<!--#include file="../Inc.asp"-->
<!--#include file="../ydzq.asp"-->
<card id="main" title="删除聊室" >
<p>
<%
dim id,TP
id=request("id")
TP=request("TP")

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

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

'管理员
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("<p>您没有管理权限！")
end if

IF TP<>"" then
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from chat where id="&id,conn,1,2
if rs.eof then
  Call Error("不存在的记录！")
end if
rs.delete
rs.update
rs.close
set rs=nothing
Response.write "删除成功<br/>"
Response.write "----------<br/>"

response.write"<a href=""index.asp?saytk="&saytk&"&amp;sid="&sid&""">[聊天大厅]</a><br/>"

else
Response.write "您确认要删除该聊室？<br/>"
Response.write "<a href=""chatdel.asp?id="&id&"&amp;TP=1&amp;saytk="&saytk&"&amp;sid="&sid&""">是的</a><br/>"
Response.write "<anchor>取消<prev/></anchor>"
end if
conn.close
set conn=Nothing
response.write"</p></card></wml>"
%>