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

📄 admin_search_book.jsp

📁 图书管理系统,B/S,C/S都有,附有源代码
💻 JSP
字号:
<%@ page contentType="text/html; charset=GBK" language="java" errorPage="" %>
<%@ page import="book.bookInfo"%>
<%request.setCharacterEncoding("GBK");%>
<jsp:useBean id="admin" scope="page" class="admin.admin" />
<jsp:useBean id="Books" scope="page" class="book.Books" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<link rel=stylesheet href="../../css/library.css" type="text/css">
<title>图书管理系统</title></head>

<body>
<%
String supervisor=(String)session.getAttribute("supervisor");//从SESSION中获取管理员ID
if(supervisor!=null){
	String bookSN=request.getParameter("bookSN");
	String bookName=request.getParameter("bookName");
	String bookAuthor=request.getParameter("bookAuthor");
	String bookPress=request.getParameter("bookPress");
	String bookISBN=request.getParameter("bookISBN");
	String bookClass=request.getParameter("bookClass");
	String submit=request.getParameter("submit");
	String curPage=request.getParameter("page");
	String searchUrl=null;
	int intCurPage;
	if(bookSN==null){bookSN="";}else{bookSN=new String(bookSN.getBytes("ISO-8859-1"),"GBK");}
	if(bookName==null){bookName="";}else{bookName=new String(bookName.getBytes("ISO-8859-1"),"GBK");}
	if(bookAuthor==null){bookAuthor="";}else{bookAuthor=new String(bookAuthor.getBytes("ISO-8859-1"),"GBK");}
	if(bookPress==null){bookPress="";}else{bookPress=new String(bookPress.getBytes("ISO-8859-1"),"GBK");}
	if(bookISBN==null){bookISBN="";}else{bookISBN=new String(bookISBN.getBytes("ISO-8859-1"),"GBK");}
	if(bookClass==null){bookClass="";}
	if(curPage==null){intCurPage=1;}else{intCurPage=Integer.parseInt(curPage);}
	searchUrl="bookSN="+bookSN+"&bookName="+bookName+"&bookAuthor="+bookAuthor+"&bookPress="+bookPress+"&bookISBN="+bookISBN+"&bookClass="+bookClass+"&submit=nino&page=";
%>
	<table cellpadding="0" cellspacing="0" border="0" width="760" bgcolor="#2E79BE" align="center">
		<tr>
			<td>
				<table cellpadding="3" cellspacing="1" border="0" width="760">
					<tr>
						<td colspan="2" height="22" bgcolor="#6CA6D5" align="center"><p style="font-size: 16px;"><strong>图书管理系统</strong></p></td>
					</tr>
					<tr bgcolor="#DCEFFA">
						<td width="130" height="30" align="left" valign="top"><%@include file="admin_left.jsp"%></td>
						<td width="630" align="center" valign="middle">
							<br />
							<!--搜索条件-->
							<form id="form" name="form" method="get" action="admin_search_book.jsp">
								<table cellpadding="0" cellspacing="0" border="0" width="550" bgcolor="#2E79BE" align="center">
									<tr>
										<td>
											<table cellpadding="3" cellspacing="1" border="0" width="100%">
												<tr>
													<td width="100%" height="22" colspan="4" align="center" bgcolor="#6CA6D5"><strong>图书搜索条件</strong></td>
												</tr>
												<tr bgcolor="#DCEFFA">
													<td width="100" height="25" align="right">图书编号:</td>
													<td width="175" height="25" align="left"><input name="bookSN" type="text" id="bookSN" value="<%=bookSN%>" size="20" /></td>
													<td width="100" height="25" align="right">书&nbsp;&nbsp;名:</td>
													<td width="175" height="25" align="left"><input name="bookName" type="text" id="bookName" value="<%=bookName%>" size="20" /></td>
												</tr>
												<tr bgcolor="#DCEFFA">
													<td height="25" align="right">作&nbsp;&nbsp;者:</td>
													<td height="25" align="left"><input name="bookAuthor" type="text" id="bookAuthor" value="<%=bookAuthor%>" size="20" /></td>
													<td height="25" align="right">出版社:</td>
													<td height="25" align="left"><input name="bookPress" type="text" id="bookPress" value="<%=bookPress%>" size="20" /></td>
												</tr>
												<tr bgcolor="#DCEFFA">
													<td height="25" align="right">I&nbsp;S&nbsp;B&nbsp;N:</td>
													<td height="25" align="left"><input name="bookISBN" type="text" id="bookISBN" value="<%=bookISBN%>" size="20" /></td>
													<td height="25" align="right">图书分类:</td>
													<td height="25" align="left">
													<select name="bookClass" size="1" id="bookClass">
														<option value="" <%if(bookClass.equals("")){%>selected<%}%>>&nbsp;</option>
														<option value="A" <%if(bookClass.equals("A")){%>selected<%}%>>A 马列、毛邓</option>
														<option value="B" <%if(bookClass.equals("B")){%>selected<%}%>>B 哲学、宗教</option>
														<option value="C" <%if(bookClass.equals("C")){%>selected<%}%>>C 社会科学总论</option>
														<option value="D" <%if(bookClass.equals("D")){%>selected<%}%>>D 政治、法律</option>
														<option value="E" <%if(bookClass.equals("E")){%>selected<%}%>>E 军事</option>
														<option value="F" <%if(bookClass.equals("F")){%>selected<%}%>>F 经济</option>
														<option value="G" <%if(bookClass.equals("G")){%>selected<%}%>>G 文化、教育、体育</option>
														<option value="H" <%if(bookClass.equals("H")){%>selected<%}%>>H 语言、文字</option>
														<option value="I" <%if(bookClass.equals("I")){%>selected<%}%>>I 文学</option>
														<option value="J" <%if(bookClass.equals("J")){%>selected<%}%>>J 艺术</option>
														<option value="K" <%if(bookClass.equals("K")){%>selected<%}%>>K 历史、地理</option>
														<option value="N" <%if(bookClass.equals("N")){%>selected<%}%>>N 自然科学总论</option>
														<option value="O" <%if(bookClass.equals("O")){%>selected<%}%>>O 数理科学和化学</option>
														<option value="P" <%if(bookClass.equals("P")){%>selected<%}%>>P 天文学、地球科学</option>
														<option value="Q" <%if(bookClass.equals("Q")){%>selected<%}%>>Q 生物科学</option>
														<option value="R" <%if(bookClass.equals("R")){%>selected<%}%>>R 医药、卫生</option>
														<option value="S" <%if(bookClass.equals("S")){%>selected<%}%>>S 农业科学</option>
														<option value="T" <%if(bookClass.equals("T")){%>selected<%}%>>T 工业技术</option>
														<option value="TB" <%if(bookClass.equals("TB")){%>selected<%}%>>TB 一般工业技术</option>
														<option value="TF" <%if(bookClass.equals("TF")){%>selected<%}%>>TF 冶金工业</option>
														<option value="TG" <%if(bookClass.equals("TG")){%>selected<%}%>>TG 金属学与金属工艺</option>
														<option value="TH" <%if(bookClass.equals("TH")){%>selected<%}%>>TH 机械、仪表工业</option>
														<option value="TM" <%if(bookClass.equals("TM")){%>selected<%}%>>TM 电工技术</option>
														<option value="TN" <%if(bookClass.equals("TN")){%>selected<%}%>>TN 无线电</option>
														<option value="TP" <%if(bookClass.equals("TP")){%>selected<%}%>>TP 自动化、计算机</option>
														<option value="TQ" <%if(bookClass.equals("TQ")){%>selected<%}%>>TQ 化学工业</option>
														<option value="TS" <%if(bookClass.equals("TS")){%>selected<%}%>>TS 轻工业、手工业</option>
														<option value="TU" <%if(bookClass.equals("TU")){%>selected<%}%>>TU 建筑科学</option>
														<option value="U" <%if(bookClass.equals("U")){%>selected<%}%>>U 交通运输</option>
														<option value="V" <%if(bookClass.equals("V")){%>selected<%}%>>V 航空、航天</option>
														<option value="X" <%if(bookClass.equals("X")){%>selected<%}%>>X 环境、安全安全科学</option>
														<option value="Z" <%if(bookClass.equals("Z")){%>selected<%}%>>Z 综合性图书</option>																																																    				</select>
													</td>
												</tr>
												<tr>
													<td width="100%" height="22" colspan="4" align="center" bgcolor="#6CA6D5">
														<input name="submit" type="submit" id="submit" value="搜索" />
													</td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							</form>
							<br />
							<!--搜索结果-->
							<%if(submit != null){
								if(Books.searchBook(request,session)){
									int bookCount = Books.getBookList().size();
									int pageCount = Books.getPageCount();
									int rowsCount = Books.getRowsCount();
									int pageSize = Books.getPageSize();
									for(int i = 0; i < bookCount; i++){
										bookInfo bi = (bookInfo)Books.getBookList().elementAt(i);
									%>
										<!--图书信息-->
										<table cellpadding=0 cellspacing=0 border=0 width=550 bgcolor="#2E79BE" align="center">
											<tr>
												<td>
													<table cellpadding=3 cellspacing=1 border=0 width=100%>
														<tr>
															<td colspan="3" height="22" bgcolor="#6CA6D5" align="center"><strong>图书基本信息</strong></td>
														</tr>
														<tr bgcolor="#DCEFFA">
															<td width="143" align="right" height="25">图书编号:</td>
															<td width="285" height="25"><%=bi.getBookSN()%></td>
															<td width="135" height="32" rowspan="5" align="center">
																<a onClick="window.open('../BookPicture/<%=bi.getBookSN()%>.jpg','','')" style="cursor: hand;"><img src="../BookPicture/resize/<%=bi.getBookSN()%>.jpg" alt="点击看大图~" align="absmiddle" /></a>						
															</td>
														</tr>
														<tr bgcolor="#D8FAFA">
															<td width="143" height="25" align="right">书&nbsp;&nbsp;名:</td>
															<td height="25"><%=bi.getBookName()%></td>
														</tr>
														<tr bgcolor="#DCEFFA">
															<td align="right" height="25">作&nbsp;&nbsp;者:</td>
															<td height="25"><%=bi.getBookAuthor()%></td>
														</tr>
														<tr bgcolor="#D8FAFA">
															<td align="right" height="25">出版社:</td>
															<td height="25"><%=bi.getBookPress()%></td>
														</tr>
														<tr bgcolor="#DCEFFA">
															<td align="right" height="25">I&nbsp;S&nbsp;B&nbsp;N:</td>
															<td height="25"><%=bi.getBookISBN()%></td>
														</tr>
														<tr>
															<td colspan="3" height="15" bgcolor="#6CA6D5" align=right><a href="admin_get_one_book.jsp?bookSN=<%=bi.getBookSN()%>">详细资料</a></td>
														</tr>
													</table>
												</td>
											</tr>
										</table>
										<br />
									<%}%>
									<div align="center">		
										<%if(intCurPage==1){%>
											上一页
										<%}else{%>
											<a href="admin_search_book.jsp?<%=searchUrl+(intCurPage-1)%>">上一页</a>
										<%}%>
										<strong><%=intCurPage%>/<%=pageCount%></strong>
										<%if(intCurPage==pageCount){%>
											下一页
										<%}else{%>
											<a href="admin_search_book.jsp?<%=searchUrl+(intCurPage+1)%>">下一页</a>
										<%}%>
										共有 <strong><%=rowsCount%></strong> 条记录 
										当前第 <strong><%=((intCurPage-1)*pageSize)+1%></strong> 到 第 <strong><%=(intCurPage*pageSize<rowsCount)?(intCurPage*pageSize):rowsCount%></strong> 条记录
									</div>
								<%}else{%>
								<!--错误信息-->
									<table cellpadding="0" cellspacing="0" border="0" width="550" bgcolor="#2E79BE" align="center">
										<tr>
											<td>
												<table cellpadding="3" cellspacing="1" border="0" width="100%">
													<tr>
														<td width="100%" height="22" align="center" bgcolor="#6CA6D5"><strong>错误</strong></td>
													</tr>
													<tr bgcolor="#DCEFFA">
														<td height="30" align="center"><%=Books.getErrMsg()%></td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								<%}%>
							<%}%>
							<br />
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td height="20" bgcolor="#6CA6D5" align="center">&nbsp;</td>
		</tr>
	</table>
<%}else{%>
	<table cellpadding="0" cellspacing="0" border="0" width="760" bgcolor="#2E79BE" align="center">
		<tr>
			<td>
				<table cellpadding="3" cellspacing="1" border="0" width="760">
					<tr>
						<td height="22" bgcolor="#6CA6D5" align="center"><p style="font-size: 16px;"><strong>图书管理系统</strong></p></td>
					</tr>
					<tr bgcolor="#DCEFFA">
						<td height="30" align="center">对不起,您尚未登录!</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td height="20" bgcolor="#6CA6D5" align="center">&nbsp;</td>
		</tr>
	</table>
<%}%>
</body>
</html>

⌨️ 快捷键说明

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