perbaikan

parent 1d14fa65
......@@ -21,17 +21,17 @@
<h5>Data Buku</h5>
<?php
$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());
$data = mysqli_fetch_array($cari);
$cari = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE isbn='$id_buku'")or die(mysql_error());
while($data = mysqli_fetch_array($cari)) {
?>
<form action="editbook_process.php" method="POST" enctype="multipart/form-data">
<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'] ?>" >
<b><br>Nama Pengarang :</b>
<input type="text" name="pengarang" placeholder="Nama Pengarang" value="<?php echo $data['pengarang'] ?>" required/>
<b><br>Nama Penerbit :</b>
<select class="form-control" name="penerbit">
<b><br>Nama Pengarang :</b>
<input type="text" name="pengarang" placeholder="Nama Pengarang" value="<?php echo $data['pengarang'] ?>" >
<b><br>Nama Penerbit :</b>
<select class="form-control" name="penerbit" required="Pilih Penerbit" value="<?php echo $data['penerbit'] ?>">
<?php
$penerbit = mysqli_query($koneksi, "SELECT * FROM t_penerbit ORDER BY id_penerbit");
while($pilih = mysqli_fetch_array($penerbit)) {
......@@ -41,8 +41,8 @@
}
?>
</select><br>
<b><br>Kategori Buku :</b>
<select class="form-control" name="kategori">
<b><br>Kategori Buku :</b>
<select class="form-control" name="kategori" required="Pilih Kategori" value="<?php echo $data['kategori'] ?>">
<?php
$kategori = mysqli_query($koneksi, "SELECT * FROM t_kategori ORDER BY id_kategori");
while($pilih = mysqli_fetch_array($kategori)) {
......@@ -52,14 +52,14 @@
}
?>
</select><br>
<b><br>Tahun Terbit :</b>
<input type="text" name="tahun" placeholder="Tahun Terbit" value="<?php echo $data['tahun']; ?>" required/>
<b><br>Harga per Eksemplar :</b>
<input type="text" name="harga" placeholder="Harga per Eksemplar" value="<?php echo $data['harga'] ?>" required/>
<b><br>Jumlah Tersedia :</b>
<input type="text" name="jumlah" placeholder="Jumlah Tersedia" value="<?php echo $data['jumlah'] ?>" required/>
<b><br>Keterangan Buku :</b>
<select class="form-control" name="keterangan">
<b><br>Tahun Terbit :</b>
<input type="text" name="tahun" placeholder="Tahun Terbit" value="<?php echo $data['tahun'] ?>" >
<b><br>Harga per Eksemplar :</b>
<input type="text" name="harga" placeholder="Harga per Eksemplar" value="<?php echo $data['harga'] ?>" >
<b><br>Jumlah Tersedia :</b>
<input type="text" name="jumlah" placeholder="Jumlah Tersedia" value="<?php echo $data['jumlah'] ?>" >
<b><br>Keterangan Buku :</b>
<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="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>
......@@ -70,9 +70,12 @@
<div class="col-md-5 agileinfo_single">
<img src="<?php echo $data['gambar']; ?>" class="img-responsive" required/>
</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">
</form>
<?php
}
?>
</div>
<div class="register-home">
<a href="processbook.php">BATAL</a>
......
<?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 -->
......@@ -26,8 +28,7 @@
<div class="products">
<div class="container">
<div class="agileinfo_single">
<?php
$query = mysqli_query($koneksi, "SELECT * FROM t_buku, t_kategori, t_penerbit WHERE isbn = '$_GET[kd]'");
<?php
$data = mysqli_fetch_array($query);
?>
<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