-
Notifications
You must be signed in to change notification settings - Fork 0
/
input_penerbit.php
116 lines (105 loc) · 3.56 KB
/
input_penerbit.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
include 'koneksi.php';
session_start();
if (!isset($_SESSION['username'])){
header ("location:login.php");
}
$sql = "SELECT * FROM mpenerbit WHERE status = 1";
$item = mysqli_query($conn, $sql);
$proses = $_GET['proses'];
if ($proses =="update"){
$id = $_GET['idPenerbit'];
$qu = "SELECT * FROM mpenerbit WHERE id = $id";
$data = mysqli_query($conn, $qu);
$d = mysqli_fetch_array($data);
$nama = $d['namaPenerbit'];
$status = $d['status'];
} else {
$id ="";
$nama = "";
$status = "";
}
?>
<html>
<head>
<title>PERPUSTAKAAN</title>
<link rel="stylesheet" type="text/css" href="assets/css/app.css">
</head>
<body>
<div class="card">
<div class="card-body">
<style type="text/css">
.pagination li{
float: left;
list-style-type: none;
margin: 5px;
}
</style>
<h1>Sistem Informasi Perpustakaan</h1>
<div class="form-grup"></div>
</form>
<a href="anggota.php" class="btn btn-primary ml-1" style="text-decoration: none;">Anggota</a>
<a href="buku.php" class="btn btn-primary ml-1" style="text-decoration: none;">Buku</a>
<a href="petugas.php" class="btn btn-primary ml-1" style="text-decoration: none;">Petugas</a>
<a href="pinjam.php" class="btn btn-primary ml-1" style="text-decoration: none;">Peminjaman Buku</a>
<a href="pengembalian.php" class="btn btn-primary ml-1" style="text-decoration: none;">Pengembalian Buku</a>
<br>
<br>
<tr>
<td width="500" align="center">
<form method="POST" action="proses_penerbit.php">
<table border="0">
</td>
</tr>
<tr>
<td>Penerbit</td>
<td>:</td>
<td>
<select name="penerbit" id="" onchange="changeValue(this.value)">
<option value="add" selected="">--Tambah Penerbit--</option>
<?php
$jsArray = "var prdName = new Array();\n";
while ($data=mysqli_fetch_array($item)) {
echo '<option value="'.$data['idPenerbit'].'">'.$data['namaPenerbit'].'</option> ';
$jsArray .= "prdName['" . $data['idPenerbit'] . "'] = {nama:'" . addslashes($data['namaPenerbit']) . "'};\n";
}
?>
</select>
</td>
</tr>
<tr>
<td></td>
<td></td>
<td><input type="text" name="namaPenerbit" id="namaPenerbit"></td>
</tr>
<tr>
<td><input type="hidden" name="id" value=<?php echo $id ?>></td>
<td><input type="hidden" name="proses" value=<?php echo $proses ?>></td>
</tr>
<tr>
<td><input type="submit" name="simpan" value="Simpan"></td>
<td></td>
<td><input type="submit" name="simpan" value="Hapus"></td>
</tr>
</tr>
</table>
<script type="text/javascript">
<?php echo $jsArray; ?>
function changeValue(x){
document.getElementById('namaPenerbit').value = prdName[x].nama;
};
</script>
</form>
<tr>
<td colspan="2" align="right">
<button>
<a href="daftar.php" style="text-decoration:none;">Daftar</a>
</button>
<button>
<a href="logout.php" style="text-decoration:none;">Logout</a>
</button>
</td>
</tr>
</table>
</body>
</html>