<!--#include file="../include/nowshop.asp"-->
<!--#include file="checkadmin.asp"-->
<%
sub checkmanage(str)
Set mrs = conn.Execute("select * from manage where username='"&request.cookies("buyok")("admin")&"'")
if not (mrs.bof and mrs.eof) then
manage=mrs("manage")
if instr(manage,str)<=0 then
response.write "<script language='javascript'>"
response.write "alert('警告：您没有此项操作的权限！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
else
session("buyok_admin_login")=0
end if
else 
response.write "<script language='javascript'>"
response.write "alert('没有登陆，不能执行此操作！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
end if
set mrs=nothing
end sub
%>
<%call checkmanage("03")%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../images/css.css" type=text/css rel=stylesheet>
<LINK href="../list/newhead.css" type=text/css rel=stylesheet>
</head>

<BODY bgcolor="#D9EAFC">
<%
action=request("action")
if action="" then
%>
		  <table height="5"><tr><td></td></tr></table>
<TABLE cellSpacing=0 cellPadding=0 width=95% border=0 style="BORDER-RIGHT: #b1bfee 1px solid; BORDER-TOP: #b1bfee 1px solid; BORDER-LEFT: #b1bfee 1px solid; BORDER-BOTTOM: #b1bfee 1px solid" 
>
  <TBODY>
    <TR> 
      <TD width="90%" bgColor=#f4f5fd><font color="#000000">　<B><font color="#FF0000">商品高级搜索</font></B></font></TD>
      <TD bgColor=#f4f5fd height=30><font color="#000000">&nbsp;<a href="http://www.nowshop.com.cn/help/index.asp?boardid=2&page=1" target="_blank">设置帮助</a></font></TD>
    </TR>
  </TBODY>
</TABLE>		  <table height="5"><tr><td></td></tr></table>

<table border="0" cellpadding="0" cellspacing="1" bgcolor="#b1bfee" width="95%">
  <form name=search action=prod2.asp method=post>
    <tr bgcolor="#FFFFFF">
      <td width=20% align=center>根据商品类别</td>
      <td> 
        <%	Dim a,b,c 
	set rs=server.createobject("adodb.recordset") 
	sql="select distinct LarCode,LarSeq from bclass order by LarSeq" 
	rs.Open sql,conn,1,1 
	response.write "<select name='fenlei'>"
	response.write	"<option value='' selected>选择要搜索的商品分类</option>"
	if rs.bof and rs.eof then
	response.write "<option selected value=''>-暂无分类-</option>"
	else
	Do While Not rs.eof	
	response.write "<option value='"&rs("larCode")&"'>"&rs("LarCode")&"</option>"
	rs.movenext
	  if rs.eof then exit do
	loop
	response.write "<option value='未归类'>所有未归类商品</option>"
	end if
	rs.close
	set rs=nothing
%>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width=20% align=center> 根据商品名称 </td>
      <td><input type=text name=name_key size=40 maxlength=20></td>
    </tr>
	    <tr bgcolor="#FFFFFF">

    <td width=20% align=center>根据商品编号 </td>
    <td><input type=text name=id_key size=40 maxlength=20></td></tr>
	    <tr bgcolor="#FFFFFF">

    <td width=20% align=center>根据商品简介 </td>
    <td><input type=text name=jj_key size=40 maxlength=20></td></tr>
	    <tr bgcolor="#FFFFFF">

	    <td width=20% align=center>根据商品内容 </td>
    <td><input type=text name=nr_key size=40 maxlength=20></td></tr>
	    <tr bgcolor="#FFFFFF">

    <td width=20% align=center>根据商品价格 </td>
    <td>价格范围：从 
      <input type=text name=jg1_key size=5 maxlength=4>
      元 至 
      <input type=text name=jg2_key size=5 maxlength=4>
      元</td></tr>
	      <tr bgcolor="#FFFFFF">

    <td width=20% align=center>根据是否推荐 </td>
    <td><input type="radio" name="tj_key" value="1">
      是 
      <input type="radio" name="tj_key" value="2">
      否 
      <input type="radio" name="tj_key" value="3">
      全部</td></TR>
	      <tr bgcolor="#FFFFFF">

    <td width=20% align=center>根据是否特价 </td>
    <td><input type="radio" name="tej_key" value="1">
      是 
      <input type="radio" name="tej_key" value="2">
      否 
      <input type="radio" name="tej_key" value="3">
      全部</td></TR>
	      <tr bgcolor="#FFFFFF">

    <td width=20% align=center>根据商品状态 </td>
    <td><input type="radio" name="zt_key" value="1">
      显示 
      <input type="radio" name="zt_key" value="2">
      关闭 
      <input type="radio" name="zt_key" value="3">
      全部</td></TR>
	      <tr bgcolor="#FFFFFF">

    <td width=20% align=center>搜索结果排序方式 </td>
    <td><input type="radio" name="paixu" value="1" checked>
      时间降 
      <input type="radio" name="paixu" value="2">
      时间升
      <input type="radio" name="paixu" value="3">
      编号降 
      <input type="radio" name="paixu" value="4">
      编号升 
      <input type="radio" name="paixu" value="5">
      名称 
      <input type="radio" name="paixu" value="6">
      点击数</td></TR>
    <tr bgcolor="#FFFFFF">
      <td colspan=2><INPUT name="action" TYPE="hidden" value="ok">
        <INPUT name=action TYPE="submit" value="开始搜索"></td>
    </tr>
  </form>
</table>

<br>
<font color=red>※提示：</font><br>
支持模糊搜索，可根据一个或多个条件进行搜索，非搜索条件可空出。 
<%
else

'开始搜索
if trim(request("jg1_key"))<>"" then
  if not isNumeric(trim(request("jg1_key"))) then
	response.write "<script language='javascript'>"
	response.write "alert('您填写的内容不符合要求，价格必须是数字，请检查！');"
	response.write "location.href='javascript:history.go(-1)';"
	response.write "</script>"
	response.end
  end if
end if

if trim(request("jg2_key"))<>"" then
  if not isNumeric(trim(request("jg2_key"))) then
	response.write "<script language='javascript'>"
	response.write "alert('您填写的内容不符合要求，价格必须是数字，请检查！');"
	response.write "location.href='javascript:history.go(-1)';"
	response.write "</script>"
	response.end
  end if
end if

	if request("name_key")<>"" then addsql=addsql+" and prodname like '%"&request("name_key")&"%'"
	if request("ID_key")<>"" then addsql=addsql+" and prodID like '%"&request("ID_key")&"%'"
	if request("jj_key")<>"" then addsql=addsql+" and ProdDisc like '%"&request("jj_key")&"%'"
	if request("nr_key")<>"" then addsql=addsql+" and MemoSpec like '%"&request("nr_key")&"%'"
	if request("tj_key")="1" then addsql=addsql+" and remark='1'"
	if request("tj_key")="2" then addsql=addsql+" and remark='0'"
	if request("zt_key")="1" then addsql=addsql+" and online=true"
	if request("zt_key")="2" then addsql=addsql+" and online=false"
	if request("tej_key")="1" then addsql=addsql+" and tejia='1'"
	if request("tej_key")="2" then addsql=addsql+" and tejia='0'"
	if request("fenlei")<>"" then addsql=addsql+" and larcode='"&request.form("fenlei")&"'"
	if trim(request("jg1_key"))<>"" then addsql=addsql+" and PriceList>"&request("jg1_key")
	if trim(request("jg2_key"))<>"" then addsql=addsql+" and PriceList<"&request("jg2_key")
	if request("paixu")="1" then orderby=" order by adddate desc"
	if request("paixu")="2" then orderby=" order by adddate"
	if request("paixu")="3" then orderby=" order by prodid desc"
	if request("paixu")="4" then orderby=" order by prodid"
	if request("paixu")="5" then orderby=" order by prodname"
	if request("paixu")="6" then orderby=" order by ClickTimes desc"

if addsql="" then
response.cookies("buyok")("sql")=""
Response.Redirect("prod2.asp")
else

sql="select * from bproduc where ProdId is not null" + addsql +orderby
response.cookies("buyok")("sql")=sql
Response.Redirect("prod1.asp")
end if

end if
%>
<table width="95%" border="0">
  <tr> 
    <td height="60"><font color="#FF0000">我们将为购买正版NowShop商城系统者免费设计全套广告图片；提供免费安装调试；免费送1%网银接口、支付宝接口；免费提供技术支持；免费提供系统升级；免费提供系统模板更换；免费代办网站ICP备案；使您的网店更具吸引力！</font></td>
  </tr>
  <tr> 
    <td><p>购买咨询或技术支持，请在周一至周五8：00-18：00间联系<br>
        Email / MSN：shop@nowshop.com.cn<br>
        电话：0551-5123308&nbsp;&nbsp;13965090551<br>
        QQ：2055008<br>
        网站：<a href="http://www.nowshop.com.cn" target="_blank">http://www.nowshop.com.cn</a><br>
        演示：<a href="http://ys.nowshop.com.cn" target="_blank">http://ys.nowshop.com.cn</a><br>
      </p>
      <p>Powerd By：NowShop商城系统 V3.5</p></td>
  </tr>
</table>
</body>
</html>
