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

<!-- checkout -->
	<div class="checkout">
		<div class="container">
			<center><h2>TERIMAKASIH TELAH BERBELANJA DI TOKO BUKU CEMERLANG</h2></center>	
			
			<div class="col-md-12 checkout-left">	
				<div class="checkout-left-basket">
					<h4>Struk Pemesanan</h4>
					<?php
						$total = 0;
						if (isset($_SESSION['items'])) {
						    foreach ($_SESSION['items'] as $key => $val) {
						        $query = mysqli_query($koneksi, "SELECT * FROM t_buku WHERE isbn = '$key'");
							    $data = mysqli_fetch_array($query);							   

							    $jumlah_harga = $data['harga'] * $val;
							    $total += $jumlah_harga;
							    $no = 1;
					?>
					<ul>
						<li><?php echo $data['judul']; ?><i> - </i> <span>Rp.<?php echo number_format($data['harga'],2,",",".");?></span></li>
					<?php
							}
					?>
						<li>Potongan Harga<span> - </span></li>
						<li>Total Harga <i>-</i> <span>Rp.<?php echo number_format($total); ?>,00</span></li>
					</ul>
					<?php
						}
					?>
					<!-- <form action="savebook_process.php" method="POST">
					<input type="hidden" name="id_user" value="<?php $_GET['id_user'];?>">
					<input type="hidden" name="isbn" value="<?php $_GET['isbn'];?>">
					<input type="hidden" name="total" value="<?php $_GET['total'];?>">
					<input type="submit" name="pesan" value="Simpan Pesanan">
					</form> -->
				</div>
				<div class="col-md-8">
					Pembayaran dapat dilakukan dengan menghubungi kontak dibawah ini :
				</div>
				<div class="col-md-6 w3_footer_grid">
					<ul class="address">
						<li><i class="glyphicon glyphicon-map-marker" aria-hidden="true"></i>Jl. Sisingamangaraja No. 146,Balige II, Balige, Toba Samosir</span></li>
						<li><i class="glyphicon glyphicon-envelope" aria-hidden="true"></i><a href="mailto:cemerlang@gmail.com">cemerlang@gmail.com</a></li>
						<li><i class="glyphicon glyphicon-earphone" aria-hidden="true"></i>(0632) 21510</li>
					</ul>
				</div>
				<div class="clearfix"> </div>
			</div>
		</div>
	</div>
<!-- //checkout -->

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