403Webshell
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/b2b.hellogtx.com/application/views/scripts/flight/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/b2b.hellogtx.com/application/views/scripts/flight/e-ticket-api-new.phtml
<?php

$baseUrl = $this->baseUrl;
$B2BType = $this->B2BType;
$type = $this->type;
$bookingDataByAPI = $this->bookingDataByAPI;
$arrtravellerList = $this->arrtravellerList;
$getSupportContact = $this->getSupportContact;
$CustomerDetails = $this->CustomerDetails;
$withprice = $this->withprice;
$MailType = isset($this->MailType) ? $this->MailType : 0;
$MasterAgencyLogo = $this->MasterAgencyLogo;
$CurrencySymbol = $bookingDataByAPI[0]['CurrencySymbol'];
$LeadSource = $bookingDataByAPI[0]['LeadSource'];
$AgencySysId = $bookingDataByAPI[0]['AgencySysId'];
$IsBookingStatus = $bookingDataByAPI[0]['IsBookingStatus'];
$companyLogo = $bookingDataByAPI[0]['Logo'];
$XRefBookingId = $bookingDataByAPI[0]['XRefBookingId'];
$ICSourceSysId = $bookingDataByAPI[0]['ICSourceSysId'];
$isDocIdAllowedMandatory = false;
$agentName = $bookingDataByAPI[0]['agentName'];
$ExchangeCurrencyRate = (($bookingDataByAPI[0]['ExchangeCurrencyRate']) > 0) ? $bookingDataByAPI[0]['ExchangeCurrencyRate'] : 1;

$interNationalSearch = (isset($bookingDataByAPI[0]['IsInternational'])) ? $bookingDataByAPI[0]['IsInternational'] : 0;
$route = (isset($bookingDataByAPI[0]['JourneyType'])) ? $bookingDataByAPI[0]['JourneyType'] : 0;

$IsRefundable = isset($bookingDataByAPI[0]['IsRefundable']) ? $bookingDataByAPI[0]['IsRefundable'] : 0;

$CompanyName = $bookingDataByAPI[0]['CompanyName'];
$strCompanyAddress = $bookingDataByAPI[0]['CompanyAddress'];
$Pincode = $bookingDataByAPI[0]['Pincode'];
$strCityTitle = $bookingDataByAPI[0]['CityTitle'];
$strCountry = $bookingDataByAPI[0]['Country'];
$PrimaryMobileNo = $bookingDataByAPI[0]['PrimaryMobileNo'];
$countrycode = $bookingDataByAPI[0]['countrycode'];
$PrimaryContactNo = (isset($bookingDataByAPI[0]['agentContactNo1']) && !empty(trim($bookingDataByAPI[0]['agentContactNo1']))) ? $bookingDataByAPI[0]['agentContactNo1'] : $bookingDataByAPI[0]['PrimaryContactNo'];
$PrimaryContactNo = $countrycode . $PrimaryContactNo;
$PrimaryEmail = (isset($bookingDataByAPI[0]['AgentEmailId']) && !empty(trim($bookingDataByAPI[0]['AgentEmailId']))) ? $bookingDataByAPI[0]['AgentEmailId'] : $bookingDataByAPI[0]['PrimaryEmail'];


if (isset($getSupportContact['EmailId']) && !empty($getSupportContact['EmailId']) && $B2BType == 2) {
    $PrimaryEmail = trim($getSupportContact['EmailId']);
}
if (isset($getSupportContact['EmailId']) && !empty($getSupportContact['EmailId']) && $B2BType == 2) {
    $PrimaryContactNo = trim($getSupportContact['countrycode']) . '-' . trim($getSupportContact['ContactNo1']);
}
$arrBookingDate = $bookingDataByAPI[0]['bookingDate'];
$flexiPayment = $bookingDataByAPI[0]['flexiPayment'];
//$strBookingDate = '';

