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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/tripstring.com/application/views/scripts/flight/cancel-ticket.phtml
<?php
$baseUrl = $this->baseUrl;
$CurrencyRate = $this->CurrencyRate;
$CurrencyTitle = $this->CurrencyTitle;
$baseUrl = $this->baseUrl;
$FlightBooking = $this->FlightBooking;
$FlightBookingInb = $this->FlightBookingInb;
$bookingId = $this->bookingId;

$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);
$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'];

$ARR_SALUTION = unserialize(ARR_SALUTION);
$ARR_SALUTION_CHILD = unserialize(ARR_SALUTION_CHILD);
//echo"<pre>"; print_r($Segments);
//echo"<pre>"; print_r($passenger);echo"</pre>";
?>
<!DOCTYPE html>
<html>

<head lang="en">
    <meta charset="UTF-8">
    <title>Cancel - Request</title>
    <link href="https://fonts.googleapis.com/css?family=Lato&display=swap" rel="stylesheet">

    <style>
        body {
            font-family: Arial, Helvetica, sans-serif;
        }

        /* The Modal (background) */
        .modal {
            display: none;
            /* Hidden by default */
            position: fixed;
            /* Stay in place */
            z-index: 9999;
            /* Sit on top */
            padding-top: 100px;
            /* Location of the box */
            left: 0;
            top: 0;
            width: 100%;
            /* Full width */
            height: 100%;
            /* Full height */
            overflow: auto;
            /* Enable scroll if needed */
            background-color: rgb(0, 0, 0);
            /* Fallback color */
            background-color: rgba(0, 0, 0, 0.4);
            /* Black w/ opacity */
        }

        /* Modal Content */
        .modal-content {
            background-color: #fefefe;
            margin: auto;
            padding: 20px;
            border: 1px solid #888;
            width: 50%;
        }

        /* The Close Button */
        .close {
            color: #aaaaaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
        }

        .close:hover,
        .close:focus {
            color: #000;
            text-decoration: none;
            cursor: pointer;
        }

        #GetCancelCharge table tr td {
            padding: 3px 6px;
            border: 1px solid #ccc;
        }

        .button {
            background-color: #ea1537d6;
            /* Green */
            border: none;
            color: white;
            padding: 8px 10px;
            text-align: center;
            text-decoration: none;
            display: inline-block;
            font-size: 14px;
            cursor: pointer;
        }
    </style>
</head>

