⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 selectaffiche.jsp

📁 新闻系统
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.util.List"%>
<%@ page import="com.actionForm.AfficheForm"%><jsp:useBean id="chinese" scope="request" class="com.tool.Chinese"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><jsp:useBean id="time" scope="request" class="com.tool.TimeShow"/>
<title>宇晨网络新闻中心后台</title>
<script language="javascript">
function deleteForm(date){
if(confirm("您真的要删除吗?")){
window.location.href="afficheAction.do?method=deleteAfficheAction&id="+date;
}
}
</script>
</head>
<%
String bigSort=chinese.toChinese(request.getParameter("bigSort"));
List list=(List)request.getAttribute("list");
int number=list.size();
//以下这段代码是计算多少页数
int pageNumber=number;
if(pageNumber%10==0){
pageNumber=pageNumber/10;
}else{
pageNumber=pageNumber/10+1;
}
//以下是计算当前页的页数
int count;
if(request.getParameter("count")==null){
count=0;
}else{
count=Integer.valueOf(request.getParameter("count"));
}
//以下显示多少条纪录
int start=count*10;//开始条数
int over=(count+1)*10;//结束条数
int lastCount=number-over;//还剩多少条记录
 if(lastCount<=0){
  over=number;
  }
%>
<body><div align="center">
<jsp:include page="../bTop.jsp"/>
<table width="800" height="465" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="196" rowspan="2" valign="top"><jsp:include page="../bleft.jsp"/></td>
    <td width="604" height="57" background="bImage/place.jpg" >
      <table width="601" height="36" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td>&nbsp;&nbsp;&nbsp;当前位置提示&nbsp;&gt;&gt;&nbsp;公告信息管理</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td height="400" align="center" valign="top" background="bImage/big.jpg"><table width="601" border="0" cellpadding="0" cellspacing="0" background="bImage/placeNext.jpg">
      <tr>
        <td height="21" >&nbsp;</td>
        <td>公告信息查询</td>
      </tr>
    </table>
	 <br><%if(number==0){%><a href="afficheAction.do?method=insertAfficheAction">公告信息添加</a><%}else{%>
	<table width="500" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><div align="right"><a href="afficheAction.do?method=insertAfficheAction">公告信息添加</a>&nbsp;</div></td>
      </tr>
    </table>
	<table width="500" border="1" cellpadding="0" cellspacing="0">
      <tr>
        <td width="77" height="27"><div align="center">编号</div></td>
        <td width="218"><div align="center">公告题目</div></td>
        <td width="101"><div align="center">创建时间</div></td>
        <td width="94"><div align="center">操作</div></td>
      </tr>
	     <%
  for(int i=start;i<over;i++){
  AfficheForm form=(AfficheForm)list.get(i);
  %>
      <tr>
        <td width="77" height="31"><div align="center"><%=i+1%></div></td>
        <td width="218"><div align="center"><a href="afficheAction.do?method=selectOneAfficheAction&id=<%=form.getId()%>&sign=1"><%=form.getTitle()%></a></div></td>
        <td width="101"><div align="center">
          <%if(time.cuttentMonthDate().equals(form.getCreateTime())){%>
          <b><font color="#0265CB">NEW</font></b>
<%}else{%><%=form.getCreateTime()%><%}%>
</div></td>
        <td width="94"><div align="center"><a href="afficheAction.do?method=selectOneAfficheAction&id=<%=form.getId()%>">修改</a>&nbsp;&nbsp;<a href="javascript:deleteForm('<%=form.getId()%>')">删除</a></div></td>
      </tr>
	  <%}%>
    </table>

	<table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr align="center">
        <td width="578" height="37" >
          <%for(int i=0;i<pageNumber;i++){%>
          <%if(count==i){%>
          [<font color="#FF0000"><b><%=i+1%></b></font>]
          <%}else{%>
      [<a href="afficheAction.do?method=selectAfficheAction&count=<%=i%>"><b><%=i+1%></b></a>]
      <%}}%></td>
      </tr>
    </table><%}%></td>
  </tr>
</table>
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -