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

<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.Publics" %>
<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" Runat="Server">

<script>

    function showToggle(id) {
        if (jQuery('#xt' + id).html() == '') {
            jQuery('#xt' + id).append('<tr class="tdbg"><td height="30" align="center" colspan="2">暂无材料!</td></tr>');
        }
        var t = jQuery("#t" + id).html();
        if (t.indexOf('打开') != -1) {
            jQuery('#xt' + id).slideDown('fast');
            jQuery("#t" + id).html('<img border="0" src="../../admin/images/icon_del_over.png" align="absmiddle"/>关闭')
        } else {
            jQuery('#xt' + id).slideUp('fast');
            jQuery("#t" + id).html('<img border="0" src="../../admin/images/icon_add_normal.png" align="absmiddle"/>打开')
        }
    }
    jQuery(document).ready(function () {
             <%if (KSCMS.S("action") == "modifyth") {%>
        jQuery(".toggleArea").html('<img border="0" src="../../admin/images/icon_del_over.png" align="absmiddle"/>关闭');
        jQuery('.showArea').each(function () {
            if (jQuery(this).html() == '') {
                jQuery(this).append('<tr class="tdbg"><td height="35" align="center" colspan="2">暂无材料!</td></tr>');
            }
        });
                 <%}else{ %>
        jQuery(".toggleArea").html('<img border="0" src="../../admin/images/icon_add_normal.png" align="absmiddle"/>打开');
        jQuery(".showArea").attr("style", "display:none");
                 <%} %>
    });
    var currStatue = 1;
    function openAll() {
        if (currStatue == 1) { //展开
            currStatue = 0
            jQuery(".toggleArea").html('<img border="0" src="../../admin/images/icon_del_over.png" align="absmiddle"/>关闭');
            jQuery('.showArea').each(function () {
                if (jQuery(this).html() == '') {
                    jQuery(this).append('<tr class="tdbg"><td height="35" align="center" colspan="2">暂无材料!</td></tr>');
                }
            });
            jQuery('.showArea').show();
            jQuery("#allstate").html('全部隐藏');
        } else {
            currStatue = 1;
            jQuery(".toggleArea").html('<img border="0" src="../../admin/images/icon_add_normal.png" align="absmiddle"/>打开');
            jQuery(".showArea").attr("style", "display:none");
            jQuery("#allstate").html('全部展开');
        }
    }
</script>

<asp:Panel ID="PanList" runat="server"> 

        <div class="message">              
        当前位置：<a href="KS.CsFile.aspx">材料管理</a>
        </div>  

     <div class="tabs_header">
      <ul class="tabs">  
           <li class='active'><a href="KS.CsFile.aspx">材料批改</a></li>                
           <li><a href="KS.CsFiles.aspx">材料汇总</a></li>              
    </ul>
     </div>
    	<div class="clear blank10"></div>
     <asp:Repeater ID="Repeater1" runat="server" 
            onitemdatabound="Repeater1_ItemDataBound" >
          <HeaderTemplate>
            <table id="tablist" width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="CTable">
              <tr align="center" class="title">
               <td height="25" width="90" align="center"><b>操作</b></td>
               <td style="text-align:left">&nbsp;&nbsp;<b>课程名称</b>(<a href="javascript:;" onclick="openAll()" id="allstate">全部展开</a>)</td>                  
              </tr>
          </HeaderTemplate>
         <ItemTemplate>        
            <tr class="tdbg">
              <td height="35" align="center" nowrap>
                 <span style='cursor:pointer' id='t<%# Eval("CourseID") %>' class="toggleArea" onclick="showToggle(<%# Eval("CourseID") %>);">
                 </span>
                 </td>
				 <td>
				 <strong>
				 <a href="javascript:void(0);" onclick="showToggle(<%# Eval("CourseID") %>);" >[<%# Eval("name") %>]</a>                
                  &nbsp; &nbsp;<a href="KS.CsFiles.aspx?courseid=<%# Eval("courseid")%>" ><font color="red">查看明细</font> </a>       
                  &nbsp; &nbsp; 交互次数：<%#( Utils.StrToInt( Eval("PeriodID"))>0? Utils.StrToInt( Eval("PeriodID"))+"次":"不限")%>
                  &nbsp; &nbsp;<font color="blue">共<asp:Label ID="Label1" runat="server"></asp:Label>条文件</font>  
                  &nbsp; &nbsp;<font color="blue">共<asp:Label ID="Label2" runat="server"></asp:Label>个学员</font>     
                  &nbsp; &nbsp;课程添加时间：<%# Eval("addtime") %>       
				</strong>
				</td>			
			</TR>
			<tbody id='xt<%# Eval("CourseID") %>' class="showArea">
             <asp:Repeater ID="Repeater2" runat="server">
               <ItemTemplate>              
               <tr class="tdbg"> 
                  <td  height="35" style="text-align:center" width="90"> 	
                     <%# Container.ItemIndex + 1%>.</strong>	                 
		          </td>	                   
                    <td> 
                      <%# Eval("sinputer")%>  共<font color="blue"><%# Gettotal(Utils.StrToInt(Eval("courseid")),1,Eval("sinputer").ToString())%></font>条  
                        &nbsp; &nbsp; <%# Gettotal(Utils.StrToInt(Eval("courseid")),2,Eval("sinputer").ToString())%>
                        &nbsp; &nbsp; <%# Gettotal(Utils.StrToInt(Eval("courseid")),3,Eval("sinputer").ToString())%>
                         &nbsp; &nbsp;  <a href="KS.CsFiles.aspx?courseid=<%# Eval("courseid")%>&username=<%# Eval("sinputer")%>" >查看</a>                         
			       </td>                                 	        
                </tr>              
               </ItemTemplate>
             </asp:Repeater>
           </tbody>  
         </ItemTemplate>
          <FooterTemplate>
            <tr class="tdbg" style="display:<%# bool.Parse((Repeater1.Items.Count==0).ToString())?"":"none"%>">
                <td class="Ctd" style="height:40px;line-height:40px;text-align:center" colspan="4">
                  没有记录!                 
                </td>
               </tr> 
           </table>
          </FooterTemplate>
        </asp:Repeater>
    
     <div class="paddingbox"><KS:Page ID="Page1" runat="server" /></div>
</asp:Panel>


</asp:Content>


