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

📄 levellistfile.asp

📁 很把错的图书管理系统——是学校教学的很好的范例
💻 ASP
字号:
<%@ Language=VBScript%>
<!--#include file ="identify.asp"-->
<% 
Response.Expires = 0 
Dim fs, f
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile(server.MapPath("./levellist.asp"),2,0)

dim conn
set conn = server.CreateObject("adodb.connection")
conn.Open application("dsn")

sql = "delete from bookwarelist0"
conn.Execute sql

sql = "insert into bookwarelist0 (id, title, type_id, parent,parent_type,parent_id) " _ 
		& " select a.id,a.title,a.type_id,a.parent,a.parent_type,b.id "_
		& " from bookwarelist a, bookwarelist b " _
		& " where a.parent = b.title and a.parent_type = 0 and a.id <> b.id"
conn.Execute sql


sql = "insert into bookwarelist0 (id, title, type_id, parent,parent_type,parent_id) " _ 
		& " select a.id,a.title,a.type_id,a.parent,a.parent_type,b.id "_
		& " from bookwarelist a, bookwarelist b " _
		& " where a.parent_type = b.type_id and a.parent_type > 0 and a.id <> b.id" 
conn.Execute sql

sql = "delete from bookwarelist0 where id in " _
		& " (select id from bookwarelist0 group by id having count(id) > 1)"
conn.Execute sql

sub recursion(id,m_title,m_type_id)
	dim rs

	f.writeline "<a name=""aa" & id & """></a>"
	f.writeline "<table CELLSPACING=""0"" CELLPADDING=""0"">"
	f.writeline "<tr>"
	f.writeline "<td colspan=""2"">"
	f.writeline "<a href=""#aa" & id & """ onclick=""diva_show('" & id & "','" & m_type_id & "');"" id=""link" & id & """>"
	f.writeline "<img name=""f" & id & """ SRC=""images/plus1.gif"" border=""0"" WIDTH=""16"" HEIGHT=""18"">"
	f.writeline "<img name=""i" & id & """ SRC=""images/icon_book_close.gif"" border=""0"">" & m_title & "</a><br>"
	f.writeline "</td>"
	f.writeline "</tr>"
	f.writeline "</table>"
	f.writeline "<div id=""a" & id & """ style=""display:none"">"
	f.writeline "<table WIDTH=""100%"" BORDER=""0"" CELLSPACING=""0"" CELLPADDING=""0"">"

	sql = "select id,title,type_id from bookwarelist0 where parent_id = " & id 
	
	set rs = server.CreateObject("adodb.recordset")
	rs.Open sql,conn
	while not rs.eof
		id0 = rs("id")
		title0 = rs("title")
		type_id0 = rs("type_id")
		
		f.writeline "<tr>"
		f.writeline "<td width=""18"">&nbsp;</td>"
		f.writeline "<td>"
		
		call recursion(id0,title0,type_id0)		

		f.writeline "</td>"
		f.writeline "</tr>"

		rs.movenext
	wend
	rs.close
	set rs = nothing

	f.writeline "</table>"
	f.writeline "</div>"

end sub 


f.writeline "<html>"
f.writeline "<head>"
f.writeline "<meta NAME=""GENERATOR"" Content=""Microsoft Visual Studio 6.0"">"
f.writeline "<link rel=""stylesheet"" type=""text/css"" href=""xcss.css"">"
f.writeline "<script language=""javascript"">"
f.writeline "	current_div_id = -1;"
f.writeline "	function diva_show(div_id,type_id)"
f.writeline "	{"
f.writeline "		if (document.all.item(""a""+div_id).style.display == ""block"")"
f.writeline "		{"
f.writeline "			document.all.item(""a""+div_id).style.display = ""none"";"
f.writeline "			document.all.item(""i""+div_id).src=""images/icon_book_close.gif"";"
f.writeline "			document.all.item(""f""+div_id).src=""images/plus1.gif"";"
f.writeline "		}"
f.writeline "		else"
f.writeline "		{"
f.writeline "			document.all.item(""a""+div_id).style.display = ""block"";"
f.writeline "			document.all.item(""i""+div_id).src=""images/icon_book_open.gif"";"
f.writeline "			document.all.item(""f""+div_id).src=""images/minus.gif"";"
f.writeline "		}"
f.writeline "		if (current_div_id != -1)"
f.writeline "		{"
f.writeline "			document.all.item(""link""+current_div_id).style.color = ""#000066""; "
f.writeline "		}"
f.writeline "		current_div_id = div_id;"
f.writeline "		document.all.item(""link""+div_id).style.color = ""red""; "
f.writeline "		if ((type_id != '0')&&(type_id != '')) "
f.writeline "		{"
f.writeline "			top.xbody.window.location = ""booklist.asp?b_type="" + type_id;"
f.writeline "		}"
f.writeline "	}"
f.writeline "</script>"
f.writeline "</head>"
f.writeline "<body topmargin=""0"" background=""images/zapsmbknd.gif"">"

f.writeline "<table WIDTH=""100%"" BORDER=""0"" CELLSPACING=""0"" CELLPADDING=""0"">"
f.writeline "<tr>"
f.writeline "<td colspan=""2""><img SRC=""images/win16.gif"" WIDTH=""16"" HEIGHT=""16"">&nbsp;<font style=""font-family:隶书,Arial;font-size:20px;font-weight:bold"">书库</font></td>"
f.writeline "</tr>"

f.writeline "</table>"

sql1 = "select id,title,type_id from bookwarelist0 where parent = '书库'"

Response.Write sql1
set rs1 = server.CreateObject("adodb.recordset")
rs1.Open sql1,conn
Response.Write rs1.EOF
while not rs1.eof
	id1 = rs1("id")
	title1 = rs1("title")
	type_id1 = rs1("type_id")

	call recursion(id1,title1,type_id1)
	rs1.movenext
wend

f.writeline "</body>"
f.writeline "</html>"
f.close
set f = nothing
set fs = nothing
conn.close
set conn = nothing

Response.Write "<br><br>书目列表生成完毕。"
%>

⌨️ 快捷键说明

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