<!--#include file="../include/DBConn.asp"-->
<!--#include file="BenbenInc/Functions.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>==新闻列表==</title>
<link href="BenbenInc/css.css" rel="stylesheet" type="text/css">
<link href="../stylecss/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	margin-left: 1px;
	margin-top: 0px;
	margin-right: 1px;
	margin-bottom: 0px;
}
.style9 {color: #0066FF}
.style10 {
	color: #000000;
	font-weight: bold;
}
-->
</style>
<script language="javascript" src="../jscript/function.js"></script>

</head>

<body>

<%
Call DBConnBegin()
Dim rs,sql,title,count,h,MsgStr,querystr,t,c

if request("action")="Del" then
	conn.execute("Delete from News where nID="&request("id"))
	Msg "删除操作成功!!","News_List.asp"
end if
Dim pr,ch
pr=Request("l1")
ch=Request("l2")
%>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="30" class="Title_bg">新闻列表</td>
  </tr>
</table>
<table width="100%"  border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#DAEFFF" style="margin-top:5px;">
  <tr bgcolor="#efeddf">
    <td colspan="8" bgcolor="#DAEFFF"> <span class="style9"><span class="t34">4</span> 新 闻 列 表 ( <span class="style10"><a href="News_Add.asp" target="_blank">添加新闻</a></span> &nbsp;<a href="News_Sort.asp" target="_blank"><strong>新闻分类管理</strong></a> ) </span></td>
  </tr>
  <tr bgcolor="#efeddf">
    <td colspan="8" bgcolor="#DAEFFF"><form name="form1" method="post" action="News_List.asp" style="margin:0;padding:0;">
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td><strong>新闻搜索：</strong>
              <input type="text" name="Title" size="20" maxlength="30" />
              <select name="l1" id="l1" onChange="vbscript:change1(document.form1.l1.value)">
			  <option value="" selected >请选择分类</option>
                <%
	Set rs = Server.CreateObject("ADODB.RecordSet")
rs.open "select * from News_Sort where Stype=0 and Stid=0 and Sid<>1 order by Sid asc",conn,1,1
if rs.eof then
	response.write "<script language=vbscript>" & chr(13)
	response.write "msgbox ""对不起,请先填加""""一级栏目""""后再进行添加！"",64,""提示""" & chr(13)
	response.write "window.location.href=""News_Sort.asp""" & chr(13)
	response.write "</script>"
	Response.End
end if
L1=""
n=1
tempID=1
do while not rs.eof
  L1=L1 & "<option value="&rs("Sid")
  If Cstr(pr) = Cstr(rs("Sid")) then
  	L1=L1 &" selected>"&rs("Sname")&"</option>"
	if pr<>1 then tempID=rs("Sid")
  Else
  	L1=L1 &">"&rs("Sname")&"</option>"
  End If
  
rs.movenext
n=n+1
loop
rs.close
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
	Set rs = Server.CreateObject("ADODB.RecordSet")
rs.open "select * from News_Sort where Stype=1 and Stid=0 order by Sid asc",conn,1,1
if rs.eof then
	response.write "<script language=vbscript>" & chr(13)
	response.write "msgbox ""对不起,请先填加""""二级栏目""""后再进行添加！"",64,""提示""" & chr(13)
	response.write "window.location.href=""News_Sort.asp""" & chr(13)
	response.write "</script>"
	Response.End
end if
L2=""
do while not rs.eof
  L2=L2 & "<option value="&rs("Sid")&">"&rs("Sname")&"&haosmallfgf;"&rs("Spid")&"</option>&haobigfgf;"
rs.movenext
loop
rs.close

%>
                <%=L1%>
                <script language=vbscript>
l2="<%=L2%>"
function change1(num)
a=split(l2,"&haobigfgf;")
tempA=""
For n=0 to ubound(a)
  if instr(a(n),"&haosmallfgf;"&cstr(num)&"<")>0 then
     tempA=tempA & replace(a(n),"&haosmallfgf;"&cstr(num)&"<","<")
  end if
NEXT
xx="<select name=l2 id=l2>" & tempA & "</select>"
select2.innerhtml=xx
end function
        </script>
            </select>
            <span id=select2><%
rs.open "select * from News_Sort where Stype=1 and Spid="&tempID,conn,1,1
%>
<select name="l2" id="l2">
<option value="" selected >请选择分类</option>

<%
do while not rs.eof
  If Cstr(ch) = Cstr(rs("Sid")) then
  	response.write "<option value="&rs("Sid")&" selected=""selected"">"&rs("Sname")&"</option>"
  else
   	response.write "<option value="&rs("Sid")&">"&rs("Sname")&"</option>" 
  end if
rs.movenext
loop
rs.close
%>
</select>
</span>
<input name="submit" type="submit" value="搜索" />
</td></tr></table>
        </form></td>
  </tr>
    <tr align="center" bgcolor="#efeddf"> 
    <td height="1" colspan="8" bgcolor=#C7C5B2></td>
  </tr>
  <tr align="center" bgcolor="#efeddf" class="ListViewTopBG">
    <td width="42%" height="20" bgcolor="#DAEFFF" onMouseOver="javascript:this.className='ListViewTopBGhover'" onMouseOut="javascript:this.className='ListViewTopBG'"><nobr>标题</td>
    <td width="16%" bgcolor="#DAEFFF" onMouseOver="javascript:this.className='ListViewTopBGhover'" onMouseOut="javascript:this.className='ListViewTopBG'"><nobr>时间</td>
    <td width="7%" bgcolor="#DAEFFF" onMouseOver="javascript:this.className='ListViewTopBGhover'" onMouseOut="javascript:this.className='ListViewTopBG'"><nobr>点击</td>
    <td width="11%" bgcolor="#DAEFFF" onMouseOver="javascript:this.className='ListViewTopBGhover'" onMouseOut="javascript:this.className='ListViewTopBG'"><nobr>栏目</td>
    <td width="11%" bgcolor="#DAEFFF" onMouseOver="javascript:this.className='ListViewTopBGhover'" onMouseOut="javascript:this.className='ListViewTopBG'"><nobr>类别</td>
    <td width="4%" bgcolor="#DAEFFF" style="display:none"><nobr>上升</td>
    <td width="5%" bgcolor="#DAEFFF" onMouseOver="javascript:this.className='ListViewTopBGhover'" onMouseOut="javascript:this.className='ListViewTopBG'"><nobr>编辑</td>
    <td width="4%" bgcolor="#DAEFFF" onMouseOver="javascript:this.className='ListViewTopBGhover'" onMouseOut="javascript:this.className='ListViewTopBG'"><nobr>删除</td>
  </tr>
<%
Sql = "select a.Nid,a.Ntitle,a.Ndatetime,a.Nhit,a.NtitlePic,a.NbigSort,a.NsmaSort,b.Sname as BigName,c.Sname as SmaName from News a,News_Sort b,News_Sort c where a.NbigSort=b.Sid and a.NsmaSort=c.Sid and a.Nbigsort<>1"
Title = Trim(Request.Form("Title"))
If Title <> "" Then Sql = Sql & " and a.Ntitle like '%"&Title&"%'"
If pr <> "" Then Sql = Sql & " and a.NbigSort="&pr
If ch <> "" Then Sql = Sql & " and a.NsmaSort="&ch

Sql = Sql & " order by a.Nid desc"
Set rs = Server.CreateObject("ADODB.RecordSet")
querystr="&l1="&pr&"&l2="&ch
rs.open Sql,conn,1,1
Const	Page_Size = 13 ' 每个页面的记录数
Dim		Cur_Page_ID ' 当前页面ID
Dim		Page_Count ' 页面总数
Cur_Page_ID=Request("PageID")
if Cur_Page_ID="" then Cur_Page_ID=1
rs.PageSize = Page_Size
if cint(Cur_Page_ID) >  RS.PageCount then
	Cur_Page_ID =  RS.PageCount
elseif Cur_Page_ID <=0 then
	Cur_Page_ID = 1
end if
if Cur_Page_ID<>0 And Not RS.EOF then
RS.AbsolutePage = cint(Cur_Page_ID)
end if
count=0
h=1
do while not rs.eof and (h-1)<Page_Size
%>
  <tr bgcolor="#FFFFFF" onMouseOver="javascript:this.bgColor='#F9F8EC'" onMouseOut="javascript:this.bgColor='#FFFFFF'">
    <td><font color=000><%=rs("Nid")%>.<%=rs("Ntitle")%></font></td>
    <td align="center"><NOBR>&nbsp;<%=rs("Ndatetime")%>&nbsp;</td>
    <td align="center"><NOBR><%=rs("Nhit")%></td>
    <td align="center"><%=rs("BigName")%></td>
    <td align="center"><%=rs("SmaName")%></td>
    <td align="center" style="display:none"><a href="news_list_sub.asp?id=<%=rs("Nid")%>&action=Up" target=_self>&nbsp;↑&nbsp;</a></td>
    <td align="center"><a href="#" onClick="javascript:OpenUrl('News_Edit.asp?id=<%=rs("Nid")%>',screen.width,screen.height,'yes');"><img src="../images/editon.gif" alt="编辑此作品" width="17" height="17" border="0"></a></td>
    <td align="center"><a href="?id=<%=rs("Nid")%>&action=Del" onClick="javascript:return confirm('确认删除此条记录吗？');" target=_self><img src="../images/delete.gif" alt="删除此作品" width="17" height="18" border="0"></a></td>
  </tr>
<% 
	h=h+1
	rs.movenext
loop
%>
  <tr bgcolor="#FFFFFF">
    <td height="25" colspan="8" align="right"><a href="?type=<%=request("type")%>&pageid=1<%=querystr%>" title="首页" class="PageMenu">9</a>&nbsp;<a href="?type=<%=request("type")%>&pageid=<%=(Cur_Page_ID - 1)%><%=querystr%>" title="上一页" class="PageMenu">7</a>
                              <%
			  t=cint(Cur_Page_ID)
			  c=rs.PageCount
			  for n=t-4 to t+4
			  	if n>0 and cint(n)<=cint(c) then
					if n=t then
						Response.Write("&nbsp;<font color=red>[" & n & "]</font>")
					else
						Response.Write("&nbsp;<a href=""?type="& request("type") &"&pageid=" & n & querystr &""" target=_self><font color=black>["&n&"]</font></a>")
					end if
				end if
			  next
			  %>&nbsp;<a href="?type=<%=request("type")%>&pageid=<%=(Cur_Page_ID + 1)%><%=querystr%>" title="下一页" class="PageMenu">8</a>&nbsp;<a href="?type=<%=request("type")%>&pageid=<%=(RS.PageCount)%><%=querystr%>" title="最后一页" class="PageMenu">:</a>&nbsp;&nbsp;共[<font color=Red><%=rs.RecordCount%></font>]条记录 &nbsp;当前[<font color=red><%=cint(Cur_Page_ID)%></font>/<font color=red><%=(RS.PageCount)%></font>]页 每页[<font color=red><%=Page_Size%></font>]条&nbsp;&nbsp;</td>
  </tr>
</table>
<table width="96%"  border="0" align="center" cellpadding="2" cellspacing="1">
  <tr>
    <td><table width="100%" border="0" align="center">
      <tr>
        <td style="border:0px solid #EFEFEF;padding:3px;">图标说明：<img src="../images/editon.gif" alt="打开的投票" width="17" height="17" align="absmiddle">编辑 <img src="../images/delete.gif" alt="删除投票按钮" width="17" height="18" align="absmiddle"> 删除</td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
