| 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 : |
$(document).ready(function () {
$(".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 ...........
$(".travelerboxh, .room-detailsh").click(function () {
var rooms = $('#itinerary_inputs_hotel').val();
var totalpax = 0;
var i;
for (i = 1; i <= rooms; i++) {
var adults = ($('.room-rows-hotelsh').find('#traveler_hotel_adult_' + i).val() != undefined) ? $('.room-rows-hotelsh').find('#traveler_hotel_adult_' + i).val() : 0;
var kids = ($('.room-rows-hotelsh').find('#traveler_hotel_child_' + i).val() != undefined) ? $('.room-rows-hotelsh').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");
$(".roomBoxMainh").toggle();
});
$(".roomBoxMainh").hide();
$('.addmoreroomsh').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(CONST_HOTEL_MAX_ROOM);
if (room > CONST_HOTEL_MAX_ROOM) {
alert("Can not add more than " + CONST_HOTEL_MAX_ROOM + " rooms.");
return false;
}
$('.room-rows-hotelsh').append(
'<div class="room-' + room + ' inserted-hotel-room-row">'
+ '<h1>Room ' + room + ': <a href="javascript:void(0)" value="' + room + '" class="close-panel1 pull-right removeroomh"><i class="fa fa-times text-gray"></i></a></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-btnh" 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-btnh" 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-btnh" 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-btnh" data-action="increase" value="' + room + '" href="javascript:void(0);">+</a> </div>'
+ '<div class="cl"> </div>'
+ '</div>'
+ '</div>'
);
$('#itinerary_inputs_hotel').val(parseInt(room));
$('#itinerary_rooms_hotel').val(parseInt(room));
});
$(document).on('click', '.removeroomh', 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-hotelsh').find('.inserted-hotel-room-row:last').remove();
});
$(document).on('click', ".incr-btnh", function () {
var $button = $(this);
var oldValue = $button.parent().find('.quantity').val();
$button.parent().find('.incr-btnh[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-hotelsh');
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);
//alert()
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) > CONST_HOTEL_MAX_PAX_IN_ROOM) {
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: {
'destination': {required: true},
'check_in': {required: true},
'check_out': {required: true}
},
messages: {
'destination': "",
check_in: "",
check_out: ""
}
});
// 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.....
// Geting Hotel City.....
// set hotel source for hotels...
function setResultSource(source) { //alert("HI")
$("#result-source").val(source);
$('#resultsload').val('0');
$('#IsFilter').val('0');
// searchResults();
}
// Ends set hotel source for hotels...
// set hotel source for hotels...
function searchResults(refId, id, destinationName, adults, child, checkIn, checkOut, infent) {
$('#hotel__count_no').val(id);
var formValues = destinationName;
var checkId = $('#resultsload' + destinationName + '-' + id).val();
var filterType = $('.filterType' + parseInt(id)).val();
var starFilterValue = $('.starFilterValue' + parseInt(id)).val();
var nameFilterValue = $('.nameFilterValue' + parseInt(id)).val();
if (checkId == '0') {
$.ajax({
url: SITEURL + 'byo/index/get-hotel',
data: {des: formValues, adults: adults, child: child, checkIn: checkIn, checkOut: checkOut, infent: infent, refId: refId, destIndex: id, filterType: filterType, nameFilterValue: nameFilterValue, starFilterValue: starFilterValue},
type: 'POST',
async: false,
beforeSend: function () {
},
success: function (response) {
$('#resultsload' + destinationName + '-' + id).val('1');
$('#' + destinationName + '-' + id).html(response);
responseHotelFunction();
filterHotelDataByStar(id, destinationName);
}
});
}
}
// Ends set hotel source for hotels...
function copydiv(that) {
$("#appendDiv").append($("#copydiv2").html());
}
// 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....
function showPopHotelsFilterMob() {
$('#FlightHotelsContainer').modal('show');
}
function trimcontent(showChar)
{
var moretext = "+More";
var lesstext = "-Less";
$('.more').each(function () {
var content = $(this).html();
if (content.length > showChar) {
var c = content.substr(0, showChar);
var h = content.substr(showChar, content.length - showChar);
var html = '<span class="defaultcontent" >' + c + '</span><span class="morecontent">' + h + '</span>\n\
<a style="color:#ea272d" href="javascript:void();" class="morelink">' + moretext + '</a>';
$(this).html(html);
}
});
$(".morelink").click(function () {
if ($(this).hasClass("less")) {
$(this).removeClass("less").html(moretext);
} else {
$(this).addClass("less").html(lesstext);
}
$(this).prev().toggle();
return false;
});
$('span.morecontent').hide();
$('.defaultcontent , .morecontent').css({'font-size': '12px', 'text-transform': 'none', 'font-weight': 'normal'});
}
function openHotelPopupModel(n, type) {
var hotelId = n;
var type = type;
$.ajax({
type: "POST",
url: "byo/index/get-hotel-detail",
async: true,
data: "type=" + type + "&hotelId=" + hotelId,
beforeSend: function () {
$("#myModa1hotelview").modal();
$('#hotelDetailViewList').html('<div style="text-align:center;padding-top:30px;"><img src="<?php echo $baseUrl;?>public/images/loader.gif"/></div>');
},
success: function (data) {
$("#hotelDetailViewList").html(data);
}
});
}
//function filterHotelData(that){
// $('.searchResultsTab').each(function() {
// var isChecked = $(this).is(':checked');
// if(isChecked == true){
// var destinationName = $(this).attr('destinationName');
// var id = $(this).attr('seq');
// $('#resultsload'+destinationName+'-'+id).val('0');
// $('#proceed'+destinationName+'_'+id).html('');
// $(this).trigger('click');
// }
// });
// searchResults('eyJUIjoiMTAzIiwiRCI6eyIyMDEiOnsiRGVzSWQiOiIzMjc1NCIsIlNlcSI6IjEifSwiMjAyIjp7IkRlc0lkIjoiMjg1NzQiLCJTZXEiOiIyIn19fQ==', '2', '28574', '2', '0', '12/09/2021', '14/09/2021', '0');
//}
function filterHotelListByName(id) {
var hotelName = $('#hotelName' + parseInt(id)).val().toLowerCase();
if (hotelName.length > 2) {
$('.listingHotelDiv' + parseInt(id)).hide();
$('.listingHotelDiv' + parseInt(id)).each(function () {
var hotelNameDiv = $(this).attr('hotelNameDiv');
if (hotelNameDiv.search(hotelName) != -1) {
$(this).show();
}
})
} else {
$('.listingHotelDiv' + parseInt(id)).show();
}
}
function filterHotelDataByStar(seq, destId) {
$('#hotelName' + parseInt(seq)).val('');
$('.listingHotelDiv' + parseInt(seq)).show();
var satrChecked = [];
$('.starRating' + parseInt(seq)).each(function () {
if ($(this).prop('checked') == true) {
satrChecked.push($(this).val());
}
})
var hotelpropertyChecked = [];
$('.HotelProperty' + parseInt(seq)).each(function () {
if ($(this).prop('checked') == true) {
hotelpropertyChecked.push($(this).val());
}
})
if (satrChecked.length > 0 && $.inArray("0", satrChecked) == -1) {
$('.listingHotelDiv' + parseInt(seq)).each(function () {
var stars = $(this).attr('stars');
if ($.inArray(stars, satrChecked) == -1) {
$(this).hide();
}
})
}
console.log(hotelpropertyChecked);
if (hotelpropertyChecked.length > 0 && $.inArray("0", hotelpropertyChecked) == -1) {
$('.listingHotelDiv' + parseInt(seq)).each(function () {
var hotelproperty = $(this).attr('hotelproperty');
if ($.inArray(hotelproperty, hotelpropertyChecked) == -1) {
$(this).hide();
}
})
}
}
function resetfilterByoHotelList(seq) {
$('#hotelName' + parseInt(seq)).val('');
$('.starRating' + parseInt(seq)).prop('checked', false);
$('.HotelProperty' + parseInt(seq)).prop('checked', false);
$('.listingHotelDiv' + parseInt(seq)).show();
}
function sortHotelData(type, id, destinationName) {
$('.filterType' + id).val(type);
$('.priceFilterIcon' + id).removeClass('fa fa-long-arrow-down').removeClass('fa fa-long-arrow-up');
$('.starFilterIcon' + id).removeClass('fa fa-long-arrow-down').removeClass('fa fa-long-arrow-up');
$('.nameFilterIcon' + id).removeClass('fa fa-long-arrow-down').removeClass('fa fa-long-arrow-up');
const container = document.querySelector('.listingHotelDivAll'+id);
const resultDivs = Array.from(container.children);
if (type == 3) {
var priceFilterValue = $('.priceFilterValue' + id).val();
var cls = 'listingHotelDivAllPrice'+id+'_';
var regex = new RegExp(cls + '(\\d+)');
resultDivs.sort((a, b) => {
const aNum = parseInt(a.className.match(regex)[1]);
const bNum = parseInt(b.className.match(regex)[1]);
if(priceFilterValue == 1){
return bNum - aNum; // ascending order
}else{
return aNum - bNum; // ascending order
}
});
if(priceFilterValue == 1){
$('.priceFilterIcon' + id).removeClass('fa fa-long-arrow-down').addClass('fa fa-long-arrow-up');
$('.priceFilterValue' + id).val(0);
}else{
$('.priceFilterIcon' + id).removeClass('fa fa-long-arrow-up').addClass('fa fa-long-arrow-down');
$('.priceFilterValue' + id).val(1);
}
$('.starFilterValue' + id).val(1);
} else if (type == 2) {
var starFilterValue = $('.starFilterValue' + id).val();
var cls = 'listingHotelDivAllStar'+id+'_';
var regex = new RegExp(cls + '(\\d)');
resultDivs.sort((a, b) => {
const aNum = parseInt(a.className.match(regex)[1]);
const bNum = parseInt(b.className.match(regex)[1]);
if(starFilterValue == 1){
return bNum - aNum; // ascending order
}else{
return aNum - bNum; // ascending order
}
});
if(starFilterValue == 1){
$('.starFilterIcon' + id).removeClass('fa fa-long-arrow-down').addClass('fa fa-long-arrow-up');
$('.starFilterValue' + id).val(0);
}else{
$('.starFilterIcon' + id).removeClass('fa fa-long-arrow-up').addClass('fa fa-long-arrow-down');
$('.starFilterValue' + id).val(1);
}
$('.priceFilterValue' + id).val(0);
} else {
var nameFilterValue = $('.nameFilterValue' + id).val();
var cls = 'listingHotelDivAllName'+id+'_';
var regex = new RegExp(cls + '([^\\s]+)');
resultDivs.sort((a, b) => {
const matchA = a.className.match(regex);
const matchB = b.className.match(regex);
const aStr = matchA ? matchA[1] : '';
const bStr = matchB ? matchB[1] : '';
return aStr.localeCompare(bStr); // Sort alphabetically
});
$('.nameFilterValue' + id).val(nameFilterValue);
if(nameFilterValue == 1){
$('.nameFilterIcon' + id).removeClass('fa fa-long-arrow-down').addClass('fa fa-long-arrow-up');
}else{
$('.nameFilterIcon' + id).removeClass('fa fa-long-arrow-up').addClass('fa fa-long-arrow-down');
}
}
// Clear and re-append
container.innerHTML = '';
resultDivs.forEach(div => container.appendChild(div));
//$('#resultsload' + destinationName + '-' + id).val('0');
//$('#proceed'+destinationName+'_'+id).html('');
//$('.searchResultsTab' + parseInt(id)).click();
}