PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.8
VikBooking Hotel Booking Engine & PMS v1.8.8
1.8.16 1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 All 37 releases
vikbooking / site / views / showprc / tmpl / default.php

default.php in VikBooking Hotel Booking Engine & PMS 1.8.8, at site/views/showprc/tmpl/default.php

973 lines 39.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package VikBooking
4 * @subpackage com_vikbooking
5 * @author Alessio Gaggii - e4j - Extensionsforjoomla.com
6 * @copyright Copyright (C) 2018 e4j - Extensionsforjoomla.com. All rights reserved.
7 * @license GNU General Public License version 2 or later; see LICENSE
8 * @link https://vikwp.com
9 */
10
11 defined('ABSPATH') or die('No script kiddies please!');
12
13 $session = JFactory::getSession();
14 $search_tpl = VikBooking::searchResultsTmpl();
15 $vat_included = VikBooking::ivaInclusa();
16 $tax_summary = !$vat_included && VikBooking::showTaxOnSummaryOnly() ? true : false;
17 $is_package = false;
18 //packages may skip some room options
19 $skip_all_opt = false;
20 $only_forced_opt = false;
21 if (is_array($this->pkg) && count($this->pkg) > 0) {
22 $skip_all_opt = $this->pkg['showoptions'] == 3 ? true : $skip_all_opt;
23 $only_forced_opt = $this->pkg['showoptions'] == 2 ? true : $only_forced_opt;
24 $is_package = true;
25 }
26 //
27 $deftar_costs = [];
28 $deftar_basecosts = [];
29 $children_agepcent = false;
30 $pitemid = VikRequest::getInt('Itemid', '', 'request');
31 // single category filter
32 $pcategories = VikRequest::getString('categories', '', 'request');
33 // multiple category filters
34 $pcategory_ids = VikRequest::getVar('category_ids', []);
35 // pre-defined children age
36 $children_age = VikRequest::getVar('children_age', []);
37
38 $infocheckin = getdate($this->checkin);
39 $infocheckout = getdate($this->checkout);
40
41 $nowdf = VikBooking::getDateFormat();
42 if ($nowdf == "%d/%m/%Y") {
43 $df = 'd/m/Y';
44 } elseif ($nowdf == "%m/%d/%Y") {
45 $df = 'm/d/Y';
46 } else {
47 $df = 'Y/m/d';
48 }
49 $datesep = VikBooking::getDateSeparator();
50
51 $checkinforlink = date($df, $this->checkin);
52 $checkoutforlink = date($df, $this->checkout);
53
54 $discl = VikBooking::getDisclaimer();
55 $currencysymb = VikBooking::getCurrencySymb();
56 $showchildren = VikBooking::showChildrenFront();
57 $totadults = 0;
58 $totchildren = 0;
59
60 $peopleforlink = '';
61 foreach ($this->arrpeople as $aduchild) {
62 $totadults += $aduchild['adults'];
63 $totchildren += $aduchild['children'];
64 $peopleforlink .= '&adults[]='.$aduchild['adults'].'&children[]='.$aduchild['children'];
65 }
66 if (!empty($pcategories)) {
67 $peopleforlink .= '&categories=' . $pcategories;
68 }
69 if (is_array($pcategory_ids) && count($pcategory_ids)) {
70 foreach ($pcategory_ids as $pcid) {
71 $peopleforlink .= '&category_ids[]=' . $pcid;
72 }
73 }
74
75 $document = JFactory::getDocument();
76 //load jQuery
77 if (VikBooking::loadJquery()) {
78 JHtml::fetch('jquery.framework', true, true);
79 }
80
81 foreach ($this->rooms as $num => $r) {
82 if (strlen($r['moreimgs']) > 0) {
83 $document->addStyleSheet(VBO_SITE_URI.'resources/vikfxgallery.css');
84 JHtml::fetch('script', VBO_SITE_URI.'resources/vikfxgallery.js');
85 break;
86 }
87 }
88
89 $gallery_data = [];
90 foreach ($this->rooms as $num => $r) {
91 if (empty($r['moreimgs'])) {
92 continue;
93 }
94 $gallery_data[$num] = [];
95 $moreimages = explode(';;', $r['moreimgs']);
96 $imgcaptions = json_decode($r['imgcaptions'], true);
97 $usecaptions = is_array($imgcaptions);
98 foreach ($moreimages as $iind => $mimg) {
99 if (empty($mimg)) {
100 continue;
101 }
102 $img_alt = $usecaptions && !empty($imgcaptions[$iind]) ? $imgcaptions[$iind] : substr($mimg, 0, strpos($mimg, '.'));
103 array_push($gallery_data[$num], array(
104 'big' => VBO_SITE_URI . 'resources/uploads/big_' . $mimg,
105 'thumb' => VBO_SITE_URI . 'resources/uploads/thumb_' . $mimg,
106 'alt' => $img_alt,
107 'caption' => $usecaptions && !empty($imgcaptions[$iind]) ? $imgcaptions[$iind] : "",
108 ));
109 }
110 }
111 $vikfx = '
112 jQuery(function() {
113 ';
114 foreach ($gallery_data as $num => $gallery) {
115 $vikfx .= '
116 window["vikfxgallery'.$num.'"] = jQuery("#vikfx-gallery'.$num.' a").vikFxGallery();
117 jQuery("#vikfx-gallery-previous-image'.$num.', #vikfx-gallery-next-image'.$num.'").click(function() {
118 if (typeof window["vikfxgallery'.$num.'"] !== "undefined") {
119 window["vikfxgallery'.$num.'"].open();
120 }
121 });';
122 }
123 $vikfx .= '
124 });
125 ';
126 if (count($gallery_data)) {
127 $document->addScriptDeclaration($vikfx);
128 }
129
130 // rate plan meals map
131 $rate_plan_meals_map = [
132 'breakfast' => JText::translate('VBO_MEAL_BREAKFAST'),
133 'lunch' => JText::translate('VBO_MEAL_LUNCH'),
134 'dinner' => JText::translate('VBO_MEAL_DINNER'),
135 ];
136
137 $mod_rooms_data = [];
138 if (count($this->mod_booking)) {
139 // booking modification
140 $mod_rooms_data = VikBooking::loadOrdersRoomsData($this->mod_booking['id']);
141 ?>
142 <div class="vbo-booking-modification-helper">
143 <div class="vbo-booking-modification-helper-inner">
144 <div class="vbo-booking-modification-msg">
145 <span><?php echo JText::translate('VBOMODBOOKHELPSHOWPRC'); ?></span>
146 </div>
147 <div class="vbo-booking-modification-canc">
148 <a href="<?php echo JRoute::rewrite('index.php?option=com_vikbooking&task=cancelmodification&sid='.$this->mod_booking['sid'].'&id='.$this->mod_booking['id'].(!empty($pitemid) ? '&Itemid='.$pitemid : '')); ?>">
149 <?php VikBookingIcons::e('times-circle'); ?>
150 <?php echo JText::translate('VBOMODBOOKCANCMOD'); ?>
151 </a>
152 </div>
153 </div>
154 </div>
155 <?php
156 }
157
158 ?>
159
160 <div class="vbstepsbarcont">
161 <ol class="vbo-stepbar" data-vbosteps="4">
162 <?php
163 if ($is_package === true) {
164 ?>
165 <li class="vbo-step vbo-step-complete"><a href="<?php echo JRoute::rewrite('index.php?option=com_vikbooking&view=packageslist'.(!empty($pitemid) ? '&Itemid='.$pitemid : '')); ?>"><?php echo JText::translate('VBOPKGLINK'); ?></a></li>
166 <li class="vbo-step vbo-step-complete"><a href="<?php echo JRoute::rewrite('index.php?option=com_vikbooking&view=packagedetails&pkgid='.$this->pkg['id'].(!empty($pitemid) ? '&Itemid='.$pitemid : ''), false); ?>"><?php echo JText::translate('VBSTEPROOMSELECTION'); ?></a></li>
167 <?php
168 } else {
169 if ($this->roomsnum < 2 && (int)$session->get('vboSearchRoomId', 0) == (int)$this->rooms[1]['id']) {
170 // we started the search from the room details page, so the dates link should point there
171 $dateslink = JRoute::rewrite('index.php?option=com_vikbooking&view=roomdetails&roomid='.$this->rooms[1]['id'].'&checkin='.$this->checkin.'&checkout='.$this->checkout.(!empty($pitemid) ? '&Itemid='.$pitemid : ''));
172 } else {
173 // link to general search form
174 $dateslink = JRoute::rewrite('index.php?option=com_vikbooking&view=vikbooking&checkin='.$this->checkin.'&checkout='.$this->checkout.(!empty($pitemid) ? '&Itemid='.$pitemid : ''));
175 }
176 ?>
177 <li class="vbo-step vbo-step-complete"><a href="<?php echo $dateslink; ?>"><?php echo JText::translate('VBSTEPDATES'); ?></a></li>
178 <li class="vbo-step vbo-step-complete"><a href="<?php echo JRoute::rewrite('index.php?option=com_vikbooking&task=search&checkindate='.urlencode($checkinforlink).'&checkoutdate='.urlencode($checkoutforlink).'&roomsnum='.$this->roomsnum.$peopleforlink.(!empty($pitemid) ? '&Itemid='.$pitemid : ''), false); ?>"><?php echo JText::translate('VBSTEPROOMSELECTION'); ?></a></li>
179 <?php
180 }
181 ?>
182 <li class="vbo-step vbo-step-current"><span><?php echo JText::translate('VBSTEPOPTIONS'); ?></span></li>
183 <li class="vbo-step vbo-step-next"><span><?php echo JText::translate('VBSTEPCONFIRM'); ?></span></li>
184 </ol>
185 </div>
186
187 <div class="vbo-showprc-head-wrapper">
188 <div class="vbo-results-head vbo-results-head-showprc">
189 <div class="vbo-results-nights">
190 <?php VikBookingIcons::e((!empty($this->split_stay) ? 'random' : 'calendar'), 'vbo-pref-color-text'); ?>
191 <div class="vbo-results-head-det">
192 <span class="vbo-results-head-det-lbl"><?php echo JText::translate('VBSEARCHRESNIGHTS'); ?></span>
193 <span class="vbo-results-head-det-val"><?php echo $this->days; ?></span>
194 </div>
195 </div>
196 <?php
197 if ($this->roomsnum > 1) {
198 ?>
199 <div class="vbo-results-numrooms">
200 <?php VikBookingIcons::e('bed', 'vbo-pref-color-text'); ?>
201 <div class="vbo-results-head-det">
202 <span class="vbo-results-head-det-lbl"><?php echo JText::translate('VBSEARCHRESROOMS'); ?></span>
203 <span class="vbo-results-head-det-val"><?php echo $this->roomsnum; ?></span>
204 </div>
205 </div>
206 <?php
207 }
208 ?>
209 <div class="vbo-results-numadults">
210 <?php VikBookingIcons::e('male', 'vbo-pref-color-text'); ?>
211 <div class="vbo-results-head-det">
212 <span class="vbo-results-head-det-lbl"><?php echo JText::translate('VBSEARCHRESADULTS'); ?></span>
213 <span class="vbo-results-head-det-val"><?php echo $totadults; ?></span>
214 </div>
215 </div>
216 <?php
217 if ($showchildren && $totchildren > 0) {
218 ?>
219 <div class="vbo-results-numchildren">
220 <?php VikBookingIcons::e('child', 'vbo-pref-color-text'); ?>
221 <div class="vbo-results-head-det">
222 <span class="vbo-results-head-det-lbl"><?php echo JText::translate('VBSEARCHRESCHILDREN'); ?></span>
223 <span class="vbo-results-head-det-val"><?php echo $totchildren; ?></span>
224 </div>
225 </div>
226 <?php
227 }
228 ?>
229 <div class="vbcheckinroom">
230 <?php VikBookingIcons::e('sign-in', 'vbo-pref-color-text'); ?>
231 <div class="vbo-results-head-det">
232 <span class="vbo-results-head-det-lbl"><?php echo JText::translate('VBCHECKINONTHE'); ?></span>
233 <span class="vbo-results-head-det-val"><?php echo JText::sprintf('VBCHECKINOUTOF', VikBooking::sayDayMonth($infocheckin['mday']), VikBooking::sayMonth($infocheckin['mon'])); ?></span>
234 </div>
235 </div>
236 <div class="vbcheckoutroom">
237 <?php VikBookingIcons::e('sign-out', 'vbo-pref-color-text'); ?>
238 <div class="vbo-results-head-det">
239 <span class="vbo-results-head-det-lbl"><?php echo JText::translate('VBCHECKOUTONTHE'); ?></span>
240 <span class="vbo-results-head-det-val"><?php echo JText::sprintf('VBCHECKINOUTOF', VikBooking::sayDayMonth($infocheckout['mday']), VikBooking::sayMonth($infocheckout['mon'])); ?></span>
241 </div>
242 </div>
243 </div>
244
245 <form action="<?php echo JRoute::rewrite('index.php?option=com_vikbooking&task=oconfirm'.(!empty($pitemid) ? '&Itemid='.$pitemid : '')); ?>" method="post">
246 <div class="vbo-showprc-wrapper vbo-showprc-wrapper-<?php echo $search_tpl; ?>">
247 <?php
248 foreach ($this->rooms as $num => $r) {
249 $ind = $num - 1;
250
251 // room amenities
252 $carats = VikBooking::getRoomCaratOriz($r['idcarat'], $this->vbo_tn);
253
254 // determine values to be considered
255 $room_nights = $this->days;
256 $room_checkin = $this->checkin;
257 $room_checkout = $this->checkout;
258 $is_split_room = false;
259 if (!empty($this->split_stay) && isset($this->split_stay[$ind]) && $this->split_stay[$ind]['idroom'] == $r['id']) {
260 $room_nights = $this->split_stay[$ind]['nights'];
261 $room_checkin = $this->split_stay[$ind]['checkin_ts'];
262 $room_checkout = $this->split_stay[$ind]['checkout_ts'];
263 $is_split_room = true;
264 }
265
266 // room options
267 $optionals = [];
268 if (!empty($r['idopt'])) {
269 $optionals = VikBooking::getRoomOptionals($r['idopt'], $this->vbo_tn);
270 VikBooking::filterOptionalsByDate($optionals, $room_checkin, $room_checkout);
271 VikBooking::filterOptionalsByParty($optionals, $this->arrpeople[$num]['adults'], $this->arrpeople[$num]['children']);
272 }
273 ?>
274 <div class="room_container">
275 <div class="vbo-showprc-room-head">
276 <?php
277 if ($this->roomsnum > 1) {
278 ?>
279 <div class="vbshowprcroomnum">
280 <?php
281 if ($is_split_room) {
282 ?>
283 <span class="vbo-showprc-roomnum-icn"><?php VikBookingIcons::e('random'); ?></span>
284 <?php
285 }
286 ?>
287 <span class="vbo-showprc-roomnum-num"><?php echo JText::translate('VBSEARCHROOMNUM') . ' ' . $num; ?></span>
288 </div>
289 <?php
290 }
291 ?>
292 <div class="vbo-showprc-staydetails">
293 <div class="vbo-showprc-staydetails-party">
294 <?php VikBookingIcons::e('users', 'vbo-pref-color-text'); ?>
295 <?php echo $this->arrpeople[$num]['adults']; ?> <?php echo ($this->arrpeople[$num]['adults'] == 1 ? JText::translate('VBSEARCHRESADULT') : JText::translate('VBSEARCHRESADULTS')); ?><?php echo ($showchildren && $this->arrpeople[$num]['children'] > 0 ? ", ".$this->arrpeople[$num]['children']." ".($this->arrpeople[$num]['children'] == 1 ? JText::translate('VBSEARCHRESCHILD') : JText::translate('VBSEARCHRESCHILDREN')) : ""); ?>
296 </div>
297 <?php
298 if ($is_split_room) {
299 ?>
300 <div class="vbo-showprc-staydetails-splitstay vbo-showprc-staydetails-nights">
301 <?php VikBookingIcons::e('moon', 'vbo-pref-color-text'); ?>
302 <?php echo $room_nights . ' ' . ($room_nights > 1 ? JText::translate('VBDAYS') : JText::translate('VBDAY')); ?>
303 </div>
304 <div class="vbo-showprc-staydetails-splitstay vbo-showprc-staydetails-checkin">
305 <?php VikBookingIcons::e('plane-arrival', 'vbo-pref-color-text'); ?>
306 <?php echo date(str_replace("/", $datesep, $df), $room_checkin); ?>
307 </div>
308 <div class="vbo-showprc-staydetails-splitstay vbo-showprc-staydetails-checkout">
309 <?php VikBookingIcons::e('plane-departure', 'vbo-pref-color-text'); ?>
310 <?php echo date(str_replace("/", $datesep, $df), $room_checkout); ?>
311 </div>
312 <?php
313 }
314 ?>
315 </div>
316 </div>
317 <div class="vbo-showprc-room-block<?php echo $this->roomsnum > 1 ? ' vbo-showprc-room-block-multi' : ''; ?>">
318 <div class="vbo-showprc-roomname">
319 <?php
320 $room_name = $r['name'];
321 // check if a sub-unit was requested
322 if (count($this->roomindex) && !empty($this->roomindex[($num - 1)])) {
323 $room_feature = VikBooking::getRoomUnitDistinctiveFeature($r['params'], $this->roomindex[($num - 1)]);
324 if ($room_feature !== false) {
325 $room_name .= ' - ' . $room_feature[0] . ' ' . $room_feature[1];
326 }
327 }
328 ?>
329 <h3><?php echo $room_name; ?></h3>
330 </div>
331 <div class="vbroomimgdesc">
332 <div class="vikfx-gallery-container vikfx-showprc-gallery-container">
333 <div class="vikfx-gallery-fade-container">
334 <?php
335 if (!empty($r['img']) && is_file(VBO_SITE_PATH . DIRECTORY_SEPARATOR . 'resources' . DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . $r['img'])) {
336 ?>
337 <img alt="<?php echo htmlspecialchars($r['name']); ?>" src="<?php echo VBO_SITE_URI; ?>resources/uploads/<?php echo $r['img']; ?>" class="vikfx-gallery-image vblistimg"/>
338 <?php
339 }
340 if (isset($gallery_data[$num]) && count($gallery_data[$num])) {
341 ?>
342 <div class="vikfx-gallery-navigation-controls">
343 <div class="vikfx-gallery-navigation-controls-prevnext">
344 <a href="javascript: void(0);" class="vikfx-gallery-previous-image" id="vikfx-gallery-previous-image<?php echo $num; ?>"><?php VikBookingIcons::e('chevron-left'); ?></a>
345 <a href="javascript: void(0);" class="vikfx-gallery-next-image" id="vikfx-gallery-next-image<?php echo $num; ?>"><?php VikBookingIcons::e('chevron-right'); ?></a>
346 </div>
347 </div>
348 <?php
349 }
350 ?>
351 </div>
352 <?php
353 if (isset($gallery_data[$num]) && count($gallery_data[$num])) {
354 ?>
355 <div class="vikfx-gallery" id="vikfx-gallery<?php echo $num; ?>">
356 <?php
357 foreach ($gallery_data[$num] as $mimg) {
358 ?>
359 <a href="<?php echo $mimg['big']; ?>">
360 <img src="<?php echo $mimg['thumb']; ?>" alt="<?php echo htmlspecialchars($mimg['alt']); ?>" title="<?php echo htmlspecialchars($mimg['caption']); ?>"/>
361 </a>
362 <?php
363 }
364 ?>
365 </div>
366 <?php
367 }
368 ?>
369 </div>
370 <div class="room_description_box">
371 <?php
372 /**
373 * @wponly we try to parse any shortcode inside the HTML description of the room.
374 * @joomlaonly trigger onContentPrepare event for plugins.
375 */
376 if (VBOPlatformDetection::isWordPress()) {
377 echo do_shortcode(wpautop($r['info']));
378 } else {
379 JPluginHelper::importPlugin('content');
380 $myItem = JTable::getInstance('content');
381 $myItem->text = $r['info'];
382 $objparams = [];
383 if (class_exists('JEventDispatcher')) {
384 $dispatcher = JEventDispatcher::getInstance();
385 $dispatcher->trigger('onContentPrepare', array('com_vikbooking.roomdetails', &$myItem, &$objparams, 0));
386 } else {
387 /**
388 * @joomla4only
389 */
390 $dispatcher = JFactory::getApplication();
391 if (method_exists($dispatcher, 'triggerEvent')) {
392 $dispatcher->triggerEvent('onContentPrepare', array('com_vikbooking.roomdetails', &$myItem, &$objparams, 0));
393 }
394 }
395 $r['info'] = $myItem->text;
396 echo $r['info'];
397 }
398 ?>
399 </div>
400 </div>
401 <?php
402 if (!empty($carats)) {
403 ?>
404 <div class="room_carats">
405 <h4><?php echo JText::translate('VBCHARACTERISTICS'); ?></h4>
406 <?php echo $carats; ?>
407 </div>
408 <?php
409 }
410 ?>
411 <div class="room_prices">
412 <h4><?php echo JText::translate('VBPRICE'); ?></h4>
413 <div class="vbo-showprc-rateplans-wrapper">
414 <div class="vbo-showprc-pricetable">
415 <?php
416 $rate_plan_id = VikRequest::getInt('rate_plan_id', 0, 'request');
417 foreach ($this->tars[$num] as $k => $t) {
418 if ($is_package === true) {
419 // do not print the regular prices if a package was requested.
420 break;
421 }
422 $priceinfo = VikBooking::getPriceInfo($t['idprice'], $this->vbo_tn);
423 $priceinfostr = '';
424 $cancpolicy = '';
425 //
426 $priceinfostr = '<div class="vbpricedetails">';
427
428 /**
429 * Handle meal plans included.
430 *
431 * @since 1.18.2 (J) - 1.8.2 (WP)
432 */
433 $rate_plan_meals = [];
434 if (!empty($priceinfo['meal_plans'])) {
435 $rate_plan_meals = is_array($priceinfo['meal_plans']) ? $priceinfo['meal_plans'] : (array) json_decode($priceinfo['meal_plans'], true);
436 if (count($rate_plan_meals) === 1 && !strcasecmp(($rate_plan_meals[0] ?? ''), 'breakfast')) {
437 // display the common "breakfast included" label
438 $rate_plan_meals = [];
439 $priceinfo['breakfast_included'] = 1;
440 }
441 }
442 if ($rate_plan_meals) {
443 $rate_plan_meals_incl = [];
444 foreach ($rate_plan_meals as $rate_plan_meal) {
445 $rate_plan_meals_incl[] = $rate_plan_meals_map[$rate_plan_meal] ?? $rate_plan_meal;
446 }
447 $priceinfostr .= '<span class="vbprice_breakfast vbprice_all_meals_incl">' . rtrim(JText::translate('VBO_MEAL_PLANS_INCL'), ':') . ': ' . implode(', ', $rate_plan_meals_incl) . '</span>';
448 }
449
450 if (!$rate_plan_meals && $priceinfo['breakfast_included'] == 1) {
451 $priceinfostr .= '<span class="vbprice_breakfast">'.JText::translate('VBBREAKFASTINCLUDED').'</span>';
452 }
453
454 if ($priceinfo['free_cancellation'] == 1) {
455 if ((int)$priceinfo['canc_deadline'] > 0) {
456 $priceinfostr .= '<span class="vbprice_freecanc">'.JText::sprintf('VBFREECANCELLATIONWITHIN', $priceinfo['canc_deadline']).'</span>';
457 } else {
458 $priceinfostr .= '<span class="vbprice_freecanc">'.JText::translate('VBFREECANCELLATION').'</span>';
459 }
460 if (!empty($priceinfo['canc_policy'])) {
461 $priceinfostr .= '<span class="vbo-cancpolicy-trig" onclick="var cancelem=document.getElementById(\'vbo-cancpolicy-cont'.$priceinfo['id'].'\').style.display;if(cancelem == \'block\'){document.getElementById(\'vbo-cancpolicy-cont'.$priceinfo['id'].'\').style.display = \'none\';}else{document.getElementById(\'vbo-cancpolicy-cont'.$priceinfo['id'].'\').style.display = \'block\';}"><i class="'.VikBookingIcons::i('question-circle').'"></i></span>';
462 $cancpolicy = '<div class="vbo-cancpolicy-cont" id="vbo-cancpolicy-cont'.$priceinfo['id'].'" style="display: none;">'.(strpos($priceinfo['canc_policy'], '<') !== false ? $priceinfo['canc_policy'] : nl2br($priceinfo['canc_policy'])).'</div>';
463 }
464 } else {
465 $priceinfostr .= '<span class="vbprice_freecanc vbprice_freecanc_no">'.JText::translate('VBONONREFUNDRATE').'</span>';
466 }
467 $priceinfostr .= '</div>';
468 $priceinfostr .= $cancpolicy;
469 //
470 $rplan_cost = ($tax_summary ? $t['cost'] : VikBooking::sayCostPlusIva($t['cost'], $t['idprice']));
471 $room_basecost = isset($t['room_base_cost']) ? $t['room_base_cost'] : $t['cost'];
472 $rplan_basecost = ($tax_summary ? $room_basecost : VikBooking::sayCostPlusIva($room_basecost, $t['idprice']));
473 if (!array_key_exists($num, $deftar_costs)) {
474 $deftar_costs[$num] = $rplan_cost;
475 }
476 if (!array_key_exists($num, $deftar_basecosts)) {
477 $deftar_basecosts[$num] = $rplan_basecost;
478 }
479 ?>
480 <div class="vbo-showprc-price-entry">
481 <div class="vbo-showprc-price-entry-radio">
482 <input type="radio" class="vbo-radio" data-roomnum="<?php echo $num; ?>" data-ratecost="<?php echo $rplan_cost; ?>" data-ratecostbase="<?php echo $rplan_basecost; ?>" name="priceid<?php echo $num; ?>" id="pid<?php echo $num.$t['idprice']; ?>" value="<?php echo $t['idprice']; ?>"<?php echo (($k == 0 && empty($rate_plan_id)) || $rate_plan_id == $t['idprice'] ? " checked=\"checked\"" : ""); ?>/>
483 </div>
484 <div class="vbo-showprc-price-entry-rateplan">
485 <label for="pid<?php echo $num.$t['idprice']; ?>"><?php echo $priceinfo['name']; ?></label>
486 <?php
487 if (strlen($t['attrdata'])) {
488 ?>
489 <div class="vbo-showprc-price-entry-rateattribute">
490 <span><?php echo VikBooking::getPriceAttr($t['idprice'], $this->vbo_tn); ?></span>
491 <?php echo $t['attrdata']; ?>
492 </div>
493 <?php
494 }
495 ?>
496 <?php echo $priceinfostr; ?>
497 </div>
498 <div class="vbo-showprc-price-entry-cost vbo-pref-color-text">
499 <span class="room_cost">
500 <?php echo VikBooking::formatCurrencyNumber(VikBooking::numberFormat($rplan_cost), $currencysymb, ['<span class="vbo_currency">%s</span>', '<span class="vbo_price">%s</span>']); ?>
501 </span>
502 <?php
503 if (isset($t['promotion']) && isset($t['promotion']['discount'])) {
504 if ($t['promotion']['discount']['pcent']) {
505 /**
506 * Do not make an upper-cent operation, but rather calculate the original price proportionally:
507 * final price : (100 - discount amount) = x : 100
508 */
509 $prev_amount = $rplan_cost * 100 / (100 - $t['promotion']['discount']['amount']);
510 } else {
511 $prev_amount = $rplan_cost + $t['promotion']['discount']['amount'];
512 }
513 if ($prev_amount > 0) {
514 ?>
515 <div class="vbo-room-result-price-before-discount">
516 <span class="room_cost">
517 <?php echo VikBooking::formatCurrencyNumber(VikBooking::numberFormat($prev_amount), $currencysymb, ['<span class="vbo_currency">%s</span>', '<span class="vbo_price">%s</span>']); ?>
518 </span>
519 </div>
520 <?php
521 if ($t['promotion']['discount']['pcent']) {
522 // hide by default the DIV containing the percent of discount
523 ?>
524 <div class="vbo-room-result-price-before-discount-percent" style="display: none;">
525 <span class="room_cost">
526 <span><?php echo '-' . (float)$t['promotion']['discount']['amount'] . ' %'; ?></span>
527 </span>
528 </div>
529 <?php
530 }
531 }
532 }
533 ?>
534 </div>
535 </div>
536 <?php
537 }
538 if ($is_package === true) {
539 $pkg_cost = $this->pkg['pernight_total'] == 1 ? ($this->pkg['cost'] * $this->days) : $this->pkg['cost'];
540 $base_pkg_cost = ($tax_summary ? $pkg_cost : VikBooking::sayPackagePlusIva($pkg_cost, $this->pkg['idiva']));
541 if (!array_key_exists($num, $deftar_costs)) {
542 $deftar_costs[$num] = $base_pkg_cost;
543 }
544 if (!array_key_exists($num, $deftar_basecosts)) {
545 $deftar_basecosts[$num] = $base_pkg_cost;
546 }
547 $pkg_cost = $this->pkg['perperson'] == 1 ? ($pkg_cost * ($this->arrpeople[$num]['adults'] > 0 ? $this->arrpeople[$num]['adults'] : 1)) : $pkg_cost;
548 ?>
549 <div class="vbo-showprc-price-entry vbo-showprc-price-pkg">
550 <div class="vbo-showprc-price-entry-radio">
551 <input type="radio" class="vbo-radio" data-roomnum="<?php echo $num; ?>" data-ratecost="<?php echo $base_pkg_cost; ?>" data-ratecostbase="<?php echo $base_pkg_cost; ?>" name="priceid<?php echo $num; ?>" id="pid<?php echo $num.$this->pkg['id']; ?>" value="<?php echo $this->pkg['id']; ?>" checked="checked"/>
552 </div>
553 <div class="vbo-showprc-price-entry-rateplan">
554 <label for="pid<?php echo $num.$this->pkg['id']; ?>"><?php echo $this->pkg['name']; ?></label>
555 </div>
556 <div class="vbo-showprc-price-entry-cost vbo-pref-color-text">
557 <?php echo VikBooking::formatCurrencyNumber(VikBooking::numberFormat(($tax_summary ? $pkg_cost : VikBooking::sayPackagePlusIva($pkg_cost, $this->pkg['idiva']))), $currencysymb, ['<span class="vbo_currency">%s</span>', '<span class="vbo_price">%s</span>']); ?>
558 </div>
559 </div>
560 <?php
561 }
562 ?>
563 </div>
564 <?php
565 // BEGIN: Children Age Intervals
566 if (!empty($r['idopt']) && !empty($optionals)) {
567 list($optionals, $ageintervals) = VikBooking::loadOptionAgeIntervals($optionals, $this->arrpeople[$num]['adults'], $this->arrpeople[$num]['children']);
568 if ($ageintervals && $this->arrpeople[$num]['children'] > 0 && $skip_all_opt !== true) {
569 ?>
570 <div class="vbageintervals">
571 <?php
572 /**
573 * @wponly we need to let WordPress parse the paragraphs in the message.
574 */
575 if (VBOPlatformDetection::isWordPress()) {
576 echo wpautop($ageintervals['descr']);
577 } else {
578 echo $ageintervals['descr'];
579 }
580 ?>
581 <div class="vbo-showprc-child-fees-wrapper">
582 <?php
583 for ($ch = 1; $ch <= $this->arrpeople[$num]['children']; $ch++) {
584 /**
585 * Age intervals may be overridden per child number.
586 *
587 * @since 1.13.5
588 */
589 $intervals = explode(';;', (isset($ageintervals['ageintervals_child' . $ch]) ? $ageintervals['ageintervals_child' . $ch] : $ageintervals['ageintervals']));
590 //
591 ?>
592 <div class="vbo-showprc-child-fee">
593 <span><?php echo JText::translate('VBSEARCHRESCHILD') . ' #' . $ch; ?></span>
594 <select name="optid<?php echo $num . $ageintervals['id']; ?>[]">
595 <?php
596 foreach ($intervals as $kintv => $intv) {
597 if (empty($intv)) {
598 continue;
599 }
600 $intvparts = explode('_', $intv);
601 $intvparts[2] = intval($ageintervals['perday']) == 1 ? ($intvparts[2] * $this->tars[$num][0]['days']) : $intvparts[2];
602 if (!empty($ageintervals['maxprice']) && $ageintervals['maxprice'] > 0 && $intvparts[2] > $ageintervals['maxprice']) {
603 $intvparts[2] = $ageintervals['maxprice'];
604 }
605
606 /**
607 * Trigger event to allow third party plugins to apply a custom calculation for the option/extra fee or tax.
608 *
609 * @since 1.17.7 (J) - 1.7.7 (WP)
610 */
611 $custom_calc_booking = ['days' => $this->tars[$num][0]['days']];
612 $custom_calc_booking_room = ($this->arrpeople[$num] ?? []);
613 $custom_calculation = VBOFactory::getPlatform()->getDispatcher()->filter('onCalculateBookingOptionFeeCost', [$intvparts[2], &$ageintervals, $custom_calc_booking, $custom_calc_booking_room]);
614 if ($custom_calculation) {
615 $intvparts[2] = (float) $custom_calculation[0];
616 }
617
618 $intvparts[2] = $tax_summary ? $intvparts[2] : VikBooking::sayOptionalsPlusIva($intvparts[2], $ageintervals['idiva']);
619 $pricestr = floatval($intvparts[2]) >= 0 ? '+ '.VikBooking::numberFormat($intvparts[2]) : '- '.VikBooking::numberFormat($intvparts[2]);
620 $pcent_interval = false;
621 $opt_suffix = '';
622 if (array_key_exists(3, $intvparts) && strpos($intvparts[3], '%') !== false && array_key_exists($num, $deftar_costs) && floatval($intvparts[2]) >= 0) {
623 $children_agepcent = true;
624 $pcent_interval = true;
625 if (strpos($intvparts[3], '%b') !== false) {
626 // VBO 1.10 - percentage value of room base cost
627 $opt_suffix = 'base';
628 $pcent_cost = $deftar_basecosts[$num] * (float)$intvparts[2] / 100;
629 $pricestr = '+ '.VikBooking::numberFormat($pcent_cost);
630 } else {
631 // percentage value of adults tariff
632 $pcent_cost = $deftar_costs[$num] * (float)$intvparts[2] / 100;
633 $pricestr = '+ '.VikBooking::numberFormat($pcent_cost);
634 }
635 }
636 /**
637 * Check if this age interval should be pre-selected for the given children age (if any).
638 *
639 * @since 1.15.0 (J) - 1.5.0 (WP)
640 */
641 $age_intval_selected = false;
642 if (is_array($children_age) && isset($children_age[($ch - 1)]) && is_numeric($children_age[($ch - 1)])) {
643 $age_intval_selected = ($intvparts[0] <= $children_age[($ch - 1)] && $intvparts[1] >= $children_age[($ch - 1)]);
644 }
645 ?>
646 <option value="<?php echo ($kintv + 1); ?>"<?php echo ($age_intval_selected ? ' selected="selected"' : '').($pcent_interval === true ? ' data-pcentintvroom="'.$num.'" data-ratetype="'.$opt_suffix.'" data-pcentintv="'.floatval($intvparts[2]).'" data-ageintv="'.$intvparts[0].' - '.$intvparts[1].'"' : ''); ?>><?php echo "{$intvparts[0]} - {$intvparts[1]} ({$pricestr} {$currencysymb})"; ?></option>
647 <?php
648 }
649 ?>
650 </select>
651 </div>
652 <?php
653 }
654 ?>
655 </div>
656 </div>
657 <?php
658 }
659 }
660 // END: Children Age Intervals
661 ?>
662 </div>
663 </div>
664
665 <?php
666 if (!empty($r['idopt']) && !empty($optionals) && $skip_all_opt !== true) {
667 $optechoed = 0;
668 $titlewritten = false;
669 $arrforcesummary = [];
670 foreach ($optionals as $k => $o) {
671 $showoptional = true;
672 if (intval($o['ifchildren']) == 1 && $this->arrpeople[$num]['children'] < 1) {
673 $showoptional = false;
674 }
675 if ($only_forced_opt === true && intval($o['forcesel']) != 1) {
676 $showoptional = false;
677 }
678 if ($showoptional !== true) {
679 continue;
680 }
681 // VBO 1.11 - options percentage cost of the room total fee
682 $o['cost'] = (int)$o['pcentroom'] ? ($deftar_costs[$num] * $o['cost'] / 100) : $o['cost'];
683 //
684 $optcost = intval($o['perday']) == 1 ? ($o['cost'] * $this->tars[$num][0]['days']) : $o['cost'];
685 if (!empty($o['maxprice']) && $o['maxprice'] > 0 && $optcost > $o['maxprice']) {
686 $optcost = $o['maxprice'];
687 }
688 if ($o['perperson'] == 1) {
689 $optcost = $optcost * $this->arrpeople[$num]['adults'];
690 }
691 $optcost = $optcost * 1;
692
693 /**
694 * Trigger event to allow third party plugins to apply a custom calculation for the option/extra fee or tax.
695 *
696 * @since 1.17.7 (J) - 1.7.7 (WP)
697 */
698 $custom_calc_booking = ['days' => $this->tars[$num][0]['days']];
699 $custom_calc_booking_room = array_merge(($this->arrpeople[$num] ?? []), ['room_cost' => ($deftar_costs[$num] ?? 0)]);
700 $custom_calculation = VBOFactory::getPlatform()->getDispatcher()->filter('onCalculateBookingOptionFeeCost', [$optcost, &$o, $custom_calc_booking, $custom_calc_booking_room]);
701 if ($custom_calculation) {
702 $optcost = (float) $custom_calculation[0];
703 }
704
705 $forcesummary = false;
706 if (intval($o['forcesel']) == 1) {
707 $forcedquan = 1;
708 $forceperday = false;
709 $forceperchild = false;
710 if (strlen($o['forceval']) > 0) {
711 $forceparts = explode("-", $o['forceval']);
712 $forcedquan = intval($forceparts[0]);
713 $forceperday = intval($forceparts[1]) == 1 ? true : false;
714 $forceperchild = intval($forceparts[2]) == 1 ? true : false;
715 $forcesummary = intval($forceparts[3]) == 1 ? true : false;
716 }
717 $setoptquan = $forceperday == true ? ($forcedquan * $this->tars[$num][0]['days']) : $forcedquan;
718 $setoptquan = $forceperchild == true ? ($setoptquan * $this->arrpeople[$num]['children']) : $setoptquan;
719 if ($forcesummary === true) {
720 $optquaninp = "<input type=\"hidden\" name=\"optid".$num.$o['id']."\" value=\"".$setoptquan."\"/>";
721 $arrforcesummary[] = $optquaninp;
722 } else {
723 if (intval($o['hmany']) == 1) {
724 $optquaninp = "<input type=\"hidden\" name=\"optid".$num.$o['id']."\" value=\"".$setoptquan."\"/><span class=\"vboptionforcequant\"><small>x</small> ".$setoptquan."</span>";
725 } else {
726 $optquaninp = "<input type=\"hidden\" name=\"optid".$num.$o['id']."\" value=\"".$setoptquan."\"/><span class=\"vboptionforcequant\"><small>x</small> ".$setoptquan."</span>";
727 }
728 }
729 } else {
730 /**
731 * During a booking modification, we pre-select the previous options for this party, if any.
732 *
733 * @since 1.15.0 (J) - 1.5.0 (WP)
734 */
735 $opt_selected = false;
736 if (count($mod_rooms_data) && isset($mod_rooms_data[($num - 1)]) && !empty($mod_rooms_data[($num - 1)]['optionals'])) {
737 $prev_party_opts = explode(';', $mod_rooms_data[($num - 1)]['optionals']);
738 foreach ($prev_party_opts as $prev_party_opt) {
739 if (empty($prev_party_opt)) {
740 continue;
741 }
742 $prev_party_opt_parts = explode(':', $prev_party_opt);
743 if (count($prev_party_opt_parts) < 2 || empty($prev_party_opt_parts[0]) || $prev_party_opt_parts[0] != $o['id']) {
744 continue;
745 }
746 $opt_sep = strpos($prev_party_opt_parts[1], '-');
747 $opt_prev_quant = $opt_sep !== false ? substr($prev_party_opt_parts[1], 0, $opt_sep) : $prev_party_opt_parts[1];
748 $opt_selected = $opt_prev_quant > 0 ? $opt_prev_quant : $opt_selected;
749 }
750 }
751
752 if (intval($o['hmany']) == 1) {
753 if (intval($o['maxquant']) > 0) {
754 $optquaninp = "<select name=\"optid".$num.$o['id']."\">\n";
755 for ($ojj = 0; $ojj <= intval($o['maxquant']); $ojj++) {
756 $optquaninp .= "<option value=\"".$ojj."\"" . ($opt_selected !== false && $opt_selected == $ojj ? ' selected="selected"' : '') . ">".$ojj."</option>\n";
757 }
758 $optquaninp .= "</select>\n";
759 } else {
760 $optquaninp = "<input type=\"number\" min=\"0\" step=\"any\" name=\"optid".$num.$o['id']."\" value=\"" . ($opt_selected !== false ? $opt_selected : '0') . "\"/>";
761 }
762 } else {
763 $optquaninp = "<input type=\"checkbox\" name=\"optid".$num.$o['id']."\" value=\"1\"" . ($opt_selected !== false ? ' checked="checked"' : '') . "/>";
764 }
765 }
766
767 if ($forcesummary === false) {
768 if (!$titlewritten) {
769 $titlewritten = true;
770 ?>
771 <div class="room_options">
772 <h4><?php echo JText::translate('VBACCOPZ'); ?></h4>
773 <div class="vbo-showprc-optionstable">
774 <?php
775 }
776 $optechoed++;
777 ?>
778 <div class="vbo-showprc-option-entry">
779 <div class="vbo-showprc-option-entry-img">
780 <?php echo (!empty($o['img']) ? '<img class="maxthirty" src="'.VBO_SITE_URI.'resources/uploads/'.$o['img'].'"/>' : '&nbsp;'); ?>
781 </div>
782 <div class="vbo-showprc-option-entry-name">
783 <?php echo $o['name']; ?>
784 <?php
785 if (strlen(strip_tags( trim($o['descr'] )))) {
786 ?>
787 <div class="vbo-showprc-option-entry-descr">
788 <?php
789 /**
790 * @wponly we need to let WordPress parse the paragraphs in the message.
791 */
792 if (VBOPlatformDetection::isWordPress()) {
793 echo wpautop($o['descr']);
794 } else {
795 echo $o['descr'];
796 }
797 ?>
798 </div>
799 <?php
800 }
801 ?>
802 </div>
803 <div class="vbo-showprc-option-entry-cost">
804 <?php echo VikBooking::formatCurrencyNumber(VikBooking::numberFormat(($tax_summary ? $optcost : VikBooking::sayPackagePlusIva($optcost, $o['idiva']))), $currencysymb, ['<span class="vbo_currency">%s</span>', '<span class="vbo_price">%s</span>']); ?>
805 </div>
806 <div class="vbo-showprc-option-entry-input">
807 <?php echo $optquaninp; ?>
808 </div>
809 </div>
810 <?php
811 }
812 }
813 if ($optechoed > 0) {
814 ?>
815 </div>
816 <?php
817 }
818 if (count($arrforcesummary) > 0) {
819 echo implode("\n", $arrforcesummary);
820 }
821 if ($optechoed > 0) {
822 ?>
823 </div>
824 <?php
825 }
826 }
827 ?>
828 </div>
829
830 </div>
831 <input type="hidden" name="roomid[]" value="<?php echo $r['id']; ?>"/>
832 <?php
833 }
834 ?>
835 </div>
836 <?php
837
838 foreach ($this->arrpeople as $indroom => $aduch) {
839 ?>
840 <input type="hidden" name="adults[]" value="<?php echo $aduch['adults']; ?>"/>
841 <?php
842 if ($showchildren) {
843 ?>
844 <input type="hidden" name="children[]" value="<?php echo $aduch['children']; ?>"/>
845 <?php
846 }
847 }
848 ?>
849 <input type="hidden" id="roomsnum" name="roomsnum" value="<?php echo $this->roomsnum; ?>"/>
850 <input type="hidden" name="days" value="<?php echo $this->days; ?>"/>
851 <input type="hidden" name="checkin" value="<?php echo $this->checkin; ?>"/>
852 <input type="hidden" name="checkout" value="<?php echo $this->checkout; ?>"/>
853 <input type="hidden" name="categories" value="<?php echo $pcategories; ?>"/>
854 <input type="hidden" name="task" value="oconfirm"/>
855 <?php
856 if (is_array($pcategory_ids) && count($pcategory_ids)) {
857 foreach ($pcategory_ids as $pcid) {
858 ?>
859 <input type="hidden" name="category_ids[]" value="<?php echo $pcid; ?>"/>
860 <?php
861 }
862 }
863 if (!empty($pitemid)) {
864 ?>
865 <input type="hidden" name="Itemid" value="<?php echo $pitemid; ?>"/>
866 <?php
867 }
868 if ($is_package === true) {
869 ?>
870 <input type="hidden" name="pkg_id" value="<?php echo $this->pkg['id']; ?>"/>
871 <?php
872 }
873 if ($is_package === true && !empty($this->pkg['benefits'])) {
874 ?>
875 <div class="vbo-pkg-showprc-benefits"><?php echo $this->pkg['benefits']; ?></div>
876 <?php
877 }
878 if (strlen($discl)) {
879 ?>
880 <div class="room_disclaimer"><?php echo $discl; ?></div>
881 <?php
882 }
883 if ($is_package === true && !empty($this->pkg['conditions'])) {
884 ?>
885 <div class="room_disclaimer vbo-pkg-showprc-conditions"><?php echo $this->pkg['conditions']; ?></div>
886 <?php
887 }
888 ?>
889 <div class="room_buttons_box">
890 <div class="goback">
891 <?php
892 if ($is_package === true) {
893 ?>
894 <a class="vbo-goback-link vbo-pref-color-btn-secondary" href="<?php echo JRoute::rewrite('index.php?option=com_vikbooking&view=packagedetails&pkgid='.$this->pkg['id'].(!empty($pitemid) ? '&Itemid='.$pitemid : ''), false); ?>"><?php echo JText::translate('VBBACK'); ?></a>
895 <?php
896 } else {
897 ?>
898 <a class="vbo-goback-link vbo-pref-color-btn-secondary" href="<?php echo JRoute::rewrite('index.php?option=com_vikbooking&task=search&checkindate='.urlencode($checkinforlink).'&checkoutdate='.urlencode($checkoutforlink).'&roomsnum='.$this->roomsnum.$peopleforlink.(!empty($pitemid) ? '&Itemid='.$pitemid : ''), false); ?>"><?php echo JText::translate('VBBACK'); ?></a>
899 <?php
900 }
901 ?>
902 </div>
903 <input type="submit" name="goon" value="<?php echo JText::translate('VBBOOKNOW'); ?>" class="btn booknow vbo-pref-color-btn"/>
904 </div>
905 <?php
906 /**
907 * Keep any previously selected room index through the interactive geomap, if any.
908 */
909 foreach ($this->roomindex as $rindex) {
910 ?>
911 <input type="hidden" name="roomindex[]" value="<?php echo $rindex; ?>"/>
912 <?php
913 }
914
915 if (!empty($this->split_stay)) {
916 // add hidden fields for the split stay booking
917 foreach ($this->split_stay as $spsk => $sps_room) {
918 foreach ($sps_room as $sps_room_k => $sps_room_v) {
919 if ($sps_room_k == 'checkin_ts' || $sps_room_k == 'checkout_ts') {
920 // these values are better to be re-calculated
921 continue;
922 }
923 ?>
924 <input type="hidden" name="split_stay[<?php echo $spsk; ?>][<?php echo $sps_room_k; ?>]" value="<?php echo JHtml::fetch('esc_attr', $sps_room_v); ?>" />
925 <?php
926 }
927 }
928 }
929 ?>
930 </form>
931 </div>
932 <?php
933 if ($children_agepcent === true) {
934 $formatvals = VikBooking::getNumberFormatData();
935 $formatparts = explode(':', $formatvals);
936 ?>
937 <script type="text/javascript">
938 Number.prototype.numFormat = function(c, d, t) {
939 var n = this,
940 c = isNaN(c = Math.abs(c)) ? 2 : c,
941 d = d == undefined ? "." : d,
942 t = t == undefined ? "," : t,
943 i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "",
944 j = (j = i.length) > 3 ? j % 3 : 0;
945 return (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
946 };
947
948 jQuery(function() {
949 jQuery(".vbo-radio").change(function() {
950 var rnum = jQuery(this).attr("data-roomnum");
951 var rcost = parseFloat(jQuery(this).attr("data-ratecost"));
952 var rcostbase = parseFloat(jQuery(this).attr("data-ratecostbase"));
953 if (!isNaN(rcost) && jQuery("option[data-pcentintvroom='"+rnum+"']").length > 0) {
954 jQuery("option[data-pcentintvroom='"+rnum+"']").each(function() {
955 var usecost = rcost;
956 var ratetype = jQuery(this).attr('data-ratetype');
957 if (ratetype == 'base') {
958 usecost = rcostbase;
959 }
960 var pcentval = parseFloat(jQuery(this).attr("data-pcentintv"));
961 var agesval = jQuery(this).attr("data-ageintv");
962 if (!isNaN(pcentval) && agesval.length) {
963 var intvcost = usecost * pcentval / 100;
964 jQuery(this).html(agesval+" (+ "+(intvcost).numFormat(<?php echo $formatparts[0]; ?>, '<?php echo $formatparts[1]; ?>', '<?php echo $formatparts[2]; ?>')+" <?php echo $currencysymb; ?>)");
965 }
966 });
967 }
968 });
969 });
970 </script>
971 <?php
972 }
973