function getAllExcursions()
 {
     $userData = $_SESSION['userData'];
     $orderBy = "";
     $this->searchParams = array();
     $this->searchParams["orderBy"] = $userData->orderBy;
     $this->searchParams["keyword"] = $userData->keyword;
     $this->searchParams["orderBy"] = $userData->orderBy;
     $this->searchParams["adults"] = $userData->adults;
     $this->searchParams["startDate"] = $userData->start_date;
     $this->searchParams["endDate"] = $userData->end_date;
     $this->searchParams["languageTag"] = JRequest::getVar('_lang');
     $this->searchParams["city"] = JRequest::getVar('city');
     $this->searchParams["showAll"] = JRequest::getVar('showAll');
     $this->searchParams["adults"] = $userData->adults;
     $this->searchParams["children"] = $userData->children;
     $this->searchParams["type"] = JRequest::getVar('jhotelreservation_type');
     $orderByPrice = false;
     if ($userData->orderBy == 'lowest_hotel_price asc' || $userData->orderBy == 'starting_price_offers asc') {
         $orderByPrice = true;
     }
     if (!isset($userData->noDates)) {
         $userData->noDates = 0;
     }
     $this->searchParams["no-dates"] = $userData->noDates;
     $excursions = ExcursionsService::getHotelExcursions(HOTEL_EXCURSIONS, -1, $userData->start_date, $userData->end_date, null, null, $userData->adults, $userData->children);
     $this->_total = count($excursions);
     if (count($excursions)) {
         UserDataService::setCurrency($excursions[0]->country_currency_short, $excursions[0]->country_currency);
     }
     return $excursions;
 }
 function showExtras()
 {
     //$log = Logger::getInstance(JPATH_COMPONENT."/logs/site-log-".date("d-m-Y").'.log',1);
     //$log->LogDebug("showExtras");
     //add room if does not exist
     $reservedItems = JRequest::getVar("reservedItems");
     $hotelId = JRequest::getVar("hotelId");
     UserDataService::updateRooms($hotelId, $reservedItems);
     $userData = UserDataService::getUserData();
     $userData->hotelId = $hotelId;
     $appSetting = JHotelUtil::getApplicationSettings();
     if (!isset($userData->currency)) {
         $hotel = HotelService::getHotel($hotelId);
         UserDataService::setCurrency($hotel->hotel_currency, $hotel->currency_symbol);
     }
     //dump($userData->reservedItems);
     //dump($userData->hotelId);
     //$log->LogDebug(serialize($userData->reservedItems));
     $model = $this->getModel("ExtraOptions");
     $extraOptions = $model->getExtraOptions();
     if (count($extraOptions) > 0 && PROFESSIONAL_VERSION == 1 && $appSetting->is_enable_extra_options) {
         //dump("show extra view");
         JRequest::setVar("view", "extraoptions");
         parent::display();
     } else {
         if (count($userData->reservedItems) < $userData->rooms) {
             $this->setRedirect(JRoute::_('index.php?option=com_jhotelreservation&task=hotel.showHotel&hotel_id=' . $userData->hotelId . "&reservedItems=" . $reservedItems, false));
         } else {
             $this->setRedirect(JRoute::_('index.php?option=com_jhotelreservation&view=guestDetails&reservedItems=' . $reservedItems, false));
         }
     }
     //exit;
     //$log->LogDebug(serialize($userData->reservedItems));
     //$log->LogDebug("End showExtras");
 }
 public function getItem($pk = null)
 {
     // Initialise variables.
     $hotel = HotelService::getHotel($this->getState('hotel.id'));
     //dmp($hotel->hotel_currency);
     UserDataService::setCurrency($hotel->hotel_currency, $hotel->currency_symbol);
     return $hotel;
 }