include("DBEngine_onhost.php"); require("include/functionoffer.php"); $Dbs=ConnectDB(); function fnc_date_calc($this_date,$num_days){ $my_time = strtotime ($this_date); //converts date string to UNIX timestamp $timestamp = $my_time + ($num_days * 86400); //calculates # of days passed ($num_days) * # seconds in a day (86400) $return_date = date("Y-m-d",$timestamp); //puts the UNIX timestamp back into string format return $return_date;//exit function and return string }//end of function function mm($mm) { switch ($mm) { case "JAN": $tt = "01"; break; case "FEB": $tt = "02"; break; case "MAR": $tt = "03"; break; case "APR": $tt = "04"; break; case "MAY": $tt = "05"; break; case "JUN": $tt = "06"; break; case "JUL": $tt = "07"; break; case "AUG": $tt = "08"; break; case "SEP": $tt = "09"; break; case "OCT": $tt = "10"; break; case "NOV": $tt = "11"; break; case "DEC": $tt = "12"; break; } return @$tt; } $arr_y1=substr($txtCheckIn,6,4); $arr_m1=substr($txtCheckIn,3,2); $arr_d1=substr($txtCheckIn,0,2); $dep_y1=substr($txtCheckOut,6,4); $dep_m1=substr($txtCheckOut,3,2); $dep_d1=substr($txtCheckOut,0,2); $ddcheck=$arr_y1."-".$arr_m1."-".$arr_d1; $ddcheck2=$dep_y1."-".$dep_m1."-".$dep_d1; if($booking){ $sql1 = "select * from allotment_tb where roomtype = '$roomtype' and (status = '1' or allot < '$noroom') and (dd >= '$ddcheck' AND dd < '$ddcheck2') order by id ASC"; $res1 = DBexec($Dbs,$sql1); $rows1 = DBNumrows($res1); if($rows1 > "0"){ echo "
"; exit; } $sql = "insert into trandetails set adate = '$ddcheck',ddate = '$ddcheck2',no_room='$noroom',adult='$noadult',kids='$nochild',age='$age',age2='$age2',roomtype='$roomtype' ,type='$type' ,amount='$amount',offer_id='$offer_id'"; DBexec($Dbs,$sql); $sql3= "select * from trandetails order by detailID desc limit 1"; $res3 = DBexec($Dbs,$sql3); $rows3 = DBNumrows($res3); if($rows3 > 0){ $arr3 = DBfetch_array($res3,0); } $detailID=$arr3[detailID]; Header("Location:index.php?detailID=$detailID&booking3=booking3"); } if($booking2){ $update = "update trandetails set adate = '$ddcheck',ddate = '$ddcheck2',no_room='$noroom',adult='$noadult',kids='$nochild',age='$age',age2='$age2',cus_ref = '$detailID'"; $update .= " where detailID = '$detailID'"; DBexec($Dbs,$update); Header("Location:index.php?detailID=$detailID&booking2=booking2"); } if($booking5){ if($extrabed > "0"){ $bedprice=$e_price*$NoNights*$noroom; } if($car=="Y"){ $carprice=$p_car; } $amount=$total1+$bedprice+$carprice; $update2 = "update trandetails set cus_ref = '$detailID',amount='$amount',car='$car',bedtype='$bedtype',extrabed='$extrabed'"; $update2 .= " where detailID = '$detailID'"; DBexec($Dbs,$update2); } if($_GET[id]){ $delsql = "delete from tranoffer where id='$_GET[id]'"; DBexec($Dbs,$delsql); Header("Location:?detailID=$detailID&booking5=booking5"); } ?>![]() |
The Palazzo Bangkok Address: 111 Soi Niam-utit, Ratchadapisek Road, Bangkok 10400 Thailand Tel:+66 22764995-9 Fax: +66 22765000-2 E-mail: rsvn@palazzobangkok.com |
|