<!--#include file="conn.asp" -->
<%
strCurrMenu="58"
ThisPage=request.ServerVariables("URL")
strQuery=""
strTitle="最新发布"
if GetVariable("class")<>"" then
	SourCode=conn.execute("Select c_code From web_news_class Where mn_id=" & strCurrMenu & " and id="&GetVariable("class"))(0)
	strQuery=strQuery & " And c_code Like '" & SourCode &"%'"
	strTitle=GetVariable("classname")
end if

if GetVariable("key")<>"" then
	strQuery=strQuery & " And (nTitle Like '%" & GetVariable("key") & "%' or nHtmlText like '%" & GetVariable("key") & "%' or nKey like '%" & GetVariable("key") & "%') "
	strTitle="搜索：" & GetVariable("key")
end if

'从这开始读数据
strSQL="Select * From v_web_news Where nAudit<>0 " & strQuery & " And mn_id=" & strCurrMenu & " Order by ID Desc"
rs.open strSQL,conn,1,1
'分页显示初始化
page=GetVariable("page")
if page="" then
	page=1
else
	page=Cint(page)
end if

Section=GetVariable("section")
if Section="" then
	Section=1
else
	Section=Cint(Section)
end if
'变量赋值
intPageSize=15		'每页显示记录数
intSectionSize=5		'多少页为一段，像GOOGLE一样
PrevSectionText="<FONT face=webdings>7</FONT>"		'上一段的链接文字
NextSectionText="<FONT face=webdings>8</FONT>"		'下一段的链接文字
PrevPageText="<FONT face=webdings>3</FONT>"			'上页的链接文字	
NextPageText="<FONT face=webdings>4</FONT>"			'下页的链接文字

strPageUrl="?class=" & GetVariable("class") & "&classname=" & GetVariable("classname") & "&key=" & GetVariable("key") & "&mnid=" & strCurrMenu

rs.pagesize=intPageSize
intCount=rs.RecordCount 
intPageCount=rs.pagecount
intSectionCount=(intPageCount - 1) \ intSectionSize + 1
if intCount>0 then
	rs.AbsolutePage=page 
end if 
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<link href="images/css.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="common/style.css" type="text/css">
<style type="text/css">
<!--
.t4 {font-family: "宋体";
	font-size: 12px;
	font-weight: bold;
	color: #000000;
	text-decoration: none;
}
-->
</style>
</head>

<body>
<!--#include file="top.asp" -->

