Server : Apache/2.4.18 (Ubuntu) System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 User : oppastar ( 1041) PHP Version : 7.0.33-0ubuntu0.16.04.15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Directory : /proc/self/root/var/www/blue-sky.co.id/public_html/application/models/ |
Upload File : |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Facilities_m extends MY_Model { protected $_table_name = 'facilities'; protected $_primary_key = 'id'; protected $_order_by = 'id'; public $_rules = array( 'hotel_id' => array( 'field' => 'hotel_id', 'label' => 'Hotel', 'rules' => 'trim|required' ), 'type' => array( 'field' => 'type', 'label' => 'Type', 'rules' => 'trim|required' ) ); function __construct() { parent::__construct(); } //pagination included function get_all_facilities($limit, $start) { $this->db->select('*'); $this->db->from('facilities'); $this->db->order_by('id', 'ASC'); $this->db->limit($limit, $start); $query = $this->db->get(); return $query->result(); } //pagination included with hotel filter function get_facilities_by_hotel($hotel_id, $limit, $start) { $this->db->select('*'); $this->db->from('facilities'); $this->db->where('hotel_id', $hotel_id); $this->db->order_by('id', 'ASC'); $this->db->limit($limit, $start); $query = $this->db->get(); return $query->result(); } //get facilities by hotel_id function get_by_hotel($hotel_id) { $this->db->select('*'); $this->db->from('facilities'); $this->db->where('hotel_id', $hotel_id); $this->db->order_by('type', 'ASC'); $query = $this->db->get(); return $query->result(); } //get facilities by hotel_id and type function get_by_hotel_and_type($hotel_id, $type) { $this->db->select('*'); $this->db->from('facilities'); $this->db->where('hotel_id', $hotel_id); $this->db->where('type', $type); $query = $this->db->get(); return $query->row(); } //function to display new facility, where all fields are empty public function get_new() { $facility = new stdClass(); $facility->hotel_id = ''; $facility->type = ''; $facility->hero_image = ''; $facility->hero_title = ''; $facility->intro_image = ''; $facility->intro_title = ''; $facility->intro_subtitle = ''; $facility->facility_title = ''; $facility->facility_subtitle = ''; $facility->facility1_image = ''; $facility->facility1_title = ''; $facility->facility1_subtitle = ''; $facility->facility2_image = ''; $facility->facility2_title = ''; $facility->facility2_subtitle = ''; $facility->facility3_image = ''; $facility->facility3_title = ''; $facility->facility3_subtitle = ''; $facility->facility4_image = ''; $facility->facility4_title = ''; $facility->facility4_subtitle = ''; $facility->facility5_image = ''; $facility->facility5_title = ''; $facility->facility5_subtitle = ''; $facility->facility6_image = ''; $facility->facility6_title = ''; $facility->facility6_subtitle = ''; $facility->gallery1_image = ''; $facility->gallery2_image = ''; $facility->gallery3_image = ''; $facility->gallery4_image = ''; $facility->gallery5_image = ''; $facility->gallery6_image = ''; $facility->gallery7_image = ''; $facility->gallery8_image = ''; $facility->gallery9_image = ''; $facility->gallery10_image = ''; return $facility; } //get facility types function get_facility_types() { return array( 'dining' => 'Dining', 'fitness' => 'Fitness', 'meeting' => 'Meeting', 'wedding' => 'Wedding' ); } }