<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Conn/conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" href="../css/indexTwo.css" type="text/css">
<title>网站后台</title>
</head>
<body>
<table width="100%" border="0" cellspacing="1" class="Navi2">
  <tr>
    <th>信息类别列表</th>
  </tr>
</table>
<table width="100%" border="0" cellspacing="1" class="Navi2">
<tr>
	<td>类别名称</td>
	<td style="text-align:center">操作</td>
</tr>
<%
sql="select * from TbNewsSort where pid=0 order by [order] asc"
rs.open sql,conn,1,1
if not rs.eof then
	do while not rs.eof 
		call sortShow(1,rs("name"),rs("id"))
		call Sort2(rs("id"))
		rs.movenext
	loop
end if
rs.close
%>
  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
</table>
</body>
</html>
<!--#include file="../Conn/conn_close.asp"-->
<%
sub sortShow(rank,SortName,SortID)
	response.Write("<tr onmouseout=""style.backgroundColor=''"" onMouseover=""style.backgroundColor='#bfdfff'"">")
	response.Write("<td>")
	for i=1 to rank 
		response.Write("&nbsp;&nbsp;&nbsp;&nbsp;")
	next
	response.Write("<img src='../images/file1.gif'>")
	response.Write(SortName)
	response.Write("</td>")
	response.Write("<td style='text-align:center;width:300px;'>")
	call GetManager(SortID)
	response.Write("</td>")
	response.Write("</tr>")
end sub
sub Sort2(SortPid)
	sql2="select * from TbNewsSort where pid="&SortPid&" order by [order] asc"
	rs2.open sql2,conn,1,1
	if not rs2.eof then
		do while not rs2.eof
			call sortShow(2,rs2("name"),rs2("id"))
			call Sort3(rs2("id"))
			rs2.movenext
		loop
	end if
	rs2.close
end sub
sub Sort3(SortPid)
	set rs3=server.CreateObject("adodb.recordset")
	sql3="select * from TbNewsSort where pid="&SortPid&" order by [order] asc"
	rs3.open sql3,conn,1,1
	if not rs3.eof then
		do while not rs3.eof
			call sortShow(3,rs3("name"),rs3("id"))
			call Sort4(rs3("id"))
			rs3.movenext
		loop
	end if

	rs3.close
end sub
sub Sort4(SortPid)
	set rs4=server.CreateObject("adodb.recordset")
	sql4="select * from TbNewsSort where pid="&SortPid&" order by [order] asc"
	rs4.open sql4,conn,1,1
	if not rs4.eof then
		do while not rs4.eof
			call sortShow(4,rs4("name"),rs4("id"))
			call Sort5(rs4("id"))
			rs4.movenext
		loop
	end if
	rs4.close
end sub
sub Sort5(SortPid)
	set rs5=server.CreateObject("adodb.recordset")
	sql5="select * from TbNewsSort where pid="&SortPid&" order by [order] asc"
	rs5.open sql5,conn,1,1
	if not rs5.eof then
		do while not rs5.eof
			call sortShow(5,rs5("name"),rs5("id"))
			rs5.movenext
		loop
	end if
	rs5.close
end sub

sub GetManager(SortID)
	set rsn=server.CreateObject("adodb.recordset")
	sqln="select top 1 * from TbNewsSort where pid="&SortID
	rsn.open sqln,conn,1,1
	if rsn.eof then
		response.Write("<img src='../images/icon_show.gif' >&nbsp;")
		response.Write("<a href='News_List.asp?SortID="&SortID&"' class='link2'>")
		response.Write("查看")
		response.Write("</a>")	
	end if
	rsn.close
end sub
%>