| Server IP : 103.48.194.25 / Your IP : 216.73.217.33 Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33 System : Linux VMHostDefault 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64 User : sieuthimay ( 1016) PHP Version : 8.2.20 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/nhadatkhangdien.net-bk/public_html/sources/ |
Upload File : |
<?php if(!defined('_source')) die("Error");
if(isset($_GET['id'])){
#tin tuc chi tiet
$id = addslashes($_GET['id']);
$rs = get_news_detail($id);
$metatitle = $rs['ten'];
$metadesc = $rs['description'];
$metakey = $rs['keyword'];
}elseif(isset($_GET['idc'])){
$id = addslashes($_GET['idc']);
$sql="select * from #_news_item where tenkhongdau='$id' limit 0,1 ";
$d->query($sql);
$loaitin=$d->result_array();
$title_bar=$loaitin[0]['ten'];
$title_tcat=$loaitin[0]['ten'];
$sql_tintuc = "select * from #_news where hienthi=1 and id_item='".$loaitin[0]['id']."' order by stt,ngaytao desc";
$d->query($sql_tintuc);
$tintuc = $d->result_array();
$curPage = isset($_GET['p']) ? $_GET['p'] : 1;
$url=getCurrentPageURL();
$maxR=6;
$maxP=5;
$paging=paging_home($tintuc, $url, $curPage, $maxR, $maxP);
$result_news=$paging['source'];
}else{
$title_bar='Tin tức - Sự kiện ';
$sql = "select ten,tenkhongdau,mota,photo,id from #_news where hienthi=1 order by stt,ngaytao desc";
$d->query($sql);
$result_source = $d->result_array();
$curPage = isset($_GET['p']) ? $_GET['p'] : 1;
$url=getCurrentPageURL();
$maxR=8;
$maxP=5;
$paging=paging_home($result_source, $url, $curPage, $maxR, $maxP);
$result_news=$paging['source'];
}
//**************************** cac ham xu ly cho trang dự án *************************************************
function get_news_detail($id=0)
{
global $d ;
$d->reset();
$sql = "select * from #_news where hienthi=1 and id='".$id."'";
$d->query($sql);
$rs=$d->fetch_array();
return $rs;
}
function get_sublist($id=0)
{
global $d ;
$d->reset();
$sql = "select ten,tenkhongdau,ngaytao,id,photo from #_news where hienthi=1 and id <>'".$id."' order by stt,ngaytao desc limit 0,6";
$d->query($sql);
$list=$d->result_array();
return $list;
}
function news_item_right($id=0)
{
global $d ;
$d->reset();
$sql = "select * from #_news_item where hienthi=1 order by stt,ngaytao desc";
$d->query($sql);
$list = $d->result_array();
return $list;
}
function get_sukien($limit=4)
{
global $d ;
$sql = "select * from #_news where hienthi=1 and id_item=7 and tinnoibat<>0 limit $limit";
$d->query($sql);
$list= $d->result_array();
return $list ;
}
function get_news_batdongsan($id_item=4,$limit=2)
{
global $d ;
$sql = "select * from #_news where hienthi=1 and id_item='".$id_item."' and tinnoibat<>0 limit $limit" ;
$d->query($sql);
$list= $d->result_array();
return $list ;
}
?>