<?php $__env->startSection('body'); ?>
<div class="row">

	<div class="col-md-12">
		<h3>Order Confirmation</h3>
		<hr>
		<?php if($company): ?>
		<div class="col-md-8">
			<form action="/member/buy/confirm-order" method="post">
				<div class="panel-body" style="border:solid 1px #eee">
					<div class="col-md-2"><img src="/img-logo/<?php echo $company->shop_logo; ?>"></div>
					<div class="col-md-4">
						<h4><?php echo $company->shop_name; ?></h4>
						<h5><?php echo $company->shop_address; ?><br><?php echo $company->officephone; ?></h5>
					</div>
					<div class="col-md-12"><hr style="border:solid 1px #eee"></div>
					<div class="col-md-4">
						<h5 style="margin-top:0px"><b><?php echo Auth::user()->name; ?></b><br><?php echo Auth::user()->profile->address; ?></h5>
					</div>
					<div class="col-md-8 right top">
						<h5 style="margin-top:0px"><?php echo date('d-m-Y'); ?></h5>
					</div>
					<div class="col-md-12">
						<h4 class="center">INVOICE</h4>
						<br>
						<table class="table table-condensed table-bordered">
							<thead>
								<tr>
									<th class="center">#</th>
									<th class="center">Product Code</th>
									<th class="center">Description</th>
									<th class="center">Quantity</th>
									<th class="center">Unit Price</th>
									<th class="center">Amount</th>
								</tr>
							</thead>
							<tbody>
								<?php $i=1; $amount=$total=0;?>
								<?php foreach($carts as $cart): ?>
								<?php $amount = $cart->product->sale_price * $cart->quantity; ?>
								<tr>
									<td class="center"><?php echo $i++; ?></td>
									<td class="center"><?php echo $cart->product_id; ?></td>
									<td ><?php echo $cart->product->name; ?></td>
									<td class="center"><?php echo $cart->quantity; ?></td>
									<td class="right"><?php echo $cart->product->sale_price; ?></td>
									<td class="right"><?php echo $amount; ?><?php $total += $amount; ?></td>
									<input type="hidden" name="cart_id[]" value="<?php echo $cart->id; ?>">
								</tr>
								<?php endforeach; ?>
							</tbody>
							<thead>
								<tr>
									<th colspan="5" class="right">Total Price</th>
									<th class="right"><?php echo $total; ?></th>
								</tr>
							</thead>
						</table>
						<div class="asterisk">*Total Price exclude delivery charge.</div>
					</div>
					<div class="col-md-12 center">
						<h6>
							Please check order status in 24 hours after confirmation.
							<br>Thank You for Shopping with Us.
						</h6>
					</div>
				</div>
				<br>
				<button type="submit" class="btn btn-warning pull-right" onclick="return confirm('I have read all the notices and agree all term and conditon.')">Confirm Order</button>
			</form>
		</div>
		<?php else: ?>
		<div class="col-md-8">
			No Order
		</div>
		<?php endif; ?>
		<div class="col-md-4">
			<div class="panel panel-default">
				<div class="panel-heading"><h4>Notice</h4></div>
				<div class="panel-body">
					<ol>
						<li><?php echo $company->shop_name; ?>'s <a href="/tnc/<?php echo $company->id; ?>" target="_blank">Term &amp; Condition</a></li>
						<li>Kounimap's <a href="">Term &amp; Condition</a></li>
					</ol>
				</div>
			</div>
		</div>


	</div><!-- end col 12 -->

</div><!-- end row -->

<?php $__env->stopSection(); ?>
<?php echo $__env->make('template', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>