<!--#include file="Access.asp"  -->
<!-- #include file="inc/functions.asp" -->
<!-- #include file="page_next.asp" -->

	<%
Call header()
%>
<script language="JavaScript">
<!--
function ask(msg) {
	if( msg=='' ) {
		msg='警告：删除后将不可恢复，可能造成意想不到后果？';
	}
	if (confirm(msg)) {
		return true;
	} else {
		return false;
	}
}
//-->
</script>

<SCRIPT language=javascript>
<!--
function class_show(meval)
{
  var left_n=eval(meval);
  if (left_n.style.display=="none")
  { eval(meval+".style.display='';"); }
  else
  { eval(meval+".style.display='none';"); }
}
-->
</SCRIPT>
	<table cellpadding='3' cellspacing='1' border='0' class='tableBorder' align=center>
	<tr>
	  <th width="100%" height=25 class='tableHeaderText'>新闻分类列表</th>
	
	<tr><td height="400" valign="top"  class='forumRow'><table width="80%" border="0" align="center" cellpadding="0" cellspacing="2">
          <tr>
            <td width="6%" height="30" bgcolor="#A5C6FC">&nbsp;</td>
            <td width="36%" height="30" bgcolor="#A5C6FC"><div align="center" style="font-weight: bold">分类名称</div></td>
            <td width="16%" bgcolor="#A5C6FC"><div align="center" style="font-weight: bold">分类类型</div></td>
            <td width="42%" bgcolor="#A5C6FC"><div align="center" style="font-weight: bold">分类操作</div></td>
          </tr>
		  <%'输出一级分类
strFileName="category_list.asp" 
pageno=100
		set rs=server.createobject("adodb.recordset")
sql="select id,pid,ppid,name,folder from category where ppid=1 order by id"
rs.open(sql),cn,1,1
rscount=rs.recordcount
if not rs.eof and not rs.bof then
call showsql(pageno)
rs.move(rsno)
for p_i=1 to loopno
		  %>
          <tr >
            <td  onClick="javascript:class_show('class_<%=rs("id")%>');" height="30" bgcolor="#B3D8F9" ><div align="center"><img src="images/tree_folder1.gif"></div></td>
            <td bgcolor="#B3D8F9" onClick="javascript:class_show('class_<%=rs("id")%>');">&nbsp;<%=rs("name")%>(<%=rs("id")%> | <a href="category_edit.asp?id=<%=rs("id")%>&ppid=1&page=<%=page%>&act=<%=act%>&keywords=<%=keywords%>"><%=rs("folder")%></a>)</td>
            <td bgcolor="#B3D8F9" >
            <div align="center">一级分类            </div></td>
            <td bgcolor="#B3D8F9" >
            <div align="center"><a href="category_add.asp?pid_name=<%=rs("name")%>&pid=<%=rs("id")%>&ppid=2&page=<%=page%>&act=<%=act%>&keywords=<%=keywords%>">添加二级分类</a> | <a href="category_edit.asp?id=<%=rs("id")%>&ppid=1&page=<%=page%>&act=<%=act%>&keywords=<%=keywords%>">分类设置</a> | <a href="article_list.asp?cid=<%=rs("id")%>&act=search">文章管理</a> | <a href="javascript:if(ask('警告：删除后将不可恢复，可能造成意想不到后果？')) location.href='category_del.asp?id=<%=rs("id")%>&page=<%=page%>&act=<%=act%>&keywords=<%=keywords%>';">删除分类</a>            </div></td>
          </tr>
		    <tr id="class_<%=rs("id")%>" style="DISPLAY: none">
            <td height="35"  colspan="4" ><table width="100%" border="0" align="center" cellpadding="0" cellspacing="2">
					  <%'输出二级分类
		  set rs2=server.createobject("adodb.recordset")
