<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../../conn/conn.asp" -->
<!--#include file="../../Inc/Commoncode.asp" -->
<!--#include file="../../inc/IP.asp"-->
<!--#include file="../checkvalid.asp"-->
<%
'************************************************************
'	Software name: Finereason HRCMS 7.0
'	软件名称:嘉缘人才网站内容管理系统 V7.0
'	Email: service@finereason.com . QQ:109530926
'	Web: http://www.finereason.com  http://www.yjys.net
'	Copyright (C) FineSincere Inc. All Rights Reserved.
'	版权所有 嘉挚科技 未经嘉挚公司授权不得用于任何商业用途
'
'	文件名称：Admin_Comment.asp
'	作    用：网站评论管理
'	最后更新：Fine Sincere (Mr.Hou)
'	最后日期：2007-5-16
'************************************************************
If Not FRAdminLevel(110) Then
	Call ErrorMsg()
End If
Response.Expires = 0 
Response.CacheControl = "no-cache" 
Response.ExpiresAbsolute = Now() - 1 
if request("newsid")<>"" then
	newsid=request("newsid")
end if
if request("pass")<>"" then
	pass=request("pass")
end if
if Request("com_id")<>"" then
com_id=Request("com_id")
end if
Dim Action
Dim page,i
Dim totalPut
const MaxPerpage=20
strFileName="Admin_Comment.asp?pass="&pass&"&newsid="&newsid&""
page=Trim(Request("page"))
If page<>"" And IsNumeric(page) Then
	If page<1 Or Len(page)>10 Then
		page=1
	Else
    	page=CLng(page)
	End If
Else
	page=1
End If
sub unpass()
conn.execute("update JOB_hrnewscom set pass=0 where com_id="&com_id&"")
response.redirect strFileName
response.End()
end sub
sub setpass()
conn.execute("update JOB_hrnewscom set pass=1 where com_id="&com_id&"")
response.redirect strFileName
response.End()
end sub
sub Del()
	com_id=trim(Request("com_id"))
	if com_id="" then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>参数不足！</li>"
		exit sub
	end if
	sql="select * from JOB_hrnewscom where com_id In("& com_id &")"
    set rs=server.CreateObject ("Adodb.recordset")
	rs.open sql,conn,1,3
	if rs.bof and rs.eof then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>评论不存在或者已被删除！</li>"
		exit sub
	else
		Do While Not(rs.Eof)
			rs.delete
			rs.update
			rs.MoveNext
		Loop
	end if
	rs.close
	set rs=nothing
    response.redirect strFileName
	response.End()
end sub
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Finereason HRCMS 7.0 后台管理系统</title>
<link href="../css/style<%=sk%>.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../inc/input.js"></script>
<script language="javascript" src="../Inc/Admin.js"></script><script language="JavaScript" type="text/JavaScript">
function ConfirmDel(ID,Name)
{
   if(confirm("您确定要删除评论【"+Name+"】吗？\n\n警告：此操作不可恢复，请慎重操作！"))
     location.href="<%=strFileName%>?Action=Del&id="+ID
}
function unSelectAll()
{
    if(document.form1.chkAll.checked){
	document.form1.chkAll.checked = document.form1.chkAll.checked&0;
    } 	
}
function SelectAll(form)
{
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.Name != "chkAll"&&e.disabled!=true&&e.zzz!=1)
       e.checked = form.chkAll.checked;
    }
}
</script></head>
<body>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="tableBorder">
  <tr>
    <th height="22" align="center" class="tableHeaderText"><strong >网站评论管理</strong></th>
  </tr>
  <tr>
    <td height="24"><span class="bodytitle"><font color="ff6600"><b class="style1">　管理选项</b></font>：</span>&nbsp;<span class="forumRowHighlight"><a href="Admin_comment.asp?pass=1">已审核评论</a> | <a href="Admin_comment.asp?pass=0">屏蔽的评论</a> | <a href="Admin_comment.asp?pass=2">机器人过滤的评论</a> | [<a href="javascript:location.reload()">刷新页面</a>]</span></td>
  </tr>
  <tr>
    <td height="21"><B>注意</B>：<BR>
      <font color=blue>①用户发表评论时，网站清洁机器人将自动将包含网址、电话、邮箱等的评论内容在前台屏蔽！</font><BR>
      <font color=red>②如果此条评论内容容许在前台显示，则设置前台显示即可。</font></td>
  </tr>
</table>
<%
Action=trim(Request("Action"))
Select Case Action
	Case "unpass"
		Call unpass()
	Case "setpass"
		Call setpass()
	Case "Del"
		Call Del()
	Case Else
		Call main()
End Select

if FoundErr=True then
	call Show_Err()
end if
%>
<!--#include file="../inc/copy.asp"-->
<%
Conn.Close
Set Conn=Nothing
%>
<%
sub main()
Set rs= Server.CreateObject(FR_HR_RS)
sql="select * from JOB_hrnewscom"
if request("pass")<>"" then
sql=sql&" where pass="&pass&""
	if request("newsid")<>"" then 
	sql=sql&" and newsid="&newsid&""
	end if
else
	if request("newsid")<>"" then 
	sql=sql&" where newsid="&newsid&""
	end if
end if
sql=sql&" order by com_id desc"
	rs.open sql,conn,1,1
	if rs.eof and rs.bof then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>暂无评论，请添加后再进行管理！</li>"
		exit sub
	else
		totalPut=rs.recordcount
		if (page-1)*MaxPerpage>totalput then
			if (totalPut mod MaxPerpage)=0 then
				page= totalPut \ MaxPerpage
			else
				page= totalPut \ MaxPerpage + 1
			end if
		end if
		if page=1 then
			Call MainInfo()
		else
			if (page-1)*MaxPerpage<totalPut then
				rs.move  (page-1)*MaxPerpage
				dim bookmark
				bookmark=rs.bookmark
				Call MainInfo()
			else
				page=1
				Call MainInfo()
			end if
		end if
	end if
	rs.close
	set rs=nothing
End Sub
%>
<%Sub MainInfo()%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="tableBorder">
  <tr>
    <th height="22" align="center" colspan="2"><strong >评论内容管理</strong></th>
  </tr>
<form name="form1" method="Post" action="<%=strFileName%>">
<%do while not rs.eof
com_id=Rs("com_id")
newsid=rs("newsid")
pj_content=rs("pj_content")
pjrname=rs("pjrname")
dateandtime=rs("dateandtime")
pjrIP=rs("pjrIP")
%>
  <tr>
    <td width="76%"><strong>评论人：<%=pjrname%> 时间：<%=dateandtime%> IP：<span title="<%=IPAddress(pjrIP)%>"><%=pjrIP%></span> <%if IsAdsContent(pj_content)=True then%>
    <span class="f00">机器人怀疑此评论为广告</span>
    <%end if%></strong></td>
    <td width="24%"><span class="forumRowHighlight">状态：
      <%if rs("pass")=0 then%>
      屏蔽<a href="admin_comment.asp?Action=setpass&com_id=<%=rs("com_id")%>">点击开通</a>
      <%elseif rs("pass")=1 then%>
      已审核<a href="admin_comment.asp?Action=unpass&com_id=<%=rs("com_id")%>">点击屏蔽</a>
      <%else%>
      过滤<a href="admin_comment.asp?Action=setpass&com_id=<%=rs("com_id")%>">点击开通</a>
      <%end if%>
&nbsp;&nbsp;<a href="admin_comment.asp?Action=Del&com_id=<%=rs("com_id")%>">删除 </a></span>        <input name="com_id" type="checkbox" class="checkbox" value="<%=com_id%>" />    </td>
  </tr>
  <tr>
    <td height="32" colspan="2"><%=pj_content%></td>
  </tr>
  <tr>
    <td height="32" colspan="2" align="right" class="f00">被评文章：
<%'读取文章标题
set rst=conn.execute("select N_sid,N_cid,N_title,N_addtime from JOB_news where N_id="&newsid&"")
if not rst.eof then
typeid=rst("N_sid")
ChannelID=rst("N_cid")
news_Title=rst("N_title")
dateandtime=rst("N_addtime")
end if
rst.close
set rst=nothing%>
<a href="<%=FormatLink(dateandtime,ChannelId,1,newsid,0)%>" target="_blank"><%=ClearColor(news_Title)%></a></td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
  <tr>
    <td height="32" colspan="2" align="right"><input name="chkAll" type="checkbox" class="checkbox" onClick="SelectAll(this.form)" value="checkbox" />
          <input name="Action" type="hidden" value="Del" />
          选中所有项目&nbsp;&nbsp;&nbsp;&nbsp;将选定的项目:&nbsp;
<input name="submit" type="submit" class="inputs" value="批量删除" /></td>
  </tr>
  <tr>
    <td height="32" colspan="2" align="center"><%If totalput>0 Then
	Call Showpage(strFileName,totalput,MaxPerPage,false,true,"条评论")
End If%></td>
  </tr>
  </form>
</table>
<%End Sub%>