<!--#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="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="qinuoli">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="css/user.css" type="text/css" />
<title>个人中心</title>
</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
%>


<!--#include file="top.asp" -->
<%
if request.QueryString("O_id")<>"" then
sql="select * from SL_orders,SL_product where O_pid=P_id and O_id="&request.QueryString("O_id")
set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		P_title=rs("P_title")
		O_price=rs("O_price")
		O_num=rs("O_num")
		P_path=rs("P_path")
		O_state=rs("O_state")
		if rs("O_shuxing")="" then
O_shuxing="标配"
else
O_shuxing=rs("O_shuxing")
end if
		end if
		rs.close
		set rs=nothing
%>
<img src="../<%=P_path%>" width="100%">
<ul class="my_list">
<li class="tiao" ><b>[商品名称]</b> <%=P_title%></li>
<li class="tiao" ><b>[商品属性]</b> <%=O_shuxing%></li>
<li class="tiao" ><b>[商品价格]</b> <%=formatnumber(O_price,2,-1)%>元</li>
<li class="tiao" ><b>[商品数量]</b> <%=O_num%></li>
<li class="tiao" ><b>[商品总价]</b> <%=formatnumber(O_price*O_num,2,-1)%>元</li>
</ul>
<%
select case O_state
case 0
%>
<button type="button" class="button blue" onclick="document.location.href='member_pay.asp?O_id=<%=request.QueryString("O_id")%>'">去付款</button>
<%
case 1
%>
<ul class="my_list"><li class="hr" ></li><li class="tiao" >等待卖家发货</li></ul>
<%
case 2
%>
<table width="100%"><tr>
<td width="50%" style="padding:5px;"><button type="button" class="button blue" onclick="document.location.href='member_wuliu.asp?O_id=<%=request.QueryString("O_id")%>'">查物流</button></td>
<td width="50%" style="padding:5px;"><button type="button" class="button blue" onclick="document.location.href='OK.asp?O_id=<%=request.QueryString("O_id")%>'">确认/退款</button></td>
</tr>
</table>
<%
case 3
%>
<ul class="my_list"><li class="hr" ></li><li class="tiao" >订单已确认</li></ul>
<%
case 4
%>
<ul class="my_list"><li class="hr" ></li><li class="tiao" >等待卖家处理</li></ul>
<%
case 5
%>
<ul class="my_list"><li class="hr" ></li><li class="tiao" >交易已结束</li></ul>
<%
case else
end select
else
%>
<ul class="my_list">
<li class="tiao" ><b>我的订单</b></li>
<%
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_pay="【未付款】"
		end if
		if rs("O_state")=1 then

		O_pay="【等待发货】"
		end if
		if rs("O_state")=2 then

		O_pay="【确认/退款】"
		end if
		if rs("O_state")=3 then

		O_pay="【已确认】"
		end if
		if rs("O_state")=4 then

		O_pay="【等待卖家处理】"
		end if
		if rs("O_state")=5 then

		O_pay="【交易结束】"
		end if
		
		response.Write "<li class='tiao'><a href='member_order.asp?O_id="&rs("O_id")&"'><img src='../"&rs("P_thumb")&"' style='height:40px;width:40px;padding-top:2px;'> "&rs("P_title")&"<span style='float:right;'>"&O_pay&"</span></a></li>"
		rs.movenext
		loop
end if
rs.close
set rs=nothing
%>
<li class="hr"></li>

<li class="tiao" ><b>收货信息</b></li>
<li class="tiao" ><a href="member_edit.asp">[收货姓名] <%=M_name%></a></li>
<li class="tiao" ><a href="member_edit.asp">[收货地址] <%=M_add%></a></li>
<li class="tiao" ><a href="member_edit.asp">[手机号码] <%=M_mobile%></a></li>
<li class="tiao" ><a href="member_edit.asp">[邮政编码] <%=M_code%></a></li>
</ul>
<%end if%>

</div>

</body>
</html>
