<!DOCTYPE html>
<html lang="en-US">
<?php 
include('common/header.php');

$succMsg = '';
if(isset($_POST['register_from']) && $_POST['register_from'] == 'listener'){
	$dateD = date('Y-m-d H:i:s');
	$email = $_POST['email'];
	
	$validateEmailQ = "SELECT * FROM tbl_user WHERE email = '$email' AND status = 1";
	$userList = $conn->execute($validateEmailQ,'select');
	if(isset($userList->id) && $userList->id > 0){
		$userId = $userList->id;
	}else{
		$userInsertQ = "INSERT INTO `tbl_user` (`name`, `email`, `emirates`, `nationality`, `type`, `mobile_no`, `where_did_hear`, `status`, `created`) VALUES ('".$_POST['name']."', '".$_POST['email']."', '".$_POST['emirate']."', '".$_POST['nationality']."', '1', '".$_POST['contact']."', '".$_POST['where_did_hear']."', '1', '$dateD')";
		$userId = $conn->execute($userInsertQ,'insert');
	}
		
		$restNameArr = $_POST['cat_val'];
		foreach($restNameArr as $key => $value){
			if($value != ''){
				$validateRestQ = "SELECT * FROM tbl_restaurant WHERE name = '$value' AND status = 1";
				$restaurantData = $conn->execute($validateRestQ,'select');
				
				$catId = $key;
				if(isset($restaurantData->id) && $restaurantData->id > 0){
					$restId = $restaurantData->id;
				}else{
					$insertQuery = "INSERT INTO `tbl_restaurant` (`name`, `created`, `status`) VALUES ('$value', '".$dateD."', '1')";
					$restId = $conn->execute($insertQuery,'insert');
				}
				$nominateQuery =  "INSERT INTO `tbl_nominate` (`category_id`, `restaurant_id`, `user_id`, `status`, `created`) VALUES ('$catId', '$restId', '$userId', '1', '$dateD')";
				$nominateId = $conn->execute($nominateQuery,'insert');
			}
		}
				
	$succMsg = "Thank You for your nomination. We will get in touch with you shortly.";	
}

if(isset($_POST['register_from']) && $_POST['register_from'] == 'owner'){
	
	$dateD = date('Y-m-d H:i:s');
	$email = $_POST['email'];
	
	$validateEmailQ = "SELECT * FROM tbl_user WHERE email = '$email' AND status = 1";
	$userList = $conn->execute($validateEmailQ,'select');
	//if(isset($userList->id) && $userList->id > 0){
	//	$userId = $userList->id;
	//}else{
		$userInsertQ = "INSERT INTO `tbl_user` (`name`, `email`, `designation`, `address`, `type`, `mobile_no`, `where_did_hear`, `status`, `created`) VALUES ('".$_POST['name']."', '".$_POST['email']."', '".$_POST['designation']."', '".$_POST['address']."', '2', '".$_POST['contact']."', '".$_POST['where_did_hear']."', '1', '$dateD')";
		$userId = $conn->execute($userInsertQ,'insert');
//	}
		
		$restNameArr = $_POST['rest_name'];
		foreach($restNameArr as $key => $value){
			
			if($value != ''){
				$validateRestQ = "SELECT * FROM tbl_restaurant WHERE name = '$value' AND status = 1";
				$restaurantData = $conn->execute($validateRestQ,'select');
				
				$catId = $_POST['category'][$key];
				if(isset($restaurantData->id) && $restaurantData->id > 0){
					$restId = $restaurantData->id;
				}else{
					$insertQuery = "INSERT INTO `tbl_restaurant` (`name`, `created`, `status`) VALUES ('$value', '".$dateD."', '1')";
					$restId = $conn->execute($insertQuery,'insert');
				}
				$nominateQuery =  "INSERT INTO `tbl_nominate` (`category_id`, `restaurant_id`, `user_id`, `status`, `created`) VALUES ('$catId', '$restId', '$userId', '1', '$dateD')";
				$nominateId = $conn->execute($nominateQuery,'insert');
			}
		}
				
	$succMsg = "Thank You for your nomination. We will get in touch with you shortly.";	
}

