<!--#include file = "Startup.asp"-->
<!-- #include file="Function.asp" -->
<!-- #include file="char.inc" -->
<%

call adminer()
Call Header()
Call ComeUrl()
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<SCRIPT language=JavaScript>

function CheckInput(){

	if(form.reply.value==''){
		alert("内容不能为空！");
		form.reply.focus();
		return false;
	}
	if(form.reply.value.length>1000){
		alert("内容不能超过1000个字符！");
		form.reply.focus();
		return false;
	}
	
	return true;
}
</SCRIPT>

<%
Dim id
id=trim(request("id"))
If IsNumeric(id) = False Then
	GoError "请通过页面上的链接进行操作，不要试图破坏此演示系统。"
End If
sSql="select * from GuestBook where id="&id
oRs.open sSql,oConn,1,3
%>

<%
if request("hiddenField")=1 then
dim sql,BookReply,i

For i = 1 To Request.Form("reply").Count
	BookReply = BookReply & Request.Form("reply")(i)
Next

BookReply=CheckStr(BookReply)
sql="Update GuestBook set reply='"&BookReply&"' Where id="&id
oconn.execute sql
response.write "<p align=center>留言回复成功，3秒后自动返回留言管理页！<script>window.setTimeout(""location.href='guestbook.asp'"",3000);</script></p>"
Response.End
end if
%>


<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#DEDFDE">
  <form action="GuestBook_Reply.asp?action=save&id=<%=request("id")%>" method="post" name="form" id="form" onsubmit=return(CheckInput())><tr bgcolor="#FFFFFF">
    <td colspan="2" bgcolor="#F7F7F7"><div align="center"><strong>管 理 员 回 复</strong></div></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td colspan="2"><table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td>回复 [ <font color="#ff0000"><%=oRs("name")%></font> ] 的留言</td>
          </tr>
            </table></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width="100">回复内容：
      <input name="hiddenField" type="hidden" value="1"></td>
      <td><textarea name="reply" cols="90" rows="10" id="reply" class="input_text"><%=oRs("reply")%></textarea></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="40" colspan="2"><div align="center">
        <input type="submit" name="Submit" value="回复留言" class="input_submit">
　
<input type="reset" name="Submit2" value="清除重写" class="input_submit">
　
<input type="submit" name="Submit3" value="返　　回" class="input_submit">
</div></td>
    </tr>
  </form>
</table>
<%
oRs.Close
%>