| 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/default/ |
Upload File : |
<?php
$param = $this->param;
$CurrencyRate = $this->CurrencyRate;
$CurrencyTitle = $this->CurrencyTitle;
$Data = $FlightBookingData = $this->Data;
$DataInbound = $this->DataInbound;
$BaggageInb = $DataInbound['Segments'][0];
$arrFlightClass = Zend_Controller_Action_HelperBroker::getStaticHelper('Flight')->getFlightClasses();
$intOtherCharges = $Data['FairRules']['OtherCharges'];
$intOtherChargesInb = isset($DataInbound['FairRules']['OtherCharges']) ? $DataInbound['FairRules']['OtherCharges'] : 0;
$intBaseFare = $Data['FairRules']['BaseFare'];
$intTax = $Data['FairRules']['Tax'];
$intAdditionalTxnFeePub = $Data['FairRules']['AdditionalTxnFeePub'];
$intServiceFee = $Data['FairRules']['ServiceFee'];
$intServiceFeeInb = isset($DataInbound['FairRules']['ServiceFee']) ? $DataInbound['FairRules']['ServiceFee'] : 0;
$intPublishedFare = $Data['FairRules']['PublishedFare'];
$intPublishedFareInb = isset($DataInbound['FairRules']['PublishedFare']) ? $DataInbound['FairRules']['PublishedFare'] : 0;
$intFarePerHeadPublish = $intBaseFare + $intTax + $intOtherCharges;
$intNetPublishedFare = 0;
$AdditionalTxnFeePub = 0;
$TotalBaseFare = 0;
$AdditionalTxnFeePubR = 0;
$TotalTaxsandFees = 0;
if ($FlightBookingData) {
foreach ($FlightBookingData as $Data) {
$couponApply = isset($Data['FairRules']['couponApply']) ? $Data['FairRules']['couponApply'] : 0;
$couponVal = (float) isset($Data['FairRules']['couponVal']) ? $Data['FairRules']['couponVal'] : 0;
$TotalcouponVal += $couponVal;
$couponName = isset($Data['FairRules']['couponName']) ? $Data['FairRules']['couponName'] : 0;
$ICSourceSysId = $Data['ICSourceSysId'];
$intNetPublishedFare += $Data['FairRules']['intPublishedFare'];
if ($Data['FairRules']['FareBreakdown']) {
foreach ($Data['FairRules']['FareBreakdown'] as $value) {
//echo '<pre>';print_r($value);echo '</pre>';
$TDS = $value['TDS']; //Management Fee
$MF = $value['MF']; //Management Fee
$YQ = $value['YQ']; //Fuel Surcharge
$AGST = $value['AGST']; //Airline GST Component
$MFT = $value['MFT']; //Management Fee Tax
$OT = $value['OT']; //Other Charges
$YR = $value['YR'];
$other = $MF + $YQ + $AGST + $MFT + $OT + $YR;
if ($ICSourceSysId == 3) {
$other = $MF + $AGST + $MFT + $OT + $YR;
}
$PBaseFare = $value['BaseFare'];
$intTotalGST = $value['intTotalGST'];
$FixedMarkUp = $value['FixedMarkUp'];
$apiMarkup = isset($value['apiMarkup']) ? $value['apiMarkup'] : 0;
$IntCommission = $value['IntCommission'];
$CommissionEarned = $value['CommissionEarned'];
$GSTOnMarkUp = isset($value['GSTOnMarkUp']) ? $value['GSTOnMarkUp'] : 0;
$CommisionPass = isset($value['CommisionPass']) ? $value['CommisionPass'] : 0;
$OtherCharges_ = isset($value['OtherCharges']) ? $value['OtherCharges'] : 0;
$ServiceFee = isset($value['ServiceFee']) ? $value['ServiceFee'] : 0;
$paxPublishedFare = ($PBaseFare);
$PassengerType = $value['PassengerType'];
$PassengerCount = $value['PassengerCount'];
$AdditionalTxnFeePub += $value['AdditionalTxnFeePub'];
$TaxesFees = ($other + $intTotalGST + $FixedMarkUp + $apiMarkup + $IntCommission - $CommissionEarned);
if ($ICSourceSysId == 3) {
$TaxesFees = ($other + $intTotalGST + $FixedMarkUp + $apiMarkup + $ServiceFee - $CommisionPass);
}
$TotalBaseFare += ($paxPublishedFare);
$TotalTaxsandFees += ($TaxesFees);
}
}
}
}
$sessionFlightSearchParams = new Zend_Session_Namespace('sessionFlightSearchParams');
$interNationalSearch = $sessionFlightSearchParams->params['interNationalSearch'];
$route = $sessionFlightSearchParams->params['route'];
$SelectedMealSessionNew = new Zend_Session_Namespace('SelectedMealSessionNew');
$SelectedBaggSessionNew = new Zend_Session_Namespace('SelectedBaggSessionNew');
$SelectedMealSessionNewInb = new Zend_Session_Namespace('SelectedMealSessionNewInb');
$SelectedBaggSessionNewInb = new Zend_Session_Namespace('SelectedBaggSessionNewInb');
$selectedSeatSession = new Zend_Session_Namespace('selectedSeatSession');
$BagPrice = 0;
$InbBagPrice = 0;
$MealPrice = 0;
$InbMealPrice = 0;
$SeatPrice = 0;
if ($SelectedBaggSessionNew->params) {
foreach ($SelectedBaggSessionNew->params as $val) {
$BagPrice += $val['Price'];
}
}
if ($SelectedMealSessionNew->params) {
foreach ($SelectedMealSessionNew->params as $val) {
$MealPrice += $val['Price'];
}
}
if ($SelectedMealSessionNewInb->params) {
foreach ($SelectedMealSessionNewInb->params as $val) {
$InbMealPrice += $val['Price'];
}
}
if ($SelectedBaggSessionNewInb->params) {
foreach ($SelectedBaggSessionNewInb->params as $val) {
$InbBagPrice += $val['Price'];
}
}
if ($selectedSeatSession->params) {
foreach ($selectedSeatSession->params as $values) {
foreach ($values as $val) {
$SeatPrice += $val['amount'];
}
}
}
$MealFare = ($MealPrice + $InbMealPrice);
$BaggFare = ($BagPrice + $InbBagPrice);
$CencelattionData = (isset($this->CencelattionData)) ? $this->CencelattionData : 0;
$CPPercentVal = (isset($this->CPPercentVal)) ? $this->CPPercentVal : 0;
$totalPayableAmount = ($TotalBaseFare + $TotalTaxsandFees + $MealFare + $BaggFare + $SeatPrice);
$CPAmountWithTax = 0;
$CPAmount = 0;
if ($CencelattionData == 1 && !empty($CPPercentVal)) {
$CPAmount = ($totalPayableAmount * $CPPercentVal) / 100;
$CPAmountWithTax = $CPAmount + ($CPAmount * 18 / 100);
}
//print_r($TotalBaseFareR+$AdditionalTxnFeePubR);die('sssssssssss');
?>
<input type="hidden" id="IsCancellationProtection" value="<?php echo $CencelattionData; ?>">
<input type="hidden" id="CPAmountWithTax" value="<?php echo ceil($CPAmountWithTax); ?>">
<div>
<ul>
<li> Base Fare <img id="BaseFarePOPBreackUp" src="<?= $baseUrl ?>public/images/grey_info.svg" style="float:none;" /><span class="price_fair"><?= $CurrencyTitle ?> <?= number_format(($TotalBaseFare * $CurrencyRate), 2) ?></span></li>
<li> Taxes and fees <img id="FeeSurchargeBreakUp" src="<?= $baseUrl ?>public/images/grey_info.svg" style="float:none;" /><span class="price_fair"><?= $CurrencyTitle ?> <?= number_format(($TotalTaxsandFees * $CurrencyRate), 2) ?></span></li>
<?php if ($MealFare > 0) { ?>
<li> Meal Charges <span class="price_fair"><?= $CurrencyTitle ?> <?= number_format(($MealFare * $CurrencyRate), 2) ?></span></li>
<?php } ?>
<?php if ($BaggFare > 0) { ?>
<li> Baggage Charges <span class="price_fair"><?= $CurrencyTitle ?> <?= number_format(($BaggFare * $CurrencyRate), 2) ?></span></li>
<?php } ?>
<?php if ($SeatPrice > 0) { ?>
<li> Seat Charges <span class="price_fair"><?= $CurrencyTitle ?> <?= number_format(($SeatPrice * $CurrencyRate), 2) ?></span></li>
<?php } ?>
<?php if ($CencelattionData == 1) { ?>
<li class="cancellation_protection_summery"> Refund Upgrade <span class="price_fair"><?= $CurrencyTitle ?> <?= number_format(($CPAmountWithTax), 2) ?></span></li>
<?php } ?>
<li> <span class="you_pay">Total <span class="price_fair_total"><?= $CurrencyTitle ?> <span class=""><?= number_format(ceil(($TotalBaseFare + $TotalTaxsandFees + $MealFare + $BaggFare + $SeatPrice) * $CurrencyRate), 2) ?></span></span>
<span class="conversation_box"> </span>
</li>
<?php if ($TotalcouponVal > 0) { ?>
<li> Coupon :
<span class="price_fair"><?= $CurrencyTitle ?> <?= number_format(($TotalcouponVal * $CurrencyRate), 2) ?></span>
</li>
<?php } ?>
<?php if ($CencelattionData == 1) { ?>
<li> <span class="you_pay">You Pay <span class="price_fair_total"><?= $CurrencyTitle ?> <span class="price_fair_total_html"><?= number_format(ceil(($TotalBaseFare + $TotalTaxsandFees + $MealFare + $BaggFare + $SeatPrice + $CPAmountWithTax) * $CurrencyRate), 2) ?></span></span>
<span class="conversation_box"> </span>
</li>
<?php } else { ?>
<li> <span class="you_pay">You Pay <span class="price_fair_total"><?= $CurrencyTitle ?> <span class="price_fair_total_html"><?= number_format(ceil(($TotalBaseFare + $TotalTaxsandFees + $MealFare + $BaggFare + $SeatPrice + $CPAmountWithTax - $TotalcouponVal) * $CurrencyRate), 2) ?></span></span>
<span class="conversation_box"> </span>
</li>
<?php } ?>
</ul>
<input type="hidden" readonly class="price_fair_total_hidden" value="<?= ceil((($TotalBaseFare + $TotalTaxsandFees + $MealFare + $BaggFare + $SeatPrice - $TotalcouponVal) * $CurrencyRate)) ?>">
<input type="hidden" class="price_price" value="0">
</div>
<style>
.ToolTips table tr td {
padding: 3px 6px;
;
}
</style>
<div id="BaseFareBreackUp" class="ToolTips" style="display: none;">
<table style="width: 100%;">
<tr>
<td height="35" class="cancellation_text"><strong>Type</strong></td>
<td height="35" class="cancellation_text"><strong>Fare</strong></td>
<td height="35" class="cancellation_text"><strong>Total</strong></td>
</tr>
<?php
$TotalBaseFare = 0;
$TotalTaxsandFees = 0;
$Total_AGST = 0;
$Total_MF = 0;
$Total_YQ = 0;
$Total_MFT = 0;
$Total_OT = 0;
$Total_MU = 0;
$Total_YR = 0;
$Total_FixedMarkUp = 0;
$Total_GSTOnMarkUp = 0;
$Total_CommEarned = 0;
if ($FlightBookingData) {
foreach ($FlightBookingData as $Data) {
$intNetPublishedFare += $Data['FairRules']['intPublishedFare'];
$Currency = $Data['FairRules']['Currency'];
//$CurrencyRate = $Data['FairRules']['CurrencyRate'];
if ($Data['FairRules']['FareBreakdown']) {
foreach ($Data['FairRules']['FareBreakdown'] as $key => $value) {
if ($key == 0) {
echo '<tr><td colspan="3">' . $Data['SourceAirportCode'] . ' - ' . $Data['DestAirportCode'] . '</td></tr>';
}
$TDS = $value['TDS']; //Management Fee
$MF = $value['MF']; //Management Fee
$YQ = $value['YQ']; //Fuel Surcharge
$AGST = $value['AGST']; //Airline GST Component
$MFT = $value['MFT']; //Management Fee Tax
$OT = $value['OT']; //Other Charges
$MU = $value['MU']; //Markup
$YR = $value['YR']; //Carrier Misc Fee
$other = $MF + $YQ + $AGST + $MFT + $OT + $YR;
//echo '<pre>';print_r($value);echo '</pre>';
$PBaseFare = $value['BaseFare'];
$FixedMarkUp = $value['FixedMarkUp'];
$GSTOnMarkUp = $value['GSTOnMarkUp'];
$intTotalGST = $value['intTotalGST'];
$IntCommission = $value['IntCommission'];
$CommissionEarned = $value['CommissionEarned'];
$apiMarkup = $value['apiMarkup'];
$paxPublishedFare = ($PBaseFare);
$PassengerType = $value['PassengerType'];
$PassengerCount = $value['PassengerCount'];
$BaseFare = ($value['BaseFare'] / $PassengerCount);
// $TaxesFees = ($MF + $YQ + $AGST + $MFT + $OT + $MU + $YR + $FixedMarkUp + $GSTOnMarkUp);
$TaxesFees = ($other + $intTotalGST + $FixedMarkUp + $apiMarkup + $IntCommission - $CommissionEarned);
$Total_AGST += $AGST;
$Total_MF += $MF;
$Total_YQ += $YQ;
$Total_MFT += $MFT;
$Total_OT += $OT;
$Total_MU += $MU;
$Total_YR += $YR;
$Total_FixedMarkUp += $FixedMarkUp + $apiMarkup;
$Total_GSTOnMarkUp += $intTotalGST;
$CommissionEarnedsdfsd += $CommissionEarned;
$Total_CommEarned += $IntCommission;
$NetCommEarned = ($IntCommission);
$AdditionalTxnFeePub += $value['AdditionalTxnFeePub'];
$TotalBaseFare += $paxPublishedFare;
// $TotalTaxsandFees += ($MF + $YQ + $AGST + $MFT + $OT + $MU + $YR + $FixedMarkUp + $GSTOnMarkUp);
$TotalTaxsandFees += ($FixedMarkUp + $apiMarkup + $intTotalGST + $other + $NetCommEarned);
if ($PassengerType == 1) {
$paxType = 'Adult';
} elseif ($PassengerType == 2) {
$paxType = 'Child';
} elseif ($PassengerType == 3) {
$paxType = 'Infant';
}
?>
<tr>
<td class="cancellation_text2"><?= $paxType ?></td>
<td class="cancellation_text2"><?= $Currency ?> <?= number_format(($BaseFare * $CurrencyRate), 2) ?> x <?= $PassengerCount ?></td>
<td class="cancellation_text2"><?= $Currency ?> <?= number_format((($PBaseFare) * $CurrencyRate), 2) ?></td>
</tr>
<?php
}
}
}
}
?>
<tr>
<td height="35" class="cancellation_text" style="font-size: 12px; font-weight:bold;">Total Amount</td>
<td height="35" class="cancellation_text" style="font-size: 12px; font-weight:bold;"><?= $CurrencyTitle ?> <?= number_format(($TotalBaseFare * $CurrencyRate), 2) ?></td>
<td height="35" class="cancellation_text" style="font-size: 12px; font-weight:bold;"><?= $CurrencyTitle ?> <?= number_format(ceil(($TotalBaseFare) * $CurrencyRate), 2) ?></td>
</tr>
</table>
</div>
<div id="FeeSurcharge" class="ToolTips" style="display: none;">
<table style="width: 100%;">
<tr>
<td height="35" class="cancellation_text"><strong>Type</strong></td>
<td height="35" class="cancellation_text"><strong>Fare</strong></td>
</tr>
<tr>
<td class="cancellation_text2">Airline GST</td>
<td class="cancellation_text2"><?= $CurrencyTitle ?> <?= number_format(($Total_AGST * $CurrencyRate), 2) ?></td>
</tr>
<!-- <tr>
<td class="cancellation_text">Management Fee</td>
<td class="cancellation_text"><?= $CurrencyTitle ?> <?= number_format(($Total_MF * $CurrencyRate), 2) ?></td>
</tr> -->
<tr>
<td class="cancellation_text">Fuel Surcharge</td>
<td class="cancellation_text"><?= $CurrencyTitle ?> <?= number_format(($Total_YQ * $CurrencyRate), 2) ?></td>
</tr>
<tr>
<td class="cancellation_text">Other Taxes</td>
<td class="cancellation_text">
<?= $CurrencyTitle ?>
<?= number_format(((($Total_MF + $Total_MFT + $Total_OT + $Total_YR) + $Total_CommEarned - $CommissionEarnedsdfsd) * $CurrencyRate), 2) ?>
</td>
</tr>
<tr>
<td class="cancellation_text">Service Fee</td>
<td class="cancellation_text"><?= $CurrencyTitle ?> <?= number_format(($Total_FixedMarkUp * $CurrencyRate), 2) ?></td>
</tr>
<tr>
<td class="cancellation_text">GST</td>
<td class="cancellation_text"><?= $CurrencyTitle ?> <?= number_format(($Total_GSTOnMarkUp * $CurrencyRate), 2) ?></td>
</tr>
<tr>
<td class="cancellation_text" style="font-size: 12px; font-weight:bold;">Total</td>
<td class="cancellation_text" style="font-size: 12px; font-weight:bold;"><?= $CurrencyTitle ?> <?= number_format(ceil(($Total_AGST + $Total_YQ + $Total_FixedMarkUp + $Total_GSTOnMarkUp + $Total_MF + $Total_MFT + $Total_OT + $Total_YR + $Total_CommEarned - $CommissionEarnedsdfsd) * $CurrencyRate), 2) ?></td>
</tr>
</table>
</div>
<div id="FareBreakUpMobileDiv" class="ToolTips" style="display: none;">
<table style="width: 100%;">
<tr>
<td height="35" class="cancellation_text"><strong>Type</strong></td>
<td height="35" class="cancellation_text"><strong>Fare</strong></td>
<td height="35" class="cancellation_text"><strong>Taxes & Fee</strong></td>
<td height="35" class="cancellation_text"><strong>Total</strong></td>
</tr>
<?php
$TotalBaseFare = 0;
$TotalTaxsandFees = 0;
$Total_AGST = 0;
$Total_MF = 0;
$Total_YQ = 0;
$Total_MFT = 0;
$Total_OT = 0;
$Total_MU = 0;
$Total_YR = 0;
$Total_FixedMarkUp = 0;
$Total_GSTOnMarkUp = 0;
if ($FlightBookingData) {
foreach ($FlightBookingData as $Data) {
$intNetPublishedFare += $Data['FairRules']['intPublishedFare'];
$Currency = $Data['FairRules']['Currency'];
// $CurrencyRate = $Data['FairRules']['CurrencyRate'];
if ($Data['FairRules']['FareBreakdown']) {
foreach ($Data['FairRules']['FareBreakdown'] as $key => $value) {
if ($key == 0) {
echo '<tr><td colspan="3">' . $Data['SourceAirportCode'] . ' - ' . $Data['DestAirportCode'] . '</td></tr>';
}
//echo '<pre>';print_r($value);echo '</pre>';
$MF = $value['MF']; //Management Fee
$YQ = $value['YQ']; //Fuel Surcharge
$AGST = $value['AGST']; //Airline GST Component
$MFT = $value['MFT']; //Management Fee Tax
$OT = $value['OT']; //Other Charges
$MU = $value['MU']; //Markup
$YR = $value['YR']; //Carrier Misc Fee
$other = $MF + $YQ + $AGST + $MFT + $OT + $YR;
$FixedMarkUp = $value['FixedMarkUp'];
$GSTOnMarkUp = $value['GSTOnMarkUp'];
$intTotalGST = $value['intTotalGST'];
$CommEarned = $value['CommEarned'];
$PBaseFare = ($value['BaseFare'] - $other);
$paxPublishedFare = ($PBaseFare);
$PassengerType = $value['PassengerType'];
$PassengerCount = $value['PassengerCount'];
//$TaxesFees = ($MF + $YQ + $AGST + $MFT + $OT + $MU + $YR + $FixedMarkUp + $GSTOnMarkUp);
$TaxesFees = ($intTotalGST + $CommEarned + $other);
$Total_AGST += $AGST;
$Total_MF += $MF;
$Total_YQ += $YQ;
$Total_MFT += $MFT;
$Total_OT += $OT;
$Total_MU += $MU;
$Total_YR += $YR;
$Total_FixedMarkUp += $FixedMarkUp;
$Total_GSTOnMarkUp += $GSTOnMarkUp;
$AdditionalTxnFeePub += $value['AdditionalTxnFeePub'];
$TotalBaseFare += ($PBaseFare);
$TotalTaxsandFees += ($TaxesFees);
if ($PassengerType == 1) {
$paxType = 'Adult';
} elseif ($PassengerType == 2) {
$paxType = 'Child';
} elseif ($PassengerType == 3) {
$paxType = 'Infant';
}
?>
<tr>
<td class="cancellation_text2"><?= $paxType ?> x <?= $PassengerCount ?></td>
<td class="cancellation_text2"><?= $Currency ?> <?= number_format(($PBaseFare * $CurrencyRate), 2) ?></td>
<td class="cancellation_text2"><?= $Currency ?> <?= number_format(($TaxesFees * $CurrencyRate), 2) ?></td>
<td class="cancellation_text2"><?= $Currency ?> <?= number_format(ceil(($PBaseFare + $TaxesFees) * $CurrencyRate), 2) ?></td>
</tr>
<?php
}
}
}
}
?>
<?php if ($MealFare > 0) { ?>
<tr>
<td height="35" class="cancellation_text2" style="font-size: 13px; font-weight:bold;">Meal</td>
<td height="35" class="cancellation_text2" style="font-size: 13px; font-weight:bold;"></td>
<td height="35" class="cancellation_text2" style="font-size: 13px; font-weight:bold;"></td>
<td height="35" class="cancellation_text2" style="font-size: 13px; font-weight:bold;"><?= $this->CurrencyTitle ?> <?= number_format(($MealFare * $CurrencyRate), 2) ?></td>
</tr>
<?php } ?>
<?php if ($BaggFare > 0) { ?>
<tr>
<td height="35" class="cancellation_text2" style="font-size: 13px; font-weight:bold;">Baggage</td>
<td height="35" class="cancellation_text2" style="font-size: 13px; font-weight:bold;"></td>
<td height="35" class="cancellation_text2" style="font-size: 13px; font-weight:bold;"></td>
<td height="35" class="cancellation_text2" style="font-size: 13px; font-weight:bold;"><?= $this->CurrencyTitle ?> <?= number_format(($BaggFare * $CurrencyRate), 2) ?></td>
</tr>
<?php } ?>
<tr>
<td height="35" class="cancellation_text" style="font-size: 13px; font-weight:bold;">Total</td>
<td height="35" class="cancellation_text" style="font-size: 13px; font-weight:bold;"><?= $this->CurrencyTitle ?> <?= number_format(($TotalBaseFare * $CurrencyRate), 2) ?></td>
<td height="35" class="cancellation_text" style="font-size: 13px; font-weight:bold;"><?= $this->CurrencyTitle ?> <?= number_format((($TotalTaxsandFees) * $CurrencyRate), 2) ?></td>
<td height="35" class="cancellation_text" style="font-size: 13px; font-weight:bold;"><?= $this->CurrencyTitle ?> <?= number_format(ceil(($TotalBaseFare + $TotalTaxsandFees + $MealFare + $BaggFare) * $CurrencyRate), 2) ?></td>
</tr>
</table>
</div>
<?php if ($CencelattionData == 1) { ?>
<script>
// alert("ghgfhjfjtf");
setTimeout(function() {
updateCancellationProtection(0);
$('.cancellation_protection_summery').hide();
}, 2000);
function updateCancellationProtection(IsCP) {
var TotalcouponVal = parseFloat('<?= $TotalcouponVal ?>');
var IsCancellationProtection = $('#IsCancellationProtection').val();
var CPAmountWithTax = $('#CPAmountWithTax').val();
var price_fair_total_hidden = $('.price_fair_total_hidden').val();
var price = $('.price_price').val();
var paymentMode = 3; //$(".paymentMode:checked").val();
if (IsCP == 1) {
$('.protect_price_html').hide();
$('.price_html').hide();
$('.total_price_html').show();
$('.protect_price').html(numberWithCommas(parseFloat(CPAmountWithTax).toFixed(2)));
$('.price_price_html').html(numberWithCommas(parseFloat(parseFloat(CPAmountWithTax) + parseFloat(price)).toFixed(2)));
if (paymentMode == 3) {
$('.customerCostHtml').html(numberWithCommas(parseFloat(parseFloat(CPAmountWithTax) + parseFloat(price_fair_total_hidden)).toFixed(2)));
} else {
$('.customerCostHtml').html(numberWithCommas(parseFloat(parseFloat(CPAmountWithTax) + parseFloat(price)).toFixed(2)));
}
$('.cancellation_protection_price').html(numberWithCommas(parseFloat(CPAmountWithTax).toFixed(2)));
$('.price_fair_total_html').html(numberWithCommas(parseFloat(parseFloat(price_fair_total_hidden) + parseFloat(CPAmountWithTax)).toFixed(2)));
$('#MobilePublishedFare').html(numberWithCommas(parseFloat(parseFloat(price_fair_total_hidden) + parseFloat(CPAmountWithTax)).toFixed(2)));
$('.cancellation_protection_summery').show();
} else {
$('.protect_price_html').hide();
$('.price_html').hide();
$('.protect_price').html(numberWithCommas(parseFloat(CPAmountWithTax).toFixed(2)))
$('.price_price_html').html(numberWithCommas(parseFloat(price).toFixed(2)));
if (paymentMode == 3) {
$('.customerCostHtml').html(numberWithCommas(parseFloat(price_fair_total_hidden).toFixed(2)));
} else {
$('.customerCostHtml').html(numberWithCommas(parseFloat(price).toFixed(2)));
}
$('.cancellation_protection_price').html(numberWithCommas(parseFloat(CPAmountWithTax).toFixed(2)));
$('.price_fair_total_html').html(numberWithCommas(parseFloat(price_fair_total_hidden).toFixed(2)));
$('#MobilePublishedFare').html(numberWithCommas(parseFloat(price_fair_total_hidden).toFixed(2)));
$('.cancellation_protection_summery').hide();
}
}
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function makePayment() {
var apiTraceId = $('#apiTraceId').val();
var baseUrl = SITEURL;
var TraceId = $('#TraceId').val();
var IsActiveCancellationProtect = $('#IsActiveCancellationProtect').val();
var accepttandc = $("input[name='accepttandc']:checked").length;
var IsCancellationProtection = $("input[name='IsCancellationProtection']:checked").val();
var IsCPChecked = $('.IsCancellationProtection').is(':checked');
if (IsCPChecked == false && IsActiveCancellationProtect == 1) {
alert('Please select refund protect.');
return false;
}
if (accepttandc) {
$.ajax({
type: "POST",
data: {
TraceId: apiTraceId,
apiTraceId: TraceId,
IsCancellationProtection: IsCancellationProtection,
},
url: baseUrl + "flight/makepayment",
dataType: 'json',
beforeSend: function() {
$(".paynowbtn22").html('Please wait...');
$(".paynowbtn22").prop('disabled', true);
},
success: function(data) {
if (data.success) {
$('#VerifyOTP').modal('show');
$('#hidePhoneNumberDigit').html(data.hidePhoneNumberDigit);
$('#hideEmailid').html(data.hideEmailid);
$(".paynowbtn22").html('Pay Now');
$(".paynowbtn22").prop('disabled', false);
} else {
alert(data.message);
return false;
}
}
});
} else {
alert('Please accept term and condition');
return false;
}
}
function verifying() {
var OTPNumber = $("#OTPNumber").val();
var apiTraceId = $('#apiTraceId').val();
var TraceId = $('#TraceId').val();
var baseUrl = SITEURL;
$.ajax({
type: "POST",
url: baseUrl + "flight/makepayment",
dataType: 'json',
data: {
OTPNumber: OTPNumber,
TraceId: apiTraceId,
apiTraceId: TraceId,
verifying: 'true',
},
beforeSend: function() {
$(".ContinueAccept").html('Please wait..');
$(".ContinueAccept").attr('disabled', true);
},
success: function(data) {
if (data.success) {
$(".ContinueAccept").html('Continue Booking');
$(".ContinueAccept").removeAttr('disabled');
if (data.paynow) {
location.href = 'flight/pay-now/' + TraceId;
return true;
}
} else {
$(".ContinueAccept").html('Continue Booking');
$(".ContinueAccept").removeAttr('disabled');
alert(data.message);
return false;
}
}
});
}
</script>
<?php } ?>