perbaikan

parent 89583d60
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
<h5>Data Buku</h5> <h5>Data Buku</h5>
<?php <?php
$id_buku = mysqli_real_escape_string($koneksi, $_GET['id']); $id_buku = mysqli_real_escape_string($koneksi, $_GET['id']);
$cari = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE isbn='$id_buku'")or die(mysqli_error()); $cari = mysqli_query($koneksi, "SELECT * FROM t_buku, t_penerbit WHERE isbn='$id_buku'")or die(mysqli_error());
while($data = mysqli_fetch_array($cari)) { $data = mysqli_fetch_array($cari);
?> ?>
<form action="editbook_process.php" method="POST" enctype="multipart/form-data"> <form action="editbook_process.php" method="POST" enctype="multipart/form-data">
<input type="hidden" name="id" placeholder="ISBN" value="<?php echo $data['isbn'] ?>" > <input type="hidden" name="id" placeholder="ISBN" value="<?php echo $data['isbn'] ?>" >
...@@ -31,11 +31,20 @@ ...@@ -31,11 +31,20 @@
<b><br>Nama Pengarang :</b> <b><br>Nama Pengarang :</b>
<input type="text" name="pengarang" placeholder="Nama Pengarang" value="<?php echo $data['pengarang'] ?>" required/> <input type="text" name="pengarang" placeholder="Nama Pengarang" value="<?php echo $data['pengarang'] ?>" required/>
<b><br>Nama Penerbit :</b> <b><br>Nama Penerbit :</b>
<input type="text" name="penerbit" placeholder="Nama Penerbit" value="<?php echo $data['penerbit'] ?>" required/> <input type="text" name="penerbit" placeholder="Nama Penerbit" value="<?php echo $data['nama_penerbit'] ?>" required/>
<b><br>Kategori Buku :</b> <b><br>Kategori Buku :</b>
<input type="text" name="kategori" placeholder="Kategori Buku" value="<?php echo $data['kategori'] ?>" required/> <select class="form-control" name="kategori">
<?php
$kategori = mysqli_query($koneksi, "SELECT * FROM t_kategori ORDER BY id_kategori");
while($data = mysqli_fetch_array($kategori)) {
?>
<option value="<?= $data['id_kategori'];?>"><a href="categories.php?kd="><i class="fa fa-arrow-right" aria-hidden="true"></i><?php echo $data['nama_kategori']; ?></option>
<?php
}
?>
</select>
<b><br>Tahun Terbit :</b> <b><br>Tahun Terbit :</b>
<input type="text" name="tahun" placeholder="Tahun Terbit" value="<?php echo $data['tahun'] ?>" required/> <input type="text" name="tahun" placeholder="Tahun Terbit" value="<?php echo $data['tahun']; ?>" required/>
<b><br>Harga per Eksemplar :</b> <b><br>Harga per Eksemplar :</b>
<input type="text" name="harga" placeholder="Harga per Eksemplar" value="<?php echo $data['harga'] ?>" required/> <input type="text" name="harga" placeholder="Harga per Eksemplar" value="<?php echo $data['harga'] ?>" required/>
<b><br>Jumlah Tersedia :</b> <b><br>Jumlah Tersedia :</b>
...@@ -48,10 +57,7 @@ ...@@ -48,10 +57,7 @@
</div><br> </div><br>
<input type="file" name="gambar" accept="img/*" value="<?php echo $data['gambar']; ?>" required/> <input type="file" name="gambar" accept="img/*" value="<?php echo $data['gambar']; ?>" required/>
<input type="submit" name="edit" value="edit"> <input type="submit" name="edit" value="edit">
</form> </form>
<?php
}
?>
</div> </div>
<div class="register-home"> <div class="register-home">
<a href="processbook.php">BATAL</a> <a href="processbook.php">BATAL</a>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<!-- breadcrumbs --> <!-- breadcrumbs -->
<div class="breadcrumbs"> <div class="breadcrumbs">
<div class="container"> <div class="container">
<?php <!-- <?php
if(isset($_POST['cari'])){ if(isset($_POST['cari'])){
$cari = $_POST['search']; $cari = $_POST['search'];
$sql = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE judul LIKE '%$cari%' ORDER BY isbn"); $sql = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE judul LIKE '%$cari%' ORDER BY isbn");
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
</button> </button>
<div class="clearfix"></div> <div class="clearfix"></div>
</form> </form>
</div> </div> -->
</div> </div>
</div> </div>
<!-- //breadcrumbs --> <!-- //breadcrumbs -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment