echo "<th>" . $i . "<sup>éme</sup>H</th>"; } ?> </tr></thead> <tbody> <?php $i = 1; $array_of_absences = array(); $array_of_classes = array(); foreach ($absences as $absence) { if (!(in_array($absence['IDPERSONNEL'], $array_of_absences) && in_array($absence['CLASSE'], $array_of_classes))) { $array_of_absences[$i - 1] = $absence['IDPERSONNEL']; $array_of_classes[$i - 1] = $absence['CLASSE']; echo "<tr><td>{$i}</td><td>" . $absence['NOM'] . "</td><td>" . $absence['NIVEAUHTML'] . "</td>"; for ($h = 1; $h < HEURE_TRAVAIL; $h++) { $abs = enseignantAbsent($absence['IDPERSONNEL'], $absences, $h); if ($abs['CLASSE'] == $absence['CLASSE']) { if (is_null($abs) || empty($abs)) { echo "<td class='present'></td>"; } elseif ($abs['ETAT'] == "A") { echo "<td class='absent'></td>"; } elseif ($abs['ETAT'] == "R") { echo "<td class='retard' align='center'>" . substr($abs['RETARD'], 0, 5) . "</td>"; } } else { echo "<td class='present'></td>"; } $i++; } } }
?> " /></th> </tr></thead> <tbody> <?php $i = 1; foreach ($enseignants as $ens) { echo "<tr>"; if ($i < 10) { echo "<td>0" . $i . "</td>"; } else { echo "<td>" . $i . "</td>"; } echo "<td>" . $ens['NOM'] . " " . $ens['PRENOM'] . "</td>"; for ($j = 1; $j <= HEURE_TRAVAIL; $j++) { $abs = enseignantAbsent($ens['IDPERSONNEL'], $absences, $j); if ($abs === null) { echo "<td class='present'></td>"; } elseif ($abs['ETAT'] === "A") { echo "<td class='absent'></td>"; } elseif ($abs['ETAT'] === "R") { echo "<td class='retard' align='center'>" . $abs['RETARD'] . "</td>"; } else { echo "<td></td>"; # Ne dois jamais arriver ici } } # Pour l'envoi de SMS echo "<td align='center' title='Nombre de notification envoyee'>" . "<img style='cursor:pointer' src='" . img_phone_add() . "' </td>"; echo "</tr>"; $i++;