| 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/public/js/backup/ |
Upload File : |
function addMoreRoomDynamicCustomize(that){
var pkg = $(that).attr('pkg');
var itinerary_rooms = $('#itinerary_roomsDynamicCustomize').val();
$('#RoomDynamicCustomize'+parseInt(pkg)+(parseInt(itinerary_rooms)+1)).show();
$('#itinerary_roomsDynamicCustomize').val(parseInt(itinerary_rooms)+1);
}
function closeTravellersFormDynamicCustomize(that){
var pkg = $(that).attr('pkg');
$('.roomBoxMainDynamicCustom').hide();
var totalAdults = 0;
var totalKids = 0;
$('.quantityAdultDynamicCustom'+parseInt(pkg)).each(function (i, element) {
console.log($(this).val());
totalAdults += parseInt($(this).val());
});
$('.quantityChildDynamicCustom'+parseInt(pkg)).each(function (i, element) {
totalKids += parseInt($(this).val());
});
$('.travelerboxDynamicCustom').html(parseInt(totalAdults) + parseInt(totalKids));
}
function showGetQuoteHtml(that){
$('.quoteCustomizeEnquire').slideUp("slow");
var pkg = $(that).attr('pkg');
//$('#booking'+parseInt(pkg)).slideUp("slow");
$("#booking"+parseInt(pkg)).slideDown('slow');
}
function closeGetQoute(that){
var pkg = $(that).attr('pkg');
$('#booking'+parseInt(pkg)).slideUp("slow");
}
$(document).on('click', '.incr-btn', function (e) {
var $button = $(this);
var oldValue = $button.parent().find('.quantity').val();
if ($button.data('action') == "increase_adult") {
if (oldValue < 3) {
var newVal = parseFloat(oldValue) + 1;
} else {
return false;
}
} else if ($button.data('action') == "increase_child") {
if (oldValue < 2) {
var newVal = parseFloat(oldValue) + 1;
} else {
return false;
}
}else if ($button.data('action') == "decrease_adult") {
if (oldValue > 1) {
var newVal = parseFloat(oldValue) - 1;
} else {
newVal = 1;
$button.addClass('inactive');
}
} else if ($button.data('action') == "decrease_child") {
if (oldValue > 0) {
var newVal = parseFloat(oldValue) - 1;
} else {
newVal = 0;
$button.addClass('inactive');
}
}
$button.parent().find('.quantity').val(newVal);
e.preventDefault();
});
function removeRoomDynamicCustomize(that){
var pkg = $(that).attr('pkg');
var itinerary_rooms = $('#itinerary_roomsDynamicCustomize').val();
$('#quantityAdultDynamicCustom'+parseInt(pkg)+parseInt(itinerary_rooms)).val(0);
$('#quantityChildDynamicCustom'+parseInt(pkg)+parseInt(itinerary_rooms)).val(0);
$('#RoomDynamicCustomize'+parseInt(pkg)+parseInt(itinerary_rooms)).hide();
$('#itinerary_roomsDynamicCustomize').val(parseInt(itinerary_rooms)-1);
}
function showDynamicCustomizePopup(that){
var pkg = $(that).attr('pkg');
var NoofNights= $('#noofnights').val();
var SourcePlaceSysId = $('#SourcePlaceSysId').val();
// alert(SourcePlaceSysId);
var DestinationPlacesSysId = $('#DestinationPlacesSysId').val();
var SourcePlace = $('#SourcePlace').val();
// alert(SourcePlace);
var DestinationPlaces = $('#DestinationPlaces').val();
var Destinations = $('#Destinations').val();
var DestinationsIds = $('#DestinationsIds').val();
// alert(DestinationsIds);
var mpackage_name = $('#mpackage_name').val();
// var package_modified = $('#package_modified').val();
// alert(package_modified);
var package_sid = $('#package_sid').val();
var mpackage_sid = $('#mpackage_sid').val();
var gtxpackage = $('#package_tpid').val();
var packagesys_id = $('#packagesys_id').val();
// alert(packagesys_id);
var packagetype_id = $('#packagetype_id').val();
var package_tourtype_id = $('#package_tourtype_id').val();
var hotelcategoryid = $('#package_hotelcategoryid').val();
var packagedesname = $('#packagedesname_'+parseInt(pkg)).val();
var isFixedDeparture= $('#isFixedDeparture').val();
var hotelDataArray= $('#hotelDataArray').val();
// alert(isFixedDeparture);
// var noofNights = $('#noofNights_'+parseInt(pkg)).val();
// var gtxpackage = $('#gtxpackage_'+parseInt(pkg)).val();
// var hotelcategoryid = $('#hotelcategoryid_'+parseInt(pkg)).val();
// var DestinationsId = $('#DestinationsId_'+parseInt(pkg)).val();
// var SourcePlaceSysId = $('#SourcePlaceSysId_'+parseInt(pkg)).val();
// var DestinationPlacesSysId = $('#DestinationPlacesSysId_'+parseInt(pkg)).val();
// var SourcePlace = $('#SourcePlace_'+parseInt(pkg)).val();
// var DestinationPlaces = $('#DestinationPlaces_'+parseInt(pkg)).val();
// var CountryIds = $('#CountryIds_'+parseInt(pkg)).val();
// var package_destination_night_detail_ = $('#package_destination_night_detail_'+parseInt(pkg)).val();
// var my_custom_select_field_ = $('#my_custom_select_field_'+parseInt(pkg)).val();
var hotelid = $(that).attr('hoteliddata');
// alert(hotelid);
var html = '<div class="travelerboxMain"><div class="travelerbox travelerboxDynamicCustom" onclick="opentravelerboxDynamicCustom()">2</div><div class="roomBoxMain roomBoxMainDynamicCustom"><div class="roomBoxMainIn">';
for(var mi = 1;mi<=10;mi++){
var display = '';
var crossBtn = '';
var defaultAdult = 2;
if(mi>1){
display = 'display:none;';
crossBtn = '<a href="javascript:void(0)" class="close-panel1 pull-right" pkg="'+pkg+'" onclick="removeRoomDynamicCustomize(this)"><i class="fa fa-times text-gray"></i></a>';
defaultAdult = 0;
}
html += '<div class="room-1" id="RoomDynamicCustomize'+pkg+mi+'" style="'+display+'">'+
'<h1 class="no-mar-top ">Room '+mi+': '+crossBtn+'</h1><div class="row"><div class="col-md-6">'+
'<label><strong>Adults </strong><span>(Above 12 years)</span></label>'+
'<div class="count-input space-bottom"> <a class="incr-btn" data-action="decrease_adult" href="#">–</a>'+
'<input class="quantityAdultDynamicCustom'+pkg+' quantity" id="quantityAdultDynamicCustom'+pkg+mi+'" type="text" name="Adult[]" value="'+defaultAdult+'"/>'+
'<a class="incr-btn" data-action="increase_adult" href="#">+</a> </div><div class="cl"></div></div>'+
'<div class="col-md-6"><label><strong>Children</strong> <span>(Below 12 years)</span></label>'+
'<div class="count-input space-bottom"> <a class="incr-btn" data-action="decrease_child" href="#">–</a>'+
'<input class="quantityChildDynamicCustom'+pkg+' quantity" id="quantityChildDynamicCustom'+pkg+mi+'" type="text" name="Child[]" value="0"/>'+
'<a class="incr-btn" data-action="increase_child" href="#">+</a> </div><div class="cl"></div></div>'+
'</div></div>';
}
html += '<div class="cl"><span class="pull-left">'+
'<a href="javascript://" class=" btn btn-group-sm btn-outline btt-btn " pkg="'+pkg+'" onclick="addMoreRoomDynamicCustomize(this)">Add room</a></span>'+
'<span class="pull-right"> <a href="javascript://" class=" btn btn-group-sm btn-outline btt-btn " onclick="closeTravellersFormDynamicCustomize(this)" pkg="'+pkg+'">Done</a> </span>'+
'<div class="cl"></div>'+
'</div></div> </div><input name="NoofNights" value="'+NoofNights+'" type="hidden"><input name="hotelid" value='+hotelDataArray+' type="hidden"><input name="SourcePlaceSysId" value="'+SourcePlaceSysId+'" type="hidden"><input name="DestinationPlacesSysId" value="'+DestinationPlacesSysId+'" type="hidden"><input name="SourcePlace" value="'+SourcePlace+'" type="hidden"><input name="DestinationPlaces" value="'+DestinationPlaces+'" type="hidden"><input name="Destinations" value="'+Destinations+'" type="hidden"><input name="DestinationsIds" value="'+DestinationsIds+'" type="hidden"><input name="mpackage_name" value="'+mpackage_name+'" type="hidden"><input name="mpackage_sid" value="'+mpackage_sid+'" type="hidden"><input name="package_sid" value='+package_sid+' type="hidden"><input name="gtxpackage" value='+gtxpackage+' type="hidden"><input name="packagesys_id" value='+packagesys_id+' type="hidden"><input name="packagetype_id" value='+packagetype_id+' type="hidden"><input name="package_tourtype_id" value='+package_tourtype_id+' type="hidden"><input name="hotelcategoryid" value='+hotelcategoryid+' type="hidden"><input name="pkg" value='+pkg+' type="hidden"><input name="packagedesname" value='+packagedesname+' type="hidden"> <input name="isFixedDeparture" value='+isFixedDeparture+' type="hidden"><input name="hotelDataArray" value='+hotelDataArray+' type="hidden">';
$('#myModalcustomizePackageHtml').html(html);
$('#myModalcustomizePackage').modal('show');
}
function dynamicCustomizePackageFunc(){
var data = $('.dynamicCustomizePackage').serialize();
// alert(data);
$.ajax({
url: SITEURL + 'detail/index/get-customize-dynamic-package-detail',
type: 'POST',
data: data,
dataType: 'html',
beforeSend: function () {},
success: function (result) {
$('#myModalcustomizePackage').modal('hide');
$('#customizeDynamicPackageDetailHtml').html(result);
$('#customizeDynamicPackageDetail').modal('show');
},
error:function (result) {
}
});
// $('#myModalcustomizePackage').modal('hide');
// $('#customizeDynamicPackageDetail').modal('show');
}
function opentravelerboxDynamicCustom(){ $('.roomBoxMainDynamicCustom').toggle(); }
$("#calendarDynamic").datepicker({ dateFormat: 'dd/mm/yy' });
function addChangeHotelDynamic(hotelId,nights,DestinationsId,checkInDate,checkOutDate){
var Price = $('#hotelPrice'+parseInt(hotelId)).val();
var data = $('.dynamicCustomizePackage').serialize();
$.ajax({
url: SITEURL + 'detail/index/get-hotel-list',
type: 'POST',
data: data+'&nightsNew='+nights+'&DestinationsId='+DestinationsId+'&checkInDate='+checkInDate+'&checkOutDate='+checkOutDate+'&hotelId='+hotelId+'&Price='+Price,
dataType: 'html',
beforeSend: function () {},
success: function (result) {
$('#changeHotelHtml').html(result);
// $('#changeHotel').show();
$('#changeHotel').slideDown("slow");
},
error: function (result) {
}
});
}
function changePreviousHotel(hoteljson,hotelId){
$.ajax({
url: SITEURL + 'detail/index/get-hotel-data-by-id',
type: 'POST',
data: '&hoteljson='+hoteljson+'&prehotelId='+hotelId,
dataType: 'html',
beforeSend: function () {},
success: function (result) {
$('#appendHotelonChangeHtml'+parseInt(hotelId)).html(result);
$('.addChangeHotelDynamic'+parseInt(hotelId)).html('Change Hotel');
var price = 0;
$("input[id^='hotelPrice']").each(function (i) {
price = parseInt(parseInt(price)+parseInt($(this).val()));
})
$('.finalPriceHtml').html(price);
$('.finalhotelPrice').val(price);
},
error: function (result) {
}
});
}
$(document).on('click', '.saveCustomizeDynamicDataForm', function (e) {
var data = $('.saveCustomizeDynamicDataFormM').serialize();
//previewCustomizePackageData(2);
$.ajax({
url: SITEURL + 'detail/index/save-customize-dynamic-data',
type: 'POST',
data: data,
dataType: 'html',
beforeSend: function () { $('.saveCustomizeDynamicBtn').html('Please Wait...').attr('disabled',true);},
success: function (result) {
if(result.status == true){
$('.msgSuccess').html('Data Save Successfully.');
}
$('.saveCustomizeDynamicBtn').html('Get Quote');
alert('Customized Successfully.');
},
error: function (result) {
}
});
});
function saveCustomizeDynamicDataOnPage(){
var data = $('.saveCustomizeDynamicDataForm').serialize();
previewCustomizePackageData(2);
$.ajax({
url: SITEURL + 'detail/index/save-change-hotel-data',
type: 'POST',
data: data,
dataType: 'html',
beforeSend: function () { $('.saveCustomizeDynamicBtn').html('Please Wait...').attr('disabled',true);},
success: function (result) {
if(result.status == true){
$('.msgSuccess').html('Data Save Successfully.');
}
$('.saveCustomizeDynamicBtn').html('Get Quote');
alert('Customized Successfully.');
},
error: function (result) {
}
});
}
function closeHotelList(){
$('#changeHotel').slideUp("slow");
}
function previewCustomizePackageData(type){
var TPSysId = $('#tpsysid').val();
var data = $('.saveCustomizeDynamicDataForm').serialize();
$.ajax({
url: SITEURL + 'detail/index/preview-customize-dynamic-data',
type: 'POST',
data: data+'&TPSysId='+TPSysId,
dataType: 'json',
beforeSend: function () { if(type == 1){ $('.previewCustomizeDynamicBtn').html('Please Wait...').attr('disabled',true);}},
success: function (result) {
if(result.status == true){
$('.msgSuccess').html('Data Save Successfully.');
//alert(result.TPSysId)
$('#tpsysid').val(result.TPSysId);
var custom_detail_link_ = $('.custom_detail_link_'+parseInt($('#pkg').val())).val();
if(type == 1){
window.open('dynamic'+custom_detail_link_+parseInt(result.TPSysId)+'.html', '_blank');
}
}
$('.previewCustomizeDynamicBtn').html('Preview').attr('disabled',false);
},
error: function (result) {
}
});
}
function selectTransportVehicle(that,RouteVechSysId){
var totalcapacity = 0;
var TotalAdultChild = parseInt($('#TotalAdultChild').val());
if($(that).prop('checked') == true){
$('.transportSelectCheck').each(function(e){
if($(this).prop("checked") == true ){
var noofVehicles = $('.noofVehicles'+parseInt($(this).attr('routevechsysid'))).val();
var capacity = parseInt($(this).attr('capacity'));
var capacityT = (parseInt(capacity) * parseInt(noofVehicles));
totalcapacity += parseInt(parseInt(capacityT) - parseInt(capacity));
}
})
if(totalcapacity > TotalAdultChild){
alert('Can Not Select'); $(that).prop('checked',false); return false;
}else{
$('.noofVehicles'+parseInt(RouteVechSysId)).val(1);
}
}
var price = $('.finalhotelPrice').val();
var Cost = 0;
$('.transportSelectCheck').each(function(e){
if($(this).prop("checked") == true ){
var routevechsysid = parseInt($(this).attr('routevechsysid'));
var routesysid = parseInt($(this).attr('routesysid'));
Cost = parseInt(parseInt(Cost) + parseInt($('.Cost'+parseInt(routesysid)+'_'+parseInt(routevechsysid)).val()));
}
})
$('.finalPrice').val(parseInt(price) + parseInt(Cost));
$('.finalPriceHtml').html(parseInt(price) + parseInt(Cost));
}
function changeNoofVehicle(that,RouteVechSysId){
var totalcapacity = 0;
var TotalAdultChild = parseInt($('#TotalAdultChild').val());
$('.transportSelectCheck').each(function(e){
if($(this).prop("checked") == true ){
var noofVehicles = $('.noofVehicles'+parseInt($(this).attr('routevechsysid'))).val();
var capacity = parseInt($(this).attr('capacity'));
var capacityT = (parseInt(capacity) * parseInt(noofVehicles));
totalcapacity += parseInt(capacityT - capacity);
}
})
if(totalcapacity > TotalAdultChild){
alert('Can Not Select'); $(that).val(1); return false;
}else{
}
var price = $('.finalhotelPrice').val();
var Cost = 0;
$('.transportSelectCheck').each(function(e){
if($(this).prop("checked") == true ){
var routevechsysid = parseInt($(this).attr('routevechsysid'));
var routesysid = parseInt($(this).attr('routesysid'));
Cost = parseInt(parseInt(Cost) + $('.Cost'+parseInt(routesysid)+'_'+parseInt(routevechsysid)).val());
}
})
$('.finalPrice').val(parseInt(price) + parseInt(Cost));
$('.finalPriceHtml').html(parseInt(price) + parseInt(Cost));
}
function saveCustomizeHotelData(){
if( !askforconfirmation() ) {
return false;
}
$('.sending1').addClass('saveCustomizeDynamicData').removeClass('sending1');
//$('.sending1').removeClass('sending1');
return false;
var packageid , os_price , price , old_price , divbody , itemid, daynumber , type , itinerary , tourtype , catid , group , mp ;
packageid = 788;
itemid = 857237; // checked item
daynumber = 1;
type = 'h';
itinerary = 46644;
tourtype = 1;
catid = 1;
group = 'yes';
mp = 'MAP';
price = 2160; // get the checked radio value
//alert(mp); return;
if( type === 'cc') {
redirect_to_newurl();
return;
}
if( group === 'yes') {
update_recent_session_price ( packageid );
old_price = $('#recent_pkgprice_'+packageid ).val();
// update price on UI
update_price( old_price , price , packageid );
// update Options on UI
update_ui( type , packageid, daynumber , itinerary , itemid , 'add' , 'yes');
update_ui_hidden_value ( type , packageid , daynumber , itinerary , itemid );
// update the session variables
update_session ( type , packageid , tourtype , catid , itinerary , daynumber , itemid , price ,'add' , 'yes' , mp );
}
else {
update_recent_session_price ( packageid );
old_price = $('#recent_pkgprice_'+packageid ).val();
// update price on UI
update_price( old_price , price , packageid );
// update Options on UI
update_ui( type , packageid, daynumber , itinerary , itemid , 'add' , '' );
update_ui_hidden_value ( type , packageid , daynumber , itinerary , itemid );
// update the session variables
update_session ( type , packageid , tourtype , catid , itinerary , daynumber , itemid , price ,'add' ,'' , mp );
}
close_modal( 'myModalChangeOptions' ); // pass id of madal to close
}
function askforconfirmation()
{
// return true; // this is temporary only , need to remove this line
var isconfirm = confirm('Are you sure for this change in package?');
if(isconfirm === false)
return false;
else
return true;
}
function close_modal( modalid )
{
$( '#'+ modalid ).modal('hide');
}
function update_recent_session_price ( packageid )
{
var recent_pkgprice_ = $('#recent_pkgprice_'+ packageid).val();
// alert(recent_pkgprice_);
$('#updated_pkgprice_'+ packageid).val( parseInt(recent_pkgprice_) );
}
function update_price( old_price , price , packageid )
{
var new_price;
new_price = parseInt(old_price) + parseInt(price);
$( '.updated_pkgprice_'+ packageid ).val( new_price );
$( '.pkgprice_html_'+ packageid ).text( rvMoneyFormatINR(new_price , 2 ,'') );
}
function update_ui( type , packageid , daynumber , itinerary , itemid , action , group )
{
if( group === 'yes' ) {
if(type === 'h') {
$('.'+ type + '_option_'+ packageid + '_' + daynumber ).addClass('hidee').removeClass('showw');
$('#'+ type + '_option_'+ packageid + '_' + daynumber + '_' + itemid ).removeClass('hidee').addClass('showw');
// for changing the related itinerary
$('.' + 'group_'+ itinerary ).addClass('hidee').removeClass('showw');
$('.' + 'group_'+ itinerary + '_'+ itemid ).addClass('showw').removeClass('hidee');
}
}
else {
if(type === 'h') {
$('.'+ type + '_option_'+ packageid + '_' + daynumber ).addClass('hidee').removeClass('showw');
$('#'+ type + '_option_'+ packageid + '_' + daynumber + '_' + itemid ).removeClass('hidee').addClass('showw');
}
else if( type === 'a' || type === 's' ) {
if( action === 'remove' ) {
$('#'+ type + '_option_'+ packageid + '_' + daynumber + '_' + itemid ).find('.add-button').show();
$('#'+ type + '_option_'+ packageid + '_' + daynumber + '_' + itemid ).find('.remove-button').hide();
$('#'+ type + '_option_'+ packageid + '_' + daynumber + '_' + itemid ).find('.INCLUDED-OPTIONAL').text('(OPTIONAL)');
} else {
$('#'+ type + '_option_'+ packageid + '_' + daynumber + '_' + itemid ).find('.add-button').hide();
$('#'+ type + '_option_'+ packageid + '_' + daynumber + '_' + itemid ).find('.remove-button').show();
$('#'+ type + '_option_'+ packageid + '_' + daynumber + '_' + itemid ).find('.INCLUDED-OPTIONAL').text('(INCLUDED)');
}
}
}
}
function update_ui_hidden_value( type , packageid , daynumber , itinerary , itemid )
{
// $('#itinerary_'+ type + '_'+ packageid + '_' + daynumber).val(itemid);
$('.itinerary_'+ type + '_'+ packageid + '_' + itinerary).val(itemid);
}
function update_session( type , packageid , tourtype , catid , itinerary , daynumber , itemid , price , myaction , group , mp)
{
var org_price , pkgid ;
pkgid = packageid;
return $.ajax({
url : SITEURL + 'detail/index/write-session' ,
type : 'POST',
async : false ,
data : { type : type , pkgid : pkgid , tourtype : tourtype , catid : catid , itinerary : itinerary , itemid : itemid, price : price , myaction : myaction , group : group , mp : mp } ,
dataType : 'json',
success : function(result) {
if(result.status == 'success')
{
return (result.price);
}
},
error : function(result) {
}
});
}