| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/b2bzend/application/views/scripts/booking-flight/ |
Upload File : |
<?php
$IsCallCenter = Travel_Model_AgencyAuth::getIdentity()->IsCallCenter;
$arrStatusType = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->getAllStatusType();
$customhelper = Zend_Controller_Action_HelperBroker::getStaticHelper('Custom');
$AgencyUser = new Zend_Session_Namespace('AgencyUser');
$IsMaskingOnEmailAndMobile = $AgencyUser->user->IsMaskingOnEmailAndMobile;
$IsFullMaskingEnabled = $AgencyUser->user->IsFullMaskingEnabled;
// $paginator = $this->paginator;
//echo "<pre>";print_r($this->searchArr);die;
?>
<body class="row">
<!--Page main section start-->
<section id="min-wrapper" class="active">
<div id="main-content">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<!--Top header start-->
<h3 class="ls-top-header">Flight Booking Queue</h3>
<!--Top header end -->
<!--Top breadcrumb start -->
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-home"></i></a></li>
<li class="active">Booking Queue</li>
<li class="active">Flights</li>
</ol>
<!--Top breadcrumb start -->
</div>
</div>
<!-- Main Content Element Start-->
<div class="row">
<div class="col-md-12">
<div class="successMessage">
<?php
if (!empty($this->messages)) {
echo ($this->messages[0]);
}
?>
</div>
</div>
<div class="">
<div class="col-md-12">
<div class="panel panel-primary">
<div class="panel-heading minus" style="padding:0">
<h3 class="panel-title" onclick="$('.minus').trigger('click')" style="padding: 12px 15px 10px 15px;"><img src="<?php echo $this->baseUrl('public/images/query_dashboard/filtericon.png'); ?>">
Filter Results</h3>
<ul class="panel-control">
<li><a class="minus <?php echo (!empty($this->searchArr)) ? 'active' : ''; ?>" href="javascript:void(0)"><i class="fa <?php echo (!empty($this->searchArr)) ? 'fa-angle-up large' : 'fa-angle-down large'; ?>"></i></a>
</li>
</ul>
</div>
<div class="panel-body" style="display:<?php echo (!empty($this->searchArr)) ? 'block' : 'none'; ?>;">
<form class="ls_form" role="form" name="BookingFilterForm" id="BookingFilterForm" method="POST" autocomplete="off">
<div class="row">
<div class="col-md-3">
<div class="active input-group ls-group-input form-group mbdate_mt_btm_25 fromgroup_height <?php echo (isset($this->searchArr['dateFrom']) && !empty($this->searchArr['dateFrom'])) ? 'active' : ''; ?>">
<label>Booking From Date</label>
<input name="dateFrom" class="form-control datePickerOnly valid" id="LeadQueryFrom" placeholder="dd-mm-yyyy" value="<?php echo isset($this->searchArr['dateFrom']) ? $this->searchArr['dateFrom'] : ''; ?>" type="text" />
<span class="input-group-addon" onclick="$('#LeadQueryFrom').focus();"><i class="fa fa-calendar"></i></span>
</div>
</div>
<div class="col-md-3">
<div class="active input-group ls-group-input form-group mbdate_mt_btm_25 fromgroup_height <?php echo (isset($this->searchArr['dateTo']) && !empty($this->searchArr['dateTo'])) ? 'active' : ''; ?>">
<label>Booking To Date</label>
<input name="dateTo" class="form-control datePickerOnly valid" id="LeadQueryTo" placeholder="dd-mm-yyyy" value="<?php echo isset($this->searchArr['dateTo']) ? $this->searchArr['dateTo'] : ''; ?>" type="text" />
<span class="input-group-addon" onclick="$('#LeadQueryTo').focus();"><i class="fa fa-calendar"></i></span>
</div>
</div>
<div class="col-md-3">
<div class="active input-group ls-group-input form-group mbdate_mt_btm_10 fromgroup_height <?php echo (isset($this->searchArr['TravelFromDate']) && !empty($this->searchArr['TravelFromDate'])) ? 'active' : ''; ?>">
<label>Travel From Date</label>
<input name="TravelFromDate" class="form-control datePickerOnly valid" id="TrFromDate" placeholder="dd-mm-yyyy" value="<?php echo isset($this->searchArr['TravelFromDate']) ? $this->searchArr['TravelFromDate'] : ''; ?>" type="text" />
<span class="input-group-addon" onclick="$('#TrFromDate').focus();"><i class="fa fa-calendar"></i></span>
</div> <br>
</div>
<div class="col-md-3">
<div class="active input-group ls-group-input form-group mbdate_mt_btm_10 fromgroup_height <?php echo (isset($this->searchArr['TravelToDate']) && !empty($this->searchArr['TravelToDate'])) ? 'active' : ''; ?>">
<label>Travel To Date</label>
<input name="TravelToDate" class="form-control datePickerOnly valid" id="TrToDate" placeholder="dd-mm-yyyy" value="<?php echo isset($this->searchArr['TravelToDate']) ? $this->searchArr['TravelToDate'] : ''; ?>" type="text" />
<span class="input-group-addon" onclick="$('#TrToDate').focus();"><i class="fa fa-calendar"></i></span>
</div> <br>
</div>
<div class="col-md-3">
<div class="active form-group">
<label>Proposal ID</label>
<input class="form-control whbg" placeholder="Proposal Id" name="ProposalId" id="ProposalId" value="<?php echo isset($this->searchArr['ProposalId']) ? $this->searchArr['ProposalId'] : '' ?>">
</div>
</div>
<div class="col-md-3">
<div class="active form-group">
<label>Flight No/Flight Name</label>
<input class="form-control whbg" placeholder="Flight No/Flight Name " name="Flight" id="Flight" value="<?php echo isset($this->searchArr['Flight']) ? $this->searchArr['Flight'] : '' ?>">
</div>
</div>
<div class="col-md-3">
<div class="active form-group">
<label>Booking Id</label>
<input class="form-control whbg" placeholder="Booking id " name="BookingId" id="BookingId" value="<?php echo isset($this->searchArr['BookingId']) ? $this->searchArr['BookingId'] : '' ?>">
</div>
</div>
<div class="col-md-3" style="display:block">
<div class="active form-group">
<label> PNR No</label>
<input class="form-control whbg" placeholder="PNR No " name="pnrnumber" id="pnrnumber" value="<?php echo isset($this->searchArr['pnrnumber']) ? $this->searchArr['pnrnumber'] : '' ?>">
</div>
</div>
<div class="col-md-3">
<div class="active form-group <?php echo (isset($this->searchArr['orgDest']) && !empty($this->searchArr['orgDest'])) ? 'active' : ''; ?>">
<label for="CityName">From Dest/To Dest</label>
<?php echo $this->partial('typeaheadcitysearchdetail.phtml', array('cityDisable' => false, 'countryFieldName' => '', 'validationCityFiledName' => 'Destination', 'textFieldName' => 'orgDest', 'textFieldSelectedValue' => @$this->searchArr['orgDest'], 'cityId' => @$this->searchArr['orgDest'])); ?>
</div>
</div>
<div class="col-md-3">
<div class="active form-group">
<label>Customer Name</label>
<input class="form-control whbg" placeholder="Customer name" name="CustomerName" id="CustomerName" value="<?php echo isset($this->searchArr['CustomerName']) ? $this->searchArr['CustomerName'] : '' ?>">
</div>
</div>
<div class="col-md-3">
<div class="active form-group">
<label>Customer Email</label>
<input class="form-control whbg" placeholder="Customer email" name="CustomerEmail" id="CustomerEmail" value="<?php echo isset($this->searchArr['CustomerEmail']) ? $this->searchArr['CustomerEmail'] : '' ?>">
</div>
</div>
<div class="col-md-3">
<div class="active form-group">
<label>Customer Phone</label>
<input class="form-control whbg MobilevalMaxMin" type="tel" placeholder="Customer phone" name="CustomerPhone" id="CustomerPhone" value="<?php echo isset($this->searchArr['CustomerPhone']) ? $this->searchArr['CustomerPhone'] : '' ?>">
</div>
</div>
<div class="col-md-3">
<div class="active form-group">
<label>Company Name </label>
<input type="text" autocomplete="off" class="form-control whbg" name="b2bagencyname" id="b2bagencyname" onkeyup="get_b2bagentname_autosuggest('b2bagencyname','hidden_b2bagency_agentId','');" value="<?php echo isset($this->searchArr['b2bagencyname']) ? $this->searchArr['b2bagencyname'] : ''; ?>">
<input type="hidden" id="hidden_b2bagency_agentId" name="hidden_b2bagency_agentId" value="<?php echo isset($this->searchArr['hidden_b2bagency_agentId']) ? $this->searchArr['hidden_b2bagency_agentId'] : ''; ?>" />
</div>
</div>
<div class="col-md-3">
<div class="active form-group">
<label>Source </label>
<select name="source" class="form-control">
<option value="">Select</option>
<option value="0" <?php echo (isset($this->searchArr['source']) && $this->searchArr['source'] == '0') ? 'selected' : ''; ?>>
B2C</option>
<option value="1" <?php echo (isset($this->searchArr['source']) && $this->searchArr['source'] == '1') ? 'selected' : ''; ?>>
B2B</option>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group" style="float:right !important;top: 26px;">
<button onclick="window.location.href = '<?php echo $this->baseUrl('/booking-flight'); ?>'" class="btn btn-primarygray" type="button">Reset</button>
<button type="submit" value="submit" class="btn btn-primary"><i class="fa fa-search"></i> Filter</button>
<input type="hidden" name="page" id="page" value="1" />
</div>
</div>
</div>
</form>
</div>
<form class="ls_form ExportExcelForm" id="ExportExcelForm1" name="ExportExcelForm1" action="<?php echo $this->baseUrl('booking-flight/export-booking-flight-queue'); ?>" method="post">
<input name="dateFrom" value="<?php echo isset($this->searchArr['dateFrom']) ? $this->searchArr['dateFrom'] : ''; ?>" type="hidden" />
<input name="dateTo" value="<?php echo isset($this->searchArr['dateTo']) ? $this->searchArr['dateTo'] : ''; ?>" type="hidden" />
<input name="TravelFromDate" value="<?php echo isset($this->searchArr['TravelFromDate']) ? $this->searchArr['TravelFromDate'] : ''; ?>" type="hidden" />
<input name="TravelToDate" value="<?php echo isset($this->searchArr['TravelToDate']) ? $this->searchArr['TravelToDate'] : ''; ?>" type="hidden" />
<input name="ProposalId" value="<?php echo isset($this->searchArr['ProposalId']) ? $this->searchArr['ProposalId'] : ''; ?>" type="hidden" />
<input name="Flight" value="<?php echo isset($this->searchArr['Flight']) ? $this->searchArr['Flight'] : ''; ?>" type="hidden" />
<input name="BookingId" value="<?php echo isset($this->searchArr['BookingId']) ? $this->searchArr['BookingId'] : ''; ?>" type="hidden" />
<input name="Pnr_No" value="<?php echo isset($this->searchArr['Pnr_No']) ? $this->searchArr['Pnr_No'] : ''; ?>" type="hidden" />
<input name="orgDest" value="<?php echo isset($this->searchArr['orgDest']) ? $this->searchArr['orgDest'] : ''; ?>" type="hidden" />
<input name="CustomerName" value="<?php echo isset($this->searchArr['CustomerName']) ? $this->searchArr['CustomerName'] : ''; ?>" type="hidden" />
<input name="CustomerPhone" value="<?php echo isset($this->searchArr['CustomerPhone']) ? $this->searchArr['CustomerPhone'] : ''; ?>" type="hidden" />
<input name="CustomerEmail" value="<?php echo isset($this->searchArr['CustomerEmail']) ? $this->searchArr['CustomerEmail'] : ''; ?>" type="hidden" />
<input name="hidden_b2bagency_agentId" value="<?php echo isset($this->searchArr['hidden_b2bagency_agentId']) ? $this->searchArr['hidden_b2bagency_agentId'] : ''; ?>" type="hidden" />
<input name="source" value="<?php echo isset($this->searchArr['source']) ? $this->searchArr['source'] : ''; ?>" type="hidden" />
</form>
</div>
</div>
</div>
<div class="col-md-12">
<div class="panel-body table-responsivenew query_listing_bg3">
<a class="pull-left btn tn-warning btn-warning btn-sm" href="<?php echo $this->baseUrl('booking-flight/queue'); ?>" title="Export To Excel">Queue </a>
<a class="pull-left btn btn-danger btn-sm" style='margin-left:10px;' href="<?php echo $this->baseUrl('booking-flight/hold'); ?>" title="Export To Excel">Hold
</a>
<ul class="mobile_scrolling pull-right">
<a class="pull-right" href="javascript:void(0);" onclick="ExportExcelForm();" title="Export To Excel"><img style="width:auto;" src="<?php echo $this->baseUrl('public/images/query_dashboard/xlsx.png'); ?>"></a>
</ul>
<div class="table-responsive">
<table class="table tablestyle sortable-theme-bootstrap">
<thead>
<tr class="alert alert-graylight">
<th nowrap="" align="left" valign="top" class="small smallbold" data-sortable="true" data-sorted="true" data-sorted-direction="descending">Booking Date<br>Proposal ID</th>
<!-- <th nowrap="" align="left" valign="top" class="small smallbold" data-sortable="true" data-sorted="true" data-sorted-direction="descending">Booking Date</th> -->
<th nowrap="" align="left" valign="top" class="small smallbold" data-sortable="true" data-sorted="true" data-sorted-direction="descending">Travel Date <br>Time</th>
<th nowrap="" align="left" valign="top" class="small smallbold" data-sortable="true" data-sorted="true" data-sorted-direction="descending">Flight</th>
<th nowrap="" align="left" valign="top" class="small smallbold" data-sortable="true" data-sorted="true" data-sorted-direction="descending">Booking Id <br> PNR No.</th>
<th nowrap="" align="left" valign="top" class="small smallbold" data-sortable="true" data-sorted="true" data-sorted-direction="descending">From / To Dest.<br>Source<br>Type</th>
<th nowrap="" align="left" valign="top" class="small smallbold" data-sortable="true" data-sorted="true" data-sorted-direction="descending">My Cost<br>Sale Price</th>
<th nowrap="" align="left" valign="top" class="small smallbold" data-sortable="true" data-sorted="true" data-sorted-direction="descending">Earnings</th>
<th align="left" valign="top" class="small smallbold" data-sortable="true" data-sorted="true" data-sorted-direction="descending">Status</th>
<th nowrap="" align="left" valign="top" class="small smallbold" data-sortable="true" data-sorted="true" data-sorted-direction="descending">Agency Details</th>
<!-- <th nowrap="" align="left" valign="top" class="small smallbold" data-sortable="true" data-sorted="true" data-sorted-direction="descending">Customer Email</th>
<th nowrap="" align="left" valign="top" class="small smallbold" data-sortable="true" data-sorted="true" data-sorted-direction="descending">Contact no</th> -->
<th nowrap="" align="left" valign="top" class="small smallbold" data-sortable="true" data-sorted="true" data-sorted-direction="descending">Booked By</th>
<th nowrap="" align="left" valign="top" class="small smallbold" data-sortable="true" data-sorted="true" data-sorted-direction="descending">Owner</th>
<th nowrap="" align="left" valign="top" class="small smallbold" data-sortable="false">Action</th>
</tr>
</thead>
<tbody>
<?php $customhelper = Zend_Controller_Action_HelperBroker::getStaticHelper('Custom');
if (!empty($this->arrFlightBookingList)) {
$h = 0;
$TicketFor = 0;
$tparray = array();
foreach ($this->arrFlightBookingList as $value) {
// echo '<pre>';
// print_r($value);
// echo '</pre>';
$ICSourceSysId = $value['ICSourceSysId'];
$PackSpecType = $value['PackSpecType'];
$EconomyMask = $value['EconomyMask'];
$intTPSysId = $value['TPSysId'];
$TripType = $value['TripType'];
$strProposalId = $value['PlanBookingId'] . "/" . $value['TPSysId'] . "/V" . $value['VersionId'];
// print_r($strProposalId);
$IsInternational = $value['IsInternational'];
$TBQAirInvenSysId = $value['TBQAirInvenSysId'];
$AirLineTitle = $value['AirLineTitle'];
$strFlightNumber = $value['FlightNumber'];
//$intTotalCostToCustomer = $value['TotalCost'];
$intCost = $value['Cost'];
$intGTXMarkup = $value['GTXMarkup'];
$intAgencyCommission = $value['AgencyCommission'];
$intAgencyMarkUp = (int) trim($value['AgencyMarkUp']);
$intAgentServiceTaxAmount = $value['AgentServiceTaxAmount'];
$AgencyCustomMarkUp = $value['MarkUp'];
$AgentsCustomServiceTaxAmount = $value['AgentsCustomServiceTaxAmount'];
$mFixedMarkUp = 0;
$APIBookingRes = json_decode($value['APIBookingRes'], true);
if ($ICSourceSysId == 8) {
if (empty($intAgencyMarkUp)) {
$mFixedMarkUp = $APIBookingRes['value']['FairRules']['FareBreakdown'][0]['FixedMarkUp'];
}
}
//$intTotalCostToCustomer = $intCost + $intGTXMarkup + ($intAgencyCommission + $intAgencyMarkUp + $intAgentServiceTaxAmount);
$intTotalCostToCustomer = $value['TotalCost'];
$intMyCost = $intTotalCostToCustomer - ($intAgencyCommission + $intAgencyMarkUp + $intAgentServiceTaxAmount + $mFixedMarkUp);
//
$IsNewMigration = $value['IsNewMigration'];
if ($IsNewMigration == 0) {
} else {
}
//echo $intAgencyMarkUp . '=' . $intAgentServiceTaxAmount . '=' . $intAgencyCommission;
//$intAmountPaid = number_format(round($intCost + $intGTXMarkup + $intAgencyCommission),2);
$strSourcePlaces = $value['SourcePlaces'];
$strDestinationPlaces = $value['DestinationPlaces'];
$SourceAirportCode = $value['SourceAirportCode'];
$DestAirportCode = $value['DestAirportCode'];
$objCity = new Travel_Model_TblCity();
if (!empty($strSourceAirportCode)) {
$strSourceCity = $objCity->getCityNameById($strSourceAirportCode);
}
if (!empty($strDestAirportCode)) {
$strDestinationCity = $objCity->getCityNameById($strDestAirportCode);
}
$strFromUTCTime = (array)$value['FromUTCTime'];
$strToUTCTime = (array)$value['ToUTCTime'];
$returnDate = (array)$value['returnDate'];
// $sourceDepartueTime = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->getDateFormatFromDbDates($strFromUTCTime['date']);
// $destinationArrivalTime = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->getDateFormatFromDbDates($strToUTCTime['date']);
$sourceDepartueTime = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->getDateFormatFromDbDates($strFromUTCTime['date']);
$destinationArrivalTime = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->getDateFormatFromDbDates($strToUTCTime['date']);
$returnDateTime = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->getDateFormatFromDbDates($returnDate['date']);
$strBookingId = $value['XRefBookingId'];
$TPIntSysId = $value['TPIntSysId'];
$arrBookingId = explode("/", $strBookingId);
$strXRefBookingId = trim($arrBookingId[0]);
$XRefPNR = $value['XRefPNR'];
// echo "<pre>";
// print_r($strBookingId);
// echo "</pre>";
//die;
$arrBookingDate = (array)$value['bookingDate'];
$strBookingDate = date('d-M-y', strtotime($arrBookingDate['date']));
$custFirstName = $value['custFirstName'];
$custLastName = $value['custLastName'];
$custEmailId = $value['custEmailId']; //email added
$countrycode = $value['countrycode'];
$custContacts = $value['custContacts']; //contact no added
$agtFirstName = $value['agtFirstName'] . "<br>";
$agtLastName = $value['agtLastName'];
$ownerFirstName = $value['ownerFirstName'] . "<br>";
$ownerLastName = $value['ownerLastName'];
$AgencyName = $value['AgencyName'];
$TrxSysId = $value['TrxSysId'];
$arrTravelDate = (array)$value['FromUTCTime'];
$strTravelDate = date('d-M-y', strtotime($arrTravelDate['date'])) . '<br />' . date('H:i:s', strtotime($arrTravelDate['date']));
$currencySymbol = $customhelper->GetCurrencyByCurrencyType($value['CurrencyType']);
$uid = $value['CustomerSysId'] . ':' . $value['TPSysId'] . ':' . $value['MasterTPSysId'];
$display = 'unique:yes';
$uid = $this->controller->getEnc($uid);
$display = $this->controller->getEnc($display);
if ($IsInternational && $TripType == 2) {
$objFlight = new Travel_Model_TblFlight();
$arrInterNationalFlightList = $objFlight->getInterNationalFlightByMasterId($TBQAirInvenSysId);
// echo "<pre>";
// print_r($TBQAirInvenSysId);
// print_r($arrInterNationalFlightList);
// echo "</pre>";
if (isset($arrInterNationalFlightList) && count($arrInterNationalFlightList) > 0) {
$FlightNumberOutBound = isset($arrInterNationalFlightList[0]['FlightNumber']) ? $arrInterNationalFlightList[0]['FlightNumber'] : '';
$FlightNumberInBound = isset($arrInterNationalFlightList[1]['FlightNumber']) ? $arrInterNationalFlightList[1]['FlightNumber'] : '';
$arrOriginDepartureTimeOutBound = isset($arrInterNationalFlightList[0]['OriginDepartureTime']) ? (array)$arrInterNationalFlightList[0]['OriginDepartureTime'] : '';
$OriginDepartureTimeOutBound = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->getDateFormatFromDbDates($arrOriginDepartureTimeOutBound['date']);
$OriginDepartureTimeInBound = isset($arrInterNationalFlightList[1]['OriginDepartureTime']) ? (array)$arrInterNationalFlightList[1]['OriginDepartureTime'] : '';
$OriginDepartureTimeInBound = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->getDateFormatFromDbDates($OriginDepartureTimeInBound['date']);
}
}
// echo '<pre>';
// print_r($APIBookingRes);
// die;
$bookingId_TJ = isset($APIBookingRes['value']['bookingId_TJ']) ? $APIBookingRes['value']['bookingId_TJ'] : '';
$TraceId = isset($APIBookingRes['Response']['TraceId']) ? $APIBookingRes['Response']['TraceId'] : '';
$PNR = isset($APIBookingRes['Response']['Response']['PNR']) ? $APIBookingRes['Response']['Response']['PNR'] : '';
$BookingId = isset($APIBookingRes['Response']['Response']['BookingId']) ? $APIBookingRes['Response']['Response']['BookingId'] : '';
$IsLCC = isset($APIBookingRes['Response']['Response']['FlightItinerary']['IsLCC']) ? $APIBookingRes['Response']['Response']['FlightItinerary']['IsLCC'] : '';
$JourneyType = isset($APIBookingRes['Response']['Response']['FlightItinerary']['JourneyType']) ? $APIBookingRes['Response']['Response']['FlightItinerary']['JourneyType'] : '';
if ($value['TPSysId'] == $value['TPSysId']) {
//$TicketFor++;
}
if (!empty($bookingId_TJ)) {
$bookingId_TJ = $bookingId_TJ;
} else {
$bookingId_TJ = isset($APIBookingRes['value']['bookingId']) ? $APIBookingRes['value']['bookingId'] : '';
}
// echo '<pre>';
// print_r($bookingId_TJ);
// echo '</pre>';
// if ($IsInternational == 1 && $JourneyType == 2) {
// $returnDateTime = $returnDateTime;
// } else {
// $returnDateTime = '';
// }
$statusMap = [];
$TicketId = [];
$TicketNumber = [];
if ($ICSourceSysId == 3) {
$Passengers = isset($APIBookingRes['response']['Response']['Response']['PNR']) ? $APIBookingRes['response']['Response']['Response']['PNR'] : '';
} else {
$Passengers = isset($APIBookingRes['response']['itemInfos']['AIR']['travellerInfos']) ? $APIBookingRes['response']['itemInfos']['AIR']['travellerInfos'] : '';
}
if ($Passengers) {
foreach ($Passengers as $pax) {
//$statusMap = implode('-', $pax['statusMap']);
$TicketId = !empty($pax['pnrDetails']) ? implode('-', $pax['pnrDetails']) : '';
}
}
$pnr = !empty($$TicketId) ? explode('-', $TicketId) : '';
if (is_array($pnr) && (count($pnr) > 2)) {
$PNR_Number = $pnr[0] . '-' . $pnr[1];
} else {
$PNR_Number = $pnr[0];
}
$OnwardAutoTicket = isset($APIBookingRes['value']['OnwardAutoTicket']) ? $APIBookingRes['value']['OnwardAutoTicket'] : 1;
if ($OnwardAutoTicket == 0) {
$PNR_Number = '';
}
if ($IsNewMigration == 3) {
$pnrlink = $this->baseUrl('/flight-new/update-ticket/id/' . base64_encode($value['TPSysId']));
} else {
$pnrlink = $this->baseUrl('/booking-flight/update-e-tickettj/id/' . base64_encode($value['TPSysId']));
}
if ($ICSourceSysId == 7 || $ICSourceSysId == 8 || $ICSourceSysId == 9) {
if (isset($arrBookingId[1]) && !empty($arrBookingId[1])) {
$strXRefBookingId = $strXRefBookingId . '<br><a style="color: #0061f1;">' . $arrBookingId[1] . '</a>';
} else {
if (!empty($PNR_Number)) {
$strXRefBookingId = $strXRefBookingId . '<br><a style="color: #0061f1;">' . $PNR_Number . ' </a>';
} else {
if ($ICSourceSysId == 8) {
//$strXRefBookingId = $strXRefBookingId . '<br><a target="_blank" href="' . $pnrlink . '" style="color: red;" id="' . base64_encode($value['TPSysId']) . '" TPIntSysId="' . $TPIntSysId . '">Update PNR </a>';
} else {
// $strXRefBookingId = $strXRefBookingId . '<br><a class="updatepnr" style="color: red;" id="' . base64_encode($value['TPSysId']) . '" TPIntSysId="' . $TPIntSysId . '">Update PNR </a>';
}
}
}
} else {
// echo '<pre>';
// print_r($strBookingId);
// print_r($ICSourceSysId);
// print_r($arrBookingId);
// echo '</pre>';
if ($ICSourceSysId == 3) {
$strXRefBookingId = $strXRefBookingId . '<br><a style="color: #0061f1;">' . $Passengers . '</a>';
} else {
$strXRefBookingId = $strXRefBookingId;
}
}
if ($ICSourceSysId == 3) {
$Bookingtype = 'TBO';
} elseif ($ICSourceSysId == 7) {
$Bookingtype = 'TJ';
} elseif ($ICSourceSysId == 9) {
// $Bookingtype = 'Offline';
$Bookingtype = trim($value['SupplierName']);
} elseif ($ICSourceSysId == 8) {
// $Bookingtype = 'SF';
$Bookingtype = trim($value['SupplierName']);
} elseif ($ICSourceSysId == 10) {
$Bookingtype = 'RIYA';
} elseif ($ICSourceSysId == 11) {
$Bookingtype = 'ETRAV';
} elseif ($ICSourceSysId == 12) {
$Bookingtype = 'VIA';
} elseif ($ICSourceSysId == 13) {
$Bookingtype = 'JUSTCLICK';
} elseif ($ICSourceSysId == 14) {
$Bookingtype = 'FLYSHOP';
} elseif ($ICSourceSysId == 15) {
$Bookingtype = 'AKASA';
} elseif ($ICSourceSysId == 17) {
$Bookingtype = 'NEXTRA';
} elseif ($ICSourceSysId == 21) {
$Bookingtype = 'Go Fly Smart';
} elseif ($ICSourceSysId == 22) {
$Bookingtype = 'Air Iq';
} elseif ($ICSourceSysId == 23) {
$Bookingtype = 'CF Departure';
} elseif ($ICSourceSysId == 24) {
$Bookingtype = 'Book N Travel';
} elseif ($ICSourceSysId == 25) {
$Bookingtype = 'Travel Boutique';
} elseif ($ICSourceSysId == 30) {
$Bookingtype = 'Travelopedia';
} elseif ($ICSourceSysId == 31) {
$Bookingtype = 'TravClan';
}
if ($value['StatusType'] == 70 || $value['StatusType'] == 104) {
if ($ICSourceSysId == 8) {
$strXRefBookingId = $strXRefBookingId . '<br><a target="_blank" href="' . $pnrlink . '" style="color: red;" id="' . base64_encode($value['TPSysId']) . '" TPIntSysId="' . $TPIntSysId . '">Update PNR </a>';
} else {
$strXRefBookingId = $strXRefBookingId . '<br><a class="updatepnr" ICSourceSysId="' . $ICSourceSysId . '" style="color: red;" id="' . base64_encode($value['TPSysId']) . '" TPIntSysId="' . $TPIntSysId . '">Update PNR </a>';
}
}
// echo "<pre>";
// print_r($value['StatusType']);
// echo "</pre>";
?>
<tr class="alert alert-warning small">
<td nowrap="">
<?php echo $strBookingDate; ?><br>
<?php echo $strProposalId; ?>
<?php ///$value['TripType'] == 1 || $value['TripType'] == 2
?>
<?php
if (in_array($value['TPSysId'], $tparray)) {
$TicketFor = 1;
} else {
$TicketFor = 0;
}
$tparray[] = $value['TPSysId'];
if ($value['StatusType'] == 72 && $value['XRefPNR'] == '' && !$IsLCC) {
?>
<br>
<span style="display:none;" id="Inprocess_<?php echo $h; ?>">Wait <img src="<?php echo $this->baseUrl('public/assets/images/ellipsis.gif'); ?>" /></span>
<a href="#" style="color:red" id="hidelink_<?php echo $h; ?>" onclick="ReleaseTicket('<?= $TraceId ?>','<?= $BookingId ?>','<?= $PNR ?>','<?= $value['TPSysId'] ?>','<?= $TicketFor ?>','<?= $TicketFor ?>','<?= $h ?>','<?= $value['AirVersionId'] ?>')">Release
Ticket </a>
<?php } ?>
</td>
<!-- <td nowrap=""><?php echo $strBookingDate; ?> </td> -->
<td align="left" nowrap="">
<?php
if ($IsInternational && $TripType == 2) {
$OriginDepartureTimeOutBoundstrDate = (trim($OriginDepartureTimeOutBound['strDate']) != '') ? DateTime::createFromFormat('d M y', @$OriginDepartureTimeOutBound['strDate']) : '';
$OriginDepartureTimeInBoundstrDate = (trim($OriginDepartureTimeInBound['strDate']) != '') ? DateTime::createFromFormat('d M y', @$OriginDepartureTimeInBound['strDate']) : '';
if (!empty($OriginDepartureTimeOutBoundstrDate)) {
echo $OriginDepartureTimeOutBoundstrDate->format('d-M-y') . "<br>" . $OriginDepartureTimeOutBound['strTime'] . "<br />";
echo $OriginDepartureTimeInBoundstrDate->format('d-M-y') . "<br>" . $OriginDepartureTimeInBound['strTime'];
}
} else {
// $sourceDepartueTimestrDate = (trim($sourceDepartueTime['strDate']) != '') ? DateTime::createFromFormat('d M y', @$sourceDepartueTime['strDate']) : '';
// echo $sourceDepartueTimestrDate->format('d-M-y') . " " . $sourceDepartueTime['strTime'];
echo $strTravelDate;
}
?>
</td>
<td align="left" nowrap="">
<?php
if ($IsInternational && $TripType == 2) {
echo @$FlightNumberOutBound . "<br />" . @$FlightNumberInBound;
} else {
echo !empty(trim($strFlightNumber)) ? $strFlightNumber : 'NA';
}
?>
<br> <?php echo $AirLineTitle; ?>
</td>
<td align="left" nowrap="">
<?php echo !empty($strXRefBookingId) ? $strXRefBookingId : 'NA'; ?>
<br>Transaction ID: <?= $TrxSysId ?>
<td align="left" nowrap="">
<?php
if ($IsInternational && $TripType == 2) {
echo $SourceAirportCode . " ⇄ " . $DestAirportCode;
} elseif ($TripType == 2) {
echo $SourceAirportCode . " ⇄ " . $DestAirportCode;
} else {
echo $SourceAirportCode . " → " . $DestAirportCode;
}
?>
<br />
<?php echo !empty($value['LeadSource']) ? $value['LeadSource'] : 'NA'; ?>
<br />
<?= $Bookingtype ?>
</td>
<td align="center" nowrap=""><?php echo $currencySymbol['Symbol']; ?>
<?php echo number_format($intMyCost, 2); ?> <br>
<?php echo $currencySymbol['Symbol']; ?>
<?php echo number_format($intTotalCostToCustomer, 2); ?></td>
<td align="center" nowrap=""><?php echo $currencySymbol['Symbol']; ?>
<?php echo number_format(($intTotalCostToCustomer - $intMyCost), 2); ?>
</td>
<td width="10%"><span id="status_<?php echo $h; ?>" class="proposalStatus"><?php echo ($OnwardAutoTicket == 1) ? $customhelper->GetTravelPlanStatusName(2, $value['StatusType']) : 'Payment made-Booking Pending'; ?></span>
</td>
<td nowrap="">
<?php if ($value['IsB2BProposal'] == 1) {
echo "<i class='fa fa-building' aria-hidden='true'></i> " . trim($value['B2BAgencyName']) . '<br/>';
} ?><?php echo !empty($custFirstName) ? "<i class='fa fa-user' aria-hidden='true'></i> " . $custFirstName : ''; ?>
<?php echo !empty($custLastName) ? $custLastName : ''; ?><br>
<?php echo !empty($custEmailId) ? "<i class='fa fa-envelope' aria-hidden='true'></i> " . $customhelper->hideEmailidCharacters(trim($custEmailId), $IsMaskingOnEmailAndMobile) : ''; ?><br>
<?php
if ($IsCallCenter == 1) {
echo !empty($custContacts) ? "<a href='javascripts://' onclick='callInitiated(" . $custContacts . ")'><i class='fa fa-phone' aria-hidden='true'></i> " . $countrycode . "-" . $customhelper->hidePhoneNumberDigit(trim($custContacts), $IsMaskingOnEmailAndMobile) . '</a>' : '';
} else {
echo !empty($custContacts) ? "<a href='tel:" . $customhelper->hidePhoneNumberDigit(trim($custContacts), $IsFullMaskingEnabled) . "'><i class='fa fa-phone' aria-hidden='true'></i> " . $countrycode . "-" . $customhelper->hidePhoneNumberDigit(trim($custContacts), $IsMaskingOnEmailAndMobile) . '</a>' : '';
}
?>
</td>
<td nowrap=""><?php echo !empty($agtFirstName) ? $agtFirstName : ''; ?>
<?php echo !empty($agtLastName) ? $agtLastName : ''; ?></td>
<td nowrap=""><?php echo !empty($ownerFirstName) ? $ownerFirstName : ''; ?>
<?php echo !empty($ownerLastName) ? $ownerLastName : ''; ?></td>
<td align="left" nowrap="">
<!--<a href="<?php ///echo $this->baseUrl('/booking-flight/e-ticket/id/'.base64_encode($value['TPSysId']));
?>/version/<? ////$value['AirVersionId']
?>" target="_blank">E-Ticket</a>-->
<?php $LocalToTime = strtotime($value['returnDate']->format('Y-m-d'));
$curdate = strtotime(date('Y-m-d'));
// echo $curdate."/".$hotelFromDate;
if ($curdate > $LocalToTime) {
$allStatusDisplayArrayById = $customhelper->getDisplayStatusByStatusId($value['StatusType'], '', 'flight', 2, 21);
} else {
$allStatusDisplayArrayById = $customhelper->getDisplayStatusByStatusId($value['StatusType'], '', 'flight', 2, 21);
}
if ($PackSpecType == 4 && $EconomyMask == 7) {
$allStatusDisplayArrayById = array();
}
// echo '<pre>';
// print_r($allStatusDisplayArrayById);
// echo '</pre>';
?>
<div class="btn-group" id="flight_<?php echo $value['TPSysId']; ?>">
<button type="button" class="btn btn-danger btn-sm dropdown-toggle" data-toggle="dropdown">
Select <span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right" role="menu">
<?php //"proposalModuleComp";
if (!empty($allStatusDisplayArrayById)) {
foreach ($allStatusDisplayArrayById as $keyid => $keyval) {
switch ($keyval['ComponentType']) {
case 1:
?>
<!-- <li><a href="<?php echo $this->baseUrl('/booking-flight/view-flight-booking/id/' . base64_encode($value['TPSysId']) . '/version/' . $value['AirVersionId']); ?>" target="_blank"><?php echo $keyval['Title']; ?></a></li> -->
<?php
break;
case 3:
?>
<li><a href="javascript:void(0);" onClick="actionSendFlightProposal('<?php echo base64_encode($value['TPSysId']); ?>',<?php echo $h; ?>)"><?php echo stripslashes($keyval['Title']); ?></a>
</li>
<?php
break;
case 4:
?>
<li><a href="<?php echo $this->baseUrl('/booking-flight/view-flight-booking/id/' . base64_encode($value['TPSysId']));; ?>" target="_blank"><?php echo stripslashes($keyval['Title']); ?></a>
</li>
<?php
break;
case 5:
?>
<li><a href="javascript:void(0);" onClick="actionChangeProposalStatus('<?php echo base64_encode($value['TPSysId']); ?>',<?php echo $h; ?>,'flight_<?php echo $value['TPSysId']; ?>',<?php echo $value['MasterTPSysId']; ?>,<?php echo $value['CustomerSysId']; ?>,'<?php echo base64_encode(15); ?>')"><?php echo stripslashes($keyval['Title']); ?></a>
</li>
<?php
break;
case 6:
// $bookingCancelURL = $this->baseUrl('/booking-flight/cancel-flight-booking/id/' . base64_encode($value['TPSysId']) . '/version/' . $value['AirVersionId']);
$bookingCancelURL = $this->baseUrl('/booking-flight/amendment-itinerary/id/' . base64_encode($value['TPSysId']));
?>
<li><a target="_blank" href="<?php echo $bookingCancelURL; ?>"><?php echo stripslashes($keyval['Title']);
?></a>
</li>
<?php
break;
case 7:
?>
<li><a onClick="alert('Work in progress');"><?php echo stripslashes($keyval['Title']); ?></a>
</li>
<?php
break;
case 8:
?>
<li><a href="javascript:void(0);" onClick="actionChangeProposalStatus('<?php echo base64_encode($value['TPSysId']); ?>',<?php echo $h; ?>,'flight_<?php echo $value['TPSysId']; ?>',<?php echo $value['MasterTPSysId']; ?>,<?php echo $value['CustomerSysId']; ?>,'<?php echo base64_encode(27); ?>')"><?php echo stripslashes($keyval['Title']); ?></a>
</li>
<?php
break;
case 9:
if ($value['StatusType'] != 17) {
?>
<li><a onclick="updatePayment('<?php echo $value['TPSysId']; ?>', '<?php echo $value['NetPrice']; ?>', '<?php echo $TotalAmountPaid; ?>');"><?php echo stripslashes($value['Title']); ?></a>
</li>
<?php
}
break;
case 11:
if (($IsNewMigration != 2 && $IsNewMigration != 3) && ($ICSourceSysId == 7 || $ICSourceSysId == 8 || $ICSourceSysId == 9 || $ICSourceSysId == 22 || $ICSourceSysId == 23 || $ICSourceSysId == 24 || $ICSourceSysId == 25)) {
// $link = $this->baseUrl('/booking-flight/customer-invoicetj/id/' . base64_encode($value['TPSysId']) . '/version/' . $value['AirVersionId']);
$link = $this->baseUrl('/booking-flight/customer-invoicetj/id/' . base64_encode($value['TPSysId']));
} elseif ($ICSourceSysId == 11 || $ICSourceSysId == 10 || $ICSourceSysId == 12 || $ICSourceSysId == 13 || $ICSourceSysId == 14 || ($IsNewMigration == 2 || $IsNewMigration == 3)) {
$link = $this->baseUrl('/booking-flight/invoice-new/id/' . base64_encode($value['TPSysId']));
} else {
$link = $this->baseUrl('/booking-flight/customer-invoice/id/' . base64_encode($value['TPSysId']) . '/version/' . $value['AirVersionId']);
}
//$link = $this->baseUrl('/booking-flight/customer-invoice/id/' . base64_encode($value['TPSysId']) . '/version/' . $value['AirVersionId']);
?>
<?php if ($value['XRefPNR'] == '1') { ?>
<li><a href="<?php echo $link; ?>" target="_blank"><?php echo stripslashes($keyval['Title']); ?></a>
</li>
<?php } ?>
<?php
break;
case 12:
if (($IsNewMigration != 2 && $IsNewMigration != 3) && ($ICSourceSysId == 7 || $ICSourceSysId == 8 || $ICSourceSysId == 9 || $ICSourceSysId == 22 || $ICSourceSysId == 23 || $ICSourceSysId == 24 || $ICSourceSysId == 24 || $ICSourceSysId == 25)) {
// $link = $this->baseUrl('/booking-flight/e-tickettj/id/' . base64_encode($value['TPSysId']) . '/version/' . $value['AirVersionId']);
$link = $this->baseUrl('/booking-flight/e-ticket-new/id/' . base64_encode($value['TPSysId']));
} elseif ($ICSourceSysId == 11 || $ICSourceSysId == 10 || $ICSourceSysId == 12 || $ICSourceSysId == 13 || $ICSourceSysId == 14 || ($IsNewMigration == 2 || $IsNewMigration == 3)) {
$link = $this->baseUrl('/booking-flight/e-ticket-mail/id/' . base64_encode($value['TPSysId']));
} else {
$link = $this->baseUrl('/booking-flight/e-ticket/id/' . base64_encode($value['TPSysId']) . '/version/' . $value['AirVersionId']);
}
if ($value['IsQuickProposal'] == 0 && $value['XRefPNR'] == '1' && $OnwardAutoTicket == 1) {
?>
<li><a href="<?php echo $link; ?>" target="_blank"><?php echo stripslashes($keyval['Title']); ?></a>
</li>
<?php
}
break;
}
?>
<?php
} ?>
<?php
if ($ICSourceSysId == 8) {
if ($IsNewMigration == 3) {
$link = $this->baseUrl('/flight-new/update-ticket/id/' . base64_encode($value['TPSysId']));
} else {
$link = $this->baseUrl('/booking-flight/update-e-tickettj/id/' . base64_encode($value['TPSysId']));
}
?>
<li><a href="<?php echo $link; ?>" target="_blank">Update
Ticket</a></li>
<?php }
}
?>
<?php
if ($ICSourceSysId == '') {
$link = $this->baseUrl('/booking-flight/offline-flight-book/id/' . base64_encode($value['TPSysId'])); ?>
<li><a href="<?php echo $link; ?>" target="_blank">Create
Ticket</a></li>
<?php } ?>
</ul>
</div>
</td>
</tr>
<?php $h++;
}
} else { ?>
<tr class="alert alert-warning small">
<td colspan="12" align="center">No records available!</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="panel-box clearfix">
<?php if (!empty($this->arrFlightBookingList)) {
$IsSubmitForm = (isset($this->searchArr) && !empty($this->searchArr)) ? true : false; ?>
<?php echo $this->paginationControl($this->arrFlightBookingList, 'Sliding', 'pagination-form.phtml', array('IsSubmitForm' => $IsSubmitForm, 'FormName' => 'BookingFilterForm')); ?>
<?php } ?>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
<!-- Main Content Element End-->
</div>
</div>
<div class="modal fade" id="updatePNRModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false">
<div class="modal-dialog " role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" style="color:#fff; font-size: 18px;">Updating PNR <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></h4>
</div>
<div class="modal-body">
<div class="">
<div id="updatePNRLoad"></div>
<form id="ConfirmedForm" style="display:none;">
<div class="col-md-6">
<div class="form-group active">
<label for="bookingIds" class="col-form-label">Booking ID:</label>
<input type="text" class="form-control" id="bookingIds" value="">
</div>
</div>
<div class="col-md-6">
<div class="form-group active">
<label for="Newpnrnumber" class="col-form-label">Enter PNR Number:</label>
<input type="text" class="form-control" id="Newpnrnumber" value="">
</div>
</div>
<div style="padding: 10px 0px;font-weight: 700;">Flight Details</div>
<div style="padding: 10px 0px;" id="bodyTextView"></div>
<button type="button" class="btn btn-primary" onclick="ConfirmedTicket();">Confirm</button>
<button type="button" class="btn btn-primary" onclick="EditTicket();">Edit &
Confirm</button>
</form>
</div>
</div> <!-- modal-body -->
</div> <!-- modal-content -->
</div> <!-- modal-dialog -->
</div>
<?php echo $this->render('copyrightfooter.phtml'); ?>
</section>
<input name="intTPSysId_get" id="intTPSysId_get" value="" type="hidden">
<input name="TPIntSysId_get" id="TPIntSysId_get" value="" type="hidden">
</section>
<script type="text/javascript">
$(document).ready(function() {
$('#booking_date').datetimepicker({
format: 'd-m-Y',
timepicker: false,
maxDate: 0
});
});
$(document).ready(function() {
$('#checkIn_date').datetimepicker({
format: 'd-m-Y',
timepicker: false,
//maxDate: 0
});
});
</script>
<script type="text/javascript" src="<?php echo $this->baseUrl('public/assets/js/customer.js'); ?>"></script>
<?php include_once 'application/views/scripts/newfooter.phtml'; ?>
<script src="<?php echo $this->baseUrl('public/assets/js/bootstrap3-typeahead.js'); ?>"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl('public/assets/js/jquery.validate.min.js'); ?>">
</script>
<script type="text/javascript" src="<?php echo $this->baseUrl('public/js/buyhotel/buyhotellist.js'); ?>"></script>
<script>
function validateFilter() {
var customername = $.trim($("#customername").val());
var customeremail = $.trim($("#customeremail").val());
var customermobile = $.trim($("#customermobile").val());
var leadType = $.trim($("#leadType").val());
var lead_stage = $.trim($("#lead_stage").val());
var hidden_typeahead_cityid = $.trim($(".hidden_typeahead_cityid").val());
if (customername == '' && customeremail == '' && customermobile == '' && leadType == '' && lead_stage == '' &&
hidden_typeahead_cityid == '') {
alert('Please fill at least one field');
return false;
}
}
function ReleaseTicket(TraceId, BookingId, PNR, intTPSysId, TicketFor, IsReturn, index, AirVersionId) {
// console.log(TraceId);
// console.log(BookingId);
// console.log(PNR);
// console.log(intTPSysId);
// console.log(TicketFor);
// console.log(IsReturn);
//return false;
$.ajax({
url: '/flight/generate-non-lcc-ticket',
data: {
TraceId: TraceId,
BookingId: BookingId,
PNR: PNR,
TPSysId: intTPSysId,
TicketFor: TicketFor,
CustomerEmailId: '',
IsReturn: IsReturn,
AirVersionId: AirVersionId
},
type: 'POST',
dataType: 'json',
beforeSend: function() {
$("#generateTicket_" + TicketFor).hide();
$("#Inprocess_" + index).show();
$("#hidelink_" + index).hide();
},
success: function(response) {
//console.log(response);
if (response.success) {
alert(response.msg);
window.location.href = 'booking-flight';
} else {
alert(response.msg);
window.location.href = 'booking-flight';
}
}
});
}
// $('#TrDate').datetimepicker({
// timepicker: false,
// datepicker: true,
// mask: false,
// formatDate: 'd-m-Y',
// format: 'd-m-Y',
// });
// $('#TrDate1').datetimepicker({
// timepicker: false,
// datepicker: true,
// mask: false,
// formatDate: 'd-m-Y',
// format: 'd-m-Y',
// });
$('#TrFromDate').datetimepicker({
timepicker: false,
datepicker: true,
scrollMonth: false,
scrollInput: false,
mask: true,
autoclose: true,
//minDate:0,
formatDate: 'd-m-Y',
format: 'd-m-Y',
onChangeDateTime: function(d) {
$('#TrToDate').focus();
$('#TrToDate').datetimepicker({
maxDate: getFormattedDate(d),
value: getFormattedDate2(d),
});
},
});
var today = new Date();
$('#TrToDate').datetimepicker({
scrollMonth: false,
scrollInput: false,
timepicker: false,
datepicker: true,
mask: true,
autoclose: true,
formatDate: 'd-m-Y',
format: 'd-m-Y',
onChangeDateTime: function() {
var CurrentDate = new Date();
console.log(CurrentDate);
CurrentDate.setMonth(CurrentDate.getMonth() + 3);
console.log("Date after " + 3 + " months:", CurrentDate);
},
onShow: function(d) {
this.setOptions({
minDate: $('#TrFromDate').val(),
// maxDate: '21/03/2020',
});
}
});
function get_b2bagentname_autosuggest(inputId, hiddenInputId, AgencySysId) {
$('#' + hiddenInputId).val('');
$('#hidden_b2bagency_agencysysid').val('');
$('#' + inputId).typeahead({
items: 'all',
source: function(query, process) {
$('#' + hiddenInputId).val('');
var AgencySysId = $("#b2b_AgencySysId").val();
return $.ajax({
//url: '/general/suggest-city',
url: '/staff/autosuggest-b2b-agent-name',
type: 'post',
async: true,
data: {
query: query,
AgencySysId: AgencySysId
},
dataType: 'json',
success: function(result) {
var resultList = result.map(function(item) {
var aItem = {
Salutation: item.Salutation,
FirstName: item.FirstName,
LastName: item.LastName,
EmailId: item.EmailId,
ContactNo1: item.ContactNo1,
UserSysId: item.UserSysId,
AgencySysId: item.AgencySysId,
label: item.label,
AgencyName: item.AgencyName,
CountryName: item.CountryName,
CountrySysId: item.CountrySysId,
CityName: item.CityName,
CitySysId: item.CitySysId,
StateName: item.StateName,
StateOrZoneSysId: item.StateOrZoneSysId,
Address: item.Address,
PinCode: item.PinCode
};
return JSON.stringify(aItem);
});
return process(resultList);
}
});
},
sorter: function(items) {
var beginswith = [],
caseSensitive = [],
caseInsensitive = [],
item;
while (aItem = items.shift()) {
var item = JSON.parse(aItem);
if (!item.label.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(JSON
.stringify(item));
else if (~item.label.indexOf(this.query)) caseSensitive.push(JSON.stringify(item));
else caseInsensitive.push(JSON.stringify(item));
}
return beginswith.concat(caseSensitive, caseInsensitive)
},
highlighter: function(obj) {
var item = JSON.parse(obj);
var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&');
return item.label.replace(new RegExp('(' + query + ')', 'ig'), function($1, match) {
return '<strong>' + match + '</strong>'
})
},
updater: function(item) {
var item = JSON.parse(item);
$('#' + hiddenInputId).val(item.UserSysId);
$('#hidden_b2bagency_agencysysid').val(item.AgencySysId);
$('#b2bagent_firstname').val(item.FirstName).focus();
$('#b2bagent_salutation').val(item.Salutation).focus();
$('#b2bagent_lastname').val(item.LastName).focus();
$('#b2bagent_mobilenum').val(item.ContactNo1).focus();
$('#b2bagency_emailid').val(item.EmailId).focus();
$('#b2bagent_city').val(item.CityName).focus();
$('#b2bagent_city_id').val(item.CitySysId).focus();
$('#b2bagent_country').val(item.CountryName).focus();
$('#b2bagent_country_id').val(item.CountrySysId).focus();
$('#b2bagent_state').val(item.StateName).focus();
$('#b2bagent_state_id').val(item.StateOrZoneSysId).focus();
$('#b2bagent_postal').val(item.PinCode).focus();
$('#b2bagent_address').val(item.Address).focus();
return item.AgencyName;
},
minLength: 2,
// displayField: 'Title',
}).focus();
}
function ExportExcelForm() {
$(".ExportExcelForm").submit();
}
function EditTicket() {
var intTPSysId = $('#intTPSysId_get').val();
var indexonway = $('#indexonway').val();
var indexround = $('#indexround').val();
url = '/booking-flight/offline-flight-book/id/' + intTPSysId + '/index/' + indexonway;
if (indexround) {
url = '/booking-flight/offline-flight-book/id/' + intTPSysId + '/index/' + indexonway + '/indexround/' +
indexround;
}
window.open(url, '_blank');
}
function ConfirmedTicket() {
var intTPSysId = $('#intTPSysId_get').val();
var TPIntSysId = $('#TPIntSysId_get').val();
var bookingIds = $('#bookingIds').val();
var Newpnrnumber = $('#Newpnrnumber').val();
$.ajax({
url: "/flight/updatepnr",
data: {
id: intTPSysId,
TPIntSysId: TPIntSysId,
bookingIds: bookingIds,
Newpnrnumber: Newpnrnumber,
ConfirmTicket: true
},
dataType: 'json',
type: 'POST',
beforeSend: function() {
$('#updatePNRLoad').show();
$("#updatePNRLoad").html(
'<div style="text-align:center;padding-top:30px;"><img src="/public/images/load1.gif"/><br> Please wait updating pnr....</div>'
);
},
success: function(data) {
var LeadSourceSysId = data.LeadSourceSysId;
if (data.success) {
alert(data.message);
window.location.href = '/booking-flight';
} else {
$('#updatePNRLoad').hide();
alert(data.message);
}
}
});
}
$(document).on('click', '.updatepnr', function() {
var intTPSysId = $(this).attr('id');
var TPIntSysId = $(this).attr('TPIntSysId');
var icsourcesysid = $(this).attr('icsourcesysid');
if (icsourcesysid == 7) {
var ReqUrl = '/flight/updatepnrapi';
} else {
var ReqUrl = '/flight/updatepnrapi';
}
$('#intTPSysId_get').val(intTPSysId);
$('#TPIntSysId_get').val(TPIntSysId);
$('#ConfirmedForm').hide();
$('#updatePNRLoad').show();
$('#updatePNRModal').modal('show');
$.ajax({
type: "POST",
url: ReqUrl, //"/flight/updatepnrapi",
dataType: 'json',
data: {
id: intTPSysId,
TPIntSysId: TPIntSysId,
},
beforeSend: function() {
$("#updatePNRLoad").html(
'<div style="text-align:center;padding-top:30px;"><img src="/public/images/load1.gif"/><br> Please wait updating pnr....</div>'
);
},
success: function(data) {
var LeadSourceSysId = data.LeadSourceSysId;
if (data.success) {
if (LeadSourceSysId == 24 || LeadSourceSysId == 'Agency-Proposal') {
$('#updatePNRLoad').hide();
$('#ConfirmedForm').show();
$('#bookingIds').val(data.booking_ids);
$('#bodyTextView').html(data.bodyText);
} else {
$('#ConfirmedForm').hide();
alert(data.message);
window.location.href = '/booking-flight';
}
} else {
$('#ConfirmedForm').hide();
alert(data.message);
window.location.href = '/booking-flight/queue';
}
}
});
});
</script>
<!--<script src="<?php /*echo $this->baseUrl('public/assets/js/bootstrap3-typeahead.js'); */ ?>"></script>
<script>
$(document).ready(function(){ updatepnr
$('.table-responsive').doubleScroll();
});
</script>-->
<div class="modal fade" id="update-payment" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Update Payment</h4>
</div>
<div class="modal-body">
<div class="col-md-12 no-padding">
<div class="col-md-7">
<input class="icheck-black1111" type="radio" checked="checked" name="payment_type" id="payment_type_online" value="1">
<label for="payment_type_online" class="leftsidearea">Online (Send Payment
Reminder)</label>
</div>
<div class="col-md-5">
<input class="icheck-black1111" type="radio" name="payment_type" id="payment_type_offline" value="2">
<label for="payment_type_offline" class="leftsidearea">Offline</label>
</div>
</div>
<div class="clear"> </div>
<div class="col-md-12 no-padding" id="payment_table_online">
<div class="col-md-8">
<table class="table tablestyle">
<tbody>
<tr>
<td><label class="radio no-margin inlinebl"> Package Cost </label> <span style="text-align:center; font-size: 12px;">(Inc. GST)</span></td>
<td align="right"><span class="CurrencyHtml"></span> <span id="pkgCostOnline"></span>
</td>
</tr>
<tr>
<td><label class="radio no-margin inlinebl"> Amount Received </label></td>
<td align="right"><span class="CurrencyHtml"></span> <span id="amountPaidOnline"></span></td>
</tr>
<tr>
<td><strong>OutStanding Bal.</strong><br></td>
<td align="right"><span class="CurrencyHtml"></span> <span class="outStandingBalOnline"></span></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-md-12 no-padding" id="payment_table_offline" style="display:none;">
<div class="col-md-12">
<table class="table tablestyle ">
<tbody>
<tr>
<td><label class="radio no-margin inlinebl"> Package Cost </label> <span style="text-align:center; font-size: 12px;">(Inc. GST)</span></td>
<td align="right"><span class="CurrencyHtml"></span> <span id="pkgCost"></span>
</td>
</tr>
<tr>
<td><label class="radio no-margin inlinebl"> Amount Received </label></td>
<td align="right"><span class="CurrencyHtml"></span> <span id="amountPaid"></span>
</td>
</tr>
<tr>
<td>
<input type="radio" name="bookingPayment" id="fullPayment" value="" class="icheck-black1" checked="" />
<label for="fullPayment" class="leftsidearea">Full Payment</label>
</td>
<td align="right"><span class="CurrencyHtml"></span> <span id="remainingBalance"></span></td>
</tr>
<tr>
<td>
<input type="radio" name="bookingPayment" id="flexiblePayment" value="" class="icheck-black1" />
<label for="flexiblePayment" class="leftsidearea">Flexible Payment</label>
</td>
<td class="pull-right" style="border:0px;">
<span class="CurrencyHtml pull-left"></span>
<input type="text" name="flex_pay" id="flex_pay" value="" class="form-control whbg" style="text-align:right; width: 120px">
</td>
</tr>
<tr>
<td><strong>Outstanding Amount</strong><br></td>
<td align="right"><span class="CurrencyHtml"></span> <span class="outStandingBal"></span></td>
</tr>
</tbody>
<form id="form_repayment" method="post" name="form_repayment" action="">
<input name="paymentType" id="paymentType" value="1" type="hidden">
<input name="guid" id="guid_repayment" value="" type="hidden">
<input name="securecode" id="securecode_repayment" value="" type="hidden">
<input name="Firstname" id="Firstname" value="" type="hidden">
<input name="email" id="email" value="" type="hidden">
<input name="phone" id="phone" value="" type="hidden">
<input id="premium_val" name="amount" value="" type="hidden">
<input name="AgencyUserSysId" id="AgencyUserSysId" value="" type="hidden">
<input name="AgencySysId" id="AgencySysId" value="" type="hidden">
<input name="TrxType" id="TrxType" value="" type="hidden">
<input name="PlanType" id="PlanType" value="5" type="hidden">
<input name="TPSysId" id="TPSysId" value="" type="hidden">
<input name="IsCardChrgToCustomer" id="IsCardChrgToCustomer" value="" type="hidden">
<input name="CustomerSysId" id="CustomerSysId" value="" type="hidden">
<input name="returnURL" id="returnURL" value="" type="hidden">
<input name="stringData" id="stringData" value="" type="hidden">
<input name="errorURL" id="errorURL" value="" type="hidden">
</form>
</table>
</div>
</div>
<div class="col-md-12 no-padding">
<div class="form-group form-group1 flexipadding pull-right" id="offline-buttons">
<button onclick="closeModal();" class="btn btn-primarygray" type="button">Cancel</button>
<button class="btn btn-primary" onclick="offlinePaymentProcess();" type="submit"><i class="fa fa-search"></i> Submit</button>
</div>
<div class="form-group form-group1 flexipadding" id="offline-buttons-inprocess" style="display:none;">
<img src="<?php echo $this->baseUrl('public/assets/images/loader.gif'); ?>"> Please Wait...
</div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
</body>
</html>