<!--#include file="conn.asp"-->
<html>
<head>
<title>聊天室管理</title>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<link rel="stylesheet" href="chat.css">
</head>
<script language="JavaScript">
<!--
function Juge(form1)
{
  if (form1.name.value == "")
  {
    alert("项目不能为空!");
    form1.name.focus();
    return (false);
  }
}
-->
</script>
<%
sql="select * from admin where name='"&session("username")&"'"
set rs=conn.execute(sql)
if not rs.eof and not rs.bof then
%>
封闭用户发言:
<%sql="select * from forbid"
set forbid_rs=conn.execute(sql)
%>
<table width="70%" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td>被BAN用户</td>
<td>被BAN时间</td>
	<td>解BAN</td>
	
  </tr><%do while not forbid_rs.eof%>
  <tr>
    <td><%=forbid_rs("name")%></td>
    <td><%=forbid_rs("time")%></td>
	<td><a href=ban.asp?act=cban&names=<%=forbid_rs("name")%>>解除</a></td>
  </tr>
<%forbid_rs.movenext
loop
forbid_Rs.close
Set forbid_Rs = Nothing%>
</table><p>


封闭用户:
<form name="form1" method="post" action="ban.asp?act=addban" onSubmit="return Juge(this)">
  用户名: 
  <input type="text" name="name">
  <input type="submit" name="Submit" value=" 封 ">
</form>

<p>
<form name="chk_form" method="post" action="1.asp?act=chk">
禁止匿名用户发言:

  <input type="radio" name="chk" value=0<%If application("chk")=1 Then%> checked<%End If%>>
  是
<input type="radio" name="chk" value=1<%If application("chk")=0 Then%> checked<%End If%>>
  否 
  <input type="submit" name="Submit" value="确定">
</form>
<%=Application("chk")%>
<p>
<form name="logs_form" method="post" action="1.asp?act=logs">
启用聊天记录:

  <input type="radio" name="logs" value=0<%If application("logs")=1 Then%> checked<%End If%>>
  是
<input type="radio" name="logs" value=1<%If application("logs")=0 Then%> checked<%End If%>>
  否 
  <input type="submit" name="Submit" value="确定">
</form><%=Application("logs")%>
<%end if%>
<centeR>此地只准聊天室管理成员进入</centeR>

<%
sql="select * from admin where name='"&session("username")&"' and type='root'"
set rs=conn.execute(sql)
if not rs.eof and not rs.bof then
%>
解除管理员权限:
<%sql="select * from admin"
set admin_rs=conn.execute(sql)
%>
<table width="70%" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td>用户名</td>
    <td>类型</td>
	<td>解除</td>
  </tr><%do while not admin_rs.eof%>
  <tr>
    <td><%=admin_rs("name")%></td>
    <td><%=admin_rs("type")%></td>
	<td><a href=user.asp?act=deladmin&names=<%=admin_rs("name")%>>解除</a></td>
  </tr>
<%admin_rs.movenext
loop
admin_Rs.close
Set admin_Rs = Nothing%>
</table><p>


添加加管理员:
<form name="form1" method="post" action="addadmin.asp?act=addadmin">
  用户名: 
  <input type="text" name="name"> 权限
    <select name="admintype">
    <option selected>admin</option>
    <option>root</option>
  </select>
  <input type="submit" name="Submit" value="添加">
</form>
管理员权限说明:
admin为一般管理员,具有清屏,绑和解绑聊天用户,禁止匿名用户发言<br>

root为聊天室超级管理员,除了有admin的所有权限外,还可以添加管理员

<a href="logs.txt">查看聊天记录</a>
<%end if%>