| 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/holidays.tripjack.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();
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},
type: 'POST',
beforeSend: function () {
},
success: function (response) {
$('#resultsload'+destinationName+'-'+id).val('1');
$('#'+destinationName+'-'+id).html(response);
}
});
}
}
// 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' });
}