<!--#include file="include/config.asp" -->
<%
call aspsql()
action=trim(request("class"))
Set rs = conn.Execute("select * from bconfig") 
title=rs("newstitle"&action)
if title="" then response.redirect "news_home.asp"
set rs=nothing
pages=30
%>
<HTML>
<HEAD>
<TITLE>新闻公告 - <%=title%></TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="description" content="<%=sitedescription%>">
<meta name="keywords" content="<%=sitekeywords%>">
<LINK href="images/news/style.css" type=text/css rel=stylesheet>
</HEAD>
<center>
  <!--#include file="top.asp"-->

  <table width="932" border="0" cellpadding="0" cellspacing="0">
    <tr> 
      <td width="180" align="left" valign="top" background=images/left_bg.gif><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
          <TBODY>
            <TR> 
              <TD><IMG height=22 src="list/zbhz_shopping_car.gif" 
            width=180></TD>
            </TR>
            <TR> 
              <TD bgColor=#fcd8e7><IFRAME border=0 name=new_date11 marginWidth=0 
            marginHeight=0 src="gouwuche.asp" frameBorder=0 
            noResize width=178 scrolling=no height=83 spacing="0" 
            vspale="0"></IFRAME></TD>
            </tr>
            <TR> 
              <TD height=5 bgcolor="#FFFFFF"></TD>
            </tr>
            <TR> 
              <TD background="images/left_bg.gif"><IMG height=20 src="list/pic_fl.gif" 
              width=180></TD>
            </tr>
            <tr> 
              <td> <TABLE align=center cellSpacing=0 cellPadding=0 width=175 border=0>
                  <tr> 
                    <td width=175 colspan=3 height=10 ></td>
                  </tr>
                  <%
color1="77CC00"     '分类列表中大类的颜色
color2="0066ff"     '分类列表中中类的颜色
viewmidclass=1      '是否显示中类，1表示显示，0表示不显示
dim larcode(100)    '最多支持100个大类
dim midcode(20)     '最多支持20个中类

	'以下是分类列表，首先读取全部大类，然后根据每个大类读取各自的中类
	response.write "<table width='175' border='0' align='center' cellpadding=1 cellspacing=1>"
	Dim a,b,c
	sqllar="select Distinct LarCode,LarSeq from bclass order by LarSeq"
	Set rsprodtree=Server.CreateObject("ADODB.RecordSet") 
	rsprodtree.Open sqllar,conn,1,1 

	if rsprodtree.bof and rsprodtree.eof then
		response.write "<tr><td width=175 colspan=3 height=100 align=center>对不起，本商城暂未开业</td></tr>"
	else
		
		i=0
		Do While Not rsprodtree.eof	
		i=i+1
		larcode(i)=rsprodtree("LarCode")
		rsprodtree.movenext	
		if rsprodtree.eof then exit do
		Loop
	end if
	set rsprodtree=nothing
	set sqllar=nothing


	
	FOR t=1 to i
	response.write "<tr><td width='175'  class='dfont' height=25 colspan=3 valign=middle><B>&nbsp;&nbsp;&nbsp;&nbsp;<img src=images/dot.gif  border=0>&nbsp;&nbsp;<a href='class.asp?LarCode="&LarCode(t)&"'>"&LarCode(t)&"</B></a></td></tr>"
	response.write "<tr>"

if viewmidclass<>0 then           '是否显示中类
	'以下是根据前面读取的大类名称，读取各个大类下的中类
	sqllar="select MIDCode,MIDSeq from bclass where larcode='"&larcode(t)&"' order by MIDSeq"
	Set rsprodtree=Server.CreateObject("ADODB.RecordSet") 
	rsprodtree.Open sqllar,conn,1,1 
		m=0
		Do While Not rsprodtree.eof	
		m=m+1
		midcode(m)=rsprodtree("midCode")
		rsprodtree.movenext	
		if rsprodtree.eof then exit do
		Loop

	set rsprodtree=nothing
	set sqllar=nothing

		for n=1 to m
		if n mod 2<>0 then
		response.write "<td width=85 align=right  class='dfont'><a href='class.asp?LarCode="&LarCode(t)&"&MidCode="&MidCode(n)&"'>"&MidCode(n)&"</a></TD>"
		else
		response.write "<td align=center width=5>|</td><td  width=85 class='dfont'><a href='class.asp?LarCode="&LarCode(t)&"&MidCode="&MidCode(n)&"'>"&MidCode(n)&"</a></TD></tr><tr>"
	    end if
		next
			response.write "<tr><td width=175 colspan=3 height=10 ></td></tr>"

end if

	next

%>
                </table></td>
            </tr>
            <TR> 
              <TD bgcolor="#FFFFFF" height=30 valign="middle"><IMG height=25 src="list/pic_tj.gif" 
              width=180></TD>
            </TR>
            <tr> 
              <td> 
                <%
