perbaikan

parent 1d14fa65
...@@ -21,17 +21,17 @@ ...@@ -21,17 +21,17 @@
<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, t_penerbit WHERE isbn='$id_buku'")or die(mysqli_error()); $cari = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE isbn='$id_buku'")or die(mysql_error());
$data = mysqli_fetch_array($cari); while($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'] ?>" >
<b>Judul Buku : </b> <b>Judul Buku : </b>
<input type="text" name="judul" placeholder="Judul Buku" value="<?php echo $data['judul'] ?>" > <input type="text" name="judul" placeholder="Judul Buku" value="<?php echo $data['judul'] ?>" >
<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'] ?>" >
<b><br>Nama Penerbit :</b> <b><br>Nama Penerbit :</b>
<select class="form-control" name="penerbit"> <select class="form-control" name="penerbit" required="Pilih Penerbit" value="<?php echo $data['penerbit'] ?>">
<?php <?php
$penerbit = mysqli_query($koneksi, "SELECT * FROM t_penerbit ORDER BY id_penerbit"); $penerbit = mysqli_query($koneksi, "SELECT * FROM t_penerbit ORDER BY id_penerbit");
while($pilih = mysqli_fetch_array($penerbit)) { while($pilih = mysqli_fetch_array($penerbit)) {
...@@ -41,8 +41,8 @@ ...@@ -41,8 +41,8 @@
} }
?> ?>
</select><br> </select><br>
<b><br>Kategori Buku :</b> <b><br>Kategori Buku :</b>
<select class="form-control" name="kategori"> <select class="form-control" name="kategori" required="Pilih Kategori" value="<?php echo $data['kategori'] ?>">
<?php <?php
$kategori = mysqli_query($koneksi, "SELECT * FROM t_kategori ORDER BY id_kategori"); $kategori = mysqli_query($koneksi, "SELECT * FROM t_kategori ORDER BY id_kategori");
while($pilih = mysqli_fetch_array($kategori)) { while($pilih = mysqli_fetch_array($kategori)) {
...@@ -52,14 +52,14 @@ ...@@ -52,14 +52,14 @@
} }
?> ?>
</select><br> </select><br>
<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'] ?>" >
<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'] ?>" >
<b><br>Jumlah Tersedia :</b> <b><br>Jumlah Tersedia :</b>
<input type="text" name="jumlah" placeholder="Jumlah Tersedia" value="<?php echo $data['jumlah'] ?>" required/> <input type="text" name="jumlah" placeholder="Jumlah Tersedia" value="<?php echo $data['jumlah'] ?>" >
<b><br>Keterangan Buku :</b> <b><br>Keterangan Buku :</b>
<select class="form-control" name="keterangan"> <select class="form-control" name="keterangan" value="<?php echo $data['keterangan'] ?>" required>
<option value="1"><i class="fa fa-arrow-right" aria-hidden="true"></i>Tidak ada penawaran khusus</option> <option value="1"><i class="fa fa-arrow-right" aria-hidden="true"></i>Tidak ada penawaran khusus</option>
<option value="2"><i class="fa fa-arrow-right" aria-hidden="true"></i>Penjualan Terbaik</option> <option value="2"><i class="fa fa-arrow-right" aria-hidden="true"></i>Penjualan Terbaik</option>
<option value="3"><i class="fa fa-arrow-right" aria-hidden="true"></i>Potongan Harga</option> <option value="3"><i class="fa fa-arrow-right" aria-hidden="true"></i>Potongan Harga</option>
...@@ -70,9 +70,12 @@ ...@@ -70,9 +70,12 @@
<div class="col-md-5 agileinfo_single"> <div class="col-md-5 agileinfo_single">
<img src="<?php echo $data['gambar']; ?>" class="img-responsive" required/> <img src="<?php echo $data['gambar']; ?>" class="img-responsive" required/>
</div><br> </div><br>
<input type="file" name="gambar" accept="img/*" value="<?php echo $data['gambar']; ?>" required/> <input type="file" name="gambar" accept="img/*" 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>
......
<?php <?php
require_once("koneksi.php"); require_once("koneksi.php");
include 'header.php'; include 'header.php';
global $query;
$query = mysqli_query($koneksi, "SELECT * FROM t_buku, t_kategori, t_penerbit WHERE isbn = '$_GET[kd]'");
?> ?>
<!-- breadcrumbs --> <!-- breadcrumbs -->
...@@ -26,8 +28,7 @@ ...@@ -26,8 +28,7 @@
<div class="products"> <div class="products">
<div class="container"> <div class="container">
<div class="agileinfo_single"> <div class="agileinfo_single">
<?php <?php
$query = mysqli_query($koneksi, "SELECT * FROM t_buku, t_kategori, t_penerbit WHERE isbn = '$_GET[kd]'");
$data = mysqli_fetch_array($query); $data = mysqli_fetch_array($query);
?> ?>
<div class="col-md-2 agileinfo_single_left"> <div class="col-md-2 agileinfo_single_left">
......
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