%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 if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class News_model extends CI_Model{
protected $table_name = 'SH_News';
protected $primary_key = 'newsid';
protected $order_by = 'newsidPriorityOrder DESC';
protected $fields_detail = 'newsid, news_title, news_description, current_date,news_slug, SH_News.status';
protected $fields_summary = 'newsid, news_title, news_description,
current_date, news_slug, status';
public function __construct()
{
parent::__construct();
}
function get_news($id){
if($id!=0){
$records = $this->db->query("SELECT * FROM `SH_News` where newsid='".$id."' and status='1' order by newsid DESC Limit 0,3")->result_array();
} else {
$records = $this->db->query("SELECT * FROM `SH_News` where status='1' order by newsid DESC Limit 0,3")->result_array();
}
return $records;
}
/* function view_testimonials(){
$testimonialss = $this->db->query("SELECT * FROM `SH_News` where status='1' order by newsid DESC")->result_array();
return $testimonialss;
}*/
public function editnews($data, $newsid) {
$data['update_date'] = date('d-m-Y H:i:s');
$this->db->where($this->primary_key, $newsid);
return $this->db->update($this->table_name, $data);
}
public function insert_news($data){
$data['update_date'] = date('Y-m-d H:i:s');
$success = $this->db->insert($this->table_name, $data);
if($success) {
return $this->db->insert_id();
} else {
return FALSE;
}
}
public function delete_news($id) {
$this->db->where($this->primary_key, $id);
return $this->db->delete($this->table_name);
}
}
?>