📄 classcar.asp
字号:
Response.Write HTML
End Sub
Public Sub BookConfirm()
Dim BookType
Dim CarCmd, rsCar, Point, TotalPrice, BeginDate, EndDate, BeginTime, EndTime, HireType, UseType
Dim CarID, CarName, PriceHour1, PriceHour2, PriceDay1, PriceDay2, PriceMonth1, PriceMonth2, IsDiscount
BookType = EL_Common.ELRequest("BookType", 2)
CarID = EL_Common.ELRequest("CarID", 2)
BeginDate = EL_Common.ELRequest("BeginDate", 1)
EndDate = EL_Common.ELRequest("EndDate", 1)
BeginTime = EL_Common.ELRequest("BeginTime", 1)
EndTime = EL_Common.ELRequest("EndTime", 1)
HireType = EL_Common.ELRequest("HireType", 2)
UseType = EL_Common.ELRequest("UseType", 2)
If EL_User.UserIsLogin = False And BookType = 0 Then
Dim TempURL
TempURL = InstallDir & EL_Channel.ChannelDir &"/"& EL_CurrentScriptName &"?"
TempURL = TempURL &"CarID="& CarID
TempURL = TempURL &"&BeginDate="& BeginDate
TempURL = TempURL &"&EndDate="& EndDate
TempURL = TempURL &"&BeginTime="& BeginTime
TempURL = TempURL &"&EndTime="& EndTime
TempURL = TempURL &"&HireType="& HireType
TempURL = TempURL &"&UseType="& UseType
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(BeginDate) Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Car.Error1", "开始日期格式错误,必须以“yyyy-mm-dd”的格式提交"))
Exit Sub
End If
If Not IsDate(EndDate) Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Car.Error2", "结束日期格式错误,必须以“yyyy-mm-dd”的格式提交"))
Exit Sub
End If
If Not IsDate(BeginTime) Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Car.Error10", "开始时间格式错误,必须以“hh:ss”的格式提交"))
Exit Sub
End If
If Not IsDate(EndTime) Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Car.Error11", "结束时间格式错误,必须以“hh:ss”的格式提交"))
Exit Sub
End If
If DateDiff("d", Date(), BeginDate)<1 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Car.Error3", "开始日期必须大于现在日期"))
Exit Sub
End If
If DateDiff("d", BeginDate, EndDate)<0 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Car.Error4", "结束日期必须大于或等于开始日期"))
Exit Sub
End If
Call EL_Common.InitCommand(CarCmd, "EL_SP_CarBookConfirm")
With CarCmd
.Parameters.Append .CreateParameter("RETURN", 2, 4)
.Parameters.Append .CreateParameter("@CarID", 3, 1, 4, CarID)
.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ChannelID)
Set rsCar = .Execute()
End With
rsCar.Close()
If CarCmd(0) <> 1 Then
EL_Common.ShowErrorMsg(EL_Common.RegExpStaticLabel(EL_Common.Lang("BaseConfig.InfoError", "指定{$ItemName}不存在"), "{$ItemName}", EL_Channel.ItemName))
Exit Sub
End If
rsCar.Open()
CarName = rsCar("CarName")
PriceHour1 = rsCar("PriceHour1")
PriceHour2 = rsCar("PriceHour2")
PriceDay1 = rsCar("PriceDay1")
PriceDay2 = rsCar("PriceDay2")
PriceMonth1 = rsCar("PriceMonth1")
PriceMonth2 = rsCar("PriceMonth2")
IsDiscount = rsCar("IsDiscount")
rsCar.Close()
Set rsCar = Nothing
Set CarCmd = Nothing
HTML = EL_Common.Template(ChannelID, 8, 0)
HTML = EL_Common.ReplaceCommonLabels(HTML)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PageTitle}", EL_Common.Join2String(CarName, 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, "{$CarID}", CarID)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$CarName}", CarName)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PriceHour1}", PriceHour1)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PriceHour2}", PriceHour2)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PriceDay1}", PriceDay1)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PriceDay2}", PriceDay2)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PriceMonth1}", PriceMonth1)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PriceMonth2}", PriceMonth2)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$BeginDate}", BeginDate)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$EndDate}", EndDate)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$BeginTime}", BeginTime)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$EndTime}", EndTime)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$HireType}", HireType)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$UseType}", UseType)
Dim PriceIcon, PriceList, HourName, DayName, MonthName
Dim HireTypeName, UseTypeName
PriceIcon = EL_Common.Lang("BaseConfig.PriceIcon", "¥")
HourName = EL_Common.Lang("Car.HourName", "小时")
DayName = EL_Common.Lang("Car.DayName", "天")
MonthName = EL_Common.Lang("Car.MonthName", "月")
HireTypeName = EL_Common.Lang("Car.HireTypeName.Type"& HireType, "")
UseTypeName = EL_Common.Lang("Car.UseTypeName.Type"& UseType, "")
Select Case HireType
Case 0:
If UseType = 1 Then
PriceList = DateDiff("h", BeginDate &" "& BeginTime , EndDate &" "& EndTime) &" "& HourName &" x "& PriceHour2
TotalPrice = DateDiff("h", BeginDate &" "& BeginTime, EndDate &" "& EndTime) * PriceHour2
Else
PriceList = DateDiff("h", BeginDate &" "& BeginTime , EndDate &" "& EndTime) &" "& HourName &" x "& PriceHour1
TotalPrice = DateDiff("h", BeginDate &" "& BeginTime, EndDate &" "& EndTime) * PriceHour1
End If
Case 1:
If UseType = 1 Then
PriceList = DateDiff("d", BeginDate &" "& BeginTime , EndDate &" "& EndTime) &" "& DayName &" x "& PriceDay2
TotalPrice = DateDiff("d", BeginDate &" "& BeginTime , EndDate &" "& EndTime) * PriceDay2
Else
PriceList = DateDiff("d", BeginDate &" "& BeginTime , EndDate &" "& EndTime) &" "& DayName &" x "& PriceDay1
TotalPrice = DateDiff("d", BeginDate &" "& BeginTime , EndDate &" "& EndTime) * PriceDay1
End If
Case 2:
If UseType = 1 Then
PriceList = DateDiff("m", BeginDate &" "& BeginTime , EndDate &" "& EndTime) &" "& MonthName &" x "& PriceMonth2
TotalPrice = DateDiff("m", BeginDate &" "& BeginTime , EndDate &" "& EndTime) * PriceMonth2
Else
PriceList = DateDiff("m", BeginDate &" "& BeginTime , EndDate &" "& EndTime) &" "& MonthName &" x "& PriceMonth1
TotalPrice = DateDiff("m", BeginDate &" "& BeginTime , EndDate &" "& EndTime) * PriceMonth1
End If
End Select
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PriceList}", PriceList)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$TotalPrice}", TotalPrice)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$HireTypeName}", HireTypeName)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$UseTypeName}", UseTypeName)
Dim DiscountHTML, TempDiscount
If IsDiscount Then
If EL_User.DiscountOfCar = 0 Then
DiscountHTML = EL_Common.Lang("Car.Discount.d0", "您不可以享受折扣")
Else
DiscountHTML = EL_Common.Lang("Car.Discount.d1", "您可享受{$Discount}折优惠,折后价")
TempDiscount = EL_User.DiscountOfCar / 10
DiscountHTML = EL_Common.RegExpStaticLabel(DiscountHTML, "{$Discount}", EL_User.DiscountOfCar)
DiscountHTML = EL_Common.RegExpStaticLabel(DiscountHTML, "{$PriceOfDiscount}", TotalPrice &" x "& EL_Common.FormatDecimal(TempDiscount) &" = "& EL_Common.Lang("BaseConfig.PriceIcon", "¥") & EL_Common.ELRound(TempDiscount * TotalPrice))
End If
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Points}", EL_Common.ELClng(TotalPrice * TempDiscount / ConsumeProportion))
Else
DiscountHTML = EL_Common.Lang("Car.NoDiscount", "此景点房型不允许打折")
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Points}", EL_Common.ELClng(TotalPrice / ConsumeProportion))
End If
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowDiscount}", DiscountHTML)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowConfirmType}", EL_Common.GetConfirmType())
Response.Write HTML
End Sub
Public Sub ShowClass()
Dim ClassCmd, rsClass, ClassType, ItemCount
Dim PageTitle, ClassName, ArrChildID, SkinID, TemplateID, StrPath
ClassID = EL_Common.ELRequest("ClassID", 2)
Call EL_Common.InitCommand(ClassCmd, "EL_SP_GetClassInfo")
With ClassCmd
.Parameters.Append .CreateParameter("RETURN", 2, 4)
.Parameters.Append .CreateParameter("@ClassID", 3, 1, 4, ClassID)
.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ChannelID)
.Parameters.Append .CreateParameter("@ClassName", 200, 2, 50)
.Parameters.Append .CreateParameter("@SkinID", 3, 2, 4)
.Parameters.Append .CreateParameter("@TemplateID", 3, 2, 4)
.Parameters.Append .CreateParameter("@ClassType", 3, 2, 4)
.Parameters.Append .CreateParameter("@ItemCount", 3, 2, 4)
.Execute()
End With
Select Case ClassCmd(0)
Case 40: EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.ChannelError", "频道参数错误")) : Set ClassCmd = Nothing : Exit Sub
Case 0, 41: EL_Common.ShowErrorMsg(EL_Common.RegExpStaticLabel(EL_Common.Lang("BaseConfig.ClassError", "指定{$ClassItemName}不存在"), "{$ClassItemName}", EL_Channel.ClassItemName)) : Set ClassCmd = Nothing : Exit Sub
End Select
If ClassCmd(0) <> 1 Then
EL_Common.ShowErrorMsg(EL_Common.RegExpStaticLabel(EL_Common.Lang("BaseConfig.ClassError", "指定{$ClassItemName}不存在"), "{$ClassItemName}", EL_Channel.ClassItemName))
Set ClassCmd = Nothing
Exit Sub
End If
ClassName = ClassCmd(3)
SkinID = ClassCmd(4)
TemplateID = ClassCmd(5)
ClassType = ClassCmd(6)
ItemCount = ClassCmd(7)
Set ClassCmd = Nothing
Dim ArrTemplate
HTML = EL_Common.Template(ChannelID, 2, TemplateID)
ArrTemplate = EL_Common.ELSplit(HTML, "{$$$Template$$$}")
If ClassType = 1 Then
HTML = ArrTemplate(1) '小类模板
Else '大类模板
If ShowClassType = 1 Then
HTML = ArrTemplate(1)
Else
HTML = ArrTemplate(0)
End If
End If
HTML = EL_Common.ReplaceCommonLabels(HTML)
PageTitle = EL_Common.Join2String(ClassName, EL_Channel.ChannelName, EL_Common.TitleDivide)
PageTitle = EL_Common.Join2String(PageTitle, SiteTitle, EL_Common.TitleDivide)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PageTitle}", PageTitle)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$DefaultSkin}", EL_Common.Skin(ChannelID, ClassID, SkinID))
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.GetParentPath(ChannelID, EL_Channel.ChannelDir, ClassID)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPath}", EL_Common.ShowPath)
HTML = ChannelCommonLabels(HTML)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ClassName}", ClassName)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ClassID}", ClassID)
If ClassType = 0 Then
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowChildClass}", GetChildClass())
HTML = Label_CurrentClass(HTML, ClassName, ItemCount)
End If
HTML = Label_ArrClassList(HTML)
HTML = Label_GetCarList(HTML)
HTML = Label_GetCarPhoto(HTML)
Response.Write HTML
End Sub
Public Sub ShowCommend()
Dim StrCommend
ClassID = 0
StrCommend = EL_Common.Lang("BaseConfig.Commend", "推荐{$ItemName}")
StrCommend = EL_Common.RegExpStaticLabel(StrCommend, "{$ItemName}", EL_Channel.ItemName)
HTML = EL_Common.Template(ChannelID, 4, 0)
HTML = EL_Common.ReplaceCommonLabels(HTML)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -