<!--#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>
<%
O_id=trim(Request("O_id"))
action=trim(Request("action"))
if action="ok" then
sql="select * from SL_orders,SL_product where O_pid=P_id and O_id="&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_num=rs("O_num")
		O_shuxing=rs("O_shuxing")
		O_price=rs("O_price")
		end if
		rs.close
		set rs=nothing
call sendmail("您的网站有订单已确认","<h2>您的网站“"&C_webtitle&"”有订单已确认</h2><hr>商品名称："&P_title&"<br>数量："&O_num&"<br>属性："&O_shuxing&"<br>价格："&formatnumber(O_num*O_price,2,-1)&"元<hr>请进入“网站后台” - “商城管理” - “订单管理”查看详情！",C_email)
conn.execute("update SL_orders set O_state=3 where O_id="&O_id)
call box("感谢您的购物，祝下次购物愉快！","member_order.asp","success")
end if
if action="tui" then
conn.execute("update SL_orders set O_state=4 where O_id="&O_id)
sql="select * from SL_orders,SL_product where O_pid=P_id and O_id="&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_num=rs("O_num")
		O_shuxing=rs("O_shuxing")
		O_price=rs("O_price")
		end if
		rs.close
		set rs=nothing
call sendmail("您的网站有退款待处理","<h2>您的网站“"&C_webtitle&"”有退款待处理</h2><hr>商品名称："&P_title&"<br>数量："&O_num&"<br>属性："&O_shuxing&"<br>价格："&formatnumber(O_num*O_price,2,-1)&"元<hr>请进入“网站后台” - “商城管理” - “订单管理”查看详情！",C_email)
call box("申请成功!等待卖家处理！","member_order.asp","success")
end if
%>

<!--#include file="top.asp" -->
<ul class="my_list">
	<li class="tiao" ><b>我的订单</b></li>
<%
sql="select * from SL_orders,SL_product where O_pid=P_id and O_id="&O_id
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")=2 then

		O_pay="<a href='member_order.asp?O_id="&O_id&"'>"&left(rs("P_title"),20)&"</a>"
		end if
		
		
		response.Write "<li class='tiao'>"&O_pay&"</li>"
		rs.movenext
		loop
end if
rs.close
set rs=nothing
%>
<li class="hr"></li>

<li class="tiao"><a href="OK.asp?action=ok&O_id=<%=O_id%>">确认收货（确认商品完好无误后，完成交易）</a></li>
<li class="tiao"><a href="OK.asp?action=tui&O_id=<%=O_id%>">申请退款（对商品不满意，申请退款）</a></li>

</ul>

</div>

</body>
</html>
