<!--#include file="../Include/conig.asp"-->
<!--#include file="../Include/Inc_Page.asp"-->
<!--#include file="Admin_check.asp"-->
<%
response.expires = 0 
response.expiresabsolute = now() - 1 
response.addHeader "pragma","no-cache" 
response.addHeader "cache-control","private" 
Response.cachecontrol = "no-cache"
if Instr(session("AdminPurview"),"|122,")=0 then 
  response.write ("<font color='red')>你不具有该管理模块的操作权限，请返回！</font>")
  response.end
end if
'========判断是否具有管理权限 
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>点评管理</title>
<LINK href="images/Admin_css.css" type=text/css rel=stylesheet>
<script src="Images/admin.js"></script>
</head>
<body>
<table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#6298E1">
<form name="form1" method="get" action="">
  <tr>
    <td height="25" nowrap background="images/th_bg.gif"><font color="#FFFFFF">&nbsp;<strong>评论查看</strong></font></td>
  </tr>
  <tr>
    <td height="24" nowrap  bgcolor="#EBF2F9"><b>快速查找：</b>        <SELECT onChange="javascript:window.open(this.options[this.selectedIndex].value,'mainFrame')"  size="1" name="s">
        <OPTION value="" selected>-=请选择=-</OPTION>
        <OPTION value="?sh=all">所有评论</OPTION>
        <OPTION value="?sh=1">已审的评论</OPTION>
        <OPTION value="?sh=0">未审的评论</OPTION>
      </SELECT>&nbsp;关健字：<input name="keyword" type="text" class="textfield" id="keyword" value="<%=request("keyword")%>">
      <input name="Submit2" type="submit" class="button" value="搜索"></td>
  </tr>
  </form>
</table>
<br>
<%
dim page,s,id,keyword,cli
	page=request("page")
	s=Request("s")
	id=request("id")
	keyword=request("keyword")
	cli=int(Request.QueryString("cli"))
	if request("action") = "add" then 
		call add()
	elseif request("action")="edit" then
		call edit()
	elseif request("action")="del" then
		call del()
	elseif request("action")="delAll" then
		call delAll()
	else
		call List()
	end if
sub List()
%>

<table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#6298E1">
<form name="myform" method="POST" action="?action=delAll&cli=<%=cli%>">
<tr> 
  <td height="25" colspan="6" align=left background="images/th_bg.gif" class="admintitle">评论列表</td>
</tr>
    <tr bgcolor="#f1f3f5" style="font-weight:bold;">
    <td width="5%" height="25" align="center" bgcolor="#EBF2F9" class="ButtonList">&nbsp;</td>
    <td width="47%" align="center" bgcolor="#EBF2F9" class="ButtonList">评论内容</td>
    <td width="17%" align="center" bgcolor="#EBF2F9" class="ButtonList">发布人</td>
    <td width="16%" height="25" align="center" bgcolor="#EBF2F9" class="ButtonList">发布时间</td>
    <td width="15%" height="25" align="center" bgcolor="#EBF2F9" class="ButtonList">管理</td>    
    </tr>
<%
Set mypage=new xdownpage
mypage.getconn=conn
mysql="select * from Web_rui_v_Pl Where cli="&cli&" "
	if id<>"" then
	mysql=mysql&" and Ioid="&id&""
	elseif s="0" then
	mysql=mysql&" and ViewFlag=0"
	elseif s="1" then
	mysql=mysql&" and ViewFlag=1"
	elseif keyword<>"" then
	mysql=mysql&" and Content like '%"&keyword&"%'"
	End if
mysql=mysql&" order by id desc"
mypage.getsql=mysql
mypage.pagesize=10
set rs=mypage.getrs()
for i=1 to mypage.pagesize
    if not rs.eof then 
