<!--#include file="../Inc.asp"-->
<!--#include file="../ydzq.asp"-->
<!--#include file="../forbbs.asp"-->
<%

Call head()
Call saycardd("管理聊天室")
ID=trim(Request("ID"))
if ID="" or IsNumeric(ID)=false then
   Call Error("错误的聊天室ID")
end if

dim TP
TP  = trim(Request("TP"))

'数据库
dim Disallow,Disaller,n
set rs=server.CreateObject("ADODB.RecordSet")
rs.open "select roomAdmin,Chattxt,chathall,roomadmin2,mmtext from Chat where ID="&ID,conn,1,2
if rs.eof then
   rs.close
   set rs=Nothing
   Call Error("错误的聊天室ID")
end if

Disallow = rs("chathall")
'管理员
dim AdminID
AdminID = 0
if Instr(","&rs("roomAdmin")&",",","&myid&",") > 0 then
   AdminID   = myid
end if

if myid = AdminID  or keys = 1 or keys=2 then
else
   rs.close
   set rs=Nothing
   Call Error("您没有管理权限！")
end if
if TP="" then

   Response.write "*密码(不能为0)"&chr(13)
   Response.write "<br/><input emptyok=""true"" name=""roomadmin2"&tt&""" value="""&rs("roomadmin2")&"""/>"&chr(13)
   Response.write "<br/><anchor>更改密码"&chr(13)
   Response.write "<go href=""chatmm.asp?saytk="&saytk&"&amp;sid="&sid&""" method=""post"">"&chr(13)
   Response.write "<postfield name=""ID""      value="""&ID&"""/>"&chr(13)
   Response.write "<postfield name=""TP""    value=""1""/>"&chr(13)
   Response.write "<postfield name=""roomadmin2"" value=""$(roomadmin2"&tt&")""/>"&chr(13)
   Response.write "</go></anchor>"&chr(13)

   Response.write "<br/><a href=""chatroom.asp?ID="&ID&"&amp;saytk="&saytk&"&amp;sid="&sid&""">返回房间</a>"&chr(13)
   Response.write "</p></card></wml>"&chr(13)
else
'主题
dim roomadmin2
  roomadmin2 = trim(Request("roomadmin2"))
  roomadmin2 = forbbs(roomadmin2)
  if roomadmin2 ="0" then
    Call Error("聊天室密码不能为0！")
  end if

  rs("roomadmin2") = roomadmin2
rs.update
response.write "<onevent type=""ontimer"">"&chr(13)
response.write "<go href=""chatroom.asp?ID="&ID&"&amp;saytk="&saytk&"&amp;sid="&sid&"""/>"&chr(13)
response.write "</onevent>"&chr(13)
response.write "<timer value=""10""/>"&chr(13)

Response.write "管理成功！"&chr(13)
Response.write "<br/><a href=""chatroom.asp?ID="&ID&"&amp;saytk="&saytk&"&amp;sid="&sid&""">返回房间</a>"&chr(13)

Call head1()
end if
rs.close
set rs=nothing
conn.close
set conn=Nothing
%>