ALPHA 3.0.1d

This commit is contained in:
TheGamecraft
2018-07-17 21:57:05 -04:00
parent 40a95d906a
commit 337c96f6f5
14 changed files with 285 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use \App\Log;
class AdminController extends Controller
{
@@ -23,11 +24,16 @@ class AdminController extends Controller
*/
public function index()
{
Log::saveLog('Affichage du tableau de bord');
return view('admin.dashboard');
}
public function update()
{
Log::saveLog('Affichage des notes de mise a jour');
return view('admin.update');
}
}

View File

@@ -0,0 +1,75 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use \App\Log;
class CalendarController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth', ['except' => ['generate']]);
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
Log::saveLog("Affichage de l'horaire");
return view('admin.calendar');
}
public function generate()
{
setlocale(LC_ALL, "fr");
$month = request('month');
$year = request('year');
$calendar = array();
$dayinmonth = cal_days_in_month(CAL_GREGORIAN, $month, $year);
$firstdaymonth = date("w", strtotime("01-".$month."-".$year));
$addingday = 0;
for ($i=$firstdaymonth ; $addingday < $dayinmonth ; $i++) {
$addingday = $addingday + 1;
$calendar[$i] = $addingday;
}
echo '<table class="table calendar">';
echo '<thead class="thead-dark">';
echo '<td colspan="7">'.strftime("%B", strtotime("01-".$month."-".$year)).'</td>';
echo '</thead>';
for ($i=0; $i < 6 ; $i++)
{
echo '<tr>';
for ($a=0; $a < 7 ; $a++)
{
if (isset($calendar[(($i*7) + $a)]))
{
echo '<td class="calendar-container">';
$today = date("Y-m-d", strtotime($year."-".$month."-".$calendar[(($i*7) + $a)]));
echo date("j", strtotime($today));
echo '</td>';
}
}
echo '</tr>';
}
echo '</table>';
}
}