<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Admin/MasterPage.master" Inherits="Kesion.NET.WebSite.Course.Admin.Course.KS_TcAchieve" Codebehind="KS.TcAchieve.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){ %>
        
		<%if(teacherid!=0){ %>
            <div class="listedit">
                <ul>
                  
                   <a href="KS.CsTeacher.aspx" class="button">返回名师</a>
                   <asp:LinkButton ID="addclassbutton" runat="server" OnClick="BtnVerify_Click" OnClientClick="return(GetIDS());" CssClass="button">批量审核</asp:LinkButton>
                   <asp:LinkButton ID="editclassbutton" runat="server" OnClick="BtnUnVerify_Click" OnClientClick="return(GetIDS());" CssClass="button">取消审核</asp:LinkButton>
                   <asp:LinkButton ID="delclassbutton" runat="server" OnClientClick="return(GetIDS('del'));" OnClick="delclassbutton_Click" CssClass="button">删除</asp:LinkButton>
                </ul>
            </div>
        <%}else{ %>
            <div id="manage_top" class="menu_top_fixed">
                <ul class="titleTab">
                    <li class="curr"><a href="KS.TcAchieve.aspx">名师评价</a></li>
                    <li><a href="KS.TcMessage.aspx">名师留言</a></li>
                </ul>
            </div>
            <div class="menu_top_fixed_height"></div> 
        <%}%>
        <%if(teacherid!=0){ %>
            <!--当前讲师信息-->
            <div class="courseInfoTop teacherInfoTop">
              <asp:PlaceHolder ID="PlaceHolder1"  runat="server"></asp:PlaceHolder> 
            </div>
            <div class="clear blank20"></div>
        <%} %>
    <%} %>
    <div class="content-area pageBlank"> 
        <%if(istop==0){ %>
        <div class="myTitle">
            <%if(teacherid!=0){ %>
             <div class="tabButton">
                <a href="KS.TcCourse.aspx?teacherid=<%=teacherid %>&from=<%=from %>">课程</a>
                <a href="KS.TcZan.aspx?teacherid=<%=teacherid %>&from=<%=from %>">点赞</a>
                <a href="KS.TcCollect.aspx?teacherid=<%=teacherid %>&from=<%=from %>">收藏</a>
                <a href="KS.TcMessage.aspx?teacherid=<%=teacherid %>&from=<%=from %>">留言</a>
                <a class="on" href="KS.TcAchieve.aspx?teacherid=<%=teacherid %>&from=<%=from %>">评价</a>
                <a href="KS.TcDegreeCertificate.aspx?teacherid=<%=teacherid%>&from=<%=from %>" >学历证书</a>
                <a href="KS.TcProfessionCertificate.aspx?teacherid=<%=teacherid%>&from=<%=from %>">职业资格证书</a>
            </div>
            <%} %>
            名师评价
            <!--<asp:Label ID="LabNav" runat="server"></asp:Label>-->
        </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:ListItem Value="3">教师姓名</asp:ListItem>
                     <asp:ListItem Value="4">发表内容</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" 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>
            <div class="property">
                <div class="name button ml15">筛选</div>
                <div class="propertyBox">
                    <ul class="tabs clearfix">
                        <span class="screen fl">审核状态：</span>
                        <li <%=KSCMS.S("Type")==""?" class='active'":string.Empty %>><a href="KS.TcAchieve.Aspx?teacherid=<%=teacherid %>"><span>所有列表</span></a></li>
                        <li <%=KSCMS.S("Type")=="1"?" class='active'":string.Empty %>><a href="KS.TcAchieve.Aspx?Type=1&teacherid=<%=teacherid %>"><span>未审核</span></a></li>
                        <li <%=KSCMS.S("Type")=="2"?" class='active'":string.Empty %>><a href="KS.TcAchieve.Aspx?Type=2&teacherid=<%=teacherid %>"><span>已审核</span></a></li>
                    </ul>
                </div>
            </div>
        </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="选择">
                    <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")%>&teacherid=<%#teacherid %>" <%# 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="100px" />
                    <itemtemplate> 
                    <img src="/SysImg/star/star-<%#Eval("PJstar") %>.jpg" style="height:14px;" title="<%# Eval("PJstar") %>颗星" />
                    </itemtemplate>
                </asp:TemplateField>
                
                 <asp:TemplateField HeaderText="评价内容">
                <itemstyle  horizontalalign="Center" width="450px" />
                    <itemtemplate> 
                    <%#Utils.CutStr(Eval("PJcontent").ToString(),50) %>
                    </itemtemplate>
                </asp:TemplateField>
                 <asp:TemplateField HeaderText="教师名称">
                <itemstyle  horizontalalign="Center" width="100px" />
                    <itemtemplate> 
                    <%# Eval("tcname") %>
                    </itemtemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="评价日期">
                <itemstyle  horizontalalign="Center" width="100px" />
                    <itemtemplate> 
                    <%#Eval("PJdate") %>
                    </itemtemplate>
                </asp:TemplateField>
                
               
                <asp:TemplateField HeaderText="查看">
                    <itemstyle horizontalalign="Center" Width="20"/>
                 <itemtemplate>
                 
                  <asp:LinkButton runat="server" id="showBtn" CssClass="showBtn" title="查看详情" commandargument=<%#Eval("ID") %> commandname="show"></asp:LinkButton>
                </itemtemplate>
                </asp:TemplateField>
    
                 <asp:TemplateField HeaderText="删除">
                    <itemstyle horizontalalign="Center" Width="20"/>
                 <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>
        <%if(teacherid==0){ %>
            <div class="listedit">
                <label><input type="checkbox" name="chkall" id="chkall" onclick="CheckAll(this.form);"/>全选</label>
                <asp:Button ID="BtnVerify" CssClass="button" runat="server" OnClick="BtnVerify_Click" OnClientClick="return(GetIDS());" text="批量审核"></asp:Button>
                <asp:Button ID="Btnedit" CssClass="button" runat="server" OnClick="BtnUnVerify_Click" OnClientClick="return(GetIDS());" Text="取消审核"></asp:Button>
                <asp:Button ID="Btndel" CssClass="button" runat="server" OnClientClick="return(GetIDS('del'));" OnClick="delclassbutton_Click" Text="删除"></asp:Button>
            </div>
        <%}%>
    </div>
    <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 mt20">    
		 <div class="myTitle">查看评价详情</div>
         <table width="99%" border="0" cellpadding="0" cellspacing="0" class="CTable no-borderTable"> 
		    <tr style="display:none">
                 <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;">
				 <%=dr["tcname"].ToString () %>
				
                 </td>
             </tr>
             <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>评价时间：</strong></td>
                 <td class="righttd" style="height: 30px;"><%=dr["PJdate"].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;">
                     <img src="/SysImg/star/star-<%=dr["PJstar"].ToString () %>.jpg" title="<%= dr["PJstar"].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["PJcontent"].ToString().Replace("\n","<br/>")%></textarea>
					<input type="hidden" name="talkcontent" value=" <%=dr["PJcontent"].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 class='redFont' onclick=\"savestatus(0)\">未审核</span>");
                     }
                     else
                     {
                         Response.Write("<span class='greenFont' 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>


