Example #1
0
 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     $hotelId = \SpoonFilter::getPostValue('hotel_id', null, 0);
     if (!$hotelId) {
         $this->output(self::ERROR, 'Missing values');
     }
     $hotel = FrontendBookingsModel::getHotel($hotelId);
     if ($hotel) {
         $museums = FrontendBookingsModel::getMuseums($hotel['country'], $hotel['city']);
         $tpl = FRONTEND_MODULES_PATH . '/Bookings/Layout/Templates/Museums.tpl';
         $museumsTpl = new Template(false);
         $museumsTpl->assign('hotel', $hotel);
         $museumsTpl->assign('museums', $museums);
         $html = $museumsTpl->getContent($tpl, true, true);
     } else {
         $html = '';
     }
     // output
     $this->output(self::OK, $html);
 }