<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<% if session("admid")="" or Session("class")<>"1" then response.redirect"login.asp"%>
<!--#include file="inc.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
}
-->
</style>
<%
  If Request.QueryString("Action")="Del" Then
     Conn.Execute("Delete * from Des where ID="&Cint(request.QueryString("ID")))
	 response.Redirect("?page="&Cint(Request.QueryString("page")))
  End If
  If Request.QueryString("Action")="Check" Then
     Conn.Execute("Update des Set [Check]=1 where ID="&Cint(request.QueryString("ID")))
	 response.Redirect("?page="&Cint(Request.QueryString("page")))
  End If
  If Request.QueryString("Action")="UnCheck" Then
     Conn.Execute("Update des Set [Check]=2 where ID="&Cint(request.QueryString("ID")))
	 response.Redirect("?page="&Cint(Request.QueryString("page")))
  End If    
    If Request.QueryString("Action")="Checked" Then
     Conn.Execute("Update des set [Check]=2")
	 response.Redirect("?")
  End If  
  	 
%>
<body>
<table width="700" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#006d63" style="border-collapse: collapse">
  <tr bgcolor="#FFFFFF">
    <td colspan="3">留言列表</td>
    <td><a href="?Action=Checked">全部审核</a></td>
  </tr>
  <tr align="center" bgcolor="#FFFFFF">
    <td width="355">留言内容</td>
    <td width="102">是否审核</td>
    <td width="138">留言时间</td>
    <td width="60">操作</td>
  </tr>
  <%Dim I
						 I=1
						  Set Rs=Server.CreateObject("Adodb.RecordSet")
                            Sql="Select ID,ucontent,[Check],udate from des Order by uDate desc"
							Rs.Open Sql,Conn,1,1
							If Not Rs.eof Then
							   If Request.QueryString("page")<>"" and IsNumeric(Request.QueryString("page"))=True Then
							      PageCount=Cint(Request.QueryString("page"))
							   Else
							      PageCount=1
							   End If
							   Rs.Pagesize=20
							   rs.AbsolutePage=PageCount
							   Do While Not rs.eof
						 %>
  <tr bgcolor="#FFFFFF">
    <td>&nbsp;<%=Rs(1)%></td>
    <td align="center">&nbsp;<%If Rs(2)="2" Then %><a href="?Action=Check&ID=<%=Rs(0)%>&page=<%=PageCount%>">已审核</a><%Else%><a href="?Action=UnCheck&ID=<%=Rs(0)%>&page=<%=PageCount%>">未审核</a><%End If%>
      |
	    <%
	  Set rst=Conn.Execute("Select ID from replay where replayid="&Rs(0))
	      If Not Rst.eof then
		     Response.Write("已回复")
		  Else
		     Response.Write("未回复")
		  End if
	  Set Rst=Nothing	  	 	 
	%>
	</td>
    <td>&nbsp;<%=Rs(3)%></td>
    <td><a href="liuyan_xiangxi.asp?ID=<%=Rs(0)%>&page=<%=PageCount%>">回复</a>|<a href="#" onClick="javascript:if(confirm('您确定要删除本留言么？')){window.location.href='?Action=Del&ID=<%=Rs(0)%>&page=<%=PageCount%>';}else{return false;}">删除</a></td>
  </tr>
  <%
						  Rs.MoveNext
						  I=i+1
						  if I>Rs.PageSize then exit do
						 Loop%>
  <tr bgcolor="#FFFFFF">
    <td colspan="4" align="center">共<%=Rs.RecordCount%>条留言，显示：<%=PageCount%>/<%=Rs.pagecount%>；
        <%If PageCount>1 Then%>
        <a href="?page=<%=PageCount-1%>">上一页</a>；
        <%End If%>
        <%If PageCount<Rs.pageCount then%>
        <a href="?page=<%=PageCount+1%>">下一页</a>；
        <%End If%>
      转到：
      <select name="District" onChange="var jmpURL=this.options[this.selectedIndex].value ;if(jmpURL!='') {window.location=jmpURL; }else{ this.selectedIndex=0; }">
        <%for i=1 to Rs.PageCount%>
        <option value="?page=<%=I%>" <%If I=PageCount then Response.write("Selected")%>><%=I%></option>
        <%Next%>
    </select></td>
  </tr>
  <%
						  End If
						  Rs.Close
						  Set Rs=nothing
						 %>
</table>
</body>
</html>