$catList = $conn->execute('SELECT * FROM tbl_category WHERE 1=1 AND status = 1');
$restaurantList = $conn->execute('SELECT name,id FROM tbl_restaurant WHERE 1=1 AND status = 1');
?>
<style>
input::-webkit-calendar-picker-indicator {
  background-color: inherit;
  }
 .result-disp {
   position: absolute;
   width: 100%;
   max-width:870px;
   cursor: pointer;
   overflow-y: auto;
   max-height: 400px;
   box-sizing: border-box;
   z-index: 1001;
  }
  .link-class:hover{
   background-color:#fff;
  }
  .link-class{
	 	margin-left: 0 !important;
	 }
  .text-muted{
	 	color:#fff !important;
	 }
</style>
<script>

$(document).ready(function(){
 $.ajaxSetup({ cache: false });
});
</script>
  <div class="container-wrapper">
    <div class="page-bg" align="center" style=" background-image: url(images/bg-pizza.jpg); " ></div>
    <div id="container">
      <div class="page-title-wrapper">
        <div class="page-title-outher">
          <div class="page-title-inner">
            <h1 class="page-title">NOMINATE YOUR FAVORITE RESTAURANT</h1>
            <div class="clear"></div>
          </div>
          <div class="clear"></div>
        </div>
      </div>
      <div class="clear"></div>
      <div class="page-wrapper">
        <div class="offer-menu-wrapper">
        <?php if(isset($succMsg) && $succMsg != ''){ ?>
        <div class="alert alert-success">
          <strong>Success!</strong> <?php echo $succMsg;?>
        </div>
        <?php }?>

        
          <ul id="filters" class="single-offer-category-filter option-set" data-option-key="filter" >
            <li class="filter-cat" style="margin-left:40px;"><a class="selected"  href="#filter" data-option-value=".cat1"><img src="images/menu-icon1.png" style="margin-right:10px;vertical-align:middle;">I am a Listener</a></li>
            <li class="filter-cat" style="margin-left:20px;"><a  href="#filter" data-option-value=".cat2"><img src="images/menu-icon.png" style="margin-right:10px;vertical-align:middle; ">I am a Restaurant Owner</a></li>
          </ul>
          <div class="offer-menu-items" style="position:relative; overflow:hidden; width:100%; height:auto !important;  ">
            <div class="single-offer-category-item isotope-item cat1">
              <div class="single-offer-item">
                <div class="single-offer-details">
                  <form role="form" method="post" name="reused_form_listener" id="reused_form_listener" style="margin-top:15px;">
                    <div class="row">
                      <div class="col-sm-6 col-md-6 form-group">
                        <label for="name"> Name <span class="red">*</span> </label>
                        <input type="text" class="form-control" id="name" name="name" maxlength="50">
                      </div>
                      <div class="col-sm-6 col-md-6 form-group">
                        <label for="contact"> Mobile Number <span class="red">*</span> </label>
                        <input type="text" class="form-control" id="contact" name="contact" maxlength="50">
                      </div>
                    </div>
                    <div class="row">
                      <div class="col-sm-6 form-group">
                        <label for="email"> Email Address <span class="red">*</span> </label>
                        <input type="text" class="form-control" id="email" name="email" required maxlength="50">
                      </div>
                      <div class="col-sm-6 form-group">
                        <label for="emirate"> Emirate <span class="red">*</span> </label>
                        <select class="form-control" name="emirate" id="emirate">
                          <option value="Abu Dhabi">Abu Dhabi</option>
                          <option value="Dubai" >Dubai</option>
                          <option value="Sharjah">Sharjah</option>
                          <option value="Ajman">Ajman</option>
                          <option value="Fujairah" >Fujairah</option>
                          <option value="Ras Al Khaimah">Ras Al Khaimah</option>
                          <option value="Umm Al Quwain">Umm Al Quwain </option>
                        </select>
                      </div>
                    </div>
                    <div class="row">
                      <div class="col-sm-6 form-group">
                        <label for="nationality"> Nationality <span class="red">*</span> </label>
                        <select class="form-control" id="nationality" name="nationality">
                          <option value="indian">India</option>
                          <option value="pakistani">Pakistan</option>
                          <option value="sri lankan">Sri Lanka</option>
                          <option value="bangladeshi">Bangladesh</option>
                          <option value="nepalese">Nepal</option>
                           <option value="United Arab Emirates">United Arab Emirates</option>
                          <option value="afghan">Afghanistan</option>
                          <option value="albanian">Albanian</option>
                          <option value="algerian">Algerian</option>
                          <option value="american">American</option>
                          <option value="andorran">Andorran</option>
                          <option value="angolan">Angolan</option>
                          <option value="antiguans">Antiguans</option>
                          <option value="argentinean">Argentinean</option>
                          <option value="armenian">Armenian</option>
                          <option value="australian">Australian</option>
                          <option value="austrian">Austrian</option>
                          <option value="azerbaijani">Azerbaijani</option>
                          <option value="bahamian">Bahamian</option>
                          <option value="bahraini">Bahraini</option>
                          <option value="barbadian">Barbadian</option>
                          <option value="barbudans">Barbudans</option>
                          <option value="batswana">Batswana</option>
                          <option value="belarusian">Belarusian</option>
                          <option value="belgian">Belgian</option>
                          <option value="belizean">Belizean</option>
                          <option value="beninese">Beninese</option>
                          <option value="bhutanese">Bhutanese</option>
                          <option value="bolivian">Bolivian</option>
                          <option value="bosnian">Bosnian</option>
                          <option value="brazilian">Brazilian</option>
                          <option value="british">British</option>
                          <option value="bruneian">Bruneian</option>
                          <option value="bulgarian">Bulgarian</option>
                          <option value="burkinabe">Burkinabe</option>
                          <option value="burmese">Burmese</option>
                          <option value="burundian">Burundian</option>
                          <option value="cambodian">Cambodian</option>
                          <option value="cameroonian">Cameroonian</option>
                          <option value="canadian">Canadian</option>
                          <option value="cape verdean">Cape Verdean</option>
                          <option value="central african">Central African</option>
                          <option value="chadian">Chadian</option>
                          <option value="chilean">Chilean</option>
                          <option value="chinese">Chinese</option>
                          <option value="colombian">Colombian</option>
                          <option value="comoran">Comoran</option>
                          <option value="congolese">Congolese</option>
                          <option value="costa rican">Costa Rican</option>
                          <option value="croatian">Croatian</option>
                          <option value="cuban">Cuban</option>
                          <option value="cypriot">Cypriot</option>
                          <option value="czech">Czech</option>
                          <option value="danish">Danish</option>
                          <option value="djibouti">Djibouti</option>
                          <option value="dominican">Dominican</option>
                          <option value="dutch">Dutch</option>
                          <option value="east timorese">East Timorese</option>
                          <option value="ecuadorean">Ecuadorean</option>
                          <option value="egyptian">Egyptian</option>
                          <option value="emirian">Emirian</option>
                          <option value="equatorial guinean">Equatorial Guinean</option>
                          <option value="eritrean">Eritrean</option>
                          <option value="estonian">Estonian</option>
                          <option value="ethiopian">Ethiopian</option>
                          <option value="fijian">Fijian</option>
                          <option value="filipino">Filipino</option>
                          <option value="finnish">Finnish</option>
                          <option value="french">French</option>
                          <option value="gabonese">Gabonese</option>
                          <option value="gambian">Gambian</option>
                          <option value="georgian">Georgian</option>
                          <option value="german">German</option>
                          <option value="ghanaian">Ghanaian</option>
                          <option value="greek">Greek</option>
                          <option value="grenadian">Grenadian</option>
                          <option value="guatemalan">Guatemalan</option>
                          <option value="guinea-bissauan">Guinea-Bissauan</option>
                          <option value="guinean">Guinean</option>
                          <option value="guyanese">Guyanese</option>
                          <option value="haitian">Haitian</option>
                          <option value="herzegovinian">Herzegovinian</option>
                          <option value="honduran">Honduran</option>
                          <option value="hungarian">Hungarian</option>
                          <option value="icelander">Icelander</option>
                          <option value="indonesian">Indonesian</option>
                          <option value="iranian">Iranian</option>
                          <option value="iraqi">Iraqi</option>
                          <option value="irish">Irish</option>
                          <option value="israeli">Israeli</option>
                          <option value="italian">Italian</option>
                          <option value="ivorian">Ivorian</option>
                          <option value="jamaican">Jamaican</option>
                          <option value="japanese">Japanese</option>
                          <option value="jordanian">Jordanian</option>
                          <option value="kazakhstani">Kazakhstani</option>
                          <option value="kenyan">Kenyan</option>
                          <option value="kittian and nevisian">Kittian and Nevisian</option>
                          <option value="kuwaiti">Kuwaiti</option>
                          <option value="kyrgyz">Kyrgyz</option>
                          <option value="laotian">Laotian</option>
                          <option value="latvian">Latvian</option>
                          <option value="lebanese">Lebanese</option>
                          <option value="liberian">Liberian</option>
                          <option value="libyan">Libyan</option>
                          <option value="liechtensteiner">Liechtensteiner</option>
                          <option value="lithuanian">Lithuanian</option>
                          <option value="luxembourger">Luxembourger</option>
                          <option value="macedonian">Macedonian</option>
                          <option value="malagasy">Malagasy</option>
                          <option value="malawian">Malawian</option>
                          <option value="malaysian">Malaysian</option>
                          <option value="maldivan">Maldivan</option>
                          <option value="malian">Malian</option>
                          <option value="maltese">Maltese</option>
                          <option value="marshallese">Marshallese</option>
                          <option value="mauritanian">Mauritanian</option>
                          <option value="mauritian">Mauritian</option>
                          <option value="mexican">Mexican</option>
                          <option value="micronesian">Micronesian</option>
                          <option value="moldovan">Moldovan</option>
                          <option value="monacan">Monacan</option>
                          <option value="mongolian">Mongolian</option>
                          <option value="moroccan">Moroccan</option>
                          <option value="mosotho">Mosotho</option>
                          <option value="motswana">Motswana</option>
                          <option value="mozambican">Mozambican</option>
                          <option value="namibian">Namibian</option>
                          <option value="nauruan">Nauruan</option>
                          <option value="new zealander">New Zealander</option>
                          <option value="ni-vanuatu">Ni-Vanuatu</option>
                          <option value="nicaraguan">Nicaraguan</option>
                          <option value="nigerien">Nigerien</option>
                          <option value="north korean">North Korean</option>
                          <option value="northern irish">Northern Irish</option>
                          <option value="norwegian">Norwegian</option>
                          <option value="omani">Omani</option>
                          <option value="palauan">Palauan</option>
                          <option value="panamanian">Panamanian</option>
                          <option value="papua new guinean">Papua New Guinean</option>
                          <option value="paraguayan">Paraguayan</option>
                          <option value="peruvian">Peruvian</option>
                          <option value="polish">Polish</option>
                          <option value="portuguese">Portuguese</option>
                          <option value="qatari">Qatari</option>
                          <option value="romanian">Romanian</option>
                          <option value="russian">Russian</option>
                          <option value="rwandan">Rwandan</option>
                          <option value="saint lucian">Saint Lucian</option>
                          <option value="salvadoran">Salvadoran</option>
                          <option value="samoan">Samoan</option>
                          <option value="san marinese">San Marinese</option>
                          <option value="sao tomean">Sao Tomean</option>
                          <option value="saudi">Saudi</option>
                          <option value="scottish">Scottish</option>
                          <option value="senegalese">Senegalese</option>
                          <option value="serbian">Serbian</option>
                          <option value="seychellois">Seychellois</option>
                          <option value="sierra leonean">Sierra Leonean</option>
                          <option value="singaporean">Singaporean</option>
                          <option value="slovakian">Slovakian</option>
                          <option value="slovenian">Slovenian</option>
                          <option value="solomon islander">Solomon Islander</option>
                          <option value="somali">Somali</option>
                          <option value="south african">South African</option>
                          <option value="south korean">South Korean</option>
                          <option value="spanish">Spanish</option>
                          <option value="sudanese">Sudanese</option>
                          <option value="surinamer">Surinamer</option>
                          <option value="swazi">Swazi</option>
                          <option value="swedish">Swedish</option>
                          <option value="swiss">Swiss</option>
                          <option value="syrian">Syrian</option>
                          <option value="taiwanese">Taiwanese</option>
                          <option value="tajik">Tajik</option>
                          <option value="tanzanian">Tanzanian</option>
                          <option value="thai">Thai</option>
                          <option value="togolese">Togolese</option>
                          <option value="tongan">Tongan</option>
                          <option value="trinidadian or tobagonian">Trinidadian or Tobagonian</option>
                          <option value="tunisian">Tunisian</option>
                          <option value="turkish">Turkish</option>
                          <option value="tuvaluan">Tuvaluan</option>
                          <option value="ugandan">Ugandan</option>
                          <option value="ukrainian">Ukrainian</option>
                          <option value="uruguayan">Uruguayan</option>
                          <option value="uzbekistani">Uzbekistani</option>
                          <option value="venezuelan">Venezuelan</option>
                          <option value="vietnamese">Vietnamese</option>
                          <option value="welsh">Welsh</option>
                          <option value="yemenite">Yemenite</option>
                          <option value="zambian">Zambian</option>
                          <option value="zimbabwean">Zimbabwean</option>
                        </select>
                      </div>
                      <div class="col-sm-6 form-group">
                        <label for="where_did_hear"> Where did you hear about us? <span class="red">*</span> </label>
                        <select class="form-control" name="where_did_hear" id="where_did_hear">
                          <option value="Radio">Radio</option>
                          <option value="Website">Website </option>
                          <option value="Social Media">Social Media </option>
                          <option value="Google Search">Google Search </option>
                          <option value="SMS">SMS </option>
                          <option value="WhatsApp">WhatsApp </option>
                          <option value="From a Friend">From a Friend </option>
                          <option value="Others">Others </option>
                        </select>
                      </div>
                    </div>
                    <div class="row">
                      <div class="col-sm-6 col-md-6 col-xs-6 form-group">
                        <label for="name">Category <span class="red">*</span> </label>
                        <ul>
                        <?php foreach($catList as $cat){?>
                          <div class="Header--wrapper">
                            <div class="Header--start-small">
                              <li style=" font-weight:bold; margin-left:30px;font-family: 'Montserrat', sans-serif;"><?php echo $cat->name?></li>
                            </div>
                            <div class="Arrow"></div>
                          </div>
                         <?php } ?>
                        </ul>
                      </div>
                      <div class="col-sm-6 col-md-6 col-xs-6 form-group">
                        <label for="name"> Restaurant Name </label>
                        <?php foreach($catList as $cat){?>
                        <input type="text" class="form-control" autocomplete="off" list="cat_val_list_2" id="cat_val<?php echo $cat->id?>" name="cat_val[<?php echo $cat->id?>]" maxlength="50" style="margin-bottom:6px;">
                        

                        <?php } ?>
                      </div>
                    </div>
                    <div class="row">
                      <div class="col-sm-12 form-group" style="text-transform:none;  color:#000; font-size:12px; font-weight:600;font-family: 'Montserrat', sans-serif;">
                        <input type="checkbox" name="checkbox" value="check" id="agree"  /><span class="red">*</span>
                        I have read and agree to the <a href="#" style="text-decoration:underline;font-family: 'Montserrat', sans-serif; ">Terms and Conditions</a> </div>
                    </div>
                    <div class="row" style="margin-top:10px;">
                      <div class="col-sm-12 form-group" style="padding-bottom:20PX;">
                      <input type="hidden" name="register_from" value="listener" id="register_from" /> 
                        <button type="submit" class="btn btn-lg btn-success btn-block" id="btnContactUs">REGISTER </button>
                      </div>
                    </div>
                  </form>
                </div>
                <div class="clear"></div>
              </div>
            </div>
            
            
            <div class="single-offer-category-item isotope-item cat2">
              <div class="single-offer-item" style=" position:relative;">
                <div class="single-offer-details">
                  <div class="single-offer-title">
                    <div>
                      <form role="form" method="post" id="reused_form_owner" name="reused_form_owner" style="margin-top:15px;">
                        
                       
                           <div class="row ">
                              <div class="col-sm-6 form-group">
                                <label for="category"> Category <span class="red">*</span> </label>
                                <select class="form-control" name="category[]">
                                 <?php foreach($catList as $cat){?>
                                  <option value="<?php echo $cat->id?>"><?php echo $cat->name?></option>
                                <?php } ?>
                                </select>
                              </div>
                              <div class="col-sm-6 form-group container1" >
                                <label> Restaurant Name<span class="red">*</span> </label>
                                <input class="form-control" list="cat_val_list_2" maxlength="50" name="rest_name[]" >
                                <span style="float:right;"><a href="javascript:void(0);" class="add2" style="font-size:12px; color:#333; text-transform:capitalize; font-weight:bold; font-family: 'Montserrat', sans-serif !important;" ><span style="margin-right:5px; vertical-align:middle; float:left; "><img src="images/add.png"></span>Nominate More</a></span> </div>
                            </div>
                             
                             <div class="contents2">
                             
                       		 </div>
                        <script>
            $(document).ready(function() {
                $(".add2").click(function() {
                    var data = '<div class="row"><div class="col-sm-6 form-group"><label for="email"> Category <span class="red">*</span></label><select class="form-control" name="category[]"><option value="1">Best Biryani</option><option value="2">Best Chinese</option><option value="3">Best Kababs</option><option value="4">Best Fine Dining Indian Restaurant</option><option value="5">Best Thali</option><option value="6">Best Dessert</option><option value="7">Best Arabic Food</option><option value="8">Best Coffee</option><option value="9">Best Chat</option></select></div><div class="col-sm-6 form-group"><label for="email"> Restaurant Name <span class="red">*</span> </label><input class=" form-control" maxlength="50" name="rest_name[]" list="cat_val_list_2"></div><span class="rem2" ><a href="javascript:void(0);" ><img src="images/Close.png" style="float:right; margin-right:20px; margin-top:-10px; "></a></span></div>';
					$(".contents2").append(data);
                });
            });

