<%@ Page Language="C#" Debug="true" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="True" Inherits="Kesion.NET.WebSite.Course.Admin_Course_CoursePJ" Codebehind="KS.CosPJ.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>
           <div class="floatLeft allCheck">
                <label><input type="checkbox" name="chkall" id="chkall" onclick="CheckAll(this.form);"/>全选</label>
            </div>
           <%if (mycourseid != 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> 
    <div class="menu_top_fixed_height  <%if (mycourseid != 0){%>menu_top_fixed_height2<%} %>" style="display:none;"></div>  
      
      
      <!--当前课程信息-->
    
        <asp:PlaceHolder ID="PlaceHolder1"  runat="server"></asp:PlaceHolder> 
   

<%} %>
   <div class="content-area <%=CosType==0?"mt20":""%>">      
    <div class="myTitle" style="display:none">
         课程评价<!--<asp:Label ID="LabNav" runat="server"></asp:Label>-->
    </div>
    <div class="tabs_header">
            <%if (mycourseid != 0)
           	{%>
            <div class="tabButton">
                  <%if (Course.GetIsPeriod(mycourseid) == 1)
                    { %>
                  <%if(CosType==1){ %>
                    <a class="noLeftBorder" href="KS.CosPeriod.Aspx?teacherid=<%=teacherid%>&CourseId=<%=mycourseid %>">课时</a>
                  
                  <%}
                    else if (CosType == 3)
                    {%>
    
                      <a class="noLeftBorder"  href="KS.CosLivePeriod.Aspx?teacherid=<%=teacherid%>&CourseId=<%=mycourseid %>">课时</a>
                    
    
                   <% }%>
                <%} %>
                   <%if(CosType==1){ %>
                    
                    <a  href="KS.CsTeacher.aspx?CosType=<%=CosType %>&teacherid=<%=teacherid%>&CourseId=<%=mycourseid %>">教师</a>
                  <%}
                    else if (CosType == 3)
                    {%>
    
                     
                      <a  href="KS.CsTeacher.aspx?CosType=<%=CosType %>&teacherid=<%=teacherid%>&CourseId=<%=mycourseid %>">教师</a>
    
                   <% }%>

                 <%if (CosType ==2)
                   { %>
                <a  href="KS.FaceSignUp.aspx?CourseId=<%=mycourseid %>&teacherid=<%=teacherid%>&type=1&CosType=2">已报名</a>
                 <a  href="KS.CosFaceExamlist.aspx?courseid=<%=mycourseid %>&teacherid=<%=teacherid%>&CosType=2&type=1">试卷</a>
              
                  <a  href="KS.CsTeacher.aspx?CosType=<%=CosType %>&teacherid=<%=teacherid%>&CourseId=<%=mycourseid %>&type=1">教师</a>

                <%} %>
                    <a  href="KS.CsZLInfo.aspx?type=<%=CosType==2?"1":CosType==1?"0":"5"%>&CourseId=<%=mycourseid %>&teacherid=<%=teacherid%>&CosType=<%=CosType %>">资料</a>
                  <%if(CosType==1){ %>
                    <a  href="KS.CosExamlist.aspx?CourseId=<%=mycourseid %>&teacherid=<%=teacherid%>">试卷</a>
                <%} %>
                 <%if(CosType==1||CosType==3){ %>  
                     <a href="KS.CosLearnRecord.aspx?CosType=<%=CosType %>&courseid=<%=mycourseid %>&teacherid=<%=teacherid%>">学员</a>
                 <%} %>
                     <a class="on" href="KS.CosPJ.aspx?CosType=<%=CosType %>&courseid=<%=mycourseid %>&teacherid=<%=teacherid%>&type=<%=CosType==2?"1":CosType==1?"0":"5"%>">评价</a>
                    
             </div>
          	<%} %>
            <ul class="tabs">
                <li <%=KSCMS.S("type")==""?" class='active'":string.Empty %>><a href="KS.CosPJ.aspx?courseid=<%=mycourseid %>&CosType=<%=CosType %>&teacherid=<%=teacherid %>"><span>所有列表</span></a></li>
                <li <%=KSCMS.S("type")=="1"?" class='active'":string.Empty %>><a href="KS.CosPJ.aspx?type=1&courseid=<%=mycourseid %>&CosType=<%=CosType %>"><span>未审核</span></a></li>
                <li <%=KSCMS.S("type")=="2"?" class='active'":string.Empty %>><a href="KS.CosPJ.aspx?type=2&courseid=<%=mycourseid %>&CosType=<%=CosType %>"><span>已审核</span></a></li>
                <%if (CosType== 0)
                  { %>
               	<li <%=KSCMS.S("type")=="3"?" class='active'":string.Empty %>><a href="KS.CosPJ.aspx?type=3"><span>点播课程</span></a></li>
                <li <%=KSCMS.S("type")=="4"?" class='active'":string.Empty %>><a href="KS.CosPJ.aspx?type=4"><span>面授课程</span></a></li>
                <li <%=KSCMS.S("type")=="5"?" class='active'":string.Empty %>><a href="KS.CosPJ.aspx?type=5"><span>直播课程</span></a></li>
                <%} %>
            </ul>
        </div>
        <%if(istop==0){ %>
            <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: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>
            </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")%>&mycourseid=<%#mycourseid %>&CosType=<%#CosType %>&teacherid=<%#teacherid %>" <%# Convert.ToString(Eval("status"))=="0"?"class='no' title='未审核'":"class='ok' title='已审核'" %>></a>
                    </ItemTemplate>
                </asp:TemplateField>
            <asp:TemplateField HeaderText="课程名称">
               <itemstyle Width="180px" />
                <itemtemplate>
               <div class="td-ltitle">
               <a href="<%# GetUrl(Utils.StrToInt(Eval("OrderType").ToString()),Utils.StrToInt(Eval("CourseID").ToString())) %>" target="_blank"><span class="doc_1"></span><%#GetCourseName(Utils.StrToInt(Eval("CourseID").ToString ()),Utils.StrToInt(Eval("ordertype").ToString ())) %></a>
               </div>

               <%--<%# Convert.ToString(Eval("status"))== "1" ?"<font color=green>已审核</font>":"<font color=red>未审核</font>" %>--%>
                </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>
            <asp:TemplateField HeaderText="查看">
                <itemstyle Width="20px" HorizontalAlign="Center" />
             <itemtemplate>
           <asp:LinkButton runat="server" id="showBtn" CssClass="showBtn" title="查看详情" commandargument=<%#Eval("PJID") %> commandname="show"></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 mt20">     
		 <div class="myTitle"><input type="button" name="backBtn" class="fr button mr20" value="返回" onclick="history.back()" />查看评价详情</div>
         <table width="99%" border="0" cellpadding="1" cellspacing="1" class="CTable no-borderTable"> 
               <%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>


		</asp:Panel>
	</div>

</asp:Content>
