sdisM2/web/WEB-INF/gardeJSP.jsp
clementine.desrucques f293ce8b0f Merge origin/master
Conflicts:
	web/WEB-INF/feuilleGardes.jsp
	web/css/mycss.css
2021-12-14 08:43:01 +01:00

94 lines
3.7 KiB
Plaintext

<%--
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" %>
<body>
<%@include file= "jspf/header.jspf" %>
<div class="container">
<section id="contenueAffiche" class="row">
<fieldset class="row mt-1 mb-10">
<legend>
Feuille de gardes
</legend>
<form action="gardes" method="POST">
<table class="table">
<thead>
<tr>
<th rowspan="2">No</th>
<th rowspan="2">Nom Prenom</th>
<c:forEach items='${sessionScope.lesDatesEnString}' var="uneDate" varStatus="status">
<th colspan="4" class="text-center"> ${uneDate}</th>
</c:forEach>
</tr>
<tr>
<c:forEach var="i" begin="0" end="6" step="1">
<c:forEach items='${sessionScope.lesPeriodes}' var="unePeriode" varStatus="status">
<c:set var="periode" value="${unePeriode.getCode()}" scope="page"/>
<td class="text-center">${unePeriode}</td>
</c:forEach>
</c:forEach>
</tr>
</thead>
<tbody>
<c:set var="oldId" value="-1" scope="page"/>
<tr>
<c:forEach items='${sessionScope.lesVentilInit}' var="uneVentil" varStatus="status">
<c:set var="newId" value='${uneVentil.getPompier().getId()}' scope="page"/>
<c:if test='${oldId != newId}' var="test" scope="page">
</tr><tr>
<td>${uneVentil.getPompier().getId()}</td>
<td>${uneVentil.getPompier().getNom()} ${uneVentil.getPompier().getPrenom()}</td>
<c:set var="oldId" value='${newId}' scope="page"/>
</c:if>
<c:set var="activite" value='${uneVentil.getDisponibilite()}' scope="page"/>
<td>
<input readonly type="text" value='${activite}' name="lesActivites"class="ztVentil ${sessionScope.lesCouleurs[activite]}"/>
</td>
</c:forEach>
</tr>
</tbody>
</table>
<div id="legendCouleur">
<span style="background-color: white">Dispo</span>
<span style="background-color: gray">Indispo</span>
<span style="background-color: yellow">Au travail</span>
<span>De garde : X</span>
</div>
</form>
</fieldset>
</section>
</div>
</body>
<script>
var couleurs = ["blanc", "gris", "jaune"];
var lesAct = document.getElementsByClassName("ztVentil");
for (var uneAct of lesAct) {
uneAct.onclick = function () {
var act = this.value;
var newAct = (act + 1) % 3;
var coul = couleurs[newAct];
this.classList.remove(couleurs[act]);
this.classList.add(coul);
this.value = newAct;
}
}
</script>