diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index df7d854f..f3511950 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -26,23 +26,7 @@ class AdminController extends Controller { clog('navigate','success','consulte le tableau de bord'); - $futureEvent_to_filtered = \App\Event::all()->sortBy('date_begin'); - $futureEvent_to_filtered_pass_1 = collect(); - $futureEvent = collect(); - - foreach ($futureEvent_to_filtered as $day) { - if (date('U',strtotime($day->date_begin)) >= date('U')) { - $futureEvent_to_filtered_pass_1->push($day); - } - } - - foreach ($futureEvent_to_filtered_pass_1 as $day) { - if (date('U',strtotime($day->date_begin)) <= date('U',strtotime("+2 week"))) { - $futureEvent->push($day); - } - } - - return view('admin.dashboard',['futureEvent' => $futureEvent->take(3),'userClasse' => \Auth::User()->getClasse()->forPage(1,6)]); + return view('admin.dashboard',['futureEvent' => \App\Event::future()->take(3),'userClasse' => \Auth::User()->getClasse()->forPage(1,6)]); } public function update() diff --git a/app/User.php b/app/User.php index 481c08ab..ce444799 100644 --- a/app/User.php +++ b/app/User.php @@ -75,6 +75,19 @@ class User extends Authenticatable return $this->hasMany('App\Course'); } + public function futureCourses() + { + $filterCourse = collect(); + foreach (\Auth::user()->courses as $course) + { + if(date('U',strtotime($course->event->date_begin)) >= date('U')) + { + $filterCourse->push($course); + } + } + return $filterCourse; + } + public function routeNotificationForNexmo($notification) { return $this->telephone; diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index 6875b102..7a200289 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -15,7 +15,7 @@

Aucun cours à venir

@else - @foreach (\Auth::user()->courses->take(6) as $course) + @foreach (\Auth::user()->futureCourses() as $course) @if($course->event != null)
diff --git a/resources/views/admin/files/index.blade.php b/resources/views/admin/files/index.blade.php index 025ddcdd..e0107fa7 100644 --- a/resources/views/admin/files/index.blade.php +++ b/resources/views/admin/files/index.blade.php @@ -8,105 +8,116 @@
-
-

Les fichiers si dessous sont disponible autant dans l'espace administration que dans l'espace cadet cadre. - +
+

Les fichiers si dessous sont disponible autant dans l'espace administration que dans l'espace cadet cadre.

+
- - - - - - + + + + + + + + + + - + + - - - - - + + - - - - - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - - - - - + + - + + - + + - + +
Nom
Ordre d'opération
NomCatégorie
Plan de cours ViergePlan de coursTélécharger
Mini Ordre Operation Projet Soirée Journée ViergeTéléchargerOrdre d'opérationTélécharger
Mini Ordre Operation ViergeTélécharger
Tenues
Ordre d'opérationTélécharger
Liste des tenuesTélécharger
Énoncé de fonction
TenuesTélécharger
Cadet commandantTéléchargerÉnoncé de fonctionTélécharger
Cadet commandant adjointTéléchargerÉnoncé de fonctionTélécharger
Chef entrainementTéléchargerÉnoncé de fonctionTélécharger
Instructeur séniorTéléchargerÉnoncé de fonctionTélécharger
InstructeurTéléchargerÉnoncé de fonctionTélécharger
Assistant InstructeurTéléchargerÉnoncé de fonctionTélécharger
Commandant de sectionTéléchargerÉnoncé de fonctionTélécharger
Commandant de la gardeTéléchargerÉnoncé de fonctionTélécharger
Commandant adjoint de sectionTéléchargerÉnoncé de fonctionTélécharger
Commandant adjoint de gardeTéléchargerÉnoncé de fonctionTélécharger
Cadet cadre de la logistiqueTéléchargerÉnoncé de fonctionTélécharger
Cadet cadre de l'administrationTéléchargerÉnoncé de fonctionTélécharger
Commandant adjoint de sectionTélécharger
Divers
Énoncé de fonctionTélécharger
Information NECPCTéléchargerDiversTélécharger
Évaluation pratique sur la coordination d’un ordre d’opération sur le terrainTéléchargerDiversTélécharger
RENCONTRE PRÉILIMINAIRE D’INSTRUCTIONTéléchargerDiversTélécharger
@@ -138,5 +149,18 @@ @endsection @section('custom_scripts') - + @endsection diff --git a/resources/views/layouts/admin/head.blade.php b/resources/views/layouts/admin/head.blade.php index 17787080..1c73d5cc 100644 --- a/resources/views/layouts/admin/head.blade.php +++ b/resources/views/layouts/admin/head.blade.php @@ -1,4 +1,4 @@ -getLocale()); setlocale( LC_ALL, $lang.'_'.strtoupper($lang).'.utf8','fra'); ?> @@ -27,5 +27,6 @@ + \ No newline at end of file