<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<% if session("admid")="" or Session("class")<>"1" then response.redirect"login.asp"%>
<!--#include file="inc.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
}
-->
</style>
</head>
<%
 if request.QueryString("Action")="ADD" Then
     If request.Form("Replay")="True" Then
	   conn.Execute("Update Replay set replayContent='"&request.Form("Content")&"' where replayid="&Request.QueryString("ID"))
	  Elseif Request.Form("Replay")="false" Then
	    Conn.Execute("Insert into Replay (replaycontent,replaydate,replayid) values('"&Request.Form("content")&"','"&Now()&"',"&request.QueryString("ID")&")")
	  End if
	 Response.Write("<script language=javascript>alert('留言回复成功,现在返回!');window.location.href='liuyan_List.asp?page="&Request.Form("page")&";'</script>")
	 Response.End()
end if	 	
%>
<% Dim Content,Replay
  Set Rs=Conn.Execute("Select ucontent from des where id="&Request.QueryString("ID"))
      If Not Rs.eof then
	    Set Rst=Conn.Execute("Select * from replay where Replayid="&Cint(request.QueryString("ID")))
		    If Not Rst.eof then
			  Content=Rst(2)
			  Replay="True"
			 Else
			  Replay="false"
			 End if
		Set Rst=Nothing	  
%>
<body>
<table width="700" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#006d63" style="border-collapse: collapse">
  <tr bgcolor="#FFFFFF">
    <td colspan="2">留言内容回复</td>
  </tr>
  <form action="?Action=ADD&ID=<%=Request.QueryString("ID")%>" name="myform" method="post">
  <tr bgcolor="#FFFFFF">
    <td colspan="2">&nbsp;<%=Rs(0)%></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td width="137">回复内容</td>
    <td width="540"><textarea name="Content" cols="60" rows="7" id="Content"><%=Content%></textarea></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td colspan="2"><input type="submit" name="Submit" value=" 提交回复的留言 "><input type="hidden" value="<%=Replay%>" name="Replay"><input type="hidden" value="<%=Request.QueryString("page")%>" name="page"></td>
  </tr>
  </form>
</table>
</body>
</html>
<%
  end if
  Rs.Close
  Set Rs=Nothing
  conn.Close
  Set Conn=Nothing
%>
