<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" Inherits="Kesion.NET.WebSite.Admin.Course.KS_CourseChat" Codebehind="KS.CosChat.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">

    <asp:Panel ID="ChatListPanel" 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);
                };
            });
        });

        </script>
        <!--<div id="manage_top" class="menu_top_fixed">
            <%= Utils.StrToInt(KSCMS.S("courseid"))!=0?("课程："+getcoursename(Utils.StrToInt(KSCMS.S("courseid")))):"" %> 
        </div>
        <div class="menu_top_fixed_height"></div>-->
      
        <div class="content-area mt20 pageBlank">
            <div class="myTitle">
                学员提问  
            </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:ListItem Value="2">内容</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 class="property">
                	<div class="name button ml15">筛选</div>
                    <div class="propertyBox">
                    	<ul class="tabs clearfix">
                            <span class="screen fl">咨询对象：</span>
                            <li <%=KSCMS.S("chattype")==""?" class='active'":string.Empty %>><a href="KS.CosChat.aspx?courseid=<%=Utils.StrToInt(KSCMS.S("courseid")) %>&costype=<%=KSCMS.S("costype") %>"><span>所有</span></a></li>
                            <li <%=KSCMS.S("chattype")=="1"?" class='active'":string.Empty %>><a href="KS.CosChat.aspx?chattype=1&courseid=<%=Utils.StrToInt(KSCMS.S("courseid")) %>&costype=<%=KSCMS.S("costype") %>"><span>问名师</span></a></li>
                            <li <%=KSCMS.S("chattype")=="2"?" class='active'":string.Empty %>><a href="KS.CosChat.aspx?chattype=2&courseid=<%=Utils.StrToInt(KSCMS.S("courseid")) %>&costype=<%=KSCMS.S("costype") %>"><span>问客服</span></a></li>
                            <li <%=KSCMS.S("chattype")=="3"?" class='active'":string.Empty %>><a href="KS.CosChat.aspx?chattype=3&courseid=<%=Utils.StrToInt(KSCMS.S("courseid")) %>&costype=<%=KSCMS.S("costype") %>"><span>广播</span></a></li>
                       </ul>
                    </div>
                </div>
            </div>

            <asp:Repeater ID="ChatlistRepeater" runat="server" OnItemCommand="ChatlistRepeater_ItemCommand">
                <HeaderTemplate>
                <table width="100%" border="0" cellpadding="0" cellspacing="0" class="CTable no-borderTable">
                    <tr class="CTitle">
                        <td></td>
                        <td>所属者</td>
                        <td>类型</td>
                        <td>添加日期</td>
                        <td>课程信息</td>
                        <td>状态</td>
                        <td>内容</td>
                         <td>审核状态</td>
                        <td style="width: 50px">查看</td>
                        <td style="width: 50px">删除 </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("chatid") %>" />
                            </div>
                        </td>
                        <td class="Ctd" style="text-align: center"><%#Eval("username") %></td>
                        <td class="Ctd" style="text-align: center"><%#getchattype(Utils.StrToInt(Eval("chattype"))) %></td>
                        <td class="Ctd" style="text-align: center"><%#Eval("adddata") %></td>
                        <td class="Ctd" style="text-align: center"><%#getcoursename(Utils.StrToInt(Eval("courseid"))) %></td>
                        <td class="Ctd" style="text-align: center"><%#Utils.StrToInt(Eval("chatstatus"))==0?"<span style='color:red'>未解决</span>":"<span style='color:green'>已解决<span>" %></td>
                        <td class="Ctd" style="text-align: center"><%#Eval("chatcontent") %></td>
                        <td class="Ctd" style="text-align: center"><%#Eval("status").ToString()=="1"?"已审核":"未审核" %></td>
                        <td class="Ctd" style="text-align: center"><span style="color:blue">
                            <%#(Utils.StrToInt(Eval("chattype"))==99||Utils.StrToInt(Eval("chattype"))==100?"--":("<a class=look href='KS.CosChat.aspx?action=modify&courseid="+Eval("courseid")+"&chatid="+Eval("chatid")+"'>查看</a>")) %>
                        </td>
                        <td class="Ctd" style="text-align: center">
                            <span style="color:red">
                            	<asp:LinkButton ID="LinkButton2" CssClass="delete"  runat="server" CommandArgument=<%#Eval("chatid") %> 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>

        </div>
          


        <div class="listedit">
           
            <div class="floatLeft allCheck">
                <label><input name="" type="checkbox" value="" id="selectAll" />全选</label>
            </div>
          
            <ul class="fl">
                    <asp:LinkButton ID="delclassbutton" runat="server" OnClientClick="return(GetIDS('del'));" CssClass="button" OnClick="delclassbutton_Click">删除</asp:LinkButton>
                    <asp:LinkButton ID="LinkButton10" runat="server" OnClientClick="return(GetIDS());" CssClass="button" OnClick="LinkButton10_Click">批量审核</asp:LinkButton>
            </ul>
        </div>
        <div class="h20"></div>
        <asp:Label ID="LabPage" runat="server"></asp:Label>
    </asp:Panel>

    <asp:Panel ID="EditPanel" runat="server" Visible="false">
        <div class="content-area mt20">
            <div class="myTitle">
                <a href="javascript:;" class="fr button mr20" onclick="location.href='<%= MyCache.GetCacheConfig(0)+MyCache.GetCacheConfig(4) %>/Course/KS.CosChat.aspx'">返回</a>
                回复信息  
            </div>
            <table width="99%" border="0" cellpadding="0" cellspacing="0" class="CTable no-borderTable">
                 <tr class="CTitle"> 
                     <td class="lefttd" height="30" align="right" style="width:80px"><b>编号:</b></td>
                    <td class="righttd">  
                        <asp:Label ID="labchatid" runat="server" Text=""></asp:Label>
                    </td> 
                </tr>
                <tr >
                    <td class="lefttd" height="30" align="right" style="width:80px"><b>所属者:</b></td>
                    <td class="righttd">  
                        <asp:Label ID="labusername" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
                <tr >
                    <td class="lefttd" height="30" align="right" style="width:80px"><b>课程信息 :</b></td>
                    <td class="righttd"> 
                        <asp:Label ID="labcourse" runat="server" Text=""></asp:Label>
                    </td>  
                </tr>
                <tr >
                    <td class="lefttd" height="30" align="right" style="width:80px"><b>提问内容 :</b></td>
                    <td class="righttd">   
                        <asp:Label ID="chatconten" runat="server"></asp:Label>  
                    </td>   
                </tr>
                <tr >
                    <td class="lefttd" height="30" align="right" style="width:80px"><b>日期 :</b></td>
                    <td class="righttd"> 
                        <asp:Label ID="labdate" runat="server" Text=""></asp:Label>
                    </td>  
                </tr>
                <tr >
                    <td class="lefttd" height="30" align="right" style="width:80px"><b>状态 :</b></td>
                    <td class="righttd">   
                        <asp:Label ID="chatstatus" runat="server"></asp:Label>  
                        <asp:Button ID="Button1" CssClass="button ml15" runat="server" Text="设置为已解决" OnClick="Button1_Click" OnClientClick="return(confirm('确定设置为已解决么？已解决问题不可回复！'))" />
                    </td>  
                </tr>

                 <tr >
                    <td class="lefttd" height="30" align="right" style="width:80px"><b>审核状态 :</b></td>
                    <td class="righttd">   
                          <asp:Label ID="checkstatus" runat="server"></asp:Label>  
                          <asp:Button ID="btncheck" CssClass="button ml15" runat="server" Text="审核" OnClick="btncheck_Click" OnClientClick="return(confirm('确定设置为已审核？'))" />
                    </td>  
                </tr>

            <asp:Label ID="replay" runat="server" Text="Label"></asp:Label>
                <tr runat="server" id="showreplay">
                    <td class="lefttd" height="30" align="right" style="width:80px"><b>回复：</b></td>
                    <td class="righttd">
                        <asp:TextBox ID="replaycontent" Width="900px"  Height="150px" runat="server" TextMode="MultiLine" ></asp:TextBox></td>
                </tr>
            </table>
              
              <KS:Foot ID="Foot1" runat="server" OnSubmit="Foot1_Submit" HiddenIDText="0" />
        </div> 
            
    </asp:Panel>


</asp:Content>
