forked from maxliaops/Java_Web_Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbook_add.jsp
More file actions
169 lines (166 loc) · 5.67 KB
/
book_add.jsp
File metadata and controls
169 lines (166 loc) · 5.67 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="com.dao.BookDAO" %>
<%@ page import="com.dao.BookTypeDAO" %>
<%@ page import="com.actionForm.BookForm" %>
<%@ page import="com.actionForm.BookTypeForm"%>
<%@ page import="com.dao.BookCaseDAO" %>
<%@ page import="com.actionForm.BookCaseForm" %>
<%@ page import="com.dao.PublishingDAO" %>
<%@ page import="com.actionForm.PublishingForm" %>
<%@ page import="java.util.*"%>
<html>
<%
String str=null;
BookTypeDAO bookTypeDAO=new BookTypeDAO();
Collection coll_type=(Collection)bookTypeDAO.query(str);
if(coll_type==null || coll_type.isEmpty()){
out.println("<script>alert('请先录入图书类型信息!');history.back(-1);</script>");
}else{
Iterator it_type=coll_type.iterator();
int typeID=0;
String typename="";
BookCaseDAO bookcaseDAO=new BookCaseDAO();
String str1=null;
Collection coll_bookcase=(Collection)bookcaseDAO.query(str1);
if(coll_bookcase==null || coll_bookcase.isEmpty()){
out.println("<script>alert('请先录入书架信息!');history.back(-1);</script>");
}else{
Iterator it_bookcase=coll_bookcase.iterator();
int bookcaseID=0;
String bookcasename="";
PublishingDAO pubDAO=new PublishingDAO();
String str2=null;
Collection coll_pub=(Collection)pubDAO.query(str2);
if(coll_pub==null || coll_pub.isEmpty()){
out.println("<script>alert('请先录入出版社信息!');history.back(-1);</script>");
}else{
Iterator it_pub=coll_pub.iterator();
String isbn="";
String pubname="";
%>
<script language="jscript">
function check(form){
if(form.barcode.value==""){
alert("请输入条形码!");form.barcode.focus();return false;
}
if(form.bookName.value==""){
alert("请输入图书名称!");form.bookName.focus();return false;
}
if(form.price.value==""){
alert("请输入图书定价!");form.price.focus();return false;
}
}
</script>
<head>
<title>图书馆管理系统</title>
<link href="CSS/style.css" rel="stylesheet">
</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"><table width="100%" height="493" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top">
<form name="form1" method="post" action="book?action=bookAdd">
<table width="600" height="432" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="173" align="center">条 形 码:</td>
<td width="427" height="39">
<input name="barcode" type="text" id="barcode">
*</td>
</tr>
<tr>
<td align="center">图书名称:</td>
<td height="39"><input name="bookName" type="text" id="bookName" size="50">
* </td>
</tr>
<tr>
<td align="center">图书类型:</td>
<td>
<select name="typeId" class="wenbenkuang" id="typeId">
<%
while(it_type.hasNext()){
BookTypeForm bookTypeForm=(BookTypeForm)it_type.next();
typeID=bookTypeForm.getId().intValue();
typename=bookTypeForm.getTypeName();
%>
<option value="<%=typeID%>"><%=typename%></option>
<%}%>
</select> </td>
</tr>
<tr>
<td align="center">作者:</td>
<td><input name="author" type="text" id="author" size="40"></td>
</tr>
<tr>
<td align="center">译者:</td>
<td><input name="translator" type="text" id="translator" size="40"></td>
</tr>
<tr>
<td align="center">出版社:</td>
<td><select name="isbn" class="wenbenkuang">
<%
while(it_pub.hasNext()){
PublishingForm pubForm=(PublishingForm)it_pub.next();
isbn=pubForm.getIsbn();
pubname=pubForm.getPubname();
%>
<option value="<%=isbn%>"><%=pubname%></option>
<%}%>
</select> </td>
</tr>
<tr>
<td align="center">价格:</td>
<td><input name="price" type="text" id="price">
(元) * </td>
</tr>
<tr>
<td align="center">页码:</td>
<td><input name="page" type="text" id="page"></td>
</tr>
<tr>
<td align="center">书架:</td>
<td><select name="bookcaseid" class="wenbenkuang" id="bookcaseid">
<%
while(it_bookcase.hasNext()){
BookCaseForm bookCaseForm=(BookCaseForm)it_bookcase.next();
bookcaseID=bookCaseForm.getId().intValue();
bookcasename=bookCaseForm.getName();
%>
<option value="<%=bookcaseID%>"><%=bookcasename%></option>
<%}%>
</select>
<input name="operator" type="hidden" id="operator" value="<%=manager%>"></td>
</tr>
<tr>
<td align="center"> </td>
<td><input name="Submit" type="submit" class="btn_grey" value="保存" onClick="return check(form1)">
<input name="Submit2" type="button" class="btn_grey" value="返回" onClick="history.back()"></td>
</tr>
</table>
</form>
</td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table><%@ include file="copyright.jsp"%></td>
</tr>
</table>
<%}
}
}%>
</body>
</html>