Example #1
0
<?php

include_once "includes/SystemConfiguration.class.php";
include "includes/language.php";
global $systemConfiguration;
global $logger;
session_start();
$logger->LogInfo(__FILE__);
$systemConfiguration->assertReferer();
// Get serach criteria
$logger->LogInfo("Getting search criteria ...");
$bookingDetails = new BookingDetails();
$searchCriteria = SearchCriteria::fetchFromParameters($_POST);
$logger->LogInfo("Search criteria:");
$logger->LogInfo("Check-in date: " . $searchCriteria->checkInDate->format("Y-m-d"));
$logger->LogInfo("Check-out date: " . $searchCriteria->checkInDate->format("Y-m-d"));
$logger->LogInfo("Adults: " . $searchCriteria->adultsCount);
$logger->LogInfo("Children: " . $searchCriteria->childrenCount);
$logger->LogInfo("Server date/time: " . date("Y-m-d H:i:s"));
if (!$searchCriteria->isValid()) {
    $logger->LogError("Search is not valid!");
    $logger->LogError("Errors:");
    $logger->LogError($searchCriteria->errors);
    $_SESSION['errors'] = $searchCriteria->errors;
    header('Location: booking-failure.php');
} else {
    if (!$systemConfiguration->isSearchEgineEnabled()) {
        $logger->LogError("Search engine is disabled!");
        $_SESSION['errors'] = array(0 => BOOKING_SEARCH_DISABLED);
        header('Location: booking-failure.php');
    } else {