$TotalFare = 0;
$TotalServiceFee = 0;
$TotalGST = 0;
$TotalDiscountValue = 0;
$YourProfit = 0;
$YourSalesPrice = 0;
$TotalYourCost = 0;
$SegmentsArr = [];
if ($bookingDataByAPI) {
    foreach ($bookingDataByAPI as $value) {

       $AddTotalCost = isset($value['AddTotalCost'])?$value['AddTotalCost']:0;
        if ($ICSourceSysId == 8 || $ICSourceSysId == 21 || $ICSourceSysId == 22 || $ICSourceSysId == 23 || $ICSourceSysId == 24 || $ICSourceSysId == 25 || $ICSourceSysId == 9) {
            $APIBookingRes = json_decode($value['APIBookingRes'], 1);
            $isDocIdAllowedMandatory = isset($APIBookingRes['value']['isDocIdAllowedMandatory']) ? $APIBookingRes['value']['isDocIdAllowedMandatory'] : false;

            if ($ICSourceSysId == 7 && $route == 2 && $interNationalSearch == 1) {
                $values = $APIBookingRes['value']['InternationalData'];
                $values['FairRules'] = $values['Fare'];
                unset($values['Fare']);
            } else {
                $values = $APIBookingRes['value'];
            }
            $AgentMarkUp = isset($value['AgentMarkup']) ? ($value['AgentMarkup'] / count($values['FairRules']['FareBreakdown'])) : 0;
            $GSTOnAgentMarkUp = isset($value['ExtraMarkupOnGST']) ? ($value['ExtraMarkupOnGST'] / count($values['FairRules']['FareBreakdown'])) : 0;
            if ($values['FairRules']['FareBreakdown']) {
                foreach ($values['FairRules']['FareBreakdown'] as $value) {
                    $PassengerCount = $value['PassengerCount'];
                    //$TotalSSr = ($TotalSSr / $PassengerCount);
                    $TDS = $value['TDS']; //Management Fee
                    $MF = $value['MF']; //Management Fee
                    $YQ = $value['YQ']; //Fuel Surcharge
                    $AGST = $value['AGST']; //Airline GST Component
                    $MFT = $value['MFT']; //Management Fee Tax
                    $OT = isset($value['OT']) ? $value['OT'] : $value['TaxBR']['OT']; //Other Charges
                    $YR = $value['YR'];
                    $PBaseFare = $value['BaseFare'];
                    $intGTXMarkUp = $value['intGTXMarkUp'];
                    $GTXMarkUpGST = $value['GTXMarkUpGST'];
                    $intTotalGST = $value['intTotalGST'];
                    $FixedMarkUp = $value['FixedMarkUp'];
                    $apiMarkup = $value['apiMarkup'];
                    if($flexiPayment){
                        $ProcessingAmount = ($AddTotalCost / count($values['FairRules']['FareBreakdown']));
                        $GSTOnProcessing = 0;
                    }else{
                        $ProcessingAmount = 0;
                        $GSTOnProcessing = 0;
                    }
                    if ($ICSourceSysId == 7 && $route == 2 && $interNationalSearch == 1) {
                        //$AgentMarkUp = $value['AgentMarkUp'];
                    }
                    // $AgentMarkUp = $value['AgentMarkUp'];
                    //$GSTOnAgentMarkUp = $value['GSTOnAgentMarkUp'];
                    $IntCommission = isset($value['Agencycommission']) ? $value['Agencycommission']  : $value['CommissionEarned'];
                    $OtherCharges = $value['OtherCharges'];
                    $CommEarned = $value['CommEarned'];
                    if ($MailType == 1) {
                        $ExtraMarkup =  0;
                        $ExtraMarkupOnGST = 0;
                        $AgentMarkUp = 0;
                    } else {
                        $ExtraMarkup = isset($value['ExtraMarkup']) ? $value['ExtraMarkup'] : 0;
                        $ExtraMarkupOnGST = isset($value['ExtraMarkupOnGST']) ? $value['ExtraMarkupOnGST'] : 0;
                    }

                    if ($ICSourceSysId == 7 || $ICSourceSysId == 8 || $ICSourceSysId == 21 || $ICSourceSysId == 22 || $ICSourceSysId == 23 || $ICSourceSysId == 24 || $ICSourceSysId == 25) {
                        $otherCharge = (($YQ + $AGST + $MFT + $MF + $OT + $YR + $intGTXMarkUp + $GTXMarkUpGST));
                        $TaxesFees = (($otherCharge + $intTotalGST + $FixedMarkUp + $apiMarkup + $AgentMarkUp + $GSTOnAgentMarkUp + $ProcessingAmount + $GSTOnProcessing) - $IntCommission);
                    } else {
                        //$YQ +
                        $otherCharge = (($AGST + $MFT + $MF + $OT + $YR + $intGTXMarkUp + $GTXMarkUpGST + $TDS + $OtherCharges));
                        $TaxesFees = (($otherCharge + $intTotalGST + $FixedMarkUp + $apiMarkup + $AgentMarkUp + $GSTOnAgentMarkUp + $ExtraMarkup + $ExtraMarkupOnGST + $CommEarned) - $IntCommission);
                    }

                    $TotalFare += ($PBaseFare);
                    $TotalServiceFee += ($TaxesFees);
                    $YourMarkup = (($intTotalGST + $FixedMarkUp + $apiMarkup));
                    $YourCost = (($PBaseFare + $otherCharge) - $IntCommission);
                    $YourProfit += ($YourMarkup);
                    $TotalYourCost += ($YourCost);
                    $YourSalesPrice += ($YourCost + $YourMarkup);
                    //   echo "<pre>";
                    //   print_r($ProcessingAmount);
                    //   echo "</pre>";
                    //   echo "<pre>";
                    //   print_r($GSTOnProcessing);
                    //   echo "</pre>";
                }
            }
        } else {
            $AgentMarkup = isset($value['AgentMarkup']) ? ($value['AgentMarkup'] / count($value['FareBreakdown'])) : 0;
            if ($value['FareBreakdown']) {
                foreach ($value['FareBreakdown'] as $fare) {

                    $GSTOnMarkUp = $fare['GSTOnMarkUp'];
                    $TotalFare += $fare['BaseFare'];
                    if ($MailType == 1) {
                        $TotalServiceFee += ($fare['FixedMarkUp'] + $fare['CommissionEarned'] + $fare['TDSEarn'] + $fare['Tax']);
                    } else {
                        $TotalServiceFee += ($fare['FixedMarkUp'] + $fare['CommissionEarned'] + $fare['TDSEarn'] + $fare['Tax'] + $AgentMarkup);
                    }

                    $TotalGST += ($fare['GSTOnMarkUp']);
                    $TotalDiscountValue += ($fare['Discount']);
                }
            }

            $Cost = $value['Cost'];
            $TotalCost = $value['TotalCost'];
            $AgencyMarkUp = $value['AgencyMarkUp'];
            $AgentServiceTaxAmount = $value['AgentServiceTaxAmount'];
            $AgencyCommission = $value['AgencyCommission'];
            $YourMarkup = (($AgencyMarkUp + $AgentServiceTaxAmount + $AgencyCommission));
            $YourCost = (($Cost));
            $YourProfit += ($YourMarkup);
            $TotalYourCost += ($YourCost);
            $YourSalesPrice += ($YourCost + $YourMarkup);
        }
    }
}
// echo json_encode($bookingDataByAPI);die;
if (!empty($getAgencyData['UserPicPath'])) {
    $UserPicPath = $bookingDataByAPI[0]['UserPicPath'];
} else {
    $UserPicPath = $bookingDataByAPI[0]['Logo'];
}
$gtxagencysysid = $this->MasterAgencySysId;
$IsCancellationProtection = 0;
$CancellationProtectionPrice = 0;
require_once('Barcode417/vendor/autoload.php');
// echo "bookingDataByAPI<pre>";
// print_r(json_encode($arrtravellerList));
// echo "</pre>";

