<%@ page language="C#" masterpagefile="~/MasterPage/UserMasterPage.master" autoeventwireup="true" inherits="Rest_Manage_RestManage_IntegralInfoList, DoodiiShop" title="Untitled Page" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <style type="text/css">@import url(/js/jquery-calendar/jquery-calendar.css);</style>

    <script type="text/javascript" src="/js/jquery-calendar/jquery-calendar.js"></script>

    <style type="text/css">
.red {color:red;}s
</style>
    <div class="mt10 UserIntegral_03 wh100">
        <span class="span03">累计赠送积分：<strong class="red "><asp:Label ID="lblGet" runat="server"
            Text="0"></asp:Label>分&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong> 用户消费积分：<strong
                class="red "><asp:Label ID="lblUsed" runat="server" Text="0"></asp:Label>分&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>目前剩余积分：<strong
                    class="red "><asp:Label ID="lblExpendIntegral" runat="server" Text="0"></asp:Label>分</strong></span>
        <%--<div style="float: left;" style="cursor: pointer;" onclick="getElementById('qw').style.display='block'">
            <img src="/images/User/JifenBtn_02.gif" alt="使用积分" style="cursor: pointer;" /></div>--%>
        <%-- <div style="cursor: pointer;float: left;display:none;">
            <a href="../Spread/ExchangeGift.aspx">
                <img src="/images/User/JifenBtn_02.gif" alt="使用积分" style="cursor: pointer;" /></a></div>
        <div class="UserIntegral_01">
            <span class="span01">订餐有“礼”！豆丁组织活动时，您的积分可以为您带来惊喜。详情请点击 </span><a href="/Service/Handbook.aspx?id=45"
                target="_blank">
                <img src="/images/User/JifenBtn_01.gif" alt="" /></a></div>--%>
        <div class="wh100 fl" style="margin-top: 10px; margin-bottom: 10px;">
            查询日期：<asp:TextBox ID="tbStartDate" runat="server"></asp:TextBox>
            至<asp:TextBox ID="tbEndDate" runat="server"></asp:TextBox>
            会员邮箱：<asp:TextBox ID="tbEmail" runat="server"></asp:TextBox>
            <a class="btnQuery" href="javascript:GetList(1);">查询</a>
        </div>
        <div>
            <!--提示开始-->
            <div id="qw" style="display: none;">
                <div style="float: left; font-size: 12px; color: #000;">
                    <div style="float: right;" style="clear: both;">
                        <a style="cursor: pointer;" onclick="getElementById('qw').style.display='none'">[ 关闭
                            ]</a></div>
                    <div style="margin-top: 20px; line-height: 1.5;">
                        <ul class="PicBtn">
                            <%--<li><a href="/Private/GoldGift.aspx">
                            <img src="/images/Spread/hjdj.jpg" alt="点击兑换黄金大奖" /></a></li>--%>
                            <li><a href="/Spread/ExchangeGift.aspx">
                                <img src="/images/Spread/dhlp.jpg" alt="点击兑换礼品" /></a></li>
                            <li><a href="/Spread/ExchangeMoney.aspx">
                                <img src="/images/Spread/dhgz.jpg" alt="点击兑换工资" /></a></li>
                            <li><a href="#">
                                <img src="/images/Spread/jfjb.jpg" alt="积分竞宝即将开通，敬请关注！" /></a></li>
                        </ul>
                    </div>
                </div>
            </div>
            <!--提示结束-->
            <div id="divList">
            </div>
        </div>
    </div>

    <script type="text/javascript">
function Loading()
{
    var divList = document.getElementById("divList");
    divList.innerHTML = "<img src='/images/System/loading.gif' alt='正在载入...'/>";
}
var page = 1;
function GetList(pageNo)
{    
   if (pageNo==null)
        pageNo = page;page = pageNo;
   var divList = document.getElementById("divList");   
   var startDate = document.getElementById("<%=tbStartDate.ClientID%>").value;
   var endDate = document.getElementById("<%=tbEndDate.ClientID%>").value;
   var email = document.getElementById("<%=tbEmail.ClientID%>").value;
   var url = "/Rest/Manage/RestManage_IntegralInfoListTemplate.aspx" + "?pageno="+pageNo;
   if (startDate!="" && endDate=="")
   {
        alert("请选择结束日期！");document.getElementById("<%=tbEndDate.ClientID%>").focus();return ;
   }
   if (startDate=="" && endDate!="")
   {
        alert("请选择开始日期！");document.getElementById("<%=tbStartDate.ClientID%>").focus();return;
   }   
   if (startDate!="" && endDate!="")
   {
        if (date_compare(startDate,endDate)<0)
        {
            alert("开始时间不能大于结束日期！");document.getElementById("<%=tbStartDate.ClientID%>").focus();return;
        }
        url += "&startDate="+startDate+"&endDate="+endDate;   
   }
   if(email!="")
   {url+="&Email="+email;}
   Loading();
   var html = $.ajax({ url: url, async: false,ifModified:true}).responseText
   document.getElementById("divList").innerHTML = html;getIntegral();
}
function getIntegral()
{
    var ret = Rest_Manage_RestManage_IntegralInfoList.getIntegral().value;
//    if (ret != null)    
//    {
//        $("#<%=lblExpendIntegral.ClientID %>").html(ret.ExpendIntegral);
//        $("#<%=lblUsed.ClientID %>").html(ret.UsedIntegral);
//        $("#<%=lblGet.ClientID %>").html(ret.ExpendIntegral + ret.UsedIntegral);
//    }
//    else
//    {
//        $("#<%=lblExpendIntegral.ClientID %>").html( "0");
//        $("#<%=lblUsed.ClientID %>").html("0");
//        $("#<%=lblGet.ClientID %>").html("0");
//    }
    if(ret!=null)
    {
        if(ret.ExpendIntegral!=0)
		    $("#<%=lblExpendIntegral.ClientID %>").html(ret.ExpendIntegral);
	    if(ret.UsedIntegral!=0)
		    $("#<%=lblUsed.ClientID %>").html(ret.UsedIntegral);
	    if(ret.UsedIntegral!=0 || ret.ExpendIntegral!=0)
		    $("#<%=lblGet.ClientID %>").html(ret.ExpendIntegral + ret.UsedIntegral);
    }
}
function pageChange(obj,pageNo)
{
     GetList(pageNo);
}
var loadPage = function() 
{    
    $("#<%=tbStartDate.ClientID %>").calendar(); 
    $("#<%=tbEndDate.ClientID %>").calendar();  
    GetList(1); 
    getIntegral();
}
$(document).ready( function(){ loadPage() });
    </script>

</asp:Content>
