<!--#include file="../conn/conn2.asp" -->
<!--#include file="../conn/function.asp" -->
<!--#include file="member_check.asp" -->

<!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="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员中心</title>
<style type="text/css">

			html {
				overflow:auto;
			}
			body {
			margin:0px;
				
				font-size:12px;
				line-height:180%;
				font-family:"微软雅黑";
				background:url(images/login_bgx.gif);
				
			}
			a img {
	border:none;
}
			a{ font-size:12px; color:#000000; text-decoration:none;}
			a:hover {color:#0066ff;text-decoration: underline}
			.input {border-top:1px solid #ABADB3;border-left:1px solid #ABADB3;border-right:1px solid #ddd;border-bottom:1px solid #ddd;height:24px;width:300px;padding:0 5px;}
.container{width:1100px; height:600px; position:absolute; top:50%; left:50%; margin-left:-550px; margin-top:-300px; background:#FFFFFF;box-shadow:0px 0px 20px #999999;}
table{ border-collapse:collapse;}
table tr td{ border-bottom:1px solid #dedede; line-height:150%; padding:10px;}
</style>
</head>
<body>
<%
action=request.QueryString("action")
O_id=request.QueryString("O_id")

if action="del" then
conn.Execute ("delete from SL_orders where O_id="&O_id)
call box("删除成功!","member_order.asp","success")
end if
%>
<div class="container">
<!--#include file="left.asp" -->
<div style="position: relative; padding:20px 20px 20px 220px;">
<div style="height:580px;overflow:auto">
<h2>我的订单</h2>
<hr>
<table width="100%" bgcolor="#eeeeee">
<tr bgcolor="#F7F7F7"><td>商品名称</td><td>图片</td><td>单价</td><td>数量</td><td>总价</td><td>状态</td><td>操作</td><td>删除</td></tr>
<%
sql="select * from SL_orders,SL_product where O_pid=P_id and O_member="&M_id&" 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='member_pay.asp?O_id="&rs("O_id")&"'><img src='"&C_dir&"images/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""' bgcolor='#ffffff'><td>"&left(rs("P_title"),24)&"...</td><td><a href='"&C_dir&"index.asp?type=productinfo&S_id="&rs("P_id")&"' target='_blank'><img src='"&C_dir&rs("P_path")&"' height='30'></a></td><td>"&FormatNumber(rs("O_price"),2,-1)&"元</td><td>"&rs("O_num")&"</td><td><font color='red'><b>"&FormatNumber(rs("O_num")*rs("O_price"),2,-1)&"元</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'>删除</td></a></tr>"
		rs.movenext
		loop
end if
rs.close
set rs=nothing
%>
</table>
<h2>收货信息</h2>
<hr>
<table width="100%" bgcolor="#eeeeee">
<tr onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F7F7F7'" bgcolor='#ffffff' ><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'" bgcolor='#ffffff' ><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'" bgcolor='#ffffff' ><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'" bgcolor='#ffffff' ><td>邮政编码</td><td><%=M_code%></td><td><a href="member_edit.asp"><img src="img/iconedit.gif">修改</a></td></tr>
</table>
</div>
</div>
</div>
</body>
</html>