📄 backlist.jsp
字号:
<%@ page language="java" import="java.util.*,com.project.util.DateTimeUtil" pageEncoding="UTF-8"%>
<%@ page import="com.project.util.DateTimeUtil,com.project.util.StringUtil" %>
<%@page import="com.model.entity.NewsInfo"%>
<%@page import="com.model.dao.DBAccessNews" %>
<%
//每次显示多少
int pageSize = 10;
int pageNum = 0;
int sumNum = 0;
int totalPage = 0;
int falg = 0;
int num = 0;
List newsList = new ArrayList();
Integer temp = 0;
Integer IpageNum = 0;
if(session.getAttribute("userInfo") == null){
response.sendRedirect(request.getContextPath() + "/login.jsp");
}else{
Map newsMap = (Map)request.getAttribute("queryNews");
newsList = (List)newsMap.get("newsInfo");
temp = (Integer)newsMap.get("newsNum");
IpageNum = (Integer)newsMap.get("pageNum");
//当前页号
pageNum = IpageNum.intValue();
//共多少条
sumNum = temp.intValue();
//共多少页
totalPage = 0;
falg = 0;
if(sumNum < pageSize ){
totalPage = 1;
}else{
if(sumNum % pageSize == 0){
totalPage = sumNum / pageSize;
}else{
falg = 1;
totalPage = sumNum / pageSize + 1;
}
}
for(int i=0;i < totalPage;i++){
if(pageNum == i){
num = i;
}
}
}
%>
<html>
<script language="JavaScript" src="<%=request.getContextPath() %>/jsp/js/Calender.js"></script>
<head>
<script language=JavaScript>
function DoEmpty(params)
{
if (confirm("真的要删除吗?"))
window.location = "<%=request.getContextPath() %>/delnews.do?newsId=" + params;
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>经济运行调度信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
td img {display: block;}body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-image: url(jsp/images/bei.gif);
}
.bai25 {
font-family: "宋体";
font-size: 12px;
line-height: 25px;
font-weight: bold;
color: #FFFFFF;
}
</style>
<!--Fireworks 8 Dreamweaver 8 target. Created Wed Sep 05 13:51:49 GMT+0800 2007-->
<link href="<%=request.getContextPath() %>/jsp/css/css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link {
color: #666666;
text-decoration: none;
}
a:visited {
color: #666699;
text-decoration: none;
}
a:hover {
color: #003399;
text-decoration: none;
}
a:active {
color: #FF0000;
text-decoration: none;
}
-->
</style>
<script type="text/JavaScript">
function init(){
if(document.queryForm.uptime.value == '' && document.queryForm.title.value == '' && document.queryForm.sort.value == '全部' && document.queryForm.kind.value == '全部'){
document.nextPageForm.action = "<%=request.getContextPath()%>/bglist.do";
}else{
document.nextPageForm.action = "<%=request.getContextPath()%>/queryInfor.do";
}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
function nextPage(pageNum,pageSize){
document.nextPageForm.pageNum.value = pageNum;
document.nextPageForm.pageSize.value = pageSize;
document.nextPageForm.submit();
}
function query(){
document.queryForm.action = "<%=request.getContextPath()%>/queryInfor.do";
document.queryForm.submit();
}
</script>
</head>
<body onload="init();">
<table width="500 border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<jsp:include flush="true" page="../include/backTop.jsp" />
</tr>
<tr>
<td height="1000" colspan="2" align="center" valign="top" bgcolor="#FFFFFF">
<table height="424" width="780" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr valign="top">
<td height="67" valign="top">
<table width="750" height="36" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#A5CFE9">
<form action="" name="queryForm" method="post">
<tr>
<td width="6" height="63" valign="top"><img src="<%=request.getContextPath() %>/jsp/images/xitong1.gif" width="6" height="63" /></td>
<td width="949" height="63" valign="top" background="<%=request.getContextPath() %>/jsp/images/xitong2.gif">
<table width="600" height="63" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="5" colspan="5" valign="bottom"></td>
</tr>
<tr>
<td width="11%" rowspan="3" align="center" valign="middle"><img src="<%=request.getContextPath() %>/jsp/images/sou.jpg" width="24" height="28" />
</td>
<td width="43%" align="left" valign="middle" class="nei20">上传时间<span class="nei25">
<%
String uptime = (String)request.getAttribute("uptime");
if(uptime==null){uptime="";}
%>
<input name="uptime" type="text" class="nei20" size="18" onclick="setday(this);" value=<%=uptime %>>
</span></td>
<td colspan="2" align="left" valign="middle" class="nei20"><span class="nei25">标题:
<label></label>
<%
String title = (String)request.getAttribute("title");
if(title==null)
{title="";}
%>
<input name="title" type="text" size="18" value=<%=title%>>
</span> </td>
</tr>
<tr>
<td height="6" valign="middle" class="nei20"></td>
<td height="6" colspan="3" valign="middle" class="nei20"></td>
</tr>
<tr>
<td valign="middle" class="nei20"align="left" >分 类
<select style="width:125" name="sort" class="nei20">
<%
String sort = (String)request.getAttribute("sort");
if(sort==null)
{sort="全部";}
%>
<%
String[] a = new String[]{"全部","政策动态","运行动态","网摘信息","综合分析","行业分析","经济运行月报","经济运行简报","工作动态","地方动态"};
for(int i=0;i<a.length;i++)
{
if(sort.equals(a[i]))
{
%>
<option value="<%=a[i] %>" selected><%=("网摘信息".equals(a[i])?"参考信息":a[i]) %></option>
<%
}else{
%>
<option value="<%=a[i] %>" ><%=("网摘信息".equals(a[i])?"参考信息":a[i]) %></option>
<%
}
}
%>
</select>
</td>
<td width="40%" align="left" valign="middle" class="nei20"><label>栏目:
<select style="width:135" name="kind" class="nei20">
<%
String kind = (String)request.getAttribute("kind");
if(kind==null)
{kind="全部";}
%>
<%
String[] b = new String[]{"全部","综合信息","经济运行工作","地方动态"};
for(int j=0;j<b.length;j++)
{
if(kind.equals(b[j]))
{
%>
<option value="<%=b[j] %>" selected><%=b[j] %></option>
<%
}else{
%>
<option value="<%=b[j] %>" ><%=b[j] %></option>
<%
}
}
%>
</select>
</label></td>
<td width="2%" align="left" valign="middle" class="nei20"><a href="javaScript:query();"><img src="<%=request.getContextPath() %>/jsp/images/shousuo.jpg" width="41" height="19" border="0"/></a></td>
<td width="1%" align="left" valign="middle" class="nei20"> </td>
</tr>
<tr valign="top">
<td height="6" colspan="2" valign="top"></td>
<td height="6" colspan="3" valign="top" class="css"></td>
</tr>
</table></td>
<td width="6" height="63" valign="top"><img src="<%=request.getContextPath() %>/jsp/images/xitong3.gif" width="6" height="63" /></td>
</tr>
</form>
</table>
</td>
</tr>
<tr valign="top">
<td height="9" align="right" valign="top">
<table width="300" border="0" valign="top">
<form name="nextPageForm" action="" method="post">
<input name="pageNum" type="hidden" value="" />
<input name="pageSize" type="hidden" value="" />
<tr class="nei20" valign="top">
<a href="javaScript:nextPage('0','<%=pageSize %>');">首页</a>
<%if(pageNum >= 1){%>
<a href="javaScript:nextPage('<%=pageNum-1%>','<%=pageSize%>');">上一页</a>
<%}else{%>
上一页
<%} %>
<%if(pageNum < totalPage-1){ %>
<a href="javaScript:nextPage('<%=pageNum+1%>','<%=pageSize%>');">下一页</a>
<a href="javaScript:nextPage('<%=totalPage-1%>','<%=pageSize%>');">尾页</a>
<%}else{ %>
下一页
尾页
<%} %>
共<%=sumNum %> 条记录
第<%=pageNum+1 %>页
共<%=totalPage %>页 </tr>
</form>
</table>
</td>
</tr>
<tr>
<td valign="top">
<table width="750" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#FFFFFF" bordercolorlight="000000" valign="top">
<caption>
</caption>
<tr> </tr>
<tr>
<td width="5%" bgcolor="#EAEAEA" class="css" align="center">序号</td>
<th width="60" bgcolor="#EAEAEA" class="css">栏目名称</th>
<th width="60" bgcolor="#EAEAEA" class="css">分类</th>
<th width="27%" bgcolor="#EAEAEA" class="css">标题</th>
<th width="40" bgcolor="#EAEAEA" class="css">提供者</th>
<th width="10%" bgcolor="#EAEAEA" class="css">上传时间</th>
<th width="10%" bgcolor="#EAEAEA" class="css">置顶时间</th>
<th width="25" bgcolor="#EAEAEA" class="css">删除</th>
<th width="25" bgcolor="#EAEAEA" class="css">修改</th>
<th width="25" bgcolor="#EAEAEA" class="css">归类</th>
</tr>
<%
for(int i=0;i < newsList.size();i++){
NewsInfo newsInfo = (NewsInfo)newsList.get(i);
%>
<tr>
<%if(i<9){ %>
<td class="nei20" align="center"><%=(num == 0)?i+1:String.valueOf(num)+String.valueOf(i+1) %></td>
<%}else{ %>
<td class="nei20" align="center"><%=String.valueOf(num+1)+"0" %></td>
<% }%>
<td class="nei20" align="center"><%=newsInfo.getKind() %></td>
<td class="nei20" align="center"><%=("网摘信息".equals(newsInfo.getSort()))?"参考信息":newsInfo.getSort() %></td>
<td class="nei20" align="center"><a href="<%=request.getContextPath() %>/look.do?newsId=<%=newsInfo.getNewsId()%>" target="_blank"><%=(newsInfo.getTitle().length()>13)?StringUtil.getSubTitle(newsInfo.getTitle(),13):newsInfo.getTitle() %></a>
<%if(newsInfo.getNewsDate()!=null&&DateTimeUtil.getChangDate(newsInfo.getNewsDate())>=DateTimeUtil.getNowTime()){ %><font color="red"><B>new!</B></font><%}%>
</td>
<td class="nei20" align="center"><%=(newsInfo.getAuthor()==null)?" ":newsInfo.getAuthor() %></td>
<td class="nei20" align="center"><%=(newsInfo.getCreateDate()==null)?" ":(newsInfo.getCreateDate().length() > 10)?newsInfo.getCreateDate().substring(0,10):newsInfo.getCreateDate() %></td>
<td class="nei20" align="center"><%=(newsInfo.getNewsTop()==null)?" ":newsInfo.getNewsTop()%></td>
<%--<td class="nei20" align="center"><a href="<%=request.getContextPath() %>/delnews.do?newsId=<%=newsInfo.getNewsId() %>">删除</a></td>
--%>
<td class="nei20" align="center"><a href="javascript:DoEmpty('<%=newsInfo.getNewsId()%>');">删除</a></td>
<td class="nei20" align="center"><a href="<%=request.getContextPath() %>/updatefornews.do?newsId=<%=newsInfo.getNewsId() %>">编辑</a></td>
<td class="nei20" align="center"><a href="<%=request.getContextPath() %>/upKindfornews.do?newsId=<%=newsInfo.getNewsId() %>">归类</a></td>
</tr>
<%
}
%>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<jsp:include flush="true" page="../include/foot.jsp" />
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -