<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
dim strFileName
const MaxPerPage=25
dim totalPut,CurrentPage,TotalPages
dim i,j
dim ArticleID
dim Title
dim sql,rs
dim BigClassName,SmallClassName,SpecialName
dim PurviewChecked
dim strAdmin,arrAdmin

BigClassName=Trim(request("BigClassName"))
SmallClassName=Trim(request("SmallClassName"))
if bigclassname="" then
bigclassname="新闻动态"
end if
PurviewChecked=false
strFileName="Manage_News.asp?BigClassName=" & BigClassName & "&SmallClassName=" & SmallClassName & "&SpecialName=" & SpecialName

if request("page")<>"" then
    currentPage=cint(request("page"))
else
	currentPage=1
end if

sql="select * from news "
if BigClassName<>"" then
	sql=sql & "where BigClassName='" & BigClassName & "' "
	if SmallClassName<>"" then
		sql=sql & " and SmallClassName='" & SmallClassName & "' "
	end if
end if
sql=sql & " order by id desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
%>
<SCRIPT language=javascript>
function unselectall()
{
    if(document.del.chkAll.checked){
	document.del.chkAll.checked = document.del.chkAll.checked&0;
    } 	
}

function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.Name != "chkAll")
       e.checked = form.chkAll.checked;
    }
  }
function ConfirmDel()
{
   if(confirm("确定要删除选中的信息吗？一旦删除将不能恢复！"))
     return true;
   else
     return false;
	 
}

</SCRIPT>
<!-- #include file="Inc/Head.asp" -->
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="98" align="center" valign="top" bgcolor="#A0CCD8">
	<!-- #include file="info_left.asp" -->
	</td>
    <td width="895" align="center" valign="top"><table width="100%" height="0"  border="0" cellpadding="5" cellspacing="0">
      <tr>
        <td height="24" background="image/usercenter_3.jpg">           <div align="center"><font color="#FFFFFF"><strong>管 理 系 信 息 管 理</strong> </font> </div></td>
      </tr>
    </table>      
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="border">
        <tr class="tdbg">
          <form name="form1" method="post" action="search.asp?bigclassname=<%=bigclassname%>">
            <td width="100%" align="center" bgcolor="#C2DAE1"><input type="radio" value="1" name="select" checked>
        按标题
          <input type="text" name="keyword" class="form" size="30">
        <input type="submit" value="搜索" name="B1">
           
		    </td>
          </form>
        </tr>
		<tr><td width="100%" bgcolor="#C2DAE1" align="center" height="25"><table class="border"><tr class="title"><td align="center">
	<%call add_info()%></td></tr>
      </table>
	  
			 
      <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" class="border">
        
        <%
if BigClassName<>"" then
	sqlSmallClass="select * from SmallClass_new where BigClassName='" & BigClassName & "'"
	Set rsSmallClass= Server.CreateObject("ADODB.Recordset")
	rsSmallClass.open sqlSmallClass,conn,1,1
	if not (rsSmallClass.bof and rsSmallClass.eof) then
		response.write "<tr class='tdbg'><td bgcolor='#C0C0C0'>"
		do while not rsSmallClass.eof
			if rsSmallClass("SmallClassName")=SmallClassName then
				response.Write("&nbsp;<a href='Manage_News.asp?BigClassName=" & rsSmallClass("BigClassName") & "&SmallClassName=" & rsSmallClass("SmallClassName") & "'><font color='red'>" & rsSmallClass("SmallClassName") & "</font></a>&nbsp;&nbsp;")
			else
				response.Write("&nbsp;<a href='Manage_News.asp?BigClassName=" & rsSmallClass("BigClassName") & "&SmallClassName=" & rsSmallClass("SmallClassName") & "'>" & rsSmallClass("SmallClassName") & "</a>&nbsp;&nbsp;")
			end if
			rsSmallClass.movenext
		loop
		response.write "</td></tr>"
	end if
	rsSmallClass.close
	set rsSmallClass=nothing
end if
%>
      </table>
        <table width="100%" border="0" cellpadding="0" cellspacing="1">
		 <form name="del" method="Post" action="News_Del.asp" onsubmit="return ConfirmDel();">
          <tr> 
            <td height="25" bgcolor="#C2DAE1"><a href="Manage_News.asp">&nbsp;信息资讯管理</a> 
              &gt;&gt; 
              <%
if request.querystring="" then
	response.write "所有信息"
