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

📄 show.asp

📁 在线图书馆系统 包括VB程序设计的后台与ASP的网页
💻 ASP
字号:
<!--#include file="conn.asp" -->
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网上图书馆</title>
</head>

<body>
<%  
    dim sql,PageSize,RowCount,TotalPages,PageNo,Position,PageBegin,PageEnd,tj
	set rs=server.createobject("adodb.recordset")
	bookname=trim(request.form("Title"))
	author=trim(request.form("author"))
	booktype=trim(request.form("Sort"))
	Publisher=trim(request.form("Publisher"))
	date1=trim(request.form("date1"))
	date11=trim(request.form("date11"))
	date2=trim(request.form("date2"))
	date22=trim(request.form("date22"))
	date3=trim(request.form("date3"))
	date33=trim(request.form("date33"))
	date111=date1&"-"&date2&"-"&date3
	date222=date11&"-"&date22&"-"&date33  
    '查询条件
    dim s 
	if len(bookname)<>0 then
		   tj=" title like '%"    & bookname  & "%'" 
	s="书名包括:" & bookname
	end if
	if len(author)<>0 then
		if tj ="" then
			tj="  author like '%"    & author& "%'"
		     s="作者包括:" & author
		else
	          tj= tj & " and  author like '%"    & author & "%'"
	 	      s=s & "  作者包括:" & author
	     end if
	end if		
	if len(booktype)<>0 then
		if tj ="" then
			tj="  SortName like '%"    & booktype & "%'"
			s="图书类别为" & booktype 
		else
			tj=tj & " and SortName like '%"    & booktype & "%'"
			s=s & "  图书类别为" & booktype 
		end if
	end if
	if len(Publisher)<>0 then
		if tj ="" then
			tj="  Publisher like '%"    & Publisher & "%'"
			s="出版社为" & Publisher 
		else
			tj=tj & " and Publisher like '%"    & Publisher & "%'"
			s=s & "  出版社为" & Publisher 
		end if
	end if
	if tj ="" then
		tj="  PublishDate between '" & date111 & "' and  '" & date222 & "' order by id desc	"	
		s="出版日期从" & date111 & "到"  &  date222 
	else
		tj=tj & " and PublishDate between '" & date111 & "' and '" & date222 & "' order by id desc	"
		s=s & "  出版日期从" & date111 & "到"  &  date222
	end if
	
	PageSize=5    '设定PageSize属性的值—每页显示几条记录
	Sql="select   ID,Title,Author,SortName,Pages,Carrier,Publisher, PublishDate,BookShelf=isnull(BookShelf,' ')"
	Sql=sql & "  from  bookproperties a inner join booksort b on a.sort=b.sortcode where " & tj
	if rs.state=1 then
		rs.close
	end if
	rs.open Sql,conn,1,1
		
	tj="bookname=" & bookname & "&author=" & author & "&booktype=" & booktype & "&Publisher=" & Publisher
	tj=tj & "&date1=" & date1 & "&date2=" & date2 & "&date3=" & date3 & "&date11=" & date11 & "&date22=" & date22 & "&date33=" & date33

%>

<form method="POST"  >
<table border="0" width="100%" height="25" bgcolor="#2487E1" id="table1" >
<tr><td> <p align="center">
<img border="0" src="image/top.jpg" width="725"  height="59"></td>
</tr></table>
<table border="1" width="100%" height="25" bgcolor="#2487E1" 
bordercolor="#C0C0C0"> <tr>
<td align="center" bgcolor="#2487E1"><b><font color="#FFFFFF" size="2">
<a href="Select.asp"><font color="#FFFFFF">图书检索</font></a></font></b></td>
<td align="center" bgcolor="#2487E1"><b><font color="#FFFFFF" size="2">
<a href="BorrowCase.asp"><font color="#FFFFFF">状态查询</font></a></font></b></td>
<td align="center" bgcolor="#2487E1"><b><font color="#FFFFFF" size="2">
<a href="PWDModify.asp"><font color="#FFFFFF">修改密码</font></a></font></b></td>
<td align="center" bgcolor="#2487E1"><b><font color="#FFFFFF" size="2">
     <a href=index.asp><font color="#FFFFFF">退出登录</font></a></font></b></td></tr></table>
<div align="center">
<table border="1" width="100%" bordercolorlight="#C0C0C0"
bordercolordark="#808080" bgcolor="#CCFFFF">
<TR height=20px >
<TD align=center colspan=10 height="18" bgcolor="#CCCCFF"><b>
<font size="2" color="#0000FF">
<span style="background-color: #CCCCFF">查询条件:  <%=s%></span></font></b></TD></tr>
<tr><td bgcolor="#FFFFCC" align="center" width="8%" ><b><font size="2"
color="#0000FF">索书号</font></b></td>
<td bgcolor="#FFFFCC" align="center" width="12%"><b><font size="2" color="#0000FF">书名</font></b></td>
<td bgcolor="#FFFFCC" align="center"><b><font size="2" color="#0000FF">作者</font></b></td>
		<td bgcolor="#FFFFCC" align="center" width="10%"><b><font size="2" 
  color="#0000FF">类别</font></b></td>
		<td bgcolor="#FFFFCC" align="center" width="5%"><b><font size="2" 
  color="#0000FF">页数</font></b></td>
		<td bgcolor="#FFFFCC" align="center" width="5%"><b><font size="2" 
  color="#0000FF">载体</font></b></td>
		<td bgcolor="#FFFFCC" align="center" width="19%"><b><font size="2" 
  color="#0000FF">出版社</font></b></td>
		<td bgcolor="#FFFFCC" align="center" width="9%"><b><font size="2" 
  color="#0000FF">出版时间</font></b></td>
		<td bgcolor="#FFFFCC" align="center" width="4%"><b><font size="2" 
  color="#0000FF">书架</font></b></td>
		<td bgcolor="#FFFFCC" align="center" width="6%"> </td>
	</tr>
 <% if rs.eof then	%>
  <TR height=20px >  <TD align=center colspan=10>
<font size="1">没有满足条件的图书信息!</font> </TD>  </TR>
<%	 else
 rs.PageSize = Cint(PageSize)
 Total=rs.PageCount'计算可显示页面的总数
 PageNo=Request("pageno")
 if PageNo="" Then
    PageNo = 1
 end if
 ScrollAction = Request("ScrollAction")
 if ScrollAction = " 上一页 " Then
     PageNo=PageNo-1
 end if
 if ScrollAction = " 下一页 " Then
    	 PageNo=PageNo+1
 end if
 if PageNo < 1 Then 
     PageNo = 1
 end if
 n=1
 rs.AbsolutePage = PageNo
 position=rs.PageSize*PageNo
 pagebegin=position-rs.PageSize+1
 if position < rs.RecordCount then
     pagend=position
 else 
     pagend= rs.RecordCount
 end if 
Do while not (rs is nothing) 
     RowCount = rs.PageSize
     Do While Not rs.EOF and rowcount > 0 
        If n=1 then
 	         Response.Write "<tr BGCOLOR=#FFFFFF>"
        ELSE
 	         Response.Write "<tr BGCOLOR=#EEEEEE>"
           End If
                       n=1-n
 %>	
<td width="8%">
<font   color='#0000FF' size="1"> <%=trim(rs("ID")) %></font></td>
<td width="12%" >
<font  color='#0000FF' size="1"> <%=trim(rs("Title")) %></font></td>
<td width="15%">
<font  color='#0000FF' size="1"> <%=trim(rs("Author")) %></font></td>
<td width="10%" >
<font color='#0000FF' size="1"> <%=trim(rs("SortName")) %></font></td>
<td width="5%" align="center">
<font  color='#0000FF' size="1"> <%=trim(rs("Pages")) %></font></td>
 <td width="5%" align="center">
<font color='#0000FF' size="1"> <%=trim(rs("Carrier")) %></font></td>
<td width="145>
<font color='#0000FF' size="1"> <%=trim(rs("Publisher")) %></font></td>
<td width="9%" align="center">
<font  color='#0000FF' size="1"> <%=trim(rs("PublishDate")) %></font></td>
<td width="4%" align="center">
<font  color='#0000FF' size="1"> <%=trim(rs("BookShelf")) %></font></td>
<td bgcolor="#CCFFFF" width="8%"><b><font color="#0000FF" size="1">
<a href ="browse.asp?id=<%=trim(rs("ID")) %>">浏览  </a>
<% if Session("ReaderID")<>"" then %>
<a href ="BorrowCase.asp?op=3&id=<%=trim(rs("ID"))%>">预约</a> 
<%  end if %>
</td> </tr>
<%
 RowCount = RowCount - 1
  rs.MoveNext
    Loop
    set rs = rs.NextRecordSet
  Loop
%>
<table  border="1" width="100%" bordercolorlight="#CCFFFF"   
 bordercolordark="#808080" bgcolor="#CCFFFF" height="30" cellpadding="0" 
 cellspacing="1">
<tr> <td align=center> <font color =#0000FF size="3" >
  <% Response.Write ("共"  & Total & "页 当前 第" & PageNo &" / "& Total )  %></font>
</td> <TD align=right > <font color =#0000FF size=2>
  <%  if PageNo > 1 Then 
        response.write( "<a href=show.asp?PageNo=1" & "&" & tj & ">首页</a>&nbsp;<a href=show.asp?PageNo=" & (PageNo-1) & "&" & tj & ">上页</a>&nbsp;")
      end if 
      if  Total > 1 and  cint(PageNo) <> cint(Total) then 
          response.write( "<a href=show.asp?PageNo=" & (PageNo+1) & "&" & tj & ">下页</a>&nbsp;<a href=show.asp?PageNo=" & Total & "&" & tj & ">末页</a>&nbsp;")
       end if 
%>  </font>	</tr>	</table> 
  <%
set rs = nothing	
end if
%>
</table></form>

</body>

</html>

⌨️ 快捷键说明

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