rows; $arrbusy = $this->arrbusy; $wmonthsel = $this->wmonthsel; $tsstart = $this->tsstart; $lim0 = $this->lim0; $navbut = $this->navbut; $vbo_auth_pricing = JFactory::getUser()->authorise('core.vbo.pricing', 'com_vikbooking'); $vbo_app = VikBooking::getVboApplication(); JHtml::fetch('script', VBO_SITE_URI.'resources/jquery-ui.min.js'); JHtml::fetch('script', VBO_ADMIN_URI.'resources/js_upload/jquery.stickytableheaders.min.js'); // JS lang defs JText::script('VBSAVE'); JText::script('VBPVIEWORDERSTHREE'); JText::script('VBEDITORDERTHREE'); JText::script('VBDAYS'); JText::script('VBDAY'); JText::script('VBMAILADULTS'); JText::script('VBMAILADULT'); JText::script('VBMAILCHILDREN'); JText::script('VBMAILCHILD'); JText::script('VBO_MISSING_SUBUNIT'); JText::script('VBO_SHOW_CANCELLATIONS'); JText::script('VBO_DRAG_SUBUNITS_SAMEDATE'); JText::script('VBPVIEWORDERCHANNEL'); JText::script('VBANNULLA'); JText::script('VIKLOADING'); JText::script('VBOVWDNDERRNOTENCELLS'); JText::script('VBOVWDNDMOVINGBID'); JText::script('VBOVWDNDMOVINGROOM'); JText::script('VBOVWDNDMOVINGDATES'); JText::script('VBEDITORDERROOMSNUM'); JText::script('VBEDITORDERADULTS'); JText::script('VBPICKUPAT'); JText::script('VBRELEASEAT'); JText::script('VBEDITORDERCHILDREN'); JText::script('VBEDITORDERNINE'); JText::script('VBPEDITBUSYTOTPAID'); JText::script('VBOFEATASSIGNUNIT'); JText::script('VBO_SPLIT_STAY'); JText::script('VBO_CONF_SWAP_RNUMB'); JText::script('VBO_ERR_SUBUN_MOVE_SUBUN'); $days_labels = [ JText::translate('VBSUN'), JText::translate('VBMON'), JText::translate('VBTUE'), JText::translate('VBWED'), JText::translate('VBTHU'), JText::translate('VBFRI'), JText::translate('VBSAT') ]; $nowdf = VikBooking::getDateFormat(); if ($nowdf == "%d/%m/%Y") { $df = 'd/m/Y'; } elseif ($nowdf == "%m/%d/%Y") { $df = 'm/d/Y'; } else { $df = 'Y/m/d'; } $currencysymb = VikBooking::getCurrencySymb(true); $pdebug = VikRequest::getInt('e4j_debug', '', 'request'); $session = JFactory::getSession(); $show_type = $session->get('vbUnitsShowType', ''); $mnum = $session->get('vbOvwMnum', '1'); $mnum = intval($mnum); $pcategory_id = $session->get('vbOvwCatid', 0); $cookie = JFactory::getApplication()->input->cookie; $cookie_uleft = $cookie->get('vboAovwUleft', '', 'string'); $cookie_sticky_heads = $cookie->get('vboAovwStheads', 'off', 'string'); $colortags = VikBooking::loadBookingsColorTags(); // View mode - Classic or Tags $pbmode = $session->get('vbTagsMode', 'classic'); $tags_view_supported = false; // Room Units Distinctive Features $rooms_features_map = []; $rooms_features_bookings = []; $rooms_bids_pools = []; $room_bookings_pool = []; $bids_checkins = []; $index_loop = 0; foreach ($rows as $kr => $room) { if ($room['units'] <= 1) { $tags_view_supported = true; } else { if (!empty($room['params']) && $room['units'] <= 150) { //sub-room units only if room type has 150 units at most $room_params = json_decode($room['params'], true); if (is_array($room_params) && isset($room_params['features']) && is_array($room_params['features'])) { $rooms_features_map[$room['id']] = []; foreach ($room_params['features'] as $rind => $rfeatures) { foreach ($rfeatures as $fname => $fval) { if (strlen($fval)) { // $rooms_features_map[$room['id']][$rind] = '#'.$rind.' - '.JText::translate($fname).': '.$fval; $rooms_features_map[$room['id']][$rind] = "#{$rind} - {$fval}"; break; } } } if (!$rooms_features_map[$room['id']]) { unset($rooms_features_map[$room['id']]); } else { foreach ($rooms_features_map[$room['id']] as $rind => $indexdata) { $clone_room = $room; $clone_room['unit_index'] = (int)$rind; $clone_room['unit_index_str'] = $indexdata; array_splice($rows, ($kr + 1 + $index_loop), 0, [$clone_room]); $index_loop++; } } } } } } if (!$tags_view_supported) { $pbmode = 'classic'; } // locked (stand-by) records $arrlocked = []; if (array_key_exists('tmplock', $arrbusy)) { if (count($arrbusy['tmplock']) > 0) { $arrlocked = $arrbusy['tmplock']; } unset($arrbusy['tmplock']); } ?>
categories)) { ?>
10) { if (VBOPlatformDetection::isJoomla()) { /** * @joomlaonly fixed offset selector is ".navbar" */ $stickyheaders_cmd_on = "jQuery('table.vboverviewtable').stickyTableHeaders({cacheHeaderHeight: true, fixedOffset: (jQuery('.navbar').length ? jQuery('.navbar') : jQuery('#subhead-container'))});"; } else { /** * @wponly fixed offset selector is "#wpadminbar" */ $stickyheaders_cmd_on = "jQuery('table.vboverviewtable').stickyTableHeaders({cacheHeaderHeight: true, fixedOffset: jQuery('#wpadminbar')});"; } $stickyheaders_cmd_off = "jQuery('table.vboverviewtable').stickyTableHeaders('destroy'); jQuery('th.bluedays').attr('style', '');"; } ?> 10) { ?>
0) { ?>
$ctagv) { ?>
 
 
 
> = $ritts && $moncurts[0] < $conts)) { // booking does not involve the current day continue; } $dclass = "vbo-overv-avcell busy"; $bid = $b['idorder']; $is_sharedcal = !empty($b['sharedcal']) ? true : $is_sharedcal; $is_closure = !empty($b['closure']) ? true : $is_closure; $bid_str = '-' . $bid . '-'; if (!in_array($bid_str, $bids_pool)) { $bids_pool[] = $bid_str; } if (isset($rooms_features_map[$room['id']])) { // multi-unit room with distinctive features defined if (!isset($room_bids_pool[$cur_day_key])) { $room_bids_pool[$cur_day_key] = []; $room_bookings[$cur_day_key] = []; } $room_bids_pool[$cur_day_key][] = (int)$bid; $room_bookings[$cur_day_key][] = $b; } elseif ($room['units'] == 1) { // single-unit room if (!isset($room_bookings[$cur_day_key])) { $room_bookings[$cur_day_key] = []; } $room_bookings[$cur_day_key][] = $b; } if ($moncurts[0] == $ritts) { $dalt = JText::translate('VBPICKUPAT')." ".date('H:i', $b['checkin']); $is_checkin = true; $lastbidcheckout = $b['checkout']; $bids_checkins[$bid] = $cur_day_key; } elseif ($moncurts[0] == $conts) { $dalt = JText::translate('VBRELEASEAT')." ".date('H:i', $b['checkout']); } $totfound++; } } // locked (stand-by) records if ($room_tags_view === true && isset($arrlocked[$room['id']]) && $arrlocked[$room['id']] && !$is_subunit) { foreach ($arrlocked[$room['id']] as $l) { $tmpone = getdate($l['checkin']); $ritts = mktime(0, 0, 0, $tmpone['mon'], $tmpone['mday'], $tmpone['year']); $tmptwo = getdate($l['checkout']); $conts = mktime(0, 0, 0, $tmptwo['mon'], $tmptwo['mday'], $tmptwo['year']); if ($moncurts[0] >= $ritts && $moncurts[0] < $conts) { $dclass = strpos($dclass, "notbusy") !== false ? "busytmplock" : "busy busytmplock"; $bid = $l['idorder']; if (!in_array($bid, $bids_pool)) { if (count($bids_pool) > 0) { array_unshift($bids_pool, '-'.$bid.'-'); } else { $bids_pool[] = '-'.$bid.'-'; } } if ($moncurts[0] == $ritts) { $dalt = JText::translate('VBPICKUPAT')." ".date('H:i', $l['checkin']); } elseif ($moncurts[0] == $conts) { $dalt = JText::translate('VBRELEASEAT')." ".date('H:i', $l['checkout']); } $totfound++; } } } // handle single-unit room reservations if ($room['units'] == 1 && !isset($rooms_features_map[$room['id']]) && isset($room_bookings[$cur_day_key]) && $room_bookings[$cur_day_key]) { // set the first (and only) booking $day_booking = []; foreach ($room_bookings[$cur_day_key] as $day_res) { if (!$day_res['closure'] && !$day_res['sharedcal']) { $day_booking = $day_res; break; } } if ($day_booking) { if (!isset($room_bookings_pool[$room['id']])) { $room_bookings_pool[$room['id']] = []; } if (!isset($room_bookings_pool[$room['id']][$cur_day_key])) { $room_bookings_pool[$room['id']][$cur_day_key] = []; } $room_bookings_pool[$room['id']][$cur_day_key][0] = $day_booking; } } $useday = $moncurts['mday'] < 10 ? "0{$moncurts['mday']}" : $moncurts['mday']; $dclass .= $totfound < $room['units'] && $totfound > 0 ? ' vbo-partially' : ''; $dclass .= $is_sharedcal ? ' busy-sharedcalendar' : ''; $dclass .= $is_closure ? ' busy-closure' : ''; $dstyle = ''; $astyle = ''; if ($room_tags_view === true && $totfound > 0) { $last_bid = intval(str_replace('-', '', $bids_pool[(count($bids_pool) - 1)])); $binfo = VikBooking::getBookingInfoFromID($last_bid); if (count($binfo) > 0) { $bcolortag = VikBooking::applyBookingColorTag($binfo); if (count($bcolortag) > 0) { $bcolortag['name'] = JText::translate($bcolortag['name']); $dstyle = " style=\"background-color: ".$bcolortag['color']."; color: ".(array_key_exists('fontcolor', $bcolortag) ? $bcolortag['fontcolor'] : '#ffffff').";\" data-lastbid=\"".$last_bid."\""; $astyle = " style=\"color: ".(array_key_exists('fontcolor', $bcolortag) ? $bcolortag['fontcolor'] : '#ffffff').";\""; $dclass .= ' vbo-hascolortag'; } } } if ($is_subunit && isset($rooms_features_bookings[$room['id']]) && isset($rooms_bids_pools[$room['id']][$cur_day_key]) && isset($rooms_features_bookings[$room['id']][$room['unit_index']])) { foreach ($rooms_bids_pools[$room['id']][$cur_day_key] as $bid) { $bid = intval(str_replace('-', '', $bid)); if (in_array($bid, $rooms_features_bookings[$room['id']][$room['unit_index']])) { $room['units'] = 1; $totfound = 1; $dclass = "vbo-overv-avcell subroom-busy"; $is_checkin = isset($bids_checkins[$bid]) && $bids_checkins[$bid] == $cur_day_key ? true : $is_checkin; break; } } } $write_units = $show_type == 'units-left' || (!empty($cookie_uleft) && $cookie_uleft == 'units-left') ? ($room['units'] - $totfound) : $totfound; // check today's date $curdayymd = date('Y-m-d', $moncurts[0]); if ($todayymd == $curdayymd) { $dclass .= ' vbo-overv-todaycell'; } if (isset($this->festivities[$curdayymd])) { $dclass .= ' vbo-overv-festcell'; } /** * Critical dates defined at room-day level. * * @since 1.13.5 (J) - 1.3.5 (WP) */ $rdaynote_keyid = $cur_day_key . '_' . $room['id'] . '_' . (isset($room['unit_index']) ? $room['unit_index'] : '0'); if (isset($this->rdaynotes[$rdaynote_keyid])) { // note exists for this combination of date, room ID and subunit $dclass .= ' vbo-roomdaynote-full'; $rdaynote_icn = 'sticky-note'; } else { // no notes for this cell $dclass .= ' vbo-roomdaynote-empty'; $rdaynote_icn = 'far fa-sticky-note'; } $critical_note = ''; /** * Closures overlapping one real reservation for a single-unit room should still * allow the display of the booking snake if it's just one real reservation. */ $closure_on_real_res = false; if ($totfound === 2 && !$is_subunit && $room['units'] == 1 && $cookie_sticky_heads == 'off' && strpos($dclass, "busy-closure") !== false) { if (isset($room_bookings_pool[$room['id']]) && isset($room_bookings_pool[$room['id']][$cur_day_key]) && $room_bookings_pool[$room['id']][$cur_day_key]) { if (isset($room_bookings_pool[$room['id']][$cur_day_key][0]) && !$room_bookings_pool[$room['id']][$cur_day_key][0]['closure']) { // found a real booking on a date with at least one closure $closure_on_real_res = true; } } } // prepare cell content if ($totfound === 1 || $closure_on_real_res) { $day_booking_snake = ''; $day_booking_data = []; if (isset($room_bookings_pool[$room['id']]) && isset($room_bookings_pool[$room['id']][$cur_day_key]) && $room_bookings_pool[$room['id']][$cur_day_key]) { if ($is_subunit && isset($room_bookings_pool[$room['id']][$cur_day_key][$room['unit_index']])) { $day_booking_data = $room_bookings_pool[$room['id']][$cur_day_key][$room['unit_index']]; } elseif (!$is_subunit && isset($room_bookings_pool[$room['id']][$cur_day_key][0])) { $day_booking_data = $room_bookings_pool[$room['id']][$cur_day_key][0]; } } if (isset($room_bookings_pool[$room['id']]) && isset($room_bookings_pool[$room['id']][$prev_day_key]) && $room_bookings_pool[$room['id']][$prev_day_key]) { if ($is_subunit && isset($room_bookings_pool[$room['id']][$prev_day_key][$room['unit_index']])) { if (date('Y-m-d', $room_bookings_pool[$room['id']][$prev_day_key][$room['unit_index']]['checkout']) == $cur_day_key) { // prepend checkout snake $day_booking_snake .= '
 
'; } } elseif (!$is_subunit && $room['units'] == 1 && isset($room_bookings_pool[$room['id']][$prev_day_key][0])) { if (date('Y-m-d', $room_bookings_pool[$room['id']][$prev_day_key][0]['checkout']) == $cur_day_key) { // prepend checkout snake $day_booking_snake .= '
 
'; } } } if ($room['units'] == 1 && $day_booking_data && !$day_booking_data['closure']) { // build tableaux-style snake container for guest $customer_descr = ''; if ($is_checkin) { // customer details if (!empty($day_booking_data['first_name']) || !empty($day_booking_data['last_name'])) { // check if we need to display a profile picture or a channel logo $booking_avatar_src = null; $booking_avatar_alt = null; if (!empty($day_booking_data['pic'])) { // customer profile picture $booking_avatar_src = strpos($day_booking_data['pic'], 'http') === 0 ? $day_booking_data['pic'] : VBO_SITE_URI . 'resources/uploads/' . $day_booking_data['pic']; $booking_avatar_alt = basename($booking_avatar_src); } elseif (!empty($day_booking_data['idorderota']) && !empty($day_booking_data['channel'])) { // channel logo $logo_helper = VikBooking::getVcmChannelsLogo($day_booking_data['channel'], $get_istance = true); if ($logo_helper !== false) { $booking_avatar_src = $logo_helper->getSmallLogoURL(); $booking_avatar_alt = $logo_helper->provenience; } } if (!empty($booking_avatar_src)) { // make sure the alt attribute is not too long in case of broken images $booking_avatar_alt = !empty($booking_avatar_alt) && strlen($booking_avatar_alt) > 15 ? '...' . substr($booking_avatar_alt, -12) : $booking_avatar_alt; // append booking avatar image $customer_descr .= ''; } // customer name $customer_fullname = trim($day_booking_data['first_name'] . ' ' . $day_booking_data['last_name']); if (strlen($customer_fullname) > 26) { if (function_exists('mb_substr')) { $customer_fullname = trim(mb_substr($customer_fullname, 0, 26, 'UTF-8')) . '..'; } else { $customer_fullname = trim(substr($customer_fullname, 0, 26)) . '..'; } } $customer_descr .= '' . $customer_fullname . ''; } else { // parse the customer data string $custdata_parts = explode("\n", $day_booking_data['custdata']); $enoughinfo = false; if (count($custdata_parts) > 2 && strpos($custdata_parts[0], ':') !== false && strpos($custdata_parts[1], ':') !== false) { // get the first two fields $custvalues = array(); foreach ($custdata_parts as $custdet) { if (strlen($custdet) < 1) { continue; } $custdet_parts = explode(':', $custdet); if (count($custdet_parts) >= 2) { unset($custdet_parts[0]); array_push($custvalues, trim(implode(':', $custdet_parts))); } if (count($custvalues) > 1) { break; } } if (count($custvalues) > 1) { $enoughinfo = true; $customer_nominative = trim(implode(' ', $custvalues)); if (strlen($customer_nominative) > 26) { if (function_exists('mb_substr')) { $customer_nominative = trim(mb_substr($customer_nominative, 0, 26, 'UTF-8')) . '..'; } else { $customer_nominative = trim(substr($customer_nominative, 0, 26)) . '..'; } } if (!empty($day_booking_data['idorderota']) && !empty($day_booking_data['channel'])) { // add support for the channel logo for the imported OTA reservations with no customer record $logo_helper = VikBooking::getVcmChannelsLogo($day_booking_data['channel'], $get_istance = true); if ($logo_helper !== false) { $booking_avatar_src = $logo_helper->getSmallLogoURL(); $booking_avatar_alt = $logo_helper->provenience; // make sure the alt attribute is not too long in case of broken images $booking_avatar_alt = !empty($booking_avatar_alt) && strlen($booking_avatar_alt) > 15 ? '...' . substr($booking_avatar_alt, -12) : $booking_avatar_alt; // append booking avatar image $customer_descr .= ''; } } // set customer nominative built $customer_descr .= '' . $customer_nominative . '';; } } if (!$enoughinfo) { $customer_descr .= '#' . $day_booking_data['idorder'] . '';; } } } // set value $day_booking_snake .= '
' . ($is_checkin ? $customer_descr : ' ') . '
'; } if ($cookie_sticky_heads != 'off') { // not supported with the sticky table headers layout $day_booking_snake = ''; } $write_units = strpos($dclass, "subroom-busy") !== false ? '' : $write_units; $stopdrag = ($mind == $mnum && !is_null($lastbidcheckout) && (int)date('n', $lastbidcheckout) != (int)$mon); $dclass .= $is_checkin === true ? ' vbo-checkinday' : ''; // build proper link if ($totfound > 1) { // there must be a closure overlapping a real booking $cell_link = 'index.php?option=com_vikbooking&task=choosebusy&idroom=' . $room['id'] . '&ts=' . $moncurts[0] . '&goto=overv'; } else { // regular situation with one booking only $cell_link = 'index.php?option=com_vikbooking&task=editbusy&cid[]=' . $bid . '&goto=overv'; } ?> 1) { ?> $rindex_bids) { if (!is_array($rindex_bids) || !$rindex_bids) { continue; } foreach ($rindex_bids as $seek_bid) { foreach ($room_bookings as $day_key => $day_ress) { foreach ($day_ress as $day_res) { if ($day_res['idorder'] != $seek_bid) { continue; } if (!isset($room_bookings_pool[$room['id']])) { $room_bookings_pool[$room['id']] = []; } if (!isset($room_bookings_pool[$room['id']][$day_key])) { $room_bookings_pool[$room['id']][$day_key] = []; } $room_bookings_pool[$room['id']][$day_key][$rindex] = $day_res; } } } } } } // close row ?>
data-day="" data-units-booked="" data-units-left="" data-bids=""> "> "> data-day="" data-units-booked="" data-units-left="" data-bids=""> >  '; } } elseif (!$is_subunit && $room['units'] == 1 && isset($room_bookings_pool[$room['id']][$prev_day_key][0])) { if (date('Y-m-d', $room_bookings_pool[$room['id']][$prev_day_key][0]['checkout']) == $cur_day_key) { // prepend checkout snake echo '
 
'; } } } echo $critical_note; ?>
getJmodalScript('', 'vboJModalHideCallback();', ''); echo $vbo_app->getJmodalHtml('vbo-new-res', JText::translate('VBOSHOWQUICKRES')); //end Prepare modal ?>
'.$navbut; ?>

createPopover(array('title' => JText::translate('VBORPHANSFOUND'), 'content' => JText::translate('VBORPHANSFOUNDSHELP'), 'icon_class' => VikBookingIcons::i('exclamation-triangle'))); ?>