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

📄 booklist.asp

📁 很把错的图书管理系统——是学校教学的很好的范例
💻 ASP
字号:
<%@ Language=VBScript %>
<!--#include file ="identify.asp"-->
<%
	Response.Expires = 0
	b_type = Request.QueryString("b_type")
%>
<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft FrontPage 4.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_introduce(bookid)
{
	window.open("add_introduce.asp?bookid=" + bookid,"_blank","height=430,width=300,status=no,toolbar=no,menubar=no,location=no");
}
function add_new(bookid)
{
	window.open("add_new.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>
<div id=div1>(正在查询库,请稍候.....)</div>
<b>书名列表</b><br><hr>
<%
	if len(b_type)=0 then
		Response.End
	end if
	
	
	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 bookid,name,Author,times from BookDetail where  type=" & b_type 
	
	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 "没有符合条件的记录。"
%>
<script language=javascript>
	div1.style.display = "none";
</script>
</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>页。" 
	if int(strPage) > 1 then
		Response.Write "&nbsp;<a href='booklist.asp?b_type=" & b_type & "&page=" & cstr(cint(strPage) - 1) & "'>上一页</a>"
	end if
	if int(strPage) < select_PageCount then
		Response.Write "&nbsp;<a href='booklist.asp?b_type=" & b_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> &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>
<%
		if session("usertype")<=1 then
%>
  &nbsp;<a href="#" onclick="add_introduce(<%=rs("bookid")%>)">推荐</a>
<%
		end if
%>
<%
		if session("usertype")<=1 then
%>
  &nbsp;<a href="#" onclick="add_new(<%=rs("bookid")%>)">加入新书列表</a>
<%
		end if
%>
</nobr><br>
<%
		rs.MoveNext
	next
	rs.Close
	set rs = nothing
	conn.Close
	set conn = nothing
	
%>

<script language=javascript>
	div1.style.display = "none";
</script>
</body>
</html>

⌨️ 快捷键说明

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