Пример #1
0
 public function annuelle()
 {
     $view = new View();
     $view->Assign("pdf", $this->pdf);
     $idclasse = $this->request->comboClasses;
     # Information generale sur la classe
     $array_of_redoublant = $this->Classe->getRedoublants($idclasse, $this->session->anneeacademique, true);
     $view->Assign("array_of_redoublants", $array_of_redoublant);
     $codeperiode = substr($this->request->comboPeriodes, 0, 1);
     $view->Assign("codeperiode", $codeperiode);
     $classe = $this->Classe->get($idclasse);
     $view->Assign("classe", $classe);
     $inscrits = $this->Inscription->getInscrits($idclasse);
     $view->Assign("effectif", count($inscrits));
     $view->Assign("eleves", $inscrits);
     $sequences = $this->Sequence->getIdSequences($_SESSION['anneeacademique']);
     # Obtenir les moyennes sequentielles
     $this->Bulletin->createMoySequentielTable();
     foreach ($sequences as $seq) {
         $this->getMoyRangSequentiel($idclasse, $seq);
     }
     $rangsequentiels = $this->Bulletin->getRangMoyenneSequences($sequences);
     $this->Bulletin->dropMoySequentielTable();
     $this->Bulletin->createAnnuelleTable($idclasse, $sequences);
     $notes = array();
     # Ajouter les notes par matiere, cette variable contient aussi les notes des eleves
     $enseignements = $this->Enseignement->getEnseignements($idclasse);
     $view->Assign("enseignements", $enseignements);
     foreach ($enseignements as $ens) {
         $notes = array_merge($notes, $this->Bulletin->getNotesByEnseignements($ens['IDENSEIGNEMENT']));
     }
     $view->Assign("notes", $notes);
     $rangs = $this->Bulletin->getElevesRangAnnuel();
     $moyclasse = $moymax = $moymin = 0;
     setrangannuel($rangs, $rangsequentiels, $moyclasse, $moymax, $moymin);
     if (!empty($this->request->comboEleves)) {
         $prev = 0;
         $rang = getRangEleve($this->request->comboEleves, $rangs, $prev);
         $view->Assign("rang", $rang);
         $view->Assign("prev", $prev);
         $discipline = $this->Absenceperiodique->getAbsenceAnnuelleByEleve($classe['IDCLASSE'], $_SESSION['anneeacademique'], $this->request->comboEleves);
     } else {
         $discipline = $this->Absenceperiodique->getAbsenceAnnuelle($classe['IDCLASSE'], $_SESSION['anneeacademique']);
         $view->Assign("rangs", $rangs);
     }
     $view->Assign("moyclasse", $moyclasse);
     $view->Assign("moymin", $moymin);
     $view->Assign("moymax", $moymax);
     $view->Assign("recapitulatifs", $rangsequentiels);
     $view->Assign("discipline", $discipline);
     if (!empty($this->request->comboEleves)) {
         echo $view->Render("bulletin" . DS . "impression" . DS . "individuelle", false);
     } else {
         echo $view->Render("bulletin" . DS . "impression" . DS . "bulletin", false);
     }
 }
Пример #2
0
 private function generateVarBulletin(&$view, $periode, $idclasse)
 {
     # S = Sequentielle, T = Trimestrielle, Autre pour annuelle
     $codeperiode = substr($periode, 0, 1);
     # Recuperer l'id de la periode
     $pos = strrpos($periode, "_");
     $idperiode = substr($periode, $pos + 1);
     if ($codeperiode === "S") {
         $this->Bulletin->createTMPNoteTable($idclasse, $idperiode);
         $rangs = $this->Bulletin->getElevesRang();
         $view->Assign("rangs", $rangs);
         $sequence = $this->Sequence->get($idperiode);
         $view->Assign("sequence", $sequence);
     } elseif ($codeperiode === "T") {
         $trimestre = $this->Trimestre->get($idperiode);
         $view->Assign("trimestre", $trimestre);
         $sequences = $this->Sequence->findBy(['TRIMESTRE' => $idperiode]);
         $array_of_sequences = [$sequences[0]['IDSEQUENCE'], $sequences[1]['IDSEQUENCE']];
         $this->Bulletin->createTrimestreTable($idclasse, $array_of_sequences);
         $rangs = $this->Bulletin->getElevesRang();
         $view->Assign("rangs", $rangs);
     } elseif ($codeperiode === "A") {
         # Obtenir les moyennes sequentielles
         $sequences = $this->Sequence->getIdSequences($_SESSION['anneeacademique']);
         $this->Bulletin->createMoySequentielTable();
         foreach ($sequences as $seq) {
             $this->getMoyRangSequentiel($idclasse, $seq);
         }
         $rangsequentiels = $this->Bulletin->getRangMoyenneSequences($sequences);
         $this->Bulletin->dropMoySequentielTable();
         $this->Bulletin->createAnnuelleTable($idclasse, $sequences);
         $rangs = $this->Bulletin->getElevesRangAnnuel();
         $moyclasse = $moymax = $moymin = 0;
         setrangannuel($rangs, $rangsequentiels, $moyclasse, $moymax, $moymin);
         $view->Assign("rangs", $rangs);
         $view->Assign("moyclasse", $moyclasse);
     }
     $notes = array();
     # Ajouter les notes par matiere, cette variable contient aussi les notes des eleves
     $enseignements = $this->Enseignement->getEnseignements($this->request->idclasse);
     $view->Assign("enseignements", $enseignements);
     foreach ($enseignements as $ens) {
         $notes = array_merge($notes, $this->Bulletin->getNotesByEnseignements($ens['IDENSEIGNEMENT']));
     }
     $view->Assign("notes", $notes);
     if ($codeperiode !== "A") {
         $rangs = $this->Bulletin->getElevesRang();
         $travail = $this->Bulletin->getGlobalMoyenne();
         $view->Assign("travail", $travail);
     }
     $classe = $this->Classe->get($idclasse);
     $view->Assign("classe", $classe);
     $this->Bulletin->dropTMPTable();
     $view->Assign("codeperiode", $codeperiode);
 }