📄 classsight.asp
字号:
rsSearch.Close()
Dim PageHTML
PageHTML = EL_Common.Lang("BaseConfig.ShowPage", "")
PageHTML = EL_Common.ReplaceText(PageHTML, "\{\$PageList\}", EL_Common.ShowPage(URLParameters, CurrentPage, PageSizes, PageCounts, TotalRowCount, EL_Channel.ItemName, EL_Channel.ItemUnit))
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPage}", PageHTML)
End If
HTML = Label_GetSightList(HTML)
HTML = Label_GetSightPhoto(HTML)
Set Matches = Nothing
Set rsSearch = Nothing
Set SearchCmd = Nothing
Session("EL_LastSearchDateTime") = Now()
Response.Write HTML
End Sub
Public Sub Booking()
'检查页面来源
If CheckComeURL = False Then
EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.ComeURLError", "禁止从本站外部提交数据"))
Exit Sub
End If
Call EL_Common.CheckEnableBook(EL_User.UserType)
Dim SightID, TotalPrice, Discount, PriceOfDiscount
Dim ContactUserName, Mobile, Phone, Fax, Email, CustomerType, ConfirmType, Demand
SightID = EL_Common.ELRequest("SightID", 2)
Sight_TravelDate = EL_Common.ELRequest("TravelDate", 1)
Sight_Person = EL_Common.ELRequest("Person", 2)
TotalPrice = EL_Common.ELRequest("TotalPrice", 2)
ContactUserName = EL_Common.ELRequest("ContactUserName", 1)
Mobile = EL_Common.ELRequest("Mobile", 1)
Phone = EL_Common.ELRequest("Phone", 1)
Fax = EL_Common.ELRequest("Fax", 1)
Email = EL_Common.ELRequest("Email", 1)
CustomerType = EL_Common.ELRequest("CustomerType", 1)
ConfirmType = EL_Common.ELRequest("ConfirmType", 1)
Demand = EL_Common.ELRequest("Demand", 1)
If EL_User.UserIsLogin Then
Discount = EL_User.DiscountOfSight
If Discount = 0 Then
PriceOfDiscount = TotalPrice
Else
PriceOfDiscount = EL_Common.ELRound(TotalPrice * (Discount / 10))
End If
Else
Discount = 0
PriceOfDiscount = TotalPrice
End If
'校验提交数据
If Not IsDate(Sight_TravelDate) Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Sight.Error1", "旅行日期格式错误,必须以“yyyy-mm-dd”的格式提交"))
Exit Sub
End If
If DateDiff("d", Date(), Sight_TravelDate)<1 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Sight.Error2", "旅行日期必须大于现在日期"))
Exit Sub
End If
If Sight_Person < 1 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Sight.Error3", "旅行人数必须大于1"))
Exit Sub
End If
If ContactUserName = "" Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Sight.Error6", "请输入联系人"))
Exit Sub
End If
If Phone = "" Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Sight.Error7", "请输入联系电话"))
Exit Sub
End If
If Email = "" Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Sight.Error8", "请输入电子邮件"))
Exit Sub
ElseIf EL_Common.CheckEmail(Email) = False Then
EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.EmailError", "电子邮件格式错误"))
Exit Sub
End If
Dim BookCmd, BookNumber, BookID
BookNumber = GetBookNumber()
Call EL_Common.InitCommand(BookCmd, "EL_SP_SightBook")
With BookCmd
.Parameters.Append .CreateParameter("RETURN", 2, 4)
.Parameters.Append .CreateParameter("@BookID", 3, 2, 4)
.Parameters.Append .CreateParameter("@BookNumber", 200, 1, 30, BookNumber)
.Parameters.Append .CreateParameter("@SightID", 3, 1, 4, SightID)
.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ChannelID)
.Parameters.Append .CreateParameter("@TravelDate", 135, 1, 8, Sight_TravelDate)
.Parameters.Append .CreateParameter("@Person", 3, 1, 4, Sight_Person)
.Parameters.Append .CreateParameter("@TotalPrice", 6, 1,8, TotalPrice)
.Parameters.Append .CreateParameter("@Discount", 5, 1, 8, Discount)
.Parameters.Append .CreateParameter("@PriceOfDiscount", 6, 1, 8, PriceOfDiscount)
.Parameters.Append .CreateParameter("@ContactUserName", 200, 1, 50, ContactUserName)
.Parameters.Append .CreateParameter("@Mobile", 200, 1, 50, Mobile)
.Parameters.Append .CreateParameter("@Phone", 200, 1, 50, Phone)
.Parameters.Append .CreateParameter("@Fax", 200, 1, 50, Fax)
.Parameters.Append .CreateParameter("@Email", 200, 1, 100, Email)
.Parameters.Append .CreateParameter("@ConfirmType", 200, 1, 50, ConfirmType)
.Parameters.Append .CreateParameter("@Demand", 200, 1, 500, Demand)
.Parameters.Append .CreateParameter("@UserID", 3, 1, 4, EL_User.UserID)
.Parameters.Append .CreateParameter("@UserName", 200, 1, 50, EL_User.UserName)
.Parameters.Append .CreateParameter("@Password", 200, 1, 32, EL_User.UserPassword)
.Execute()
End With
Select Case BookCmd(0)
Case 40:
EL_Common.ShowErrorMsg(EL_Common.Lang("Sight.Error4", "指定景点不存在"))
Set BookCmd = Nothing
Exit Sub
Case 41:
EL_Common.ShowErrorMsg(EL_Common.Lang("User.Error14", "您使用的帐户有误,如有问题请与管理员联系"))
Set BookCmd = Nothing
Exit Sub
End Select
BookID = BookCmd(1)
Set BookCmd = Nothing
Response.Redirect "BookSuccess.asp?BookID="& BookID
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_SightBook", "BookNumber, PriceOfDiscount", "ChannelID="& ChannelID &" And BookID="& BookID)
rsBook.Close()
If BookCmd(0) <> 1 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Sight.Error5", "指定的订单不存在"))
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 BookType
Dim SightCmd, rsSight, Price, Point, TotalPrice
Dim SightID, SightName, MarketPrice, IsDiscount
Dim Province, City, Area
BookType = EL_Common.ELRequest("BookType", 2)
SightID = EL_Common.ELRequest("SightID", 2)
Sight_TravelDate = EL_Common.ELRequest("TravelDate", 1)
Sight_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 &"SightID="& SightID
TempURL = TempURL &"&TravelDate="& Sight_TravelDate
TempURL = TempURL &"&Person="& Sight_Person
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(Sight_TravelDate) Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Sight.Error1", "旅行日期格式错误,必须以“yyyy-mm-dd”的格式提交"))
Exit Sub
End If
If DateDiff("d", Date(), Sight_TravelDate)<1 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Sight.Error2", "旅行日期必须大于现在日期"))
Exit Sub
End If
If Sight_Person < 1 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Sight.Error3", "旅行人数必须大于1"))
Exit Sub
End If
Call EL_Common.SetCookie(EL_Sn, "Sight_TravelDate", Sight_TravelDate, 7)
Call EL_Common.SetCookie(EL_Sn, "Sight_Person", Sight_Person, 7)
Call EL_Common.InitCommand(SightCmd, "EL_SP_SightBookConfirm")
With SightCmd
.Parameters.Append .CreateParameter("RETURN", 2, 4)
.Parameters.Append .CreateParameter("@SightID", 3, 1, 4, SightID)
.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ChannelID)
Set rsSight = .Execute()
End With
rsSight.Close()
If SightCmd(0) <> 1 Then
EL_Common.ShowErrorMsg(EL_Common.RegExpStaticLabel(EL_Common.Lang("BaseConfig.InfoError", "指定{$ItemName}不存在"), "{$ItemName}", EL_Channel.ItemName))
Exit Sub
End If
rsSight.Open()
Province = rsSight("Province")
City = rsSight("City")
Area = rsSight("Area")
SightName = rsSight("SightName")
MarketPrice = rsSight("MarketPrice")
Price = rsSight("BookPrice")
IsDiscount = rsSight("IsDiscount")
rsSight.Close()
Set rsSight = Nothing
Set SightCmd = Nothing
HTML = EL_Common.Template(ChannelID, 8, 0)
HTML = EL_Common.ReplaceCommonLabels(HTML)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PageTitle}", EL_Common.Join2String(SightName, SiteTitle, EL_Common.TitleDivide))
HTML = EL_Common.RegExpStaticLabel(HTML, "{$DefaultSkin}", EL_Common.Skin(ChannelID, 0, 0))
Dim StrPath
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>"
EL_Common.ShowPath = EL_Common.ShowPath & StrPath & EL_Common.RegExpStaticLabel(EL_Common.Lang("BaseConfig.BookPath.Book", "{$ItemName}预订"), "{$ItemName}", EL_Channel.ItemName) & StrPath & EL_Common.Lang("BaseConfig.BookPath.Confirm", "订单信息确认")
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPath}", EL_Common.ShowPath)
HTML = ChannelCommonLabels(HTML)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$SightID}", SightID)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Province}", Province)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -