<!--#include file="../conn.asp" -->
<!--#include file="logout.asp" -->
<%
nclass=request("nclass")

if nclass="" then
sql= "select * from news  where bigclassid=4 order by ord desc"
else
sql= "select * from news  where smallclassname='"&nclass&"' order by ord desc"
end if



%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<script type="text/JavaScript">

function TableMouseOver(Obj){
	Obj.style.backgroundColor='#F3F8FC';
}
function TableMouseOut(Obj){
	Obj.style.backgroundColor='';
}
function CheckOthers(form)
   {
     for (var i=0;i<form.elements.length;i++)
     {
       var e = form.elements[i];
//     if (e.name != 'chkall')
         if (e.checked==false)
         {
	   e.checked = true;// form.chkall.checked;
         }
         else
         {
	   e.checked = false;
         }
     }
   }

   function CheckAll(form)
   {
     for (var i=0;i<form.elements.length;i++)
     {
       var e = form.elements[i];
//     if (e.name != 'chkall')
         e.checked = true// form.chkall.checked;
     }
   }//-->
</script>

<link href="admin_style.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="100%"><table width="100%"  border="0" cellpadding="0" cellspacing="0" background="images/main_bg_top.gif">
      <tr>
        <td width="4%" align="left"><img src="images/main_left_top.gif" width="26" height="36"></td>
        <td width="92%" valign="bottom" background="images/main_bg_top.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="10"></td>
          </tr>
          <tr>
            <td height="25"><div align="center" class="bai_font">环 境 管 理 
                <select name="classname" onChange="javascript:location=this.options[this.selectedIndex].value;">
				<option value="Manage_hj.asp">=所有环境=</option>
                  <%
				set rs=conn.execute("select * from smallclass where bigclassid=4 order by s_order asc")
				
				do while not rs.eof 
				%>
                  <option value="Manage_hj.asp?nclass=<%=rs("smallclassname")%>"<%if nclass=rs("smallclassname") then response.Write"selected"%>><%=rs("smallclassname")%></option>
                  <%
				rs.movenext
				loop
				%>
                </select>			
                &nbsp;</div></td>
          </tr>
        </table></td>
        <td width="4%" align="right"><img src="images/main_right_top.gif" width="26" height="36"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="500" valign="top" class="lb" align="center">
	<%
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
	if rs.eof then
	response.Write"<br><br>暂无记录<br><br>"
	else
	rs.PageSize = 20
    Page = CLng(Request("Page"))
    If Page < 1 Then Page = 1
    If Page > rs.PageCount Then Page = rs.PageCount
	rs.absolutepage=page
	%>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<form action="del.asp?action=p_delnews&url=<%=server.URLEncode(request.ServerVariables("QUERY_STRING"))%>&url2=<%=request.ServerVariables("PATH_INFO")%>" method=post name=form id="form">
<td width="46%">
      <tr>
        <td height="25" bgcolor="#799AE1"> &nbsp; 标 题</td>
        <td width="10%" height="25" align="center" bgcolor="#799AE1">分 类</td>
        <td width="11%" height="25" align="center" bgcolor="#799AE1">发布时间</td>
        <td width="11%" height="25" align="center" bgcolor="#799AE1">点击次数</td>
        <td width="22%" height="25" align="center" bgcolor="#799AE1">管 理</td>
        </tr>
	  	<%
	  for i=1 to rs.PageSize
	  qq=i mod 2
	  if qq=0 then
	  		response.Write"<tr bgcolor=#f4f4f4  onMouseOver='TableMouseOver(this)' onMouseOut='TableMouseOut(this)'>"
	  else
		   response.Write"<tr  onMouseOver='TableMouseOver(this)' onMouseOut='TableMouseOut(this)'>"
	  end if
	  %>
<td height="25">&nbsp;<input name="delid" type=checkbox id="delid" value="<%=rs("Id")%>">&nbsp;<a href="/showhuanj.asp?id=<%=rs("id")%>" target="_blank"><%=rs("title")%></a><%if rs("d_picture")<>"nopic" then response.Write"&nbsp;<img src='/images/news.gif'align='absbottom'>"%>&nbsp; <a href="save.asp?action=hj_up&id=<%=rs("id")%>&page=<%=page%>&nclass=<%=rs("smallclassname")%>"><font color="#666666">向上</font></a> <a href="save.asp?action=hj_down&id=<%=rs("id")%>&page=<%=page%>&nclass=<%=rs("smallclassname")%>"><font color="#666666">向下</font></a></td>
          <td align="center"><a href="Manage_hj.asp?nclass=<%=rs("smallclassname")%>"><%=rs("smallclassname")%></a></td>
          <td height="25" align="center"><%=rs("addtime")%></td>
        <td height="25" align="center"> <%=rs("hits")%> 次 </td>
        <td height="25" align="center"><a href="Modify_hj.asp?id=<%=rs("id")%>&page=<%=page%>"><img src="images/edit1.gif" width="15" height="16" border="0" align="absmiddle">修改</a>&nbsp;&nbsp;<a href="del.asp?action=delnews&id=<%=rs("id")%>&url=<%=server.URLEncode(request.ServerVariables("QUERY_STRING"))%>&url2=<%=request.ServerVariables("PATH_INFO")%>" onClick="return confirm('确定要删除此记录吗？删除后不能恢复');"><img src="images/del1.gif" width="15" height="16" border="0" align="absmiddle">删除</a> &nbsp;
		<a href="save.asp?action=hjgood&id=<%=rs("id")%>&url=<%=server.URLEncode(request.ServerVariables("QUERY_STRING"))%>&url2=<%=request.ServerVariables("PATH_INFO")%>" >
		<%
		if rs("good")=true then
		response.Write "<font color='#ff0000'>取消</font>"
		else
		response.Write "推荐"
		end if
		%>
		</a></td>
        </tr>
		<%
	  rs.movenext
	  if rs.eof then exit for
	  next
	  %>
		<tr>
          <td height="25" colspan="6" bgcolor="#009900"><table width="100%" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="#990000">
            <tr>
              <td align="center" bgcolor="#799AE1">
			    <input name="action" type="hidden" id="action" value="delnews">
			    <input type=button class="inp" onClick="CheckAll(this.form)" value="全选">
              &nbsp;<input type=button class="inp" onClick="CheckOthers(this.form)" value="反选">
              &nbsp;
	  <input name="submit" type=submit class="inp" onClick="return confirm('确定要删除选中的师资吗？删除后不能恢复');"value="删除所选" /> 
	  <span class="bai_font">&nbsp;
	 
	<% 
  If page=1 Then
  response.Write "<font color=#999966>第一页</font>&nbsp;"
  response.Write "<font color=#999966>上一页</font>&nbsp;"
  else
  response.Write"<a href='Manage_hj.asp?page=1&nclass="&nclass&"'>第一页</a>&nbsp;&nbsp;<a href='Manage_hj.asp?page="&(page-1)&"&nclass="&nclass&"'>上一页</a>&nbsp;"
  end if
  If cint(page)=rs.pagecount then
  response.Write "<font color=#999966>下一页&nbsp;</font>"
  response.Write "<font color=#999966>最后页&nbsp;</font>"
  else
  response.Write"<a href='Manage_hj.asp?page="&(page+1)&"&nclass="&nclass&"'>下一页</a>&nbsp;<a href='Manage_hj.asp?page="&rs.pagecount&"&nclass="&nclass&"'>最后页</a>&nbsp;"
  end if
%>
&nbsp;页次&nbsp;<font COLOR="Red"><%=Page%></font>/<%=rs.PageCount%> 共<font COLOR="Red"><%=rs.recordcount%></font>条记录
                <select name="sel_page" onChange="javascript:location=this.options[this.selectedIndex].value;">
                  <%for i = 1 to rs.PageCount
                  if i = page then%>
                  <option value="Manage_hj.asp?page=<%=i%>&nclass=<%=nclass%>"selected><%=i%></option>
                  <%else%>
                  <option value="Manage_hj.asp?page=<%=i%>&nclass=<%=nclass%>"><%=i%></option>
                  <%
			 end if
             next
             %>
                </select>
	  </span></td>
            </tr>
          </table></td>
        </tr>
		
		</form>
    </table>	
    <%
	end if
	%>
	
	</td>
  </tr>
  <tr>
    <td><table width="100%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#275BCB">
      <tr>
        <td width="6%"><img src="images/main_left_btm.gif" width="38" height="25"></td>
        <td width="88%" bgcolor="#275BCB" class="style1">&nbsp;</td>
        <td width="6%" align="right"><img src="images/main_right_btm.gif" width="38" height="25"></td>
      </tr>
    </table></td>
  </tr>
</table>

</body>
</html>
