showRoom.jsp 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <title>会议室信息查询</title>
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  9. <!-- 引入bootstrap -->
  10. <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/bootstrap.min.css">
  11. <!-- 引入JQuery bootstrap.js-->
  12. <script src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>
  13. <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
  14. <%--<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">--%>
  15. </head>
  16. <body>
  17. <!-- 顶栏 -->
  18. <jsp:include page="top.jsp"></jsp:include>
  19. <!-- 中间主体 -->
  20. <div class="container" id="content">
  21. <div class="row">
  22. <jsp:include page="menu.jsp"></jsp:include>
  23. <div class="col-md-10">
  24. <div class="panel panel-default">
  25. <div class="panel-heading">
  26. <div class="row">
  27. <h1 class="col-md-5">会议室信息查询</h1>
  28. <form class="bs-example bs-example-form col-md-5" role="form" style="margin: 20px 0 10px 0;" action="${pageContext.request.contextPath}/ordinary/queryRoom" id="form1" method="post">
  29. <div class="input-group">
  30. <input type="text" class="form-control" placeholder="请输入会议室" name="findByName">
  31. <span class="input-group-addon btn" onclick="document.getElementById('form1').submit" id="sub">搜索</span>
  32. </div>
  33. </form>
  34. </div>
  35. </div>
  36. <table class="table table-bordered">
  37. <thead>
  38. <tr>
  39. <th>会议室编号</th>
  40. <th>会议室名称</th>
  41. <th>详细信息</th>
  42. </tr>
  43. </thead>
  44. <tbody>
  45. <c:forEach items="${roomList}" var="item">
  46. <tr>
  47. <td>${item.id}</td>
  48. <td>${item.name}</td>
  49. <td>${item.message}</td>
  50. </tr>
  51. </c:forEach>
  52. </tbody>
  53. </table>
  54. <div class="panel-footer">
  55. <c:if test="${pagingVO != null}">
  56. <nav style="text-align: center">
  57. <ul class="pagination">
  58. <li><a href="${pageContext.request.contextPath}/ordinary/showRoom?page=${pagingVO.upPageNo}">&laquo;上一页</a></li>
  59. <li class="active"><a href="">${pagingVO.curentPageNo}</a></li>
  60. <c:if test="${pagingVO.curentPageNo+1 <= pagingVO.totalCount}">
  61. <li><a href="${pageContext.request.contextPath}/ordinary/showRoom?page=${pagingVO.curentPageNo+1}">${pagingVO.curentPageNo+1}</a></li>
  62. </c:if>
  63. <c:if test="${pagingVO.curentPageNo+2 <= pagingVO.totalCount}">
  64. <li><a href="${pageContext.request.contextPath}/ordinary/showRoom?page=${pagingVO.curentPageNo+2}">${pagingVO.curentPageNo+2}</a></li>
  65. </c:if>
  66. <c:if test="${pagingVO.curentPageNo+3 <= pagingVO.totalCount}">
  67. <li><a href="${pageContext.request.contextPath}/ordinary/showRoom?page=${pagingVO.curentPageNo+3}">${pagingVO.curentPageNo+3}</a></li>
  68. </c:if>
  69. <c:if test="${pagingVO.curentPageNo+4 <= pagingVO.totalCount}">
  70. <li><a href="${pageContext.request.contextPath}/ordinary/showRoom?page=${pagingVO.curentPageNo+4}">${pagingVO.curentPageNo+4}</a></li>
  71. </c:if>
  72. <li><a href="${pageContext.request.contextPath}/ordinary/showRoom?page=${pagingVO.totalCount}">最后一页&raquo;</a></li>
  73. </ul>
  74. </nav>
  75. </c:if>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <div class="container" id="footer">
  82. <div class="row">
  83. <div class="col-md-12"></div>
  84. </div>
  85. </div>
  86. </body>
  87. <script type="text/javascript">
  88. <%--设置菜单中选中背景色改变,不同导航栏,nth-child(1)中参数1不可重复--%>
  89. $("#nav li:nth-child(1)").addClass("active")
  90. <c:if test="${pagingVO != null}">
  91. if (${pagingVO.curentPageNo} == ${pagingVO.totalCount}) {
  92. $(".pagination li:last-child").addClass("disabled")
  93. };
  94. if (${pagingVO.curentPageNo} == ${1}) {
  95. $(".pagination li:nth-child(1)").addClass("disabled")
  96. };
  97. </c:if>
  98. function removeRoom(id) {
  99. if(confirm('确实要删除该客户吗?')) {
  100. $.post("${pageContext.request.contextPath}/ordinary/removeRoom",{"id":id},function(data){
  101. alert("客户删除更新成功!");
  102. window.location.reload();
  103. });
  104. }
  105. }
  106. $("#sub").click(function () {
  107. $("#form1").submit();
  108. });
  109. </script>
  110. </html>