list.jsp 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="X-UA-Compatible" content="IE=edge;chrome=1">
  5. <%@ page pageEncoding="utf-8" %>
  6. <%@taglib uri="/struts-tags" prefix="s" %>
  7. <%@ page language="java" import="java.util.*" %>
  8. <%@ page import=" com.ccgj.database.manager.*" %>
  9. <%@ page import=" com.ccgj.database.factory.*" %>
  10. <%@ page import=" com.ccgj.database.beans.*" %>
  11. <%@ page import=" java.util.Calendar" %>
  12. <%@ page import=" java.text.SimpleDateFormat" %>
  13. <%
  14. long id = Long.parseLong(request.getParameter("param").split("_")[0]);
  15. LMBManager lmManager = DatabaseFactory.getLMBIF().getLMBService().getLmbManager();
  16. WZBManager wzManager = DatabaseFactory.getWZBIF().getWZBService().getWzbManager();
  17. LMB lmb = lmManager.getLMBByLmid(id);
  18. LMB flm = lmManager.getLMBByLmid(Long.parseLong(lmb.getFlmid()));
  19. //取得当前页数
  20. String currentPageStr = request.getParameter("param").split("_")[1] == null ? "0" : request.getParameter("param").split("_")[1];
  21. int currentPage = Integer.valueOf(currentPageStr);
  22. //文章总数
  23. //int wzCount = wzManager.getAllWzb(id,"1").size();
  24. int wzCount = wzManager.getAllWzbCount(lmb.getId(), "1");
  25. //本页显示条数
  26. int pageSize = 30;
  27. //分页首条记录游标
  28. int firstSize = currentPage * pageSize;
  29. //总页数
  30. int totalPage = wzCount % pageSize == 0 ? wzCount / pageSize : wzCount / pageSize+1;
  31. %>
  32. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  33. <title>长春经济技术开发区内网</title>
  34. <link rel="stylesheet" href="<s:property value="#application['basePath']"/>/main/images/base.css"/>
  35. </head>
  36. <body>
  37. <!--头部 开始-->
  38. <%@include file="top.jsp" %>
  39. <!--头部 结束-->
  40. <!--中间内容开始-->
  41. <div class="content">
  42. <%@include file="weather.jsp" %>
  43. <div class="innercont zclist">
  44. <div class="current" style="margin-bottom:5px"><img style="float:left"
  45. src="<s:property value="#application['basePath']"/>/main/images/home1.png"
  46. width="23px" height="23px">
  47. <p style="text-indent:10px">当前位置 :<a
  48. href="<s:property value="#application['basePath']"/>">首页 </a>>><a
  49. href="<s:property value="#application['basePath']"/>/main/<%=lmb.getId() %>_0/list.html"><%="".equals(flm.getLmmc()) ? "" : flm.getLmmc()+">>" %>
  50. </a> <a href="list.html"><%=lmb.getLmmc() %>
  51. </a></p></div>
  52. <ul class="listul">
  53. <%
  54. List<WZB> wzList = wzManager.getAllWzb(lmb.getId()+"", 1, firstSize, pageSize);
  55. for (WZB wzb : wzList) {
  56. %>
  57. <li><a target="_blank"
  58. href="<s:property value="#application['basePath']"/>/main/<%=wzb.getId()%>_0/news.html"><%=wzb.getWzbt(45) %>
  59. </a><em><%=wzb.getTjsj("yyyy-MM-dd")%>
  60. </em></li>
  61. <%} %>
  62. </ul>
  63. <!-- 分页显示 -->
  64. <table cellspacing="0" align="center" style="margin-top:30px">
  65. <script type="text/javascript">
  66. function page(cpage) {
  67. pageform.action = "<s:property value="#application['basePath']"/>/main/<%=id%>_" + cpage + "/list.html";
  68. pageform.submit();
  69. }
  70. </script>
  71. <form name="pageform" method="post"
  72. action="<s:property value="#application['basePath']"/>/main/<%=id%>_0/list.html">
  73. <input type="hidden" name="currentPage" value="">
  74. <tbody>
  75. <tr height="30" class="gray">
  76. <td>
  77. &nbsp;
  78. 总共:<span class="red">&nbsp;<%=wzCount %>&nbsp;</span>条记录
  79. &nbsp;
  80. 当前:<span class="red"><%=currentPage+1%></span><span class="web">/</span><span
  81. class="red"><%=totalPage %></span>&nbsp;页<span class="web">
  82. &nbsp;
  83. <%=pageSize %>条/页&nbsp;
  84. 本页显示第</span><span
  85. class="red">&nbsp;<%=(pageSize * (currentPage))+1 %>&nbsp;</span><span
  86. class="web">条到第</span><span class="red">&nbsp;<%= (pageSize * (currentPage))+pageSize%>&nbsp;</span><span
  87. class="web">条</span>
  88. &nbsp;&nbsp;
  89. <span class="web"><a
  90. href="<s:property value="#application['basePath']"/>/main/<%=id %>_0/list.html"
  91. class="red">首页</a></span>
  92. <span class="web"><a
  93. href="<s:property value="#application['basePath']"/>/main/<%=id %>_<%=currentPage-1<0?0:currentPage-1 %>/list.html"
  94. class="red">上页</a></span>
  95. <span class="web"><a
  96. href="<s:property value="#application['basePath']"/>/main/<%=id %>_<%=currentPage>=totalPage-1?currentPage:currentPage+1%>/list.html"
  97. class="red">下页</a></span>
  98. <span class="web"><a
  99. href="<s:property value="#application['basePath']"/>/main/<%=id %>_<%=totalPage-1 %>/list.html"
  100. class="red">尾页</a></span>
  101. <span class="web">转到第
  102. <select name="current" onchange="page(this.value)">
  103. <%for (int i = 0; i < totalPage; i++) {%>
  104. <option value="<%=i %>" <%=currentPage == i ? "selected" : "" %>><%=i+1 %></option>
  105. <%} %>
  106. </select>页</span>
  107. </td>
  108. </tr>
  109. </tbody>
  110. </table>
  111. <!-- 右侧页 -->
  112. </form>
  113. </div>
  114. </div>
  115. </body>
  116. </html>