<?php // This is the booking receipt page require 'rezgo/include/page_header.php'; // start a new instance of RezgoSite $site = new RezgoSite(); // grab and decode the trans_num if it was set $trans_num = $site->decode($_REQUEST['trans_num']); // send the user home if they shoulden't be here if (!$trans_num) { $site->sendTo($site->base . "/booking-not-found"); } // start a session so we can grab the analytics code session_start(); // empty the cart $site->clearCart(); $site->setMetaTags('<meta name="robots" content="noindex, nofollow">'); ?> <?php echo $site->getTemplate('frame_header'); ?> <?php if (strlen($trans_num) == 16) { ?> <?php echo $site->getTemplate('booking_order'); ?>
<?php // any new page must start with the page_header, it will include the correct files // so that the rezgo parser classes and functions will be available to your templates require 'rezgo/include/page_header.php'; // start a new instance of RezgoSite $site = new RezgoSite(); if ($_REQUEST['search'] == 'restore' && $_COOKIE['rezgo_search']) { $site->sendTo($_COOKIE['rezgo_search']); } // some code to handle the pagination if (!$_REQUEST['pg']) { $_REQUEST['pg'] = 1; } $start = ($_REQUEST['pg'] - 1) * REZGO_RESULTS_PER_PAGE; // we only want 11 responses, starting at our page number times item number $site->setTourLimit(REZGO_RESULTS_PER_PAGE + 1, $start); ?> <?php echo $site->getTemplate('frame_header'); ?> <?php echo $site->getTemplate('index'); ?> <?php echo $site->getTemplate('frame_footer');
$_SESSION['REZGO_CONVERSION_ANALYTICS'] .= '<script></script>'; } else { // this booking failed, send a status code back to the requesting page if ($result->message == 'Availability Error' || $result->mesage == 'Fatal Error') { $response = 2; } else { if ($result->message == 'Payment Declined' || $result->message == 'Invalid Card Checksum' || $result->message == 'Invalid Card Expiry') { $response = 3; } else { if ($result->message == 'Account Error') { // hard system error, no commit requests are allowed if there is no valid payment method $response = 5; } else { $response = 4; } } } } } if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { // ajax response if we requested this page correctly echo $response; } else { // if, for some reason, the ajax form submit failed, then we want to handle the user anyway die('Something went wrong during booking. Your booking may have still been completed.'); if ($result->status == 1) { $site->sendTo("/complete/" . $trans_num); } else { echo 'ERROR: ' . $result->message; } }