Gestionale per il centralino della brigata di zona 4
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

103 lines
3.3 KiB

  1. <%@page import="service.OrdiniService"%>
  2. <%@page import="bean.Contatto"%>
  3. <%@page import="java.util.ArrayList"%>
  4. <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  5. pageEncoding="UTF-8"%>
  6. <!DOCTYPE html>
  7. <html>
  8. <head>
  9. <meta charset="UTF-8">
  10. <title>Elenco ordini</title>
  11. <link rel="stylesheet"
  12. href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
  13. integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
  14. crossorigin="anonymous">
  15. <link rel="stylesheet" href="css/stile.css">
  16. </head>
  17. <body>
  18. <jsp:include page="nav.jsp"></jsp:include>
  19. <div style="margin: 25px">
  20. <h4>Elenco ordini</h4>
  21. <%
  22. ArrayList<Contatto> elencoOrdini = OrdiniService.leggiTutti();
  23. if (request.getAttribute("limit") != null) {
  24. int limite = (Integer) request.getAttribute("limit");
  25. elencoOrdini = OrdiniService.leggiTutti(limite);
  26. }
  27. if (elencoOrdini.isEmpty()) {
  28. %>
  29. <h2>Non ci sono ordini</h2>
  30. <%
  31. } else {
  32. %>
  33. <form action="ordini-ctrl" method="post">
  34. Seleziona i primi <select name="limite"
  35. class="form-control form-control-sm" style="width: 70px">
  36. <option value="20">20</option>
  37. <option value="20">50</option>
  38. <option value="20">70</option>
  39. <option value="20">100</option>
  40. </select><input type="hidden" name="azione" value="selectTop"> <input
  41. type="submit" value="OK" class="btn btn-light btn-sm" style="vertical-align: top">
  42. </form>
  43. <br>
  44. <table id="ordini" class="table table-dark"
  45. style="background-color: #3a3a3a">
  46. <tr>
  47. <th>#</th>
  48. <th>Nominativo</th>
  49. <th>Zona</th>
  50. <th>Indirizzo</th>
  51. <th>Telefono</th>
  52. <th>Componenti</th>
  53. <th>Composizione nucleo</th>
  54. <th>Note</th>
  55. <th>Consegnato</th>
  56. </tr>
  57. <%
  58. for (int i = 0; i < elencoOrdini.size(); i++) {
  59. Contatto contatto = elencoOrdini.get(i);
  60. %>
  61. <tr>
  62. <td><a href="home-contatto.jsp?id=<%=contatto.getTelefono()%>"
  63. style="color: white; font-weight: bold"><%=i + 1%></a></td>
  64. <td><%=contatto.getNome()%> <%=contatto.getCognome()%></td>
  65. <td><%=contatto.getArea()%></td>
  66. <td><%=contatto.getIndirizzo()%></td>
  67. <td><%=contatto.getTelefono()%></td>
  68. <td><%=contatto.getNumero_persone()%></td>
  69. <td><%=contatto.getComposizione_nucleo()%></td>
  70. <td><%=contatto.getNote_sacchetto()%></td>
  71. <th>
  72. <form action="ordini-ctrl" method="post" style="text-align: center">
  73. <input type="hidden" name="azione" value="elimina"> <input
  74. type="hidden" name="id" value="<%=contatto.getTelefono()%>">
  75. <input type="submit" value="&times;" class="btn btn-danger btn-sm rounded-pill">
  76. </form>
  77. </th>
  78. </tr>
  79. <%
  80. }
  81. %>
  82. </table>
  83. <%
  84. }
  85. %>
  86. </div>
  87. <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
  88. integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n"
  89. crossorigin="anonymous"></script>
  90. <script
  91. src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
  92. integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
  93. crossorigin="anonymous"></script>
  94. <script
  95. src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
  96. integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
  97. crossorigin="anonymous"></script>
  98. </body>
  99. </html>