<!--#include file="inc/conn.asp"-->
<!--#include file="top.asp"-->
<%
'判断面码是否是数字
dim founder
founder=false
if request.querystring("page")<>"" then
if not IsNumeric(request("page")) then
founder=true
end if
end if
if founder=true then
response.write "<script language=JavaScript>" & "alert('页码参数传递错误！');" & "history.back()" & "</script>"
else

	if request.querystring("id")<>"" then
		if not IsNumeric(request.querystring("id")) then
			response.Write("<script language='javascript'>alert('对不起,您输入了非法参数!');javascript:history.go(-1)</script>")	
			response.end 
		end if
		strSQL="Select * From News where sort_id="&request.querystring("id")&" order by news_id desc"
	else
		strSQL="Select * From News order by news_id desc"	
	end if
		Set rs1=Server.CreateObject("Adodb.Recordset")
		rs1.open strSQL,conn,1,1
		
%>
<table width="1001" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="160" height="400" align="left" valign="top" background="images/bg_left.jpg">
	<table border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="146" height="28" align="center" background="images/cpfl.jpg" style="color:#FFFFFF; "><b>新 闻 分 类</b></td>
      </tr>
      <tr>
        <td height="100" valign="top" style="padding-top:20px;padding-bottom:20px; ">
		<table width="146" border="0" cellspacing="0" cellpadding="0">
		  <%
		  '调用新闻分类
		  set rs2=conn.execute("select * from newssort order by sort_id desc")
		  do while not rs2.eof
		  %>
          <tr>
            <td height="25" align="center" bgcolor="#EEEFF1">
			<a href="news.asp?id=<%=rs2("sort_id")%>"><%=rs2("sort_name")%></a>
			</td>
          </tr>
          <tr>
            <td height="6"></td>
          </tr>
		  <%
		  rs2.movenext
		  loop
		  if rs2.eof and rs2.bof then
		  response.write "<tr><td>请添加新闻分类！</td></tr>"
		  end if
		  rs2.close
		  set rs2=nothing
		  %>
        </table>
		</td>
      </tr>
    </table>
	</td>
    <td align="center" valign="top"><table width="675" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="28" align="center" background="images/bg1.jpg">
		</td>
      </tr>
      <tr>
        <td height="34" background="images/daohang.jpg" style="padding-left:25px;">您的当前位置：<a href="index.asp">首页</a> --&gt; 新闻动态 </td>
      </tr>
      <tr>
        <td height="260" valign="top" background="images/bg2.jpg" style="padding-left:25px;padding-right:22px;padding-top:10px;">
		<table width="614" border="0" cellspacing="0" cellpadding="4">
		<%
		'调用所有新闻列表
		if not rs1.eof then
		rs1.pagesize=20
			if Trim(request("page"))<>"" then
				page=clng(request("page"))
					if page<1 or page>rs1.pagecount then
					response.write "<script language=JavaScript>" & "alert('超过页码范围！');" & "history.back()" & "</script>"
					end if
			 else
					 page=1
			 end if 
		  i=0
		  rs1.absolutepage=page
		do while not rs1.eof and i<20
		%>
              <tr>
                <td><img src="images/icon1.jpg" width="14" height="10" align="absmiddle"> <a href="shownews.asp?id=<%=rs1("news_id")%>" target="_blank"><%=rs1("news_name")%></a> <font color="#CCCCCC">(<%=rs1("news_date")%>)</font></td>
              </tr>
		  <%
		  i=i+1
		  rs1.movenext
		  loop
		  else
		  if rs1.bof and rs1.eof then
		  response.write "<tr><td align='center'>暂无相关内容</td></tr>"
		  end if
		  end if
		  %>
              <tr>
                <td style="padding-left:20px;">
    <%
	if page<>1 then
	%>
	<a href="News.asp?page=1">首页</a> 
	<a href="News.asp?page=<%=page-1%>">上页</a> 
	<%else%>
	首页 上页
	<%end if%>
	第 <font color="#ff0000"><%=page%></font> 页 
	<%if page<>rs1.pagecount then%>
	<a href="News.asp?page=<%=page+1%>">下页</a> 
	<a href="News.asp?page=<%=rs1.pagecount%>">尾页</a>
	<%else%>
	下页 尾页
	<%end if%> 共<font color=#ff0000><%=rs1.pagecount%></font>页<font color=#666666>(<%=rs1.pagesize%>条/页)</font>
				</td>
              </tr>
            </table>
		</td>
      </tr>
      <tr>
        <td height="19"><img src="images/bg3.jpg" width="675" height="19"></td>
      </tr>
    </table></td>
    <td width="166" align="right" valign="top" background="images/bg_right.jpg">
	<table border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="154" height="28" align="center" background="images/zxzx.jpg" style="color:#FFFFFF;"><b>在 线 咨 询</b></td>
      </tr>
      <tr>
        <td align="center" valign="top">
		  <table width="140" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td align="center" valign="middle"><img src="images/QQ.gif" width="50" height="59" align="absmiddle"><a href="tencent://message/?uin=236219983&amp;Site=im.qq.com&amp;Menu=yes"><img src="images/QQ1.gif" width="68" height="29" border="0" align="absmiddle" alt="有问题请咨询！"></a></td>
            </tr>
            <tr>
              <td align="center"><img src="images/QQ.gif" width="50" height="59" align="absmiddle"><a href="tencent://message/?uin=983427879&amp;Site=im.qq.com&amp;Menu=yes"><img src="images/QQ1.gif" width="68" height="29" border="0" align="absmiddle" alt="有问题请咨询！"></a></td>
            </tr>
            <tr>
              <td align="center">&nbsp;</td>
            </tr>
            <tr>
              <td align="center"><a href= 'msnim:chat?contact=huayusp@hotmail.com ' ><img src="images/msn.gif" width="90" height="21" border="0"></a><object classid= "clsid:B69003B3-C55E-4B48-836C-BC5946FC3B28 " codetype= "application/x-oleobject" id= "MsgrUIA " width= "0 " height= "0 " viewastext></object></td>
            </tr>
            <tr>
              <td height="8" align="center"></td>
            </tr>
            <tr>
              <td align="center"><a href= 'msnim:chat?contact=tianyu0909@hotmail.com ' ><img src="images/msn.gif" width="90" height="21" border="0"></a><object classid= "clsid:B69003B3-C55E-4B48-836C-BC5946FC3B28 " codetype= "application/x-oleobject" id= "MsgrUIA " width= "0 " height= "0 " viewastext></object></td>
            </tr>
          </table>
 		</td>
      </tr>
    </table>
	</td>
  </tr>
</table>
<%
rs1.close
set rs1=nothing
End if
%>

<!--#include file="bottom.asp"-->
