📄 admin_shop.asp
字号:
<%
Option Explicit
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
%>
<!--#Include File="../Conn.asp"-->
<!--#Include File="Admin_CheckPurview.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href='Admin_Style.css' type='text/css' rel='stylesheet'>
<title><%=EL_Channel.ChannelName%></title>
<script language="javascript" src="../js/Common.js"></script>
<script language="javascript" src="../js/InstallDir.js"></script>
</head>
<body>
<%
Call EL_Common.CheckChannel(EL_Channel.ChannelID, 7)
Dim ManageType, Passed, OnTop, Commended
Dim ClassID, CurrentPath, Search_Keywords, Search_Field, ClassURL
ManageType = EL_Common.ELRequest("ManageType", 1)
ClassID = EL_Common.ELRequest("ClassID", 2)
Passed = EL_Common.ELRequest("Passed", 1)
OnTop = EL_Common.ELRequest("OnTop", 1)
Commended = EL_Common.ELRequest("Commended", 1)
Search_Keywords = EL_Common.ReplaceBadChar(EL_Common.ELRequest("Search_Keywords", 1))
Search_Field = EL_Common.ReplaceBadChar(EL_Common.ELRequest("Search_Field", 1))
If ClassID = "" Then
ClassURL = URLParameters
Else
ClassURL = EL_Common.ReplaceText(URLParameters, "\&ClassID=[0-9]*", "")
ClassURL = EL_Common.ReplaceText(ClassURL, "Show", "")
End If
If OnTop = "" Then OnTop = EL_False
If Commended = "" Then Commended = EL_False
CurrentPath = "·您现在的位置:<a href='"& EL_CurrentScriptName &"?ChannelID="& EL_Channel.ChannelID &"'>"& EL_Channel.ItemName &"管理首页</a> "
%>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
<tr>
<td align="center" class="top_25"><strong><%=EL_Channel.ChannelName%>管理</strong></td>
</tr>
<tr>
<td class="td_50">管理导航:
<a href="<%=EL_CurrentScriptName%>?ChannelID=<%=EL_Channel.ChannelID%>"><%=EL_Channel.ItemName%>管理首页</a> |
<a href="<%=EL_CurrentScriptName%>?ChannelID=<%=EL_Channel.ChannelID%>&Action=Add">添加<%=EL_Channel.ItemName%></a> |
<a href="<%=EL_CurrentScriptName%>?ChannelID=<%=EL_Channel.ChannelID%>&ManageType=Check&Passed=<%=EL_False%>"><%=EL_Channel.ItemName%>发布</a> |
<a href="<%=EL_CurrentScriptName%>?ChannelID=<%=EL_Channel.ChannelID%>&Action=Batch">批量<%=EL_Channel.ItemName%>设置</a> |
<a href="<%=EL_CurrentScriptName%>?ChannelID=<%=EL_Channel.ChannelID%>&ManageType=Recycled"><%=EL_Channel.ItemName%>回收站</a>
</td>
</tr>
</table>
<br>
<%
Select Case Action
Case "": Call ManageProduct()
Case "Add": Call AddProduct()
Case "SaveNewProduct": Call SaveProduct(0)
Case "Modify": Call ModifyProduct()
Case "SaveModify": Call SaveProduct(1)
Case "Delete": Call SaveProduct(2)
Case "SetOnTop": Call SaveProduct(3)
Case "SetCommended": Call SaveProduct(4)
Case "SetPassed": Call SaveProduct(5)
Case "Restore": Call SaveProduct(6)
Case "DeleteTrue": Call SaveProduct(7)
Case "Move": Call SaveProduct(8)
Case "DeleteAllTrue": Call SaveProduct(9)
Case "RestoreAll": Call SaveProduct(10)
Case "Show": Call ShowProduct()
Case "Batch": Call BatchSetup()
Case "SaveBatch": Call SaveBatch()
End Select
Call EL_Common.Bottom()
Call ApplicationTerminate()
Sub SaveBatch()
On Error Resume Next
Dim BatchCmd
Dim SetupType, ArrSetItems, ArrProductID, ArrClassID
Dim Points, Num, OnTop, Commended, Hits, SkinID, TemplateID
SetupType = EL_Common.ELRequest("SetupType", 2)
ArrSetItems = EL_Common.ELRequest("SetItems", 1)
ArrProductID = EL_Common.ELRequest("ArrProductID", 1)
ArrClassID = EL_Common.ELRequest("ArrClassID", 1)
Points = EL_Common.ELRequest("Points", 2)
Num = EL_Common.ELRequest("Num", 2)
OnTop = EL_Common.ELRequest("OnTop", 2)
Commended = EL_Common.ELRequest("Commended", 2)
Hits = EL_Common.ELRequest("Hits", 2)
SkinID = EL_Common.ELRequest("SkinID", 2)
TemplateID = EL_Common.ELRequest("TemplateID", 2)
'检查权限
If EL_Admin.Purview <> 1 And EL_Admin.Purview <> 2 Then
Dim ArrCheckClassID, CheckCmd, rsCheck, i, RowCount
If SetupType = 0 Then
Call EL_Common.InitCommonCmd(CheckCmd, rsCheck, "EL_Shop", "ClassID", "ChannelID="& EL_Channel.ChannelID &" And ProductID IN("& ArrProductID &") GROUP BY ClassID")
rsCheck.Close()
RowCount = CheckCmd(0)
If RowCount = 0 Then
Set rsCheck = Nothing
Set CheckCmd = Nothing
EL_Admin.ShowPurviewError("对不起,您只能管理栏目权限范围之内的"& EL_Channel.ItemName)
End If
rsCheck.Open()
For i = 1 To RowCount
If EL_Admin.CheckAdminPurview(rsCheck(0), 2) = False Then
rsCheck.Close()
Set rsCheck = Nothing
Set CheckCmd = Nothing
EL_Admin.ShowPurviewError("对不起,您只能管理栏目权限范围之内的"& EL_Channel.ItemName)
End If
If i<RowCount Then rsCheck.MoveNext
Next
rsCheck.Close()
Set rsCheck = Nothing
Set CheckCmd = Nothing
Else
ArrCheckClassID = Split(ArrClassID, ",")
For i = 0 To Ubound(ArrCheckClassID)
If EL_Admin.CheckAdminPurview(ArrCheckClassID(i), 2) = False Then
EL_Admin.ShowPurviewError("对不起,您只能管理栏目权限范围之内的"& EL_Channel.ItemName)
End If
Next
End If
End If
Call EL_Common.InitCommand(BatchCmd, "EL_SP_ShopBatchSetup")
With BatchCmd
.Parameters.Append .CreateParameter("RETURN", 2, 4)
.Parameters.Append .CreateParameter("@SetupType", 3, 1, 4, SetupType)
.Parameters.Append .CreateParameter("@ArrSetItems", 200, 1, 500, ArrSetItems)
.Parameters.Append .CreateParameter("@ArrProductID", 200, 1, 4000, ArrProductID)
.Parameters.Append .CreateParameter("@ArrClassID", 200, 1, 4000, ArrClassID)
.Parameters.Append .CreateParameter("@Points", 3, 1, 4, Points)
.Parameters.Append .CreateParameter("@Num", 3, 1, 4, Num)
.Parameters.Append .CreateParameter("@OnTop", 11, 1, 1, OnTop)
.Parameters.Append .CreateParameter("@Commended", 11, 1, 1, Commended)
.Parameters.Append .CreateParameter("@Hits", 3, 1, 4, Hits)
.Parameters.Append .CreateParameter("@SkinID", 3, 1, 4, SkinID)
.Parameters.Append .CreateParameter("@TemplateID", 3, 1, 4, TemplateID)
.Execute()
End With
Select Case BatchCmd(0)
Case 40: EL_Common.ShowErrorMsg("未指定"& EL_Channel.ItemName &"ID") : Set BatchCmd = Nothing : Exit Sub
Case 41: EL_Common.ShowErrorMsg("未指定"& EL_Channel.ItemName & EL_Channel.ClassItemName) : Set BatchCmd = Nothing : Exit Sub
Case 42: EL_Common.ShowErrorMsg("未指定设置项目") : Set BatchCmd = Nothing : Exit Sub
End Select
Set BatchCmd = Nothing
EL_Common.ShowSuccessMsg("完成批量"& EL_Channel.ItemName &"设置<p>【<a href='"& EL_CurrentScriptName &"?ChannelID="& EL_Channel.ChannelID &"'>"& EL_Channel.ItemName &"管理</a>】</p>")
EL_Common.ShowScriptError()
End Sub
Sub SaveProduct(UpdateType)
On Error Resume Next
Dim ProductCmd, RetMessage
Dim ProductID, ClassID, ProductName, Points, Num, Content, DefaultPictrue, Uploadfiles
Dim OnTop, Commended, Passed, UpdateTime, SkinID, TemplateID, Inputer, Editor
Dim IsSaveRemoteImages, DefineField
ProductID = EL_Common.ELRequest("ProductID", 2)
ClassID = EL_Common.ELRequest("ClassID", 2)
ProductName = EL_Common.ELRequest("ProductName", 1)
Points = EL_Common.ELRequest("Points", 2)
Num = EL_Common.ELRequest("Num", 2)
Content = EL_Common.ELRequest("Content", 1)
DefaultPictrue = EL_Common.ELRequest("DefaultPictrue", 1)
Uploadfiles = EL_Common.ELRequest("Uploadfiles", 1)
OnTop = EL_Common.ELRequest("OnTop", 2)
Commended = EL_Common.ELRequest("Commended", 2)
Passed = EL_Common.ELRequest("Passed", 2)
UpdateTime = EL_Common.ELRequest("UpdateTime", 1)
SkinID = EL_Common.ELRequest("SkinID", 2)
TemplateID = EL_Common.ELRequest("TemplateID", 2)
Inputer = EL_Admin.AdminName
Editor = EL_Admin.AdminName
IsSaveRemoteImages = EL_Common.ELRequest("IsSaveRemoteImages", 2)
If UpdateTime = "" Then UpdateTime = Now()
Select Case UpdateType
Case 0, 1:
If Not IsDate(UpdateTime) Then
EL_Common.ShowErrorMsg("更新日期的时间格式错误")
Exit Sub
End If
'检查录入权限
If EL_Admin.Purview <> 1 And EL_Admin.Purview <> 2 Then
If EL_Admin.CheckAdminPurview(ClassID, 2) = False Then
EL_Admin.ShowPurviewError("对不起!您只能在自己管理的"& EL_Channel.ClassItemName &"中录入或修改"& EL_Channel.ItemName)
End If
End If
'取自定义字段值
DefineField = EL_Common.RequestDefineField(EL_Channel.ChannelID)
'检查并保存远程图片
If EnableSaveRemote = True And IsSaveRemoteImages = 1 Then
Dim ObjectSRI, SRI_Uploadfiles
Set ObjectSRI = New SaveRemoteImages
ObjectSRI.SetCreateWatermark = EnableWatermark
ObjectSRI.SetCreateThumb = EnableCreateThumb
Content = ObjectSRI.AutoSave(Content, EL_Channel.FilePath)
If ObjectSRI.GetSRI_Flag() = True Then
SRI_Uploadfiles = ObjectSRI.GetImagesList()
Uploadfiles = EL_Common.Join2String(Uploadfiles, SRI_Uploadfiles, "|")
End If
Set ObjectSRI = Nothing
End If
Case Else:
DefineField = EL_Common.ELRequest("CheckObject", 1)
Passed = EL_Common.ELRequest("SetValue", 2)
If ProductID <> 0 Then DefineField = EL_Common.Join2String(DefineField, ProductID, ",")
If UpdateType = 8 Then
ClassID = EL_Common.ELRequest("TargetClassID", 2)
'检查权限
If EL_Admin.Purview <> 1 And EL_Admin.Purview <> 2 Then
If EL_Admin.CheckAdminPurview(ClassID, 2) = False Then
EL_Admin.ShowPurviewError("对不起!您只能在自己管理的"& EL_Channel.ClassItemName &"中移动"& EL_Channel.ItemName)
End If
End If
End If
End Select
Call EL_Common.InitCommand(ProductCmd, "EL_SP_Shop")
With ProductCmd
.Parameters.Append .CreateParameter("RETURN", 2, 4)
.Parameters.Append .CreateParameter("@UpdateType", 3, 1, 4, UpdateType)
If UpdateType = 0 Then
.Parameters.Append .CreateParameter("@ProductID", 3, 2, 4)
Else
.Parameters.Append .CreateParameter("@ProductID", 3, 1, 4, ProductID)
End If
.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, EL_Channel.ChannelID)
.Parameters.Append .CreateParameter("@ClassID", 3, 1, 4, ClassID)
.Parameters.Append .CreateParameter("@ProductName", 200, 1, 255, ProductName)
.Parameters.Append .CreateParameter("@Points", 3, 1, 4, Points)
.Parameters.Append .CreateParameter("@Num", 3, 1, 4, Num)
.Parameters.Append .CreateParameter("@Content", 203, 1, EL_Common.LenParameter(Content), Content)
.Parameters.Append .CreateParameter("@DefaultPictrue", 200, 1, 255, DefaultPictrue)
.Parameters.Append .CreateParameter("@Uploadfiles", 203, 1, EL_Common.LenParameter(Uploadfiles), Uploadfiles)
.Parameters.Append .CreateParameter("@OnTop", 11, 1, 1, OnTop)
.Parameters.Append .CreateParameter("@Commended", 11, 1, 1, Commended)
.Parameters.Append .CreateParameter("@Passed", 11, 1, 1, Passed)
.Parameters.Append .CreateParameter("@UpdateTime", 135, 1, 8, UpdateTime)
.Parameters.Append .CreateParameter("@SkinID", 3, 1, 4, SkinID)
.Parameters.Append .CreateParameter("@TemplateID", 3, 1, 4, TemplateID)
.Parameters.Append .CreateParameter("@Inputer", 200, 1, 50, Inputer)
.Parameters.Append .CreateParameter("@Editor", 200, 1, 50, Editor)
.Parameters.Append .CreateParameter("@DefineField", 200, 1, 4000, DefineField)
.Execute()
End With
Select Case ProductCmd(0)
Case 40: EL_Common.ShowErrorMsg("频道参数错误") : Set ProductCmd = Nothing : Exit Sub
Case 41: EL_Common.ShowErrorMsg("指定"& EL_Channel.ClassItemName &"不存在") : Set ProductCmd = Nothing : Exit Sub
Case 42: EL_Common.ShowErrorMsg("不允许在有子"& EL_Channel.ClassItemName &"的"& EL_Channel.ClassItemName &"中添加"& EL_Channel.ItemName) : Set ProductCmd = Nothing : Exit Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -