<!--#include file="conn.asp"-->
<%
page_title=Eval("order_title"&Language)
page_keywords=Eval("order_keywords"&Language)
page_description=Eval("order_description"&Language)
if page_title="" then
page_title=city_title
page_keywords=city_keywords
page_description=city_description
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-Language" content="zh-CN">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><%=page_title%></title>
<meta name="keywords" content="<%=page_keywords%>" />
<meta name="description" content="<%=page_description%>" />
<!--#include file="top.asp"-->
<!--#include file="header.asp"-->
<%
if session("user_xxx_name")="" then
response.Redirect("login.asp")
end if
%>
<link href="<%=filepath%>inc/mycenter.css" type="text/css" rel="stylesheet">
<link href="<%=filepath%>inc/style.css" type="text/css" rel="stylesheet">
<link href="<%=filepath%>inc/user.css" type="text/css" rel="stylesheet">

    <div id="wrap">
        <!--container-->
        <div class="main">
            
<!--sidebar-->
<!--#include file="Mb_left.asp"-->

<script type="text/javascript">
//<![CDATA[

var cancelOrder = function(orderId) {
	if (orderId && confirm("确定要取消订单吗？")) {
		//app.helper.showLoadingTip();
		var cancelOrderForm = $('<form action="mb_ajax.asp?action=cancelOrder" method="post"></form>');
	    cancelOrderForm.append('<input type="hidden" value="'+orderId+'" name="orderId"/>');
	    cancelOrderForm.appendTo(document.body).submit();
	}
	return;
};

var confirmReciveOrder = function(orderId) {
	if (orderId && confirm("确定收到货了吗？")) {
		//app.helper.showLoadingTip();
		var confirmReciveOrderForm = $('<form action="mb_ajax.asp?action=confirmReciveOrder" method="post"></form>');
	    confirmReciveOrderForm.append('<input type="hidden" value="'+orderId+'" name="orderId"/>');
	    confirmReciveOrderForm.appendTo(document.body).submit();
	}
	return;
};

//]]>
</script>

<!--sidebar end-->
<%
dingdan=request.QueryString("dan")
tid=request.QueryString("tid")

dim dingdan
dingdan=request.QueryString("dingdan")
set rs=server.CreateObject("adodb.recordset")
rs.open "select shopxp_action.shopxpacid,shopxp_action.expressOrder,shopxp_action.expressDate,shopxp_action.pro_color,shopxp_action.pro_size,shopxp_action.promoRuleId,shopxp_action.couponCodeNumber,shopxp_action.pay_class,shopxp_action.feiyong,shopxp_action.provinceId,shopxp_action.cityId,shopxp_action.countyId,shopxp_action.deliveryTimeId,shopxp_action.user_01,shopxp_action.user_03,shopxp_action.user_04,shopxp_action.user_05,shopxp_action.user_06,shopxp_action.useremail,shopxp_action.delivery,shopxp_action.zhuangtai,shopxp_action.shopxp_shfs,shopxp_action.liuyan,shopxp_action.zhifufangshi,shopxp_action.shopxpptid,shopxp_action.actiondate,shopxp_action.productcount,shopxp_action.fapiaoTt,shopxp_action.jifen_dk,shopxp_action.zonger,com_books.id,com_books.cid,com_books.titlecn,com_books.bookpicm,com_books.titlecn,com_books.shichangjia,com_books.shopxphyjia,com_books.jifeng,com_books.shopxpvjia from com_books inner join  shopxp_action on com_books.id=shopxp_action.shopxpptid where shopxp_action.dingdan='"&dingdan&"' ",conn,1,1
if rs.eof and rs.bof then
response.write "<p align=center>此订单中有商品已被管理员删除，无法进行正确计算!<br>订单取消，请通知管理员或重新下订单!</p>"
response.End
end if
%>

            <!--main-->
<div class="mainBox">
			<div class="mainContent">
				<div class="mycontent_10">
					<span>我的订单</span>
				</div>
				<div class="orderstatus">
					<ul <%if rs("shopxp_shfs")=1 then%>style="width:474px;"<%end if%>>
						<li class="itemfirst statdone">提交订单<span class="time"><%=rs("actiondate")%></span></li>
							<%if rs("shopxp_shfs")=1 then%>
							
							<li class="<%if rs("zhuangtai")>=4 then%>statdone<%end if%>">卖家发货<span class="time"></span></li>
							<li class="<%if rs("zhuangtai")>=5 then%>statdone<%end if%>">确认收货<span class="time"></span></li>
							<li class="itemlast <%if rs("zhuangtai")=5 then%>statdone<%end if%>">完成<span class="time"></span></li>
							
							<%else%>
							
							<li class="<%if rs("zhuangtai")>1 then%>statdone<%end if%>">买家付款<span class="time"></span></li>
							<li class="<%if rs("zhuangtai")>=4 then%>statdone<%end if%>">卖家发货<span class="time"></span></li>
							<li class="<%if rs("zhuangtai")>=5 then%>statdone<%end if%>">确认收货<span class="time"></span></li>
							<li class="itemlast <%if rs("zhuangtai")=5 then%>statdone<%end if%>">完成<span class="time"></span></li>
							
							<%end if%>
					</ul>
				</div>
				
				<%if rs("shopxp_shfs")<>1 and rs("zhuangtai")=1 then%>
				<div class="infobox">
					<p>
						<strong>订单当前状态：</strong><span class="red">未付款</span><br>
						从提交订单起24小时内会保留您的订单，24小时后自动取消订单
					</p>
					<div class="btncon">
						<a href="step_three_show.asp?expressId=<%=rs("shopxp_shfs")%>&dingdan=<%=dingdan%>&submitOK=2"  target="_blank"  class="btn-a"><span>立即付款</span></a> <a href="javascript:cancelOrder('<%=dingdan%>')">取消订单</a>
					</div>
				</div>
				<%end if%>
				
				<%if rs("shopxp_shfs")=1 and rs("zhuangtai")=3 then%>
				<div class="infobox">
					<p>
						<strong>订单当前状态：</strong><span class="red">等待商家发货</span><br>
						您可以通过电话或在线客服提醒我们发货！
					</p>
					<div class="btncon"><a href="javascript:cancelOrder('<%=dingdan%>')">取消订单</a></div>
				</div>
				<%end if%>
				
				<%if rs("zhuangtai")=4 then%>
				<div class="infobox">
					<p><strong>订单当前状态：</strong><span class="red">确认收货</span><br>您的商品已经发货，请注意确认收货！</p>
					<div class="btncon"><a href="javascript:confirmReciveOrder('<%=dingdan%>')"  class="btn-a"><span>确认收货</span></a></div>
				</div>
				<%end if%>
				
				
				<div class="orderdetail">
					<div class="div-nav">
						<span>订单与支付</span>
					</div>
					<div class="div-content">
						订单编号：<%=dingdan%><br> 
						支付方式：<%
select case rs("pay_class")
case 1
response.write("支付宝交易")
case 2
response.write("财付通交易")
case 3
response.write("快钱交易")
case else
	if rs("shopxp_shfs")=1 then
	response.write("货到付款")
	else
	response.write("未付款")
	end if
end select
 %>
						 <br>
						订单状态：
<%select case rs("zhuangtai")
case "1"
response.write "等候付款"
case "2"
response.write "确认收款"
case "3"
response.write "等待发货"
case "4"
response.write "已经发货"
case "5"
response.write "已经收货 <font color=red>交易完成</font>"
case "6"
response.write "交易完成"
case "7"
response.write "已经退款"
end select%>
						<br> 
						下单时间：<%=rs("actiondate")%>
					</div>
					<div class="div-nav">
						<span>收货信息</span>
					</div>
					<div class="div-content">
						收 件 人：<%=trim(rs("user_01"))%><br> 
						联系电话：&nbsp;<%=trim(rs("user_05"))%><br> 
						收件地址：<%call showAddName(rs("provinceId"))%>&nbsp;<%call showAddName(rs("cityId"))%>&nbsp;<%call showAddName(rs("countyId"))%> &nbsp;&nbsp;<%=trim(rs("user_03"))%><br>
						邮政编码：<%=trim(rs("user_04"))%><br />
						电子邮箱：<%=trim(rs("useremail"))%>
					</div>
					<div class="div-nav">
						<span>配送信息</span>
					</div>
					<div class="div-content">
						配送公司名称：<%
expressId=rs("shopxp_shfs")
set rszf=server.CreateObject("adodb.recordset")
rszf.open "select * from com_songhuo where id="&expressId&"",conn,1,1
response.write(rszf("subject"))
rszf.close
set rszf=nothing
%><br>
						 快递单号：<%=trim(rs("expressOrder"))%><br> 
						 发货时间：<%=trim(rs("expressDate"))%><br> 
						 送货时间：<%
select case rs("deliveryTimeId")
case "delivery_time_workday"
response.Write("工作日送货（周一到周五）")
case "delivery_time_weekend"
response.Write("周六周天")
case "delivery_time_allday"
response.Write("时间不限") 
end select				
%> <br>
						送货备注：<%=trim(rs("liuyan"))%>
					</div>

					<div class="div-nav">
						<span>我挑选的商品</span>
					</div>
					<div class="gouwu-list">
						<div class="tb-head">
							<table cellspacing="0" cellpadding="0" border="0">
								<tbody>
									<tr>
										<td>商品</td>
										<td width="60">促销价</td>
										<td width="60">数量</td>
										<td width="60">小计</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="tb-body">
							<table cellpadding="0" cellspacing="0" border="0">
								<tbody>
<%
zongji=0
jf=0
kg_zong=0
do while not rs.eof
	bookiid=rs("shopxpptid")
	jianshu=jianshu+rs("productcount")
	zongji=zongji+rs("zonger")
	subtitle=rs("titlecn")
	subid=rs("id")
	subcid=rs("cid")
	subbookpicm=rs("bookpicm")
	jifeng=jifeng+rs("jifeng")
	shichangjia=rs("shichangjia")
	shopxphyjia=rs("shopxphyjia")
	jifen_dk=rs("jifen_dk")
	pro_color=rs("pro_color")
	pro_size=rs("pro_size")
	
%>
									<tr>
										<td class="td-prod">
											<table border="0" cellpadding="0" cellspacing="0">
												<tbody>
													<tr>
														<td class="prod-pic">
															<a href="products_show.asp?typeid=<%=subcid%>&id=<%=subid%>" target="_blank">
																<img src="../<%=rs("bookpicm")%>" width="80" height="80" border="0">
															</a>
														</td>
														<td class="prod-info">
														  <a class="prod-name" href="products_show.asp?typeid=<%=subcid%>&id=<%=subid%>" target="_blank"><%=subtitle%></a>
														   <p class="prod-attr">颜色:<%=pro_color%>，规格:<%=pro_size%></p>
														</td>
													</tr>
												</tbody>
											</table>
										</td>
										<td width="60" class="td-price-real">¥<%=Formatnumber(shopxphyjia,2,-1,-1,0)%></td>
										<td width="60" class="td-calculate"><%=rs("productcount")%></td>
										
										<td width="60">¥<%=formatnumber(rs("zonger"),2)%></td>
									</tr>
<%
jf=jf+rs("jifeng")
'kg_zong=kg_zong+rs("cs4")*rs("productcount")
feiyong=rs("feiyong")
rs.movenext
loop
rs.movefirst

if rs("promoRuleId")<>"coupon_code" then
	setId=replace(rs("promoRuleId"),"act_","")
	set rsp=server.CreateObject("adodb.recordset")
	rsp.open "select * from com_act where id="&setId&"",conn,1,1
	if not rsp.bof or not rsp.eof then
	amount=rsp("amount")
	act_name=rsp("CodeNumber")
	end if
	rsp.close
	set rsp=nothing
showword="("&act_name&")优惠"

elseif rs("promoRuleId")="coupon_code" and rs("couponCodeNumber")<>"" then
	set rsp=server.CreateObject("adodb.recordset")
	rsp.open "select * from com_coupon where CodeNumber='"&rs("couponCodeNumber")&"'",conn,1,1
	if not rsp.bof or not rsp.eof then
	amount=rsp("amount")
	end if
	rsp.close
	set rsp=nothing
showword="优惠券(券号："&rs("couponCodeNumber")&")"
	
else
amount=0
showword="无优惠"
end if

zongji_a=feiyong+zongji-jifen_dk-amount
%>
								</tbody>
							</table>
						</div>
						<div class="tb-foot">
							<div class="footl">
								产品数量总计：<em><%=jianshu%></em>件
							</div>
							<div class="footr">
								产品金额总计：<em>¥<%=formatnumber(zongji,2)%></em>
							</div>
						</div>
					</div>
					<div class="div-content">
						<ul class="settlelist">
							<li>
							<div>
									<label>使用积分：</label>
								    <span>-¥<%=formatnumber(jifen_dk,2)%></span>
								</div>
								
								<div>
									<label><%=showword%>：</label>
								    <span>-¥<%=formatnumber(amount,2)%></span>
								</div>
								
								<div class="clear"></div>
							</li>
							<li><label>运费：</label><span>¥<%=formatnumber(feiyong,2)%></span></li>
							<li class="count"><label>应付总额：</label><span>¥<%=formatnumber(zongji_a,2)%></span></li>
						</ul>
					</div>
				</div>
			</div>
		</div>
            <!--main end-->
        </div>
        <!--container end-->
        <div class="clr">
        </div>
        
<div id="bg" class="bg" style="display: none;"></div>
	<iframe id="popIframe" class="popIframe" frameborder="0"></iframe>
	<div id="loadingTip" class="loadingTip" style="display: none;">
		数据处理中...
	</div> 
  
<!--#include file="foot.asp"--> 