<!--#include file="conn.asp"-->



<%
Set Rs = Server.CreateObject("ADODB.Recordset")
Sql = "Select * From setting"
Rs.Open Sql,conn,1,3
Rs.Movefirst

backimage=Rs("backimage")               '可选1到14之间的任何数，用来指定留言本背景
websitename=Rs("websitename")        '你的网上昵称
website=Rs("website")                            '你的网站首页地址（如没有请填#）
LogName=Rs("LogName")                      '用于登陆和管理的 用户名称
LogPWD= Rs("LogPWD")                         '用于登陆和管理的 用户密码   
outnum=Rs("outnum")                            '每页的留言数
gbookname=Rs("gbookname")              '留言本名字

Rs.Close %>
<HTML>
<title><%=gbookname%></title>
<HEAD>
<%function code(fString)
    fString = replace(fString, ">", "&gt;")
    fString = replace(fString, "<", "&lt;")

    fString = Replace(fString, CHR(32), "&nbsp;")
    fString = Replace(fString, CHR(9), "&nbsp;")
    fString = Replace(fString, CHR(34), "&quot;")
    fString = Replace(fString, CHR(39), "&#39;")
    fString = Replace(fString," ","&nbsp;")
	
    fString = Replace(fString, CHR(13), "")
	fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
	fString = Replace(fString, CHR(10), "<BR>")
	code = fString
end function


IF Request("POST")<>"" and Session("PROADMIN")=True Then
Call WriteData
End IF

if request("id")="" then
response.redirect "default.asp"
end if

IF Session("PROADMIN")<>True then
Response.Write "<script language='javascript'>alert('非法修改操作!');</script>"
 Response.Write "<font color=red size=18>操作不合法，请返回。</font>" %><BR><a href="JavaScript:history.back()">返回</a>
 <%
response.end
end if

Function WriteData

IF Request("author")="" or Request("content")="" Then
 Response.Write "<font color=red size=18>请将 昵称 和 留言内容 填写完全。谢谢。</font>" %><BR><a href="JavaScript:history.back()">返回</a>
 <%
response.end
ELSE


Set Rs = Server.CreateObject("ADODB.Recordset")
Sql = "Select * From guestbook where id="&request("id")
Rs.Open Sql,conn,1,3

Rs("e-mail")=Request("e-mail")
Rs("address")=Request("address")
Rs("author")=Request("author")
Rs("content")=Request("content")
Rs("date")=Request("date")
Rs("reply")=Request("reply") 
 


Rs.Update
Rs.Close


Set Rs=Nothing
Call CloseDB

response.redirect "default.asp"

END IF
End Function






set rs=server.CreateObject("adodb.recordset")  
Sql = "Select * From guestbook where id="&request("id")
Rs.Open Sql,conn,1,3 %>

<META http-equiv=Content-Type content="text/html; charset=gb2312">


<META content="Microsoft FrontPage 5.0" name=GENERATOR>
<style type="text/css">
<!--
body {
	background-image: url(back/<%=backimage%>.gif);
}
-->
</style>
</HEAD>
<LINK href="style.css" type=text/css rel=stylesheet>
<BODY background=images/bg1.gif topMargin=0>
<TABLE width=770 height=331 border=0 align=center cellPadding=0 cellSpacing=0 
background="" class=3lines>
  <TBODY>
    <TR>
      <TD height=331 align=center valign="middle">
	    <p>&nbsp;</p>
	    <p>&nbsp;</p>
	    <p>&nbsp;</p>
	    <table cellspacing=0 cellpadding=0 width=562 align=center bgcolor=#ffffff border=0>

            <tr>
              <td width=649 align="center" valign=middle><span class="style16"><%=gbookname%></span>			  <table width="100%" height="325" border="0" cellpadding="2" cellspacing="1">
                <form name="form1" method="post" action="">
                  <input type="hidden" name="POST" value="True">
                  <tr bgcolor="#FFFFFF">
                    <td height="18" colspan="2" align="center" class="NO1"><p>欢迎进入 留言修改及回复页面</p></td>
                  </tr>
                  <tr align="right" bgcolor="#FFFFFF">
                    <td height="22" colspan="2" class="NO1"><!--DWLayoutEmptyCell-->&nbsp;</td>
				  </tr>
                  <tr bgcolor="#FFFFFF">
                    <td width="10%" height="22" align="center" class="NO1">昵称</td>
                    <td width="90%" align="left" bgcolor="#eeeeee"><input  name="author" type="text" size="20" value="<%=rs("author")%>">
        </td>
                  </tr>
                  <tr bgcolor="#FFFFFF">
                    <td height="22" align="center" class="NO1">e-mail</td>
                    <td align="left" bgcolor="#eeeeee"><input  name="e-mail" type="text" size="20" value="<%=rs("e-mail")%>"></td>
                  </tr>
				  <tr bgcolor="#FFFFFF">
                    <td height="22" align="center" class="NO1">主页</td>
                    <td align="left" bgcolor="#eeeeee"><input  name="address" type="text" size="20" value="<%=rs("address")%>"></td>
                  </tr>
				  <tr bgcolor="#FFFFFF">
                    <td height="22" align="center" class="NO1">留言时间</td>
                    <td align="left" bgcolor="#eeeeee"><input  name="date" type="text" size="20" value="<%=rs("date")%>">
                    mm/dd/yyyy</td>
                  </tr>
                  <tr bgcolor="#FFFFFF">
                    <td height="67" align="center" class="NO1">留言内容</td>
                    <td align="left" bgcolor="#eeeeee"><textarea name="content" cols="78" rows="4"><%=rs("content")%></textarea>
                    </td>
                  </tr>
				   <tr bgcolor="#FFFFFF">
                    <td height="67" align="center" class="NO1">回复内容</td>
                    <td align="left" bgcolor="#eeeeee"><textarea name="reply" cols="78" rows="4"><%=rs("reply")%></textarea>
                     </td>
                  </tr>
                  <tr bgcolor="#EEEEEE">
                    <td height="24" colspan="2" align="center" class="NO1"><input name="submit"  type="submit"   value="提交修改">
&nbsp;&nbsp;
        <input type="reset" value="重新修改" name="重置"></td>
                  </tr>
                </form>
              </table></td></tr>
        </table>      
    </TR>
  </TBODY>
</TABLE>
<p>&nbsp;</p>
<p>&nbsp;</p>
</BODY>
</HTML>
