Connect($host, $user, $pwd); $db->DBUse($db_name); if($_GET['jbl']!='' && $_GET['ua']!=''){ $p_sql = "SELECT * from rentalzdata_full_$switch WHERE prop_jobl = '".trim($_GET["jbl"])."' AND prp_unique LIKE '".$_GET["ua"]."%' "; $p_result = $db->Query($p_sql) or die(mysql_error()); if($db->numRows($p_result) > 0){ $p_row = $db->fetchArray($p_result); $sql = "SELECT * from rentalzdata_full_$switch WHERE prp_unique = '".$p_row["prp_unique"]."' "; } } else{ if($_GET["ua"] != ""){ if($_GET["nw"] == 1){ $uniqueid = trim($_GET["id"]); $sql = "SELECT * from rentalzdata_full_$switch WHERE prp_unique = '$uniqueid'"; } elseif(strlen($_GET["id"]) > 5){ $sql = "SELECT * from rentalzdata_full_$switch WHERE prop_jobl = '".trim($_GET["id"])."' AND prp_unique LIKE '".$_GET["ua"]."%' LIMIT 1 "; } elseif(strlen($_GET["p"]) != ''){ $sql = "SELECT * from rentalzdata_full_$switch WHERE prop_jobl = '".mysql_escape_string($p)."'"; } else{ $uniqueid = trim($_GET["ua"]).trim($_GET["id"]); $sql = "SELECT * from rentalzdata_full_$switch WHERE prp_unique = '$uniqueid'"; } } else{ if(trim($_GET['id'])==''){ $info = explode("/",$_SERVER['PATH_INFO']); $p_sql = "SELECT * from rentalzdata_full_$switch WHERE prop_jobl = '".$info[2]."' AND prp_unique LIKE '".$info[1]."%' "; $p_result = $db->Query($p_sql) or die(mysql_error()); if($db->numRows($p_result) > 0){ $p_row = $db->fetchArray($p_result); $sql = "SELECT * from rentalzdata_full_$switch WHERE prp_unique = '".$p_row["prp_unique"]."' "; $p = $info[2]; } } else{ $sql = "SELECT * from rentalzdata_full_$switch WHERE prp_unique = '".mysql_escape_string($_GET['id'])."'"; } } } //echo $sql; //echo 'PROP_CODE: '.$prop_code; if($sql != ''){ $result = $db->Query($sql) or die(mysql_error()); if($db->numRows($result) > 0){ $row = $db->fetchArray($result); $prop_code = $row["prp_unique"]; // //Redirect all active SecureBookIt clients! // try{ // include_once "SecureBookIt.php"; // $sbi = new SecureBookIt($prop_code); // header("HTTP/1.1 301 Moved Permanently"); // header("Location: https://secure.sherlock.com.au/SecureBookIt/check.php?id=".$prop_code); // exit(); // } // catch(Exception $e){} $p = $row["prop_code"]; if($db->numRows($result) > 0){ $db_name_rentalz = 'rentalz'; $dbh2 = new PDOManager('mysql:host='.$host.';dbname='.$db_name_rentalz, $user, $pwd); $dbh2->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, 1); $dbh2->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbh2->errorLocation('screen'); $cal = new RentalzCalendar($dbh2, "bookings_$switch", true); $cal->ReferenceID($prop_code); $cal->UserRef($p); $cal->AgentID($ua); $show = "CALENDAR"; //GET AGENT DETAILS $a_abn = substr($prop_code, 0, 11); $a_lic = substr($prop_code, 11, 7); $property_id = substr($id, -5); $a_sql = "SELECT * FROM agentz_$switch WHERE ag_abn='$a_abn' AND ag_license='$a_lic' "; $a_result = $db->Query($a_sql) or die(mysql_error()); $a_row = $db->fetchArray($a_result); } else { $show = "ERROR"; } } else { $show = "ERROR"; } } else { $show = "ERROR"; } $page->webBase($web_base); $page->pageTitle($region_name); $page->pageMenu($menu_main); $page->breadCrumbs($include_breadcrumbs); $page->styleSheet($sheet); $page->customTag1(array("[[--PROP_STATISTICS--]]"=>$include_propstatistics), "file"); $page->customTag2(array("[[--BG_COLOR--]]"=>$arrColor[$typeID]), "variable"); $page->customTag3(array("[[--BG_COLOR_2--]]"=>$arrColor_2[$typeID]), "variable"); //Display Header & Body Start $page->showHeader(); $page->showPageStart(); echo '
'; $propname = $p; if(empty($p)) { if($id==''){ $propname = $_GET['jbl']; } else{ $propname = $id; } } switch ($show){ case "ERROR": echo ""; echo "
Sorry, There are no booking details available for this property.
"; break; case "CALENDAR": echo '
'; echo ''; echo ''; echo ''; echo '
'.$cal->MonthToView(3).'
'; echo ''; echo ''; echo ''; echo ''; echo '
KEY:
 Currently booked. Currently available.
To request a booking \'click\' on your proposed arrival date.
If the property is already booked you may still register your interest
in the property in the event of a cancellation.


'; echo 'NOTE: This availablity calendar should only be used as a guide.
Final confirmation of availability must be made with the relevant booking agent. The agent or owner of the property reserve the right to refuse a booking.
'; echo '
'; echo '
'; echo '
'; if($show_agent){ echo '
'; echo ''.$a_row["ag_name"].'
'; echo "Phone: ".$a_row["ag_phone"].'
'; echo "".$a_row["ag_email"]."

"; echo "".$a_row["ag_website"]."

"; echo "

"; echo '< < Back To Property Details'; } echo '
'; } $page->showPageFinish(); ?>