⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 goodssupersearchform.php

📁 推荐的一本书!!!!建议看 !!!!!!!!!
💻 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);


	//商品类型指定时,读取参数列

	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;


}
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -