searchresult.asp
资源名称:图书管理系统.rar [点击查看]
上传用户:llrg7406
上传日期:2007-03-02
资源大小:654k
文件大小:3k
源码类别:
教育系统应用
开发平台:
Delphi
- <%@ Language=VBScript %>
- <!--#include file ="identify.asp"-->
- <%
- Response.Expires = 0
- search_text = request.querystring("search_text")
- search_type = request.querystring("search_type")
- %>
- <html>
- <head>
- <meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
- <link rel="stylesheet" type="text/css" href="xcss.css">
- <script LANGUAGE="javascript">
- <!--
- function add_bm(bookid)
- {
- window.open("add_bookmark.asp?bookid=" + bookid,"_blank","height=430,width=300,status=no,toolbar=no,menubar=no,location=no");
- }
- function add_comment(bookid)
- {
- 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");
- }
- //-->
- </script></head>
- <body background=images/zapsmbknd.gif>
- <b>书名列表(访问次数)</b><br><hr>
- <%
- strPage = Request.queryString("page")
- if len(strPage) = 0 then
- strPage = "1"
- end if
- set conn = server.CreateObject("adodb.connection")
- conn.Open application("dsn")
- 'sql = "select top 10 name,Author from BookDetail "
- sql = "select bookid,name,Author,Times from BookDetail where " & search_type & " like '%" & search_text & "%' "
- set rs = server.CreateObject("adodb.recordset")
- rs.CursorLocation = 3 '客户端处理游标
- rs.Open sql,conn
- if rs.EOF then
- rs.Close
- set rs = nothing
- conn.Close
- set conn = nothing
- Response.Write "没有符合条件的记录。"
- Response.Write "</body></html>"
- Response.End
- end if
- rs.PageSize = 20
- rs.absolutepage=cint(strPage)
- select_count = rs.RecordCount
- select_PageCount = rs.PageCount
- Response.Write "共<b>" & select_PageCount & "</b>页<b>" & select_count & "</b>条记录,本页是第<b>" & strPage & "</b>页。<br>"
- if int(strPage) > 1 then
- Response.Write " <a href='searchresult.asp?search_text=" & search_text & "&search_type=" & search_type & "&page=" & cstr(cint(strPage) - 1) & "'>上一页</a>"
- end if
- if int(strPage) < select_PageCount then
- Response.Write " <a href='searchresult.asp?search_text=" & search_text & "&search_type=" & search_type & "&page=" & cstr(cint(strPage) + 1) & "'>下一页</a>"
- end if
- Response.Write "<br><br>"
- for i = 1 to rs.PageSize
- if rs.EOF then
- exit for
- end if
- %>
- <nobr><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> <%=rs("Author")%> <a href="#" onclick="add_bm(<%=rs("bookid")%>);">加书签</a> <a href="#" onclick="add_comment(<%=rs("bookid")%>);">写书评</a></nobr><br>
- <%
- rs.MoveNext
- next
- rs.Close
- set rs = nothing
- conn.Close
- set conn = nothing
- %>
- </body>
- </html>