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

📄 listquery.jsp

📁 JSP制作的图书管理系统
💻 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 type = "";
		String message = "";
	%>

	<%
		request.setCharacterEncoding("gb2312");
		Listid = (String) session.getAttribute("Listid");
		type = request.getParameter("type");
		if (Listid != null) {
			sql = "select * from List where Listid='" + Listid + "'";
			//out.println(Listid);
			try {
				rs = myRs.executeQuery(sql);
			} catch (Exception e) {
				e.printStackTrace();
				response.sendRedirect("error");
			}
			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");
			}
		}

		if (type == null)
			type = "";
		if (type.equals("Listid")) {
			Listid = request.getParameter("Listid");
			//out.println(Listid);
			sql = "select * from List where Listid='" + Listid + "'";
			//out.println(sql);
			try {
				rs = myRs.executeQuery(sql);
			} catch (Exception e) {
				e.printStackTrace();
				response.sendRedirect("error");
			}
			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");
			}
		}

		if (type == null)
			type = "";
		if (type.equals("classname")) {
			classname = request.getParameter("classname");
			sql = "select * from List where classname='" + classname + "'";
			//out.println(classname);
			try {
				rs = myRs.executeQuery(sql);
			} catch (Exception e) {
				e.printStackTrace();
				response.sendRedirect("error");
			}
			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");
			}
		}

		if (type == null)
			type = "";
		if (type.equals("bookname")) {
			bookname = request.getParameter("bookname");
			sql = "select * from List where bookname='" + bookname + "'";
			//out.println(bookname);
			try {
				rs = myRs.executeQuery(sql);
			} catch (Exception e) {
				e.printStackTrace();
				response.sendRedirect("error");
			}
			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");
			}
		}
		if (Listid == null)
			Listid = "";
		if (Ldate == null)
			Ldate = new Date();
	%>
	<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="ListQuery.jsp?type=Listid">
									<table width="100%" border="1">
										<tr>
											<td width="16%">
												定单编号:
											</td>
											<td width="33%">
												<input name="Listid" type="text" id="bookid12"
													value="<%=Listid%>">
											</td>
											<td width="51%">
												<label>
													<input type="submit" name="Submit22" value="查询">
												</label>
											</td>
										</tr>
									</table>
								</form>
								<form name="form" method="post"
									action="ListQuery.jsp?type=classname">
									<table width="100%" border="1">
										<tr>
											<td width="16%">
												班级名称:
											</td>
											<td width="33%">
												<input name="classname" type="text" id="bookid1"
													value="<%=classname%>">
											</td>
											<td width="51%">
												<label>
													<input type="submit" name="Submit2" value="查询">
												</label>
											</td>
										</tr>
									</table>
								</form>
								<form name="form" method="post"
									action="ListQuery.jsp?type=bookname">
									<table width="100%" border="1">
										<tr>
											<td width="16%">
												图书名称:
											</td>
											<td width="33%">
												<input name="bookname" type="text" id="bookid13"
													value="<%=bookname%>">
											</td>
											<td width="51%">
												<label>
													<input type="submit" name="Submit23" value="查询">
												</label>
											</td>
										</tr>
									</table>
								</form>
								<form name="form1" method="post" action="Book.jsp?type=save">
									<table width="100%" border="1">
										<tr>
											<td width="18%">
												<label>
													定单编号:
												</label>
											</td>
											<td width="32%">
												<label>
													<input name="bookid" type="text" id="Listid"
														value="<%=Listid%>">
												</label>
											</td>
											<td width="21%">
												图书名称:
											</td>
											<td width="29%">
												<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%>">
											</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 + -