<!--#include file="../conn/conn2.asp" -->
<!--#include file="../conn/function.asp" -->
<!--#include file="member_check.asp" -->
<%
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
%>
<!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" />
<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;}
.submit{ width:131px;height:34px; border:hidden; font-family:"微软雅黑";color:#FFFFFF;background-image:url(img/btn.png);cursor:hand;font-size:15px}
.submit2{ width:131px;height:34px; border:hidden; font-family:"微软雅黑";color:#FFFFFF;background-image:url(img/btn2.png);cursor:hand;font-size:15px}
</style>
</head>
<body>
<div class="container">
<!--#include file="left.asp" -->
<div style="position: relative; padding:20px 20px 20px 220px;">
<h2>确认收货/申请退款</h2>
<hr>
<table width="100%" bgcolor="#eeeeee" style="font-size:12px;">
<tr bgcolor="#F7F7F7"><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_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")=0 then
		O_state="未付款"
		O_pay="<a href='"&C_dir&"alipay/alipayapi.asp?O_id="&rs("O_id")&"' target='_blank'><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></tr>"
		rs.movenext
		loop
end if
rs.close
set rs=nothing
%>
</table>

<input name="Submit" type="button" class="submit" onMouseOver="this.className='submit2'" onMouseOut="this.className='submit'" onClick="document.location.href='OK.asp?action=ok&O_id=<%=O_id%>'" value="确认收货" style="float:right; margin:10px" />
<input name="Submit" type="button" class="submit" onMouseOver="this.className='submit2'" onMouseOut="this.className='submit'" onClick="document.location.href='OK.asp?action=tui&O_id=<%=O_id%>'" value="申请退款" style="float:right; margin:10px;" />

<h2>说明</h2><h3>1.确认收货</h3>
请确认商品完好无误后，确认收货，完成交易。<br>
<h3>2.申请退款</h3>
(1)对商品不满意，申请退款。<br>
(2)与客服协商退款事宜。
</div>
</div>
</body>
</html>