<%@ codepage ="936" %>
<% 
	data_path="../../" 'ACC连接数据库路径，对SQL无效
	numid="02"
	dir="../err.asp" 
  %>
 <!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
 <!--#include file="../rolecheck.asp"-->

<%
  id=Replace_Text(request("id"))
 %>

<link rel="stylesheet" type="text/css" href="../css/style.css">
<title>回复留言</title><table width="98%" border="0" cellpadding="0" cellspacing="0" class="tableBorder">
<tr>
<th height="20" class="tableHeaderText" align="center"> 
<strong>
<font color="#FFffff">回 复 留 言</font></strong></td>
</th>
<tr> 
<Form language=javascript name="Gbhf" method="POST" action="hfbook.asp?id=<%=id%>&up=add" onsubmit="return Gbhf_onsubmit()">
<td height="56" valign="top">
<div align="center">
<center>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bordercolor="#111111" bordercolorlight="#E8F4FF" bordercolordark="#E8F4FF" bgcolor="F4F4F4" style="border-collapse: collapse">

<tr> 
<td width="524" align="center" bgcolor="#FBFDFF">
<textarea name="G_Content" cols="72" rows="13" id="G_Content"><%
set rshf=server.CreateObject("adodb.recordset")
sqlhf="select * from Websen_GuestBook where id="&id
rshf.open sqlhf,conn,1,1
if not rshf.eof then
%><%=rshf("reContent")%>
<%set rshf=nothing
end if
 %></textarea></tr>
<tr align="center"> 
<td height="30" colspan="2" class=forumRowHighlight> <input type="submit" name="Submit" value="确 定 回 复">
</td>
</tr>
</table></center>
</div>
</td>
</Form>
</tr>
</table>
</center>
</div>
<SCRIPT language=javascript>
<!--
function Gbhf_onsubmit() 
{
if(trim(document.Gbhf.G_Content.value)=="")
{
alert("回复不能为空！");
document.Gbhf.G_Content.focus();
return false;
}
}
//-->
//-->
function trim(inputString) {
	   
              if (typeof inputString != "string") { return inputString; }
              var retValue = inputString;
              var ch = retValue.substring(0, 1);
              while (ch == " ") { 
	          //检查字符串开始部分的空格
                  retValue = retValue.substring(1, retValue.length);
                  ch = retValue.substring(0, 1);
              }
              ch = retValue.substring(retValue.length-1, retValue.length);
              while (ch == " ") {
                 //检查字符串结束部分的空格
                 retValue = retValue.substring(0, retValue.length-1);
                 ch = retValue.substring(retValue.length-1, retValue.length);
              }
              while (retValue.indexOf("  ") != -1) { 
	         //将文字中间多个相连的空格变为一个空格
                 retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
              }
              return retValue;
           } 

//--> 
</SCRIPT>
<% 
if request("up")="add" then
Gcontent=request.form("G_Content")
set rs=server.createobject("adodb.recordset")
sql="select * from Websen_GuestBook where id="&id&""
rs.open sql,conn,1,3
rs("reContent")=server.htmlencode(Gcontent)
rs("retime")=now()
rs.update
rs.close
 conn.close
   response.write"<SCRIPT language=JavaScript>alert('回复留言成功！');window.close();</script>"
   response.end
End if
conn.execute("update Websen_GuestBook set hf=1 where id="&request("id")&"")
%>
<iframe src="../../manage/makehtml/feedback/makelist.asp?all=all" width="0" height="0"></iframe>
<script>
function window.onbeforeunload(){
window.opener.location.reload()
}
</script>
<br>
