<!--#include file="Conn.asp"-->
<!--#include file ="Check_Manager.asp"-->
<%If Request.QueryString("action")="add" Then
If Request.Form("Submit")="确认" Then
Call reply
End if
End if%>
<script language="JavaScript">
<!--
function chk(theForm){
       if (theForm.reply.value == ""){
                alert("留言主题不能为空!");
                theForm.reply.focus();
                return (false);
        }
        if (theForm.title.value == ""){
                alert("回复主题不能为空!");
                theForm.title.focus();
                return (false);
        }
        
        if (theForm.message.value == ""){
                alert("回复内容不能为空!");
                theForm.message.focus();
                return (false);
        } 
}
//-->
</script>
<HTML>
<HEAD>
<TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="admin/admin.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
<BODY>
<SCRIPT>
function change(obj,i) {
he=parseInt(obj.style.height);
if (he>=80&&he<=400)
   obj.style.height=he+i+'px';
else 
   obj.style.height='80px';
}
</SCRIPT>
<%Set rs=Server.CreateObject("Adodb.Recordset")
Sql="Select * From [Book] Where ID="&Cint(Request("id"))
rs.Open Sql,Conn,1,1
%>
<table class=tableBorder cellspacing=0 cellpadding=5 width="700" align=center border=0>
  <form id="form1" name="form1" action="Book_Reply.asp?action=add&id=<%=rs("ID")%>" method="post" onSubmit="return chk(this)">
    <tbody>
      <tr> 
        <th colspan=2 height=25><b>留言回复</b></th>
      </tr>
      <tr> 
        <td align=right width="31%">留言主题&nbsp;</td>
        <td width="69%"><input name=reply id="reply" value=<%=rs("Title")%> size=50 maxlength="60"></td>
      </tr>
      <tr> 
        <td align=right>回复主题&nbsp; </td>
        <td width="69%"><input name="title" type="text" id="title" size="50" maxlength="60"></td>
      </tr>
      <tr> 
        <td align=right width="31%">回复内容&nbsp;</td>
        <td width="69%"><textarea name="message" rows=8 wrap=VIRTUAL cols=50></textarea> 
          <br> &nbsp;
		  <a href="javascript:change(document.all.message,-20)"><img title=缩小文本框 
      src="admin/minus.gif" border=0></a>&nbsp;&nbsp;<a 
      href="javascript:change(document.all.message,20)"><img title=放大文本框 
      src="admin/plus.gif" border=0></a></td>
      </tr>
      <tr align=middle bgcolor=#f7fbff> 
        <td colspan=2 height=30> <div align="center"> 
            <input type=submit value="确认" name=Submit>
            &nbsp;&nbsp; 
            <input type=reset value=重置 name=Submit2>
          </div></td>
      </tr>
  </form>
</table>
<%rs.Close
Conn.Close
%>
</BODY>
</HTML>
<%Sub reply
Set rs=Server.CreateObject("Adodb.Recordset")
Sql="Select * From [Book_Reply] Where (ID IS Null)"
rs.Open Sql,Conn,1,3
rs.AddNew
rs("Book_ID")=Cint(Request("id"))
rs("Book_Tit")=Trim(Request.Form("reply"))
rs("Title")=Trim(Request.Form("title"))
rs("Content")=Trim(Request.Form("message"))
rs.Update
rs.Close
Set rs=Nothing
JaSys("管理员" & session("ManagerUser") & "<font color=red>回复留言ID"&Request("id")&"</font>成功")
Sql = "Update [Book] Set [Reply] = Reply + 1 Where ID="&Cint(Request("id"))
Conn.Execute (Sql)
Response.write "<script language='javascript'>" & chr(13)
		Response.write "alert('回复成功!');" & Chr(13)
		Response.write "window.document.location.href='Book_Manage.asp';"&Chr(13)
		Response.write "</script>" & Chr(13)
Response.End
End Sub
%>