<?php
session_start();
$value = "blogger";
if (isset($_COOKIE["cookieblog"]))
  {
 $cookie = "yes";
  }
else
  {
	setcookie("cookieblog",$value, time()+(86400 * 7));
 $cookie = "no";
// A way to view all cookies
  }

include "centralconnect.php";
$u_agent = $_SERVER['HTTP_USER_AGENT'];
 if(preg_match('/MSIE/i',$u_agent) && !preg_match('/Opera/i',$u_agent)) 
    { 
        $bname = 'Internet Explorer'; 
        $ub = "MSIE"; 
    } 

$uniqueid1 = mysql_real_escape_string($_GET['uniqueid1']); // a-1


if ($uniqueid1 =="")
{
	echo '<script type="text/javascript">window.location="searchrestaurant.php";</script>';

}
@$_SESSION['REMOTE_ADDR']=$_SERVER['REQUEST_REMOTE_ADDR'];
@$email = $_SESSION['username'];

if ($email !="")
{

$sql1312 = "Select * from kohincom_centralkreserve.users where email='$email'";
$res1312 = mysql_query($sql1312) or die(mysql_error());
$num1312 = mysql_num_rows($res1312);
if ($num1312 > 0)
	{
		$row1312 = mysql_fetch_array($res1312);
		
		$title = $row1312['title'];
		$name = $row1312['name'];
		
		$email = $row1312['email'];
		$phno = $row1312['phone'];
	}
}
@$_SESSION['REMOTE_ADDR']=$_SERVER['REQUEST_REMOTE_ADDR'];

@$ip=$_SERVER['REMOTE_ADDR'];

@$booking = mysql_real_escape_string($_GET['booking']); // a-2

if($booking!="" && $booking!='1')
{

	if ($_SESSION['vid'] !="")
	{
	$vid = $_SESSION['vid'];	
	}
	else
	{
	$vid = mt_rand(10000000, 99999999);	
	$_SESSION['vid'] = $vid;	
	}	
	$_SESSION['booking'] = @$booking;
	
	$sql7s = "Select * from kohincom_blogger.bloggerinfo where bloggerid='$booking'";
	$res7s = mysql_query($sql7s) or die(mysql_error());
	$row7s = mysql_fetch_array($res7s);
	$num7s = mysql_num_rows($res7s);
	if ($num7s > 0)
	{
	$visitcomissionalblogger = $row7s['visitcomissionvalueblogger'];
	$visitcomissionalreference = $row7s['visitcomissionreference'];
	$visitors7s = $row7s['visitors'];
	
	$paidblogger =$row7s['paidblogger'] + $visitcomissionalblogger;
	$bloggerreference = $row7s['reference'];
	
	$sql7se = "Select * from kohincom_blogger.bloggerinfo where bloggerid='$bloggerreference'";
	$res7se = mysql_query($sql7se) or die(mysql_error());
	$row7se = mysql_fetch_array($res7se);
	$num7se = mysql_num_rows($res7se);
	
	$paidreference =$row7se['paidblogger'] + $visitcomissionalreference;
	
	
	
	$totalvisitors = $visitors7s + 1;
	
	
	
	$url = $_SERVER['REQUEST_URI'];
		$timezone = 'Asia/Kuala_Lumpur';
if(function_exists('date_default_timezone_set')) date_default_timezone_set($timezone);

$todaydate = date('Y/m/d h:i:s');
	
	
	if ($cookie == "no")
	{
	
	$sql34 = "Update kohincom_blogger.bloggerinfo set visitors='$totalvisitors', paidblogger='$paidblogger' where bloggerid='$booking'";
	if (!mysql_query($sql34))
	{
		die(mysql_error());
	}
	$sql34g = "Update kohincom_blogger.bloggerinfo set  paidblogger='$paidreference' where bloggerid='$bloggerreference'";
	if (!mysql_query($sql34g))
	{
		die(mysql_error());
	}
	
		
	$datex = date('m/d/Y');	
$sql098 = "Insert into kohincom_blogger.visitorinfo (bloggerid,referenceid,vid,ip,datetime,date,comissionvalue,refcomissionvalue,landingpage)
		values ('$booking','$bloggerreference','$vid','$ip','$todaydate','$datex','$visitcomissionalblogger','$visitcomissionalreference','$url') ";
			if(!mysql_query($sql098))
				{
					die(mysql_error());
				}
				
	}
	}
}


if ($booking != "" && $booking < 100)
{
	$booking = 1;
}
else
{
	$booking = 0;
}
$sql22 = "Select * from databasename where uniqueid = '$uniqueid1'";
$result22 = mysql_query($sql22) or die(mysql_error());
$row22 = mysql_fetch_array($result22);
$dbname = $row22['dbname'];

$restaurant = $row22['restaurantname'];

$sql2233 = "Select * from restaurantinfo where restaurant = '$restaurant'";
$result2233 = mysql_query($sql2233) or die(mysql_error());
$row2233 = mysql_fetch_array($result2233);


include"connect.php";

