<?php $__env->startSection('body2'); ?>

<h3>Order Details</h3>
<hr>
<div class="row">
	<div class="col-md-8">
		<div class="panel panel-default">
			<div class="panel-heading"><h4>Invoice</h4></div>
			<div class="panel-body">
				<div class="panel-body" style="border:solid 1px #eee">
					<div class="col-md-2"><img src="/img-logo/<?php echo $orderDetail->profile->shop_logo; ?>"></div>
					<div class="col-md-4">
						<h4><?php echo $orderDetail->profile->shop_name; ?></h4>
						<h5><?php echo $orderDetail->profile->shop_address; ?><br><?php echo $orderDetail->profile->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 $orderDetail->user->name; ?></b><br><?php echo $orderDetail->user->profile->address; ?></h5>
					</div>
					<div class="col-md-8 right top">
						<h5 style="margin-top:0px"><?php echo $orderDetail->orderStatus[0]->tarikh; ?></h5>
					</div>
					<div class="col-md-12">
						<h4 class="center">INVOICE</h4>
						<br>
						<span class="pull-right"><b>Order ID : <?php echo $orderDetail->user_id; ?>/<?php echo $orderDetail->id; ?></b></span>
						<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($orderDetail->orderDetails as $detail): ?>
								<?php $amount = $detail->unit_price * $detail->quantity; ?>
								<tr>
									<td class="center"><?php echo $i++; ?></td>
									<td class="center"><?php echo $detail->product_id; ?></td>
									<td ><?php echo $detail->product->name; ?></td>
									<td class="center"><?php echo $detail->quantity; ?></td>
									<td class="right"><?php echo $detail->unit_price; ?></td>
									<td class="right"><?php echo $amount; ?><?php $total += $amount; ?></td>
								</tr>
								<?php endforeach; ?>
								<tr>
									<td class="center"><?php echo $i++; ?></td>
									<td class="center">-</td>
									<td>Shipping charge</td>
									<td class="center">-</td>
									<td class="center">-</td>
									<td class="right"><?php echo $orderDetail->delivery_charge; ?>
										<?php $total += $orderDetail->delivery_charge; ?>
									</td>
								</tr>
							</tbody>
							<thead>
								<tr>
									<th colspan="5" class="right">Total Price</th>
									<th class="right"><?php echo $total; ?></th>
								</tr>
							</thead>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="col-md-4">
		<div class="panel panel-default">
			<div class="panel-heading"><h4>Status</h4></div>
			<div class="panel-body">
				<div class="col-md-12">
					<div class="form-horizontal">
						<div class="form-group">
							<label class="col-md-6">Status</label>
							<div class="col-sm-6"><?php echo $orderDetail->latestStatus->status; ?></div>
						</div>
						<div class="form-group">
							<label class="col-md-6">Date</label>
							<div class="col-sm-6"><?php echo $orderDetail->latestStatus->tarikh; ?></div>
						</div>
						<div class="form-group">
							<label class="col-md-6">Product Rating</label>
							<div class="col-sm-6">
								<?php for($i=1; $i<=$orderDetail->rating_product; $i++): ?>
								<span class="fa fa-star"></span>
								<?php endfor; ?>
							</div>
						</div>
						<div class="form-group">
							<label class="col-md-6">Shop Rating</label>
							<div class="col-sm-6">
								<?php for($i=1; $i<=$orderDetail->rating_store; $i++): ?>
								<span class="fa fa-star"></span>
								<?php endfor; ?>
							</div>
						</div>
						<div class="form-group">
							<label class="col-md-6">Feedback</label>
							<div class="col-sm-6"><?php echo $orderDetail->feedback; ?></div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('/member/template', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>