mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 18:59:09 -04:00
56 lines
1.4 KiB
PHP
56 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use \App\Log;
|
|
|
|
class AdminController extends Controller
|
|
{
|
|
/**
|
|
* Create a new controller instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->middleware('auth');
|
|
}
|
|
|
|
/**
|
|
* Show the application dashboard.
|
|
*
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function index()
|
|
{
|
|
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)]);
|
|
}
|
|
|
|
public function update()
|
|
{
|
|
clog('navigate','success','consulte les notes de mise à jours');
|
|
|
|
return view('admin.update');
|
|
}
|
|
|
|
}
|