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

📄 admin_update_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 submit = request.getParameter("submit");
	String bookSN = request.getParameter("bookSN");//取得图书编号
	String msg_title = null;
	String msg_content = null;
%>
	<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">
							<%
							if (bookSN != null & submit == null) {
							  if(Books.getOneBook(bookSN)){
								bookInfo bi=(bookInfo)Books.getBookList().elementAt(0);
							%>
								<br />
								<form id="form" name="form" method="post" action="admin_update_book.jsp">
								<table cellpadding=0 cellspacing=0 border=0 width=550 bgcolor="#2E79BE" align="center"  style="table-layout: fixed;WORD-BREAK: break-all; WORD-WRAP: break-word">
									<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">
														<input name="bookSN" type="text" id="bookSN" value="<%=bi.getBookSN()%>" size="20" readonly />													</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">
														<input name="bookName" type="text" id="bookName" value="<%=bi.getBookName()%>" size="20" />													</td>
												</tr>
												<tr bgcolor="#DCEFFA">
													<td align="right" height="25">作&nbsp;&nbsp;者:</td>
													<td height="25">
														<input name="bookAuthor" type="text" id="bookAuthor" value="<%=bi.getBookAuthor()%>" size="20" />													</td>
												</tr>
												<tr bgcolor="#D8FAFA">
													<td align="right" height="25">出版社:</td>
													<td height="25">
														<input name="bookPress" type="text" id="bookPress" value="<%=bi.getBookPress()%>" size="20" />													</td>
												</tr>
												<tr bgcolor="#DCEFFA">
													<td align="right" height="25">I&nbsp;S&nbsp;B&nbsp;N:</td>
													<td height="25">
														<input name="bookISBN" type="text" id="bookISBN" value="<%=bi.getBookISBN()%>" size="20" />													</td>
												</tr>
												<tr>
													<td colspan="3" height="15" bgcolor="#6CA6D5" align=right>&nbsp;</td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
								<br />
								<table cellpadding="0" cellspacing="0" border="0" width="550" bgcolor="#2E79BE" align="center"  style="table-layout: fixed;WORD-BREAK: break-all; WORD-WRAP: break-word">
									<tr>
										<td>
											<table cellpadding="3" cellspacing="1" border="0" width="100%">
												<tr>
													<td colspan="4" height="22" bgcolor="#6CA6D5" align="center"><strong>图书详细信息</strong></td>
												</tr>
												<tr bgcolor="#DCEFFA">
													<td width="130" height="25" align="right">图书分类:</td>
													<td width="145" height="25" align="left">
														<select name="bookClass" size="1" id="bookClass">
															<option value="A 马列、毛邓" <%if(bi.getBookClass().equals("A 马列、毛邓")){%>selected="selected"<%}%>>A 马列、毛邓</option>
															<option value="B 哲学、宗教" <%if(bi.getBookClass().equals("B 哲学、宗教")){%>selected="selected"<%}%>>B 哲学、宗教</option>
															<option value="C 社会科学总论" <%if(bi.getBookClass().equals("C 社会科学总论")){%>selected="selected"<%}%>>C 社会科学总论</option>
															<option value="D 政治、法律" <%if(bi.getBookClass().equals("D 政治、法律")){%>selected="selected"<%}%>>D 政治、法律</option>
															<option value="E 军事" <%if(bi.getBookClass().equals("E 军事")){%>selected="selected"<%}%>>E 军事</option>
															<option value="F 经济" <%if(bi.getBookClass().equals("F 经济")){%>selected="selected"<%}%>>F 经济</option>
															<option value="G 文化科学、教育、体育" <%if(bi.getBookClass().equals("G 文化科学、教育、体育")){%>selected="selected"<%}%>>G 文化科学、教育、体育</option>
															<option value="H 语言、文字" <%if(bi.getBookClass().equals("H 语言、文字")){%>selected="selected"<%}%>>H 语言、文字</option>
															<option value="I 文学" <%if(bi.getBookClass().equals("I 文学")){%>selected="selected"<%}%>>I 文学</option>
															<option value="J 艺术" <%if(bi.getBookClass().equals("J 艺术")){%>selected="selected"<%}%>>J 艺术</option>
															<option value="K 历史、地理" <%if(bi.getBookClass().equals("K 历史、地理")){%>selected="selected"<%}%>>K 历史、地理</option>
															<option value="N 自然科学总论" <%if(bi.getBookClass().equals("N 自然科学总论")){%>selected="selected"<%}%>>N 自然科学总论</option>
															<option value="O 数理科学和化学" <%if(bi.getBookClass().equals("O 数理科学和化学")){%>selected="selected"<%}%>>O 数理科学和化学</option>
															<option value="P 天文学、地球科学" <%if(bi.getBookClass().equals("P 天文学、地球科学")){%>selected="selected"<%}%>>P 天文学、地球科学</option>
															<option value="Q 生物科学" <%if(bi.getBookClass().equals("Q 生物科学")){%>selected="selected"<%}%>>Q 生物科学</option>
															<option value="R 医药、卫生" <%if(bi.getBookClass().equals("R 医药、卫生")){%>selected="selected"<%}%>>R 医药、卫生</option>
															<option value="S 农业科学" <%if(bi.getBookClass().equals("S 农业科学")){%>selected="selected"<%}%>>S 农业科学</option>
															<option value="T 工业技术" <%if(bi.getBookClass().equals("T 工业技术")){%>selected="selected"<%}%>>T 工业技术</option>
															<option value="TB 一般工业技术" <%if(bi.getBookClass().equals("TB 一般工业技术")){%>selected="selected"<%}%>>TB 一般工业技术</option>
															<option value="TF 冶金工业" <%if(bi.getBookClass().equals("")){%>selected="selected"<%}%>>TF 冶金工业</option>
															<option value="TG 金属学与金属工艺" <%if(bi.getBookClass().equals("TG 金属学与金属工艺")){%>selected="selected"<%}%>>TG 金属学与金属工艺</option>
															<option value="TH 机械、仪表工业" <%if(bi.getBookClass().equals("TH 机械、仪表工业")){%>selected="selected"<%}%>>TH 机械、仪表工业</option>
															<option value="TM 电工技术" <%if(bi.getBookClass().equals("TM 电工技术")){%>selected="selected"<%}%>>TM 电工技术</option>
															<option value="TN 无线电" <%if(bi.getBookClass().equals("TN 无线电")){%>selected="selected"<%}%>>TN 无线电</option>
															<option value="TP 自动化、计算机技术" <%if(bi.getBookClass().equals("TP 自动化、计算机技术")){%>selected="selected"<%}%>>TP 自动化、计算机技术</option>
															<option value="TQ 化学工业" <%if(bi.getBookClass().equals("TQ 化学工业")){%>selected="selected"<%}%>>TQ 化学工业</option>
															<option value="TS 轻工业、手工业" <%if(bi.getBookClass().equals("TS 轻工业、手工业")){%>selected="selected"<%}%>>TS 轻工业、手工业</option>
															<option value="TU 建筑科学" <%if(bi.getBookClass().equals("TU 建筑科学")){%>selected="selected"<%}%>>TU 建筑科学</option>
															<option value="U 交通运输" <%if(bi.getBookClass().equals("U 交通运输")){%>selected="selected"<%}%>>U 交通运输</option>
															<option value="V 航空、航天" <%if(bi.getBookClass().equals("V 航空、航天")){%>selected="selected"<%}%>>V 航空、航天</option>
															<option value="X 环境、安全安全科学" <%if(bi.getBookClass().equals("X 环境、安全安全科学")){%>selected="selected"<%}%>>X 环境、安全安全科学</option>
															<option value="Z 综合性图书" <%if(bi.getBookClass().equals("Z 综合性图书")){%>selected="selected"<%}%>>Z 综合性图书</option>
														</select>
													</td>
													<td width="130" height="25" align="right">单&nbsp;&nbsp;价:</td>
													<td width="145" height="25" align="left">
														<input name="bookPrice" type="text" id="bookPrice" value="<%=bi.getBookPrice()%>" size="20" />													
													</td>
												</tr>
												<tr bgcolor="#D8FAFA">
													<td height="25" align="right">借阅权限:</td>
													<td height="25" align="left">
														<select name="bookLevel" size="1" id="bookLevel">
															<option value="1" <%if(bi.getBookLevel().equals("1")){%>selected<%}%>>1级</option>
															<option value="2" <%if(bi.getBookLevel().equals("2")){%>selected<%}%>>2级</option>
															<option value="3" <%if(bi.getBookLevel().equals("3")){%>selected<%}%>>3级</option>
															<option value="4" <%if(bi.getBookLevel().equals("4")){%>selected<%}%>>4级</option>
															<option value="5" <%if(bi.getBookLevel().equals("5")){%>selected<%}%>>5级</option>																																															</select>
													</td>
													<td height="25" align="right">图书状态:</td>
													<td height="25" align="left">
														<select name="bookIn" size="1" id="bookIn">
															<option value="<%=bi.getBookIn()%>"><%=(bi.getBookIn().equals("1"))?"在库":"不在库"%></option>																																															</select>
													</td>
												</tr>
												<tr bgcolor="#DCEFFA">
													<td height="25" align="right">备&nbsp;&nbsp;注:</td>
													<td height="25" colspan="3" align="left">
													<input name="bookComment" type="text" id="bookComment" value="<%=bi.getBookComment()%>" size="50" /></td>
												</tr>
												<tr>
													<td colspan="4" height="15" bgcolor="#6CA6D5" align="center">&nbsp;</td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
								<br />
								<input name="submit" type="submit" id="submit" value="确 定">
								</form>
								<%
								}else{
									msg_title = "没有记录";
									msg_content = "对不起,您所查询的图书编号为"+bookSN+"的图书不存在,请确认您输入的图书编号是否正确!";
								}
							}else{
								msg_title = "图书编号为空";
								msg_content = "对不起,您的查询的图书编号为空,无法进行查询!";
							}
							%>
							<%if(submit != null){
								if(Books.updateBook(request,session)){
									msg_title = "修改图书信息成功";
									msg_content = "修改图书信息成功,请再次检查图书信息是否正确录入!";
									//自动跳转
									response.setHeader("Refresh","2;url=admin_get_one_book.jsp?bookSN="+bookSN);
								}else{
									msg_title = "修改图书信息失败";
									msg_content = Books.getErrMsg();
								}
							}%>
							<%if(msg_title != null){%>
								<table cellpadding="0" cellspacing="0" border="0" width="550" bgcolor="#2E79BE" align="center"  style="table-layout: fixed;WORD-BREAK: break-all; WORD-WRAP: break-word">
									<tr>
										<td>
											<table cellpadding="3" cellspacing="1" border="0" width="100%">
												<tr>
													<td width="100%" height="22" align="center" bgcolor="#6CA6D5"><%=msg_title%></td>
												</tr>
												<tr bgcolor="#DCEFFA">
													<td height="30" align="center"><%=msg_content%></td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							<%}%>
						</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 + -