コード例 #1
0
ファイル: helpers.php プロジェクト: tchalvak/airl
function get_air_price_build($gateCode, $destCode, $numDays, $discount, $convertToCurrency = true)
{
    $tripStart = date("m/d/y", mktime(0, 0, 0, date("m"), date("d") + DAYS_OUT_TO_PRICE_TRIP_FOR_BUILDS, date("y")));
    $tripEnd = date("m/d/y", mktime(0, 0, 0, date("m"), date("d") + DAYS_OUT_TO_PRICE_TRIP_FOR_BUILDS + $numDays, date("y")));
    $passengerListObject = new PassengerListObject(2, null);
    $airtype = "C";
    //Coach is cheapest
    $nonStop = "N";
    // Stops are cheaper
    return get_air_price($gateCode, $destCode, $discount, $convertToCurrency, $tripStart, $tripEnd, $passengerListObject, $airtype, $nonStop);
}
コード例 #2
0
ファイル: airprice-servlet.php プロジェクト: tchalvak/airl
error_reporting(E_ALL);
ini_set('log_errors', TRUE);
ini_set('html_errors', FALSE);
ini_set('error_log', ERROR_LOG);
ini_set('display_errors', TRUE);
ini_set('memory_limit', '268435456');
ini_set('max_execution_time', '120');
// 0 = no limit.
ignore_user_abort(true);
include_once "helpers.php";
$txtLeave = $_GET["txtLeave"];
$txtReturn = $_GET["txtReturn"];
$destinationCode = strtoupper($_GET["destinationCode"]);
$gatewayCode = strtoupper($_GET["gatewayCode"]);
$airtype = $_GET["airtype"];
$nonStop = @$_GET["nonStop"];
$numRooms = @$_GET["numRooms"];
$numAdultsRoom1 = @$_GET["numAdultsRoom1"];
$numAdultsRoom2 = @$_GET["numAdultsRoom2"];
$childArrayRoom1 = @$_GET["childArrayRoom1"];
$childArrayRoom2 = @$_GET["childArrayRoom2"];
$numAdults = $numAdultsRoom1;
$childAges = $childArrayRoom1;
if ($numRooms > 1) {
    $numAdults += $numAdultsRoom2;
    $childAges .= $childArrayRoom2;
}
$passengerListObject = new PassengerListObject($numAdults, $childAges);
$convertToCurrency = false;
echo get_air_price($gatewayCode, $destinationCode, AIR_DISCOUNT, $convertToCurrency, $txtLeave, $txtReturn, $passengerListObject, $airtype, $nonStop);