<!-- #include file="conn.asp"-->
<% 
set rs1=server.createobject("adodb.recordset") 
sql1="select * from news_class where parentid=0 order by classid" 
rs1.open sql1,conn,1,1 
if rs1.eof or rs1.bof then 
response.write"还没分类!" 
else 
call reclass(0) 
end if 
rs1.close 
set rs1=nothing 
sub reclass(id) 
'递归调用函数,生成一个类别代码 
	set rs=server.createobject("adodb.recordset") 
	sql="select * from news_class where parentid="&id 
	rs.open sql,conn,1,1 
	i=1
	while not rs.eof 
	id0=rs("classid") 
	classname0=rs("classname") 
	parentid0=rs("parentid") 
	classdepth0=rs("classdepth")
	brstr=""
	for j=1 to classdepth0 *2
		brstr="&nbsp;"&brstr
	next
%><style type="text/css">
<!--
body,td,th {
	font-size: 12px;
}
-->
</style>
<link href="css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
	background-color: #F4F2E8;
}
-->
</style><form action="news_class_exe.asp?exe=modify&amp;classID=<%=rs("classID")%>" method="post" target="blank">
<%=brstr%>└classid:<%=rs("classID")%>
  <input name="className" type="text" id="className" value="<%=rs("className")%>" />
  <input type="submit" name="Submit" value="修改" />
  <a href="news_class_exe.asp?exe=del&amp;classid=<%=rs("classID")%>" target="blank">删除</a>

  <input type="button" name="Submit2" value="添加" onclick="add('<%=rs("classID")%>')" />
</form>
<div id="div_<%=rs("classid")%>"></div>
<%
	call reclass(id0) 
	
	rs.movenext 
	i=i+1
	wend 
	rs.close 
	set rs=nothing 
end sub
%>
<iframe name="blank"  width="0" height="0"></iframe>

<script>
function add(classID){
var str
str="<form action=help_class_exe.asp?exe=add&classid="+classID+" method=post target=blank>"
str=str+"类别名：<input name=classname type=text id=classname>&nbsp;<input type=submit name=Submit value=提交></form>"
eval("document.all.div_"+classID+".innerHTML=str")
}
</script>