if ($_SERVER['REQUEST_METHOD'] == 'POST') {

// Get values from form submitted form 

@$title=$_POST['title'];
@$name=$_POST['name'];
@$phno=$_POST['phno'];
@$email=$_POST['email'];
@$loyalty = $_POST['loyality'];
@$dine=$_POST['hiddendine'];
@$date = $_POST['datepicker'];
@$h1=$_POST['hour1'];
@$m1=$_POST['minutes1'];
@$h2=$_POST['hour2'];
@$m2=$_POST['minutes2'];
@$adultqty = $_POST['guest'];

@$kidqty= $_POST['kids'];
@$branch = $_POST['branch'];
@$remarks =$_POST['remarks'];



//As our date came from datepicker with format of mm/dd/yyyy and our mysql databse has 3 seperate coloumns for day,month and year I used php substr command to seperate these three parts and save it to 3 different variables.
$month =  substr($date, 0, 2);
$day=  substr($date, 3, 2);
$year =  substr($date, 6, 4);



if (($dine == '-Select-' or $date =="") or ($h1 == 'Select' or $h1 =="") or ($h2 == 'Select' or $h2 =="") or ($h2 < $h1) or ($m1 == 'Select' or $m1 =="") 
or ($m2 == 'Select' or $m2 =="") )
{
	$openform = '1';
	echo '<script type="text/javascript"> alert ("Please Fill up All Required Fields!");</script>';
	
}
elseif (($h1 == $h2 &&  $m1 == $m2))
{
$openform = '1';
echo '<script type="text/javascript"> alert ("Please Select Proper Timings");</script>';
}
else
{

@$vouchercode11 = $_POST['vouchercode11'];
@$vouchercode11 = mysql_real_escape_string($vouchercode11);
@$vouchertype11 = $_POST['vouchertype11'];
@$vouchertype11 = mysql_real_escape_string($vouchertype11);
@$vouchercode22 = $_POST['vouchercode22'];
@$vouchercode22 = mysql_real_escape_string($vouchercode22);
@$vouchertype22 = $_POST['vouchertype22'];
@$vouchertype22 = mysql_real_escape_string($vouchertype22);
@$vouchercode33 = $_POST['vouchercode33'];
@$vouchercode33 = mysql_real_escape_string($vouchercode33);
@$vouchertype33 = $_POST['vouchertype33'];
@$vouchertype33 = mysql_real_escape_string($vouchertype33);
@$vouchercode44 = $_POST['vouchercode44'];
@$vouchercode44 = mysql_real_escape_string($vouchercode44);
@$vouchertype44 = $_POST['vouchertype44'];
@$vouchertype44 = mysql_real_escape_string($vouchertype44);
@$vouchercode55 = $_POST['vouchercode55'];
@$vouchercode55 = mysql_real_escape_string($vouchercode55);
@$vouchertype55 = $_POST['vouchertype55'];
@$vouchertype55 = mysql_real_escape_string($vouchertype55);
@$vouchercode66 = $_POST['vouchercode66'];
@$vouchercode66 = mysql_real_escape_string($vouchercode66);
@$vouchertype66 = $_POST['vouchertype66'];
@$vouchertype66 = mysql_real_escape_string($vouchertype66);
@$vouchercode77 = $_POST['vouchercode77'];
@$vouchercode77 = mysql_real_escape_string($vouchercode77);
@$vouchertype77 = $_POST['vouchertype77'];
@$vouchertype77 = mysql_real_escape_string($vouchertype77);
@$vouchercode88 = $_POST['vouchercode88'];
@$vouchercode88 = mysql_real_escape_string($vouchercode88);
@$vouchertype88 = $_POST['vouchertype88'];
@$vouchertype88 = mysql_real_escape_string($vouchertype88);

$title = mysql_real_escape_string($title);
$name = mysql_real_escape_string($name);
$phno = mysql_real_escape_string($phno);
$email = mysql_real_escape_string($email);
$loyalty = mysql_real_escape_string($loyalty);
$dine = mysql_real_escape_string($dine);
$date = mysql_real_escape_string($date);
$h1 = mysql_real_escape_string($h1);
$m1 = mysql_real_escape_string($m1);
$h2 = mysql_real_escape_string($h2);
$m2 = mysql_real_escape_string($m2);
@$adultqty = mysql_real_escape_string($adultqty);
$kidqty = mysql_real_escape_string($kidqty);
$branch = mysql_real_escape_string($branch);
$remarks = mysql_real_escape_string($remarks);

$sql438 = "Select * from kohincom_centralkreserve.allusers where email ='$email' ";
$res438 = mysql_query($sql438) or die(mysql_error());
$num438 = mysql_num_rows($res438);
if ($num438  == 0)
{
$sql439 = "Insert into kohincom_centralkreserve.allusers (name,email,flag) values ('$name','$email','$restaurant')";
if(!mysql_query($sql439))
{
die(mysql_error());
}
}
if ($vouchercode11=="")
	{
		$vouchercode11 = "NULL1";	
	}
if ($vouchercode22=="")
	{
		$vouchercode22 ="NULL1";	
	}
if ($vouchercode33 =="" )
	{
		$vouchercode33 = "NULL1";	
	}
if ($vouchercode44 =="" )
	{
		$vouchercode44 = "NULL1";	
	}
if ($vouchercode55 =="" )
	{
		$vouchercode55 = "NULL1";	
	}
if ($vouchercode66 =="" )
	{
		$vouchercode66 = "NULL1";	
	}

if ($vouchercode77 =="" )
	{
		$vouchercode77 = "NULL1";	
	}
if ($vouchercode88 =="" )
	{
		$vouchercode88= "NULL1";	
	}	


$referenceno = rand();
//check loyaltycard number exists or not
if($loyalty != ""){  
                    $sql6 = "Select * from loyality";
                    $result6 = mysql_query($sql6);
                    $num6 = mysql_num_rows($result6);
                    $count6 = 0;
                    $controlmembership=0; //this flag shows a member with this details existed in our server or not. If it is 1 it means existed if it is zero it means not existed
                     while (($count6<$num6) && ($controlmembership == 0)){
                                                                          $count6++;
                                                                          $row6 = mysql_fetch_array($result6);
                                                                          $dbloyalty = $row6['loyality'];
                                                                          if($loyalty == $dbloyalty) { // it checks how much the member discount percentage is for this dine type and this total guest number and will save it in $memberpercent.
                                                                                                      $controlmembership++;
                                                                                                      }
                                                                          }
                       if($controlmembership == 0) { //it couldn't found matched loyalty card number and email address 
                                                    die("The member number is not matched with our members database. Please recheck the information you entered or leave member card number section empty in the form");
                                                    }
                    }
					else {$loyalty = "NULL1";}
$sql7="Select * from dine where dit = '$dine' and branch='$branch'"; // CALLING DINE TYPE SELECTED BY CUSTOMER TO CHECK PROMOTIONS DATES & RATES / DISCOUNTS/ PAYMENT METHOD//..
$result7=mysql_query($sql7);
$row7=mysql_fetch_array($result7);
if ($row7['payment'] == "alacarte") {
$paymenttype = "Minimum Deposit";
} 

else {
$paymenttype =  $row7['payment'];
}
// select a right guest field foradult qty
if (($row7['kids']=='same') && ($row7['fullkid']=='same')) {
@$adultqty = $_POST['guest2'];
$adultqty = mysql_real_escape_string($adultqty);
}
else {
@$adultqty = $_POST['guest'];
$adultqty = mysql_real_escape_string($adultqty);
}

$totalguestlimit = $adultqty + $kidqty;
$totalguest09 = 0;
$sql09 = "Select * from reservation where day ='$day' and month='$month' and year= '$year' and paymentstatus !='' and paymentstatus !='Cancelled'";
$res09 = mysql_query($sql09) or die(mysql_error());
while($row09 = mysql_fetch_array($res09))
{
	$totalguest09 = $totalguest09 + $row09['guest'] + $row09['kids'] + $row09['vipadultqty'] +
	 $row09['vipkidqty'] + $row09['vipguest'];
	
}




$sql009 = "Select * from kohincom_centralkreserve.dine where dit = '$dine' and restaurant ='$restaurant' and
branch='$branch' and maxguest !='NULL1' ";
$res009 = mysql_query($sql009) or die(mysql_error());
$row009 = mysql_fetch_array($res009);
$num009 = mysql_num_rows($res009);
if ($num009 > 0) 
{
@$maxguest009  = $row009['maxguest'];
}
else
{
$maxguest009 = 9999999;
}
if($vouchercode11 != "NULL1"){
$sql0091 = "Select * from voucher where branch='$branch' AND maxlimit!='NULL1' AND vouchertype='$vouchertype11'";
$res0091 = mysql_query($sql0091) or die(mysql_error());
$row0091 = mysql_fetch_array($res0091);
$num0091 = mysql_num_rows($res0091);
     if ($num0091 > 0) 
     {
     @$maxlimit0019  = $row0091['maxlimit'];
     }
     else
     {
     $maxlimit0019  = 9999999;
     }
}
else
{
$maxlimit0019  = 9999999;
}

$totalguest009 = $totalguest09 + $totalguestlimit;

$totalguest091 = 0;

$sql091 = "Select * from reservation where day ='$day' and month='$month' and year= '$year' and voucher ='1' and paymentstatus !='' and paymentstatus !='Cancelled'";
$res091 = mysql_query($sql091) or die(mysql_error());
while($row091 = mysql_fetch_array($res091))
{
	$totalguest091 = $totalguest091 + $row091['guest'] + $row091['kids'] + $row091['vipadultqty'] +
	 $row091['vipkidqty'] + $row091['vipguest'];
	
}


if ($totalguest009 > $maxguest009 ) // p-1 
{
	$openform = '1'; 
	echo'<script> alert("Sorry The restaurant is fully booked for this date and time for this dining offer.");</script>';
	//Sorry The restaurant is fully booked for this date and time for this dining offer.
}
else
{

if( $vouchercode11 !="NULL1" or $vouchercode22!="NULL1" or $vouchercode33!="NULL1" or $vouchercode44!="NULL1" or $vouchercode55!="NULL1" or
$vouchercode66!="NULL1" or $vouchercode77!="NULL1" or $vouchercode88!="NULL1" )
{
	$totalguest0091 = $totalguest091 + $totalguestlimit;
	
}

if ($totalguest0091 > $maxlimit0019 )
{	
$openform = '1'; 
		echo'<script> alert("Sorry The restaurant is fully booked for this date and time for this dining offer.Please change your booking date.");</script>';
}
else
{

if (!isset($_SESSION['uniqueid']))
{

$uniqueid = md5(uniqid());

$_SESSION['uniqueid']= $uniqueid ;
}
else
{
$uniqueid  =$_SESSION['uniqueid'];
}



$sql898989 = "Select * from reservation where uniqueid='$uniqueid' and paymentstatus =''";
$res898989 = mysql_query($sql898989) or die(mysql_error());
$row898989 = mysql_fetch_array($res898989);
$num898989 = mysql_num_rows($res898989);



if ($num898989 == 0)
{  
$uniqueid = md5(uniqid());

$_SESSION['uniqueid']= $uniqueid ; 
                            
// save form data into reservation table
			$sql="INSERT INTO reservation (title,name,phno,email,loyality,dine,paymenttype,day,month, year, h1, m1, h2, m2, guest,kids, branch, remarks,booking,referenceno ) VALUES
			( '$title' , '$name' , '$phno' ,'$email','$loyalty','$dine' , '$paymenttype', '$day', '$month','$year','$h1','$m1','$h2','$m2','$adultqty', '$kidqty' ,'$branch','$remarks','$booking','$referenceno')";
		   if(!mysql_query($sql))
		   {
			   die('Error: ' .mysql_error());			  
		   }
		   $id = mysql_insert_id();
		   
		   $sqla="INSERT INTO kohincom_centralkreserve.reservation (title,name,phno,email,loyality,dine,paymenttype,day,month, year, h1, m1, h2, m2, guest,kids, branch,restaurant, remarks,booking , referenceno ) VALUES
			( '$title' , '$name' , '$phno' ,'$email','$loyalty','$dine' , '$paymenttype', '$day', '$month','$year','$h1','$m1','$h2','$m2','$adultqty', '$kidqty' ,'$branch','$restaurant','$remarks','$booking' ,'$referenceno')";
		   if(!mysql_query($sqla))
		   {
			   die('Error: ' .mysql_error());			  
		   }
		
//took current id from database
$idc = mysql_insert_id();





$totalguestqty = $adultqty + $kidqty;
if ($vouchercode11 !="NULL1" or $vouchercode22!="NULL1" or $vouchercode33!="NULL1" or $vouchercode44!="NULL1" or $vouchercode55!="NULL1" or
$vouchercode66!="NULL1" or $vouchercode77!="NULL1" or $vouchercode88!="NULL1" )
	{	 
		   $sql56="INSERT INTO vouchernumber (id, name,phno,email,branch,dine,guests,day,month,year, vouchercode11,vouchertype11, vouchercode22,vouchertype22,
		   vouchercode33,vouchertype33,vouchercode44,vouchertype44,vouchercode55,vouchertype55,vouchercode66,vouchertype66,
		   vouchercode77,vouchertype77,vouchercode88,vouchertype88) VALUES
		   ( '$uniqueid' , '$name' , '$phno' ,'$email' ,'$branch','$dine','$totalguestqty','$day', '$month','$year', '$vouchercode11' ,'$vouchertype11', '$vouchercode22' ,'$vouchertype22',
		   '$vouchercode33' ,'$vouchertype33', '$vouchercode44' ,'$vouchertype44','$vouchercode55' ,'$vouchertype55',
		   '$vouchercode66' ,'$vouchertype66', '$vouchercode77' ,'$vouchertype77','$vouchercode88' ,'$vouchertype88')";
		   if(!mysql_query($sql56))
		   {
			   die('Error: ' .mysql_error());			  
		   }
	}
mysql_query("UPDATE reservation set uniqueid='$uniqueid' WHERE id='$id'") or die(mysql_error);
mysql_query("UPDATE kohincom_centralkreserve.reservation set uniqueid='$uniqueid' WHERE id='$idc'") or die(mysql_error);

if ($vouchercode11 !="NULL1" or $vouchercode22!="NULL1" or $vouchercode33!="NULL1" or $vouchercode44!="NULL1" or $vouchercode55!="NULL1" or
$vouchercode66!="NULL1" or $vouchercode77!="NULL1" or $vouchercode88!="NULL1" )
	{   
		   mysql_query("UPDATE reservation set voucher='1' WHERE uniqueid='$uniqueid'") or die(mysql_error);
		   mysql_query("UPDATE kohincom_centralkreserve.reservation set voucher='1' WHERE uniqueid='$uniqueid'") or die(mysql_error);

	}

//send email section: 
	
	$reservationnum = $id +1000;
	

$to ="reservation@kreserve.com";
 $mailtitle= "Dear Support Team";
 @$subject= "You have 1 Pending booking from Kreserve"; 


$message = '
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
</style>
</head>
<body>

<div class="maindiv" style="max-width:550px;margin: 15px auto ;">
<div id="head" style="position:relative;background: rgb(153,0,0);width:550px;z-index:0;">
<img id="back" style="z-index:5;width:90px;" src="http://www.kreserve.com/images/backemails.png">
<div id="kname" style="font-family:Tahoma, Geneva, sans-serif;font-size:135%;position:relative;padding:0% 0 0 1%;width:25%;color:#fff;font-weight:bold;z-index:4;">KRESERVE</div></div>
<div id="thankyou" style="position:relative;margin:2% 0 0 22%;text-align:center;color:#ff9900;font-size:20px;z-index:6;width:291px;height:20px;font-family:Courier New, Courier, monospace;font-weight:bold;"> Dear '.$mailtitle.' You have got pending booking from Kreserve system. Kindly log-in to your Kreserve control panel to view details </div>

<div id="yourreserve" style="position:relative;margin:2% 0 0 19%;float:left;color:#333;font-size:18px;z-index:6;width:266px;height:20px;
font-family:Lucida Sans Unicode, Lucida Grande, sans-serif;">Reservation Number is:</div>
<div id="reservenum" style="position:relative;margin:2.2% 24%  0 0;float:right;overflow:auto;color:#333;font-size:13pt;z-index:5;font-family: Lucida Sans Unicode, Lucida Grande, sans-serif;">'.$reservationnum.'</div>




<table id="rounded-corner" style="font-family: Lucida Sans Unicode,Lucida Grande, Sans-Serif;font-size: 12px;margin: 7% 0% 0% 11%;width: 430px;text-align: left;border-collapse: collapse;position:relative;z-index:5;" summary="2007 Major IT Companies" Profit">
   
        <tfoot>
    	
    </tfoot>
    <tbody>
    <tr>
        	<td style="padding: 8px;background: #FF9900;border-top: 1px solid #FFcc66;color: #fff;">Name:</td>
            <td style="padding: 8px;background: #FF9900;border-top: 1px solid #FFcc66;color: #fff;">'.$name.'</td>
            </tr>
	
    	<tr>
        	<td style="padding: 8px;background: #FF9900;border-top: 1px solid #FFcc66;color: #fff;">Date Of booking:</td>
            <td style="padding: 8px;background: #FF9900;border-top: 1px solid #FFcc66;color: #fff;">'.$day.'-'.$month .'-'.$year.'</td>
            </tr>
        </tr>
        
        <tr>
        	<td style="padding: 8px;background: #FF9900;border-top: 1px solid #FFcc66;color: #fff;">Phone:</td>
            <td style="padding: 8px;background: #FF9900;border-top: 1px solid #FFcc66;color: #fff;">'.$phno.'</td>
        </tr>
        <tr>
        	<td style="padding: 8px;background: #FF9900;border-top: 1px solid #FFcc66;color: #fff;">E Mail:</td>
            <td style="padding: 8px;background: #FF9900;border-top: 1px solid #FFcc66;color: #fff;">'.$email.'</td>
        </tr>
        
         <tr>
        	<td style="padding: 8px;background: #FF9900;border-top: 1px solid #FFcc66;color: #fff;">Restaurant:</td>
            <td style="padding: 8px;background: #FF9900;border-top: 1px solid #FFcc66;color: #fff;">'.$restaurant.'</td>
            
        </tr>
         
         <tr>
        	<td style="padding: 8px;background: #FF9900;border-top: 1px solid #FFcc66;color: #fff;">Branch:</td>
            <td style="padding: 8px;background: #FF9900;border-top: 1px solid #FFcc66;color: #fff;">'.$branch.'</td>
        </tr>
    </tbody>
</table>

<div id="footer" style="background:#990000;width:550px;height:30px;margin:3.3% 0 0 0">
<div id="contact" style="color: rgb(255, 255, 255);font-size: 9pt;z-index: 5;font-family:Arial, Helvetica, sans-serif;width: 100%;margin: 1% 0%;text-align: center;">Kreserve.com | Phone : 03-42650388 | Email: support@kreserve.com</div></div>
<p style="color:#fff;">Kreserve.com</p>
</div>
</body>
</html>';     
   
// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'From:Kreserve Notification <reservation@kreserve.com>' . "\r\n";
$headers .= 'Bcc: reservation@kreserve.com' . "\r\n";

// Mail it
mail($to, $subject, $message, $headers);    

// end of mail section

}
else
{
	$sql="Update reservation set title='$title',name='$name',phno='$phno',email='$email',loyality='$loyalty',dine='$dine',
	paymenttype='$paymenttype',day='$day',month='$month', year='$year', h1='$h1', m1='$m1', h2='$h2', m2='$m2',
	 guest='$adultqty',kids='$kidqty', branch='$branch', remarks='$remarks',booking='$booking',referenceno='$referenceno'
	 where uniqueid='$uniqueid'";
		   if(!mysql_query($sql))
		   {
			   die('Error: ' .mysql_error());			  
		   }
		   
		   
		   $sql="Update kohincom_centralkreserve.reservation set title='$title',name='$name',phno='$phno',email='$email',loyality='$loyalty',dine='$dine',
	paymenttype='$paymenttype',day='$day',month='$month', year='$year', h1='$h1', m1='$m1', h2='$h2', m2='$m2',
	 guest='$adultqty',kids='$kidqty', branch='$branch', restaurant='$restaurant', remarks='$remarks',booking='$booking',referenceno='$referenceno'
	 where uniqueid='$uniqueid'";
		   if(!mysql_query($sql))
		   {
			   die('Error: ' .mysql_error());			  
		   }
		   
	
	$totalguestqty = $adultqty + $kidqty;
if ($vouchercode11 !="NULL1" or $vouchercode22!="NULL1" or $vouchercode33!="NULL1" or $vouchercode44!="NULL1" or $vouchercode55!="NULL1" or
$vouchercode66!="NULL1" or $vouchercode77!="NULL1" or $vouchercode88!="NULL1" )
	{
		$sql56=" Update vouchernumber set  name='$name',phno='$phno',email='$email',branch='$branch',
		dine='$dine',guests='$totalguestqty',day='$day',month='$month',year='$year', vouchercode11='$vouchercode11',
		vouchertype11='$vouchertype11', vouchercode22='$vouchercode22',vouchertype22='$vouchertype22',
		   vouchercode33='$vouchercode33',vouchertype33='$vouchertype33',vouchercode44='$vouchercode44',vouchertype44='$vouchertype44',
		   vouchercode55='$vouchercode55',vouchertype55='$vouchertype55',vouchercode66='$vouchercode66',vouchertype66='$vouchertype66',
		   vouchercode77='$vouchercode77',vouchertype77='$vouchertype77',vouchercode88='$vouchercode88',vouchertype88='$vouchertype88'
		   where id='$uniqueid'";
		   if(!mysql_query($sql56))
		   {
			   die('Error: ' .mysql_error());			  
		   }
	}
	if ($vouchercode11 !="NULL1" or $vouchercode22!="NULL1" or $vouchercode33!="NULL1" or $vouchercode44!="NULL1" or $vouchercode55!="NULL1" or
$vouchercode66!="NULL1" or $vouchercode77!="NULL1" or $vouchercode88!="NULL1" )
	{   
		   mysql_query("UPDATE reservation set voucher='1' WHERE uniqueid='$uniqueid'") or die(mysql_error);
		   mysql_query("UPDATE kohincom_centralkreserve.reservation set voucher='1' WHERE uniqueid='$uniqueid'") or die(mysql_error);

	}
	   
	
}
if ($row7['disablemapsection']=="1" && $vouchercode11=="NULL1" && $vouchercode22=="NULL1" && $vouchercode33=="NULL1" && $vouchercode44=="NULL1" && $vouchercode55=="NULL1" && $vouchercode66=="NULL1" && $vouchercode77=="NULL1" && $vouchercode88=="NULL1" ) { // p-2
echo '<script type="text/javascript">window.location="calculation.php?uniqueid='.$uniqueid.'& dbname='.$uniqueid1.'";</script>';
exit; 
}
else { //it says if map section is enabled go  to map page.
echo '<script type="text/javascript">window.location="reservation9.php?id='.$uniqueid.'& dbname='.$uniqueid1.'";</script>';
exit;

}
}// esle vocuher capcity closes
} // else max capacity closes

}// else closes....
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>


