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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/b2c.hellogtx.com/application/views/scripts/flight/e-ticket-download copy.phtml
<?php
$baseUrl = $this->baseUrl;
$FlightBooking = $this->FlightBooking;
$FlightBooking__ = $this->FlightBooking__;
$FlightBookingInb = $this->FlightBookingInb;
$getSupportContact = $this->getSupportContact;
$getAgencyData = $this->getAgencyData;
$arrAgencyUserDetail = $this->arrAgencyUserDetail;
$object = Zend_Controller_Front::getInstance();
$options = $object->getParam('bootstrap')->getOption('bootstrap');
$stylecss = $options['stylecss'];
$AgencySysId = $getAgencyData['AgencySysId'];
$API_Response = json_decode($FlightBooking['data']['API_Response'], true);
$API_ResponseInb = json_decode($FlightBookingInb['data']['API_Response'], true);
$API_Response_Ticket = json_decode($FlightBooking['data']['API_Response_Ticket'], true);
if (!empty($FlightBookingInb['data']['API_Response_Ticket'])) {
    $API_Response_TicketInb = json_decode($FlightBookingInb['data']['API_Response_Ticket'], true);
}

$FareClass = $API_Response['FairRules']['FareClass'];
$IsRefundableTxt = $API_Response['IsRefundableTxt'];
$IsRefundableTxtInb = $API_ResponseInb['IsRefundableTxt'];
$FareClassInb = $API_ResponseInb['FairRules']['FareClass'];
$Segments = $API_Response['Segments'];
$SegmentsInb = $API_ResponseInb['Segments'];
$status = $API_Response_Ticket['order']['status'];
$tripInfos = $API_Response_Ticket['itemInfos']['AIR']['tripInfos'];
$travellerInfos = $API_Response_Ticket['itemInfos']['AIR']['travellerInfos'];
$PNR_Number = array_unique(explode('-', $FlightBooking['data']['PNR_Number']));
$PNR_Number = implode(',', $PNR_Number);
$passenger = $FlightBooking['passenger'];
$BookingId = $FlightBooking['data']['BookingId'];
$ICSourceSysId = $FlightBooking['data']['ICSourceSysId'];
$ResponseStatusonward = $FlightBooking['data']['status'];
$ARR_SALUTION = unserialize(ARR_SALUTION);
$ARR_SALUTION_CHILD = unserialize(ARR_SALUTION_CHILD);
$SegmentsApi = [];
$SegmentsApiInb = [];
if ($ICSourceSysId == 3) {
    $travellerInfos = $API_Response_Ticket['Response']['Response']['FlightItinerary']['Passenger'];
    $SegmentsApi = $API_Response_Ticket['Response']['Response']['FlightItinerary']['Segments'];
    $SegmentsApiInb = isset($API_Response_TicketInb['Response']['Response']['FlightItinerary']['Segments']) ? $API_Response_TicketInb['Response']['Response']['FlightItinerary']['Segments'] : [];
    if ($ResponseStatusonward == 1) {
        $status = 'Confirmed';
    } else {
        $status = 'Pending';
    }
    if ($ResponseStatusreturn == 1) {
        $statusInb = 'Confirmed';
    } else {
        $statusInb = 'Pending';
    }
    $ARR_SALUTION = unserialize(ARR_SALUTIONTBO);
    $ARR_SALUTION_CHILD = unserialize(ARR_SALUTIONTBO);
}
$Currency = $FlightBooking['data']['Currency'];

$intNetPublishedFare = 0;
$AdditionalTxnFeePub = 0;
$TotalBaseFare = 0;
$AdditionalTxnFeePubR = 0;
$TotalTaxsandFees = 0;
$TotalServiceFee = 0;
$TotalGST = 0;
$coupnValAmt = 0;
$FlightBookingData = [];

$Segments = [];
if ($FlightBooking__['data']) {
    foreach ($FlightBooking__['data'] as $key => $value) {
        $API_Response__ = json_decode($value['API_Response'], true);
        $FlightBookingData[] = $API_Response__;
    }
}

