<!-- #Include File="../Include/Channel_Shop.asp" -->
<!-- #Include File="Common.asp" -->
<%
'=======================================================
' 欢迎使用《阿赛大型门户网站系统V3.0》，简称“AsaiMHV3”
' 技术支持、商业版咨询、官方唯一指定联系QQ“4941172”
' 官方网站：http://77ya.com      程序负责人：阿赛
'=======================================================

tit="订单查询"
dim otype,sTmp
    sTmp=""
    otype=trim(request.querystring("type"))
call DoWebHead(0,0)
Call Channel_Load(0)
tit_fir=Cls.ChannelName
if action="search" then
  select case otype
    case "emoney"
      call emoney_search_list()
    case else
  call order_search_list()
   end select
end if
Call ShowMsg(tit,order_search()&vbcrlf&sTmp)
Call Channel_End(0)
call DoWebEnd()

sub order_search_list()
 sTmp = sTmp & Vbcrlf&" <table cellspacing=1 cellpadding=4 class=table>" & _
               Vbcrlf&" <tr align=center>" & _
               Vbcrlf&"<td class=td width='7%'>序号</td>" & _
               Vbcrlf&"<td class=td width='22%'>订 单 号</td>" & _
               Vbcrlf&"<td class=td width='14%'>收货人</td>" & _
               Vbcrlf&"<td class=td width='12%'>订购金额</td>" & _
               Vbcrlf&"<td class=td width='16%'>订购时间</td>" & _
               Vbcrlf&"<td class=td width='12%'>支付方式</td>" & _
               Vbcrlf&"<td class=td width='10%'>支付否</td>" & _
               Vbcrlf&"<td class=td width='7%'>查看</td>" & _
               Vbcrlf&"</tr>"
  dim tim,ordernum,sqladd,keyword
  keyword=request.querystring("keyword")
  sqladd=" where ordernum='"&keyword&"'"
  i=1
  sql="select id,ordernum,nname,tim,prices,ispayment,ispay from AsaiMHShopOrders "&sqladd&" order by id desc"
  set rs=Cls.exec(sql,1)
  do while not rs.eof
    ordernum=rs("ordernum")
    tim=rs("tim")
 sTmp = sTmp & Vbcrlf&"  <tr class=tr align=center><td>"&i&"</td>" & _
               Vbcrlf&"  <td align=left><a href='Order_View.asp?ordernum="&ordernum&"'>"&ordernum&"</a></td>" & _
               Vbcrlf&"  <td align=left>"&rs("nname")&"</td>" & _
               Vbcrlf&"  <td align=right>"&fm_price(rs("prices"),1)&"</td>" & _
               Vbcrlf&"  <td><font title='"&Cls.time_type(tim,2)&"' class=tims>"&Cls.time_type(tim,3)&"</td>" & _
               Vbcrlf&"  <td>"
    if rs("ispayment") then
     sTmp = sTmp &  "在线支付"
    else
     sTmp = sTmp &  "<font class=Gys>其它方式</font>"
    end if
     sTmp = sTmp &  "</td> <td>"
    if rs("ispay") then
      sTmp = sTmp &  "<font class=red>已支付</font>"
    else
      sTmp = sTmp &  "<font class=Gys>未支付</font>"
    end if
	sTmp = sTmp &  "</td><td><a href='Order_View.asp?ordernum="&ordernum&"'>详细</a></td> </tr>"
    i=i+1
    rs.movenext
  loop
  rs.close
  sTmp = sTmp &  "</table>"
end sub