<body id="PDFcontent">
<table cellpadding="0" cellspacing="0" border="0" width="900px" 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/images/logo.png" height="65"></span>

                    </td>
                    <td align="center" valign="middle" width="30%" style="font-size: 17px; font-weight: bold; padding: 10px;">
                        Cancel - Request
                    </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']['PNR_Number']; ?></span>

                    </td>
                </tr>
                <tr bgcolor="#f7f7f7 ">
                    <td colspan="3" align="left" valign="middle" style="font-size: 14px; font-weight: bold;  padding: 8px; color: #727477; border: 1px solid #eaeaea;">Cancellation Type:
                        <select id="requestType" name="requestType" class="form-control" style="width: auto !important;">
                            <option value="">-Select-</option>
                            <!-- <option value="CANCELLATION">Cancellation</option> -->
                            <option value="1">Full Cancellation</option>
                            <option value="2">Partial Cancellation</option>
                        </select>
                    </td>
                </tr>
            </table>


        </td>
    </tr>
    <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;">Onward</td>
                    <td align="right" valign="middle" style="font-size: 14px; font-weight: bold;  padding: 8px; color: #727477; border: 1px solid #eaeaea;"><?= $IsRefundableTxt ?></td>

                </tr>
            </table>
        </td>
    </tr>
    <?php
    if ($Segments) {
        $currentSeg = current($Segments);
        $originAirportCode = $currentSeg['originAirportCode'];
        $endSeg = end($Segments);
        $destinationAirportCode = $endSeg['destinationAirportCode'];
        foreach ($Segments as $konw => $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];
            $departureDate = str_replace('T', ' ', $value['originDepTime']);
            // echo '<pre>';print_r($value);echo '</pre>';
            ?>
            <tr>
                <td align="left" style=" padding: 4px 5px;" valign="top">
                    <table cellspacing="0" cellpadding="0" border="0" width="100%">
                        <tr>
                            <?php if ($konw == 0) { ?>
                                <td align="center" valign="middle" style="padding: 4px 5px;">
                                    <input class="checkme" type="checkbox" name="sectorsSelectors" date="<?= date('Y-m-d', strtotime($departureDate)) ?>" value="<?= $originAirportCode ?>-<?= $destinationAirportCode ?>" id="sectorsSelectors_<?= $konw ?>">
                                </td>
                            <?php } else {
                                echo '<td style="padding: 4px 13px;">&nbsp;</td>';
                            } ?>
                            <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" width="50" 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></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> </td>
                        </tr>
                        <tr>
                            <?php if ($value['GroundTime'] > 0) { ?>
                            <td align="center" valign="middle" colspan="5" style="border: 1px solid #eaeaea; font-size: 13px; padding: 4px 5px; background: antiquewhite;">
                                <img src="<?= $baseUrl ?>public/images/clock.png" style="height: 20px; margin: -6px 0px;" /> LAYOVER <?= $LAYOVERDuration ?>
                            </td>
                        </tr>
                        <?php } ?>
                    </table>
                </td>
            </tr>
            <?php
        }
    }
    ?>

    <?php if ($SegmentsInb) { ?>
        <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;">Return</td>
                        <td align="right" valign="middle" style="font-size: 14px; font-weight: bold;  padding: 8px; color: #727477;"><?= $IsRefundableTxtInb ?></td>

                    </tr>
                </table>
            </td>
        </tr>
        <?php
    }
    if ($SegmentsInb) {
        $currentSeg = current($SegmentsInb);
        $originAirportCode = $currentSeg['originAirportCode'];
        $endSeg = end($SegmentsInb);
        $destinationAirportCode = $endSeg['destinationAirportCode'];
        foreach ($SegmentsInb as $konw => $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];
            $departureDate = str_replace('T', ' ', $value['originDepTime']);
            ?>
            <tr>
                <td align="left" style=" padding: 4px 5px;" valign="top">
                    <table cellspacing="0" cellpadding="0" border="0" width="100%">
                        <tr>
                            <?php if ($konw == 0) { ?>
                                <td align="center" valign="middle" style="padding: 4px 5px;">
                                    <input class="checkme" type="checkbox" name="sectorsSelectors" date="<?= date('Y-m-d', strtotime($departureDate)) ?>" value="<?= $originAirportCode ?>-<?= $destinationAirportCode ?>" id="sectorsSelectors_<?= $konw ?>">
                                </td>
                            <?php } else {
                                echo '<td style="padding: 4px 10px;">&nbsp;</td>';
                            } ?>
                            <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></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;"><?= $FareClassInb ?></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></td>
                        </tr>
                        <tr>
                            <?php if ($value['GroundTime'] > 0) { ?>
                            <td align="center" valign="middle" colspan="5" style="border: 1px solid #eaeaea; font-size: 13px; padding: 4px 5px; background: antiquewhite;">
                                <img src="<?= $baseUrl ?>public/images/clock.png" style="height: 20px; margin: -6px 0px;" /> LAYOVER <?= $LAYOVERDuration ?>
                            </td>
                        </tr>
                        <?php } ?>
                    </table>
                </td>
            </tr>
            <?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: 8px; line-height:12px; display: block">Check-in | Cabin </span> Meal & Other Preference</td>
                </tr>
                <?php
                $MealFare = 0;
                $BaggFare = 0;
                if ($passenger) {
                    foreach ($passenger as $keys => $value) {
                        $paxName = $value['FirstName'] . ' ' . $value['LastName'];
                        if ($value['paxType'] == 1) {
                            $paxType = 'Adult';
                            $Salutation = $ARR_SALUTION[$value['Salutation']];
                        } elseif ($value['paxType'] == 2) {
                            $paxType = 'Child';
                            $Salutation = $ARR_SALUTION_CHILD[$value['Salutation']];
                        } else {
                            $paxType = 'Infant';
                            $Salutation = $ARR_SALUTION_CHILD[$value['Salutation']];
                        }
                        $pnrDetails = $travellerInfos[$keys]['pnrDetails'];
                        $ticketNumberDetails = $travellerInfos[$keys]['ticketNumberDetails'];
                        $ssrBaggageInfos = [];
                        $ssrMealInfos = [];
                        if (isset($travellerInfos[$keys]['ssrBaggageInfos'])) {
                            $ssrBaggageInfos = $travellerInfos[$keys]['ssrBaggageInfos'];
                        }
                        if (isset($travellerInfos[$keys]['ssrMealInfos'])) {
                            $ssrMealInfos = $travellerInfos[$keys]['ssrMealInfos'];
                        }

                        if (!empty($value['ChangeRequestId'])) {
                            $status = 'CAN/MODE';
                            $disable = 'disabled="disabled"';
                        } else {
                            $status = '';
                            $disable = '';
                        }
                        // echo "<pre>";
                        // print_r($travellerInfos[$keys]['ssrBaggageInfos']);
                        // print_r($pnrDetails);
                        // print_r($value['ChangeRequestId']);
                        // echo '</pre>';
                        $sector = implode("<br>", array_keys($pnrDetails));
                        $PNRNumber = implode("<br>", $pnrDetails);
                        ?>
                        <tr>
                            <td align="left" valign="middle" style="padding: 4px 5px;" width="40%"> <input class="checkme" <?= $disable ?> type="checkbox" value="<?= $value['FirstName'] ?>-<?= $value['LastName'] ?>" name="PaxDetails" id="PaxDetails_<?= $keys + 1 ?>"><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></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)) {
                                    foreach (array_keys($pnrDetails) as $sec) {
                                        $ticketNumber = isset($ticketNumberDetails[$sec]) ? '(' . $ticketNumberDetails[$sec] . ')' : '';
                                        ?>
                                        <div><span><?= $pnrDetails[$sec] ?> <?= $ticketNumber ?></span></div>
                                        <?php
                                    }
                                }
                                ?>
                            </td>
                            <td align="center" valign="middle" style="padding: 4px 5px;">
                                <?php
                                if (array_keys($pnrDetails)) {
                                    foreach (array_keys($pnrDetails) as $sec) {
                                        $Baggage = isset($ssrBaggageInfos[$sec]) ? $ssrBaggageInfos[$sec] : [];
                                        $Meal = isset($ssrMealInfos[$sec]) ? $ssrMealInfos[$sec] : [];
                                        $BaggFare += isset($Baggage['amount']) ? $Baggage['amount'] : '0';
                                        $MealFare += isset($Meal['amount']) ? $Meal['amount'] : '0';
                                        // echo "<pre>";print_r($Baggage);echo "</pre>";
                                        ?>
                                        <div>
                                            <?= $value['Baggage'] ?> | <?= $value['CabinBaggage'] ?>
                                            <?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 } ?>
                                        </div>
                                        <?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;">Cancellation Remarks</td>
                </tr>
                <tr>
                    <td align="left" valign="middle" style="padding: 4px 5px;">
                        <textarea class="cancellation_comments" id="cancellation_comments" name="cancellation_comments" style="height:100px; width: 650px;"></textarea>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td align="left" style=" padding: 4px 5px;" valign="top">
            <button type="submit" class="btn btn-danger updatesubmit" id="cancel_booking" onclick="cancelBookingNow()">Get Cancel Charge</button>
        </td>
    </tr>

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


</table>
<div id="myModal" class="modal">

    <!-- Modal content -->
    <div class="modal-content">
        <!-- <span class="close">&times;</span> -->
        <div id="GetCancelCharge">loading.....</div>
    </div>

</div>
<br /> <br />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script type="text/javascript">
    $('#requestType').on('change', function() {
        var requestType = $(this).val();
        if (requestType == 1) {
            $('.checkme').each(function() {
                $(this).prop('checked', true).trigger('change');
                $(this).attr('disabled', true);
            });
        } else {
            $('.checkme').each(function() {
                $(this).prop('checked', false).trigger('change');
                $(this).attr('disabled', false);
            });
        }
    });

    function cancelBookingNow() {

        var cType = '2';
        var cRemarks = $("#cancellation_comments").val();
        var requestType = $("#requestType").val();
        var PaxDetails = $('input[name="PaxDetails"]:checked').map(function(_, el) {
            return $(el).val();
        }).get();
        var sectorsSelectors = $('input[name="sectorsSelectors"]:checked').map(function(_, el) {
            return $(el).val();
        }).get();
        var sectorsDates = $('input[name="sectorsSelectors"]:checked').map(function(_, el) {
            return $(el).attr('date');
        }).get();
        if (requestType === '') {
            alert('Please Select Cancellation Type!');
            $("#requestType").focus();
            return false;
        }

        //if (requestType === '2') {
        if (sectorsSelectors.length === 0) {
            alert('Please Select Sector(s)');
            return false;
        }
        if (PaxDetails.length === 0) {
            alert('Please Select Passenger(s)');
            return false;
        }
        //}
        if (cRemarks === "") {
            alert('Cancellation Remarks');
            return false;
        }
        // if (cRemarks !== "") {
        //     var confrm = confirm("Are you sure ? You want to cancel booking.");
        //     if (!confrm) {
        //         return false;
        //     }
        // }
        //return false;

        $.ajax({
            url: '<?= $baseUrl ?>flight/cancel-ticket/<?= $bookingId ?>',
            data: {
                requestType: requestType,
                cRemarks: cRemarks,
                sectorsSelectors: sectorsSelectors,
                PaxDetails: PaxDetails,
                sectorsDates: sectorsDates
            },
            type: 'POST',
            dataType: 'json',
            beforeSend: function() {
                $("#cancel_booking").html("Please Wait...");
                $("#cancel_booking").prop('disabled', true);
            },
            success: function(response) {

                if (!response.success) {
                    alert(response.msg);
                    $("#cancel_booking").html("Get Cancel Charge");
                    return false;
                } else {
                    getModal();
                    $('#GetCancelCharge').html(response.html);
                    //$("#cancellation_comments").val('');
                    $("#cancel_booking").html("Get Cancel Charge");
                    $("#cancel_booking").prop('disabled', false);
                    // if (response.redirect) {
                    //     location.href = "/customer/myprofile#!0=2"

                    // }
                }


            }
        });


    }

    function SubmitcancelBooking() {
        var cType = '2';
        var cRemarks = $('.cancellation_comments').val();
        var requestType = $("#requestType").val();
        var PaxDetails = $('input[name="PaxDetails"]:checked').map(function(_, el) {
            return $(el).val();
        }).get();
        var sectorsSelectors = $('input[name="sectorsSelectors"]:checked').map(function(_, el) {
            return $(el).val();
        }).get();
        var sectorsDates = $('input[name="sectorsSelectors"]:checked').map(function(_, el) {
            return $(el).attr('date');
        }).get();
        if (requestType === '') {
            alert('Please Select Cancellation Type!');
            $("#requestType").focus();
            return false;
        }

        //if (requestType === '2') {
        if (sectorsSelectors.length === 0) {
            alert('Please Select Sector(s)');
            return false;
        }
        if (PaxDetails.length === 0) {
            alert('Please Select Passenger(s)');
            return false;
        }
        //}
        if (cRemarks === "") {
            alert('Cancellation Remarks');
            return false;
        }
        if (cRemarks !== "") {
            var confrm = confirm("Are you sure ? You want to cancel booking.");
            if (!confrm) {
                return false;
            }
        }
        //return false;

        $.ajax({
            url: '/flight/submit-amendment/<?= $bookingId ?>',
            data: {
                requestType: requestType,
                cRemarks: cRemarks,
                sectorsSelectors: sectorsSelectors,
                PaxDetails: PaxDetails,
                sectorsDates: sectorsDates
            },
            type: 'POST',
            dataType: 'json',
            beforeSend: function() {
                $("#cancel_ticket").html("Please Wait...");
                $("#cancel_ticket").prop('disabled', true);
            },
            success: function(response) {

                if (!response.success) {
                    alert(response.msg);
                    $("#cancel_ticket").html("Cancel Ticket");
                    return false;
                } else {
                    alert(response.msg);
                    $("#cancel_ticket").html("Cancel Ticket");
                    $("#cancel_ticket").prop('disabled', false);
                    if (response.redirect) {
                        location.href = "/customer/myprofile#!0=2"

                    }
                }


            }
        });


    }
</script>

<script>
    function getModal() {
        var modal = document.getElementById("myModal");
        modal.style.display = "block";
    }
    // Get the modal


    // Get the button that opens the modal
    //var btn = document.getElementById("cancel_booking__ppp");

    // Get the <span> element that closes the modal
    //var span = document.getElementsByClassName("close")[0];

    // When the user clicks the button, open the modal
    // btn.onclick = function() {
    //     modal.style.display = "block";
    // }

    // When the user clicks on <span> (x), close the modal
    // span.onclick = function() {
    //     modal.style.display = "none";
    // }

    // When the user clicks anywhere outside of the modal, close it
    // window.onclick = function(event) {
    //     if (event.target == modal) {
    //         modal.style.display = "none";
    //     }
    // }
</script>
</body>

</html>

Youez - 2016 - github.com/yon3zu
LinuXploit