| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/b2bzend/application/views/scripts/booking-flight/ |
Upload File : |
<?php
$arrStatusType = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->getAllStatusType();
$type = $this->type;
$arrCustomerInvoiceData = $this->arrCustomerInvoiceData;
$arrtravellerList = $this->arrtravellerList;
$withprice = $this->withprice;
$getSupportContact = $this->getSupportContact;
$IsB2BProposal = $arrCustomerInvoiceData[0]['IsB2BProposal'];
$AgencySysId = $arrCustomerInvoiceData[0]['AgencySysId'];
$CompanyName = $arrCustomerInvoiceData[0]['CompanyName'];
$strCompanyAddress = $arrCustomerInvoiceData[0]['CompanyAddress'];
$Pincode = $arrCustomerInvoiceData[0]['Pincode'];
$strCityTitle = $arrCustomerInvoiceData[0]['CityTitle'];
$strCountry = $arrCustomerInvoiceData[0]['Country'];
$PrimaryMobileNo = $arrCustomerInvoiceData[0]['PrimaryMobileNo'];
$PrimaryContactNo = (isset($arrCustomerInvoiceData[0]['ContactNo2']) && !empty(trim($arrCustomerInvoiceData[0]['ContactNo2']))) ? $arrCustomerInvoiceData[0]['ContactNo2'] : $arrCustomerInvoiceData[0]['PrimaryContactNo'];
$PrimaryEmail = (isset($arrCustomerInvoiceData[0]['SecondaryEmail']) && !empty(trim($arrCustomerInvoiceData[0]['SecondaryEmail']))) ? $arrCustomerInvoiceData[0]['SecondaryEmail'] : $arrCustomerInvoiceData[0]['PrimaryEmail'];
$companyLogo = $arrCustomerInvoiceData[0]['Logo'];
$UserAgencyLogo = isset($arrCustomerInvoiceData[0]['UserAgencyLogo']) ? $arrCustomerInvoiceData[0]['UserAgencyLogo'] : '';
if (isset($getSupportContact['EmailId']) && !empty($getSupportContact['EmailId'])) {
$PrimaryEmail = trim($getSupportContact['EmailId']);
}
if (isset($getSupportContact['EmailId']) && !empty($getSupportContact['EmailId'])) {
$PrimaryContactNo = trim($getSupportContact['countrycode']) . '-' . trim($getSupportContact['ContactNo1']);
}
if ($IsB2BProposal == 1) {
$strCityTitle = $arrCustomerInvoiceData[0]['agentCityTitle'];
$strCountry = $arrCustomerInvoiceData[0]['agentCountry'];
$strCompanyAddress = $arrCustomerInvoiceData[0]['agentAdddress'];
$Pincode = $arrCustomerInvoiceData[0]['agentPinCode'];
$PrimaryEmail = $arrCustomerInvoiceData[0]['AgentEmailId'];
$CompanyName = $arrCustomerInvoiceData[0]['AgentAgencyName'];
$PrimaryContactNo = trim($getSupportContact['countrycode']) . '-' . trim($arrCustomerInvoiceData[0]['agentmobile']);
}
$GTXMarkup = $arrCustomerInvoiceData[0]['GTXMarkup'];
$Cost = ($arrCustomerInvoiceData[0]['Cost'] + $GTXMarkup);
$AgencyMarkUp = ($arrCustomerInvoiceData[0]['AgencyMarkUp'] + $arrCustomerInvoiceData[0]['MarkUp'] + $arrCustomerInvoiceData[0]['AgentsCustomServiceTaxAmount']);
$AgentServiceTaxAmount = $arrCustomerInvoiceData[0]['AgentServiceTaxAmount'];
$TotalCost = $arrCustomerInvoiceData[0]['TotalCost'];
$CurrencySymbol = $arrCustomerInvoiceData[0]['CurrencySymbol'];
$ExtraMarkup = $arrCustomerInvoiceData[0]['ExtraMarkup'];
$ExtraMarkupOnGST = $arrCustomerInvoiceData[0]['ExtraMarkupOnGST'];
//customer Details
$arrTrevllerDetails = $this->arrTrevllerDetails;
$CustomerEmailId = $arrTrevllerDetails[0][0]['EmailId'];
//customer Details
$TBQAirInvenSysId = $arrCustomerInvoiceData[0]['TBQAirInvenSysId'];
$TripType = $arrCustomerInvoiceData[0]['TripType'];
$IsInternational = $arrCustomerInvoiceData[0]['IsInternational'];
$strFlightNumber = $arrCustomerInvoiceData[0]['FlightNumber'];
$strSourceAirportCode = $arrCustomerInvoiceData[0]['SourceAirportCode'];
$strDestAirportCode = $arrCustomerInvoiceData[0]['DestAirportCode'];
$strXRefBookingId = $arrCustomerInvoiceData[0]['XRefBookingId'];
$LeadSource = $arrCustomerInvoiceData[0]['LeadSource'];
$strAirLineTitle = $arrCustomerInvoiceData[0]['AirLineTitle'];
$strAirLineCode = $arrCustomerInvoiceData[0]['AirLineCode'];
$arrBookingId = explode("/", $strXRefBookingId);
$strXRefBookingId = trim($arrBookingId[0]);
$strBookingPNR = isset($arrBookingId[1]) ? trim($arrBookingId[1]) : '';
$ICSourceSysId = $arrCustomerInvoiceData[0]['ICSourceSysId'];
$strStatusType = $arrCustomerInvoiceData[0]['StatusType'];
$GstNumber = $arrCustomerInvoiceData[0]['GstNumber'];
$AgencyGst = $arrCustomerInvoiceData[0]['AgencyGst'];
$bookingStatus = $arrStatusType[$strStatusType];
$arrBookingDate = (array) $arrCustomerInvoiceData[0]['bookingDate'];
$strBookingDate = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->getDateFormatFromDbDates($arrBookingDate['date']);
$arrFromUTCTime = (array) $arrCustomerInvoiceData[0]['FromUTCTime'];
$arrToUTCTime = (array) $arrCustomerInvoiceData[0]['ToUTCTime'];
$XRefBookingId = $arrCustomerInvoiceData[0]['XRefBookingId'];
$TotalTcs = $arrCustomerInvoiceData[0]['TotalTcs'];
$IsRefundable = isset($arrCustomerInvoiceData[0]['IsRefundable']) ? $arrCustomerInvoiceData[0]['IsRefundable'] : 0;
$sourceDepartueTime = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->getDateFormatFromDbDates($arrFromUTCTime['date']);
$destinationArrivalTime = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->getDateFormatFromDbDates($arrToUTCTime['date']);
//$arrAPIBookingRes = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->json_clean_decode($arrCustomerInvoiceData[0]['APIBookingRes']);
if (isset($arrCustomerInvoiceData[1]['APIBookingRes']) && !empty($arrCustomerInvoiceData[1]['APIBookingRes'])) {
$arrAPIBookingRes1 = json_decode($arrCustomerInvoiceData[1]['APIBookingRes'], true);
$SECTORSINB = trim($arrCustomerInvoiceData[1]['SourceAirportCode']) . '-' . trim($arrCustomerInvoiceData[1]['DestAirportCode']);
}
$arrAPIBookingRes = json_decode($arrCustomerInvoiceData[0]['APIBookingRes'], true);
if (is_array($arrAPIBookingRes)) {
$arrAPIBookingRes = $arrAPIBookingRes;
} else {
$arrAPIBookingRes = json_decode($arrAPIBookingRes, true);
}
$arrPassenger = isset($arrAPIBookingRes['Response']['Response']['FlightItinerary']['Passenger']) ? $arrAPIBookingRes['Response']['Response']['FlightItinerary']['Passenger'] : '';
//$Segments = isset($arrAPIBookingRes['Response']['Response']['FlightItinerary']['Segments']) ? $arrAPIBookingRes['Response']['Response']['FlightItinerary']['Segments'] : '';
$CancellationCharges = isset($arrAPIBookingRes['Response']['Response']['FlightItinerary']['CancellationCharges']) ? $arrAPIBookingRes['Response']['Response']['FlightItinerary']['CancellationCharges'] : '';
$FareRuleDetails = isset($arrAPIBookingRes['Response']['Response']['FlightItinerary']['FareRules']) ? $arrAPIBookingRes['Response']['Response']['FlightItinerary']['FareRules'] : '';
$showintax = isset($arrAPIBookingRes['value']['FairRules']['showintax']) ? $arrAPIBookingRes['value']['FairRules']['showintax'] : 0;
$this->CurrencyRate = isset($arrAPIBookingRes['value']['FairRules']['CurrencyRate']) ? $arrAPIBookingRes['value']['FairRules']['CurrencyRate'] : 0;
$OtherCharges = ($ExtraMarkup + $ExtraMarkupOnGST);
$TotalExtraCharge = ($ExtraMarkup + $ExtraMarkupOnGST);
if ($showintax == 1) {
$OtherCharges = $OtherCharges;
$ExtraMarkup = 0;
$ExtraMarkupOnGST = 0;
$TotalExtraProfit = $TotalExtraCharge;
$Cost = $Cost + $TotalExtraCharge;
} else {
$ExtraMarkup = $ExtraMarkup;
$ExtraMarkupOnGST = $ExtraMarkupOnGST;
$OtherCharges = 0;
$TotalExtraProfit = $ExtraMarkup;
$Cost = $Cost;
}
$AgencyMarkUp = $AgencyMarkUp + $ExtraMarkup;
$AgentServiceTaxAmount = $AgentServiceTaxAmount + $ExtraMarkupOnGST;
$API_Response = $arrAPIBookingRes['value'];
if ($arrAPIBookingRes1) {
$API_ResponseInb = $arrAPIBookingRes1['value'];
}
if ($IsInternational == 1 && $TripType == 2) {
if (isset($arrAPIBookingRes['value']['InternationalData']['Fare']['FareBreakdown'])) {
$FareBreakdown = $arrAPIBookingRes['value']['InternationalData']['Fare']['FareBreakdown'];
} elseif (isset($arrAPIBookingRes['value']['InternationalData']['FairRules']['FareBreakdown'])) {
$FareBreakdown = $arrAPIBookingRes['value']['InternationalData']['FairRules']['FareBreakdown'];
} else {
$FareBreakdown = $API_Response['FairRules']['FareBreakdown'];
}
} else {
$FareBreakdown = $API_Response['FairRules']['FareBreakdown'];
}
// echo "<pre>";
// print_r($AgencyGst);
// echo "</pre>";
$TotalFare = 0;
$TotalServiceFee = 0;
$TotalGST = 0;
$TotalAmount = 0;
$sl = 0;
$TotalMealFare = 0;
$TotalBaggFare = 0;
$TotalSeatFare = 0;
$TotalDiscountValue = 0;
if ($FareBreakdown) {
foreach ($FareBreakdown as $k => $value) {
$PassengerCount = $value['PassengerCount'];
$valueInb = isset($API_ResponseInb['FairRules']['FareBreakdown'][$k]) ? $API_ResponseInb['FairRules']['FareBreakdown'][$k] : [];
// echo "<pre>";
// print_r($value);
// echo "</pre>";
$OT_IN = isset($valueInb['OT']) ? $valueInb['OT'] : $valueInb['TaxBR']['OT'];
$OT_ = isset($value['OT']) ? $value['OT'] : $value['TaxBR']['OT'];
$TaxIN = (($value['TaxIN'] + $valueInb['TaxIN']));
$YR = (($value['YR'] + $valueInb['YR']));
$MF = (($value['MF'] + $valueInb['MF']));
$MFT = (($value['MFT'] + $valueInb['MFT']));
$MU = (($value['MU'] + $valueInb['MU']));
$OT = ($OT_ + $OT_IN);
$BaseFareCal = (($value['BaseFare'] + $valueInb['BaseFare']));
$YQ = (($value['YQ'] + $valueInb['YQ']));
$AGST = (($value['AGST'] + $valueInb['AGST']));
$FixedMarkUp = (($value['FixedMarkUp'] + $valueInb['FixedMarkUp']));
$GSTOnMarkUp = (($value['GSTOnMarkUp'] + $valueInb['GSTOnMarkUp']));
$intTotalGST = (($value['intTotalGST'] + $valueInb['intTotalGST']));
$apiMarkup = (($value['apiMarkup'] + $valueInb['apiMarkup']));
$apiTaxOnMarkup = (($value['apiTaxOnMarkup'] + $valueInb['apiTaxOnMarkup']));
$CommEarned = (($value['CommEarned'] + $valueInb['CommEarned']));
$CommissionEarned = (($value['CommissionEarned'] + $valueInb['CommissionEarned']));
$intGTXMarkUp = (($value['intGTXMarkUp'] + $valueInb['intGTXMarkUp']));
$GTXMarkUpGST = (($value['GTXMarkUpGST'] + $valueInb['GTXMarkUpGST']));
$Agencycommission = (($value['Agencycommission'] + $valueInb['Agencycommission']));
if (empty($Agencycommission)) {
$Agencycommission = $CommissionEarned;
}
$ExtraMarkup = isset($value['ExtraMarkup']) ? $value['ExtraMarkup'] + $valueInb['ExtraMarkup'] : 0;
$ExtraMarkupOnGST = isset($value['ExtraMarkupOnGST']) ? $value['ExtraMarkupOnGST'] + $valueInb['ExtraMarkupOnGST'] : 0;
$showintax = isset($value['showintax']) ? $value['showintax'] : 0;
$DiscountValue_ = isset($value['DiscountValue']) ? $value['DiscountValue'] : 0;
$AgentMarkUp = 0; //isset($value['AgentMarkUp']) ? $value['AgentMarkUp'] : 0;
if ($LeadSource == 'Website B2B') {
$ExtraMarkup = 0;
$ExtraMarkupOnGST = 0;
}
$ServiceFee = ($intGTXMarkUp + $GTXMarkUpGST);
$OTTax = ($MF + $MFT + $OT + $YR + $AgentMarkUp);
//$OTTax = ($apiTaxOnMarkup);
$OtherCharges = ($ExtraMarkup + $ExtraMarkupOnGST);
$TotalExtraCharge = ($ExtraMarkup + $ExtraMarkupOnGST);
$TotalAmount += ($BaseFareCal + $OTTax + $AGST + $YQ + $GSTOnMarkUp + $FixedMarkUp + $apiMarkup + $apiTaxOnMarkup + $intGTXMarkUp + $GTXMarkUpGST + $TotalExtraCharge);
if ($showintax == 1) {
$OtherCharges = $OtherCharges;
$ExtraMarkup = 0;
$ExtraMarkupOnGST = 0;
$TotalExtraProfit = $TotalExtraCharge;
$BaseFareCal = $BaseFareCal + $TotalExtraCharge;
} else {
$ExtraMarkup = $ExtraMarkup;
$ExtraMarkupOnGST = $ExtraMarkupOnGST;
$OtherCharges = 0;
$TotalExtraProfit = $ExtraMarkup;
$BaseFareCal = $BaseFareCal;
}
$TotalServiceFee += ($FixedMarkUp + $ExtraMarkup + $apiMarkup);
$TotalDiscountValue += ($DiscountValue_);
$TotalGST += ($GSTOnMarkUp + $ExtraMarkupOnGST + $apiTaxOnMarkup);
// $TotalGST += ($GSTOnMarkUp + $apiTaxOnMarkup + $ExtraMarkupOnGST);apiMarkup
$TotalFare += ((($BaseFareCal + $OTTax + $AGST + $YQ + $intGTXMarkUp + $GTXMarkUpGST + $CommEarned) - $CommissionEarned));
}
}
//echo $TotalFare . ' + ' . $TotalServiceFee . ' + ' . $TotalGST . ' + ' . $TotalTcs . ' - ' . $TotalDiscountValue;
// if ($showintax == 1) {
// $OtherCharges = $OtherCharges;
// $ExtraMarkup = 0;
// $ExtraMarkupOnGST = 0;
// $TotalExtraProfit = $TotalExtraCharge;
// $TotalFare = $TotalFare + $TotalExtraCharge;
// } else {
// $ExtraMarkup = $ExtraMarkup;
// $ExtraMarkupOnGST = $ExtraMarkupOnGST;
// $OtherCharges = 0;
// $TotalExtraProfit = $ExtraMarkup;
// $TotalFare = $TotalFare;
// }
$Segments = $arrAPIBookingRes['value']['Segments'];
$status = $arrAPIBookingRes['response']['order']['status'];
$travellerInfos = $arrAPIBookingRes['response']['itemInfos']['AIR']['travellerInfos'];
$SECTORS = trim($arrCustomerInvoiceData[0]['SourceAirportCode']) . '-' . trim($arrCustomerInvoiceData[0]['DestAirportCode']);
//echo $IsInternational . '==' . $TripType . '==' . $ICSourceSysId;
$CustomeSegment1 = [];
if ($IsInternational == 1 && $TripType == 2 && $ICSourceSysId != 9 && $ICSourceSysId != 8) {
$CustomeSegment = [];
if (isset($arrAPIBookingRes['value']['InternationalData']['Segments'])) {
foreach ($arrAPIBookingRes['value']['InternationalData']['Segments'] as $seg) {
foreach ($seg as $val) {
$CustomeSegment[] = $val;
}
}
} else {
foreach ($Segments as $seg) {
foreach ($seg as $val) {
$CustomeSegment[] = $val;
}
}
}
} else {
$CustomeSegment = $arrAPIBookingRes['value']['Segments'];
$CustomeSegment1 = $arrAPIBookingRes1['value']['Segments'];
}
$sectorArr = [];
$sectorArrInb = [];
if ($CustomeSegment) {
foreach ($CustomeSegment as $key => $value) {
$sectorKey = $value['originAirportCode'] . '-' . $value['destinationAirportCode'];
$sectorArr[$sectorKey] = $value['originAirportCode'] . '-' . $value['destinationAirportCode'];
$sectorKeyinb = $value['destinationAirportCode'] . '-' . $value['originAirportCode'];
$sectorArrInb[$sectorKeyinb] = $value['destinationAirportCode'] . '-' . $value['originAirportCode'];
}
}
if (isset($arrAPIBookingRes1) && !empty($arrAPIBookingRes1) && $TripType == 2) {
if (!empty($CustomeSegment1)) {
$CustomeSegment = array_merge($CustomeSegment, $CustomeSegment1);
} else {
$CustomeSegment = $CustomeSegment;
}
} else {
$CustomeSegment = $CustomeSegment;
}
$couponApply = isset($arrAPIBookingRes['value']['FairRules']['couponApply']) ? $arrAPIBookingRes['value']['FairRules']['couponApply'] : 0;
$couponVal = isset($arrAPIBookingRes['value']['FairRules']['couponVal']) ? $arrAPIBookingRes['value']['FairRules']['couponVal'] : 0;
$couponVal1 = isset($arrAPIBookingRes1['value']['FairRules']['couponVal']) ? $arrAPIBookingRes1['value']['FairRules']['couponVal'] : 0;
if ($couponApply) {
$TotalDiscountValue = $TotalDiscountValue + $couponVal + $couponVal1;
}
$CancelCharge = isset($arrAPIBookingRes['value']['FairRules']['CancelCharge']) ? $arrAPIBookingRes['value']['FairRules']['CancelCharge'] : 0;
$FareRuleDetails = isset($arrAPIBookingRes['value']['FareRuleDetails']) ? $arrAPIBookingRes['value']['FareRuleDetails'] : '';
$FareRuleData = isset($arrAPIBookingRes['value']['FareRuleData']) ? $arrAPIBookingRes['value']['FareRuleData'] : '';
$IsLCC = isset($arrAPIBookingRes['value']['IsLCC']) ? $arrAPIBookingRes['value']['IsLCC'] : '0';
$IsTJFlightAPI = isset($arrAPIBookingRes['value']['IsTJFlightAPI']) ? $arrAPIBookingRes['value']['IsTJFlightAPI'] : '0';
$interNationalSearch = isset($arrAPIBookingRes['value']['arrCommonInsVariables']['interNationalSearch']) ? $arrAPIBookingRes['value']['arrCommonInsVariables']['interNationalSearch'] : '';
$FareRules = $FareRuleData['fareRule'];
$ErrorCode = $FareRuleData['status']['success'];
if (isset($travellerInfos[0]['pnrDetails'])) {
$PNRNUmber = implode(',', (array_values($travellerInfos[0]['pnrDetails'])));
} else {
$PNRNUmber = '';
}
$FareRules = isset($API_Response['FareRules']) ? $API_Response['FareRules'] : '';
$InternalRemarks = isset($API_Response['InternalRemarks']) ? $API_Response['InternalRemarks'] : '';
$CancellationPolicy = isset($API_Response['CancellationPolicy']) ? $API_Response['CancellationPolicy'] : '';
if ($TripType == 3) {
$CustomeSegment = [];
$FareBreakdown = [];
if ($arrCustomerInvoiceData) {
foreach ($arrCustomerInvoiceData as $values) {
$arrAPIBookingRes = json_decode($values['APIBookingRes'], true);
$Segments__ = $arrAPIBookingRes['value']['Segments'];
$FairRules = $arrAPIBookingRes['value']['FairRules']['FareBreakdown'];
foreach ($Segments__ as $seg) {
$CustomeSegment[] = $seg;
}
foreach ($FairRules as $fare) {
$FareBreakdown[] = $fare;
}
}
}
$TotalFare = 0;
$TotalServiceFee = 0;
$TotalGST = 0;
$TotalAmount = 0;
$sl = 0;
$TotalMealFare = 0;
$TotalBaggFare = 0;
$TotalSeatFare = 0;
$TotalDiscountValue = 0;
if ($FareBreakdown) {
foreach ($FareBreakdown as $k => $value) {
$PassengerCount = $value['PassengerCount'];
$TaxIN = (($value['TaxIN']));
$YR = (($value['YR']));
$MF = (($value['MF']));
$MFT = (($value['MFT']));
$MU = (($value['MU']));
$OT = (($value['OT']));
$BaseFareCal = (($value['BaseFare']));
$YQ = (($value['YQ']));
$AGST = (($value['AGST']));
$FixedMarkUp = (($value['FixedMarkUp']));
$GSTOnMarkUp = (($value['GSTOnMarkUp']));
$intTotalGST = (($value['intTotalGST']));
$apiMarkup = (($value['apiMarkup']));
$apiTaxOnMarkup = (($value['apiTaxOnMarkup']));
$CommEarned = (($value['CommEarned']));
$CommissionEarned = (($value['CommissionEarned']));
$intGTXMarkUp = (($value['intGTXMarkUp']));
$GTXMarkUpGST = (($value['GTXMarkUpGST']));
$Agencycommission = (($value['Agencycommission']));
if (empty($Agencycommission)) {
$Agencycommission = $CommissionEarned;
}
$ExtraMarkup = isset($value['ExtraMarkup']) ? $value['ExtraMarkup'] : 0;
$ExtraMarkupOnGST = isset($value['ExtraMarkupOnGST']) ? $value['ExtraMarkupOnGST'] : 0;
$showintax = isset($value['showintax']) ? $value['showintax'] : 0;
$DiscountValue_ = isset($value['DiscountValue']) ? $value['DiscountValue'] : 0;
$AgentMarkUp = 0; //isset($value['AgentMarkUp']) ? $value['AgentMarkUp'] : 0;
if ($LeadSource == 'Website B2B') {
$ExtraMarkup = 0;
$ExtraMarkupOnGST = 0;
}
$ServiceFee = ($intGTXMarkUp + $GTXMarkUpGST);
$OTTax = ($MF + $MFT + $OT + $YR + $AgentMarkUp);
//$OTTax = ($apiTaxOnMarkup);
$OtherCharges = ($ExtraMarkup + $ExtraMarkupOnGST);
$TotalExtraCharge = ($ExtraMarkup + $ExtraMarkupOnGST);
$TotalAmount += ($BaseFareCal + $OTTax + $AGST + $YQ + $GSTOnMarkUp + $FixedMarkUp + $apiMarkup + $apiTaxOnMarkup + $intGTXMarkUp + $GTXMarkUpGST + $TotalExtraCharge);
if ($showintax == 1) {
$OtherCharges = $OtherCharges;
$ExtraMarkup = 0;
$ExtraMarkupOnGST = 0;
$TotalExtraProfit = $TotalExtraCharge;
$BaseFareCal = $BaseFareCal + $TotalExtraCharge;
} else {
$ExtraMarkup = $ExtraMarkup;
$ExtraMarkupOnGST = $ExtraMarkupOnGST;
$OtherCharges = 0;
$TotalExtraProfit = $ExtraMarkup;
$BaseFareCal = $BaseFareCal;
}
$TotalServiceFee += ($FixedMarkUp + $ExtraMarkup + $apiMarkup);
$TotalDiscountValue += ($DiscountValue_);
$TotalGST += ($GSTOnMarkUp + $ExtraMarkupOnGST + $apiTaxOnMarkup);
// $TotalGST += ($GSTOnMarkUp + $apiTaxOnMarkup + $ExtraMarkupOnGST);apiMarkup
$TotalFare += ((($BaseFareCal + $OTTax + $AGST + $YQ + $intGTXMarkUp + $GTXMarkUpGST + $CommEarned) - $Agencycommission));
}
}
}
if ($ICSourceSysId == 10) {
$RiyaPnr = [];
if ($arrCustomerInvoiceData) {
foreach ($arrCustomerInvoiceData as $val) {
$arrAPIBookingRes = json_decode($val['APIBookingRes'], true);
$Segments__ = $arrAPIBookingRes['value']['Segments'];
foreach ($Segments__ as $seg) {
$sc = $seg['originAirportCode'] . '-' . $seg['originAirportCode'];
$RiyaPnr[$sc] = $val['AirlineRefPNR'];
}
}
}
$success = $arrCustomerInvoiceData[0]['IsBookingStatus'];
$status = ($arrCustomerInvoiceData[0]['IsBookingStatus'] == 1) ? 'SUCCESS' : 'Pending';
$PNRNUmber = implode(',', (array_values($RiyaPnr)));
// echo "<pre>";
// print_r($arrCustomerInvoiceData[0]['IsBookingStatus']);
// echo "</pre>";
}
// echo "<pre>";
// print_r($CustomeSegment);
// echo "</pre>";
// die('ss');
require_once('Barcode417/vendor/autoload.php');
use BigFish\PDF417\PDF417;
use BigFish\PDF417\Renderers\ImageRenderer;
$pdf417 = new PDF417();
?>
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
<title>E - TICKET</title>
<link rel="stylesheet" href="<?php echo $this->baseUrl('public/css/ticket.css'); ?>">
<link rel="shortcut icon" href="<?php echo $this->baseUrl('public/assets/images/ico/fab.ico'); ?>">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"> </script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js">
</script>
<style>
* {
padding: 0;
margin: 0;
}
body {
page-break-before: avoid;
width: 100%;
height: 100%;
zoom: 70%;
-webkit-print-color-adjust: exact;
}
.gtx--body__print {
width: 100% !important;
}
</style>
<style>
body {
margin: 0px auto !important;
color: #000 !important;
-webkit-print-color-adjust: exact;
color-adjust: exact;
zoom: 65%;
}
p {
margin: 0;
line-height: 1.4;
}
ul {
margin: 0;
padding: 0
}
table {
width: 100%;
border-spacing: 0;
}
.print_back {
display: none;
}
</style>
</head>
<body id="body">
<div id="invoice__">
<table style="background:#fff; width:800px; margin: 0px auto" class="gtx--body__print">
<tbody>
<tr>
<td>
<table width="800px" class="removeshadow" style="box-shadow: 1px 1px 15px rgba(0, 0, 0,0.1); background: #fff">
<tbody>
<tr>
<td>
<table style="width:100%">
<tbody>
<tr>
<td style="width:60%; padding:15px 40px" class="print_logo">
<?php if ($IsB2BProposal == 1) { ?>
<img class=" print_image-success" style="max-width: 150px; opacity: 0.99;" src="<?php echo $UserAgencyLogo ?>" />
<?php } else { ?>
<img class=" print_image-success" style="max-width: 150px; opacity: 0.99;" src="<?php echo $this->baseUrl('public/upload/media/agency/' . $AgencySysId . '/' . $companyLogo); ?>" />
<?php } ?>
</td>
<td style="width:40%">
<p>
<strong class="printSmTxt">
<?php echo $CompanyName; ?>
</strong>
</p>
<p>
<span style="font-weight: 400; font-size: 12px; color: #777" class="printSmTxt">
Email:
<?= $PrimaryEmail ?>
</span>
</p>
<p>
<span style="font-weight: 400; font-size: 12px; color: #777" class="printSmTxt">
Phone:
<?= $PrimaryContactNo ?>
</span>
</p>
<p>
<span style="font-weight: 400; font-size: 12px; color: #777" class="printSmTxt">
Address:
<?php echo $strCompanyAddress; ?><br>
<?php echo $strCityTitle; ?><br>
<?php echo $strCountry; ?>,
<?php echo $Pincode; ?><br>
</span>
</p>
</td>
</tr>
</tbody>
</table>
<table style="width:100%">
<tbody>
<tr>
<td style="width: 50%; border: 1px solid #333; border-left: 0; padding: 8px;" class="printBookingDetail">
<p style="margin-bottom: 5px; color:#777"><span style="font-weight: 400;">
Booking Time:
<?= date('d-M-Y H:i:s', strtotime($arrBookingDate['date'])) ?></span>
</p>
<p style="margin-bottom: 5px; color:#777"><span style="font-weight: 400;">Booking
ID:<?= $strXRefBookingId ?></span></p>
<p style="margin-bottom: 5px; color:#777"><span style="font-weight: 400;">Booking
Status:
</span>
<strong style="color:#000">
<?= $status ?></strong>
</p>
</td>
<td style="width: 50%; border-top: 1px solid #333; border-bottom: 1px solid #333; padding:5px" class="printAirlineDetail">
<br />
<?php
$sectors = [];
$BAGGAGEARRAY = [];
$MEALARRAY = [];
$SEATARRAY = [];
if ($CustomeSegment) {
foreach ($CustomeSegment as $k => $flight) {
$strAirlineCode = $flight['AirlineCode'];
$filePath = $_SERVER['DOCUMENT_ROOT'] . "/public/upload/AirlineLogo/";
if (file_exists($filePath . $strAirlineCode . ".gif")) {
$strAirlineLogo = $strAirlineCode . ".gif";
$filePath = $this->baseUrl("public/upload/AirlineLogo/") . $strAirlineLogo;
} elseif (file_exists($filePath . $strAirlineCode . ".png")) {
$strAirlineLogo = $strAirlineCode . ".png";
$filePath = $this->baseUrl("public/upload/AirlineLogo/") . $strAirlineLogo;
} elseif (file_exists($filePath . $strAirlineCode . ".jpg")) {
$strAirlineLogo = $strAirlineCode . ".jpg";
$filePath = $this->baseUrl("public/upload/AirlineLogo/") . $strAirlineLogo;
} elseif (file_exists($filePath . $strAirlineCode . ".jpeg")) {
$strAirlineLogo = $strAirlineCode . ".jpeg";
$filePath = $this->baseUrl("public/upload/AirlineLogo/") . $strAirlineLogo;
} else {
$filePath = $this->baseUrl("public/upload/AirlineLogo/noimage.png");
}
$PNRNUmberExpl = explode(',', $PNRNUmber);
$nPNR = isset($PNRNUmberExpl[$k]) ? $PNRNUmberExpl[$k] : '';
// echo '<pre>';
// print_r(explode(',', $PNRNUmber));
// echo '</pre>';
?>
<table style="width: 100%; margin-bottom: 15px;">
<tbody>
<tr>
<td style="width: 40px;">
<p>
<span style="font-weight: 400;">
<img class="reviewbox__airlineLogo" src="<?php echo $filePath; ?>" title="<?php echo $flight['AirlineName']; ?>" style="margin-right:5px; vertical-align: middle; width: 30px" width="30" />
</span>
</p>
</td>
<td style="width:40%">
<p style="font-weight: 400; font-size:12px">
<?= $flight['AirlineName'] ?>
</p>
<p>
<span style="font-weight: 400; font-size:12px; color:#777">
</span>
</p>
</td>
<td>
<p style="font-weight:bold; font-size: 20px;">
<strong>
<?= !empty($nPNR) ? $nPNR : 'Pending' ?>
</strong>
</p>
<p>
<span style="font-weight: 400; font-size:12px; color:#777">Airline
PNR</span>
</p>
</td>
</tr>
</tbody>
</table>
<?php
}
}
?>
</td>
</tr>
</tbody>
</table>
<table style="width: 100%">
<tbody>
<tr>
<td style="width: 30%">
<p style="background: #000; padding: 5px; color: #fff; padding-left: 20px">
<span style="font-weight: 400;">Flight Detail
</span>
</p>
</td>
<td style="width: 70%" align="right">
<p style="background: #000; padding: 5px; color: #fff;"><em><span style="font-weight: 400;">*Please
verify flight timings & terminal info with the
airlines</span></em></p>
</td>
</tr>
</tbody>
</table>
<table style="width: 100%; line-height: normal;">
<tbody>
<tr>
<td width="20%">
<p style="background:#BCBEC0; color: #000; padding: 3px; padding-left: 20px">
<span style="font-weight: 400;">Flight</span>
</p>
</td>
<td width="10%">
<p style="background:#BCBEC0; color: #000; padding: 3px"><span style="font-weight: 400;">Class</span></p>
</td>
<td width="10%">
<p style="background:#BCBEC0; color: #000; padding: 3px"><span style="font-weight: 400;">Type</span></p>
</td>
<td width="20%">
<p style="background:#BCBEC0; color: #000; padding: 3px"><span style="font-weight: 400;">Departing</span></p>
</td>
<td width="20%">
<p style="background:#BCBEC0; color: #000; padding: 3px"><span style="font-weight: 400;">Arriving</span></p>
</td>
<td width="10%">
<p style="background:#BCBEC0; color: #000; padding: 3px"><span style="font-weight: 400;">Duration</span></p>
</td>
</tr>
</tbody>
</table>
<?php
$CabinBaggage = [];
if ($CustomeSegment) {
foreach ($CustomeSegment as $k => $flight) {
$originAirportCode = $flight['originAirportCode'];
$destinationAirportCode = $flight['destinationAirportCode'];
$BAGGAGEARRAY[$originAirportCode . '-' . $destinationAirportCode] = $flight['BAGGAGEARRAY'];
$MEALARRAY[$originAirportCode . '-' . $destinationAirportCode] = $flight['MEALARRAY'];
$SEATARRAY[$originAirportCode . '-' . $destinationAirportCode] = $flight['SEATARRAY'];
$sectors[] = $flight['originAirportCode'] . '-' . $flight['destinationAirportCode'];
$strAirlineCode = $flight['AirlineCode'];
$filePath = $_SERVER['DOCUMENT_ROOT'] . "/public/upload/AirlineLogo/";
if (file_exists($filePath . $strAirlineCode . ".gif")) {
$strAirlineLogo = $strAirlineCode . ".gif";
$filePath = $this->baseUrl("public/upload/AirlineLogo/") . $strAirlineLogo;
} elseif (file_exists($filePath . $strAirlineCode . ".png")) {
$strAirlineLogo = $strAirlineCode . ".png";
$filePath = $this->baseUrl("public/upload/AirlineLogo/") . $strAirlineLogo;
} elseif (file_exists($filePath . $strAirlineCode . ".jpg")) {
$strAirlineLogo = $strAirlineCode . ".jpg";
$filePath = $this->baseUrl("public/upload/AirlineLogo/") . $strAirlineLogo;
} elseif (file_exists($filePath . $strAirlineCode . ".jpeg")) {
$strAirlineLogo = $strAirlineCode . ".jpeg";
$filePath = $this->baseUrl("public/upload/AirlineLogo/") . $strAirlineLogo;
} else {
$filePath = $this->baseUrl("public/upload/AirlineLogo/noimage.png");
}
$CabinBaggage[] = $flight['Baggage'] . ' | ' . $flight['CabinBaggage'];
// echo "<pre>";
// print_r($flight);
// echo "</pre>";
?>
<table style="width: 100%; margin-top:10px;">
<tbody>
<tr>
<td width="20%" style="padding: 2px; font-size: 12px; padding-left: 20px">
<p>
<strong style="color: #000" class="printSmTxt">
<?= $flight['SegFlightNumber'] ?>
</strong>
</p>
<p>
<span style="font-weight: 400;">
<?= $flight['AirlineName'] ?>
</span>
</p>
</td>
<td width="10%" style="padding: 2px; font-size: 12px">
<p>
<span style="font-weight: 400;">
<?= $flight['FareClass'] ?>
</span>
</p>
</td>
<td width="10%" style="padding: 2px; font-size: 12px">
<p>
<span style="font-weight: 400;">
<?= ($IsRefundable == 1) ? 'Refundable' : 'Non-Refundable' ?>
</span>
</p>
</td>
<td width="20%" style="padding: 2px; font-size: 12px">
<p><strong style="color: #000" class="printSmTxt">
<?= date('D, d M Y H:i', strtotime($flight['originDepTime'])) ?></strong><span style="font-weight: 400;">
</span>
</p>
<p><span style="font-weight: 400;">
<?= $flight['originCityName']; ?>,
<?= $flight['DepTerminal'] ?></span></p>
<p><span style="font-weight: 400;">
<?= $flight['originAirportName']; ?></span></p>
</td>
<td width="20%" style="padding: 2px; font-size: 12px">
<p><strong style="color: #000" class="printSmTxt">
<?= date('D, d M Y H:i', strtotime($flight['destinationArrTime'])) ?>
</strong><span style="font-weight: 400;">
</span>
</p>
<p><span style="font-weight: 400;">
<?= $flight['destinationCityName']; ?>,
<?= $flight['ArrTerminal'] ?></span></p>
<p><span style="font-weight: 400;">
<?= $flight['destinationAirportName']; ?></span></p>
</td>
<td width="10%" style="padding: 2px; font-size: 12px">
<p>
<strong style="color: #000" class="printSmTxt">
<?= $flight['FlightDuration']; ?></strong><br>
<span style="font-weight: 400;">
<?php if (!empty($flight['AirlinePNR'])) {
echo 'Airline Ref: ' . $flight['AirlinePNR'];
} ?>
</span>
</p>
</td>
</tr>
<!-- <tr>
<td colspan="3" width="100%" style="padding: 2px; font-size: 12px; padding-left: 20px">
<strong style="color: #000" class="printSmTxt">CHECKIN:</strong><?= $flight['Baggage'] ?>
</td>
<td colspan="3" width="100%" style="padding: 2px; font-size: 12px; padding-left: 20px">
<strong style="color: #000" class="printSmTxt">CABIN:</strong><?= $flight['CabinBaggage'] ?>
</td>
</tr> -->
</tbody>
</table>
<?php if ($flight['GroundTime'] > 0) { ?>
<table style="width: 100%; margin-bottom: 15px; background: #e6e6e6; margin-top: 15px;" align="center" class="printLyover">
<tbody>
<tr>
<td style="text-align:center; width: 100%; padding: 5px 0;" align="center">
<?= $flight['LAYOVERDuration'] ?> LAYOVER at
<?= $flight['destinationCityName'] ?> Airport
</td>
</tr>
</tbody>
</table>
<?php } ?>
<?php
}
}
?>
<table style="margin-top:12px; width:100%">
<tbody>
<tr>
<td width="100%">
<p style="background: #000; color:#fff; padding:5px; padding-left: 20px">
Passenger
Details</p>
</td>
</tr>
</tbody>
</table>
<table style="color:#000; width:100%; vertical-align: middle">
<tbody>
<tr>
<td style="border-bottom:1px solid #333; background:#BCBEC0;">
<p style="color: #000; padding: 3px">Sr.
</p>
</td>
<td style="border-bottom:1px solid #333; background:#BCBEC0;">
<p style="color: #000; padding: 3px"> Name & FF
</p>
</td>
<td style="border-bottom:1px solid #333; background:#BCBEC0;">
<p style="color: #000; padding: 3px">Sector
</p>
</td>
<td style="border-bottom:1px solid #333; background:#BCBEC0;">
<p style="color: #000; padding: 3px">PNR & Ticket
No. </p>
</td>
<td style="border-bottom:1px solid #333; background:#BCBEC0;">
<p style="color: #000; padding: 3px">
Baggage
<span style="font-size: 8px; line-height:12px; display: block">Check-in
| Cabin </span>
</p>
</td>
<td style="border-bottom:1px solid #333; background:#BCBEC0;">
<p style="color: #000; padding: 3px">Meal, Seat &
Other
Preference </p>
</td>
</tr>
<?php
// echo '<pre>';
// print_r($CustomeSegment);
// echo '</pre>';
$TotalMealFare = 0;
$TotalBaggFare = 0;
$TotalSeatFare = 0;
if (!empty($this->arrtravellerList)) {
$intPaxCT = 1;
foreach ($this->arrtravellerList as $ks1 => $trevllerValue) {
$isWheelChair = !empty($trevllerValue['isWheelChair']) ? $trevllerValue['isWheelChair'] : 0;
$TicketFullJson = json_decode($trevllerValue['TicketFullJson'], 1);
// echo '<pre>';
// print_r($trevllerValue);
// echo '</pre>';
if (isset($TicketFullJson[$ks1]) && !empty($TicketFullJson[$ks1])) {
$TicketFullJson = $TicketFullJson[$ks1];
}
$pnrDetails = $TicketFullJson['pnrDetails'];
$sector = array_keys($pnrDetails);
$pnr = array_values($pnrDetails);
$PaxType = $TicketFullJson['pt'];
$CustomerTitle = $TicketFullJson['ti'];
$CustomerFirstName = trim($TicketFullJson['fN']);
$CustomerLastName = trim($TicketFullJson['lN']);
if (empty($TicketFullJson['ti'])) {
$CustomerTitle = $trevllerValue['Title'];
}
if (empty($TicketFullJson['fN'])) {
$CustomerFirstName = $trevllerValue['FirstName'];
}
if (empty($TicketFullJson['lN'])) {
$CustomerLastName = $trevllerValue['LastName'];
}
if (isset($TicketFullJson['DOB'])) {
$CustomerDOB = $TicketFullJson['DOB'];
}
if (empty($TicketFullJson['pt'])) {
if ($trevllerValue['paxType'] == 1) {
$PaxType = 'ADULT';
} elseif ($trevllerValue['paxType'] == 2) {
$PaxType = 'CHILD';
} else {
$PaxType = 'INFANT';
}
}
$ssrBaggageInfos = [];
$ssrMealInfos = [];
$ssrSeatInfos = [];
if (isset($TicketFullJson['ssrBaggageInfos'])) {
$ssrBaggageInfos = $TicketFullJson['ssrBaggageInfos'];
}
if (isset($TicketFullJson['ssrMealInfos'])) {
$ssrMealInfos = $TicketFullJson['ssrMealInfos'];
}
if (isset($TicketFullJson['ssrSeatInfos'])) {
$ssrSeatInfos = $TicketFullJson['ssrSeatInfos'];
}
// echo '<pre>';
// print_r($TicketFullJson);
// echo '</pre>';
$MealFare = 0;
$BaggFare = 0;
$SeatFare = 0;
if (array_keys($pnrDetails)) {
foreach (array_keys($pnrDetails) as $sec) {
$Baggage = isset($ssrBaggageInfos[$sec]) ? $ssrBaggageInfos[$sec] : [];
$Meal = isset($ssrMealInfos[$sec]) ? $ssrMealInfos[$sec] : [];
$Seat = isset($ssrSeatInfos[$sec]) ? $ssrSeatInfos[$sec] : [];
$BaggFare += isset($Baggage['amount']) ? $Baggage['amount'] * $this->CurrencyRate : 0;
$MealFare += isset($Meal['amount']) ? $Meal['amount'] * $this->CurrencyRate : 0;
$SeatFare += isset($Seat['amount']) ? $Seat['amount'] * $this->CurrencyRate : 0;
}
}
if (isset($TicketFullJson['SegmentInformation']['Item']) && !empty($TicketFullJson['SegmentInformation']['Item'])) {
$SegmentInformation = $TicketFullJson['SegmentInformation']['Item'];
$sector = [];
$pnr = [];
$CabinBaggage = [];
if ($SegmentInformation) {
foreach ($SegmentInformation as $seg) {
$CabinBaggage[] = $seg['BaggagePreference'];
$pnr[] = $seg['AirlinePNR'];
$strTicketPNRLCC[] = $seg['AirlinePNR'];
$originAirportCode = $seg['Origin'];
$destinationAirportCode = $seg['Destination'];
$sector[] = $originAirportCode . '-' . $destinationAirportCode;
}
}
}
$fullName = strtoupper(trim($CustomerFirstName)) . '/' . strtoupper(trim($CustomerLastName));
if (strlen($fullName) > 0) {
$fullName = substr($fullName, 0, 20);
}
$fullName_ = str_pad($fullName, 20, ' ');
if ($trevllerValue['ChangeRequestStatus'] != 1) {
?>
<tr>
<td style="border-bottom:0px solid #333; border-left: 1px solid #333; padding:2px; border-top:1px solid #333;">
<p style="font-size:9px">
<?php echo $intPaxCT; ?>.
</p>
</td>
<td style="border-bottom:0px solid #333; padding:2px; border-top:1px solid #333;">
<p style="font-size:12px">
<?php echo $CustomerTitle; ?> <?php echo $CustomerFirstName; ?>
<?php echo $CustomerLastName; ?> (<?= $PaxType ?>)
<br />
<?= ($CustomerDOB) ? 'DOB - ' . date('d-M-Y', strtotime($CustomerDOB)) : '' ?>
</p>
</td>
<td style="border-bottom:0px solid #333; padding:2px; border-top:1px solid #333;">
<p style="font-size:9px; font-weight: bold" class="printSmTxt">
<?= implode('<br>', $sector) ?> <br>
<?= ($TripType == 2) ? $sectorInb : '' ?>
</p>
</td>
<td style="border-bottom:0px solid #333; padding:2px; border-top:1px solid #333;">
<p style="font-size:9px; font-weight: bold" class="printSmTxt">
<?php echo implode('<br>', $pnr); ?>
</p>
</td>
<td style="border-bottom:0px solid #333; padding:2px; border-top:1px solid #333;">
<?php echo implode('<br>', $CabinBaggage) ?>
<?php
if (array_keys($pnrDetails)) {
foreach (array_keys($pnrDetails) as $sec) {
$Baggage = isset($ssrBaggageInfos[$sec]) ? $ssrBaggageInfos[$sec] : [];
$Meal = isset($ssrMealInfos[$sec]) ? $ssrMealInfos[$sec] : [];
$Seat = isset($ssrSeatInfos[$sec]) ? $ssrSeatInfos[$sec] : [];
?>
<?php if (!empty($Baggage)) { ?>
<p style="font-size:12px"> Baggage - <b class="baggagebold printSmTxt">
<?= !empty($Baggage['desc']) ? $Baggage['desc'] . '<br>' : '' ?></b>
</p>
<?php } ?>
<?php
}
}
?>
</td>
<td style="border-bottom:0px solid #333;padding:2px;border-right:1px solid #333; border-top:1px solid #333;">
<?php if ($isWheelChair) {
echo 'Wheel Chair - <b class="baggagebold printSmTxt">YES</b>';
} ?>
<?php
if (array_keys($pnrDetails)) {
foreach (array_keys($pnrDetails) as $sec) {
$Baggage = isset($ssrBaggageInfos[$sec]) ? $ssrBaggageInfos[$sec] : [];
$Meal = isset($ssrMealInfos[$sec]) ? $ssrMealInfos[$sec] : [];
$Seat = isset($ssrSeatInfos[$sec]) ? $ssrSeatInfos[$sec] : [];
?>
<?php if (!empty($Meal)) { ?>
<p style="font-size:12px"> Meal - <b class="baggagebold printSmTxt"><?= !empty($Meal['desc']) ? $Meal['desc'] . '<br>' : '' ?></b>
</p>
<?php } ?>
<?php if (!empty($Seat)) { ?>
<p style="font-size:12px"> Seat No.- <b class="baggagebold printSmTxt"><?= !empty($Seat['code']) ? $Seat['code'] : '' ?>
</b></p>
<?php } ?>
<?php
}
}
?>
</td>
</tr>
<?php
if ($CustomeSegment && $trevllerValue['paxType'] != 3) {
foreach ($CustomeSegment as $keysss => $SegBar) {
$AirlineCode = $SegBar['AirlineCode'];
$originDepTime = date('Y-m-d', strtotime($SegBar['originDepTime']));
$SegFlightNumber = explode('-', $SegBar['SegFlightNumber']);
$SegFlightNumber_ = $SegFlightNumber[1];
$FlightNumber_ = Zend_Controller_Action_HelperBroker::getStaticHelper("Flight")->FlightNumberPadded($SegFlightNumber_);
$originAirportCode = $SegBar['originAirportCode'];
$destinationAirportCode = $SegBar['destinationAirportCode'];
$SGSECK = $originAirportCode . '-' . $destinationAirportCode;
$SecPnr = isset($pnrDetails[$SGSECK]) ? $pnrDetails[$SGSECK] : '';
// $SeatBarcode = (isset($ssrSeatInfos[$SGSECK]['code']) && !empty($ssrSeatInfos[$SGSECK]['code'])) ? $ssrSeatInfos[$SGSECK]['code'] : '0000';
$DateofFight__ = Zend_Controller_Action_HelperBroker::getStaticHelper("Flight")->GetJulianDate($originDepTime);
$SecPnr = str_pad($SecPnr, 7, ' ');
$AirlineCode = str_pad($AirlineCode, 3, ' ');
//$SeatBarcode = str_pad($SeatBarcode, 4, '0');
$FormatCode = 'M';
$NumberofLegsEncoded = '1';
$PassengerName = ($fullName_);
$ElectronicTicketIndicator = ' ';
$OperatingcarrierPNRCode = $SecPnr;
$FromCityAirportCode = $originAirportCode;
$ToCityAirportCode = $destinationAirportCode;
$OperatingcarrierDesignator = $AirlineCode;
$FlightNumber = $FlightNumber_;
$DateofFight = $DateofFight__;
$CompartmentCode = 'Y';
$SeatNumber = '0000';
$CheckinSequenceNumber = '00000';
$PassengerStatus = '0';
$FieldSizeofvariable = '00';
$FInalBarCode = $FormatCode . '' . $NumberofLegsEncoded . '' . $PassengerName . '' . $ElectronicTicketIndicator . '' . $OperatingcarrierPNRCode . '' . $FromCityAirportCode . '' . $ToCityAirportCode . '' . $OperatingcarrierDesignator . '' . $FlightNumber . '' . $DateofFight . '' . $CompartmentCode . '' . $SeatNumber . '' . $CheckinSequenceNumber . '' . $PassengerStatus . '' . $FieldSizeofvariable;
//$FInalBarCode = str_pad($FInalBarCode, 60, '0');
// echo '<pre>';
// print_r($FInalBarCode);
// echo '</pre>';
// echo '<pre>';
// print_r(strlen($FInalBarCode));
// echo '</pre>';
if (strlen($FInalBarCode) == 60) {
$data = $pdf417->encode($FInalBarCode);
$renderer = new ImageRenderer([
'format' => 'data-url'
]);
$img = $renderer->render($data);
?>
<tr>
<td colspan="6" style="border-bottom:0px solid #333; border-right:1px solid #333; border-left: 1px solid #333; padding:2px;">
<img src="<?= $img->encoded ?>" width="270" height="80" style="margin: 11px;" />
</td>
</tr>
<?php
}
}
}
?>
<?php
$TotalBaggFare += $BaggFare;
$TotalMealFare += $MealFare;
$TotalSeatFare += $SeatFare;
$intPaxCT++;
}
}
}
$totalAddon = ($TotalMealFare + $TotalBaggFare + $TotalSeatFare);
$TotalFare = ($TotalFare + $TotalBaggFare + $TotalMealFare + $TotalSeatFare);
?>
</tbody>
</table>
<?php if ($withprice == 1) { ?>
<table style="margin-top:12px; width:100%" class="PaymentDetails">
<tbody>
<tr>
<td>
<p style="background: #000; color:#fff; padding:5px; padding-left: 20px">
Fare
Details</p>
</td>
</tr>
</tbody>
</table>
<?php
}
?>
<table style="border:1px solid #333; width:100%" class="PaymentDetails">
<tbody>
<?php if (!empty(strip_tags($CancellationPolicy))) { ?>
<tr>
<td style="padding:3px; font-size:12px; color:#000; padding-left: 20px">
Cancellation Policy
</td>
<td style="padding:3px; font-size:12px; color:#000">
<?= $CancellationPolicy ?>
</td>
</tr>
<?php } ?>
<?php if ($withprice == 1) { ?>
<tr>
<td style="padding:3px; font-size:12px; color:#000; padding-left: 20px">
Fare
</td>
<td style="padding:3px; font-size:12px; color:#000">
<?= $CurrencySymbol ?>
<?= number_format($TotalFare, 2) ?>
</td>
</tr>
<tr>
<td style="padding:3px; font-size:12px; color:#000; padding-left: 20px">
Fee & Surcharges
</td>
<td style="padding:3px; font-size:12px; color:#000">
<?= $CurrencySymbol ?>
<?= number_format($TotalServiceFee, 2) ?>
</td>
</tr>
<?php if ($LeadSource == 'Website') { ?>
<tr>
<td style="padding:3px; font-size:12px; color:#000; padding-left: 20px">
SGST
</td>
<td style="padding:3px; font-size:12px; color:#000">
<?= $CurrencySymbol ?><?= number_format(($TotalGST / 2), 2) ?>
</td>
</tr>
<tr>
<td style="padding:3px; font-size:12px; color:#000; padding-left: 20px">
CGST
</td>
<td style="padding:3px; font-size:12px; color:#000">
<?= $CurrencySymbol ?><?= number_format(($TotalGST / 2), 2) ?>
</td>
</tr>
<?php } else { ?>
<tr>
<td style="padding:3px; font-size:12px; color:#000; padding-left: 20px">
IGST
</td>
<td style="padding:3px; font-size:12px; color:#000">
<?= $CurrencySymbol ?><?= number_format($TotalGST, 2) ?>
</td>
</tr>
<?php } ?>
<tr>
<td style="padding:3px; font-size:12px; color:#000; padding-left: 20px">
Meal/Seat/Baggage (Included)
</td>
<td style="padding:3px; font-size:12px; color:#000">
<?= $CurrencySymbol ?>
<?= number_format(($TotalMealFare + $TotalBaggFare + $TotalSeatFare), 2) ?>
</td>
</tr>
<tr>
<td style="padding:3px; font-size:12px; color:#000; padding-left: 20px">
Discount
</td>
<td style="padding:3px; font-size:12px; color:#000">
<?= $CurrencySymbol ?>
<?= number_format(($TotalDiscountValue), 2) ?>
</td>
</tr>
<?php if ($TotalTcs > 0) { ?>
<tr>
<td style="padding:3px; font-size:12px; color:#000; padding-left: 20px">
Refund Upgrade
</td>
<td style="padding:3px; font-size:12px; color:#000">
<?= $CurrencySymbol ?>
<?= number_format(($TotalTcs), 2) ?>
</td>
</tr>
<?php
}
?>
<tr>
<td style="padding:3px; font-size:12px; color:#000; padding-left: 20px">
Total Price
</td>
<td style="padding:3px; font-weight:bold">
<?= $CurrencySymbol ?>
<?= number_format(ceil($TotalFare + $TotalServiceFee + $TotalGST + $TotalTcs - $TotalDiscountValue), 2) ?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<table style="margin-top:12px; width:100%">
<tbody>
<tr>
<td>
<p style="background: #000; color:#fff; padding:5px; padding-left: 20px">
Important
Information</p>
</td>
</tr>
</tbody>
</table>
<table style="width:100%; margin-bottom: 40px;padding-top: 15px;" class="print-info">
<?php if ($TotalTcs > 0) { ?>
<p style="padding: 0 8px; margin:0; font-size: 14px; color:#000;">
<span style=" font-size: 12px; font-weight: bold;display:table;padding:0 0 0 3px;">
To make changes to your booking or where it is cancelled or changed by
the provider, please contact our Customer Service Team at <a href="mailto:<?php echo trim($PrimaryEmail); ?>"><?php echo trim($PrimaryEmail); ?></a>.
<br>This is a refundable booking. If you are unable to attend your
booking due to unforeseen circumstances and can provide evidence as
listed in the <a target="_blank" href="https://www.refundable.me/extended/en/" style="text-decoration:underline;color:red;">Terms & Conditions</a>
here, you may be entitled to a full refund. Your booking reference
number is <?= base64_decode($this->intTPSysId) ?>.<br><a target="_blank" href="https://form.refundable.me/forms/refund?memberId=268&bookingReference=<?= base64_decode($this->intTPSysId) ?>" style="text-decoration:underline;color:red;">Apply for a refund
using the form here</a>.
</span>
</p>
<?php
}
?>
<p style="padding: 0 8px; margin:0; font-size: 14px; color:#000;">1 -
You must web check-in on the airline website and obtain a boarding
pass.
</p>
<p style="padding: 0 8px; margin:0; font-size: 14px; color:#000;">2 -
You must download & register on the Aarogya Setu App and carry a
valid ID.
</p>
<p style="padding: 0 8px; margin:0; font-size: 14px; color:#000;">3 -
It is mandatory to wear a mask and carry other protective gear.
</p>
<p style="padding: 0 8px; margin:0; font-size: 14px; color:#000;">4 -
Reach the terminal at least 2 hours prior to the departure for
domestic flight and 4 hours prior to the departure of international
flight.
</p>
<p style="padding: 0 8px; margin:0; font-size: 14px; color:#000;"> 5 -
For departure terminal please check with the airline first.
</p>
<p style="padding: 0 8px; margin:0; font-size: 14px; color:#000;"> 6 -
Date & Time is calculated based on the local time of the
city/destination.
</p>
<p style="padding: 0 8px; margin:0; font-size: 14px; color:#000;"> 7 -
Use the Airline PNR for all Correspondence directly with the Airline
</p>
<p style="padding: 0 8px; margin:0; font-size: 14px; color:#000;"> 8 -
For rescheduling/cancellation within 4 hours of the departure time
contact the airline directly
</p>
<p style="padding: 0 8px; margin:0; font-size: 14px; color:#000;"> 9 -
Your ability to travel is at the sole discretion of the airport
authorities and we shall not be held responsible.
</p>
</table>
<table style="width:100%; border-top: 1px solid black;">
<tbody>
<tr>
<td>
<img style="max-width:100%;" src="<?php echo $this->baseUrl('public/css/images/goodnItems.png'); ?>" alt="Goods and Items">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<script src="/public/js/html2pdf.bundle.min.js"></script>
<script>
const pairs = document.cookie.split(';');
const cookies = {};
pairs.forEach(function(value) {
const pair = value.split('=');
cookies[(pair[0] + '').trim()] = unescape(pair.slice(1).join('='));
});
if (cookies['ccode'] === 'SA') {
var element = document.getElementsByTagName('body')[0];
element.classList.add("body-arabic--wrapper");
}
// else {
// var element = document.getElementsByTagName('body')[0];
// element.classList.add("");
// }
</script>
<script type="text/javascript">
window.onload = function() {
// Choose the element that our invoice is rendered in.
const element = document.getElementById('invoice');
// Choose the element and save the PDF for our user.
// html2pdf().set({
// html2canvas: {
// scale: 4
// }
// }).from(element).save('<?= $strXRefBookingId ?>.pdf');
html2pdf(document.getElementById('invoice'), {
margin: 10,
filename: "<?= $strXRefBookingId ?>.pdf",
image: {
type: 'jpeg',
quality: 1
},
html2canvas: {
scale: 4,
letterRendering: true
},
jsPDF: {
unit: 'mm',
format: 'letter',
orientation: 'portrait'
},
pageBreak: {
mode: 'css',
before: '#nextpage1'
},
pdfCallback: pdfCallback
})
function pdfCallback(pdfObject) {
var number_of_pages = pdfObject.internal.getNumberOfPages()
var pdf_pages = pdfObject.internal.pages
var myFooter = "Footer info"
for (var i = 1; i < pdf_pages.length; i++) {
// We are telling our pdfObject that we are now working on this page
pdfObject.setPage(i)
//pdfObject.text("my header text", 10, 10)
// The 10,200 value is only for A4 landscape. You need to define your own for other page sizes
pdfObject.text('Page ' + i + ' of ' + totalPages, (pdfObject.internal.pageSize.getWidth() / 2.25), (
pdfObject.internal.pageSize.getHeight() - 8))
}
}
setTimeout(function() {
//window.close();
}, 2000);
}
</script>
</body>
</html>