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

<%@ Import Namespace="Kesion.Publics" %>
<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.BLL" %>

<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" Runat="Server">

<asp:Panel ID="ListPanel" runat="server" Width="100%">

<div id="manage_top" class="menu_top_fixed">

       <ul>        
           <li id='p2'><asp:LinkButton ID="editclassbutton" runat="server" OnClick="editclassbutton_Click"><b></b>编辑资料</asp:LinkButton></li>
           <li id='p3'><asp:LinkButton ID="delclassbutton" runat="server" OnClick="delclassbutton_Click"><b></b>删除资料</asp:LinkButton></li>
           </ul>
        </div>
<style>
.categorynav{line-height:25px;width:97%;margin:0 auto;margin-bottom:10px;border:1px solid #DEEFFA;background-color:#F7FBFE;padding:5px 0px 5px 10px; height:100%; overflow:hidden;}
ul,li{padding:0px;margin:0px}
.categorynav li{width:160px;float:left;}
</style>           
      <div class="message">
        </div>
        <div class="message">
         <span style="float:right;padding-right:10px">
         <strong>搜索资料：</strong>
            <asp:TextBox ID="TextBox1" CssClass="textbox" runat="server"></asp:TextBox>
            <asp:Button ID="Button2" runat="server" Text=" 搜索 " CssClass="button" onclick="Button2_Click" />
        </span>
        
        当前位置：<asp:Label ID="LabNav" runat="server"></asp:Label>
        </div>

      <KS:ksgv id="list" runat="server" AutoGenerateColumns="False"  EmptyDataText="没有添加任何资料!" PagerType="CustomNumeric" Width="99%" 
             CssClass="CTable" GridLines="None" OnRowCommand="List_RowCommand" 
            OnRowCreated="List_RowCreated" onrowdatabound="list_RowDataBound" >
        <Columns>
        <asp:TemplateField HeaderText="&lt;input type='checkbox' name='chkall' id='chkall' onClick='CheckAll(this.form);'/&gt;">
                <itemstyle horizontalalign="Center" Height="30px" width="30px" />
                <itemtemplate>
                <input type="checkbox"  name="ids" id="ids" value="<%#Eval("ZLid") %>" />
                </itemtemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="ID号" DataField="ZLid" Visible="false">
                <itemstyle horizontalalign="Center" />
            </asp:BoundField>
              <asp:TemplateField HeaderText="状态">
                <itemstyle Width="30px" horizontalalign="Center" />
                <itemtemplate>
                  <a href="?action=verify&ZLid=<%#Eval("ZLid")%>" <%# Convert.ToString(Eval("IsPublic"))=="0"?"class='no' title='不公开'":"class='ok' title='公开'" %>></a>
                </itemtemplate>
            </asp:TemplateField>
            

            <asp:TemplateField HeaderText="资料名称">            
                <itemtemplate>
                <div onmouseover="jQuery('#a<%#Eval("ZLid") %>').show();" onmouseout="jQuery('#a<%#Eval("ZLid") %>').hide();">
                 <a href="/course/view.aspx?id=<%# Eval("CourseID") %>" target="_blank"> <span class="doc_1"></span>[<%# GetName(Utils.StrToInt(Eval("Courseid").ToString()))%>]</a>
               <%# Utils.CutStr(Convert.ToString(Eval("Zlname")),30) %>
                 </div>
                </itemtemplate>
            </asp:TemplateField>

             <asp:BoundField HeaderText="下载地址" DataField="ZLAdd">
                <itemstyle verticalalign="Middle" width="300px"  horizontalalign="Center"/>
            </asp:BoundField>  
                     
              <asp:BoundField HeaderText="上传者" DataField="username">
                <itemstyle verticalalign="Middle"  horizontalalign="Center"/>
            </asp:BoundField>
         
         
              <asp:BoundField HeaderText="添加时间" DataField="adddate">
                <itemstyle verticalalign="Middle" width="135px"  horizontalalign="Center"/>
            </asp:BoundField>
            

             <asp:TemplateField HeaderText="编辑">
              <itemstyle width="30px" horizontalalign="Center"/>
              <itemtemplate>
                  <asp:LinkButton ID="LinkButton2" CssClass="edit" ToolTip="编辑" runat="server" commandargument=<%#Eval("ZLid") %> commandname="modify">编辑</asp:LinkButton>
             </itemtemplate>
            </asp:TemplateField>

             <asp:TemplateField HeaderText="删除">
              <itemstyle width="30px" horizontalalign="Center"/>
              <itemtemplate>
               <asp:LinkButton  ToolTip="删除" CssClass="delete"  runat="server" id="delete" commandargument=<%#Eval("ZLid") %> commandname="del">删除</asp:LinkButton>
              </itemtemplate>
            </asp:TemplateField>
        </Columns>
        <HeaderStyle CssClass="CTitle" />
        <EmptyDataRowStyle CssClass="emptycss" />
    </KS:ksgv>
      
    <KS:Page ID="page1" runat="server" />

    </asp:Panel>

<asp:Panel ID="AddPanel" runat="server" Width="100%">
  <KS:TopNav ID="TopNav1" runat="server" Text="添加资料" />
   
        <div class="tab-page" id="sjPanel">
         <script type="text/javascript">
             var tabPane1 = new WebFXTabPane(document.getElementById("sjPanel"), 1)
         </script>
             
		 <div class="tab-page" id="tab0">
		  <h2 class="tab">基本信息</h2>
			<script type="text/javascript">
			    tabPane1.addTabPage(document.getElementById("tab0"));
			</script>

     <table width="100%" border="0" cellpadding="1" cellspacing="1" class="CTable"> 
    
      <tr>
     <td class="lefttd" height="30" align="right" style="width: 40px"><b>课程名称：</b></td>
      <td class="righttd">
      <asp:TextBox ID="TxtCName" CssClass="textbox " ReadOnly="true" runat="server" Width="300px"></asp:TextBox>
      </td>          
     </tr>
     <tr>
        <td align="right" class="lefttd" height="30" ><strong>资料名称：</strong></td>
         <td class="righttd"><asp:TextBox ID="TxtName" CssClass="textbox" runat="server" Width="300px"></asp:TextBox></td>
     </tr>
       <tr>
        <td align="right" class="lefttd" height="30" ><strong>上传资料：</strong></td>
         <td class="righttd"><asp:TextBox ID="TextBox2" CssClass="textbox" runat="server" Width="300px"></asp:TextBox>
          &nbsp;<input type="button" class="button" onclick="SelectFiles('<%=this.TextBox2.ClientID %>',-10);" value="选择资料" />
         <%=Kesion.APPCode.UploadAPI.EchoUpload("courseFile",this.TextBox2.ClientID) %>
        
         </td>
     </tr>
   
     <tr>
        <td align="right" class="lefttd" height="30" ><strong>资料简介：</strong></td>
         <td class="righttd"><asp:TextBox ID="TxtIntro" TextMode="MultiLine" Width="400px" Height="100px" runat="server"></asp:TextBox>
         <% Kesion.APPCode.EditorAPI.EchoEditor("editor", this.TxtIntro.ClientID, "Basic");%>
        </td>
     </tr>
        <tr>
            <td align="right" class="lefttd" height="30" style="width: 102px">
                <strong>是否公开：</strong></td>
            <td class="righttd">
             <asp:RadioButtonList ID="RdbVerify" runat="server" Width="137px" 
                    RepeatDirection="Horizontal" Height="24px">
              <asp:ListItem Value="1" Selected="True">公开</asp:ListItem>
              <asp:ListItem Value="0">不公开</asp:ListItem>
             </asp:RadioButtonList>
             </td>
        </tr>
      <tr>
            <td align="right" class="lefttd" height="30" style="width: 102px">
                <strong>关键字Tags：</strong></td>
            <td class="righttd">
             <asp:TextBox ID="TxtKeyTags"  runat="server" CssClass="textbox" Width="300px" /> 
            【<a href='javascript:;' onclick='GetKeyTags()' style='color:green'>根据资料名称自动获取Tags</a>】&nbsp;&nbsp;<font class='tips'>多个tags请用空格隔开</font>
             </td>
        </tr>
  </table>
   </div>
      <KS:Foot ID="Foot1" runat="server" OnSubmit="Foot1_Submit" />
     </asp:Panel>
     <script>
         function GetKeyTags() {
             var text = escape(jQuery('#<%=this.TxtName.ClientID %>').val());
             if (text != '') {
                 jQuery('#<%=this.TxtKeyTags.ClientID %>').val('请稍等,系统正在自动获取tags...').attr("disabled", true);
                 jQuery.get("../../plus/ajaxs.ashx", { a: "GetTags", text: text },
				  function (data) { jQuery('#<%=this.TxtKeyTags.ClientID %>').val(unescape(data)).attr("disabled", false); });
             } else { KesionJS.Alert('对不起,请先输入课程名称!', "jQuery('#<%=this.TxtName.ClientID %>').focus();"); }
         }
</script>

</asp:Content>
