?? index.asp
字號(hào):
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="hotel.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>酒店管理系統(tǒng)</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
'打開(kāi)用戶(hù)資料數(shù)據(jù)庫(kù)---------------
Set rs_user = Server.CreateObject("ADODB.Recordset")
sql = "SELECT user_name FROM user_reg"
rs_user.Open sql,hotel_conn,3,2
'打開(kāi)房間資料數(shù)據(jù)庫(kù)---------------
Set room = Server.CreateObject("ADODB.Recordset")
sql = "SELECT room_id FROM room"
room.Open sql,hotel_conn,3,2
'生成注冊(cè)用戶(hù)總數(shù)和房間記錄總數(shù)------------------
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"> </td>
</tr>
<tr>
<td width="44"> </td>
<td width="194" class="table_small"><form name="form1" method="post" action="login.asp">
<table border="0" cellspacing="0">
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td align="right" class="text"> </td>
<td align="right" class="text">用戶(hù)名:</td>
<td align="left"><input name="user_name" type="text" class="textfield" id="user_name" size="20"></td>
<td> </td>
</tr>
<tr>
<td align="right" class="text"> </td>
<td align="right" class="text">密 碼:</td>
<td align="left"><input name="psw" type="password" class="textfield" id="psw" size="15"></td>
<td> </td>
</tr>
<tr>
<td align="right"> </td>
<td align="right"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </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="注冊(cè)"></td>
<td> </td>
</tr>
</table>
</form></td>
<td width="66" align="right" class="text"> </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">
<%
'用戶(hù)登陸后顯示歡迎用戶(hù)--------------------------
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("歡迎您," & rs_user_name("user_name") & " !<br><br>")
end if
%>
</div></td>
</tr>
<tr>
<td height="27" valign="top" class="text"><div align="left">本系統(tǒng)共收錄房間<span class="text_blue"><a href="room.asp"><%=(room_total)%></a></span>個(gè)</div></td>
</tr>
<tr>
<td height="39" valign="top" class="text"><div align="left">當(dāng)前有<span class="text_blue"><%=(rs_user_total)%></span>位注冊(cè)用戶(hù)</div></td>
</tr>
</table> <p align="center"><br>
</p>
</td>
</tr>
<tr>
<td height="90"> </td>
<td height="90" colspan="3" bgcolor="#76BABC" class="text"><div align="left"><br>
●您注冊(cè)后才能使用本系統(tǒng)的全部功能<br>
●在您預(yù)約房間后請(qǐng)及時(shí)交費(fèi)<br>
●預(yù)約必須提前24小時(shí)提出<br>
●取消預(yù)約必要提前24小時(shí)提出<br>
●一旦預(yù)約過(guò)期或已經(jīng)交費(fèi)就不能取消<br>
●有任何疑問(wèn)請(qǐng)給管理員留言</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
%>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -