<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css.css" rel="stylesheet">
<title>目录树</title>
<script type="text/javascript">
function ConfirmDel()
{
   if(confirm("确认删除？并且不能恢复！确定要删除此栏目吗？"))
     return true;
   else
     return false;	 
}
</script>
</head>
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p01")
'''''''''''''''''''''''''''''''''''''''''''''''
Dim classSql,rs,parentid,classArr
parentid=Cint(request("classid"))
classSql = "Select id,parentid,title from catalogs where parentID="&parentid
Set rs = Conn.Execute(classSql)
if not rs.eof and not rs.bof then
	classArr=rs.GetRows()
	rs.close
	set rs = Nothing
else
	response.Write("没有分类，请先添加分类！<br><a href=""classadd.asp?id=0"">&nbsp;&nbsp;添加==></a>")
	rs.close
	set rs = Nothing
	call connclose()
	response.End()
end if
Function GetChildClassList(ClassID,Str)
	Dim Sql,RsTempObj,TempImageStr,ImageStr
	TempImageStr = "<img src=""../Images/folder-.gif"" width=""18"" height=""18""><img src=""../Images/folder.gif"" width=""18"" height=""18"">"
	Sql = "Select id,parentid,title from catalogs where ParentID=" & ClassID
	ImageStr = Str & "<img src=""../Images/folderHR.gif"" width=""18"" height=""18"">"
	Set RsTempObj = Conn.Execute(Sql)
	do while Not RsTempObj.Eof
		GetChildClassList = GetChildClassList & "<tr><td><table border=""0"" cellspacing=""0"" cellpadding=""0""><tr class=""TempletItem"">"
		GetChildClassList = GetChildClassList & "<td>"&ImageStr&TempImageStr&"</td><td>"&RsTempObj("id")&"-<a href=""classmodi.asp?id="&RsTempObj("id")&""" title=""查看栏目详细信息"">"&RsTempObj("title")&"</a>"
		GetChildClassList = GetChildClassList & "&nbsp;<a href=""classadd.asp?id="&RsTempObj("id")&""" title=""添加子栏目"">+</a>&nbsp;<a href=""classdele.asp?id="&RsTempObj("id")&""" title=""删除栏目"" onClick=""return ConfirmDel()"">-</a>&nbsp;<a href=""classview.asp?id="&RsTempObj("id")&""" title=""预览"">预览</a></td></tr></table></td></tr>"
		GetChildClassList = GetChildClassList & GetChildClassList(RsTempObj("id"),ImageStr)
		RsTempObj.MoveNext
	loop
	RsTempObj.close
	Set RsTempObj = Nothing
End Function
%>
<body topmargin="0" leftmargin="0">
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><iframe src="right_top.htm" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" height="30" width="100%"></iframe></td>
  </tr>
</table>
<table width="100%"  border="0" cellspacing="0" cellpadding="0" style="border:1px solid #666666; ">  
  <tr>
    <td width="20" bgcolor="#F0EFEC">&nbsp;</td>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
      <tr>
        <td bgcolor="#FFFFFF">
          <table border="0" cellspacing="0" cellpadding="0">
            <tr align="left" class="TempletItem">
              <td><img src="../Images/Folderk.gif" width="18" height="18"></td>
              <td>系统根栏目&nbsp;<a href="classadd.asp?id=0" title="添加子栏目">+</a></td>
            </tr>
        </table></td>
      </tr>
      <%
		for ii=0 to ubound(classArr,2)
	  %>
      <tr>
        <td bgcolor="#FFFFFF"><table border="0" cellspacing="0" cellpadding="0">
            <tr align="left" class="TempletItem">
              <td><img src="../Images/folder-.gif" width="18" height="18"><img src="../Images/Folder.gif"></td>
              <td>
			  <%=classArr(0,ii)%>-<a href="classmodi.asp?id=<%=classArr(0,ii)%>"  title="查看栏目详细信息"><%=classArr(2,ii)%></a>
			  &nbsp;<a href="classadd.asp?id=<%=classArr(0,ii)%>" title="添加子栏目">+</a>&nbsp;<a href="classdele.asp?id=<%=classArr(0,ii)%>" title="删除栏目" onClick="return ConfirmDel()">-</a> <a href="classview.asp?id=<%=classArr(0,ii)%>" target="_blank">预览</a>
			  </td>
            </tr>
        </table></td>
      </tr>
      	<%
			Response.Write(GetChildClassList(classArr(0,ii),""))
		next
		%>
    </table></td>
  </tr>
</table>
</body>
</html>
<%call connclose()%>