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

<%@ Import Namespace="Kesion.Publics" %>
<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.BLL" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="Kesion.Course" %>
<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%">  
    <%if(istop==0){ %>
        <div class="listedit">
            <ul>
                <a href="KS.CsTeacher.aspx" class="button">返回名师</a>
                <asp:LinkButton ID="delclassbutton" runat="server" OnClientClick="return(GetIDS('del'));" OnClick="delclassbutton_Click" CssClass="button">删除收藏</asp:LinkButton>
            </ul>
        </div> 
        <!--当前讲师信息-->
        <div class="courseInfoTop teacherInfoTop">
            <asp:PlaceHolder ID="PlaceHolder1"  runat="server"></asp:PlaceHolder>           
        </div>
        <div class="clear blank20"></div>
    <%} %>
    <%if(istop==0){ %>          
    <div class="content-area">           
        <div class="myTitle">
            <div class="tabButton">
                <a href="KS.TcCourse.aspx?teacherid=<%=TcID %>&from=<%=from %>">课程</a>
                <a href="KS.TcZan.aspx?teacherid=<%=TcID %>&from=<%=from %>">点赞</a>
                <a class="on" href="KS.TcCollect.aspx?teacherid=<%=TcID %>&from=<%=from %>">收藏</a>
                <a href="KS.TcMessage.aspx?teacherid=<%=TcID %>&from=<%=from %>">留言</a>
                <a href="KS.TcAchieve.aspx?teacherid=<%=TcID %>&from=<%=from %>">评价</a>
                <a href="KS.TcDegreeCertificate.aspx?teacherid=<%=TcID%>&from=<%=from %>" >学历证书</a>
                <a href="KS.TcProfessionCertificate.aspx?teacherid=<%=TcID%>&from=<%=from %>">职业资格证书</a>
            </div>
            名师收藏
        </div>
        <div class="quickSearch">
            <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="请输入关键字！" CssClass="textbox" ID="KeyWord" runat="server" Width="180px"></asp:TextBox>
            <b 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" />
        </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="200" 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="200px" />
                <itemtemplate> 
                <%# gettname(Utils.StrToInt(Eval("infoid"))) %>
                </itemtemplate>
            </asp:TemplateField>
             <asp:TemplateField HeaderText="收藏日期">
            <itemstyle  horizontalalign="Center" width="200px" />
                <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="myTitle">查看评价详情</div>
        <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_UserTalk 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" style="height: 30px;">
                    <textarea name="TextArea1" style="width:500px;" cols="20" rows="5"><%=dr["talkcontent"].ToString().Replace("\n","<br/>")%></textarea>
                    <input type="hidden" name="talkcontent" value=" <%=dr["talkcontent"].ToString().Replace("\n","<br/>")%>" />
                </td>
            </tr>
            <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>
    
        <div style="margin-top:20px;text-align:center">
            <KS:Foot ID="Foot1" runat="server" OnSubmit="Foot1_Submit" />
        </div>
    </asp:Panel>
</div>

</asp:Content>


