Пример #1
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     $produit = new Produit();
     $produits = $produit->getAll();
     $matiere = new Matiere();
     $matieres = $matiere->getAll();
     return view('produit.create')->with('produits', $produits)->with('matieres', $matieres);
 }
Пример #2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $etudiants_count = Etudiant::count();
     $enseignants_count = Enseignant::count();
     $absences_count = Absence::count();
     $matieres_count = Matiere::count();
     $etudiants = Etudiant::etudiants_plus_3_absences();
     //Graph shitty way to do that
     $stats_cours = array();
     $today = Carbon::now();
     for ($i = 0; $i < 10; $i++) {
         $nb = Absence::whereDate('created_at', '=', date("Y-m-d", strtotime($today)))->count();
         date_add($today, date_interval_create_from_date_string('-1 days'));
         array_push($stats_cours, $nb);
     }
     //dd($stats_cours);
     /*	if(Session::get('user')->isAdmin())
     				return View('app/dashboard',[
     											'etudiants_count'=>$etudiants_count,
     											'enseignants_count'=>$enseignants_count,
     											'absences_count'=>$absences_count,
     											'matieres_count'=>$matieres_count,
     											'etudiants'=>$etudiants
     										]);
     			if(Session::get('user')->isEnseignant())
     				return Redirect('/app/absences');
     			if(Session::get('user')->isEtudiant())
     				return Redirect('/app/consultation_absences');*/
     return View('app/dashboard', ['etudiants_count' => $etudiants_count, 'enseignants_count' => $enseignants_count, 'absences_count' => $absences_count, 'matieres_count' => $matieres_count, 'etudiants' => $etudiants, 'statistics' => $stats_cours]);
 }
Пример #3
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $matiere = Matiere::find($id);
     $matiere->delete();
     return redirect('/app/matieres');
 }
 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]);
 }
Пример #5
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $matieres = Matiere::all();
     return View('app/gestion_cours', ['matieres' => $matieres]);
 }
Пример #6
0
 public function getById($idMat)
 {
     return Matiere::findOrFail($idMat);
 }