<!--#include file="inc_const.asp"-->
<%response.expires=0
Response.CacheControl = "Private"
application.lock

set cschat=server.createobject("ffcschat.cssbchat")
my_level=cschat.getLevel(Session,Application(ConstStr & "_user_list"),Application(ConstStr & "_room_list"))
set cschat=nothing
application.unlock
if my_level-application( ConstStr & "_superlevel")<>0 then
  response.redirect("showerr.asp?errtext=你没有权力修改机器人的话语！")  
  response.end
end if

Set Conn=Server.CreateObject("ADODB.Connection")
conn.open Application( ConstStr & "_connstr")

ID=request("ID")
if ID<>"" then
  sql="select * from autoact where ID="&ID
  set rs=conn.Execute(sql)
  if rs.eof or rs.bof then ID=""
end if
if request("cmdYes")="确认" then
  text_body=replace(request("text_body"),"'","''")
  if len(text_body)>100 then
    errtext="错误：内容太长啦，超过了100个字符！"
  elseif text_body="" then
    errtext="错误：内容不能为空！"
  elseif id<>"" then
    sql="update autoact set text_body='"&text_body&"' where id="&id
    conn.Execute(sql)
    errText="操作成功：你成功地修改了对话！"
  else
    sql="insert into autoact (text_body) values ('"&text_body&"')"
    conn.Execute(sql)
    errText="操作成功：你成功地添加了对话！"
  end if
  response.redirect("showerr.asp?errtext="&errtext)
else%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="chat.css">
<style>u{color:red}</style>
<body style="background-color:EAF2FF;color:112233;scrollbar-Base-Color: #b0d8ff;SCROLLBAR-DARKSHADOW-COLOR:#b0d8ff;SCROLLBAR-arrow-COLOR:#336699;SCROLLBAR-TRACK-COLOR: EAF2FF;SCROLLBAR-3DLIGHT-COLOR: #b0d8ff;SCROLLBAR-SHADOW-COLOR: #336699;SCROLLBAR-HIGHLIGHT-COLOR: #b0d8ff;" leftmargin=3 topmargin=20 >
  <table width=400 align=center cellspacing=0 cellpadding=0 border=1 BORDERCOLORLIGHT=#000000 BORDERCOLORDARK=#ffffff>
  <tr><td class=navy1>修改或添加机器人的对话</td></tr>
 <form name="frmNewadd" action="automod.asp" method="post">
 <input type=hidden name="id" value="<%=id%>">
  <tr><td height=80>机器人的对话内容:<font color=990000>[<u>必填</u>，最多100个汉字]</font><BR>
  <textarea rows="3" name="text_body" cols="50"><%if ID<>"" then%><%=rs("text_body")%><%END IF%></textarea>
  <tr><td height=40><input class=navy1 type="submit" name="cmdYes" value="确认" >
    <input class=navy1 type="reset" name="cmdClear" value="清除" onclick="javascript:document.frmNewadd.act_name.focus();return true">
  <tr><td><ol>
    <li>修改或添加的时候可以包含<u>单引号</u>和<u>双引号</u>！</li>
    <li>由于你是超级用户，对你的输入<u>不做html检查</u>，好自为之啊！</li>
  </td></tr></form></table><tr<td><br><center>[<a href='javascript:history.go(-1)'>后退</a>]</table></body></html>
<%end if
conn.close
set conn=nothing%>












