📄 classcar.asp
字号:
<%
Class ClassCar
Private HTML, CommonRegExp, EL_Channel, ClassID, ShowClassType
Private EL_Flag, CurrentPage, URLParameters, ReplaceKeyType
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 <> 8 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
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, "{$ShowClassMenu}", "<script language='JavaScript1.2' type='text/JavaScript' src='"& InstallDir & EL_Channel.ChannelDir &"/Js/ShowClassMenu.js'></script>")
TempHTML = EL_Common.RegExpStaticLabel(TempHTML, "{$ShowSearchForm}", "<script language='JavaScript' type='text/JavaScript' src='"& InstallDir & EL_Channel.ChannelDir &"/Js/ShowSearchForm.js'></script>")
ChannelCommonLabels = TempHTML
End Function
Public Sub CreateIndex()
ClassID = 0
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_ArrClassList(HTML)
HTML = Label_GetCarList(HTML)
HTML = Label_GetCarPhoto(HTML)
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 CarID, TotalPrice, Discount, PriceOfDiscount, BeginDate, EndDate, BeginTime, EndTime, HireType, UseType
Dim ContactUserName, Mobile, Phone, Fax, Email, CustomerType, ConfirmType, Demand
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)
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.DiscountOfCar
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(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
If ContactUserName = "" Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Car.Error6", "请输入联系人"))
Exit Sub
End If
If Phone = "" Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Car.Error7", "请输入联系电话"))
Exit Sub
End If
If Email = "" Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Car.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_CarBook")
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("@CarID", 3, 1, 4, CarID)
.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ChannelID)
.Parameters.Append .CreateParameter("@BeginDate", 135, 1, 8, BeginDate)
.Parameters.Append .CreateParameter("@EndDate", 135, 1, 8, EndDate)
.Parameters.Append .CreateParameter("@BeginTime", 200, 1, 20, BeginTime)
.Parameters.Append .CreateParameter("@EndTime", 200, 1, 20, EndTime)
.Parameters.Append .CreateParameter("@HireType", 3, 1, 4, HireType)
.Parameters.Append .CreateParameter("@UseType", 3, 1, 4, UseType)
.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("Car.Error5", "指定车型不存在"))
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_CarBook", "BookNumber, PriceOfDiscount", "ChannelID="& ChannelID &" And BookID="& BookID)
rsBook.Close()
If BookCmd(0) <> 1 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Car.Error9", "指定的订单不存在"))
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)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -