<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="checklogin.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>编辑回答</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
ul{margin:0px; padding:0px;}
li{margin:2px; padding:0px;}
-->
</style>
</head>

<body>
<!--#include file="top.asp"-->
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
  <tr>
    <td valign="top">
<%
dim act,rs,id
id=Clng(request.QueryString("id"))
act=request.querystring("act")
if(act="do") then
	dim title,content
	title=request.Form("title")
	content=request.Form("content")
	set rs=server.CreateObject("adodb.recordset")
	rs.open "select * from t_reply where UserId='"&checkusername&"' and id="&id,conn,3,3
	if not rs.eof then
		rs("content")=content
		rs.update
		rs.close
		set rs=nothing
	else
		rs.close
		set rs=nothing
		call alertstr("没有找到!",1)
	end if	
	response.Write("<p align=""center"">成功修改!<br><a href=""javascript:history.go(-2)"">返回</a></p>")
else
	set rs=server.CreateObject("adodb.recordset")
	rs.open "select * from t_reply where UserId='"&checkusername&"' and id="&id,conn,3,3
	if not rs.eof then
%>

	  <form id="form1" name="form1" method="post" action="?act=do&id=<%=id%>">
	    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
          <tr>
            <td height="28" colspan="2" class="th_title">编辑回答</td>
          </tr>
          <tr>
            <td width="34%" class="td_row"><div align="right">内容：</div></td>
            <td width="66%" class="td_row"><textarea name="content" id="content" cols="45" rows="5"><%=rs("content")%></textarea></td>
          </tr>
          <tr>
            <td><div align="center"></div></td>
            <td height="32"><input type="submit" name="Submit" value="确定" />
              &nbsp;&nbsp;
              <input type="reset" name="Submit2" value="取消" /></td>
          </tr>
        </table>
      </form>    
		<%
		end if
		rs.close
		set rs=nothing
end if
%></td>
  </tr>
</table>
</body>
</html>
<%
call connclose()
%>