<%@ Page Language="C#" Debug="true" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="True" Inherits="Kesion.NET.WebSite.Course.Admin_Course_CosClassPJ" Codebehind="KS.CosClassPJ.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 look(id, way) {
         if (way == "1") {
         window.open("/Course/View.aspx?id=" + id, "课时详情");
         }else {
             window.open("/Course/FaceView.aspx?id=" + id, "课时详情");
         }
  }
  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('请输入关键字！');
            }
        }


 </script> 
     <asp:Panel ID="ListPanel" runat="server" Width="100%">
    <%if(istop==0){ %>
  	<div class="listedit">
       	<ul>
          	<%if (RoomID != 0)
       		{%>
           	<a onclick="history.back();return false;" class="button">返回班级列表</a>
           	<%} %>
           	<asp:LinkButton ID="addclassbutton" runat="server" OnClick="BtnVerify_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> 
      <!--当前课程信息-->
    
    <asp:PlaceHolder ID="PlaceHolder1"  runat="server"></asp:PlaceHolder> 

	<%} %>
   <div class="content-area mt20">      
    <!--<div class="myTitle">
        课程评价
    </div>-->
    <div class="tabs_header">
        <ul class="tabs">
            <li <%=KSCMS.S("type")==""?" class='active'":string.Empty %>><a href="KS.CosClassPJ.Aspx?RoomID=<%=RoomID %>&CosType=<%=CosType %>&teacherid=<%=teacherid %>"><span>所有列表</span></a></li>
            <li <%=KSCMS.S("type")=="1"?" class='active'":string.Empty %>><a href="KS.CosClassPJ.Aspx?type=1&RoomID=<%=RoomID %>&CosType=<%=CosType %>"><span>未审核</span></a></li>
            <li <%=KSCMS.S("type")=="2"?" class='active'":string.Empty %>><a href="KS.CosClassPJ.Aspx?type=2&RoomID=<%=RoomID %>&CosType=<%=CosType %>"><span>已审核</span></a></li>
        </ul>
    </div>
    <div class="quickSearch clearfix">
        <asp:DropDownList ID="Condition" runat="server" Style="margin-right:8px;">
            <asp:ListItem Value="2">评价人</asp:ListItem>
            <asp:ListItem Value="3">评价内容</asp:ListItem>
        </asp:DropDownList>
        <asp:TextBox onfocus="keyWordFocus();" onblur="keyWordBlur();" CssClass="textbox" ID="KeyWord" runat="server" Width="180px"></asp:TextBox>

        <span class="link-color" onclick="SetDate()" style="cursor: pointer">日期范围？</span>
        <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("PJID") %>" />
                </itemtemplate>
            </asp:TemplateField>

             <asp:TemplateField HeaderText="状态">
                    <ItemStyle Width="20px" HorizontalAlign="Center" />
                    <ItemTemplate>
                         <a href="?action=verify&PJID=<%#Eval("PJID")%>&RoomID=<%#RoomID %>&CosType=<%#CosType %>&teacherid=<%#teacherid %>" <%# Convert.ToString(Eval("status"))=="0"?"class='no' title='未审核'":"class='ok' title='已审核'" %>></a>
                    </ItemTemplate>
                </asp:TemplateField>
        
             <asp:TemplateField HeaderText="评价人">
            <itemstyle  Width="20px" HorizontalAlign="Center"  />
                <itemtemplate> 
                <%# Eval("UserName") %>
                </itemtemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="评价">
            <itemstyle  Width="40px" HorizontalAlign="Center"   />
                <itemtemplate> 
                <%# Eval("CmtType").ToString ()=="0"?"好评":Eval("CmtType").ToString ()=="1"?"中评":"差评"%>
                </itemtemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="评价内容">
            <itemstyle  Width="40px" />
                <itemtemplate> 
                <%# Utils.CutStr(Convert.ToString(Eval("CosContent")), 25)%>
                </itemtemplate>
            </asp:TemplateField>
            
             <asp:TemplateField HeaderText="评价时间">
            <itemstyle  Width="68px" HorizontalAlign="Center" />
                <itemtemplate>
                     <%#Convert.ToDateTime(Eval("adddate").ToString()).ToString("yyyy-MM-dd")%> 
                </itemtemplate>
            </asp:TemplateField>
              <asp:TemplateField HeaderText="班级星级">
            <itemstyle Width="65px" HorizontalAlign="Center"  />
                <itemtemplate> 
                    <%# Eval("EpStartNum").ToString()==string.Empty?"-":  "<img src=\"/SysImg/star/star-"+Eval("EpStartNum")+".jpg\" title=\""+ Eval("EpStartNum") +"颗星\" /> "%>
                </itemtemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="课程星级">
            <itemstyle Width="65px" HorizontalAlign="Center"  />
                <itemtemplate> 
                 <img class='starImg' src="/SysImg/star/star-<%# Eval("Cosnumber") %>.jpg" title="<%# Eval("Cosnumber") %>颗星" />
                </itemtemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="删除">
                <itemstyle Width="20px" HorizontalAlign="Center" />
             <itemtemplate>
             <asp:LinkButton runat="server"  CssClass="delete" id="delet" commandargument=<%# Eval("PJID") %> commandname="del">删除</asp:LinkButton>
            </itemtemplate>
            </asp:TemplateField>
           
        </Columns>
        <HeaderStyle CssClass="CTitle" />
        <EmptyDataRowStyle CssClass="emptycss" />
    </KS:ksgv>
       
     <KS:Page ID="Page1" runat="server" />            
