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

📄 admin_add_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 (submit == null) {%>
								<br />
								<form id="form" name="form" method="post" action="admin_add_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 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" align="left">
														<input name="bookSN" type="text" id="bookSN" value="<%=Books.createBookSN()%>" size="20" readonly />													
												  </td>
													<td width="135" height="32" rowspan="5" align="center">
														<a onClick="window.open('admin_upload_book_picture.html','','')" style="cursor: hand;"><img src="../BookPicture/book.png" alt="点击添加图书照片!" width="90" height="120" align="absmiddle" /></a>													</td>
												</tr>
												<tr bgcolor="#D8FAFA">
													<td width="143" height="25" align="right">书&nbsp;&nbsp;名:</td>
													<td height="25" align="left">
												  <input name="bookName" type="text" id="bookName" size="20" />																	</td>
												</tr>
												<tr bgcolor="#DCEFFA">
													<td align="right" height="25">作&nbsp;&nbsp;者:</td>
													<td height="25" align="left">
												  <input name="bookAuthor" type="text" id="bookAuthor" size="20" />													</td>
												</tr>
												<tr bgcolor="#D8FAFA">
													<td align="right" height="25">出版社:</td>
													<td height="25" align="left">
												  <input name="bookPress" type="text" id="bookPress" size="20" />													</td>
												</tr>
												<tr bgcolor="#DCEFFA">
													<td align="right" height="25">I&nbsp;S&nbsp;B&nbsp;N:</td>
													<td height="25" align="left">
												  <input name="bookISBN" type="text" id="bookISBN" 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 马列、毛邓">A 马列、毛邓</option>
															<option value="B 哲学、宗教">B 哲学、宗教</option>
															<option value="C 社会科学总论">C 社会科学总论</option>
															<option value="D 政治、法律">D 政治、法律</option>
															<option value="E 军事">E 军事</option>
															<option value="F 经济">F 经济</option>
															<option value="G 文化科学、教育、体育">G 文化科学、教育、体育</option>
															<option value="H 语言、文字">H 语言、文字</option>
															<option value="I 文学">I 文学</option>
															<option value="J 艺术">J 艺术</option>
															<option value="K 历史、地理">K 历史、地理</option>
															<option value="N 自然科学总论">N 自然科学总论</option>
															<option value="O 数理科学和化学">O 数理科学和化学</option>
															<option value="P 天文学、地球科学">P 天文学、地球科学</option>
															<option value="Q 生物科学">Q 生物科学</option>
															<option value="R 医药、卫生">R 医药、卫生</option>
															<option value="S 农业科学">S 农业科学</option>
															<option value="T 工业技术">T 工业技术</option>
															<option value="TB 一般工业技术">TB 一般工业技术</option>
															<option value="TF 冶金工业">TF 冶金工业</option>
															<option value="TG 金属学与金属工艺">TG 金属学与金属工艺</option>
															<option value="TH 机械、仪表工业">TH 机械、仪表工业</option>
															<option value="TM 电工技术">TM 电工技术</option>
															<option value="TN 无线电">TN 无线电</option>
															<option value="TP 自动化、计算机技术">TP 自动化、计算机技术</option>
															<option value="TQ 化学工业">TQ 化学工业</option>
															<option value="TS 轻工业、手工业">TS 轻工业、手工业</option>
															<option value="TU 建筑科学">TU 建筑科学</option>
															<option value="U 交通运输">U 交通运输</option>
															<option value="V 航空、航天">V 航空、航天</option>
															<option value="X 环境、安全安全科学">X 环境、安全安全科学</option>
															<option value="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" 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">1级</option>
															<option value="2">2级</option>
															<option value="3">3级</option>
															<option value="4">4级</option>
															<option value="5">5级</option>																																															                                                        </select>
													</td>
													<td height="25" align="right">图书状态:</td>
													<td height="25" align="left">
														<select name="bookIn" size="1" id="bookIn">
															<option value="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" 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>
							<%}%>
							<%if(submit != null){
								if(Books.addBook(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 + -