%>
    <tr>
    <td height="25" align="center" bgcolor="#EBF2F9"><input type="checkbox" value="<%=rs("ID")%>" name="ID" onClick="unselectall(this.form)" style="border:0;"></td>
    <td height="25" bgcolor="#EBF2F9"><%=left(GlHtml(rs("Content")),30)%>...</td>
    <td height="25" align="center" bgcolor="#EBF2F9"><%=rs("Author")%></td>
    <td height="25" align="center" bgcolor="#EBF2F9"><span class="td"><%=rs("PostTime")%></span></td>
    <td align="center" bgcolor="#EBF2F9"><%if rs("ViewFlag")=0 then Response.Write("<font color=red>未审</font>") else Response.Write("已审") end if%>|<a href="?action=edit&id=<%=rs("ID")%>">详细</a>|<a href="?action=del&id=<%=rs("ID")%>">删除</a></td>
    </tr>
<%
rs.movenext
    else
         exit for
    end if
next
%>
<tr><td height="25" align="center" bgcolor="#EBF2F9"><input name="Action" type="hidden"  value="Del"><input name="chkAll" type="checkbox" id="chkAll" onClick=CheckAll(this.form) value="checkbox" style="border:0"></td>
  <td colspan="5" align="right" bgcolor="#EBF2F9"><input name="Del" type="submit" class="button" id="Del" value="删除评论">
    <input name="Del" type="submit" class="button" id="Del" value="取消审核">
    <input name="Del" type="submit" class="button" id="Del" value="通过审核"></td>
  </tr><tr><td bgcolor="#EBF2F9" colspan="6">
<div class="LPageBar">
<%=mypage.showpage()%>
</div>
</td>
</tr>
</form>
</table>

<%
rs.close
end sub
sub edit()
id=request("id")
set rs = server.CreateObject ("adodb.recordset")
sql="select * from Web_rui_v_Pl where id="& id &""
rs.open sql,conn,1,1
%>
<table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#6298E1">
<tr> 
    <td colspan=2 height="25"  background="images/th_bg.gif" class="admintitle">详细评论</td>
</tr>
<tr>
  <td height="25" align="right" bgcolor="#EBF2F9">评论人：</td>
  <td bgcolor="#EBF2F9" class=td><%=rs("Author")%></td>
</tr>
<tr>
  <td height="25" align="right" bgcolor="#EBF2F9">网友IP：</td>
  <td bgcolor="#EBF2F9" class=td><%=rs("IP")%></td>
</tr>
<tr>
  <td height="25" align="right" bgcolor="#EBF2F9">评论时间：</td>
  <td bgcolor="#EBF2F9" class=td><%=rs("PostTime")%></td>
</tr>
<tr>
  <td width="10%" height="50" align="right" bgcolor="#EBF2F9">内容：</td>
  <td bgcolor="#EBF2F9" class=td><%=rs("Content")%></td>
</tr>
</table>
<%
end sub
Sub delAll
ID=Trim(Request("ID"))
If ID="" Then
	  Response.Write("<script language=javascript>alert('请选择!');history.back(1);</script>")
	  Response.End
ElseIf Request("Del")="取消审核" Then
   set rs=conn.execute("update Web_rui_v_Pl set ViewFlag = 0 where ID In(" & ID & ")")
   Response.Write("<script>alert(""取消审核！"");location.href=""Admin_Pl.asp?cli="&cli&""";</script>")
ElseIf Request("Del")="通过审核" Then
   set rs=conn.execute("update Web_rui_v_Pl set ViewFlag = 1 where ID In(" & ID & ")")
   Response.Write("<script>alert(""通过审核！"");location.href=""Admin_Pl.asp?cli="&cli&""";</script>")
ElseIf Request("Del")="删除评论" Then
	set rs=conn.execute("delete from Web_rui_v_Pl where ID In(" & ID & ")")
   	Response.write"<script>alert(""删除成功！"");location.href=""Admin_Pl.asp?cli="&cli&""";</script>"
End If
End Sub
sub del()
	id=request("id")
	set rs=conn.execute("delete from Web_rui_v_Pl where id="&id)
	Response.write"<script>alert(""删除成功！"");location.href=""Admin_Pl.asp?cli="&cli&""";</script>"
end sub
%>
</body>
</html>