<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<%
	useflag=4
%>
<!--#include file="flag.asp"-->
<!--#include file="../inc/setup.asp"-->
<%
	action=Trim(Request.QueryString("action"))

	if action="del" then
		id=Trim(Request("id"))
		cid=Trim(Request("cid"))
		cate=Trim(Request("type"))
		if id="" then
			response.write"<script language=JavaScript>alert('参数为空，请选择您要删除的新闻评论');"    
			response.write"this.location.href='talknews.asp';</script>"
		end if
		sql="delete from talknews where id="&id&""
		conn.Execute sql
		
		response.redirect "News_html.asp?id="&cid&"&type="&cate&"&ttype=1"
		
		response.write"<script language=JavaScript>alert('新闻评论删除成功！');"    
		response.write"this.location.href='talknews.asp';</script>"
		response.End
	end if
	
	if action="edit" then
	
		id=Trim(Request("id"))
		cid=Trim(Request("cid"))
		cate=Trim(Request.QueryString("type"))
		
		sql="update talknews set zhuangtai=1 where id="&id&""
		conn.Execute sql
		
		response.redirect "News_html.asp?id="&cid&"&type="&cate&"&ttype=1"
		
		response.End
	end if
	
	if action="save" then
	
		id=Trim(Request("id"))
		cid=Trim(Request("cid"))
		cate=Trim(Request.QueryString("type"))
		
		sql="update talknews set zhuangtai=0 where id="&id&""
		conn.Execute sql
		
		response.redirect "News_html.asp?id="&cid&"&type="&cate&"&ttype=1"

		response.End
	end if
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href='Include/Admin_Style.CSS' rel='stylesheet' type='text/css'>
<script src='Include/Common.js'></script>
</head>
<form name="selform" method="post" action="?action=del">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="sortbutton">
<tr>    
<td height="23" align="center">网站新闻评论管理
</tr>
</table>
<table width="100%" style="MARGIN-TOP: 3px" border="0" align="center" cellspacing="1" cellpadding="1"  class="Border">
<tr height="25" align="center" class='title'>
	<td width="4%" nowrap>编号</td>
	<td width="10%" nowrap>新闻主题</td>
	<td width="8%" nowrap>评论者呢称</td>
	<td width="49%" nowrap>评论内容</td>
	<td width="8%" nowrap>评论时间</td>
	<td width="10%" nowrap>评论者IP</td>
	<td width="6%" nowrap>评论状态</td>
	<td width="5%" nowrap>操作</td>
</tr>
<%
	dim i,intPage,page,pre,last,filepath'定义变量
	set rs_user = server.CreateObject("adodb.recordset")'创建对象
	sql="select talknews.id tid,talknews.tname,talknews.content,talknews.stime,talknews.addip,talknews.zhuangtai,companynews.id cid,companynews.title,companynews.cate from talknews,companynews where companynews.id=talknews.nid order by talknews.id desc" '定义SQL语句
	rs_user.Open sql,conn,1,1 '这里执行你查询SQL并获得结果记录集
	if rs_user.eof then
		response.Write "<tr><td colspan=6><div align=center><font size=3 color=red><b>暂没有新闻评论</b></font></div></tr></td>"
		response.End
	else
	i=1
	do while not rs_user.eof
%>
<tr height="25" align=center class='tdbg' onMouseOver="this.className='tdbgmouseover'" onMouseOut="this.className='tdbg'">
	<td><%=i%></td>
	<td><a href='../view_news.asp?id=<%=rs_user("cid")%>' title='浏览详细的新闻信息' target='_blank'><%= left(rs_user("title"),5) %>...</a></td>
	<td><%=rs_user("tname")%></td>
	<td><%=rs_user("content")%></td>
	<td><%=rs_user("stime")%></td>
	<td><%=rs_user("addip")%></td>
	<td><% if rs_user("zhuangtai")=0 then Response.Write("<a href='?action=edit&id="&rs_user("tid")&"&type="&rs_user("cate")&"&cid="&rs_user("cid")&"' title='改为已验证?'><font color='#FF0000'>未验证</font></a>") else Response.Write("<a href='?action=save&id="&rs_user("tid")&"&type="&rs_user("cate")&"&cid="&rs_user("cid")&"' title='改为未验证?'>已验证</a>")%></td>
	<td><a href="?action=del&id=<%=rs_user("tid")%>&cid=<%=rs_user("cid")%>&type=<%=rs_user("cate")%>"><font color="#FF0000">删除</font></a></td>
</tr>
<%
	i=i+1
	rs_user.movenext
	loop
	End If
	rs_user.close
	set rs_user=nothing
	conn.close
	set conn=nothing
%>
</table>
</form>