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 Other_business_m extends MY_Model { protected $_table_name = 'other_businesses'; protected $_primary_key = 'id'; protected $_order_by = 'id'; public $rules = array( array( 'field' => 'name', 'label' => 'Business Name', 'rules' => 'trim|required' ), array( 'field' => 'intro_title', 'label' => 'Intro Title', 'rules' => 'trim' ), array( 'field' => 'intro_content', 'label' => 'Intro Content', 'rules' => 'trim' ), array( 'field' => 'facility_title', 'label' => 'Facility Title', 'rules' => 'trim' ), array( 'field' => 'facility_subtitle', 'label' => 'Facility Subtitle', 'rules' => 'trim' ), array( 'field' => 'testimony_tag', 'label' => 'Testimony Tag', 'rules' => 'trim' ), array( 'field' => 'testimony_title', 'label' => 'Testimony Title', 'rules' => 'trim' ), array( 'field' => 'contact_tag', 'label' => 'Contact Tag', 'rules' => 'trim' ), array( 'field' => 'contact_title', 'label' => 'Contact Title', 'rules' => 'trim' ), array( 'field' => 'contact_subtitle', 'label' => 'Contact Subtitle', 'rules' => 'trim' ), array( 'field' => 'contact_email', 'label' => 'Contact Email', 'rules' => 'trim|valid_email' ), array( 'field' => 'contact_phone', 'label' => 'Contact Phone', 'rules' => 'trim' ), array( 'field' => 'contact_hours', 'label' => 'Contact Hours', 'rules' => 'trim' ), array( 'field' => 'contact_address', 'label' => 'Contact Address', 'rules' => 'trim' ) ); public function get_new() { $other_business = new stdClass(); $other_business->name = ''; $other_business->banner_image = ''; $other_business->intro_title = ''; $other_business->intro_content = ''; $other_business->intro1_image = ''; $other_business->intro2_image = ''; $other_business->intro3_image = ''; $other_business->facility_title = ''; $other_business->facility_subtitle = ''; $other_business->facility1_image = ''; $other_business->facility1_title = ''; $other_business->facility1_subtitle = ''; $other_business->facility2_image = ''; $other_business->facility2_title = ''; $other_business->facility2_subtitle = ''; $other_business->facility3_image = ''; $other_business->facility3_title = ''; $other_business->facility3_subtitle = ''; $other_business->facility4_image = ''; $other_business->facility4_title = ''; $other_business->facility4_subtitle = ''; $other_business->gallery1_image = ''; $other_business->gallery2_image = ''; $other_business->gallery3_image = ''; $other_business->gallery4_image = ''; $other_business->gallery5_image = ''; $other_business->gallery6_image = ''; $other_business->gallery7_image = ''; $other_business->gallery8_image = ''; $other_business->gallery9_image = ''; $other_business->gallery10_image = ''; $other_business->testimony_tag = ''; $other_business->testimony_title = ''; $other_business->testimony1_title = ''; $other_business->testimony1_name = ''; $other_business->testimony1_content = ''; $other_business->testimony1_image = ''; $other_business->testimony2_title = ''; $other_business->testimony2_name = ''; $other_business->testimony2_content = ''; $other_business->testimony2_image = ''; $other_business->testimony3_title = ''; $other_business->testimony3_name = ''; $other_business->testimony3_content = ''; $other_business->testimony3_image = ''; $other_business->testimony4_title = ''; $other_business->testimony4_name = ''; $other_business->testimony4_content = ''; $other_business->testimony4_image = ''; $other_business->contact_tag = ''; $other_business->contact_title = ''; $other_business->contact_subtitle = ''; $other_business->contact_image = ''; $other_business->contact_email = ''; $other_business->contact_hours = ''; $other_business->contact_phone = ''; $other_business->contact_address = ''; return $other_business; } public function get_all_other_businesses($limit = 100, $offset = 0) { $this->db->limit($limit, $offset); $this->db->order_by($this->_order_by); return $this->db->get($this->_table_name)->result(); } public function add_other_business($data) { $this->db->insert($this->_table_name, $data); return $this->db->insert_id(); } public function edit_other_business($id, $data) { $this->db->where($this->_primary_key, $id); $this->db->update($this->_table_name, $data); } public function record_count() { return $this->db->count_all($this->_table_name); } }