<%
'商易仿淘宝4.0(多用户)
'ACCESS版演示网站：http://www.ftaobao.com(商易仿淘宝商城)
'SQL版演示网站：http://sql.ftaobao.com
'电话：0571-56907100
'QQ：1147100
%>
<body onLoad="show(A21),show(A22)">
<%titlename=" 买家订单管理"%>
<!--#include file="top.asp"-->
<!--#include file="../include/money.asp"-->
<html><head>
<meta http-equiv=Content-Type content='text/html; charset=gb2312'>
<link href="/include/css.css" rel="stylesheet" type="text/css">
<title><%=my_name%>-----会员中心</title></head>
<%
hy "login.asp"
if request("a")=1 and request("id")<>"" then
conn.execute("Update cart set jg = 1 ,over=1 where id="&shopnet("id")&"")
conn.execute("Update list set over = 1 where bh='"&shopnet("bh")&"'")
response.Write("<Script>alert('通知成功,请为卖家评定信用,谢谢!');window.location='index.asp';</script>")
end if
%>
<table width="762" border="0" align="center" cellpadding="2" cellspacing="0" style='BORDER-COLLAPSE: collapse;MARGIN: 3px'>
  <tr> 
    <td height="15" colspan="2">您的位置： <A href="../index.asp">首页</A> &gt;&gt; <a href="index.asp">会员中心</a>&nbsp;&gt;&gt; 我的订单 </td>
  </tr>
  <tr>
  
  <td width="180" valign="top"><!--#include file="left.asp" -->
  </td>
  <td width="582" height="280" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td><table border="0" align="left" cellpadding="0" cellspacing="0">
          <tr>
            <td width="1"><IMG SRC="../../images/mytaobaobj1_3.gif" WIDTH=3 HEIGHT=25 ALT=""></td>
            <td width="120" align="center" background="../images/mytaobaobj1_4.gif"><font color="#FFFFFF">我的订单</a></span></font></td>
            <td width="1"><IMG SRC="../images/mytaobaobj1_6.gif" WIDTH=7 HEIGHT=25 ALT=""></td>
          </tr>
      </table></td>
    </tr>
  </table>
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="4" bgcolor="1E88C1"></td>
      </tr>
    </table>
    <%
'处理请求

if request("dingdan")<>"" and request("pay")="yes" then
conn.execute("Update list set pay = 1 where bh='"&shopnet("dingdan")&"'")
end if

if request("del")="yes" and request("id")<>"" then
huiyuan= conn.execute("select huiyuan from cart where id="&shopnet("id")&"")(0)
if huiyuan=Request.Cookies(Rikee)("huiyuan") then
conn.execute("Update cart set zt =2 where id="&shopnet("id")&"")
Response.redirect "?"
else
Response.Write("对不起!，您不能取消该条订单。如有疑问请与网站管理员联系。")
end if
end if
if request("abc")=0 then
'显示订单
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from cart where huiyuan='"&Request.Cookies(Rikee)("huiyuan")&"' and over<>1 and zt<>2 order by id desc"
rs.open sql,conn,1,1 
rs.pagesize = 15
if request("page")=""  or isempty(request("page")) then
page = 1
else
page=int(request("page"))
end if
if page>rs.pagecount then
page=rs.pagecount
end if
if not rs.BOF then
Rs.Move Rs.PageSize*(page-1)

i=1
do while not rs.eof and i<=rs.pagesize%>
    &nbsp;<br>    &nbsp;
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td height="22" align="center">&nbsp;订单状态
                <%if rs("cl")=1 then %>
货已发出,请注意查收！如果收到货,<a href=?a=1&id=<%=rs("id")%>&bh=<%=rs("bh")%>>请点击这里通知商家</a>
<%elseif rs("cl")=0 then 
response.write "订单等待处理&nbsp;&nbsp;&nbsp;&nbsp;[<a href=?adc=0&del=yes&id="&rs("id")&">取消该订单</a>]"
elseif rs("cl")=2 then 
response.write "订单已受理，请尽快付款！&nbsp;&nbsp;&nbsp;&nbsp;[<a href=?pay=yes&dingdan="&rs("bh")&">如果已经付款，请点击这里通知商家！</a>]"
else
response.write "订单已取消"
end if

%></td>
            </tr>
      </table>
          <table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#efefef">
            <tr align="center" valign="middle" bgcolor="#f7f7f7">
              <td width="131" height="21" background="../image/bk.gif">订单号</td>
              <td width="179" height="21" background="../image/bk.gif">商品名称</td>
              <td width="109" background="../image/bk.gif">订单时间</td>
              <td width="46" height="21" background="../image/bk.gif">状态</td>
              <td width="45" height="21" background="../image/bk.gif">价格</td>
              <td width="47" height="21" background="../image/bk.gif">数量</td>
            </tr>
            <%set rs1 = conn.execute("select * from list where bh='"&rs("bh")&"' and over=0 order by id desc")
do while not rs1.eof%>
            <tr valign="middle" bgcolor="#FFFFFF">
              <td width="131"><div align="center"><a href="dingdan_xiangxi.asp?id=<%=rs("id")%>&type=1" target="_blank"><%=rs("bh")%></a></div></td>
              <td width="179" height="20"><a href=../merchandise.asp?id=<%=encode(rs1("cpid"))%>><%=rs1("mc")%></a></td>
              <td width="109" align="center"><%=rs1("sj")%></td>
              <td width="46" height="20" align="center"><%if rs1("pay")="0" then %>未付款<%else%>已付款<%end if%></td>
              <td width="45" height="20" align="center"><%=rs1("jg2")%></td>
              <td width="47" height="20" align="center"><%=rs1("sl")%></td>
            </tr>
            <tr valign="middle" bgcolor="#FFFFFF">
              <td height="21" colspan="6" background="../image/bk1.gif">&nbsp;</td>
            </tr>
            <%rs1.movenext
loop
rs1.close
set rs1=nothing%>
      </table>
    <br>
          <%i=i+1
rs.MoveNext                                              
loop 
if rs.recordcount<>0 then
if page-1 mod 5=0 then
p=(page-1) \ 5
else
p=(page-1) \ 5
end if
response.write "分"& rs.pagecount &"页,共"& rs.recordcount &"条"
if p*5>0 then response.write "<a href='?page="&p*5&"' title=上5页>[&lt;&lt;]</a>   "
uming_i=1
for ii=p*5+1 to P*5+5
if ii=page then
response.write "<font color=#ff0000>["+Cstr(ii)+"]</font> "
else
response.write "<a href='?page="&ii&"'>["+Cstr(ii)+"]</a>   "
end if
if ii=rs.pagecount then exit for
uming_i=uming_i+1
next
if ii<=rs.pagecount and uming_i=11 then response.write "<a href='?page="&ii&"' title=下5页>[&gt;&gt;]</a>   "
end if
rs.close
set rs=nothing%>
          <%else
'显示已购商品
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from cart where huiyuan='"&Request.Cookies(Rikee)("huiyuan")&"' and over<>1 order by id desc"
rs.open sql,conn,1,1 
rs.pagesize = 5
if request("page")="" or isempty(request("page")) then
page = 1
else
page=int(request("page"))
end if
if page>rs.pagecount then
page=rs.pagecount
end if
if not rs.BOF then
Rs.Move Rs.PageSize*(page-1)
end if
i=1
do while not rs.eof and i<=rs.pagesize%>
    商品单号：<%=rs("bh")%>&nbsp;&nbsp;
    <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
      <tr align="center" valign="middle" bgcolor="#f7f7f7">
        <td width="225" height="21" background="../image/bk.gif">商品名称</td>
        <td width="85" height="21" background="../image/bk.gif">商家ID</td>
        <td width="118" height="21" background="../image/bk.gif">购买日期</td>
        <td width="58" height="21" background="../image/bk.gif">价格</td>
        <td width="52" height="21" background="../image/bk.gif">商品数量</td>
      </tr>
      <%set rs1 = conn.execute("select * from list where bh='"&rs("bh")&"' order by id desc")
do while not rs1.eof%>
      <tr valign="middle" bgcolor="#FFFFFF">
        <td width="225"><%=rs1("mc")%></td>
        <td width="85" height="20"><div align="center"><%=RS("userid")%>&nbsp;</div></td>
        <td width="118" height="20" align="center"><%=rs1("jg1")%></td>
        <td width="58" height="20" align="center"><%=rs1("jg2")%></td>
        <td width="52" height="20" align="center"><%=rs1("sl")%></td>
      </tr>
      <tr valign="middle" bgcolor="#FFFFFF">
        <td height="21" background="../image/bk1.gif">&nbsp;</td>
        <td height="21" background="../image/bk1.gif">&nbsp;</td>
        <td height="21" align="center" background="../image/bk1.gif">&nbsp;</td>
        <td height="21" align="center" background="../image/bk1.gif">&nbsp;</td>
        <td height="21" align="center" background="../image/bk1.gif">&nbsp;</td>
      </tr>
      <%rs1.movenext
loop
rs1.close
set rs1=nothing%>
    </table>
    <div align="center"><br>
        <%i=i+1
rs.MoveNext                                              
loop 
if rs.recordcount<>0 then
if page-1 mod 5=0 then
p=(page-1) \ 5
else
p=(page-1) \ 5
end if
response.write "共"& rs.pagecount &"页,共"& rs.recordcount &"条"
if p*5>0 then response.write "<a href='?page="&p*5&"' title=上5页>[&lt;&lt;]</a>   "
uming_i=1
for ii=p*5+1 to P*5+5
if ii=page then
response.write "<font color=#ff0000>["+Cstr(ii)+"]</font> "
else
response.write "<a href='?page="&ii&"'>["+Cstr(ii)+"]</a>   "
end if
if ii=rs.pagecount then exit for
uming_i=uming_i+1
next
if ii<=rs.pagecount and uming_i=11 then response.write "<a href='?page="&ii&"' title=下5页>[&gt;&gt;]</a>   "
else
%>
           <Br>  <%msg="<font color=red>提示：</font>您还没去买过东西吧！<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在您付款之后请耐心的等待卖家确认收款和发货吧!<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;请您在收到商品后别忘了点收货确认，还有别忘了评价商品卖家哦!"
	  wmsg()%>

      
      <%end if
rs.close
set rs=nothing
end if
end if
%>
    </div></td>
  </tr>
</table>
<!--#include file="../bottom.asp"-->
