<span style="font-size: 10px;margin:0; padding:0">Activité : <?php echo $activite['TITRE']; ?> </span> <table class="dataTable" id="tableChapitre"> <thead><tr><th>N°</th><th>Titre</th><th></th><th></th></tr></thead> <tbody> <?php $i = 1; foreach ($chapitres as $chap) { echo "<tr><td>" . $i . "</td><td>" . $chap['TITRE'] . "</td>"; echo "<td align='center'>"; if (isAuth(525)) { echo "<img style='cursor:pointer' src='" . img_edit() . "' " . "onclick=\"modifierChapitre(" . $chap['IDCHAPITRE'] . "," . $chap['ACTIVITE'] . ")\" /> "; } else { echo "<img style='cursor:pointer' src='" . img_edit_disabled() . "' /> "; } if (isAuth(524)) { echo "<img style='cursor:pointer' src='" . img_delete() . "' " . "onclick=\"supprimerChapitre(" . $chap['IDCHAPITRE'] . ", " . $chap['ACTIVITE'] . ")\" />"; } else { echo "<img style='cursor:pointer' src='" . img_delete_disabled() . "' />"; } echo "</td><td align='center'>" . "<img style='cursor:pointer' title='Ajouter des lecons a ce chapitre' src='" . img_plus() . "' " . "onclick=\"chargerLecon(" . $chap['IDCHAPITRE'] . ");\" /></td></tr>"; $i++; } ?> </tbody> </table> <script> $(document).ready(function () { if (!$.fn.DataTable.isDataTable("#tableChapitre")) {
<?php $data = array(); $d = new DateFR(); foreach ($eleves as $el) { $d->setSource($el['DATENAISS']); $action = ""; if (isAuth(520)) { $action .= "<img style='cursor:pointer' src='" . img_edit() . "' " . "onclick=\"document.location='" . Router::url("eleve", "edit", $el['IDELEVE']) . "'\" />"; } else { $action .= "<img style='cursor:pointer' src='" . img_edit_disabled() . "' />"; } if (isAuth(521)) { $action .= " <img style='cursor:pointer' src='" . img_delete() . "' " . "onclick=\"document.location='" . Router::url("eleve", "delete", $el['IDELEVE']) . "'\" />"; } else { $action .= " <img style='cursor:pointer' src='" . img_delete_disabled() . "' />"; } $datenaiss = $d->getDate() . " " . $d->getMois(3) . " " . $d->getYear(); $line_nom = "<span style='cursor:pointer;display:block' " . "onclick=\"ouvrirFiche(" . $el['IDELEVE'] . ")\">" . $el['NOM'] . " " . $el['PRENOM'] . "</span>"; $row = ["MATRICULE" => $el['MATRICULE'], "NOM" => $line_nom, "SEXE" => $el['SEXE'], "DATENAISS" => $datenaiss, "ACTION" => $action]; $data[] = $row; } echo json_encode($data);