</asp:Panel>
</div>
<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"> 
               <%if (Kesion.Course.Course.IsMoreEdu() && DataFactory.GetOnlyValue("select top 1 companyname from KS_EnterPrise where id=" + dr["EpID"].ToString())!="0")
                 { %>
              <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 companyname from KS_EnterPrise where id="+dr["EpID"].ToString())=="0"?"官方平台":DataFactory.GetOnlyValue("select top 1 companyname from KS_EnterPrise where id="+dr["EpID"].ToString())%> </td>
             </tr>
             <%} %>
		    <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>订单号：</strong></td>
                 <td class="righttd" style="height: 30px;"><%=dr["orderid"].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 ()),Utils.StrToInt(dr["ordertype"].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 PayTime from KS_CosOrder where orderid='"+dr["orderid"].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;"><%=dr["AddDate"].ToString()%>
                 </td>
             </tr>
           
		    <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>评价内容：</strong></td>
                 <td class="righttd" style="height: 30px;"><%=dr["CosContent"].ToString().Replace("\n","<br/>")%>
                 </td>
             </tr>
                <%if (Kesion.Course.Course.IsMoreEdu() && DataFactory.GetOnlyValue("select top 1 companyname from KS_EnterPrise where id=" + dr["EpID"].ToString()) != "0")
                  { %>
              <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["EpStartNum"] %>.jpg" title="<%=dr["EpStartNum"] %>颗星" /> </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["Cosnumber"] %>.jpg" title="<%=dr["Cosnumber"] %>颗星" /> </td>
             </tr>
		    <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>评价等级：</strong></td>
                 <td class="righttd" style="height: 30px;">
                 <%
                     if (dr["CmtType"].ToString() == "0")
                     {
                         Response.Write("<span style='color:Green'>好评</span>");
                     }
                     else if (dr["CmtType"].ToString() == "1")
                     {
                         Response.Write("<span style='color:Purple'>中评</span>");
                     }
                     else
                     {
                         Response.Write("<span style='color:blue'>差评</span>");
                     }
                  %>
                 </td>
             </tr>
		    <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>状态：</strong></td>
                 <td class="righttd" style="height: 30px;">
                 <%
                     if (dr["Status"].ToString() == "0")
                     {
                         Response.Write("<span style='color:red'>未审核</span>");
                     }
                     else
                     {
                         Response.Write("<span style='color:blue'>已审核</span>");
                     }
                  %>
                 </td>
             </tr>
            
		 </table>

         <div style="margin-top:20px;text-align:center">
          <input type="button" name="backBtn" class="button" value=" 返 回 " onclick="history.back()" />
         </div>

		</asp:Panel>
</div>

</asp:Content>
