Rows($sql); $co_id = $r[0]['co_id']; #-------------------------------------------------------------------------- $pro_id = intval($_GET['id']); $sql1 = " SELECT A1.*, A2.main_name, A2.account, A3.mn_name , A4.ca_name, A5.prot_name FROM tbl_product as A1 left join tbl_company as A2 on A1.co_id = A2.co_id left join tbl_money as A3 on A1.mn_id = A3.mn_id left join tbl_category as A4 on A1.ca_id = A4.ca_id left join tbl_product_type as A5 on A1.prot_id = A5.prot_id WHERE A1.co_id = '$co_id' AND A1.pro_id='$pro_id'"; $r1=$db->Rows($sql1); if($r1[0]['pro_id']=="") header("Location: index.php"); $hit = $r[0]['hit']+1; //UPDATE HIT $strSQL_HIT = "UPDATE tbl_product SET hit = '$hit' WHERE pro_id = '$pro_id'"; $resultSQL_HIT = mysql_query($strSQL_HIT) or die("Not query strSQL_HIT"); #--------Menu------------------------------------------------------------ $menu="select san_phamct,thong_tinsp,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("r",$r); $smarty->assign("r1",$r1); $smarty->assign("company",$company); $smarty->assign("row_menu",$row_menu); $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_product_detail.tpl'); ?>