📄 classshop.asp
字号:
<%
Class ClassShop
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 <> 7 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_GetShopList(HTML)
HTML = Label_GetShopPhoto(HTML)
Response.Write HTML
End Sub
Public Sub Booking()
If EL_User.UserIsLogin = False Then
Response.Redirect InstallDir &"User/User_Login.asp?url="& EL_Common.ServerURLEncode(InstallDir & EL_Channel.ChannelDir)
End If
'检查页面来源
If CheckComeURL = False Then
EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.ComeURLError", "禁止从本站外部提交数据"))
Exit Sub
End If
Call EL_Common.CheckEnableBook(0)
Dim ProductID, ProductName, Points, Num, ProductNum, TotalPoints
Dim BookCmd, BookNumber, BookID
Dim ContactUserName, Mobile, Phone, Fax, Email, CustomerType, ConfirmType, Demand, ZipCode, Address
ProductID = EL_Common.ELRequest("ProductID", 2)
ProductNum = EL_Common.ELRequest("ProductNum", 2)
TotalPoints = EL_Common.ELRequest("TotalPoints", 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)
ZipCode = EL_Common.ELRequest("ZipCode", 1)
Address = EL_Common.ELRequest("Address", 1)
If ProductNum<1 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Shop.Error4", "要兑换的商品数量必须大于1"))
Exit Sub
End If
BookNumber = GetBookNumber()
Call EL_Common.InitCommand(BookCmd, "EL_SP_ShopBook")
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("@ProductID", 3, 1, 4, ProductID)
.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ChannelID)
.Parameters.Append .CreateParameter("@ProductNum", 3, 1, 4, ProductNum)
.Parameters.Append .CreateParameter("@TotalPoints", 3, 1, 4, TotalPoints)
.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("@ZipCode", 200, 1, 10, ZipCode)
.Parameters.Append .CreateParameter("@Address", 200, 1, 255, Address)
.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("Shop.Error1", "指定商品不存在"))
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 EL_User.UserIsLogin = False Then
Response.Redirect InstallDir &"User/User_Login.asp?url="& EL_Common.ServerURLEncode(InstallDir & EL_Channel.ChannelDir)
End If
'检查页面来源
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_ShopBook", "BookNumber, TotalPoints", "ChannelID="& ChannelID &" And BookID="& BookID)
rsBook.Close()
If BookCmd(0) <> 1 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Shop.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()
If EL_User.UserIsLogin = False Then
Dim TempURL
TempURL = ComeURL
If Instr(TempURL, "?") Then TempURL = Left(TempURL, Instr(TempURL, "?")-1)
If lCase(TempURL) <> lCase("http://"& Request.ServerVariables("HTTP_HOST") & InstallDir & EL_Channel.ChannelDir & "/ShowProduct.asp") Then
Response.Redirect InstallDir & EL_Channel.ChannelDir
Else
Response.Redirect InstallDir &"User/User_Login.asp?url="& EL_Common.ServerURLEncode(ComeURL)
End If
End If
'检查页面来源
If CheckComeURL = False Then
EL_Common.ShowErrorMsg(EL_Common.Lang("BaseConfig.ComeURLError", "禁止从本站外部提交数据"))
Exit Sub
End If
Call EL_Common.CheckEnableBook(0)
Dim ShopCmd, rsShop, TotalPoints
Dim ProductID, ProductName, Points, Num, ProductNum
ProductID = EL_Common.ELRequest("ProductID", 2)
ProductNum = EL_Common.ELRequest("ProductNum", 2)
If ProductNum<1 Then ProductNum = 1
Call EL_Common.InitCommand(ShopCmd, "EL_SP_ShopBookConfirm")
With ShopCmd
.Parameters.Append .CreateParameter("RETURN", 2, 4)
.Parameters.Append .CreateParameter("@ProductID", 3, 1, 4, ProductID)
.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ChannelID)
.Execute()
End With
If ShopCmd(0) <> 1 Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Shop.Error1", "指定商品不存在"))
Set rsShop = Nothing
Set ShopCmd = Nothing
Exit Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -