
<!--#include file="Include/Iheeo_Conn.asp"-->
<!--#include file="Include/Iheeo_config.asp"-->
<html><head><title><%=webname%>--商城动态</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="Include/Iheeo_head.asp"-->
<TABLE cellSpacing=0 cellPadding=0 width=970 align=center border=0>
  <TBODY>
    <TR>
      <TD class=b vAlign=top align=left><table width="100%" align="center" border="0" cellspacing="0" cellpadding="0" class="table-zuoyou">
        <tr>
          <td background="images/class_bg.jpg" height=50>　<img src="images/ring02.gif" width="23" height="15" align="absmiddle"> <a href=index.asp><%=webname%></a> >> 商城动态</td>
        </tr>
        <tr>
          <td><table width=100% align=center class=table-shang border=0 cellpadding=0 cellspacing=0 bgcolor=#f1f1f1>
              <TR>
                <TD bgColor=#ffffff height=1></TD>
              <tr>
                <td align=center height=30>商城动态</td>
              </tr>
              <tr>
                <TD bgColor=#cccccc height=1></TD>
              </tr>
              <tr>
                <TD bgColor=#f1f1f1 height=3></TD>
              </TR>
          </table></td>
        </tr>
        <tr>
          <td valign="top" bordercolor="#FFFFFF" bgcolor="#FFFFFF"><%set rs=server.createobject("adodb.recordset")
		rs.open "select * from BJX_news  order by adddate desc",conn,1,1
		if rs.recordcount=0 then 
		%>
              <table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
                <tr>
                  <td align=center>暂无新闻</td>
                </tr>
              </table>
              <%
		else
	  		rs.PageSize =10 '每页记录条数
			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="100%" border="0" cellspacing="0" cellpadding="5" align="center">
                <%
			For i=1 To x
			%>
                <tr>
                  <td align=center height=24 width="10%" class="table-xia"><img src="images/ring01.gif"></td>
                  <td  height=24 width="80%" class="table-xia"><a href="javascript:;" onClick="javascript:window.open('news.asp?id=<%=rs("newsid")%>','','width=432,height=288,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"><%=replace(trim(rs("newsname")),"<br>","")%></a> (<font color=red><%=rs("viewcount")%></font>)</td>
                  <td align=center height=24 width="20%" class="table-xia"><%=year(rs("adddate"))&"."&month(rs("adddate"))&"."&day(rs("adddate"))%></td>
                </tr>
                <%
			rs.movenext
		    next
			%>
              </table>
              <%
		call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
		end if
		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=100% border=0 cellpadding=0 cellspacing=0 bgcolor=#f1f1f1>" & 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></TD>
    </TR>
  </TBODY>
</TABLE>
<!--#include file="Include/Iheeo_service.asp"-->
<!--#include file="Include/Iheeo_foot.asp"-->
</body>
</html>
