<!--#include file="conn.asp"-->
<!--#include file="include/safe.asp"-->
<!--#include file="include/function.asp"-->
<!--#include file="include/config.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=site("site_name")%>-<%=site("site_keywords")%></title>
<meta name="keywords" content="<%=site("site_keywords")%>" />
<meta name="description" content="<%=site("site_description")%>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!--#include file="header.asp"-->
<div id="content">
  <div class="wap_title"> <span class="tag">新闻中心</span> </div>
  <div class="w_body">
    <ul class="news">
      <%
main_id = request.QueryString("main_id")
sub_id = request.QueryString("sub_id")
If Not IsNumeric(main_id) Or Not IsNumeric(sub_id) Then
    Call infoback("非法操作哟！")
End If
sql = "from news where 1=1"
If main_id<>"" And IsNumeric(main_id) Then
    sql = sql&" and main_id="&main_id
    If sub_id<>"" And IsNumeric(sub_id) Then sql = sql&" and sub_id="&sub_id
End If
page_size = New_news
total = conn.Execute("select Count(*) "&sql)(0)
If total = 0 Then
    response.Write("暂无新闻！")
Else
    If total Mod page_size = 0 Then pages = total / page_size Else pages = total \ page_size + 1
    page = Return_Page(pages, request.QueryString("page"))
    If page>pages Then page = pages
    If page>1 Then Set rs = conn.Execute("select Top "&page_size&" * "&sql&" and id<(select min(id) from (select top "&page_size * (page -1)&" id "&sql&" order by id desc) as minId) order by id desc") Else Set rs = conn.Execute("select Top "&page_size&" * "&sql&" order by id desc")
    Do While Not rs.EOF
            Response.Write("<li>&nbsp;&nbsp;<a href=""news_view.asp?id="&rs("id")&""" title="""&rs("news_name")&"""></a><a href=""news_view.asp?id="&rs("id")&""" news_name="""&rs("news_name")&""">"&str_left(rs("news_name"), 30, "...")&"<span class=""data"">　"&format_time(rs("data"))&"</span></a></li>"&vbCrLf)
            rs.movenext
    Loop
End If
Set rs = Nothing
%>
    </ul>
    <div id="pagetop"></div>
    <%'以下显示分页
response.Write(setPage(total, page_size, page))
%>
    <div class="clear"></div>
  </div>
</div>
<div class="clear"></div>
</div>
</div>
<!--#include file="foot.asp"-->
</body>
</html>
