diff --git a/build/web/WEB-INF/classes/servlet/ModifyAttendanceServlet.class b/build/web/WEB-INF/classes/servlet/ModifyAttendanceServlet.class index 3553f75..8b7f95a 100644 Binary files a/build/web/WEB-INF/classes/servlet/ModifyAttendanceServlet.class and b/build/web/WEB-INF/classes/servlet/ModifyAttendanceServlet.class differ diff --git a/build/web/WEB-INF/modifyAttendanceJSP.jsp b/build/web/WEB-INF/modifyAttendanceJSP.jsp index 1721d10..5801660 100644 --- a/build/web/WEB-INF/modifyAttendanceJSP.jsp +++ b/build/web/WEB-INF/modifyAttendanceJSP.jsp @@ -6,7 +6,7 @@ uri="http://java.sun.com/jsp/jstl/core" %> <% // Définir la date de départ (lundi) - String startWeekStr = "2024-11-04"; // Format YYYY-MM-DD + String startWeekStr = request.getParameter("startWeek"); // Format YYYY-MM-DD SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Calendar calendar = Calendar.getInstance(); @@ -54,13 +54,13 @@ uri="http://java.sun.com/jsp/jstl/core" %>

Pour les periodes entre :

- + et - +

Pour le salarie avec l'identifiant :

- +

Lundi <%= weekDates.get(0) %>

diff --git a/src/java/servlet/ModifyAttendanceServlet.java b/src/java/servlet/ModifyAttendanceServlet.java index e2634f4..950a8e5 100644 --- a/src/java/servlet/ModifyAttendanceServlet.java +++ b/src/java/servlet/ModifyAttendanceServlet.java @@ -102,17 +102,17 @@ public class ModifyAttendanceServlet extends HttpServlet { int idSalarie = Integer.parseInt(request.getParameter("idSalarie")); - for (int i = 0; i < 7; i++) { - attendanceMysql.createVentil(TrmtDate.getSQLDate(calendar), "am", idSalarie, Integer.parseInt(request.getParameter(sdf.format(calendar.getTime()) + "_am"))); - attendanceMysql.createVentil(TrmtDate.getSQLDate(calendar), "pm", idSalarie, Integer.parseInt(request.getParameter(sdf.format(calendar.getTime()) + "_pm"))); + for (int i = 0; i < 5; i++) { + System.out.println(sdf.format(calendar.getTime())); + attendanceMysql.createVentil(TrmtDate.getSQLDate(calendar), "AM", idSalarie, Integer.parseInt(request.getParameter(sdf.format(calendar.getTime()) + "_am"))); + attendanceMysql.createVentil(TrmtDate.getSQLDate(calendar), "PM", idSalarie, Integer.parseInt(request.getParameter(sdf.format(calendar.getTime()) + "_pm"))); calendar.add(Calendar.DATE, 1); } - getServletContext().getRequestDispatcher("/WEB-INF/employeAttendanceJSP.jsp").forward(request, response); + response.sendRedirect("http://localhost:8080/PersonnelTP/EmployesAttendanceServlet"); } catch(Exception e) { e.printStackTrace(); - System.out.println(e); - getServletContext().getRequestDispatcher("/WEB-INF/employeAttendanceJSP.jsp").forward(request, response); + response.sendRedirect("http://localhost:8080/PersonnelTP/EmployesAttendanceServlet"); } } diff --git a/web/WEB-INF/modifyAttendanceJSP.jsp b/web/WEB-INF/modifyAttendanceJSP.jsp index 1721d10..5801660 100644 --- a/web/WEB-INF/modifyAttendanceJSP.jsp +++ b/web/WEB-INF/modifyAttendanceJSP.jsp @@ -6,7 +6,7 @@ uri="http://java.sun.com/jsp/jstl/core" %> <% // Définir la date de départ (lundi) - String startWeekStr = "2024-11-04"; // Format YYYY-MM-DD + String startWeekStr = request.getParameter("startWeek"); // Format YYYY-MM-DD SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Calendar calendar = Calendar.getInstance(); @@ -54,13 +54,13 @@ uri="http://java.sun.com/jsp/jstl/core" %>

Pour les periodes entre :

- + et - +

Pour le salarie avec l'identifiant :

- +

Lundi <%= weekDates.get(0) %>