コード例 #1
0
 public function getHotelNameId()
 {
     $result = array();
     $hotels = new HotelColl();
     $hotels->setAll();
     foreach ($hotels as $hotel) {
         $result[] = "[" . $hotel->getId() . "] " . $hotel->getName();
     }
     if (!$this->input->is_ajax_request()) {
         return $result;
     } else {
         echo json_encode($result);
     }
 }
コード例 #2
0
 public function __construct()
 {
     parent::__construct();
     $this->_aggregation = "";
 }
コード例 #3
0
 protected function _setViewDataErrCsv()
 {
     $revenue = new Revenuedata();
     $hotels = new HotelColl();
     $hotels->setAll();
     $this->_viewdata['acctCat']['dropdown'] = $revenue->getCatAsDropdown();
     $this->_viewdata['acctCat']['default'] = $this->input->post('category');
     $this->_viewdata['status'] = 'error';
     $this->_viewdata['showmsg'] = true;
     $this->_viewdata['hotels'] = $hotels;
     if ($_FILES['revenue-csv']['error'] === 4) {
         $this->_viewdata['msg'] = 'There was a problem uploading your csv file. Please try again.';
     }
 }
コード例 #4
0
 protected function _filterHotels(HotelColl $hotels)
 {
     if ($this->session->has_userdata('filter')) {
         foreach ($this->session->userdata('filter') as $filterGroup => $filters) {
             if ($filterGroup == 'hotel-name') {
                 foreach ($filters as $hotelName) {
                     $htlNameFiltr = new HtlNameFiltr();
                     $htlNameFiltr->setFilter($hotelName);
                     $htlNameFiltr->setFilterGrp('hotel-name');
                     $hotels->addFilter($htlNameFiltr);
                 }
             }
             if ($filterGroup == 'hotel-portfolio') {
                 $this->load->model('Do_portfolio');
                 $htlPrtfoFiltr = new HtlPrtfoFiltr();
                 foreach ($filters as $portfolioName) {
                     # get equivalent id
                     $portfolio = $this->Do_portfolio->getByName($portfolioName);
                     $portfolioId = empty($portfolio) ? 0 : $portfolio->id;
                     $htlPrtfoFiltr->setFilterGrp('hotel-portfolio');
                     $htlPrtfoFiltr->setFilter($portfolioId);
                 }
                 $hotels->addFilter($htlPrtfoFiltr);
             }
             if ($filterGroup == 'hotel-country') {
                 foreach ($filters as $tagVal) {
                     $htlTagFiltr = new HtlTagFiltr();
                     $htlTagFiltr->setFilter($tagVal);
                     $htlTagFiltr->setFilterGrp('hotel-country');
                     $hotels->addFilter($htlTagFiltr);
                 }
             }
             if ($filterGroup == 'hotel-coach') {
                 foreach ($filters as $tagVal) {
                     $htlTagFiltr = new HtlTagFiltr();
                     $htlTagFiltr->setFilter($tagVal);
                     $htlTagFiltr->setFilterGrp('hotel-coach');
                     $hotels->addFilter($htlTagFiltr);
                 }
             }
         }
     }
     return $hotels;
 }