diff --git a/src/java/servlet/GPServlet.java b/src/java/servlet/GPServlet.java deleted file mode 100644 index e396971..0000000 --- a/src/java/servlet/GPServlet.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package servlet; - -import bdd.GardeMySQL; -import bean.Gardes; -import bean.Pompier; -import form.DispoForm; -import java.io.IOException; -import java.io.PrintWriter; -import jakarta.servlet.ServletException; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.servlet.http.HttpSession; -import java.util.ArrayList; -import java.util.Calendar; -import util.TrmtDate; - -/** - * - * @author clementine.desrucques - */ -public class GPServlet extends HttpServlet { - - /** - * Processes requests for both HTTP GET and POST - * methods. - * - * @param request servlet request - * @param response servlet response - * @throws ServletException if a servlet-specific error occurs - * @throws IOException if an I/O error occurs - */ - protected void processRequest(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - response.setContentType("text/html;charset=UTF-8"); - try ( PrintWriter out = response.getWriter()) { - /* TODO output your page here. You may use following sample code. */ - out.println(""); - out.println(""); - out.println(""); - out.println("Servlet GPServlet"); - out.println(""); - out.println(""); - out.println("

Servlet GPServlet at " + request.getContextPath() + "

"); - out.println(""); - out.println(""); - } - } - - // - /** - * Handles the HTTP GET method. - * - * @param request servlet request - * @param response servlet response - * @throws ServletException if a servlet-specific error occurs - * @throws IOException if an I/O error occurs - */ - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { -// processRequest(request, response); - HttpSession maSession = request.getSession(); - - if(maSession.getAttribute("lesVentilInit") == null){ - ArrayList lesPompiers = (ArrayList) maSession.getAttribute("lesPompiers"); - Calendar[] lesDates = new Calendar[7]; - String[] lesDatesEnString = new String[7]; - lesDates[0] = TrmtDate.getDateDebutSemaine(); - lesDatesEnString[0] = TrmtDate.getDateAAfficher(lesDates[0]); - - for (int i = 1; i < lesDates.length; i++) { - lesDates[i] = TrmtDate.addDays(lesDates[0], i); - lesDatesEnString[i] = TrmtDate.getDateAAfficher(lesDates[i]); - } - maSession.setAttribute("lesDates", lesDates); - - maSession.setAttribute("lesDatesEnString", lesDatesEnString); - System.out.println(lesDatesEnString.toString()); - /*Initialisation des periodes */ - int[] lesPeriodes = {1,2,3,4}; - maSession.setAttribute("lesPeriodes", lesPeriodes); - System.out.println(lesPeriodes.toString()); - /* Recherche des ventilations */ - - GardeMySQL vm = new GardeMySQL(); - ArrayList lesVentilInit = vm.getLesDisponibilite(lesDates, lesPeriodes,request); - //System.out.println("lesVentilInit : " + lesVentilInit); - maSession.setAttribute("lesVentilInit", lesVentilInit); - - - /* Initialisation des couleurs */ - String[] lesCouleurs = {"blanc", "gris", "jaune"}; - maSession.setAttribute("lesCouleurs", lesCouleurs); - } - /* Affichage de la page de ventilation */ - getServletContext().getRequestDispatcher("/WEB-INF/gardeJSP.jsp").forward(request, response); - } - - /** - * Handles the HTTP POST method. - * - * @param request servlet request - * @param response servlet response - * @throws ServletException if a servlet-specific error occurs - * @throws IOException if an I/O error occurs - */ - @Override - protected void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { -// processRequest(request, response); - DispoForm vf = new DispoForm(); - vf.verifDispo(request); - getServletContext().getRequestDispatcher("/WEB-INF/pompierJSP.jsp").forward(request, response); - } - - /** - * Returns a short description of the servlet. - * - * @return a String containing servlet description - */ - @Override - public String getServletInfo() { - return "Short description"; - }// - -} diff --git a/web/WEB-INF/gardeJSP.jsp b/web/WEB-INF/gardeJSP.jsp deleted file mode 100644 index eab42a9..0000000 --- a/web/WEB-INF/gardeJSP.jsp +++ /dev/null @@ -1,93 +0,0 @@ -<%-- - Document : gardeJSP - Created on : 14 déc. 2021, 08:20:45 - Author : clementine.desrucques ---%> - -<%@page contentType="text/html" pageEncoding="UTF-8"%> -<%@include file= "jspf/debutJSP.jspf" %> - - <%@include file= "jspf/header.jspf" %> -
-
- - - -
- - - Feuille de gardes - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NoNom Prenom ${uneDate}
${unePeriode.getCode()}
${uneVentil.getPompier().getId()}${uneVentil.getPompier().getNom()} ${uneVentil.getPompier().getPrenom()} - -
-
- - Dispo - Indispo - Au travail - De garde : X - -
-
-
-
-
- -