| 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/reisentours.com/public/js/ |
Upload File : |
function countWords(tx) {
return tx ? tx.replace(/ +/g, " ").replace(/\w+| $|^ /g, "").length + 1 : 0;
}
var HotelsTags = [];
var DefaultCity = [{ "CityId": 0, "TBBCityId": 725862, "CityName": "DELHI", "countryTitle": "INDIA", "CountryId": "101", "label": "DELHI (INDIA)" }, { "CityId": 0, "TBBCityId": 699261, "CityName": "MUMBAI", "countryTitle": "INDIA", "CountryId": "101", "label": "MUMBAI (INDIA)" }, { "CityId": 0, "TBBCityId": 699356, "CityName": "GOA", "countryTitle": "INDIA", "CountryId": "101", "label": "GOA (INDIA)" }, { "CityId": 0, "TBBCityId": 740075, "CityName": "BENGALURU", "countryTitle": "INDIA", "CountryId": "101", "label": "BENGALURU (INDIA)" }, { "CityId": 0, "TBBCityId": 738801, "CityName": "CHENNAI", "countryTitle": "INDIA", "CountryId": "101", "label": "CHENNAI (INDIA)" }, { "CityId": 0, "TBBCityId": 739947, "CityName": "KOLKATA", "countryTitle": "INDIA", "CountryId": "101", "label": "KOLKATA (INDIA)" }, { "CityId": 0, "TBBCityId": 697486, "CityName": "JAIPUR DISTRICT", "countryTitle": "INDIA", "CountryId": "101", "label": "JAIPUR DISTRICT (INDIA)" }, { "CityId": 0, "TBBCityId": 738891, "CityName": "LUCKNOW", "countryTitle": "INDIA", "CountryId": "101", "label": "LUCKNOW (INDIA)" }, { "CityId": 0, "TBBCityId": 738356, "CityName": "PATNA", "countryTitle": "INDIA", "CountryId": "101", "label": "PATNA (INDIA)" }, { "CityId": 0, "TBBCityId": 707176, "CityName": "PUNE", "countryTitle": "INDIA", "CountryId": "101", "label": "PUNE (INDIA)" }, { "CityId": 0, "TBBCityId": 697010, "CityName": "DUBAI", "countryTitle": "UNITED ARAB EMIRATES", "CountryId": "228", "label": "DUBAI (UNITED ARAB EMIRATES)" }, { "CityId": 0, "TBBCityId": 727326, "CityName": "BANGKOK", "countryTitle": "THAILAND", "CountryId": "215", "label": "BANGKOK (THAILAND)" }, { "CityId": 0, "TBBCityId": 738005, "CityName": "SINGAPORE", "countryTitle": "SINGAPORE", "CountryId": "190", "label": "SINGAPORE (SINGAPORE)" }, { "CityId": 0, "TBBCityId": 695869, "CityName": "PATTAYA", "countryTitle": "THAILAND", "CountryId": "3623", "label": "PATTAYA (THAILAND)" }, { "CityId": 0, "TBBCityId": 111003, "CityName": "KAYSERSBERG", "countryTitle": "FRANCE", "CountryId": "76", "label": "KAYSERSBERG (FRANCE)" }, { "CityId": 0, "TBBCityId": 111142, "CityName": "LA CALEVIE", "countryTitle": "FRANCE", "CountryId": "76", "label": "LA CALEVIE (FRANCE)" }, { "CityId": 0, "TBBCityId": 111290, "CityName": "LENTIER", "countryTitle": "FRANCE", "CountryId": "76", "label": "LENTIER (FRANCE)" }, { "CityId": 0, "TBBCityId": 113113, "CityName": "BAIHU", "countryTitle": "CHINA", "CountryId": "46", "label": "BAIHU (CHINA)" }];
$(".hotel_name_search").autocomplete({
// search: function(event, ui) {
// $('.spinner').show();
// },
source: function(request, response) {
//console.log(request.term.replace(/ /g, '').length);
if (request.term.replace(/ /g, '').length > 2) {
var query = request.term;
$.getJSON("/hotel/hotel-city", 'query=' + query, function(source) {
var term = $.ui.autocomplete.escapeRegex(request.term),
startsWithMatcher = new RegExp("^" + term, "i"),
startsWith = $.grep(source, function(value) {
return startsWithMatcher.test(value.CityName || value.value || value);
}),
containsMatcher = new RegExp(term, "i"),
contains = $.grep(source, function(value) {
return $.inArray(value, startsWith) < 0 &&
containsMatcher.test(value.label || value.value || value);
});
response(startsWith.concat(contains).slice(0, 15));
});
} else {
source = DefaultCity;
var query = 'd';
var term = $.ui.autocomplete.escapeRegex(query),
startsWithMatcher = new RegExp("^" + term, "i"),
startsWith = $.grep(source, function(value) {
return startsWithMatcher.test(value.CityName || value.value || value);
}),
containsMatcher = new RegExp(term, "i"),
contains = $.grep(source, function(value) {
return $.inArray(value, startsWith) < 0 &&
containsMatcher.test(value.label || value.value || value);
});
response(startsWith.concat(contains).slice(0, 15));
}
// $.getJSON("/hotel/hotel-city", 'query=' + query, function(source) {
// console.log(request.term);
// var term = $.ui.autocomplete.escapeRegex(request.term),
// startsWithMatcher = new RegExp("^" + term, "i"),
// startsWith = $.grep(source, function(value) {
// return startsWithMatcher.test(value.CityName || value.value || value);
// }),
// containsMatcher = new RegExp(term, "i"),
// contains = $.grep(source, function(value) {
// return $.inArray(value, startsWith) < 0 &&
// containsMatcher.test(value.label || value.value || value);
// });
// response(startsWith.concat(contains).slice(0, 15));
// });
},
// source: function(request, response) {
// var query = $(".hotel_name_search").val();
// var countryId = '';
// $.getJSON("/hotel/hotel-city", {
// query: query,
// },
// response);
// },
minLength: 0,
autoFocus: true,
select: function(event, ui) {
var index = $(this).attr('index');
var value = ui.item.value;
$('.hotelserchcls').prop("disabled", false);
$('#hidden_selected_hotel_cityid').val(ui.item.TBBCityId);
}
}).focus(function() {
$(this).autocomplete('search');
});