⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 listdel.jsp

📁 jsp+sqlserver2000+tomcat做的教材管理系统。基本功能全部实现
💻 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 + -