<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<html>
<head>
<title><%=webname%>--商品专题</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="webtop.asp"-->
<div align="center">
<TABLE id=table1 style="MARGIN: 0px auto; BORDER-BOTTOM: #ffffff 0px solid" 
height="100%" cellSpacing=0 borderColorDark=#FFFFFF cellPadding=0 width=976 
borderColorLight=#CECECE border=1>
  <TBODY>
  <TR><!--sart left-->
    <TD vAlign=top width=234 bgcolor="#F1F1F1">
      <p align="center">   <!--#include file="left.asp"--></TD><!---end left--><!--start right-->
    <TD vAlign=top align=middle width=736>
            <br>
		<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" id="table2">
              <tr> 
                <td height="1" bgcolor="cccccc"><img src="images/dot_03.gif" width="9" height="1" border="0"></td>
              </tr>
              <tr> 
                <td height="25" bgcolor="efefef"><strong>&nbsp;&nbsp;</strong><B><img src="images/o.gif" width="15" height="15"> 
                  </B><strong>商品专题</strong></td>
              </tr>
              <tr> 
                <td height="1" bgcolor="cccccc"><img src="images/dot_03.gif" width="9" height="1" border="0"></td>
              </tr>
            </table>
            <br>
            <%set rs=server.createobject("adodb.recordset")
		rs.open "select * From shop_zhuanti  order by newsid desc",conn,1,1
		if rs.recordcount=0 then 
		%>
            <table width="370" border="0" cellspacing="0" cellpadding="5" align="center" id="table3">
              <tr> 
                <td align=center>暂无商品专题</td>
              </tr>
            </table>
            <%
		else
	  		rs.PageSize =35 '每页记录条数
			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="98%" border="0" cellspacing="0" cellpadding="5" align="center" id="table4">
              <%
			For i=1 To x
			%>
              <tr onmouseover="this.bgColor='#C5E5F6';this.style.color='#000000';" style="CURSOR: hand; COLOR: #000000"  onmouseout="this.bgColor='ffffff';this.style.color='#000000';" bgColor="#ffffff" name="852753" > 
                <td align=center height=20 width="21">
				<img border="0" src="feed.gif" width="14" height="14"> </td>
                <td height=20 align=left><a href=listzt.asp?id=<%=rs("newsid")%>> 
                  <%=replace(trim(rs("title")),"<br>","")%></a></td>
                <td align=left height=20 width="116"><%=year(rs("updatetime"))&"."&month(rs("updatetime"))&"."&day(rs("updatetime"))%></td>
              </tr>
              <%
			rs.movenext
		    next
			%>
            </table><br>
            <%
		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 " & Table_style & ">" & vbCrLf )        
    Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
    Response.Write("<TD align=right>" & 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 NAME=page SIZE=1 Maxlength=5 VALUE=" & page & ">" & "页"  & vbCrLf & "<INPUT type=submit style=""font-size: 9pt"" value=GO class=b2>")
    Response.Write("</TD>" & vbCrLf )                
    Response.Write("</TR></form>" & vbCrLf )        
    Response.Write("</table>" & vbCrLf )        
End Sub
%>
          <p>　</TD><!--end right--></TR></TBODY></TABLE></div>
<!--#include file="copyright.asp"-->
</body>
</html>
