?? goodssupersearchform.php
字號:
<?php
/*
[插件名稱] 商品高級搜索 - 替換模版的{#modGoodsSuperSearchForm#}
[適用范圍] 全站
[文 件 名] GoodsSuperSearchForm.php
[更新時間] 2007/2/16
*/
function GoodsSuperSearchForm(){
global $msql,$fsql,$tsql,$charset,$PagesInfo,$tbl_goodstype,$tbl_goodsprop_list;
global $tbl_shop_cat,$tbl_goodsprop,$tbl_brand,$tbl_menu,$MenuInfo,$CONF;
$PSET=PlusSet("modGoodsSuperSearchForm");
$tempname=PlusDef($PSET["tempname"],"tpl_goodssupersearch.htm");
$catid=$_GET["catid"];
$key=$_GET["key"];
$showtj=$_GET["showtj"];
$showremai=$_GET["showremai"];
$shownew=$_GET["shownew"];
$showtejia=$_GET["showtejia"];
$page=$_GET["page"];
$brand=$_GET["brand"];
$goodstype=$_GET["goodstype"];
$hbdanwei=$CONF["hbdanwei"];
//分類
$msql->query("select * from $tbl_menu where coltype='shop' and ifshow='1' and ifsearch='1' order by xuhao");
while($msql->next_record()){
$menuid=$msql->f('menuid');
$menu=$msql->f('menu');
$menustr=$menu."-| ";
$fsql->query("select * from $tbl_shop_cat where menuid='$menuid' and pid='0' order by xuhao");
while($fsql->next_record()){
$lcatid=$fsql->f('catid');
$lcat=$fsql->f('cat');
if($catid==$lcatid){
$catlist.="<option value='".$lcatid."' selected>".$menustr.$lcat."</option>";
}else{
$catlist.="<option value='".$lcatid."'>".$menustr.$lcat."</option>";
}
}
}
//品牌
$fsql->query("select * from $tbl_brand order by xuhao ");
while($fsql->next_record()){
$lbrand=$fsql->f('brand');
if($brand==$lbrand){
$brandlist.="<option value='".$lbrand."' selected>".$lbrand."</option>";
}else{
$brandlist.="<option value='".$lbrand."'>".$lbrand."</option>";
}
}
//商品類型
$fsql->query("select * from $tbl_goodstype where goodstype!='cent' and goodstype!='flowerdiy' and goodstype!='fushu' order by xuhao");
while($fsql->next_record()){
$gtname=$fsql->f('name');
$gttype=$fsql->f('goodstype');
if($goodstype==$gttype){
$typelist.="<option value='supersearch.php?goodstype=".$gttype."' selected>".$gtname."</option>";
}else{
$typelist.="<option value='supersearch.php?goodstype=".$gttype."'>".$gtname."</option>";
}
}
$words=$CONF["GoodsHotWords"];
$arr=explode(",",$words);
for($i=0;$i<sizeof($arr);$i++){
if($arr[$i]!=""){
$hotwords.="<a href=".ROOTPATH."goodssearch.php?key=".$arr[$i].">".$arr[$i]."</a> ";
}
}
//模版解釋
$Temp=LoadTemp(ROOTPATH."templates/".$MenuInfo["skin"]."/".$tempname);
$TempArr=SplitTblTemp($Temp);
$var=array (
'key' => $key,
'catlist' => $catlist,
'typelist' => $typelist,
'brandlist' => $brandlist,
'hotwords' => $hotwords,
'hbdanwei' => $hbdanwei,
'goodstype' => $goodstype,
'RP' => ROOTPATH
);
$str=ShowTplTemp($TempArr["start"],$var);
//商品類型指定時,讀取參數(shù)列
if($goodstype!="" && $goodstype!="0"){
$n=1;
$fsql->query("select * from $tbl_goodsprop where ifsearch='1' and goodstype='$goodstype' order by xuhao");
while($fsql->next_record()){
$propid=$fsql->f('id');
$propname=$fsql->f('propname');
$proptype=$fsql->f('proptype');
$pn="prop".$n;
if($proptype=="list"){
$pnlist="";
$tsql->query("select * from $tbl_goodsprop_list where propid='$propid' order by xuhao");
while($tsql->next_record()){
$listname=$tsql->f('name');
$pnlist.="<option value='".$listname."'>".$listname."</option>";
}
$var=array (
'propname' => $propname,
'pnlist' => $pnlist,
'pn' => $pn
);
$str.=ShowTplTemp($TempArr["menu"],$var);
}else{
$var=array (
'propname' => $propname,
'pn' => $pn
);
$str.=ShowTplTemp($TempArr["list"],$var);
}
$n++;
}
}
$str.=$TempArr["end"];
return $str;
}
?>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -