<%
function NumericPage(curPage,totalPage)
pageStart=curPage-2
if pageStart<=0 then pageStart=1
pageEnd=curPage+2
if pageEnd>totalPage then pageEnd=totalPage
NumericPage=""
if curPage>1 then
NumericPage=NumericPage&"<a href='?pageno="&curPage-1&"'>上一页</a> "
else
NumericPage=NumericPage&"上一页 "
end if
for i=pageStart to pageEnd
if i<>curPage then
NumericPage=NumericPage&"<a href='?pageno="&i&"'>"&i&"</a> "
else
NumericPage=NumericPage&"<a href='?pageno="&i&"'><font color=red>"&i&"</font></a> "
end if
next
if curPage<totalPage then
NumericPage=NumericPage& "<a href='?pageno="&curPage+1&"'>下一页</a> "
else
NumericPage=NumericPage& "下一页 "
end if
end function %>
<%
N_type=request("N_type")
set rs = server.createobject("adodb.recordset")
sql = "select * from news"
if N_type<>"" then sql=sql&" where N_type='"&N_type&"'"
sql=sql&" order by N_id desc"
rs.Open SQL, Conn, 1, 1
rs.pagesize=20
PageNo=request("PageNo")
if request("PageNo")="" then PageNo=1
totalpages=rs.pagecount
if request.servervariables("content_length") > 0 then
currentpage=1
else
currentpage=clng(PageNo)
end if
if currentpage>totalpages then currentpage=totalpages
if not(rs.eof) then rs.absolutepage = currentpage
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>添加新闻</title>
<LINK href="rsc.css" type=text/css rel=stylesheet>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#999999">
<tr bgcolor="#E3E8F9">
<td height="15" bgcolor="#E3E8F9">
<div align="center"><font size="2"><strong>项 目 标 题</strong></font></div></td>
<td width="80" height="18">
<div align="center"><font size="2"><strong>项目类型</strong></font></div></td>
<td width="120" height="18">
<div align="center"><font size="2"><strong>管理</strong></font></div></td>
</tr>
<%
rowcount=(currentpage - 1)*rs.pagesize
for i=1 to rs.pagesize
if rs.eof then exit for
%>
<tr bgcolor="#F4F8FF">
<td height="20" title="<%=rs("N_time")%>"><a href="shownews.asp?N_id=<%=rs("N_id")%>" target=_blank><%if rs("N_hot")=true then response.write "<font color=red>"%><%=left(rs("N_title"),22)%>
<%if len(rs("N_title"))>22 then response.write "……"%><%if rs("N_pic")<>"" then%>[图]<%end if%>
</a></td>
<td> <div align="center"><a href="?N_type=<%=rs("n_type")%>"><%=rs("n_type")%></a></div></td>
<td>
<div align="center">
<%if session("userlimit")>0 then%>
<%if rs("N_enabled")=false then%>
<a href="enablednews.asp?N_id=<%=rs("N_id")%>&pageno=<%=PageNo%>"><font color=green>通过</font></a>
<%else%>
<a href="enablednews.asp?N_id=<%=rs("N_id")%>&pageno=<%=PageNo%>"><font color=red>取消</font></a>
<%end if%>
<%end if%>
<%if session("userlimit")>0 or (session("userlimit")<1 and rs("N_enabled")=false)then%> <a href="editnews.asp?N_id=<%=rs("N_id")%>&pageno=<%=PageNo%>">修改</a><%end if%>
<%if session("userlimit")>0 then%> <a href="javascript:if(confirm('您确定要删除此条信息?')) window.location.href='delnews.asp?N_id=<%=rs("N_id")%>&pageno=<%=PageNo%>'">删除</a><%end if%>
</div>
</td>
</tr>
<%
rs.movenext
next
%>
</table>
</td>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20" bgcolor="#E3E8F9"><%response.write NumericPage(currentpage,totalpages)%></td>
</tr>
</table>
</body>
</html>