set cqrsprod=conn.execute("select  * from bproduc where online=true order by ClickTimes desc,AddDate desc")
Do While Not cqrsprod.eof
prodname=lleft(cqrsprod("ProdName"),22)
response.write "<tr><td class=td1 height=22>&nbsp;&nbsp;&nbsp;&nbsp;·<a href='list.asp?ProdId="&cqrsprod("ProdId")&"'><font alt='热门商品TOP"&K+1&"'>"&prodname&"</font></a></td></tr>"
k=k+1
if k>renmen_num-1 then exit do
if cqrsprod.eof then exit do
cqrsprod.movenext
loop
set cqrsprod=nothing
%>
              </td>
            </tr>
          </TBODY>
        </TABLE></td>
      <td width="9"></td>
      <td width="743" align="center" valign="top" ><TABLE width=743 
                  border=0 cellPadding=0 cellSpacing=0 bgColor=#f1f1f1>
          <TBODY>
            <TR> 
              <TD bgcolor="#FFFFFF">&nbsp;</TD>
              
            <TD height=30 bgcolor="#FFFFFF">目前位置：<a href=main.asp>首页</a> > <a href="news_home.asp">新闻公告</a> 
              > <%=title%></TD>
              <TD bgcolor="#FFFFFF">&nbsp;</TD>
            </TR>
            <TR> 
              <TD width=10><IMG height=12 
                        src="images/news/com_article_01.gif" width=10></TD>
              <TD width=532 height=12></TD>
              <TD width=10><IMG height=12 
                        src="images/news/com_article_02.gif" width=10></TD>
            </TR>
            <TR> 
              <TD></TD>
              <TD align=middle> <TABLE cellSpacing=0 cellPadding=0 width="100%" 
border=0>
                  <TBODY>
                    <TR> 
                      <TD align=middle> <TABLE class=com_table_zb cellSpacing=0 
                              cellPadding=0 width=720 bgColor=#ffffff 
                                border=0>
                          <TBODY>
                            <TR> 
                              <TD width=10 height=10></TD>
                              <TD height="30" align="left" valign="middle"><B><FONT color=#ff6600><%=title%></font></b></TD>
                              <TD width=10 height=10></TD>
                            </TR>
                            <TR> 
                              <TD></TD>
                              <TD><table cellpadding=2 cellspacing=0 border=0  width=100% align=center  class=com_table_zb>
                                  <%
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from News where online=true and now()<OffDate and now()>=PubDate and NewsClass='"&action&"'  order by uup desc,Pubdate desc"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
response.write "<tr><td height=50 align=center>暂时没有新闻文章</td></tr>"
else
rs.pageSize = pages '每页记录数
allPages = rs.pageCount	'总页数
page = Request("page")	'从浏览器取得当前页

'if是基本的出错处理

If not isNumeric(page) then page=1

if isEmpty(page) or clng(page) < 1 then
page = 1
elseif clng(page) >= allPages then
page = allPages 
end if
rs.AbsolutePage = page			'转到某页头部
do while not rs.eof and pages>0
%>
                                  <tr>
                                    <td width=55% height="20"> <a href="news.asp?NewsId=<%=rs("NewsId")%>"><%=lleft(rs("NewsTitle"),40)%></a></td>
                                    <td width=25%><%=rs("PubDate")%></td>
                                    <td width=20%>人气值：<%=rs("cktimes")%></td>
                                  </tr>
                                  <%
pages = pages - 1
rs.movenext
if rs.eof then exit do
loop

end if
%>
                                </table></TD>
                              <TD></TD>
                            </TR>
                            <TR> 
                              <TD width=10 height=10></TD>
                              <TD>&nbsp; </TD>
                              <TD width=10 
                            height=10></TD>
                            </TR>
                          </TBODY>
                        </TABLE></TD>
                    </TR>
                    <TR> 
                      <TD height=5></TD>
                    </TR>
                  </TBODY>
                </TABLE></TD>
              <TD></TD>
            </TR>
            <TR> 
              <TD><IMG height=12 
                        src="images/news/com_article_03.gif" width=10></TD>
              <TD height=12></TD>
              <TD><IMG height=12 
                        src="images/news/com_article_04.gif" 
                    width=10></TD>
            </TR>
          </TBODY>
        </TABLE>
        <table width="743" height="20" border="0" cellpadding="0" cellspacing="0">
          <tr> 
            <td>
              <%
call listpage()
%>
            </td>
          </tr>
        </table></td>
    </tr>
  </table>
  <!--#include file="down.asp"-->
</BODY></CENTER>

</HTML>
<%
sub listpage()
'if allpages<=1 then exit sub
response.write "<tr><td height=30> </td></tr>"
response.write "<tr><td align=center>"
response.write "<br>总计 "&RS.RecordCount&" 篇文章 &nbsp;"
if page = 1 then
response.write "<font color=darkgray>首页 前页</font>"
else
response.write "<a href=allnews.asp?class="&action&"&page=1>首页</a> <a href=allnews.asp?class="&action&"&page="&page-1&">前页</a>"
end if
if page = allpages then
response.write "<font color=darkgray> 下页 末页</font>"
else
response.write " <a href=allnews.asp?class="&action&"&page="&page+1&">下页</a> <a href=allnews.asp?class="&action&"&page="&allpages&">末页</a>"
end if
response.write " &nbsp; 第"&page&"页 共"&allpages&"页 </td></tr>"
end sub

rs.close
set rs=nothing
conn.close
set conn=nothing
%>
