<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Admin/MasterPage.master" Inherits="Kesion.NET.WebSite.Course.Admin.Course.KS_CsDJrecord" CodeBehind="KS.CsDJrecord.aspx.cs" %>

<%@ Import Namespace="Kesion.Publics" %>
<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.BLL" %>

<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" Runat="Server">
  
 <script>

 	function SetDate() {
 		var today = new Date();
 		if ($("#showdate").is(":hidden")) {
 			$("#showdate").show();
 			$('#<%=TxtBeginDate.ClientID%>').val(today.getFullYear() + '-' + (today.getMonth() + 1) + '-01');
 			$('#<%=TxtEndDate.ClientID%>').val(today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate());
 		}
 		else {
 			$("#showdate").hide();
 			$('#<%=TxtBeginDate.ClientID%>').val('');
      	$('#<%=TxtEndDate.ClientID%>').val('');
 		}
	 }
	 function keyWordFocus() {
	 	if (jQuery("#<%=this.KeyWord.ClientID %>").val() == '请输入关键字！') {
  		jQuery("#<%=this.KeyWord.ClientID %>").val('');
  	}
  }
  function keyWordBlur() {
  	if (jQuery("#<%=this.KeyWord.ClientID %>").val() == '') {
		jQuery("#<%=this.KeyWord.ClientID %>").val('请输入关键字！');
	}
}
function savestatus(i) {
	if (i == 0) { $("#showstatus").html("<span style='color:blue' onclick=\"savestatus(1)\">已审核</span>"); $("#status").val(1); };
	if (i == 1) { $("#showstatus").html("<span style='color:red' onclick=\"savestatus(0)\">未审核</span>"); $("#status").val(0); };
}
function setinput()
{
	$("#TJ").val("TJ");
}
 </script> 
     <asp:Panel ID="ListPanel" runat="server" Width="100%">
  <div id="manage_top" class="menu_top_fixed">
  		
       <ul>
            <%-- <span style="float:right;padding-right:10px">
            <asp:DropDownList ID="DrpClassID" runat="server" onchange="location.href='?classid='+this.value;">
             <asp:ListItem Value="0">--按分类查看--</asp:ListItem>
             </asp:DropDownList>
          </span>--%>
           <li id='p3'><asp:LinkButton ID="delclassbutton" runat="server" OnClientClick="return(GetIDS('del'));" OnClick="delclassbutton_Click" ><b></b>批量删除</asp:LinkButton></li>  
		     <%--  <li id='p11' style="display:<%=KSCMS.S("action").ToString()=="allGX"?"block":"none"%>">
			   <asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="setinput()"  OnClick="contribution" ><b></b>按条件统计贡献</asp:LinkButton>
			
		       </li>--%>
       
           </ul>
        </div> 
       <div class="menu_top_fixed_height"></div>  
 <div class="content-area">      
 	<div class="myTitle">道具记录
    	<span class="quickSearch">
       <b>快速搜索：</b>
                <asp:DropDownList ID="Condition" runat="server">
                    <asp:ListItem Value="1">发送者</asp:ListItem>
                    <asp:ListItem Value="2">接受者</asp:ListItem>
                     <asp:ListItem Value="3">道具名称</asp:ListItem>
                </asp:DropDownList>
                <asp:TextBox onfocus="keyWordFocus();" onblur="keyWordBlur();" Style="color: #ccc" Text="请输入关键字！" CssClass="textbox" ID="KeyWord" runat="server" Width="180px"></asp:TextBox>

                <b class="link-color" onclick="SetDate()" style="cursor: pointer">日期范围？</b>
                <span id="showdate" <%if (this.TxtBeginDate.Text == "")
                                      { %> style="display: none" <%} %>>
                    <asp:TextBox ID="TxtBeginDate" placeholder="格式：YYYY-MM-DD" Width="150px" runat="server" onclick="WdatePicker({dateFmt:&#39;yyyy-MM-dd&#39;});" CssClass="textbox Wdate"></asp:TextBox>至
                   <asp:TextBox ID="TxtEndDate" placeholder="格式：YYYY-MM-DD" Width="150px" runat="server" onclick="WdatePicker({dateFmt:&#39;yyyy-MM-dd&#39;});" CssClass="textbox Wdate"></asp:TextBox>
                </span>
       <asp:Button ID="Button1" runat="server" Text=" 搜索 "  CssClass="button"  onclick="Button1_Click" />
            </span>
           <asp:Label ID="LabNav" Visible="false" runat="server"></asp:Label>
    </div>
    <div class="tabs_header">
        <ul class="tabs">
          <li><a href="KS.CsDJOrder.aspx">购买记录</a></li>
          <li class="active"><a href="KS.CsDJRecord.aspx">发送记录</a></li>
          <li><a href="KS.CsDJHold.aspx">持有记录</a></li>
        </ul>
       </div>
    
		<asp:Panel runat="server" ID="panel1">
    <KS:ksgv id="List" runat="server" AutoGenerateColumns="False" EmptyDataText="暂时没有记录!" PagerType="CustomNumeric" Width="99%"  CssClass="CTable" GridLines="None" OnRowDataBound="List_RowDataBound" OnRowCommand="List_RowCommand" OnRowCreated="List_RowCreated">
        <Columns>
        <asp:TemplateField HeaderText="&lt;input type='checkbox' name='chkall' id='chkall' onClick='CheckAll(this.form);'/&gt;">
                <itemstyle horizontalalign="Center" width="30px" />
                <itemtemplate>
                <input type="checkbox"  name="ids" id="ids" value="<%#Eval("ID") %>" />
                </itemtemplate>
            </asp:TemplateField>

             <asp:TemplateField HeaderText="道具名称">
                    <ItemStyle Width="100px" HorizontalAlign="Center" />
                    <ItemTemplate>
                     	<%#Eval("acname") %>
                    </ItemTemplate>
                </asp:TemplateField>
				    <asp:TemplateField HeaderText="图片">
               <itemstyle width="100" HorizontalAlign="Center" />
                <itemtemplate>
			<img style="width:50px;" src="<%#Eval("acimage") %>" />
            
                </itemtemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="发送人名称">
               <itemstyle width="100" HorizontalAlign="Center" />
                <itemtemplate>
				<%#Eval("sender") %>
             
                </itemtemplate>
            </asp:TemplateField>
			 <asp:TemplateField HeaderText="送出数量">
               <itemstyle width="60" HorizontalAlign="Center" />
                <itemtemplate>
				<%#Eval("sendnum") %>
          
                </itemtemplate>
            </asp:TemplateField>
			 <asp:TemplateField HeaderText="贡献值">
               <itemstyle width="60" HorizontalAlign="Center" />
                <itemtemplate>
				<%#Eval("contribution") %>
            
                </itemtemplate>
            </asp:TemplateField>
             <asp:TemplateField HeaderText="送出日期">
            <itemstyle  horizontalalign="Center" width="150px" />
                <itemtemplate> 
                <%# Eval("senddate") %>
                </itemtemplate>
            </asp:TemplateField>
             <asp:TemplateField HeaderText="接受人名称">
               <itemstyle width="100" HorizontalAlign="Center" />
                <itemtemplate>
				<%#Eval("acepter") %>
           
                </itemtemplate>
            </asp:TemplateField>
             <asp:TemplateField HeaderText="所在课程">
            <itemstyle  horizontalalign="Center" width="100px" />
                <itemtemplate> 
                <%# getcoursename(Utils.StrToInt(Eval("courseid").ToString()) ) %>
                </itemtemplate>
            </asp:TemplateField>
           

            <asp:TemplateField HeaderText="删除">
                <itemstyle horizontalalign="Center" Width="70"/>
             <itemtemplate>
             <asp:LinkButton runat="server"  CssClass="delete" id="delet" commandargument=<%# Eval("ID") %> commandname="del">删除</asp:LinkButton>
            </itemtemplate>
            </asp:TemplateField>
           
        </Columns>
        <HeaderStyle CssClass="CTitle" />
        <EmptyDataRowStyle CssClass="emptycss" />
    </KS:ksgv>
	</asp:Panel>
	<asp:Panel runat="server" ID="panel2">
	
	 <asp:Repeater ID="MyContribution" runat="server"  onitemcommand="Repeater1_ItemCommand">
    <HeaderTemplate>
        <table id="tablist" width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="CTable">
      <tr align="center" class="title">
        	<td width="50" align="center">序号</td>
			<td width="50" align="center">选择</td>
        	<td align="center">用户名</td>
			<td align="center">总贡献值</td>
        	<td align="center">发送次数</td>
			  <%if(string.IsNullOrEmpty(KSCMS.S("TJ").ToString())){ %>
            <td align="center"> 最后发送时间 </td>
		
			  <td align="center"> 操作 </td>
			  	<%} %>
        </tr>
    </HeaderTemplate>
    <ItemTemplate>
      <tr class="tdbg" style="cursor:pointer;" onclick="jQuery('#s<%# Container.ItemIndex+1 %>').toggle();">
          <td class="splittd" style="text-align:center"> 
             <%# Container.ItemIndex+1 %>
          </td>
		    <td class="splittd" style="text-align:center"> 
           <input type="checkbox" name="ids" value="<%#Eval("ID") %>" />
          </td>
          <td class="splittd" style="text-align:center"> 
             <%# Eval("username") %>
          </td>
		    <td class="splittd" style="text-align:center"> 
           <%#Eval("contribution") %>
          </td>
          <td class="splittd" style="text-align:center"> 
             <%# Eval("sendtime") %>
          </td>
		  <%if(string.IsNullOrEmpty(KSCMS.S("TJ").ToString())){ %>
          <td class="splittd" style="text-align:center"> 
             <%# Eval("lasttime")%>
          </td>
		 
		  <td class="splittd" style="text-align:center">

		       <a href="?action=showrecord&sender=<%#Eval("username") %>" >查看记录</a>
              <asp:LinkButton runat="server"  id="delet" commandargument=<%# Eval("ID") %> commandname="del">删除</asp:LinkButton>

          </td>
		    <%} %>
      </tr>  
      <tbody id="s<%# Container.ItemIndex+1 %>" style="display:none">
      <tr class="tdbg">
     <%--  <td class="splittd" style="text-align:center">&nbsp;</td>
       <td class="splittd tips" colspan="4">
         <div class="tips"><strong>介绍：</strong> <%# Eval("Descript") %></div>
       </td>--%>
      
      </tr>
</tbody>
     </ItemTemplate>
     <FooterTemplate>
         <tr class="tdbg" style="display:<%# bool.Parse((MyContribution.Items.Count==0).ToString())?"":"none"%>">
                <td class="splittd" style="text-align:center" colspan="10">
                  没有记录！
                </td>
           </tr> 
      </table>
     </FooterTemplate>
    </asp:Repeater>

	</asp:Panel>

	<asp:Panel runat="server" ID="panel3">
	
	    <KS:KSGV ID="list1" cssclass="CTable" runat="server" AutoGenerateColumns="False" Width="99%" EmptyDataText="没有任何的记录!" GridLines="None" OnRowDataBound="list1_RowDataBound"   AllowPaging="True" OnPageIndexChanging="list1_PageIndexChanging" PageSize="20" >
        <Columns>
		  <asp:TemplateField HeaderText="选择">
               <itemstyle width="100" HorizontalAlign="Center" />
                <itemtemplate>
		       <input type="checkbox" name="ids" value="" />
                </itemtemplate>
            </asp:TemplateField>
			  <asp:TemplateField HeaderText="用户名">
               <itemstyle width="100" HorizontalAlign="Center" />
                <itemtemplate>
		           <%# Eval("sender") %>
                </itemtemplate>
            </asp:TemplateField>
			  <asp:TemplateField HeaderText="总贡献值">
               <itemstyle width="100" HorizontalAlign="Center" />
                <itemtemplate>
		          <%#Eval("contribution") %>
                </itemtemplate>
            </asp:TemplateField>
			  <asp:TemplateField HeaderText="总发送次数">
               <itemstyle width="100" HorizontalAlign="Center" />
                <itemtemplate>
		       <%# Eval("sendtime") %>
                </itemtemplate>
            </asp:TemplateField>
			  <asp:TemplateField HeaderText="总发送数量">
               <itemstyle width="100" HorizontalAlign="Center" />
                <itemtemplate>
		          <%# Eval("sendnum") %>
                </itemtemplate>
            </asp:TemplateField>
		</Columns>
		
		</KS:ksgv>

	</asp:Panel>

       
     <KS:Page ID="Page1" runat="server" />       
	     
</asp:Panel>

</div>

</asp:Content>


