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

<!-- breadcrumbs -->
	<div class="breadcrumbs">
		<div class="container">
			<ol class="breadcrumb breadcrumb1 animated wow slideInLeft" data-wow-delay=".5s">
				<?php
	                if (isset($_SESSION['pengunjung'])) {
					    echo '
						<li><span><i class="fa fa-sign-in" aria-hidden="true"></i><a href="login.php"> Masuk</a></span></li>
						<li class="active">Daftar Penerbit</li> ';
					}
					else {
						echo '
						<li><a href="index.php"><span class="glyphicon glyphicon-home" aria-hidden="true"></span>Beranda</a></li>
						<li class="active">Daftar Penerbit</li> ';
					}
				?>
			</ol>
		</div>
	</div>
<!-- //breadcrumbs -->
<!-- groceries -->
	<div class="products">
		<div class="container">
			<div class="col-md-4 products-left">
				<div class="categories">
					<h2>PENERBIT</h2>
					<ul class="cate">
					<?php
						$sql = mysqli_query($koneksi, "SELECT * FROM t_penerbit ORDER BY id_penerbit");
						while($data = mysqli_fetch_array($sql)){
					?>
						<li><a href="publisher.php?kd=<?php echo $data['id_penerbit'];?>"><i class="fa fa-arrow-right" aria-hidden="true"></i><?php echo $data['nama_penerbit']; ?></a></li>
					<?php   
			      		}
			      	?>
					</ul>
				</div>																																												
			</div>
			<div class="col-md-8 products-right">
				<div class="agile_top_brands_grids">
						<?php
							$id= $_GET['kd'];
							$sql = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE penerbit='$id' ORDER BY isbn");
							while($data = mysqli_fetch_array($sql)){
						?>
						<div class="col-md-4 top_brand_left">
							<div class="hover14 column">
								<div class="agile_top_brand_left_grid">
								<?php 
									if ($data['keterangan'] != 1) {
										echo '<div class="agile_top_brand_left_grid_pos">
												<img src="images/offer.png" alt=" " class="img-responsive">
											</div>';
										}
								?>
									<div class="agile_top_brand_left_grid1">
										<figure>
											<div class="snipcart-item block" >
												<div class="snipcart-thumb">
														<a href="singlebook.php?kd=<?php echo $data['isbn'];?>"><img class="col-md-12" title="Klik Disini" src="<?php echo $data['gambar']; ?>" /></a>
													<br>
													<center><h5><?php echo $data['judul']; ?></h5></center>
													<center><h5><?php echo $data['pengarang']; ?></h5></center>
													<center><h5><?php echo $data['tahun']; ?></h5></center>
													<center><h5>Rp.<?php echo number_format($data['harga'],2,",",".");?></h5></center>
												</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'];?>">
													<input type="submit" name="simpan" value="Tambah" class="button" />
												</div>
											</div>
										</figure>
									</div>
								</div>
							</div>
							<br>	
						</div>
					<?php   
			      		}
			      	?>
					<div class="clearfix"> </div>
				</div>
			</div>
			<div class="clearfix"> </div>
		</div>
	</div>
<!--- groceries --->

<?php
	include 'footer.php';
?>