|
|
|
@ -1,83 +1,83 @@
|
|
|
|
|
<%@page import="javabean.Util"%>
|
|
|
|
|
<%@page import="javabean.Base"%>
|
|
|
|
|
<%@page import="java.sql.ResultSet"%>
|
|
|
|
|
<%@page import="java.sql.PreparedStatement"%>
|
|
|
|
|
<%@page import="java.sql.Connection"%>
|
|
|
|
|
<%@page import="javabean.Util"%> <!-- 导入自定义的Util类 -->
|
|
|
|
|
<%@page import="javabean.Base"%> <!-- 导入自定义的Base类 -->
|
|
|
|
|
<%@page import="java.sql.ResultSet"%> <!-- 导入ResultSet类,用于处理SQL查询结果 -->
|
|
|
|
|
<%@page import="java.sql.PreparedStatement"%> <!-- 导入PreparedStatement类,用于执行预编译的SQL语句 -->
|
|
|
|
|
<%@page import="java.sql.Connection"%> <!-- 导入Connection类,用于建立数据库连接 -->
|
|
|
|
|
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
|
|
|
|
pageEncoding="UTF-8"%>
|
|
|
|
|
pageEncoding="UTF-8"%> <!-- 设置页面语言为Java,内容类型和字符编码为UTF-8 -->
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html>
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<title>书籍借阅历史</title>
|
|
|
|
|
<link rel="stylesheet" href="../public/layui/css/layui.css" media="all">
|
|
|
|
|
<script src="../public/layui/layui.js" charset="utf-8"></script>
|
|
|
|
|
<style>
|
|
|
|
|
.layui-table, .layui-table-view{
|
|
|
|
|
margin-top: 0px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<meta charset="UTF-8"> <!-- 设置HTML文档的字符编码为UTF-8 -->
|
|
|
|
|
<title>书籍借阅历史</title> <!-- 设置网页标题 -->
|
|
|
|
|
<link rel="stylesheet" href="../public/layui/css/layui.css" media="all"> <!-- 引入Layui样式表 -->
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
.layui-table, .layui-table-view{
|
|
|
|
|
margin-top: 0px; /* 设置表格顶部边距为0 */
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<%
|
|
|
|
|
String id = request.getParameter("id");
|
|
|
|
|
String name = request.getParameter("name");
|
|
|
|
|
Connection connection = null;
|
|
|
|
|
PreparedStatement pstmt = null;
|
|
|
|
|
ResultSet resultSet = null;
|
|
|
|
|
String sql = "select * from borrow_books,borrow_card where book_id=? and card_id=borrow_card.id order by borrow_books.id desc";
|
|
|
|
|
connection = (Connection)Base.getConnection();
|
|
|
|
|
pstmt = connection.prepareStatement(sql);
|
|
|
|
|
pstmt.setString(1,id);
|
|
|
|
|
resultSet = pstmt.executeQuery();
|
|
|
|
|
String id = request.getParameter("id"); // 获取请求参数中的id
|
|
|
|
|
String name = request.getParameter("name"); // 获取请求参数中的name
|
|
|
|
|
Connection connection = null; // 声明数据库连接对象
|
|
|
|
|
PreparedStatement pstmt = null; // 声明预编译SQL语句对象
|
|
|
|
|
ResultSet resultSet = null; // 声明结果集对象
|
|
|
|
|
String sql = "select * from borrow_books,borrow_card where book_id=? and card_id=borrow_card.id order by borrow_books.id desc"; // SQL查询语句
|
|
|
|
|
connection = (Connection)Base.getConnection(); // 获取数据库连接
|
|
|
|
|
pstmt = connection.prepareStatement(sql); // 创建预编译SQL语句对象
|
|
|
|
|
pstmt.setString(1,id); // 设置SQL语句中的参数
|
|
|
|
|
resultSet = pstmt.executeQuery(); // 执行查询并获取结果集
|
|
|
|
|
/* while(resultSet.next()){
|
|
|
|
|
out.print(resultSet.getString("id"));
|
|
|
|
|
}*/
|
|
|
|
|
%>
|
|
|
|
|
<div class="layui-form">
|
|
|
|
|
<table class="layui-table">
|
|
|
|
|
<colgroup>
|
|
|
|
|
<col width="150">
|
|
|
|
|
<col width="150">
|
|
|
|
|
<col width="200">
|
|
|
|
|
<col width="200">
|
|
|
|
|
<col width="200">
|
|
|
|
|
<col width="200">
|
|
|
|
|
<col width="220">
|
|
|
|
|
<col width="200">
|
|
|
|
|
<col width="200">
|
|
|
|
|
</colgroup>
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>ID</th>
|
|
|
|
|
<th>书籍ID</th>
|
|
|
|
|
<th>书籍名</th>
|
|
|
|
|
<th>借阅证</th>
|
|
|
|
|
<th>借阅者</th>
|
|
|
|
|
<th>借阅时间</th>
|
|
|
|
|
<th>归还时间</th>
|
|
|
|
|
<th>违规信息</th>
|
|
|
|
|
<th>处理人</th>
|
|
|
|
|
</tr>
|
|
|
|
|
<%while(resultSet.next()){ %>
|
|
|
|
|
<tr>
|
|
|
|
|
<td><%=resultSet.getString("id") %></td>
|
|
|
|
|
<td><%=id %></td>
|
|
|
|
|
<td><%=name %></td>
|
|
|
|
|
<td><%=resultSet.getString("borrow_card.id") %></td>
|
|
|
|
|
<td><%=resultSet.getString("reader") %></td>
|
|
|
|
|
<td><%=Util.getFormatDateTime(resultSet.getString("borrow_date")) %></td>
|
|
|
|
|
<td><%=resultSet.getString("return_date") != null? Util.getFormatDateTime(resultSet.getString("return_date")) : "" %></td>
|
|
|
|
|
<td><%=resultSet.getString("illegal") != null? resultSet.getString("illegal") : "" %></td>
|
|
|
|
|
<td><%=resultSet.getString("manager_id") != null? resultSet.getString("manager_id") : "" %></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<%} %>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
<div class="layui-form"> <!-- Layui表单容器 -->
|
|
|
|
|
<table class="layui-table"> <!-- Layui表格 -->
|
|
|
|
|
<colgroup>
|
|
|
|
|
<col width="150"> <!-- 定义列宽 -->
|
|
|
|
|
<col width="150">
|
|
|
|
|
<col width="200">
|
|
|
|
|
<col width="200">
|
|
|
|
|
<col width="200">
|
|
|
|
|
<col width="200">
|
|
|
|
|
<col width="220">
|
|
|
|
|
<col width="200">
|
|
|
|
|
<col width="200">
|
|
|
|
|
</colgroup>
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>ID</th> <!-- 表头单元格 -->
|
|
|
|
|
<th>书籍ID</th>
|
|
|
|
|
<th>书籍名</th>
|
|
|
|
|
<th>借阅证</th>
|
|
|
|
|
<th>借阅者</th>
|
|
|
|
|
<th>借阅时间</th>
|
|
|
|
|
<th>归还时间</th>
|
|
|
|
|
<th>违规信息</th>
|
|
|
|
|
<th>处理人</th>
|
|
|
|
|
</tr>
|
|
|
|
|
<%while(resultSet.next()){ %> <!-- 遍历结果集 -->
|
|
|
|
|
<tr>
|
|
|
|
|
<td><%=resultSet.getString("id") %></td> <!-- 显示借阅记录ID -->
|
|
|
|
|
<td><%=id %></td> <!-- 显示书籍ID -->
|
|
|
|
|
<td><%=name %></td> <!-- 显示书籍名称 -->
|
|
|
|
|
<td><%=resultSet.getString("borrow_card.id") %></td> <!-- 显示借阅证ID -->
|
|
|
|
|
<td><%=resultSet.getString("reader") %></td> <!-- 显示借阅者姓名 -->
|
|
|
|
|
<td><%=Util.getFormatDateTime(resultSet.getString("borrow_date")) %></td> <!-- 显示格式化后的借阅日期 -->
|
|
|
|
|
<td><%=resultSet.getString("return_date") != null? Util.getFormatDateTime(resultSet.getString("return_date")) : "" %></td> <!-- 显示格式化后的归还日期,如果为空则显示空字符串 -->
|
|
|
|
|
<td><%=resultSet.getString("illegal") != null? resultSet.getString("illegal") : "" %></td> <!-- 显示违规信息,如果为空则显示空字符串 -->
|
|
|
|
|
<td><%=resultSet.getString("manager_id") != null? resultSet.getString("manager_id") : "" %></td> <!-- 显示处理人ID,如果为空则显示空字符串 -->
|
|
|
|
|
</tr>
|
|
|
|
|
<%} %>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|
</html>
|
|
|
|
|