alert('参数传递有误,系统返回!');window.history.back(-1);"; die(""); } //查看产品次数 $sql="update product set pclick=pclick+1 where id=$id"; mysql_query($sql); //检索数据信息 $sql="select * from product where id=$id"; $result=mysql_query($sql); if($result){ if($row=mysql_fetch_array($result)){ $pname=$row["pname"]; $pno=$row["pno"]; $pclass1=$row["pclass1"]; $pclass2=$row["pclass2"]; $pclass3=$row["pclass3"]; $makeyear=$row["makeyear"]; $makeaddress=$row["makeaddress"]; $guige=$row["guige"]; $rongliang=$row["rongliang"]; $dushu=$row["dushu"]; $baozhuang=$row["baozhuang"]; $xiangxing=$row["xiangxing"]; $yuanliao=$row["yuanliao"]; $shuliang=$row["shuliang"]; $fangweima=$row["fangweima"]; $zhilianggrade=$row["zhilianggrade"]; $changjia=$row["changjia"]; $price1=$row["price1"]; $price2=$row["price2"]; $price3=$row["price3"]; $msggrade=$row["msggrade"]; $zhutileibie=$row["zhutileibie"]; $xiaofeileibie=$row["xiaofeileibie"]; $dangcileibie=$row["dangcileibie"]; $areacity=$row["areacity"]; $pcontent=$row["pcontent"]; $pmeno=$row["pmeno"]; $ppic=$row["ppic"]; $pspic=$row["pspic"]; $regdate=$row["regdate"]; $puser=$row["puser"]; $pclass=$row["pclass"]; $tejiadate=$row["tejiadate"]; $pgo=$row["pgo"]; $spcontent=mysubstr(strip_tags($pcontent),0,120); } } if(strlen($makeaddress)<=10) $xmakeaddress=mysubstr($makeaddress,0,10); if(strlen($makeaddress)>10) $xmakeaddress=mysubstr($makeaddress,0,10).".."; if(strlen($baozhuang)<=10) $xbaozhuang=mysubstr($baozhuang,0,10); if(strlen($baozhuang)>10) $xbaozhuang=mysubstr($baozhuang,0,10).".."; if(strlen($changjia)<=28) $xchangjia=mysubstr($changjia,0,28); if(strlen($changjia)>28) $xchangjia=mysubstr($changjia,0,28).".."; if(strlen($yuanliao)<=28) $xyuanliao=mysubstr($yuanliao,0,28); if(strlen($yuanliao)>28) $xyuanliao=mysubstr($yuanliao,0,28).".."; if($price1==0) $xprice1="面议"; if($price2==0) $xprice2="面议"; if($price3==0) $xprice3="面议"; if($price1>0) $xprice1="¥".$price1."元"; if($price2>0) $xprice2="¥".$price2."元"; if($price3>0) $xprice3="¥".$price3."元"; if($pgo==1){ $pgoname=""; }else{ $pgoname=""; } //检索代理商信息 $sql="select * from users where id=$puser"; $result=mysql_query($sql); if($result){ if($row=mysql_fetch_array($result)){ $comname=$row["comname"]; $address=$row["address"]; $phone=$row["phone"]; $fax=$row["fax"]; $email=$row["email"]; $lxr=$row["lxr"]; $qq=$row["qq"]; }else{ $comname=""; $address=""; $phone=""; $fax=""; $email=""; $lxr=""; $qq=""; } } if(strlen($comname)<=28) $xcomname=mysubstr($comname,0,28); if(strlen($comname)>28) $xcomname=mysubstr($comname,0,28).".."; //检索产品列表 $sql="select * from product where puser=$puser and pisopen=1 order by rand() limit 0,10"; $result=mysql_query($sql); if($result){ while($row=mysql_fetch_array($result)){ $rowid=$row["id"]; $pspic=$row["pspic"]; $npname=$row["pname"]; if($pspic=="") $pspic="nopic.jpg"; $xnpname=mysubstr(strip_tags($npname),0,20); $product[]=array("id"=>$rowid,"pic"=>$pspic,"name"=>$npname,"xname"=>$xnpname); } } //检索相关产品评论信息 $sql="select * from pinglun where plclass=2 and plid=$id order by id desc limit 0,6"; $result=mysql_query($sql); if($result){ while($row=mysql_fetch_array($result)){ $rowid=$row["id"]; $content=$row["plcontent"]; if(strlen($content)>60) $content=mysubstr($content,0,60); $pinglun[]=array("title"=>"· $content"); } } //检索相关店铺信息 $sql="select * from myshop where userid=$puser"; $result=mysql_query($sql); if($result){ if($row=mysql_fetch_array($result)){ $rowid=$row["id"]; $mbid=$row["mbid"]; $shoplink=selectmb($mbid,"/",$rowid); }else{ $shoplink="../product/list_t$puser.html"; } } //==================================================================== //检索所有大类信息 /* $sql1="select * from mainclass1 order by id asc"; $re1=mysql_query($sql1); if($re1){ while($row1=mysql_fetch_array($re1)){ $classid1=$row1["id"]; $classname1=$row1["menu"]; $productallclass.=""; $sql2="select * from mainclass2 where menu_superior=$classid1"; $re2=mysql_query($sql2); if($re2){ while($row2=mysql_fetch_array($re2)){ $classid2=$row2["id"]; $classname2="  ".$row2["menu"]; $productallclass.=""; $sql3="select * from mainclass3 where menu_superior=$classid2"; $re3=mysql_query($sql3); if($re3){ while($row3=mysql_fetch_array($re3)){ $classid3=$row3["id"]; $classname3="  →".$row3["menu"]; $productallclass.=""; } } } } } } //检索省份 $areasql="select * from sheng"; $areare=mysql_query($areasql); if($areare){ while($arearow=mysql_fetch_array($areare)){ $shengid=$arearow["id"]; $shengname=$arearow["shengname"]; $shenglist.= ""; } } //检索首字母 for($i=65;$i<=90;$i++){ $charlist.=""; } */ //==================================================================== $smarty->assign("id",$id); $smarty->assign("userid",$puser); $smarty->assign("pname",$pname); $smarty->assign("ppic",$ppic); $smarty->assign("pno",$pno); $smarty->assign("makeyear",$makeyear); $smarty->assign("makeaddress",$makeaddress); $smarty->assign("xmakeaddress",$xmakeaddress); $smarty->assign("guige",$guige); $smarty->assign("rongliang",$rongliang); $smarty->assign("dushu",$dushu); $smarty->assign("baozhuang",$baozhuang); $smarty->assign("xbaozhuang",$xbaozhuang); $smarty->assign("xiangxing",$xiangxing); $smarty->assign("yuanliao",$yuanliao); $smarty->assign("xyuanliao",$xyuanliao); $smarty->assign("shuliang",$shuliang); $smarty->assign("fangweima",$fangweima); $smarty->assign("zhilianggrade",numtostar($zhilianggrade)); $smarty->assign("changjia",$changjia); $smarty->assign("xchangjia",$xchangjia); $smarty->assign("price1",$price1); $smarty->assign("price2",$price2); $smarty->assign("price3",$price3); $smarty->assign("xprice1",$xprice1); $smarty->assign("xprice2",$xprice2); $smarty->assign("xprice3",$xprice3); $smarty->assign("msggrade",$ProductClass[$msggrade]); $smarty->assign("zhutileibie",$ZhuTiClass[$zhutileibie]); $smarty->assign("xiaofeileibie",$XiaoFeiClass[$xiaofeileibie]); $smarty->assign("dangcileibie",$DangCiClass[$dangcileibie]); $smarty->assign("pcontent",$pcontent); $smarty->assign("spcontent",$spcontent); $smarty->assign("pmeno",$pmeno); $smarty->assign("pgoname",$pgoname); $smarty->assign("comname",$comname); $smarty->assign("xcomname",$xcomname); $smarty->assign("address",$address); $smarty->assign("phone",$phone); $smarty->assign("fax",$fax); $smarty->assign("email",$email); $smarty->assign("lxr",$lxr); $smarty->assign("qq",$qq); //$smarty->assign("productallclass",$productallclass); //$smarty->assign("shenglist",$shenglist); //$smarty->assign("charlist",$charlist); $smarty->assign("product",$product); $smarty->assign("pinglun",$pinglun); $smarty->assign("shoplink",$shoplink); $smarty->caching = true; $smarty->cache_lefetime = 86400; $my_cache_id = $_GET['id']; $smarty->display("productview.html","$my_cache_id"); ?>