<%@ Page language="c#" Codebehind="NewProducts.aspx.cs" AutoEventWireup="false" Inherits="wqeshop.NewProducts" %>
<%@ Register TagPrefix="uc1" TagName="LeftNav" Src="Modules/LeftNav.ascx" %>
<%@ Register TagPrefix="uc1" TagName="SmallCart" Src="Modules/SmallCart.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/Header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Helper" Src="Modules/Helper.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>
<head>
<!--#include file="../../inc/head.inc"-->
<title><%=GetResourceString("NewProducts")%>-<%=config.SiteTitle%></title>
</head>
<body id="MenuM4">
<uc1:header id="Header1" runat="server"></uc1:header>
<div class="twidth">
  <!--当前位置开始-->
  <div id="cnav">
    <div class="l"></div>
    <div class="r"></div>
    <div class="m"><%=GetResourceString("WhereYouAre")%> <a href='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%if(config.html==""){%>Default.aspx<%}else{%>index.<%=config.html%><%}%>'><%=GetResourceString("Home")%></a> <font face="Times New Roman, Times, serif">>></font> <%=GetResourceString("NewProducts")%></div>
  </div>
  <!--当前位置结束-->
  <div id="middle">
    <div class="middlel">
      <!--购物车开始-->
      <uc1:smallcart id="SmallCart1" runat="server"></uc1:smallcart>
      <!--购物车结束-->
      <!--类别导航开始-->
      <uc1:leftnav id="LeftNav1" runat="server"></uc1:leftnav>
      <!--类别导航结束-->
    </div>
    <div class="middler">
      <div class="mframe">
        <div class="tl"></div>
        <div class="tr"></div>
        <div class="tm"><span class="tt"><%=GetResourceString("NewProducts")%></span></div>
        <div class="wrapper"><div class="ml"></div>
        <div class="mr"></div>
        <div class="mm">
          <table cellSpacing="0" cellPadding="0" width="100%" border="0">
            <tr>
              <td vAlign="top"><%BindProductList();%>
                <asp:DataList ID="dlProducts" runat="server" RepeatColumns="2" RepeatDirection="Horizontal" RepeatLayout="Table"
													CellSpacing="0" CellPadding="5" Width="100%" Visible="true" GridLines="None">
                  <itemstyle CssClass="alignCenterTop" />
                  <itemtemplate>
                    <table cellpadding="5" cellspacing="0" border="0" width="95%">
                      <tr>
                        <td colspan="2" align="left"><img src="images/items.gif" border="0" align="absmiddle"><%#DataBinder.Eval(Container.DataItem,"Name")%></td>
                      </tr>
                      <tr>
                        <td><a href='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%if(config.html==""){%>Show.aspx?PID=<%# DataBinder.Eval(Container.DataItem,"ProductID")%><%}else{%>products/Product_<%# DataBinder.Eval(Container.DataItem,"ProductID") %>.<%=config.html%><%}%>'><img src='<%=config.Path%>upload/<%#DataBinder.Eval(Container.DataItem,"ThumbnailImg")%>' class="chnsimg"></a> </td>
                        <td><div class="jingdian">
                          <% if(wqeshop.WebUtils.MemberShowPrice()) {%>
                          <%=GetResourceString("MarketPrice")%>：<%#DataBinder.Eval(Container.DataItem,"MarketPrice","{0:c}")%><br />
                          <%=GetResourceString("MemberPrice")%>：<%#DataBinder.Eval(Container.DataItem,"MemberPrice","{0:c}")%><br />
                          <% }%>
                          <% if(config.MarkUnit == 1) {%>
                          <%=GetResourceString("Credit")%>：<%#DataBinder.Eval(Container.DataItem,"Score")%>
                          <% }%>
                          <br />
                          <a href="#" onclick='addtocart(<%#DataBinder.Eval(Container.DataItem,"ProductID")%>)'><%=GetResourceString("Buy")%></a> | <a href='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%if(config.html==""){%>Show.aspx?PID=<%# DataBinder.Eval(Container.DataItem,"ProductID")%><%}else{%>products/Product_<%# DataBinder.Eval(Container.DataItem,"ProductID") %>.<%=config.html%><%}%>'><%=GetResourceString("Details")%></a> | <a href='Actions.aspx?action=Favorite&ProductID=<%#DataBinder.Eval(Container.DataItem,"ProductID")%>&ReturnUrl=<%=Request.Url%>'><%=GetResourceString("AddToFavourite")%></a></div><%# GetAliPayButton(DataBinder.Eval(Container.DataItem,"ProductID").ToString())%></td>
                      </tr>
                    </table>
                  </itemtemplate>
                </asp:DataList>
                <!-- 翻页开始-->
                <table width="100%">
                  <tr>
                    <td><asp:hyperlink id="hplPrev" runat="server"></asp:hyperlink>
                      [&nbsp;
                      <asp:label id="lbPage" Runat="server"></asp:label>
                      &nbsp;]
                      <asp:hyperlink id="hplNext" runat="server"></asp:hyperlink></td>
                    <td align="right"><asp:label id="lblTotalPage" runat="server" visble="false"></asp:label>
                      <asp:label id="lblPagerInfo" Runat="server"></asp:label>
                      <B>
                      <asp:label id="lblCurrentPage" runat="server" visble="false"></asp:label>
                      </B> &nbsp;
                      <input id="gopage" type="text" name="gopage" class="inputbg" size="1" onKeyUp="isNumber()">
                      <input type="button" value="Go" onclick="return GoPage();" ></td>
                  </tr>
                </table>
                <!-- 翻页结束-->
                <script type="text/javascript">
						function GoPage() 
						{ 
							if(trim(document.all.gopage.value)!="" )
							{
								if(document.all.gopage.value!="0")
								{
				                    
									if(document.all.gopage.value><%=totalpage %>)
									{
										alert("输入的数字大于总页数");
										document.all.gopage.value="1";
										return false;
									}
									else
									{
					                                           											
										javascript:window.location.href="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>NewProducts.aspx?Page=" + document.all.gopage.value;
										document.all.gopage.value="";
									}
								}
								else
								{  
									alert("输入错误！");
									document.all.gopage.value="";
								}
							}
							else
							{
								alert("请输入要跳转到的页面");
								document.all.gopage.value="";
							}
			                
							return false;
						}
						function trim(str)
						{
							return str.replace(new RegExp("(^[\\s]*)|([\\s]*$)", "g"), "");	
						}
						function isNumber()
						{
							document.getElementById("gopage").value = document.getElementById("gopage").value.replace(/\D/g,"");
						}

						function addtocart(pid)
						{
							if('<%=config.ShopStop%>' == 'True')
							{
								temp=window.open('ShoppingCart.aspx?pid='+pid,'shopcat','width=700,height=650,scrollbars=yes');
								temp.focus();
							}
							else
							{
								alert('<%=config.ShopStopWords%>');
								return false;
							}
						}
						</script>
              </td>
            </tr>
          </table>
        </div>
        </div><div class="bl"></div>
        <div class="br"></div>
        <div class="bm"></div>
      </div>
    </div>
  </div>
</div>
<uc1:helper id="Helper1" runat="server"></uc1:helper>
<uc1:footer id="Footer1" runat="server"></uc1:footer>
</body>
</html>
