<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Admin/MasterPage.master" Inherits="Kesion.NET.WebSite.Course.Admin.Course.KS_CourseTalk" Codebehind="KS.CosTalk.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); };
 	}
 </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='p11'><asp:LinkButton ID="addclassbutton" runat="server" OnClick="BtnVerify_Click" OnClientClick="return(GetIDS());"><b></b>批量审核</asp:LinkButton></li>
       
           <li id='p2'><asp:LinkButton ID="editclassbutton" runat="server" OnClick="BtnUnVerify_Click" OnClientClick="return(GetIDS());"><b></b>取消审核</asp:LinkButton></li>
           <li id='p3'><asp:LinkButton ID="delclassbutton" runat="server" OnClientClick="return(GetIDS('del'));" OnClick="delclassbutton_Click" ><b></b>删除讨论</asp:LinkButton></li>        
           </ul>
        </div> 
 <div class="menu_top_fixed_height"></div>       
 <div class="content-area">       
    <div class="myTitle">
   		<div class="quickSearch">
       <%-- 发表者：<asp:TextBox CssClass="textbox" ID="TxtKeyWord" runat="server"></asp:TextBox>&nbsp;--%>
       
       快速搜索：
                <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 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="Button1" runat="server" Text=" 搜索 "  CssClass="button"  onclick="Button1_Click" />
            </div>
            直播学员讨论管理<!--<asp:Label ID="LabNav" runat="server"></asp:Label>-->
</div>
    <div class="tabs_header">
            <ul class="tabs">
                <li <%=KSCMS.S("Type")==""?" class='active'":string.Empty %>><a href="KS.CosTalk.aspx"><span>所有列表</span></a></li>
                <li <%=KSCMS.S("Type")=="1"?" class='active'":string.Empty %>><a href="KS.CosTalk.aspx?Type=1"><span>未审核</span></a></li>
                <li <%=KSCMS.S("Type")=="2"?" class='active'":string.Empty %>><a href="KS.CosTalk.aspx?Type=2"><span>已审核</span></a></li>

            </ul>
        </div>
    <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="30px" HorizontalAlign="Center" />
                    <ItemTemplate>
                         <a href="?action=verify&PJID=<%#Eval("ID")%>" <%# Convert.ToString(Eval("status"))=="0"?"class='no' title='未审核'":"class='ok' title='已审核'" %>></a>
                    </ItemTemplate>
                </asp:TemplateField>
            <asp:TemplateField HeaderText="用户名称">
               <itemstyle width="60" HorizontalAlign="Center" />
                <itemtemplate>
				<%#Eval("username") %>
               <%--<%# Convert.ToString(Eval("status"))== "1" ?"<font color=green>已审核</font>":"<font color=red>未审核</font>" %>--%>
                </itemtemplate>
            </asp:TemplateField>

             <asp:TemplateField HeaderText="发表内容">
            <itemstyle  horizontalalign="Center" width="450px" />
                <itemtemplate> 
                <%# Kesion.Course.ReplaceContent.ReplaceEmot(Eval("talkcontent").ToString()) %>
                </itemtemplate>
            </asp:TemplateField>
            
             <asp:TemplateField HeaderText="发表时间">
            <itemstyle  horizontalalign="Center" width="100px" />
                <itemtemplate> 
                <%# Eval("adddate") %>
                </itemtemplate>
            </asp:TemplateField>
            
           
            <asp:TemplateField HeaderText="↓管理操作">
                <itemstyle horizontalalign="Center" Width="100"/>
             <itemtemplate>
             <asp:LinkButton runat="server"  CssClass="delete" id="delet" commandargument=<%# Eval("ID") %> commandname="del">删除</asp:LinkButton>

              <asp:LinkButton runat="server" id="showBtn" CssClass="showBtn" title="查看详情" commandargument=<%#Eval("ID") %> commandname="show"></asp:LinkButton>
            </itemtemplate>
            </asp:TemplateField>

        </Columns>
        <HeaderStyle CssClass="CTitle" />
        <EmptyDataRowStyle CssClass="emptycss" />
    </KS:ksgv>
       
     <KS:Page ID="Page1" runat="server" />            
</asp:Panel>
<asp:Panel runat="server" ID="showPannel" Visible="false">
    <KS:TopNav ID="top1" Text="查看评价详情"  runat ="server" />
    <div class="content-area">      
		 <table width="99%" border="0" cellpadding="1" cellspacing="1" class="CTable"> 
		    <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>编号：</strong></td>
                 <td class="righttd" style="height: 30px;">
				  <input type="text" readonly="true" style="border:none" name="courseID" value="<%=dr["ID"].ToString() %>" />
                 </td>
             </tr>
             <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>课程名称：</strong></td>
                 <td class="righttd" style="height: 30px;">
				 <%=GetCourseName(Utils.StrToInt(dr["CourseID"].ToString ())) %>
				
                 </td>
             </tr>
             <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>发表时间：</strong></td>
                 <td class="righttd" style="height: 30px;"><%=DataFactory.GetOnlyValue("select top 1 adddate from KS_CosUsertalk where ID='"+dr["ID"].ToString()+"'") %>
                 </td>
             </tr>
		    <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>发表人：</strong></td>
                 <td class="righttd" style="height: 30px;"><%=dr["username"].ToString() %>
                 </td>
             </tr>
		    <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>发表内容：</strong></td>
                 <td class="righttd imgtd" style="height: 30px;">
					<%=Kesion.Course.ReplaceContent.ReplaceEmot(dr["talkcontent"].ToString().Replace("\n","<br/>"))%>
			
                 </td>
             </tr>

			<style>
				.imgtd img{height:40px;margin:10px 0px 0px 10px;}
			</style>
		    <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>状态:</strong></td>
				 
                 <td class="righttd" id="showstatus" style="height: 30px;">
                 <%
                     if (dr["Status"].ToString() == "0")
                     {
                         Response.Write("<span style='color:red' onclick=\"savestatus(0)\">未审核</span>");
                     }
                     else
                     {
                         Response.Write("<span style='color:blue' onclick=\"savestatus(1)\">已审核</span>");
                     }
                  %>
				
                 </td>
             </tr>
     <input type="hidden" id="status" name="status" value="">
		 </table>

         
    <KS:Foot ID="Foot1" runat="server" OnSubmit="Foot1_Submit" />
		  
		</div>
		</asp:Panel>
</div>

</asp:Content>