bootstrap = true; $this->display = 'view'; parent::__construct(); $this->meta_title = $this->l('Belegungsplan'); } public function initToolbar() { parent::initToolbar(); unset($this->toolbar_btn['new']); } public function setMedia() { parent::setMedia(); $this->addJS(_MODULE_DIR_.'occupancyplan/views/js/occupancyplan.js'); } public function renderView() { $days = (int)Tools::getValue('days', 21); $from = Tools::getValue('from'); if (!$from || !Validate::isDate($from)) { $from = date('Y-m-d', strtotime('-2 day')); } $idHotel = (int)Tools::getValue('id_hotel'); $plan = new OccupancyPlanRenderer($from, $days, $idHotel, (int)$this->context->language->id); $base = self::$currentIndex.'&token='.$this->token; $nav = function ($shift) use ($from, $days, $idHotel, $base) { return $base.'&from='.date('Y-m-d', strtotime($from.' '.$shift)).'&days='.(int)$days.($idHotel ? '&id_hotel='.$idHotel : ''); }; $link = $this->context->link; $orderLink = function ($idOrder) use ($link) { return $link->getAdminLink('AdminOrders').'&id_order='.(int)$idOrder.'&vieworder'; }; $hotels = Db::getInstance()->executeS('SELECT hbi.`id`, hbil.`hotel_name` FROM `'._DB_PREFIX_.'htl_branch_info` hbi LEFT JOIN `'._DB_PREFIX_.'htl_branch_info_lang` hbil ON hbil.`id` = hbi.`id` AND hbil.`id_lang` = '.(int)$this->context->language->id.' WHERE hbi.`active` = 1'); $e = function ($s) { return htmlspecialchars((string)$s, ENT_QUOTES, 'UTF-8'); }; $form = '
'; // "Book Now" with dates/hotel/room type taken over from the selection (see views/js/occupancyplan.js) $reserveUrl = $link->getAdminLink('AdminHotelRoomsBooking'); $hint = ''.$this->l('Reservieren: freie Zelle anklicken (erste Nacht), dann die letzte Nacht in derselben Zeile anklicken.').'
'; return '