public function showhoraire($id) { $etudiants_count = Etudiant::count(); $enseignants_count = Enseignant::count(); $absences_count = Absence::count(); $matieres_count = Matiere::count(); $etudiants = Etudiant::etudiants_plus_3_absences(); $matiere = Matiere::find($id); $horaires = $matiere->horaires; return View('app/statistiques_horaire', ['etudiants_count' => $etudiants_count, 'enseignants_count' => $enseignants_count, 'absences_count' => $absences_count, 'matieres_count' => $matieres_count, 'etudiants' => $etudiants, 'horaires' => $horaires]); }
public function moduleShowChef($id) { $filiere = Session::get('user')->filieres[0]; $promotions = $filiere->promos; $etudiants_count = Filiere::nbreEtudiantByFiliere($filiere->id); $enseignants_count = Enseignant::count(); $promos_count = count($promotions); $absences_count = 0; if ($promos_count > 0) { foreach ($promotions as $promotion) { $absences_count = $absences_count + Filiere::nbreAbsencesByPromo($promotion->id); } } $module = Module::find($id); $matieres = $module->matieres; $horaires = null; $i = 0; if (count($matieres) > 0) { foreach ($matieres as $matiere) { $horaires[$i] = $matiere->horaires; $i++; } } $absences = null; $j = 0; if (count($horaires) > 0) { foreach ($horaires as $horaire) { if (count($horaire) > 0) { foreach ($horaire as $value) { $absences[$j] = $value->absences; $j++; } } } } $students = null; $k = 0; if (count($absences) > 0) { foreach ($absences as $absence) { foreach ($absence as $key) { $students[$k] = $key->etudiant; $k++; } } } return View('app/etudiants_absences', ['etudiants_count' => $etudiants_count, 'enseignants_count' => $enseignants_count, 'absences_count' => $absences_count, 'promos_count' => $promos_count, 'filiere' => $filiere, 'promotions' => $promotions, 'module' => $module, 'students' => $students, 'statistics' => null]); }