📄 admin_usergroup.asp
字号:
Response.Write " <tr>" & vbCrLf
Response.Write " <td align='center'>" & vbCrLf
Response.Write " <input type='hidden' name='GroupID' value='" & rsUserGroup("GroupID") & "'>" & vbCrLf
Response.Write " <input type='hidden' name='Action' value='SaveModify'>" & vbCrLf
Response.Write " <input type='submit' value='保存修改结果'>" & vbCrLf
Response.Write " <input type='button' name='cancel' value=' 取 消 ' onClick=""JavaScript:window.location.href='Admin_UserGroup.asp'"">" & vbCrLf
Response.Write " </td>" & vbCrLf
Response.Write " </tr>" & vbCrLf
Response.Write " </table>" & vbCrLf
Response.Write "</form>" & vbCrLf
End Sub
Sub Del()
GroupID = PE_CLng(Trim(Request("GroupID")))
If GroupID = 1 Then
FoundErr = True
ErrMsg = ErrMsg & "<li>不能删除系统默认的会员组</li>"
Exit Sub
End If
Conn.Execute ("update PE_User set GroupID=1 where GroupID=" & GroupID & "")
Conn.Execute ("delete from PE_UserGroup where GroupID=" & GroupID & " AND GroupType>=2")
Call main
End Sub
Sub SaveGroup()
Dim GroupType, strValue, GroupIntro, i
Dim rsUserGroup, rsChannel, GroupPurview, GroupPurviewChannel
Dim arrClass_Browse, arrClass_View, arrClass_Input
GroupID = Trim(Request.Form("GroupID"))
GroupName = Trim(Request.Form("GroupName"))
GroupIntro = Trim(Request.Form("GroupIntro"))
GroupType = Trim(Request.Form("GroupType"))
FoundErr = False
If GroupName = "" Then
FoundErr = True
ErrMsg = ErrMsg & "<li>会员组名称不能为空</li>"
Exit Sub
Else
GroupName = ReplaceBadChar(GroupName)
End If
If GroupType = "" Then
GroupType = 0
Else
GroupType = CLng(GroupType)
End If
GroupSetting = ""
For i = 0 To 30
strValue = Trim(Request.Form("GroupSetting" & i & ""))
If strValue = "" Or (Not IsNumeric(strValue)) Then
strValue = "0"
End If
If GroupSetting = "" Then
GroupSetting = strValue
Else
GroupSetting = GroupSetting & "," & strValue
End If
Next
arrClass_Browse = ""
arrClass_View = ""
arrClass_Input = ""
Dim tBrowse, tView, tInput, ChannelDir
Set rsChannel = Conn.Execute("SELECT ChannelDir FROM PE_Channel WHERE ChannelType<=1 And ModuleType<>4 And ModuleType<>5 And Disabled=" & PE_False & " ORDER BY OrderID")
Do While Not rsChannel.EOF
ChannelDir = rsChannel(0)
tBrowse = ReplaceBadChar(Trim(Request.Form("arrClass_Browse_" & ChannelDir)))
tView = ReplaceBadChar(Trim(Request.Form("arrClass_View_" & ChannelDir)))
tInput = ReplaceBadChar(Trim(Request.Form("arrClass_Input_" & ChannelDir)))
If tBrowse = "" And tView = "" And tInput = "" Then
If arrClass_Browse = "" Then
arrClass_Browse = ChannelDir & "none"
Else
arrClass_Browse = arrClass_Browse & "," & ChannelDir & "none"
End If
If arrClass_View = "" Then
arrClass_View = ChannelDir & "none"
Else
arrClass_View = arrClass_View & "," & ChannelDir & "none"
End If
If arrClass_View = "" Then
arrClass_View = ChannelDir & "none"
Else
arrClass_View = arrClass_View & "," & ChannelDir & "none"
End If
Else
If tBrowse <> "" Then
If arrClass_Browse = "" Then
arrClass_Browse = tBrowse
Else
arrClass_Browse = arrClass_Browse & "," & tBrowse
End If
End If
If tView <> "" Then
If arrClass_View = "" Then
arrClass_View = tView
Else
arrClass_View = arrClass_View & "," & tView
End If
End If
If tInput <> "" Then
If arrClass_Input = "" Then
arrClass_Input = tInput
Else
arrClass_Input = arrClass_Input & "," & tInput
End If
End If
End If
rsChannel.MoveNext
Loop
Set rsChannel = Nothing
Set rsUserGroup = Server.CreateObject("Adodb.Recordset")
If Action = "SaveAdd" Then
rsUserGroup.Open "SELECT * FROM PE_UserGroup WHERE GroupName='" & GroupName & "'", Conn, 1, 3
If Not (rsUserGroup.BOF And rsUserGroup.EOF) Then
FoundErr = True
ErrMsg = ErrMsg & "<li>数据库中已有同名会员组!</li>"
Else
rsUserGroup.addnew
rsUserGroup("GroupID") = PE_CLng(Conn.Execute("select max(GroupID) from PE_UserGroup")(0)) + 1
End If
Else
rsUserGroup.Open "SELECT * FROM PE_UserGroup WHERE GroupID=" & GroupID, Conn, 1, 3
If rsUserGroup.BOF And rsUserGroup.EOF Then
FoundErr = True
ErrMsg = ErrMsg & "<li>数据库没有发现此会员组!</li>"
End If
End If
If FoundErr = True Then
rsUserGroup.Close
Set rsUserGroup = Nothing
Exit Sub
End If
rsUserGroup("GroupName") = GroupName
rsUserGroup("GroupIntro") = GroupIntro
If GroupType > 0 Then
rsUserGroup("GroupType") = GroupType
End If
rsUserGroup("GroupSetting") = GroupSetting
rsUserGroup("arrClass_Browse") = arrClass_Browse
rsUserGroup("arrClass_View") = arrClass_View
rsUserGroup("arrClass_Input") = arrClass_Input
rsUserGroup.Update
rsUserGroup.Close
Set rsUserGroup = Nothing
Call main
End Sub
Function GetGroupNum(iGroupID)
If Not IsNumeric(iGroupID) Then Exit Function
Dim rsUserGroup
Set rsUserGroup = Conn.Execute("SELECT Count(UserID) FROM PE_User WHERE GroupID=" & iGroupID & "")
If IsNull(rsUserGroup(0)) Then
GetGroupNum = 0
Else
GetGroupNum = rsUserGroup(0)
End If
Set rsUserGroup = Nothing
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -