%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
<?php class Business_model extends CI_Model { public function __construct() { parent::__construct(); } /* * Function : deleteRecords * Description : Delete Records */ public function deleteRecords($id, $field_name= 'id', $tbl_name = 'tbl_business') { $this->db->where($field_name, $id); $data = array(); $data = array('is_deleted'=> '1','status'=>'0','modifiedon'=>date('Y-m-d h:i:s')); if (!$this->db->update($tbl_name, $data)) { log_message('error', print_r($this->db->error(), true)); show_error(lang('database_error')); } } /* * Function : getAllcategories * Description : Get all category details */ function getAllcategories($tbl_name='tbl_business_category', $limit = NULL) { $this->db->select('*'); $this->db->where('is_deleted', '0'); if ($limit != NULL) { $this->db->limit($limit); } $queryResult = $this->db->get($tbl_name); return $queryResult->result_array(); } /* * Function : getcategory * Description : Get all category details */ function getcategory($tbl_name, $category_id = NULL, $limit = NULL) { $this->db->select('*'); $this->db->where('status', '1'); $this->db->where('is_deleted', '0'); if($category_id>0){ $this->db->where('id', $category_id); } if ($limit != NULL) { $this->db->limit($limit); } $queryResult = $this->db->get($tbl_name); if ($category_id >0) { return $queryResult->row_array(); } else { return $queryResult->result_array(); } } /* * Function : getHappenings * Description : Get all happening details */ function getBusinesses( $business_id = NULL, $limit = NULL) { $this->db->select('*'); $this->db->where('is_deleted', '0'); if($business_id>0){ $this->db->where('id', $business_id); } $this->db->order_by('display_order', 'asc'); if ($limit != NULL) { $this->db->limit($limit); } $queryResult = $this->db->get('tbl_business'); if ($business_id >0) { return $queryResult->row_array(); } else { return $queryResult->result_array(); } } /* * Function : setCategory */ function setCategory($post) { $post['slug'] = str_replace(' ','-',$post['slug']); // Replace space with - unset($post['submit']); if ($post['id'] > 0) { $this->db->where('id', $post['id']); unset($post['edit']); unset($post['id']); if (!$this->db->update('tbl_business_category', $post)) { print_r($this->db->error()); log_message('error', print_r($this->db->error(), true)); show_error(lang('database_error')); } } else { unset($post['edit']); unset($post['id']); if (!$this->db->insert('tbl_business_category', $post)) { print_r($this->db->error()); log_message('error', print_r($this->db->error(), true)); show_error(lang('database_error')); } } } /* * Function : setBusinesses */ function setBusinesses($post) { $post['slug'] = str_replace(' ','-',$post['slug']); // Replace space with - unset($post['submit']); if($post['business_image']=='') { $post['business_image'] = $post['old_image']; } unset($post['old_image']); if ($post['id'] > 0) { $this->db->where('id', $post['id']); unset($post['edit']); unset($post['id']); $post['modifiedon'] = date('Y-m-d'); if (!$this->db->update('tbl_business', $post)) { print_r($this->db->error()); log_message('error', print_r($this->db->error(), true)); show_error(lang('database_error')); } } else { unset($post['edit']); unset($post['id']); $post['createdon'] = date('Y-m-d'); if (!$this->db->insert('tbl_business', $post)) { print_r($this->db->error()); log_message('error', print_r($this->db->error(), true)); show_error(lang('database_error')); } } } /* * Function : getcategoryList */ function getcategoryList($tbl_name) { $categoryArray = $this->getcategory($tbl_name); $response = array(); foreach($categoryArray as $category) { $response['category'][$category['id']] = $category['category_name']; } return $response; } // Function for deletion public function delete_records($tbl_name, $id){ if($tbl_name!='' && $id>0){ $sql_query=$this->db->where('id', $id)->delete($tbl_name); } } }