<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!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">
<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>新闻中心-<%=webname%></title>
<meta name="keywords" content="<%=keywords%>" />
<meta name="description" content="<%=description1%>" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.idtabs.js"></script>
<script type="text/javascript" src="js/swf.js"></script>
</head>
<body>
<!--#include file="top.asp" -->
<table width="995" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="20"><div align="center"></div></td>
  </tr>
</table>
<table width="995" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="189" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td style="background:url(images/index_left_top.gif) top no-repeat left; height:50px;">&nbsp;</td>
        </tr>
      <tr>
        <td style="background:url(images/fenlei_bottom2.gif) bottom no-repeat left;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
           <%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * FROM BJX_class1 where typeid=1 order by anclassidorder asc",conn,1,1
if rs.recordcount=0 then
response.write "<br>目前没有商品分类"
else
while not rs.eof
%>
		 
		  <tr>
            <td><b><a href="products.asp?anid=<%=rs("anclassid")%>&typeid=<%=rs("typeid")%>" class="a1"><img src="images/list_ico1.gif" width="28" height="23" align="absmiddle" /><%=rs("anclass")%></a></b></td>
          </tr>
          <tr>
            <td style="padding-left:28px; padding-top:5px;">
			<%set rss=server.CreateObject("adodb.recordset")
		  rss.open "select * FROM BJX_class2 where typeid=1 and anclassid="&rs("anclassid")&" order by nclassidorder asc",conn,1,1		
		  if not rss.eof then
		i=1
		do while not rss.eof%>
			 <a href="products.asp?anid=<%=rss("anclassid")%>&nid=<%=rss("nclassid")%>&typeid=<%=rss("typeid")%>"><%=rss("nclass")%></a> <br />
			  <%
	    rss.movenext
         i=i+1
    	 loop
		rss.close
		end if
		
	%>
               </td>
          </tr>
		  <%
	rs.movenext
wend
end if
rs.close
set rs=nothing
%>
         
        
          <tr>
            <td>&nbsp;</td>
          </tr>
        </table></td>
      </tr>
    </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="5"><div align="center"></div></td>
        </tr>
      </table>
    </td>
    <td width="10" valign="top"><div align="center"></div></td>
    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="40">您当前的位置： <a title="" href="index.asp" alt="">首页</a>  &gt;&gt; <b>新闻中心</b></td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td style="padding:10px; font-size:14px; line-height:200%;">
		   <%set rs=server.createobject("adodb.recordset")
			rs.open "select * from BJX_news where newstype=1 order by adddate desc",conn,1,1
		
		if rs.recordcount=0 then 
		%> 
		
		 <table width="90%" border="0" cellspacing="0" cellpadding="0">
                <tr>
				<td align="center">暂无新闻				</td>
				</tr>
			</table>
				 <%
		else
	
	  		rs.PageSize =25 
			iCount=rs.RecordCount 
			iPageSize=rs.PageSize
    		maxpage=rs.PageCount 
    		page=request("page")
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
    rs.AbsolutePage=Page
	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
	%>
		  <table width="90%" border="0" cellspacing="0" cellpadding="0">
          <%
				  n=1
			For i=1 To x
			%>
          <tr>
            <td width="81%" height="20">·<a href="shownews.asp?newsid=<%=rs("newsid")%>"><%=rs("newsname")%></a></td>
            <td width="19%"><%=rsdate("adddate")%></td>
          </tr>
           <%
			rs.movenext
			n=n+1
		    next
			%>
        </table>
		<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><%
		call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
		
		rs.close
		set rs=nothing
Sub PageControl(iCount,pagecount,page,table_style,font_style)
    Dim query, a, x, temp
    action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
    query = Split(Request.ServerVariables("QUERY_STRING"), "&")
    For Each x In query
        a = Split(x, "=")
        If StrComp(a(0), "page", vbTextCompare) <> 0 Then
            temp = temp & a(0) & "=" & a(1) & "&"
        End If
    Next
    Response.Write("<table width=90% border=0 cellpadding=0 cellspacing=0  align=center >" & vbCrLf )        
    Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
    Response.Write("<TD align=center height=35>" & vbCrLf )
    Response.Write(font_style & vbCrLf )    
    if page<=1 then
        Response.Write ("首页 " & vbCrLf)        
        Response.Write ("上页 " & vbCrLf)
    else        
        Response.Write("<A HREF=" & action & "?" & temp & "Page=1>首页</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">上页</A> " & vbCrLf)
    end if
    if page>=pagecount then
        Response.Write ("下页 " & vbCrLf)
        Response.Write ("尾页 " & vbCrLf)            
    else
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">下页</A> " & vbCrLf)
        Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & ">尾页</A> " & vbCrLf)            
    end if
    Response.Write(" 页次：" & page & "/" & pageCount & "页" &  vbCrLf)
    Response.Write(" 共有" & iCount & "条新闻" &  vbCrLf)
    Response.Write(" 转到" & "<INPUT TYEP=TEXT CLASS=wenbenkuang NAME=page SIZE=2 Maxlength=5 VALUE=" & page & ">" & "页"  & vbCrLf & "<INPUT CLASS=go-wenbenkuang type=submit value=GO>")
    Response.Write("</TD>" & vbCrLf )                
    Response.Write("</TR></form>" & vbCrLf )        
    Response.Write("</table>" & vbCrLf )        
End Sub
%></td>
  </tr>
</table>
<%end if%>
		  </td>
        </tr>
      </table></td>
  </tr>
</table>
<!--#include file="bottom.asp" -->
</body>
</html>

