<%@ 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" %>
<%@ Page language="c#" Codebehind="List.aspx.cs" AutoEventWireup="false" Inherits="wqeshop.List" %>
<!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("ProductList")%>-<%=config.SiteTitle%></title>
</head>
<body id="MenuM2">
<!--头部导航条开始-->
<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")%><font face="Times New Roman, Times, serif"><%=GetCurrentPosition()%></font></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">
      <!--子类列表开始-->
      <%BindSubCatList();%>
      <div class="mframe"><!--style='display:< % = HasSubCategory % >'-->
        <div class="tl"></div>
        <div class="tr"></div>
        <div class="tm"><span class="tt"><%=GetResourceString("SubCategoryList")%></span></div>
        <div class="wrapper"><div class="ml"></div>
        <div class="mr"></div>
        <div class="mm">
          <asp:DataList id="dlSubCatList" CellPadding="3" CellSpacing="0" RepeatLayout="Table" RepeatDirection="Horizontal"
						RepeatColumns="7" CssClass="tdbg" Style="MARGIN-LEFT:30px" runat="server">
            <ItemStyle Width="100px" />
            <ItemTemplate> <a href='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%if(config.html==""){%>List.aspx?CatID=<%# DataBinder.Eval(Container.DataItem,"CategoryID")%><%}else{%>categories/Category_<%# DataBinder.Eval(Container.DataItem,"CategoryID") %>.<%=config.html%><%}%>'><%#DataBinder.Eval(Container.DataItem,"Name")%> </a> </ItemTemplate>
          </asp:DataList>
        </div>
        </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("ProductList")%></span></div>
        <div class="wrapper"><div class="ml"></div>
        <div class="mr"></div>
        <div class="mm">
          <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
              <td valign="top" align="center"><%BindProductList();%>
                <asp:DataList id="dlProducts" CellPadding="0" CellSpacing="0" GridLines="None" RepeatColumns="4" RepeatDirection="Horizontal" RepeatLayout="Table" Visible="true" Width="100%" runat="server">
                  <ItemStyle CssClass="alignCenterTop" />
                  <ItemTemplate>
                    <table cellpadding="5" cellspacing="0" border="0" width="170">
                      <tr>
                        <td colspan="2"><img src="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>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%><%}%>' target=_self ><img src='/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%><%=config.Path%>upload/<%#DataBinder.Eval(Container.DataItem,"ThumbnailImg")%>' class="chnsimg"></a> </td>
                      </tr>
                      <tr>
                        <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%><%}%>' target=_self ><%=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
									{
										var catid = <%=catid%>;
										if(catid != 0)
										{
											window.location.href="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>List.aspx?CatID=" + catid + "&Page=" + document.all.gopage.value;
										}
										else
										{
											window.location.href="/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>List.aspx?Page=" + document.all.gopage.value;
										}
									}
								}
								else
								{  
									alert("输入错误！");
									document.all.gopage.value="";
									return false;
								}
							}
							else
							{
								alert("请输入要跳转到的页面");
								document.all.gopage.value="";
								return false;
							}
							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('/<%=System.Configuration.ConfigurationSettings.AppSettings["ShopFolder"]%>ShoppingCart.aspx?pid='+pid,'shopcat','width=700,height=850,scrollbars=yes,resizable=yes');
								temp.focus();
							}
							else
							{
								alert('<%=config.ShopStopWords%>');
								return false;
							}
						}
						</script>
              </td>
            </tr>
          </table>
          <table width="100%">
            <tr>
              <td class="hr"></td>
            </tr>
            <tr>
              <td align="center" height="30"><!-- 快速搜索栏 ->
                < %=GetResourceString("Search")%>:
                <input type="text" name="keyword" class="inputbg" size="20">
                <input type="submit" value="< %=GetResourceString("Search")%>" onclick="GoSearch()">
                <script type="text/javascript">
													function GoSearch() 
													{ 
														javascript:window.location.href="Search.aspx?keyword=" + document.all.keyword.value;
													}
												</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>
