<%@ Language=VBScript %>
<!--#include file="../conn/conn1.asp" -->
<!--#include file="../session1.asp"-->
<html>
<head>
<title>新闻</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../news.css">
<style type="text/css">
<!--
.样式1 {font-size: 12px}
.p9 {
font-size: 9pt;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
}
-->
</style>
</head><%
set rs=server.CreateObject ("Adodb.RecordSet")
rs.Source="select * from news order by update desc"
rs.Open rs.Source,conn,1,1
dim MaxPerPage
MaxPerPage=14
If rs.eof and rs.bof then
response.write "<p align='center'><font color='#ff0000' class='p9'>现在还没有任何的信息!</font></p>"
response.end
End if
dim text,checkpage
text="0123456789"
Rs.PageSize=MaxPerPage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next
If checkpage<>0 then
If NOT IsEmpty(request("page")) Then
CurrentPage=Cint(request("page"))
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
Else
CurrentPage= 1
End If
If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
CurrentPage=1
End if
%>
<script language="javascript">
function cdel(id,page){
if (confirm("真的要删除此信息吗?"))
window.location.href="del_news.asp?ID="+id+"&page="+page+""}
</script>
<body text="#000000">
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#000000" height="1"></td>
</tr>
<tr>
<td height="4"></td>
</tr>
<tr>
<td bgcolor="#000000" height="1"></td>
</tr>
<tr>
<td><table width="100%" height="62" border="0" cellpadding="1" cellspacing="0">
<tr align="center" bordercolor="#242424" bordercolordark="#ffffff" bgcolor=efefef>
<td width="14%" height="26" ><span class="p9">作者</span></td>
<td width="15%" bgcolor="efefef" ><span class="p9">来源</span></td>
<td width="43%" bgcolor="efefef" ><span class="p9">标题</span></td>
<td width="15%" ><span class="p9">提交时间</span></td>
<td colspan="2" ><span class="p9">管理</span></td>
</tr><%
if not rs.eof then
i=0
do while not rs.eof
%>
<tr>
<td height="35"><div align="center" class="p9"></div>
<div align="center" class="p9"><%=rs("author") %></div></td>
<td> <div align="center" class="p9"><%=rs("Original") %></div></td>
<td><div align="center" class="p9"><%title=rs("title")
if len(title)>20 then
title=left(title,18)&"..."
end if
response.Write title %></div></td>
<td><div align="center" class="p9"><%=rs("update") %></div></td>
<td width="7%"><div align="center" class="p9"><a href="editnews.asp?id=<%=rs("newsid")%>&page=<%=currentPage%>">修改</a></div></td>
<td width="6%"><div align="center" class="p9"><a href="javascript:cdel('<%=rs("newsID")%>','<%=currentPage%>')" title="删除信息">删除</a></div></td>
</tr>
<%
i=i+1
if i >= MaxPerpage then exit do
rs.movenext
loop
end if
%> </table> </td>
</tr>
<tr>
<td><div align="right">
<%
call showpages%>
</div></td>
</tr>
</table>
</body>
</html>
<%
sub showpages()%>
<table border="0" cellPadding="0" cellSpacing="0" width="100%">
<tr><td width="695">
<%
response.write "<form method=Post action='news.asp'>"
%>