<%@ Page language="c#" Codebehind="Gifts.aspx.cs" AutoEventWireup="true" Inherits="XpShop.WebUI.Gifts" %>
<%@ 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="AlreadyExchaged" Src="Modules/AlreadyExchaged.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

    protected void search_Click(object sender, EventArgs e)
    {

    }
</script>

<HTML>
	<HEAD>
		<!--#include file="../../inc/encoding.inc"-->
		<title><%=GetResourceString("IntegralExchangeGift")%>,<%=config.SiteTitle%></title>
		<!--#include file="../../inc/head.inc"-->
		<link href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/list.css" type="text/css" rel="stylesheet" />
		<script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/gifts.js" type="text/javascript"></script>
		<script type="text/javascript">
    	    var extend = '<%=config.html %>';
		    var baseUrl="<%=webSite %>gifts";
		    var prePage="<%=GetResourceString("PreviousPage")%>";
		    var nextPage="<%=GetResourceString("NextPage")%>";
		    var page="<%=Request.QueryString["page"] == null ? "1" : Request.QueryString["page"] %>";
		    var sort="<%=Request.QueryString["OrderSort"] == null ? "0" : Request.QueryString["OrderSort"] %>";
		</script>
	</HEAD>
	<body>
	<% if (HaveGiftApply(Request.Url.ToString()))
    {%>
		<uc1:Header id="Header1" runat="server"></uc1:Header>
		<div class="xp-w clear" style=" margin-top:-5px; margin-bottom:1px; overflow:hidden;"><%=GetAD(34)%></div> 
        <div class="xp-w clear">
		    <div class="path"><%=position%></div>
			<div id="content_left" >
                <div class="lframe">
                    <div class="tl"></div>
                    <div class="tr"></div>
                    <div class="tm">礼品分类</div>
                    <div class="ml"></div>
                    <div class="mr"></div>
                    <div class="mm">
                        <ul class="ul_content">
                            <asp:Repeater Runat="server" ID="rptGiftCat">
                                <ItemTemplate>
                                    <li class="text clear">
<%--                                            <div class="index" style="float:left"><%#Container.ItemIndex+1 %></div>--%>
                                            <div class="titile">
                                        <a href='<%=webSite %>gifts-<%#DataBinder.Eval(Container.DataItem,"CatID")%>.<%=config.html %>' target="_self" ><%#DataBinder.Eval(Container.DataItem,"CatName")%></a></div>
                                        </li>
                                </ItemTemplate>
	                        </asp:Repeater>
                        </ul>
                    </div>
                    <div class="bl"></div>
                    <div class="br"></div>
                    <div class="bm"></div>
                </div>
            	<%--兑换积分排行榜开始--%>
<%--           	<uc1:AlreadyExchaged id="AlreadyExchaged1" runat="server"></uc1:AlreadyExchaged>	
--%>
            	<%--兑换积分排行榜结束--%>
                <div class="lframe">
                    <div class="tl"></div>
                    <div class="tr"></div>
                    <div class="tm">
                        <div class="title">积分兑换排行榜</div>
                    </div>                    
                    <div class="ml"></div>
                    <div class="mr"></div>
                    <div class="mm">
                        <ul class="ul_content">
                            <asp:Repeater Runat="server" ID="rptGifts">
                                <ItemTemplate>
                	                <li class="index"><%#Container.ItemIndex+1 %></li>
                                    <li style="width:160px;overflow:hidden;">
                                        <a href='<%=webSite %>GiftDetails-<%#DataBinder.Eval(Container.DataItem,"GiftID")%>.<%=config.html %>' target="_blank" ><%#DataBinder.Eval(Container.DataItem,"GiftName")%></a>
                                    </li>
                                </ItemTemplate>
	                        </asp:Repeater>
                        </ul>
                    </div>
                    <div class="bl"></div>
                    <div class="br"></div>
                    <div class="bm"></div>
                </div>

                </div>
                

			<div id="content_right">				
                <form id="Form1" method="post" runat="server" style="height:41px"> 
			       <!--礼品列表开始-->
				    <div class="list_style clear">
		                <div style="float:left;margin-right:15px;">
		                <asp:Label ID="lblPdtNum" runat="server"></asp:Label>
                            <span >积分从</span>
                            <asp:TextBox ID="txtMinScore" MaxLength="8"  runat="server" style="width:60px;margin-top:7px"/>
                            <span >到</span>
                            <asp:TextBox ID="txtMaxScore" MaxLength="8"  runat="server" style="width:60px;margin-top:7px"/>
                            <asp:button ID="btnSearch" runat=server OnClick="btnSearch_Click" Text="查询" />
                        </div>
                      
					    <%=GetSortMode()%>
                        <div class="page_change">
						    <asp:Label ID="lblTopPage" CssClass="pagelblpage" runat="server"></asp:Label>
					    </div>
		            </div>
                </form>	
		        
			    <div class="plist">
					<div class="pro_wlist">
						<asp:DataList id="dlGifts" CellPadding="3" CellSpacing="0" GridLines="None" RepeatColumns="4"
							RepeatDirection="Horizontal" RepeatLayout="Table" HorizontalAlign="left" Visible="true" runat="server">
							<ItemStyle CssClass="dl_item"/>
							<ItemTemplate>													
								<table cellpadding="3" cellspacing="0" border="0" width="100%">
							        <tr>
								        <td>
								            <div class="xp-pdt-img">
								            <a href="GiftDetails-<%#DataBinder.Eval(Container.DataItem,"GiftID")%>.<%=config.html %>" target="_blank">
                                                    <img width="160" height="160" src="<%=webSite %>upload/ProductImg/<%# DataBinder.Eval(Container.DataItem,"ImgFolder")%><%#DataBinder.Eval(Container.DataItem,"ThumbnailImg")%>" alt='' /></a>										            <br />
										            <div class="clear"></div>
                                            </div>
								        </td>
								    </tr>
							        <tr>
								        <td>
								            <div class="xp-pdt-img">
										            <div style="overflow:hidden; text-align:center;">
										                <a href="GiftDetails-<%#DataBinder.Eval(Container.DataItem,"GiftID")%>.<%=config.html %>"><%#DataBinder.Eval(Container.DataItem,"GiftName")%></a>
										            </div>
										            <div style="overflow:hidden; text-align:center;">
										                兑换该礼品需<font color="#fe0000"><strong><%#DataBinder.Eval(Container.DataItem,"Score")%></strong></font>分
										                <br />
										                已有<font color="#fe0000"><strong><%#DataBinder.Eval(Container.DataItem, "AlreadyExchaged")%></strong></font>人兑换
										                <br />
										            </div>
										            <div class="gift_btdh clear" style="text-align:center;">
										                <a href="GiftDetails-<%#DataBinder.Eval(Container.DataItem,"GiftID")%>.<%=config.html %>" target="_blank"><%=GetResourceString("SelectExchange")%></a>
										            </div>
										            <div class="clear"></div>
                                            </div>
								        </td>
								    </tr>
								</table>
							</ItemTemplate>
						</asp:DataList>
					</div>
			    </div><!--end plist-->
				<!--礼品列表结束-->
				
				<asp:panel id="plPage" visible="true" runat="server">
				<!-- 翻页开始-->
				<div class="page clear">
                    <div class="fpage">
                        <asp:Label ID="lbPage" class="lb-page" runat="server"></asp:Label>
                    </div>                                
				</div>
				<!-- 翻页结束-->
				</asp:panel>
				
				<asp:panel id="plNoProduct" visible="false" runat="server">
					<div style="margin:20px;">
						<h3>抱歉，暂无可兑换的礼品！</h3>
					</div>
				</asp:panel>
		    </div>
		</div>

		<div class="xp-w clear">
		    <uc1:Helper id="Helper1" runat="server"></uc1:Helper>
		</div>
		<div class="xp-w clear">
		    <uc1:Footer id="Footer1" runat="server"></uc1:Footer>
		</div>
		<%} %>
	</body>
</HTML>
