<%@ Page Language="C#" ValidateRequest="false" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" Inherits="Kesion.NET.WebSite.Admin_SJClass" Title="试卷分类管理" Codebehind="KS.SJCategory.aspx.cs" %>
<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.Publics" %>
<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" Runat="Server">
      <div id="manage_top" class="menu_top_fixed">
         <ul class="titleTab">
          <li><a href="KS.SJConfig.aspx">频道参数设置</a></li>
          <li class="curr"><a href="KS.SJCategory.aspx">分类管理</a></li>
          <li><a href="KS.SJType.aspx">自定义类别</a></li>
          <li><a href="KS.SJZDYType.aspx">自定义题型</a></li>
        <%if (MyCache.GetSJCacheConfig(2).ToString() == "1"){ %>
          <li><a href="KS.SJKnowledge.aspx">知识点管理</a></li>
        <%} %>
          <li><a href="KS.SjTypeClass.aspx">章节管理</a></li>
          <li><a href="KS.SJCJD.aspx">成绩等级管理</a></li>
          <li><a href="KS.ZGCard.aspx">准考证生成管理</a></li>
          <li><a href="KS.SJKM.aspx">会计科目管理</a></li>
       </ul>
 </div>  
<div class="menu_top_fixed_height"></div> 
     <asp:Panel ID="ClassList" runat="server" Width="100%">
    <div class="content-area">
    <div class="myTitle">
        <div class="fr headOperation ">
            <ul>
                <li class="fl"><a href="?action=OrderOne" class="button">分类排序</a></li>
                <li class="fl"><a href="?action=OneKeyCount" class="button" title="修改正分类排序及统计分类下的试卷数">一键修正分类</a></li>
                <li class="fl"><a href="?action=add" class="button button_on">添加分类</a></li>
            </ul>
        </div>
        试卷分类管理</div> 
     <script type="text/javascript">
    function ExtSub(ID,event) {//阻止冒泡调用parent
        var e = (event) ? event : window.event;
        if (window.event) {//IE
            e.cancelBubble = true;
        } else { //FF
            e.stopPropagation();
        }
        if (jQuery('#C'+ID).attr('class')=="tree_Close")
        {       
            jQuery('#C'+ID).attr('class','tree_Open');
            if ($(".CTable").find("tr[attr*=',"+ID+",']").length>0){
                $(".CTable").find("tr[attr*=',"+ID+",']").show();
            }else{
                jQuery('#ajaxmsg',window.parent.document).toggle();
                jQuery.ajax({
                    type: "POST",
                    url: "KS.SJCategory.aspx",
                    data: "parentid="+ID+"&action=ExtSub",
                    success: function (data) {
                    jQuery('#ajaxmsg',window.parent.document).toggle();
                    jQuery("#sub"+ID).after(data);
                    //jQuery("#sub"+ID).html(data);
                }
            });
        }
    }
    else{
        $(".CTable").find("tr[attr*=',"+ID+",']").hide();
        jQuery('#C'+ID).attr('class','tree_Close');
    }
    }
    function ContentSetAttribute(){
     parent.openWin("批量设置试卷分类是否收费","<%=KSCMS.GetInstallDir()+MyCache.GetCacheConfig(4)%>/exam/KS.TrangSetting.aspx",true,880,520);
    }
         function moveClass(id) {
             top.openWin("移动分类", "exam/KS.SJCategory.aspx?action=moveClass&classid=" + id, true, 600, 250);
         }
    </script>
 


         <asp:Repeater ID="list" runat="server">
          <HeaderTemplate>
           <table width="99%" cellpadding="0" cellspacing="0" class="CTable">
           <tr class="CTitle">
			   <th scope="col">选择</th>
               <th scope="col">序号</th>
               <th scope="col" style="text-align:left">分类名称<a class="greenFont" href="KS.SJCategory.aspx?action=showall">(展开)</a></th>
               <th scope="col">分类ID</th>
               <th scope="col">操作</th>
			</tr>
          </HeaderTemplate>
          <ItemTemplate>
            <tr id='sub<%#Eval("classid") %>'  onmouseover="jQuery('#a<%# Eval("classid") %>').show();this.className='CtrMouseOver'" onmouseout="jQuery('#a<%# Eval("classid") %>').hide();this.className='CtrMouseOut'" onclick="chk(this)">
             <td class="Ctd" align="center" style="width:40px;"><input type="checkbox" name="ids" value='<%#Eval("classID")%>' /></td>
             <td class="Ctd" align="center" align="center" style="width:100px;"><%# Container.ItemIndex + 1 + (CurrPage - 1) * PageSize%></td>
             <td class="Ctd" style="height:30px;">
             <%if (KSCMS.S("Action") != "showall")
               { %>
             <a href="javascript:void(0)" onclick='ExtSub("<%# Eval("ClassID") %>",event);' style='text-decoration:none'><%# getClassName(Convert.ToInt32(Eval("ClassID")),Eval("Classname", "{0}"), Convert.ToInt16(Eval("child")), Convert.ToInt16(Eval("NextID")), Convert.ToInt16(Eval("depth", "{0}")), 1)%></a><%}
               else
               { %><%# getClassName(Convert.ToInt32(Eval("ClassID")),Eval("Classname", "{0}"), Convert.ToInt16(Eval("child")), Convert.ToInt16(Eval("NextID")), Convert.ToInt16(Eval("depth", "{0}")), 1)%><%} %>
               
               <span id="a<%# Eval("classid") %>" style="display:none;padding-left:20px">
                <a style="color:#999" href="KS.SJCategory.Aspx?action=add&parentid=<%# Eval("classid") %>">添加子分类</a>
                <a href="javascript:;" onclick="moveClass(<%# Eval("ClassID") %>)"  style="color:#999">移动</a>
               </span>

             </td>
             <td class="Ctd" align="center" width="100"><%# Eval("classid") %></td>
             <td class="Ctd" align="center" width="400">
              <a href="KS.SJCategory.Aspx?action=edit&classid=<%# Eval("classid") %>" class="greenFont">编辑</a>&nbsp;&nbsp;&nbsp;
              <a href="KS.SJCategory.Aspx?Action=del&Ids=<%# Eval("classid") %>" onclick="return(confirm('删除分类，同时删除该分类下的试卷，此操作不可逆，确定删除分类吗?'));" class="greenFont">删除</a>&nbsp;&nbsp;&nbsp;
              <a href='<%# GetClassUrl(Convert.ToInt32(Eval("ClassID"))) %>'target="_blank" class="greenFont">预览</a>
             </td>
            </tr>
            
          </ItemTemplate>
          <FooterTemplate>
               <tr style="display:<%# bool.Parse((list.Items.Count==0).ToString())?"":"none"%>">
                <td class="Ctd" style="text-align:center" colspan="4">
                 <asp:LinkButton ID="addbutton" runat="server" OnClick="lbtaddmodel_Click"> 还没有添加任何分类，点此添加分类&raquo;</asp:LinkButton>
                </td>
               </tr> 
          </table>
          </FooterTemplate>
         </asp:Repeater>

         	<div class="listedit">
      	     	<ul>
                    <input type='checkbox' name='chkall' id='chkall' onClick='CheckAll(this.form);'/><label for="chkall">全选</label>
                    <asp:LinkButton ID="delbutton" runat="server" CssClass="button" OnClientClick="if (GetIDS('del')){return true}else{return false}" onclick="BtnDelete_Click">删除分类</asp:LinkButton>
                    <asp:LinkButton  ID="batchset" runat="server" CssClass="button">批量设置</asp:LinkButton>
                </ul>
          	</div>
          	<KS:Page ID="Page1" runat="server" />
			<script type="text/javascript">
                showtips('<span class="state"><strong>操作说明：</strong><br /></span>可使用标签{$GetExamCategory}在前台模板调用出试卷分类。');
            </script>
        </div> 
        </asp:Panel> 
        
        <asp:Panel ID="ClassAdd" runat="server" Width="100%">
        <script type="text/javascript">
        <!--
	        function setFileFileds(num){    
             for(var i=1,str="";i<=20;i++){
	            jQuery("#define" + i).css("display","none");
              }
             for(var i=1,str="";i<=num;i++){	jQuery("#define" + i).css("display","");
                 }
            }
            function ConvertPinYin(){
              var className=jQuery('#<%=this.ClassName.ClientID %>').val();
              jQuery.get("../../plus/ajaxs.ashx",{a:"convertclassname",classname:className},function(v){
                 jQuery('#<%=this.ClassEname.ClientID %>').val(unescape(v));
              });
            }

            function CheckAddMode() {
                if (jQuery("#AddType")[0].checked == true) {
                    jQuery("#AddOne").hide();
                    jQuery("#AddEOne").hide();
                    jQuery("#AddMore").show();
                } else {
                    jQuery("#AddOne").show();
                    jQuery("#AddEOne").show();
                    jQuery("#AddMore").hide();
                }
            }

	        function CheckForm()
	        {
	            if (jQuery('#<%=this.ClassName.ClientID %>').val() == '' && jQuery("#AddType")[0].checked == false) {
	             KesionJS.Alert( '请输入试卷分类名称！', "jQuery('#<%=this.ClassName.ClientID %>').focus()");
	           return false;
	       } else if (jQuery("#AddType")[0].checked == true && jQuery('#<%=this.TxtMoreClassName.ClientID %>').val() == '') {
	           KesionJS.Alert('请按格式输入分类名称和英文名称！', "jQuery('#<%=this.TxtMoreClassName.ClientID %>').focus()");
	           return false;
	       } else if (jQuery("#AddType")[0].checked == true && jQuery('#<%=this.TxtMoreClassName.ClientID %>').val().indexOf('|') == -1) {
	           KesionJS.Alert('请按格式输入分类名称和英文名称,格式为：分类中文名称|分类英文名称！', "jQuery('#<%=this.TxtMoreClassName.ClientID %>').focus()");
	           return false;
	       }else if (jQuery('#<%=this.ClassEname.ClientID %>').val() == '' && jQuery("#AddType")[0].checked == false) {
                       KesionJS.Alert('请输入分类英文名称！',"jQuery('#<%=this.ClassEname.ClientID %>').focus()");
                       return false;}
                       return true;    
           }
	        //-->
	    </script>
	    

        <!--<KS:TopNav ID="TopNav1" runat="server" Text="添加新试卷分类" />-->
 <div class="content-area">       
       	<div class="tab-page" id="ExamClassPanel">
         <script type="text/javascript">
           var tabPane1 = new WebFXTabPane( document.getElementById( "ExamClassPanel" ), 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 no-borderTable">
				   <tr>
                       <td align="right" class="lefttd" style="width: 258px; height: 37px;"><strong>
                           所属分类：</strong><br>
                         </td>
                         <td class="righttd" style="height: 37px">
                             <asp:DropDownList ID="ParentID" runat="server" OnSelectedIndexChanged="ParentID_SelectedIndexChanged" AutoPostBack="true">
                             <asp:ListItem Value="0">-无（作为一级分类）-</asp:ListItem>
                             </asp:DropDownList>&nbsp;
                             <span id="ParentIDMessage" runat="server"></span>
                       </td>
                     </tr>
                     
                    <tr>
                    <td class="lefttd" height="30" align="right" style="width: 258px">
                        <strong> 分类名称：</strong></td>
                    <td class="righttd">
                       <span id="AddOne">
                        <asp:TextBox CssClass="textbox" ID="ClassName" runat="server"></asp:TextBox>
                        <span class="tips">*请输入分类的中文名称，如公务员</span>
                       </span>

                       <label style="<%=KSCMS.S("action")=="edit"?"display:none;":"" %>font-weight:bold;color:Green"><input onclick="CheckAddMode()" type="checkbox" name="AddType" id="AddType" value="1" />切换到批量添加模式</label>
                       <div id="AddMore" style="display:none">
                          <font color=red>录入格式:分类中文名称|英文名称,说明每行一个</font><br />
                          <asp:TextBox Text="分类名称1|英文名称1" ID="TxtMoreClassName" runat="server" CssClass="textbox" TextMode="MultiLine" Width="250px" Height="150px"></asp:TextBox>
                         </div>
                       </td>
                  </tr>
                  <tr id="AddEOne">
                    <td  class="lefttd" align="right" style="width: 258px; height: 48px"><strong>英文名称：</strong><br />
                        </td>
                    <td  class="righttd" style="height: 48px">
             
                        <asp:TextBox CssClass="textbox" ID="ClassEname" runat="server" onblur="CheckEnglishStr(this,'分类的英文名称')"></asp:TextBox>&nbsp;<span class="tips">*只能填写英文和数字的组合,不能带\/：*？“ &lt; &gt; | 等特殊符号</span>
						</td>
                  </tr>
                   <tr style="display:none">
                    <td  class="lefttd" align="right" style="width: 258px; height: 48px"><strong>分成比率：</strong><br />
                        </td>
                    <td  class="righttd" style="height: 48px">
             
                        <asp:TextBox CssClass="textbox" ID="DividePercent" Text="0" width="50px" runat="server"></asp:TextBox>&nbsp;%<span class='tips'> 系统将根据这里设置的分成比率将收成分给投稿者。建议设成10的整数倍!</span>
						</td>
                  </tr>
                    <tr>
                    <td  class="lefttd" align="right" style="width: 258px; height: 48px"><strong>省份检索：</strong><br />
                        </td>
                    <td  class="righttd" style="height: 48px">
             
                      <asp:RadioButtonList ID="ExamPro" runat="server" RepeatDirection="horizontal">
                    <asp:ListItem Value="0">关闭</asp:ListItem>
                    <asp:ListItem Value="1" Selected>开启</asp:ListItem>
                    </asp:RadioButtonList>   <span class='tips'> 开启时前台会自动支持该分类省份筛选</span>
						</td>
                  </tr>
                    <tr>
                    <td  class="lefttd" align="right" style="width: 258px; height: 48px"><strong>年份：</strong><br />
                        </td>
                    <td  class="righttd" style="height: 48px">
             
                      <asp:RadioButtonList ID="examyear" runat="server" RepeatDirection="horizontal">
                    <asp:ListItem Value="0">关闭</asp:ListItem>
                    <asp:ListItem Value="1" Selected>开启</asp:ListItem>
                    </asp:RadioButtonList>   <span class='tips'> 开启时前台会自动年份筛选</span>
						</td>
                  </tr>
                      <tr>
                    <td  class="lefttd" align="right" style="width: 258px; height: 48px"><strong>每日一练：</strong><br />
                        </td>
                    <td  class="righttd" style="height: 48px">
             
                      <asp:RadioButtonList ID="examdialy" runat="server" RepeatDirection="horizontal">
                    <asp:ListItem Value="0">关闭</asp:ListItem>
                    <asp:ListItem Value="1" Selected>开启</asp:ListItem>
                    </asp:RadioButtonList>   <span class='tips'> 开启时将会生随机从该分类随机抽题进行每日一练</span>
						</td>
                  </tr>
                     <tr>
                    <td  class="lefttd" align="right" style="width: 258px; height: 48px"><strong>章节练习检索：</strong><br />
                        </td>
                    <td  class="righttd" style="height: 48px">
             
                      <asp:RadioButtonList ID="ExamChaper" runat="server" RepeatDirection="horizontal">
                    <asp:ListItem Value="0">关闭</asp:ListItem>
                    <asp:ListItem Value="1" Selected>开启</asp:ListItem>
                    </asp:RadioButtonList>   <span class='tips'> 开启时前台会自动章节筛选</span>
						</td>
                  </tr>
          <tr>
                    <td  class="lefttd" align="right" style="width: 258px; height: 48px"><strong>分类是否隐藏：</strong><br />
                        </td>
                    <td  class="righttd" style="height: 48px">
             
                      <asp:RadioButtonList ID="radiohide" runat="server" RepeatDirection="horizontal">
                    <asp:ListItem Value="1">是</asp:ListItem>
                    <asp:ListItem Value="0" Selected="True">否</asp:ListItem>
                    </asp:RadioButtonList>   <span class='tips'> 用于控制前台是否显示的设置，只有开启才可以在前台筛选页里显示</span>
						</td>
                  </tr>
                 <% if (MyCache.GetExamSetting(17)!="0"){ %>
                 <tr>
                    <td  class="lefttd" align="right" style="width: 258px; height: 48px"><strong>是否设分类练习收费：</strong><br />
                        </td>
                    <td  class="righttd" style="height: 48px">
             
                      <asp:RadioButtonList ID="TrangCharge" runat="server" RepeatDirection="horizontal">
                    <asp:ListItem Value="1">是</asp:ListItem>
                    <asp:ListItem Value="0" Selected="True">否</asp:ListItem>
                    </asp:RadioButtonList>   <span class='tips'> 用于控制前台是否收费用户才能进行练习</span>
				</td>
                  </tr>
                 <%} %>

                 


                <tr id="IntroArea">
                    <td align="right"  class="lefttd" style="width: 258px; height: 50px;">
                        <strong>分类介绍：</strong><br />
                        </td>
                    <td  class="righttd" style="height: 50px">
                        <asp:TextBox CssClass="textbox textarea" ID="ClassIntro" runat="server" rows="2" TextMode="MultiLine" Width="383px" Height="80px"></asp:TextBox>
                         <a class="textarea_min" href="javascript:zoomtextarea(-2,'<%=this.ClassIntro.ClientID %>');"> </a>
                        <a class="textarea_max" href="javascript:zoomtextarea(2,'<%=this.ClassIntro.ClientID %>');"></a>  

                          <br />
                          <font class='tips'>用于在分类页的介绍信息，支持HTML</font> 
                        </td>
                  </tr>
                  <tr>
                    <td  height="30" class="lefttd" align="right" style="width: 258px">
                        <strong>分类图片：</strong></td>
                    <td class="righttd">
                        <asp:TextBox CssClass="textbox" ID="ClassImg" runat="server" Width="380px"></asp:TextBox>&nbsp;<input type="button" class="button" onclick="SelectFiles('<%=this.ClassImg.ClientID %>',101);" value="选择图片">
                        <br />
                        <font class='tips'>用于在分类页显示指定的图片</font>
                        </td>
              </tr>
              
              
                  
              
          </table>	

        </div>
      
		
        <div class="tab-page" id="seooption">
		  <h2 class="tab">SEO选项</h2>
			<script type="text/javascript">
			    tabPane1.addTabPage(document.getElementById("seooption"));
			</script>
			
             <table width="100%" border="0" cellpadding="1" cellspacing="1" class="CTable no-borderTable">
            <tr>
                    <td  height="30" align="right"  class="lefttd" style="width: 258px">
                        <strong>分类META关键词</strong>：</td>
                    <td class="righttd">
                        <asp:TextBox CssClass="textbox textarea" ID="MetaKeyWord" runat="server" Height="100px" Rows="3" TextMode="MultiLine" Width="378px"></asp:TextBox>
                        <a class="textarea_min" href="javascript:zoomtextarea(-2,'<%=this.MetaKeyWord.ClientID %>');"> </a>
                        <a class="textarea_max" href="javascript:zoomtextarea(2,'<%=this.MetaKeyWord.ClientID %>');"></a>  
                        <br />
                        <span class="tips">针对搜索引擎设置的关键词，调用标签“{$GetClassMetaKeyWords} ”。</span></td>
                  </tr>
                  <tr>
                         <td align="right"  class="lefttd" style="height: 76px; width: 258px;">
                             <strong>分类META网页描述：
                             </strong></td>
                         <td  class="righttd" style="height: 76px">
                             <asp:TextBox CssClass="textbox textarea" Height="100px" ID="MetaDescript" runat="server" rows="3" TextMode="MultiLine" Width="376px"></asp:TextBox>
                          <a class="textarea_min" href="javascript:zoomtextarea(-2,'<%=this.MetaDescript.ClientID %>');"> </a>
                          <a class="textarea_max" href="javascript:zoomtextarea(2,'<%=this.MetaDescript.ClientID %>');"></a>  
                         <br /><span class="tips">针对搜索引擎设置的网页描述,调用标签“{$GetClassMetaDescript}”。</span>
                        </td>
                  </tr>
                   </table>
 </div>
		
		
		 <div class="tab-page" id="tab1">
		  <h2 class="tab">自设内容</h2>
			<script type="text/javascript">
						 tabPane1.addTabPage( document.getElementById( "tab1" ) );
			</script>
			
 <table width="100%" border="0" cellpadding="1" cellspacing="1" class="CTable no-borderTable">
         <tr>           
            <td height='30' align='right' style='width:258px;' class='lefttd'><strong>自设内容数：</strong></td>
           	<td height='28' class="righttd">
              &nbsp;<select name="ClassDefine_Num" id="ClassDefine_Num" onChange="setFileFileds(this.value)"><option value="1" selected>1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option> </select>             </td>
         </tr>
         
         <%for (int i = 1; i <= 20; i++)
           {
           %>
           <tbody id="define<%=i %>" style="display:none">
         <tr>           
          <td height='30' align='right' style='width:258px;' class='lefttd'><strong>自设内容<%=i %>：</strong><br> <font color=blue>在分类模板页插入{$GetClassDefineContent<%=i %>} 调用</font>
             </td>
             <td class="righttd">&nbsp;<textarea class="textbox" cols="10" ID='ClassDefineContent<%=i %>'  Name='ClassDefineContent<%=i %>' style='width:500px;height:100px'><% try
                {
                    Response.Write(param[i - 1].ToString());
                }
               catch{}%></textarea> 
               <a class="textarea_min" href="javascript:zoomtextarea(-2,'ClassDefineContent<%=i %>');"> </a>
                <a class="textarea_max" href="javascript:zoomtextarea(2,'ClassDefineContent<%=i %>');"></a>  

             </td>
         </tr>
         </tbody>
         <%} %>
         </table>			
			
        </div>
        
        <div class="tab-page" id="tab2">
		  <h2 class="tab">分类标签</h2>
			<script type="text/javascript">
			    tabPane1.addTabPage(document.getElementById("tab2"));
			</script>
			
 		<table width="100%" border="0" cellpadding="1" cellspacing="1" class="CTable no-borderTable">
         <tr>           
             <td height='30' align='right' class='lefttd' style="width:258px;"><strong>本分类可用标签：</strong></td>
             <td height='28' class="righttd">
                 <li>分类ID：{$GetClassID}</li>
                 <li>分类名称：{$GeClassName}</li>
                 <li>分类介绍：{$GetClassIntro}</li>
                 <li>分类图片：{$GetClassImgSrc}</li>
                 <li>分类URL：{$GetClassURL}</li>
                 <li>分类MetaKeyWords：{$GetClassMetaKeyWords}</li>
                 <li>分类MetaDescrtion：{$GetClassMetaDescript}</li>
                 <li>分类自设内容：{$GetClassDefineContent<font color=red>n</font>}
             
                 n取1-20的值。</li>
                 <li>分类页按类别查看：{$GetSearchByType}</li>
                 <li>分类页按省份查看：{$GetSearchByArea}</li>
                 <li>分类页按试卷分类查看：{$GetSearchByClass}</li>
                 <li>全站弹出分类标签：{$GetExamCategory}</li>
              
              </td>
         </tr>
         </table>
        
        
       </div>

       <div class="tab-page" id="freeoption" runat="server">
		  <h2 class="tab">收费选项</h2>
			<script type="text/javascript">
			    tabPane1.addTabPage(document.getElementById("freeoption"));
			</script>
			
             <table width="100%" border="0" cellpadding="1" cellspacing="1" class="CTable no-borderTable">
            <tr>
                    <td  class="lefttd" align="right" style="width: 258px; height: 48px"><strong>价格：</strong><br />
                        </td>
                    <td  class="righttd" style="height: 48px">

                   <asp:TextBox CssClass="textbox textarea" ID="TxtMoney" runat="server"  Width="50px"  Text="200"></asp:TextBox>元
                     
                  <span class='tips'> 设置为“0”表示不按分类收费(用于如果学员购买该分类的话,那么该学员就可以做该分类下的试卷和练习）</span>
				</td>
                  </tr>
                  <tr>
                     <td align="right"  class="lefttd" style="height: 76px; width: 258px;">
                         <strong>购买后有效期：
                             </strong></td>
                         <td  class="righttd" style="height: 76px">
                          
                       <asp:TextBox CssClass="textbox textarea" ID="TxtMonth" runat="server"  Width="50px"  Text="12"></asp:TextBox>个月
                   <font color="red">（设置“0”为不限）</font>
                         <span class='tips'>例如:学员在2018.08.04购买了该分类，那么我们设置12个月的话，他只能用到2019.8.08.04，从2019.8.08.04起就要重新购买啦</span></td>
                  </tr>
                   <tr>
                     <td align="right"  class="lefttd" style="height: 76px; width: 258px;">
                         <strong>是否允许子分类设置购买：
                             </strong></td>
                         <td  class="righttd" style="height: 76px">
                       <asp:RadioButtonList ID="IsBuyChild" runat="server" RepeatDirection="horizontal">
                    <asp:ListItem Value="1" >是</asp:ListItem>
                    <asp:ListItem Value="0" Selected="True">否</asp:ListItem>
                    </asp:RadioButtonList>
                    <span class='tips'>
                        如果选择是的话，那么子分类就会出现价格设置和购买后有效期设置，否则就会不显示。
                        </span>
                    </td>
                  </tr>
                   </table>
 </div>
      <div style="clear:both;text-align:center"><br />
          <KS:Foot ID="Foot1" runat="server" OnSubmit="SaveButton_Click" />
      </div>
               </div>
     </div>
 </asp:Panel>
    
 <asp:Panel ID="PanMoveClass" runat="server" Width="100%" Visible="false">
 	<style>
    #manage_top,.menu_top_fixed_height{ display:none;}
    </style>
     <table width="100%" border="0" cellpadding="1" cellspacing="1" class="CTable">
       <tr>
           	<td align="right" class="lefttd" style="width:100px; height: 37px;"><strong>将分类移动到：</strong></td>
            <td  class="righttd" style="height: 37px">
                 <asp:DropDownList ID="DrpToClassID" runat="server" >
                 <asp:ListItem Value="0">-无（作为一级分类）-</asp:ListItem>
                 </asp:DropDownList>&nbsp;<asp:Button ID="BtnMoveSave" runat="server" Text="确认移动" CssClass="button" OnClick="BtnMoveSave_Click" />
           	</td>
         </tr>
     </table>
     <div class="message">
     注意事项：<br />
      本操作不可逆，请慎重操作！！！<br />
      不能在同一个分类内进行操作，不能将一个分类移动到其下属分类中；<br />
      移动后您所指定的分类（或者包括其下属分类）将转移到目标分类中。<br />
     </div>
 </asp:Panel>


  <!---  一级分类排序 begin-->
    <asp:Panel ID="PanelOrderOne" runat="server" Visible="false">
        <div class="content-area">    
            <div class="myTitle"><span class="fr">
            <a href="KS.SJCategory.aspx" class="button">返回</a>
        </span>一级分类排序</div>
            <div class="tabs_header">
                <ul class="tabs">
                     <li class='active'><a href="?action=OrderOne"><span>一级排序</span></a></li>
                     <li><a href="?action=OrderN"><span>N级排序</span></a></li>
                </ul>
            </div>
             <KS:KSGV ID="OrderOneList" CssClass="CTable" runat="server" AutoGenerateColumns="False" EmptyDataText="还没有添加栏目!" GridLines="None" OnRowDataBound="OrderOneList_RowDataBound" PagerType="CustomNumeric" Width="99%" OnDataBound="OrderOneList_DataBound" OnRowCommand="OrderOneList_RowCommand">
                <EmptyDataRowStyle CssClass="emptycss" />
                <Columns>
                    <asp:BoundField DataField="classid" HeaderText="栏目ID" >
                        <itemstyle horizontalalign="Center" width="50px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="classname" HeaderText="栏目名称" />
                    <asp:BoundField DataField="root" HeaderText="序号" >
                        <itemstyle horizontalalign="Center" width="100px" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="一级栏目排序操作">
                    <itemtemplate>
                     <table border="0" cellpadding="0" cellspacing="0" align="center" width="100%">
                        <tr>
                        <td style="width: 49%;text-align:right;" nowrap>
                               <asp:DropDownList ID="DropUpOrder" runat="server" AutoPostBack="False">
                                  <asp:ListItem Selected="True" Value="0">↑向上移动</asp:ListItem>
                                 </asp:DropDownList>
                                &nbsp;<asp:Button runat="server" ID="UpButton" onmouseover="this.className='button_on';" onmouseout="this.className='button';" class="button" Text="修改" commandname="uporder" commandargument=<%#Eval("root") %>></asp:Button>

                      </td>
                      <td>&nbsp;</td>
                      <td style="width: 49%;text-align:left" nowrap>
                       <asp:DropDownList ID="DropDownOrder" runat="server" AutoPostBack="False">
                          <asp:ListItem Selected="True" Value="0">↓向下移动</asp:ListItem>
                       </asp:DropDownList>&nbsp;<asp:Button ID="DownButton" onmouseover="this.className='button_on';" onmouseout="this.className='button';" class="button" Text="修改" commandname="downorder" commandargument=<%#Eval("root") %> runat="server" />
                    </td>
                    </table>
                </itemtemplate>
            </asp:TemplateField>
        </Columns>
        <HeaderStyle CssClass="CTitle" />
    </KS:KSGV>
      <KS:Page ID="OrderOnePage" runat="server" />

        </div>
    </asp:Panel>
    <!---  一级分类排序 end-->



    <!---  N级分类排序 begin-->
       <asp:Panel ID="PanelOrderN" runat="server" Visible="false">
        <div class="content-area">    
            <div class="myTitle"><span class="fr">
            <a href="KS.SJCategory.aspx" class="button">返回</a>
        </span>N级分类排序</div>
            <div class="tabs_header">
                <ul class="tabs">
                     <li><a href="?action=OrderOne"><span>一级排序</span></a></li>
                     <li class='active'><a href="?action=OrderN"><span>N级排序</span></a></li>
                </ul>
            </div>
            <KS:KSGV ID="OrderNList" CssClass="CTable" runat="server" AutoGenerateColumns="False" EmptyDataText="没有添加任何栏目!" GridLines="None" OnRowDataBound="OrderNList_RowDataBound" PagerType="CustomNumeric" Width="99%" OnRowCommand="OrderNList_RowCommand">
                <EmptyDataRowStyle CssClass="emptycss" />
                <Columns>
                    <asp:BoundField DataField="ClassID" HeaderText="栏目ID" >
                        <itemstyle horizontalalign="Center" width="50px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="parentid" HeaderText="父ID" >
                        <itemstyle horizontalalign="Center" width="50px" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="栏目名称">
                        <itemtemplate>
                <%# getClassListName(Eval("Classname", "{0}"), Convert.ToInt16(Eval("child")), Convert.ToInt16(Eval("NextID")), Convert.ToInt16(Eval("depth", "{0}")),1)%>
                    </itemtemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="OrderID" HeaderText="序号" />
                    <asp:TemplateField HeaderText="N级栏目排序">
                        <itemtemplate>
                         <table border="0" cellpadding="0" cellspacing="0" align="center" width="100%">
                            <tr>
                            <td style="width: 49%;text-align:right;" nowrap>
                                   <asp:DropDownList ID="DropUpOrder" runat="server" AutoPostBack="False">
                                      <asp:ListItem Selected="True" Value="0">↑向上移动</asp:ListItem>
                                     </asp:DropDownList>
                                    &nbsp;<asp:Button runat="server" ID="UpButton" onmouseover="this.className='button_on';" onmouseout="this.className='button';" class="button" Text="修改" commandname="upordern" commandargument=<%#Eval("root") %>></asp:Button>

                          </td>
                          <td>&nbsp;</td>
                          <td style="width: 49%;text-align:left" nowrap>
                           <asp:DropDownList ID="DropDownOrder" runat="server" AutoPostBack="False">
                              <asp:ListItem Selected="True" Value="0">↓向下移动</asp:ListItem>
                           </asp:DropDownList>&nbsp;<asp:Button ID="DownButton" onmouseover="this.className='button_on';" onmouseout="this.className='button';" class="button" Text="修改" commandname="downordern" commandargument=<%#Eval("root") %> runat="server" />
                        </td>
                        </table>
                     </itemtemplate>
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle CssClass="CTitle" />
            </KS:KSGV>
             <KS:Page ID="OrderNPage" runat="server" />

        </div>
        </asp:Panel>
    <!---  N级分类排序 end-->
</asp:Content>