<%@ Page language="c#" Codebehind="Checkout.aspx.cs" AutoEventWireup="false" Inherits="wqeshop.Checkout" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
<HEAD>
<title><%=GetResourceString("ValidateOrders")%>－－<%=config.SiteTitle%></title>
<!--#include file="inc/head.inc"-->
<script language="javascript" src="inc/calendar.js"></script>
<script language="JavaScript">
function GetDiv(sDiv)
{
	var div;
	if (document.getElementById)
		div = document.getElementById(sDiv);
	else if (document.all)
		div = eval("window." + sDiv);
	else if (document.layers)
		div = document.layers[sDiv];
	else
		div = null;

	return div;
}

function HideDiv(sDiv)
{
	d = GetDiv(sDiv);
	if (d)
	{
		if (document.layers) d.visibility = "hide";
		else d.style.visibility = "hidden";
	}
}

function PleaseWait(sDivButton, sDivMessage, sInnerHtml)
{
	HideDiv(sDivButton);
	var d = GetDiv(sDivMessage);
	if (d) d.innerHTML = sInnerHtml;
}
		</script>
<script language="javascript"> 
              //jb函数会根据不同的浏览器初始化个xmlhttp对象 
              function jb() 
              { 
                 var A=null; 
               try 
               { 
                   A=new ActiveXObject("Msxml2.XMLHTTP"); 
                } 
                 catch(e) 
                 { 
                  try 
                   { 
                      A=new ActiveXObject("Microsoft.XMLHTTP"); 
                   } 
                       catch(oc) 
                      { 
                     A=null 
                   } 
              } 
           if ( !A && typeof XMLHttpRequest != "undefined" ) 
            { 
               A=new XMLHttpRequest() 
             } 
           return A 
              } 
              
              //下面Go函数是父列表框改变的时候调用，参数是选择的条目 
              function Go(obj) 
              { 
                 //得到选择框的下拉列表的value 
                var svalue = obj.value; 
                 //定义要处理数据的页面 
                 var weburl = "ajax.aspx?parent_id="+svalue; 
                 //初始化个xmlhttp对象 
                 var xmlhttp = jb(); 
                 //提交数据，第一个参数最好为get，第三个参数最好为true 
                 xmlhttp.open("get",weburl,true); 
                // alert(xmlhttp.responseText); 
                 //如果已经成功的返回了数据 
                 xmlhttp.onreadystatechange=function() 
                 { 
                   if(xmlhttp.readyState==4)//4代表成功返回数据 
                    { 
                       var result = xmlhttp.responseText;//得到服务器返回的数据 
                       //先清空ddlSubAreas的所有下拉项 
                      document.getElementById("ddlSubAreas").length = 0; 
                       //给ddlSubAreas加个全部型号的,注意是Option不是option 
                       document.getElementById("ddlSubAreas").options.add(new Option("选择地区","0")); 
                       if(result!="")//如果返回的数据不是空 
                       { 
                          //把收到的字符串按照，分割成数组 
                          var allArray = result.split("<")[0].toString().split(","); 
                         //循环这个数组，注意是从1开始，因为收到的字符串第一个字符是，号，所以分割后第一个数组为空 
                          for(var i=1;i<allArray.length;i++) 
                          { 
                             //在把这个字符串按照|分割成数组 
                            var thisArray = allArray[i].split("|"); 
                             //为ddlSubAreas添加条目 
                             document.getElementById("ddlSubAreas").options.add(new Option(thisArray[1].toString(),thisArray[0].toString())); 
                          } 
                       } 
                    } 
                 } 
                 //发送数据，请注意顺序和参数，参数一定为null或者"" 
                 xmlhttp.send(null); 
              } 
		</script>
