【JSP开源代码栏目提醒】:本文主要为网学会员提供AdminNewsList.jsp,希望对需要AdminNewsList.jsp网友有所帮助,学习一下!
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,common.PageView" errorPage="ErrorPage.jsp" %>
<!-- 权限管理 -->
<%@ include file="SessionCheckAll.jsp" %>
<jsp:useBean id="myNewsTypeManager" scope="page" class="news.NewsTypeManager"/>
<jsp:useBean id="myNewsManager" scope="page" class="news.NewsManager" />
<%
int tid = 1, currentPageNo = 1;
if(request.getParameter("tid") != null)
tid = (new Integer(request.getParameter("tid"))).intValue();
if(request.getParameter("page") != null)
currentPageNo = (new Integer(request.getParameter("page"))).intValue();
%>
<html>
<head>
<title>汉语史研究中心网站——后台管理系统</title>
<link rel="stylesheet" type="text/css" href="../style.css">
<style type="text/css">
<!--
-->
</style>
</head>
<body>
<div align="center" class="unnamed1">
<center>
<!-- include common top page -->
<jsp:include page="top.htm" />
<table width="777" border="0" align="center" cellpadding="0" cellspacing="0" height="1">
<tr>
<td bgcolor="#3A5C9F" width="168" height="143" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#000000">
<td><img src="../images/dot.gif" width="1" height="1"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15%"> </td>
<td width="70%"><table width="100%" height="142" border="0" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
<tr bgcolor="#000000">
<td colspan="2" height="1"><img src="../images/dot.gif" width="1" height="1"></td>
</tr>
<tr>
<td width="100%" bgcolor="#304D7C"><div align="center"><a href="AdminNewsList.jsp"> <font color="#FFFFFF">浏
览 新 闻</font></a></div></td>
</tr>
<%
ResultSet newTypeSet = myNewsTypeManager.getNewsTypeSet();
while(newTypeSet != null && newTypeSet.next()) {
%>
<tr>
<td width="100%"><div align="center">
<a href="AdminNewsList.jsp?tid=<%=newTypeSet.getInt("tid")%>">
<font color="#FFFFFF"><%=newTypeSet.getString("typename")%></font>
</a></div></td>
</tr>
<%
}
%>
<tr bgcolor="#000000">
<td colspan="2" height="1"><img src="../images/dot.gif" width="1" height="1"></td>
</tr>
<tr>
<td bgcolor="#304D7C"><div align="center"> <a href="AdminNewsAdd.jsp"><font color="#FFFFFF">添 加 新 闻</font></a></div></td>
</tr>
<tr bgcolor="#000000">
<td colspan="2" height="1"><img src="../images/dot.gif" width="1" height="1"></td>
</tr>
<tr>
<td bgcolor="#304D7C"><div align="center">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><a href="AdminNewsCheck.jsp"><font color="#FFFFFF">审 核 新 闻</font></a></div></td>
</tr>
</table>
<strong></strong></div></td>
</tr>
<tr bgcolor="#000000">
<td colspan="2" height="1"><img src="../images/dot.gif" width="1" height="1"></td>
</tr>
<tr>
<td bgcolor="#304D7C"><div align="center">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="18"><div align="center"><a href="AdminNewsColumn.jsp"><font color="#FFFFFF">栏 目 管 理</font></a></div></td>
</tr>
</table>
</div></td>
</tr>
<tr bgcolor="#000000">
<td colspan="2" height="1"><img src="../images/dot.gif" width="1" height="1"></td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="15%"> </td>
</tr>
</table> </td>
<td bgcolor="#C4C4C4" width="3" height="143"><img src="../images/dot1.gif" width="1" height="1"></td>
<td colspan="2" height="143" valign="top" align="right">
<table border="0" width="98%" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="100%" >
<p align="center">
<div align="center">
<%
if(myNewsManager.getCheckedNewsSet(tid) == null) {
out.println(" ");
out.println("<p align='center'> 还 没 有 任 何 文 章</p>");
} else {
PageView pageView = new PageView(myNewsManager.getCheckedNewsSet(tid));
//设置每页最大显示记录数
pageView.setPageSize(15);
ResultSet rs = pageView.getPage(currentPageNo);
%>
<div align="center">
<center>
<table border="0" cellspacing="1" width="100%" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellpadding="0" bgcolor="#000000">
<tr bgcolor="#304D7C">
<td width="50" align="center" height="20"><strong><font color="#FFFFFF">ID号</font></strong></td>
<td width="389" align="center"><strong><font color="#FFFFFF">新闻标题</font></strong></td>
<td width="148" align="center"><strong><font color="#FFFFFF">发布时间</font></strong></td>
</tr>
<%
rs.previous();
for(int i = 0; rs.next() && i < pageView.getPageSize(); i++) {
int nid = rs.getInt("nid");
%>
<tr bgcolor="#FFFFFF">
<td height="23" width="50">
<p align="center"><%=nid%>
</td>
<td width="389">
<p align="center"><a href="../viewnews.jsp?nid=<%=nid%>" ><%=myNewsManager.getTitle(nid)%></a>
</td>
<td width="148" bgcolor="#FFFFFF">
<p align="center">
<%
out.print(myNewsManager.getPostDate(nid) + " " + myNewsManager.getPostTime(nid));
%>
</td>
</tr>
<%
} // out for loop and still in else clause
%>
</table>
</center>
</div>
<%
out.println("<form method=Post action=AdminNewsList.jsp?tid=" + tid + ">");
out.println("<p align='center'>");
if(currentPageNo < 2) {
out.println("<font color='#000080'>首页 上一页</font>");
} else {
out.println("<a href=AdminNewsList.jsp?tid=" + tid + "&page=1>首页</a>");
out.println("<a href=AdminNewsList.jsp?tid=" + tid + "&page=" + (currentPageNo - 1) + ">上一页</a>");
}
if((pageView.getPageCount() - currentPageNo) < 1) {
out.println("<font color='#000080'>下一页 尾页</font>");
} else {
out.println("<a href=AdminNewsList.jsp?tid=" + tid + "&page=" + (currentPageNo + 1) + ">");
out.println("下一页</a> <a href=AdminNewsList.jsp?tid=" + tid + "&page=" + pageView.getPageCount() + ">尾页</a>");
}
out.println("<font color='#000080'> 页次:</font><strong><font color=red>" + currentPageNo + "</font><font color='#000080'>/" + pageView.getPageCount() + "</strong>页</font> ");
out.println("<font color='#000080'> 共<b>" + pageView.getRecordCount() + "</b>篇文章 <b>" + pageView.getPageSize() + "</b>篇文章/页</font> ");
out.println("<font color='#000080'>转到:</font><input type='text' name='page' size=4 maxlength=10 class=smallInput value=" + currentPageNo + ">");
out.println("<input class=buttonface type='submit' value='Goto' name='cndok'></span></p></form>");
%>
<%
rs.close(); // close ResultSet
} // out else clause
%>
<
上一篇:
AdminNewsEdit.jsp
下一篇:
基于web二手汽车交易管理系统(含录像)