⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 leibie2.asp

📁 是个不错的文件代码,希望大家好好用,
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
if Session("isAdmin")<>true Then
Response.Write "非法闯入!"
Response.End
End if
%>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<style type="text/css">
body {font-size:13px}
</style>
</HEAD>
<%
dim rs(5)
function listunder(i)
	set rs(i)=server.createobject("adodb.recordset")
	rs(i).open "select classid,classname,verity from feilei where topclass="&rs(i-1)("classid"),conn,1,3
	while not rs(i).eof
		dim topclassname
		topclassname=""
		for x=0 to i-1
			topclassname=topclassname&rs(x)("classname")&">"
		next
		fujia=""
		if rs(i)("verity")<>1 then fujia="(未审核)"
		response.write "<option value='"&rs(i)("classid")&"'>"&topclassname&rs(i)("classname")&fujia&"</option>"&vbCrLf
		if i<Ubound(rs) then
			call listunder(i+1)
		end if
		rs(i).movenext
	wend
end function
%>
<BODY>

<%
if action="add" then
	if classname="" or leibie="" then
		Response.Write "表单填写不完整!"
		Response.End
	end if
	if Session("lastadded")<>classname then
		set rss=server.createobject("adodb.recordset")
		rss.open "select * from feilei",conn,1,3
		rss.addnew
		rss("classname")=classname
		rss("topclass")=leibie
		set r=server.createobject("adodb.recordset")
		r.open "select * from feilei where classid="&leibie,conn,1,3
		if not r.eof then
			level=r("level")+1
		else
			level=1
		end if
		r.close
		set r=nothing
		rss("level")=level
		if memo="" then memo=" "
		rss("memo")=memo
		rss("verity")=1
		rss.update
		rss.close
		set rss=nothing
		Session("lastadded")=classname
		Response.Write "<table width=100% height=100%\><tr><td width=100% height=100% align=center>"
		Response.Write "新网站分类已经成功添加!!"
		Response.Write "</td></tr></table>"
		Response.End
	end if
end if
if action="delete" then
	if leibie=0 then
		Response.Write "请选择一个类别!"
		Response.End
	end if
	if Session("lastdeleted")<>leibie then
		conn.execute "delete from feilei where classid="&leibie
		Session("lastdeleted")=leibie
		Response.Write "<table width=100% height=100%\><tr><td width=100% height=100% align=center>"
		Response.Write "新网站分类已经成功添加!!"
		Response.Write "</td></tr></table>"
		Response.End
	end if
end if
if action="verity" then
	if leibie=0 then
		Response.Write "请选择一个类别!"
		Response.End
	end if
	if Session("lastverityed")<>leibie then
		conn.execute "update feilei set verity=1 where classid="&leibie
		Session("lastverityed")=leibie
		Response.Write "<table width=100% height=100%\><tr><td width=100% height=100% align=center>"
		Response.Write "你选中网站分类已经成功通过验证!"
		Response.Write "</td></tr></table>"
		Response.End
	end if
end if
if action="rename" then
	if leibie=0 then
		Response.Write "请选择一个类别!"
		Response.End
	end if
	if newname="" then
		Response.Write "需要新的分类名称!"
		Response.End
	end if
	if Session("renamed")<>leibie then
		conn.execute "update feilei set classname='"&newname&"' where classid="&leibie
		Session("renamed")=leibie
		Response.Write "<table width=100% height=100%\><tr><td width=100% height=100% align=center>"
		Response.Write "你选中网站分类已经成功更名!"
		Response.Write "</td></tr></table>"
		Response.End
	end if
end if
%>

<br><br>
<big><big>添加新类别</big></big>
<br>
<form action="leibie.asp" method="post">
类别名称:<input name="classname" size="15">
  <br>
  <input type="radio" name="ljj" value="radiobutton" checked onclick="dv1.style.display='none';">
  一级&nbsp; 
  <input type="radio" name="ljj" value="radiobutton" onclick="dv1.style.display='';">
  二级<br>
<div id=dv1 style="display:none">
上级类别:<select name="leibie">
<%
set rs(0)=server.createobject("adodb.recordset")
rs(0).open "select classid,classname,verity from feilei where topclass=0",conn,1,3
while not rs(0).eof
	fujia=""
	if rs(0)("verity")<>1 then fujia="(未审核)"
	response.write "<option value='"&rs(0)("classid")&"'>"&rs(0)("classname")&fujia&"</option>"&vbCrLf
	call listunder(1)
	rs(0).movenext
wend
%>
</select><br>
</div>
其他信息:<input name="memo" size="50"><br>
<input type="hidden" name="action" value="add">
<input type="submit" value="添加新类别">
</form>
<br><br>
<big><big>删除类别</big></big>
<br>
<form action="leibie.asp" method="post">
类别名称:<select name="leibie">
<option selected value="0">请选择一个类别</option>
<%
set rs(0)=server.createobject("adodb.recordset")
rs(0).open "select classid,classname,verity from feilei where topclass=0",conn,1,3
while not rs(0).eof
	fujia=""
	if rs(0)("verity")<>1 then fujia="(未审核)"
	response.write "<option value='"&rs(0)("classid")&"'>"&rs(0)("classname")&fujia&"</option>"&vbCrLf
	call listunder(1)
	rs(0).movenext
wend
%>
</select><br>
<input type="hidden" name="action" value="delete">
<input type="submit" value="删除此类别">
</form>
<br><br>
<big><big>验证新提交类别</big></big>
<br>
<form action="leibie.asp" method="post">
未验证类别:<select name="leibie">
<option selected value="0">请选择一个类别</option>
<%
set rs(0)=server.createobject("adodb.recordset")
rs(0).open "select classid,classname,verity from feilei where topclass=0 and verity=0",conn,1,3
while not rs(0).eof
	fujia=""
	if rs(0)("verity")<>1 then fujia="(未审核)"
	response.write "<option value='"&rs(0)("classid")&"'>"&rs(0)("classname")&fujia&"</option>"&vbCrLf
	call listunder(1)
	rs(0).movenext
wend
%>
</select><br>
<input type="hidden" name="action" value="verity">
<input type="submit" value="此类别通过验证">
</form>
<br><br>
<big><big>更改类别名称</big></big>
<br>
<form action="leibie_execute.asp" method="post">
类别名称:<select name="leibie">
<option selected value="0">请选择一个类别</option>
<%
set rs(0)=server.createobject("adodb.recordset")
rs(0).open "select classid,classname,verity from feilei where topclass=0",conn,1,3
while not rs(0).eof
	fujia=""
	if rs(0)("verity")<>1 then fujia="(未审核)"
	response.write "<option value='"&rs(0)("classid")&"'>"&rs(0)("classname")&fujia&"</option>"&vbCrLf
	call listunder(1)
	rs(0).movenext
wend
%>
</select><br>
类别名称更改为:<input name="newname">
<input type="hidden" name="action" value="rename">
<input type="submit" value="确定更改">
</form>
<br><br>
*未通过审核的类别不在前台显示(包括其下属分类及网站)
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -