예제 #1
0
function flight_avail()
{
    //    print_r($source_update_ids);
    $conf = new conf();
    $db = new db_flight();
    $query = "SELECT * FROM source_update WHERE stat=0 ";
    $res = $db->query($query);
    while ($row = $res->fetch_assoc()) {
        $db->query("UPDATE `source_update` SET  `stat` =  '2' WHERE  `source_update`.`id` =" . $row['id'] . ";");
        switch ($row['source_id']) {
            case 1:
                // GOHAR
                $db->query("UPDATE `source_update` SET  `stat` =  '1',last_update='" . date('Y-m-d H:i:s') . "' WHERE  `source_update`.`id` =" . $row['id'] . ";");
                break;
            case 3:
                // MERAJ
                require_once 'MerajDrive.php';
                $source_class = new MerajDrive($db, $conf->meraj_auth, $conf->meraj_base_url);
                $source_class->update_avail($row['id'], $row['source_id']);
                break;
            case 4:
                // PARTO
                break;
            case 2:
            case 10:
                // Gardoon
            // Gardoon
            case 11:
            case 12:
                // Hamoon Gasht
            // Hamoon Gasht
            case 13:
                // Binalood
            // Binalood
            case 14:
            case 15:
                // Donya Seir
            // Donya Seir
            case 16:
                // Arad Gasht
            // Arad Gasht
            case 17:
                require_once 'gabriel_reserve.php';
                $source_class = new gabriel_reserve($db);
                $source_class->update_avail($row['id'], $row['source_id']);
                break;
        }
    }
}
예제 #2
0
                </TravelerInfo>
                <Fulfillment>
                        <PaymentDetails>
                                <PaymentDetail>
                                        <DirectBill DirectBill_ID="DARVISHI">
                                                <CompanyName>DARVISHI</CompanyName>
                                        </DirectBill>
                                        <PaymentAmount CurrencyCode="IRR" DecimalPlaces="0" Amount="' . $PaymentAmount . '"/>
                                </PaymentDetail>
                        </PaymentDetails>
                </Fulfillment>
        </OTA_AirBookRQ>';
        $content = $this->sendRequest("booking/create", $xmlStr);
        return $content;
    }
}
date_default_timezone_set("Asia/Tehran");
$db = new Flight();
//$meraj = new MerajDrive($db,"PJ9C2dPofKP4XBTzFeEF3IusN6lVKc+/", "http://products.proavos.com:9190/wsbe/rest");
$meraj = new MerajDrive($db, "PJ9C2dPofKPW1MhAX/B09DHgk5YsSP4xXw9DXzuoBaE=", "http://booking.merajairlines.ir:8180/wsbe/rest");
//$froms=$db->select("mahan_city", array());
//$tos=$db->select("mahan_city", array());
$froms = array('MHD', 'THR', 'SYZ', 'ISF');
$tos = array('MHD', 'THR', 'SYZ', 'ISF');
//$froms=array('THR');
//$tos=array('SYZ');
$startTime = time();
$flights = $meraj->avail($froms, $tos);
$finishTime = time();
$bench = $finishTime - $startTime;
echo "<p>زمان اجرای درخواست : {$bench} ثانیه</p>";