<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true"  Inherits="Kesion.NET.WebSite.Admin.Course.KS_CourseInteractRecord" Codebehind="KS.CosInteractRecord.aspx.cs" %>

<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.Data" %>
<%@ 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 () {
               //全选反选
               $("#selectAll").click(function () {
                   if ($(this).is(":checked")) {
                       $(".courseList").find("input[type=checkbox]").attr("checked", true);//从父标签开始找
                   }
                   else {
                       $(".courseList").find("input[type=checkbox]").attr("checked", false);
                   };
               });
               $("#selectinfo").click(function () {
                   if ($(this).is(":checked")) {
                       $(".infolist").find("input[type=checkbox]").attr("checked", true);//从父标签开始找
                   }
                   else {
                       $(".infolist").find("input[type=checkbox]").attr("checked", false);
                   };
               });
           });
        </script>
        <div class="listedit">
            <ul>
             <label class="noPadRight"><input name="" type="checkbox" value="" id="selectAll" /> 全选</label>
             <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click" OnClientClick="return(confirm('确定删除选中的记录么？此操作不可逆，请谨慎操作！'));" CssClass="button">批量删除</asp:LinkButton>
            </ul>
        </div>
      
        <div class="content-area mt20 pageBlank">
            <div class="tabs_header">
                <ul class="tabs">
                    <li <%=(string.IsNullOrEmpty(KSCMS.S("chattype")))?" class='active'":string.Empty %>><a href="KS.CosInteractRecord.aspx"><span>学员获得的学习礼物（点播）</span></a></li>
                    <li <%=(KSCMS.S("chattype")=="100")?" class='active'":string.Empty %>><a href="KS.CosInteractRecord.aspx?chattype=100"><span>学员送出的礼物（直播）</span></a></li>
                </ul>
            </div>
			<div class="quickSearch clearfix">
                <div class="SearchBox fl">
                    <asp:DropDownList ID="Condition" runat="server" style="margin-right:8px;">
                        <asp:ListItem Value="1">用户名</asp:ListItem>  
                    </asp:DropDownList>
                    <asp:TextBox onfocus="keyWordFocus();" onblur="keyWordBlur();" Style="color: #ccc"  Text="" placeholder="请输入关键字！" CssClass="textbox" ID="KeyWord" runat="server" Width="180px"></asp:TextBox>
                    <b onclick="SetDate()" class="link-color">日期范围？</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="Button2" runat="server" Text="开始搜索 " CssClass="button" OnClick="Button2_Click"/>
                </div>
            </div>
            <asp:Repeater ID="ChatlistRepeater" runat="server" OnItemCommand="ChatlistRepeater_ItemCommand">
                <HeaderTemplate>
                    <table width="100%" border="0" cellpadding="1" cellspacing="1" class="CTable">
                        <tr class="CTitle">
                            <td></td>
                            <td>用户</td>
                            <td>类型</td>
                            <td>道具类型</td>
                            <td>记录日期</td>
                            <td>课程信息</td> 
                            <td>观看时间点</td> 
                            <td>备注</td> 
                            <td>删除</td> 
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr onmouseover="this.className=&#39;CtrMouseOver&#39;" onmouseout="this.className=&#39;CtrMouseOut&#39;" onclick="chk(this)">
                        <td class="courseList" style="text-align: center">
                            <div class="input">
                                <input type="checkbox" name="ids" id="ids" value="<%#Eval("id") %>" />
                            </div>
                        </td>
                        <td class="Ctd" style="text-align: center"><%#Eval("username") %></td>
                        <td class="Ctd" style="text-align: center"><%#getchattype(Utils.StrToInt(KSCMS.S("chattype"))) %></td>
                        <td class="Ctd" style="text-align: center"><%#getdianbotype(Utils.StrToInt(Eval("proptype")),Utils.StrToInt(Eval("gametype"))) %></td>
                        <td class="Ctd" style="text-align: center"><%#Eval("adddate") %></td>
                        <td class="Ctd" style="text-align: center"><%#getcoursename(Utils.StrToInt(Eval("courseid"))) %></td>
                        <td class="Ctd" style="text-align: center"><%#(Utils.StrToInt(Eval("times").ToString())/60) %>分钟</td>
                        <td class="Ctd" style="text-align: center"><%#getremark(Eval("remark").ToString()) %></td>
                      	<td class="Ctd" style="text-align: center"><span style="color:red">
                            <asp:LinkButton ID="LinkButton2" CssClass="delete"  runat="server" CommandArgument=<%#Eval("id") %> CommandName="delete" OnClientClick="return(confirm('确定删除提问记录么？此操作不可逆，请谨慎操作！'));">删除</asp:LinkButton></span></td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    <tr style="display: <%# bool.Parse((ChatlistRepeater.Items.Count==0).ToString())?"":"none"%>">
                        <td align="center" colspan="10">
                            <div class="empty">
                                没有查询到记录
                            </div>
                        </td>
                    </tr>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
            
            <asp:Repeater ID="livepropRepeater" runat="server" Visible="false">
                <HeaderTemplate>
                    <table width="100%" border="0" cellpadding="1" cellspacing="1" class="CTable">
                        <tr class="CTitle">
                            <td></td>
                            <td>用户</td>
                            <td>类型</td>
                            <td>直播道具</td> 
                            <td>赠送数量</td>
                            <td>赠送价值</td>
                            <td>被赠送对象</td>
                            <td>赠送日期</td>
                            <td>课程信息</td> 
                            <td>删除</td> 
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr onmouseover="this.className=&#39;CtrMouseOver&#39;" onmouseout="this.className=&#39;CtrMouseOut&#39;" onclick="chk(this)">
                        <td class="courseList" style="text-align: center">
                            <div class="input">
                                <input type="checkbox" name="ids" id="ids" value="<%#Eval("id") %>" />
                            </div>
                        </td>
                        <td class="Ctd" style="text-align: center"><%#Eval("username") %></td>
                        <td class="Ctd" style="text-align: center"><%#getchattype(Utils.StrToInt(KSCMS.S("chattype"))) %></td>
                        <td class="Ctd" style="text-align: center"><%#getremark(Eval("remark").ToString()) %></td>
                        <td class="Ctd" style="text-align: center"><%#Eval("sendnum").ToString() %></td>
                        <td class="Ctd" style="text-align: center"><%#getcashmoney(Utils.StrToInt(Eval("remark").ToString()),Utils.StrToInt(Eval("sendnum").ToString())) %>元</td>
                        <td class="Ctd" style="text-align: center"><%#Eval("acepter").ToString() %></td>
                        <td class="Ctd" style="text-align: center"><%#Eval("adddate") %></td>
                        <td class="Ctd" style="text-align: center"><%#getcoursename(Utils.StrToInt(Eval("courseid"))) %></td>
                      <td class="Ctd" style="text-align: center"><span style="color:red">
                            <asp:LinkButton ID="LinkButton2" CssClass="delete"  runat="server" CommandArgument=<%#Eval("id") %> CommandName="delete" OnClientClick="return(confirm('确定删除提问记录么？此操作不可逆，请谨慎操作！'));">删除</asp:LinkButton></span></td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    <tr style="display: <%# bool.Parse((livepropRepeater.Items.Count==0).ToString())?"":"none"%>">
                        <td align="center" colspan="10">
                            <div class="empty">
                                没有查询到记录
                            </div>
                        </td>
                    </tr>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
        </div>

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