<%@ Language=VBScript %>
<%Option Explicit%>
<!-- #INCLUDE FILE = "../inc.asp" -->
<%
CheckAdminLogin()
Dim oChat, rst
Dim i, iBound, j, sTemp
Set oChat = Server.CreateObject("LSChat.ChatRooms")
oChat.Configure g_SiteName, g_SiteDomain, g_DBString, g_ErrFile, g_ScriptName

Set rst = oChat.GetChatGroups
iBound = rst.RecordCount

Function checkBox(iFunctionCode, sGroup)
	Dim aRights, k
    checkBox = False
    If sGroup <> Empty Then
		If InStr(sGroup, ",") = 0 Then
            If CInt(sGroup) = iFunctionCode Then checkBox = True
        Else
            aRights = Split(sGroup, ",")
            For k = 0 To UBound(aRights)
				If iFunctionCode = CInt(aRights(k)) Then
					checkBox = True
					Exit For
				End If
            Next
        End If
    End If
End Function
%>
<html>
<head>
<title>组别修改页面</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script src="../inc.js" language="javascript"></script>
<link rel="stylesheet" href="manager.css" type="text/css">
</head>
<body <%=g_BodyTag%>>
<table width="100%" border="0" cellspacing="0" cellpadding="0"><form action="m_mgroups.asp" method="post" name="form">
    <tr>
      <td bgcolor="#000000" background="images/admin_bg_1.gif">
        <table width="100%" border="0" cellspacing="1" cellpadding="3">
          <tr> 
            <th colspan="16">组别修改页面</th>
          </tr>
          <tr bgcolor="#DEE5FA"> 
            <td align="center">组名</td>
            <td align="center">改组</td>
            <td align="center">广告Ⅰ</td>
            <td align="center">广告Ⅱ</td>
            <td align="center">帮助</td>
            <td align="center">HTML</td>
            <td align="center">图片</td>
            <td align="center">踢人</td>
            <td align="center">封杀</td>
            <td align="center">漫游</td>
            <td align="center">拯救</td>
            <td align="center">音乐</td>
            <td align="center">大字体</td>
            <td align="center">状态</td>
            <td align="center">等级</td>
            <td align="center"><font color="red">删除</font></td>
          </tr>
          <%For i = 1 To iBound%>
          <tr bgcolor="#DEE5FA"> 
            <td align="center"> 
              <input type="text" name="GN<%=i%>" size="15" maxlength="15" value="<%=rst("GroupName")%>" <%If rst("GroupName") = "Administrators" Or rst("GroupName") = "Users" Then Response.Write "readonly class=""readonlyinput"""%>>
              <input type="hidden" name="ON<%=i%>" value="<%=rst("GroupName")%>">
            </td>
            <%sTemp = Empty
            For j = 0 To 12
				sTemp = sTemp & "<td align=""center""><input type=""checkbox"" name=""RT" & i & "-" & j & """ class=""FormElement"""
				If checkBox(j, rst("Authorities")) Then sTemp = sTemp & " checked"
				sTemp = sTemp & "></td>"
			Next
			  Response.Write sTemp
            %>
            <td align="center"> 
              <input type="text" name="LV<%=i%>" size="2" maxlength="2" value="<%=rst("Priority")%>" <%If rst("GroupName") = "Administrators" Then Response.Write "readonly class=""readonlyinput"""%>>
            </td>
            <td align="center"> 
              <input type="checkbox" name="DL<%=i%>" <%If rst("GroupName") = "Administrators" Or rst("GroupName") = "Users" Then Response.Write "disabled"%>>
            </td>
          </tr>
          <%
          rst.MoveNext
          Next%>
          <tr bgcolor="#DEE5FA"> 
            <td align="center">Group Name</td>
            <td align="center">/chgrp</td>
            <td align="center">/ad</td>
            <td align="center">/adc</td>
            <td align="center">/help</td>
            <td align="center">/html</td>
            <td align="center">/img</td>
            <td align="center">/kick</td>
            <td align="center">/kill</td>
            <td align="center">/message</td>
            <td align="center">/rescue</td>
            <td align="center">/sing</td>
            <td align="center">/size</td>
            <td align="center">/status</td>
            <td align="center">Level</td>
            <td align="center"><font color="red">Delete</font></td>
          </tr>
          <tr bgcolor="#DEE5FA"> 
            <td colspan="15" align="center"></td>
            <td align="center"> 
              <input type="hidden" name="Bound" value="<%=iBound%>">
              <input type="submit" name="Submit" value="修改" class="Button">
            </td>
          </tr>
        </table>
      </td>
    </tr></form>
  </table>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
  <tr> 
    <td class="Solid1" bgcolor="#CCCCCC">[<b>系统提示</b>] 
      <ol>
        <li><b>Administrators</b>和<b>Users</b>是系统组，不可以对其改名和删除。</li>
        <li>等级只能是自然数，如果您填写了小于等于0的数值，系统将自动赋值为20。</li>
        <li>如果您修改了某个组的名字，所有属于该组的成员将自动转到于新组名之下。</li>
        <li>如果您删除了某个组，所有属于该组的成员将自动转到<b>Users</b>组之下。</li>
      </ol>
    </td>
  </tr>
</table>
<!-- #INCLUDE File = "../bottom.asp" -->
</body>
</html>
<%
rst.Close
Set rst = Nothing
Set oChat = Nothing
%>