<!-- #include file="include/config_shop.asp" -->
<!-- #include file="include/conn.asp" -->
<%
dim ordernum,isuser,types,nid,price,prices,num,sum
tit="订单查询"

call web_head(0,0,0,0,0)
'------------------------------------left----------------------------------
call format_login()
call shop_sort()
call shop_left()
'----------------------------------left end--------------------------------
call web_center(0)
'-----------------------------------center---------------------------------
response.write ukong

call product_sea()
%>
<table border=0 width='100%' cellspacing=0 cellpadding=0>
<tr><td height=300 align=center>
<%
ordernum=replace(trim(request.querystring("ordernum")),"'","")
if len(ordernum)<1 then
  response.write "<font class=red>查询提示：</font><font class=blue_1>请在订单查询栏中输入您要查询的订单号进行订单查询！</font>"
else
  if len(ordernum)<>10 then
    response.write "<font class=red>查询出错：</font>请输入您要查询的正确的订单号：<font class=red>订单号的长度必须为10位！</font>"
  else
    sql="select * from orders where ordernum='"&ordernum&"'"
    set rs=conn.execute(sql)
    if rs.eof and rs.bof then
      response.write "<font class=red>查询出错：</font>请输入的订单号（<font class=red>"&ordernum&"</font>）不存在或已被删除！"
    else
      id=rs("id"):types=rs("types")
      response.write "<br>"&table1
%>
<tr<%response.write table2%>><td colspan=2 height=20 align=center class=end><b>订单查询结果</b></td></tr>
<tr<%response.write table3%>><td width='20%'>订 单 号：</td><td width='80%'class=red><b><%response.write ordernum%></b></td></tr>
<tr<%response.write table3%>><td>收货人姓名：</td><td><%
response.write rs("nname")
isuser=rs("isuser")
if isuser=true then response.write "　<font class=red_3>（会员："&format_user_view(rs("username"),1,"")&"）</font>"%></td></tr>
<tr<%response.write table3%>><td>收货人地址：</td><td><%response.write rs("address")%></td></tr>
<tr<%response.write table3%>><td>邮政编码：</td><td><%response.write rs("code")%></td></tr>
<tr<%response.write table3%>><td>联系电话：</td><td><%response.write rs("phone")%></td></tr>
<tr<%response.write table3%>><td>电子信箱：</td><td><%response.write rs("email")%></td></tr>
<tr<%response.write table3%>><td>付款方式：</td><td><%response.write rs("payment")%></td></tr>
<tr<%response.write table3%>><td>订购时间：</td><td><%response.write rs("tim")%></td></tr>
<tr<%response.write table3%>><td valign=top>备注信息：</td><td><pre><%response.write code_html(rs("remark"),1,0)%></td></tr>
<tr<%response.write table4%>><td>订单状态：</td><td><%
select case int(types)
case 1
  response.write "有问题"
case 5
  response.write "已处理"
case else
  response.write "未处理"
end select
%>
&nbsp;&nbsp;&nbsp;&nbsp;（上次处理时间：<%response.write rs("dis_tim")%>）</td></tr>
<tr<%response.write table3%>><td>处理信息：</td><td><pre><%response.write code_html(rs("dis_remark"),1,0)%></td></tr>
</table>
<br>
<%response.write table1%>
<tr<%response.write table2%> height=22 align=center>
<td width='23%' class=end>产品编号</td>
<td width='35%' class=end>产品名称</td>
<td width='14%' class=end>产品单价</td>
<td width='13%' class=end>产品数量</td>
<td width='14%' class=end>产品总价</td>
</tr>
<%
  sql="select * from oorders where oid="&id&" order by id"
  set rs=conn.execute(sql)
  do while not rs.eof
    nid=rs("pid"):price=rs("price"):num=rs("num")
    prices=price*num
    sum=sum+prices
%>
<tr<%response.write table3%> align=center>
<td><%response.write rs("serial")%></td>
<td><a href='shop_view.asp?id=<%response.write nid%>' title='浏览该产品信息' target=_blank><%response.write rs("name")%></a></td>
<td><%response.write price%></td>
<td><%response.write num%></td>
<td><%response.write prices%></td>
</tr>
<%
    rs.movenext
  loop
%>
<tr<%response.write table4%>><td colspan=5 align=right class=red>总价格：<%response.write sum%>&nbsp;&nbsp;&nbsp;</td></tr>
</table>
<%
    end if
    rs.close
    set rs=nothing
  end if
end if
%>
</td></tr></table>
<%
response.write kong
'---------------------------------center end-------------------------------
call web_end(0)
%>