<meta name="generator" content="Kohitec R and D Team HTTP://www.kohitec.com">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

 <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.9.1.js"></script>
  <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<title>Reservation Form</title>
<script language="javascript" type="text/javascript">
function validateform() 
{
	var regexp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
   	var str1 =document.getElementById("email").value;	
	
	 if(document.form1.name.value =="")
  {
  alert("Name must be filled out");
  return false;
  }
  
  
  
  if(document.form1.phno.value =="")
  {
  alert("Phone number must be filled out");
  return false;
  }
  
   if (isNaN(document.form1.phno.value))
   {
      alert("Please enter a valid phone number");
      return false;
   }
  
   if (document.form1.phno.value.length < 5)
   {
      alert("Please enter a valid phone number");
      return false;
   }
   
   
    if(document.form1.email.value =="")
 	{
 	

 	
  	alert("Email must be filled out");
  	return false;
  	}
  	if (document.getElementById("email").value !=""  && (regexp.test(str1)) )
	{
	}	
  	else
  	{
  alert("Please Enter a Valid Email");
  return false;	
  	}
	$(".pagewrap14-15").css("display",'block');
	if (document.getElementById("notsame").style.display!="block" && document.getElementById("notsame2").style.display!="block")
	{
	$("#kidsame").css("display",'block');
	}
	$(".pagewrap14a").css("top",'0px');
		if (document.getElementById("pagewrap12-13").style.display!="block")
{
	document.getElementById("pagewrap12-13").style.display="block";
	document.getElementById("pagewrap114-115").style.display="block";
	document.getElementById("pagewrap1114-1115").style.display='block';
	document.getElementById("pagewrap16-17-18-19-20-21-22-23-24-25").style.display='block';
 return false;
}



if(document.getElementById("branch").value =="" ||  document.getElementById("branch").value =="-Select-")
 		 {
  	alert("Please Select a Branch");
  	return false;
  		}
	


  
if (document.getElementById("pagewrap12-13").style.display=="block")
{	
	 if (document.form1.datepicker.value == "")
   {
      alert("Please pickup the booking date from calendar");
      return false;
   }
	}
	


	
	if (document.getElementById("guest").style.display == "block")
	{
		var x = document.getElementById("guest").value;
	
	if ( x == "" || x == 0 || isNaN(x))
	{
			alert("Please add the quantity of Adults ");
			return false;
	}
	}
	
	if (document.getElementById("guest").style.display == "none")
	{
		var y = document.getElementById("guest2").value;
	
	if ( y == "" || y == 0 || isNaN(y))
	{
			alert("Please add the quantity of Guests  ");
			return false;
	}
	
	}

	if (document.getElementById("pagewrap12-13").style.display=="block")
{
   if (document.getElementById("terms").checked == false)
	{
		alert ("You must agree with the Terms & Conditions to make a reservation");
		return false;
	}
	else
	{
	//alert(document.form1.h1.value);
	 document.forms["form1"].submit();
	}
   }
   
  if((document.form1.h1.value == "Select") || (document.form1.h2.value == "Select"))
	{
		alert("Please Select Hours");
		return false;
	}
  
	if(document.form1.h1.value > document.form1.h2.value)
	{
		alert("Your Check-out time should be greater than check-in time");
		return false;
	}
	
	if((document.form1.h1.value == document.form1.h2.value) && (document.form1.m1.value >=  document.form1.m2.value))
	{
		alert("Your Check-out time should be greater than check-in time");
		return false;
	}
	


 }

</script>
<?php
$sql50 = "select * from logo";
$result50 = mysql_query($sql50) or die(mysql_error());
$num50 = mysql_num_rows($result50);

if($row50 = mysql_fetch_array($result50)) {
@$logopic = $row50['file'];  
if ($logopic !="")
{
if (@$row50['logowidth']== "NULL1") {
$logowidth = 120;
$ratio = $row50['logoratio'];
$logoheight = intval(120 / $ratio);
}
else {
@$logowidth = $row50['logowidth'];	
@$logoheight = $row50['logoheight'];
}
}
}
else { $logopic = "restaurant-logo.png";
$logowidth = 90;
$logoheight = 70; }
@$logowidth = $logowidth /10;
@$logoheight = $logoheight /10;

?>
<style>
.ui-widget-content {
    font-size: 14px;
}
.back {
	position: absolute;
	z-index: -10;
	left: 0px;
	top: 0px;
}

.button {
		width:12%;
	z-index: 3;
	float:left;
display:inline-block;
	margin:4% 0 0 0%;
	
}




a:link {color:#0000ff;}    /* unvisited link */
a:visited {color:#cccccc;} /* visited link */
a:hover {color:#111111;}   /* mouse over link */
a:active {color:#0000FF;}  /* selected link */



#parentwrap {
	overflow:hidden;
	margin:0 0 0 0%;
	width:100%;
	float:left;
	height:782px;
	background-image:url('./images/kreservebackreseve.png');
	-webkit-border-radius: 10px;
        -moz-border-radius: 10px;
        border-radius: 10px;
        background-position:center; 
	
}
#pagewrap
{
	max-width: 848px;
        margin: 0px auto;
        position: relative;
}
#pagewrap1
{
	width:100%;
	margin :6% 0 0 0%;
	font-family:Arial, Helvetica, sans-serif;
	
}
#pagewrap2 {	
z-index:5;
	position:relative;
	margin:-2% auto 6% 0%;
	color:white;
	width:100%;
	text-align:center;

background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAALElEQVQIW2P8P5PhPwMykGNgYEQRBAowPEIWhAqANEFUIglABLcDBYFakAEAwM8RF1MGjpwAAAAASUVORK5CYII=);
	height:81px;
	-webkit-border-bottom-right-radius: 10px;
        -webkit-border-bottom-left-radius: 10px;
        -moz-border-radius-bottomright: 10px;
        -moz-border-radius-bottomleft: 10px;
        border-bottom-right-radius: 10px;
        border-bottom-left-radius: 10px;

}
#poppop {
position: absolute;
height: 29px;
bottom: 4px;
right: 4px;
width: 60%;
background: #fff;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}

.halfCircleRight{
        padding: 0px 0px 0px 5px;
        position: relative;
        height: 20px;
        display: inline-block;
        width: 100%;
}
.maindropm1{
        margin:3px 0 0 0;
        width:157px;
        display: inline-block;
        
        
        }
.maindropm1:hover {


        margin:3px 0 0 0;
        width:157px;
        display: inline-block;
        }        
.maindropm2{
        margin: 3px 0px 0px 2px;
       display: inline-block;
        width: 162px;
        opacity:0.4;
        
}
.maindropm2:hover {
        margin: 3px 0px 0px 2px;
        display: inline-block;
        width: 162px;
        opacity:1;
}  
.maindropm3{
        margin:3px 0 0 3px;
        width:52px;
        display: inline-block;
        opacity:0.4;
        }
.maindropm3:hover {
        margin:3px 0 0 3px;
        width:52px;
        display: inline-block;
        opacity:1;
        }        
.maindropm4{
        margin: 3px 0px 0px 5px;
        display: inline-block;
        width:120px;
        opacity:0.4;
}
.maindropm4:hover {
        margin: 3px 0px 0px 5px;
        display: inline-block;
        width:120px;
        opacity:1;
}       
   
.maindrop{
        position:relative;
        font-family:'arial';
        font-size:85%;
        font-weight:bold;
        height:20px;
        background:#fff;
        color:#FFB84D;
        z-index:0;
        float:left;
        padding: 3px 0px 0px 0px;
        cursor:pointer;
        }
.maindrop:hover{
        position:relative;
        height:20px;
        background:#ff9900;
        z-index:0;
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px;
        border-radius: 5px;
        float:left;
        color:#fff;
        -webkit-transition: all 300ms ease-in-out 0s;
-moz-transition: all 300ms ease-in-out 0s;
-ms-transition: all 300ms ease-in-out 0s;
-0-transition: all 300ms ease-in-out 0s;
               }
#circle11 {
	width: 22px;
height: 22px;
background: none repeat scroll 0% 0% rgb(255, 153, 0);
border-radius: 50px;
color: rgb(255, 255, 255);
position: relative;
display: inline-block;
float: left;
font-family: arial;
font-size: 115%;
z-index: 10;
font-weight: bold;
margin: -2px 0px 0px 0px;
      }
#circle22 {
	width: 22px;
height: 22px;
background: none repeat scroll 0% 0% rgb(255, 153, 0);
border-radius: 50px;
color: rgb(255, 255, 255);
position: relative;
display: inline-block;
float: left;
font-family: arial;
font-size: 115%;
z-index: 10;
font-weight: bold;
margin: -2px 0px 0px 0px;       
}
#circle33{
	width: 22px;
height: 22px;
background: none repeat scroll 0% 0% rgb(255, 153, 0);
border-radius: 50px;
color: rgb(255, 255, 255);
position: relative;
display: inline-block;
float: left;
font-family: arial;
font-size: 115%;
z-index: 10;
font-weight: bold;
margin: -2px 0px 0px 0px;
}
#circle44 {
	width: 22px;
height: 22px;
background: none repeat scroll 0% 0% rgb(255, 153, 0);
border-radius: 50px;
color: rgb(255, 255, 255);
position: relative;
display: inline-block;
float: left;
font-family: arial;
font-size: 115%;
z-index: 10;
font-weight: bold;
margin: -2px 0px 0px 0px;
}


#pagewrap3{

	position: relative;
        z-index: 10;
        display: inline-block;
        float: left;
        width: 160px;
        height: 134px;
        margin: 9% 0px 0px 9%;
        background: none repeat scroll 0% 0% rgb(245, 245, 245);
        padding: 3px;
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px;
        border-radius: 5px;
	}
#pagewrap4-5{
width: 100%;
float: left;
display: inline-block;
margin: 0% 0px 0px 0%;
overflow: hidden;
}
#pagewrap4{
width: 47.5%;
margin: 0px 0px 0px 0%;
float: left;
display: inline-block;
padding: 10px 0px 10px 11px;
background: #f5f5f5;
font-weight: bold;
color: #999;

}
#pagewrap5{
width: 50%;
margin: 0px 0px 0px 0%;
float: left;
display: inline-block;
z-index: 10;
overflow: hidden;


}
select{
-webkit-appearance:none;
-moz-appearance:none;
-ms-appearance:none;
-o-appearance:none;
font-weight:bold;
font-family:arial;
font-size:100%;
color:#999;
}
#pagewrap6-7{
width: 100%;
float: left;
display: inline-block;
margin: -4px 0px 0px 0%;
}
#pagewrap6{
width: 47.5%;
margin: 0px 0px 0px 0%;
float: left;
display: inline-block;
padding: 10px 0px 10px 11px;
background:#f5f5f5;
font-weight: bold;
color: #999;
}
#pagewrap7{
width: 50%;
margin: -2px 0px 0px 0%;
float: left;
display: inline-block;
z-index:10;

}

#pagewrap8-9{
width: 100%;
float: left;
display: inline-block;
margin: -4px 0px 0px 0%;
}
#pagewrap8
{
width: 47.5%;
margin: -2px 0px 0px 0%;
float: left;
display: inline-block;
padding: 10px 0px 10px 11px;
background: #f5f5f5;
font-weight: bold;
color: #999;
}
#pagewrap9{
width: 50%;
margin: -4px 0px 0px 0%;
float: left;
display: inline-block;
z-index:10;
}
#pagewrap10-11{
width: 100%;
float: left;
display: inline-block;
margin: -4px 0px 0px 0%;
}
#pagewrap10{
width: 47.5%;
margin: -2px 0px 0px 0%;
float: left;
display: inline-block;
padding: 10px 0px 10px 11px;
background: #f5f5f5;
font-weight: bold;
color: #999;
}
#pagewrap11{
width: 50%;
margin: -4px 0px 0px 0%;
float: left;
display: inline-block;
z-index:10;
	
}
#pagewrap12-13
{
width: 100%;
float: left;
display: inline-block;
margin: -1% 0px 0px 0%;
<?php if (@$openform == '')
{
echo' display:none;';
}
else
{
	echo'display:block;';
}
?>
}

#pagewrap12{
width: 47.5%;
margin: -1px 0px 0px 0%;
float: left;
display: inline-block;
padding: 10px 0px 10px 11px;
background:#f5f5f5;
font-weight: bold;
color: #999;
	
}
#pagewrap13
{
width: 50%;
margin: 0px 0px 0px 0%;
float: left;
display: inline-block;
z-index: 10;
overflow: hidden;
	
}

.pagewrap14-15
{
width: 100%;
float: left;
display: inline-block;
margin: -2% 0px 0px 0%;
<?php if (@$openform == '')
{
echo' display:none;';
}
else
{
	echo'display:block;';
}
?>

}
.pagewrap141a-151a
{
	width:100%;
float:left;
display:inline-block;
	margin:1% 0 0 0%;
	
}
#pagewrap114-115
{
width: 100%;
float: left;
display: inline-block;
margin: -2% 0px 0px 0%;
overflow: hidden;
<?php if (@$openform == '')
{
echo' display:none;';
}
else
{
	echo'display:block;';
}
?>
}
#pagewrap114
{
 47.5%;
margin: 0px 0px 0px 0%;
float: left;
display: inline-block;
padding: 14px 0px 10px 11px;
background: none repeat scroll 0% 0% rgb(245, 245, 245);
font-weight: bold;
color: rgb(153, 153, 153);
font-size: 80%;
}
#pagewrap115
{
width: 30%;
margin: 0px 0px 0px 0%;
float: left;
display: inline-block;
z-index:10;
}



#pagewrap1114-1115
{
width: 100%;
float: left;
display: inline-block;
margin: -2% 0px 0px 0%;
overflow: hidden;
<?php if (@$openform == '')
{
echo' display:none;';
}
else
{
	echo'display:block;';
}
?>
}
#pagewrap1114
{
 47.5%;
margin: 0px 0px 0px 0%;
float: left;
display: inline-block;
padding: 10px 0px 10px 11px;
background: none repeat scroll 0% 0% rgb(245, 245, 245);
font-weight: bold;
color: rgb(153, 153, 153);
font-size: 80%;
}
#pagewrap1115
{
width: 42%;
margin: -2px 0px 0px 0%;
float: left;
display: inline-block;
z-index:10;
}

.pagewrap14-15a
{
	width:100%;
float:left;
display:inline-block;
	margin:0% 0 0 0%;
}
.pagewrap14
{
width: 47.5%;
margin: -1px 0px 0px 0%;
float: left;
display: inline-block;
padding: 12px 0px 12px 11px;
background:#f5f5f5;
font-weight: bold;
color: #999;
font-size:80%;
}

.pagewrap141
{
	width:0%;
float:left;
display:inline-block;
	margin:0% 0 0 10%;
	display:none;
}
.pagewrap14a
{
width: 14%;
float: left;
display: inline-block;
margin: -44% 0px 0px 100.8%;
text-align: center;
position: relative;
top: 124px;
}
.pagewrap15
{
width: 50%;
margin: 5px 0px 0px 0%;
float: left;
display: inline-block;
z-index:10;
}
.pagewrap151
{
	width:100%;
float:left;
display:inline-block;
	margin:1% 0 0 0%;
	background:#f5f5f5;
	color:#999;
	text-align: center;
padding: 5px 0px;
}

#pagewrap16-17-18-19-20-21-22-23-24-25
{
width: 100%;
float: left;
display: inline-block;
margin: -2% 0px 0px 0%;
<?php if (@$openform == '')
{
echo' display:none;';
}
else
{
	echo'display:block;';
}
?>
background:#f5f5f5;
color: #999;
font-weight: bold;
font-size: 95%;
}
#pagewrap16
{
width: 47.5%;
margin: 0px 0px 0px 0%;
float: left;
display: inline-block;
padding: 10px 0px 10px 11px;
background:#f5f5f5;
font-weight: bold;
color: #999;
}
#pagewrap17
{
	width:10%;
float:left;
display:inline-block;
	margin:2% 0 0 0%;
}
#pagewrap18
{
	width:10%;
float:left;
display:inline-block;
	margin:1.5% 0 0 0%;
}
#pagewrap19
{
	width:14%;
float:left;
display:inline-block;
	margin:2% 0 0 4%;
}

#pagewrap20
{
	width:10%;
float:left;
display:inline-block;
	margin:1.5% 0 0 0%;
}
#pagewrap21
{
width: 47.5%;
margin: 0px 0px 0px 0%;
float: left;
display: inline-block;
padding: 10px 0px 10px 12px;
background:#f5f5f5;
font-weight: bold;
color: #999;
}
#pagewrap22
{
	width:10%;
float:left;
display:inline-block;
	margin:2% 0 0 0%;
}
#pagewrap23
{
	width:10%;
float:left;
display:inline-block;
	margin:1.5% 0 0 0%;
}
#pagewrap24
{
	width:14%;
float:left;
display:inline-block;
	margin:2% 0 0 4%;
}
#pagewrap25
{
	width:10%;
float:left;
display:inline-block;
	margin:1.5% 0 0 0%;
}
#support{
position: relative;
float: right;
color: rgb(255, 153, 0);
font-family: arial;
margin: 3.3% 0.4% 0px 0%;
width: 19%;
background: none repeat scroll 0% 0% rgb(255, 255, 255);
font-size: 95%;
padding: 0.25%;
font-weight: bold;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
#nextbutton{
z-index: 10;
cursor: pointer;
background: none repeat scroll 0% 0% rgb(255, 153, 0);
padding: 7px 13px;
font-weight: bold;
font-size: 100%;
font-family: arial;
color: rgb(255, 255, 255);
-webkit-border-top-right-radius:5px;
-webkit-border-bottom-right-radius:5px;
-moz-border-radius-topright:5px;
-moz-border-radius-bottomright:5px;
border-top-right-radius:5px;
border-bottom-right-radius:5px;
}
</style>
<script>
function terms()
{
	document.getElementById("dialogterms").style.display='block';
$( "#dialogterms" ).dialog({
		height:300,
		width:600
});
}
</script>
 <script>
function checkval()
{
	
	
	
var checkempty = document.getElementById("name").value;
var checkempty1 = document.getElementById("phno").value;
var checkempty2 = document.getElementById("email").value;
var checkempty3 = document.getElementById("datepicker").value;
if (document.getElementById("terms").checked == false)
	{
		
		var checkempty4 = 4;
		
	}
	else
	{
		var checkempty4 = 3;
	}

  $(function() {
    var vouchercode = $( "#vouchercode" ),
      vouchertype = $( "#vouchertype" )

      allFields = $( [] ).add( vouchercode ).add( vouchertype );

    
if (checkempty !="" && checkempty1 !="" && checkempty2 !="" && checkempty3!="" && checkempty4 != 4 )
{
	<?php 
	$sql24 = "Select * from voucher";
	$result24 = mysql_query($sql24) or die(mysql_error());
	$num24 = mysql_num_rows($result24);
	if ($num24 > 0)
	{
		echo'
	document.getElementById("vouchercode11").style.display="inline-block";
		document.getElementById("vouchertype11").style.display="inline-block";
	document.getElementById("vouchercode1a").style.display="inline-block";
	document.getElementById("vouchertype1a").style.display="inline-block";';
	}
	?>
	
    $( "#dialog-form" ).dialog({
      autoOpen: false,
      height:400,
      width: 650,
      modal: true,
	  
      buttons: {
        "OK": function() {
			
      	$(this).appendTo($("#form1"));
		 document.forms["form1"].submit();

		   $( this ).dialog( "close" );
         
        },
        Cancel: function() {
          $( this ).dialog( "close" );
        },
		"More Vouchers": function() {
	
		
		
    	document.getElementById("vouchercode22").style.display="inline-block";
		document.getElementById("vouchertype22").style.display="inline-block";
		document.getElementById("vouchercode1b").style.display="inline-block";
		document.getElementById("vouchertype1b").style.display="inline-block";
		
		document.getElementById("vouchercode33").style.display="inline-block";
		document.getElementById("vouchertype33").style.display="inline-block";
		document.getElementById("vouchercode1c").style.display="inline-block";
		document.getElementById("vouchertype1c").style.display="inline-block";
		
		document.getElementById("vouchercode44").style.display="inline-block";
		document.getElementById("vouchertype44").style.display="inline-block";
		document.getElementById("vouchercode1d").style.display="inline-block";
		document.getElementById("vouchertype1d").style.display="inline-block";
		
		document.getElementById("vouchercode55").style.display="inline-block";
		document.getElementById("vouchertype55").style.display="inline-block";
		document.getElementById("vouchercode1e").style.display="inline-block";
		document.getElementById("vouchertype1e").style.display="inline-block";
		
		document.getElementById("vouchercode66").style.display="inline-block";
		document.getElementById("vouchertype66").style.display="inline-block";
		document.getElementById("vouchercode1f").style.display="inline-block";
		document.getElementById("vouchertype1f").style.display="inline-block";  
        
		
		document.getElementById("vouchercode77").style.display="inline-block";
		document.getElementById("vouchertype77").style.display="inline-block";
		document.getElementById("vouchercode1g").style.display="inline-block";
		document.getElementById("vouchertype1g").style.display="inline-block"; 
		
		document.getElementById("vouchercode88").style.display="inline-block";
		document.getElementById("vouchertype88").style.display="inline-block";
		document.getElementById("vouchercode1h").style.display="inline-block";
		document.getElementById("vouchertype1h").style.display="inline-block"; 
		
		 
        }
      },
      close: function() {
        allFields.val( "" ).removeClass( "ui-state-error" );
      }
    });
}



 
    $( "#redeemvoucher" )
      .click(function() {
		
		 
        $( "#dialog-form" ).dialog( "open");
      });
  });
  
  <?php
  $sql987 = "Select * from dine";
					$result987 = mysql_query($sql987);
						
					while ($row987 = mysql_fetch_array($result987))
					{
						@$dateblock =  $row987['closingdate'];
						$dit987 = $row987['dit'];
						$branch987 = $row987['branch'];
						
						$lengthdateblock = strlen($dateblock);
						
						if ($lengthdateblock > 11)
						{
						$dateblock1 = substr_count($dateblock, ',');
						
						if ($dateblock1 > 1)
						{
						$count = 0;
							while ($count != $dateblock1)
							{
								
						$pieces = explode(',', $dateblock);
						
						
						
						
echo '
var dateblock11 = new  Array();
dateblock11 = ["'.$pieces[$count].'"];
var date987 = document.getElementById("datepicker").value;
var dit987 = document.getElementById("dine").value;
var branch987 = document.getElementById("branch").value;

if (date987 != "")
{
if ( date987 == "'.$pieces[$count].'" && dit987 == "'.$dit987.'" && branch987== "'.$branch987.'")
{	
	document.getElementById("datepicker").value = "";
	alert ("Sorry Booking is closed for this date.");
	
}
}';
$count  = $count + 1;
	}
}
						}
else
{
	$dateblock = substr($dateblock, 0, 10);
	
echo '

var date987 = document.getElementById("datepicker").value;
var dit987 = document.getElementById("dine").value;
var branch987 = document.getElementById("branch").value;
if (date987 != "")
{
if ( date987 == "'.$dateblock.'" && dit987 == "'.$dit987.'" && branch987== "'.$branch987.'")
{	
	document.getElementById("datepicker").value = "";
	alert ("Sorry Booking is closed for this date.");
	
}
}';
							
}
} // while closes

  ?>
 }

 
 function alertmsg()
  {
	  
	  
	  
	  
	  var checkempty = document.getElementById("name").value;
      var checkempty1 = document.getElementById("phno").value;
	  var checkempty2 = document.getElementById("email").value;
var checkempty3 = document.getElementById("datepicker").value;

	  if (document.getElementById("terms").checked == false)
	{
		
		var checkempty4 = 4;
		alert ("Please accept the terms and conditions.");
	}
	else
	{
		var checkempty4 = 3;
		
	}
	  
	  
	  if (checkempty !="" && checkempty1 !="" && checkempty2 !=""  && checkempty3 !="")
{
}
else
{
	alert ("Please fill up all the required fields");
}
  }
  
 
  </script>
   
 <script type="text/javascript">
 
 
 
function checkvoucher($branch){

var dbname= "<?php echo $dbname; ?>";
var restaurant = "<?php echo $restaurant;?>";
     $.ajax({
         url : "branchvoucher1.php?branch="+$branch+ "& dbname="+dbname,
         cache : false,
         beforeSend : function (){
              //Show a message
         },
         complete : function($response, $status){
             if ($status != "error" && $status != "timeout") {
                 $('#v1').html($response.responseText);
		
             }
         },
         error : function ($responseObj){
             alert("Something went wrong while processing your request.\n\nError => "
                 + $responseObj.responseText);
         }
     }); 
	 $.ajax({
         url : "branchvoucher2.php?branch="+$branch+ "& dbname="+dbname,
         cache : false,
         beforeSend : function (){
              //Show a message
         },
         complete : function($response, $status){
             if ($status != "error" && $status != "timeout") {
                 $('#v2').html($response.responseText);
		
             }
         },
         error : function ($responseObj){
             alert("Something went wrong while processing your request.\n\nError => "
                 + $responseObj.responseText);
         }
     });  
	 
	 
	  $.ajax({
         url : "branchvoucher3.php?branch="+$branch+ "& dbname="+dbname,
         cache : false,
         beforeSend : function (){
              //Show a message
         },
         complete : function($response, $status){
             if ($status != "error" && $status != "timeout") {
                 $('#v3').html($response.responseText);
		
             }
         },
         error : function ($responseObj){
             alert("Something went wrong while processing your request.\n\nError => "
                 + $responseObj.responseText);
         }
     });  
	 
	 
	  $.ajax({
         url : "branchvoucher4.php?branch="+$branch+ "& dbname="+dbname,
         cache : false,
         beforeSend : function (){
              //Show a message
         },
         complete : function($response, $status){
             if ($status != "error" && $status != "timeout") {
                 $('#v4').html($response.responseText);
		
             }
         },
         error : function ($responseObj){
             alert("Something went wrong while processing your request.\n\nError => "
                 + $responseObj.responseText);
         }
     });  
	 
	 
	 
	  $.ajax({
         url : "branchvoucher5.php?branch="+$branch+ "& dbname="+dbname,
         cache : false,
         beforeSend : function (){
              //Show a message
         },
         complete : function($response, $status){
             if ($status != "error" && $status != "timeout") {
                 $('#v5').html($response.responseText);
		
             }
         },
         error : function ($responseObj){
             alert("Something went wrong while processing your request.\n\nError => "
                 + $responseObj.responseText);
         }
     });  
	 
	 
	  $.ajax({
         url : "branchvoucher6.php?branch="+$branch+ "& dbname="+dbname,
         cache : false,
         beforeSend : function (){
              //Show a message
         },
         complete : function($response, $status){
             if ($status != "error" && $status != "timeout") {
                 $('#v6').html($response.responseText);
		
             }
         },
         error : function ($responseObj){
             alert("Something went wrong while processing your request.\n\nError => "
                 + $responseObj.responseText);
         }
     });  
  
  

	  $.ajax({
         url : "branchvoucher7.php?branch="+$branch+ "& dbname="+dbname,
         cache : false,
         beforeSend : function (){
              //Show a message
         },
         complete : function($response, $status){
             if ($status != "error" && $status != "timeout") {
                 $('#v7').html($response.responseText);
		
             }
         },
         error : function ($responseObj){
             alert("Something went wrong while processing your request.\n\nError => "
                 + $responseObj.responseText);
         }
     });    
  
	  $.ajax({
         url : "branchvoucher8.php?branch="+$branch+ "& dbname="+dbname,
         cache : false,
         beforeSend : function (){
              //Show a message
         },
         complete : function($response, $status){
             if ($status != "error" && $status != "timeout") {
                 $('#v8').html($response.responseText);
		
             }
         },
         error : function ($responseObj){
             alert("Something went wrong while processing your request.\n\nError => "
                 + $responseObj.responseText);
         }
     });  
  
  
	 
	 
	 
	 $.ajax({
         url : "hour1.php?branch="+$branch+ "& restaurant="+restaurant,
         cache : false,
         beforeSend : function (){
              //Show a message
         },
         complete : function($response, $status){
             if ($status != "error" && $status != "timeout") {
                 $('#pagewrap18').html($response.responseText);
		
             }
         },
         error : function ($responseObj){
             alert("Something went wrong while processing your request.\n\nError => "+ $responseObj.responseText);
         }
     });  
	 
	  
	 
	 
	  $.ajax({
         url : "hour2.php?branch="+$branch+ "& restaurant="+restaurant,
         cache : false,
         beforeSend : function (){
              //Show a message
         },
         complete : function($response, $status){
             if ($status != "error" && $status != "timeout") {
                 $('#pagewrap23').html($response.responseText);
		
             }
         },
         error : function ($responseObj){
             alert("Something went wrong while processing your request.\n\nError => "+ $responseObj.responseText);
         }
     });
<?php
include"connect.php";
					$sql213 = "select * from branch";
					$queryresult213 = mysql_query($sql213) or die(mysql_error());
					$num213 = mysql_num_rows($queryresult213);
					if ($num213 > 1)
					{
echo '
document.getElementById("dine").innerHTML = "";

	$("#dine").append( $("<option>")
    .val("-Select-")
    .html("-Select-")

);';
	  


$sql13 = "Select * from dine order by dit ASC";
$res13 = mysql_query($sql13) or die(mysql_error());

$timezone = 'Asia/Kuala_Lumpur';
if(function_exists('date_default_timezone_set')) date_default_timezone_set($timezone);
$daypresent = date('d');
$monthpresent = date('m');
$yearpresent = date('Y');

$datepresent = $monthpresent.'/'.$daypresent.'/'.$yearpresent;
$datepresentstr = strtotime($datepresent);


while ($row13 = mysql_fetch_array($res13))
{
	$branchname = $row13['branch'];
	
	$dateofdine2 = $row13['date2'];
	if ($dateofdine2 != 'null1')
	{
	$dateofdine2str = strtotime($dateofdine2);
	}
	else
	{
	$dateofdine2str = 9999999999999999999999999999;
	}
	if ($datepresentstr <= $dateofdine2str)
	{
	echo'
		
		
		if ($branch == "'.$branchname.'")
		{';
			$dine13 = $row13['dit'];
			
			echo '
			
			var xyz = "'.$dine13.'";
			
		$("#dine").append( $("<option>")
    .val("'.$dine13.'")
    .html("'.$dine13.'")
);
			
			
		}
		';
		
	}
}
} // if branches are greater than one 


?>	 
	
  }
	<?php 
					
 					if ($num213 == 1 )
					{
						$row213 = mysql_fetch_array($queryresult213);
						$branch213 = $row213['name'];
						echo 'checkvoucher("'.$branch213.'")';
					}
					
					?>

  
</script>

 <script>
/*$(function(){


$("#dine").click(function(){

var dinex = document.getElementById("dine").value;
dine.addEventListener('mousedown', function() {
$("#dine option:selected").html(dinex) ;
   
});


});
}); */
</script>
</head>

<body style="background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAALUlEQVQIW2P8DwQMyODXx7OMKIJAAQY2fmOEIFQApAkiiCQAEfz54QxIC7KxAHDQH6qdHDQwAAAAAElFTkSuQmCC)repeat;">
<?php include_once("analyticstracking.php") ?>
<div id="pagewrap">
<div id="pagewrap2">
<a href="searchrestaurant.php"><img style="width: 220px;float: left;position: relative;margin: 11px 0px 0px 13px;border:none;" src="./images/kreserve-logoreserve3.png"/></a>
<div id="support">Support: 03-42650388</div><div id="poppop">
<div class="halfCircleRight"><div class="maindrop maindropm1"><div id="circle11">1</div>Reservation Form</div><div class="maindrop maindropm2"><div id="circle22">2</div>Choose Your Table</div><div class="maindrop maindropm3"><div id="circle33">3</div>Bill</div><div class="maindrop maindropm4"><div id="circle44">4</div>Confirmation</div></div>
     </div>
</div>

<div id="parentwrap"> 
<div id="pagewrap3">
<img style="width:100%;" src="images/<?php echo $row2233['profilpic'];?>"/>
</div>


<div id="pagewrap1">

<table  style="position:relative;margin-left: auto;width: 53%;right: 75px;margin-top: 9%;background:#fff;-webkit-border-radius: 5px;-moz-border-radius: 5px;
border-radius: 5px;">


<form action="" method="post" name="form1" id="form1"  >


<tr ><td><div id="pagewrap4-5"><div id="pagewrap4">Title:</div>
<div id="pagewrap5"><select name="title" size="1" id="title" style="width:108%;height:40px;padding:9px 0px 10px;border: medium none;background:url('./images/buttonselect.png')no-repeat right #f5f5f5;">
					<option <?php if ( @$title == 'Mr'){echo "selected"; }?>>Mr.</option>
                    <option <?php if ( @$title == 'Miss'){echo "selected"; }?>>Ms.</option>
                   
                    </select></div></div></td></tr>
                  <tr><td>
              <div id="pagewrap6-7"><div id="pagewrap6">    
	<span>Name:<strong style="color:red">* </strong></span></div>
    <div id="pagewrap7">
    <input  type="text" id="name" 
    style="background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAALklEQVQIW2P8DwQMSODbt28MjMiCIAEuLi6EIEwApAmsElkALPj169f/IC3IAACNQR/U9VwWygAAAABJRU5ErkJggg==)repeat;width:99%;padding:8px 0px 14px;border-style:solid;border-width:1px;text-align:left;color:#999;border-color:#f5f5f5;" placeholder="Write your name here..." name="name" value="<?php echo @$name;?>"  onchange="checkval()" style="width:100%;"/>
    </div></div></td></tr>
    
    
    <tr ><td><div id="pagewrap8-9"><div id="pagewrap8">
    		Phone:<strong style="color:red">*</strong></span>
            </div><div id="pagewrap9">
            <input type="text" id="phno" name="phno" style="background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAALklEQVQIW2P8DwQMSODbt28MjMiCIAEuLi6EIEwApAmsElkALPj169f/IC3IAACNQR/U9VwWygAAAABJRU5ErkJggg==)repeat;width:99%;padding:8px 0px 14px;border-style:solid;border-width:1px;text-align:left;color:#999;border-color:#f5f5f5;"  placeholder="Write your phone number here..." 
             value="<?php echo @$phno;?>" onchange="checkval()" /></div></div></td></tr>
        <tr ><td> 
        <div id="pagewrap10-11"><div id="pagewrap10">   	
            <span>Email:<strong style="color:red">*</strong></span>
            </div><div id="pagewrap11">
            <input type="text" id="email" 
            style="width:99%;padding:8px 0px 14px;border: medium none;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAALklEQVQIW2P8DwQMSODbt28MjMiCIAEuLi6EIEwApAmsElkALPj169f/IC3IAACNQR/U9VwWygAAAABJRU5ErkJggg==)repeat;border-style:solid;border-width:1px;text-align:left;color:#999;border-color:#f5f5f5;" name="email" placeholder="Write your Email here..."  value="<?php echo @$email;?>"onchange="checkval()" style="width:100%;"/>
            </div></div></td></tr>
            
                    <?php 
					include"connect.php";
					
					$sql21 = "select * from branch order by name ASC ";
				
					$queryresult21 = mysql_query($sql21) or die(mysql_error());
					$num21 = mysql_num_rows($queryresult21);
 					if ($num21 > 1) // a-3
					{
					echo "
                    <tr><td >
					<div class='pagewrap14-15'><div class='pagewrap14'>
                    Branch:<strong style='color:red'>*</strong></div>
					<div id='pagewrap13'>
					<select style='width:108%;height:40px;padding:9px 0px 10px;border: medium none;background:url(./images/buttonselect.png)no-repeat right #f5f5f5;' name='branch' size='1' id='branch' onchange='checkvoucher(this.value)'>";
					
					
					echo "<option value='-Select-'>-Select-</option>";
				
					while($row21 = mysql_fetch_array($queryresult21)){
						$branch21 = $row21['name'];
						
						$sql501 = "Select * from kohincom_centralkreserve.branch where name='$branch21'
								and restaurant = '$restaurant'";
								$res501 = mysql_query($sql501) or die(mysql_error());
								$row501 = mysql_fetch_array($res501);
						if ($row501['disablebranch'] != '1')
						{		 
                      echo "<option value='".$row21['name']."' >".$row21['name']."</option>";
						}
					}
                    echo "</select></div></td></tr>"; 
					}
					else // a-4
					{
						$row21 = mysql_fetch_array($queryresult21);
						echo "
                    <tr><td >
					<div class='pagewrap14-15'><div class='pagewrap14'>
                    Branch:</div>
					<div id='pagewrap13'>
					<select style='width:108%;height:40px;padding:9px 0px 10px;border: medium none;background:url(./images/buttonselect.png)no-repeat right #f5f5f5;' name='branch' size='1'
					 id='branch'>";
					echo "<option value='".$row21['name']."' >".$row21['name']."</option>";
				
                     
                    echo "</select></div></td></tr>";
					}
					?>
            
            
             <tr ><td><div id="pagewrap12-13"><div id="pagewrap12">
            		Dine-in Type:<strong style="color:red">*</strong></span>
                    </div><div id="pagewrap13"><div id="page13" >
                    
                    <select style="width:108%;height:40px;padding:9px 0px 10px;border: medium none;background:url('./images/buttonselect.png')no-repeat right #f5f5f5;" name="dine" size="1" id="dine" onchange="checksame()" >
                    <?php if ($num21 > 1) // a-5
				{
					
					
					echo '<option >Select Branch</option>';
					
				}
				else //a-6
				{
					
				$sql13 = "Select * from dine order by dit ASC";
$res13 = mysql_query($sql13) or die(mysql_error());

$timezone = 'Asia/Kuala_Lumpur';
if(function_exists('date_default_timezone_set')) date_default_timezone_set($timezone);
$daypresent = date('d');
$monthpresent = date('m');
$yearpresent = date('Y');

$datepresent = $monthpresent.'/'.$daypresent.'/'.$yearpresent;
$datepresentstr = strtotime($datepresent);

	echo '<option value="-Select-">-Select-</option>';
	while ($row13 = mysql_fetch_array($res13))
	{
		$dateofdine2 = $row13['date2'];
		if ($dateofdine2 != 'null1')
		{
		$dateofdine2str = strtotime($dateofdine2);
		}
		else
		{
		$dateofdine2str = 9999999999999999999999999999;
		}
		if ($datepresentstr <= $dateofdine2str)
		{
		$dine13 = $row13['dit'];
		
		
		
		echo '<option value="'.$dine13.'">'.$dine13.'</option>';
		
		
		}
	}
				}	
				?>
                    </select></div></div></div></td></tr>
             
                                     
                    <tr><td><div class="pagewrap14-15"><div class="pagewrap14">Date:<strong style="color:red">*</strong></div><div class="pagewrap15">
                    <input style="width:99%;padding:7px 0px 14px;border-style:solid;border-width:1px;text-align:left;color:#999;border-color:#f5f5f5;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAALklEQVQIW2P8DwQMSODbt28MjMiCIAEuLi6EIEwApAmsElkALPj169f/IC3IAACNQR/U9VwWygAAAABJRU5ErkJggg==)repeat;" type="text" id="datepicker" name="datepicker" readonly="true" value="" onchange="checkval()" placeholder="Select Dining Offer"/></div></div></td></tr>       
        
        <tr ><td><div id="pagewrap16-17-18-19-20-21-22-23-24-25"><div id="pagewrap16">
       Check-in: <span style="color:#FF4500;font-family:Arial;font-size:13px;"><strong>*</strong>
       </span></div><div id="pagewrap17">
       Hour: </div><div id="pagewrap18"><select  style="width:100%;"><option selected="selected">00</option>
       
       </select><!-- section a-7 -->
        </div>
                    <div id="pagewrap19"> Minutes:</div> <div id="pagewrap20">
                    <select  style="width:100%;" name="minutes1" id="minutes1"><option selected="selected">00</option>
       <option >05</option><option >10</option>