<table width="782" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="205" valign="top" background="images/eo_09.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><table width="205" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="29" background="images/eo_07.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="14%">&nbsp;</td>
                  <td width="86%" class="t1">新闻分类</td>
                </tr>
            </table></td>
          </tr>
          <tr>
            <td><table width="71%" height="36" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="10"></td>
              </tr>
              <%
									'开始输出分类
									strcode=""
									for i=1 to Len(SourCode) \ 4
									strcode=strcode&" or c_code like '"&left(SourCode,i*4)&"____'"
									next
									if strcode<>"" then
									strcode="(1<>1"&strcode&" or Len(c_code)=4)"
									else
									strcode=" Len(c_code)=4"
									end if
									strSQL="Select * From web_news_class Where mn_id=" & strCurrMenu&" and " & strcode & "  Order by c_code"
									'response.Write(strsql)
									Set rs0=Server.CreateObject("ADODB.RecordSet")
									rs0.open strSQL,conn,1,1
									for i=1 to rs0.recordcount
									Level=(Len(rs0("c_code"))/4-1)*3
									%>
              <tr>
                <td height="26" valign="top" class="hbt" ><%
			If Len(rs0("c_code"))>4 Then Response.Write "├"
			Response.Write String(Level,"-")
			%>
                  <a href="?class=<%=rs0("id")%>&classname=<%=trim(rs0("c_name"))%>"><%=trim(rs0("c_name"))%></a> </td>
              </tr>
              <% 
										rs0.movenext
									next
									rs0.close
									set rs0=nothing
									%>
            </table></td>
          </tr>
        </table>
          <table width="205" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="29" background="images/eo_07.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="14%">&nbsp;</td>
                  <td width="86%" class="t1">新闻搜索</td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td><table width="100%" border="0" cellspacing="5" cellpadding="0">
                <tr>
                  <td bgcolor="#FFFFFF" scope="row"><form name="form1" method="post" action="?mnid=<%=strCurrMenu%>">
                      <table width="90%" border="0" align="center" cellpadding="7" cellspacing="0" class="t1">
                        <tr>
                          <td height="53" colspan="2" valign="top" class="cn"> 关键字:
                            <input name="key" type="text" id="key">
                          </td>
                        </tr>
                        <tr>
                          <td width="56%" height="3" valign="top" class="cn"><div align="center">
                              <input name="imageField2" type="image" src="images/search.gif" width="53" height="19" border="0">
                          </div></td>
                          <td width="44%" height="3" valign="top" class="cn">搜索帮助</td>
                        </tr>
                      </table>
                  </form>
                      <!--Link Begin-->
                      <%
							isLink=GetKey("Enable",WebUserID,"link")
							if isLink="Yes" then
							%></td>
                </tr>
              </table></td>
            </tr>
          </table>
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="29" background="images/eo_07.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="13%">&nbsp;</td>
                    <td width="87%" class="t1">友情链接</td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                <tr align="center">
                  <td width="100%" scope="row"><table width="76%" border="0" align="center" cellpadding="7" cellspacing="0">
                      <tr>
                        <td height="107" align="center"  valign="top" class="t1"> 　 <span class="cn"><br>
                              <script language="JavaScript" src="admin/link/link.asp"></script>
                        </span></td>
                      </tr>
                    </table>
                      <span class="t1">
                      <%
							  end if
							  %>
                      <!--Link End-->
                    </span></td>
                </tr>
              </table></td>
            </tr>
          </table></td>
      </tr>
    </table></td>
    <td width="581" valign="top"><table width="577" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="29" background="images/eo_08.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="7%">&nbsp;</td>
            <td width="93%" class="t2">新闻动态</td>
          </tr>
        </table></td>
      </tr>
    </table>
      <table width="99%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#EFEFEF">
        <tr>
          <td valign="top" bgcolor="#FFFFFF"><table width="500"  height="100%" border="0" cellpadding="0" cellspacing="0" class="t1">
            <tr>
              <td height="264"  width="500"  valign="top"><TABLE width="90%" 
                          border=0 align="center" cellPadding=0 cellSpacing=0>
                  <TBODY>
                    <TR>
                      <TD><TABLE cellSpacing=0 cellPadding=0 width="100%" 
                          border=0>
                          <TBODY>
                            <TR>
                              <TD height="25" class="cn">共<%=intCount%>结果</TD>
                            </TR>
                            <TR>
                              <TD width="65%" height="25" class="cn"><table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
                                  <%
										  '开始输出最新新闻
										   for i=1 to intPageSize
												if rs.eof then exit For
												if i mod 2 =0 then
													strColor="#FFFFFF"
												else
													strColor="#F9F9F9"
												end if
										  %>
                                  <tr>
                                    <td width="10%" height="22" align="right">· </td>
                                    <td width="90%" height="22"><a href="newshow.asp?id=<%=trim(rs("ID"))%>&mnid=<%=strCurrMenu%>&classname=新闻动态&uppage=<%=ThisPage%>" target="_blank" class="t1"><%=trim(rs("nTitle"))%></a></td>
                                  </tr>
                                  <%
											rs.movenext
										next
										%>
                              </table></TD>
                            </TR>
                            <TR>
                              <TD height="25" class="cn">&nbsp;</TD>
                            </TR>
                          </TBODY>
                      </TABLE></TD>
                    </TR>
                  </TBODY>
                </TABLE>
                  <br>
                  <table width="92%" border="0" align="center">
                    <tr>
                      <td height="1" background="images/linebg.gif"></td>
                    </tr>
                    <tr>
                      <td height="28" align="right" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="18" align="right" class="cn"> 共有<%=intCount%>记录，分<%=intPageCount%>页，当前页<%=Page%>，每页显示<%=intPageSize%>条记录
                              <%
			'计算每一段的开始页
			intStarPage=(Section-2) * intSectionSize + 1
			'前一段
			if Section<=1 then
				response.Write(PrevSectionText & " ")
			else
				response.Write("<a href='" & strPageUrl & "&page=" & intStarPage & "&section=" & Section-1 & "'>" & PrevSectionText & "</a> ")
			end if 
			
			'显示页码列表
			response.Write("第")
			intStarPage=(Section-1) * intSectionSize + 1
		    for p=intStarPage to intStarPage + intSectionSize - 1
				if p > intPageCount then exit for
				if p=page then
		    		response.Write("<strong>[" & p & "]</strong> ")
				else
		    		response.Write("<a href='" & strPageUrl & "&page=" & p & "&section=" & Section & "'>[" & p & "]</a> ")
				end if	
		    next
			response.Write("页")
			'后一段
			intStarPage=(Section) * intSectionSize + 1
			if Section>=intSectionCount then
				response.Write(" " & NextSectionText)
			else
				response.Write(" <a href='" & strPageUrl & "&page=" & intStarPage & "&section=" & Section+1 & "'>" & NextSectionText & "</a> ")
			end if 
		  %>
                            </td>
                          </tr>
                      </table></td>
                    </tr>
                    <tr>
                      <td height="23" align="right" >&nbsp;</td>
                    </tr>
                </table></td>
            </tr>
          </table></td>
        </tr>
      </table></td>
  </tr>
</table>
<!--#include file="end.asp" -->
<script language="JavaScript" src="common/init.js"></script><br><script language=Javascript src="common/tranbig5.Js"></script>
</body>
</html>



