rooms; $tsstart = $this->tsstart; $wmonthsel = $this->wmonthsel; $busy = $this->busy; $vbo_tn = $this->vbo_tn; $showpartlyres=VikBooking::showPartlyReserved(); $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'; } $datesep = VikBooking::getDateSeparator(); $document = JFactory::getDocument(); //load jQuery if (VikBooking::loadJquery()) { //JHtml::fetch('jquery.framework', true, true); JHtml::fetch('script', VBO_SITE_URI.'resources/jquery-1.12.4.min.js'); } $pmonth = VikRequest::getInt('month', '', 'request'); $pshowtype = VikRequest::getInt('showtype', 2, 'request'); //1 = do not show the units - 2 = show the units remaning - 3 = show the number of units booked. $pshowtype = $pshowtype >= 1 && $pshowtype <= 3 ? $pshowtype : 1; $pitemid = VikRequest::getString('Itemid', '', 'request'); $begin_info = getdate($tsstart); $rids_qstring = ''; foreach ($rooms as $room) { $rids_qstring .= '&room_ids[]=' . $room['id']; } $inonout_allowed = true; $timeopst = VikBooking::getTimeOpenStore(); if (is_array($timeopst)) { if ($timeopst[0] < $timeopst[1]) { // check-in not allowed on a day where there is already a check out (no arrivals/depatures on the same day) $inonout_allowed = false; } } ?>

     
0 ? true : false; $days_labels = array( JText::translate('VBSUN'), JText::translate('VBMON'), JText::translate('VBTUE'), JText::translate('VBWED'), JText::translate('VBTHU'), JText::translate('VBFRI'), JText::translate('VBSAT') ); ?>
$room) { $nowts = $begin_info; $carats = VikBooking::getRoomCaratOriz($room['idcarat'], $vbo_tn); ?>
<?php echo htmlspecialchars($room['name']); ?>

0) { foreach ($busy[$room['id']] as $b) { $info_in = getdate($b['checkin']); $checkin_ts = mktime(0, 0, 0, $info_in['mon'], $info_in['mday'], $info_in['year']); $info_out = getdate($b['checkout']); $checkout_ts = mktime(0, 0, 0, $info_out['mon'], $info_out['mday'], $info_out['year']); if ($nowts[0] >= $checkin_ts && $nowts[0] == $checkout_ts) { $is_checkout = true; } if ($nowts[0] >= $checkin_ts && $nowts[0] < $checkout_ts) { $totfound++; $dclass = "vbo-occupied-cell"; if ($nowts[0] == $checkin_ts) { $is_checkin = true; } } } } $useday = ($nowts['mday'] < 10 ? "0".$nowts['mday'] : $nowts['mday']); $dclass .= ($totfound < $room['units'] && $totfound > 0 ? ' vbo-partially-cell' : ''); // partially reserved days can be disabled from the configuration $dclass = !$showpartlyres && $totfound < $room['units'] && $totfound > 0 ? 'vbo-free-cell' : $dclass; if ($is_checkout && $room['units'] < 2 && !$inonout_allowed) { // in case check-in on check-out is disabled, add the occupied class for the check-out date $totfound = 1; $dclass = "vbo-occupied-cell"; } // check if the date is closed at property-level if (!$totfound && VikBooking::validateClosingDates($nowts[0], ($nowts[0] + 86399))) { // this date is closed at property-level $totfound = $room['units']; $dclass = "vbo-occupied-cell"; } $show_day_units = $totfound; if ($pshowtype == 1) { $show_day_units = ''; } elseif ($pshowtype == 2 && $totfound >= 1) { $show_day_units = ($room['units'] - $totfound); $show_day_units = $show_day_units < 0 ? 0 : $show_day_units; } elseif ($pshowtype == 3 && $totfound >= 1) { $show_day_units = $totfound; } if (!$showpartlyres && $totfound < $room['units'] && $totfound > 0) { $show_day_units = ''; } if ($totfound == 1) { $dclass .= $is_checkin === true ? ' vbo-checkinday-cell' : ''; $dclass .= $is_checkout === true ? ' vbo-checkoutday-cell' : ''; $dlnk = "".$show_day_units.""; } elseif ($totfound > 1) { $dlnk = "".$show_day_units.""; } ?>
" data-cell-ts="">