loadDatePicker(['type' => 'dates_range']); if (VikBooking::allowBooking()) { $is_mobile = VikBooking::detectUserAgent(false, false); $calendartype = VikBooking::calendarType(); $document = JFactory::getDocument(); // load modalframe lib for search suggestions $document->addStyleSheet(VBO_SITE_URI.'resources/jquery.fancybox.css'); JHtml::fetch('script', VBO_SITE_URI.'resources/jquery.fancybox.js'); // restrictions and values $restrictions = VikBooking::loadRestrictions(); $oldroomsnum = $session->get('vbroomsnum', ''); $oldarrpeople = $session->get('vbarrpeople', ''); $pcheckin = VikRequest::getInt('checkin', '', 'request'); $pcheckout = VikRequest::getInt('checkout', '', 'request'); $sesscheckin = $session->get('vbcheckin', ''); $sesscheckout = $session->get('vbcheckout', ''); $pcategories = VikRequest::getString('categories', '', 'request'); $pitemid = VikRequest::getInt('Itemid', '', 'request'); $pval = ""; $rval = ""; $vbdateformat = VikBooking::getDateFormat(); if ($vbdateformat == "%d/%m/%Y") { $df = 'd/m/Y'; } elseif ($vbdateformat == "%m/%d/%Y") { $df = 'm/d/Y'; } else { $df = 'Y/m/d'; } if (!empty($pcheckin) || !empty($sesscheckin)) { $pcheckin = !empty($pcheckin) ? $pcheckin : $sesscheckin; $dp = date($df, $pcheckin); if (VikBooking::dateIsValid($dp)) { $pval = $dp; } } if (!empty($pcheckout) || !empty($sesscheckout)) { $pcheckout = !empty($pcheckout) ? $pcheckout : $sesscheckout; $dr = date($df, $pcheckout); if (VikBooking::dateIsValid($dr)) { $rval = $dr; } } // form method is dependant to the platform $form_method = VBOPlatformDetection::isWordPress() ? 'post' : 'get'; $selform = "
\n"; $selform .= "\n"; $selform .= "\n"; $timeopst = VikBooking::getTimeOpenStore(); if (is_array($timeopst)) { $opent = VikBooking::getHoursMinutes($timeopst[0]); $closet = VikBooking::getHoursMinutes($timeopst[1]); $hcheckin = $opent[0]; $mcheckin = $opent[1]; $hcheckout = $closet[0]; $mcheckout = $closet[1]; } else { $hcheckin = 0; $mcheckin = 0; $hcheckout = 0; $mcheckout = 0; } // datepicker calendar setup if ($calendartype == "jqueryui") { if ($vbdateformat == "%d/%m/%Y") { $juidf = 'dd/mm/yy'; } elseif ($vbdateformat == "%m/%d/%Y") { $juidf = 'mm/dd/yy'; } else { $juidf = 'yy/mm/dd'; } // lang for jQuery UI Calendar is loaded through the application class $ldecl = ' jQuery.noConflict(); function vbGetDateObject(dstring) { var dparts = dstring.split("-"); return new Date(dparts[0], (parseInt(dparts[1]) - 1), parseInt(dparts[2]), 0, 0, 0, 0); } function vbFullObject(obj) { var jk; for(jk in obj) { return obj.hasOwnProperty(jk); } } var vbrestrctarange, vbrestrctdrange, vbrestrcta, vbrestrctd;'; $document->addScriptDeclaration($ldecl); // global restrictions $totrestrictions = count($restrictions); $wdaysrestrictions = []; $wdaystworestrictions = []; $wdaysrestrictionsrange = []; $wdaysrestrictionsmonths = []; $ctarestrictionsrange = []; $ctarestrictionsmonths = []; $ctdrestrictionsrange = []; $ctdrestrictionsmonths = []; $monthscomborestr = []; $minlosrestrictions = []; $minlosrestrictionsrange = []; $maxlosrestrictions = []; $maxlosrestrictionsrange = []; $notmultiplyminlosrestrictions = []; if ($totrestrictions > 0) { foreach ($restrictions as $rmonth => $restr) { if ($rmonth != 'range') { if (strlen((string)$restr['wday'])) { $wdaysrestrictions[($rmonth - 1)] = $restr['wday']; $wdaysrestrictionsmonths[] = $rmonth; if (strlen((string)$restr['wdaytwo'])) { $wdaystworestrictions[($rmonth - 1)] = $restr['wdaytwo']; $monthscomborestr[($rmonth - 1)] = VikBooking::parseJsDrangeWdayCombo($restr); } } elseif (!empty($restr['ctad']) || !empty($restr['ctdd'])) { if (!empty($restr['ctad'])) { $ctarestrictionsmonths[($rmonth - 1)] = explode(',', $restr['ctad']); } if (!empty($restr['ctdd'])) { $ctdrestrictionsmonths[($rmonth - 1)] = explode(',', $restr['ctdd']); } } if ($restr['multiplyminlos'] == 0) { $notmultiplyminlosrestrictions[] = $rmonth; } $minlosrestrictions[($rmonth - 1)] = $restr['minlos']; if (!empty($restr['maxlos']) && $restr['maxlos'] > 0 && $restr['maxlos'] >= $restr['minlos']) { $maxlosrestrictions[($rmonth - 1)] = $restr['maxlos']; } } else { foreach ($restr as $kr => $drestr) { if (strlen((string)$drestr['wday'])) { $wdaysrestrictionsrange[$kr][0] = date('Y-m-d', $drestr['dfrom']); $wdaysrestrictionsrange[$kr][1] = date('Y-m-d', $drestr['dto']); $wdaysrestrictionsrange[$kr][2] = $drestr['wday']; $wdaysrestrictionsrange[$kr][3] = $drestr['multiplyminlos']; $wdaysrestrictionsrange[$kr][4] = strlen((string)$drestr['wdaytwo']) ? $drestr['wdaytwo'] : -1; $wdaysrestrictionsrange[$kr][5] = VikBooking::parseJsDrangeWdayCombo($drestr); } elseif (!empty($drestr['ctad']) || !empty($drestr['ctdd'])) { $ctfrom = date('Y-m-d', $drestr['dfrom']); $ctto = date('Y-m-d', $drestr['dto']); if (!empty($drestr['ctad'])) { $ctarestrictionsrange[$kr][0] = $ctfrom; $ctarestrictionsrange[$kr][1] = $ctto; $ctarestrictionsrange[$kr][2] = explode(',', $drestr['ctad']); } if (!empty($drestr['ctdd'])) { $ctdrestrictionsrange[$kr][0] = $ctfrom; $ctdrestrictionsrange[$kr][1] = $ctto; $ctdrestrictionsrange[$kr][2] = explode(',', $drestr['ctdd']); } } $minlosrestrictionsrange[$kr][0] = date('Y-m-d', $drestr['dfrom']); $minlosrestrictionsrange[$kr][1] = date('Y-m-d', $drestr['dto']); $minlosrestrictionsrange[$kr][2] = $drestr['minlos']; if (!empty($drestr['maxlos']) && $drestr['maxlos'] > 0 && $drestr['maxlos'] >= $drestr['minlos']) { $maxlosrestrictionsrange[$kr] = $drestr['maxlos']; } } unset($restrictions['range']); } } $resdecl = " var vbrestrmonthswdays = " . json_encode($wdaysrestrictionsmonths) . "; var vbrestrmonths = " . json_encode(array_keys($restrictions)) . "; var vbrestrmonthscombojn = " . json_encode($monthscomborestr) . "; var vbrestrminlos = " . json_encode((object) $minlosrestrictions) . "; var vbrestrminlosrangejn = " . json_encode($minlosrestrictionsrange) . "; var vbrestrmultiplyminlos = " . json_encode($notmultiplyminlosrestrictions) . "; var vbrestrmaxlos = " . json_encode((object) $maxlosrestrictions) . "; var vbrestrmaxlosrangejn = " . json_encode($maxlosrestrictionsrange) . "; var vbrestrwdaysrangejn = " . json_encode($wdaysrestrictionsrange) . "; var vbrestrcta = " . json_encode($ctarestrictionsmonths) . "; var vbrestrctarange = " . json_encode($ctarestrictionsrange) . "; var vbrestrctd = " . json_encode($ctdrestrictionsmonths) . "; var vbrestrctdrange = " . json_encode($ctdrestrictionsrange) . "; var vbcombowdays = {}; function vbRefreshCheckout(darrive) { if (vbFullObject(vbcombowdays)) { var vbtosort = new Array(); for(var vbi in vbcombowdays) { if (vbcombowdays.hasOwnProperty(vbi)) { var vbusedate = darrive; vbtosort[vbi] = vbusedate.setDate(vbusedate.getDate() + (vbcombowdays[vbi] - 1 - vbusedate.getDay() + 7) % 7 + 1); } } vbtosort.sort(function(da, db) { return da > db ? 1 : -1; }); for(var vbnext in vbtosort) { if (vbtosort.hasOwnProperty(vbnext)) { var vbfirstnextd = new Date(vbtosort[vbnext]); jQuery('#checkindate').vboDatesRangePicker('checkout', 'minDate', vbfirstnextd); jQuery('#checkindate').vboDatesRangePicker('checkout', 'setcheckoutdate', vbfirstnextd); break; } } } } function vbSetMinCheckoutDate(selectedDate) { var minlos = ".VikBooking::getDefaultNightsCalendar()."; var maxlosrange = 0; var nowcheckin = jQuery('#checkindate').vboDatesRangePicker('getCheckinDate'); var nowd = nowcheckin.getDay(); var nowcheckindate = new Date(nowcheckin.getTime()); vbcombowdays = {}; if (vbFullObject(vbrestrminlosrangejn)) { for (var rk in vbrestrminlosrangejn) { if (vbrestrminlosrangejn.hasOwnProperty(rk)) { var minldrangeinit = vbGetDateObject(vbrestrminlosrangejn[rk][0]); if (nowcheckindate >= minldrangeinit) { var minldrangeend = vbGetDateObject(vbrestrminlosrangejn[rk][1]); if (nowcheckindate <= minldrangeend) { minlos = parseInt(vbrestrminlosrangejn[rk][2]); if (vbFullObject(vbrestrmaxlosrangejn)) { if (rk in vbrestrmaxlosrangejn) { maxlosrange = parseInt(vbrestrmaxlosrangejn[rk]); } } if (rk in vbrestrwdaysrangejn && nowd in vbrestrwdaysrangejn[rk][5]) { vbcombowdays = vbrestrwdaysrangejn[rk][5][nowd]; } } } } } } var nowm = nowcheckin.getMonth(); if (vbFullObject(vbrestrmonthscombojn) && vbrestrmonthscombojn.hasOwnProperty(nowm)) { if (nowd in vbrestrmonthscombojn[nowm]) { vbcombowdays = vbrestrmonthscombojn[nowm][nowd]; } } if (jQuery.inArray((nowm + 1), vbrestrmonths) != -1) { minlos = parseInt(vbrestrminlos[nowm]); } nowcheckindate.setDate(nowcheckindate.getDate() + minlos); jQuery('#checkindate').vboDatesRangePicker('checkout', 'minDate', nowcheckindate); jQuery('#checkindate').vboDatesRangePicker('checkout', 'minStayNights', minlos); if (maxlosrange > 0) { var diffmaxminlos = maxlosrange - minlos; var maxcheckoutdate = new Date(nowcheckindate.getTime()); maxcheckoutdate.setDate(maxcheckoutdate.getDate() + diffmaxminlos); jQuery('#checkindate').vboDatesRangePicker('checkout', 'maxDate', maxcheckoutdate); } if (nowm in vbrestrmaxlos) { var diffmaxminlos = parseInt(vbrestrmaxlos[nowm]) - minlos; var maxcheckoutdate = new Date(nowcheckindate.getTime()); maxcheckoutdate.setDate(maxcheckoutdate.getDate() + diffmaxminlos); jQuery('#checkindate').vboDatesRangePicker('checkout', 'maxDate', maxcheckoutdate); } if (!vbFullObject(vbcombowdays)) { var is_checkout_disabled = false; if (typeof selectedDate !== 'undefined' && typeof jQuery('#checkindate').vboDatesRangePicker('drpoption', 'beforeShowDay.checkout') === 'function') { // let the datepicker validate if the min date to set for check-out is disabled due to CTD rules is_checkout_disabled = !jQuery('#checkindate').vboDatesRangePicker('drpoption', 'beforeShowDay.checkout')(nowcheckindate)[0]; } if (!is_checkout_disabled) { jQuery('#checkindate').vboDatesRangePicker('checkout', 'setCheckoutDate', nowcheckindate); } else { setTimeout(() => { // make sure the minimum date just set for the checkout has not populated a CTD date that we do not want var current_out_dt = jQuery('#checkindate').vboDatesRangePicker('getCheckoutDate'); if (current_out_dt && current_out_dt.getTime() === nowcheckindate.getTime()) { jQuery('#checkindate').vboDatesRangePicker('checkout', 'setCheckoutDate', null); } }, 100); } } else { vbRefreshCheckout(nowcheckin); } }"; if ($wdaysrestrictions || $wdaysrestrictionsrange) { $resdecl .= " var vbrestrwdays = " . json_encode((object) $wdaysrestrictions) . "; var vbrestrwdaystwo = " . json_encode((object) $wdaystworestrictions) . "; function vbIsDayDisabled(date) { if (!vbIsDayOpen(date) || !vboValidateCta(date)) { return [false]; } var m = date.getMonth(), wd = date.getDay(); if (vbFullObject(vbrestrwdaysrangejn)) { for (var rk in vbrestrwdaysrangejn) { if (vbrestrwdaysrangejn.hasOwnProperty(rk)) { var wdrangeinit = vbGetDateObject(vbrestrwdaysrangejn[rk][0]); if (date >= wdrangeinit) { var wdrangeend = vbGetDateObject(vbrestrwdaysrangejn[rk][1]); if (date <= wdrangeend) { if (wd != vbrestrwdaysrangejn[rk][2]) { if (vbrestrwdaysrangejn[rk][4] == -1 || wd != vbrestrwdaysrangejn[rk][4]) { return [false]; } } } } } } } if (vbFullObject(vbrestrwdays)) { if (jQuery.inArray((m+1), vbrestrmonthswdays) == -1) { return [true]; } if (wd == vbrestrwdays[m]) { return [true]; } if (vbFullObject(vbrestrwdaystwo)) { if (wd == vbrestrwdaystwo[m]) { return [true]; } } return [false]; } return [true]; } function vbIsDayDisabledCheckout(date) { if (!vbIsDayOpen(date) || !vboValidateCtd(date)) { return [false]; } var m = date.getMonth(), wd = date.getDay(); if (vbFullObject(vbcombowdays)) { if (jQuery.inArray(wd, vbcombowdays) != -1) { return [true]; } else { return [false]; } } if (vbFullObject(vbrestrwdaysrangejn)) { for (var rk in vbrestrwdaysrangejn) { if (vbrestrwdaysrangejn.hasOwnProperty(rk)) { var wdrangeinit = vbGetDateObject(vbrestrwdaysrangejn[rk][0]); if (date >= wdrangeinit) { var wdrangeend = vbGetDateObject(vbrestrwdaysrangejn[rk][1]); if (date <= wdrangeend) { if (wd != vbrestrwdaysrangejn[rk][2] && vbrestrwdaysrangejn[rk][3] == 1) { return [false]; } } } } } } if (vbFullObject(vbrestrwdays)) { if (jQuery.inArray((m+1), vbrestrmonthswdays) == -1 || jQuery.inArray((m+1), vbrestrmultiplyminlos) != -1) { return [true]; } if (wd == vbrestrwdays[m]) { return [true]; } return [false]; } return [true]; }"; } $document->addScriptDeclaration($resdecl); } // global closing dates $closing_dates = VikBooking::parseJsClosingDates(); $sdecl = " var vbclosingdates = " . json_encode($closing_dates) . "; function vbCheckClosingDatesIn(date) { if (!vbIsDayOpen(date) || !vboValidateCta(date)) { return [false]; } return [true]; } function vbCheckClosingDatesOut(date) { if (!vbIsDayOpen(date) || !vboValidateCtd(date)) { return [false]; } return [true]; } function vbIsDayOpen(date) { if (vbFullObject(vbclosingdates)) { for (var cd in vbclosingdates) { if (vbclosingdates.hasOwnProperty(cd)) { var cdfrom = vbGetDateObject(vbclosingdates[cd][0]); var cdto = vbGetDateObject(vbclosingdates[cd][1]); if (date >= cdfrom && date <= cdto) { return false; } } } } return true; } function vboValidateCta(date) { var m = date.getMonth(), wd = date.getDay(); if (vbFullObject(vbrestrctarange)) { for (var rk in vbrestrctarange) { if (vbrestrctarange.hasOwnProperty(rk)) { var wdrangeinit = vbGetDateObject(vbrestrctarange[rk][0]); if (date >= wdrangeinit) { var wdrangeend = vbGetDateObject(vbrestrctarange[rk][1]); if (date <= wdrangeend) { if (jQuery.inArray('-'+wd+'-', vbrestrctarange[rk][2]) >= 0) { return false; } } } } } } if (vbFullObject(vbrestrcta)) { if (vbrestrcta.hasOwnProperty(m) && jQuery.inArray('-'+wd+'-', vbrestrcta[m]) >= 0) { return false; } } return true; } function vboValidateCtd(date) { var m = date.getMonth(), wd = date.getDay(); if (vbFullObject(vbrestrctdrange)) { for (var rk in vbrestrctdrange) { if (vbrestrctdrange.hasOwnProperty(rk)) { var wdrangeinit = vbGetDateObject(vbrestrctdrange[rk][0]); if (date >= wdrangeinit) { var wdrangeend = vbGetDateObject(vbrestrctdrange[rk][1]); if (date <= wdrangeend) { if (jQuery.inArray('-'+wd+'-', vbrestrctdrange[rk][2]) >= 0) { return false; } } } } } } if (vbFullObject(vbrestrctd)) { if (vbrestrctd.hasOwnProperty(m) && jQuery.inArray('-'+wd+'-', vbrestrctd[m]) >= 0) { return false; } } return true; } function vbSetGlobalMinCheckoutDate() { var minlos = ".VikBooking::getDefaultNightsCalendar()."; var nowcheckin = jQuery('#checkindate').vboDatesRangePicker('getCheckinDate'); var nowcheckindate = new Date(nowcheckin.getTime()); nowcheckindate.setDate(nowcheckindate.getDate() + minlos); jQuery('#checkindate').vboDatesRangePicker('checkout', 'minDate', nowcheckindate); jQuery('#checkindate').vboDatesRangePicker('checkout', 'minStayNights', minlos); jQuery('#checkindate').vboDatesRangePicker('checkout', 'setCheckoutDate', nowcheckindate); } jQuery(function() { // reset regional jQuery.datepicker.setDefaults(jQuery.datepicker.regional['']); // start DRP jQuery('#checkindate').vboDatesRangePicker({ checkout: '#checkoutdate', dateFormat: '{$juidf}', showOn: 'focus', numberOfMonths: " . ($is_mobile ? '1' : '2') . ", minDate: '" . VikBooking::getMinDaysAdvance() . "d', maxDate: '" . VikBooking::getMaxDateFuture() . "', beforeShowDay: { checkin: " . ($wdaysrestrictions || $wdaysrestrictionsrange ? 'vbIsDayDisabled' : 'vbCheckClosingDatesIn') . ", checkout: " . ($wdaysrestrictions || $wdaysrestrictionsrange ? 'vbIsDayDisabledCheckout' : 'vbCheckClosingDatesOut') . ", }, onSelect: { checkin: (selectedDate) => { " . ($totrestrictions ? 'vbSetMinCheckoutDate(selectedDate);' : 'vbSetGlobalMinCheckoutDate();') . " vbCalcNights(); }, checkout: (selectedDate) => { vbCalcNights(); }, }, labels: { checkin: Joomla.JText._('VBPICKUPROOM'), checkout: Joomla.JText._('VBRETURNROOM'), minStayNights: (nights) => { return (Joomla.JText._('VBO_MIN_STAY_NIGHTS') + '').replace('%d', nights); }, }, bottomCommands: { clear: Joomla.JText._('VBO_CLEAR_DATES'), close: Joomla.JText._('VBO_CLOSE'), onClear: () => { vbCalcNights(); }, }, }); // set proper regional jQuery('#checkindate').datepicker('option', jQuery.datepicker.regional['vikbooking']); // register additional triggers jQuery('.vb-cal-img, .vbo-caltrigger').click(function() { let dp = jQuery(this).prev('input'); if (!dp.length) { return; } if (dp.hasClass('hasDatepicker')) { dp.focus(); } else if (dp.attr('id') == 'checkoutdate') { jQuery('#checkindate').focus(); } }); });"; // add script declaration to document $document->addScriptDeclaration($sdecl); // add HTML code to the form $selform .= "
\n"; $selform .= "
\n"; } else { // default platform Calendar $selform .= "
" . $vbo_app->getCalendar('', 'checkindate', 'checkindate', $vbdateformat, array ('class' => '','size' => '10','maxlength' => '19')); $selform .= "
\n"; $selform .= "
" . $vbo_app->getCalendar('', 'checkoutdate', 'checkoutdate', $vbdateformat, array ('class' => '','size' => '10','maxlength' => '19')); $selform .= "
\n"; } // rooms, adults, children $showchildren = VikBooking::showChildrenFront(); $guests_label = VBOFactory::getConfig()->get('guests_label', 'adults'); $use_guests_label = 'VBFORMADULTS'; if (!$showchildren && !strcasecmp($guests_label, 'guests')) { $use_guests_label = 'VBOINVTOTGUESTS'; } // max number of rooms $maxsearchnumrooms = VikBooking::getSearchNumRooms(); if (intval($maxsearchnumrooms) > 1) { $roomsel = "\n"; } else { $roomsel = "\n"; } // max number of adults per room $globnumadults = VikBooking::getSearchNumAdults(); $adultsparts = explode('-', $globnumadults); $adultsel = ""; // max number of children per room $globnumchildren = VikBooking::getSearchNumChildren(); $childrenparts = explode('-', $globnumchildren); $childrensel = ""; // $selform .= "
\n"; $selform .= "
".$roomsel."
\n"; $selform .= "
\n"; $selform .= "
".(intval($maxsearchnumrooms) > 1 || (!empty($oldroomsnum) && (int)$oldroomsnum > 1) ? "".JText::translate('VBFORMNUMROOM')." 1" : "")."\n"; $selform .= "
".$adultsel."
\n"; if ($showchildren) { $selform .= "
".$childrensel."
\n"; } $selform .= "
\n"; $selform .= "
\n"; //the tag
will be used by javascript to calculate the nights $selform .= "
\n"; $selform .= "
\n"; if (VikBooking::showCategoriesFront()) { $q = "SELECT * FROM `#__vikbooking_categories` ORDER BY `#__vikbooking_categories`.`name` ASC;"; $dbo->setQuery($q); $categories = $dbo->loadAssocList(); if ($categories) { $vbo_tn->translateContents($categories, '#__vikbooking_categories'); $selform .= "
\n"; } } $selform .= "
\n"; $selform .= "
\n"; $selform .= (!empty ($pitemid) ? "" : "") . "
"; ?> " . $err . "

"; } ?>
0 && (int)VikBooking::showSearchSuggestions() > 0) { if (!empty($pitemid) && !isset($err_code_info['Itemid'])) { $err_code_info['Itemid'] = $pitemid; } /** * We also inject the current category filter to suggest only rooms of the same category. * * @since 1.14 (J) - 1.4.0 (WP) */ if (!empty($pcategories) && $pcategories != 'all') { $err_code_info['categories'] = $pcategories; } // /** * Clients have reported that in case of error code #1 (no availability for the party requested, but some rooms would * be able to allocate the party in the rooms that are simply not available on the requested dates), we should not * suggest only other closed booking dates, but rather check for also other possible booking solutions. In short, * if the error code is #1, we should perform another AJAX request like if the error code was #2 (query failed for * fetching the rooms, no rates defined for this number of nights or no rooms for the party requested). * * @since 1.13.5 (J) - 1.3.6 (WP) */ $rq_err_code_infos = array(); if ($err_code_info['code'] === 1) { // clone the error code info array $copy_errcode = $err_code_info; // overwrite error code to #2 $copy_errcode['code'] = 2; // push first request to fetch other possible rooms (higher priority to get the booking) array_push($rq_err_code_infos, $copy_errcode); // then push the regular error code #1 to find the closest available booking dates array_push($rq_err_code_infos, $err_code_info); // if split stays are enabled, we invert the error code positions if (VBOFactory::getConfig()->get('split_stay_ratio', 0) > 0) { $rq_err_code_infos = array_reverse($rq_err_code_infos); } } else { // push the regular error code info to make just one request array_push($rq_err_code_infos, $err_code_info); } ?>
1 && count($oldarrpeople) > 0) { $oldroomscountadults = array(); $oldroomscountchildren = array(); for($i = 2; $i <= $oldroomsnum; $i++) { $globnumadults = VikBooking::getSearchNumAdults(); $adultsparts = explode('-', $globnumadults); $adultsel = ""; $oldroomscountadults[$i] = $adultsel; $globnumchildren = VikBooking::getSearchNumChildren(); $childrenparts = explode('-', $globnumchildren); $childrensel = ""; $oldroomscountchildren[$i] = $childrensel; } ?>