<!--#include file="conn.asp"-->
<!--#include file="checkUser.asp"-->
<%
set rs=server.createobject("adodb.recordset")
if request("action")="delete" then
   sql="delete * from book where id="&request("id")&""
   rs.open sql,conn,1,1
   response.redirect "book.asp"
else
    sql="select * from book order by id desc"
	rs.open sql,conn,1,1
end if
    rs.pagesize=10
%>
<html>
<HEAD>
<TITLE>New Document</TITLE>
<META NAME="Generator" CONTENT="Microsoft FrontPage 4.0">
<script>
  function openurl(id) { window.open("message.asp?id="+id,"","height=420,width=460,left=190,top=10,resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,location=no");} 
</script>
<link rel="stylesheet" href="Images/Admin_style.css">
</head>

<BODY>
	
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#005984" class="unnamed1" >
  <tbody>
    <tr bgcolor="#BFDFFF"> 
      <td height="25" colspan="9" align="middle"> <div align="left"><font color="#FFFFFF" size="1"><strong><font color="#333333">　<font size="2">||
                留言薄管理</font></font></strong></font></div>
      <div align="center"></div></td>
    </tr>
    <tr bgcolor="#E1EFFF">
      <td width="10%" align="center"><font color="#003399" size="2">状态</font></td> 
      <td  height="20" align="middle"><div align="center"><font size="2"><font color="#003399">标题</font></font></div>        </td>
      <td width="15%"  align="middle"><div align="center"><font size="2"><font color="#003399">留言时间</font></font></div></td>
      <td colspan="2"  align="middle"><div align="center"><font color="#003399" size="2">操作</font></div></td>
    </tr>
    <%
	if rs.eof then
	    response.write "<tr><td colspan=8 align=center bgcolor=""#F0F8FF""><font color=red>暂时还没有留言</font></td></tr>"
	else 
   if request("page")="" then
       page=1
    else
       page=cint(request("page"))
    end if
    rs.absolutepage=page
	for j=1 to rs.pagesize

	%>
    <tr>
      <td align="center"  bgcolor="#F0F8FF">
	    <font size="2">
	    <%
	  if rs("click")=0 then
	     a="<font color=red><b>新留言</b></font>"
	  else
	     a="已查看"
	  end if
	    response.write a
	  %>	  
      </font></td> 
      <td height="20" align="center"  bgcolor="#F0F8FF"><font size="2"><a href="javascript:openurl(<%=rs("id")%>)"><%=rs("title")%></a></font></td>
      <td height="25" align="center" bgcolor="#F0F8FF"><font size="2"><%=rs("dateandtime")%></font></td>
      <td width="10%" align="center" bgcolor="#F0F8FF">
        <font size="2"><a href="javascript:openurl(<%=rs("id")%>)">查看</a></font></td>
      <td width="10%" height="25" align="center" bgcolor="#F0F8FF"><font size="2"><a href="?action=delete&id=<%=rs("id")%>">删除</a></font></td>
    </tr>
    <%
rs.movenext
if rs.eof then
exit for
end if
next
end if
%>
    <tr bgcolor="#E1EFFF"> 
      <td height="25" colspan="9" align="middle"><table width="90%" height="20" border="0" align="center" cellpadding="0" cellspacing="0" class="unnamed1">
          <tr> 
            <td><font size="2">共<font color=red><b><%=rs.pagecount%></b></font>页,当前为第<font color=red><b><%=page%></b></font>页&nbsp;&nbsp;&nbsp;&nbsp; 转到：
              <%for i=1 to rs.pagecount%>
              <a href="?page=<%=i%>"><b><%=i%></b></a>&nbsp; 
              <%next%>
              <%if page>1 then%>
              <a href="?page=<%=(page-1)%>">&lt;&lt;&lt上一页&nbsp;</a> 
              <%end if%>
              <%if page<rs.pagecount then%>
              <a href="?page=<%=(page+1)%>">下一页&gt;&gt;&gt;&nbsp;</a> 
              <%end if%>
            </font></td>
          </tr>
      </table></td>
    </tr>
  </tbody>
</table> 
	   
 
</BODY> 
</HTML> 
<%
rs.close
conn.close
set conn=nothing
%>