feat: finish project

This commit is contained in:
Azerothwav 2024-11-03 23:57:08 +01:00
parent 11b50e734b
commit 680dd69afc
4 changed files with 14 additions and 14 deletions

View File

@ -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" %>
<form class="flex flex-col" action="ModifyAttendanceServlet" method="POST">
<div class="flex space-x-2">
<h1>Pour les periodes entre :</h1>
<input type="text" disabled name="startWeek" value="${param.startWeek}" class="w-[90px]">
<input type="text" id="startWeek" name="startWeek" value="${param.startWeek}" class="w-[90px]">
et
<input type="text" disabled name="startWeek" value="${param.endWeek}">
<input type="text" id="endWeek" name="endWeek" value="${param.endWeek}">
</div>
<div class="flex">
<h1>Pour le salarie avec l'identifiant :</h1>
<input type="text" disabled name="idSalarie" value="${param.idSalarie}">
<input type="text" id="idSalarie" name="idSalarie" value="${param.idSalarie}">
</div>
<div class="w-full">
<h1>Lundi <%= weekDates.get(0) %></h1>

View File

@ -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");
}
}

View File

@ -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" %>
<form class="flex flex-col" action="ModifyAttendanceServlet" method="POST">
<div class="flex space-x-2">
<h1>Pour les periodes entre :</h1>
<input type="text" disabled name="startWeek" value="${param.startWeek}" class="w-[90px]">
<input type="text" id="startWeek" name="startWeek" value="${param.startWeek}" class="w-[90px]">
et
<input type="text" disabled name="startWeek" value="${param.endWeek}">
<input type="text" id="endWeek" name="endWeek" value="${param.endWeek}">
</div>
<div class="flex">
<h1>Pour le salarie avec l'identifiant :</h1>
<input type="text" disabled name="idSalarie" value="${param.idSalarie}">
<input type="text" id="idSalarie" name="idSalarie" value="${param.idSalarie}">
</div>
<div class="w-full">
<h1>Lundi <%= weekDates.get(0) %></h1>