booklist.asp
上传用户:llrg7406
上传日期:2007-03-02
资源大小:654k
文件大小:3k
源码类别:

教育系统应用

开发平台:

Delphi

  1. <%@ Language=VBScript %>
  2. <!--#include file ="identify.asp"-->
  3. <%
  4. Response.Expires = 0
  5. b_type = Request.QueryString("b_type")
  6. %>
  7. <html>
  8. <head>
  9. <meta NAME="GENERATOR" Content="Microsoft FrontPage 4.0">
  10. <link rel="stylesheet" type="text/css" href="xcss.css">
  11. <script LANGUAGE="javascript">
  12. <!--
  13. function add_bm(bookid)
  14. {
  15. window.open("add_bookmark.asp?bookid=" + bookid,"_blank","height=430,width=300,status=no,toolbar=no,menubar=no,location=no");
  16. }
  17. function add_introduce(bookid)
  18. {
  19. window.open("add_introduce.asp?bookid=" + bookid,"_blank","height=430,width=300,status=no,toolbar=no,menubar=no,location=no");
  20. }
  21. function add_new(bookid)
  22. {
  23. window.open("add_new.asp?bookid=" + bookid,"_blank","height=430,width=300,status=no,toolbar=no,menubar=no,location=no");
  24. }
  25. function add_comment(bookid)
  26. {
  27. window.open("add_comment2.asp?bookid=" + bookid,"_blank","height=550,width=550,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,top=0,left=0");
  28. }
  29. //-->
  30. </script></head>
  31. <body background=images/zapsmbknd.gif>
  32. <div id=div1>(正在查询库,请稍候.....)</div>
  33. <b>书名列表</b><br><hr>
  34. <%
  35. if len(b_type)=0 then
  36. Response.End
  37. end if
  38. strPage = Request.queryString("page")
  39. if len(strPage) = 0 then 
  40. strPage = "1"
  41. end if
  42. set conn = server.CreateObject("adodb.connection")
  43. conn.Open application("dsn")
  44. sql = "select bookid,name,Author,times from BookDetail where  type=" & b_type 
  45. set rs = server.CreateObject("adodb.recordset")
  46. rs.CursorLocation = 3   '客户端处理游标
  47. rs.Open sql,conn
  48. if rs.EOF then
  49. rs.Close
  50. set rs = nothing
  51. conn.Close
  52. set conn = nothing
  53. Response.Write "没有符合条件的记录。"
  54. %>
  55. <script language=javascript>
  56. div1.style.display = "none";
  57. </script>
  58. </body>
  59. </html>
  60. <%
  61. Response.End
  62. end if
  63. rs.PageSize = 20
  64. rs.absolutepage=cint(strPage)
  65. select_count = rs.RecordCount
  66. select_PageCount = rs.PageCount
  67. Response.Write "共<b>" & select_PageCount & "</b>页<b>" & select_count & "</b>条记录,本页是第<b>" & strPage & "</b>页。" 
  68. if int(strPage) > 1 then
  69. Response.Write "&nbsp;<a href='booklist.asp?b_type=" & b_type & "&page=" & cstr(cint(strPage) - 1) & "'>上一页</a>"
  70. end if
  71. if int(strPage) < select_PageCount then
  72. Response.Write "&nbsp;<a href='booklist.asp?b_type=" & b_type & "&page=" & cstr(cint(strPage) + 1) & "'>下一页</a>"
  73. end if
  74. Response.Write "<br><br>"
  75. for i = 1 to rs.PageSize
  76. if rs.EOF then 
  77. exit for
  78. end if
  79. %>
  80. <nobr>
  81. <a href="readbook.asp?bookid=<%=rs("bookid")%>" title="作者:<%=rs("Author")%>" target="xbody"><img SRC="images/plus.gif" border="0" WIDTH="18" HEIGHT="19"><%=rs("name")%> (点击<%=rs("times")%>次)</a> &nbsp;<%=rs("Author")%>  &nbsp;<a href="#" onclick="add_bm(<%=rs("bookid")%>);">加书签</a>  &nbsp;<a href="#" onclick="add_comment(<%=rs("bookid")%>);">写书评</a>  &nbsp;<a href="bookcomment1.asp?bookid=<%=rs("bookid")%>">看书评</a>
  82. <%
  83. if session("usertype")<=1 then
  84. %>
  85.   &nbsp;<a href="#" onclick="add_introduce(<%=rs("bookid")%>)">推荐</a>
  86. <%
  87. end if
  88. %>
  89. <%
  90. if session("usertype")<=1 then
  91. %>
  92.   &nbsp;<a href="#" onclick="add_new(<%=rs("bookid")%>)">加入新书列表</a>
  93. <%
  94. end if
  95. %>
  96. </nobr><br>
  97. <%
  98. rs.MoveNext
  99. next
  100. rs.Close
  101. set rs = nothing
  102. conn.Close
  103. set conn = nothing
  104. %>
  105. <script language=javascript>
  106. div1.style.display = "none";
  107. </script>
  108. </body>
  109. </html>