📄 classhotel.asp
字号:
<%
Class ClassHotel
Private HTML, CommonRegExp, EL_Channel, ShowClassType
Private EL_Flag, CurrentPage, URLParameters, ReplaceKeyType
Private Hotel_CheckInDate, Hotel_CheckOutDate, Hotel_Rooms, Hotel_Person
Private Hotel_Province, Hotel_City, Hotel_Area
Private Sub Class_Initialize
Set CommonRegExp = New RegExp
CommonRegExp.IgnoreCase = True
CommonRegExp.Global = True
EL_Flag = True
ReplaceKeyType = 0 '内容页字符替换模式 0:站内链接 1:字符过滤 2:两者
Set EL_Channel = New ClassChannel
EL_Channel.GetChannelConfig()
If EL_Channel.ErrorCode = 1 Or EL_Channel.ChannelType = 1 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.ChannelError", "频道参数错误"))
Call ApplicationTerminate()
End If
If EL_Channel.ChannelModule <> 2 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.ChannelModuleError", "频道模块错误"))
Call ApplicationTerminate()
End If
If EL_Channel.Disabled Then
EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.Disabled", "该频道已被禁用"))
Call ApplicationTerminate()
End If
CurrentPage = EL_Common.ELRequest("page", 2)
ShowClassType = EL_Common.ELRequest("ShowType", 2)
URLParameters = request.ServerVariables("QUERY_STRING")
If CurrentPage<1 Then
CurrentPage = 1
Else
URLParameters = EL_Common.ReplaceText(URLParameters, "\&{0,}page=[0-9]*", "")
If URLParameters <> "" And Left(URLParameters, 1) = "&" Then URLParameters = Right(URLParameters, Len(URLParameters)-1)
End If
Hotel_CheckInDate = EL_Common.GetCookie(EL_Sn, "Hotel_CheckInDate")
Hotel_CheckOutDate = EL_Common.GetCookie(EL_Sn, "Hotel_CheckOutDate")
Hotel_Rooms = EL_Common.ELClng(EL_Common.GetCookie(EL_Sn, "Hotel_Rooms"))
Hotel_Person = EL_Common.ELClng(EL_Common.GetCookie(EL_Sn, "Hotel_Person"))
Hotel_Province = EL_Common.GetCookie(EL_Sn, "Hotel_Province")
Hotel_City = EL_Common.GetCookie(EL_Sn, "Hotel_City")
Hotel_Area = EL_Common.GetCookie(EL_Sn, "Hotel_Area")
If Not IsDate(Hotel_CheckInDate) Then Hotel_CheckInDate = Date()
If DateDiff("d", Date(), Hotel_CheckInDate)<0 Then Hotel_CheckInDate = Date()
If Not IsDate(Hotel_CheckOutDate) Then Hotel_CheckOutDate = DateAdd("d", 1, Hotel_CheckInDate)
If DateDiff("d", Hotel_CheckInDate, Hotel_CheckOutDate)<1 Then Hotel_CheckOutDate = DateAdd("d", 1, Hotel_CheckInDate)
If Hotel_Rooms < 1 Then Hotel_Rooms = 1
If Hotel_Person < 1 Then Hotel_Person = 1
Hotel_CheckInDate = EL_Common.FormatDate(Hotel_CheckInDate)
Hotel_CheckOutDate = EL_Common.FormatDate(Hotel_CheckOutDate)
Call EL_Common.SetCookie(EL_Sn, "Hotel_CheckInDate", Hotel_CheckInDate, 7)
Call EL_Common.SetCookie(EL_Sn, "Hotel_CheckOutDate", Hotel_CheckOutDate, 7)
Call EL_Common.SetCookie(EL_Sn, "Hotel_Rooms", Hotel_Rooms, 7)
Call EL_Common.SetCookie(EL_Sn, "Hotel_Person", Hotel_Person, 7)
Call EL_Common.SetCookie(EL_Sn, "Hotel_Province", Hotel_Province, 7)
Call EL_Common.SetCookie(EL_Sn, "Hotel_City", Hotel_City, 7)
Call EL_Common.SetCookie(EL_Sn, "Hotel_Area", Hotel_Area, 7)
End Sub
Private Sub Class_Terminate
Set CommonRegExp = Nothing
Set EL_Channel = Nothing
End Sub
Private Function ChannelCommonLabels(ByVal HTML)
'频道通用标签
Dim TempHTML
TempHTML = HTML
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ChannelID}", ChannelID)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ChannelName}", EL_Channel.ChannelName)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ChannelPictrue}", EL_Channel.ChannelPictrue)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ChannelDir}", EL_Channel.ChannelDir)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ItemName}", EL_Channel.ItemName)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ItemUnit}", EL_Channel.ItemUnit)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ClassItemName}", EL_Channel.ClassItemName)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$UploadDir}", EL_Channel.UploadDir)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$MetaKeywords}", "<meta name=""keywords"" content="""& EL_Channel.MetaKeywords &""" />")
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$MetaDescription}", "<meta name=""description"" content="""& EL_Channel.MetaDescription &""" />")
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$Hotel_CheckInDate}", Hotel_CheckInDate)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$Hotel_CheckOutDate}", Hotel_CheckOutDate)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$Hotel_Rooms}", Hotel_Rooms)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$Hotel_Person}", Hotel_Person)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$Hotel_Province}", Hotel_Province)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$Hotel_City}", Hotel_City)
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$Hotel_Area}", Hotel_Area)
ChannelCommonLabels = TempHTML
End Function
Public Sub CreateIndex()
HTML = EL_Common.Template(ChannelID, 1, 0)
HTML = EL_Common.ReplaceCommonLabels(HTML)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PageTitle}", EL_Common.Join2String(EL_Channel.ChannelName, SiteTitle, EL_Common.TitleDivide))
HTML = EL_Common.RegExpStaticLabel(HTML, "{$DefaultSkin}", EL_Common.Skin(ChannelID, 0, 0))
EL_Common.ShowPath = EL_Common.ShowPath & EL_Common.Lang("BaseConfig.Path", " >> ") & EL_Channel.ChannelName
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPath}", EL_Common.ShowPath)
HTML = ChannelCommonLabels(HTML)
HTML = Label_GetHotelList(HTML)
HTML = Label_GetHotelPhoto(HTML)
Response.Write HTML
End Sub
Public Sub Booking()
Response.Write "<p>对不起,试用版本暂时不提供此功能! </p>"
Response.Write "<p>官方网站:<a href='http://www.elancom.net' target='_blank'>http://www.elancom.net</a><br><br>"
Response.Write "论坛交流:<a href='http://www.elancom.net/Forum/' target='_blank'>http://www.elancom.net/Forum/</a><br><br>"
Response.Write "在线演示功能:<a href='http://www.elancom.net/Demo/' target='_blank'>http://www.elancom.net/Demo/ </a></p>"
Response.Write "<p>联系方式:elancom@163.com QQ:30735755 </p>"
End Sub
Public Sub BookSuccess()
'检查页面来源
If CheckComeURL = False Then
EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.ComeURLError", "禁止从本站外部提交数据"))
Exit Sub
End If
Dim BookCmd, rsBook
Dim BookID, Consume, BookNumber
BookID = EL_Common.ELRequest("BookID", 2)
Call EL_Common.InitCommonCmd(BookCmd, rsBook, "EL_HotelBook", "BookNumber, PriceOfDiscount", "ChannelID="& ChannelID &" And BookID="& BookID)
rsBook.Close()
If BookCmd(0) <> 1 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Hotel.Error10", "指定的订单不存在"))
Exit Sub
End If
rsBook.Open()
BookNumber = rsBook(0)
Consume = rsBook(1)
rsBook.Close()
Set rsBook = Nothing
HTML = EL_Common.Template(ChannelID, 31, 0)
HTML = EL_Common.ReplaceCommonLabels(HTML)
Dim PageTitle, StrPath
PageTitle = EL_Common.Join2String(EL_Channel.ChannelName, SiteTitle, EL_Common.TitleDivide)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PageTitle}", PageTitle)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$DefaultSkin}", EL_Common.Skin(ChannelID, 0, 0))
StrPath = EL_Common.Lang("BaseConfig.Path", " >>")
EL_Common.ShowPath = EL_Common.ShowPath & StrPath &"<a href='"& InstallDir & EL_Channel.ChannelDir &"/Index.asp'>"& EL_Channel.ChannelName &"</a>"
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPath}", EL_Common.ShowPath)
HTML = ChannelCommonLabels(HTML)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$BookID}", BookID)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$BookNumber}", BookNumber)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Consume}", Consume)
Response.Write HTML
End Sub
Public Sub BookConfirm()
Dim HotelCmd, rsHotel, i, TotalPrice, BookType
Dim HotelID, HotelName, Address, Remark, LevelName, LevelPictrue
Dim RoomID, RoomName, PointOfUser, PointOfBrother, Room_Remark, IsDiscount
Dim StrPath, DayNum
BookType = EL_Common.ELRequest("BookType", 2)
HotelID = EL_Common.ELRequest("HotelID", 2)
RoomID = EL_Common.ELRequest("RoomID", 2)
Hotel_CheckInDate = EL_Common.ELRequest("CheckInDate", 1)
Hotel_CheckOutDate = EL_Common.ELRequest("CheckOutDate", 1)
Hotel_Rooms = EL_Common.ELRequest("Rooms", 2)
Hotel_Person = EL_Common.ELRequest("Person", 2)
If EL_User.UserIsLogin = False And BookType = 0 Then
Dim TempURL
TempURL = InstallDir & EL_Channel.ChannelDir &"/"& EL_CurrentScriptName &"?"
TempURL = TempURL &"CheckInDate="& Hotel_CheckInDate
TempURL = TempURL &"&CheckOutDate="& Hotel_CheckOutDate
TempURL = TempURL &"&Rooms="& Hotel_Rooms
TempURL = TempURL &"&Person="& Hotel_Person
TempURL = TempURL &"&HotelID="& HotelID
TempURL = TempURL &"&RoomID="& RoomID
TempURL = TempURL &"&BookType=1"
Response.Redirect InstallDir &"User/Login.asp?url="& EL_Common.ServerURLEncode(TempURL)
End If
Call EL_Common.CheckEnableBook(EL_User.UserType)
'校验提交数据
If Not IsDate(Hotel_CheckInDate) Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Hotel.Error2", "入住日期格式错误,必须以“yyyy-mm-dd”的格式提交"))
Exit Sub
End If
If DateDiff("d", Date(), Hotel_CheckInDate)<0 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Hotel.Error4", "入住日期必须大于或者等于现在日期"))
Exit Sub
End If
If Not IsDate(Hotel_CheckOutDate) Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Hotel.Error3", "离店日期格式错误,必须以“yyyy-mm-dd”的格式提交"))
Exit Sub
End If
If DateDiff("d", Hotel_CheckInDate, Hotel_CheckOutDate)<1 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Hotel.Error5", "离店日期必须大于入住日期"))
Exit Sub
End If
If Hotel_Rooms < 1 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Hotel.Error6", "房间数必须大于1"))
Exit Sub
End If
If Hotel_Person < 1 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Hotel.Error7", "人数必须大于1"))
Exit Sub
End If
Call EL_Common.SetCookie(EL_Sn, "Hotel_CheckInDate", Hotel_CheckInDate, 7)
Call EL_Common.SetCookie(EL_Sn, "Hotel_CheckOutDate", Hotel_CheckOutDate, 7)
Call EL_Common.SetCookie(EL_Sn, "Hotel_Rooms", Hotel_Rooms, 7)
Call EL_Common.SetCookie(EL_Sn, "Hotel_Person", Hotel_Person, 7)
Call EL_Common.InitCommand(HotelCmd, "EL_SP_HotelBookConfirm")
With HotelCmd
.Parameters.Append .CreateParameter("RETURN", 2, 4)
.Parameters.Append .CreateParameter("@HotelID", 3, 1, 4, HotelID)
.Parameters.Append .CreateParameter("@RoomID", 3, 1, 4, RoomID)
.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ChannelID)
Set rsHotel = .Execute()
End With
rsHotel.Close()
If HotelCmd(0) <> 1 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Hotel.Error1", "指定酒店或房型不存在"))
Set rsHotel = Nothing
Set HotelCmd = Nothing
Exit Sub
End If
rsHotel.Open()
HotelName = rsHotel("HotelName")
Address = rsHotel("Address")
Remark = rsHotel("Remark")
LevelName = rsHotel("LevelName")
LevelPictrue = rsHotel("LevelPictrue")
RoomName = rsHotel("RoomName")
IsDiscount = rsHotel("IsDiscount")
rsHotel.Close()
Set rsHotel = Nothing
Set HotelCmd = Nothing
DayNum = DateDiff("d", Hotel_CheckInDate, Hotel_CheckOutDate)
HTML = EL_Common.Template(ChannelID, 8, 0)
HTML = EL_Common.ReplaceCommonLabels(HTML)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -