📄 adminbook.asp
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>欢迎光临本图书馆</title>
<Link href="Css.css" rel=stylesheet>
</head>
<!--#include file="Conn.asp"-->
<body>
<table width="780" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center"><img src="Images/title.jpg" width="283" height="51"></td>
</tr>
<% If Session("admin") <> "" Then %>
<tr>
<td height="25" ><table width="780" border="0" bgcolor="#EFEFEF" align="center" cellpadding="0" cellspacing="0" style="border-color:#000000;border-top-style: solid;border-top-width: 1">
<tr>
<td height="25" bgcolor="#EFEFEF"> <a href="Default.asp">首页 </a>|<a href="AdminBorrow.asp"> 借书管理 </a>|<a href="AdminPublish.asp"> 出版社管理 </a>|<a href="AdminBook.asp"> 图书管理 </a>|<a href="AdminUser.asp"> 用户管理 </a>|<a href="ModifyAdmin.asp"> 修改密码 </a>|<a href="Logout.asp"> 退出 </a>
</td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="780" border="0" align="center" cellpadding="0" cellspacing="0" style="border-color:#000000;border-bottom-style: solid;border-bottom-width: 1;border-top-style: solid;border-top-width: 1">
<tr bgcolor="#FFFFFF">
<form name="form1" method="post" action="AdminBook.asp?action=Find">
<td height="25" background="Images/bg.gif" bgcolor="#FFFFFF"><img src="Images/find.gif" width="12" height="13">选择查询方式:
<select name="select">
<option value="ISBN">图书编号</option>
<option value="title">图书名称</option>
<option value="author">图书作者</option>
</select>
<input name="key" type="text" size="12">
<input type="submit" name="Submit" value="搜索">(请先输入查询关键字) </td>
</form>
</tr>
</table></td>
</tr>
<tr>
<td height="25" align="right">
</td>
</tr>
<tr align="center">
<td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#44608A">
<tr align="right" bgcolor="#EFEFEF">
<td height="30" colspan='9' align="center" bgcolor="#EFEFEF"><a href="AddBook.asp">◆添加图书信息◆</a></td>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<td height="25">图书编号</td>
<td>图书名称</td>
<td>作者</td>
<td>价格</td>
<td>库存</td>
<td>添加时间</td>
<td>出版社</td>
<td>附光盘</td>
<td>操作</td>
</tr>
<%
Set Rs = Server.CreateObject("ADODB.Recordset")
If Request("action") = "Find" Then
key = Trim(Request("key"))
If Request("select") = "ISBN" Then
Sql = "Select * From bookInfo Where ISBN Like '%"&key&"%' Order By addtime Desc"
ElseIf Request("select") = "title" Then
Sql = "Select * From bookInfo Where title Like '%"&key&"%' Order By addtime Desc"
ElseIf Request("select") = "author" Then
Sql = "Select * From bookInfo Where author Like '%"&key&"%' Order By addtime Desc"
Else
Response.Write "<Script>alert('查询错误!');</Script>"
Response.End
End If
Else
Sql = "Select * From bookInfo Order By addtime Desc"
End If
Rs.Open Sql,conn,3,3
If IsNumeric(Request("Page"))=false Or Request("Page")="" Then
Page=1
Else
Page=CInt(Request("Page"))
End if
Rs.PageSize=10
If Rs.Eof And Rs.Bof Then
Response.Write "<tr align='center' bgcolor='#FFFFFF'><td height='25' colspan='9'>没有搜索到相关的图书!</td></tr>"
Response.End
Else
myPageSize=Rs.PageSize
Rs.AbsolutePage=Page
Do While not Rs.Eof And myPageSize>0
%>
<tr bgcolor="#FFFFFF">
<td width="10%" height="25" align="center"><a href="Borrow.asp?ISBN=<%=Rs("ISBN")%>" target="_blank"><%=Rs("ISBN")%></a></td>
<td width="19%" align="center"><a href="Detail.asp?id=<%=Rs("id")%>" target="_blank">
<%=Rs("title")%></a></td>
<td width="9%" align="center"><%=Rs("author")%></td>
<td width="9%" align="center"><%=Rs("price")%></td>
<td width="8%" align="center"><%=Rs("remain")%></td>
<td width="13%" align="center"><%=Rs("addtime")%></td>
<%
Set Rs1 = Server.CreateObject("ADODB.Recordset")
Sql1="Select * From publisherInfo Where pid="&Rs("pid")
Rs1.Open Sql1,conn,3,3
%>
<td width="13%" align="center"><%=Rs1("ptitle")%></td>
<%
Rs1.Close
Set Rs1=nothing
%>
<td width="6%" align="center"><%=Rs("cd")%></td>
<td width="13%" align="center">
<a href="EditBook.asp?id=<%=Rs("id")%>"><img src="Images/edit.jpg" width="15" height="15" border="0" alt="修改">修改</a>
<a href="javascript:if(window.confirm('你确实要删除此项记录吗?') == true){window.location = 'DeleteBook.asp?id=<%=Rs("id")%>';}"><img src="Images/delete.jpg" width="15" height="15" border="0" alt="删除">删除</a></td>
</tr>
<% myPageSize=myPageSize-1
i=i+1
Rs.MoveNext
Loop
%>
<tr bgcolor="#FFFFFF">
<td colspan='9' height="25" align="left" > 总共 <b><%=Rs.RecordCount%></b> 条 每页 <b><%=Rs.PageSize%></b> 条 <b><%=Page%>/<%=Rs.PageCount%></b>
<%If Page>1 Then
Response.Write "<a href='AdminBook.asp?Page=1' title='首页'><font face=webdings>" & 9 & "</font></a>"
Response.Write " <a href='AdminBook.asp?Page="&Page-1&"' title='上一页'><font face=webdings>" & 7 & "</font></a>"
End If
If Rs.PageCount <= 4 Then
For j=1 To Rs.PageCount
Response.Write " <a href='AdminBook.asp?Page="&j&"'>" & j & "</a>"
Next
Else
For j=1 To 4
Response.Write " <a href='AdminBook.asp?Page="&j&"'>" & j & "</a>"
Next
If Page<Rs.PageCount Then
Response.Write " <a href='AdminBook.asp?Page="&Page+1&"' title='下一页'><font face=webdings>" & "8" & "</a></font>"
End If
Response.Write " <a href='AdminBook.asp?Page="&Rs.PageCount&"' title='尾页'><font face=webdings>:</font></a>"
End If
%>
</td>
</tr>
</table></td>
</tr>
<%
End If
Rs.Close
Set Rs = nothing
Conn.Close
Set Conn = nothing
%>
<% Else %>
<tr>
<td height="50" align="center"><font color="ff0000">对不起,请不要非法登录!</font></td>
</tr>
<%End If%>
</table>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -