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 : /var/www/blue-sky.co.id/public_html/application/models/ |
Upload File : |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Home_centerbanner_hotel_m extends MY_Model { protected $_table_name = 'home_centerbanners_hotel'; protected $_primary_key = 'id_home_centerbanners_hotel'; protected $_order_by = 'id_home_centerbanners_hotel'; function __construct() { parent::__construct(); } //pagination included function get_all_home_centerbanners_hotel($limit, $start ) { $this->db->select('*'); $this->db->from('home_centerbanners_hotel'); $this->db->order_by('id_home_centerbanners_hotel', 'ASC'); $this->db->limit($limit, $start); $query = $this->db->get(); return $query->result(); } function get_byidhotel($hotel_id) { $this->db->select('*'); $this->db->from('home_centerbanners_hotel'); $this->db->where('hotel_id', $hotel_id); $query = $this->db->get(); return $query->row(); } //function to display new home center banners, where all fields are empty public function get_new() { $home_centerbanners_hotel = new stdClass(); $home_centerbanners_hotel->id_home_centerbanners_hotel = ''; $home_centerbanners_hotel->hotel_id = ''; $home_centerbanners_hotel->hero_title = ''; $home_centerbanners_hotel->hero_image = ''; $home_centerbanners_hotel->intro_title = ''; $home_centerbanners_hotel->intro_subtitle = ''; $home_centerbanners_hotel->intro_image1 = ''; $home_centerbanners_hotel->intro_image2 = ''; $home_centerbanners_hotel->intro_image3 = ''; $home_centerbanners_hotel->room_title = ''; $home_centerbanners_hotel->room_subtitle = ''; $home_centerbanners_hotel->room_image = ''; $home_centerbanners_hotel->promotion_title = ''; $home_centerbanners_hotel->promotion_subtitle = ''; $home_centerbanners_hotel->facilities_tag = ''; $home_centerbanners_hotel->facilities_title = ''; $home_centerbanners_hotel->facilities_subtitle = ''; $home_centerbanners_hotel->facilities1_title = ''; $home_centerbanners_hotel->facilities1_subtitle = ''; $home_centerbanners_hotel->facilities1_image = ''; $home_centerbanners_hotel->facilities1_url = ''; $home_centerbanners_hotel->facilities2_title = ''; $home_centerbanners_hotel->facilities2_subtitle = ''; $home_centerbanners_hotel->facilities2_image = ''; $home_centerbanners_hotel->facilities2_url = ''; $home_centerbanners_hotel->facilities3_title = ''; $home_centerbanners_hotel->facilities3_subtitle = ''; $home_centerbanners_hotel->facilities3_image = ''; $home_centerbanners_hotel->facilities3_url = ''; $home_centerbanners_hotel->facilities4_title = ''; $home_centerbanners_hotel->facilities4_subtitle = ''; $home_centerbanners_hotel->facilities4_image = ''; $home_centerbanners_hotel->facilities4_url = ''; $home_centerbanners_hotel->testimony_tag = ''; $home_centerbanners_hotel->testimony_title = ''; $home_centerbanners_hotel->testimony_subtitle = ''; $home_centerbanners_hotel->faq_tag = ''; $home_centerbanners_hotel->faq_title = ''; $home_centerbanners_hotel->faq_subtitle = ''; $home_centerbanners_hotel->news_tag = ''; $home_centerbanners_hotel->news_title = ''; $home_centerbanners_hotel->news_subtitle = ''; $home_centerbanners_hotel->gallery1_image = ''; $home_centerbanners_hotel->gallery2_image = ''; $home_centerbanners_hotel->gallery3_image = ''; $home_centerbanners_hotel->gallery4_image = ''; $home_centerbanners_hotel->gallery5_image = ''; $home_centerbanners_hotel->gallery6_image = ''; $home_centerbanners_hotel->gallery7_image = ''; $home_centerbanners_hotel->gallery8_image = ''; $home_centerbanners_hotel->gallery9_image = ''; $home_centerbanners_hotel->cta_tag = ''; $home_centerbanners_hotel->cta_title = ''; $home_centerbanners_hotel->cta_subtitle = ''; $home_centerbanners_hotel->cta_email = ''; $home_centerbanners_hotel->cta_phone = ''; $home_centerbanners_hotel->cta_address = ''; $home_centerbanners_hotel->cta_image = ''; return $home_centerbanners_hotel; } //function count all record for home center banners public function record_count() { return $this->db->select("id_home_centerbanners_hotel")->from("home_centerbanners_hotel")->get()->num_rows(); } //function add new brand function add_home_centerbanners_hotel($data) { $this->db->insert('home_centerbanners_hotel', $data); return $this->db->insert_id(); } //function count if existing record exist public function count_exist($id) { $this->db->select('*'); $this->db->from('home_centerbanners_hotel'); $this->db->where('id_home_centerbanners_hotel', $id); $query = $this->db->get(); return $query->num_rows(); } //function count if existing record exist by hotel_id public function count_exist_by_hotel($hotel_id) { $this->db->select('*'); $this->db->from('home_centerbanners_hotel'); $this->db->where('hotel_id', $hotel_id); $query = $this->db->get(); return $query->num_rows(); } //function edit function edit_home_centerbanners_hotel($id, $data) { $this->db->where('id_home_centerbanners_hotel', $id); $this->db->update('home_centerbanners_hotel', $data); } //function edit by hotel_id function edit_home_centerbanners_hotel_by_hotel($hotel_id, $data) { $this->db->where('hotel_id', $hotel_id); $this->db->update('home_centerbanners_hotel', $data); } }