| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/b2b.hellogtx.com/public/js/ |
Upload File : |
function maleIconActive(i){
var cost = $('#count_cost'+i).val();
var cap = $('#select_capacity'+i).val();
var total_ac = $('#total_adult_child').val();
var totalcap = $('#Capacity'+i).val();
if(cap != 0){
$('.maleIcon'+i).toggleClass('maleIconActive');
if ($("#maleIcon"+i).hasClass("maleIconActive")) {
//for validation total vehicles onclick another one start
var remaining_ac = $('#total_remaining_ac').val();
// var total_seat_count = 0;
// $("input[name='total_seat_select[]']").each(function() {
// total_seat_count = parseInt(total_seat_count) + parseInt($(this).val());
//
// });
var totalSelect = parseInt(cap) * parseInt(totalcap);
if((remaining_ac) > (parseInt(totalSelect) - parseInt(totalcap))){
// alert('can select');
}else{
alert('can not select');
$('#select_capacity'+i).val(0);
$('.maleIcon'+i).toggleClass('maleIconActive');
return false;
}
var remaining_ac_new = parseInt(remaining_ac) - parseInt(totalSelect);
$('#total_remaining_ac').val(remaining_ac_new);
$('#total_seat_select'+i).val(totalSelect);
//for validation total vehicles onclick another one end
$('#VehName'+i).attr('disabled',false);
$('#RouteName'+i).attr('disabled',false);
$('#Capacity'+i).attr('disabled',false);
$('#Noofnights'+i).attr('disabled',false);
$('#RouteSysId'+i).attr('disabled',false);
$('#CityName'+i).attr('disabled',false);
$('#EndCityName'+i).attr('disabled',false);
$('#RouteVechSysId'+i).attr('disabled',false);
$('#VehicleSysId'+i).attr('disabled',false);
$('#StartCitySysId'+i).attr('disabled',false);
$('#VehicleTypeName'+i).attr('disabled',false);
$('#CurrencyType'+i).attr('disabled',false);
$('#count_cost'+i).attr('disabled',false);
$('#count_cost'+i).val(cost*cap);
$('#count_cost_span'+i).html(cost*cap);
$('#select_capacity'+i).attr('disabled',true);
$('#click_select'+i).html('click here to deselect');
$('#click_select'+i).removeClass('btn-primary').addClass('btn-success');
}else{
$('#count_cost'+i).val(cost/cap);
$('#count_cost_span'+i).html(cost/cap);
$('#select_capacity'+i).attr('disabled',false);
$('#VehName'+i).attr('disabled',true);
$('#RouteName'+i).attr('disabled',true);
$('#Capacity'+i).attr('disabled',true);
$('#Noofnights'+i).attr('disabled',true);
$('#RouteSysId'+i).attr('disabled',true);
$('#CityName'+i).attr('disabled',true);
$('#EndCityName'+i).attr('disabled',true);
$('#RouteVechSysId'+i).attr('disabled',true);
$('#VehicleSysId'+i).attr('disabled',true);
$('#StartCitySysId'+i).attr('disabled',true);
$('#VehicleTypeName'+i).attr('disabled',true);
$('#CurrencyType'+i).attr('disabled',true);
$('#count_cost'+i).attr('disabled',true);
$('#click_select'+i).html('click here to select');
$('#click_select'+i).removeClass('btn-success').addClass('btn-primary');
$('#select_capacity'+i).val(0);
//for validation total vehicles onclick another one start
$('#total_seat_select'+i).val(0);
var remaining_ac = $('#total_remaining_ac').val();
var totalSelect = parseInt(cap) * parseInt(totalcap);
var remaining_ac_new = parseInt(remaining_ac) + parseInt(totalSelect);
// alert(remaining_ac_new);
$('#total_remaining_ac').val(remaining_ac_new);
//for validation total vehicles onclick another one end
}
}
else{
alert('Please select quantity');
}
}
function validVehicles(i){
var total_ac = $('#total_adult_child').val();
var cap = $('#select_capacity'+i).val();
var totalcap = $('#Capacity'+i).val();
$('#select_capacity_hidden'+i).val(cap);
var totalSelect = parseInt(totalcap) * parseInt(cap-1);
if((total_ac <= totalSelect)){
alert(' can not select');
$('#select_capacity'+i).val(0);
return false;
}
}
function savenext(){
var total = $('#total_transport').val();
for(var i=1;i<=total;i++){
var select_capacity = $('#select_capacity'+i).val();
// alert(select_capacity);
if(select_capacity != 0){
$('#select_capacity_hidden'+i).attr('disabled',false);
$('#select_capacity_hidden'+i).val(select_capacity);
}
if (!$("#maleIcon"+i).hasClass("maleIconActive")) {
$('#select_capacity'+i).attr('disabled',true);
}
}
}
$("#choose_vehicle").on('submit', function(e) {
// alert('here');
var data = $("#choose_vehicle").serialize();
console.log(data);
$.ajax({url: SITEURL + 'byo/index/save-choose-vehicles', type: 'POST', data: data, dataType: 'json', beforeSend: function() {
}, success: function(result) {
getFinalPriceOptionwiseData(result.TPSysId);
}
})
});
function getFinalPriceOptionwiseData(TPSysId){
$.ajax({
url: SITEURL + 'byo/index/get-final-price-optionwise',
type: 'POST',
data: {'TPSysId':TPSysId},
dataType: 'html',
beforeSend: function() {
}, success: function(result) {
$('#myModalTotalpricetable').modal();
$('#putTotalPriceData').html(result);
}
})
}
function submitFinalPackageDetail(TPSysId){
var AgencyType = $('#AgencyType').val();
if(AgencyType == 3){
var salutation = $('#salutationCustomer').val();
var fname = $('#fnameCustomer').val();
var lname = $('#lnameCustomer').val();
var custemail = $('#custemailCustomer').val();
var countrycode = $('#countrycodeCustomer').val();
var custmobile = $('#custmobileCustomer').val();
var preferences = $('#preferences').val();
if(fname == ''){
alert('Please enter first name.');
$('#fnameCustomer').focus();
return false;
}
if(lname == ''){
alert('Please enter last name.');
$('#lnameCustomer').focus();
return false;
}
if(custemail == ''){
alert('Please enter email id .');
$('#custemailCustomer').focus();
return false;
}
if(custmobile == ''){
alert('Please enter mobile number.');
$('#custmobileCustomer').focus();
return false;
}
}
$('.submitFinalPackageDetailBtn').html('Please Wait...').attr('disabled',true);
var totalOptions = $('#totalOptions').val();
var extraMarkup = [];
for(var m = 1; m <= totalOptions; m++){
extraMarkup.push($('#extraMarkup'+parseInt(m)).val());
}
var SelectPricingType = $('input[name="SelectPricingType"]:checked').val();
var form = '';
form += '<input type="hidden" name="salutation" value="'+salutation+'"><input type="hidden" name="fname" value="'+fname+'"><input type="hidden" name="lname" value="'+lname+'"><input type="hidden" name="custemail" value="'+custemail+'">';
form += '<input type="hidden" name="countrycode" value="'+countrycode+'"><input type="hidden" name="custmobile" value="'+custmobile+'"><input type="hidden" name="preferences" value="'+preferences+'">';
form += '<input type="hidden" name="TPSysId" value="'+TPSysId+'"><input type="hidden" name="extraMarkup" value="'+extraMarkup+'"><input type="hidden" name="saveType" value="save"><input type="hidden" name="SelectPricingType" value='+SelectPricingType+'>';
$('<form target="_blank" action="' + SITEURL + 'byo/index/package-details" method="POST">' + form + '</form>').appendTo($(document.body)).submit();
}
function previewBYOPackage(){
var data = $("#choose_vehicle").serialize();
console.log(data)
$.ajax({url: SITEURL + 'byo/index/save-choose-vehicles', type: 'POST', data: data, dataType: 'json', beforeSend: function() {
}, success: function(result) {
window.open(result.Rurl, '_blank');
// $.ajax({
// url: SITEURL + 'byo/index/byo/index/package-details',
// type: 'POST',
// data: data+'&TPSysId='+result.TPSysId+'&saveType=preview',
// dataType: 'json',
// beforeSend: function() {
//
// }, success: function(result) {
//
// }
// })
}
})
}
$("#save_tnc").on('submit', function(e) {
var data = $("#save_tnc").serialize();
console.log(data);
$.ajax({url: SITEURL + 'byo/index/save-package-tnc', type: 'POST', data: data, dataType: 'json', beforeSend: function() {
}, success: function(result) {
var form = '';
form += '<input type="hidden" name="TPSysId" value="'+result.TPSysId+'">';
$('<form action="' + SITEURL + 'byo/index/package-details" method="POST">' + form + '</form>').appendTo($(document.body)).submit();
}
})
});
/*For Edit Data Start */
var totalT = $('#total_transport').val();
var total_editT = $('#total_edit_transport').val();
var inc = 1;
for(var m =1; m <= totalT; m++){
var VehicleSysId = $('#VehicleSysId'+parseInt(m)).val();
// alert(VehicleSysId);
for(var n=1;n<=total_editT;n++){
var RouteSysIdEdit = $('#RouteSysIdEdit_'+parseInt(n)).val();
// alert(RouteSysIdEdit);
if(VehicleSysId == RouteSysIdEdit){
var selected_quantity_Edit = $('#selected_quantity_Edit_'+parseInt(inc)).val();
$('#select_capacity'+parseInt(m)).val(selected_quantity_Edit);
$('#click_select'+parseInt(m)).click();
inc++;
}
}
}
/*For Edit Data End */
$(document).ready(function(){
var total_ac = $('#total_adult_child').val();
var total = $('#total_transport').val();
var firstLoop = 0;
var remainingTotal = total_ac;
for(var i=1;i<=total;i++){
var select_capacity = $('#select_capacity'+i).val();
var totalcap = $('#Capacity'+i).val();
if(select_capacity != 0 && parseInt(remainingTotal) > 0){
// if(parseInt(totalcap) > parseInt(remainingTotal)){
maleIconActive(i);
remainingTotal = parseInt(remainingTotal) - parseInt(totalcap);
firstLoop = 1;
// }
}
}
// if(firstLoop == 0){
// for(var i=1;i<=total;i++){
// var select_capacity = $('#select_capacity'+i).val();
// var totalcap = $('#Capacity'+i).val();
//
// if(select_capacity != 0 && parseInt(remainingTotal) > 0){
//
//
// maleIconActive(i);
// remainingTotal = parseInt(remainingTotal) - parseInt(totalcap);
//
//
// }
// }
// }
})