<?php
	include 'koneksi.php';
	include 'common/header.php';
?>
	<h3> <span class="glyphicon glyphicon-credit-card"></span> Menu Pembayaran </h3>
	<br/> <hr/>
	
	<?php
		global $total;
		$member_id = $_GET['id_member'];
		$query = mysqli_query($koneksi, "SELECT menu.nama AS nama_menu, menu.harga, pemesanan.jumlah FROM menu 
		INNER JOIN (pemesanan INNER JOIN member ON member_id = id_member) ON menu_id= id_menu WHERE member_id= '$id_member'");
		while($row = mysqli_fetch_assoc($query)){
			$jumlah = $row['jumlah'] * $row['harga'];
			$total = $total += $jumlah;
		}
	?>
	
	<div class="col-md-12" align="center">
		<h3> Terimakasih telah memesan </h3>
		<div> Pesanan anda sebesar Rp. <?= $total?>,- <br> 
			Silahkan Kirim uang dengan nominal tertera ke No. Rekening 0413- XXX. <br>
		</div>
		<br> <br>
		<div>
			Setelah mengirim uang upload bukti pengiriman :<br>
			<form action="selesai.php?id_member=<?= $member_id?>" method="post" enctype="multipart/form-data">
				<input type="file" name="bukti">
				<input type="submit" class="btn btn-info" value="Upload">
			</form>
			<br>
			<?php
				$kueri = mysqli_query($koneksi, "SELECT * FROM pembayaran WHERE member_id = '$member_id'");
				$bukti = mysqli_fetch_array($kueri);
				if($bukti['bukti'] != NULL){
			?>
			<img src="picture/<?php $bukti['bukti']?>" class="img img-rounded" width="250" height="250">
				<?php 
				} else{
					echo 'Gambar Bukti Belum di Upload!';
					}
				?>
			<br>
		</div>
		<br>
	</div>

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