?? admin_borrow_book.jsp
字號:
<%@ page contentType="text/html; charset=GBK" language="java" errorPage="" %>
<%@ page import="reader.readerInfo"%>
<%@ page import="book.bookInfo"%>
<%request.setCharacterEncoding("GBK");%>
<jsp:useBean id="admin" scope="page" class="admin.admin" />
<jsp:useBean id="Readers" scope="page" class="reader.Readers" />
<jsp:useBean id="Books" scope="page" class="book.Books" />
<jsp:useBean id="borrowBook" scope="page" class="book.borrowBook" />
<!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>圖書管理系統(tǒng)</title></head>
<body>
<%
String supervisor = (String)session.getAttribute("supervisor");//從SESSION中獲取管理員ID
if(supervisor != null){
String bookSN = request.getParameter("newBookSN");
String readerSN = request.getParameter("newReaderSN");
String submit = request.getParameter("submit");
String submitConfirm = request.getParameter("submitConfirm");
String msg_title = null;
String msg_content = null;
boolean showTip = false;
boolean chkBook = false;
boolean chkReader = false;
if(bookSN == null){bookSN="";}else{bookSN=new String(bookSN.getBytes("ISO-8859-1"),"GBK");}
if(readerSN == null){readerSN="";}else{readerSN=new String(readerSN.getBytes("ISO-8859-1"),"GBK");}
%>
<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>圖書管理系統(tǒng)</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 />
<%if(submit == null & submitConfirm == null){%>
<!--輸入圖書編號和讀者編號-->
<form id="form" name="form" method="post" action="admin_borrow_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="newBookSN" type="text" id="newBookSN" size="20" /></td>
<td width="100" height="25" align="right">讀者編號:</td>
<td width="175" height="25" align="left"><input name="newReaderSN" type="text" id="newReaderSN" size="20" /></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>
<%}%>
<!--搜索結(jié)果-->
<%if(submit != null){
chkBook=Books.getOneBook(bookSN);
if(chkBook){
bookInfo bi=(bookInfo)Books.getBookList().elementAt(0);
%>
<br />
<!--圖書信息-->
<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">書 名:</td>
<td height="25"><%=bi.getBookName()%></td>
</tr>
<tr bgcolor="#DCEFFA">
<td align="right" height="25">作 者:</td>
<td height="25"><%=bi.getBookAuthor()%></td>
</tr>
<tr bgcolor="#D8FAFA">
<td align="right" height="25">出版社:</td>
<td height="25"><%=bi.getBookPress()%></td>
</tr>
<td align="right" height="25">I S B 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()%>">詳細(xì)資料</a></td>
</tr>
</table> </td>
</tr>
</table>
<br />
<%}else{
showTip=true;
msg_title="錯誤";
msg_content="圖書編號為 "+bookSN+" 的圖書不存在,請確認(rèn)無誤后再嘗試!";
}%>
<%chkReader = Readers.getOneReader(readerSN);
if (chkReader) {
readerInfo ri=(readerInfo)Readers.getReaderList().elementAt(0);
%>
<!--讀者信息-->
<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"><%=ri.getReaderSN()%></td>
<td width="135" height="32" rowspan="5" align="center">
<a onClick="window.open('../ReaderPicture/<%=ri.getReaderSN()%>.jpg','','')" style="cursor: hand;"><img src="../ReaderPhoto/resize/<%=ri.getReaderSN()%>.jpg" alt="點擊看大圖~" align="absmiddle" /></a> </td>
</tr>
<tr bgcolor="#D8FAFA">
<td width="143" height="25" align="right">讀者姓名:</td>
<td height="25"><%=ri.getReaderName()%></td>
</tr>
<tr bgcolor="#DCEFFA">
<td align="right" height="25">性 別:</td>
<td height="25"><%=ri.getReaderSex()%></td>
</tr>
<tr bgcolor="#D8FAFA">
<td align="right" height="25">單 位:</td>
<td height="25"><%=ri.getReaderWP()%></td>
</tr>
<tr bgcolor="#DCEFFA">
<td align="right" height="25">讀者狀態(tài):</td>
<td height="25"><%=(ri.getReaderLocked().equals("0"))?"正常":"鎖定"%></td>
</tr>
<tr>
<td colspan="3" height="15" bgcolor="#6CA6D5" align=right><a href="admin_get_one_reader.jsp?readerSN=<%=ri.getReaderSN()%>">詳細(xì)資料</a></td>
</tr>
</table> </td>
</tr>
</table>
<br />
<%}else{
showTip=true;
msg_title="錯誤";
msg_content="讀者編號為 "+readerSN+" 的讀者不存在,請確認(rèn)無誤后再嘗試!";
}
if(chkBook==true & chkReader==true){
%>
<!--確認(rèn)圖書編號和讀者編號-->
<form id="form" name="form" method="post" action="admin_borrow_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>確認(rèn)資料</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">讀者編號:</td>
<td width="175" height="25" align="left"><input name="readerSN" type="text" id="readerSN" value="<%=readerSN%>" size="20" /></td>
</tr>
<tr>
<td width="100%" height="22" colspan="4" align="center" bgcolor="#6CA6D5"><input name="submitConfirm" type="submit" id="submitConfirm" value="確認(rèn)借閱" /> </td>
</tr>
</table></td>
</tr>
</table>
</form>
<%}%>
<%}%>
<%if(submitConfirm != null){
if(borrowBook.borrowBook(request,session)){
if(borrowBook.exeBorrow(request)){
showTip = true;
msg_title = "借閱成功";
msg_content = "借閱成功,現(xiàn)在可以進(jìn)行下一次操作!";
}else{
showTip = true;
msg_title = "借閱失敗";
msg_content = "無法借閱,請聯(lián)系高級管理員解決!";
}
}else{
showTip = true;
msg_title = "借閱失敗";
msg_content = borrowBook.getErrMsg();
}
}%>
<%if(showTip==true){%>
<!--顯示信息-->
<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><%=msg_title%></strong></td>
</tr>
<tr bgcolor="#DCEFFA">
<td height="30" align="center"><%=msg_content%></td>
</tr>
</table> </td>
</tr>
</table>
<%}%> </td>
</tr>
</table>
</td>
</tr>
<tr>
</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>圖書管理系統(tǒng)</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"> </td>
</tr>
</table>
<%}%>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -