mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 10:49:10 -04:00
ALPHA 3.0.2
This commit is contained in:
@@ -15,6 +15,8 @@ class AdminController extends Controller
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
|
||||
dd(Auth::user()->getAcces(2));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use \App\Notifications\mail;
|
||||
use \App\Notifications\sms;
|
||||
use \App\Notifications\Alert;
|
||||
use \App\Log;
|
||||
use \App\Schedule;
|
||||
use \App\Local;
|
||||
@@ -71,43 +74,79 @@ class CalendarController extends Controller
|
||||
$calendar[$i] = $addingday;
|
||||
}
|
||||
|
||||
echo '<table class="table calendar">';
|
||||
echo '<thead class="thead-dark">';
|
||||
echo '<td><a class="btn" onclick="generate('.$prevMonth.','.$prevYear.')"><i class="fa fa-chevron-left" aria-hidden="true"></i></a></td><td colspan="5">'.ucfirst(strftime("%B %Y", strtotime("01-".$month."-".$year))).'</td><td><a class="btn" onclick="generate('.$nextMonth.','.$nextYear.')"><i class="fa fa-chevron-right" aria-hidden="true"></i></a></td>';
|
||||
echo '<tr><td>Dimanche</td><td>Lundi</td><td>Mardi</td><td>Mercredi</td><td>Jeudi</td><td>Vendredi</td><td>Samedi</td></tr>';
|
||||
echo '</thead>';
|
||||
|
||||
echo '<div class="table calendar">';
|
||||
echo '<div class="thead-dark">';
|
||||
echo '<div class="row"><div class="col-2"><a class="btn" onclick="generate('.$prevMonth.','.$prevYear.')"><i class="fa fa-chevron-left" aria-hidden="true"></i></a></div><div class="col-8">'.ucfirst(strftime("%B %Y", strtotime("01-".$month."-".$year))).'</div><div class="col-2"><a class="btn" onclick="generate('.$nextMonth.','.$nextYear.')"><i class="fa fa-chevron-right" aria-hidden="true"></i></a></div></div>';
|
||||
echo '<div class="row calendar-head"><div style="width:14%;">Dimanche</div><div style="width:14%;">Lundi</div><div style="width:14%;">Mardi</div><div style="width:14%;">Mercredi</div><div style="width:14%;">Jeudi</div><div style="width:14%;">Vendredi</div><div style="width:14%;">Samedi</div></div>';
|
||||
echo '</div>';
|
||||
echo '<div class="card-body">';
|
||||
for ($i=0; $i < 6 ; $i++)
|
||||
{
|
||||
echo '<tr>';
|
||||
echo '<div class="row">';
|
||||
for ($a=0; $a < 7 ; $a++)
|
||||
{
|
||||
if (isset($calendar[(($i*7) + $a)]))
|
||||
{
|
||||
echo '<td class="calendar-container">';
|
||||
|
||||
/** Date info */
|
||||
$today = date("Y-m-d", strtotime($year."-".$month."-".$calendar[(($i*7) + $a)]));
|
||||
$activityToday = Schedule::where('date','=',$today)->get();
|
||||
|
||||
/** If nothing today */
|
||||
if ($activityToday->isEmpty()) {
|
||||
echo '<div><a name="'.$today.'" type="button" data-toggle="modal" data-target="#scrollmodal" id="calendar_'.$calendar[(($i*7) + $a)].'" class="btn btn-block btn-calendar" onclick="openCalendar(this.name)"><div class="calendar-date">'.date("j", strtotime($today)).'</div></a></div>';
|
||||
echo '<a class="calendar-container calendar-empty" name="'.$today.'" type="button" data-toggle="modal" data-target="#scrollmodal" id="calendar_'.$calendar[(($i*7) + $a)].'" class="btn btn-block btn-calendar" onclick="openCalendar(this.name)"><div class="calendar-date">'.date("j", strtotime($today)).'</div></a>';
|
||||
} else {
|
||||
echo '<a class="calendar-container" name="'.$today.'" type="button" data-toggle="modal" data-target="#scrollmodal" id="calendar_'.$calendar[(($i*7) + $a)].'" class="btn btn-block btn-calendar" onclick="openCalendar(this.name)">';
|
||||
$text = "";
|
||||
foreach ($activityToday as $activity) {
|
||||
$text = $text.'<div style="color:blue;"><i class="fa fa-plane" aria-hidden="true"></i>'.ucfirst($activity->data['event_name'])."</div><br>";
|
||||
echo '<div class="calendar-date">'.date("j", strtotime($today)).'</div>
|
||||
<div class="calendar-text" style="width:90%;">';
|
||||
switch ($activity->type) {
|
||||
case 'regular':
|
||||
echo '<div class="row" style="color:orange;"><span class="fa-stack fa-lg col-md-2"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-book fa-stack-1x fa-inverse"></i></span><div class="col-md-10 calendar_event_name">'.ucfirst($activity->data['event_name'])."</div></div>";
|
||||
break;
|
||||
|
||||
case 'pilotage':
|
||||
echo '<div class="row" style="color:#58D3F7;"><span class="fa-stack fa-lg col-md-2"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-plane fa-stack-1x fa-inverse"></i></span><div class="col-md-10 calendar_event_name">'.ucfirst($activity->data['event_name'])."</div></div>";
|
||||
break;
|
||||
|
||||
case 'drill':
|
||||
echo '<div class="row" style="color:blue;"><span class="fa-stack fa-lg col-md-2"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-trophy fa-stack-1x fa-inverse"></i></span><div class="col-md-10 calendar_event_name">'.ucfirst($activity->data['event_name'])."</div></div>";
|
||||
break;
|
||||
|
||||
case 'music':
|
||||
echo '<div class="row" style="color:green;"><span class="fa-stack fa-lg col-md-2"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-music fa-stack-1x fa-inverse"></i></span><div class="col-md-10 calendar_event_name">'.ucfirst($activity->data['event_name'])."</div></div>";
|
||||
break;
|
||||
|
||||
case 'biathlon':
|
||||
echo '<div class="row" style="color:red;"><span class="fa-stack fa-lg col-md-2"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-snowflake-o fa-stack-1x fa-inverse"></i></span><div class="col-md-10 calendar_event_name">'.ucfirst($activity->data['event_name'])."</div></div>";
|
||||
break;
|
||||
|
||||
case 'marksmanship':
|
||||
echo '<div class="row" style="color:grey;"><span class="fa-stack fa-lg col-md-2"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-star fa-stack-1x fa-inverse"></i></span><div class="col-md-10 calendar_event_name">'.ucfirst($activity->data['event_name'])."</div></div>";
|
||||
break;
|
||||
|
||||
case 'founding':
|
||||
echo '<div class="row" style="color:#00FF40;"><span class="fa-stack fa-lg col-md-2"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-usd fa-stack-1x fa-inverse"></i></span><div class="col-md-10 calendar_event_name">'.ucfirst($activity->data['event_name'])."</div></div>";
|
||||
break;
|
||||
|
||||
case 'volunteer':
|
||||
echo '<div class="row" style="color:#DF0174;"><span class="fa-stack fa-lg col-md-2"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-handshake-o fa-stack-1x fa-inverse"></i></span><div class="col-md-10 calendar_event_name">'.ucfirst($activity->data['event_name'])."</div></div>";
|
||||
break;
|
||||
|
||||
default:
|
||||
echo '<div class="row" style="color:#0B615E;"><span class="fa-stack fa-lg col-md-2"><i class="fa fa-circle fa-stack-2x"></i></span><div class="col-md-10 calendar_event_name">'.ucfirst($activity->data['event_name'])."</div></div>";
|
||||
break;
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '<div><a name="'.$today.'" type="button" data-toggle="modal" data-target="#scrollmodal" id="calendar_'.$calendar[(($i*7) + $a)].'" class="btn btn-block btn-calendar" onclick="openCalendar(this.name)"><div class="calendar-date">'.date("j", strtotime($today)).'</div><div class="calendar-text">'.$text.'</div></a></div>';
|
||||
echo '</a>';
|
||||
}
|
||||
|
||||
|
||||
echo '</td>';
|
||||
} else {
|
||||
echo '<td class="calendar-container" style="border:none !important"></td>';
|
||||
echo '<div class="calendar-container¸calendar-empty" style="border:none !important; width:14%;"></div>';
|
||||
}
|
||||
}
|
||||
echo '</tr>';
|
||||
echo '</div>';
|
||||
}
|
||||
echo '</table>';
|
||||
|
||||
}
|
||||
|
||||
@@ -322,7 +361,7 @@ class CalendarController extends Controller
|
||||
|
||||
$UserList = User::all();
|
||||
$LocalList = Local::all();
|
||||
|
||||
|
||||
return view('admin.calendar.calendar_add' ,['RequestDate' => $date, 'Userslist' => $UserList, 'LocalsList' => $LocalList]);
|
||||
}
|
||||
|
||||
@@ -398,6 +437,10 @@ class CalendarController extends Controller
|
||||
$schedule->data = $eventData;
|
||||
|
||||
$schedule->save();
|
||||
|
||||
/** Logs and Notification */
|
||||
Log::saveLog("Ajout de l'activité, ".$schedule->event_name." à l'horaire le ".$schedule->event_date);
|
||||
|
||||
}
|
||||
|
||||
public function patch($id)
|
||||
|
||||
85
app/Http/Controllers/ConfigController.php
Normal file
85
app/Http/Controllers/ConfigController.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Config;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ConfigController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Config $config
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Config $config)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Config $config
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(Config $config)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Config $config
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, Config $config)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Config $config
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Config $config)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,13 @@ class JobController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
$jobs = Job::all();
|
||||
|
||||
$jobs_sorted = $jobs->sortBy('name');
|
||||
|
||||
$jobs = $jobs_sorted->values();
|
||||
|
||||
return view('admin.job.index', ['jobs' => $jobs]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,6 +7,17 @@ use Illuminate\Http\Request;
|
||||
|
||||
class MessageController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth', ['except' => ['destroy']]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
@@ -14,7 +25,7 @@ class MessageController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('admin.message.index', ['messages' => \App\Message::all()]);
|
||||
return view('admin.message.index', ['messages' => \App\Message::all()]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -24,7 +35,7 @@ class MessageController extends Controller
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
return view('admin.message.add', ['messages' => \App\Message::all()]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,7 +46,26 @@ class MessageController extends Controller
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
$msg = new Message;
|
||||
|
||||
$msg->title = request('msg_title');
|
||||
$msg->body = request('msg_body');
|
||||
|
||||
$msg->user_id = \Auth::user()->id;
|
||||
|
||||
/** Basic Shit to change */
|
||||
|
||||
$msg->data = [
|
||||
'as_seen' => "",
|
||||
'parameter' => ""
|
||||
];
|
||||
|
||||
$msg->publish = true;
|
||||
$msg->private = true;
|
||||
|
||||
$msg->save();
|
||||
|
||||
\App\Log::savelog("Publication du message : ".request('msg_title'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -44,9 +74,24 @@ class MessageController extends Controller
|
||||
* @param \App\Message $message
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Message $message)
|
||||
{
|
||||
//
|
||||
public function show($id)
|
||||
{
|
||||
$this_msg = Message::find($id);
|
||||
|
||||
if(isset($this_msg->data['as_seen']))
|
||||
{
|
||||
if (!strpos($this_msg->data['as_seen'],"-".\Auth::user()->id."-")) {
|
||||
$data = [
|
||||
'as_seen' => $this_msg->data['as_seen']."-".\Auth::user()->id."-",
|
||||
'parameter' => $this_msg->data['parameter']
|
||||
];
|
||||
|
||||
$this_msg->data = $data;
|
||||
|
||||
$this_msg->save();
|
||||
}
|
||||
}
|
||||
return view('admin.message.show', ['message' => $this_msg]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,8 +123,12 @@ class MessageController extends Controller
|
||||
* @param \App\Message $message
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Message $message)
|
||||
public function destroy()
|
||||
{
|
||||
//
|
||||
$id = request('id');
|
||||
|
||||
$msg = Message::find($id);
|
||||
|
||||
$msg->delete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,8 +80,12 @@ class UserController extends Controller
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
public function destroy()
|
||||
{
|
||||
//
|
||||
$id = request('id');
|
||||
|
||||
$user = User::find($id);
|
||||
|
||||
$user->delete();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user