Example #1
0
 /**
  * Display
  */
 public function display($tpl = null)
 {
     // prepare document
     $this->prepareDocument();
     // display
     parent::display($tpl);
 }
Example #2
0
 /**
  * Display
  */
 public function display($tpl = null)
 {
     // get the hotel
     $this->hotel = $this->get('Hotel');
     // display
     parent::display($tpl);
 }
Example #3
0
 /**
  * Display
  */
 public function display($tpl = null)
 {
     // load data
     $this->month = CHLibDate::getMonth(substr($this->search->start_date, 0, -3));
     $this->months_list = CHLibDate::getMonthsList();
     $this->availability = $this->get('Availability');
     // check availability
     if (!$this->availability || $this->availability->errors->errors) {
         // errors view
         $this->setLayout('errors');
     }
     // rooms with extras
     if (isset($this->availability->results)) {
         $this->rooms_with_extras = [];
         $rooms_with_extras = [];
         foreach ($this->availability->results->search_rooms as $search_room) {
             foreach ($search_room->available_rooms as $available_room) {
                 if (count($available_room->extras)) {
                     $rooms_with_extras[] = (int) $available_room->room_id;
                 }
             }
         }
         $this->rooms_with_extras = array_values(array_unique($rooms_with_extras));
     }
     // extend view
     $this->extendView();
     // display the view
     parent::display($tpl);
 }
Example #4
0
 /**
  * Display
  */
 public function display($tpl = null)
 {
     // load data
     $this->availability = $this->get('Availability');
     // display the view
     parent::display($tpl);
 }
Example #5
0
 /**
  * Display
  */
 public function display($tpl = null)
 {
     // get the promo
     $this->promo = $this->get('Promo');
     // promo check
     if (!$this->promo) {
         $this->setLayout('not_found');
         parent::display($tpl);
         return;
     }
     // prepare document
     $this->prepareDocument($this->promo->title);
     // display
     parent::display($tpl);
 }
Example #6
0
 /**
  * Display
  */
 public function display($tpl = null)
 {
     // get the room
     $this->room = $this->get('Room');
     // room check
     if (!$this->room) {
         $this->setLayout('not_found');
         parent::display($tpl);
         return;
     }
     // prepare document
     $this->prepareDocument($this->room->title);
     // display
     parent::display($tpl);
 }
Example #7
0
 /**
  * Display
  */
 public function display($tpl = null)
 {
     // load the app
     $app = CHClient::getApp();
     // check if guest user
     $this->user = CHClient::getUser();
     if (!$this->user) {
         $this->setLayout('access');
     }
     // my booking error
     $this->my_booking_error = $app->getUserState('chclient.my_booking_error', false);
     $app->setUserState('chclient.my_booking_error', null);
     // prepare document
     $this->prepareDocument();
     // display
     parent::display($tpl);
 }
Example #8
0
 /**
  * Display
  */
 public function display($tpl = null)
 {
     // get the hotel
     $this->hotel = $this->get('Hotel');
     $this->calendar = $this->get('Calendar');
     $this->room = CHLib::input()->getInt('room_id');
     // ajax update month
     if ($this->isRaw()) {
         $tpl = 'month';
     }
     // check availability
     if (isset($this->calendar->errors)) {
         // load hotel
         $this->setLayout('errors');
     }
     // display the view
     parent::display($tpl);
 }
 /**
  * displayProcessing
  */
 private function displayProcessing()
 {
     // load config
     $this->config = CHClient::getConfig();
     // submit confirmation method
     $this->submit_confirm = false;
     if ($this->app->getUserState('chclient.submit_confirm', false)) {
         $this->submit_confirm = true;
         $this->app->setUserState('chclient.submit_confirm', null);
         $this->loadConfirmationMethod();
     }
     // load needed data
     $this->data->special_conditions = false;
     $this->data->worst_conditions = false;
     $conditions_array = [];
     foreach ($this->booking->rooms as $room) {
         $conditions_array[] = $room->rate->conditions;
         $room->special_conditions = false;
         $room->free_cancellation = CHClient::freeCancellation($room->rate->conditions, $room->rate->deadline);
         $room->non_refundable = in_array($room->rate->conditions, ['deposit_non_refundable', 'prepay_non_refundable']);
         if (!$room->free_cancellation && !$room->non_refundable) {
             $room->special_conditions = true;
             $this->data->special_conditions = true;
         }
     }
     $this->data->worst_conditions = CHClient::worstConditions($conditions_array);
     // display
     $this->setLayout('processing');
     parent::display();
     return;
 }