function getAllCourses()
 {
     $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_COURSES, -1, $userData->start_date, $userData->end_date, null, null, $userData->adults, $userData->children);
     $this->_total = count($excursions);
     return $excursions;
 }
 static function getSelectedExcursions($reservedItems, $customPrices, $hotelId, $startDate, $endDate, $roomGuests, $roomGuestsChildren, $discountCode, $checkAvailability = true, $confirmationId = null)
 {
     $selectedExcursions = array();
     if (count($reservedItems) > 0) {
         $excursionData = ExcursionsService::parseExcursions($reservedItems);
         $selectedExcursions = ExcursionsService::getHotelExcursions(-1, -1, $startDate, $endDate, $excursionData->excursionIds, $excursionData->nrBooked, null, $discountCode, $checkAvailability, $confirmationId);
     }
     ksort($selectedExcursions);
     return $selectedExcursions;
 }
Exemple #3
0
 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;
 }
 function generateCalendarData($year = 0, $month = 0)
 {
     $session = JFactory::getSession();
     $userData = $_SESSION['userData'];
     $post = JRequest::get('post');
     $get = JRequest::get('get');
     if (!count($post)) {
         $post = $get;
     }
     if (!isset($post["hotel_id"])) {
         $post["hotel_id"] = JRequest::getInt('hotel_id');
     }
     $year_start = $userData->year_start;
     $month_start = $userData->month_start;
     $day_start = 1;
     $year_end = $userData->year_end;
     $month_end = $userData->month_start;
     $day_end = date('t', mktime(0, 0, 0, $userData->month_start, 1, $userData->year_start));
     //dmp($currentRoom);
     $adults = $userData->adults;
     $children = $userData->children;
     //dmp($userData);
     $post["guest_adult"] = $adults;
     $post["guest_child"] = $userData->children;
     if ($year != 0) {
         $post["year_start"] = $year;
         $post["year_end"] = $year;
         $year_start = $year;
         $year_end = $year;
     }
     if ($month != 0) {
         $post["month_start"] = $month;
         $post["month_end"] = $month;
         $month_start = $month;
         $month_end = $month;
     }
     $number_persons = $post["guest_adult"];
     //dmp($post);
     $datasi = date("Y-m-d", mktime(0, 0, 0, $userData->month_start, $userData->day_start, $userData->year_start));
     $dataei = date("Y-m-d", mktime(0, 0, 0, $userData->month_end, $userData->day_end, $userData->year_end));
     $diff = abs(strtotime($dataei) - strtotime($datasi));
     $years = floor($diff / (365 * 60 * 60 * 24));
     $months = floor(($diff - $years * 365 * 60 * 60 * 24) / (30 * 60 * 60 * 24));
     $initialNrDays = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24) / (60 * 60 * 24));
     //dmp($initialNrDays);
     $datas = date("Y-m-d", mktime(0, 0, 0, $month_start, $day_start, $year_start));
     $datae = date("Y-m-d", mktime(0, 0, 0, $month_end, $day_end + 7, $year_end));
     //echo $adults." ";
     //dmp($adults);
     /* 	dmp($year_start);
     			dmp($month_start);
     		dmp($datas);
     		dmp($datae); */
     //exit;
     $hotelId = -1;
     $excursions = ExcursionsService::getHotelExcursions(-1, $hotelId, $datas, $datae, null, null, $adults, $children);
     $bookingsDays = null;
     $hoteAvailability = null;
     $temporaryReservedRooms = null;
     $excursionCalendar = ExcursionsService::getExcursionCalendar($excursions, $initialNrDays, $adults, $children, $month_start, $year_start, $bookingsDays, $temporaryReservedRooms, $hoteAvailability);
     //dmp($excursionCalendar);
     //dmp($offersCalendar);
     return $excursionCalendar;
 }