B2B Reservation System Version 1.00                    

January" ; else print ""; if ($month==2) print "" ; else print ""; if ($month==3) print "" ; else print ""; if ($month==4) print "" ; else print ""; if ($month==5) print "" ; else print ""; if ($month==6) print "" ; else print ""; if ($month==7) print "" ; else print ""; if ($month==8) print "" ; else print ""; if ($month==9) print "" ; else print ""; if ($month==10) print "" ; else print ""; if ($month==11) print "" ; else print ""; if ($month==12) print "" ; else print ""; } function PrintDate($cutoff) { $newdate=getdate(mktime(0,0,0,date("m"),date("d")+$cutoff,date("Y"))); $tday=$newdate["mday"]; for ($i=1;$i<=31;$i++) if ($i == $tday) print ""; else print ""; } function PrintYear($cutoff) { $newdate=getdate(mktime(0,0,0,date("m"),date("d")+$cutoff,date("Y"))); $year = $newdate["year"]; $Yone = $year; $Ytwo = $year+1; $Ythree = $year+2; print ""; print ""; print ""; } $today=getdate(timenow()); $tday0=$today["mday"]; $tday1=$today["mon"]; $tday2=$today["year"]; $tday3=addzero($today["hours"],2); $tday4=addzero($today["minutes"],2); $tday5=addzero($today["seconds"],2); if(!isset($_SESSION['userkey'])) { if($_GET['user']==""||$_GET['password']=="") { print ""; exit; } $query = "select * from $systemname"."_info "; //echo $query ; //mysql_query($query) or die ("Counldn't create $systemname"."_info"); $result = mysqli_query($link,$query); if (!$result) { printf("Error: %s\n", mysqli_error($link)); exit(); } $info = mysqli_fetch_array($result,MYSQLI_ASSOC); if(mysqli_num_rows($result)==0) {echo "Table in Database error";exit();} // check password & expiration $email=preg_replace("/\%40/","@",trim($_GET['user'])); $query = "select * from $systemname"."_emailagent where email='$email' "; //echo $query;exit; $result = mysqli_query($link,$query); $emailfound=mysqli_num_rows($result); //echo $emailfound;exit; if($emailfound>1||$emailfound==0) { print ""; exit; } // check password $iteme = mysqli_fetch_array($result); if(trim($_GET['password'])!=$iteme[password]||trim($_GET['password'])==""||$iteme[password]==""){ //echo "if(trim($_GET[\'password\'])!=$iteme[password]||trim($_GET[\'password\'])==""||$iteme[password]==""){"; //echo "get="; echo $_GET['password']; echo "item= $iteme[password]"; // exit; print ""; exit; } // check status if($iteme[status]==0){ print ""; exit; } // check expire $expire=sqldate2array("$iteme[resetdate] $iteme[resettime]"); $minutepassword=gmmktime($expire[3],$expire[4],$expire[5],$expire[1],$expire[0],$expire[2])/60; $minutenow=gmmktime($today["hours"],$today["minutes"],$today["seconds"],$today["mon"],$today["mday"],$today["year"])/60; //echo "$minutenow-$minutepassword>$info[passwordexpire]
//gmmktime($expire[3],$expire[4],$expire[5],$expire[1],$expire[0],$expire[2]
//".$today["hours"].",".$today["minutes"].",".$today["seconds"].",".$today["mon"].",".$today["mday"].",".$today["year"].")"; if($minutenow-$minutepassword>$info[passwordexpire]){ print ""; exit; } // add username to session $_SESSION['valid_user'] = $_GET['user']; $_SESSION['userkey'] = $iteme[userkey]; $_SESSION['fullname'] = $iteme[full_name]; $_SESSION['company'] = $iteme[company]; $_SESSION['systemname123'] = $systemname; $_SESSION['logt'] =1; } $query = "select * from $systemname"."_emailagent where email='".$_SESSION['valid_user']."' "; //echo $query;exit; $result = mysqli_query($link,$query); $iteme = mysqli_fetch_array($result); $checkstatic=$iteme[static2]; $checkdynamic=$iteme[dynamic]; $discount=$iteme[discount]; if($iteme[domainkey]>0) { $query = "select * from $systemname"."_domainagent where domainkey=$iteme[domainkey] "; //echo $query;exit; $resultdomain = mysqli_query($link,$query); $itemdomain = mysqli_fetch_array($resultdomain); $checkstatic=$itemdomain[static2]; $checkdynamic=$itemdomain[dynamic]; $discount=$itemdomain[discount]; } echo "
Hello, ".$_SESSION['fullname'].", ".$_SESSION['company']."

"; $todaysql=$today["year"]."-".$today["mon"]."-".$today["mday"]; //echo $_POST['go']; if($_POST['go']=="checkroom") {include ("checkroom.php"); exit; } elseif($_GET['success']>0) {include ("success.php"); exit; } elseif($_POST['success']>0) {include ("success.php"); exit; } elseif($_POST['go']=="ReservationList") {include ("reservationlist.php"); exit; } if($_POST['go']=="checkroomdynamic") {include ("checkroomdynamic.php"); exit; } // error from check room if($_GET['dateerror1']=="y") echo "Error : Check out date should not same or before check in date!!


"; if($_GET['dateerror2']=="y") echo "Error : The allocation was cut off. Please contact reservation department.!!


"; if($_GET['dateerror3']=="y") echo "Error : Check Out Date is Invalid!!


"; if($_GET['dateerror4']=="y") echo "Error : Check In Date is Invalid!!


"; $query = "select * from $systemname"."_hotel where status=1 "; //echo $query;exit; $result = mysqli_query($link,$query); echo ""; if($checkstatic=="Y") echo ""; if($checkdynamic=="Y") echo ""; echo ""; while ($itemhotel = mysqli_fetch_array($result)) { if($_GET['ci']=="") $showci=phpdate2sqldate(dateshift(sqldate2array($todaysql),$itemhotel[CutoffDay])); else $showci=$_GET['ci']; if($_GET['co']=="") $showco=phpdate2sqldate(dateshift(sqldate2array($todaysql),$itemhotel[CutoffDay]+2)); else $showco=$_GET['co']; //echo $showci; echo ""; if($checkstatic=="Y") {echo " ";} if($checkdynamic=="Y") {echo ""; } echo ""; } echo "
Hotel NameMake Reservation (Contract Rates)Make Reservation (Dynamic Rates)Action
$itemhotel[hotelname] $itemhotel[hotelskype]
Check In:     
Check Out:     
Room Type:     
Number of Room:     
"; //echo ""; //if($home=="bb") echo "" echo "
"; echo "


Check In:     
Check Out:     
    Room Type:     
    Number of Room:     



Dynamic rates require 100% prepayment
by credit card in Thai Baht.
"; echo "
"; // // Room Available Chart
//echo $today["mon"].",".$today["year"].",$itemhotel[nickname]"; echo "    

"; ?>