<?php
session_start();
require_once('header_2.php');
require_once('database.php');
$query="SELECT * from products where product_category='appetizers'";
$data=db::getRecords($query);
$query2="SELECT * from products where product_category='chicken'";
$data2=db::getRecords($query2);
$query3="SELECT * from products where product_category='lamb'";
$data3=db::getRecords($query3);
$query4="SELECT * from products where product_category='h_specialties'";
$data4=db::getRecords($query4);
$query5="SELECT * from products where product_category='fish'";
$data5=db::getRecords($query5);
$query6="SELECT * from products where product_category='biriani'";
$data6=db::getRecords($query6);
$query7="SELECT * from products where product_category='vegetable'";
$data7=db::getRecords($query7);
$query8="SELECT * from products where product_category='accompangnements'";
$data8=db::getRecords($query8);
$query9="SELECT * from products where product_category='dessert'";
$data9=db::getRecords($query9);
  ?>  
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<style>
.card{
       margin-top:25px;
   }
    @media only screen and (min-width: 768px) {
  /* For desktop: */
  .menu-body {
        border:1px solid;
      height:150px;
        }
		
		.top-padding {padding-top: 120px;}
    }
        
        @media (max-width: 992px){
         .form-field{
            display:none;
        }   
        }
        .menu-body
        {
            cursor:pointer;
        }
        div.scrollmenu {
  background-color: #E93E21;
  overflow: auto;
  white-space: nowrap;
  z-index: 99;
}

div.scrollmenu a {
  display: inline-block;
  color: white;
  text-align: center;
  padding: 14px;
  text-decoration: none;
  font-size:20px;
}

