PageSourceSearch

https://www.americanpalace.it/templates/template_1/js/reservation-tgm.js

js americanpalace.it collected 2026-10-08 19:43:40 UTC 6,952 bytes, 239 lines download raw bytes

1/*************************************************************************************************
2 * Caricamento dei link verso sistema Her
3 *************************************************************************************************/
4/* Azione dal fastReservation */
5function openPren2() {
6    const linkher = 'https://www.hoteleasyreservations.it/herx';
7	
8    let idHotel = null;
9    let data_checkin = $('input[name="datepicker"]').val();
10    let camere = $('select[name="NUMCAMERE"] option:selected').val();
11    let persone = $('select[name="NUMPERSONE"] option:selected').val();
12    let bambini = $('select[name="NUMBAMBINI"] option:selected').val();
13    let neonati = $('select[name="NUMNEONATI"] option:selected').val();
14    let get_listino = $('input[name="LISTINO"]').val();
15
16    let notti = 1;
17    let input_datepicker2 = false;
18    
19    /* Controlla l'esistenza del datepicker2 */
20    if($('input[name="datepicker2"]').length){
21        input_datepicker2 = true;
22    }
23
24    let gruppo_her = $('#idHer').data('gruppo');
25    if(!gruppo_her || gruppo_her === false){
26        idHotel = $('input[name="HOTEL"]').val();
27    }
28    else{
29        idHotel = $('select[name="HOTEL"] option:selected').val();
30    }
31    
32    if(!idHotel){
33        console.log('errore openPren2(): idHotel non valido.');
34        return;
35    }
36
37    let href = null;
38    let lingua = $('input[name="HLANG"]').val().toLowerCase();
39    
40    /* Genera il parametro listino se inserito nel fastreservation */
41    let listino = (get_listino) ? '&listino='+get_listino : '';
42
43    if(!lingua){ lingua = 'it'; }
44    if(!persone){ persone = 2;}
45
46    /* Recupera la data di checkin, valido per la singola struttura e per il gruppo */
47    let checkin = converti_formato(data_checkin);
48    let data_in = moment(converti_formato2(data_checkin));
49
50    /* Recupera le notti in base all'esistenza del datepicker2, valido per la singola struttura e per il gruppo */
51    if(input_datepicker2){
52        let data_checkout = $('input[name="datepicker2"]').val();
53        let data_out = moment(converti_formato2(data_checkout));
54        notti = data_out.diff(data_in, 'days');
55    }
56    else{
57        notti = $('select[name="NUMNOTTI"]').val();
58    }
59
60    if (idHotel === 'all') {
61        let id_gruppo = $('#idHer option').data('idgruppo');
62        href = linkher+"?form=group&group="+id_gruppo+"&hlang="+lingua+'&dtfrom='+checkin+'&numnotti='+notti+'&numpersone='+persone+listino;
63    }
64    else {
65        if(camere > 1){
66            href = linkher+'?form=load&hotel='+idHotel+'&hlang='+lingua+'&numcamere='+camere+'&dtfrom='+checkin+'&numnotti='+notti+listino;
67        }
68        else{
69            if(bambini > 0 || neonati > 0){
70                href = linkher+'?form=search&hotel='+idHotel+'&hlang='+lingua+'&dtfrom='+checkin+'&numnotti='+notti+'&numpersone='+persone+'&numbambini='+bambini+'&numneonati='+neonati+listino;
71            }
72            else{
73                href = linkher+'?form=search&hotel='+idHotel+'&hlang='+lingua+'&dtfrom='+checkin+'&numnotti='+notti+'&numpersone='+persone+listino;
74            }
75        }
76    }
77    
78    if(!href){
79        console.log('errore openPren2(): href non generato.');
80        return;
81    }
82	
83    /* Avacy CrossDomain */
84	if (typeof window.addAvacyConsentToUrl === 'function') {
85		href = window.addAvacyConsentToUrl(href);
86	}
87
88	location.href = href;
89
90}
91
92/* Prenotazione sul popup multistruttura */
93function openPren(idHotel, lingua) {
94    const linkher = 'https://www.hoteleasyreservations.it/herx';
95
96    if(!idHotel){
97        console.log('errore openPren(): idher non valido.');
98        return;
99    }
100    
101    if(!lingua){ lingua = 'it'; }
102
103    let tipo_form = 'load';
104    
105    if(idHotel === 0){
106        let gruppo_her = $('#idHer').data('gruppo');
107        if(!gruppo_her || gruppo_her === false){
108            idHotel = $('input[name="HOTEL"]').val();
109        }
110        else{
111            idHotel = $('select[name="HOTEL"] option').data('idgruppo');
112        }
113    }
114    
115    let href = linkher+'?form='+tipo_form+'&hotel='+idHotel+'&hlang='+lingua;
116	
117    /* Avacy CrossDomain */
118	if (typeof window.addAvacyConsentToUrl === 'function') {
119		href = window.addAvacyConsentToUrl(href);
120	}
121
122	location.href = href;
123
124}
125
126/* Azione dalle voci di menu */
127function move(evento) {
128    const linkher = 'https://www.hoteleasyreservations.it/herx';
129	
130    let idHotel = null;
131    let lingua = $('input[name="HLANG"]').val().toLowerCase();
132    let tipo_form = 'load';
133	let tipo_hotel = 'hotel';
134
135    let gruppo_her = $('#idHer').data('gruppo');
136    if(!gruppo_her || gruppo_her === false){
137        idHotel = $('input[name="HOTEL"]').val();
138    }
139    else{
140        idHotel = $('select[name="HOTEL"] option').data('idgruppo');
141    }
142    
143    if(!idHotel){
144        console.log('errore move(): idHotel non valido.');
145        return;
146    }
147
148    if(!lingua){ lingua = 'it'; }
149
150    switch (evento) {
151        case 'offerte':
152            tipo_form = 'spoff';
153            break;
154
155        case 'prenotazioni':
156            tipo_form = 'load';
157
158            if(gruppo_her){
159                tipo_hotel = 'group';
160                tipo_form = 'group';
161            }
162            break;
163
164        case 'modifica':
165            tipo_form = 'modify';
166            break;
167
168        default:
169            tipo_form = 'load';
170    }
171    
172    let href = linkher+'?form='+tipo_form+'&'+tipo_hotel+'='+idHotel+'&hlang='+lingua;
173
174    /* Avacy CrossDomain */
175	if (typeof window.addAvacyConsentToUrl === 'function') {
176		href = window.addAvacyConsentToUrl(href);
177	}
178
179	location.href = href;
180}
181
182/* Azione sul link della camera */
183function prenRoom(idRoom) {
184    const linkher = 'https://www.hoteleasyreservations.it/herx';
185   
186    let idHotel = null;
187    let lingua = $('input[name="HLANG"]').val().toLowerCase();
188    
189    let gruppo_her = $('#idHer').data('gruppo');
190    if(!gruppo_her || gruppo_her === false){
191        idHotel = $('input[name="HOTEL"]').val();
192    }
193    else{
194        idHotel = $('select[name="HOTEL"] option').data('idgruppo');
195    }
196    
197    if(!idHotel){
198        console.log('errore move(): idHotel non valido.');
199        return;
200    }
201
202    if(!lingua){ lingua = 'it'; }
203
204    
205    
206    let href = linkher+'?form=load&hotel='+idHotel+'&hlang='+lingua;
207	
208    /* Avacy CrossDomain */
209	if (typeof window.addAvacyConsentToUrl === 'function') {
210		href = window.addAvacyConsentToUrl(href);
211	}
212
213	location.href = href;
214}
215
216/* Azione sul link del ticker */
217function linkticker(href){
218
219    /* Avacy CrossDomain */
220	if (typeof window.addAvacyConsentToUrl === 'function') {
221		href = window.addAvacyConsentToUrl(href);
222	}
223
224	location.href = href;
225}
226
227function converti_formato(id_data) {
228    let data_inserita = id_data;
229    let separa = data_inserita.split(/[/.]+/);
230    
231    return separa[2]+separa[1]+separa[0];
232}
233
234function converti_formato2(id_data) {
235    let data_inserita = id_data;
236    let separa = data_inserita.split(/[/.]+/);
237    
238    return separa[2]+'-'+separa[1]+'-'+separa[0];
239}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.