'' AND vip=1 "; $resultVip = mysql_query($sqlVip) or die("Not query"); $i=0; while($rowsVip = mysql_fetch_array($resultVip)) { $i++; if($i==1) $rV1[] = $rowsVip; else if($i==2) $rV2[] = $rowsVip; else if($i==3) $rV3[] = $rowsVip; else if($i==4) { $rV4[] = $rowsVip; $i=0; } } #-------------------------------------------------------------------------- $sql = "SELECT A1.*, A4.ca_name FROM tbl_company as A1 left join tbl_category as A4 on A4.ca_id = A1.ca_id WHERE A1.logo<>'' AND A1.vip<>1 ".$WHERE." ORDER BY A1.vip ASC "; $result = mysql_query($sql) or die("Not query"); $total_records=@mysql_num_rows($result); $record_per_page=60; $scroll=10; $page->set_qry_string($strURL); $page->set_page_data("logo_thuonghieu.php",$total_records,$record_per_page,$scroll,true,true,true); $result_get_rs = mysql_query($page->get_limit_query($sql)); $i=0; while($rows_rs = mysql_fetch_array($result_get_rs)) { $i++; if($i==1) $r1[] = $rows_rs; else if($i==2) $r2[] = $rows_rs; else if($i==3) $r3[] = $rows_rs; else if($i==4) { $r4[] = $rows_rs; $i=0; } } $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; #BANNER $sqlBanner = "SELECT * FROM tbl_banner WHERE ba_id = 5"; $rB = $db->Rows($sqlBanner); $smarty->assign('rB',$rB); #CATEGORY $sql30 = "SELECT * FROM tbl_category"; $r30_id = $db->RowsField($sql30,'ca_id'); $r30_name = $db->RowsField($sql30,'ca_name'); #-------------------------------------------------------------------------- $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("ca_id",$ca_id); $smarty->assign("r1",$r1); $smarty->assign("r2",$r2); $smarty->assign("r3",$r3); $smarty->assign("r4",$r4); $smarty->assign("rV1",$rV1); $smarty->assign("rV2",$rV2); $smarty->assign("rV3",$rV3); $smarty->assign("rV4",$rV4); $smarty->assign('ca_name',$ca_name); #-------------------------------------------------------------------------- $smarty->display($template_root.'logo_thuonghieu.tpl'); ?>