<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<% call head()
dim nam,idi,txt,ids,TP,ID
nam=usb(request("nam"))
TP=usb(request("TP"))
ID=usb(request("id"))
idi=usb(request("idi"))
ids=request("ids")
txt=usb(request("txt"))

IF TP<>"" then

if ID="" or IsNumeric(ID) = False then
if saytk>1 then
  Call Error("<title>出错</title></head><body><body bgcolor="""&yanse1&"""><p>ID无效！")
else
  Call Error("<card id=""main"" title=""出错"" ><p>ID无效！")
end if
end if
call saycardd("编辑项目")
else
call saycardd("添加项目")
end if
if nam="" then
  Call Error("名称不能为空！")
end if



if idi="" or IsNumeric(idi) = False then
  Call Error("排序错误！")
end if


set rs=Server.CreateObject("ADODB.Recordset")
IF TP<>"" then
rs.open"select * from chat where ID="&ID,conn,1,2
else
rs.open"select * from chat",conn,1,2
rs.addnew
end if
rs("roomname")=nam
rs("pid")=idi
rs("roomadmin")=ids
if txt<>"" then rs("title")=txt

rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
IF TP<>"" then
response.write"成功编辑聊室<br/>"
else
response.write"成功增加聊室<br/>"
end if
response.write"----------<br/>"
response.write"<a href=""chat.asp?sid="&sid&"&amp;saytk="&saytk&""">[聊吧管理]</a>"
%><!--#include file="fanhui.asp"-->
<%response.write""
call headsay()%>
