<!--#include file="conn.asp" -->
 <% 
dim bid :bid=Trim(Request.QueryString("bid"))
if bid="" then 
bname="新闻中心"
else
bname=GetNewBname(bid)
end if
 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=bname%>-石家庄金太阳生物有机肥有限公司</title>
<meta name="keywords" content="石家庄金太阳生物有机肥有限公司 石家庄金太阳 金太阳 ">
 <meta name="description" content="石家庄金太阳生物有机肥有限公司 石家庄金太阳 金太阳 ">
<link href="css/css.css" rel="stylesheet" type="text/css" />
<link href="css/product.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!--头部-->
 <!--#include file="header.asp" -->
<!--头部 end-->


<!--内容部分-->
<div id="product_wrap">
  <!--#include file="left_news.asp" -->
  <div id="rightside">
    <h5><%=bname%><span><a href="/">首页</a> > <a href="news.asp">新闻中心</a> ><%=bname%></span></h5>
<%  
set rs=server.createobject("adodb.recordset")
sql="Select * from news where id>0"
if bid<>"" then sql=sql&" and bid="&bid
sql=sql&" order by id desc"

rs.open sql,conn,1,1
if err.number <> 0 then
response.write "数据库操作失败："&err.description
response.End()
end if

'分页信息头部
filepath=request.servervariables("path_info")
'page=1 '设置变量初始值PAGE=1
page=request.querystring("page") 'page值为接受值 
rs.PageSize =4 '每页显示记录数
if Not IsEmpty(trim(Request("Page"))) then '如果PAGE已经初始化...
Page = CInt(Request("Page")) '接收PAGE并化为数字型赋给PAGE变量 
if Page > rs.PageCount then '如果接收的页数大于总页数
rs.AbsolutePage = rs.PageCount '设置当前显示页等于最后页 
elseif Page <= 0 then '如果page小于等于0
Page = 1 '设置PAGE等于第一页
else
rs.AbsolutePage = Page '如果大于零,显示当前页等于接收的页数 
end if
End if

for i = 0 to (rs.PageSize-1)
 
%>
    <dl class="news_dl">
      <dt><a href="news_show.asp?id=<%=rs("id")%>" target="_blank"><%=rs("title")%></a></dt>
      <dd><%=left(RemoveHTML(rs("content")),140)%><span><%=FormatDateTime(rs("addtime"),2)%></span></dd>
    </dl>
    
 <%
RS.movenext 
if RS.eof then
i = i + 1
exit for
End If
next
%> 	
	
  </div>
  <div class="clear"></div>
</div>

<div  style="margin:5px auto;text-align:center">
  <form action="<%=filepath%>" method="get">
    <%if rs.pagecount<>1 and rs.pagecount<>0 then%>
    <%if page>1 then%>
    <%if page<rs.pagecount then %>
[<a Href="<%=filepath%>?Page=<% = 1%>&bid=<%=bid%>">首页</a>]
    [<a Href="<%=filepath%>?Page=<% = page -1 %>&bid=<%=bid%>">上一页</a>]
    [<a Href="<%=filepath%>?Page=<% = page + 1%>&bid=<%=bid%>">下一页</a>]
    [<a Href="<%=filepath%>?Page=<% = rs.PageCount%>&bid=<%=bid%>">尾页</a>]
    <%else%>
    [<a Href="<%=filepath%>?Page=<% = 1%>&bid=<%=bid%>">首页</a>]
    [<a Href="<%=filepath%>?Page=<% = page -1 %>&bid=<%=bid%>">上一页</a>] 
    [下一页] [尾页]
    <% end if %>
    <%else%>
    [首页] [上一页]
    [<a Href="<%=filepath%>?Page=<% = page + 1%>&bid=<%=bid%>">下一页</a>] 
    [<a Href="<%=filepath%>?Page=<% = rs.PageCount%>&bid=<%=bid%>">尾页</a>]
    <%end if %>
    <%else%>
    [首页] [上一页] [下一页] [尾页]
    <%end if%>
    <!--尾部-->
    [页次:<font color=red><b><%=page%></b></font>/<%=rs.PageCount%>]
    [共<%=rs.RecordCount%>篇 <font color=red><b><%=rs.PageSize%></b></font>篇/页]
    转到
    <input name="page" size=2 value="<%=page%>">
    页
    <input name="submit" type="submit" value="Enter">
  </form>
</div>
<% 
rs.close :set rs=nothing
 %>
<!--内容部分 end-->
<!--底部-->
 <!--#include file="footer.asp" -->
<!--底部 end-->
</body>
</html>
