<?php
	require_once("koneksi.php");
    include 'header.php';
?>

	<!-- breadcrumbs -->
		<div class="breadcrumbs">
			<div class="container">
				<ol class="breadcrumb breadcrumb1">
					<li><span><i class="fa fa-sign-in" aria-hidden="true"></i><a href="login.php"> Masuk</a></span></li>
					<li class="active">Form Kelola Buku</li>
				</ol>
			</div>
		</div>
	<!-- //breadcrumbs -->
	<!-- register -->
		<div class="register">
			<div class="container">
				<h2>Edit Data Buku</h2>
				<div class="login-form-grids">
					<h5>Data Buku</h5>
					<?php
					$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());
					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>
						<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'] ?>" >
						<b><br>Nama Penerbit 	:</b>
						<input type="text" name="penerbit" placeholder="Nama Penerbit" value="<?php echo $data['penerbit'] ?>" >
						<b><br>Kategori Buku	:</b>
						<input type="text" name="kategori" placeholder="Kategori Buku" value="<?php echo $data['kategori'] ?>" >
						<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>
						<input type="text" name="keterangan" placeholder="Keterangan Buku" value="<?php echo $data['keterangan'] ?>" >
						<b><br>Gambar 			: <br><br></b>
						<input type="file" name="gambar" accept="img/*" value="<?php echo $data['gambar'] ?>" >
						<input type="submit" name="edit" value="edit">
					</form>
					<?php 
						}
					?>
				</div>
				<div class="register-home">
					<a href="processbook.php">BATAL</a>
				</div>
			</div>
		</div>
	<!-- //register -->
	
<?php
	include 'footer.php';
?>