</HEAD>
<body style="background:#FFFFFF">
<form id="Form1" method="post" runat="server">
  <div class="twidth">
    <div class="mframe">
        <div class="tl"></div>
        <div class="tr"></div>
        <div class="tm"><span class="tt"><%=GetResourceString("ShoppingCart")%></span></div>
        <div class="ml"></div>
        <div class="mr"></div>
        <div class="mm"><table width="100%" cellpadding="0" cellspacing="0" border="0">
              <tr>
                <td valign="top"><table cellSpacing="0" cellPadding="0" width="98%" align="center">
                    <tr>
                      <td><b><%=GetResourceString("ProductName")%></b></td>
                      <td><b><%=GetResourceString("ProductNo")%></b></td>
                      <td><b><%=GetResourceString("MemberPrice")%></b></td>
                      <td><b><%=GetResourceString("FittingPrice")%></b></td>
                      <td><b><%=GetResourceString("Quantity")%></b></td>
                      <td><b><%=GetResourceString("Total")%></b></td>
                      <td width="80"><b><%=GetResourceString("IsDiscount")%></b></td>
                    </tr>
                    <asp:repeater id="rptShoppingCart" Runat="server">
                      <ItemTemplate>
                        <TR>
                          <TD><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><%# DataBinder.Eval(Container.DataItem, "ProductNo") %></TD>
                          <TD><%# DataBinder.Eval(Container.DataItem, "MemberPrice","{0:c2}") %></TD>
                          <TD><%# GetFieldItemPrice(DataBinder.Eval(Container.DataItem, "Items").ToString()) %></TD>
                          <TD><%# DataBinder.Eval(Container.DataItem, "Quantity") %> </TD>
                          <TD><%# (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") %></TD>
                          <TD width="80" align="center"><%# GetDiscount()%></TD>
                        </TR>
                      </ItemTemplate>
                    </asp:repeater>
                  </table></td>
              </tr>
              <tr>
                <td class="hr"></td>
              </tr>
              <tr>
                <td align="right"><table>
                    <tr>
                      <td align="right"><b><%=GetResourceString("Weight")%></b>：</td>
                      <td><%=GetTotalWeight()%>Kg</td>
                      <td align="right"><b><%=GetResourceString("Total")%></b>：</td>
                      <td>￥<%=GetTotal()%></td>
                    </tr>
                    <tr>
                      <td align="right"><b><%=GetResourceString("Quantity")%></b>：</td>
                      <td><%=GetTotalQuantity()%><%=GetResourceString("Piece")%></td>
                      <td align="right"><b><%=GetResourceString("IsDiscount")%></b>：</td>
                      <td><%=GetDiscount()%>%</td>
                    </tr>
                    <tr>
                      <td align="right"><b><%=GetResourceString("AfterDiscount")%></b>：</td>
                      <td>￥<%=string.Format("{0:c2}",GetDiscountTotal())%></td>
                      <td align="right"><b><%=GetResourceString("Add_onsCharge")%></b>：</td>
                      <td>￥<%=GetCustomItemTotal()%></td>
                    </tr>
                  </table></td>
              </tr>
              <tr>
                <td class="hr"></td>
              </tr>
              <tr>
                <td align="center"><A href="ShoppingCart.aspx">&nbsp;<%=GetResourceString("MemberInfomationsDesc")%></A></td>
              </tr>
            </table></div>
        <div class="bl"></div>
        <div class="br"></div>
        <div class="bm"></div>
      </div>
      <div class="mframe">
        <div class="tl"></div>
        <div class="tr"></div>
        <div class="tm"><span class="tt"><%=GetResourceString("ReceiverInfo")%></span></div>
        <div class="ml"></div>
        <div class="mr"></div>
        <div class="mm"><table cellSpacing="0" cellPadding="0" align="center" width="98%">
              <tr>
                <td height="16"><%=GetResourceString("ReceiverAddress")%>：</td>
                <td colSpan="3" height="16"><asp:dropdownlist id="ddlTopAreas" runat="server" AutoPostBack="True"></asp:dropdownlist>
                  <asp:dropdownlist id="ddlSubAreas" runat="server" AutoPostBack="True"></asp:dropdownlist>
                  <asp:textbox id="txtRAddress" runat="server" Width="300px"></asp:textbox>
                  <font color="red">*</font></td>
              </tr>
              <tr>
                <td><%=GetResourceString("ReceiverName")%></td>
                <td><asp:textbox id="txtRName" runat="server"></asp:textbox>
                  <FONT color="red">*</FONT></td>
                <td>Email</td>
                <td><asp:textbox id="txtREmail" runat="server"></asp:textbox>
                  <FONT color="red">*</FONT></td>
              </tr>
              <tr>
                <td><%=GetResourceString("ReceiverTelephone")%></td>
                <td><asp:textbox id="txtRPhone" runat="server"></asp:textbox>
                  <FONT color="red">*</FONT></td>
                <td><%=GetResourceString("ReceiverPostalcode")%></td>
                <td><asp:textbox id="txtRPostalcode" runat="server"></asp:textbox></td>
              </tr>
              <tr>
                <td colSpan="4"><asp:CheckBox id="cbxSame" runat="server" Text="ReceiverSameAsBuyer" Checked="True" TextAlign="Left"></asp:CheckBox></td>
              </tr>
            </table></div>
        <div class="bl"></div>
        <div class="br"></div>
        <div class="bm"></div>
      </div>
      <SPAN id="buyer" style="DISPLAY: none">
      <div class="mframe">
        <div class="tl"></div>
        <div class="tr"></div>
        <div class="tm"><span class="tt"><%=GetResourceString("BuyerInfo")%></span></div>
        <div class="ml"></div>
        <div class="mr"></div>
        <div class="mm"><table cellSpacing="0" cellPadding="0" width="98%" align="center">
              <tr>
                <td height="16"><%=GetResourceString("BuyerAddress")%>：</td>
                <td colSpan="3" height="16"><asp:textbox id="txtBAddress" runat="server" Width="400px"></asp:textbox></td>
              </tr>
              <tr>
                <td><%=GetResourceString("BuyerName")%></td>
                <td><asp:textbox id="txtBName" runat="server"></asp:textbox></td>
                <td>Email</td>
                <td><asp:textbox id="txtBEmail" runat="server"></asp:textbox></td>
              </tr>
              <tr>
                <td><%=GetResourceString("BuyerTelephone")%></td>
                <td><asp:textbox id="txtBPhone" runat="server"></asp:textbox></td>
                <td><%=GetResourceString("BuyerPostalcode")%></td>
                <td><asp:textbox id="txtBPostalcode" runat="server"></asp:textbox></td>
              </tr>
            </table></div>
        <div class="bl"></div>
        <div class="br"></div>
        <div class="bm"></div>
      </div>
      </SPAN>
      <script language="javascript">
					function BuyerSame()
					{
						if(document.Form1.cbxSame.checked)
						{
							eval("buyer" + ".style.display=\"none\";");
						}
						else
						{
							eval("buyer" + ".style.display=\"\";");
						}
					}
					BuyerSame();
				</script>
      <div class="mframe">
        <div class="tl"></div>
        <div class="tr"></div>
        <div class="tm"><span class="tt"><%=GetResourceString("ShippingInfo")%></span></div>
        <div class="ml"></div>
        <div class="mr"></div>
        <div class="mm"><asp:RadioButtonList ID="rblShipping" Runat="server" RepeatDirection="Vertical" RepeatLayout="Table"></asp:RadioButtonList></div>
        <div class="bl"></div>
        <div class="br"></div>
        <div class="bm"></div>
      </div>    
      <table id="TABLE1" cellSpacing="0" cellPadding="0" width="100%" runat="server">
        <tr>
          <td><div class="mframe">
        <div class="tl"></div>
        <div class="tr"></div>
        <div class="tm"><span class="tt"><%=GetResourceString("Date")%></span></div>
        <div class="ml"></div>
        <div class="mr"></div>
        <div class="mm"><table width="100%"  cellspacing="0" cellpadding="0">
                    <tr>
                      <td width=25%><asp:textbox id="txt_Date" runat="server" ForeColor="ControlDark"></asp:textbox>
                        <A onMouseOver="window.status='Date Picker';return true;" onMouseOut="window.status='';return true;"
											href="javascript:show_calendar('Form1.txt_Date');" border="0"><IMG src="images/imgbtn_Date.jpg" align="absMiddle" border="0"></A> </td>
                      <td align="left"><table cellpadding="0" cellspacing="0" id="TABLE2" height="22" runat="server">
                          <tr>
                            <td><%=GetResourceString("Form")%>
                              <asp:dropdownlist id="ddlHours" Runat="server">
                                <asp:ListItem Value="0">0:00</asp:ListItem>
                                <asp:ListItem Value="1">1:00</asp:ListItem>
                                <asp:ListItem Value="2">2:00</asp:ListItem>
                                <asp:ListItem Value="3">3:00</asp:ListItem>
                                <asp:ListItem Value="4">4:00</asp:ListItem>
                                <asp:ListItem Value="5">5:00</asp:ListItem>
                                <asp:ListItem Value="6">6:00</asp:ListItem>
                                <asp:ListItem Value="7">7:00</asp:ListItem>
                                <asp:ListItem Value="8">8:00</asp:ListItem>
                                <asp:ListItem Value="9">9:00</asp:ListItem>
                                <asp:ListItem Value="10">10:00</asp:ListItem>
                                <asp:ListItem Value="11">11:00</asp:ListItem>
                                <asp:ListItem Value="12">12:00</asp:ListItem>
                                <asp:ListItem Value="13">13:00</asp:ListItem>
                                <asp:ListItem Value="14">14:00</asp:ListItem>
                                <asp:ListItem Value="15">15:00</asp:ListItem>
                                <asp:ListItem Value="16">16:00</asp:ListItem>
                                <asp:ListItem Value="17">17:00</asp:ListItem>
                                <asp:ListItem Value="18">18:00</asp:ListItem>
                                <asp:ListItem Value="19">19:00</asp:ListItem>
                                <asp:ListItem Value="20">20:00</asp:ListItem>
                                <asp:ListItem Value="21">21:00</asp:ListItem>
                                <asp:ListItem Value="22">22:00</asp:ListItem>
                                <asp:ListItem Value="23">23:00</asp:ListItem>
                                <asp:ListItem Value="24" Selected>Change</asp:ListItem>
                              </asp:dropdownlist>
                              &nbsp; to
                              <asp:dropdownlist id="ddlHours1" Runat="server">
                                <asp:ListItem Value="0">0:00</asp:ListItem>
                                <asp:ListItem Value="1">1:00</asp:ListItem>
                                <asp:ListItem Value="2">2:00</asp:ListItem>
                                <asp:ListItem Value="3">3:00</asp:ListItem>
                                <asp:ListItem Value="4">4:00</asp:ListItem>
                                <asp:ListItem Value="5">5:00</asp:ListItem>
                                <asp:ListItem Value="6">6:00</asp:ListItem>
                                <asp:ListItem Value="7">7:00</asp:ListItem>
                                <asp:ListItem Value="8">8:00</asp:ListItem>
                                <asp:ListItem Value="9">9:00</asp:ListItem>
                                <asp:ListItem Value="10">10:00</asp:ListItem>
                                <asp:ListItem Value="11">11:00</asp:ListItem>
                                <asp:ListItem Value="12">12:00</asp:ListItem>
                                <asp:ListItem Value="13">13:00</asp:ListItem>
                                <asp:ListItem Value="14">14:00</asp:ListItem>
                                <asp:ListItem Value="15">15:00</asp:ListItem>
                                <asp:ListItem Value="16">16:00</asp:ListItem>
                                <asp:ListItem Value="17">17:00</asp:ListItem>
                                <asp:ListItem Value="18">18:00</asp:ListItem>
                                <asp:ListItem Value="19">19:00</asp:ListItem>
                                <asp:ListItem Value="20">20:00</asp:ListItem>
                                <asp:ListItem Value="21">21:00</asp:ListItem>
                                <asp:ListItem Value="22">22:00</asp:ListItem>
                                <asp:ListItem Value="23">23:00</asp:ListItem>
                                <asp:ListItem Value="24" Selected>Change</asp:ListItem>
                              </asp:dropdownlist>
                            </td>
                          </tr>
                        </table></td>
                    </tr>
                  </table></div>
        <div class="bl"></div>
        <div class="br"></div>
        <div class="bm"></div>
      </div></td>
        </tr>
      </table>
      <div class="mframe">
        <div class="tl"></div>
        <div class="tr"></div>
        <div class="tm"><span class="tt"><%=GetResourceString("PaymentInfo")%></span></div>
        <div class="ml"></div>
        <div class="mr"></div>
        <div class="mm"><asp:RadioButtonList ID="rblPayment" Runat="server" RepeatDirection="Vertical" RepeatLayout="Table"></asp:RadioButtonList>
            <br>
            <%=GetResourceString("AdvancePayment")%>：<%=member.AdvancePayment%>
            <asp:CheckBox ID="cbPayment" Runat="server" Text="Yes/No AdvancePayment"></asp:CheckBox></div>
        <div class="bl"></div>
        <div class="br"></div>
        <div class="bm"></div>
      </div>
      <div class="mframe">
        <div class="tl"></div>
        <div class="tr"></div>
        <div class="tm"><span class="tt"><%=GetResourceString("OrderComment")%></span></div>
        <div class="ml"></div>
        <div class="mr"></div>
        <div class="mm"><asp:textbox id="txtRemark" runat="server" Width="400" Height="40px" TextMode="MultiLine"></asp:textbox><div id='pleaseWaitButtonDiv2_PleaseWaitButton1'></div>
            <div id='pleaseWaitButtonDiv_PleaseWaitButton1'>
              <asp:button id="btnSave" Runat="server" Text="Confirm Order"></asp:button>
            </div></div>
        <div class="bl"></div>
        <div class="br"></div>
        <div class="bm"></div>
      </div> 
</div>
</form>
</body>
</HTML>