<option >15</option><option >20</option><option >25</option>
<option >30</option><option >35</option><option >40</option>
<option >45</option><option>50</option><option >55</option></select></div>
                  <div id="pagewrap21">Check-out:<span style="color:#FF4500;font-family:Arial;font-size:13px;">
                  <strong>*</strong></span></div>
                   
                 <div id="pagewrap22">   
        Hour:</div><div id="pagewrap23"> <select  style="width:100%;">
					<option selected="selected">00</option>
                    
                    </select> <!-- section a-8 --> </div>
                    <div id="pagewrap24">  Minutes:</div><div id="pagewrap25">
                    <select  style="width:100%;" name="minutes2" id="minutes2"><option selected="selected">00</option>
        <option >05</option><option >10</option>
<option >15</option><option >20</option><option >25</option>
<option >30</option><option >35</option><option >40</option>
<option >45</option><option>50</option><option >55</option></select></div></div></td></tr>




<!--when price of kids and adult is same-->
<tr><td id="kidsame" style="display:none;">
<div class="pagewrap141a-151a"><div class="pagewrap14"> Number of Guests:<strong style="color:red">*</strong></div><div class="pagewrap15">
 <input  type="text" id="guest2" name="guest2" value="" onchange="maxguests()"
 placeholder="Number of guests..."  value="<?php echo @$adultqty;?>"
 style="background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAALklEQVQIW2P8DwQMSODbt28MjMiCIAEuLi6EIEwApAmsElkALPj169f/IC3IAACNQR/U9VwWygAAAABJRU5ErkJggg==)repeat;width:100%;padding:1px 0px 14px;border-style:solid;border-width:1px;text-align:left;color:#999;border-color:#f5f5f5;"/></div></div>
 </td></tr>  <!-- a-9 -->

<!--when price of kids and adult is not same-->
<tr ><td id="notsame" style="display:none;"> <!-- a-10 -->
 <div id="pagewrap114-115"><div id="pagewrap114"><div id="test1">

<span style="color:#FF4500;font-family:Arial;font-size:13px;"></span></div></div>
<div id="pagewrap115"><input type="text" id="guest" name="guest" value="<?php echo $adultqty;?>" onchange="maxguests()" placeholder="Number of guests..."  style="z-index:30;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAALklEQVQIW2P8DwQMSODbt28MjMiCIAEuLi6EIEwApAmsElkALPj169f/IC3IAACNQR/U9VwWygAAAABJRU5ErkJggg==)repeat;width:100%;padding:10px 0px 14px;border-style:solid;border-width:1px;text-align:left;color:#999;border-color:#f5f5f5;" /></div></div>
</td></tr>                
                    <tr ><td id="notsame2" style="display:none;" > <!-- a-11 -->
                    <div id="pagewrap1114-1115"><div id="pagewrap1114">
                    <div id="test" >
                      <?php 
				    $sql11 = "Select * from dine";
					$result12 = mysql_query($sql11);
					$row12 = mysql_fetch_array($result12);
					
					
					$result11 = mysql_query($sql11);
				$strongstyle = 	"<strong style='color:red;'>*</strong>";
	
	$dit12 = $row12['dit'];
	$agefrom12 = $row12['agefrom'];
	$ageupto12 = $row12['ageupto'];
					echo '<script language="javascript">';


echo '

	document.getElementById("test").innerHTML = "No of kids (age from '.$agefrom12.' to '.$ageupto12.' years old):";
	
	document.getElementById("test1").innerHTML = "No of Adult (Older than '.$ageupto12.' years old):'.$strongstyle.' ";


function checksame()
{
 
  	
var dine = document.getElementById("dine").value;


	var dbname = "'.$dbname.'";
var branch = document.getElementById("branch").value;

	  var params1 = "dine="+dine+"& dbname="+dbname+"& branch="+branch;
  

           var url = "checksame.php";
                $.ajax({
                               type: "POST",
                               url: url,
                               dataType: "html",
							 
                               data: params1,
							  beforeSend: function() {
                                 document.getElementById("counted").innerHTML= "checking"  ;
                                         },
                               complete: function() {
 
                               },
                               success: function(html) {
 
                                  var checksame = document.getElementById("counted").innerHTML= html ;
	
	if (checksame == 1 )
	{
		
		document.getElementById("test").style.display="none";
		document.getElementById("kids").style.display="none";
		document.getElementById("test1").style.display="none";
		document.getElementById("guest").style.display="none";
		document.getElementById("test1").style.height = "0px";
		document.getElementById("test").style.height = "0px";
	document.getElementById("pagewrap114-115").style.height = "0px";
	document.getElementById("pagewrap1114-1115").style.height = "0px";
	document.getElementById("kidsame").style.display="block";	

	}
	
	else
	{
		alert(checksame);
		document.getElementById("test").style.display="block";
		document.getElementById("kids").style.display="block";
		document.getElementById("guest").style.display="block";

		document.getElementById("kidsame").style.display="none"
		document.getElementById("test1").style.height = "38px";
		document.getElementById("test").style.height = "38px";
	document.getElementById("pagewrap114-115").style.height = "38px";
	document.getElementById("pagewrap1114-1115").style.height = "38px";
		document.getElementById("test1").style.display="block";
		document.getElementById("notsame").style.display="block";
		document.getElementById("notsame2").style.display="block";
			
	}
		}
						
	});
   ';
	$strongstyle = 	"<strong style='color:red;'>*</strong>"; 	
	while ($row11 = mysql_fetch_array($result11))
	{ 
	@$dit11 = $row11['dit']; 
	@$branch11 = $row11['branch'];
	@$agefrom = $row11['agefrom'];
	@$ageupto = $row11['ageupto'];	

	@$date11 = $row11['date1'];
	@$date12 = $row11['date2'];
	
	
     
	
	 echo 'if ((document.getElementById("dine").value == "'.$dit11.'") && (branch == "'.$branch11.'") ){
		
       var characters = dine.length; ';
 /*if (characters > 20)
{
var option = $("#dine option:selected").html();
var showhtml = option.substring(0,20);

$("#dine option:selected").html(showhtml);
} */
    echo ' document.getElementById("test").innerHTML = "No of kids (age from '.$agefrom.' to '.$ageupto.' years old):";
	
	document.getElementById("test1").innerHTML = "No of Adult Guest (Older than '.$ageupto.' years old):'.$strongstyle.'";
	} 	';
	
	
	
	echo'
	
var today = new Date(); 
var dine = document.getElementById("dine").value;
 document.getElementById("hiddendine").value = dine;
 
if (( dine == "'.$dit11.'") && ("'.$date11.'" != "null1") && ("'.$date12.'" != "null1"))
{
	
	
$( "#datepicker" ).datepicker({ changeMonth: true,
changeYear: true,
showOn: "both",
buttonImageOnly: true});
            $("#datepicker").datepicker("option", "minDate", "'.$date11.'" );
         $("#datepicker").datepicker("option","maxDate", "'.$date12.'" );
			
}';
                                        
         
		 echo'
else if (( dine == "'.$dit11.'") && ("'.$date11.'" == "null1") && ("'.$date12.'" == "null1"))
{
	$( "#datepicker" ).datepicker({ changeMonth: true,
changeYear: true,
showOn: "both",
buttonImageOnly: true});
            $("#datepicker").datepicker("option","minDate", today );
            $("#datepicker").datepicker("option", "maxDate", "");
}';
                               
           
     
	} // close while loop
        
					

  
			

echo '}
	</script>';
                    
                   ?> 
                    </div></div>
                    <div id="pagewrap1115"><input placeholder="Number of kids..." style="border-style:solid;border-width:1px;text-align:left;color:#999;border-color:#f5f5f5;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAALklEQVQIW2P8DwQMSODbt28MjMiCIAEuLi6EIEwApAmsElkALPj169f/IC3IAACNQR/U9VwWygAAAABJRU5ErkJggg==)repeat;width:100%;padding:9px 0px;"
                     type="text" id="kids" value="<?php echo @$kidqty;?>" name="kids" onchange="maxguests()"/></div></div>
                    </td></tr>                   
            
       
                   
                    <tr ><td><div class='pagewrap14-15'><div class='pagewrap14'>
                     Remarks:</div><div class='pagewrap15'> <input style="background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAALklEQVQIW2P8DwQMSODbt28MjMiCIAEuLi6EIEwApAmsElkALPj169f/IC3IAACNQR/U9VwWygAAAABJRU5ErkJggg==)repeat;width:100%;padding:9px 0px;border-style:solid;border-width:1px;text-align:left;color:#999;border-color:#f5f5f5;" type="text" name="remarks" 
                   placeholder="Remarks..."  id="remarks"  value="<?php echo @$remarks;?>"  /></div></div>
                     </td></tr>
                   <tr ><td><div class='pagewrap14-15'><div class='pagewrap14'>
            Membership Card No (optional):</div><div class='pagewrap15'>
			<input style="background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAALklEQVQIW2P8DwQMSODbt28MjMiCIAEuLi6EIEwApAmsElkALPj169f/IC3IAACNQR/U9VwWygAAAABJRU5ErkJggg==)repeat;width:100%;padding:10px 0px 10px;border-style:solid;border-width:1px;text-align:left;color:#999;border-color:#f5f5f5;" type="text" id="loyality" placeholder="Membership Card No" name="loyality" /></div></div>
            </td></tr> 
