📄 group_admin.asp
字号:
<!--#include file="../ACT.Function.asp"-->
<!--#include file="../../act_inc/cls_pageview.asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>用户组管理</title>
<link href="../Images/css1/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td colspan="2" align="center" class="bg_tr"><strong>会员系统----用户组管理</strong></td>
</tr>
<tr>
<td width="22%" align="right" ><strong>管理选项:</strong></td>
<td width="78%" ><strong><a href="?">管理首页</a></strong> ┆
<% If Not ACTCMS.ChkAdmin() Then Call Actcms.Alert("对不起,您没有操作权限!","")
Dim rs
Set Rs =ACTCMS.ACTEXE("SELECT ModeID,ModeName FROM ModeUser_Act order by ModeID asc")
If Rs.EOF Then
Response.Write "没有记录"
Else
Do While Not Rs.EOF
%>
<strong><a href="?Action=Add&ModeID=<%=rs("ModeID")%>">新增<%=rs("ModeName")%>组</a></strong>
<%
Rs.movenext
Loop
end if
Set Rs = Nothing %>
</td>
</tr>
</table><%
Dim ShowErr,Action,ModeID
Action = Request("Action")
ModeID = ACTCMS.ChkNumeric(Request("ModeID"))
Select Case Action
Case "Edit","Add"
Call Edit()
Case "SaveAdd"
Call SaveAdd
Case "SaveEdit"
Call SaveEdit
Case "del"
Call Del()
Case "DefaultGroup"
Call DefaultGroup()
Case Else
Call Main()
End Select
Sub DefaultGroup()
Dim GroupID
GroupID=ACTCMS.ChkNumeric(actcms.s("GroupID"))
Conn.execute "update Group_Act set DefaultGroup=0 where ModeID="&ModeID&""
Conn.execute "update Group_Act set DefaultGroup=1 where ModeID="&ModeID&" and GroupID="&GroupID&""
Call actcms.ActErr("操作成功","")
End Sub
Sub SaveAdd()
Dim Sql,Rs,GroupID,ChargeType,GroupSetting
GroupID = ACTCMS.ChkNumeric(Request("GroupID"))
ChargeType = ACTCMS.ChkNumeric(Request.Form("ChargeType"))
IF ChargeType = 0 Then ChargeType = 1
IF Request("GroupSetting1") = "" Then
ShowErr = "<li>用户组名称不能为空!</li>"
Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl="&"&Title=1")
Response.End
End IF
GroupSetting=GroupSetting&Request.Form("GroupSetting1")&"^@$@^"
GroupSetting=GroupSetting&Request.Form("GroupSetting2")&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting3"))&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting4"))&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting5"))&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting6"))&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting7"))&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting8"))&"^@$@^"
GroupSetting=GroupSetting&Request.Form("GroupSetting9")&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting10"))&"^@$@^"
GroupSetting=GroupSetting&Request.Form("GroupSetting11")&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting12"))&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting13"))&"^@$@^"
GroupSetting=GroupSetting&Request.Form("GroupSetting14")&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting15"))&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting16"))&"^@$@^"
SQL = "Select * From Group_ACT "
Set Rs=Server.CreateObject("Adodb.RecordSet")
Rs.Open SQL,Conn,1,3
Do While Not rs.eof
If Split(rs("GroupSetting"),"^@$@^")(0)=actcms.rsql(actcms.s("GroupSetting1")) Then
ShowErr = "<li>数据库中已经存在此用户组名称!</li>"
Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl="&"&Title=1")
Response.End
End IF
rs.movenext
Loop
Rs.addnew
Rs("GroupSetting") = GroupSetting
Rs("ModeID") = ModeID
Rs.update
Rs.Close:Set Rs=Nothing
ShowErr = "<li>添加新用户组成功! <a href='User/Group_Admin.asp'><b>返回用户组管理</b></a></li>"
Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl=")
Response.End
End Sub
Sub SaveEdit()
Dim Sql,Rs,GroupID,ChargeType,GroupSetting
GroupID = ACTCMS.ChkNumeric(Request("GroupID"))
ChargeType = ACTCMS.ChkNumeric(Request.Form("ChargeType"))
IF ChargeType = 0 Then ChargeType = 1
IF Request("GroupSetting1") = "" Then
ShowErr = "<li>用户组名称不能为空!</li>"
Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl="&"&Title=1")
Response.End
End IF
GroupSetting=GroupSetting&Request.Form("GroupSetting1")&"^@$@^"
GroupSetting=GroupSetting&Request.Form("GroupSetting2")&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting3"))&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting4"))&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting5"))&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting6"))&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting7"))&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting8"))&"^@$@^"
GroupSetting=GroupSetting&Request.Form("GroupSetting9")&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting10"))&"^@$@^"
GroupSetting=GroupSetting&Request.Form("GroupSetting11")&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting12"))&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting13"))&"^@$@^"
GroupSetting=GroupSetting&Request.Form("GroupSetting14")&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting15"))&"^@$@^"
GroupSetting=GroupSetting&ACTCMS.ChkNumeric(Request.Form("GroupSetting16"))&"^@$@^"
SQL = "Select * From Group_ACT Where GroupID="&GroupID
Set Rs=Server.CreateObject("Adodb.RecordSet")
Rs.Open SQL,Conn,1,3
IF Not (Rs.Eof And Rs.Bof) Then
Rs("GroupSetting") = GroupSetting
Rs("ChargeType") = ChargeType
Rs.update
Else
ShowErr = "<li>无此用户组,参数传递出错</li>"
Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl="&"&Title=1")
Response.End
End IF
Rs.Close:Set Rs=Nothing
ShowErr = "<li>用户组修改成功! <a href='User/Group_Admin.asp'><b>返回用户组管理</b></a></li>"
Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl=")
Response.End
End Sub
Sub Del()
Conn.Execute ("Delete from Group_ACT Where GroupID=" & ACTCMS.ChkNumeric(Request.QueryString("GroupID")))
Set conn=nothing
ShowErr = "<li>用户组删除成功!</li>"
Response.Redirect("../Error.asp?Errs="&Server.URLEncode(ShowErr)&"&ErrorUrl=User/Group_Admin.asp")
Response.End
End Sub
Sub Main
Dim strLocalUrl,ModeName
strLocalUrl = request.ServerVariables("SCRIPT_NAME")
Dim intPageNow
intPageNow = request.QueryString("page")
Dim intPageSize, strPageInfo
intPageSize = 30
Dim arrU, i,GroupSettingSet
Dim sql, sqlCount
sql = "SELECT [GroupID], [GroupSetting],[ModeID],[DefaultGroup]" & _
" FROM [Group_ACT]" & _
"ORDER BY [GroupID] ASC"
sqlCount = "SELECT Count([GroupID])" & _
" FROM [Group_ACT]"
Dim clsRecordInfo
Set clsRecordInfo = New Cls_PageView
clsRecordInfo.intRecordCount = 2816
clsRecordInfo.strSqlCount = sqlCount
clsRecordInfo.strSql = sql
clsRecordInfo.intPageSize = intPageSize
clsRecordInfo.intPageNow = intPageNow
clsRecordInfo.strPageUrl = strLocalUrl
clsRecordInfo.strPageVar = "page"
clsRecordInfo.objConn = Conn
arrU = clsRecordInfo.arrRecordInfo
strPageInfo = clsRecordInfo.strPageInfo
Set clsRecordInfo = nothing
%>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td colspan="7" class="bg_tr">您现在的位置:管理首页 >> <a href="?" ><font class="bg_tr">用户组管理</font></a> >></td>
</tr>
<tr>
<td width="20" align="center" ><STRONG>ID</STRONG></td>
<td align="center" ><STRONG>用户组名称</STRONG></td>
<td width="13%" align="center" ><STRONG>组模型</STRONG></td>
<td align="center" nowrap><STRONG>属性</STRONG></td>
<td align="center" nowrap><STRONG>会员数量</STRONG></td>
<td align="center" nowrap><strong>管理操作</strong></td>
</tr>
<%
Dim bgColor
If IsArray(arrU) Then
For i = 0 to UBound(arrU, 2)
GroupSettingSet=Split(arrU(1,i),"^@$@^")
%>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" ><%= arrU(0,i) %></td>
<td align="center" ><%=GroupSettingSet(0)%></td>
<td align="center" ><%
Dim rs2,IFD
Set rs2=Conn.Execute("Select ModeName,ModeTable From ModeUser_Act Where ModeID=" & arrU(2,i))
If rs2.eof Then
ModeName= "<font color=red>错误,该组模型已被删除</font>"
IFD=1
Else
ModeName= "<font color=red>"&rs2("ModeName")&"</font>"
IFD=2
End If
response.write ModeName%></td>
<td align="center" >
<%IF arrU(3,i) = "1" Then Response.Write "<font color=green>默认注册组</font>" Else Response.Write "正常" %> </td>
<td align="center" >
<%If ifd=2 Then
response.write Conn.Execute("Select Count(UserID) From "&rs2("ModeTable")&" Where GroupID=" & arrU(0,i))(0)
End If %></td>
<td align="center" >
<a href="?Action=DefaultGroup&ModeID=<%=arrU(2,i)%>&GroupID=<%=arrU(0,i)%>">设置为<font color=red><%=ModeName%></font>模型默认的注册用户组</a>
<a href="?Action=Edit&GroupID=<%=arrU(0,i) %>">修改</a>┆
<a href="?Action=del&GroupID=<%= arrU(0,i) %>" onClick="return confirm('确认删除此用户组吗?')">删除</a>┆
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -