<%@ Page language="c#" Codebehind="Search.aspx.cs" AutoEventWireup="false" Inherits="wqeshop.Search" %>
<%@ 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" %>
<%@ Register TagPrefix="uc1" TagName="LeftNav" Src="Modules/LeftNav.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="<%=GetResourceString("charset")%>">
<head>
<!--#include file="../../inc/head.inc"-->
<title><%=GetResourceString("Search_Title")%>-<%=config.SiteTitle%></title>
<script type="text/javascript">function Go(obj){	window.location="Search.aspx?cid="+obj+"&key="+document.frmSearch.keyword.value+"&low="+document.frmSearch.lowprice.value+"&high="+document.frmSearch.highprice.value;}	</script>
</head>
<body>
<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("Search")%></div>
  </div>
  <!--当前位置结束-->
  <div id="middle">
    <div class="middlel">
      <!--类别导航开始-->
      <uc1:LeftNav id="LeftNav1" runat="server"></uc1:LeftNav>
      <!--类别导航结束-->
    </div>
    <div class="middler">
      <!--商品列表开始-->
      <% if(Request.QueryString["keyword"] != null) {%>
      <div class='mframe'>
        <form id="Form1" method="post" runat="server">
          <div class="tl"></div>
          <div class="tr"></div>
          <div class="tm"><span class="tt"><%=GetResourceString("Search_Title")%></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" RepeatDirection="Horizontal" RepeatColumns="4" RepeatLayout="Table"
														Width="100%" Visible="true" GridLines="None" CellSpacing="0" CellPadding="5">
                    <itemstyle CssClass="alignCenterTop" />
                    <itemtemplate>
                      <table cellpadding="5" cellspacing="0" border="0" width="150" align="center">
                        <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>
                        </tr>
                        <tr>
                          <td><span class="thumbnailTitle">
                            <% if(wqeshop.WebUtils.MemberShowPrice()) {%>
                            <%=GetResourceString("MarketPrice")%>：<%=GetCurrency()%><%#DataBinder.Eval(Container.DataItem,"MarketPrice","{0:c}")%><br />
                            <%=GetResourceString("MemberPrice")%>：<%=GetCurrency()%><%#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="_blank" > <%=GetResourceString("Details")%></a> | <a href='Actions.aspx?action=Favorite&ProductID=<%#DataBinder.Eval(Container.DataItem,"ProductID")%>&ReturnUrl=<%=Request.Url%>'> <%=GetResourceString("AddToFavourite")%></a></span></td>
                        </tr>
                      </table>
                    </itemtemplate>
                  </asp:DataList>
                  <script type="text/javascript">
												function addtocart(pid)
												{
													temp=window.open('ShoppingCart.aspx?pid='+pid,'shopcat','width=700,height=650,scrollbars=yes');
													temp.focus();
												}
													</script>
                  <asp:Label ID="lbNoProduct" Runat="server" Visible="False">没有符合搜索条件的商品</asp:Label>
                  <!-- 翻页-->
                  <table width="100%">
                    <tr>
                      <td><asp:hyperlink id="hplPrev" runat="server"><%=GetResourceString("PreviousPage")%></asp:hyperlink>
                        [&nbsp;
                        <asp:Label ID="lbPage" Runat="server"></asp:Label>
                        &nbsp;]
                        <asp:hyperlink id="hplNext" runat="server"><%=GetResourceString("NextPage")%></asp:hyperlink>
                      </td>
                      <td align="right"><asp:label id="lblPagerInfo" runat="server"></asp:label>
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:TextBox ID="txtGOPage" Runat="server" class="inputbg" size="1"></asp:TextBox>
                        <asp:Button ID="btnGo" Text="Go" Runat="server"></asp:Button>
                        &nbsp;&nbsp;&nbsp;&nbsp; </td>
                    </tr>
                  </table></td>
              </tr>
            </table>
          </div>
          </div><div class="bl"></div>
          <div class="br"></div>
          <div class="bm"></div>
        </form>
      </div>
      <% }%>
      <div class="mframe">
        <div class="tl"></div>
        <div class="tr"></div>
        <div class="tm"><span class="tt"><%=GetResourceString("Search_Advance")%></span></div>
        <div class="wrapper"><div class="ml"></div>
        <div class="mr"></div>
        <div class="mm">
          <table width="100%">
            <tr>
              <td align="center" height="30"><!-- 快速搜索栏 -->
                <FORM name=frmSearch action=search.aspx method=get target=_self>
                  <table width="100%" align="center">
                    <tr>
                      <td align="right" width="30%"><%=GetResourceString("Search_Key")%>：</td>
                      <td align="left"><input name="keyword" type="text" id="keyword" size="30" class="Seainputbg2" <%if(Request.QueryString["key"]!=null){%> value=<%=Request.QueryString["key"].ToString()%> <%}%>></td>
                    </tr>
                    <tr>
                      <td class="hr" colspan="2"></td>
                    </tr>
                    <tr>
                      <td align="right"><%=GetResourceString("Search_Price")%>：</td>
                      <td align="left"><%=GetResourceString("Search_LowPrice")%>:
                        <input name="lowprice" type="text" id="lowprice" size="5" class="Seainputbg" <%if(Request.QueryString["low"]!=null){%> value=<%=Request.QueryString["low"].ToString()%> <%}%>>
                        <%=GetResourceString("Search_HighPrice")%>:
                        <input name="highprice" type="text" id="highprice" size="5" class="Seainputbg" <%if(Request.QueryString["high"]!=null){%> value=<%=Request.QueryString["high"].ToString()%> <%}%>></td>
                    </tr>
                    <tr>
                      <td class="hr" colspan="2"></td>
                    </tr>
                    <tr>
                      <td align="right"><%=GetResourceString("Search_Category")%>：</td>
                      <td align="left"><%=GetCategories()%> </td>
                    </tr>
                    <tr>
                      <td class="hr" colspan="2"></td>
                    </tr>
                    <asp:Repeater ID="rptProductFields" Runat="server">
                      <ItemTemplate>
                        <tr>
                          <td align="right"><%# DataBinder.Eval(Container.DataItem, "FieldName") %>：</td>
                          <td><%# GetFieldValues(DataBinder.Eval(Container.DataItem, "FieldValues").ToString(),DataBinder.Eval(Container.DataItem, "IsMultiple").ToString(),DataBinder.Eval(Container.DataItem, "ProductFieldID").ToString())%></td>
                        </tr>
                        <tr>
                          <td class="hr" colspan="2"></td>
                        </tr>
                      </ItemTemplate>
                    </asp:Repeater>
                    <tr>
                      <td colspan="2" align="center"><input type="submit" name="btnSearch" value="<%=GetResourceString("Search_Advance")%>" id="btnSearch" />
                      </td>
                    </tr>
                  </table>
                </form>
                <!-- 搜索栏结束 --></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>
</div>
</body>
</html>
