ÿØÿà JFIF ` ` ÿþ
|
Server : Apache/2.4.58 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.13 System : Linux cpanel4.trivietit.net 6.8.0-85-generic #85-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 18 15:26:59 UTC 2025 x86_64 User : cungcapmhutbui ( 1010) PHP Version : 5.6.40-86+ubuntu24.04.1+deb.sury.org+1 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,exec,system,passthru,shell_exec,proc_open,popen Directory : /home/cungcapmhutbui/web/cungcapmayhutbui.com/public_html/system/application/controllers/ |
Upload File : |
<?php
require 'indexcontroller.php';
class News extends IndexController{
public function __construct(){
parent:: __construct();
$this->load->model(array('admin/categories_m','admin/articles_m','admin/configs_m'));
}
public function listNews($slug){
$cateObject = $this->categories_m->getObject('slug',$slug);
$adminCp =$this->configs_m->getValues('admincp');
$lang = $_SESSION['lang'];
$this->data['active_menu'] = 9;
if($slug=='cong-trinh') $this->data['active_menu'] = 10;
if($cateObject){
$this->data['cateObject'] = $cateObject;
$this->data['cateName'] = $cateObject[$lang.'_name'];
$this->data['cateSlug'] = $cateObject['slug'];
$title_page = $cateObject[$lang.'_name'];
$keyword_page = '';
$description_page ='';
if($adminCp['seo_web']==1){
$title_page = $cateObject[$lang.'_title_site'];
$keyword_page = $cateObject[$lang.'_keyword'];
$description_page = $cateObject[$lang.'_description'];
}
$cId = $cateObject['id'];
$p=$this->uri->segment('3');
$per_page=6;
if($p == 0)
$page = 1;
else
$page = $p;
$condition = "status = 1 AND cid = $cId";
$total_rows=count($this->articles_m->getObjects($condition));
$total_page = ceil($total_rows/$per_page);
if($p>$total_page)
$page = $total_page;
$config['base_url']=base_url().$slug.'/page';
$config['first_url']=base_url().$slug.'.html';
$config['total_rows'] =$total_rows;
$config['per_page'] = $per_page;
//*********************************************
$config['uri_segment'] = 3;
$this->load->library('pagination');
$this->pagination->initialize($config);
$this->data['listPages']=$this->pagination->create_links();
$this->data['listNews']=$this->articles_m->getObjects($condition,$page,$per_page);
# Bread crumb
$breadCrumbs = array(array( 'name'=>$cateObject['vn_name'], 'url' =>'')
//array( 'name'=>$cateObjects['vn_name'], 'url' =>'')
);
$this->data['breadCrumbs'] = $breadCrumbs;
$this->index('news/listnews',$title_page,$keyword_page,$description_page);
}else $this->index('news/listnews');
}
public function listItem($slug){
$cateObject = $this->categories_m->getObject('slug',$slug);
$lang = $_SESSION['lang'];
$this->data['cateObject'] = $cateObject;
if($cateObject){
$this->data['cateName'] = $cateObject[$lang.'_name'];
$this->data['cateSlug'] = $cateObject['slug'];
$cId = $cateObject['id'];
$p=$this->uri->segment('3');
$per_page=100;
if($p == 0)
$page = 1;
else
$page = $p;
$condition = "status = 1 AND cid = $cId";
$total_rows=count($this->articles_m->getObjects($condition));
$total_page = ceil($total_rows/$per_page);
if($p>$total_page)
$page = $total_page;
$config['base_url']=base_url().$slug.'/page';
$config['first_url']=base_url().$slug.'.html';
$config['total_rows'] =$total_rows;
$config['per_page'] = $per_page;
//*********************************************
$config['uri_segment'] = 3;
$this->load->library('pagination');
$this->pagination->initialize($config);
$this->data['listPages']=$this->pagination->create_links();
$this->data['listItem']=$this->articles_m->getObjects($condition,$page,$per_page);
}
$this->index('news/detailservice');
}
public function detail($slug){
$newObject = $this->articles_m->getObject('slug',$slug);
$adminCp =$this->configs_m->getValues('admincp');
$lang = $_SESSION['lang'];
if($newObject){
$this->data['newObject'] = $newObject;
$this->data['properties'] = unserialize($newObject['properties']);
$id = $newObject['id'];
$title_page = $newObject[$lang.'_title'];
$keyword_page = '';
$description_page ='';
if($adminCp['seo_web']==1){
$title_page = $newObject[$lang.'_title_site'];
$keyword_page = $newObject[$lang.'_keyword'];
$description_page = $newObject[$lang.'_description'];
}
$cateObject = $this->categories_m->getObject('id',$newObject['cid']);
if($cateObject){
$this->data['cateName'] = $cateObject[$lang.'_name'];
$this->data['cateSlug'] = $cateObject['slug'];
$cId = $cateObject['id'];
# orther new
$condition = "status = 1 AND cid = $cId AND id<> $id";
$ortherNew = $this->articles_m->getObjects($condition,0,5);
$this->data['ortherNew'] = $ortherNew;
}
# Bread crumb
$breadCrumbs = array(array( 'name'=>$cateObject['vn_name'], 'url' =>base_url().$cateObject['slug'].'.html'),
array( 'name'=>$newObject['vn_title'], 'url' =>'')
);
$this->data['breadCrumbs'] = $breadCrumbs;
$this->index('news/detail',$title_page,$keyword_page,$description_page);
}else
$this->index('news/detail');
}
public function service(){
$this->data['serviceObject'] = $this->categories_m->getObject('id','23');
//$this->data['subService'] = $this->categories_m->getObjects('status = 1 AND pid = 23');
$this->index('news/service');
}
public function search(){
$keyword = $this->input->post('keyword',TRUE);
$keyword = str_replace('/','',$keyword);
$keyword = str_replace("'",'',$keyword);
$keyword = str_replace('"','',$keyword);
$this->data['listItem'] = $this->articles_m->getObjects("status = 1 AND (`vn_title` LIKE '%$keyword%' OR `slug` LIKE '%$keyword%' OR `vn_sapo` LIKE '%$keyword%' OR `vn_detail` LIKE '%$keyword%' )");
$this->index('news/search');
}
public function getPriceTable () {
$this->data['listPriceTable'] = $this->articles_m->getObjects('cid = 2 and status = 1');
$this->index('news/price');
}
}
?>