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

📄 roomdetail.jsp

📁 一个酒店房间登记系统
💻 JSP
字号:

<%@ page language="java" import="java.util.*" 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">
<%@ page import="java.sql.*"%>
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'roomdetail.jsp' starting page</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>  
<!--  
a:link    { color: #090094; text-decoration: none;font-size: 12px;}
a:visited { color: #090094; text-decoration: none;font-size: 12px;}
a:hover   { color: #FF0000; text-decoration: underline;font-size: 12px;}
a:active  { color: #090094; text-decoration: none;font-size: 12px;}

-->  
</style>  
	</head>

	<body background="images/kite.gif">
		<jsp:useBean id="roomNO" scope="session" class="db.DBCon" />
		<form name="form1" method="POST">
			<P>

				房间类型:
				<%String list = null;
			String list_temp = request.getParameter("list1");
			if (list_temp != null)
				list = new String(list_temp.getBytes("iso-8859-1"), "gb2312");
			String sql_lst = "select class from roomclass";
			ResultSet rs_lst = null;
			roomNO.connect("jdbc:odbc:restaurant");
			rs_lst = roomNO.excuteQuery(sql_lst);

			%>
				<SELECT name="list1" size="1">
					<OPTION value="全部" selected="true">
						全部
					</OPTION>
					<%String value = null;
			while (rs_lst.next()) {
				value = rs_lst.getString(1);

				%>
					<option value="<%=value%>" <%
					if(list!=null){
					%> <%=list.compareTo(value)==0?"selected":""%> <%
					}
					%>>
						<%=value%>
					</option>
					<%}
			rs_lst.close();
			roomNO.close();

			%>
				</SELECT>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<INPUT type="checkbox" name="checkbox1" value="r">
				可租&nbsp;
				<INPUT type="checkbox" name="checkbox2" value="1">
				住人&nbsp;
				<INPUT type="checkbox" name="checkbox3" value="o">
				故障&nbsp;
				<INPUT type="checkbox" name="checkbox4" value="z">
				整理
			</P>
			<P>
				<INPUT type="Submit" name="button1" value="查看" />
			</P>
		</form>
		<HR>
		<%String c1 = request.getParameter("checkbox1");
			String c2 = request.getParameter("checkbox2");
			String c3 = request.getParameter("checkbox3");
			String c4 = request.getParameter("checkbox4");
			int i=0;
			if (list != null) {

				String sql = "select distinct roomno from room,roomclass,roomstate where room.classno=roomclass.classno and roomstate.roomcode=room.roomcode ";
				if (!list.equals("全部")) {
					sql += "and roomclass.class='" + list + "' ";
				}
				if (c1 != null){				
					sql += "and (roomstate='" + c1 + "' ";
					i++;
				}
				if (c2 != null ){
					if(i>0)
						sql += "or roomstate='" + c2 + "' ";
					else
						sql += "and (roomstate='" + c2 + "' ";
					i++;
				}
				if (c3 != null){
					if(i>0)
						sql += "or roomstate='" + c3 + "' ";
					else
						sql += "and (roomstate='" + c3 + "' ";
					i++;
				}
				if (c4 != null){
					if(i>0)
						sql += "or roomstate='" + c4 + "' ";
					else
						sql += "and (roomstate='" + c4 + "' ";
					i++;
				}
				if(i>0)
					sql+=")";
				ResultSet rs = null;
				
				rs = roomNO.excuteQuery(sql);
				if (rs != null) {
					while (rs.next()) {
						String no = rs.getString(1);

						%>
		<BR>
		
		<tr align="center" valign="middle" bgcolor="#F9F900">
			<td>
				<FONT color="#0000ff"><%=no%></font>
			</td>
			<td>
				<a href="room.jsp?fname=<%=no%>" target="_blank"><FONT size="2" color="red">房间配置</font></a>
			</td>
			<TD>
				<a href="guest.jsp?fname=<%=no%>" target="_blank"><FONT size="2" color="green">客人情况</font></a>
			</td>
			<td>
				<a href="register.jsp?fname=<%=no%>" target="_blank" ><FONT size="2" color="blue">入住登记</font></a>
			</td>
			<td>
				<a href="rschange.jsp?roomno=<%=no%>" target="_blank" ><FONT size="2" color="#7c7ff7">房态修改</font></a>
			</td>
		</tr>
		<%}
					rs.close();
					roomNO.close();
				}
			}

		%>
	</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -