Rows($sql); $co_id = $r[0]['co_id']; $sql1 = "SELECT * FROM tbl_news_com WHERE co_id = '$co_id' ORDER BY post_date DESC"; $result1 = mysql_query($sql1) or die("Not query sql1"); $total_records=@mysql_num_rows($result1); $record_per_page=10; $scroll=10; $page->set_qry_string($strURL); $page->set_page_data("e-store_news.php",$total_records,$record_per_page,$scroll,true,true,true); $r1 = $db->Rows($page->get_limit_query($sql1)); $showPage=$page->get_page_nav(); $total_page=$page->total_page; $fN = $n_page*$record_per_page + 1; $tN = ($n_page+1)*$record_per_page; if($tN > $total_records) $tN=$total_records; #--------Menu------------------------------------------------------------ $menu="select tin_tuc,backgrounb from tbl_menubg where co_id='$co_id'"; $row_menu=$db->Rows($menu); #-----option------------------------------------------------------------- $ds = "SELECT * FROM tbl_option WHERE co_id='$co_id'"; $r8=$db->Rows($ds); #-------------------------------------------------------------------------- $smarty->assign("showPage",$showPage); $smarty->assign("total_page",$total_page); $smarty->assign("total_records",$total_records); $smarty->assign("fN",$fN); $smarty->assign("tN",$tN); $smarty->assign("row_menu",$row_menu); $smarty->assign("r",$r); $smarty->assign("r1",$r1); $smarty->assign("company",$company); $smarty->assign("r8",$r8); #-------------------------------------------------------------------------- $sqltemp = "Select * From tbl_template a,tbl_company b where a.id_template = b.id_template AND co_id = $co_id"; $rtemp = $db->Rows($sqltemp); #-------------------------------------------------------------------------- $smarty->assign("rtemp",$rtemp); $smarty->display($template_root.$rtemp[0]["url_template"].'/e-store_news.tpl'); ?>