📄 classshop.asp
字号:
End If
Set rsShop = ShopCmd.Execute()
ProductName = rsShop("ProductName")
Points = rsShop("Points")
Num = rsShop("Num")
rsShop.Close()
Set rsShop = Nothing
Set ShopCmd = Nothing
If ProductNum > Num Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Shop.Error2", "您要兑换的商品数量大于库存量"))
Exit Sub
End If
TotalPoints = ProductNum * Points
If TotalPoints > EL_User.Points Then
EL_Common.ShowErrorMsg(EL_Common.Lang("Shop.Error3", "您没有足够的积分兑换此商品"))
Exit Sub
End If
HTML = EL_Common.Template(ChannelID, 8, 0)
HTML = EL_Common.ReplaceCommonLabels(HTML)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PageTitle}", EL_Common.Join2String(ProductName, 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, "{$ProductID}", ProductID)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ProductNum}", ProductNum)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Points}", Points)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ProductName}", ProductName)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$TotalPoints}", TotalPoints)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowConfirmType}", EL_Common.GetConfirmType())
Response.Write HTML
End Sub
Public Sub Search()
Dim SearchCmd, rsSearch, RowCount, i, StrPath
Dim Search_ProductName, Search_Points
Dim MaxPoints, MinPoints, PointArea
Dim PageSizes, PageCounts, TotalRowCount
If IsDate(Session("EL_LastSearchDateTime")) Then
If DateDiff("s", Session("EL_LastSearchDateTime"), Now()) < SearchInterval Then
EL_Common.ShowErrorMsg(EL_Common.RegExpStaticLabel(EL_Common.Lang("Search.Error1", "为节省系统资源,请在{$SearchInterval}秒后再执行搜索……"), "{$SearchInterval}", SearchInterval))
Exit Sub
End If
End If
ClassID = EL_Common.ELRequest("ClassID", 2)
Search_ProductName = EL_Common.ELRequest("ProductName", 3)
Search_Points = EL_Common.ELRequest("Points", 2)
PointArea = EL_Common.Lang("Shop.SearchField.PointArea.a"& Search_Points &".value", "0-90000")
If PointArea = "" Then PointArea = "0-90000"
PointArea = Split(PointArea, "-")
If UBound(PointArea)=1 Then
MinPoints =EL_Common.ELClng(PointArea(0))
MaxPoints = EL_Common.ELClng(PointArea(1))
Else
MinPoints = 0
MaxPoints = 90000
End If
If MinPoints<0 Then MinPoints = 0
If MaxPoints<=0 Then MaxPoints = 90000
Call EL_Common.InitCommand(SearchCmd, "EL_SP_SearchShop")
With SearchCmd
.Parameters.Append .CreateParameter("RETURN", 2, 4)
.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ChannelID)
.Parameters.Append .CreateParameter("@ClassID", 3, 1, 4, ClassID)
.Parameters.Append .CreateParameter("@ProductName", 200, 1, 255, Search_ProductName)
.Parameters.Append .CreateParameter("@MinPoints", 3, 1, 4, MinPoints)
.Parameters.Append .CreateParameter("@MaxPoints", 3, 1, 4, MaxPoints)
.Parameters.Append .CreateParameter("@CurrentPage", 3, 1, 4, CurrentPage)
.Parameters.Append .CreateParameter("@PageSizes", 3, 2, 4)
.Parameters.Append .CreateParameter("@TotalRowCount", 3, 2, 4)
.Parameters.Append .CreateParameter("@PageCount", 3, 2, 4)
.Parameters.Append .CreateParameter("@RowCount", 3, 2, 4)
Set rsSearch = .Execute()
End With
rsSearch.Close()
PageSizes = SearchCmd(7)
TotalRowCount = SearchCmd(8)
PageCounts = SearchCmd(9)
RowCount = SearchCmd(10)
HTML = EL_Common.Template(ChannelID, 5, 0)
HTML = EL_Common.ReplaceCommonLabels(HTML)
Dim SearchTitle
SearchTitle = EL_Common.RegExpStaticLabel(EL_Common.Lang("Search.Title", "{$ItemName}搜索"), "{$ItemName}", EL_Channel.ItemName)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PageTitle}", EL_Common.Join2String(SearchTitle, SiteTitle, EL_Common.TitleDivide))
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>"& StrPath & SearchTitle
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPath}", EL_Common.ShowPath)
HTML = ChannelCommonLabels(HTML)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Search_ProductName}", Search_ProductName)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Search_Points}", Search_Points)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Search_ClassID}", ClassID)
Dim Match, Matches, ReturnString
Dim TempString, MatchString, NoList
CommonRegExp.Pattern = "\[ArrSearchResult\][\w\W]*\[\/ArrSearchResult\]"
Set Matches = CommonRegExp.Execute(HTML)
NoList = EL_Common.RegExpStaticLabel(EL_Common.Lang("Search.NoList", "<p> </p>搜索不到任何{$ItemName}<p> </p>"), "{$ItemName}", EL_Channel.ItemName)
If RowCount = 0 Then
For Each Match in Matches
HTML = Replace(HTML, Match.Value, NoList)
Next
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPage}", "")
Else
rsSearch.Open()
For Each Match in Matches
rsSearch.MoveFirst
MatchString = Match.Value
MatchString = EL_Common.ReplaceText(MatchString, "\[ArrSearchResult\]", "")
MatchString = EL_Common.ReplaceText(MatchString, "\[\/ArrSearchResult\]", "")
ReturnString = ""
Dim ItemHTML
For i = 1 To RowCount
ItemHTML = MatchString
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_ProductID}", rsSearch("ProductID"))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_ProductName}", EL_Common.HTMLEncode(rsSearch("ProductName")))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_Points}", rsSearch("Points"))
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_Num}", rsSearch("Num"))
If Trim(rsSearch("DefaultPictrue")) = "" Then
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_DefaultPictrue}", "")
Else
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_DefaultPictrue}", "<img src='"& EL_Common.PictrueURL(rsSearch("DefaultPictrue"), EL_Channel.FilePath) &"' width=110 height=80 border=0>")
End If
ItemHTML = EL_Common.RegExpStaticLabel(ItemHTML, "{$Arr_Content}", EL_Common.GetTopic(EL_Common.RemoveHTML(rsSearch("Content")), EL_Common.Lang("Shop.ContentLen", 250)))
ReturnString = ReturnString & ItemHTML
If i<RowCount Then rsSearch.MoveNext
Next
HTML = Replace(HTML, Match.Value, ReturnString)
Next
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_GetShopList(HTML)
HTML = Label_GetShopPhoto(HTML)
Set Matches = Nothing
Set rsSearch = Nothing
Set SearchCmd = Nothing
Session("EL_LastSearchDateTime") = Now()
Response.Write HTML
End Sub
Public Sub ShowProduct()
Dim ShopCmd, rsShop, i
Dim ProductID, ProductName, Points, Num, Content, DefaultPictrue, SkinID, TemplateID
ProductID = EL_Common.ELRequest("ProductID", 2)
Call EL_Common.InitCommand(ShopCmd, "EL_SP_GetShopInfo")
With ShopCmd
.Parameters.Append .CreateParameter("RETURN", 2, 4)
.Parameters.Append .CreateParameter("@ProductID", 3, 1, 4, ProductID)
.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ChannelID)
Set rsShop = .Execute()
End With
rsShop.Close()
If ShopCmd(0) <> 1 Then
EL_Common.ShowErrorMsg(EL_Common.RegExpStaticLabel(EL_Common.Lang("BaseConfig.InfoError", "指定{$ItemName}不存在"), "{$ItemName}", EL_Channel.ItemName))
Set rsShop = Nothing
Set ShopCmd = Nothing
Exit Sub
End If
rsShop.Open()
ClassID = rsShop("ClassID")
ProductName = rsShop("ProductName")
Points = rsShop("Points")
Num = rsShop("Num")
Content = rsShop("Content")
DefaultPictrue = rsShop("DefaultPictrue")
SkinID = rsShop("SkinID")
TemplateID = rsShop("TemplateID")
HTML = EL_Common.Template(ChannelID, 3, TemplateID)
HTML = EL_Common.ReplaceCommonLabels(HTML)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$PageTitle}", EL_Common.Join2String(ProductName, SiteTitle, EL_Common.TitleDivide))
HTML = EL_Common.RegExpStaticLabel(HTML, "{$DefaultSkin}", EL_Common.Skin(ChannelID, ClassID, SkinID))
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.GetParentPath(ChannelID, EL_Channel.ChannelDir, ClassID) & StrPath & EL_Common.RegExpStaticLabel(EL_Common.Lang("BaseConfig.Content", "{$ItemName}内容"), "{$ItemName}", EL_Channel.ItemName)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ShowPath}", EL_Common.ShowPath)
HTML = ChannelCommonLabels(HTML)
'自定义字段标签
Dim FieldCmd, rsField, FieldCount
Call EL_Common.InitCommonCmd(FieldCmd, rsField, "EL_Field", "FieldName", "ChannelID="& ChannelID)
rsField.Close()
FieldCount = FieldCmd(0)
If FieldCount = 0 Then
Set rsField = Nothing
Set FieldCmd = Nothing
Else
rsField.Open()
For i = 1 To FieldCount
HTML = EL_Common.RegExpStaticLabel(HTML, "{$"& rsField(0) &"}", rsShop(rsField(0).value))
If i<FieldCount Then rsField.MoveNext
Next
rsField.Close()
Set rsField = Nothing
Set FieldCmd = Nothing
End If
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ProductID}", ProductID)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ProductName}", ProductName)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Num}", Num)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Points}", Points)
HTML = EL_Common.RegExpStaticLabel(HTML, "{$Content}", Content)
If Trim(DefaultPictrue) <> "" Then
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ProductPictrue}", "<img src='"& InstallDir & EL_Channel.ChannelDir &"/"& EL_Channel.UploadDir &"/"& DefaultPictrue &"' width='130' height='90' border=0>")
Else
HTML = EL_Common.RegExpStaticLabel(HTML, "{$ProductPictrue}", "<img src='"& InstallDir &"Images/nopic.gif' border=0>")
End If
Dim BookButtonText
BookButtonText = EL_Common.Lang("BaseConfig.BookButtonText", "立即兑换")
HTML = EL_Common.RegExpStaticLabel(HTML, "{$BookButton}", "<input type='button' value='"& BookButtonText &"' class='bookbutton1' onClick=""onBooking("& ProductID &")""/>")
Dim SelectNumString
SelectNumString = "<select id='ProductNum' name='ProductNum'>"
For i = 1 To Num
SelectNumString = SelectNumString &"<option value='"& i &"'>"& i &"</option>"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -