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

📄 read_class.asp

📁 很把错的图书管理系统——是学校教学的很好的范例
💻 ASP
字号:
<%@ Language=VBScript %>
<!--#include file ="identify.asp"-->
<%
	parent_title = Request.QueryString("title")
	parent_type_id = Request.QueryString("type_id")
%>
<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<link rel="stylesheet" type="text/css" href="xcss.css">
<STYLE>
<!--
#page {position:absolute; z-index:0; left:0px; top:0px}
.tt3 {font: 9pt/12pt "宋体"}
.tt2 {font: 12pt/15pt "宋体"}
a {color: blue;text-decoration:none}
a:hover {color: blue;text-decoration:underline}
-->
</style>
<script language=javascript>
function show_onclick() {
	if(top.window.f2.cols != "0,*")
	{
		top.window.f2.cols = "0,*";
	}
	else
	{
		top.window.f2.cols = "300,*";
	}
}
</script>
<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");
}
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_introduce(bookid)
{
	window.open("add_introduce.asp?bookid=" + bookid,"_blank","height=430,width=300,status=no,toolbar=no,menubar=no,location=no");
}
//-->
</script></head>

<body topmargin="0" background="images/zapsmbknd.gif">

<TABLE BORDER=0 CELLSPACING=0 WIDTH="100%" >
<TR>
<TD VALIGN=top WIDTH="8%" BGCOLOR="#e0e0e0" class="tt3">&nbsp;
<BR><CENTER>
<A href="read_parentclass.asp?title=<%=parent_title%>">上一级</A><br>
<A href="xmain.asp">回首页</A>
<BR><a href="#" onclick="javascript:show_onclick();">显示菜单</A></CENTER>
</TD>

<TD WIDTH="84%">
<TABLE border=0 width="90%" align=center>
<tr><td>
<BR><B><FONT FACE="楷体_GB2312"><FONT COLOR="#ff6666"><FONT SIZE=+3><%=parent_title%></FONT></FONT></FONT></B>
</td></tr>
</table>
<HR SIZE=1 NOSHADE WIDTH="94%" color="#ee9b73">


<TABLE border=0 width="90%" align=center>
<tr>
<%
set conn = server.CreateObject("adodb.connection")
conn.Open application("dsn")

i_temp = -1

sql1 = "select id,title,type_id from bookwarelist where parent = '" & parent_title & "'"
	
set rs1 = server.CreateObject("adodb.recordset")
rs1.Open sql1,conn
while not rs1.eof
	id = rs1("id")
	title = rs1("title")
	type_id = rs1("type_id")	

	
	i_temp = i_temp + 1
	if i_temp = 3 then
		Response.Write "</tr><tr>"
		i_temp = 0
	end if
%>

          <TD class=tt3 width="30%"><br><IMG height=10 src="images/ar.gif" 
            width=15><a href="read_class.asp?title=<%=title%>&type_id=<%=type_id%>"><b><%=title%></b></a></TD>
<%
	rs1.MoveNext
wend

rs1.Close
set rs1 = nothing
%>
</TR>
</TABLE>
<HR SIZE=1 WIDTH="94%" color="#ee9b73">





<%'书名列表
	if len(parent_type_id)>0 and (not (parent_type_id=0)) then
		b_type = parent_type_id
%>
<br>
<br>
<TABLE border=0 width="90%" align=center>
<tr>
<td>
<b>类别<font color=red><%=parent_title%></font>的书名列表</b><br><hr>
<%
		strPage = Request.queryString("page")
		
		if len(strPage) = 0 then 
			strPage = "1"
		end if
	
		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 "没有符合条件的记录。"
			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>页。" 
		if int(strPage) > 1 then
			Response.Write "&nbsp;<a href='read_class.asp?title=" & parent_title & "&type_id=" & parent_type_id & "&page=" & cstr(cint(strPage) - 1) & "'>上一页</a>"
		end if
		if int(strPage) < select_PageCount then
			Response.Write "&nbsp;<a href='read_class.asp?title=" & parent_title & "&type_id=" & parent_type_id & "&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
%>
</td>
</tr>
</table>
<%
	else
		conn.Close
		set conn = nothing
	end if
%>

</TD>







<TD VALIGN=bottom WIDTH="8%" BGCOLOR="#e0e0e0" class="tt3"> </TD>
</TR>

<TR>
<TD VALIGN=top WIDTH="8%" BGCOLOR="#e0e0e0" class="tt3"> </TD>





<TD WIDTH="84%" class="tt3">
<CENTER>
<table WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="1" align="center">
<tr align="middle">
<td height="10"><img height="1" src="images/dot.gif" width="500"></td></tr>
<tr align="middle">
<td>若有任何意见或者建议,请<a href="mailto:zhang95@263.net" style="TEXT-DECORATION: underline">写信给我们</a>
<br><span style="FONT-FAMILY: verdana">&copy; CopyRight 1999 All Rights Reserved</span>科技有限公司</p>
</td>
</tr>
</table>
</TD>

<TD VALIGN=top WIDTH="8%" BGCOLOR="#e0e0e0" class="tt3">
<BR><CENTER>
<A href="read_parentclass.asp?title=<%=parent_title%>">上一级</A><br>
<A href="xmain.asp">回首页</A>
<BR><a href="#" onclick="javascript:show_onclick();">显示菜单</A></CENTER>
</TD>
</TR>
</TABLE>
<BR>


</body>
</html>

⌨️ 快捷键说明

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