<%@ Page language="c#" Codebehind="Order.aspx.cs" AutoEventWireup="true" Inherits="XpShop.WebUI.Order" %>
<%@ Register TagPrefix="uc1" TagName="Footer" Src="Modules/Footer.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Helper" Src="Modules/Helper.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/Header.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
	<HEAD>
		<!--#include file="../../inc/encoding.inc"-->
		<title>订单确认</title> 
		<!--#include file="../../inc/head.inc"-->
		<script language="javascript" src="<%=webSite %>inc/calendar.js"></script>
		<script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/Order.js" type="text/javascript"></script>
		<script type="text/javascript">
		    //以下变量在checkout.js中用到
			var memberAdvance = <%=member.AdvancePayment %>;
			var cartID = '<%=CartID%>';
			var couponsCode = '<%=couponsCode%>';
			var shopFolder = '<%=ShopFolder %>';
			var extend = '<%=config.html %>';
			var shipFreeType = <%=shipfree.FreeType %>;//免运费方式
			var leastMoney = <%=shipfree.LeastMoney %>;//FreeType为1时用到此变量
			var taxRateGeneral = <%=config.TaxRate.Split('|')[0] %>;//普通发票
			var taxRateVAT = <%=config.TaxRate.Split('|')[1] %>;//增值税发票
			var currencySign = '<%=GetCurrencySign() %>';
			var scoreRate = <%=scoreRate %>;
			var usdScore = <%=usedScore %>;
		</script>
	</HEAD>
	<body>
	    <uc1:Header id="Header1" runat="server"></uc1:Header>
	    <form id="Form1" method="post" runat="server">
		    <div class="xp-w clear">
			    <div class="cart_step clear">
	                <ul>
	                    <li class="outoc">
	                        1.我的购物车
	                    </li>
	                    <li class="ono">
	                        2.填写核对订单信息
	                    </li>
	                    <li class="outcs">
	                        3.成功提交订单
	                    </li>
	                </ul>
	            </div>
    			<div style="color:#ff6501; font-weight:bold; font-size:16px; margin:10px 0px;">核对订单并确认</div>
			    <div class="cartframe clear">
		            <div class="tl"></div>
			        <div class="tr"></div>
			        <div class="tm"><div class="frmtitle">请确认以下信息，然后提交订单</div></div>
			        <div class="ml"></div>
			        <div class="mr"></div>
			        <div class="mm">
			            <div class="orderfrm">
			                <div class="itemtitle">我的收货地址</div>
			                <div class="frmborder">
    			                
                                <table width="100%" border="0" cellpadding="0" cellspacing="0" class="liststyle data" style="margin-bottom:5px;">
                                    <colgroup class="Colspan-4 ColColorGray"></colgroup>
                                    <colgroup class="Colspan-auto"></colgroup>
                                    <tr>
                                        <th>选择收货地址：</th>
                                        <td>
                                            <%=GetAddress()%>
                                            <input type="radio" id="ship_0" name="shipAddr" value="0" /><label>新增收货地址</label>
                                        </td>
                                    </tr>
                                </table>
                                
			                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="liststyle data" style="margin-bottom:5px;">
                                    <tbody>
                                        <tr>
                                            <th><em>*</em>收货人姓名：</th>
                                            <td><asp:textbox id="txtRName" runat="server" CssClass="inputstyle"></asp:textbox><span class="infotips">请填写有效证件上的真实姓名，以免延误按时收到货物</span></td>
                                        </tr>
                                        <tr>
                                            <th>手机/电话：</th>
                                            <td><asp:textbox id="txtRPhone" runat="server" CssClass="inputstyle"></asp:textbox></td>
                                        </tr>
                                        <tr style="display:none;">
                                            <th>联系手机：</th>
                                            <td><asp:textbox id="txtRMobile" runat="server" CssClass="inputstyle"></asp:textbox></td>
                                        </tr>
                                        <tr>
                                            <th><em>*</em>地区：</th>
                                            <td>
                                                <select id="ddlTopAreas" name="ddlTopAreas"><%=GetSubArea(0)%></select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th><em>*</em>地址：</th>
                                            <td>
                                            <asp:textbox id="txtRAddress" runat="server" Columns="50" CssClass="inputstyle"></asp:textbox>
                                            <span class="infotips">格式：街道-小区-门牌号数-楼层-房间</span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th><em>*</em>邮编：</th>
                                            <td><asp:textbox id="txtRPostalcode" runat="server" CssClass="inputstyle"></asp:textbox></td>
                                        </tr>
                                        <tr style="display:none;">
                                            <th>电子邮箱：</th>
                                            <td><asp:textbox id="txtREmail" runat="server" CssClass="inputstyle"></asp:textbox></td>
                                        </tr>
                                        <tr class="recsave" id="saveaddr" style="display:none;">
                                            <th><em>*</em>是否保存：</th>
                                            <td><input id="isSaveAddr" name="isSaveAddr" type="checkbox" value="1" checked="checked" /><span class="infotips">勾选，则保存本次收货地址</span></td>
                                        </tr>
                                    </tbody>
                                </table>
                                
                                
                                
			                </div>
			            </div>
			            <!--支付方式开始-->
			            <div class="orderfrm">
			                <div class="itemtitle"><%=GetResourceString("PaymentInfo")%></div>
			                <div class="frmborder">
                                
                                <table width="100%" border="0" cellpadding="0" cellspacing="0" class="liststyle data">
                                    <colgroup class="span-4 ColColorGray"></colgroup>
                                    <colgroup class="span-auto"></colgroup>
                                    <tbody>
                                        <asp:Repeater ID="rptpayment" runat="server">
                                            <ItemTemplate>
                                                <tr class='paytype_<%#DataBinder.Eval(Container.DataItem, "PayTypeID")%>' style='<%#((int)DataBinder.Eval(Container.DataItem, "PayTypeID") == 5 || (int)DataBinder.Eval(Container.DataItem, "PayTypeID")==6) ? "display:none" : ""%>'>
                                                    <th><input type="radio" id='rbPayType_<%# Container.ItemIndex %>' name="rbPayType" value='<%#DataBinder.Eval(Container.DataItem, "PayTypeID")%>' /><label for="rbPayType_<%# Container.ItemIndex %>"><%#DataBinder.Eval(Container.DataItem, "PayTypeName")%></label></th>
                                                    <td><%#DataBinder.Eval(Container.DataItem, "Remark")%>&nbsp;</td>
                                                </tr>
                                            </ItemTemplate>
                                        </asp:Repeater>
                                    </tbody>
                                </table>
                                
                                <table width="100%" border="0" cellpadding="0" cellspacing="0" class="liststyle data" style="margin:5px 0px; display:none;" id="ztdContainer">
                                    <tbody>
                                        <tr>
                                            <td colspan="2">选择自提点</td>
                                        </tr>
                                        <tr id="tmp_ztd" style="display:none;">
                                            <th class="ztdname">自提点名称</th>
                                            <td class="ztddetail"><div class="ztdAddr">地址</div><div class="ztdRemark">描述</div></td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
			            </div>
			            <!--支付方式结束-->
    			        
    			        
			            <!--配送方式开始-->
			            <div class="orderfrm shipContainer"><%--shipContainer不能少--%>
			                <div class="itemtitle"><%=GetResourceString("ShippingWay")%></div>
			                <div class="frmborder">
			                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="liststyle data" style="margin:5px 0px;" id="shipContainer">
                                    <colgroup class="span-4 ColColorGray"></colgroup>
                                    <colgroup class="span-auto"></colgroup>
                                    <tbody>
                                        <tr id="tmp_ship" style="display:none;">
                                            <th><span class="shipname">配送方式名称</span>(<%=GetCurrencySign()%><span class="shipprice"></span>)</th>
                                            <td><span class="shipdetail"></span></td>
                                        </tr>
                                    </tbody>
                                </table>
			                </div>
			            </div>
			            <!--配送方式结束-->
			            <div class="orderfrm">
			                <div class="itemtitle"><%=GetResourceString("DeliverGoodsDate")%></div>
			                <div class="frmborder">
			                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="liststyle data">
                                    <colgroup class="span-4 ColColorGray"></colgroup>
                                    <colgroup class="span-auto"></colgroup>
                                    <tbody>
                                        <tr>
                                            <th>送货日期：</th>
                                            <td>
                                                <select class="inputstyle" id="ddlDate" name="ddlDate"><option selected="selected" value="0">任意日期</option><option value="1">仅工作日</option><option value="2">仅休息日</option><option value="3">指定日期</option></select>
                                                <div id="specal_day" style="display:none;">
                                                <asp:textbox id="txt_Date" runat="server" ForeColor="ControlDark"></asp:textbox><a id="picktime" onmouseover="window.status='Date Picker';return true;" onmouseout="window.status='';return true;" onclick="javascript:show_calendar('Form1.txt_Date');" href="javascript:show_calendar('Form1.txt_Date');" border="0"><IMG src="images/imgbtn_Date.jpg" align="absMiddle" border="0"></a>
                                                <span class="infotips">此默认日期及之后的时间可作为有效的送货时间</span>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>时间：</th>
                                            <td>
                                                <select class="inputstyle" id="ddlShippTime" name="ddlShippTime"><option>任意时间段</option><option>上午</option><option>下午</option><option>晚上</option></select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>订单附言：</th>
                                            <td><asp:textbox id="txtRemark" runat="server" Width="400" Height="40px" TextMode="MultiLine"></asp:textbox></td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
			            </div>
    			        
			            <!--发票开始-->
			            <div class="orderfrm">
			                <div class="itemtitle"><asp:CheckBox ID="chkInvoice" runat="server" Text="开具发票" /></div>
			                <div class="frmborder" id="invoice" style="display:none;">
			                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="liststyle data" style="margin:5px 0px;">
                                    <colgroup class="span-4 ColColorGray"></colgroup>
                                    <colgroup class="span-auto"></colgroup>
                                    <tbody>
                                        <tr>
                                            <th height="25px">发票类型：</th>
                                            <td>
                                                <asp:RadioButton ID="rbtnInvoiceTypeGeneral" GroupName="InvoiceType" runat="server" Text="普通发票" Checked="true"></asp:RadioButton>
                                                <asp:RadioButton ID="rbtnInvoiceTypeVAT" GroupName="InvoiceType" runat="server" Text="增值税发票"></asp:RadioButton>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th height="25px">发票抬头：</th>
                                            <td>
                                                <asp:RadioButton ID="rbtnInvoiceHeadPerson" GroupName="InvoiceHead" runat="server" Text="个人" Checked="true"></asp:RadioButton>
                                                <asp:RadioButton ID="rbtnInvoiceHeadCompany" GroupName="InvoiceHead" runat="server" Text="单位"></asp:RadioButton>
                                                <asp:TextBox ID="txtCompanyName" runat="server" Columns="45" style="display:none;"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>发票内容：</th>
                                            <td>
                                                <asp:RadioButton ID="rbtnInvoiceContentDetails" GroupName="InvoiceContent" runat="server" Text="明细" Checked="true"></asp:RadioButton>
                                                <asp:RadioButton ID="rbtnInvoiceContentOther" GroupName="InvoiceContent" runat="server" Text="其它"></asp:RadioButton><br />
                                                <asp:TextBox ID="txtInvoiceContent" TextMode="MultiLine" runat="server" Height="60px" Columns="50" style="padding:5px;display:none;"></asp:TextBox>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
			                </div>
			            </div>
			            <!--发票结束-->
                        
                        <!--优惠券开始-->
                        <div class="orderfrm">
			                <div class="itemtitle"><%=GetResourceString("MemberCoupon")%></div>
			                <div class="frmborder">
			                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="liststyle data" style="margin:5px 0px;">
                                    <colgroup class="span-4 ColColorGray"></colgroup>
                                    <colgroup class="span-auto"></colgroup>
                                    <tbody>
                                        <tr>
                                            <%--<th>选择或输入优惠券</th>--%>
                                            <td width="55%">
                                        	    <div id="selectCoupons">
                                            	    <span style="font-size:15px; font-weight:bold; margin:10px;">>> 使用电子优惠券</span><Br />
                                            	    <asp:RadioButtonList ID="rblCoupons" Runat="server" RepeatDirection="Vertical" RepeatLayout="flow"></asp:RadioButtonList>
                                                </div>
                                            </td>
                                            <td>
                                                <%--输入优惠券--%>
                                                <div style="background-color:#E4F0FF; border:solid 1px #b5b5b5; height:80px;" id="coupons"><br />
                                                    <span style="font-size:15px; font-weight:bold; margin:10px;">>> 使用实体优惠券</span>
                                                    <div style="margin:10px; background-color:white; height:30px;border:solid 1px #b5b5b5; line-height:30px;">
                                                        <br style="line-height:3px;" />
                                                        <input type="text" id="txtCoupons" name="txtCoupons" size="30" />&nbsp;
                                                        <input type="button" id="btnCoupons" name="btnCoupons" value="输入优惠券号码" />
                                                        <span id="spanCoupons" style="display:none;">使用的优惠券：<span id="usedCoupons"></span>&nbsp;&nbsp;&nbsp;&nbsp;<span id="cancelCoupons" style="cursor:pointer;"><u>取消优惠券</u></span></span>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
			                </div>
			            </div>
                        <!--优惠券结束-->
    			        
    			        <div class="orderfrm" style="display:none;" id="frmAdvance">
    			            <div class="itemtitle">预付款</div>
    			            <div class="frmborder">
    			                <input type="checkbox" id="cbAdvPay" name="cbAdvPay" value="1" /><label>使用预付款</label>　预付款余额:<label id="advMoney"><%=string.Format("{0:f2}", member.AdvancePayment) %></label>
    			            </div>
    			        </div>
    			        
			            <!--商品信息开始-->
			            <div class="orderfrm">
			                <div class="itemtitle">购买的商品</div>
			                <div class="frmborder">
					                <div>
				                        <table id="cart_product" cellspacing="0" rules="all" bordercolor="#A7CDF1" border="1" style="border-color:#A7CDF1;border-width:1px;border-style:solid;width:100%;border-collapse:collapse; text-align:center;">
							                <tr style="background-color:#EBF4FB; height:25px;">
							                    <td><%=GetResourceString("ProductNo")%></td>
							                    <td><%=GetResourceString("ProductName")%></td>
							                    <td>规格</td>
							                    <td>会员价格</td>
							                    <td><%=GetResourceString("Quantity")%></td>
							                    <td>赠送积分</td>
							                    <td>消费积分</td>
							                </tr>
							                <tr id="tmp_cart" style="background-color:#EBF4FB; height:25px; display:none;">
							                    <td class="_productno"></td>
							                    <td class="_productname"></td>
							                    <td class="_productspecs"></td>
							                    <td class="_price RedWeight"></td>
							                    <td class="_num"></td>
							                    <td class="_score"></td>
							                    <td class="_usedscore"></td>
							                </tr>
						                    <asp:Repeater ID="rptShoppingCart" Runat="server">
								                <ItemTemplate>
									                <tr style="background-color:White; height:25px;">
