📄 reserve.jsp
字号:
<%@ page language="java" import="java.util.*,com.bean.util.*" pageEncoding="UTF-8"%>
<%
String readerId=session.getAttribute("user").toString();
String sql="select b.BookName,b.author,a.ReserveId,a.time,a.flag,a.bookId from reserve a,BookInfo b,readerInfo r where r.readerId='"+readerId+"' and r.readerId=a.readerId and b.bookId=a.bookId";
DbConn conn=new DbConn();
String[][] bookinfo=conn.getData(sql);
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'reserve.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<div style="padding-left:30px;padding-top:10px;">
<table style="BORDER: #d6d6d6 1px solid;">
<tr><th style="width:80px">预约序号</th><th style="width:100px">题名</th><th style="width:100px">作者/编著</th><th style="width:100px">预约日期</th><th style="width:80px">是否可借</th><th></th></tr>
<%
if(bookinfo!=null){
for(int i=0;i<bookinfo.length;i++){
if(bookinfo[i][4].equals("N")){
%>
<tr><td><%=i+1 %></td><td><%=bookinfo[i][0] %></td><td><%=bookinfo[i][1] %></td><td><%=bookinfo[i][3].substring(0,10) %></td><td>否</td><td><a href='UnReserve?reserveId=<%=bookinfo[i][2]%>&bookId=<%=bookinfo[i][5] %>'>解除预约</a></td></tr>
<%
}else{%>
<tr><td><%=i +1%></td><td><%=bookinfo[i][0] %></td><td><%=bookinfo[i][1] %></td><td><%=bookinfo[i][3].substring(0,10) %></td><td>可借</td><td><a href='UnReserve?reserveId=<%=bookinfo[i][2]%>&bookId=<%=bookinfo[i][5] %>'>解除预约</a></td></tr>
<% }
}
}
%>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -