<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Connnews.asp" -->
<%
myid=request("id")
%>
<script Language="vbscript">
sub check()
	c=document.form1.page.value
			if c<>"" then
				if not IsNumeric(c) then
				msgbox " 页数只能输入数字"
				document.form1.page.select()
				exit sub
				else
				
				end if
			else
				msgbox"请输入想要转到页数"
				document.form1.page.select()
				exit sub
			end if
			
				document.form1.submit()
end sub
</script>
<HTML><HEAD>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新闻后台</title>
<link href="skins/css/main.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center"> 
  <center>
    <table border="0" cellpadding="4" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="96%">
      <form method="get" name=form2 action="">
        <%keyword=trim(request("keyword"))
    if keyword="" then
    keywords="所有内容"
    else
    keywords=keyword
    end if 
    %>
      </form>
      <%
		set rs=Server.CreateObject("ADODB.Recordset")
		if myid<>"" then
		sqlstt=" and typeid='"&myid&"'"
		end if
		
		sql="select * from mynews where n_title<>'' "&sqlstt&" order by inpx asc"


		rs.open sql,conn,1,1
		rs.pagesize=20
	%>
      <tr>
        <td align="center" bgcolor="#99CCFF" class="td_title">标题</td>
        <td align="center" bgcolor="#99CCFF" class="td_title">日期</td>
        <td align="center" bgcolor="#99CCFF" class="td_title">排序</td>
        <td align="center" bgcolor="#99CCFF" class="td_title">删除</td>
      </tr>
      <%if not (rs.eof and rs.bof) then
		Page = cint(Request.querystring("Page"))
   		If Page < 1 Then Page = 1
   		If Page > rs.PageCount Then Page = rs.PageCount
			showpages rs,Page
	%>
      <%else%>
      <tr> 
        <td colspan=4><center>
            <font color=red>没有你所查的信息</font> </center></td>
      </tr>
      <%end if%>
      <%Sub showpages( rs,Page )
   rs.AbsolutePage = Page		
		for i=0 to rs.pagesize-1
			j=j+1
			if j mod 2 =0 then
				bg="#ededed"
			else 
				bg="#ffffff"
			end if
			%>
      <tr bgcolor=<%=bg%>>
        <td bgcolor="<%=bg%>"><%=rs("n_title")%></td>
        <td bgcolor="<%=bg%>"><%=rs("n_time")%></td>
        <form name="form3" method="post" action="s_check.asp?url=<%="http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("PATH_INFO") & "?" & Request.ServerVariables("QUERY_STRING")%>&t=top">
      </form>
     
        <form name="form3" method="post" action="news_ok.asp?action=px&url=<%="http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("PATH_INFO") & "?" & Request.ServerVariables("QUERY_STRING")%>"><td align="center" bgcolor="<%=bg%>"><input name="inpx" type="text" style="width:40px" id="inpx" value="<%=rs("inpx")%>"><input type="submit" name="Submit4" value="改">
         <input name="id" type="hidden" id="id" value="<%=rs("id")%>"></td></form>
        <td align="center"><a href="news_edit.asp?id=<%=rs("id")%>&url=<%="http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("PATH_INFO") & "?" & Request.ServerVariables("QUERY_STRING")%>">修改</a> | <a href="news_ok.asp?action=del&id=<%=rs("id")%>&url=<%="http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("PATH_INFO") & "?" & Request.ServerVariables("QUERY_STRING")%>" onClick="javascript:return confirm('确实要删除吗?')">删除</a></td>
      </tr>
      <%
		rs.movenext
  		If rs.EOF Then Exit For
	 	Next%>
      <%End Sub%>
      <tr> 
        <td colspan="4" align="center"> <form action=<%=filename%>?keyword=<%=keyword%> method="get" name=form1  >
            <%
		response.write "共<font color=red>"&rs.recordcount&"</font>条信息&nbsp;&nbsp;"
		response.write rs.pagesize&"条一页&nbsp;&nbsp;"
		if Page=1 then 
      		 response.write"[首页]  "
   		end if 
  		 If Page <> 1 Then
  		    Response.Write "<A HREF=?keyword="&keyword&"&id="&myid&"&Page=1>[首页]</A>"
   		    Response.Write "<A HREF=?keyword="&keyword&"&id="&myid&"&Page=" & (Page-1) & ">上一页</A>"
   		End If
   		If Page <> rs.PageCount Then
     		Response.Write "<A HREF=?keyword="&keyword&"&id="&myid&"&Page=" & (Page+1) & ">下一页</A>"
   			Response.Write "<A HREF=?keyword="&keyword&"&id="&myid&"&Page=" & rs.PageCount & ">[尾页]</A>"
  		End If
   		if page= rs.PageCount then 
      		response.write"[尾页]  "
  		end if
		response.write "总共有"&rs.pagecount&"页,&nbsp;目前是第"&page&"页"
		%>
            转到<font class="a"> 
            <input name="page" class="input" value=<%=page%> size="4" maxLength="8">
            <input type="hidden" value=<%=keyword%> name="keyword2">
            页<span lang="en-us"> </span> 
            <input name="button" type="button" class="buttonface" onclick=check() value="Go">
            </font><br>
          </form></td>
      </tr>
    </table>
  </center>  
</div>  
</html>