<!DOCTYPE html>
<?php
                $nobukti = $this->session->userdata('nobukti');
                $torder = 0;
                $ord = $this->db->query("select sum(qty) as torder from tbl_belanja_detail where nobukti='$nobukti';");
                if ($ord->num_rows() > 0) {
                    $ordd = $ord->row_array();
                    $torder = $ordd['torder'];
                    if ($torder == null) {
                        $torder = 0;
                    }
                }
                ?>
<html>
	<head>
		<meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
		<meta name="keywords" content="Djoedes by enambelasapp.my.id">
		<meta name="author" content="Suroto">
		<meta name="description" content="Djoedes by enambelasapp.my.id">
		<meta name="viewport" content="width=device-width initial-scale=1.0 maximum-scale=1.0 user-scalable=yes" />

		<title>Keranjang Belanja</title>
		<link href="<?php echo base_url().'assets/img/logo.png'?>" rel="shortcut icon" type="image/x-icon">

		<link type="text/css" rel="stylesheet" href="<?php echo base_url().'mobile/css/jquery.mmenu.all.css'?>" />
		<link type="text/css" rel="stylesheet" href="<?php echo base_url().'mobile/css/style.css'?>" />

		<link rel="apple-touch-icon" href="img/apple-touch-icon.png">
		<link rel="apple-touch-startup-image" href="img/apple-touch-startup-image.png">
		
		<script type="text/javascript" src="<?php echo base_url().'mobile/js/jquery.min.js'?>"></script>
		<script type="text/javascript" src="<?php echo base_url().'mobile/js/jquery.mmenu.min.all.js'?>"></script>
		<script type="text/javascript" src="<?php echo base_url().'mobile/js/jquery.easy-pie-chart.js'?>"></script>
		<script type="text/javascript" src="<?php echo base_url().'mobile/js/o-script.js'?>"></script>
		
	</head>
	<body class="o-page" style="background-color:#fff;">
		<!--<div id="page">-->
			<div id="header">
				<div class="header-content">
					<a href="#menu" class="p-link-home"><i class="fa fa-bars"></i></a>
					<a href="javascript:history.back();" class="p-link-back"><i class="fa fa-arrow-left"></i></a>
				</div>
				</div>
			<!--</div>-->
			<div class="bannerPane banner-bg">
				<div class="overlay"></div>
				<div class="s-banner-content">
					Keranjang Belanja
				</div>
			</div>
			<div id="content">
				
				<article>
					
					<div class="prod-single-content">
						<table style="width:100%">
							<thead>
							<tr>
								<th style="text-align:center;">Menu</th>
								<th style="text-align:center;">Order</th>
								<th style="text-align:center;">Harga</th>
								<th style="text-align:center;">Total</th>
							</tr>
							<thead>
							<tbody>
							<form action="<?php echo base_url().'mobile/menu/update/'?>" method="post">
							<?php $i = 1; ?>
							<?php foreach ($this->cart->contents() as $items): ?>
								<?php echo form_hidden($i.'[rowid]', $items['rowid']); ?>

								<tr>
									<td><?=$items['name'];?></td>
									<td style="padding:0px;width:15%"><input type="number" name="<?php echo $i.'[qty]'?>" value="<?php echo number_format($items['qty']);?>" min="1"></td>
									<td style="text-align:center;"><?php echo number_format($items['subtotal']);?></td>
									<td style="text-align:center;"><a href="<?php echo base_url().'mobile/menu/remove/'.$items['rowid'];?>" style="text-decoration:none;">X</a></td>
								</tr>
							<?php $i++; ?>
							<?php endforeach; ?>
							</tbody>
							<tfoot>
								<tr>
									<th style="text-align:left;" colspan="2">Total</th>
									<th style="text-align:center;"><?php echo number_format($this->cart->total());?></th>
									<th></th>
								</tr>
							</tfoot>
						</table>
						<button type="submit" class="o-buttons blue" style="border:none;height:32px;">Update Keranjang</button>
						<?php if ($torder == null) { ?>
						<a style="text-decoration:none;" class="o-buttons red pull-right">Check Out</a>
						<?php } else { ?>
                        <a href="<?php echo base_url().'mobile/menu/check_out1'?>" style="text-decoration:none;" class="o-buttons red pull-right">Check Out</a>
                    <?php } ?>
						</form>
					</div>
					<div class="notifications info">
						<p style="text-align:justify;">Jika jumlah porsi yang Anda inginkan lebih dari satu. Tambahkan jumlah posrsi sesuai dengan yang Anda inginkan dan klik tombol <b>Update Keranjang</b>.</p> 
						<p style="text-align:justify;"><b>Ada lagi Pesanannya?</b><a href="<?php echo base_url().'mobile/menu/hotpromo'?>"><button type="submit" class="o-buttons green" style="border:none;height:32px;"><b>Tambah</b></button></a></p>
					</div>
				</article>

			</div>
			
			
			<!-- Menu navigation -->
			<nav id="menu">
				<ul>
					<li class="Selected">
						<a href="#close">
							<i class="fa fa-times-circle"></i>
						</a>
					</li>
					<li>
						<a href="<?php echo base_url().'mobile/menu/allmenu'?>">
							<i class="fa fa-home"></i>Home
						</a>
					</li>
					<li>
						<a href="<?php echo base_url().'mobile/menu/belanja'?>">
							<i class="fa fa-shopping-cart"></i>Keranjang Belanja (<?=$torder?>)
						</a>
					</li>
				
					
					<li>
						<a href="<?php echo base_url().'mobile/tracker'?>">
							<i class="fa fa-crosshairs"></i>Tracker
						</a>
					</li>
					<li>
						<a href="<?php echo base_url().'mobile/member/register'?>">
							<i class="fa fa-user"></i>Mendaftar
						</a>
					</li>
					<li>
						<a href="<?php echo base_url().'mobile/gallery'?>">
							<i class="fa fa-camera-retro"></i>Gallery
						</a>
					</li>
					
					
					<?php if($this->session->userdata('online') == TRUE):?>
					<li>
						<a href="<?php echo base_url().'mobile/konfirmasi'?>">
							<i class="fa fa-exchange"></i>Konfirmasi
						</a>
					</li>
				
					<li>
						<a href="<?php echo base_url().'mobile/myfood'?>">
							<i class="fa fa-cutlery"></i>My Food
						</a>
					</li>

					<li>
						<a href="<?php echo base_url().'mobile/member/logout'?>">
							<i class="fa fa-sign-out"></i>Logout
						</a>
					</li>
					<?php else:?>
					<li>
						<a href="<?php echo base_url().'mobile/member'?>">
							<i class="fa fa-sign-in"></i>Login
						</a>
					</li>
					<?php endif;?>
				</ul>
					
			</nav>

	
	</body>
</html>