<?php //p($_SESSION); ?>
	<div class="mobile-banner-wrap relative">
		<div class="layer"></div>
		<img class="mobile-banner" src="<?= base_url('assets/images/banner-5-mobile.jpg') ?>"></div>
	<div id="parallax-wrap" class="parallax-search" data-parallax="scroll" data-position="center" data-bleed="10" data-image-src="/assets/images/banner-5.jpg">
		<div class="search-wraps">
			<?php if ($_SESSION['orderconfirmData']) { ?>
				<h1>Confirm Order</h1><p>please review your order below</p>
			<?php } else { ?>
				<h1>oops something went wrong</h1>
			<?php } ?>
		</div> <!--search-wraps--></div> <!--parallax-container-->
	<div class="order-progress-bar conf-order-progress">
		<div class="container">
			<div class="row">

				<div class="col-md-2 col-xs-2"><a class="active " href="<?= base_url('menu'); ?>"> Create your order</a>
				</div>
				<div class="col-md-2 col-xs-2 ">
					<a class="active " href="<?= base_url('paymentoption') ?>">Payment information</a></div>
				<div class="col-md-2 col-xs-2 " style="display:none;"><a class="active current " href="javascript:;" >Confirm Order</a></div>
				<div class="col-md-2 col-xs-2 "><a class="inactive " href="javascript:;">Receipt</a></div>
			</div><!-- row--> </div> <!--container-->
		<div class="border progress-dot mytable">
			<a href="https://foodkoko.com.ng/store" class="mycol selected"><i class="ion-record"></i></a>
			<a href="javascript:;" class="mycol selected"><i class="ion-record"></i></a>
			<a href="javascript:;" class="mycol selected"><i class="ion-record"></i></a>
			<a href="javascript:;" class="mycol selected"><i class="ion-record"></i></a></div> <!--end progress-dot-->
	</div> <!--order-progress-bar-->
	<?php if ($_SESSION['orderconfirmData'] && isset($cart['data'])) { ?>
	<form id="frm-delivery" class="frm-delivery has-validation-callback" method="POST" action="order/place_order">


		<div class="sections section-grey2 section-confirmorder">
			<?php if ($this->session->flashdata('error')) { ?>
				<div class="alert alert-danger">
					<?= $this->session->flashdata('error') ?>.
				</div>
			<?php unset($_SESSION['error']);  
			} ?>
			<div class="container" style="transform: none;">
				<div class="row" style="transform: none;">
					<div class="col-md-7">
						<div class="box-grey rounded">
							<div class="section-label"><a class="section-label-a">
									<span class="bold"> <?= (isset($_SESSION['deliveryData']['transaction_type']) && $_SESSION['deliveryData']['transaction_type']=='delivery')?'Delivery information':'Pickup information';?> </span> <b></b> </a>
							</div>
							<table class="table-order-details">
								<tbody>
								<tr>
									<td class="a">Merchant Name</td>
									<td class="b">:<?= @$cart['merchant']['restaurant_name']; ?></td>
								</tr>
								<tr>
									<td class="a"><?= (isset($_SESSION['deliveryData']['transaction_type']) && $_SESSION['deliveryData']['transaction_type']=='delivery')?'Delivery Date':'Pickup Date';?></td>
									<td class="b">: <?= @$_SESSION['orderconfirmData']['delivery_date'] ?></td>
								</tr>
								<tr>
									<td class="a"><?= isset($_SESSION['orderconfirmData']['delivery_asap'])?'Delivery ASAP':(isset($_SESSION['deliveryData']['transaction_type']) && $_SESSION['deliveryData']['transaction_type']=='delivery')?'Delivery Time':'Pickup Time'; ?></td>
									<td class="b">:<?= isset($_SESSION['orderconfirmData']['delivery_asap'])?'Yes':@$_SESSION['orderconfirmData']['delivery_time']  ?></td>
								</tr>
								</tbody>
							</table>
							
						
								<?php if(isset($_SESSION['deliveryData']['transaction_type']) && $_SESSION['deliveryData']['transaction_type']=='delivery') { ?>
								<div class="section-label">
								<a class="section-label-a">
									<span class="bold">Delivery Address</span> <b></b>
								</a></div><?php } ?>
							<p class="spacer3"><?= $_SESSION['address']['street'] . $_SESSION['address']['city'] . $_SESSION['address']['state'] . $_SESSION['address']['zipcode']; ?> </p>
							<div class="section-label"><a class="section-label-a">
									<span class="bold"> Payment Information</span> <b></b> </a></div>
							<p> <?= $_SESSION['orderconfirmData']['payment_provider']; ?></p>
							<p class="text-muted text-small"></p>
							<p></p>
						</div><!-- box-grey--> <a href="order/payment_option">
							<i class="ion-ios-arrow-thin-left"></i> Back </a></div> <!--col-->
					<div class="col-md-5 sticky-div" style="position: relative; overflow: visible; box-sizing: border-box; min-height: 1px;">  <!--box-grey sticky-div-->
						<div class="theiaStickySidebar" style="padding-top: 1px; padding-bottom: 1px; position: static;">
							<div class="box-grey rounded relative top-line-green">
								<i class="order-icon your-order-icon"></i>
                                <img alt="order-basket" src="assets/images/pickup_iconNew.png" style="width: 60px;position: absolute;top: 5px;">
								<div class="order-list-wrap">
									<p class="bold center">Your Order</p>
									<div class="item-order-wrap">
										<?php
										//p($_SESSION);
										foreach ($cart['data']['item'] as $key => $order) { 
										
										if($order['size_words']){
				$size_words='('.$order['size_words'].')';
				}else{
					$size_words='';
				}?>
											<div class="item-order-list item-row cust-item<?= $key; ?>"><p style="margin:0;">
												</p>
												<div class="a"></div>
                                            <div class="b uk-text-success"><?= $order['category_name'];  ?></div>
												<div class="a"><?= $order['qty']; ?></div>
												<div class="b"><?= $order['item_name'].$size_words; ?><p class="uk-text-small">
														<span class="base-price"><?= $_SESSION['settings']['currency_symbol'].$order['normal_price']; ?></span>
													</p>
                                                    <p class="small text-info"><?= $order['order_notes']; ?></p>
													<p class="small ingredients-label"><?= $order['cooking_ref']; ?></p>
                                                </div>
												<div class="manage">
													<div class="d"><?= $_SESSION['settings']['currency_symbol'].($order['qty'] * $order['discounted_price']); ?></div>
												</div>
												<div class="clear"></div>
												<?php if(isset($order['sub_item'])) { foreach ($order['sub_item'] as $sb_item) {?>
                    						    <div class="a"></div>
                    						    <div class="b uk-text-success"><?= $sb_item['addon_category'];  ?></div>
                    						    <div class="clear"></div>
                    						    <div class="a"><?= $sb_item['addon_qty'];  ?></div>
                    						    <div class="b uk-text-muted"><?= $sb_item['addon_name'];  ?></div>
                    						    <div class="manage"><div class="d"><?= $_SESSION['settings']['currency_symbol'] .$sb_item['addon_price'];  ?></div></div>
                    						    <div class="clear"></div>
                                           <?php }} ?>
											</div>
										<?php } ?>
										<div class="summary-wrap">
										<?php if($cart['data']['total']['less_voucher'] != 0) {?>
										<div class="row">
												<div class="col-md-6 col-xs-6 text-right ">Voucher Amount</div>
												<div class="col-md-6 col-xs-6 text-right cart_subtotal"><?= $_SESSION['settings']['currency_symbol'].round($cart['data']['total']['less_voucher'],2); ?></div>
										</div><?php } ?>
											<div class="row">
												<div class="col-md-6 col-xs-6 text-right ">Sub Total</div>
												<div class="col-md-6 col-xs-6 text-right cart_subtotal"><?= $_SESSION['settings']['currency_symbol'].$cart['data']['total']['subtotal']; ?></div>
											</div>
											<div class="row">
												<div class="col-md-6 col-xs-6 text-right ">Delivery Charge</div>
												<div class="col-md-6 col-xs-6 text-right cart_deliverycharge"><?= $_SESSION['settings']['currency_symbol'].round($cart['data']['total']['delivery_charges'],2); ?></div>
											</div>
											<div class="row cart_total_wrap bold">
												<div class="col-md-6 col-xs-6  text-right">Total</div>
												<div class="col-md-6 col-xs-6  text-right cart_total"><?= $_SESSION['settings']['currency_symbol'].$cart['data']['total']['total']; ?></div>
											</div>
											<input type="hidden" value="" name="subtotal_order" id="subtotal_order"><input type="hidden" value="" name="subtotal_order2" id="subtotal_order2"><input type="hidden" value="" name="total" id="total"><input type="hidden" value="" name="subtotal_extra_charge" id="subtotal_extra_charge">
										</div>
									</div>
									<div class="text-center top25">

										<input type="submit" value="Confirm Order" class="place_order orange-button medium inline block">
									</div>
								</div> <!--order-list-wrap--> </div>
						</div>
					</div> <!--col--> </div> <!--row--> </div> <!--container--></div><!-- sections--> </form>
<?php } else { ?>
	<h3 class="text-danger">merchant is not available</h3>
<?php } ?>
