%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 Files_model extends CI_Model { public function __construct() { parent::__construct(); } /* * Function: deleteCourse * Description : delete course details */ public function deleteRecord($id, $field_name= 'id', $tbl_name = 'su_manage_files') { $this->db->where($field_name, $id); if (!$this->db->delete($tbl_name)) { log_message('error', print_r($this->db->error(), true)); show_error(lang('database_error')); } } /* * Function : removeSpecialChars */ function removeSpecialChars($post) { $newArray = array(); foreach($post as $key=>$string) { //$string = preg_replace('/[^a-zA-Z0-9_ -]/s','',$string); $string = str_replace( array( '\'', '"', ',' , ';','—','’','~','!','@','#','#','^','*', '|'), ' ', $string); $newArray[$key] = $string; } return $newArray; } /* * Function : getRecords * Description : Get all courses details */ function getRecords($tbl_name='su_manage_files', $dy_id = NULL, $condition_array) { $this->db->select('*'); $this->db->from($tbl_name); $this->db->where('is_deleted', '0'); if($dy_id>0){ $this->db->where('id', $dy_id); } else { $this->db->or_where('admin_id', '0'); } foreach($condition_array as $key=>$val){ $this->db->where($key, $val); } $this->db->order_by('id','desc'); $queryResult = $this->db->get(); //echo $this->db->last_query(); die; if ($dy_id >0) { return $queryResult->row_array(); } else { return $queryResult->result_array(); } } /* * Function: setRecordDetails * Description : set course details */ function setRecordDetails($post, $tbl_name = 'su_manage_files') { unset($post['submit']); // Remove Special Character $post = $this->removeSpecialChars($post); if ($post['edit'] > 0) { $this->db->where('id', $post['edit']); unset($post['edit']); unset($post['id']); $post['last_modifiedon'] = date("Y-m-d H:i:s"); if (!$this->db->update($tbl_name, $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 H:i:s"); if (!$this->db->insert($tbl_name, $post)) { print_r($this->db->error()); log_message('error', print_r($this->db->error(), true)); show_error(lang('database_error')); } } } }