else
	if request("Query")<>"" then
		if Title<>"" then
			response.write "名称中含有“<font color=blue>" & Title & "</font>”的信息"
		else
			response.Write("所有信息")
		end if
 	else
		if BigClassName<>"" then
			response.write "<a href='Manage_News.asp?BigClassName=" & BigClassName & "'>" & BigClassName & "</a>&nbsp;&gt;&gt;&nbsp;"
			if SmallClassName<>"" then
				response.write "<a href='Manage_News.asp?BigClassName=" & BigClassName & "&SmallClassName=" & SmallClassName & "'>" & SmallClassName & "</a>"
			else
				response.write "所有小类"
			end if
		end if		
	end if
end if
%></td>
            <td width="150" bgcolor="#C2DAE1">&nbsp;
            <%
  	if rs.eof and rs.bof then
		response.write "共找到 0 条信息</td></tr></table>"
	else
    	totalPut=rs.recordcount
		if currentpage<1 then
       		currentpage=1
    	end if
    	if (currentpage-1)*MaxPerPage>totalput then
	   		if (totalPut mod MaxPerPage)=0 then
	     		currentpage= totalPut \ MaxPerPage
		  	else
		      	currentpage= totalPut \ MaxPerPage + 1
	   		end if

    	end if
		response.Write "共找到 " & totalPut & " 条信息"
%></td>
          </tr>
        </table>
        <%		
	    if currentPage=1 then
        	showContent
        	showpage strFileName,totalput,MaxPerPage,true,false,"条信息"
   	 	else
   	     	if (currentPage-1)*MaxPerPage<totalPut then
         	   	rs.move  (currentPage-1)*MaxPerPage
         		dim bookmark
           		bookmark=rs.bookmark
            	showContent
            	showpage strFileName,totalput,MaxPerPage,true,false,"条信息"
        	else
	        	currentPage=1
           		showContent
           		showpage strFileName,totalput,MaxPerPage,true,false,"条信息"
	    	end if
		end if
	end if
%>
        <%  
sub showContent
   	dim i
    i=0
%>
        <table class="border" border="0" cellspacing="1" width="100%" cellpadding="0" style="word-break:break-all">
          <tr bgcolor="#C2DAE1" class="title"> 
            <td width="34" height="25" align="center" bgcolor="#C2DAE1">选中</td>
            <td width="35"  height="25" align="center" bgcolor="#C2DAE1">ID</td>
            <td width="339" align="center" bgcolor="#C2DAE1" >信息标题</td>
            <td width="112" align="center" >所属一级分类</td>
            <td width="105" align="center" >所属二级分类</td>
            <td width="78" align="center" >加入时间</td>
            <td width="97" align="center" >操作</td>
          </tr>
          <%do while not rs.eof%>
            <tr bgcolor="#EFEEE9" onMouseOver=this.bgColor='#ffffff' onmouseout=this.bgColor='#EFEEE9'> 
            <td width="34" height="22" align="center" bgcolor="#C2DAE1"> <div align="center">
              <input name='ID' type='checkbox' onClick="unselectall()" id="ID" value='<%=cstr(rs("ID"))%>'>
            </div></td>
            <td width="35" align="center"><%=rs("id")%></td>
            <td><a href="../Article.asp?ID=<%=rs("id")%>" target="_blank" title="<%=rs("title")%>"><%if rs("Pic")="Yes" then response.write("<font color=red>[图]</font>")%><%=left(rs("title"),25)%></a></td>
            <td><div align="center"><%=rs("BigClassName")%></div></td>
            <td><div align="center"><%=rs("SmallClassName")%></div></td>
            <td align="center"><%=year(rs("infotime"))%>-<%=month(rs("infotime"))%>-<%=day(rs("infotime"))%></td>
            <td width="97" align="center">
			<%call info_edit()%>
			<%call man_rdel("admin_infodel.asp?id="&rs("id")&"&Action=Del","删除","Info_allMan")%>
            </td>
          </tr>
          <%
	i=i+1
	      if i>=MaxPerPage then exit do
	      rs.movenext
	loop
%>
        </table>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr> 
            <td width="250" height="30"><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
              选中本页显示的所有信息</td>
            <td><%call man_r4("submit","删除选定的信息","Submit","","Info_allMan")%>
              <input name="Action" type="hidden" id="Action" value="Del"></td>
          </tr>
      </form>
    </table>
	  <%
   end sub 
%>
    </td>
  </tr>
</table>
<!-- #include file="Inc/Foot.asp" -->
<%
rs.close
set rs=nothing  

%>