public function index($id = 0) { $data = []; if ($id == FicheEtudiantController::$ID_FICHE_LOCALISATION) { $stage = Stage::infos(session('uid')); $data['stage'] = $stage; $etudiant = Etudiant::infos(session('uid')); $data['etudiant'] = $etudiant; } else { if ($id == FicheEtudiantController::$ID_FICHE_AVIS_STAGE) { $stage = Stage::where('idEtudiant', session('uid'))->first(); if ($stage == null) { return view('etudiant.erreur.stageAbsent')->with(['id' => $id]); } $data['stage'] = $stage; } else { if ($id == FicheEtudiantController::$ID_FICHE_SOUTENANCE) { $data['dureeCreneau'] = Disponibilite::getDureeMinute(); $data['heureDebut'] = Disponibilite::getDebutMinute(); $data['heureFin'] = Disponibilite::getFinMinute(); $data['date'] = Disponibilite::getDate(); $data['dispo'][0] = Disponibilite::heureDispoToArray(0); $data['dispo'][1] = Disponibilite::heureDispoToArray(1); return view('commun.dispoSoutenance')->with(['id' => $id, 'data' => $data]); } } } return view('etudiant.fiche')->with(['id' => $id, 'data' => $data]); }
public function indexEtudiant() { $dashboardInfos = []; $etudiant = Etudiant::infos(session('uid')); $dashboardInfos['etudiant'] = $etudiant; $stage = Stage::infos(session('uid')); $stage = Stage::checkStageExiste($stage); $tuteur = Utilisateur::where('id', $stage->idEnseignant)->select('nom', 'prenom')->first(); if (count($tuteur) == 0) { $tuteur = new Utilisateur(); $tuteur->nom = "-"; $tuteur->prenom = ""; } $dashboardInfos['tuteur'] = $tuteur; $dashboardInfos['stage'] = $stage; return view("dashboard.dashboard")->with('dashboardInfos', $dashboardInfos); }