📄 addbook_confirm.jsp
字号:
<%@ page language="java" import="java.util.*,book.*"
pageEncoding="gb2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<title>图书管理</title>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<link rel="stylesheet" href="Css/style.css" />
<style type="text/css">
<!--
.STYLE1 {
font-size: 30px;
font-weight: bold;
color: #FF0000;
}
.STYLE2 {
font-size: 24px;
font-weight: bold;
}
-->
</style>
</head>
<body>
<table width="800" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td width="22" background="images/bg_left.gif">
</td>
<td width="760">
<table width="760" height="568" border="0" align="center"
cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td height="126" align="center">
<img src="images/bg_top.gif" width="761" height="126">
</td>
</tr>
<tr>
<td height="347" valign="top" class="STYLE1">
<%
String adminName = (String) session.getAttribute("admin");
if (adminName == null) {
String error = "请您先输入用户名与密码登陆!";
session.setAttribute("error", error);
response.sendRedirect("error.jsp");
}
String bookName = ToChinese.ToChange((String) request
.getParameter("bookName"));
String publish = ToChinese.ToChange((String) request
.getParameter("publish"));
String author = ToChinese.ToChange((String) request
.getParameter("author"));
String ISBN = ToChinese.ToChange((String) request
.getParameter("ISBN"));
String dianSort = ToChinese.ToChange((String) request
.getParameter("dianSort"));
String standardSort = ToChinese.ToChange((String) request
.getParameter("standardSort"));
String priceString = ToChinese.ToChange((String) request
.getParameter("price"));
float price = 0;
try {
price = Float.parseFloat(priceString);
} catch (Exception ex) {
ex.printStackTrace();
}
String regTimeString = ToChinese.ToChange((String) request
.getParameter("regTime"));
Date regTime = null;
try {
regTime = new java.text.SimpleDateFormat("yyyy-MM-dd")
.parse(regTimeString);
} catch (Exception ex) {
ex.printStackTrace();
}
String introduce = ToChinese.ToChange((String) request
.getParameter("introduce"));
String remark = ToChinese.ToChange((String) request
.getParameter("remark"));
String sql = "INSERT INTO book(book_name,publish,author,ISBN,Dian_sort,"
+ "standard_sort,price,checkin_time,introduce,remark)"
+ "values ('"
+ bookName
+ "','"
+ publish
+ "','"
+ author
+ "','"
+ ISBN
+ "','"
+ dianSort
+ "','"
+ standardSort
+ "','"
+ priceString
+ "','"
+ regTimeString
+ "','"
+ introduce + "','" + remark + "')";
int num = DbConnect.update(sql);
if(num > 0){
out.print("增加成功");
}
else{
out.print("增加失败");
}
%>
<p align="center">
<a href="addBook.jsp" class="STYLE2">返回</a>
</p>
</td>
</tr>
<tr>
<td align="center" class="tableBorder_LR">
</td>
</tr>
</table>
<td width="19" background="images/bg_right.gif">
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -