<!--#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 [feedback] where id="&cstr(id)
rs.open sql,conn,1,3
response.write "<li>删除成功！"
response.redirect "admin_message.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">
<body topmargin="0" leftmargin="0">

<div align="center">
<table width="98%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#c5cfe0" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
    <tr align="center" bgcolor="#FFFFFF" height="20"> 
<td align="center" height="29"  class="tdbar">
<table width="100%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#c5cfe0" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
        <tr align="center" bgcolor="#FFFFFF" height="20"> 
<td align="center" height="29"  class="tdbar" colspan="5" class="tdbar"> 
    <p align="center"><b>留言反馈信息管理</b></td>
  </tr>
  <tr>
    <td width="88%" height="23" colspan="5" bgcolor="#EFF7FF"> 
	<p align="center"> <b> <a href="?jle=3">
    【查看所有留言】</a> <a href="?jle=1">【查看投诉留言】</a>
    <a href="?jle=2">【查看普通留言】</a> <a href="?jle=4">
    【尚未回复的留言】</a></b></td>
  </tr>
<%
dim k,jle
jle=trim(request("jle"))
set rs=server.createobject("adodb.recordset")
Select Case jle
Case "1"
sql = "select * from feedback where lx=1 order by id desc"
Case "2"
sql = "select * from feedback where lx=0 order by id desc"
Case "4"
sql = "select * from feedback where hf=0 order by id desc"
Case Else
sql = "select * from feedback 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"  align="center" class="tdbar1">编号</td>
    <td bgcolor="#FEEEBC" align="center" class="tdbar1">内容</td>
    <td align="center" bgcolor="#FEEEBC" class="tdbar1">　</td>
    <td align="center" bgcolor="#FEEEBC" class="tdbar1">　</td>
    <td align="center" bgcolor="#FEEEBC" class="tdbar1">是否回复</td>
  </tr>
  <%
  do while not rs.eof
  %>
  <tr>
    <td width="4%" height="23" class="tdbar1">
    <p align="center"><%=k+1%></td>
    <td width="69%" height="23" class="tdbar1" ><%=rs("gbook1")%>&nbsp;[<font color="#999999"><%=rs("username")%></font>&nbsp;<font color="#999999"><%=rs("fbsj")%></font>]</td>
    <td width="6%" height="23" align="center" class="tdbar1"><a href="#" ONCLICK="window.open('admin_message_edit.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"  class="tdbar1"><a href="?del=ok&id=<%=rs("id")%>">
    <font color="#FF0000">删除</font></a></td>
    <td width="13%" height="23" align="center" class="tdbar1" ><%if rs("hf")=1 then%><span id="followImg<%=k%>" style="CURSOR: hand" onClick="loadThreadFollow(<%=k%>,5)">查看回复</span><%else%> <a href="#" ONCLICK="window.open('admin_message_reply.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('admin_message_reply.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></td></tr></table><br>
<table width="98%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#c5cfe0" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
    <tr align="center" bgcolor="#FFFFFF" height="20"> 
<td align="center" height="29"  class="tdbar">
共有&nbsp;<font color="#CC5200"><%=Allrecord%></font>&nbsp;条记录</td>
<td width="181" align="center"  class="tdbar">
共 <font color="#CC5200"><%=Allpage%></font> 页</td>
<td width="237" align="center"  class="tdbar">
现在是第 
      <font color="#CC5200"><%=ThisPage%></font> 页</td>
<td width="198" align="center"  class="tdbar">
<%
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%>