// $FlightBookingData[0] = $API_Response;
// if ($API_ResponseInb) {
//     $FlightBookingData[1] = $API_ResponseInb;
// }
$pnrDetails = [];
// echo "<pre>"; print_r($API_Response_Ticket);
if ($FlightBookingData) {
    foreach ($FlightBookingData as $Data) {
        $SourceAirportCode = $Data['SourceAirportCode'];
        $DestAirportCode = $Data['DestAirportCode'];
        $ICSourceSysId = $Data['ICSourceSysId'];
       
        //$PNR_Number = $Data['PNR_Number'];
        // if($AgencySysId == '1'){
        //     echo '<pre>';print_r($Data);
        // }
        $pnrDetails[$SourceAirportCode . '-' . $DestAirportCode] = $PNR_Number;
        $intNetPublishedFare += $Data['FairRules']['PublishedFare'];
        if ($Data['FairRules']['FareBreakdown']) {
            foreach ($Data['FairRules']['FareBreakdown'] as $value) {

                $MF = $value['MF'];
                $TDS = $value['TDS'];
                $YQ = $value['YQ'];
                $AGST = $value['AGST'];
                $MFT = $value['MFT'];
                // $OT = $value['OT'];
                $OT = isset($value['OT'])?$value['OT']:$value['TaxBR']['OT']; //Other Charges
                $MU = $value['MU'];
                $YR = $value['YR'];
                $other = $MF + $TDS + $YQ + $AGST + $MFT + $OT + $YR;
                $PBaseFare = $value['BaseFare'];
                $CommisionPass = $value['CommisionPass'];
                $ServiceFee = $value['ServiceFee'];

                $FixedMarkUp = $value['FixedMarkUp'];
                $GSTOnMarkUp = $value['GSTOnMarkUp'];
                $apiMarkup = $value['apiMarkup'];
                $paxPublishedFare = ($PBaseFare);
                $PassengerType = $value['PassengerType'];
                $PassengerCount = $value['PassengerCount'];
                $AdditionalTxnFeePub += $value['AdditionalTxnFeePub'];

                $IntCommission = $value['IntCommission'];
                $CommissionEarned = $value['CommissionEarned'];
                $TotalBaseFare += $paxPublishedFare;
                if ($ICSourceSysId == 8) {
                    $TotalServiceFee += ($FixedMarkUp + $apiMarkup);
                }else{
                    $TotalServiceFee += ($FixedMarkUp);
                }
                if ($ICSourceSysId != 3) {
                    if ($ICSourceSysId == 8 || $ICSourceSysId == 7) {
                        $TotalGST += ($GSTOnMarkUp);
                    }else{
                        $TotalGST += ($apiMarkup);
                    }
                    $TotalTaxsandFees += ($MF + $YQ + $AGST + $MFT + $OT + $YR + $IntCommission - $CommissionEarned);
                } else {
                    $TotalGST += ($GSTOnMarkUp);
                    $YQ = 0;
                    $TotalTaxsandFees += ($MF + $YQ + $AGST + $MFT + $OT + $MU + $ServiceFee + $YR + $TDS - $CommisionPass);
                }

                // echo '<pre>';print_r($ICSourceSysId);echo '</pre>';
                
                if ($AgencySysId == '12577') {
                    // echo '<pre>';print_r($TotalAmount);echo '</pre>';
                    // echo '<pre>';print_r($OTTax);echo '</pre>';
                    //echo '<pre>';print_r(($MF + $YQ + $AGST + $MFT + $OT + $MU + $YR + $IntCommission - $CommissionEarned));echo '</pre>';
                }
            }
        }
        
        if($Data['FairRules']['couponApply']){
            $coupnValAmt += isset($Data['FairRules']['couponVal'])? ($Data['FairRules']['couponVal']): 0;
        }
        
    }
}
$IsCancellationProtection = isset($FlightBooking['data']['IsCancellationProtection']) ? $FlightBooking['data']['IsCancellationProtection'] : 0;
$CancellationProtectionPrice = isset($FlightBooking['data']['CancellationProtectionPrice']) ? $FlightBooking['data']['CancellationProtectionPrice'] : 0;
$TPSysId = isset($FlightBooking['data']['TPSysId']) ? $FlightBooking['data']['TPSysId'] : 0;
$couponApply = isset($FlightBooking['data']['couponApply']) ? $FlightBooking['data']['couponApply'] : 0;
// if ($couponApply) {
//     $couponVal = isset($FlightBooking['data']['couponVal']) ? $FlightBooking['data']['couponVal'] : 0;
// } else {
//     $couponVal = 0;
// }


//echo"<pre>"; print_r($travellerInfos);echo '</pre>';
// echo "<pre>";
// print_r($FlightBookingData);
// echo '</pre>';

$travellerInfosarr  = [];
if ($travellerInfos && $ICSourceSysId == 3) {
    foreach ($travellerInfos as $key => $value) {
        $travellerInfos[$key] = $value;
        $travellerInfos[$key]['pnrDetails'] = $pnrDetails;
        //$travellerInfos[$key]['ticketNumberDetails'] = $value['Ticket']['TicketId'];
    }
}

$PNRArray  = [];
if ($SegmentsApi && $ICSourceSysId == 3) {
    foreach ($SegmentsApi as $key => $value) {
        $PNRArray[] = $value['AirlinePNR'];
    }
}

if ($AgencySysId == '69640') {
    //echo '<pre>';print_r($API_Response);echo '</pre>';
    // echo '<pre>';
    // print_r($FlightBookingData);
    // echo '</pre>';
    //echo '<pre>';print_r(($MF + $YQ + $AGST + $MFT + $OT + $MU + $YR + $IntCommission - $CommissionEarned));echo '</pre>';
}
$pnrNumber = isset($FlightBooking['data']['PNR_Number'])? (explode("-",$FlightBooking['data']['PNR_Number'])) : "";


if (isset($getSupportContact['EmailId']) && !empty($getSupportContact['EmailId'])) {
    $MasterPrimaryEmail = trim($getSupportContact['EmailId']);
} else {
    $MasterPrimaryEmail = $getAgencyData['PrimaryEmail'];
}
if (isset($getSupportContact['ContactNo1']) && !empty($getSupportContact['ContactNo1'])) {
    $PrimaryMobileNo = trim($getSupportContact['ContactNo1']);
} else {
    $PrimaryMobileNo = $getAgencyData['PrimaryMobileNo'];
}
if (isset($getSupportContact['countrycode']) && !empty($getSupportContact['countrycode'])) {
    $countrycode = trim($getSupportContact['countrycode']);
} else {
    $countrycode = $getAgencyData['countrycode'];
}
// echo "FlightBookingData<pre>";print_r($FlightBookingData);die;
$LeadCustomerName = $passenger[0]['FirstName'] . ' ' . $passenger[0]['LastName'];

require_once('Barcode417/vendor/autoload.php');

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

$pdf417 = new PDF417();
// echo "<pre>";print_r($travellerInfos);die;
?>
<!DOCTYPE html>
<html>

<head lang="en">
    <meta charset="UTF-8">
    <title>E-Ticket</title>
    <link href="https://fonts.googleapis.com/css?family=Lato&display=swap" rel="stylesheet">
    <link rel="shortcut icon" href="<?php echo $baseUrl ?>public/upload/<?php echo $stylecss ?>/images/favicon.ico">
</head>
<style>
    @media print {
        @page {
            margin-top: 0;
            margin-bottom: 0;
        }

        body {
            padding-top: 72px;
            padding-bottom: 72px;
        }
    }
</style>

<!-- <body onload="window.print();"> -->
<body>
<div id="invoice">
    <table cellpadding="0" cellspacing="0" border="0" width="700px" style="margin: auto; border: 1px solid #eaeaea;  padding: 5px; font-family: Roboto, sans-serif; font-size: 14px; color: #827878; word-spacing: 2px;">
        <tr>
            <td align="left" valign="top" style="padding: 4px 5px;">
                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="font-family: Roboto, sans-serif; font-size: 14px; color: #827878; word-spacing: 2px;">
                    <tr>
                        <td align="center" valign="middle" width="30%" style="font-size: 17px; font-weight: bold; padding: 10px;">
                            <span style="float: left; line-height: 40px; margin-right: 10px;"><img src="<?= $baseUrl ?>public/upload/<?php echo $stylecss ?>/images/logo_email.png"></span>
                            <span style="float: left; line-height: 40px;">Ticket <?= $status ?></span>
                        </td>
                        <td align="center" valign="middle" width="30%" style="font-size: 17px; font-weight: bold; padding: 10px;">
                            Flight Itinerary
                        </td>
                        <td align="right" valign="middle" width="30%" style="font-size: 13px; font-weight: bold; padding: 10px; color: #988c8c; line-height: 20px;">
                            Booking Id / PNR : <br> <span style=" font-size: 15px; text-transform: capitalize; font-weight: 600; color:#2191d0;"><?= $FlightBooking['data']['BookingId']; ?> /  <?= '(' . implode(',', array_unique($pnrNumber)) . ')' ?> <?= ($ICSourceSysId == 3) ? '(' . implode(',', array_unique($PNRArray)) . ')' : '' ?></span>

                        </td>
                    </tr>
                </table>


            </td>
        </tr>
        <?php
        $Segmentsarray = [];
        if ($FlightBookingData) {
            foreach ($FlightBookingData as $key => $values) {
                $Segments = $values['Segments'];
                
        ?>
                <tr>
                    <td align="left" style=" padding: 4px 5px;" valign="top">
                        <table cellspacing="0" cellpadding="0" border="0" width="100%" style="border: 1px solid #eaeaea; font-family: Roboto, sans-serif; font-size: 14px; color: #827878; word-spacing: 2px;">
                            <tr bgcolor="#f7f7f7 ">
                                <td align="left" valign="middle" style="font-size: 14px; font-weight: bold;  padding: 8px; color: #727477; border: 1px solid #eaeaea;"><?= $values['SourceAirportCode'] ?> - <?= $values['DestAirportCode'] ?></td>
                                <td align="right" valign="middle" style="font-size: 14px; font-weight: bold;  padding: 8px; color: #727477; border: 1px solid #eaeaea;"><?= $values['IsRefundableTxt'] ?></td>

                            </tr>
                        </table>
                    </td>
                </tr>
                <?php
                $sectorArr = [];
                if ($Segments) {
                    foreach ($Segments as $konw => $value) {
                        $Segmentsarray[] = $value;
                        $originDepTime = Zend_Controller_Action_HelperBroker::getStaticHelper("Flight")->getArrivalDepartureIndianFormat($value['originDepTime']);
                        $destinationArrTime = Zend_Controller_Action_HelperBroker::getStaticHelper("Flight")->getArrivalDepartureIndianFormat($value['destinationArrTime']);
                        $originTime = Zend_Controller_Action_HelperBroker::getStaticHelper("Flight")->getTimeFromApiString($value['originDepTime']);
                        $destinationTime = Zend_Controller_Action_HelperBroker::getStaticHelper("Flight")->getTimeFromApiString($value['destinationArrTime']);
                        $Duration = Zend_Controller_Action_HelperBroker::getStaticHelper("Flight")->convertMinutesToHoursFormat((isset($value['Duration']) ? $value['Duration'] : 0));
                        $LAYOVERMinutes = ((isset($value['GroundTime']) ? $value['GroundTime'] : 0));
                        $LAYOVERDuration = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->convertMinutesToHoursFormat($LAYOVERMinutes);
                        $segggg = $value['originAirportCode'] . '-' . $value['destinationAirportCode'];
                        $PNR = $pnrDetails[$segggg];
                        $sectorArr[] = $segggg;
                        $SegmentsArr = isset($SegmentsApi[$konw]) ? $SegmentsApi[$konw] : '';
                        $AirlinePNR = !empty($SegmentsArr['AirlinePNR']) ? $SegmentsArr['AirlinePNR'] : $FlightBooking['data']['PNR_Number'];
                        if ($values['IsSeriesFareData'] == 1) {
                            $Duration = $value['FlightDuration'];
                        }
                        // echo '<pre>';print_r($SegmentsArr);echo '</pre>';die;
                ?>
                        <tr>
                            <td align="left" style=" padding: 4px 5px;" valign="top">
                                <table cellspacing="0" cellpadding="0" border="0" width="100%">
                                    <?php if ($value['GroundTime'] > 0 && $ICSourceSysId == 3) { ?>
                                        <tr>
                                            <td align="center" valign="middle" colspan="4" style="border: 1px solid #eaeaea; font-size: 13px; padding: 4px 5px; background: antiquewhite;">
                                                <img src="<?= $baseUrl ?>public/images/clock.png" style="width: 14px; height: 14px; margin: -3px 0px;" /> LAYOVER <?= $LAYOVERDuration ?>
                                            </td>
                                        </tr>
                                    <?php } ?>
                                    <tr>
                                        <td align="center" valign="middle" style="padding: 4px 5px;">
                                            <span style="width: 40px; height: 40px; position: relative; display: block; text-align: center;  padding: 10px; overflow: hidden; margin: auto;  z-index: 99;"> <img src="<?= $baseUrl ?>public/upload/AirlineLogo/<?= $value['AirlineCode'] ?>.gif" height="50"> </span>
                                            <?= $value['AirlineName'] ?> <?= $value['SegFlightNumber'] ?>
                                        </td>
                                        <td align="center" valign="middle" style="padding: 4px 5px;"><span style="font-size: 26px; font-weight: 700; color: #727477;"><?= $value['originAirportCode'] ?></span><br><span style="font-size: 14px; font-weight: 700; color: #727477;"><?= $value['originCityName'] ?></span><br><span style="border-bottom: 1px solid #ffb28e; border-top: 1px solid #ffb28e; padding: 5px; line-height: 45px;"><?= $originDepTime ?>, <?= $originTime ?></span><br><span><?= $value['originAirportName'] ?><br><?= ($ICSourceSysId == 3) ? 'Terminal - ' . $value['DepTerminal'] : $value['DepTerminal'] ?></span></td>
                                        <td align="center" valign="middle" style="padding: 4px 5px;">
                                            <span style="width: 15px !important; height:10px !important; position: relative; display: block; text-align: center;  padding: 10px; overflow: hidden; margin: auto;  z-index: 99;"><img src="<?= $baseUrl ?>public/images/departure_flight.png" style="position: absolute; max-width: 97%; max-height: 97%; left: 0; top: 0; bottom: 0; right: 0;  margin: auto;  padding: 0; transition: all .7s ease-in-out;" /> </span>
                                            <?= $Duration ?><br><span style="border-top: 1px solid #ffb28e; padding: 5px; line-height: 45px;"><?= $FareClass ?></span>
                                        </td>
                                        <td align="center" valign="middle" style="padding: 4px 5px;"><span style="font-size: 26px; font-weight: 700; color: #727477;"><?= $value['destinationAirportCode'] ?></span><br><span style="font-size: 14px; font-weight: 700; color: #727477;"><?= $value['destinationCityName'] ?></span><br><span style="border-bottom: 1px solid #ffb28e; border-top: 1px solid #ffb28e; padding: 5px; line-height: 45px;"><?= $destinationArrTime ?>, <?= $destinationTime ?></span> <br><span><?= $value['destinationAirportName'] ?><br><?= ($ICSourceSysId == 3) ? 'Terminal - ' . $value['ArrTerminal'] . '<br> Airline PNR-' . $AirlinePNR : $value['ArrTerminal'] ?></span></td>
                                    </tr>
                                    <?php if ($value['GroundTime'] > 0 && $ICSourceSysId != 3) { ?>
                                        <tr>
                                            <td align="center" valign="middle" colspan="4" style="border: 1px solid #eaeaea; font-size: 13px; padding: 4px 5px; background: antiquewhite;">
                                                <img src="<?= $baseUrl ?>public/images/clock.png" style="width: 14px; height: 14px; margin: -3px 0px;" /> LAYOVER <?= $LAYOVERDuration ?>
                                            </td>
                                        </tr>
                                    <?php } ?>
                                </table>
                            </td>
                        </tr>
                <?php
                    }
                }
                ?>
        <?php
            }
        }
        ?>


        <tr>
            <td align="left" style=" padding: 4px 5px;" valign="top">
                <table cellspacing="0" cellpadding="0" border="0" width="100%" style="font-family: Roboto, sans-serif; font-size: 14px; color: #827878; word-spacing: 2px;">
                    <tr bgcolor="#f7f7f7 ">
                        <td align="left" valign="middle" width="40%" style="font-size: 14px; font-weight: bold;  padding: 8px; color: #727477; border: 1px solid #eaeaea;"> PASSENGER NAME </td>
                        <td align="center" valign="middle" style="font-size: 14px; font-weight: bold;  padding: 8px; color: #727477; border: 1px solid #eaeaea;"> SECTOR</td>
                        <td align="center" valign="middle" style="font-size: 14px; font-weight: bold;  padding: 8px; color: #727477; border: 1px solid #eaeaea;"> PNR & TICKET </td>
                        <td align="center" nowrap valign="middle" style="font-size: 14px; font-weight: bold;  padding: 8px; color: #727477; border: 1px solid #eaeaea;">Baggage <span style="font-size: 11px; line-height:12px; display: block">Check-in | Cabin </span> Meal & Other Preference</td>
                    </tr>
                    <?php
                    $MealFare = 0;
                    $BaggFare = 0;
                    $SeatFare = 0;
                    if ($passenger) {
                        foreach ($passenger as $keys => $value) {
                            //echo "<pre>";
                            //print_r($value);echo "</pre>";
                            $paxName = $value['FirstName'] . ' ' . $value['LastName'];
                            if ($value['paxType'] == 1) {
                                $paxType = 'ADT';
                                $Salutation = $ARR_SALUTION[$value['Salutation']];
                            } elseif ($value['paxType'] == 2) {
                                $paxType = 'CHD';
                                $Salutation = $ARR_SALUTION_CHILD[$value['Salutation']];
                            } else {
                                $paxType = 'INF';
                                $Salutation = $ARR_SALUTION_CHILD[$value['Salutation']];
                            }
                            $pnrDetails = $travellerInfos[$keys]['pnrDetails'];
                            //print_r($travellerInfos[$keys]);
                            $ticketNumberDetails = $travellerInfos[$keys]['ticketNumberDetails'];
                            $ssrBaggageInfos = [];
                            $ssrMealInfos = [];
                            $ssrSeatInfos = [];
                            if (isset($travellerInfos[$keys]['ssrBaggageInfos'])) {
                                $ssrBaggageInfos = $travellerInfos[$keys]['ssrBaggageInfos'];
                            }
                            if (isset($travellerInfos[$keys]['ssrMealInfos'])) {
                                $ssrMealInfos = $travellerInfos[$keys]['ssrMealInfos'];
                            }
                            if (isset($travellerInfos[$keys]['ssrSeatInfos'])) {
                                $ssrSeatInfos = $travellerInfos[$keys]['ssrSeatInfos'];
                            }
                            if (!empty($value['ChangeRequestId'])) {
                                $status = 'CAN/MODE';
                            } else {
                                $status = '';
                            }
                            // echo "<pre>";
                            // print_r($pnrDetails);
                            // echo '</pre>';
                            $sector = implode("<br>", array_keys($pnrDetails));
                            $PNRNumber = implode("<br>", $pnrDetails);
                            $BaggageAdd = [];
                            $MealDynamicAdd = [];
                            $SeatDynamicAdd = [];
                            $fullName = strtoupper(trim($value['LastName'])) . '/' . strtoupper(trim($value['FirstName']));
                            $fullName_ = str_pad($fullName, 20, ' ');
                            if ($ICSourceSysId == 3) {
                                $BarcodeDetails = isset($travellerInfos[$keys]['BarcodeDetails']['Barcode'])?$travellerInfos[$keys]['BarcodeDetails']['Barcode']:'';

                                $JourneyType = $value['JourneyType'];
                                $ValidatingAirline = $travellerInfos[$keys]['Ticket']['ValidatingAirline'];
                                $BaggageAdd = isset($travellerInfos[$keys]['Baggage']) ? $travellerInfos[$keys]['Baggage'] : [];
                                $MealDynamicAdd = isset($travellerInfos[$keys]['MealDynamic']) ? $travellerInfos[$keys]['MealDynamic'] : [];
                                $SeatDynamicAdd = isset($travellerInfos[$keys]['SeatDynamic']) ? $travellerInfos[$keys]['SeatDynamic'] : [];
                                $TicketId = $value['TicketId'] . $ValidatingAirline;
                                $TicketNumber = $value['TicketNumber'];

                                // $MealFare += isset($value['MealPrice']) ? $value['MealPrice'] : 0;
                                //$BaggFare += isset($value['BaggagePrice']) ? $value['BaggagePrice'] : 0;
                                if ($JourneyType == 1) {

                                    //$sector = implode('<br>', $sectorArr);
                                } else {
                                    //$SegmentAdditionalInfo = $travellerInfos[$keys]['SegmentAdditionalInfo'][1];
                                    //$sector = implode('<br>', $sectorInbArr);
                                }
                            }
                    ?>
                            <tr>
                                <td align="left" valign="middle" style="padding: 4px 5px;" width="40%"><span><?= $keys + 1 ?> </span>
                                    <span style=" font-size: 15px; text-transform: capitalize; font-weight: 600; color:#2191d0;"><?= $Salutation ?>. <?= $paxName ?></span>,
                                    <span style="font-size: 14px;color: #a29c9c;"><?= $paxType ?></span>
                                    <span style="font-size: 14px;color: #ff0000;"><?= $status ?></span>
                                    
                                    <?php
                                    
                                    if($ICSourceSysId == 7 || $ICSourceSysId == 17 || $ICSourceSysId == 16){
                                         if ($Segmentsarray && $value['paxType'] != 3) {
                                            foreach ($Segmentsarray as $keysss => $SegBar) {
                                                $AirlineCode = $SegBar['AirlineCode'];
                                                //echo "<pre>";print_r($SegBar);echo "</pre>";
                                                $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;
                                               
                                                if (strlen($FInalBarCode) == 60) {
                                                    $data = $pdf417->encode($FInalBarCode);

                                                    $renderer = new ImageRenderer([
                                                        'format' => 'data-url'
                                                    ]);
                                                    $img = $renderer->render($data);
                                        ?>
                                                    <img src="<?= $img->encoded ?>" width="240" height="80" style="margin: 11px;" />
                                        <?php
                                                }
                                            }
                                        }
                                    }else{
                                        if ($BarcodeDetails) {
                                            foreach ($BarcodeDetails as $Barcode) {

                                                if (strlen($Barcode['Content']) == 60) {
                                                    $data = $pdf417->encode($Barcode['Content']);

                                                    $renderer = new ImageRenderer([
                                                        'format' => 'data-url'
                                                    ]);
                                                    $img = $renderer->render($data);
                                        ?>
                                                    <img src="<?= $img->encoded ?>" width="240" height="80" style="margin: 11px;" />
                                        <?php
                                                }
                                            }
                                        }
                                        }
                                        ?>
                                </td>
                                <td align="center" valign="middle" style="padding: 4px 5px;"> <?= $sector ?></td>
                                <td align="center" valign="middle" style="padding: 4px 5px;">
                                    <?php
                                    if (array_keys($pnrDetails) && ($ICSourceSysId == 7 || $ICSourceSysId == 8 || $ICSourceSysId == 17 || $ICSourceSysId == 16)) {
                                        foreach (array_keys($pnrDetails) as $sec) {
                                            $ticketNumber = isset($ticketNumberDetails[$sec]) ? '(' . $ticketNumberDetails[$sec] . ')' : '';
                                    ?>
                                            <div><span><?= $pnrDetails[$sec] ?> <?= $ticketNumber ?></span></div>
                                    <?php
                                        }
                                    } else {
                                        echo '<li style="    width: 100%;list-style-type:none;float:left;font-size:12px;display:inline-block;margin-right:20px;"> ' . $TicketId . '/' . $TicketNumber . '</li>';
                                    }
                                    ?>
                                </td>
                                <td align="center" valign="middle" style="padding: 4px 5px;">
                                    <?php
                                    if (array_keys($pnrDetails) && ($ICSourceSysId == 7 || $ICSourceSysId == 8 || $ICSourceSysId == 17 || $ICSourceSysId == 16)) {
                                        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'] : '0';
                                            $MealFare += isset($Meal['amount']) ? $Meal['amount'] : '0';
                                            $SeatFare += isset($Seat['amount']) ? $Seat['amount'] : '0';
                                            // echo "<pre>";print_r($sec);echo "</pre>";
                                            // echo "<pre>";print_r($Baggage);echo "</pre>";
                                    ?>
                                            <div>
                                                <?= $value['Baggage'] ?> | <?= $value['CabinBaggage'] ?><br>
                                                <?php if (!empty($Baggage)) { ?>
                                                    <b><?= $sec ?></b>: <span class="graycolor"><i class="fa fa-suitcase"></i> - <?= !empty($Baggage['desc']) ? $Baggage['desc'] : '' ?>,</span>
                                                <?php } ?>

                                                <?php if (!empty($Meal)) { ?>
                                                    <span class="graycolor"> <i class="fa fa-cutlery"></i> - <?= !empty($Meal['desc']) ? $Meal['desc'] : '' ?>, </span>
                                                <?php } ?>
                                                <?php if (!empty($Seat)) { ?>
                                                    <span class="graycolor" style="font-weight: bold;"> Seat No - <?= !empty($Seat['code']) ? $Seat['code'] : '' ?> </span>
                                                <?php } ?>
                                            </div>
                                            <?php
                                        }
                                    } else {
                                        echo $value['Baggage'] . ' | ' . $value['CabinBaggage'] . '<br>';
                                        if ($BaggageAdd) {
                                            foreach ($BaggageAdd as $m => $val) {
                                                $BaggFare += isset($val['Price']) ? $val['Price'] : '0';

                                            ?>
                                                <?php if (!empty($val)) { ?>
                                                    <b><?= $val['Origin'] ?>-<?= $val['Destination'] ?></b>: <span class="graycolor"><i class="fa fa-suitcase"></i> <?= !empty($val['Weight']) ? '- ' . $val['Weight'] . 'KG ,' : '' ?></span>
                                                <?php } ?>

                                        <?php
                                            }
                                        }
                                        ?>
                                        <?php
                                        if ($MealDynamicAdd) {
                                            foreach ($MealDynamicAdd as $m => $val) {
                                                $MealFare += isset($val['Price']) ? $val['Price'] : '0';

                                        ?>
                                                <?php if (isset($val) && !empty($val)) {
                                                ?>
                                                    <span class="graycolor"> <i class="fa fa-cutlery"></i> - <?= !empty($val['AirlineDescription']) ? $val['AirlineDescription'] : '' ?> </span>
                                                <?php } ?>
                                        <?php
                                            }
                                        }
                                        ?>
                                        <?php
                                        if ($SeatDynamicAdd) {
                                            foreach ($SeatDynamicAdd as $m => $val) {
                                                $SeatFare += isset($val['Price']) ? $val['Price'] : '0';

                                        ?>
                                                <?php if (isset($val) && !empty($val)) {
                                                ?>
                                                    <span class="graycolor"> Seat No - <?= !empty($val['Code']) ? $val['Code'] : '' ?> </span>
                                                <?php } ?>
                                        <?php
                                            }
                                        }
                                        ?>
                                    <?php
                                    }
                                    ?>
                                </td>
                            </tr>
                    <?php
                        }
                    }
                    ?>
                </table>
            </td>
        </tr>

        <tr>
            <td align="left" style=" padding: 4px 5px;" valign="top">
                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="border: 1px solid #eaeaea; font-family: Roboto, sans-serif; font-size: 14px; color: #827878; word-spacing: 2px;">
                    <tr bgcolor="#f7f7f7 ">
                        <td align="left" valign="middle" style="font-size: 14px; font-weight: bold;  padding: 8px; color: #727477;">Payment Details</td>
                    </tr>
                    <tr>
                        <td align="left" valign="middle" style="padding: 4px 5px;">
                            <table cellpadding="0" cellspacing="0" border="0" width="100%" style="font-family: Roboto, sans-serif; font-size: 14px; color: #827878; word-spacing: 2px;">
                                <tr>
                                    <td align="left" valign="center" style="padding: 4px 5px;" width="60%">This is an Electronic ticket. Please carry a physical identification for Check in.</td>
                                    <td align="left" valign="center" style="padding: 4px 5px;" width="40%">
                                        <table cellspacing="0" cellpadding="0" border="0" width="100%" style="font-family: Roboto, sans-serif; font-size: 14px; color: #827878; word-spacing: 2px;">
                                            <tr>
                                                <td align="left" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="60%">Base Fare : </td>
                                                <td align="right" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="40%"><?= $Currency ?> <?= number_format(($TotalBaseFare * $this->CurrencyRate)) ?></td>
                                            </tr>
                                            <?php if($stylecss=='atlas') { ?>
                                            <tr>
                                                <td align="left" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="60%">Other Charges : </td>
                                                <td align="right" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="40%"><?= $Currency ?> <?= number_format((($TotalTaxsandFees +$TotalServiceFee + $TotalGST) * $this->CurrencyRate)) ?></td>
                                            </tr>
                                            <?php } else{ ?>
                                                <tr>
                                                    <td align="left" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="60%">Other Charges : </td>
                                                    <td align="right" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="40%"><?= $Currency ?> <?= number_format(($TotalTaxsandFees * $this->CurrencyRate)) ?></td>
                                                 </tr>
                                                <tr>
                                                    <td align="left" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="60%">Service Fee : </td>
                                                    <td align="right" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="40%"><?= $Currency ?> <?= number_format(($TotalServiceFee * $this->CurrencyRate)) ?></td>
                                                </tr>
                                                <?php if ($this->gstvalidate['SGST'] == 1) { ?>
                                                    <tr>
                                                        <td align="left" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="60%">SGST : </td>
                                                        <td align="right" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="40%"><?= $Currency ?> <?= number_format(($TotalGST * $this->CurrencyRate / 2)) ?></td>
                                                    </tr>
                                                <?php } ?>
                                                <?php if ($this->gstvalidate['CGST'] == 1) { ?>
                                                    <tr>
                                                        <td align="left" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="60%">CGST : </td>
                                                        <td align="right" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="40%"><?= $Currency ?> <?= number_format(($TotalGST * $this->CurrencyRate / 2)) ?></td>
                                                    </tr>
                                                <?php } ?>
                                                <?php if ($this->gstvalidate['IGST'] == 1) { ?>
                                                    <tr>
                                                        <td align="left" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="60%">IGST : </td>
                                                        <td align="right" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="40%"><?= $Currency ?> <?= number_format(($TotalGST * $this->CurrencyRate)) ?></td>
                                                    </tr>
                                                <?php } }?>
                                                
                                            <tr>
                                                <td align="left" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="60%">Meal,Baggage & Seat : </td>
                                                <td align="right" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="40%"><?= $Currency ?> <?= number_format((($MealFare + $BaggFare + $SeatFare) * $this->CurrencyRate)) ?></td>
                                            </tr>
                                            <?php if ($couponApply == 1) { ?>
                                                <tr>
                                                    <td align="left" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="60%">Coupon Discount : </td>
                                                    <td align="right" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="40%"><?= $Currency ?> <?= number_format(($coupnValAmt * $this->CurrencyRate)) ?></td>
                                                </tr>
                                            <?php } ?>
                                            <?php if ($IsCancellationProtection == 1) { ?>
                                                <tr>
                                                    <td align="left" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="60%">Refund Upgrade : </td>
                                                    <td align="right" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="40%"><?= $Currency ?> <?= number_format(($CancellationProtectionPrice * $this->CurrencyRate)) ?></td>
                                                </tr>
                                            <?php } ?>
                                            <tr>
                                                <td align="left" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="60%">Total Amount : </td>
                                                <td align="right" valign="center" style="border: 1px solid #eaeaea; padding: 4px 5px;" width="40%"><?= $Currency ?> <?= number_format(ceil(($TotalBaseFare + $TotalTaxsandFees + $TotalServiceFee + $TotalGST + $MealFare + $BaggFare + $SeatFare + $CancellationProtectionPrice - $coupnValAmt) * $this->CurrencyRate)) ?></td>
                                            </tr>
                                        </table>
                                    </td>

                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="left" style=" padding: 4px 5px;" valign="top">
                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="border: 1px solid #eaeaea; font-family: Roboto, sans-serif; font-size: 14px; color: #827878; word-spacing: 2px;">
                    <tbody>
                        <tr bgcolor="#f7f7f7 ">
                            <td align="left" valign="middle" colspan="2" style="font-size: 14px; font-weight: bold;  padding: 8px; color: #727477;">24x7 CUSTOMER SUPPORT</td>
                        </tr>

                        <tr>
                            <td align="left" valign="middle" width="50%" style="padding: 4px 5px;">
                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="font-family: Roboto, sans-serif; font-size: 14px; color: #827878; word-spacing: 2px;">
                                    <tbody>
                                        <tr>
                                            <td align="left" valign="middle" width="50%" style="padding: 4px 5px;">
                                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="border: 1px solid #eaeaea; font-family: Roboto, sans-serif; font-size: 14px; color: #827878; word-spacing: 2px;">
                                                    <tbody>
                                                        <tr bgcolor="#f7f7f7 ">
                                                            <td valign="middle" align="left" colspan="2" style="font-size: 14px; font-weight: bold;   padding: 4px 5px; color: #727477;"><?= $this->siteName ?> Support</td>
                                                        </tr>
                                                        <tr>
                                                            <td align="left" style=" padding:4px 5px;" valign="top" rowspan="2">Telephone</td>
                                                            <td align="left" style="border: 1px solid #eaeaea; padding: 4px 5px;" valign="middle"><?= !empty($countrycode) ? trim($countrycode).'-' : '' ?><?= !empty($PrimaryMobileNo) ? $PrimaryMobileNo :'' ?></td>
                                                        </tr>
                                                        <tr>

                                                            <td align="left" valign="middle" style=" border: 1px solid #eaeaea; padding: 4px 5px;"> <?= !empty($MasterPrimaryEmail) ? trim($MasterPrimaryEmail) : '' ?> </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                            <!-- <td align="left" valign="middle" width="50%" style=" padding: 4px 5px;">
                                                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="border: 1px solid #eaeaea; font-family: Roboto, sans-serif; font-size: 14px; color: #827878; word-spacing: 2px;">
                                                    <tbody>
                                                        <tr bgcolor="#f7f7f7 ">
                                                            <td valign="middle" align="left" colspan="2" style="font-size: 14px; font-weight: bold;   padding: 4px 5px; color: #727477;">Airline Support</td>
                                                        </tr>
                                                        <tr>
                                                            <td align="left" style="  padding: 4px 5px;" valign="top" rowspan="2">Airlines</td>
                                                            <td align="left" style="border: 1px solid #eaeaea; padding: 4px 5px;" valign="middle">1800-0001-5456-51515 (toll free)</td>
                                                        </tr>
                                                        <tr>
                                                            <td align="left" valign="middle" style="border: 1px solid #eaeaea; padding: 4px 5px;">&nbsp;</td>

                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td> -->
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>
        <?php if ($IsCancellationProtection == 1) { ?>
            <tr>
                <td colspan="3" align="center" valign="top">
                    <div style="color: #444; font-size:14px; font-weight:bold; line-height:22px;padding: 8px 12px;">Refundable Booking</div>
                </td>
            </tr>
            <tr>
                <td colspan="3" align="left" valign="top">
                    <table width="100%" border="1" bordercolor="#d7d7d7" cellspacing="0" cellpadding="0" style="padding:0px; font-family: Roboto, sans-serif; font-size: 12px; color: #4f4f50; word-spacing: 2px;">

                        <tr>
                            <td align="left" valign="center" width="100%" style="padding: 8px 12px;">
                                <span style="border-radius: 100%;     font-size: 16px;background: #4f4f50; width: 0px; height: 0px; line-height: 0px; display: list-item; margin: 6px 4px 0 16px; float: left;">&nbsp;</span>
                                <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:<?= !empty($arrAgencyUserDetail['EmailId']) ? trim($arrAgencyUserDetail['EmailId']) : $getAgencyData['PrimaryEmail'] ?>"><?= !empty($arrAgencyUserDetail['EmailId']) ? trim($arrAgencyUserDetail['EmailId']) : $getAgencyData['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:rgb(0, 0, 238);">Terms & Conditions</a> here, you may be entitled to a full refund. Your booking reference number is <?php echo $TPSysId; ?>.<br><a target="_blank" href="https://form.refundable.me/forms/refund?memberId=268&bookingReference=<?php echo $TPSysId; ?>" style="text-decoration:underline;">Apply for a refund using the form here</a>.
                                </span>

                            </td>
                        </tr>

                    </table>
                </td>
            </tr>
        <?php } ?>
        <tr>
            <td align="left" style=" padding: 4px 5px;" valign="top">
                <table cellpadding="0" cellspacing="0" border="0" width="100%" style="border: 1px solid #eaeaea; font-family: Roboto, sans-serif; font-size: 14px; color: #827878; word-spacing: 2px;">
                    <tr bgcolor="#f7f7f7 ">
                        <td align="left" valign="middle" style="font-size: 14px; font-weight: bold;  padding: 8px; color: #727477;">IMPORTANT INFORMATION</td>
                    </tr>
                    <tr>
                        <td align="left" valign="middle" style="padding: 4px 5px;">
                            <table cellpadding="0" cellspacing="0" border="0" width="100%" style="font-family: Roboto, sans-serif; font-size: 14px; color: #827878; word-spacing: 2px;">
                                <tr>
                                    <td align="left" valign="center" width="100%" style="padding: 4px 5px;">
                                        <ul>
                                            <li style="margin: 10px 0; text-align: justify;"><span style=" font-size: 15px; font-weight: bold;">Check-in Time : </span> Check-in desks will close 1 hour before departure.</li>
                                            <li style="margin: 10px 0; text-align: justify;"><span style=" font-size: 15px; font-weight: bold;">Valid ID proof needed : </span> Carry a valid photo identification proof (Driver Licence, Aadhar Card, Pan Card or any other Government recognised photo identification).</li>
                                            <li style="margin: 10px 0; text-align: justify;"><span style=" font-size: 15px; font-weight: bold;">Web Check-in (opens 48 hrs. before departure):</span> - Use PNR and last name only</li>
                                            <li style="margin: 10px 0; text-align: justify;"><span style=" font-size: 15px; font-weight: bold;">To Cancel or Modify this booking, visit: </span> <a href="<?= $baseUrl ?>"> <?= $baseUrl ?></a>.</li>
                                            <li style="margin: 10px 0; text-align: justify;"><span style=" font-size: 15px; font-weight: bold;">You have paid: <?= $Currency ?> <?= number_format(ceil($intNetPublishedFare + $MealFare + $BaggFare + $SeatFare)) ?></span></li>
                                        </ul>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>

        <!--<tr>-->
        <!--<td align="left" valign="top">&nbsp;</td>-->
        <!--</tr>-->


    </table>

    <br /> <br />

    <a href="#" onclick="window.print();">Print</a>
</div>
</body>
<script src="<?= $baseUrl ?>public/js/html2pdf.bundle.min.js"></script>
<script type="text/javascript">
    window.onload = function() {
        // Choose the element that our invoice is rendered in.
        const element = document.getElementById('invoice');

        html2pdf(document.getElementById('invoice'), {
            margin: 10,
            filename: "<?= $LeadCustomerName ?>.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>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit