<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DispartOrder.aspx.cs" Inherits="XpShop.WebUI.DispartOrder" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/CartHeader.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Footer" Src="Modules/Footer.ascx" %> 
<!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>
	<!--#include file="../../inc/encoding.inc"-->
    <title>分单</title>
	<!--#include file="../../inc/head.inc"-->
	<script type="text/javascript" src="/<%=ShopFolder %>Template/<%=config.TemplateFolder%>/inc/DispartOrder.js"></script>
	<link href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/mycart.css" rel="stylesheet" />
	<script type="text/javascript">
        $(document).ready(function(){
                $('#dgShoppingCart').attr('rules','none')
        });
    </script> 
</head>
<body>
    <uc1:Header id="Header1" runat="server"></uc1:Header>
    <form id="form1" runat="server">
        <div class="xp-w clear">
		    <div class="cart_step clear">
		        <div style="float:left; margin-right:20px;"><%=config.SiteLogo %></div>
	            <ul>
	                <li class="outoc">
	                    1.我的购物车
	                </li>
	                <li class="ono">
                        2.选择订单
                    </li>
	                <li class="outco">
	                    3.确认订单信息
	                </li>
	                <li class="outcs">
	                    4.成功提交订单
	                </li>
	            </ul>
	        </div>
		    <div id="dgShoppingCart">
			<%for(int q=0;q<dtSupplier.Rows.Count;q++){%>	
                <div class="choose_store">
                    <input type="radio" itemindex="<%=q+1%>" shopname="<%=dtSupplier.Rows[q]["SupplierName"]%>" shoptype="0"  value="<%=dtSupplier.Rows[q]["SupplierID"]%>" name="radOrderSelect">订单<%=q+1%>：<%=dtSupplier.Rows[q]["SupplierName"]%>
                </div>
                <%--商家购物车开始--%>					
				<div class="store_cart">
				<table class="cart_product" cellspacing="0">
                <tbody>
                    <tr class="title">
                        <td width="10%">商品编号</td>
                        <td>商品名称</td>
                        <td width="10%">价格</td>
                        <td width="10%">优惠</td>
                        <td width="10%">赠送积分</td>
                        <td width="10%">购买数量</td>
                    </tr>
                </tbody>
                <%--套装商品开始--%>
                <%System.Data.DataRow[] drSuit = dtSuit.Select("supplierid=" + dtSupplier.Rows[q]["SupplierID"].ToString());%>
                <%for (int i = 0; i < drSuit.Length; i++){%>
                <tbody id="suitd_<%=drSuit[i]["SuitID"] %>">
                    <tr class="item">
			            <td>-</td>
			            <td class="pname"><img id="suitimg_<%=drSuit[i]["SuitID"] %>" class="showsuit hand" src="images/open.gif" /><font color="red">[套装]</font><%=drSuit[i]["SuitName"]%><a id="suita_<%=drSuit[i]["SuitID"] %>" class="showsuit" href="javascript:void(0);">[查看套装商品]</a></td>
			            <td class="RedWeight">￥<%=string.Format("{0:f2}", drSuit[i]["MemberPrice"])%></td>
			            <td>￥<%=string.Format("{0:f2}", drSuit[i]["LessMoney"])%></td>
			            <td><%=drSuit[i]["Score"]%></td>
			            <td><%=drSuit[i]["Quantity"]%></td>
		            </tr>
                </tbody>
                <tbody id="suit_<%=drSuit[i]["SuitID"] %>" class="hide">
                    <%--遍历套装商品明细开始--%>
                    <%System.Data.DataRow[] drSuitPdt = dtPdt.Select("suitid=" + drSuit[i]["SuitID"].ToString());%>
                    <%for (int j = 0; j < drSuitPdt.Length; j++){%>
                    <tr class="item">
			            <td><%=drSuitPdt[j]["ProductNo"]%></td>
			            <td class="pname"><div class="pimg"><a href='<%=webSite %>products/product-<%=drSuitPdt[j]["ProductID"]%>.<%=config.html%>' target="_blank"><img src="<%=webSite %>upload/productimg/<%=drSuitPdt[j]["ImgFolder"]%><%=drSuitPdt[j]["ProductImg"]%>" /></a></div><a href='<%=webSite %>products/product-<%=drSuitPdt[j]["ProductID"]%>.<%=config.html %>' target="_blank"><%=drSuitPdt[j]["ProductName"]%><span style="color:Red;"><%=drSuitPdt[j]["RuleName"].ToString() != "" ? ("(" + drSuitPdt[j]["RuleName"] + ")") : ""%></span><span style="color:Red;"><%=drSuitPdt[j]["remark"]%></span></a></td>
			            <td class="RedWeight">￥<%=string.Format("{0:f2}", drSuitPdt[j]["pmtprice"])%></td>
			            <td>￥<%=string.Format("{0:f2}", drSuitPdt[j]["LessMoney"])%></td>
			            <td>-</td>
			            <td><%=(int)drSuitPdt[j]["Quantity"]/(int)drSuit[i]["Quantity"]%>×<%=drSuit[i]["Quantity"]%></td>
		            </tr>
                    <%} %>
                    <%--遍历套装商品明细结束--%>
                </tbody>
                <%} %>
                <%--套装商品结束--%>
                <%--普通商品开始--%>
                <%System.Data.DataRow[] drPdt = dtPdt.Select("supplierid=" + dtSupplier.Rows[q]["SupplierID"].ToString()+"and suitid=0");%>
                <%if (drPdt.Length > 0){ %>
                <tbody>
                <%for (int i = 0; i < drPdt.Length; i++){%>
                    <tr class="item">
			            <td><%=drPdt[i]["ProductNo"]%></td>
			            <td class="pname">
			                <div class="pimg"><a href='<%=webSite %>products/product-<%=drPdt[i]["ProductID"]%>.<%=config.html%>' target="_blank"><img src="<%=webSite %>upload/productimg/<%=drPdt[i]["ImgFolder"]%><%=drPdt[i]["ProductImg"]%>" /></a></div>
			                <a href='<%=webSite %>products/product-<%=drPdt[i]["ProductID"]%>.<%=config.html %>' target="_blank"><%=drPdt[i]["ProductName"]%><span style="color:Red;"><%=drPdt[i]["RuleName"].ToString() != "" ? ("(" + drPdt[i]["RuleName"] + ")") : ""%></span><span style="color:Red;"><%=drPdt[i]["remark"]%></span></a>
			                <%System.Data.DataRow[] drCoupon = dtSendCoupon.Select("supplierid=" + dtSupplier.Rows[q]["SupplierID"].ToString()+" and productid="+drPdt[i]["ProductID"].ToString());%>
                            <%for (int j = 0; j < drCoupon.Length; j++){%>
                            <div><font color="red">[赠品]</font><%=drCoupon[j]["CouponName"]%><font color="red">× <%=drCoupon[j]["Number"]%>(订单完成后自动发放)</font></div>
                            <%} %>
			            </td>
			            <td class="RedWeight">￥<%=string.Format("{0:f2}", drPdt[i]["pmtprice"])%></td>
			            <td>￥<%=string.Format("{0:f2}", drPdt[i]["LessMoney"])%></td>
			            <td><%=drPdt[i]["Score"]%></td>
			            <td>
			                <%=drPdt[i]["Quantity"]%>
                        </td>
		            </tr>
                <%} %>
                </tbody>
                <%} %>
                <%--普通商品结束--%>
                <%--礼品开始--%>
                <%System.Data.DataRow[] drGift = dtGift.Select("supplierid=" + dtSupplier.Rows[q]["SupplierID"].ToString());%>
                <%if (drGift.Length > 0){%>
                <tbody>
		        <%for (int i = 0; i < drGift.Length; i++){%>
		        <tr class="item">
			        <td><%=drGift[i]["ProductNo"]%></td>
			        <td style="text-align:left;"><a href='<%=webSite %>products/product-<%=drGift[i]["ProductID"]%>.<%=config.html %>' target="_blank"><%=drGift[i]["ProductName"]%><span style="color:Red;"><%=drGift[i]["RuleName"].ToString() != "" ? ("(" + drGift[i]["RuleName"] + ")") : ""%></span><span style="color:Red;"><%=drGift[i]["giftremark"]%></span></a></td>
			        <td class="RedWeight">￥<%=string.Format("{0:f2}", drGift[i]["pmtprice"])%></td>
			        <td>￥<%=string.Format("{0:f2}", drGift[i]["LessMoney"])%></td>
			        <td>0</td>
			        <td><%=drGift[i]["giftnumber"]%></td>
		        </tr>
		        <%}%>
		        </tbody>
		        <%}%>
		        <%--礼品结束--%>
                </table>
                </div>
                <%--商家购物车结束--%>
                <%--商家商品金额总计开始--%>
                <div class="price_charge">
                    <p class="change_total">您需支付：<span><%=string.Format("{0:f2}",dtSupplier.Rows[q]["totalmoney"])%></span></p>
                </div>
                <%--商家商品金额总计结束--%>
			<%}%>
			</div>
			<div class="total-xq clear">
				<div style="text-align:right;margin:10px;">
					重量总计：<span id="totalweight"><%=string.Format("{0:f2}",totalweight)%></span>
					商品数量：<span id="total_quantity"><%=totalnumber%></span>&nbsp;&nbsp;
					<% if(config.MarkUnit == 1) {%>
					赠送积分：<span id="totalScore"><%=totalscore%></span>&nbsp;&nbsp;
					<% }%>
					原始金额：<span id="oldtotalprice">￥<%=string.Format("{0:f}",totalmoney+promotionprice) %></span>&nbsp;&nbsp;
					优惠：<span id="promotionprice">￥<%=string.Format("{0:f}",promotionprice) %></span>元
					<br/>
					商品总金额(不含运费)：<em style="font-size:24px;">￥<span id="totalprice"><%=string.Format("{0:f}",totalmoney) %></span></em>
				</div>
			</div>
			<div class="ordernext clear" style="margin-top:30px;">
				<a href="mycart.<%=config.html%>" style="float:left; color:#1a63b0;">返回购物车>></a>
				<a href="#" class="next" style="float:right; margin-left:20px;"><img src='<%=webSite %>Template/<%=config.TemplateFolder %>/Images/dispartordernext.jpg' border="0"></a>
				<span style="float:right; line-height:29px;">
					您已经选择“<span id="choosedshop" style="color:#ce3200"></span>”，请点击下一步提交该订单！
				</span>
			</div>		
			<!--内容结束-->
		</div>
    </form>
	<uc1:Footer id="Footer1" runat="server"></uc1:Footer>
</body>
</html>
