<%@ codepage ="936" %>
 <%
	  data_path="../../"   'ACC连接数据库路径，对SQL无效
	  numid="03"            
	  dir="../err.asp"
 %>
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
<!--#include file="../rolecheck.asp"-->
 <LINK href="../css/style.css" rel=stylesheet type=text/css> 
<SCRIPT language=javascript1.2 src="../css/iXs_Main.js"></SCRIPT>
<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
idlist=request("selAnnounce")
if instr(idlist,",")>0 then
dim idarr
idArr=split(idlist)
dim log_id
for i = 0 to ubound(idarr)
log_id=clng(idarr(i))
call deleteannounce(log_id)
next
response.Redirect("index.asp?action="&request("action"))
else
call deleteannounce(clng(idlist))
response.Redirect("index.asp?action="&request("action"))
end if

end if
keywords=replace_text(request("keywords"))
if request("action")<>"" then
if Chkrequest(request("action")) then
action=request("action")
else
response.Write("<script>alert('参数传递错误！');history.back(-1);</script>")
response.End()
end if
end if

set rs=server.createobject("adodb.recordset") 
sql="select * from Websen_worldec_about where id>0"
if action<>"" then sql=sql&" and typeid="&cint(action)&""
if keywords<>"" then sql=sql&" and title like '%"&keywords&"%'"

sql=sql&" order by id desc"
Set rs= Server.CreateObject("ADODB.Recordset")
 rs.open sql,conn,1,1 

msg_per_page=20 '定义每页显示记录条数
%>
<table width="100%" border="0" align=center cellpadding="3" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#C4D8ED"> 
  <tr> 
     <td height=30 colspan="2" align="center" bgcolor="#FFFFFF"><strong>网站公告+新闻+活动管理 </strong></td> 
     <td width="7%" bgcolor="#FFFFFF"><a href="../about/add.asp" target="main">添加</a></td>
  </tr>
  <tr> 
     <td width="10%" height=25 align="center" class=forumRow><strong>信息查询:</strong></td> 
         <FORM name=searchForm action="index.asp" method=post onsubmit="javascript:if(doSearch()==false) return false;"><td colspan="2" class=forumRow>
       关键字：<input name="keywords" type="text" value="<%=keywords%>">
&nbsp;所属类别：
<select name="action" size="1">  
<%
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from Websen_worldec_about_class"
rs1.open sql1,conn,1,1
if not rs1.eof then
do while not rs1.eof
response.write "<option value='"&rs1("id")&"'>"&rs1("type")&"</option>"&chr(13)+chr(10)
rs1.movenext
loop
rs1.close
end if
%>
</select> 
&nbsp;&nbsp;<input type="submit" value="立刻查找" id=submit name=submit>
         </td></form>
  </tr> 
</table>
<SCRIPT LANGUAGE='JavaScript' SRC='/js/search.js' TYPE='text/javascript'></script>
<!--#include file="../../inc/headpage.asp"-->

  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td>&nbsp;</td>
    </tr>
  </table>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  <Form name="search" method="POST" action="index.asp?action=<%=request("action")%>">  
 <%
if rs.eof then
response.Write"<tr><td colspan=5><br><br><div align='center'>暂无数据信息</div><br><br></td></tr>"
else
%>   
 <tr height=25 class=bodytitle>
      <td width="60%" height="30" align="left" bgcolor="#FFFFFF"><font color="#135294"><b>信息标题</b></font></td>
      <td width="12%" height="30" align="center" bgcolor="#FFFFFF" class=bodytitle><font color="#135294"><b>所属类别</b></font></td>
      <td width="14%" height="30" align="center" bgcolor="#FFFFFF" class=bodytitle><font color="#135294"><b>发布日期</b></font></td>
      <td width="7%" height="30" align="center" bgcolor="#FFFFFF" class=bodytitle><font color="#135294"><b>修改</b></font></td>
      <td width="7%" height="30" align="center" bgcolor="#FFFFFF" class=bodytitle><input name="submit2" type='submit' value='删除' onclick="return sureok();"></td>
    </tr>
    <%
do while not rs.eof and rowcount > 0%>
    <tr height="20">
      <td align="left" class=forumRow> <a href="<%=HOPE_InstallDir%>about/about.asp?id=<%=rs("id")%>" target="_blank">
	  <%=replace(rs("title"),keywords,"<font color=red>"&keywords&"</font>")%></a> <%if rs("tj")=1 then%><img src="../images/thanx.gif" alt="此条信息已设置推荐,点击修改可重新设置推荐属性！" width="19" height="19" align="absmiddle"><%end if%> <%if rs("picture")<>"nopicture.gif" then%><img src="../images/pre.gif" alt="包含标题图片：&lt;br&gt;&lt;img src=<%=HOPE_InstallDir%>UploadFile/<%=rs("picture")%> border=1 width=220 height=150&gt;" border="0"><%end if%></td>
      <td class=forumRow align="center">
        <%
set rs5=server.CreateObject("adodb.recordset")
sql5="select id,type from Websen_worldec_about_class where id="&rs("typeid")
rs5.open sql5,conn,1,1
if not rs5.eof then
response.write"<a href='index.asp?action="&rs5("id")&"'>"&rs5("type")&"</a>"
rs5.close
end if
 %></td>
      <td width="113" align="center" class=forumRow><%=FormatDate(rs("dateandtime"),2)%>　</td>
      <td align="center" class=forumRow><a href="edit.asp?id=<%=rs("id")%>">修改</a></td>
      <td width="57" align="center" class=forumRow><input type='checkbox' name='selAnnounce' value='<%=cstr(rs("id"))%>'></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="5" align="left" class=forumRow><div align="right">
          <input name="button" type=button onClick="this.value=check(this.form)" value=" 全部选定 ">
      </div></td>
    </tr>
    <tr height="20" bgcolor="#ffffff">
      <td align="center" colspan="5"><b><%=listPages("index.asp?typeid="&typeid&"&keywords="&keywords&"")%></b></td>
    </tr></form>
</table>

  <%
	sub deleteannounce(id)
	dim rs,sql
	set rs=server.createobject("adodb.recordset")
	sql="delete from [Websen_worldec_about] where id="&cstr(id)
	conn.execute sql
	if err.Number<>0 then
	err.clear
	response.write "删 除 失 败 !<br>"
	end if
	End sub
%>
 