<%@ codepage ="936" %>
   <% 
	data_path="../../" 
	numid="51"
	dir="../err.asp" 
  %>
  <!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
<!--#include file="../../inc/FileSystem.asp"-->
    <!--#include file="../rolecheck.asp"-->

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../css/style.css" rel=stylesheet type=text/css> 
<style type="text/css">
<!--
.STYLE3 {font-size: 11px;
         font-family: "新宋体";
		 font-weight: bold;
}
-->
</style>
<script>
var checkflag="false";
function check(field){
if(checkflag=="false"){
for(i=0;i<field.length;i++){
field[i].checked=true;}
checkflag="true";
return "解除全选"; }
else {
for(i=0;i<field.length;i++) {
field[i].checked=false;}
checkflag="false";
return "选择全部";}}
</script>
<title>帮助信息管理</title>
<%

if not isempty(request("selAnnounce")) then
newsidlist=request("selAnnounce")
if instr(newsidlist,",")>0 then
dim newsidarr
newsidArr=split(newsidlist)
dim log_newsid
for i = 0 to ubound(newsidarr)
log_newsid=clng(newsidarr(i))
call deleteannounce(log_newsid)
next
else
call deleteannounce(clng(newsidlist))
end if
end if
keywords=replace_text(request("keywords"))
 if replace_text(request("typeid"))<>"" then
typeid=request("typeid")

 end if
 
set rs=server.createobject("adodb.recordset") 
sql="select * from Websen_news"
if typeid<>"" then 
	if typeid<>"All" then 
			sql=sql&" where typeid="&typeid&""
			if keywords<>"" then sql=sql&" and title like '%"&keywords&"%'"
	else
		if typeid<>"" then sql=sql&" where "
		if keywords<>"" then sql=sql&" title like '%"&keywords&"%'"
	end if
end if

sql=sql&" order by newsid desc"

Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1 
http =rs("http")
checkbox=rs("checkbox")
        newsid=rs("newsid")
msg_per_page=20 '定义每页显示记录条数
%>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align=center class="tableBorder"> 
  <tr> 
     <th height=25 colspan="2" class="tableHeaderText">行业资讯管理 </th> 
  </tr> 
  <tr> 
     <td colspan="2"    height="20"><font color="#666666">温馨提示：①类别直接与发布的信息相关联，删除类别可能会影响到以前发布的专项商机信息。 </font> </td> 
  </tr> 
  <tr> 
     <td width="10%" height=25 class="forumRowHighlight"> <B>操作选项</B></td> 
         <FORM name=searchForm action="reviewpl_delete.asp" method=post  ><td class="forumRowHighlight">
       关键字：<input name="keywords" type="text" value="<%=keywords%>" maxlength="10">
&nbsp;所属类别：
<select name="typeid" size="1">  
<%
response.write "<option value='All'>所有分类信息</option>"&chr(13)+chr(10)

set rs1=server.CreateObject("adodb.recordset")
sql1="select * from Websen_newsType order by orderid  "
rs1.open sql1,conn,1,1
if not rs1.eof then
do while not rs1.eof
response.write "<option value='"&rs1("typeid")&"'>"&rs1("type")&"类信息</option>"&chr(13)+chr(10)
rs1.movenext
loop
rs1.close
end if
%>
</select>
<input type="submit" value="立刻查找" id=submit name=submit></td>
         </form>
  </tr>  <Tr><td colspan="2" height="1"  bgcolor="#CCCCCC"></td></Tr>
</table>

<!--#include file="../../inc/headpage.asp"-->
  <table wnewsidth="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="tableBorder">
  <Form name="search" method="POST" action="reviewpl_delete.asp" onsubmit="return sureok()">
 <tr>      <td colspan="6">
