ÿþ<? ob_start(); session_start(); require 'config.php'; require $include_dir.'/clsDatabase.php'; require $include_dir.'/clsPaging.php'; require $include_dir.'/clsCommons.php'; #-------------------------------------------------------------------------- $db = new clsDatabase(); $page=new clsPaging(); #-------------------------------------------------------------------------- $company = trim($_REQUEST['company']); $strURL = "company=".$company."&"; #-------------------------------------------------------------------------- $sql = "SELECT * FROM tbl_company WHERE account = '$company'"; $r=$db->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); $temp=$r1[0]['factory']; $temp=explode(":::",$temp); $temp=$r1[0]['factory']; $temp=explode(":::",$temp); if(empty($temp[1])) $temp[1]="Hãng s£n xu¥t"; 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"); #-------------------------------------------------------------------------- $smarty->assign("r",$r); $smarty->assign("r1",$r1); #-------------------------------------------------------------------------- $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'); ?>