1.登陆界面
index.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>登录</title> <style> .a{ margin-top: 20px; } .b{ font-size: 20px; width: 160px; color: white; background-color: greenyellow; } </style> </head> <body> <% Object message = request.getAttribute("message"); if(message!=null && !"".equals(message)){ %> <script type="text/javascript"> alert("<%=request.getAttribute("message")%>"); </script> <% } %> <div align="center" id="div1"> <form action="useservlet?method=login" method="post" onsubmit="check()"> <a class="a">请输入账号密码</a> <div class="a"> 账号<input type="text" name="id"></input> </div> <div class="a"> 密码<input type="text" name="password"></input> </div> <div class="a"> <button type="submit" class="b">登 录</button> </div> </form> </div> </body> </html>
2.管理员登陆界面
genlist.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>管理员登陆</title> <style> .a{ margin-top: 20px; } </style> </head> <body> <% Object message = request.getAttribute("message"); if(message!=null && !"".equals(message)){ %> <script type="text/javascript"> alert("<%=request.getAttribute("message")%>"); </script> <% } %> <div align="center" id="div1"> <form> <div class="a"> <a href="genAddDu.jsp">添加读者信息</a> </div> <div class="a"> <a href="genAddBook.jsp">添加新书信息</a> </div> <div class="a"> <a href="useservlet?method=cuilist">打印催还书目</a> </div> <div class="a"> <a href="index.jsp">返回</a> </div> </form> </div> </body> </html>
3.添加读者信息
genAddDu.jsp
<%-- Created by IntelliJ IDEA. User: linmob Date: 2020/11/17 Time: 15:45 To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <meta charset="UTF-8"> <title>读者信息添加</title> <style> .a{ margin-top: 20px; } .b{ font-size: 20px; width: 160px; color: white; background-color: greenyellow; } </style> </head> <body> <% Object message = request.getAttribute("message"); if(message!=null && !"".equals(message)){ %> <script type="text/javascript"> alert("<%=request.getAttribute("message")%>"); </script> <% } %> <div align="center" id="div1"> <h1 style="color: red;">添加读者</h1> <form action="useservlet?method=addDu" name="information" method="post" onsubmit="return check()"> <div class="a"> 学号:<input type="text" id="duid" name="duid"/> </div> <div class="a"> 姓名:<input type="text" id="duname" name="duname"/> </div> <div class="a"> <label>性别:</label> <input type="radio" name="sex" value="男" checked="checked"/>男 <input type="radio" name="sex" value="女"/>女 </div> <div class="a"> 学院:<input type="text" id="school" name="school"/> </div> <div class="a"> <button type="submit" class="b">保 存</button> </div> <div class="a"> <a href="genlist.jsp" >返回</a> </div> </form> </div> <script Language="javaScript"> function check() { /* if (document.information.sqare.value == "") { alert("住房面积不能为空."); document.information.sqare.focus(); return false; }*/ return true; } </script> </body> </html>
4.添加新书信息
genAddBook.jsp
<%-- Created by IntelliJ IDEA. User: linmob Date: 2020/11/17 Time: 15:45 To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <meta charset="UTF-8"> <title>图书信息添加</title> <style> .a{ margin-top: 20px; } .b{ font-size: 20px; width: 160px; color: white; background-color: greenyellow; } </style> </head> <body> <% Object message = request.getAttribute("message"); if(message!=null && !"".equals(message)){ %> <script type="text/javascript"> alert("<%=request.getAttribute("message")%>"); </script> <% } %> <div align="center" id="div1"> <h1 style="color: red;">添加图书</h1> <form action="useservlet?method=addBook" name="information" method="post" onsubmit="return check()"> <div class="a"> 编号:<input type="text" id="bid" name="bid"/> </div> <div class="a"> 书名:<input type="text" id="bname" name="bname"/> </div> <div class="a"> 作者名:<input type="text" id="bwriter" name="bwriter"/> </div> <div class="a"> 出版社:<input type="text" id="bout" name="bout"/> </div> <div class="a"> 可借阅数目:<input type="text" id="bnum" name="bnum"/> </div> <div class="a"> <button type="submit" class="b">保 存</button> </div> <div class="a"> <a href="genlist.jsp" >返回</a> </div> </form> </div> <script Language="javaScript"> function check() { /* if (document.information.sqare.value == "") { alert("住房面积不能为空."); document.information.sqare.focus(); return false; }*/ return true; } </script> </body> </html>
5.催还
cuilist.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <style> .a{ margin-top: 20px; } .b{ font-size: 20px; width: 160px; color: white; background-color: greenyellow; } .tb, td { border: 1px solid black; font-size: 22px; } </style> </head> <body> <div align="center"> <h1 style="color: red;">催还信息列表</h1> <table class="tb"> <tr> <td>编号</td> <td>书名</td> <td>读者编号</td> <td>借书日期</td> <td>还书日期</td> <td>超出日期</td> </tr> <!-- forEach遍历出adminBeans --> <c:forEach items="${cui}" var="item" varStatus="status"> <tr> <td>${item.bid}</td> <td>${item.bname}</td> <td>${item.duid}</td> <td>${item.jiedate}</td> <td>${item.huandate}</td> <td>${item.chaodate}</td> </tr> </c:forEach> </table> <a href="dulist.jsp">返回主页</a> </div> </body> </html>
cuilist2.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <style> .a{ margin-top: 20px; } .b{ font-size: 20px; width: 160px; color: white; background-color: greenyellow; } .tb, td { border: 1px solid black; font-size: 22px; } </style> </head> <body> <div align="center"> <h1 style="color: red;">催还信息列表</h1> <table class="tb"> <tr> <td>编号</td> <td>书名</td> <td>读者编号</td> <td>借书日期</td> <td>还书日期</td> <td>超出日期</td> </tr> <!-- forEach遍历出adminBeans --> <c:forEach items="${cui}" var="item" varStatus="status"> <tr> <td>${item.bid}</td> <td>${item.bname}</td> <td>${item.duid}</td> <td>${item.jiedate}</td> <td>${item.huandate}</td> <td>${item.chaodate}</td> </tr> </c:forEach> </table> <a href="genlist.jsp">返回主页</a> </div> </body> </html>
6.读者登录界面
dulist.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>读者登录</title> <style> .a{ margin-top: 20px; } </style> </head> <body> <% Object message = request.getAttribute("message"); if(message!=null && !"".equals(message)){ %> <script type="text/javascript"> alert("<%=request.getAttribute("message")%>"); </script> <% } %> <div align="center" id="div1"> <form> <div class="a"> <a href="useservlet?method=lookBook">浏览图书信息</a> </div> <div class="a"> <a href="searchBook.jsp">查询图书信息</a> </div> <div class="a"> <a href="searchBook.jsp">借阅图书</a> </div> <div class="a"> <a href="useservlet?method=cuiBook">浏览催还书目</a> </div> <div class="a"> <a href="useservlet?method=jieBooklist">归还图书</a> </div> <div class="a"> <a href="index.jsp">返回</a> </div> </form> </div> </body> </html>
7.浏览图书信息
lookBook.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <style> .a{ margin-top: 20px; } .b{ font-size: 20px; width: 160px; color: white; background-color: greenyellow; } .tb, td { border: 1px solid black; font-size: 22px; } </style> </head> <body> <div align="center"> <h1 style="color: red;">图书列表</h1> <table class="tb"> <tr> <td>编号</td> <td>书名</td> <td>作者</td> <td>出版社</td> <td>可借阅数</td> </tr> <!-- forEach遍历出adminBeans --> <c:forEach items="${books}" var="item" varStatus="status"> <tr> <!--<td><a href="BillServlet?method=getbillbyidcard3&idcard="> </a></td>--> <td>${item.bid}</td> <td>${item.bname}</td> <td>${item.bwriter}</td> <td>${item.bout}</td> <td>${item.bnum}</td> </tr> </c:forEach> </table> <a href="dulist.jsp">返回主页</a> </div> </body> </html>
8.图书查询
searchBook.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <style> .a{ margin-top: 20px; } .b{ font-size: 20px; width: 160px; color: white; background-color: greenyellow; } </style> </head> <body> <div align="center"> <h1 style="color: cyan;">图书查询</h1> <form action="useservlet?method=searchBook" method="post" onsubmit="return check()"> <div class="a"> 书名:<input type="text" id="bname" name="bname"/> </div> <div class="a"> 作者名<input type="text" id="bwriter" name="bwriter"/> </div> <div class="a"> <button type="submit" class="b">查 询</button> </div> <div class="a"> <a href="dulist.jsp?" >返回</a> </div> </form> </div> </body> </html>
searchlist.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <style> .a{ margin-top: 20px; } .b{ font-size: 20px; width: 160px; color: white; background-color: greenyellow; } .tb, td { border: 1px solid black; font-size: 22px; } </style> </head> <body> <div align="center"> <h1 style="color: red;">图书信息列表</h1> <a href="searchBook.jsp">继续查询</a> <table class="tb"> <tr> <td>编号</td> <td>书名</td> <td>作者</td> <td>出版社</td> <td>可借阅数</td> </tr> <!-- forEach遍历出adminBeans --> <c:forEach items="${books}" var="item" varStatus="status"> <tr> <td>${item.bid}</td> <td>${item.bname}</td> <td>${item.bwriter}</td> <td>${item.bout}</td> <td>${item.bnum}</td> <td><a href="useservlet?method=getbookbybid&bid=${item.bid}">借阅</a></td> </tr> </c:forEach> </table> <a href="dulist.jsp?">返回主页</a> </div> </body> </html>
9.还书
huanlist.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <style> .a{ margin-top: 20px; } .b{ font-size: 20px; width: 160px; color: white; background-color: greenyellow; } .tb, td { border: 1px solid black; font-size: 22px; } </style> </head> <body> <div align="center"> <h1 style="color: red;">图书信息列表</h1> <table class="tb"> <tr> <td>编号</td> <td>书名</td> <td>读者id</td> <td>借书日期</td> <td>还书日期</td> </tr> <!-- forEach遍历出adminBeans --> <c:forEach items="${huan}" var="item" varStatus="status"> <tr> <td>${item.bid}</td> <td>${item.bname}</td> <td>${item.duid}</td> <td>${item.jiedate}</td> <td>${item.huandate}</td> <td><a href="useservlet?method=huanBookbybid&bid=${item.bid}">还书</a></td> </tr> </c:forEach> </table> <a href="dulist.jsp">返回主页</a> </div> </body> </html>