Esempio n. 1
0
            }
            //$res = $soapProxy->verifyTransaction($RefNum, $SamanMID); #reference number and sellerid
            $paramss[] = array("refNum" => $RefNum, "sellerId" => $UserName);
            $res = $soapProxy->verifyTransaction($params);
            //var_dump($res);
            $res = $res[0];
            if ($res <= 0) {
                echo 'verification failed 1: <br>بروز خطا در سیستم بانکی<br>' . $res;
                //            echo '<h2>verification Error</h2><pre>خطا در پرداخت <br>لطقا با پشتیبانی تماس بگیرید</pre>';
                $en = 6;
            } elseif ($res != $tprice) {
                echo 'verification failed : <br>بروز خطا در سیستم مالی<br>' . $res;
                //            echo '<h2>verification Error 2</h2><pre>خطا در پرداخت <br>لطقا با پشتیبانی تماس بگیرید</pre>';
                $en = 7;
            } else {
                $out = reserve_class::confirm($refrence_id);
            }
        } else {
            if ($en == 4) {
                echo 'رزرو شما توسط ادمین کنسل شد :' . "<br/>\n" . $State . '<br/>مبلغ شما تا ۷۲ ساعت دیگر به حساب شما بر می گردد<br/><a href="' . site_url() . '">بازگشت</a>';
            }
        }
    }
    $my->ex_sqlx("update reserve set en = {$en} , bank_result = '" . json_encode($bank_result) . "', tarikh = '" . date("Y-m-d H:i:s") . "' where id = {$ResNum}");
} else {
    die('Access ERROR.');
}
$voucher_id = $_SESSION['voucher_id'];
$voucher = $voucher_id[0] . (count($voucher_id) == 2 ? '-' . $voucher_id[1] : '');
$refrence_id = $_SESSION['refrence_id'];
$passengers = $_SESSION['passengers'];
Esempio n. 2
0
$flight1 = (array) $flight_info;
$flight2 = (array) $flight_info2;
$ttprice1 = reserve_class::ghimat($flight1['tflight'], $adl, $chd, $inf);
if (isset($ttprice1['err']) && $ttprice1['err']['code'] != 0) {
    //    var_dump($ttprice1);
    die("GHIMAT ERROR<br/>" . $ttprice1['err']['code'] . "<br/>" . $ttprice1['err']['msg']);
}
$price['adult_price'] = (int) $ttprice1['fare'];
$price['inf_price'] = (int) ($price['adult_price'] / 10);
$price['child_price'] = $chd > 0 ? (int) (((int) $ttprice1['total'] - ($price['adult_price'] * $adl + $price['inf_price'] * $inf)) / $chd) : 0;
$price['total_price'] = (int) $ttprice1['total'];
$price['badult_price'] = 0;
$price['bchild_price'] = 0;
$price['binf_price'] = 0;
if (isset($_SESSION['data2'])) {
    $ttprice2 = reserve_class::ghimat($flight2['tflight'], $adl, $chd, $inf);
    $price['badult_price'] = (int) $ttprice2['fare'];
    $price['binf_price'] = (int) ($price['badult_price'] / 10);
    $price['bchild_price'] = $chd > 0 ? (int) (((int) $ttprice2['total'] - ($price['badult_price'] * $adl + $price['binf_price'] * $inf)) / $chd) : 0;
    $price['total_price'] += (int) $ttprice2['total'];
}
//parvaz raft price
$adl_tax = 0;
$chd_tax = 0;
$inf_tax = 0;
$adl_price = $price['adult_price'] + $rookeshi;
$chd_price = $price['child_price'] + $rookeshi;
$inf_price = $price['inf_price'] + $rookeshi;
$adl_total_price = ($adl_tax + $adl_price) * $adl;
$chd_total_price = ($chd_tax + $chd_price) * $chd;
$inf_total_price = ($inf_tax + $inf_price) * $inf;
Esempio n. 3
0
 public static function passengers($refID, $passengers, $mobile, $email, $address, $description, $flight1, $flight2)
 {
     $out['err']['code'] = 8;
     $out['err']['msg'] = 'UNKNOWN ERROR';
     $conf = new conf();
     $url = $conf->wurl . "rest/book";
     $User = $conf->wuser;
     $Password = $conf->wpass;
     $npass = array();
     foreach ($passengers as $i => $p) {
         $birthday = explode('-', $p['birthday']);
         $bdate_arr = jalali_to_jgregorian($birthday[0], $birthday[1], $birthday[2]);
         $passenger = array("gender" => $p['gender'] == 1 ? 'M' : 'F', "fname" => $p['fname_en'], "lname" => $p['lname_en'], 'nationality' => 'IRN', 'nationalCode' => trim($p['passport_engheza']) != '' ? '' : $p['shomare_melli'], "passportId" => trim($p['passport_engheza']) == '' ? '' : $p['shomare_melli'], "passportExpire" => trim($p['passport_engheza']), 'passportIssueCountry' => 'IRN', "birthDate" => $bdate_arr[0] . '-' . $bdate_arr[1] . '-' . $bdate_arr[2]);
         $npass[] = $passenger;
     }
     $dtmp = explode('-', $flight1['fdate']);
     $mtmp = jalali_to_jgregorian($dtmp[0], $dtmp[1], $dtmp[2]);
     $flight1['fdate'] = $mtmp[0] . '-' . $mtmp[1] . '-' . $mtmp[2];
     $flight1['arrivalDate'] = $flight1['fdate'];
     if ($flight1['ltime'] < $flight1['ftime']) {
         $flight1['arrivalDate'] = date("Y-m-d", strtotime($flight1['fdate'] . ' + 1 day'));
     }
     $req = ' <OTA_AirBookRQ xmlns="http://www.opentravel.org/OTA/2003/05" 
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                xsi:schemaLocation="http://www.opentravel.org/OTA/2008/05  
                OTA_AirBookRQ.xsd" EchoToken="50987" TimeStamp="2015-11-02IRST16:06:12+03:30" 
                Target="Real" Version="2.001" SequenceNmbr="1" PrimaryLangID="En-us"> 
     <AirItinerary DirectionInd="OneWay"> 
         <OriginDestinationOptions> 
             <OriginDestinationOption> 
                 <FlightSegment TFlight="' . $flight1['tflight'] . '" FlightNumber="' . $flight1['flight_number'] . '" ResBookDesigCode="H" DepartureDateTime="' . $flight1['fdate'] . 'T' . $flight1['ftime'] . ':00.000+03:30" 
                                ArrivalDateTime="' . $flight1['arrivalDate'] . 'T' . $flight1['ltime'] . ':00.000+03:30" StopQuantity="0" RPH="1"> 
                     <DepartureAirport LocationCode="' . $flight1['from_city'] . '" Terminal="T1"/> 
                     <ArrivalAirport LocationCode="' . $flight1['to_city'] . '" Terminal="T2"/> 
                 </FlightSegment> 
             </OriginDestinationOption> 
         </OriginDestinationOptions> 
     </AirItinerary> 
     <PriceInfo> 
         <ItinTotalFare> 
             <TotalFare CurrencyCode="IRR" DecimalPlaces="0" Amount="' . $flight1['price'] . '"/> 
         </ItinTotalFare> 
     </PriceInfo> 
     <TravelerInfo>';
     foreach ($npass as $passenger) {
         $req .= '<AirTraveler PassengerTypeCode="ADT" Gender="' . $passenger['gender'] . '" BirthDate="' . $passenger['birthDate'] . '" AccompaniedByInfantInd="false"> 
             <PersonName> 
                 <NamePrefix>Mr</NamePrefix> 
                 <GivenName>' . $passenger['fname'] . '</GivenName>  
                 <Surname>' . $passenger['lname'] . '</Surname> 
             </PersonName> 
             <Telephone PhoneNumber="' . $mobile . '"/> 
             <Email>' . $email . '</Email> 
             <Document DocID="' . $passenger['passportId'] . '" DocHolderNationality="' . $passenger['passportIssueCountry'] . '"/>  
         </AirTraveler>';
     }
     $req .= '</TravelerInfo> 
     </OTA_AirBookRQ>';
     //        echo "REQUEST : <br/>\n" . $req;
     $content = reserve_class::sendRequest($url, $User, $Password, $req);
     //        echo "<br/>\nRESPONSE:<br/>\n" . $content;
     $xml = new SimpleXMLElement($content);
     if (empty($xml->Errors)) {
         $t = (array) $xml->AirReservation->BookingReferenceID;
         $refrenceId = $t['@attributes']['ID'];
         //            $return = [
         //                'result' => 'success',
         //                'refrenceId' => $refrenceId,
         //                'errors' => []
         //            ];
         $out['err']['code'] = 0;
         $out['err']['msg'] = '';
         $out['refrence_id'] = $refrenceId;
     } else {
         //            var_dump((array) $xml->Errors);
         //            foreach ((array) $xml->Errors as $index => $node) {
         //                $n = (array)$node[0];
         //                $node= (array)$n[0];
         //                var_dump($node);
         //                $code = $node["@attributes"]['Code'];
         //                $msg = $node["@attributes"]['Message'];
         //                $out['err']['code'] = $code;
         //                $out['err']['msg'] = $msg;
         //            }
         $errors = (array) $xml->Errors;
         $error = (array) $errors['Error'];
         $code = $error["@attributes"]['Code'];
         $msg = $error["@attributes"]['Message'];
         $out['err']['code'] = $code;
         $out['err']['msg'] = $msg;
         $out['refrence_id'] = '';
     }
     //        } else {
     //            foreach ((array) $xml->Errors as $index => $node) {
     //                foreach ($node as $key => $n) {
     //                    $code = (string) $n->attributes()->Code . '<br/>';
     //                    $msg = (string) $n->attributes()->Message;
     //                    $out['err']['code'] = $code;
     //                    $out['err']['msg'] = $msg;
     //                }
     //            }
     //            $out['refrence_id'] = '';
     //        }
     //        $client = new nusoap_client($conf->wurl."server.php?wsdl", true);
     //        $arguments = array(
     //            "user" => $conf->wuser,
     //            "pass" => $conf->wpass,
     //            "refrence_id" => $refID,
     //            "jpassengers" => json_encode($passengers),
     //            "mobile" => $mobile,
     //            "email" => $email,
     //            "address" => $address,
     //            "description" => $description
     //        );
     //        $result = $client->call("reserve_passengers2", $arguments);
     //        if ($client->fault) {
     //            $out['err']['code'] = 8;
     //            $out['err']['msg'] = $client->fault;
     //        } else {
     //            $error = $client->getError();
     //            if ($error) {
     //                $out['err']['code'] = 8;
     //                $out['err']['msg'] = $error;
     //                echo '<hr/>';
     //                echo '<h2>Request</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
     //                echo '<hr/>';
     //                echo '<h2>Response</h2><pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
     //                echo '<hr/>';
     //                echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
     //            } else {
     //                $out = json_decode($result, TRUE);
     //            }
     //        }
     return $out;
 }
Esempio n. 4
0
<?php

//echo $p1;
$out = reserve_class::tickets((int) $p1);
$pr = '';
//var_dump($out);
if (is_array($out['tickets'])) {
    foreach ($out['tickets'] as $ticket) {
        $pr .= $ticket;
    }
} else {
    $pr = "بلیت مورد نظر پیدا نشد";
}
echo $pr;
Esempio n. 5
0
    $date_az = date_create(jalali_to_jgregorian($arr_az[0], $arr_az[1], $arr_az[2], '-'));
    $date_az2 = date_create(jalali_to_jgregorian($arr_az[0], $arr_az[1], $arr_az[2], '-'));
    //var_dump($date_az);
    $az_next = date_format($date_az->modify('+1 day'), 'Y-m-d');
    $az_pre = date_format($date_az->modify('-2 day'), 'Y-m-d');
    $arr_fa_pre = explode('-', $az_pre);
    $az_fa_pre = jgregorian_to_jalali($arr_fa_pre[0], $arr_fa_pre[1], $arr_fa_pre[2], '/');
    $arr_fa_next = explode('-', $az_next);
    $az_fa_next = jgregorian_to_jalali($arr_fa_next[0], $arr_fa_next[1], $arr_fa_next[2], '/');
} else {
    $az_fa_next = '';
    $az_fa_pre = '';
}
$tmpp = '';
if (isset($_REQUEST['adult'])) {
    $res = new reserve_class();
    $adl = (int) $_REQUEST['adult'];
    $chd = (int) $_REQUEST['child'];
    $inf = (int) $_REQUEST['inf'];
    $class_ghimat = $_REQUEST['class_ghimat'];
    $ip = getenv("REMOTE_ADDR");
    if (!$ip) {
        $ip = $_SERVER['REMOTE_ADDR'];
    }
    if (!$ip) {
        $ip = $_SERVER['HTTP_CLIENT_IP'];
    }
    if (!$ip) {
        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    }
    $agency_id = (int) $_REQUEST['agency_id'] . ',' . (int) $_REQUEST['agency_id2'];