<%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true	
Const PurviewLevel=2    '操作权限
%>
<!--#include file="Admin_ChkPurview.asp"-->
<!--#include file="inc/conn.asp"-->
<%
dim arrShowLine(10)
for i=0 to ubound(arrShowLine)
	arrShowLine(i)=False
next
dim sqlClass,rsClass,i,iDepth
sqlClass="select * From ArticleClass order by RootID,OrderID"
set rsClass=server.CreateObject("adodb.recordset")
rsClass.open sqlClass,conn,1,1
%>
<html>
<head>
<title>栏目管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Admin_Style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
function ConfirmDel1()
{
   alert("此栏目下还有子栏目，必须先删除下属子栏目后才能删除此栏目！");
   return false;
}

function ConfirmDel2()
{
   if(confirm("删除栏目将同时删除此栏目中的所有文章，并且不能恢复！确定要删除此栏目吗？"))
     return true;
   else
     return false;
	 
}
function ConfirmDel3()
{
   if(confirm("清空栏目将把栏目（包括子栏目）的所有文章放入回收站中！确定要清空此栏目吗？"))
     return true;
   else
     return false;
	 
}
</script>

</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
  <tr class="topbg"> 
    <td height="22" colspan="2" align="center"><strong>栏 目 管 理</strong></td>
  </tr>
  <tr class="tdbg"> 
    <td width="70" height="30"><strong>管理导航：</strong></td>
    <td height="30"><a href="Admin_ClassManage.asp">栏目管理首页</a> | <a href="Admin_ClassAdd.asp">添加一级栏目</a>&nbsp;|&nbsp;<a href="Admin_ClassOrder.asp">一级栏目排序</a>&nbsp;|&nbsp;<a href="Admin_ClassOrderN.asp">N级栏目排序</a>&nbsp;|&nbsp;<a href="Admin_ClassReset.asp">复位所有栏目</a>&nbsp;|&nbsp;<a href="Admin_ClassUnite.asp">栏目合并</a></td>
  </tr>
</table>
<br> 
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
  <tr class="title"> 
    <td height="22" align="center"><strong>栏目名称</strong></td>
    <td width="100" align="center"><strong>管理员</strong></td>
    <td width="80" align="center"><strong>栏目属性</strong></td>
    <td width="60" align="center"><strong>浏览权限</strong></td>
    <td width="60" align="center"><strong>添加权限</strong></td>
    <td width="300" height="22" align="center"><strong>操作选项</strong></td>
  </tr>
  <% 
do while not rsClass.eof 
%>
  <tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'"> 
    <td> <% 
	iDepth=rsClass("Depth")
	if rsClass("NextID")>0 then
		arrShowLine(iDepth)=True
	else
		arrShowLine(iDepth)=False
	end if
	if iDepth>0 then
	  	for i=1 to iDepth 
			if i=iDepth then 
				if rsClass("NextID")>0 then 
					response.write "<img src='images/tree_line1.gif' width='17' height='16' valign='abvmiddle'>" 
				else 
					response.write "<img src='images/tree_line2.gif' width='17' height='16' valign='abvmiddle'>" 
				end if 
			else 
				if arrShowLine(i)=True then
					response.write "<img src='images/tree_line3.gif' width='17' height='16' valign='abvmiddle'>" 
				else
					response.write "<img src='images/tree_line4.gif' width='17' height='16' valign='abvmiddle'>" 
				end if
			end if 
	  	next 
	  end if 
	  if rsClass("Child")>0 then 
	  	response.write "<img src='Images/tree_folder4.gif' width='15' height='15' valign='abvmiddle'>" 
	  else 
	  	response.write "<img src='Images/tree_folder3.gif' width='15' height='15' valign='abvmiddle'>" 
	  end if 
	  if rsClass("Depth")=0 then 
	  	response.write "<b>" 
	  end if 
	  response.write "<a href='Admin_ClassModify.asp?ClassID=" & rsClass("ClassID") & "' title='" & rsClass("ReadMe") & "'>" & rsClass("ClassName") & "</a>"
	  if rsClass("Child")>0 then 
	  	response.write "（" & rsClass("Child") & "）" 
	  end if
	  
	  
	  'response.write "&nbsp;&nbsp;" & rsClass("ClassID") & "," & rsClass("PrevID") & "," & rsClass("NextID") & "," & rsClass("ParentID") & "," & rsClass("RootID")
	  %> </td>
    <td> <%
	if rsClass("ClassMaster")<>"" then
		response.write rsClass("ClassMaster")
	else
		response.write "&nbsp;"
	end if
	%> </td>
    <td width="80" align="center"> <%
	if rsClass("LinkUrl")<>"" then
		response.write "<font color=red>外部</font>，"
	else
		response.write "<font color=green>系统</font>，"
	end if
	if rsClass("IsElite")=True then
		response.write "<font color=blue>推荐</font>"
	else
		response.write "普通"
	end if
	%> </td>
    <td align="center"> <%
	select case rsClass("BrowsePurview")
	case 9999
		response.write "游客"
	case 999
		response.write "注册用户"
	case 99
		response.write "收费用户"
	case 9
		response.write "VIP用户"
	case 5
		response.write "管理员"
	end select%> </td>
    <td align="center">
      <%
	select case rsClass("AddPurview")
	case 999
		response.write "注册用户"
	case 99
		response.write "收费用户"
	case 9
		response.write "VIP用户"
	case 5
		response.write "管理员"
	end select%>
    </td>
    <td align="center"><a href="Admin_ClassAdd.asp?ParentID=<%=rsClass("ClassID")%>">添加子栏目</a> 
      | <a href="Admin_ClassModify.asp?ClassID=<%=rsClass("ClassID")%>">修改设置</a> 
      | <a href="Admin_ClassMove.asp?ClassID=<%=rsClass("ClassID")%>">移动栏目</a> 
      | <a href="Admin_ClassDel.asp?ClassID=<%=rsClass("ClassID")%>&Action=Clear" onClick="return ConfirmDel3();">清空</a> 
      | <a href="Admin_ClassDel.asp?ClassID=<%=rsClass("ClassID")%>&Action=Del" onClick="<%if rsClass("Child")>0 then%>return ConfirmDel1();<%else%>return ConfirmDel2();<%end if%>">删除</a></td>
  </tr>
  <% 
	rsClass.movenext 
loop 
%>
</table> 
</body> 
</html> 
<% 
rsClass.close 
set rsClass=nothing 
call CloseConn() 
%> 
