levellistfile.asp
资源名称:图书管理系统.rar [点击查看]
上传用户:llrg7406
上传日期:2007-03-02
资源大小:654k
文件大小:5k
源码类别:
教育系统应用
开发平台:
Delphi
- <%@ 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""> </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""> <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>书目列表生成完毕。"
- %>