<!--#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("04")%>

<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">
		  <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>

<%
action=request("action")
if action="" then
%>
<table border="0" cellpadding="0" cellspacing="1" bgcolor="#b1bfee" width="95%">
<form name=search action=order2.asp method=post>
  <tr bgcolor="#FFFFFF">
    <td width=20% align=center>根据订单状态</td>
    <td><select name='Status'>
        <option value=''>请选择订单状态</option>
        <%
	set rs=conn.execute("select * from type Order by Status asc")
	do while not rs.eof
	response.write "<option value='"&rs("Status")&"'>"&rs("StatusDefine")&"</option>"
	rs.movenext
	if rs.eof then exit do
	loop
	set rs=nothing
%>
      </select></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td width=20% align=center> 根据订单号 </td>
    <td><input type=text name=ordernum size=25 maxlength=12></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td width=20% align=center> 根据提交订单的会员ID </td>
    <td><input type=text name=userid size=25 maxlength=16></td>
  </tr>
    <tr bgcolor="#FFFFFF">

  <td width=20% align=center>根据收货人姓名 </td>
  <td><input type=text name=recname size=25 maxlength=20></td></tr>
    <tr bgcolor="#FFFFFF">

  <td width=20% align=center>根据电子邮箱 </td>
  <td><input type=text name=RecMail size=25 maxlength=100></td></tr>
    <tr bgcolor="#FFFFFF">

  <td width=20% align=center>根据联系电话 </td>
  <td><input type=text name=RecPhone size=25 maxlength=20></td></tr>
    <tr bgcolor="#FFFFFF">

  <td width=20% align=center>根据移动电话 </td>
  <td><input type=text name=CompPhone size=25 maxlength=20></td></tr>
    <tr bgcolor="#FFFFFF">

  <td width=20% align=center>根据联系地址 </td>
  <td><input type=text name=RecAddress size=25 maxlength=100></td></tr>
    <tr bgcolor="#FFFFFF">

  <td width=20% align=center>根据邮政编码 </td>
  <td><input type=text name=ZipCode size=25 maxlength=8></td></tr>
    <tr bgcolor="#FFFFFF">

  <td width=20% align=center>根据提交订单时间 </td>
  <td><input type="radio" name="ordertime" value="1">
    今天 &nbsp; <input type="radio" name="ordertime" value="2">
    昨天 &nbsp; <input type="radio" name="ordertime" value="7">
    一周内 &nbsp; <input type="radio" name="ordertime" value="30">
    一月内 &nbsp; <input type="radio" name="ordertime" value="">
    全部 &nbsp; </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("ordernum"))<>"" then
  if not isNumeric(trim(request("ordernum"))) 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
	ordersql=""
	if request("Status")<>"" then ordersql=ordersql+" and b.Status='"&request("Status")&"'"
	if trim(request("ordernum"))<>"" then ordersql=ordersql+" and a.ordernum like '%"&trim(request("ordernum"))&"%'"
	if trim(request("userID"))<>"" then ordersql=ordersql+" and a.userid like '%"&trim(request("userid"))&"%'"
	if trim(request("recname"))<>"" then ordersql=ordersql+" and a.recname like '%"&trim(request("recname"))&"%'"
	if trim(request("RecMail"))<>"" then ordersql=ordersql+" and a.RecMail like '%"&trim(request("usermail"))&"%'"
	if trim(request("RecAddress"))<>"" then ordersql=ordersql+" and a.RecAddress like '%"&trim(request("RecAddress"))&"%'"
	if trim(request("RecPhone"))<>"" then ordersql=ordersql+" and a.RecPhone like '%"&trim(request("RecPhone"))&"%'"
	if trim(request("CompPhone"))<>"" then ordersql=ordersql+" and a.CompPhone like '%"&trim(request("CompPhone"))&"%'"
	if trim(request("ZipCode"))<>"" then ordersql=ordersql+" and a.ZipCode like '%"&trim(request("ZipCode"))&"%'"

	if request("ordertime")="1" then  ordersql=ordersql+" and a.ordertime >= #"&date()&"#"
	if request("ordertime")="2" then  ordersql=ordersql+" and a.ordertime >= #"&date()-1&"# and ordertime < #"&date()&"#"
	if request("ordertime")="7" then  ordersql=ordersql+" and a.ordertime >= #"&date()-7&"#"
	if request("ordertime")="30" then  ordersql=ordersql+" and a.ordertime >= #"&date()-30&"#"

response.cookies("buyok")("ordersql")=ordersql
if ordersql="" then
Response.Redirect("order2.asp")
else
Response.Redirect("order1.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>