<?php
			$sql4 = "Select * from voucher where disable ='0'";
			$res4 = mysql_query($sql4) or die(mysql_error());
			$num4 = mysql_num_rows($res4);
			if ($num4 > 0) // a-12
			{
             echo'<tr ><td><div class="pagewrap14-15" style="background: none repeat scroll 0% 0% #F5F5F5;"><div class="pagewrap14">
            <p style="color:#03F; font-family:arial;cursor: pointer;text-decoration:underline;" id="redeemvoucher" onclick="alertmsg()" >Redeem Vouchers</p>
    </div></div></td></tr>';
			}
			?>
            <tr><td>
            <div class='pagewrap14-15'><div class='pagewrap141'>5</div><div class='pagewrap151'>
            	<input type="checkbox" id="terms" name="terms" onclick="checkval()"/>I read & agree with the <p  style="color:red;text-decoration:underline; cursor:pointer;" class='pagewrap151' onclick="terms()"> Terms & Conditions</p></div>
             </div>
            </td></tr>
            
            
            
    <tr ><td>
    <div class='pagewrap14-15a'><div class='pagewrap14a'>
<div id="nextbutton" onclick="return validateform()">Next</div>
</div></div></td></tr>

 <tr><td>

    <div id="dialog-form" title="Redeem Voucher" style="height:0px;"> <!-- a-13 -->
                     
           <label style="display:none; font-size:12px;" id="vouchercode1a" for="vouchercode">Voucher Code</label>
    	<input style="display:none;"  type="text" name="vouchercode11" id="vouchercode11" value="" />
      
        
    	<label style="display:none; font-size:12px; " id="vouchertype1a"  for="vouchertype">Voucher Type</label>
    	<div id="v1">
        <select style="display:none;"  name="vouchertype11" id="vouchertype11" value=""  >
        </select></div>
       

           <label style="display:none; font-size:12px;" id="vouchercode1b" for="vouchercode">Voucher Code</label>
           
    	<input style="display:none;"  type="text" name="vouchercode22" id="vouchercode22" value="" />
        
        
    	<label style="display:none; font-size:12px;" id="vouchertype1b"  for="vouchertype">Voucher Type</label>
    	<div id="v2">
        <select style="display:none;"  name="vouchertype22" id="vouchertype22" value=""  >
    	</select></div>    
       
        <label style="display:none; font-size:12px;" id="vouchercode1c" for="vouchercode">Voucher Code</label>
    	<input style="display:none"  type="text" name="vouchercode33" id="vouchercode33" value="" />
      
        
    	<label style="display:none; font-size:12px;" id="vouchertype1c"  for="vouchertype">Voucher Type</label>
    	<div id="v3">
        <select style="display:none"  name="vouchertype33" id="vouchertype33" value=""  >
    	
    	</select> </div>
        
       
        <label style="display:none; font-size:12px;" id="vouchercode1d" for="vouchercode">Voucher Code</label>
    	<input style="display:none"  type="text" name="vouchercode44" id="vouchercode44" value="" />
        
        
    	<label style="display:none; font-size:12px;" id="vouchertype1d"  for="vouchertype">Voucher Type</label>
    		<div id="v4">
        <select style="display:none"  name="vouchertype44" id="vouchertype44" value=""  >
    	</select></div>
        
      
        <label style="display:none; font-size:12px;" id="vouchercode1e" for="vouchercode">Voucher Code</label>
    	<input style="display:none"  type="text" name="vouchercode55" id="vouchercode55" value="" />
         
        
    	<label style="display:none; font-size:12px;" id="vouchertype1e"  for="vouchertype">Voucher Type</label>
    	
        	<div id="v5">
        <select style="display:none"  name="vouchertype55" id="vouchertype55" value=""  >
    	
    	</select></div>
        
       
        <label style="display:none; font-size:12px;" id="vouchercode1f" for="vouchercode">Voucher Code</label>
    	<input style="display:none"  type="text" name="vouchercode66" id="vouchercode66" value="" />
        
        
    	<label style="display:none; font-size:12px;" id="vouchertype1f"  for="vouchertype">Voucher Type</label>
    		<div id="v6">
        <select style="display:none"  name="vouchertype66" id="vouchertype66" value=""  >
    	</select></div>
        
        
        <label style="display:none; font-size:12px;" id="vouchercode1g" for="vouchercode">Voucher Code</label>

    	<input style="display:none"  type="text" name="vouchercode77" id="vouchercode77" value="" />
       
        
    	<label style="display:none; font-size:12px;" id="vouchertype1g"  for="vouchertype">Voucher Type</label>
    	
        	<div id="v7">
        <select style="display:none"  name="vouchertype77" id="vouchertype77" value=""  >
    	</select></div>
        
       
        <label style="display:none; font-size:12px;" id="vouchercode1h" for="vouchercode">Voucher Code</label>
    	<input style="display:none"  type="text" name="vouchercode88" id="vouchercode88" value="" />
        
        
    	<label style="display:none; font-size:12px;" id="vouchertype1h"  for="vouchertype">Voucher Type</label>
    		<div id="v8">
        <select style="display:none"  name="vouchertype88" id="vouchertype88" value=""  >
    	</select></div>        
     </div></td></tr>

	  <input type="hidden" name="hour1" id="hour1" value="" /> 
        <input type="hidden" name="hour2" id="hour2" value="" />
         
    
         
       <input type="hidden" name="hiddendine" id="hiddendine" value="" /> 
       
       
</form>

</table></div>


</div>

<!--</div>
&nbsp; &nbsp; &nbsp; &nbsp; 
-->









<script>

function submitform(){
document.forms["form1"].submit();
}

function Visibilitymouseout(objectid1)
{
document.getElementById(objectid1).style.display="none";
}

function Visibilitymouseover(objectid2)
{
document.getElementById(objectid2).style.display="block";
}

function switchadult1(objectid1,objectid2,objectid3)
{
document.getElementById(objectid1).style.display="none";
document.getElementById(objectid2).style.display="none";
document.getElementById(objectid3).style.display="block";
}
function switchadult2(objectid1,objectid2,objectid3)
{
document.getElementById(objectid1).style.display="none";
document.getElementById(objectid2).style.display="block";
document.getElementById(objectid3).style.display="block";
}
</script>

<script>

function checktime()
{
	var h1 = document.getElementById("h1").value;
	var h2 = document.getElementById("h2").value;
	
	
	
	 document.getElementById("hour1").value = h1;
	 document.getElementById("hour2").value = h2;
	 

 	
}
</script>

<script>
function maxguests()
{

var date999 = document.getElementById("datepicker").value;

	var dine999 = document.getElementById("dine").value;
	var branch999 = document.getElementById("branch").value;
	



	<?php
	//include"centralconnect.php";
	 $totalguest9991 = 0;
	

	$sql999 = "Select * from kohincom_centralkreserve.maxguests where restaurant ='$restaurant'";
$res999 = mysql_query($sql999) or die(mysql_error());
while($row999 = mysql_fetch_array($res999))
{
	$dateofmaxguest = $row999['date'];
	$branch999 = $row999['branch'];
	$dine999= $row999['dine'];
	$max999 = $row999['maxguest'];
	
	
	
	if ($dine999 != 'all')
	{
	
	echo '
	if ("'.$dateofmaxguest.'" == date999 && dine999 == "'.$dine999.'" && branch999 == "'.$branch999.'" )
	{
		var guestadults = document.getElementById("guest").value;
		var guestkids = document.getElementById("kids").value;
		var guests = document.getElementById("guest2").value;
		
		var guestlimit = guestadults + guestkids + guests;
		
		
		if (guestlimit < "'.$row999['guestlimit'].'" )
		{
			
			alert ("Sorry to make a reservation you must have minimum '.$row999['guestlimit'].' guests");
			document.getElementById("guest").value ="";
			document.getElementById("kids").value ="";
			document.getElementById("guest2").value ="";
		}
	}';
	}
	else
	{
		echo '
	if ("'.$dateofmaxguest.'" == date999  && branch999 == "'.$branch999.'" )
	{
		var guestadults = document.getElementById("guest").value;
		var guestkids = document.getElementById("kids").value;
		var guests = document.getElementById("guest2").value;
		
		var guestlimit = guestadults + guestkids + guests;
		
		
		if (guestlimit < "'.$row999['guestlimit'].'" )
		{
			
			alert ("Sorry to make a reservation you must have minimum '.$row999['guestlimit'].' guests");
			document.getElementById("guest").value ="";
			document.getElementById("kids").value ="";
			document.getElementById("guest2").value ="";
		}
	}';
		
	}
}
?>
}

</script>

<div id="counted" style="display:none; height:0px;"></div>

</div>


 <div id="totalguest999" style="display:none;"></div>
 

  <div id="datediv"> </div><!--DIV Created to get the date-->
<div id="dialogterms" title="Terms & Conditions" style="height:80px; display:none;text-align:justify;line-height: 1.8;">



<strong>End Users Terms and Conditions<br>
Last Updated: 1 January 2014</strong><br>
<br><strong style="color:red;text-align:justify;">
Please read the Cancellation Policy before reading the whole terms and conditions:<br>
11. Cancellation Policy:<br>
11.1 No cancellation allowed to for USERS for any booking or any restaurants for any reason unless was written clearly in the website or some other criteria for cancellation. In this case, that policy or criteria is just valid for the event or dining offer which is identified in the website. Kreserve has right to not refund the paid amount and even withdraw the blocked amount from the user's credit card.
<br>11.2 We don't encourage restaurants to cancel the booking. Restaurants may cancel the booking for some reasons. In any cancellation case by affiliate restaurants, Kreserve must approve the cancelation too. Kreserve approval may issue within 7 working days after receiving cancellation application from the Restaurant. If Kreserve accepts cancellation for a customer, Kreserve can refunds the paid money or release the block amount in user's credit card within 3 working days after Kreserve approval. As booking is cancelled by restaurant, no penalty or charges or any liability will impose for cancelation on Kreserve.
<br>11.3 If a restaurant asked you to pay some parts or full amount of the bill online, You must pay the amount online and your reservation is not confirmed until we receive confirmation from our payment gateways. If you select a table in a restaurant which it asks you to pay some parts or full amount of your bill via online payment gateway and you don't pay online to Kreserve, then your table will be released after 1 hour from your reservation time which is saved into our database and any other persons can take that table. 
</strong>
<br><br>
<strong>Customer's Terms and Conditions</strong>
<br><br>
Kohimaran Info Systems Sdn Bhd. ("Kohitec" or "Kreserve" or "we") welcomes you (the "Customer" or "you" or "user") to its website (the "Site"). This page, together with the documents referred to on it, tells you the terms and conditions (these Terms and Conditions) on which we list any of the products, services, restaurants, bars, shops and any businesses on our website www.kreserve.com (hereinafter referred to as 'the Site') to you. Please read these terms and conditions carefully before ordering any Products or booking any service or package from the Site. You should understand that by ordering any of our Products, you agree to be bound by these terms and conditions. You should print a copy of these Terms and Conditions for future reference.
<strong>1. Introduction</strong><br>
1.1 We are Kohimaran Info Systems Sdn Bhd, S081 & S082- Midvalley Megamall, Midvalley City, Lingkaran Syed Putra 59200 Kuala Lumpur, trading as www.kreserve.com and its subsidiaries, associates and officers unless otherwise stated.

<br>1.2 These Terms and Conditions govern the provide by us of any booking ordered by you on the Site. By agreeing to make a reservation, you agree to be legally bound by these Terms and Conditions. 

<br>1.3 In these Terms and Conditions:
<br>a)	"Account" means the account that you will need to register for on the Site if you would like to submit an Order on the Site;
 
<br>b)	"Acknowledgement" means our acknowledgement of your Order by email;

<br>c)	"Website" means kreserve.com; 

<br>d) "Business Day" means a day which is neither (i) a Saturday or Sunday, nor (ii) a public holiday anywhere in Malaysia;

<br>e) "Booking Confirmation" means our email to you, in which we accept your booking in accordance with clause 3 below; 

<br>f) "Contract" means your reservation accordance with these Terms and Conditions which we accept in accordance with clause 4.9 below; 

<br>g) "Customer" means individual who make a reservation on the Site; 
<br>h)"reservation" means the reservation submitted by you to the Site to purchase a Product from us; 
<br>i)"you" means the Customer who makes a booking; 
<br>j) References to "clauses" are to clauses of these Terms and Conditions; 
<br>k) Headings are for ease of reference only and shall not affect the interpretation or construction of the Terms and Conditions; 
<br>l) Words imparting the singular shall include the plural and vice versa. Words imparting a gender shall include every gender and references to persons shall include an individual, company, corporation, firm or partnership; 
<br>m) References to "includes" or "including" or like words or expressions shall mean without limitation. 
<br>n) "booking" means the reservation submitted by you to the Site to purchase a Product from us;
<br>o) "USER" means anybody who use our service or access to kreserve.com
<br>p) "Reservation Time" means the time; a user is surfing reservation page of a restaurant in kreserve.com and reserved a table online.
<br>q) "Reserved Time" means the time and date; a user clearly specified in the reservation form for dining at a restaurant. 
<br>r) "Restaurant" can be any businesses which are listed in kreserve.com. It is not limited to just "Fine Dining restaurants" and can be any type of food related businesses including but not limited to bar, bistro, café, fast food and hotel's restaurant. 

<br>1.4 These Terms and Conditions are our copyrighted intellectual property. Use by third parties – even of extracts – for the commercial purposes of offering goods and/or services– is not permitted. Infringements may be subject to legal action.
<br><strong>2. Your Status</strong><br>
To place an order with Kreserve, you must be over 18 years of age and possess a valid credit or debit card issued by a bank acceptable to us. There will be no refund in any case if we recognize, customer whose booking is under his name is below 18 years old.
<br><strong>3. Scope of our Service<br></strong>
Through the Site, Kreserve provides the Services to USER for the purpose of assisting USER in securing dining reservations at participating third party restaurants (each a "Restaurant"). In response to a USER's online request, the Kreserve Site directly contacts the Restaurant's computerized database of reservations. The availability of reservations is determined at the time of USER's query. Once a reservation is made by USER, Kreserve will provide confirmation of the reservation to USER by email. By using the Services, USER agrees to receive reservation confirmations by email after booking a reservation through the Kreserve Site. We reserve the right to reject bookings as set out below.
<br><strong>3. PRIVACY POLICY:<br></strong>
Kreserve is committed to safeguarding your privacy online. Kreserve can reveal your email address and phone number and name for the restaurant you have booked (Whether the booking is confirmed or not confirmed).The restaurants usually are using this address to contact you for perusing your reservation, any changes in booking, upcoming promotions and events and whatever they need to do for marketing. However if a restaurant misused your data on any purposes, Kreserve is not liable at all and customer can make complaint in the judiciary system just against that restaurant. In addition of that Kreserve can use your email, phone number and name for contacting you for upcoming promotions and events, policy changes, your booking changes and confirmation at anytime. Kreserve is committed to not to reveal your data for other restaurants which are listed in Kreserve.com. However Kreserve can send their messages or promotional emails to you. 
<br><strong>4. Kreserve REWARDS:<br></strong>
USER may be able to participate in Kreserve's USER benefits program, KRESERVE REWARDS. Participation is subject to Kreserve Rewards Terms and Conditions which is written in the website.
<br><strong>5. Intellectual Property Rights<br></strong>
<br>5.1	We are the owner or the licensee of all intellectual property rights in the Website, and in the material published on it. Those works are protected by copyright laws and treaties around the world. All such rights are reserved. 
<br>5.2	You may print off one copy, and may download extracts, of any page(s) from the Website for your personal reference and you may draw the attention of others within your organization to material posted on the Website. 
<br>5.3	You must not modify the paper or digital copies of any materials you have printed off or downloaded in any way, and you must not use any illustrations, photographs, video or audio sequences or any graphics separately from any accompanying text. 
<br>5.4	You must not use any part of the materials on the Website for commercial purposes without obtaining a license to do so from us or our licensors. 
<br>5.5	If you print off, copy or download any part of the Website in breach of these Terms of Use, your right to use the Website will cease immediately and you must, at our option, return or destroy any copies of the materials you have made. 
<br><strong>6. LIABILITY LIMITATIONS<br></strong>
IN NO EVENT SHALL KRESERVE BE LIABLE FOR ANY INJURY, LOSS, CLAIM, DAMAGE OR ANY SPECIAL, EXEMPLARY, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, WHETHER BASED IN CONTRACT, TORT OR OTHERWISE, WHICH ARISES OUT OF OR IS ANY WAY CONNECTED WITH (I) ANY USE OF THE SERVICES, THE KRESERVE SITE OR THE KRESERVE CONTENT, (II) ANY FAILURE OR DELAY (INCLUDING, BUT NOT LIMITED TO, THE USE OR INABILITY TO USE ANY COMPONENT OF THE SERVICES OR THE KRESERVE SITE FOR RESERVATIONS), OR (III) THE PERFORMANCE OR NON-PERFORMANCE OF ANY RESTAURANT IN CONNECTION WITH THE SERVICES. IN ADDITION, ALL USERS SPECIFICALLY UNDERSTAND AND AGREE THAT ANY THIRD PARTY DIRECTING USERS TO THE KRESERVE SITE BY REFERRAL, LINK OR ANY OTHER MEANS IS NOT LIABLE TO USER FOR ANY REASON WHATSOEVER, INCLUDING BUT NOT LIMITED TO DAMAGES OR LOSS ASSOCIATED WITH THE USE OF THE SERVICES, THE KRESERVE SITE OR THE KRESERVE CONTENT. KRESERVE IS NEITHER AN AGENT OF NOR IS CONNECTED WITH ANY AFFILIATED RESTAURANT IN WHICH A USER HAS MADE A RESERVATION. ASIDE FROM THE SERVICES PROVIDED ON THE KRESERVE SITE. KRESERVE IS NOT LIABLE FOR ANY INJURY, LOSS, CLAIM, DAMAGE OR ANY SPECIAL, EXEMPLARY, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, WHETHER BASED IN CONTRACT, TORT OR OTHERWISE, WHICH ARISES OUT OF OR IS IN ANY WAY CONNECTED WITH A USER'S VISIT TO AN AFFILIATED RESTAURANT.
BY LISTING INFORMATION RELEVANT TO ANY RESTAURANT in KRESERVE MOBILE APPLICATION OR KRESERVE WEBSITE OR BLOGS, KRESERVE DOES NOT REPRESENT OR WARRANT THAT RESTAURANT OR PACKAGE OR SERVICE IS ADVISABLE OR WITHOUT RISK, AND IS NOT LIABLE FOR DAMAGES OR LOSSES THAT MAY RESULT FROM DINING IN SUCH RESTAURANTS.
<br><strong>7. DISCLAIMER OF WARRANTY<br></strong>
THE INFORMATION, PROGRAMS, PRODUCTS, AND MATERIALS CONTAINED IN OR ACCESSED ON THE KRESERVE SITE, INCLUDING, WITHOUT LIMITATION, THE SERVICES AND THE KRESERVE CONTENT, ARE PROVIDED TO USER ON AN 'AS IS' BASIS AND WITHOUT WARRANTY OF ANY KIND. KRESERVE DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, WITH RESPECT TO THE SERVICES, THE KRESERVE SITE, THE KRESERVE CONTENT AND RELATED MATERIALS PROVIDED HEREUNDER INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT OR ARISING FROM A COURSE OF DEALING.

<br><strong>8. LINKS TO THIRD PARTY SITES<br></strong>
The KRESERVE Site may contain hypertext links to Web sites operated by parties other than KRESERVE. Such hypertext links are provided for USER's reference only and KRESERVE does not control such Web sites and is not responsible for their content. KRESERVE's inclusion of any hypertext links to such Web sites does not imply any endorsement of the material on such Web sites or any association with their operators.
<br><strong>9. REVIEWS, COMMENTS, COMMUNICATIONS, AND OTHER CONTENTS<br></strong>
At Kreserve's invitation, USER may submit reviews, comments, and ratings, send e-mails and other communications; and submit suggestions, ideas, comments, questions, or other information for publication and distribution to restaurants and other third parties, so long as the content is not illegal, threatening, obscene, racist, defamatory, libelous, pornographic, infringing of intellectual property rights, promoting of illegal activity or harm to groups and/or individuals, invasive of privacy, purposely false or otherwise injurious to third parties or objectionable and does not consist of or contain software, computer viruses, commercial solicitation, political campaigning, chain letters, mass mailings, any form of "spam" or references to illegal activity, malpractice, purposeful overcharging, false advertising or health code violations (e.g., foreign objects in food, food poisoning, etc.). You may not use a false e-mail address, impersonate any person or entity, or otherwise mislead as to the origin of content. Kreserve reserves the right (but not the obligation) to remove or edit such content, but may not regularly review submitted content.
<br><strong>10. Terms of use:</strong><br>
In addition of usage policy related to patent and Intellectual property in clause 5, you agree not to:<br> 
<br>•	use the Site or its contents for any non-authorized commercial purpose; 
<br>•	make any speculative, false, or fraudulent booking; 
<br>•	access, monitor or copy any content or information of the Site using any robot, spider, scraper or other automated means or any manual process for any purpose without our express prior written permission; 
<br>•	violate the restrictions in any robot exclusion headers on the Site or bypass or circumvent other measures employed to prevent or limit access to the Site; 
<br>•	take any action that imposes, or may impose, in our discretion, an unreasonable or disproportionately large load on our infrastructure; 
<br>•	deep-link to any portion of the Site (including, without limitation, purchase paths) for any purpose without our express prior written permission; 
<br>•	re-sell, use, copy, monitor (e.g. spider, scrape), display, download or reproduce any content or information, software, products or services available on the Site for any commercial or competitive activity or purpose; 
<br>•	"frame", "mirror" or otherwise incorporate any part of the Site into any other website without our prior written authorization;
<br>•	deliver any unlawful (according to any and all applicable laws or regulations) postings to or through the Site, or any postings which advocate illegal activity;
<br>•	deliver, or provide links to, any postings containing material that could be considered harmful, obscene, pornographic, indecent, lewd, violent, abusive, profane, racist, discriminating, insulting, threatening, tortuous, harassing, hateful or otherwise objectionable;
<br>•	deliver or provide links to, any postings containing defamatory, slanderous, false or libelous material;
<br>•	deliver any posting that infringes or violates any intellectual property or other right of any entity or person, including, without limitation, copyrights, patents, trademarks, laws governing trade secrets, rights to privacy, or publicity;
<br>•	deliver any posting that you do not have a right to make available under law or contractual or fiduciary relationships;
<br>•	impersonate another person or entity or falsely state or otherwise misrepresent your affiliation with a person or entity, or adopt a false identity if the purpose of doing so is to mislead, deceive, or defraud another; 
<br>•	manipulate identifiers, including by forging headers, in order to disguise the origin of any posting that you deliver;
<br>•	use the Site in any manner which could damage, disable, overburden, or impair or otherwise interfere with the use of the Site or other users' computer equipment, or cause damage, disruption or limit the functioning of any software, hardware, or telecommunications equipment;
<br>•	attempt to gain unauthorized access to the Site, any related website, other accounts, computer system, or networks connected to the Site, through hacking, password mining, or any other means; 
<br>•	obtain or attempt to obtain any materials or information through any means not intentionally made available through the Site, including harvesting or otherwise collecting information about others such as email addresses; 
<br>•	engage in any deceptive practices intended to manipulate the organic Search Engine Results Page (SERP) or employ search engine optimization ("SEO") techniques considered to be against common search engine guidelines. SEO practices considered unethical, or "black hat" (aka "spamdexing") include, though are not limited to cloaking, meta data and title tags, content scraping, link schemes, Google bombs, keyword stuffing, hidden text and links, doorway and cloaked pages, link farming or schemes, blog comment spam, etc.; or
<br>•	do anything else which could cause damage to the Site, the Kohimaran group of companies and their employees, Kreserve's reputation, or would otherwise have a negative impact.
Unless otherwise expressly permitted, websites may not hyperlink to any page beyond the homepage of the Site or frame the Site or any web page or material herein, nor may any entity hyperlink any aspect of the Site in an email for commercial purposes without the express written permission of Kreserve.
By making a reservation on the Site, you represent and warrant that you are not covered by any international sanction program.


<br><strong>12. Credit Card/Bank account information:<br></strong>
We don't save any information of customer's credit cards, debit cards, personal or business banking account in our servers nor in our databases. You will enter your bank account or credit card information directly in bank's payment gateway website. We use SSL protocol to encrypt all the information about our transactions. All of the payments will be paid in bank's payment gateway websites or PayPal website or private payment gateway companies and we don't have any responsibility about misusing or hacking or any other illegal usage of your credit card or debit card or bank account information. 
13. Some restaurants are allowing customers to select their table from the table layout which they provided in the Kreserve. The Restaurants are usually trying to draw an accurate table layout.  Customer must understand these layouts can't be completely accurate and can be different with real environment. In addition of that restaurant has the right to change the selected table at any time if they can't provide the table for the booked date.

<br><strong>14. Severability<br></strong>
If any of these terms should be determined to be illegal, invalid or otherwise unenforceable by reason of the laws of any state or country in which these terms are intended to be effective, then to the extent and within the jurisdiction which that term is illegal, invalid or unenforceable, it shall be severed and deleted and the remaining Terms of Use shall survive, remain in full force and effect and continue to be binding and enforceable. 
<br><strong>15. NO ASSIGNMENT<br></strong>
This Agreement and the rights granted and obligations undertaken hereunder may not be transferred, assigned or delegated in any manner by USER, but may be so transferred, assigned or delegated by Kreserve. In addition, this agreement and any of the clauses in our terms and conditions may be changed without prior notice.
<br><strong>16. Malaysia law and jurisdiction<br></strong>
These Terms of Use and your use of the Website (and all non-contractual relationships arising out of or connected to it or them) shall be governed by and construed in accordance with Malaysia law. You submit to the exclusive jurisdiction of the Malaysia courts to settle any dispute which may arise under these Terms of Use. 





</div>


<!-- Google Code for Reservation3 Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 974946716;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "ZK5NCNzI0AgQnIPy0AM";
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/974946716/?label=ZK5NCNzI0AgQnIPy0AM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>
</body>
</html>