<?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; ?>
							</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.<br>*This invoice not a finalize invoice.
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="col-md-4">
		<div class="panel panel-default">
			<div class="panel-heading"><h4>Approve</h4></div>
			<div class="panel-body">
				<div class="col-md-12">
					<form action="/member/sell/approve" method="post">
						<label>Shipping Cost</label>
						<input name="delivery_charge" class="form-control" required>
						<label>Description</label>
						<textarea rows="4" name="description" class="form-control" required></textarea><br>
						<input type="hidden" name="order_id" value="<?php echo $orderDetail->id; ?>">
						<button type="submit" class="btn btn-sm btn-warning">Approve</button>
					</form>
				</div>
			</div>
		</div>
		<hr>
		<div class="panel panel-default">
			<div class="panel-heading"><h4>Reject</h4></div>
			<div class="panel-body">
				<div class="col-md-12">
					<form action="/member/sell/reject" method="post">
						<label>Description</label>
						<textarea rows="4" name="description" class="form-control" required></textarea><br>
						<input type="hidden" name="order_id" value="<?php echo $orderDetail->id; ?>">
						<button type="submit" class="btn btn-sm btn-warning">Reject</button>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('/member/template', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>