<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" class="">
<head>
	<base href="<?= base_url();?>">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Loveeatery</title>
	<link rel="stylesheet" type="text/css" href="assets/css/store.css">
	<link rel="stylesheet" type="text/css" href="assets/css/font-awesome.min.css">
	<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="assets/css/jquery.raty.css">
	<link rel="stylesheet" type="text/css" href="assets/css/ionicons.min.css">
	<link rel="stylesheet" type="text/css" href="assets/css/bootstrap-select.min.css">
	<link rel="stylesheet" type="text/css" href="assets/css/justifiedGallery.min.css">
	<link rel="stylesheet" type="text/css" href="assets/css/store-v2.css">
	<link rel="stylesheet" type="text/css" href="assets/css/responsive.css">
	<link rel="stylesheet" type="text/css" href="assets/css/custom.css">
	<link rel="shortcut icon" href="https://demo56.tribital.ga/munch/favicon.ico?ver=1.1">
	<script src="assets/js/jquery.min.js"></script>
	<script src="assets/vendor/theia-sticky-sidebar.js"></script>
	<meta name="robots" content="noindex">
	
	<style>
        #mobile-header {
            position: sticky; 
            top: 0;
            z-index: 1000;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }
    </style>
</head>

<?php 
$merchantInfo = $this->session->userdata('merchantInfo');
$resturantInfo = $this->session->userdata('resturantInfo');
?>



<body>
    
<div id="mobile-header" class="container">
    
   <div class="">
      <div class="col-xs-1 center">
         <!--<a class="back-mobile" href="/store/menu/merchant/menu">-->
         <a class="back-mobile"  onclick="window.history.back()">
            <i class="ion-ios-arrow-back"></i>
         </a>
      </div>
      <div class="col-xs-10 ">
         <h1 class="center">Basket</h1>
      </div>
   </div> <!--row-->
   
</div>    

<div class="tabs-wrapper" id="menu-tab-wrapper" style="transform: none;">
					<ul id="tab" style="transform: none;">
						<li>
							<div class="box-grey rounded" style="margin-top:0;">
								<div id="merchant-map" class="merchant_map"></div>
							</div> <!--box-grey-->
							<div class="direction_output" id="direction_output"></div>
						</li>
					
					</ul>
				</div>
			
			
			<div class="theiaStickySidebar cartDetails" style="padding-top: 0px; padding-bottom: 1px; padding-right: 10px; position: static;">
					<div id="cart-container" class="box-grey rounded  relative cartDetailsdiv"  id="ajax-content">

					</div> <!--end theiaStickySidebar-->
				</div> <!--end theiaStickySidebar-->
		
<div class="modal fade" id="menumodel" role="dialog">
</div>
<?php
$search_address = $this->session->userdata('address');
?>
<?php if($merchantInfo['services'] != 'Pickup'){ ?>
<div class="modal fade" id="addressModal" role="dialog">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
                <div class="section-label">
                    <a class="section-label-a">
                        <span class="bold">Enter your address below</span>
                        <b></b>
                    </a>
                </div>
			</div>
			<form method="post" action="menu/setAddress" onsubmit="event.preventDefault();menu.setDeliveryAddress(this)">
				<div class="modal-body">

					<div class="row">
						<div class="col-md-12 has-success">
							<input id="search_address" required value="<?= @$search_address['address']; ?>"
								   name="address" class="form-control" placeholder="Enter your address" type="text">
						</div>
						<input name="lat" id="search_lat" type="hidden" value="<?= @$search_address['lat']; ?>"/>
						<input name="lng" id="search_lng" type="hidden" value="<?= @$search_address['lng']; ?>"/>
						<input id="street_number" name="street" type="hidden"
							   value="<?= @$search_address['street']; ?>"/>
						<input id="locality" name="city" type="hidden" value="<?= @$search_address['city']; ?>"/>
						<input id="administrative_area_level_1" type="hidden" name="state"
							   value="<?= @$search_address['state']; ?>"/>
						<input id="postal_code" name="zipcode" type="hidden"
							   value="<?= @$search_address['zipcode']; ?>"/>
						<input id="country" name="country" type="hidden" value="<?= @$search_address['country']; ?>"/>
						<input id="country_code" name="country_code" type="hidden"
							   value="<?= @$search_address['country_code']; ?>"/>
					</div>
				</div>
				<div class="modal-footer">
					<button type="submit" class="btn btn-success">Submit</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
				</div>
			</form>
		</div>
	</div>
</div><!--End model-->
<?php } ?>
</body>
</html>

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=<?= $_SESSION['settings']['google_geo_api_key']; ?>&libraries=places"></script>
<script type="text/javascript" src="assets/js/gmaps.js"></script>
<script>
	var settings_map_country='NZ';
</script>
<script>
	$(document).ready(function () {


		// $('.j_date').trigger('change');
		$(document).on("click", ".goto-category", function (ev) {
			var class_name = $(this).data("id");
			// dump(class_name);
			$(".goto-category").removeClass("active");
			$(this).addClass("active");
			scroll_class(class_name);
		});
		$(document).on("click", ".qty-plus", function () {
			qty = parseFloat($("#qty").val()) + 1;
			////console.debug(qty);
			if (isNaN(qty)) {
				qty = 1;
			}
			$("#qty").val(qty);
		});
		
		$(document).on("click", ".qty-minus", function () {
			var qty = $("#qty").val() - 1;
			if (qty <= 0) {
				qty = 1;
			}
			$("#qty").val(qty);
		});
		
		
		$(document).on("click", ".special-instruction", function () {
			$(".notes-wrap").slideToggle("fast");
		});
		
		$("ul#tabs li").click(function (e) {
			if ($(this).hasClass("noclick")) {
				return;
			}
			if (!$(this).hasClass("active")) {
				var tabNum = $(this).index();
				var nthChild = tabNum + 1;
				$("ul#tabs li.active").removeClass("active");
				$(this).addClass("active");
				$("ul#tab li.active").removeClass("active");
				$("ul#tab li:nth-child(" + nthChild + ")").addClass("active");
			}

		});
		//
		//
		// $(document).on("click", ".delete_item", function () {
		// 	var row = $(this).data("row");
		// 	delete_item(row);
		//
		// });


		smap = new GMaps({
			div: '#merchant-map',
			lat: <?= $merchantInfo['latitude']; ?>,
			lng: <?= $merchantInfo['lontitude'];?>,
			scrollwheel: false,
			styles: [{stylers: [{"saturation": -100}, {"lightness": 0}, {"gamma": 1}]}]
		});

		var resto_info = '';
		resto_info += '<div class="marker-wrap">';
		resto_info += '<div class="row">';
		resto_info += '<div class="col-md-4 ">';
		resto_info += '<img class="logo-small" src="assets/images/default-image-merchant.png" >';
		resto_info += '</div>';
		resto_info += '<div class="col-md-8 ">';
		resto_info += '<h3 class="orange-text"><?= $merchantInfo['restaurant_name']; ?></h3>';
		resto_info += '<p class="small"><?= $merchantInfo['complete_address'];?></p>';
		resto_info += '</div>';
		resto_info += '</div>';
		resto_info += '<div>';

		smap.addMarker({
			lat: <?= $merchantInfo['latitude']; ?>,
			lng: <?= $merchantInfo['lontitude'];?>,
			title: $("#restaurant_name").val(),
			icon: '',
			infoWindow: {
				content: resto_info
			}
		});


		menu.init();
		<?php if(!isset($search_address['lat']) || $search_address['lat']==''){ ?>
		menu.geolocate();
		<?php } ?>
	})


</script>
<script>
    $(function(){
        $('.date_booking').trigger('change');
    });
</script>

<script src="assets/js/bootstrap.min.js"></script>
<script type="text/javascript" src="assets/js/icheck.js"></script>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script type="text/javascript" src="assets/js/functions.js"></script>