div.scrollmenu a:hover {
 background:black;

}
.sticky{
  position: -webkit-sticky;
  position: sticky;
  top: 90px;
 }
 @media only screen and (max-width: 768px) {
        div.scrollmenu {
  background-color: #E93E21;
  overflow: auto;
  white-space: nowrap;
  z-index: 99;
}

div.scrollmenu a {
  display: inline-block;
  color: white;
  text-align: center;
  padding: 14px;
  text-decoration: none;
  font-size:20px;
}

div.scrollmenu a:hover {
 background:black;

}
.sticky{
  position: -webkit-sticky;
  position: sticky;
  top:0px;
 }
}
@media only screen and (min-width: 600px) {.top-padding {padding-top: 60px;}}
@media only screen and (max-width: 360px) {.top-padding {padding-top: 60px;} 
	
	h4 {font-size: 18px;}
	input { border: 1px solid #e4e4e4; border-radius: 12px 0px;}
	
	}
	
@media (min-width:479px){.top-padding {padding-top: 60px;}}   



</style>
<div class="inner-intro parallax bg-overlay-black-70" style="background-image: url(images/bg/05.jpg);height:400px">
   <div class="container-fluid">
        
       <div class="row">
         <div class="col-lg-6 col-md-6 top-padding">
                    <div class="card white-bg" style="margin-top:10px">
                        <div class="row">
              <div class="col-lg-1 col-md-1 col-sm-1" ></div>
                   <div class="col-lg-10 col-md-10 col-sm-10" >
  <div class="card-body col-lg-10 col-md-10 col-sm-10">
    <h4 class="card-title"  style="text-align:left;padding-top:10px">Shezan Bruxelles</h4>
    <p style="text-align:left">€€ • World Kitchen • Indien • Indien (Ouest) • Indien (Nord) • Indien (Sud)</p>
    <p id="km" style="text-align:left"></p>
      <p  style="text-align:left">Chaussée De Wavre 120 Ixelles 1050 Bruxelles </p>
  </div>
  
</div>
                             <div class="col-lg-1 col-md-1 col-sm-1" ></div>
                 </div>
                 
                  
             </div>
         </div>
     </div>
     
     <div class="row">
         <div class="col-lg-6 col-md-6 visible-xs">
                    <div class="card" style="background-color:white">
                        <div class="row">
              <div class="col-lg-1 col-md-1 col-sm-1" ></div>
                   <div class="col-lg-10 col-md-10 col-sm-10" >
  <div class="card-body col-lg-10 col-md-10 col-sm-10">
      <h4 class="card-title"  style="text-align:left;padding-top:10px"> Delivery Address</h4>
   <div class="form-field  contact-form" style="margin-bottom:15px; display:block;">
            <input id="search_input" class="web placeholder" type="text" placeholder="Enter Delivery Address"  value="" onchange="myFunction(this.value)">
          </div>
  </div>
  
</div>
                             <div class="col-lg-1 col-md-1 col-sm-1" ></div>
                 </div>
                 
                  
             </div>
         </div>
     </div>
  </div>
</div>
<div class="scrollmenu sticky">
  <a href="#appetizer">APPETIZERS</a>
 <a href="#chicken">CHICKEN</a>
 <a href="#labm">LAMB</a>
 <a href="#h_specialities">HOUSE SPECIALTIES</a>
 <a href="#fish">FISH</a>
 <a href="#birianis">BIRIANIS</a>
 <a href="#accom">ACCOMPANGNEMENTS</a>
 <a href="#vegetables">VEGETABLES </a>
 <a href="#dessert">DESSERT</a>
</div>
<!--section Appetizer-->
    <section class="card white-bg" id="appetizer" >
    <div class="container">
         <div class="row">
      <div class="col-lg-12 col-md-12">
        <div class="section-title text-center">
          <div class="title-separator">
            <i class="glyph-icon flaticon-food-27"></i>
          </div>
          <h2> <span class="text-orange">APPET</span>IZERS</h2>
        </div>
      </div>
    </div>
        <div class="row">
           <?php
            	if($data)
                {
				foreach($data as $rec)
				   {
				?>
            
        <div class="col-lg-6">
            <div class="menu-body menu-left menu-white  userinfo" data-id="<?php echo $rec['product_code'];?>"  style="">
              <div class="menu-thumbnail">
                 <img src="images/<?php  echo $rec['product_image'];?>" alt="Image" style="width:100%;">
              </div>
              <div class="menu-details">
                <div class="menu-title clearfix">
                  <h4><?php  echo $rec['product_name']; ?></h4>
                  <span class="price">€<?php  echo $rec['product_price']; ?></span>
                </div>
                <div class="menu-description">
                  <p><?php  echo $rec['product_desc']; ?></p>
                </div>
              </div>
            </div>
             <br>
               </div>
           
            	<?php		}
					}
				?>
           
        </div>
        </div>
    </section>
<!--section chicken-->
    <section class="card white-bg" id="chicken" >
    <div class="container">
         <div class="row">
      <div class="col-lg-12 col-md-12">
        <div class="section-title text-center">
          <div class="title-separator">
            <i class="glyph-icon flaticon-food-27"></i>
          </div>
          <h2> <span class="text-orange">CHIC</span>KEN</h2>
        </div>
      </div>
    </div>
        <div class="row">
           <?php
            	if($data2)
                {
				foreach($data2 as $rec)
				   {
				?>
            
        <div class="col-lg-6">
            <div class="menu-body menu-left menu-white  userinfo" data-id="<?php echo $rec['product_code'];?>"  style="">
              <div class="menu-thumbnail">
                 <img src="images/<?php  echo $rec['product_image'];?>" alt="Image" style="width:100%;height:auto">
              </div>
              <div class="menu-details">
                <div class="menu-title clearfix">
                  <h4><?php  echo $rec['product_name']; ?></h4>
                  <span class="price">€<?php  echo $rec['product_price']; ?></span>
                </div>
                <div class="menu-description">
                  <p><?php  echo $rec['product_desc']; ?></p>
                </div>
              </div>
            </div>
             <br>
               </div>
           
            	<?php		}
					}
				?>
           
        </div>
        </div>
    </section>
<!--section lamb-->
    <section class="card white-bg" id="labm" >
    <div class="container">
         <div class="row">
      <div class="col-lg-12 col-md-12">
        <div class="section-title text-center">
          <div class="title-separator">
            <i class="glyph-icon flaticon-food-27"></i>
          </div>
          <h2> <span class="text-orange">LAMB/</span>AGNEAU</h2>
        </div>
      </div>
    </div>
        <div class="row">
           <?php
            	if($data3)
                {
				foreach($data3 as $rec)
				   {
				?>
            
        <div class="col-lg-6">
            <div class="menu-body menu-left menu-white  userinfo" data-id="<?php echo $rec['product_code'];?>"  style="">
              <div class="menu-thumbnail">
                 <img src="images/<?php  echo $rec['product_image'];?>" alt="Image" style="width:100%;">
              </div>
              <div class="menu-details">
                <div class="menu-title clearfix">
                  <h4><?php  echo $rec['product_name']; ?></h4>
                  <span class="price">€<?php  echo $rec['product_price']; ?></span>
                </div>
                <div class="menu-description">
                  <p><?php  echo $rec['product_desc']; ?></p>
                </div>
              </div>
            </div>
             <br>
               </div>
           
            	<?php		}
					}
				?>
           
        </div>
        </div>
    </section>
<!--section HOUSE SPECIALTIES -->
    <section class="card white-bg" id="h_specialities" >
    <div class="container">
         <div class="row">
      <div class="col-lg-12 col-md-12">
        <div class="section-title text-center">
          <div class="title-separator">
            <i class="glyph-icon flaticon-food-27"></i>
          </div>
          <h2> <span class="text-orange">HOUSE</span> SPECIALTIES</h2>
        </div>
      </div>
    </div>
        <div class="row">
           <?php
            	if($data4)
                {
				foreach($data4 as $rec)
				   {
				?>
            
        <div class="col-lg-6">
            <div id="hspe" class="menu-body menu-left menu-white  userinfo" data-id="<?php echo $rec['product_code'];?>" >
              <div class="menu-thumbnail">
                 <img src="images/<?php  echo $rec['product_image'];?>" alt="Image" style="width:100%;">
              </div>
              <div class="menu-details">
                <div class="menu-title clearfix">
                  <h4><?php  echo $rec['product_name']; ?></h4>
                  <span class="price">€<?php  echo $rec['product_price']; ?></span>
                </div>
                <div class="menu-description">
                  <p><?php  echo $rec['product_desc']; ?></p>
                </div>
              </div>
            </div>
             <br>
               </div>
           
            	<?php		}
					}
				?>
           
        </div>
        </div>
    </section>
<!--section FISH -->
    <section class="card white-bg" id="fish" >
    <div class="container">
         <div class="row">
      <div class="col-lg-12 col-md-12">
        <div class="section-title text-center">
          <div class="title-separator">
            <i class="glyph-icon flaticon-food-27"></i>
          </div>
          <h2> <span class="text-orange">FI</span>SH</h2>
        </div>
      </div>
    </div>
        <div class="row">
           <?php
            	if($data5)
                {
				foreach($data5 as $rec)
				   {
				?>
            
        <div class="col-lg-6">
            <div class="menu-body menu-left menu-white  userinfo" data-id="<?php echo $rec['product_code'];?>" >
              <div class="menu-thumbnail">
                 <img src="images/<?php  echo $rec['product_image'];?>" alt="Image" style="width:100%;">
              </div>
              <div class="menu-details">
                <div class="menu-title clearfix">
                  <h4><?php  echo $rec['product_name']; ?></h4>
                  <span class="price">€<?php  echo $rec['product_price']; ?></span>
                </div>
                <div class="menu-description">
                  <p><?php  echo $rec['product_desc']; ?></p>
                </div>
              </div>
            </div>
             <br>
               </div>
           
            	<?php		}
					}
				?>
           
        </div>
        </div>
    </section>
<!--section BIRIANIS -->
    <section class="card white-bg" id="birianis" >
    <div class="container">
         <div class="row">
      <div class="col-lg-12 col-md-12">
        <div class="section-title text-center">
          <div class="title-separator">
            <i class="glyph-icon flaticon-food-27"></i>
          </div>
          <h2> <span class="text-orange">BIRI</span>ANIS</h2>
        </div>
      </div>
    </div>
        <div class="row">
           <?php
            	if($data6)
                {
				foreach($data6 as $rec)
				   {
				?>
            
        <div class="col-lg-6">
            <div class="menu-body menu-left menu-white  userinfo" data-id="<?php echo $rec['product_code'];?>" >
              <div class="menu-thumbnail">
                 <img src="images/<?php  echo $rec['product_image'];?>" alt="Image" style="width:100%;">
              </div>
              <div class="menu-details">
                <div class="menu-title clearfix">
                  <h4><?php  echo $rec['product_name']; ?></h4>
                 
                </div>
                <div class="menu-description">
                  <span class="price">€<?php  echo $rec['product_price']; ?></span>
                </div>
              </div>
            </div>
             <br>
               </div>
           
            	<?php		}
					}
				?>
           
        </div>
        </div>
    </section>
<!--section  ACCOMPANGNEMENTS-->
    <section class="card white-bg" id="accom" >
    <div class="container">
         <div class="row">
      <div class="col-lg-12 col-md-12">
        <div class="section-title text-center">
          <div class="title-separator">
            <i class="glyph-icon flaticon-food-27"></i>
          </div>
          <h4> <span class="text-orange">ACCOMPAN</span>GNEMENTS</h4>
        </div>
      </div>
    </div>
        <div class="row">
           <?php
            	if($data8)
                {
				foreach($data8 as $rec)
				   {
				?>
            
        <div class="col-lg-6">
            <div class="menu-body menu-left menu-white  userinfo" data-id="<?php echo $rec['product_code'];?>" >
              <div class="menu-thumbnail">
                 <img src="images/<?php  echo $rec['product_image'];?>" alt="Image" style="width:100%;">
              </div>
              <div class="menu-details">
                <div class="menu-title clearfix">
                  <h4><?php  echo $rec['product_name']; ?></h4>
                  <span class="price">€<?php  echo $rec['product_price']; ?></span>
                </div>
                <div class="menu-description">
                  <p><?php  echo $rec['product_desc']; ?></p>
                </div>
              </div>
            </div>
             <br>
               </div>
           
            	<?php		}
					}
				?>
           
        </div>
        </div>
    </section>
<!--section  vegetables-->
    <section class="card white-bg" id="vegetables" >
    <div class="container">
         <div class="row">
      <div class="col-lg-12 col-md-12">
        <div class="section-title text-center">
          <div class="title-separator">
            <i class="glyph-icon flaticon-food-27"></i>
          </div>
          <h2> <span class="text-orange">VEGET</span>ABLES</h2>
        </div>
      </div>
    </div>
        <div class="row">
           <?php
            	if($data7)
                {
				foreach($data7 as $rec)
				   {
				?>
            
        <div class="col-lg-6">
            <div class="menu-body menu-left menu-white  userinfo" data-id="<?php echo $rec['product_code'];?>" >
              <div class="menu-thumbnail">
                 <img src="images/<?php  echo $rec['product_image'];?>" alt="Image" style="width:100%;">
              </div>
              <div class="menu-details">
                <div class="menu-title clearfix">
                  <h4><?php  echo $rec['product_name']; ?></h4>
                  <span class="price">€<?php  echo $rec['product_price']; ?></span>
                </div>
                <div class="menu-description">
                  <p><?php  echo $rec['product_desc']; ?></p>
                </div>
              </div>
            </div>
             <br>
               </div>
           
            	<?php		}
					}
				?>
           
        </div>
        </div>
    </section>
<!--section  vegetables-->
    <section class="card white-bg" id="dessert" >
    <div class="container">
         <div class="row">
      <div class="col-lg-12 col-md-12">
        <div class="section-title text-center">
          <div class="title-separator">
            <i class="glyph-icon flaticon-food-27"></i>
          </div>
          <h2> <span class="text-orange">DESS</span>ERT</h2>
        </div>
      </div>
    </div>
        <div class="row">
           <?php
            	if($data9)
                {
				foreach($data9 as $rec)
				   {
				?>
            
        <div class="col-lg-6">
            <div class="menu-body menu-left menu-white  userinfo" data-id="<?php echo $rec['product_code'];?>" >
              <div class="menu-thumbnail">
                 <img src="images/<?php  echo $rec['product_image'];?>" alt="Image" style="width:100%;">
              </div>
              <div class="menu-details">
                <div class="menu-title clearfix">
                  <h4><?php  echo $rec['product_name']; ?></h4>
                  <span class="price">€<?php  echo $rec['product_price']; ?></span>
                </div>
                <div class="menu-description">
                  <p><?php  echo $rec['product_desc']; ?></p>
                </div>
              </div>
            </div>
             <br>
               </div>
           
            	<?php		}
					}
				?>
           
        </div>
        </div>
    </section>
 <!-- Modal -->
            <div class="modal fade" id="cart_Modal" role="dialog">
                <div class="modal-dialog">
                
                    <!-- Modal content-->
                    <div class="modal-content">
                        <div class="modal-header">
                          <button type="button" class="close" data-dismiss="modal">&times;</button>
                            <h5 class="modal-title">Product Detail</h5>
                        </div>
                        <div id="modal-body">
                         </div>
                         </div>
                         </div>
                         </div>
<?php require_once('footer.php'); ?>
<script>
         window.addEventListener("load", function() {
              var userid = "0";
                   // AJAX request for auto load 
                    $.ajax({
                        url: 'ajaxfile.php',
                        type: 'post',
                        async:true,
                        data: {userid: userid},
                        success: function(response){ 
                            // Add response in Modal body
                            $('#modal-body').html(''); 
                             $('#modal-body').html(response); 
                            // Display Modal
                            $('#cart_Modal').modal('hide'); 
                        }
                    });
});
      </script>
<script type='text/javascript'>
       $(document).ready(function(){

                $('.userinfo').click(function(){
                   
                    var userid = $(this).data('id');

                    // AJAX request
                    $.ajax({
                        url: 'ajaxfile.php',
                        type: 'post',
                        async:true,
                        data: {userid: userid},
                        success: function(response){ 
                            // Add response in Modal body
                            $('#modal-body').html(''); 
                             $('#modal-body').html(response); 
                            // Display Modal
                            $('#cart_Modal').modal('show'); 
                        }
                    });
                });
            });
var d = JSON.parse(window.localStorage.getItem('distanceresultcheck'));
document.getElementById("km").innerHTML = (d.toFixed(2))+" • Kilometres";
            </script>
<script>
 $(document).ready(function () {
    var searchInput = 'search_input';
    var autocomplete;
    var lat1;
    var lon1;
    var  distanceresult
    var lat2=50.836498;
    var lon2=4.367400;
    var unit='K';
    var autocomplete;
    var lat1;
    var lon1;
    var lat2=50.836498;
    var lon2=4.367400;
    var unit='K'
    autocomplete = new google.maps.places.Autocomplete((document.getElementById(searchInput)), {
        types: ['geocode'],
    });
	
    google.maps.event.addListener(autocomplete, 'place_changed', function () {
        var near_place = autocomplete.getPlace();
		lat1= near_place.geometry.location.lat();
        lon1= near_place.geometry.location.lng();
        distanceresult =distance(lat1, lon1, lat2, lon2, unit);
        var distanceresultcheck=distanceresult;
  if(distanceresultcheck>5.000){
      swal({
  title: "Ohh Sorry",
  text: "Delivery Not in This Area Only Pick Up",
  icon: "warning",
  buttons: [false,  "ok!"],
  dangerMode: true,
})
.then((willDelete) => {
  if (willDelete) {
     var address=$("#search_input").val();
     window.localStorage.setItem('address', JSON.stringify(address));
     window.localStorage.setItem('distanceresultcheck', JSON.stringify(distanceresultcheck));
     window.location.assign("product_order.php");
    
  } 
});
  }
  else{
   var address=$("#search_input").val();
   window.localStorage.setItem('address', JSON.stringify(address));
   window.localStorage.setItem('distanceresultcheck', JSON.stringify(distanceresultcheck));
   window.location.assign("product_order.php");
  }
    });
});
         function distance(lat1, lon1, lat2, lon2, unit) {
	 if ((lat1 == lat2) && (lon1 == lon2)) {
		return 0;
	    }
	else {
		var radlat1 = Math.PI * lat1/180;
		var radlat2 = Math.PI * lat2/180;
		var theta = lon1-lon2;
		var radtheta = Math.PI * theta/180;
		var dist = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);
		if (dist > 1) {
			dist = 1;
		}
		dist = Math.acos(dist);
		dist = dist * 180/Math.PI;
		dist = dist * 60 * 1.1515;
		if (unit=="K") { dist = dist * 1.609344 }
		if (unit=="N") { dist = dist * 0.8684 }
		return dist;
	}
}
var a = JSON.parse(window.localStorage.getItem('address'));
document.getElementById("search_input").value = a;
var d = distanceresultcheck;
document.getElementById("km").innerHTML = (d.toFixed(2));
</script>