<%@ Page language="c#" Codebehind="ShoppingCart.aspx.cs" AutoEventWireup="false" Inherits="XpShop.WebUI.ShoppingCart" %>
<%@ 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><%=GetResourceString("ShoppingCart")%></title> 
		<!--#include file="../../inc/head.inc"-->
		<script language="javascript" src="inc/overlib.js"></script>
		<script language="javascript" src="inc/Cart.js"></script>
		<script type="text/javascript">
		    var markUnit = '<%=config.MarkUnit %>';
		</script>
	</HEAD>
	<body>
		<div id="container">
		    <uc1:Header id="Header1" runat="server"></uc1:Header>
			<!--内容开始-->
			<div id="CurrentStatus">
		        <div class="tl"><%=GetResourceString("ShoppingCart")%></div>
		        <div class="tr">
		            <ul>
		                <li class="current"><%=GetResourceString("ShoppingCart")%></li>
		                <li id="S_Receiver"><%--收货人信息--%><%=GetResourceString("ReceiverInfo")%></li>
		                <%--<li id="S_Buyer">购买人信息</li>--%>
		                <li id="S_Shipping"><%--配送方式--%><%=GetResourceString("ShippingWay")%></li>
		                <li id="S_Coupon"><%--选择优惠券--%><%=GetResourceString("SelectCoupon")%></li>
		                <li id="S_Payment"><%--支付方式--%><%=GetResourceString("PaymentInfo")%></li>
		                <li id="S_Confirm"><%--确认提交--%><%=GetResourceString("SubmitConfirm")%></li>
		            </ul>
		        </div>
		        <div class="tm"></div>
		    </div>    
			<form id="Form1" method="post" runat="server">
			<div class="checkout">
				<%--<div class="tl"></div>
				<div class="tr"></div>
				<div class="tm">
				    <div class="checkouttitle">
                        <div class="mframetmimg"></div><%=GetResourceString("ShoppingCart")%>
                    </div>
				</div>--%>
				<div class="ml"></div>
				<div class="mr"></div>
				<div class="mm">
					<div>
					    <TABLE cellSpacing="0" cellPadding="0" width="100%" bgcolor="#e0e0e0" style=" color:#ffffff; border-left:1px #b5b5b5 solid; border-right:1px #b5b5b5 solid; border-top:1px #b5b5b5 solid;">
							<TR align="center">
								<TD height="38" width="5%" style="border-right:1px #b5b5b5 solid;">&nbsp;</TD>
								<TD height="38" width="19%" align="center" style="border-right:1px #b5b5b5 solid;"><b><%=GetResourceString("ProductName")%></b></TD>
								<TD height="38" width="10%" align="center" style="border-right:1px #b5b5b5 solid;"><b><%=GetResourceString("Specs")%></b></TD>
								<TD height="38" width="12%" style="border-right:1px #b5b5b5 solid;"><b><%=GetResourceString("MarketPrice")%></b></TD>
								<TD height="38" width="12%" style="border-right:1px #b5b5b5 solid;"><b><%=GetResourceString("MemberPrice")%></b></TD>
								<TD height="38" width="15%" style="border-right:1px #b5b5b5 solid;"><b><%=GetResourceString("Fittings")%></b></TD>
								<TD width="10%"  style="border-right:1px #b5b5b5 solid;"><b><%=GetResourceString("Quantity")%></b></TD>
								<TD height="38" width="14%" style="border-right:1px #b5b5b5 solid;"><b><%=GetResourceString("SumPrice")%></b></TD>
								<TD height="38" width="10%">&nbsp;&nbsp;&nbsp;&nbsp;</TD>
							</TR>
						</TABLE>
						<asp:datalist id="dlShoppingCart" Width="100%" cellSpacing="0" cellPadding="0" style="border-left:1px #b5b5b5 solid; border-right:1px #b5b5b5 solid;" RepeatColumns="1" Runat="server" DataKeyField="RecordID">
							<ItemTemplate>
								<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0" >
									<TR align="center">
										<TD height="38" width="5%" style="border-right:1px #b5b5b5 solid;">
											<a href="#" onmouseover="return overlib('<IMG SRC=<%=config.Path%>Upload/<%# DataBinder.Eval(Container.DataItem, "ThumbnailImg") %> width=200>', CAPTION, '<%# DataBinder.Eval(Container.DataItem, "Name") %>',FGCOLOR, '#fcfcfc', BGCOLOR, '#0080C0', CAPCOLOR, '#ffffff', BORDER, 2, CLOSETEXT, 'Close');" onmouseout="nd();"><IMG SRC="images/icon-viewpic.gif" border="0"></a>
										</TD>
										<TD height="38" width="19%" align="left" style="border-right:1px #b5b5b5 solid;"><a href='Show.aspx?PID=<%# DataBinder.Eval(Container.DataItem, "ProductID") %>' target="_blank"><%# DataBinder.Eval(Container.DataItem, "Name") %></a><br><%# GetItemNames(DataBinder.Eval(Container.DataItem, "Items").ToString()) %></TD>
										<TD height="38" width="10%" align="left" style="border-right:1px #b5b5b5 solid;"><%# bShow(DataBinder.Eval(Container.DataItem, "ProductSpecs"))%>&nbsp;</TD>
										<TD height="38" width="12%" style="border-right:1px #b5b5b5 solid;"><%# DataBinder.Eval(Container.DataItem, "MarketPrice","{0:f2}") %></TD>
										<TD height="38" width="12%" style="border-right:1px #b5b5b5 solid;"><%# DataBinder.Eval(Container.DataItem, "MemberPrice","{0:f2}") %></TD>
										<TD height="38" width="15%" style="border-right:1px #b5b5b5 solid;"><%# GetFieldItemPrice(DataBinder.Eval(Container.DataItem, "Items").ToString()) %></TD>
										<TD width="10%" align="center" style="border-right:1px #b5b5b5 solid;">
											<%--<input name="quantity<%# Container.ItemIndex+1%>" type="text" class="inputstyle" id="Text1" value='<%# DataBinder.Eval(Container.DataItem, "Quantity") %>' size="9" maxlength="10" onkeyup="getTotal(<%# Container.ItemIndex+1%>,<%#DataBinder.Eval(Container.DataItem, "MemberPrice")%>,<%#GetFieldItemPrice(DataBinder.Eval(Container.DataItem, "Items").ToString())%>,<%#DataBinder.Eval(Container.DataItem, "RecordID")%>)"/>--%>
											<input name="quantity" type="text" class="inputstyle" id="quantity<%# Container.ItemIndex+1%>" value='<%# DataBinder.Eval(Container.DataItem, "Quantity") %>' size="9" maxlength="10" />
											<input type="hidden" name="itemIndex" value="<%# Container.ItemIndex+1%>" />    <%--索引--%>
											<input type="hidden" name="memberPrice" value='<%#DataBinder.Eval(Container.DataItem, "MemberPrice")%>' />  <%--单价--%>
											<input type="hidden" name="fieldItemPrice" value='<%#GetFieldItemPrice(DataBinder.Eval(Container.DataItem, "Items").ToString())%>' />   <%--配件价格--%>
											<input type="hidden" name="recordID" value='<%#DataBinder.Eval(Container.DataItem, "RecordID")%>' />    <%--RecordID--%>
											<input type="hidden" name="weight" value='<%#DataBinder.Eval(Container.DataItem, "Weight")%>' /><%--重量--%>
											<input type="hidden" name="score" value='<%#DataBinder.Eval(Container.DataItem, "Score")%>' /><%--积分--%>
										<TD height="38" width="14%" style="border-right:1px #b5b5b5 solid;"><span id="total<%# Container.ItemIndex+1%>" class="itemTotal"><%# (decimal)DataBinder.Eval(Container.DataItem, "MemberPrice") * (int)DataBinder.Eval(Container.DataItem, "Quantity") + GetFieldItemPrice(DataBinder.Eval(Container.DataItem, "Items").ToString()) * (int)DataBinder.Eval(Container.DataItem, "Quantity") %></span></TD>
										<TD height="38" width="10%"><A href='Actions.aspx?Action=DeleteCartItem&pid=<%# DataBinder.Eval(Container.DataItem, "ProductID") %>&items=<%# DataBinder.Eval(Container.DataItem, "Items") %>&choice=<%#System.Web.HttpUtility.UrlEncode(DataBinder.Eval(Container.DataItem, "ProductSpecs").ToString())%>'><IMG height="16" src="images/delete.gif" width="16" border="0"></A></TD>
									</TR>
								</TABLE>
							</ItemTemplate>
						</asp:datalist>
					</div>
					<div style="text-align:right; background-color:#e0e0e0; border:1px #b5b5b5 solid; height:30px; line-height:30px; color:#000000; font-weight:normal;">
						<b><%=GetResourceString("Total")%>: </b><span id="total"><%=GetTotal()%></span>
						<b><%=GetResourceString("Weight")%>: </b><span id="totalWeight"><%=GetTotalWeight()%></span> Kg
						<b><%=GetResourceString("Quantity")%>: </b><span id="total_quantity"><%=GetTotalQuantity()%></span>
						<% if(config.MarkUnit == 1) {%><b><%=GetResourceString("Credit")%>: </b><span id="totalScore"><%=GetScore()%></span><% }%>
					</div>
					<div style="text-align:right">
						<a href="Actions.aspx?Action=EmptyCart">
						<img src='Images/<%=GetResourceString("ButtonCartClear")%>' border="0"></a>&nbsp;
						<asp:ImageButton id="ibtUpdate" runat="server" ImageUrl="Images/cart_change.gif" BorderWidth="0" Visible="False"></asp:ImageButton>
						<a href='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%if(config.html==""){%>List.aspx<%}else{%>List.<%=config.html%><%}%>'>
						<img src='Images/<%=GetResourceString("ButtonCartContinue")%>' border="0"></a>&nbsp;
						<asp:ImageButton id="ibtNextStep" runat="server" ImageUrl="Images/cart_next.gif" BorderWidth="0"></asp:ImageButton>
					</div>
				</div>
				<div class="bl"></div>
				<div class="br"></div>
				<div class="bm"></div>
			</div>
			</form>
			<!--内容结束--> 
			<div id="overDiv" style="Z-INDEX: 1000; VISIBILITY: hidden; POSITION: absolute"></div>
			<uc1:Helper id="Helper1" runat="server"></uc1:Helper>
			<uc1:Footer id="Footer1" runat="server"></uc1:Footer>
		</div>
	</body>
</HTML>
