<!--#include file="../conn/conn2.asp" -->
<!--#include file="member_check.asp" -->
<%
action=request.QueryString("action")
O_id=request.QueryString("O_id")
if action="del" then
conn.execute("delete from Orders where O_id="&O_id)
Response.Write"<script>alert('删除订单成功!');window.location='member_order.asp';</script>"
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>会员中心</title>
<style type="text/css">
			html {
				overflow:auto;
			}
			body {
			margin:0px;
				background-color: transparent; 
				font-size:12px;
				line-height:180%;
				font-family:"微软雅黑";
				
			}
			a{ font-size:12px; color:#000000; text-decoration:none;}
			a:hover {color:#0066ff;text-decoration: underline}
			a img {
	border:none;
}
</style>
</head>
<body>
<!--#include file="left.asp" -->
<div style="width:550px; float:left; padding-left:20px;">
<h2>我的订单</h2>
<hr>
<table width="100%" border="1" bordercolor="#000000" style="border-collapse:collapse;">
<tr><td>商品名称</td><td>图片</td><td>单价</td><td>数量</td><td>总价</td><td>状态</td><td>操作</td><td>删除</td></tr>
<%
sql="select * from orders,buy where O_bid=B_id and O_member='"&M_login&"' order by O_id desc"
set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		Do while Not rs.eof
		if rs("O_state")=0 then
		O_state="未付款"
		O_pay="<a href='../alipay/alipayapi.asp?O_id="&rs("O_id")&"' target='_blank'><img src='../image/pay.png'></a>"
		end if
		if rs("O_state")=1 then
		O_state="未发货"
		O_pay="已付款"
		end if
		if rs("O_state")=2 then
		O_state="已发货(<a href='member_wuliu.asp?O_id="&rs("O_id")&"'>查物流</a>)"
		O_pay="<a href='OK.asp?O_id="&rs("O_id")&"'>确认/退款</a>"
		end if
		if rs("O_state")=3 then
		O_state="已确认"
		O_pay="已确认"
		end if
		if rs("O_state")=4 then
		O_state="已申请退款"
		O_pay="等待卖家处理"
		end if
		if rs("O_state")=5 then
		O_state="已退款"
		O_pay="交易结束"
		end if
		
		response.Write "<tr onmouseout='this.style.backgroundColor=""""' onmouseover='this.style.backgroundColor=""#F7F7F7""'><td>"&left(rs("B_title"),24)&"...</td><td><a href='../"&rs("B_pic")&"' target='_blank'><img src='../"&rs("B_pic")&"' height='30'></a></td><td>"&rs("O_price")&"</td><td>"&rs("O_num")&"</td><td><font color='red'><b>"&rs("O_num")*rs("O_price")&"</b></font></td><td>"&O_state&"</td><td>"&O_pay&"</td><td><a href='member_order.asp?action=del&O_id="&rs("O_id")&"'><img src='img/icondel.gif'>删除</a></td></tr>"
		rs.movenext
		loop
end if
rs.close
set rs=nothing
%>
</table>
<hr>
<table width="100%" border="1" bordercolor="#000000" style="border-collapse:collapse;">
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" ><td>姓名</td><td><%=M_name%></td><td><a href="member_edit.asp"><img src="img/iconedit.gif">修改</a></td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" ><td>收货地址</td><td><%=M_add%></td><td><a href="member_edit.asp"><img src="img/iconedit.gif">修改</a></td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" ><td>手机号</td><td><%=M_mobile%></td><td><a href="member_edit.asp"><img src="img/iconedit.gif">修改</a></td></tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F7F7F7'" ><td>邮政编码</td><td><%=M_code%></td><td><a href="member_edit.asp"><img src="img/iconedit.gif">修改</a></td></tr>
</table>
</div>
</body>
</html>