<!--#include file="dbpath/dbpath.asp"-->
<%response.expires=0
if request.cookies("loginok")="" then
  response.redirect "login.asp"
end if

%>
<html><head>
<title>3鸟设社∨留言本</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript1.2">
<!--
function confirm_delete(){
	if (confirm("你确定真的要这么做吗？")){
		return true;
	}
	return false;
}
//-->
</script>
<%
   dim MaxPerPage
   dim sql 
   dim rs
   dim gstBookID
   dim totalPut   
   dim CurrentPage
   dim TotalPages
   dim i,j
   if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
   end if
%>
<link rel="stylesheet" type="text/css" href="css/style.css">
<script language="JavaScript">
<!--
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->

function MM_popupMsg(msg) { //v1.0
  alert(msg);
}
//-->
</script>
</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"></script> 
<table width="450" border="0" cellspacing="0" cellpadding="0" align="center"> 
<tr> <td width="500" ><span > </span> <table width="560" border="0" cellspacing="0" cellpadding="0" align="center" height="16" > 
<tr > <td width="401" class="font3"> <div class="efont"> <div align="left"><a href="../index.htm"><img src="IMAGES/head.gif" alt="·点击回到大门口·" width="270" height="97" border="0"></a></div></div></td><td width="80" valign="bottom" class="font3"  ><font color="#0000FF"><b><font color="#FF6600"><a href="guestbook.asp"><img src="IMAGES/ly.gif" width="79" height="19" border="0"></a></font></b></font></td><td width="79" valign="bottom" class="font3"  > 
<div align="center"><font color="#0000FF"><b><font color="#FF6600"><a href="guest.asp"><img src="IMAGES/ck.gif" width="79" height="19" border="0"></a></font></b></font></div></td></tr> 
</table><span > <% 
set rs=server.createobject("adodb.recordset") 
sql="select * from book order by id desc" 
rs.open sql,conn,1,1 
if rs.eof and rs.bof then %> </span> <div align="center" ><font color="#0099CC">还 
没 有 任 何 留 言</font> <% else 
   rs.pagesize=8 
   totalPut=rs.recordcount '记录总数 
   totalPage=rs.pagecount 
   MaxPerPage=rs.pagesize 
      if currentpage<1 then 
          currentpage=1 
      end if 
      if currentpage>totalPage then 
          currentpage=totalPage 
      end if 
   if currentPage=1 then 
      showpages 
      showContent 
      showpages 
    else 
         if (currentPage-1)*MaxPerPage<totalPut then 
         rs.move  (currentPage-1)*MaxPerPage 
         dim bookmark 
         bookmark=rs.bookmark '移动到开始显示的记录位置 
         showpages 
         showContent 
         showpages 
       end if 
   end if 
      rs.close 
end if 
set rs=nothing   
conn.close 
set conn=nothing     
 
sub showContent 
    dim i 
    dim k 
    k=(totalPut-MaxPerPage*(currentPage-1))+1 
    i=0 
%> <% 
       do while not (rs.eof or err) 
         k=k-1 
%> <table width="560" border="0" cellspacing="0" cellpadding="0"  align="center"> 
<tr> <td class="border2"> <table width="560" border="0" cellspacing="0" cellpadding="0" align="center"> 
<tr > <td width="120" align="center" class="font3"><font class="EFONT" color="#33CCFF">No.</font><font class="EFONT" color="#CCCCCC"><%=k%></font></td><td rowspan="3"  width="32" class="font" ><img 
    src="<%=rs("txthead")%>" > </td><td width="408" class="font"><div align="right"><font class="EFONT"><font color="#FF0000" class="titel"><span class="titel"><font color="#0099CC" size="1">Time</font></span></font><font color="#0099CC" size="1"><span class="titel">&nbsp;： 
<% =rs("time") %> </span></font></font></div></td></tr> <tr > <td width="120" align="center" class="font3" height="17"><img 
    src="<%=rs("face")%>"></td><td class="font"><%=rs("Memo")%></td></tr> <tr> 
