PageSourceSearch

https://www.hajduszoboszloiszallodakhotelek.hu/include/price.js

js hajduszoboszloiszallodakhotelek.hu collected 2026-10-01 23:43:03 UTC 6,401 bytes, 247 lines download raw bytes

1function callprice(hotelid) {
2	//összerakja a paraméterlistát és meghívja az ár kiszámításához a php scriptet
3	var x = document.getElementById('order_'+hotelid);
4	var callstr = new String;
5	for (var i=0;i<x.length;i++) 
6	{
7		if ((x.elements[i].value != 0) && (x.elements[i].name != 'hrtid') && (x.elements[i].name.search('maxpot_') == -1) && (x.elements[i].name.search('ipot_') == -1)  && (x.elements[i].name.search('agy_'))) {
8			callstr=callstr + x.elements[i].name+'='+x.elements[i].value +'&';
9		}
10	}
11	makeRequest('/admin/calcprice.php?from=search&'+callstr,'ar_'+hotelid);
12	
13}
14
15function callsearch() {
16	
17	var x = document.getElementById('src');
18	var callstr = new String;
19	for (var i=0;i<x.length;i++) 
20	{
21		callstr=callstr + x.elements[i].name+'='+x.elements[i].value +'&';
22	}
23	makeRequest('/admin/search.php?'+callstr,'srctarget');
24
25}
26
27
28function vendeg(hotelid) {
29	//kiszámolja a szobák kapacitása és a kiválasztott pótágyak hány vendégnek elegendőek
30	var ossz = 0;
31	var x = document.getElementById('order_'+hotelid);
32//	var nr = x.elements['nr'].value;
33	var hr = x.elements['hrtid'];
34//	var mar = 0;
35
36if (hr.length > 0) {
37	var i = 0;
38	for (i=0;i<hr.length;i=i+1){
39		
40		var hrtid = hr[i].value;
41		var szoba = x.elements['szoba_'+hrtid].value;
42		var agy = x.elements['agy_'+hrtid].value;
43		a = parseInt(szoba,10) * parseInt(agy,10);
44		ossz = ossz + parseInt(a,10);
45		//maradék
46//		mar = mar + parseInt(nr % a);
47
48		if ((x.elements['pot_'+hrtid])&&(x.elements['pot_'+hrtid].length > 0)) {
49			
50			var pot = x.elements['pot_'+hrtid].value;
51			ossz = ossz + parseInt(pot,10);
52		}
53		if ((x.elements['ipot_'+hrtid])&&(x.elements['ipot_'+hrtid].length > 0)) {
54			var ipot = x.elements['ipot_'+hrtid].value;
55			ossz = ossz + parseInt(ipot,10);
56		}
57	}
58} 
59else {
60		
61		var hrtid = hr.value;
62		var szoba = x.elements['szoba_'+hrtid].value;
63		var agy = x.elements['agy_'+hrtid].value;
64		a = parseInt(szoba,10) * parseInt(agy,10);
65		ossz = ossz + parseInt(a,10);
66		//maradék
67//		mar = mar + parseInt(nr % a);
68
69		if ((x.elements['pot_'+hrtid])&&(x.elements['pot_'+hrtid].length > 0)) {
70			
71			var pot = x.elements['pot_'+hrtid].value;
72			ossz = ossz + parseInt(pot,10);
73		}
74		if ((x.elements['ipot_'+hrtid])&&(x.elements['ipot_'+hrtid].length > 0)) {
75			var ipot = x.elements['ipot_'+hrtid].value;
76			ossz = ossz + parseInt(ipot,10);
77		}
78
79
80}
81	var resp = '';
82
83//	if (ossz < nr) {
84//		resp = '<span style="color: red;">' + ossz + ' / ' + nr +' (' + (ossz-nr) + ')</span>';
85//	}
86//	else {
87//		if (ossz > nr) {
88//			resp = '<span style="color: green;">' + ossz + ' / ' + nr + ' ('+ (ossz-nr) + ')</span>';
89//		}
90//		else {
91//			resp = '<span style="color: green;">' + ossz + ' / '+nr+'</span>';
92//		}
93//	}
94
95	resp = '<span style="color: green;">' + ossz + '</span><input type="hidden" name="nr" value="' + ossz + '">';
96//	resp = '<span style="color: green;">' + ossz + '</span>';
97	
98	cel = document.getElementById('emberek_'+hotelid);
99	cel.innerHTML = resp;
100	
101	if (ossz > 0) {
102		callprice(hotelid);
103	}
104	else {
105		cel = document.getElementById('ar_'+hotelid);
106		cel.innerHTML = '';
107	}
108	
109}
110
111function chszoba(hrtid,hotelid) {
112	// szobák számának változását kezeli, pótágyak és ingyenpótágyak számát állítja
113	
114	var x = document.getElementById('order_'+hotelid);
115//	var nr = x.elements['nr'].value;
116	var szoba = x.elements['szoba_'+hrtid].value;
117	var agy = x.elements['agy_'+hrtid].value;
118	var mpot = x.elements['maxpot_'+hrtid].value;
119
120	// új pótágyak
121	
122	if (x.elements['pot_'+hrtid]) {
123		pot = x.elements['pot_'+hrtid].length;
124		maxpot = szoba * mpot;
125		z=document.getElementById('pot_'+hrtid);
126		i = 0;
127
128		for (i=pot;i>=0;i=i-1) {
129				z.remove(i); 
130		}	
131
132		for (i=0;i<=maxpot;i=i+1) {
133			y=document.createElement('option');
134			y.text = i;
135			y.value = i;
136			try {
137				z.add(y,null); // standards compliant
138			}
139			catch(ex) {
140				z.add(y); // IE only
141			}
142		}
143
144	}
145	
146	if (x.elements['ipot_'+hrtid]) {
147
148		ipot = x.elements['ipot_'+hrtid].length;
149		z=document.getElementById('ipot_'+hrtid);
150		i = 0;
151		maxpot = szoba * mpot;
152
153		for (i=ipot;i>=0;i=i-1) {
154				z.remove(i); 
155		}	
156
157		for (i=0;i<=maxpot;i=i+1) {
158			y=document.createElement('option');
159			y.text = i;
160			y.value = i;
161			try {
162				z.add(y,null); // standards compliant
163			}
164			catch(ex) {
165				z.add(y); // IE only
166			}
167		}
168	}
169	
170	vendeg(hotelid);
171	
172}
173
174function chpot(hrtid,hotelid) {
175	//pótágyak számának változását kezeli, ingyen pótágyak számát állítja
176
177	var x = document.getElementById('order_'+hotelid);
178
179	// van, ahol nincs ingyen pótágy
180	if  (x.elements['ipot_'+hrtid]) {
181		var pot = x.elements['pot_'+hrtid].value;
182		var ingyenpot = x.elements['ipot_'+hrtid].value
183		var maxpot = x.elements['pot_'+hrtid].length;
184		
185		if ((pot+ingyenpot)>maxpot) {
186			var uj = ingyenpot - pot;
187			if (uj < 0) { uj = 0};
188			x.elements['ipot_'+hrtid].value = uj;
189		}
190	}
191	
192	vendeg(hotelid);
193		
194}
195
196function chingyenpot(hrtid,hotelid) {
197	//ingyen pótágyakat számának változását kezeli, pótágyak számát állítja
198
199	var x = document.getElementById('order_'+hotelid);
200	var pot = x.elements['pot_'+hrtid].value;
201	var ingyenpot = x.elements['ipot_'+hrtid].value
202	var maxpot = x.elements['pot_'+hrtid].length;
203
204	// ahol van ingyen pótágy, ott mindig van pótágy is, nem kell ellenőrizni
205	
206	if ((pot+ingyenpot)>maxpot) {
207		var uj = pot - ingyenpot;
208		if (uj < 0) { uj = 0};
209		x.elements['pot_'+hrtid].value = uj;
210	}
211	
212	vendeg(hotelid);
213	
214}
215
216function check(hotelid) {
217	//ha van kiválasztva ár, megjeleníti a küldés gombot
218
219	var x = document.getElementById('order_'+hotelid);
220	var pr_vis = (x.elements['pricetype']||false);
221	var price = getCheckedValue(x.elements['pricetype']);
222	var vis = document.getElementById('kuld_'+hotelid).style;
223	if (document.getElementById('off_'+hotelid)) {
224		var vis2 = document.getElementById('off_'+hotelid).style;
225	}
226
227	if ((price > '')&&(pr_vis)) {
228		vis.display = 'block';
229		if (vis2) {
230			vis2.display = 'block';
231		}
232	}
233	else {
234		vis.display = 'none';
235		if (vis2) {
236			vis2.display = 'none';
237		}
238	}
239}	
240
241function offer(hotelid) {
242
243	var x = document.getElementById('order_'+hotelid);
244	x.elements['ajanlat'].value = '1';
245	x.submit();
246
247}

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.