function getOffers() { $userData = UserDataService::getUserData(); $offers = HotelService::getHotelOffers($this->getState('hotel.id'), $userData->start_date, $userData->end_date, array(), $userData->adults, $userData->children); BookingService::setRoomAvailability($offers, $userData->reservedItems, $this->getState('hotel.id'), $userData->start_date, $userData->end_date); return $offers; }
public function getExtraOptions() { $userData = UserDataService::getUserData(); $roomReserved = $userData->reservedItems[count($userData->reservedItems) - 1]; $roomReservedInfo = explode("|", $roomReserved); //dmp($userData); $extraOptions = ExtraOptionsService::getHotelExtraOptions($userData->hotelId, $userData->start_date, $userData->end_date, array(), $roomReservedInfo[1], $roomReservedInfo[0]); return $extraOptions; }
function editaccount() { $model = $this->getModel(); $userData = UserDataService::getUserData(); $personalData = $model->getClientData(); $this->row = $personalData; $tpl = 'editaccount'; return $tpl; }
function display($tpl = null) { $this->extraOptions = $this->get("ExtraOptions"); $this->state = $this->get('State'); $this->userData = UserDataService::getUserData(); $this->hotel = HotelService::getHotel($this->userData->hotelId); $this->appSettings = JHotelUtil::getInstance()->getApplicationSettings(); //dmp($this->userData); parent::display($tpl); }
function back() { UserDataService::removeLastRoom(); $userData = UserDataService::getUserData(); if ($userData->hotelId > 0) { $hotel = HotelService::getHotel($userData->hotelId); $link = JHotelUtil::getHotelLink($hotel); } else { $link = JRoute::_('index.php?option=com_jhotelreservation&task=excursionslisting.searchExcursions', false); UserDataService::initializeExcursions(); } $this->setRedirect($link); }
function getReservationDetails() { $userData = UserDataService::getUserData(); $reservationData = new stdClass(); $reservationData->userData = $userData; $reservationData->appSettings = JHotelUtil::getInstance()->getApplicationSettings(); $reservationData->hotel = HotelService::getHotel($userData->hotelId); $reservationService = new ReservationService(); $reservationDetails = $reservationService->generateReservationSummary($reservationData); UserDataService::setReservationDetails($reservationDetails); $reservationDetails->reservationData = $reservationData; return $reservationDetails; }
function display($tpl = null) { $this->hotel = $this->get("Item"); $this->state = $this->get('State'); $this->offers = $this->get("Offers"); $this->rooms = $this->get("Rooms"); $this->appSettings = JHotelUtil::getInstance()->getApplicationSettings(); if ($this->appSettings->is_enable_reservation == 0) { JHotelUtil::getInstance()->showUnavailable(); } $this->userData = UserDataService::getUserData(); $this->currencies = CurrencyService::getAllCurrencies(); //dmp($this->userData); parent::display($tpl); }
function display($tpl = null) { $this->state = $this->get('State'); $this->reservationDetails = $this->get("ReservationDetails"); $this->paymentMethods = $this->get('paymentMethods'); $this->guestTypes = JHotelReservationHelper::getGuestTypes(); $this->userData = UserDataService::getUserData(); $this->hotel = HotelService::getHotel($this->userData->hotelId); $this->appSettings = JHotelUtil::getInstance()->getApplicationSettings(); $doc = JFactory::getDocument(); $tag = JHotelUtil::getJoomlaLanguage(); $doc->addStyleSheet('administrator/components/' . getBookingExtName() . '/assets/js/validation/css/validationEngine.jquery.css'); $doc->addScript('administrator/components/' . getBookingExtName() . '/assets/js/validation/js/languages/jquery.validationEngine-' . $tag . '.js'); $doc->addScript('administrator/components/' . getBookingExtName() . '/assets/js/validation/js/jquery.validationEngine.js'); parent::display($tpl); }
public static function getNumberOfBookingsPerDay($hoteId, $startDate, $endDate, $reservationId = null) { $reservedRooms = array(); $bookedRooms = array(); $db = JFactory::getDBO(); $reservationFilter = ""; if (isset($reservationId) && $reservationId > 0) { //exclude the current reservation $reservationFilter = "and c.confirmation_id <> {$reservationId}"; //build count of rooms added to reservation $reservedItems = UserDataService::getUserData()->reservedItems; $bookedRooms = self::getReservationBookedRooms($reservedItems); } $query = "select hcr.room_id, c.start_date, c.end_date\r\n\t\t\t\t\tfrom #__hotelreservation_confirmations_rooms hcr\r\n\t\t\t\t\tleft join #__hotelreservation_confirmations c on c.confirmation_id= hcr.confirmation_id\r\n\t\t\t\t\twhere (c.start_date <'{$endDate}' and c.end_date >='{$startDate}') \r\n\t\t\t\t\t\tand c.reservation_status <> " . CANCELED_ID . " \r\n\t\t\t\t\t\t{$reservationFilter}\r\n\t\t\t\t\t\tand c.hotel_id = {$hoteId}"; //echo $query; $db->setQuery($query); $reservationInfos = $db->loadObjectList(); //dmp($bookedRooms); for ($d = strtotime($startDate); $d <= strtotime($endDate);) { $dayString = date("Y-m-d", $d); foreach ($reservationInfos as $reservationInfo) { if (strtotime($reservationInfo->start_date) == $d || $d < strtotime($reservationInfo->end_date) && $d > strtotime($reservationInfo->start_date)) { if (!isset($reservedRooms[$reservationInfo->room_id]) || !isset($reservedRooms[$reservationInfo->room_id][$dayString])) { $reservedRooms[$reservationInfo->room_id][$dayString] = 0; } $reservedRooms[$reservationInfo->room_id][$dayString] = $reservedRooms[$reservationInfo->room_id][$dayString] + 1; } } //add to the total booked the number of added rooms if (count($bookedRooms)) { foreach ($bookedRooms as $key => $bookedRoom) { if (!isset($reservedRooms[$key][$dayString])) { $reservedRooms[$key][$dayString] = 0; } $reservedRooms[$key][$dayString] += $bookedRoom; } } $d = strtotime(date('Y-m-d', $d) . ' + 1 day '); } //dmp($reservedRooms);exit; return $reservedRooms; }
function display($tpl = null) { $this->state = $this->get('State'); $this->countries = $this->get('Countries'); $this->guestTypes = JHotelReservationHelper::getGuestTypes(); $this->userData = UserDataService::getUserData(); $this->hotel = HotelService::getHotel($this->userData->hotelId); $this->appSettings = JHotelUtil::getInstance()->getApplicationSettings(); if ($this->appSettings->save_all_guests_data) { UserDataService::prepareGuestDetails(); } $hotelId = JRequest::getVar("hotel_id"); $reservedItems = JRequest::getVar("reservedItems"); if (!empty($reservedItems)) { UserDataService::updateRooms($hotelId, $reservedItems); } $this->reservationDetails = $this->get("ReservationDetails"); $this->showDiscounts = true; parent::display($tpl); }
function back() { UserDataService::removeLastRoom(); $userData = UserDataService::getUserData(); $hotel = HotelService::getHotel($userData->hotelId); $link = JHotelUtil::getHotelLink($hotel); $this->setRedirect($link); }
/** * @copyright Copyright (C) 2008-2009 CMSJunkie. All rights reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ // no direct access defined('_JEXEC') or die('Restricted access'); JHTML::_('stylesheet', 'modules/mod_jreservationinfo/assets/css/style.css'); require_once JPATH_SITE . '/administrator/components/com_jhotelreservation/helpers/defines.php'; require_once JPATH_SITE . '/administrator/components/com_jhotelreservation/helpers/utils.php'; // Include the syndicate functions only once require_once dirname(__FILE__) . DS . 'helper.php'; $userData = UserDataService::getUserData(); $hotel = HotelService::getHotel($userData->hotelId); $reservationData = new stdClass(); $reservationData->userData = $userData; $reservationData->appSettings = JHotelUtil::getInstance()->getApplicationSettings(); $reservationData->hotel = $hotel; $reservationService = new ReservationService(); $reservationDetails = $reservationService->generateReservationSummary($reservationData); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx')); require JModuleHelper::getLayoutPath('mod_jreservationinfo', $params->get('layout', 'default'));
function getCourses() { $userData = UserDataService::getUserData(); $excursions = ExcursionsService::getHotelExcursions(HOTEL_COURSES, $this->getState('hotel.id'), $userData->start_date, $userData->end_date, array(), $userData->adults, $userData->children); return $excursions; }