sub emoney_search_list()
  sTmp = sTmp & "<table cellspacing=1 cellpadding=4 class=table>" &_
  Vbcrlf&"<tr align=center>" &_
  Vbcrlf&"<td class=td width='7%'>序号</td>" &_
  Vbcrlf&"<td class=td width='28%'>订 单 号</td>" &_
  Vbcrlf&"<td class=td width='18%'>客户姓名</td>" &_
  Vbcrlf&"<td class=td width='12%'>订购"&Cls.web_unit&"</td>" &_
  Vbcrlf&"<td class=td width='12%'>订购数量</td>" &_
  Vbcrlf&"<td class=td width='16%'>订购时间</td>" &_
  Vbcrlf&"<td class=td width='7%'>查看</td>" &_
  Vbcrlf&"</tr>" 
  dim tim,ordernum,sqladd,tmp1,keyword
  keyword=request.querystring("keyword")
  sqladd=" where ordernum='"&keyword&"'"
  i=0
  sql="select id,ordernum,nname,tim,emoneys,num from AsaiMHShopEmoneyNotes "&sqladd&" order by id desc"
  set rs=Cls.exec(sql,1)
  if rs.eof then
  sTmp = sTmp & "<tr align=center><td colspan=7 height=30>没有找到您搜索的订单！</td></tr>"
  end if
  do while not rs.eof
    i=i+1
    ordernum=rs("ordernum")
    tim=rs("tim")
sTmp = sTmp & Vbcrlf&"       <tr class=tr align=center>" & _
Vbcrlf&"      <td>"&i&"</td>" & _
Vbcrlf&"      <td align=left><a href='Order_View.asp?type=emoney&ordernum="&ordernum&"'>"&ordernum&"</a></td>" & _
Vbcrlf&"      <td align=left>"&rs("nname")&"</td>" & _
Vbcrlf&"      <td align=right>"&fm_price(rs("emoneys"),1)&"</td>" & _
Vbcrlf&"      <td align=center>"&rs("num")&"</td>" & _
Vbcrlf&"      <td><font alt='"&Cls.time_type(tim,2)&"' class=tims>"&Cls.time_type(tim,3)&"</td>" & _
Vbcrlf&"      <td><a href='Order_View.asp?type=emoney&ordernum="&ordernum&"'>详细</a></td>" & _
Vbcrlf&"      </tr>"
    i=i+1
    rs.movenext
  loop
  rs.close
 sTmp = sTmp & Vbcrlf&"  </table>"
end sub

function order_search()
order_search="<table cellspacing=1 cellpadding=4 class=table>" & _
vbcrlf&"<tr class=tr align=center>" & _
vbcrlf&"<td><a href='"&Cls.Web_Dir&"User/EmoneyNote.asp?action=query'><b>查看我的 一般 订单列表</b></a></td>" & _
vbcrlf&"<td><a href='"&Cls.Web_Dir&"User/EmoneyNote.asp?action=query2'><b>查看我的 "&Cls.web_unit&" 订单列表</b></a></td>" & _
vbcrlf&"</tr></form></table>{$ukong}" & _
vbcrlf&"<table cellspacing=1 cellpadding=4 class=table>" & _
vbcrlf&"<form name=shop_order_sea_frm action='Order.asp' method=get onsubmit=""javascript:frm_submitonce(this);"">" & _
vbcrlf&"<input type=hidden name=action value='search'>" & _
vbcrlf&"<tr class=td>" & _
vbcrlf&"<td colspan=7><font class=red2>请输入您在购买时生成的订单号</font></td>" & _
vbcrlf&"</tr>" & _
vbcrlf&"<tr class=tr>" & _
vbcrlf&"<td>订单号：</td>" & _
vbcrlf&"<td><input type=text name=keyword value='请输入订单号' onfocus=""if (value =='请输入订单号'){value =''}"" onblur=""if (value ==''){value='请输入订单号'}"" size=20 maxlength=20></td>" & _
vbcrlf&"<td><select name=type size=1><option value='other'>一般支付订单</option><option value='emoney'>"& Cls.web_unit&"支付订单</option></select></td>" & _
vbcrlf&"<td><input class=btn type=submit value='搜索订单'></td>" & _
vbcrlf&"</tr></form></table>{$ukong}"
end function
%>
