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

<%
dim sql,rs,Allrecord,Pagesize,Allpage,ThisPage,id
if request("page")="" then
ThisPage=1		
else
ThisPage=request("page")
end if
if request("del")="ok" then
id=trim(request("id"))
if not isnumeric(id) or id="" then
response.write "<li>参数错误！"
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="delete from [gbook] where id="&cstr(id)
rs.open sql,conn,1,3
response.write "<li>删除成功！"
response.redirect "gbook.asp"
else%>
<script>
function loadThreadFollow(t_id,b_id){
	var targetImg =eval("document.all.followImg" + t_id);
	var targetDiv =eval("document.all.follow" + t_id);
	
	if ("object"==typeof(targetImg)){
		if (targetDiv.style.display!='block'){
			targetDiv.style.display="block";
			
		}else{
			targetDiv.style.display="none";
		}
	}
}
</script>
<meta http-equiv="Content-Language" content="zh-cn">
<link href="inc_style.css" rel="stylesheet" type="text/css">
<p align="center">
<img src="img/list_bo.gif"></p>
<div align="center">
<table border="1" cellspacing="0" style="border-collapse: collapse" bordercolor="#CCCCCC" width="76%" cellpadding="0">
  <tr>
    <td width="88%" height="25" colspan="5" bgcolor="#FEEEBC"> 
    <p align="center"><b>留言反馈信息管理</b></td>
  </tr>
  <tr>
    <td width="88%" height="23" colspan="5"> <b> <a href="?cnmai=3">
    列出所有留言</a> <a href="?cnmai=1">列出投诉留言</a>
    <a href="?cnmai=2">列出普通留言</a> <a href="?cnmai=4">
    没有回复的留言</a></b></td>
  </tr>
<%
dim k,cnmai
cnmai=trim(request("cnmai"))
set rs=server.createobject("adodb.recordset")
Select Case cnmai
Case "1"
sql = "select * from gbook where lx=1 order by id desc"
Case "2"
sql = "select * from gbook where lx=0 order by id desc"
Case "4"
sql = "select * from gbook where hf=0 order by id desc"
Case Else
sql = "select * from gbook order by id desc"
End Select
rs.open sql,conn,1,1
if rs.eof then
response.write "还没有留言内容！"
response.end
end if
rs.Pagesize=10
Pagesize=rs.Pagesize
Allrecord=rs.Recordcount
Allpage=rs.Pagecount
if ThisPage<1 then                           
ThisPage=1
end if
On Error Resume Next
rs.move (ThisPage-1)*Pagesize
k=0
%>
  <tr>
    <td height="25" bgcolor="#FEEEBC" align="center">编号</td>
    <td bgcolor="#FEEEBC" align="center">内容</td>
    <td align="center" bgcolor="#FEEEBC">　</td>
    <td align="center" bgcolor="#FEEEBC">　</td>
    <td align="center" bgcolor="#FEEEBC">是否回复</td>
  </tr>
  <%
  do while not rs.eof
  %>
  <tr>
    <td width="4%" height="23" bgcolor="#FFF9EE">
    <p align="center"><%=k+1%></td>
    <td width="69%" height="23" bgcolor="#FFF9EE"><%=rs("gbook1")%><br>〈<font color="#999999"><%=rs("username")%></font>&nbsp;<font color="#999999"><%=rs("fbsj")%></font>〉</td>
    <td width="6%" height="23" align="center" bgcolor="#FFF9EE"><a href="#" ONCLICK="window.open('gbookedit.asp?id=<%=rs("id")%>&chk=2','Sample','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=300,height=150,left=300,top=100')">
    <font color="#FF0000">修改</font></a></td>
    <td width="6%" height="23" align="center" bgcolor="#FFF9EE"><a href="gbook.asp?del=ok&id=<%=rs("id")%>">
    <font color="#FF0000">删除</font></a></td>
    <td width="13%" height="23" align="center" bgcolor="#FFF9EE"><%if rs("hf")=1 then%><span id="followImg<%=k%>" style="CURSOR: hand" onclick="loadThreadFollow(<%=k%>,5)">查看回复</span><%else%><a href="#" ONCLICK="window.open('gbookhf.asp?id=<%=rs("id")%>','Sample','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=200,height=150,left=300,top=100')"><font color="#FF0000">回复留言</font></a><%end if%></td>
  </tr>
  <tr style="display:none" id="follow<%=k%>">
    <td width="88%" height="23" colspan="5">
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
      <tr>
        <td width="4%">　</td>
        <td width="76%"><font color="#FF6600"><%=rs("gbook2")%></font> 〈<%=rs("hfsj")%>〉[<a href="#" ONCLICK="window.open('gbookhf.asp?id=<%=rs("id")%>&chk=2','Sample','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=200,height=150,left=300,top=100')">修改</a>]</td>
        <td width="4%">　</td>
        <td width="16%">　</td>
      </tr>
    </table>
    </td>
  </tr>
   <%
   rs.movenext
   k=k+1
   if k>=Pagesize then exit do
   loop
   rs.close
   set rs=nothing
   closedb
   %>
</table>
<table border="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111" width="76%" height="20">
<tr> 
<td height="20" width="151" align="center" bgcolor="#FEEEBC">
共有&nbsp;<font color="#CC5200"><%=Allrecord%></font>&nbsp;条记录</td>
<td width="181" align="center" bgcolor="#FEEEBC">
共 <font color="#CC5200"><%=Allpage%></font> 页</td>
<td width="237" align="center" bgcolor="#FEEEBC">
现在是第 
                <font color="#CC5200"><%=ThisPage%></font> 页</td>
<td width="198" align="center" bgcolor="#FEEEBC">
<%
if ThisPage<2 then     
response.write "<font color=""#808080"">首页</font>&nbsp;"
response.write "<font color=""#808080"">上一页</font>&nbsp;"     
else     
response.write "<a href=?page=1>首页</a>&nbsp;"
response.write "<a href=?page="&ThisPage-1&">上一页</a>&nbsp;"     
end if
if Allpage-ThisPage<1 then     
response.write "<font color=""#808080"">下一页</font>&nbsp;"
response.write "<font color=""#808080"">尾页</font>&nbsp;"  
else     
response.write "<a href=?page="&(ThisPage+1)&">下一页</a>&nbsp;"   
response.write "<a href=?page="&Allpage&">尾页</a>&nbsp;"     
end if
%></td></tr></table></center>
</div>
<%end if%>