} } //$pdf->CellFitScale($L_entete_classe,$H_entete_classe,' '.$current_classe,'LTRB',2,'C'); } $pdf->Setxy($X_entete_matiere, $Y_entete_matiere); $pdf->SetFont('DejaVu', '', 14); //Si on peut connaître le nom de la matière (id_groupe existe !) if ($id_groupe != NULL) { $current_group = get_group($id_groupe); $matiere = $current_group["description"]; //echo $matiere."<br/>"; $pdf->CellFitScale($L_entete_discipline, $H_entete_discipline / 2, $matiere, 'LTR', 2, 'C'); $pdf->SetFont('DejaVu', 'I', 11); $pdf->Cell($L_entete_classe, $H_entete_classe / 2, 'Année scolaire ' . getSettingValue('gepiYear'), 'LRB', 2, 'C'); } elseif ($id_aid != NULL) { $current_aid = get_tab_aid($id_aid); $matiere = $current_aid["nom_aid"]; //echo $matiere."<br/>"; $pdf->CellFitScale($L_entete_discipline, $H_entete_discipline / 2, $matiere, 'LTR', 2, 'C'); $pdf->SetFont('DejaVu', 'I', 11); $pdf->Cell($L_entete_classe, $H_entete_classe / 2, 'Année scolaire ' . getSettingValue('gepiYear'), 'LRB', 2, 'C'); } else { // On demande une classe ==> on ajoute la période. $pdf->SetFont('DejaVu', 'I', 11); $sql = "SELECT num_periode,nom_periode FROM periodes WHERE id_classe='{$id_classe}' AND num_periode={$id_periode} ORDER BY num_periode"; $res_per = mysqli_query($GLOBALS["mysqli"], $sql); if (mysqli_num_rows($res_per) == 0) { die("Problème avec les infos de la classe {$id_classe}</body></html>"); } else { $lig_tmp = mysqli_fetch_object($res_per); $periode = $lig_tmp->nom_periode;
$msg = ""; if (!isset($id_aid)) { header("Location: ../accueil.php?msg=Aucun_AID_choisi"); die; } elseif (!preg_match("/^[0-9]{1,}\$/", $id_aid)) { header("Location: ../accueil.php?msg=Identifiant AID invalide"); die; } if (isset($periode_num)) { $periode_num = preg_replace('/[^0-9]/', '', $periode_num); if ($periode_num == '') { unset($periode_num); //$msg.="Numéro de période invalide.<br />\n"; } } $tab_aid = get_tab_aid($id_aid, $orderby); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <?php echo "<title>" . $tab_aid['nom_aid'] . " (" . $tab_aid['nom_general_complet'] . ")</title>\n"; ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link type="text/css" rel="stylesheet" href="../style.css" /> <?php if (isset($style_screen_ajout)) { if ($style_screen_ajout == 'y') { echo "<link rel='stylesheet' type='text/css' href='{$gepiPath}/style_screen_ajout.css' />\n"; }
$periode_num = 1; } $_SESSION['mes_listes_periode_num'] = $periode_num; if (is_numeric($id_groupe) && $id_groupe > 0) { $current_group = get_group($id_groupe); //echo "2<br />"; } else { $current_group = false; } if ($current_group) { $nom_fic = $current_group["name"] . "-" . remplace_accents(preg_replace('/, /', '~', $current_group["classlist_string"]), 'all') . ".csv"; } elseif (isset($id_aid)) { if (!preg_match("/^[0-9]{1,}\$/", $id_aid)) { die("Indice AID '{$id_aid}' invalide."); } $tab_aid = get_tab_aid($id_aid); $nom_fic = remplace_accents($tab_aid['nom_aid'] . "_" . $tab_aid['nom_general_complet'] . "_periode_" . $periode_num, "all") . ".csv"; } else { if ($id_classe == 'toutes') { $classe = "Toutes_les_classes"; $nom_fic = $classe . ".csv"; } else { $classe = get_nom_classe($id_classe); $nom_fic = remplace_accents($classe, "all") . ".csv"; } } //debug_var(); send_file_download_headers('text/x-csv', $nom_fic); if (!isset($id_classe) || $id_classe != "toutes") { include "../lib/periodes.inc.php"; }
function traite_donnees_aid($id_aid, $id_periode, &$nombre_eleves, $tri) { global $prefix_base; $current_aid = get_tab_aid($id_aid); /* echo "Aid n°$id_aid<pre>"; print_r($current_aid); echo "</pre>"; */ $donnees_eleves = array(); $cpt_i = 0; if (isset($current_aid["eleves"][$id_periode]["users"])) { foreach ($current_aid["eleves"][$id_periode]["users"] as $current_eleve) { $eleve_login = $current_eleve["login"]; $eleve_nom = $current_eleve["nom"]; $eleve_prenom = $current_eleve["prenom"]; $sql = "SELECT classe, nom_complet FROM classes WHERE id='" . $current_eleve["classe"] . "'"; //echo "$sql<br />"; $res_tmp = mysqli_query($GLOBALS["mysqli"], $sql); if (mysqli_num_rows($res_tmp) == 0) { die("{$eleve_login} ne serait dans aucune classe???</body></html>"); } else { $lig_tmp = mysqli_fetch_object($res_tmp); $eleve_classe = $lig_tmp->classe; $eleve_classe_nom_complet = $lig_tmp->nom_complet; } // La fonction get_group() dans /lib/groupes.inc.php ne récupère pas le sexe et la date de naissance,ereno... //$sql="SELECT id_classe,naissance,ereno,doublant,regime FROM eleves, j_eleves_classes, j_eleves_regime WHERE eleves.login='******' AND j_eleves_classes.login='******' AND j_eleves_regime.login='******'"; $sql = "SELECT id_classe,naissance,ereno FROM eleves, j_eleves_classes WHERE eleves.login='******' AND j_eleves_classes.login=eleves.login;"; //echo "$sql<br />"; $res_tmp = mysqli_query($GLOBALS["mysqli"], $sql); if (mysqli_num_rows($res_tmp) == 0) { die("Problème avec les infos de {$eleve_login}</body></html>"); } else { $lig_tmp = mysqli_fetch_object($res_tmp); $eleve_naissance = $lig_tmp->naissance; $eleve_ereno = $lig_tmp->ereno; $eleve_id_classe = $lig_tmp->id_classe; // A quoi servent les données ci-dessous? Je n'ai pas vu dans les pages appelant liste.inc.php $sql = "SELECT doublant,regime FROM j_eleves_regime WHERE login='******';"; $res_regime = mysqli_query($GLOBALS["mysqli"], $sql); if (mysqli_num_rows($res_regime) == 0) { $eleve_doublant = ''; $eleve_regime = ''; } else { $lig_tmp2 = mysqli_fetch_object($res_regime); $eleve_doublant = $lig_tmp2->doublant; $eleve_regime = $lig_tmp2->regime; } } //pour rendre compatible groupe et classe par la suite $donnees_eleves[$cpt_i]['login'] = $eleve_login; $donnees_eleves[$cpt_i]['ereno'] = $eleve_ereno; $donnees_eleves[$cpt_i]['nom'] = $eleve_nom; $donnees_eleves[$cpt_i]['prenom'] = $eleve_prenom; $donnees_eleves[$cpt_i]['naissance'] = $eleve_naissance; $donnees_eleves[$cpt_i]['nom_complet'] = $eleve_classe_nom_complet; $donnees_eleves[$cpt_i]['nom_court'] = $eleve_classe; $donnees_eleves[$cpt_i]['doublant'] = $eleve_doublant; $donnees_eleves[$cpt_i]['regime'] = $eleve_regime; $donnees_eleves[$cpt_i]['id_classe'] = $eleve_id_classe; $donnees_eleves[$cpt_i]['id_periode'] = $id_periode; // ID de la période traitée $ident_eleve_sel1 = $donnees_eleves[$cpt_i]['login']; $cpt_i++; } } $nombre_eleves = $cpt_i; // parametre de la fonction /* echo "<pre>\$donnees_eleves\n"; print_r($donnees_eleves); echo "</pre>"; */ //echo "tri=$tri<br />"; if ($tri == 'classes') { $column = array(); $column1 = array(); $column2 = array(); foreach ($donnees_eleves as $sortarray) { //$column[] = $sortarray['id_classe']; //@array_multisort($column, SORT_ASC, $donnees_eleves); $column[] = $sortarray['nom_complet']; $column1[] = $sortarray['nom_court']; $column2[] = $sortarray['nom']; } @array_multisort($column, SORT_ASC, $column1, SORT_ASC, $column2, SORT_ASC, $donnees_eleves); /* echo "<pre>\$column\n"; print_r($column); echo "</pre>"; */ } /* echo "<pre>\$donnees_eleves\n"; print_r($donnees_eleves); echo "</pre>"; */ if (isset($donnees_eleves)) { return $donnees_eleves; } else { return array(); } }
$temoin_afficher_aid = "n"; if ($_SESSION['statut'] == 'professeur') { $sql = "SELECT DISTINCT ac.* FROM aid_config ac, aid a, j_aid_utilisateurs jau WHERE ac.indice_aid=a.indice_aid AND a.indice_aid=jau.indice_aid AND jau.id_utilisateur='" . $_SESSION['login'] . "' ORDER BY ac.nom, ac.nom_complet;"; } else { $sql = "SELECT DISTINCT ac.* FROM aid_config ac, aid a, j_aid_eleves jae WHERE ac.indice_aid=a.indice_aid AND a.indice_aid=jae.indice_aid AND a.id=jae.id_aid ORDER BY ac.nom, ac.nom_complet;"; } $res_aid_config = mysqli_query($GLOBALS["mysqli"], $sql); if (mysqli_num_rows($res_aid_config) > 0) { $html_aid = "<h3>Liste des AID : </h3>\r\n<div style='margin-left:3em; margin-bottom:1em;'>\r\n\t<p>Séléctionnez l'AID pour lequel vous souhaitez imprimer une liste alphabétique d'élèves au format PDF :</p>\r\n\t<table>\n"; while ($lig_aid_config = mysqli_fetch_object($res_aid_config)) { if ($_SESSION['statut'] == 'professeur') { $sql = "SELECT DISTINCT a.* FROM aid a, j_aid_utilisateurs jau WHERE a.indice_aid='" . $lig_aid_config->indice_aid . "' AND a.indice_aid=jau.indice_aid AND jau.id_aid=a.id AND jau.id_utilisateur='" . $_SESSION['login'] . "' ORDER BY a.numero, a.nom;"; } else { $sql = "SELECT DISTINCT a.* FROM aid a, j_aid_eleves jae WHERE a.indice_aid='" . $lig_aid_config->indice_aid . "' AND a.indice_aid=jae.indice_aid AND a.id=jae.id_aid ORDER BY a.numero, a.nom;"; } //echo "$sql<br />\n"; $res_aid = mysqli_query($GLOBALS["mysqli"], $sql); if (mysqli_num_rows($res_aid) > 0) { $temoin_afficher_aid = "y"; while ($lig_aid = mysqli_fetch_object($res_aid)) { $current_aid = get_tab_aid($lig_aid->id); $html_aid .= "\r\n\t\t<tr>\r\n\t\t\t<td>\r\n\t\t\t\t<b>" . htmlspecialchars($current_aid['nom_aid']) . "</b> (" . $current_aid['classlist_string'] . ") : </b>\r\n\t\t\t</td>\r\n\t\t\t<td> - </td>\r\n\t\t\t<td>\r\n\t\t\t\tTri <a href='liste_pdf.php?id_aid={$lig_aid->id}' target='_blank'>Alpha</a> - <a href='liste_pdf.php?id_aid={$lig_aid->id}&tri=classes' target='_blank'>Classe</a>\r\n\t\t\t</td>\r\n\t\t</tr>\n"; } } } $html_aid .= "</table>\r\n</div>\n"; if ($temoin_afficher_aid == "y") { echo $html_aid; } } require "../lib/footer.inc.php";
$current_group = get_group($lig->id_groupe, array('matieres', 'classes', 'profs')); $info_grp = get_info_grp($lig->id_groupe); echo "<p>" . $info_grp . "</p>"; echo "<p>Voir l'EDT de la classe : "; $cpt_classe = 0; foreach ($current_group['classes']['classes'] as $current_id_classe => $current_classe) { if ($cpt_classe > 0) { echo " - "; } //echo "<a href='".$_SERVER['PHP_SELF']."?login_prof=$login_prof&id_classe=$current_id_classe&type_affichage=$type_affichage&login_eleve=$login_eleve&num_semaine_annee=$num_semaine_annee&affichage=$affichage&mode=afficher_edt".add_token_in_url()."' target='_blank' title=\"Afficher l'EDT seul\"><img src='../images/icons/edt.png' class='icone16' alt='EDT seul' /></a>"; echo "<a href='" . $_SERVER['PHP_SELF'] . "?id_classe={$current_id_classe}&type_affichage=classe&num_semaine_annee={$num_semaine_annee}&affichage={$affichage}&mode=afficher_edt" . add_token_in_url() . "' target='_blank' title=\"Afficher l'EDT seul\"><img src='../images/icons/edt.png' class='icone16' alt='EDT seul' />" . $current_classe['classe'] . "</a>"; $cpt_classe++; } echo "</p>"; } elseif ($lig->id_aid != 0) { $tab_aid = get_tab_aid($lig->id_aid); echo "<p>" . $tab_aid['nom_general_court'] . " (" . $tab_aid['nom_general_complet'] . ") (" . $tab_aid['nom_aid'] . ")</p>"; echo "<p>Voir l'EDT de la classe : "; $cpt_classe = 0; foreach ($tab_aid['classes'] as $current_id_classe => $current_classe) { if ($cpt_classe > 0) { echo " - "; } echo "<a href='" . $_SERVER['PHP_SELF'] . "?id_classe={$current_id_classe}&type_affichage=classe&num_semaine_annee={$num_semaine_annee}&affichage={$affichage}&mode=afficher_edt" . add_token_in_url() . "' target='_blank' title=\"Afficher l'EDT seul\"><img src='../images/icons/edt.png' class='icone16' alt='EDT seul' />" . $current_classe['classe'] . "</a>"; $cpt_classe++; } echo "</p>"; } // Pour un prof afficher des liens vers le CDT, les notes,... // Pour un EDT classe, mettre des liens EDT prof,... // Afficher les infos liées à la classe (pp), edt classe,...