<td width="120" align="center" height="15" class="font"><%=rs("name")%></td><td class="font">&nbsp;</td></tr> 
</table></td></tr> <tr> <td> <table width="560" border="0" cellspacing="0" cellpadding="0" align="center" > 
<tr > <td width="109" valign="bottom" class="titel"> <div align="right"></div><div align="right"></div></td><td width="50" class="titel" > 
<div align="center" class="EFONT"><a title="主页:[ <%=rs("homepage")%> ]" href="<%=rs("homepage")%>" target="_blank"><font size="1">Homepage</font></a></div></td><td width="50" class="titel" > 
<div align="center" class="EFONT"><a  title="E-mail:[ <%=rs("email")%> ]" href="mailto:<%=rs("email")%>"><font size="1">Email</font></a></div></td><td width="50" class="titel" > 
<div align="center" class="EFONT" ><a title="QQ号码:[ <%=rs("oicq")%> ]" href="javascript:;" onClick="MM_popupMsg('QQ号码：[ <%=rs("oicq")%> ]')"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Oicq</font></a></div></td><td width="50" align="right" valign="bottom" class="font" > 
<div align="center" class="EFONT"> <%Response.Write "<A HREF=reply.asp?userid=" & cstr(rs("id")) & "&cpage=" & cstr(currentpage) & ">Reply</A>" %> 
</div></td><td width="50" align="right" valign="bottom" class="font" > <div align="center" class="EFONT" onClick="return confirm_delete()"> 
<%Response.Write "<A HREF=delelist.asp?userid=" & cstr(rs("id")) & "&cpage=" & cstr(currentpage) & " >Delete</A>"%> 
</div></td></tr> </table><table width="560" border="0" cellspacing="0" cellpadding="0" align="center" > 
<%  
      if rs("anser")<>"" then%> <tr valign="middle"> <td align="center" width="120" class="font1" ><font color="#0099CC">回 
复:</font></td><td width="31" >&nbsp;</td><td width="409" class="font1"><%=rs("anser")%></td></tr> 
<%end if%> </table></td></tr> </table><%  
    i=i+1  
    if i>=MaxPerPage then exit do '循环时如果到尾部则先退出，如果记录达到页最大显示数，也退出  
       rs.movenext  
    loop  
   end sub   
  
sub showpages()  
dim n  
n=totalPage  
%> <table border="0" width="560" cellspacing="0" cellpadding="0"  align="center"  class="border2" > 
<tr bgcolor="#33CCFF" class="EFONT" > <td width="60" valign="bottom" bgcolor="#cccccc"> 
<div align="center"><font color="#333333"><span class="EFONT"><font size="2">Pages:</font></span></font></div></td><td valign="bottom" bgcolor="#cccccc"><span class="EFONT"><font color="#333333" size="2" class="EFONT"> 
<%   
   If currentPage <> 1 Then       
      Response.Write "[<A HREF=manage.asp?Page=" & (currentPage-1) & "><font face='宋体' size='1'><<</font></A>] "  
   End If  
%> <%
 if rs.pagecount <= 8 then
for i=1 to rs.pagecount
response.write "[<a href='manage.asp?page="&i&"'>"&i&"</a>]"
next
else
for i=1 to 8
response.write "[<a href='manage.asp?page="&i&"'>"&i&"</a>]"
next

end if
%> <font size="1"> <%
   If currentPage <> rs.PageCount Then  
      Response.Write "[<A HREF=manage.asp?Page=" & (currentPage+1) & "><font face='宋体' size='1'>>></font></A>] "   
   End If  
%> &nbsp;&nbsp;&nbsp;</font></font></span><font color="#333333" size="2" class="EFONT"><font size="1">Total 
Pages: &lt;<A HREF=manage.asp?Page=<%=totalPage%>><%=totalPage%></A>&gt;</font></font></td></table></div><%  
end sub  
%> <table width="560" border="0" cellspacing="0" cellpadding="0"  align="center" class="border2" height="25"> 
<tr valign="bottom" > <td class="font2"> <div align="center" class="EFONT" ><font color="#0099CC" size="2"><a href="http://www.3niao.com">http://www.3niao.com</a></font></div></td></tr> 
</table></td></tr> </table><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
</body>  
</html>




