forked from maxliaops/Java_Web_Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathborrowQuery.jsp
More file actions
144 lines (144 loc) · 5.35 KB
/
borrowQuery.jsp
File metadata and controls
144 lines (144 loc) · 5.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="com.dao.BorrowDAO" %>
<%@ page import="com.actionForm.BorrowForm" %>
<%@ page import="java.util.*"%>
<html>
<%
Collection coll=(Collection)request.getAttribute("borrowQuery");
%>
<head>
<title>图书馆管理系统</title>
<link href="CSS/style.css" rel="stylesheet">
<script src="JS/function.js"></script>
<script language="javascript">
function check(myform){
if(myform.flag[0].checked==false && myform.flag[1].checked==false){
alert("请选择查询方式!");return false;
}
if (myform.flag[1].checked){
if(myform.sdate.value==""){
alert("请输入开始日期");myform.sdate.focus();return false;
}
if(CheckDate(myform.sdate.value)){
alert("您输入的开始日期不正确(如:2011-02-14)\n 请注意闰年!");myform.sDate.focus();return false;
}
if(myform.edate.value==""){
alert("请输入结束日期");myform.edate.focus();return false;
}
if(CheckDate(myform.edate.value)){
alert("您输入的结束日期不正确(如:2011-02-14)\n 请注意闰年!");myform.edate.focus();return false;
}
}
}
</script>
</head>
<body onLoad="clockon(bgclock)">
<%@include file="banner.jsp"%>
<%@include file="navigation.jsp"%>
<table width="778" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td valign="top" bgcolor="#FFFFFF"><table width="99%" height="510" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="tableBorder_gray">
<tr>
<td height="510" valign="top" style="padding:5px;"><table width="98%" height="487" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="22" valign="top" class="word_orange">当前位置:系统查询 > 图书借阅查询 >>></td>
</tr>
<tr>
<td align="center" valign="top">
<form name="myform" method="post" action="borrow?action=borrowQuery">
<table width="98%" height="67" border="0" cellpadding="0" cellspacing="0" bgcolor="#E3F4F7" class="tableBorder_gray">
<tr>
<td rowspan="2" align="center" bgcolor="#F9D16B"> <img src="Images/search.gif" width="45" height="28"></td>
<td height="29" bgcolor="#F9D16B"><input name="flag" type="checkbox" class="noborder" value="a" checked>
请选择查询依据:
<select name="f" class="wenbenkuang" id="f">
<option value="barcode">图书条形码</option>
<option value="bookname">图书名称</option>
<option value="readerbarcode">读者条形码</option>
<option value="readername">读者名称</option>
</select>
<input name="key" type="text" id="key" size="50">
<input name="Submit" type="submit" class="btn_grey" value="查询" onClick="return check(myform)"></td>
</tr>
<tr>
<td height="26" bgcolor="#F9D16B">
<input name="flag" type="checkbox" class="noborder" value="b">
借阅时间: 从
<input name="sdate" type="text" id="sdate">
到
<input name="edate" type="text" id="edate">
(日期格式为:2011-02-14)</td>
</tr>
</table>
</form>
<%
if(coll==null || coll.isEmpty()){
%>
<table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="36" align="center">暂无图书借阅信息!</td>
</tr>
</table>
<%
}else{
//通过迭代方式显示数据
Iterator it=coll.iterator();
String bookname="";
String bookbarcode="";
String readerbar="";
String readername="";
String borrowTime="";
String backTime="";
int ifback=0;
String ifbackstr="";
%>
<table width="98%" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bordercolordark="#F6B83B" bordercolorlight="#FFFFFF">
<tr align="center" bgcolor="#e3F4F7">
<td width="11%" bgcolor="#F9D16B">图书条形码</td>
<td width="29%" bgcolor="#F9D16B">图书名称</td>
<td width="15%" bgcolor="#F9D16B">读者条形码</td>
<td width="13%" bgcolor="#F9D16B">读者名称</td>
<td width="12%" bgcolor="#F9D16B">借阅时间</td>
<td width="12%" bgcolor="#F9D16B">应还时间</td>
<td width="8%" bgcolor="#F9D16B">是否归还</td>
</tr>
<%
while(it.hasNext()){
BorrowForm borrowForm=(BorrowForm)it.next();
bookname=borrowForm.getBookName();
bookbarcode=borrowForm.getBookBarcode();
readerbar=borrowForm.getReaderBarcode();
readername=borrowForm.getReaderName();
borrowTime=borrowForm.getBorrowTime();
backTime=borrowForm.getBackTime();
ifback=borrowForm.getIfBack();
if(ifback==0){
ifbackstr="未归还";
}else{
ifbackstr="已归还";
}
%>
<tr>
<td style="padding:5px;"> <%=bookbarcode%></td>
<td style="padding:5px;"><%=bookname%></td>
<td style="padding:5px;"> <%=readerbar%></td>
<td style="padding:5px;"> <%=readername%></td>
<td style="padding:5px;"> <%=borrowTime%></td>
<td style="padding:5px;"> <%=backTime%></td>
<td align="center" style="padding:5px;"> <%=ifbackstr%></td>
</tr>
<%
}
}
%>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table><%@ include file="copyright.jsp"%></td>
</tr>
</table>
</body>
</html>