| 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/v2.hellogtx.com/backup/public/js/ |
Upload File : |
$(document).ready(function () {
$(document).on('click', '.searchHotelChechBox', function () {
$('.searchHotelChechBox').attr('checked',false);
$(this).attr('checked',true);
$('.ReturningDate').toggle('show');
var dateType = $(this).attr('index');
if(dateType =='ReturningDate'){
$('.returnDate').attr('disabled',false);
}else{
$('.returnDate').attr('disabled',true);
}
})
$('#check_in').datepicker({
dateFormat: 'dd/mm/yy',
minDate: 0,
numberOfMonths: 2,
onSelect: function () {
var CheckIn = $("#check_in").val();
$("#check_out").val(CheckIn);
var arrCheckIn = CheckIn.split("/");
var day = parseInt(arrCheckIn[0]) + parseInt(1);
var month = arrCheckIn[1];
var year = arrCheckIn[2];
CheckIn = year+"/"+month+"/"+day;
$("#check_out").datepicker("option",{ minDate: new Date(CheckIn)})
}
});
$('#check_in_m').datepicker({
dateFormat: 'dd/mm/yy',
minDate: 0,
numberOfMonths: 1,
onSelect: function () {
var CheckIn = $("#check_in_m").val();
$("#check_out_m").val(CheckIn);
var arrCheckIn = CheckIn.split("/");
var day = parseInt(arrCheckIn[0]) + parseInt(1);
var month = arrCheckIn[1];
var year = arrCheckIn[2];
CheckIn = year+"/"+month+"/"+day;
$("#check_out_m").datepicker("option",{ minDate: new Date(CheckIn)})
}
});
$('#check_out').datepicker({
dateFormat: 'dd/mm/yy',
minDate: 0,
numberOfMonths: 2,
onSelect: function () {
var CheckIn = $("#check_in").val();
if(CheckIn == ''){
$("#check_out").val('');
$("#check_in").focus();
alert("Please select Check in date first.")
return false;
}
return true;
}
});
$('#check_out_m').datepicker({
dateFormat: 'dd/mm/yy',
minDate: 0,
numberOfMonths: 1,
onSelect: function () {
var CheckIn = $("#check_in_m").val();
if(CheckIn == ''){
$("#check_out_m").val('');
$("#check_in_m").focus();
alert("Please select Check in date first.")
return false;
}
return true;
}
});
$('#check_in_h').datepicker({
dateFormat: 'dd/mm/yy',
minDate: 0,
numberOfMonths: 2,
onSelect: function () {
var CheckIn = $("#check_in_h").val();
$("#check_out_h").val(CheckIn);
var arrCheckIn = CheckIn.split("/");
var day = parseInt(arrCheckIn[0]) + parseInt(1);
var month = arrCheckIn[1];
var year = arrCheckIn[2];
CheckIn = year+"/"+month+"/"+day;
$("#check_out_h").datepicker("option",{ minDate: new Date(CheckIn)})
}
});
$('#check_out_h').datepicker({
dateFormat: 'dd/mm/yy',
minDate: 0,
numberOfMonths: 2,
onSelect: function () {
var CheckIn = $("#check_in_h").val();
if(CheckIn === ''){
$("#check_out_h").val('');
$("#check_in_h").focus();
alert("Please select Check in date first.")
return false;
}
return true;
}
});
$(".showmore").on('click',function(){
var rIndex = $(this).attr('value');
var ControlText = $(this).text();
if(ControlText == "Read More..."){
$(".less_aminities_"+rIndex).hide();
$(".more_aminities_"+rIndex).show();
$(this).text("Less...");
}else{
$(".more_aminities_"+rIndex).hide();
$(".less_aminities_"+rIndex).show();
$(this).text("Read More...");
}
});
// add more rooms / remove ...........
$(".travelerboxHotel, .room-details").click(function(){
var rooms = $('#itinerary_inputs_hotel').val();
var totalpax= 0;
var i;
for(i=1;i<=rooms;i++){
var adults = ($('.room-rows-hotels').find('#traveler_hotel_adult_'+i).val()!=undefined)?$('.room-rows-hotels').find('#traveler_hotel_adult_'+i).val():0;
var kids = ($('.room-rows-hotels').find('#traveler_hotel_child_'+i).val()!=undefined)?$('.room-rows-hotels').find('#traveler_hotel_child_'+i).val():0;
var infant = 0;//div.find('#traveler_hotel_infant_'+rownumber).val();
totalpax += parseInt(adults) + parseInt(kids) + parseInt(infant);
}
$(".hotelPaxCount").html(totalpax +" People");
$(".hotelRoomCount").html(rooms+" Room");
$(".roomBoxMain").toggle();
});
$(".roomBoxMain").hide();
$('.addmorerooms').click(function () {
var count = 2;
var room = 2;
count = parseInt($('#itinerary_inputs_hotel').val());
room = parseInt($('#itinerary_rooms_hotel').val()) + parseInt(1);
CONST_HOTEL_MAX_ROOM = parseInt(5);
if (room > CONST_HOTEL_MAX_ROOM) {
alert("Can not add more than " + CONST_HOTEL_MAX_ROOM + " rooms.");
return false;
}
$('.room-rows-hotels').append(
'<div class="room-'+room+' inserted-hotel-room-row">'
+ '<h1>Room '+room+': <a href="javascript:void(0)" value="'+room+'" class="close-panel1 pull-right removeroom"><i class="fa fa-times text-gray"></i></a></h1>'
+ '<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-h" data-action="decrease" value="'+room+'" href="javascript:void(0);">–</a>'
+ '<input class="quantity" type="text" id="traveler_hotel_adult_'+room+'" name="traveler_hotel_adult_'+room+'" value="1"/>'
+ '<a class="incr-btn-h" data-action="increase" value="'+room+'" href="javascript:void(0);">+</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-h" data-action="decrease" value="'+room+'" box="child" href="javascript:void(0);">–</a>'
+ '<input class="quantity" type="text" id="traveler_hotel_child_'+room+'" name="traveler_hotel_child_'+room+'" value="0"/>'
+ '<a class="incr-btn-h" data-action="increase" value="'+room+'" href="javascript:void(0);">+</a> </div>'
+ '<div class="cl"> </div>'
+ '</div>'
);
$('#itinerary_inputs_hotel').val(parseInt(room));
$('#itinerary_rooms_hotel').val(parseInt(room));
});
$(document).on('click', '.removeroom', function () {
var roomIndex = $(this).attr('value');
var count = $('#itinerary_inputs_hotel').val();
var rooms = $('#itinerary_rooms_hotel').val();
if (count == 1) {
return false;
}
$('#itinerary_inputs_hotel').val(parseInt(count) - 1);
$('#itinerary_rooms_hotel').val(parseInt(rooms) - 1);
$('.room-rows-hotels').find('.inserted-hotel-room-row:last').remove();
});
$(document).on('click', ".incr-btn-h" , function () {
var $button = $(this);
var oldValue = $button.parent().find('.quantity').val();
$button.parent().find('.incr-btn-h[data-action="decrease"]').removeClass('inactive');
if ($button.data('action') == "increase") {
var newVal = parseFloat(oldValue) + 1;
} else {
// Don't allow decrementing below 1
if (oldValue > 1) {
var newVal = parseFloat(oldValue) - 1;
} else {
var inputType = $(this).attr('box');
if(inputType!="child"){
newVal = 1;
}else{
newVal = 0;
}
$button.addClass('inactive');
}
}
$button.parent().find('.quantity').val(newVal);
var div = $(this).closest('.room-rows-hotels');
var roomIndex = $(this).attr('value');
var RoomCount = $('#itinerary_rooms_hotel').val();
var totalpax= 1;
var adults = div.find('#traveler_hotel_adult_'+roomIndex).val();
var kids = div.find('#traveler_hotel_child_'+roomIndex).val();
var infant = 0;//div.find('#traveler_hotel_infant_'+rownumber).val();
totalpax = parseInt(adults) + parseInt(kids) + parseInt(infant);
if( parseInt(adults) > 3) {
alert("Total Adult pax can not be more than 3 in a room. Please modify travellers in room "+roomIndex);
div.find('#traveler_hotel_adult_'+roomIndex).val(adults-1);
div.find('#traveler_hotel_child_'+roomIndex).val(kids);
return false;
}
if( parseInt(kids) > 2) {
alert("Total Child pax can not be more than 2 in a room. Please modify travellers in room "+roomIndex);
div.find('#traveler_hotel_adult_'+roomIndex).val(adults);
div.find('#traveler_hotel_child_'+roomIndex).val(kids - 1);
return false;
}
if( parseInt(totalpax) > 4) {
alert("Total pax can not be more than 4 in a room. Please modify travellers in room "+roomIndex);
div.find('#traveler_hotel_adult_'+roomIndex).val('1');
div.find('#traveler_hotel_child_'+roomIndex).val('0');
return false;
}
});
// add more rooms / remove ends.....
$("#hotelSearchFrm").validate({
rules : {
'destination' : {required : true},
'check_in' : {required : true},
'check_out' : {required : true}
},
messages : {
destination : "",
check_in : "",
check_out : ""
}
});
// For Package Page
$("#hotel-search-form").validate({
rules : {
'check_in' : {required : true},
'check_out' : {required : true}
},
messages : {
check_in : "",
check_out : ""
},
submitHandler: function() {
searchResults();
}
});
// For Package Page
//Hide Show room type for inventory Hotel List....
$(document).on('click', ".Enquire-btn" ,function(){
var rIndex = $(this).attr('value');
$(".room-detail-"+rIndex).slideToggle('slow');
});
//Hide Show room type for inventory Hotel List....
});
// Geting Hotel City.....
/*$.getJSON(SITEURL + 'public/data/dynamic/hotel_destinations.json', function (destinations) {
$(".destinationBoxHotel").autocomplete({
minLength: 3,
source: destinations,
//autoFill: true,
select: function (event, ui) {
var label = ui.item.label;
var value = ui.item.value;
var destinationCode = ui.item.destinationCode;
$(".destinationCode").val(destinationCode);
}
});
});*/
// Geting Hotel City.....
// For activate tabs on package result page...
function activateTab(tab){
if(tab == 'tours'){
$("#package-filters").show();
$("#hotel-filters, #activities-filters").hide();
}else if(tab == 'hotels'){
$("#package-filters, #activities-filters").hide();
$("#hotel-filters").show();
$("#result-source").val();
$('#IsFilter').val('0');
var resultsload = $('#resultsload').val();
if(resultsload == '0'){
setResultSource('INV');
searchResults();
}
}else if(tab == 'activities'){
$("#package-filters, #hotel-filters").hide();
$("#activities-filters").show();
}else{
$("#package-filters").show();
$("#hotel-filters, #activities-filters").hide();
}
$('#filter_mob_pop').attr('data-active-filter', tab);
}
setTimeout(function(){
var tabtext = $('.tabtxt').val();
if(tabtext == "tours"){
// $("#tab1").trigger('click');
}else if(tabtext == "hotels"){
$("#tab2").trigger('click');
}else if(tabtext == "activities"){
$("#tab3").trigger('click');
}else{
//$("#tab1").trigger('click');
}
},2000);
// Ends activate tabs on package result page...
// set hotel source for hotels...
function setResultSource(source){ //alert("HI")
$("#result-source").val(source);
$('#resultsload').val('0');
$('#IsFilter').val('0');
}
// Ends set hotel source for hotels...
// set hotel source for hotels...
function searchResults(){
var formValues = $("#hotel-search-form").serialize();
$.ajax({
url: SITEURL+'hotels/search/search-results',
data: formValues,
type: 'POST',
beforeSend: function () {
angular.element(document.getElementById('ngHotelTab')).scope().loadingHotel = true;
angular.element(document.getElementById('ngHotelTab')).scope().$apply();
},
success: function (response) {
$('#resultsload').val('1');
angular.element(document.getElementById('ngHotelTab')).scope().ngHotelTab();
}
});
}
// Ends set hotel source for hotels...
// Hotel filters reset...
function resetFilters() {
$(".filterByHotelName").val('');
$(".filterByHotelName").trigger('change');
$('.hotelfiltercheckbox').each(function() {
var isChecked = $(this).is(':checked');
if(isChecked == true) {
$(this).trigger('click');
}
});
}
// Hotel filters reset Ends...
function appendUrl(title, url) {
if (typeof (history.pushState) != "undefined") {
var obj = { Title: title, Url: url };
history.pushState(obj, obj.Title, obj.Url);
} else {
}
}
// check For any destination choosen or not....
function checkForDestination(event) {
var cityid = $("#cityid").val();
if(cityid == ''){
alert("Please choose destination for Hotels / Activities.");
$(".destinationBox").val('');
$("#myModalmodify").modal();
return false;
}
}
// check For any destination choosen or not ends....
$("#cityName").autocomplete({
source: function (request, response) {
var query = $("#cityName").val();
var countryId = '';
$.getJSON("/index/get-citydata", {query: query, countryId: countryId},
response);
},
minLength: 2,
autoFocus: true,
select: function (event, ui) {
var CityId = ui.item.CityId;
var CityName = ui.item.CityName;
$("#cityId").val(CityId);
$("#cityNameVal").val(CityName);
$('#cityName').focus();
}
});
$(".searchHotelForm").submit(function () {
$('.errorMsgsHotel').html('');
if ($('.searchHotelForm input[id="cityId"]').val() == '') {
$('.errorMsgsHotel').show().html('Please enter city.');
$('.searchHotelForm input[id="cityId"]').focus();
return false;
}
if ($('.searchHotelForm input[class="check_in"]').val() == '') {
$('.errorMsgs').show().html('Please select check in date.');
$('.searchHotelForm input[class="check_in"]').focus();
return false;
}
if ($('.searchHotelForm input[class="check_out"]').val() == '') {
$('.errorMsgsHotel').show().html('Please select check out date.');
$('.searchHotelForm input[class="check_out"]').focus();
return false;
}
var data = $('.searchHotelForm').serialize();
$.ajax({
url: SITEURL + 'index/send-search-hotel-email',
type: 'POST',
data: data,
dataType: 'json',
beforeSend: function () {
$('.searchHotels').val(' Please Wait...').attr('disabled', 'disabled');
},
success: function (result) {
$('.searchHotels').val('Hotel Enquiry');
if(result.status == true){
$('.successMsgsHotel').html(result.msg);
}else{
$('.errorMsgsHotel').html(result.msg);
}
return false;
},
error: function () {
$('.searchHotels').val('Hotel Enquiry');
alert('Oops unable to connect with server!!');
return false;
}
});
return false;
});