perbaikan

parent 416043ba
......@@ -23,8 +23,17 @@
<input type="text" name="isbn" placeholder="ISBN" required=" " ><br>
<input type="text" name="judul" placeholder="Judul Buku" required=" " ><br>
<input type="text" name="pengarang" placeholder="Nama Pengarang" required=" " ><br>
<input type="text" name="penerbit" placeholder="Nama Penerbit" required=" " ><br>
<select class="form-control" name="kategori">
<select class="form-control" name="penerbit" required="Pilih Penerbit">
<?php
$penerbit = mysqli_query($koneksi, "SELECT * FROM t_penerbit ORDER BY id_penerbit");
while($pilih = mysqli_fetch_array($penerbit)) {
?>
<option value="<?= $pilih['id_penerbit'];?>"><i class="fa fa-arrow-right" aria-hidden="true"></i><?php echo $pilih['nama_penerbit']; ?></option>
<?php
}
?>
</select><br>
<select class="form-control" name="kategori" required="Pilih Kategori">
<?php
$kategori = mysqli_query($koneksi, "SELECT * FROM t_kategori ORDER BY id_kategori");
while($pilih = mysqli_fetch_array($kategori)) {
......@@ -37,9 +46,15 @@
<input type="text" name="tahun" placeholder="Tahun Terbit" required=" " ><br>
<input type="text" name="harga" placeholder="Harga per Eksemplar" required=" " ><br>
<input type="text" name="jumlah" placeholder="Jumlah Tersedia" required=" " ><br>
<input type="text" name="keterangan" placeholder="Keterangan Buku" required=" " ><br>
<select class="form-control" name="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>
<option value="4"><i class="fa fa-arrow-right" aria-hidden="true"></i>Rilis Terbaru</option>
</select><br>
Pilih File Gambar : <br><br>
<input type="file" name="gambar" accept="img/*" required=" ">
<input type="file" name="gambar" accept="img/*" required="Pilih file gambar">
<input type="submit" name="tambah" value="tambah">
</form>
</div>
......
......@@ -80,7 +80,7 @@
<?php
if($total != 0 && isset($_SESSION['pengunjung'])){
echo '
<tr style="background-color:#dbase_delete_record(dbase_identifier, record_number);"><td colspan="4" align="right"><b>Total :</b></td><td align="right"><b>Rp. '.number_format($total,2,",",".").'</b></tr></table>
<tr style="background-color:#dbase_delete_record(dbase_identifier, record_number);"><td colspan="5" align="right"><b>Total :</b></td><td align="right"><b>Rp. '.number_format($total,2,",",".").'</b></tr></table>
<p><div align="right">
<div class="checkout-right-basket">
<a href="allbook.php"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span>Lanjut Berbelanja</a>
......
......@@ -31,18 +31,27 @@
<b><br>Nama Pengarang :</b>
<input type="text" name="pengarang" placeholder="Nama Pengarang" value="<?php echo $data['pengarang'] ?>" required/>
<b><br>Nama Penerbit :</b>
<input type="text" name="penerbit" placeholder="Nama Penerbit" value="<?php echo $data['nama_penerbit'] ?>" required/>
<select class="form-control" name="penerbit">
<?php
$penerbit = mysqli_query($koneksi, "SELECT * FROM t_penerbit ORDER BY id_penerbit");
while($pilih = mysqli_fetch_array($penerbit)) {
?>
<option value="<?= $pilih['id_penerbit'];?>"><i class="fa fa-arrow-right" aria-hidden="true"></i><?php echo $pilih['nama_penerbit']; ?></option>
<?php
}
?>
</select><br>
<b><br>Kategori Buku :</b>
<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)) {
while($pilih = 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>
<option value="<?= $pilih['id_kategori'];?>"><i class="fa fa-arrow-right" aria-hidden="true"></i><?php echo $pilih['nama_kategori']; ?></option>
<?php
}
?>
</select>
</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>
......@@ -50,14 +59,20 @@
<b><br>Jumlah Tersedia :</b>
<input type="text" name="jumlah" placeholder="Jumlah Tersedia" value="<?php echo $data['jumlah'] ?>" required/>
<b><br>Keterangan Buku :</b>
<input type="text" name="keterangan" placeholder="Keterangan Buku" value="<?php echo $data['keterangan'] ?>" required/>
<select class="form-control" name="keterangan">
<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>
<option value="4"><i class="fa fa-arrow-right" aria-hidden="true"></i>Rilis Terbaru</option>
</select><br>
<b><br>File Gambar : <br></b>
<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="submit" name="edit" value="edit">
</form>
</form>
</div>
<div class="register-home">
<a href="processbook.php">BATAL</a>
......
......@@ -12,7 +12,6 @@
$harga = $_POST['harga'];
$jumlah = $_POST['jumlah'];
$keterangan = $_POST['keterangan'];
$gambar = $_POST['gambar'];
if($_FILES['gambar']['name']) {
move_uploaded_file($_FILES['gambar']['tmp_name'],'images/'.$judul.'.jpg');
......
......@@ -58,12 +58,9 @@
<th>ISBN</th>
<th>Judul</th>
<th>Pengarang</th>
<th>Penerbit</th>
<th>Kategori</th>
<th>Tahun</th>
<th>Harga</th>
<th>Jumlah</th>
<th>Keterangan</th>
<th>Pengelola</th>
<th>Opsi</th>
</tr>
......@@ -75,12 +72,9 @@
<td class="invert"><?php echo $data['isbn']; ?></td>
<td class="invert"><?php echo $data['judul']; ?></td>
<td class="invert"><?php echo $data['pengarang']; ?></td>
<td class="invert"><?php echo $data['penerbit']; ?></td>
<td class="invert"><?php echo $data['kategori']; ?></td>
<td class="invert"><?php echo $data['tahun']; ?></td>
<td class="invert">Rp.<?php echo number_format($data['harga'],2,",",".");?></td>
<td class="invert"><?php echo $data['jumlah']; ?></td>
<td class="invert"><?php echo $data['keterangan']; ?></td>
<td class="invert"><?php echo $data['username']; ?></td>
<td class="col-md-2">
<div class="rem">
......@@ -104,13 +98,13 @@
<?php
if( isset($_SESSION['administrator'])){
echo '
<tr><td colspan="10" align="center" style="background-color:#ffffff"><b> Tambah Data Buku </b></td>
<tr><td colspan="7" align="center" style="background-color:#ffffff"><b> Tambah Data Buku </b></td>
<td><a href="addbook.php"><img src="images/tambah.png" /></td></tr></table>
';
}
else {
echo '
<tr><td colspan="11" align="center" style="background-color:#ffffff"> Data buku kosong ! </td></tr></table>
<tr><td colspan="8" align="center" style="background-color:#ffffff"> Data buku kosong ! </td></tr></table>
';
}
?>
......
......@@ -59,9 +59,14 @@
</div>
<div class="snipcart-details top_brand_home_details">
<a href="function.php?act=add&amp;barang_id=<?php echo $data['isbn']; ?>&amp;ref=checkout.php?kd=<?php echo $data['isbn'];?>" >
<?php if ($data['jumlah'] >= 1) {
<?php
if ($data['jumlah'] == 0 || isset($_SESSION['administrator'])) {
echo '';
}
else {
echo '<input type="submit" name="simpan" value="Tambah" class="button" />';
} ?>
}
?>
</a>
</div>
</div>
......
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