<%
if rs.eof then
response.Write"<br><br><div align='center'>暂无数据信息</div><br><br>"
else
%>
      </td>
    </tr>
    <tr height=25 class=bodytitle>
      <td width="36%" align="left" class=bodytitle wnewsidth="446"><font color="ff6600"><b>信息标题</b></font></td>
      <td width="20%" align="center" class=bodytitle wnewsidth="263"><font color="ff6600"><b>所属类别</b></font></td>
      <td width="10%" align="center" class=bodytitle wnewsidth="263"><font color="ff6600"><b>评论查看</b></font></td>
      <td width="14%" align="center" class=bodytitle wnewsidth="113"><font color="ff6600"><b>发布日期</b></font></td>
      <td width="14%" align="center" class=bodytitle wnewsidth="62"><font color="ff6600"><b>评论数</b></font></td>
      <td width="6%" align="center" class=bodytitle wnewsidth="57"><input name="submit2" type='submit' value='删除'  ></td>
    </tr>
    <%do while not rs.eof and rowcount > 0%>
    <tr height="20">
      <td align="left" class=forumRow>   
	  <%if (rs("checkbox")=1) then%>
	   〖<a href="<%=rs("http")%>" target="_blank"><% Response.write "<font color='#FF0000' class='STYLE3'>调用外部连接</font>"%></a>〗<%=rs("title")%>
	
	  <%else%>
	   <a href="<%=HOPE_InstallDir%>info/shownews.asp?newsid=<%=rs("newsid")%>" target="_blank"><%=replace(rs("title"),keywords,"<font color=red>"&keywords&"</font>")%></a>
	   <%end if%></td>
      <td align="center" class=forumRow>
        <%
set rs5=server.CreateObject("adodb.recordset")
sql5="select typeid,type from Websen_newstype where typeid="&rs("typeid")
rs5.open sql5,conn,1,1
 if not rs5.eof then
response.write rs5("type")&"类"
else
	Response.write "无些分类"
end if
rs5.close
%>
</td>
      <td align="center" class=forumRow><a href="chakan.asp?di=<%=rs("newsid")%>&typeid=<%=typeid%>">查看该评论</a></td>
      <td wnewsidth="113" align="center" class=forumRow><%=FormatDate(rs("dateandtime"),2)%>　</td>
      <td align="center" class=forumRow><%
	  set rst=server.CreateObject("adodb.recordset")
sqlt="select * from   websen_Review where pl_newsid="&rs("newsid")
'sql="SELECT First(a.b) AS a, Count(a.b) AS Number FROM a HAVING Count(a.b)>1"
rst.open sqlt,conn,1,3
'response.Write   rst("id")
  if (rs("checkbox")=1) then
  response.Write  "<font color='#808080'> 无法评论</font>"
  else
   if rst.recordcount<>"0" then  
   response.Write   "共计评论<font color='#2A0000'>"& rst.recordcount&"</font>条"
   mytime=rs("pl_date") 
  nowtime=now() 
if datediff("d",mytime,nowtime)<1 then %>
<img src="../../admin/images/gengxin.gif" />
   <%
   end if
    else 
   response.Write "暂无相关评论"
   end if
   end if
   
rst.close
	  %>
	  	  </td>
      <td wnewsidth="57" align="center" class=forumRow><input type='checkbox' name='selAnnounce' value='<%=cstr(rs("newsid"))%>'></td>
    </tr>
    <%
icolor=icolor+1
if icolor>1 then icolor=0
rowcount=rowcount-1
rs.movenext
loop
end if
%>
    <tr height="20" bgcolor="#ffffff">
      <td colspan="6" align="left" class=forumRow><div align="right">
         
          <input name="button" type=button style="color:#135294"  onClick="this.value=check(this.form)" value=" 全部选定 ">
      </div></td>
    </tr>
    <tr height="20" >
      <td class=forumrowHighLight align="center" colspan="6"><%=listPages("reviewpl_delete.asp?typeid="&typeid&"&keywords="&keywords&"")%></td>
    </tr></form>
</table>
<%
sub deleteannounce(newsid)
set rs=server.createobject("adodb.recordset")
sql="delete from [Websen_news] where newsid="&cstr(newsid)
conn.execute sql
set rn=server.createobject("adodb.recordset")
sn="delete from [websen_Review] where pl_newsid="&cstr(newsid)
conn.execute sn
End sub

%>
<!--#include file="../copy.asp" -->