$('.contents2').on('click', '.rem2', function() {
  $(this).parent("div").remove();
});
</script>
 
                        <div class="row">
                          <div class="col-sm-6 col-md-6 form-group">
                            <label for="name">Name <span class="red">*</span> </label>
                            <input type="text" class="form-control" required id="name" name="name" maxlength="50">
                          </div>
                          <div class="col-sm-6 form-group">
                            <label for="contact"> Contact Number <span class="red">*</span> </label>
                            <input type="text" class="form-control" required id="contact" name="contact" maxlength="50">
                          </div>
                        </div>
                        <div class="row">
                          <div class="col-sm-6 col-md-6 form-group">
                            <label for="email"> Email ID <span class="red">*</span> </label>
                            <input type="text" class="form-control" required id="email" name="email" maxlength="50">
                          </div>
                          <div class="col-sm-6 col-md-6 form-group">
                            <label for="designation"> Designation <span class="red">*</span> </label>
                            <select id="designation" name="designation" class="form-control">
                              <option value="Owner">Owner </option>
                              <option value="Manager">Manager </option>
                            </select>
                          </div>
                        </div>
                        <div class="row">
                          <div class="col-sm-6 form-group">
                            <label for="address"> Office Address <span class="red">*</span> </label>
                            <input type="text" class="form-control" id="address" name="address" required maxlength="50">
                          </div>
                          <div class="col-sm-6 form-group">
                            <label for="where_did_hear"> Where did you hear about us? <span class="red">*</span> </label>
                            <select name="where_did_hear" id="where_did_hear" class="form-control">
                              <option value="Radio">Radio</option>
                              <option value="Website">Website </option>
                              <option value="Social Media">Social Media </option>
                              <option value="Google Search">Google Search </option>
                              <option value="SMS">SMS </option>
                              <option value="WhatsApp">WhatsApp </option>
                              <option value="From a Friend">From a Friend </option>
                              <option value="Others">Others </option>
                            </select>
                          </div>
                        </div>
                        <div class="row">
                          <div class="col-sm-12 form-group" style="text-transform:none;  color:#000; font-size:12px; font-weight:600;font-family: 'Montserrat', sans-serif;">
                            <input type="checkbox" name="agree" required value="check" id="agree"  /><span class="red">*</span>
                            I have read and agree to the <a href="#" style="text-decoration:underline;font-family: 'Montserrat', sans-serif; ">Terms and Conditions</a> </div>
                        </div>
                        <div class="row" style="margin-top:10px;">
                          <div class="col-sm-12 form-group" style="padding-bottom:20PX;">
                          <input type="hidden" name="register_from" value="owner" id="register_from" /> 
                            <button type="submit" class="btn btn-lg btn-success btn-block" id="btnContactUs">REGISTER </button>
                          </div>
                        </div>
                      </form>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <datalist id="cat_val_list_2">
                        <?php  foreach($restaurantList as $restaurant){?>
                          <option value="<?php echo $restaurant->name?>"><?php echo $restaurant->name?></option>
                          <?php } ?>
                        </datalist>
  <?php include 'common/footer.php';?>
<script type="text/javascript">
function hideSuggestions(id){
	$("#result"+id).html('');
}
</script>