<%--									                    20110108 modify by liwenhai
										                <td><%# DataBinder.Eval(Container.DataItem, "ProductNo") %></td>--%>
										                <td><%# DataBinder.Eval(Container.DataItem, "GoodsNo") %></td>
										                <td style="text-align:left;"><a href='<%=webSite %>products/product-<%# DataBinder.Eval(Container.DataItem, "ProductID") %>.<%=config.html %>' target="_blank"><%# DataBinder.Eval(Container.DataItem, "ProductName") %></a>
											                
						                                <br />
						                                <asp:Repeater ID="rptPrePdts" runat="server" DataSource='<%# BindPrePdts((int)DataBinder.Eval(Container.DataItem,"ProductID")) %>'>
							                            <ItemTemplate>
							                            <span style="color:Red;">[赠品]</span><%# DataBinder.Eval(Container.DataItem,"ProductName") %>  <span style="color:Red;">×<%# DataBinder.Eval(Container.DataItem,"PresentNum") %></span><br />
							                            </ItemTemplate>
							                            </asp:Repeater>
                							            
							                            <asp:Repeater ID="rptPreGifts" runat="server" DataSource='<%# BindPreGifts((int)DataBinder.Eval(Container.DataItem,"ProductID")) %>'>
							                            <ItemTemplate>
							                            <span style="color:Red;">[赠品]</span><%# DataBinder.Eval(Container.DataItem, "GiftName")%>  <span style="color:Red;">×<%# DataBinder.Eval(Container.DataItem,"PresentNum") %></span><br />
							                            </ItemTemplate>
							                            </asp:Repeater>
										                </td>
										                <td style="text-align:left;"><%# DataBinder.Eval(Container.DataItem, "ProductSpecs") %></td>
										                <td class="RedWeight"><%=GetCurrencySign() %><%# DataBinder.Eval(Container.DataItem, "MemberPrice","{0:f2}") %></td>
										                <td><%# DataBinder.Eval(Container.DataItem, "Quantity") %></td>
										                <td><%#DataBinder.Eval(Container.DataItem, "Score")%></td>
										                <td><%#DataBinder.Eval(Container.DataItem, "UsedScore")%></td>
									                </tr>
								                </ItemTemplate>
							                </asp:Repeater>
						                </table>
						                <br />
						                <table cellspacing="0" rules="all" bordercolor="#A7CDF1" border="1" style="border-color:#A7CDF1;border-width:1px;border-style:solid;width:100%;border-collapse:collapse; text-align:center;">
							                <tr style="background-color:#EBF4FB; height:25px;">
							                    <td>礼品名称</td>
							                    <td>积分</td>
							                    <td>兑换数量</td>
							                </tr>
							                <asp:Repeater ID="rptGift" Runat="server">
								                <ItemTemplate>
									                <tr style="background-color:White; height:25px;">
										                <td style="text-align:left;"><a href='<%=webSite %>GiftDetails-<%# DataBinder.Eval(Container.DataItem, "GiftID") %>.<%=config.html %>' target="_blank"><%# DataBinder.Eval(Container.DataItem, "GiftName")%></a></td>
										                <td><%# DataBinder.Eval(Container.DataItem, "Integral") %></td>
										                <td><%# DataBinder.Eval(Container.DataItem, "Quantity") %></td>
									                </tr>
								                </ItemTemplate>
							                </asp:Repeater>
							            </table>    
					                </div>
                                    <div style="text-align:right; background-color:#e4f0ff; border:1px #b5b5b5 solid; color:#000000; font-weight:normal; zoom:1;">
                                        <b><%=GetResourceString("Total")%>: </b><font size="3" color="#ff6600"><span id="total"><%=NewTotal%></span></font>&nbsp;&nbsp;<%--id="total" 在js中用到--%>
                                        <b><%=GetResourceString("Weight")%>: </b><span id="totalWeight"><%=GetTotalWeight()%></span> Kg&nbsp;&nbsp;
                                        <b><%=GetResourceString("Quantity")%>: </b><span id="total_quantity"><%=GetTotalQuantity()%></span>&nbsp;&nbsp;
                                        <% if(config.MarkUnit == 1) {%><b>获得积分: </b><span id="totalScore"><%=GetScore()%></span><% }%>&nbsp;&nbsp;
                                        <% if(config.MarkUnit == 1) {%><b>消费积分: </b><%=usedScore%><% }%>&nbsp;&nbsp;
                                        
                                        <div id="favourable" style="float:right;">
                                            <%=favourable%>
                                        </div>
                                        <div class="clear"></div>
                                    </div>
			                </div>
			            </div>
			            <!--商品信息结束-->  
			            
    			        <!--优惠券开始-->
                        <div class="orderfrm">
			                <div class="itemtitle">结算信息</div>
			                <div class="frmborder">
			                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="liststyle data" style="margin:5px 0px;">
                                    <tbody>
                                        <tr>
                                            <td>
                                                商品总金额：<span id="ptotalPrice">0</span>元&nbsp;
                                                + 配送费用：<span id="shipPrice">0</span>元<span id="freeTip" style="color:#ff0000; display:none;">(免运费)</span>&nbsp;
                                                + 发票税金：<span id="taxPrice">0</span>元&nbsp;
                                                - 使用预付款：<span id="advPrice">0</span>元&nbsp;
                                                - 使用积分抵现金：<span id="ScoreAmount">0</span>元&nbsp;
                                                - 优惠金额：<span id="couponPrice">0</span>元
                                                <br />
                                                应付总金额：<span id="lefttotal" class="RedWeight">0</span>元
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                在购物车中可以使用积分抵消部分订单金额：积分与现金兑换比例为<%=scoreRate%>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
			                </div>
			            </div>
                        <!--优惠券结束-->
			            
			                       
                        <br />
                        <div id='pleaseWaitButtonDiv2_PleaseWaitButton1'></div>
		                <div id='pleaseWaitButtonDiv_PleaseWaitButton1' style="text-align:center; display:none;"><asp:button id="btnSave" OnClick="btnSave_Click" Runat="server" Text=" " CssClass="btnSave"></asp:button></div>
                        
			            <div class="clear"></div>
			        </div>
			        <div class="bl"></div>
			        <div class="br"></div>
			        <div class="bm"></div>
		        </div>
    			
				    <!--内容结束-->
				    <div style="clear:both;"></div>
			    </div>
		</form>
		<uc1:Helper id="Helper1" runat="server"></uc1:Helper>
		<uc1:Footer id="Footer1" runat="server"></uc1:Footer>
	</body>
</HTML>
