<!--#include file="conn.asp"-->
<!--#include file="config.asp"--> 
<!--#include file="include/header.asp"--> 
<title><%=webname%>--商品专题</title> 
<%
Dim Intcatid,strOrder,strcat,strcategory
Intcatid = 0
Intcatid=SafeRequest("catid",1)
strcat = "<a href=productnews.asp>商品专题</a>"
 set rs=server.CreateObject("adodb.recordset")
If Intcatid <> 0 Then
rs.open "select category from category where categoryid="&Intcatid&" ",conn,1,1 
strcategory = trim(rs("category"))
rs.close 
strcat = strcat &"－><a href=productnews.asp?catid="&Intcatid&" target=_blank>"& strcategory &"</a> "
Else

End If
%>
<TABLE width="980" BORDER="0" CELLSPACING="0" CELLPADDING="0" class=table-zuoyou align="center" bgcolor="#F6EFDC" >
<TR><TD HEIGHT="30" bgcolor="#999999" width="75" class=table-xia><FONT COLOR="#F6EFDC">&nbsp;<b>您的位置：</b></FONT></TD>
<td class=table-xia>&nbsp;<a href="index.asp"><%=webname%></a>－&gt;<a href="productnews.asp"><% = strcat %></a></td></TR></table>

<%
				Const MaxPerPage=20
   				dim totalPut   
   				dim CurrentPage
   				dim TotalPages
   				dim j
   				dim sql
    			if Not isempty(SafeRequest("page",1)) then
      				currentPage=Cint(SafeRequest("page",1))
   				else
      				currentPage=1
   				end if 
	
	rs.open "select newsid,newsname,newscontent,addname,adddate from news Where categoryid = 1001 Order By adddate desc ",conn,1,1
	
				
  				if rs.eof And rs.bof then
       				Response.Write "<p align='center' class='contents'> 您还没有添加产品专题！</p>"
   				else
	  				totalPut=rs.recordcount

      				if currentpage<1 then
          				currentpage=1
      				end if

      				if (currentpage-1)*MaxPerPage>totalput then
	   					if (totalPut mod MaxPerPage)=0 then
	     					currentpage= totalPut \ MaxPerPage
	   					else
	      					currentpage= totalPut \ MaxPerPage + 1
	   					end if
      				end if

       				if currentPage=1 then
            			showContent
            			showpage totalput,MaxPerPage,"productnews.asp"
       				else
          				if (currentPage-1)*MaxPerPage<totalPut then
            				rs.move  (currentPage-1)*MaxPerPage
            				dim bookbrand
            				bookbrand=rs.bookbrand
            				showContent
             				showpage totalput,MaxPerPage,"productnews.asp"
        				else
	        				currentPage=1
           					showContent
           					showpage totalput,MaxPerPage,"productnews.asp"
	      				end if
	   				end if
   				   				end if

   				sub showContent
       			dim i
	   			i=0

			%> 
<TABLE width="980" BORDER="0" CELLSPACING="0" CELLPADDING="0" class=table-zuoyou align="center" bgcolor="#F6EFDC" >
<TR ALIGN="center" height=30> 
<TD width="50%" class=table-youxia>信息主题</TD>
<TD width="25%" class=table-youxia>发布人</TD>
<TD width="25%" class=table-xia>发布时间</TD></TR> 
<%do while not rs.eof%>
 <TR ALIGN="center" height=25>
 <TD class=table-youxia STYLE="PADDING-LEFT: 6px" align="left">
 <a href=# onClick="javascript:window.open('news.asp?id=<% = rs("newsid") %>','','width=580,height=500,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;">
<%=trim(rs("newsname"))%></A></TD>
 <TD class=table-youxia> <%=trim(rs("addname"))%></TD>
 <TD class=table-xia><%=rs("adddate")%></TD></TR> 
<%i=i+1
			if i>=MaxPerPage then Exit Do
			rs.movenext
		  loop
		  rs.close
		  set rs=nothing%><tr><td colspan="3"><%  
				End Sub   
  
				Function showpage(totalnumber,maxperpage,filename)  
  				Dim n
  				
				If totalnumber Mod maxperpage=0 Then  
					n= totalnumber \ maxperpage  
				Else
					n= totalnumber \ maxperpage+1  
				End If %>
				
				<form method=Post action= <% = filename %>>
				<p align='center'> 
				<%
				If CurrentPage<2 Then  %>
				首 页 上一页
				<%
				Else   %>
				<a href=<% = filename %>?page=1>首 页</a>
				<a href=<% = filename %>?page=<% = CurrentPage-1 %>>上一页</a>
				<%
				End If	
				If n-currentpage<1 Then  %>
				下一页 末 页
				<%
				Else   %>
				<a href=<% = filename %>?page=<% = (CurrentPage+1) %>>下一页</a>
				<a href=<% = filename %>?page=<% = n %>>末 页</a>
				<%
				End If  %>
					第 <b><% = CurrentPage %></b> 页 共 <b><% = n %></b> 页
				共&nbsp;<b><% = totalnumber %></b>&nbsp;条信息　每页 <b><% = maxperpage %></b> 条信息
				转到第：<input type='text' name='page' size=2 maxlength=10 class=smallInput value=<% = currentpage %>>
				页<input type='submit'  class='contents' value='跳转' name='cndok'></form>
				<%
				End Function  
			%> </td></tr></TABLE>
			<!--#include file="include/footer.asp"--> 
<script language=javascript>
function mm()
{
   var a = document.getElementsByTagName("input");
   if(a[0].checked==true){
   for (var i=0; i<a.length; i++)
      if (a[i].type == "checkbox") a[i].checked = false;
   }
   else
   {
   for (var i=0; i<a.length; i++)
      if (a[i].type == "checkbox") a[i].checked = true;
   }
}
</script>
