From 680dd69afc809f9694378803bf21cef22a541836 Mon Sep 17 00:00:00 2001 From: Azerothwav Date: Sun, 3 Nov 2024 23:57:08 +0100 Subject: [PATCH] feat: finish project --- .../servlet/ModifyAttendanceServlet.class | Bin 4952 -> 4961 bytes build/web/WEB-INF/modifyAttendanceJSP.jsp | 8 ++++---- src/java/servlet/ModifyAttendanceServlet.java | 12 ++++++------ web/WEB-INF/modifyAttendanceJSP.jsp | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/build/web/WEB-INF/classes/servlet/ModifyAttendanceServlet.class b/build/web/WEB-INF/classes/servlet/ModifyAttendanceServlet.class index 3553f75007c4f649f45fb787f0104ecede5c39f8..8b7f95afdd36d9ab58a7135926cb1c808063783e 100644 GIT binary patch delta 1324 zcmah{S#T6p6g_X2emzZ3CJdp%RH`Vg2ql?N6UtIjK@<4^iw~_Spx^^2X(nwlVK%3m z2vvbmK|warhiu9Y5|35`3|`bvsKK&6XJ+eD$P|f4^N4|q>7+| z1t{iN$k3-jYt%x~WGI}DCd@HrTG!$V7UOA-B`Ti5vtovHU%#acj^X$F!9Y)!V+F@b z6|3;P7{*6uR#P%eNr#oJ!#Wk~v4O#<)z&h&Zyz;k&^Q^J7>3oGW~wR_iX|gjtUhU& zRh1Q$6``=6Hj;^i9vd4DjfkgW$r-va+%)w>t(J)BWAt=mOgDQ$!HX)kpnyR&C^uTK zji&X8$#K_9SEh(*iMr5;=@C6;Mw1Bz&Df^mWk?LZRBk#gGIeZPi|8_5X`d%IF}6pz zl>w|v1eGc5o%Y3wmldC2D6~bf%aJ0{L>y3spuLA0o8-EM);B zkGD=c(P7sxunV2Uuv;|ws&0FoP!iqVz?*oB&K?H=K@f}NZ6a|I$!TAhNP>kWnJXkf zO;72Xp3*h>(lUl(FZNLjyQz)>=f9TI_80ZWP3Ybws5S9>Hud{CYJi=fsE1-*LH`7? zzi?^a?s$79auI#2YTT;(318v_h2uEK zWDaunNk;bj8?kO`NV*XK#?f5xzst+yx5w}a29c*MYY(QFWo@T_yJhLCjXmosV>|P+ zU2B5V_KPz(OaDGp=2LqAnSsyo#RM<|=kO&ZifHB^DESpitlu~GV2Xe4!3cFs*()_4{u^}H#u%hd~}%C2|6q8M#Ty(MOc zeQ4AN3jc6nT}pa3YCbZ%PB@|tnr+VMWnU}Y>Z)+e!?(FpBIdLB-sT5>)coWyiJwhT z!5;TvMY)+?Q0~(FX8eUA)nRH2PdvF(R%D6LP{z~pb#mu?y4Wl?H(S_>iw?82aE0nL zV|=00vZ#rY@evUPo{=mh2l3fchG%m54u+cntkzW zIqF>l)SwPZ)GM*Rioh(h&p##Y*K4^vnBUEUz)d4{MbI70&#)-NZN1!yJZ*NKj4`j9 zr85UW<`~eu$AUcW3@aCTRD1uri5aQ`5A<-MxOh?zbuQW&JIxAO8P;s((d>Ur`|+SI znLEe^Hi|)Abei==W$6&jG%$xHw6KgOR?;enlwcBU;#%2bo5+*oP3Gn{e2oY-l`DCj z-FPTvF<0=0y!}kU%$1mys*?oWCoxfDNdCSd`TGXt_p+0>(!4FB6pJ43@UCnzD1yGn z9`bWLIR|&Yuz58zH02sw^S?N%r?u?(z-4NXnM`A%5iu!M_1 <% // 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) %>