sql="select id,pid,ppid,name,folder from category where ppid=2 and pid="&rs("id")&" order by id"
rs2.open(sql),cn,1,1
if not rs2.eof and not rs2.bof then
		  do while not rs2.eof
		  %>
			  <tr ><td width="6%" height="27" bgcolor="#CEE6FB"  onClick="javascript:class_show('class_<%=rs2("id")%>');"><div align="center"><img src="images/tree_folder2.gif"></div></td>
            <td width="37%" bgcolor="#CEE6FB"  onClick="javascript:class_show('class_<%=rs2("id")%>');" >&nbsp;<%=rs2("name")%>(<%=rs2("id")%> | <a href="category_edit.asp?id=<%=rs2("id")%>&pid_name=<%=rs("name")%>&ppid=2"><%=rs2("folder")%></a>)</td>
            <td width="15%" bgcolor="#CEE6FB"  >
              <div align="center">二级分类            </div></td>
            <td width="42%" bgcolor="#CEE6FB"  >
              <div align="center"><a href="category_add.asp?pid_name=<%=rs("name")%>&pid_name2=<%=rs2("name")%>&pid=<%=rs2("id")%>&ppid=3">添加三级分类</a> | <a href="category_edit.asp?id=<%=rs2("id")%>&pid_name=<%=rs("name")%>&ppid=2">分类设置</a> | <a href="article_list.asp?pid=<%=rs2("id")%>&act=search">文章管理</a> | <a href="javascript:if(ask('警告：删除后将不可恢复，可能造成意想不到后果？')) location.href='category_del.asp?id=<%=rs2("id")%>';">删除分类</a> </div>			  </td></tr>
			  
			     <tr id="class_<%=rs2("id")%>" style="DISPLAY: none">
            <td height="35"  colspan="4" ><table width="100%" border="0" align="center" cellpadding="0" cellspacing="2">
					  <%'输出三分类
		  set rs3=server.createobject("adodb.recordset")
sql="select id,pid,ppid,name,folder from category where ppid=3 and pid="&rs2("id")&" order by id"
rs3.open(sql),cn,1,1
if not rs3.eof and not rs3.bof then
		  do while not rs3.eof
		  %>
			  <tr ><td width="7%" height="23" class='forumRowHighLight'  ></td>
            <td width="37%" class='forumRowHighLight'  >&nbsp;<%=rs3("name")%>(<%=rs3("id")%> | <%=rs3("folder")%>)</td>
            <td width="14%" class='forumRowHighLight'  >
              <div align="center">三级分类            </div></td>
            <td width="42%" class='forumRowHighLight'  >
              <div align="center"><a href="category_edit.asp?id=<%=rs3("id")%>&pid_name=<%=rs("name")%>&pid_name2=<%=rs2("name")%>&ppid=3">分类设置</a> | <a href="article_list.asp?cid=<%=rs3("id")%>&act=search">文章管理</a> | <a href="javascript:if(ask('警告：删除后将不可恢复，可能造成意想不到后果？')) location.href='category_del.asp?id=<%=rs3("id")%>';">删除分类</a> </div>			  </td></tr>
					  <%
		  rs3.movenext
		  loop 
else
response.write "<div align='center'><span style='color: #FF0000'>无下级分类！</span></div>"
end if 
		  rs3.close
		  set rs3=nothing
		  %> </table> </td>
          </tr>
					  <%
		  rs2.movenext
		  loop 
else
response.write "<div align='center'><span style='color: #FF0000'>无下级分类！</span></div>"
end if 
		  rs2.close
		  set rs2=nothing
		  %> </table> </td>
          </tr>
		  		  <%
		  rs.movenext
		  next
		  else
response.write "<div align='center'><span style='color: #FF0000'>暂无数据！</span></div>"
		  end if 
		  rs.close
		  set rs=nothing
		  %>
		  		    <tr  >
              <td height="35"  colspan="4" ><div align="center">
                <%call showpage(strFileName,rscount,pageno,false,true,"")%>
           </div></td>
		    </tr>
      </table>
	    <br></td>
	</tr>
	</table>

<%
Call DbconnEnd()
 %>