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

📄 index.asp

📁 asp酒店房间预约系统设计+论文 本酒店房间预约系统按照用户部分和管理员部分划分了两块
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="hotel.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>酒店管理系统</title>
<style type="text/css">
<!--
@import url("style.css");
-->
</style>
<script language="JavaScript" type="text/JavaScript"> 
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
</head>

<%
dim rs_user,room
dim rs_user_total,room_total
'打开用户资料数据库---------------
Set rs_user = Server.CreateObject("ADODB.Recordset")
sql = "SELECT user_name FROM user_reg"
rs_user.Open sql,hotel_conn,3,2
'打开房间资料数据库---------------
Set room = Server.CreateObject("ADODB.Recordset")
sql = "SELECT room_id FROM room"
room.Open sql,hotel_conn,3,2
'生成注册用户总数和房间记录总数------------------
If (rs_user.RecordCount = -1) Then
	rs_user_total=0
	rs_user.movefirst
	While (Not rs_user.EOF)
		rs_user_total = rs_user_total + 1
		rs_user.MoveNext
	Wend
else
	rs_user_total = rs_user.RecordCount
End If
If (room.RecordCount = -1) Then
	room_total=0
	room.movefirst
	While (Not room.EOF)
		room_total = room_total + 1
		room.MoveNext
	Wend
else
	room_total = room.RecordCount
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (room_total = -1) Then

  ' count the total records by iterating through the recordset
  room_total=0
  While (Not room.EOF)
    room_total = room_total + 1
    room.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (room.CursorType > 0) Then
    room.MoveFirst
  Else
    room.Requery
  End If

  ' set the number of rows displayed on this page
  If (room_numRows < 0 Or room_numRows > room_total) Then
    room_numRows = room_total
  End If

  ' set the first and last displayed record
  room_first = 1
  room_last = room_first + room_numRows - 1
  
  If (room_first > room_total) Then
    room_first = room_total
  End If
  If (room_last > room_total) Then
    room_last = room_total
  End If

End If
%>


<body>
<div align="center">
  <table width="760" border="0" class="table_big">
    <tr>
      <td height="345" valign="top"><div align="center">
        <!--#include file="include/head.asp" -->
		<br>
        <table border="0" cellspacing="0">
          <tr>
            <td colspan="4">&nbsp;</td>
          </tr>
          <tr>
            <td width="44">&nbsp;</td>
            <td width="194" class="table_small"><form name="form1" method="post" action="login.asp">
              <table border="0" cellspacing="0">
                <tr>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  </tr>
                <tr>
                  <td align="right" class="text">&nbsp;</td>
                  <td align="right" class="text">用户名:</td>
                  <td align="left"><input name="user_name" type="text" class="textfield" id="user_name" size="20"></td>
                  <td>&nbsp;</td>
                  </tr>
                <tr>
                  <td align="right" class="text">&nbsp;</td>
                  <td align="right" class="text">密&nbsp;&nbsp;码:</td>
                  <td align="left"><input name="psw" type="password" class="textfield" id="psw" size="15"></td>
                  <td>&nbsp;</td>
                  </tr>
                <tr>
                  <td align="right">&nbsp;</td>
                  <td align="right">&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  </tr>
                <tr>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
				  <% if isempty(session("user_name")) then login="登录" else login="重新登录" end if %>
                  <td align="center"><input name="login" type="submit" class="button_" id="login" value="<%= login %>">
                    <input name="reg" type="button" class="button_" id="reg" onClick="MM_goToURL('parent','reg.asp');return document.MM_returnValue" value="注册"></td>
                  <td>&nbsp;</td>
                  </tr>
              </table>
            </form></td>
            <td width="66" align="right" class="text">&nbsp;</td>
            <td width="252" align="right" valign="top" class="text">
			<table width="225" height="131" border="0" align="left" class="table_small">
              <tr>
                <td height="14"><div align="left">
                </div></td>
              </tr>
              <tr>
                <td height="21" class="text"><div align="left">
                  <%
			'用户登陆后显示欢迎用户--------------------------
			if not isempty(session("user_name")) then
				set rs_user_name=server.CreateObject("adodb.recordset")
				sql="select * from user_reg where user_name ='" & session("user_name") &"'"
				rs_user_name.open sql,hotel_conn,3,2
				'下面的response.Write中可以输出Html代码-------------
				response.Write("欢迎您," & session("user_name") &  " &nbsp;!<br><br>")
			end if 
			%>
                </div></td>
              </tr>
              <tr>
                <td height="27" valign="top" class="text"><div align="left">本系统共收录房间<span class="text_blue"><a href="room.asp"><%=(room_total)%></a></span>个</div></td>
              </tr>
              <tr>
                <td height="39" valign="top" class="text"><div align="left">当前有<span class="text_blue"><%=(rs_user_total)%></span>位注册用户</div></td>
              </tr>
            </table>              <p align="center"><br>
              </p>
              </td>
          </tr>
          <tr>
            <td height="90">&nbsp;</td>
            <td height="90" colspan="3" bgcolor="#76BABC" class="text"><div align="left"><br>
              ●您注册后才能使用本系统的全部功能<br>
                ●在您预约房间后请及时交费<br>
                ●预约必须提前24小时提出<br>
                ●取消预约必要提前24小时提出<br>
                ●一旦预约过期或已经交费就不能取消<br>
              ●有任何疑问请给管理员留言</div></td>
            </tr>
        </table>
        <br>
        <!--#include file="include/foot.asp" -->
		<br>
      </div></td>
    </tr>
  </table>
</div>
</body>
</html>
<%
set rs_user_name = Nothing
rs_user.Close()
Set rs_user = Nothing
room.Close()
Set room = Nothing
%>

⌨️ 快捷键说明

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