<%if session("user")<>"" and session("pwd")<>"" then%>
<!--#include file="conn.asp"--> 
<% 
set rs=server.createobject("adodb.recordset") 
sql="select * from book where id="&request("ID") 
rs.open sql,conn,1,1 
if rs("user")="" or session("user")<>rs("user") then 
   response.write("<script>alert('用户名不对 或 这条留言不属于你的');history.go(-1)</script>") 
end if 
 
u=rs("user") 
set rsadm=server.createobject("adodb.recordset") 
sqladm="select * from user where username='"&u&"'" 
rsadm.open sqladm,conn,1,1 
if not rsadm.eof then 
 if session("pwd")=rsadm("password") then 
  
if request("kind")="edit" then 
set rsedit=server.createobject("adodb.recordset") 
sqledit="select * from book where id="&request("ID")  
rsedit.open sqledit,conn,1,3 
rsedit("rely")=request.form("re") 
rsedit("retime")=now()
rsedit.update 
rsedit.close    
set rsedit=nothing  
response.redirect "guestbook.asp?user="&session("user")&"" 
end if
if request("kind")="del" then
set rsdel=server.createobject("adodb.recordset") 
sqldel="select * from book where id="&request("ID") 
sqldel="delete from book where id="&request("ID")
sql="update user set count=count-1 where username='" & session("user") & "'"
conn.execute (sql)
rsdel.open sqldel,conn,1,1
rsdel.close    
set rsdel=nothing
response.redirect "guestbook.asp?user="&session("user")&""    
end if
%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>:: 回复留言::---k666软件园 收集 http://www.vv66.net</title>
<%user=session("user")
  set rs1=server.createobject("adodb.recordset")
sql="select * from user where username='" & user &"'"
rs1.Open SQL,conn,1,2
if rs1.BOF or rs1.EOF then
kind=5
else
kind=rs1("kind")
webname=rs1("web")
end if
set rs1=nothing
rs1.close
%>
<link rel="stylesheet" type="text/css" href="style/<%=kind%>.css">
<base target="_blank">
</head>

<body topmargin="2"> 

<div align="center"> 
  <center>
    <table width="600" align="center" cellspacing="0" cellpadding="1"  border="0" bgcolor=#000000>
      <tr> 
        <td> 
          <table width="600" cellspacing="0" cellpadding="4" border="0" class="table002">
            <tr> 
              <td class="jnfont7" valign="middle" align=left> <b>>> </b> 
                <a href="<%=web%>"><acronym title="返回主页">主页</acronym></a> | <a href="modify.asp?user=<%=user%>"><acronym title="编辑你的个人资料">修改资料</acronym></a> 
                | <%if  adminok="ok" then%><a href="usermanager.asp?user=<%=user%>&exit=ok"><acronym title="退出管理">退出管理</acronym></a><%else%><a href="usermanager.asp?user=<%=user%>"><acronym title="回复或删除留言">留言管理</acronym></a><%end if%> 
                | <a href="default.asp"><acronym title="免费申请留言本">免费申请</acronym></a> 
                | <a href="top.asp"><acronym title="留言排行榜">留言排行</acronym></a> 
              </td>
              <td class="jnfont7" valign="middle" align=right><b><%=webname%></b></td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
    <p>&nbsp;</p>
    <table border="0" width="600" bgcolor="#000000" cellspacing="1" cellpadding="3">
      <tr class="table001"> 
      <td width="100%"> 
        <table border="0" width="100%" cellspacing="0" cellpadding="0"> 
        <form method="POST" action="manage.asp?id=<%=request("ID")%>&kind=edit" target="_self"> 
          <tr> 
            <td width="7%" valign="top">回复:</td> 
            <td width="93%"><textarea cols="69" name="re" rows="5" class="testarea1""><%=rs("rely")%></textarea></td> 
          </tr> 
          <tr> 
            <td width="100%" colspan="2"> 
              <p align="center"><input type="submit" value="提交" class="input1">&nbsp;&nbsp;&nbsp;                                                                
              <input type="reset" value="复原" class="input1"></td>                                                                   
          </tr>                                                                 
         </form>                                                                   
        </table>                                                                   
      </td>                                                                   
    </tr>                                                                   
  </table>                                                                   
  </center>                                                                   
</div>                                                                   
 
<table width="600" cellspacing="1" cellpadding="3" bgcolor="#000000" align="center">
  <tr > 
    <td width="20%" rowspan="2" valign="top" class="table001"> 
      <div align="center">作者 </div>
      <center>
       <br><table class="jnfont6" ><%=rs("name")%></table>
      </center>
      <br>
    </td>
    <td rowspan="2" valign=top height="94" class="table002"> <%=rs("ly")%> 
      <div align="right"></div>
    </td>
  </tr>
  <tr bgcolor="#ffffff"> </tr>
</table>                            
                                                                          
<table border="0" width="560" cellpadding="0" align="center">
  <tr> 
    <td width="100%"> 
      <hr size="1" width="80%">
    </td>
  </tr>
  <tr> 
    <td width="100%" class="jnfont6"> 
          <p align="center">
            <a href=http://www.5151.cn target=_blank>免费留言本由[中泰科技]提供</a>
        </td>
      </tr>
    </table>     
<p>&nbsp;</p>
</body>                                                     
</html>                                                     
<%else    
   response.write("<script>alert('密码不对哦！');history.go(-1)</script>")    
end if   
end if   
rs.close    
set rs=nothing    
rsadm.close    
set rsadm=nothing      
conn.close    
set conn=nothing   
end if%>                                                   


