?? listdel.jsp
字號:
<%@ page language="java" contentType="text/html; charset=gb2312"
import="java.util.*" pageEncoding="gb2312" errorPage="../error.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>刪除訂單</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">
-->
<style type="text/css">
<!--
.STYLE3 {font-family: "宋體"; font-size: 18px; }
-->
</style>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<jsp:useBean id="myRs" scope="page" class="utils.DBManager" />
<%
String userid = (String) session.getAttribute("userid");
if (userid == null)
response.sendRedirect("../index.jsp?error=2");
%>
<%
Integer level = (Integer) session.getAttribute("level");
int l = level.intValue();
if (level == null)
response.sendRedirect("../index.jsp?error=2");
if (!(l == 2))
response.sendRedirect("../error.jsp");
%>
<%
String sql = null;
java.sql.Connection con = null;
java.sql.ResultSet rs = null;
String Listid = null;
String bookname = null;
String classname = null;
Float price = null;
int menbers = 0;
int Lnumber = 0;
Date Ldate = null;
int checked = 0;
String message = "";
String type = "";
%>
<%
request.setCharacterEncoding("gb2312");
Listid = (String) session.getAttribute("Listid");
//out.println(Listid);
if (Listid != null) {
sql = "select * from List where Listid='" + Listid + "'";
//out.println(sql);
try {
rs = myRs.executeQuery(sql);
} catch (Exception e) {
e.printStackTrace();
message = "該記錄已被刪除!";
}
while (rs.next()) {
Listid = rs.getString("listid");
bookname = rs.getString("bookname");
price = Float.valueOf(rs.getFloat("price"));
Lnumber = rs.getInt("Lnumber");
classname = rs.getString("classname");
menbers = rs.getInt("menbers");
Ldate = rs.getDate("Ldate");
checked = rs.getInt("checked");
}
type = request.getParameter("type");
//out.println(type);
if (type == null)
type = "";
if (type.equals("delete")) {
sql = "delete from List where Listid='" + Listid + "'";
//out.println(sql);
try {
int i = myRs.executeUpdate(sql);
message = "記錄被成功刪除!";
} catch (Exception e) {
e.printStackTrace();
message = "刪除失敗!";
}
}
}
%>
<body>
<table width="1024" border="0" align="center">
<tr>
<td>
<img src="MainImages/Top.jpg" width="1024" height="126">
</td>
</tr>
<tr>
<td>
<table width="1024" height="300" border="0"
background="MainImages/bg01.gif">
<tr>
<td width="192" valign="top">
<table width="100%" height="160" border="0">
<tr>
<td valign="middle">
<div align="center" class="STYLE3">
<a href="../Main.jsp">首頁</a>
</div>
</td>
</tr>
<tr>
<td valign="middle">
<div align="center" class="STYLE3">
<a href="ListInfo.jsp">定單信息</a>
</div>
</td>
</tr>
<tr>
<td valign="middle">
<div align="center" class="STYLE3">
<a href="ListQuery.jsp">定單號查詢</a>
</div>
</td>
</tr>
<tr>
<td valign="middle">
<div align="center" class="STYLE3">
<a href="ListQuery.jsp">按班級查詢</a>
</div>
</td>
</tr>
<tr>
<td valign="middle">
<div align="center" class="STYLE3">
<a href="ListQuery.jsp">按圖書名查詢</a>
</div>
</td>
</tr>
<tr>
<td valign="middle">
<div align="center" class="STYLE3">
<a href="ListDel.jsp">刪除已有定單</a>
</div>
</td>
</tr>
<tr>
<td valign="middle">
<div align="center" class="STYLE3">
<a href="ListAdd.jsp">增加新的定單</a>
</div>
</td>
</tr>
</table>
</td>
<td width="822" align="center">
<form name="form" method="post" action="ListDel.jsp?type=delete">
<table width="100%" border="1">
<tr>
<td width="16%">
<label>
定單編號:
</label>
</td>
<td width="33%">
<label>
<input name="bookid" type="text" id="bookid"
value="<%=Listid%>">
</label>
</td>
<td width="18%">
圖書名稱:
</td>
<td width="33%">
<label>
<input name="bookname" +i+"" type="text" id="bookname"
value="<%=bookname%>">
</label>
</td>
</tr>
<tr>
<td>
班級名稱:
</td>
<td>
<label>
<input name="auther" type="text" id="auther"
value="<%=classname%>">
</label>
</td>
<td>
圖書售價:
</td>
<td>
<label>
<input name="pbdate" type="text" id="pbdate"
value="<%=price%>">
</label>
</td>
</tr>
<tr>
<td>
班級人數:
</td>
<td>
<label>
<input name="price" +i+"" type="text" id="price"
value="<%=menbers%>">
</label>
</td>
<td>
已定貨數量:
</td>
<td>
<label>
<input name="publisher" type="text" id="publisher"
value="<%=Lnumber%>">
</label>
</td>
</tr>
<tr>
<td>
預定日期:
</td>
<td>
<label>
<input name="price2" +i+"" type="text" id="price2"
value="<%=Ldate%>">
</label>
</td>
<td>
是否已全部預定:
</td>
<td>
<input type="text" name="textfield" value="<%=checked%>">
(是1/否0)
</td>
</tr>
<tr>
<td colspan="4">
<div align="center">
<input type="submit" name="Submit" value="刪除">
</div>
</td>
</tr>
</table>
<center>
<%=message%>
</center>
</form>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<p align="center">
<img src="MainImages/bottom.gif" width="1024" height="80"
border="0" usemap="#Map">
</p>
</td>
</tr>
</table>
<map name="Map">
<area shape="rect" coords="521,49,605,70"
href="mailto:zhangxuebo1025@163.com" target="_blank">
</map>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -