【摘要】宏都大酒店管理信息系统中不能通过互联网方式进行客房预订,通过本次设计主要实现通过互联网方式进行客房预订。让客户足不出户坐在家里就能预订出自己想要的客房。主要功能有:酒店简介、客房简介、客房报价、客房预订信息提交,预订信息查询及修改,删除,等等)管理员信息查询、回复预订信息等功能,真正实现酒店的无纸化,电子信息化、无距离限制的进行客房信息的预订。
本软件的后台数据库也采用微软公司的大型数据库SQLSERVER2000,与原C/S系统的数据库SQLSERVER2000相同,进行了一次无缝链接,也就是说在原有SQLSERVER2000数据库上面进行适当的添加表,使得能保持在原来的系统的基础上进行升级。
【关键字】 数据库应用与开发 asp ACCESS2000 SQLSERVEER2000 B/S模式 客房预订
3.1 设计实现的策略和算法描述
系统的总体任务是实现客房预订管理信息系统的系统化、规范化和自动化。系统功能分析是在系统开发的总体任务的基础上完成的。本系统中主要完成的功能主要有:
A:酒店简介,能让客户能够对酒店有一个了解,比地理位置、规模、档次等。
B:客房信息查询,能够在网上了解到客房的样子、客房的档次。
C:客房价格的查询,让客户能够知道他根据自身的情况订购出适合自己的客房。
D:客房的预订登记。
E:管理员密码验证、管理员回复预订信息、管理员删除预订信息以及修改预订信息及修改管理员的用户名和密码。
F:系统功能模块设计
对上述各项功能进行集中、分块,按照结构化程序设计的要求,得到如图系统功能模块图:
4.1各模块详述系统各部分的实现方法
宏都大酒店简介,主要功能是让客户了解宏都大酒店的规模情况。
主要功能,显示宏都大酒店客房情况,包括点击放大图片,查询房价、或预订房间。
功能是显示房间的价格,让客户了解房价的情况。
客房的预订登记信息
4.2 程序流程
<%
page = Request.QueryString("page")
action = Request.QueryString("action")
action_e = Request.Form("action_e")
set Conn=Server.CreateObject("ADODB.Connection")’ 连接数据库
Conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("\data\data.mdb")
%>’ “\data\data.mdb”指定数据库的路径
<html>
<head>
<title>宏都大酒店客房网上预订管理系统</title>
<meta name="keywords" content="宏都大酒店客房网上预订管理系统">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="gbstyle.css" type="text/css">
<style type="text/css">
<!--
body {
background-image: url(../bg_p1.gif);
}
.style4 {color: #990000}
body,td,th {
color: #666666;
}
.style5 {
color: #666666;
font-weight: bold;
}
.style7 {color: #FF3300}
-->
</style>
</head>
<script language="JavaScript">
<!--
function reloadPage(init) {
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.pgW=innerWidth; document.pgH=innerHeight; οnresize=reloadPage; }}
else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}
reloadPage(true);
function jumpMenu(targ,selObj,restore){
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
function openBrWindow(theURL,winName,features) {
window.open(theURL,winName,features);
}
function get_cookie(Name){
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset,end))
}
}
return returnvalue;
}
function swapImgRestore() {
var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function preloadImages() {
var d=document; if(d.images){ if(!d.p) d.p=new Array();
var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}
function findObj(n, d) {
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function swapImage() {
var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#FFFFFF">
<table width="760" border="0" cellpadding="0" cellspacing="0" align="center">
<tr><td width="199" align="center" height="16"><img border="0" src="images/Zc-interhotel.GIF" width="425" height="26"></td><td width="331" align="center" height="16"><img border="0" src="images/Zc-interhotel.GIF" width="333" height="26"></td></tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" class="boder">
<!--DWLayoutTable-->
<tr>
<td valign="top"><table width="760" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#F0F0F0">
<!--DWLayoutTable-->
<tr>
<td width="627" height="16" align="right" valign="middle" background="images/top_01.gif"><strong><img border="0" src="images/TOP.jpg" width="755" height="100"></strong></td>
</tr>
<tr>
<td height="16" valign="top"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="72" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="notice">
<!--DWLayoutTable-->
<tr bgcolor="f9f9f9">
<td width="20" valign="top"><!--DWLayoutEmptyCell--> </td>
<td width="160" valign="top" bgcolor="#cde0a0">
<div align="center"><strong>宏都大酒店客房网上预订管理系统</strong>
<br>
<br>
<strong><font color="#FF6600" size="2"><a href="/index.asp" target="_blank">返回首页</a></font></strong></div></td>
<td width="20" valign="top" background="images/line2.gif" bgcolor="#cde0a0"><!--DWLayoutEmptyCell--> </td>
<td valign="top" bgcolor="#cde0a0"> <br>
欢迎您使用宏都大酒店客房预订系统!在本系统您可方便地在网上预订宏都大酒店客房。您只需按提示填完下面订房表并发送至宏都大酒店销售部,我们将尽快给您答复。请务必将您的E-mail地址或电话、传真告诉我们,以便联系。若您有任何问题或要求,请<a href="mailto:info@hd_hotel.com">与我站联系</a>。<strong><br>
</strong></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="46" valign="top"><table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F0F0F0">
<tr>
<td align="center" valign="top" class="input1">
<%
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'主程序
Select Case action_e
Case ""
Case "Add_New" ‘添加客房预定的信息
Call Add_New_Execute() 调用客房预订的函数
Case "reply" ‘客房预订的回复
Call Reply_Execute() 调用客房预订的函数
Case "admin" ‘管理员登录
Call Admin_Login_Execute() 调用管理员登录模块
Case "EditPWD" 修改当前操作员密码
Call EditPWD_Execute() 调用修改当前操作员密码模块
Case "Edit" 修改预订信息
Call Edit_Execute() 调用修改预订信息
End Select
Call Main_Menu() 进入管理员调用主菜单
Select Case action ‘选择调用情况
Case "UbbHelp"
Call UbbHelp()
Case "Admin_Login" 管理员登录
Call Admin_Login() 调用管理员登录模块
Case "Exit" 如果选择退出管理员登录
Call Exit_Admin() 调用了退出管理员登录
Call View_Words() 调用浏览预订信息浏览模块
Case ""
Call View_Words() 调用浏览预订信息浏览模块
Case "Add_New" 如果是“添加预订信息”
Call Add_New() 调用“添加预订信息”
Case "reply" 如果是回复预订信息
Call Reply() 调用回复预订信息模块
Case "View_Words"如果是浏览预订信息
Call View_Words()调用浏览预订信息模块
Case "Delete"如果是删除预订信息
Call Delete() 调用删除预订信息模块
Call View_Words() 调用预订浏览信息模块
Case "EditPWD" 如果是是修改密码
Call EditPWD() 调用修改密码模块
Case "Edit" 如果是编辑预订信息
Call Edit() 调用编辑预订信息模块
End Select
Call Copyrights() 调用版权信息
%> </td>
</tr>
</table>
<HR width="95%" color=#000000 noShade SIZE=1>
<table width="760" height="43" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" bgcolor="#F0F0F0" height="22"> <font color="#000000"> 程序设计:康宾
大丰广播电视大学</font>
<p> </p>
</td>
</tr>
<tr>
<td background="images/top_01.gif" height="21"> </td>
</tr>
</table></td>
</tr>
</table>
<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'添加一条新预订信息
%>
<% Sub Add_New() %>
<table width="760" border="0" cellspacing="1" cellpadding="4" align="center">
<form name="new" method="post" action="ydgl.asp">
<tr>
<td align="center"> <font size="6" face="黑体" color="#000000">预订登记</font> </td>
</tr>
<tr>
<td align="right">
<P align="left"><STRONG><FONT color=#ff0000>(</FONT><FONT color=#ff0000
size=2>填表时请注意:凡标有*的项目为订房必需内容)</FONT></STRONG></P>
<P align="left"><FONT face=宋体>姓 名</FONT><FONT face=宋体 size=2> <INPUT
maxLength=256 size=15 name=姓名> </FONT><FONT face=宋体 color=#ff0000
size=2>* </FONT><FONT face=宋体 color=#ff0000><FONT
color=#000000>公司</FONT> <INPUT maxLength=256 size=35 name=公司>
</FONT></P>
<P align="left"><FONT face=宋体>地 址</FONT><FONT face=宋体 size=2> <INPUT
maxLength=256 size=35 name=地址> </FONT></P>
<P align="left"><FONT face=宋体>城 市</FONT><FONT face=宋体 size=2> <INPUT
maxLength=256 size=15 name=城市> </FONT><FONT face=宋体>省 份</FONT><FONT
face=宋体 size=2> <INPUT maxLength=256 size=15 name=省份> </FONT></P>
<P align="left"><FONT face=宋体>国 别</FONT><FONT face=宋体 size=2> <INPUT
maxLength=256 size=15 name=国别> </FONT><FONT face=宋体>邮 政 编 码
</FONT><FONT face=宋体 size=2><INPUT maxLength=256 size=15 name=邮编>
</FONT></P>
<P align="left"><FONT face=宋体>E-Mail 地 址</FONT><FONT face=宋体 size=2> <INPUT
maxLength=256 size=35 name=email> </FONT><FONT face=宋体 color=#ff0000
size=2>* </FONT></P>
<P align="left"><FONT face=宋体>电 话</FONT><FONT face=宋体 size=2> <INPUT
maxLength=256 size=15 name=电话> <FONT
color=#ff3366>*</FONT></FONT></P>
<P align="left"><FONT face=宋体>传 真 </FONT><FONT face=宋体 size=2><INPUT
maxLength=256 size=15 name=传真> </FONT></P>
<P align="left"><FONT face=宋体>入 住 日 期 <INPUT maxLength=256 size=10 name=入住日期>
<FONT color=#ff0000>* </FONT>离 开 日 期 <INPUT maxLength=256 size=10
name=离开日期> </FONT><FONT face=宋体 color=#ff0000 size=2>* </FONT></P>
<P align="left"><FONT face=宋体>入 住 夜 数 <INPUT maxLength=256 size=2 name=入住夜数>
<FONT color=#ff0000>* </FONT>房 间 数 <INPUT maxLength=256 size=2
name=房间数> <FONT color=#ff0000>* </FONT>入 住 成 人 数 <INPUT
maxLength=256 size=2 name=入住成人数> </FONT><FONT face=宋体
color=#ff0000>* </FONT></P>
<P align="left"><FONT face=宋体>客 房 类 型 <SELECT size=1 name=房间类型> <OPTION
selected>套房</OPTION> <OPTION>三人间</OPTION> <OPTION>豪华单人间</OPTION>
<OPTION>标准间</OPTION> <OPTION>商务套房</OPTION></SELECT> 床 位 要 求 <SELECT
size=1 name=床位要求> <OPTION value=bed-plus-not selected>不加床</OPTION>
<OPTION value=bed-plus>加床</OPTION></SELECT> 请您 <a target="_blank" href="fjjs.asp">查看客房</a> 或
<a href="http://price.asp" target="_blank">了解价格</a></FONT></P>
<P align="left"><FONT face=宋体>支 付 方 式 <SELECT size=1 name=支付方式> <OPTION
value=RM selected>人民币</OPTION> <OPTION value=CK>支票</OPTION>
<OPTION value=PC>牡丹卡</OPTION> <OPTION value=MT>万事达卡</OPTION>
<OPTION value=JC>JCB</OPTION> <OPTION value=GW>长城金卡</OPTION>
<OPTION value=GR>长城卡</OPTION> <OPTION value=DI>大来卡</OPTION>
<OPTION value=AE>运通卡</OPTION> <OPTION value=BX>不限</OPTION></SELECT>
</FONT><FONT face=宋体
color=#ff0000 size=2>* </FONT></P>
<P align="left">
<P align="left">您若有其他特殊要求,请留言:(您的预订将在宏都大酒店回复后生效) </P><FONT size=2>
<P align="left"><FONT face=宋体><TEXTAREA name=特殊要求 rows=6 cols=65 type="textarea"></TEXTAREA>
</FONT></P></FONT>
<p> </td>
</tr>
<tr align="center">
<td> <input type="hidden" name="action_e" value="Add_New">
<input type="submit" name="Submit" value=" " class="submit">
<input type="reset" name="Submit2" value=" " class="reset"> </td>
</tr>
</form>
</table>
<br>
<% End Sub %>
<%
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'管理员回复预订信息
%>
<% Sub Reply() %>
<table width="499" border="0" cellspacing="1" cellpadding="4" align="center">
<form name="reply" method="post" action="ydgl.asp">
<tr>
<td colspan="2" align="center">
<font color="#000000">回复预订信息</font>
</td>
</tr>
<tr>
<td align="right" valign="top">
预订信息内容:
</td>
<td>
<textarea name="reply" cols="50" rows="5" class="input1"></textarea>
</td>
</tr>
<tr align="center">
<td colspan="2">
<input type="hidden" name="action_e" value="reply"> <input type="hidden" name="id" value="<%=Request.QueryString("id")%>">
<input type="submit" name="Submit3" value="提交" ID="Submit1" class="input1"> <input type="reset" name="Submit22" value="重写" class="input1">
</td>
</tr>
</form>
</table>
<% End Sub %>
<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
%>
<% Sub Main_Menu() %>
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center"> <br>
<a href="ydgl.asp?action=Add_New"> <img src="images/tjly.gif" alt="预订信息登记" width="60" height="25" class="bian"></a>
<a href="ydgl.asp?action=View_Words"><img src="images/ckly.gif" alt="查看预订信息" width="60" height="25" class="bian"></a>
<% If Session("Admin")="Login" Then %>
<a href="ydgl.asp?action=Exit"><img src="images/tcgl.gif" alt="退出管理" width="60" height="25" class="bian"></a>
<% Else %>
<a href="ydgl.asp?action=Admin_Login"><img src="images/glly.gif" alt="管理预订信息" width="60" height="25" class="bian"></a>
<% End If %>
<% If Session("Admin")="Login" Then %>
<a href="ydgl.asp?action=EditPWD"><img src="images/xgmm.gif" alt="修改密码" width="60" height="25" class="bian"></a>
<% End If %> </td>
</tr>
</table>
<br>
<% End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'查看预订信息
Sub View_Words()
Set Rs = Server.CreateObject("ADODB.RecordSet")
Sql="Select * From words Order By 日期 Desc"
Rs.Open Sql,Conn,1,1
if rs.recordcount=0 then
Response.Write"没有预订信息!"
Response.End
end if
TotalRecord=Rs.RecordCount
Rs.PageSize =10 '每页显示预订的数目
PageSize = Rs.PageSize
PageCount=Rs.PageCount
If page="" Then
Rs.AbsolutePage = 1
Else
Rs.AbsolutePage = page
End If
%>
<table width="499" border="0" cellspacing="1" cellpadding="4" align="center">
<tr>
</tr>
</table>
<table width="499" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><p align="center"><img src="IMAGES/line.gif" width="470" height="1"></td></p>
</tr>
</table>
<br>
<%
do while i < PageSize And not rs.eof
%>
<table width="760" border="0" cellspacing="1" cellpadding="4" align="center" style="table-layout:fixed;word-break:break-all">
<tr>
<td align="right" rowspan="7" height="26" valign="top" width="9"> <font color="#000000"> </font>
<br> </td>
<td width="75" align="right"><span class="style5">姓名:</span> </td>
<td width="230"><%=Rs("姓名")%></td>
<td width="50" align="right"> </td>
<td valign="top" width="89"> </td>
</tr>
<tr>
<%If Rs("公司")<>"" Then%>
<td align="right" width="75"> <span class="style5">主页地址: </span> </td>
<td colspan="3"><b><font color="#FF3300"><a href="<%=Rs("公司")%>" target="_blank"><%=Rs("公司")%></a></font></b></td>
<%End If%>
</tr>
<tr>
<td width="75" align="right" valign="top"><strong><b>E-Mail:</b></strong></td>
<td width="230"><%=Rs("地址")%></td>
<td align="right" width="50"><b>日期:</b></td>
<td width="89" align="left"><font color="#000000"> </font><%=Left(Rs("日期"),9)%></td>
</tr>
<tr>
<td valign="top" width="75" align="right"> <b>留言内容:</b></td>
<td colspan="3"><%=Rs("请您留言")%></td>
</tr>
<tr>
<%If Rs("回复")<>"" Then%>
<td align="right" valign="top" width="75"><b><span class="style4">回 复:</span></b>
</td>
<td colspan="3"><font color="#FF6600"><%=Ubb(unHtml(Rs("回复")))%></font></td>
<%End If%>
</tr>
<tr>
<td align="right" valign="top"> </td>
<td colspan="3">
<% If Session("Admin") = "Login" Then %>
<a href="ydgl.asp?action=Delete&id=<%=Rs("id")%>">【删除】</a> <a href="ydgl.asp?action=reply&id=<%=Rs("id")%>">【回复】</a>
<a href="ydgl.asp?action=Edit&id=<%=Rs("id")%>">【编辑】</a>
<% End If %>
</td>
</tr>
</table>
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="16" background="images/line.gif"></td>
</tr>
</table>
<%
rs.movenext
i=i+1
loop
Rs.Close
Set Rs = Nothing
%>
<table width="760" border="0" cellspacing="1" cellpadding="4" align="center">
<tr>
<td align="right" height="20">共有<%=TotalRecord%>条预订信息 分页
<%
For m = 1 To PageCount
%>
[<a href="ydgl.asp?page=<%=m%>"><%=m%></a>]
<%
Next
%>
</td>
<td align="right"> </td>
</tr>
</table>
<% End Sub %>
<%
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'管理员登陆接口
%>
<% Sub Admin_Login() %>
<br>
<table width="760" border="0" cellspacing="1" cellpadding="4" align="center">
<form name="reply" method="post" action="ydgl.asp">
<tr>
<td colspan="2" align="center">管理登录</td>
</tr>
<tr>
<td align="right" valign="top" width="105">
用户名:
</td>
<td width="226">
<input type="text" name="username" class="input1">
</td>
</tr>
<tr>
<td align="right" valign="top" width="105">
密 码:
</td>
<td width="226">
<input type="password" name="password" class="input1"> <input type="hidden" name="action_e" value="admin">
</td>
</tr>
<tr align="center">
<td colspan="2">
<input type="submit" name="Submit32" value=" " class="b">
</td>
</tr>
</form>
</table>
<br>
<% End Sub%>
<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
%>
<%
Sub Copyrights()
%>
<%
End Sub
%>
<%Sub UbbHelp()%>
<div align="left">
<table width="499" border="0" cellspacing="1" cellpadding="4" align="center">
<tr>
<td height="20" colspan="4" align="center"> </td>
</tr>
<tr>
<td width="17"><div align="right"></div></td>
<td width="74"> </td>
<td width="308"> </td>
<td width="63"> </td>
</tr>
<tr>
<td width="17" height="20"><div align="right"></div></td>
<td width="74" height="20"> </td>
<td width="308" height="20"> </td>
<td width="63" height="20"> </td>
</tr>
<tr>
<td width="17"><div align="right"></div></td>
<td width="74"> </td>
<td width="308"> </td>
<td width="63"> </td>
</tr>
<tr>
<td width="17" height="20"><div align="right"></div></td>
<td width="74" height="20"> </td>
<td width="308" height="20"> </td>
<td width="63" height="20"> </td>
</tr>
<tr>
<td width="17"><div align="right"></div></td>
<td width="74"> </td>
<td width="308"> </td>
<td width="63"> </td>
</tr>
<tr>
<td width="17"><div align="right"></div></td>
<td width="74"> </td>
<td width="308"> </td>
<td width="63"> </td>
</tr>
<tr>
<td width="17"><div align="right"></div></td>
<td width="74"> </td>
<td width="308"> </td>
<td width="63"> </td>
</tr>
</table>
<%End Sub%>
</div>
<%Sub EditPWD()%>
<table width="499" border="0" cellspacing="1" cellpadding="4" align="center">
<form name="editpwd" method="post" action="ydgl.asp">
<tr>
<td colspan="2" align="center"> <b>修改密码</b></td>
</tr>
<tr>
<td align="right" valign="middle" width="105" height="38">旧用户名:</td>
<td width="226" height="38" align="left">
<input type="text" name="oldusername" class="input1">
</td>
</tr>
<tr>
<td align="right" valign="middle" width="105" height="38">新用户名:</td>
<td width="226" height="38" align="left">
<input type="text" name="username" class="input1">
</td>
</tr>
<tr>
<td align="right" valign="middle" width="105" height="38">确认新用户名:</td>
<td width="226" height="38" align="left">
<input type="text" name="username_c" class="input1">
</td>
</tr>
<tr>
<td align="right" valign="middle" width="105" height="38"> 旧 密 码: </td>
<td width="226" height="38" align="left">
<input type="password" name="oldpwd" class="input1">
</td>
</tr>
<tr>
<td align="right" valign="middle" width="105">新 密 码: </td>
<td width="226" align="left">
<input type="password" name="newpwd" class="input1">
</td>
</tr>
<tr>
<td align="right" valign="middle" width="105" height="38">确认新密码:</td>
<td width="226" align="left" height="38">
<input type="password" name="newpwd_c" class="input1">
<input type="hidden" name="action_e" value="EditPWD">
</td>
</tr>
<tr align="center">
<td colspan="2">
<input type="submit" name="EditPWD" value="修改密码" class="input1">
</td>
</tr>
</form>
</table>
<%End Sub%>
<% Sub Edit() %>
<%
Set Rs = Server.CreateObject("ADODB.RecordSet")
Sql="Select * From words Where 编号="&Request.QueryString("id")
Rs.Open Sql,Conn,1,1
%>
<table width="499" border="0" cellspacing="1" cellpadding="4" align="center">
<form name="reply" method="post" action="ydgl.asp">
<tr>
<td colspan="2" align="center"> 编辑预订信息</td>
</tr>
<tr>
<td align="right" valign="top"> 来客预订内容: </td>
<td>
<textarea name="words" cols="50" rows="5" class="input1"><%=Rs("words")%></textarea>
</td>
</tr>
<tr align="center">
<td align="right">回复:</td>
<td align="left">
<textarea name="reply" cols="50" rows="5" class="input1"><%=Rs("回复")%></textarea>
</td>
</tr>
<tr align="center">
<td colspan="2">
<input type="hidden" name="action_e" value="Edit">
<input type="hidden" name="id" value="<%=Request.QueryString("id")%>">
<input type="submit" name="Submit" value="修改预订信息" id="Submit" class="input1">
<a href="ydgl.asp?action=View_Words">返回</a></td>
</tr>
</form>
</table>
<% End Sub %>
</body>
</html>
<%
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'添加新预订信息到数据库
Sub Add_New_Execute()
If Request.Form("姓名")="" Then
Response.Write "<br>错误类型: 姓名不能为空"
Response.Write "<br>"
Response.Write "<a href=""ydgl.asp?action=Add_New""><br>返回</a><br><br><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td><img src=images/bottom.gif width=530 height=27 border=0></td> </tr></table>"
Response.End
End If
If Len(Request.Form("姓名"))>20 Then
Response.Write "<br>错误类型: 姓名不能太长"
Response.Write "<br>"
Response.Write "<a href=""ydgl.asp?action=Add_New""><br>返回</a><br><br><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td><img src=images/bottom.gif width=530 height=27 border=0></td> </tr></table>"
Response.End
End If
Set Rs = Server.CreateObject("ADODB.RecordSet")
Sql="Select * From words"
Rs.Open Sql,Conn,2,3
Rs.AddNew
Rs("姓名")=Server.HTMLEncode(Request.Form("姓名"))
Rs("公司")=Server.HTMLEncode(Request.Form("公司"))
Rs("地址")=Server.HTMLEncode(Request.Form("地址"))
Rs("城市")=Server.HTMLEncode(Request.Form("城市"))
Rs("省份")=Server.HTMLEncode(Request.Form("省份"))
Rs("国别")=Server.HTMLEncode(Request.Form("国别"))
Rs("邮政编码")=Server.HTMLEncode(Request.Form("邮编"))
Rs("E-mail")=Server.HTMLEncode(Request.Form("email"))
Rs("电话")=Server.HTMLEncode(Request.Form("电话"))
Rs("传真")=Server.HTMLEncode(Request.Form("传真"))
Rs("入住日期")=Server.HTMLEncode(Request.Form("入住日期"))
Rs("离开日期")=Server.HTMLEncode(Request.Form("离开日期"))
Rs("入住夜数")=Server.HTMLEncode(Request.Form("入住夜数"))
Rs("房间数")=Server.HTMLEncode(Request.Form("房间数"))
Rs("入住成人数")=Server.HTMLEncode(Request.Form("入住成人数"))
Rs("客房类型")=Server.HTMLEncode(Request.Form("房间类型"))
Rs("床位要求")=Server.HTMLEncode(Request.Form("床位要求"))
Rs("支付方式")=Server.HTMLEncode(Request.Form("支付方式"))
Rs("请您留言")=Server.HTMLEncode(Request.Form("特殊要求"))
rs("日期")=date
Rs.Update
Rs.Close
Set Rs = Nothing
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'验证管理员登陆
Sub Admin_Login_Execute()
username = Server.HTMLEncode(Request.Form("username"))
password = Server.HTMLEncode(Request.Form("password"))
If username = "" OR password = "" Then
Response.Write "<br>错误类型: 用户名或者密码为空"
Response.Write "<br>"
Response.Write "<a href=""ydgl.asp?action=Admin_Login""><br>返回</a><br><br><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td><img src=images/bottom.gif width=530 height=27 border=0></td> </tr></table>"
Response.End
End If
Set Rs = Server.CreateObject("ADODB.RecordSet")
Sql="Select * From admin"
Rs.Open Sql,Conn,1,1
If username = Rs("username") AND password = Rs("password") Then
Session("Admin") = "Login"
Else
Response.Write "<br>错误类型: 用户名或者密码不对,登陆失败"
Response.Write "<br>"
Response.Write "<a href=""ydgl.asp?action=Admin_Login""><br>返回</a><br><br><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td><img src=images/bottom.gif width=530 height=27 border=0></td> </tr></table>"
Response.End
End If
Rs.Close
Set Rs = Nothing
End Sub
Sub EditPWD_Execute()
oldusername=Server.HTMLEncode(Request.Form("oldusername")) ‘从客户端返回旧用户名
username = Server.HTMLEncode(Request.Form("username")) ‘从客户端返回新用户名
username_c = Server.HTMLEncode(Request.Form("username_c")) ‘从客户端再次返回新用户名
oldpwd = Server.HTMLEncode(Request.Form("oldpwd")) ‘从客户端返回旧密码
newpwd = Server.HTMLEncode(Request.Form("newpwd")) ‘从客户端返回新密码
newpwd_c = Server.HTMLEncode(Request.Form("newpwd_c")) ‘从客户端再次新密码
If username = "" OR username_c="" Then 如果新用户名或旧用户名为空的话则:
Response.Write "新旧用户名均不能为空" 提示出错信息
Response.End ‘退出过程
End If
If oldpwd = "" OR newpwd = "" OR newpwd_c="" Then 如果新旧密码为空的话则
Response.Write "新旧密码均不能为空" 则提示出错信息
Response.End 退出过程
End If
If username<>username_c Then 如果两次新用户名输入不相同的话 则
Response.Write "新填写的两个新用户名不一致,请重新填写" 提示出错信息
Response.End 退出过程
End If
If newpwd<>newpwd_c Then 如果两次新密码输入不同话则
Response.Write "新填写的两个密码不一致,请重新填写" 提示出错信息
Response.End 退出过程
End If
Set Rs = Server.CreateObject("ADODB.RecordSet") 生成一个ADODB对象
Sql="Select * From admin" 从ADMIN表中查询所有的记录
Rs.Open Sql,Conn,2,3
If Rs("password")=oldpwd And Rs("username")=oldusername Then如果旧用户名或旧密码与输入的用户名和密码相同的话,表示验证成功,则修改数据
Rs("username")=username 把新用户名给USERNAME字段
Rs("password")=newpwd 把新密码比给PASSWORD字段
Rs.Update 保存信息
Else 否则的话则显示错误信息
Response.Write "你的旧密码填写不对或者旧用户名不对,修改不成功" ‘显示错误信息
Response.End 退出过程
End If
Rs.Close ‘关闭数据库连接
Set Rs = Nothing ‘释放内存
End Sub ‘结束过程
Sub Exit_Admin()
Session.Abandon
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'删除数据
Sub Delete()
'删除数据
Conn.Execute("Delete * From words Where id="&Request.QueryString("id"))
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'回复信息添加到数据库
Sub Reply_Execute()
Set Rs = Server.CreateObject("ADODB.RecordSet") 创建一个ADODB对象
Sql="Select reply From words Where id="&Request.Form("id") 从预订信息中查询回复信息
Rs.Open Sql,Conn,2,3
Rs("回复") = Server.HTMLEncode(Request.Form("reply")) 将查询信息复值给“回复”字段
Rs.Update 保存信息
Rs.Close 关闭RS对象
Set Rs=Nothing释放内存
End Sub结束过程
Sub Edit_Execute() 修改预订回复
Set Rs = Server.CreateObject("ADODB.RecordSet")
Sql="Select * From words Where 编号="&Request.Form("id")
Rs.Open Sql,Conn,2,3
Rs("请您留言") = Server.HTMLEncode(Request.Form("特殊要求"))
Rs("回复") = Server.HTMLEncode(Request.Form("reply"))
Rs.Update
Rs.Close
Set Rs=Nothing
End Sub
Conn.Close
Set Conn = Nothing
%>
<%
function unHtml(content)
unHtml=content
if content <> "" then
unHtml=replace(unHtml,"&","&")
unHtml=replace(unHtml,"<","<")
unHtml=replace(unHtml,">",">")
unHtml=replace(unHtml,chr(34),""")
unHtml=replace(unHtml,chr(13),"<br>")
unHtml=replace(unHtml,chr(32)," ")
'unHtml=ubb(unHtml)
end if
end function
function Convert(ubb,CovT)
cText=ubb
startubb=1
do while Covt="url" or Covt="color" or Covt="font" or Covt="size"
startubb=instr(startubb,cText,"["&CovT&"=",1)
if startubb=0 then exit do
endubb=instr(startubb,cText,"]",1)
if endubb=0 then exit do
Lcovt=Covt
startubb=startubb+len(lCovT)+2
text=mid(cText,startubb,endubb-startubb)
codetext=replace(text,"[","["&chr(176),1,-1,1)
codetext=replace(codetext,"]",chr(176)&"]",1,-1,1)
'codetext=replace(codetext,"{:em","{;em",1,-1,1)
codetext=replace(codetext,"/","/"&chr(176),1,-1,1)
select case CovT
case "color"
cText=replace(cText,"[color="&text&"]","<font color='"&text&"'>",1,1,1)
cText=replace(cText,"[/color]","</font>",1,1,1)
case "font"
cText=replace(cText,"[font="&text&"]","<font face='"&text&"'>",1,1,1)
cText=replace(cText,"[/font]","</font>",1,1,1)
case "size"
if IsNumeric(text) then
if text>6 then text=6
if text<1 then text=1
cText=replace(cText,"[size="&text&"]","<font size='"&text&"'>",1,1,1)
cText=replace(cText,"[/size]","</font>",1,1,1)
end if
case "url"
cText=replace(cText,"[url="&text&"]","<a href='"&codetext&"' target=_blank>",1,1,1)
cText=replace(cText,"[/url]","</a>",1,1,1)
case "email"
cText=replace(cText,"["&CovT&"="&text&"]","<a href=mailto:"&text&">",1,1,1)
cText=replace(cText,"[/"&CovT&"]","</a>",1,1,1)
end select
loop
startubb=1
do
startubb=instr(startubb,cText,"["&CovT&"]",1)
if startubb=0 then exit do
endubb=instr(startubb,cText,"[/"&CovT&"]",1)
if endubb=0 then exit do
Lcovt=Covt
startubb=startubb+len(lCovT)+2
text=mid(cText,startubb,endubb-startubb)
codetext=replace(text,"[","["&chr(176),1,-1,1)
codetext=replace(codetext,"]",chr(176)&"]",1,-1,1)
'codetext=replace(codetext,"{:em","{;em",1,-1,1)
codetext=replace(codetext,"/","/"&chr(176),1,-1,1)
select case CovT
case "url"
cText=replace(cText,"["&CovT&"]"&text,"<a href='"&codetext&"' target=_blank>"&codetext,1,1,1)
cText=replace(cText,"<a href='"&codetext&"' target=_blank>"&codetext&"[/"&CovT&"]","<a href="&codetext&" target=_blank>"&codetext&"</a>",1,1,1)
case "email"
cText=replace(cText,"["&CovT&"]","<a href=mailto:"&text&">",1,1,1)
cText=replace(cText,"[/"&CovT&"]","</a>",1,1,1)
case "html"
codetext=replace(codetext,"<br>",chr(13),1,-1,1)
codetext=replace(codetext," ",chr(32),1,-1,1)
Randomize
rid="temp"&Int(100000 * Rnd)
cText=replace(cText,"[html]"&text,"代码片断如下:<TEXTAREA id="&rid&" rows=15 style='width:100%' class='bk'>"&codetext,1,1,1)
cText=replace(cText,"代码片断如下:<TEXTAREA id="&rid&" rows=15 style='width:100%' class='bk'>"&codetext&"[/html]","代码片断如下:<TEXTAREA id="&rid&" rows=15 style='width:100%' class='bk'>"&codetext&"</TEXTAREA><INPUT οnclick=runEx('"&rid&"') type=button value=运行此段代码 name=Button1 class='Tips_bo'> <INPUT οnclick=JM_cc('"&rid&"') type=button value=复制到我的剪贴板 name=Button2 class='Tips_bo'>",1,1,1)
case "img"
cText=replace(cText,"[img]"&text,"<a href="&chr(34)&"about:<img src="&codetext&" border=0>"&chr(34)&" target=_blank><img src="&codetext,1,1,1)
cText=replace(cText,"[/img]"," vspace=2 hspace=2 border=0 alt=::点击图片在新窗口中打开::></a>",1,1,1)
case "code"
cText=replace(cText,"[code]"&text,"以下内容为程序代码<hr noshade>"&codetext,1,1,1)
cText=replace(cText,"以下内容为程序代码<hr noshade>"&codetext&"[/code]","以下内容为程序代码<hr noshade>"&codetext&"<hr noshade>",1,1,1)
case "quote"
atext=replace(text,"[img]","",1,-1,1)
atext=replace(atext,"[/img]","",1,-1,1)
atext=replace(atext,"[swf]","",1,-1,1)
atext=replace(atext,"[/swf]","",1,-1,1)
atext=replace(atext,"[html]","",1,-1,1)
atext=replace(atext,"[/html]","",1,-1,1)
' atext=replace(atext,"{:em","{;em",1,-1,1)
atext=SplitWords(atext,350)
atext=replace(atext,chr(32)," ",1,-1,1)
cText=replace(cText,"[quote]"&text,"<blockquote><hr noshade>"&atext,1,1,1)
cText=replace(cText,"<blockquote><hr noshade>"&atext&"[/quote]","<blockquote><hr noshade>"&atext&"<hr noshade></blockquote>",1,1,1)
end select
loop
Convert=cText
end function
function AutoURL(ubb)
cText=ubb
startubb=1
do
startubb=1
endubb_a=0
endubb_b=0
endubb=0
startubb=instr(startubb,cText,"http://",1)
if startubb=0 then exit do
endubb_b=instr(startubb,cText,"<",1)
endubb_a=instr(startubb,cText," ",1)
endubb=endubb_a
if endubb=0 then
endubb=endubb_b
end if
if endubb_b<endubb and endubb_b>0 then
endubb=endubb_b
end if
if endubb=0 then
lenc=ctext
endubb=len(lenc)+1
end if
'response.write startubb&","&endubb
if startubb>endubb then exit do
text=mid(cText,startubb,endubb-startubb)
'response.write text
'codetext=replace(text,"/","/"&chr(176),1,-1,1)
codetext=text
'response.write text&","
urllink="<a href='"&codetext&"' target=_blank>"&codetext&"</a> "
'response.write urllink
urllink=replace(urllink,"/","/"&chr(176),1,-1,1)
cText=replace(cText,text,urllink,1,1,1)
loop
AutoURL=cText
end function
%>