// die('ss');
?>
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="<?php echo $this->baseUrl('public/assets/images/ico/fab.ico'); ?>">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>
        E-Ticket
    </title>
    <link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">

    <script type="text/javascript">
        window.onload = function() {
            let tempTitle = document.title;
            document.title = "E-Ticket - <?= $XRefBookingId ?>";
            //window.print();
        };
    </script>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
        @media print {
           body {
                print-color-adjust: exact;
              -webkit-print-color-adjust: exact;
           }
        }
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: "Poppins", sans-serif;
            font-size: 13px;
        }
        body p {
            line-height: 15px;
        }
        img {
            max-width: 100%;
        }
        .mb-20 {
            margin-bottom: 20px;
        }
        .responsive-scroller {
            overflow-x: auto;
        }
        .mailer-wrapper {
            max-width: 700px;
            margin: 0 auto;
            background-color: #fff;
        }
        .mailer-header {
            padding: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            border-bottom: 1px solid #e5e5e5;
        }
        .header-right {
            text-align: right;
        }
        .header-right p {
            margin-bottom: 4px;
            font-size: 11px;
            line-height: 13px;
        }
        .mailer-info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
        }
        .mailer-info p {
            font-size: 11px;
            margin-bottom: 4px;
        }
        .mailer-info-left {
            width: 50%;
            padding: 10px;
            border-right: 1px solid #e5e5e5;
        }
        .company-heading {
            font-size: 16px;
            line-height: 20px;
            margin-bottom: 4px;
        }
        .mailer-info-right {
            width: 50%;
            padding: 10px;
            text-align: right;
        }
        .mailer-info .airline-pnr {
            font-size: 15px;
        }
        .flight-details {
            border: 1px solid #cbe5f6;
            border-top: none;
            min-width: 540px;
        }
        .flight-details-header {
            background-color: #1076bb;
            color: #fff;
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
        }
        .flight-details-header .onward-flight {
            padding: 5px 10px
        }
        .flight-details-header .verify-flight {
            padding: 5px 10px;
            font-size: 11px;
            font-style: italic;
        }
        .flight-details-row {
            display: flex;
        }
        .flight-details-caption {
            padding: 5px 10px;
            background-color: #cbe5f6;
        }
        .flight-details-caption:first-child {
            width: 18%;
        }
        .flight-details-caption:nth-child(2) {
            width: 32%;
        }
        .flight-details-caption:nth-child(3) {
            width: 50%;
        }
        .flight-details-col {
            padding: 5px 10px;
            align-self: center;
        }
        .flight-details-col figure {
            line-height: 0;
            margin-bottom: 4px;
        }
        .flight-details-col p {
            font-size: 11px;
            line-height: 13px;
            margin-bottom: 4px;
        }
        .flight-details-col:first-child {
            width: 18%;
        }
        .flight-details-col:nth-child(2) {
            width: 32%;
        }
        .flight-details-col:nth-child(3) {
            width: 35%;
        }
        .flight-details-col:nth-child(4) {
            width: 15%;
        }
        .passenger-details {
            border: 1px solid #ffd8da;
            border-top: none;
            min-width: 540px;
        }
        .passenger-details-header {
            background-color: #f16367;
            color: #fff;
            padding: 5px 10px;
        }
        .passenger-details-row {
            display: flex;
            border-bottom: 1px solid #ffd8da;
        }
        .passenger-details-row:last-child {
            border-bottom: none;
        }
        .passenger-details-caption {
            padding: 5px 10px;
            background-color: #ffd8da;
        }
        .passenger-details-caption:first-child {
            width: 5%;
        }
        .passenger-details-caption:nth-child(2) {
            width: 35%;
        }
        .passenger-details-caption:nth-child(3) {
            width: 20%;
        }
        .passenger-details-caption:nth-child(4) {
            width: 20%;
        }
        .passenger-details-caption:nth-child(5) {
            width: 20%;
        }
        .passenger-details-col {
            padding: 5px 10px;
            align-self: center;
        }
        .passenger-details-col p {
            font-size: 11px;
            line-height: 13px;
            margin-bottom: 4px;
        }
        .passenger-details-col:first-child {
            width: 5%;
        }
        .passenger-details-col:nth-child(2) {
            width: 35%;
        }
        .passenger-details-col:nth-child(3) {
            width: 40%;
        }
        .passenger-details-col:nth-child(4) {
            width: 20%;
        }
        .passenger-barcode {
            display: flex;
            align-items: center;
            margin: 4px 0;
        }
        .barcode-caption {
            margin: 0;
            margin-right: 10px;
            min-width: 66px;
        }
        .barcode-image {
            line-height: 0;
        }
        .fare-details {
            margin-bottom: 20px;
            border: 1px solid lightgrey;
            border-top: 0;
        }
        .fare-details-header {
            background-color: #d3d3d3;
            padding: 5px 10px;
        }
        .fare-details-row {
            display: flex;
            flex-wrap: wrap;
            font-size: 11px;
            line-height: 13px;
        }
        .fare-details-property {
            padding: 5px 10px;
            width: 50%;
        }
        .fare-details-value {
            padding: 5px 10px;
            width: 50%;
        }
        .fare-details-price-total {
            border-top: 1px solid lightgrey;
        }
        .important-note {
            border: 1px solid lightgrey;
            border-top: 0;
        }
        .important-note-header {
            background-color: #d3d3d3;
            padding: 5px 10px;
        }
        .important-note-list {
            padding: 5px 0;
        }
        .important-note-list li {
            font-size: 11px;
            line-height: 13px;
            padding: 5px 10px;
            list-style-type: none;
        }
        
        .layover {
            background: #cbe5f6;
            text-align: center;
            padding: 5px 10px;
            font-size: 11px;
            width: 48%;
            border-radius: 5px;
            margin: 0 auto;
        }
        @media(max-width: 479px) {
            .mailer-info-left {
                width: 70%;
            }
            .mailer-info-right {
                width: 30%;
            }
        }
        @media(max-width: 399px) {
            .mailer-header {
                flex-direction: column;
            }
            .header-right {
                text-align: center;
            }
        }
    </style>
</head>
<body>
<?php

    use BigFish\PDF417\PDF417;
    use BigFish\PDF417\Renderers\ImageRenderer;

    $pdf417 = new PDF417();
?>
<div class="mailer-wrapper">
    <div class="mailer-header">
        <div class="header-left">
            <img src="img/logo.png" alt="" />
        </div>
        <div class="header-right">
            </div>
    </div>
    <div class="mailer-body">
        <div class="mailer-info">
            <div class="mailer-info-left">
                <h1 class="company-heading"> <?php echo $CompanyName; ?></h1>
                <p>Address:  <?php echo $strCompanyAddress; ?>
                    <?php echo $strCityTitle; ?>
                    <?php echo $strCountry; ?>,
                    <?php echo $Pincode; ?></p>
                <p>Email:  <?= $PrimaryEmail ?></p>
                <p>Mobile: <?= $PrimaryContactNo ?></p>
            </div>
            <div class="mailer-info-right">
                <p>Booking ID: <strong><?= $XRefBookingId ?></strong></p>
                <p>Booked on: <strong><?= date('d-M-Y H:i:s', strtotime($arrBookingDate)) ?></strong></p>
                <p>Booking Status: <strong style="color: green"><?= ($IsBookingStatus == 1) ? 'CONFIRMED' : 'PENDING' ?></strong></p>
       
                </div>
        </div>
        <div class="responsive-scroller mb-20">
            <div class="flight-details">
                <div class="flight-details-header">
                    <div class="onward-flight">
                        Onward Flight Details
                    </div>
                    <div class="verify-flight">
                        *Please verify flight times with the airlines prior to departure
                    </div>
                </div>
                <?php
                if ($bookingDataByAPI) {
                    $Sectors = [];
                    foreach ($bookingDataByAPI as $value) {
                        $response = isset($APIBookingRes['response']['Response']['Response']['FlightItinerary']) ? $APIBookingRes['response']['Response']['Response']['FlightItinerary'] : [];
                        $ResponsePNR = isset($APIBookingRes['response']['Response']['Response']['FlightItinerary']['PNR']) ? $APIBookingRes['response']['Response']['Response']['FlightItinerary']['PNR'] : '';
                        if ($response['Segments']) {
                            foreach ($response['Segments'] as $TBseg) {
                                $AirlinePNR = $TBseg['AirlinePNR'];
                                $Origin = $TBseg['Origin']['Airport']['AirportCode'];
                                $Destination = $TBseg['Destination']['Airport']['AirportCode'];
                                $secKey = $Origin . '-' . $Destination;
                                $TBOPnr[$secKey] = ($AirlinePNR) ? $AirlinePNR : $ResponsePNR;
                            }
                        }
                        ?>
                    <div class="flight-details-table">
                        <div class="flight-details-row">
                            <div class="flight-details-caption">Flight</div>
                            <div class="flight-details-caption">Departs</div>
                            <div class="flight-details-caption">Arrives</div>
                        </div>
                    <?php

                        if ($value['Segments']) {
                            foreach ($value['Segments'] as $key => $flight) {
                                $strAirlineCode = trim($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";
                                }
                                $originAirportCode = isset($flight['OriginAirportCode']) ? $flight['OriginAirportCode'] : $flight['originAirportCode'];
                                $DestAirportCode = isset($flight['DestAirportCode']) ? $flight['DestAirportCode'] : $flight['destinationAirportCode'];
                                $secKey = $originAirportCode . '-' . $DestAirportCode;
                                $sectorarray[] = $Sectors[] =$secKey;
                                $SegmentsArr[$secKey] = $flight;
                                $sectorBagg[$secKey] = ['Baggage' => $flight['Baggage'], 'CabinBaggage' => $flight['CabinBaggage']];
                                $originDepTime_ = (array) $flight['originDepTime'];
                                $originDepTime = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->getDateFormatFromDbDates(str_replace('T', ' ', $flight['originDepTime']));
                                $destinationArrTime_ = (array) $flight['destinationArrTime'];
                                $destinationArrTime = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->getDateFormatFromDbDates(str_replace('T', ' ', $flight['destinationArrTime']));
                                $Duration = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->convertMinutesToHoursFormat($flight['Duration']);
                                if ($ICSourceSysId == 8 || $ICSourceSysId == 21 || $ICSourceSysId == 22 || $ICSourceSysId == 23 || $ICSourceSysId == 24 || $ICSourceSysId == 25) {
                                    $Duration = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->CalculateTotalTime($flight['originDepTime'], $flight['destinationArrTime']);
                                }
                                $CabinBaggageAR[] = $flight['Baggage'] . ' | ' . $flight['CabinBaggage'];
                             ?>
                             <?php if ($flight['GroundTime'] > 0 && $ICSourceSysId == 3) { ?>
                            <div class="layover">
                                <?= $flight['LAYOVERDuration'] ?> LAYOVER at <?= $flight['originCityName'] ?> Airport
                            </div>
                            <?php } ?>
                            <div class="flight-details-row">
                                <div class="flight-details-col">
                                    <figure><img src="<?= $filePath ?>" alt="" /></figure>
                                    <p><strong><?= $flight['AirlineName'] ?></strong></p>
                                    <p><?= ($flight['FlightNumber']) ? $flight['FlightNumber'] : $flight['SegFlightNumber']; ?></p>
                                    <p><?= ($flight['cabinClass']) ? $flight['cabinClass'] : $value['FairRules']['FareClass'] ?></p>
                                </div>
                                <div class="flight-details-col">
                                    <p><strong><?= $flight['originCityName']; ?> (<?= $flight['OriginAirportCode'] ?>)</strong></p>
                                    <p><?= $flight['originAirportName']; ?></p>
                                    <p><strong><?= $originDepTime['strDate'] ?> <?= $originDepTime['strTime'] ?></strong></p>
                                </div>
                                <div class="flight-details-col">
                                    <p><strong><?= $flight['destinationCityName']; ?> (<?= $flight['DestAirportCode'] ?>)</strong></p>
                                    <p><?= $flight['destinationAirportName']; ?></p>
                                    <p><strong><?= $destinationArrTime['strDate'] ?> <?= $destinationArrTime['strTime'] ?> </strong></p>
                                </div>
                                <div class="flight-details-col">
                                    <p><strong><?= $value['StopCount'] ?></strong></p>
                                    <p><?= $Duration ?></p>
                                    <p><?= ($IsRefundable == 1) ? 'Refundable' : 'Non-Refundable' ?></p>
                                </div>
                            
                            </div>
                            <?php if ($flight['GroundTime'] > 0 && $ICSourceSysId == 7) { ?>
                            <div class="layover">
                                <?= $flight['LAYOVERDuration'] ?> LAYOVER at <?= $flight['originCityName'] ?> Airport
                            </div>
                        <?php } } } } } ?>
                    
                </div>
            </div>
         </div>
         <div class="responsive-scroller mb-20">
            <div class="passenger-details">
                <div class="passenger-details-header">
                    Passenger Details
                </div>
                <div class="passenger-details-row">
                    <div class="passenger-details-caption">Sl.</div>
                    <div class="passenger-details-caption">Passenger(s) Name</div>
                    <div class="passenger-details-caption">Sector</div>
                    <div class="passenger-details-caption">Bar Code</div>
                    <div class="passenger-details-caption">PNR or Ticket No.</div>
                </div>
                <?php

                $TotalBaggFare = 0;
                $TotalMealFare = 0;
                $TotalSeatFare = 0;
                $ARR_SALUTION = unserialize(ARR_SALUTION);
                $ARR_SALUTION_CHILD = unserialize(ARR_SALUTION_CHILD);
                if ($arrtravellerList) {
                    foreach ($arrtravellerList as $ks1 => $trevllerValue) {
                        $CustomerTitle = $trevllerValue['Title'];
                        $isWheelChair = isset($trevllerValue['isWheelChair']) ? $trevllerValue['isWheelChair'] : 0;
                        

                        if ($trevllerValue['paxType'] == 1) {
                            $PaxType = 'Adult';
                            $CustomerTitle = $ARR_SALUTION[$CustomerTitle];
                        } elseif ($trevllerValue['paxType'] == 2) {
                            $PaxType = 'Child';
                            $CustomerTitle = $ARR_SALUTION_CHILD[$CustomerTitle];
                        } else {
                            $PaxType = 'Infant';
                            $CustomerTitle = $ARR_SALUTION_CHILD[$CustomerTitle];
                        }

                        $SelectedMeal = !empty($trevllerValue['SelectedMeal']) ? json_decode($trevllerValue['SelectedMeal'], 1) : [];
                        $SelectedSeat = !empty($trevllerValue['SelectedSeat']) ? json_decode($trevllerValue['SelectedSeat'], 1) : [];
                        $SelectedBag = !empty($trevllerValue['SelectedBag']) ? json_decode($trevllerValue['SelectedBag'], 1) : [];
                        // $Sectors = explode('@@', $trevllerValue['Sectors']);
                        $TicketId = explode('-', $trevllerValue['TicketId']);
                        $TicketNumber = explode('-', $trevllerValue['TicketNumber']);
                        $CustomerFirstName = $trevllerValue['FirstName'];
                        $CustomerLastName = $trevllerValue['LastName'];
                        $CustomerDOB = (isset($trevllerValue['DOB']) && $trevllerValue['DOB'] != '1900-01-01 00:00:00.000000') ? $trevllerValue['DOB'] : '';
                        $TotalBaggFare += $trevllerValue['BagPrice'];
                        $TotalMealFare += $trevllerValue['MealPrice'];
                        $TotalSeatFare += $trevllerValue['SeatPrice'];
                        $CabinBaggage = $trevllerValue['CabinBaggage'];
                        $CheckinBaggage = !empty($trevllerValue['CheckinBaggage']) ? $trevllerValue['CheckinBaggage'] : 'NA';
                        $fullName_ = strtoupper(trim($trevllerValue['LastName'])) . '/' . strtoupper(trim($trevllerValue['FirstName']));
                        if (strlen($fullName_) > 0) {
                            $fullName_ = substr($fullName, 0, 20);
                        }
                        $fullName_ = str_pad($fullName_, 20, ' ');
                        $CustomerTitle = $trevllerValue['Title'];
                        if ($ICSourceSysId == 7 ||  $ICSourceSysId == 8 || $ICSourceSysId == 21 || $ICSourceSysId == 22 || $ICSourceSysId == 23 || $ICSourceSysId == 24 || $ICSourceSysId == 25 || $ICSourceSysId == 9) {
                            $TicketFullJson = !empty($trevllerValue['TicketFullJson']) ? json_decode($trevllerValue['TicketFullJson'], 1) : '';
                            $traveller = isset($TicketFullJson[$ks1]) ? $TicketFullJson[$ks1] : $TicketFullJson;
                            $ValidIdNo = isset($traveller['di']) ? $traveller['di'] : 0;
                            $pnrDetails = $traveller['pnrDetails'];
                            if ($ICSourceSysId == 3) {
                                $TicketId = [$traveller['Ticket']['TicketNumber']];
                                $TicketNumber = [$traveller['Ticket']['TicketId']];
                            }

                            $ssrBaggageInfos = [];
                            $ssrMealInfos = [];
                            $ssrSeatInfos = [];
                            if (!empty($traveller) && isset($traveller['ssrBaggageInfos'])) {
                                $ssrBaggageInfos = $traveller['ssrBaggageInfos'];
                            } else {
                                $ssrBaggageInfos = $traveller['Baggage'];
                            }
                            if (!empty($traveller) && isset($traveller['ssrMealInfos'])) {
                                $ssrMealInfos = $traveller['ssrMealInfos'];
                            } else {
                                $ssrMealInfos = $traveller['MealDynamic'];
                            }
                            if (!empty($traveller) && isset($traveller['ssrSeatInfos'])) {
                                $ssrSeatInfos = $traveller['ssrSeatInfos'];
                            } else {
                                $ssrSeatInfos = $traveller['SeatDynamic'];
                            }
                            //
                            if ($ssrBaggageInfos) {
                                foreach ($ssrBaggageInfos as $bagg) {
                                    $TotalBaggFare += isset($bagg['amount']) ? ceil($bagg['amount'] * $ExchangeCurrencyRate) : $bagg['Price'];
                                }
                            }
                            if ($ssrMealInfos) {
                                foreach ($ssrMealInfos as $bagg) {
                                    $TotalMealFare += isset($bagg['amount']) ? ceil($bagg['amount'] * $ExchangeCurrencyRate) : $bagg['Price'];
                                }
                            }
                            if ($ssrSeatInfos) {
                                foreach ($ssrSeatInfos as $bagg) {
                                    $TotalSeatFare += isset($bagg['amount']) ? ceil($bagg['amount'] * $ExchangeCurrencyRate) : $bagg['Price'];
                                }
                            }


                            if ($pnrDetails) {
                                $Sectors = [];
                                foreach ($pnrDetails as $ksec => $vl) {
                                    $Sectors[] = $ksec;
                                }
                            }
                        }

                ?>
                    <div class="passenger-details-row">
                        <div class="passenger-details-col">
                         <?php echo ($ks1 + 1); ?>
                        </div>
                        <div class="passenger-details-col">
                            <p><strong>   <?php echo $CustomerTitle; ?> <?php echo $CustomerFirstName; ?> <?php echo $CustomerLastName; ?> (<?= $PaxType ?>)</strong></p>
                            <span style="font-size:12px">
                                <p> <?= ($trevllerValue['passportno']) ? 'PassportNo : ' . $trevllerValue['passportno'] : '' ?></p></span>
                            <span style="font-size:12px">
                                <p> <?= ($trevllerValue['passporIssue']) ? 'PassportIssue : ' . date('d-M-Y', strtotime($trevllerValue['passporIssue'])) : '' ?></p></span>
                            <span style="font-size:12px">
                                <p> <?= ($CustomerDOB) ? 'DOB : ' . date('d-M-Y', strtotime($CustomerDOB)) : '' ?></p></span>
                            <span style="font-size:12px"> <p> <?php echo $CheckinBaggage . ' | ' . $CabinBaggage ?></p></span>
                            <?php
                                if ($SelectedBag && $ICSourceSysId == 3) {
                                    foreach ($SelectedBag as $keysec => $bg) {  ?>
                                        <span style="font-size:12px">
                                            <p>SSR: <?= $keysec ?> <?= $bg[0]['Weight'] ?> Kg </p>
                                        </span>
                                <?php
                                    }
                                }
                                ?>
                                 <?php if ($SelectedMeal && $ICSourceSysId == 3) {
                                        foreach ($SelectedMeal as $mealkey => $ml) { ?>
                                            <span style="font-size:12px">
                                            <p>SSR: <?= $mealkey ?> <?= $ml[0]['AirlineDescription'] ?> </p>
                                            </span>
                                    <?php
                                        }
                                    }
                                ?>
                                 <?php if ($SelectedSeat[$sck] && $ICSourceSysId == 3) {
                                    foreach ($SelectedSeat[$sck] as $seatkey => $ml) { ?>
                                        <span style="font-size:12px">
                                        <p>SSR: <?= $seatkey ?> <?= $ml['seatNo'] ?> </p>
                                        </span>
                                <?php
                                    }
                                }
                                ?>
                        </div>
                        <?php 
                        if ($Sectors && $trevllerValue['paxType'] != 3) { ?>
                            <div class="passenger-details-col">
                          
                        <?php foreach ($Sectors as $keysss => $Secvalue) {
                            $SegBar = isset($SegmentsArr[$Secvalue]) ? $SegmentsArr[$Secvalue] : [];
                            $AirlineCode = $SegBar['AirlineCode'];
                            $originDepTime =  date('Y-m-d', strtotime($SegBar['originDepTime']));
                            $FlightNumber = isset($SegBar['FlightNumber']) ? $SegBar['FlightNumber'] : $SegBar['SegFlightNumber'];
                            $SegFlightNumber = explode('-', $FlightNumber);
                            $SegFlightNumber_ = trim($SegFlightNumber[1]);
                            $FlightNumber_ = Zend_Controller_Action_HelperBroker::getStaticHelper("Flight")->FlightNumberPadded($SegFlightNumber_);

                            $originAirportCode = isset($SegBar['OriginAirportCode']) ? $SegBar['OriginAirportCode'] : $SegBar['originAirportCode'];
                            $destinationAirportCode = isset($SegBar['DestAirportCode']) ? $SegBar['DestAirportCode'] : $SegBar['destinationAirportCode'];

                            $SGSECK = $originAirportCode . '-' . $destinationAirportCode;
                            $SecPnr = isset($TicketId[$keysss]) ? $TicketId[$keysss] : '';
                          
                            $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;

                            if (strlen($FInalBarCode) == 60) {
                                $data = $pdf417->encode($FInalBarCode);

                                $renderer = new ImageRenderer([
                                    'format' => 'data-url'
                                ]);
                                $img = $renderer->render($data);
                    ?>
                                  <div class="passenger-barcode">
                                <div class="barcode-caption"><?= $Secvalue; ?></div>
                                <div class="barcode-image"><img src="<?= $img->encoded ?>" style="height: 60px;" alt=""></div>
                            </div>
                        <?php } } ?>
                        </div>
                     <?php }else{ ?>
                            <div class="passenger-details-col">
                            <div class="passenger-barcode">
                               
                                <div class="barcode-caption"><?= implode('<br>', $Sectors) ?></div>
                                </div>
                        </div>
                            <?php } ?>
                        <div class="passenger-details-col">
                        <?php
                            if ($TicketId) {
                                foreach ($TicketId as $tk => $pnr) {
                                    $TicketNum = isset($TicketNumber[$tk]) ?  $TicketNumber[$tk] : '';
                                    $pnrDetails___ = $pnr;
                            ?>
                          
                            <p><strong><?= ($ICSourceSysId == 3) ? implode('<br>', $TBOPnr) : '' ?> <?= $pnr ?></strong></p>
                            <p><strong><?= $TicketNum ?></strong></p>
                            <?php
                                }
                            }
                            ?>
                        </div>
                    </div>
                    <?php } } ?>
              
            </div>
        </div>
        <div class="fare-details">
            <div class="fare-details-header">
                <strong>Passenger Details</strong>
            </div>
            <div class="fare-details-row">
                <div class="fare-details-property">Basic Fare</div>
                <div class="fare-details-value"> <?= $CurrencySymbol ?> <?= number_format($TotalFare, 2) ?></div>
            </div>
            <div class="fare-details-row">
                <div class="fare-details-property">Taxes & Fees</div>
                <div class="fare-details-value"><?= $CurrencySymbol ?> <?= number_format($TotalServiceFee, 2) ?></div>
            </div>
            <div class="fare-details-row">
                <div class="fare-details-property">Meal/ Seat/Baggage/ Misc Charges	</div>
                <div class="fare-details-value"><?= $CurrencySymbol ?> <?= number_format(($TotalMealFare + $TotalBaggFare + $TotalSeatFare), 2) ?></div>
            </div>
            <div class="fare-details-row">
                <div class="fare-details-property">Discount</div>
                <div class="fare-details-value"> <?= $CurrencySymbol ?> <?= number_format(($TotalDiscountValue), 2) ?></div>
            </div>
            <div class="fare-details-row fare-details-price-total">
                <div class="fare-details-property"><strong>Total</strong></div>
                <div class="fare-details-value"><strong> <?= $CurrencySymbol ?> <?= number_format(ceil($TotalFare + $TotalServiceFee + $TotalGST + $TotalMealFare + $TotalBaggFare + $TotalSeatFare), 2) ?></strong></div>
            </div>
        </div>
        <div class="important-note">
            <div class="important-note-header">
                <strong>Important Note:</strong>
            </div>
            <ul class="important-note-list">
                <li>All Guests Must Present Valid Identification At Check-In.</li>
                <li>Use The Airline PNR For All Correspondence Directly With The Airline</li>
                <li>In Case Of Cancellation Less Than 6 Hours, Please Cancel With The Airline Directly.</li>
                <li>Please Verify Flight Timing And Terminal Information With Airline Directly.</li>
                <li>All Times Are Local To The Respective Airports In 24 Hours. Format.</li>
                <li>For More Information Either Contact Your Travel Agent Or Airline.</li>
            </ul>
        </div>
    </div>
</div>

</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit