/** * Effectue l'insertion des absences pour cet appel * @param type $idappel */ private function insererAbsences($idappel) { $eleves = $this->Inscription->getInscrits($this->request->idclasse, $this->session->anneeacademique); $classe = $this->Classe->getBy(['IDCLASSE' => $this->request->idclasse]); # 8 heure pour les classes different de 1ere et Tle $horaire = getNbHoraire($classe['GROUPE']); # Permet d'obtenir 1 = Lun ... 5 = Vendredi, Utiliser pour obtenir le champ select # Qui est sous la forme de matricule_horaire_jour $jour = $this->request->jour; foreach ($eleves as $el) { $mat = $el['MATRICULE']; # Parcourir les horaires de la journee et inserer s'il n'est pas present for ($i = 1; $i <= $horaire; $i++) { $etat = $this->request->{$mat . "_" . $i . "_" . $jour}; #Proceder a l'insertion que s'il est absent, exclu ou en retard if (!empty($etat)) { $param = ["appel" => $idappel, "eleve" => $el['IDELEVE'], "etat" => $etat, "horaire" => $i]; $this->Absence->insert($param); } } } }
# Titre du PDF $titre = '<p style = "text-decoration:underline"><b>LISTE D\'APPEL DE L\'ANNEE SCOLAIRE ' . $anneescolaire . '</b></p>'; $pdf->WriteHTMLCell(0, 50, $middle - 40, $y - 10, $titre); $titre = '<span style = "text-decoration:underline"><b>CLASSE</b></span><b> : ' . $classe['NIVEAUHTML'] . '</b>'; $pdf->WriteHTMLCell(0, 50, $middle - 10, $y, $titre); $d1 = new DateFR($datedebut); $d2 = new DateFR($datefin); $semaine = '<span>Semaine du <b style="text-decoration:underline">' . $d1->getDate() . " " . $d1->getMois(3) . " " . $d1->getYear() . '</b> au <b style="text-decoration:underline">' . $d2->getDate() . " " . $d2->getMois(3) . " " . $d2->getYear() . '</b></span>'; $pdf->WriteHTMLCell(100, 50, 135, 10 + $y, $semaine); $tab = getEffectifs($eleves); $pdf->WriteHTMLCell(0, 5, $x, $y + 10, '<span style="text-decoration:underline">Filles</span> : <b>' . $tab[0] . '</b>'); $pdf->WriteHTMLCell(0, 5, $x + 40, $y + 10, '<span style="text-decoration:underline">Garçons</span> : <b>' . $tab[1] . '</b>'); $pdf->WriteHTMLCell(0, 5, $x, $y + 15, '<span style="text-decoration:underline">Effectif Total</span> : <b>' . $tab[2] . '</b>'); $pdf->SetFont("Times", '', 8); # Nombre de colonnes, pour les 1eres et Tle, 9 colonnes $l = getNbHoraire($classe['GROUPE']); $absent = "<b>A</b>"; $retard = "<b>R</b>"; $exclu = "<b>E</b>"; $justifier = "<b>J</b>"; $pdf->SetFont("Times", '', 8); $corps = '<table cellpadding="2"> <thead><tr border ="0.5" style = "font-weight:bold"><th border ="0.5" width ="3%">N°</th> <th border ="0.5" align="center" width ="23%">Noms Prénoms</th> <th border ="0.5" align="center" width ="5%">Sexe</th> <th border ="0.5" align="center" width ="14%" style="border-right:2px solid #000000" colspan="' . $l . '">Lundi</th> <th border ="0.5" align="center" width ="14%" style="border-right:2px solid #000000" colspan="' . $l . '">Mardi</th> <th border ="0.5" align="center" width ="14%" style="border-right:2px solid #000000" colspan="' . $l . '">Mercredi</th> <th border ="0.5" align="center" width ="14%" style="border-right:2px solid #000000" colspan="' . $l . '">Jeudi</th> <th border ="0.5" align="center" width ="14%" style="border-right:2px solid #000000" colspan="' . $l . '">Vendredi</th> <th border ="0.5" align="center" width ="5%">Total</th></tr></thead><tbody><tr>';
<?php $colonnes = getNbHoraire($classe['GROUPE']); echo "<input type='hidden' name ='datedujour' value = '" . $datedujour . "' />"; echo "<input type='hidden' name='jour' value='" . $jour . "' />"; ?> <table class="dataTable" cellpadding='0' id="tableAbsences<?php echo $jour; ?> "> <thead><tr><th>N°</th><th>Noms & Prénoms</th> <?php for ($j = 1; $j <= $colonnes; $j++) { if ($j === 1) { echo "<th>1<sup>ère</sup>H</th>"; } elseif ($j !== $colonnes) { echo "<th>" . $j . "<sup>ème</sup>H</th>"; } else { echo "<th>" . $j . "<sup>ème</sup>H</th>"; } } ?> </tr></thead> <tbody> <?php $i = 1; foreach ($eleves as $el) { $mat = $el['MATRICULE']; echo "<tr>"; if ($i < 10) { echo "<td>0" . $i . "</td>";