ALPHA 3.0.1h

This commit is contained in:
TheGamecraft
2018-08-20 13:12:20 -04:00
parent 5471539ab3
commit 54cdc12680
18 changed files with 73123 additions and 123 deletions

View File

@@ -93,7 +93,7 @@ class CalendarController extends Controller
} else {
$text = "";
foreach ($activityToday as $activity) {
$text = '<div style="color:blue;"><i class="fa fa-plane" aria-hidden="true"></i>'.$text.ucfirst($activity->type)."</div><br>";
$text = $text.'<div style="color:blue;"><i class="fa fa-plane" aria-hidden="true"></i>'.ucfirst($activity->data['event_name'])."</div><br>";
}
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>';
@@ -130,40 +130,342 @@ class CalendarController extends Controller
echo '<div class="modal-content"><div class="modal-header"><h5 class="modal-title" id="scrollmodalLabel">'.ucfirst(strftime("%A le %e %B %Y", strtotime($Requestdate))).'</h5><button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span></button></div><div class="modal-body">';
foreach ($today as $date) {
if ($date->id) {
switch ($date->type) {
case 'pilotage':
$this->loadPilotage($date);
break;
case 'instruction':
$this->loadInstruction($date);
break;
default:
# code...
break;
if ($date->data['is_event_mandatory'] == "on") {
$is_mandatory = "<div class='btn btn-block btn-warning m-l-10 m-b-10 float-right'>Activité obligatoire</div>";
} else {
$is_mandatory = "<div class='btn btn-block btn-primary m-l-10 m-b-10 float-right'>Activité n'est pas obligatoire</div>";
}
echo(
'<div class="row">'.
'<div class="col-7">'.
'<p>'.$date->data['event_name'].trans('calendar.begin_at').$date->data['event_begin_time'].trans('calendar.end_at').$date->data['event_end_time'].'</p>'.
'</div>'.
'<div class="col-3">'.
$is_mandatory.
'</div>'.
'<div class="col-1">'.
'<a href="/admin/calendar/edit/'.$date->id.'" type="button" class="btn btn-secondary"><i class="fa fa-cog"></i>&nbsp; Modifier</a>'.
'</div>'.
'<div class="col-1">'.
'<a type="button" class="btn btn-danger" onclick="deleteEvent('.$date->id.');"><i class="fa fa-times-circle" style="color:white;"></i></a>'.
'</div>'.
'</div>'.
'<p>'.
"L'activité auras lieux a l'escadron entre 18h30 et 21h30".
'</p>'.
'<p>'.$date->data['event_desc'].
'</p>'
);
if ($date->type == "regular") {
if($date->data['n1_p1_plandone'] == "on")
{
$isdone_n1_p1 = '<span class="badge badge-success">Remis</span></i>';
} else {
$isdone_n1_p1 = '<span class="badge badge-danger">Non remis</span>';
}
if($date->data['n1_p2_plandone'] == "on")
{
$isdone_n1_p2 = '<span class="badge badge-success">Remis</span></i>';
} else {
$isdone_n1_p2 = '<span class="badge badge-danger">Non remis</span>';
}
if($date->data['n2_p1_plandone'] == "on")
{
$isdone_n2_p1 = '<span class="badge badge-success">Remis</span></i>';
} else {
$isdone_n2_p1 = '<span class="badge badge-danger">Non remis</span>';
}
if($date->data['n2_p2_plandone'] == "on")
{
$isdone_n2_p2 = '<span class="badge badge-success">Remis</span></i>';
} else {
$isdone_n2_p2 = '<span class="badge badge-danger">Non remis</span>';
}
if($date->data['n3_p1_plandone'] == "on")
{
$isdone_n3_p1 = '<span class="badge badge-success">Remis</span></i>';
} else {
$isdone_n3_p1 = '<span class="badge badge-danger">Non remis</span>';
}
if($date->data['n3_p2_plandone'] == "on")
{
$isdone_n3_p2 = '<span class="badge badge-success">Remis</span></i>';
} else {
$isdone_n3_p2 = '<span class="badge badge-danger">Non remis</span>';
}
echo '<table class="table">
<thead class="thead-dark">
<tr>
<th>Niveau</th>
<th style="width:45%">1er Période</th>
<th style="width:45%">2e Période</th>
</tr>
</thead>
<tbody>
<tr>
<th>1</th>
<td>
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<tbody>
<tr style="border:none;">
<td style="border:none;">'.User::find($date->data['n1_p1_instructor'])->fullname().'</td>
<td style="border:none;">'.$isdone_n1_p1.'</td>
</tr>
<tr style="border:none;">
<td style="border:none;">'.$date->data['n1_p1_ocom'].' - '.$date->data['n1_p1_name'].'</td>
<td style="border:none;">'.Local::find($date->data['n1_p1_local'])->name.'</td>
</tr>
</tbody>
</table>
</td>
<td>
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<tbody>
<tr style="border:none;">
<td style="border:none;">'.User::find($date->data['n1_p2_instructor'])->fullname().'</td>
<td style="border:none;">'.$isdone_n1_p2.'</td>
</tr>
<tr style="border:none;">
<td style="border:none;">'.$date->data['n1_p2_ocom'].' - '.$date->data['n1_p2_name'].'</td>
<td style="border:none;">'.Local::find($date->data['n1_p2_local'])->name.'</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<th>2</th>
<td>
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<tbody>
<tr style="border:none;">
<td style="border:none;">'.User::find($date->data['n2_p1_instructor'])->fullname().'</td>
<td style="border:none;">'.$isdone_n2_p1.'</td>
</tr>
<tr style="border:none;">
<td style="border:none;">'.$date->data['n2_p1_ocom'].' - '.$date->data['n2_p1_name'].'</td>
<td style="border:none;">'.Local::find($date->data['n2_p1_local'])->name.'</td>
</tr>
</tbody>
</table>
</td>
<td>
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<tbody>
<tr style="border:none;">
<td style="border:none;">'.User::find($date->data['n2_p2_instructor'])->fullname().'</td>
<td style="border:none;">'.$isdone_n2_p2.'</td>
</tr>
<tr style="border:none;">
<td style="border:none;">'.$date->data['n2_p2_ocom'].' - '.$date->data['n2_p2_name'].'</td>
<td style="border:none;">'.Local::find($date->data['n2_p2_local'])->name.'</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<th>3</th>
<td>
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<tbody>
<tr style="border:none;">
<td style="border:none;">'.User::find($date->data['n3_p1_instructor'])->fullname().'</td>
<td style="border:none;">'.$isdone_n3_p1.'</td>
</tr>
<tr style="border:none;">
<td style="border:none;">'.$date->data['n3_p1_ocom'].' - '.$date->data['n3_p1_name'].'</td>
<td style="border:none;">'.Local::find($date->data['n3_p1_local'])->name.'</td>
</tr>
</tbody>
</table>
</td>
<td>
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<tbody>
<tr style="border:none;">
<td style="border:none;">'.User::find($date->data['n3_p2_instructor'])->fullname().'</td>
<td style="border:none;">'.$isdone_n3_p2.'</td>
</tr>
<tr style="border:none;">
<td style="border:none;">'.$date->data['n3_p2_ocom'].' - '.$date->data['n3_p2_name'].'</td>
<td style="border:none;">'.Local::find($date->data['n3_p2_local'])->name.'</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>';
}
}
echo '<a href="/admin/calendar/add/'.$url.'" type="button" class="btn btn-primary btn-lg btn-block">'.trans('calendar.add_to_schedule').'</a></div><div class="modal-footer"><button type="button" class="btn btn-secondary" data-dismiss="modal">'.trans('pagination.close').'</button></div></div>';
}
private function loadPilotage($schedule)
{
echo '<p>'.trans('calendar.pilotage_title').'</p><p>'.trans('calendar.begin_at').$schedule->data['begin_at'].trans('calendar.end_at').$schedule->data['end_at'].'</p>';
}
public function add($date)
{
$lang = str_replace('_', '-', app()->getLocale());
setlocale(LC_ALL, $lang.'_'.strtoupper($lang).'.utf8','fra');
$date = str_replace("_", "-", $date);
$UserList = User::all();
$LocalList = Local::all();
return view('admin.calendar.calendar_add' ,['RequestDate' => $date, 'Userslist' => $UserList, 'LocalsList' => $LocalList]);
}
public function edit($id)
{
$schedule = Schedule::find($id);
$UserList = User::all();
$LocalList = Local::all();
return view('admin.calendar.calendar_edit' ,['RequestSchedule' => $schedule, 'Userslist' => $UserList, 'LocalsList' => $LocalList]);
}
public function store()
{
$schedule = new Schedule;
$schedule->date = request('event_date');
$schedule->type = request('event_type');
if(request('event_type') == "regular")
{
$eventData = [
"event_name" => request('event_name'),
"is_event_mandatory" => request('is_event_mandatory'),
"event_date" => request('event_date'),
"event_begin_time" => request('event_begin_time'),
"event_end_time" => request('event_end_time'),
"event_location" => request('event_location'),
"event_desc" => request('event_desc'),
"n1_p1_name" => request('n1_p1_name'),
"n1_p1_ocom" => request('n1_p1_ocom'),
"n1_p1_instructor" => request('n1_p1_instructor'),
"n1_p1_local" => request('n1_p1_local'),
"n1_p1_plandone" => request('n1_p1_plandone'),
"n1_p2_name" => request('n1_p2_name'),
"n1_p2_ocom" => request('n1_p2_ocom'),
"n1_p2_instructor" => request('n1_p2_instructor'),
"n1_p2_local" => request('n1_p2_local'),
"n1_p2_plandone" => request('n1_p2_plandone'),
"n2_p1_name" => request('n2_p1_name'),
"n2_p1_ocom" => request('n2_p1_ocom'),
"n2_p1_instructor" => request('n2_p1_instructor'),
"n2_p1_local" => request('n2_p1_local'),
"n2_p1_plandone" => request('n2_p1_plandone'),
"n2_p2_name" => request('n2_p2_name'),
"n2_p2_ocom" => request('n2_p2_ocom'),
"n2_p2_instructor" => request('n2_p2_instructor'),
"n2_p2_local" => request('n2_p2_local'),
"n2_p2_plandone" => request('n2_p2_plandone'),
"n3_p1_name" => request('n3_p1_name'),
"n3_p1_ocom" => request('n3_p1_ocom'),
"n3_p1_instructor" => request('n3_p1_instructor'),
"n3_p1_local" => request('n3_p1_local'),
"n3_p1_plandone" => request('n3_p1_plandone'),
"n3_p2_name" => request('n3_p2_name'),
"n3_p2_ocom" => request('n3_p2_ocom'),
"n3_p2_instructor" => request('n3_p2_instructor'),
"n3_p2_local" => request('n3_p2_local'),
"n3_p2_plandone" => request('n3_p2_plandone'),
];
} else {
$eventData = [
"event_name" => request('event_name'),
"is_event_mandatory" => request('is_event_mandatory'),
"event_date" => request('event_date'),
"event_begin_time" => request('event_begin_time'),
"event_end_time" => request('event_end_time'),
"event_location" => request('event_location'),
"event_desc" => request('event_desc'),
];
}
$schedule->data = $eventData;
$schedule->save();
}
public function patch($id)
{
$schedule = Schedule::find($id);
$schedule->date = request('event_date');
$schedule->type = request('event_type');
if(request('event_type') == "regular")
{
$eventData = [
"event_name" => request('event_name'),
"is_event_mandatory" => request('is_event_mandatory'),
"event_date" => request('event_date'),
"event_begin_time" => request('event_begin_time'),
"event_end_time" => request('event_end_time'),
"event_location" => request('event_location'),
"event_desc" => request('event_desc'),
"n1_p1_name" => request('n1_p1_name'),
"n1_p1_ocom" => request('n1_p1_ocom'),
"n1_p1_instructor" => request('n1_p1_instructor'),
"n1_p1_local" => request('n1_p1_local'),
"n1_p1_plandone" => request('n1_p1_plandone'),
"n1_p2_name" => request('n1_p2_name'),
"n1_p2_ocom" => request('n1_p2_ocom'),
"n1_p2_instructor" => request('n1_p2_instructor'),
"n1_p2_local" => request('n1_p2_local'),
"n1_p2_plandone" => request('n1_p2_plandone'),
"n2_p1_name" => request('n2_p1_name'),
"n2_p1_ocom" => request('n2_p1_ocom'),
"n2_p1_instructor" => request('n2_p1_instructor'),
"n2_p1_local" => request('n2_p1_local'),
"n2_p1_plandone" => request('n2_p1_plandone'),
"n2_p2_name" => request('n2_p2_name'),
"n2_p2_ocom" => request('n2_p2_ocom'),
"n2_p2_instructor" => request('n2_p2_instructor'),
"n2_p2_local" => request('n2_p2_local'),
"n2_p2_plandone" => request('n2_p2_plandone'),
"n3_p1_name" => request('n3_p1_name'),
"n3_p1_ocom" => request('n3_p1_ocom'),
"n3_p1_instructor" => request('n3_p1_instructor'),
"n3_p1_local" => request('n3_p1_local'),
"n3_p1_plandone" => request('n3_p1_plandone'),
"n3_p2_name" => request('n3_p2_name'),
"n3_p2_ocom" => request('n3_p2_ocom'),
"n3_p2_instructor" => request('n3_p2_instructor'),
"n3_p2_local" => request('n3_p2_local'),
"n3_p2_plandone" => request('n3_p2_plandone'),
];
} else {
$eventData = [
"event_name" => request('event_name'),
"is_event_mandatory" => request('is_event_mandatory'),
"event_date" => request('event_date'),
"event_begin_time" => request('event_begin_time'),
"event_end_time" => request('event_end_time'),
"event_location" => request('event_location'),
"event_desc" => request('event_desc'),
];
}
$schedule->data = $eventData;
$schedule->save();
$check = Schedule::find($id);
dd($check);
}
}

View File

@@ -31,4 +31,10 @@ class User extends Authenticatable
{
return $this->hasMany(Log::class);
}
public function fullname()
{
$fullname = $this->lastname.' '.$this->firstname;
return $fullname;
}
}

14060
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -18,5 +18,8 @@
"laravel-mix": "^2.0",
"lodash": "^4.17.4",
"vue": "^2.5.7"
},
"dependencies": {
"sweetalert2": "^7.26.11"
}
}

View File

@@ -164,5 +164,5 @@
}
@include media-breakpoint-up(lg) {
.modal-lg { max-width: $modal-lg; }
.modal-lg { max-width: 1500px; }
}

View File

@@ -742,7 +742,7 @@ $modal-header-border-width: $modal-content-border-width !default;
$modal-footer-border-width: $modal-header-border-width !default;
$modal-header-padding: 1rem !default;
$modal-lg: 800px !default;
$modal-lg: 1500px !default;
$modal-md: 500px !default;
$modal-sm: 300px !default;

View File

@@ -3753,7 +3753,7 @@ button.close {
max-width: 300px; } }
@media (min-width: 992px) {
.modal-lg {
max-width: 800px; } }
max-width: 1500px; } }
.tooltip {
position: absolute;
z-index: 1070;

View File

@@ -71,94 +71,285 @@ function switchType()
(function($) {
var eventInput = document.getElementById("event_type");
var eventName = document.getElementById('event_name');
var isEventMandatory = document.getElementById('is_event_mandatory');
var isEventMandatory = document.getElementsByName('is_event_mandatory');
var eventBeginTime = document.getElementById('event_begin_time');
var eventEndTime = document.getElementById('event_end_time');
var eventLocation = document.getElementById('event_location');
var eventDesc = document.getElementById('event_desc');
var divSpecialSection = document.getElementById('special_section');
switch (eventInput.value) {
case "pilotage":
eventName.value = "Test";
isEventMandatory.checked = false;
isEventMandatory[0].checked = false;
eventBeginTime.value = "09:30";
eventEndTime.value = "11:30";
eventLocation.value = "Escadron";
eventDesc.value = "Cours de pilotage";
divSpecialSection.style.display = "none";
break;
case "regular":
eventName.value = "Soirée d'instruction régulière";
isEventMandatory.checked = true;
eventBeginTime.value = "06:30";
eventEndTime.value = "9:45";
isEventMandatory[0].checked = true;
eventBeginTime.value = "18:30";
eventEndTime.value = "21:45";
eventLocation.value = "Escadron";
eventDesc.value = "Soirée d'instruction régulière";
var n1_p1_plandone = document.getElementById('n1_p1_plandone');
var n1_p2_plandone = document.getElementById('n1_p2_plandone');
var n2_p1_plandone = document.getElementById('n2_p1_plandone');
var n2_p2_plandone = document.getElementById('n2_p2_plandone');
var n3_p1_plandone = document.getElementById('n3_p1_plandone');
var n3_p2_plandone = document.getElementById('n3_p2_plandone');
if (n1_p1_plandone.checked == false) {
n1_p1_plandone.checked = false;
}
if (n1_p2_plandone.checked == false) {
n1_p2_plandone.checked = false;
}
if (n2_p1_plandone.checked == false) {
n2_p1_plandone.checked = false;
}
if (n2_p2_plandone.checked == false) {
n2_p2_plandone.checked = false;
}
if (n3_p1_plandone.checked == false) {
n1_p1_plandone.checked = false;
}
if (n3_p2_plandone.checked == false) {
n1_p1_plandone.checked = false;
}
divSpecialSection.style.display = "block";
break;
case "drill":
eventName.value = "Cours de précidrill";
isEventMandatory.checked = false;
isEventMandatory[0].checked = false;
eventBeginTime.value = "";
eventEndTime.value = "";
eventLocation.value = "Maison de mon père";
eventDesc.value = "Cours de précidrill";
divSpecialSection.style.display = "none";
break;
case "music":
eventName.value = "Cours de musique";
isEventMandatory.checked = false;
isEventMandatory[0].checked = false;
eventBeginTime.value = "";
eventEndTime.value = "";
eventLocation.value = "";
eventDesc.value = "Cours de musique";
divSpecialSection.style.display = "none";
break;
case "biathlon":
eventName.value = "Cour de Biathlon";
isEventMandatory.checked = false;
isEventMandatory[0].checked = false;
eventBeginTime.value = "";
eventEndTime.value = "";
eventLocation.value = "";
eventDesc.value = "Cours de biathlon";
divSpecialSection.style.display = "none";
break;
case "marksmanship":
eventName.value = "Tir de précision";
isEventMandatory.checked = false;
isEventMandatory[0].checked = false;
eventBeginTime.value = "";
eventEndTime.value = "";
eventLocation.value = "";
eventDesc.value = "Tir de précision";
divSpecialSection.style.display = "none";
break;
case "founding":
eventName.value = "";
isEventMandatory.checked = true;
isEventMandatory[0].checked = true;
eventBeginTime.value = "";
eventEndTime.value = "";
eventLocation.value = "";
eventDesc.value = "";
divSpecialSection.style.display = "none";
break;
case "volunteer":
eventName.value = "";
isEventMandatory.checked = true;
isEventMandatory[0].checked = true;
eventBeginTime.value = "";
eventEndTime.value = "";
eventLocation.value = "";
eventDesc.value = "";
divSpecialSection.style.display = "none";
break;
default:
eventName.value = "";
isEventMandatory.checked = false;
isEventMandatory[0].checked = false;
eventBeginTime.value = "";
eventEndTime.value = "";
eventLocation.value = "";
eventDesc.value = "";
divSpecialSection.style.display = "none";
break;
}
})(jQuery);
}
function checkBox()
{
var isEventMandatory = document.getElementsByName('is_event_mandatory');
console.log(isEventMandatory[0].checked);
if (isEventMandatory[0].checked) {
isEventMandatory[0].checked = true
} else {
isEventMandatory[0].checked = false
}
}
function switchToLevelOne()
{
var divLevelOne = document.getElementById("grade_1");
var divLevelTwo = document.getElementById('grade_2');
var divLevelThree = document.getElementById('grade_3');
var btnLevelOne = document.getElementById('btn_grade_1');
var btnLevelTwo = document.getElementById('btn_grade_2');
var btnLevelThree = document.getElementById('btn_grade_3');
divLevelOne.style.display = "block";
divLevelTwo.style.display = "none";
divLevelThree.style.display = "none";
btnLevelOne.className = "btn btn-primary btn-lg col-md-4 col-sm-12 active";
btnLevelTwo.className = "btn btn-primary btn-lg col-md-4 col-sm-12";
btnLevelThree.className = "btn btn-primary btn-lg col-md-4 col-sm-12";
}
function switchToLevelTwo()
{
var divLevelOne = document.getElementById("grade_1");
var divLevelTwo = document.getElementById('grade_2');
var divLevelThree = document.getElementById('grade_3');
var btnLevelOne = document.getElementById('btn_grade_1');
var btnLevelTwo = document.getElementById('btn_grade_2');
var btnLevelThree = document.getElementById('btn_grade_3');
divLevelOne.style.display = "none";
divLevelTwo.style.display = "block";
divLevelThree.style.display = "none";
btnLevelOne.className = "btn btn-primary btn-lg col-md-4 col-sm-12";
btnLevelTwo.className = "btn btn-primary btn-lg col-md-4 col-sm-12 active";
btnLevelThree.className = "btn btn-primary btn-lg col-md-4 col-sm-12";
}
function switchToLevelThree() {
var divLevelOne = document.getElementById("grade_1");
var divLevelTwo = document.getElementById('grade_2');
var divLevelThree = document.getElementById('grade_3');
var btnLevelOne = document.getElementById('btn_grade_1');
var btnLevelTwo = document.getElementById('btn_grade_2');
var btnLevelThree = document.getElementById('btn_grade_3');
divLevelOne.style.display = "none";
divLevelTwo.style.display = "none";
divLevelThree.style.display = "block";
btnLevelOne.className = "btn btn-primary btn-lg col-md-4 col-sm-12";
btnLevelTwo.className = "btn btn-primary btn-lg col-md-4 col-sm-12";
btnLevelThree.className = "btn btn-primary btn-lg col-md-4 col-sm-12 active";
}
function switchTypeWithoutOverride()
{
(function($) {
var eventInput = document.getElementById("event_type");
var divSpecialSection = document.getElementById('special_section');
switch (eventInput.value) {
case "pilotage":
divSpecialSection.style.display = "none";
break;
case "regular":
divSpecialSection.style.display = "block";
var n1_p1_plandone = document.getElementById('n1_p1_plandone');
var n1_p2_plandone = document.getElementById('n1_p2_plandone');
var n2_p1_plandone = document.getElementById('n2_p1_plandone');
var n2_p2_plandone = document.getElementById('n2_p2_plandone');
var n3_p1_plandone = document.getElementById('n3_p1_plandone');
var n3_p2_plandone = document.getElementById('n3_p2_plandone');
if (n1_p1_plandone.checked == false) {
n1_p1_plandone.checked = false;
}
if (n1_p2_plandone.checked == false) {
n1_p2_plandone.checked = false;
}
if (n2_p1_plandone.checked == false) {
n2_p1_plandone.checked = false;
}
if (n2_p2_plandone.checked == false) {
n2_p2_plandone.checked = false;
}
if (n3_p1_plandone.checked == false) {
n1_p1_plandone.checked = false;
}
if (n3_p2_plandone.checked == false) {
n1_p1_plandone.checked = false;
}
break;
case "drill":
divSpecialSection.style.display = "none";
break;
case "music":
divSpecialSection.style.display = "none";
break;
case "biathlon":
divSpecialSection.style.display = "none";
break;
case "marksmanship":
divSpecialSection.style.display = "none";
break;
case "founding":
divSpecialSection.style.display = "none";
break;
case "volunteer":
divSpecialSection.style.display = "none";
break;
default:
divSpecialSection.style.display = "none";
break;
}
})(jQuery);

10477
public/css/app.css vendored

File diff suppressed because one or more lines are too long

47417
public/js/app.js vendored

File diff suppressed because one or more lines are too long

4
public/mix-manifest.json Normal file
View File

@@ -0,0 +1,4 @@
{
"/js/app.js": "/js/app.js",
"/css/app.css": "/css/app.css"
}

View File

@@ -11,8 +11,8 @@ return [
'nothing_today' => "Il n'y a rien a l'horaire pour cette date",
'add_to_schedule' => "Ajouter une activité a l'horaire",
'begin_at' => "Commence a ",
'end_at' => " et termine a ",
'begin_at' => " de ",
'end_at' => " à ",
/** Admin Display Page */
'admin_page_title' => "Horaire",

View File

@@ -4,10 +4,13 @@
<div class="col-sm-12 col-lg-12">
<div class="card">
<div class="card-header">
<strong> {{ trans('calendar.add_title')}} </strong> {{ ucfirst(strftime("%A le %e %B %Y", strtotime($RequestDate))) }}
<strong> {{ trans('calendar.add_title')}} </strong> {{ ucfirst(strftime("%A le %e %B %Y", strtotime($RequestDate)))}}
</div>
<div class="card-body card-block">
<form action="" method="post" enctype="multipart/form-data" class="form-horizontal">
<form action="/admin/calendar/add" method="POST" enctype="multipart/form-data" class="form-horizontal">
{{ csrf_field() }}
<div class="row form-group">
<div class="col col-md-3"><label for="select" class=" form-control-label"> {{ trans('calendar.add_form_event_type')}} </label></div>
<div class="col-12 col-md-9">
@@ -55,11 +58,11 @@
</div>
<!-- Special section ONLY for regular event type -->
<div id="special_section" style="display: none">
<div class="row form-group">
<button type="button" class="btn btn-primary btn-lg col-md-4 col-sm-12 active">Niveau 1</button>
<button type="button" class="btn btn-primary btn-lg col-md-4 col-sm-12">Niveau 2</button>
<button type="button" class="btn btn-primary btn-lg col-md-4 col-sm-12">Niveau 3</button>
<button type="button" class="btn btn-primary btn-lg col-md-4 col-sm-12 active" id="btn_grade_1" onclick="switchToLevelOne()">Niveau 1</button>
<button type="button" class="btn btn-primary btn-lg col-md-4 col-sm-12" id="btn_grade_2" onclick="switchToLevelTwo()">Niveau 2</button>
<button type="button" class="btn btn-primary btn-lg col-md-4 col-sm-12" id="btn_grade_3" onclick="switchToLevelThree()">Niveau 3</button>
</div>
<div id="grade_1">
<!-- First periode -->
@@ -92,12 +95,14 @@
</div>
<div class="col col-md-2">
<label for="disabled-input" class=" form-control-label"> {{ trans("calendar.reg_plan_done")}} </label>
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="n1_p1_plandone" name="n1_p1_plandone" class="switch-input" checked="false" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="n1_p1_plandone" name="n1_p1_plandone" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
<small class="form-text text-muted"> {{trans('calendar.reg_plan_done_help')}}</small>
</div>
</div>
</div>
<hr style="margin-top: 25px; margin-bottom: 40px;">
<!-- Second periode -->
<div>
<h3> {{ trans('calendar.reg_p2') }} </h3>
@@ -128,13 +133,164 @@
</div>
<div class="col col-md-2">
<label for="disabled-input" class=" form-control-label"> {{ trans("calendar.reg_plan_done")}} </label>
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="n1_p2_plandone" name="n1_p2_plandone" class="switch-input" checked="false" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="n1_p2_plandone" name="n1_p2_plandone" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
<small class="form-text text-muted"> {{trans('calendar.reg_plan_done_help')}}</small>
</div>
</div>
</div>
</div>
<div id="grade_2" style="display: none">
<!-- First periode -->
<div>
<h3> {{ trans('calendar.reg_p1') }} </h3>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_classe_name')}} </label></div>
<div class="col-md-5"><input id="n2_p1_name" name="n2_p1_name" placeholder="{{ trans('calendar.reg_classe_name')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small></div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_ocom')}} </label></div>
<div class="col-md-4"><input id="n2_p1_ocom" name="n2_p1_ocom" placeholder="{{ trans('calendar.reg_ocom')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_ocom_help')}}</small></div>
</div>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_instructor_name')}} </label></div>
<div class="col-md-3">
<select name="n2_p1_instructor" id="n2_p1_instructor" class="form-control">
@foreach ($Userslist as $user)
<option value=" {{ $user->id }}"> {{ $user->lastname." ".$user->firstname}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_location')}} </label></div>
<div class="col-md-3">
<select name="n2_p1_local" id="n2_p1_local" class="form-control">
@foreach ($LocalsList as $local)
<option value=" {{ $local->id }}"> {{ $local->name}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col col-md-2">
<label for="disabled-input" class=" form-control-label"> {{ trans("calendar.reg_plan_done")}} </label>
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="n2_p1_plandone" name="n2_p1_plandone" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
<small class="form-text text-muted"> {{trans('calendar.reg_plan_done_help')}}</small>
</div>
</div>
</div>
<hr style="margin-top: 25px; margin-bottom: 40px;">
<!-- Second periode -->
<div>
<h3> {{ trans('calendar.reg_p2') }} </h3>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_classe_name')}} </label></div>
<div class="col-md-5"><input id="n2_p2_name" name="n2_p2_name" placeholder="{{ trans('calendar.reg_classe_name')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small></div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_ocom')}} </label></div>
<div class="col-md-4"><input id="n2_p2_ocom" name="n2_p2_ocom" placeholder="{{ trans('calendar.reg_ocom')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_ocom_help')}}</small></div>
</div>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_instructor_name')}} </label></div>
<div class="col-md-3">
<select name="n2_p2_instructor" id="n2_p2_instructor" class="form-control">
@foreach ($Userslist as $user)
<option value=" {{ $user->id }}"> {{ $user->lastname." ".$user->firstname}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_location')}} </label></div>
<div class="col-md-3">
<select name="n2_p2_local" id="n2_p2_local" class="form-control">
@foreach ($LocalsList as $local)
<option value=" {{ $local->id }}"> {{ $local->name}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col col-md-2">
<label for="disabled-input" class=" form-control-label"> {{ trans("calendar.reg_plan_done")}} </label>
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="n2_p2_plandone" name="n2_p2_plandone" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
<small class="form-text text-muted"> {{trans('calendar.reg_plan_done_help')}}</small>
</div>
</div>
</div>
</div>
<div id="grade_3" style="display: none">
<!-- First periode -->
<div>
<h3> {{ trans('calendar.reg_p1') }} </h3>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_classe_name')}} </label></div>
<div class="col-md-5"><input id="n3_p1_name" name="n3_p1_name" placeholder="{{ trans('calendar.reg_classe_name')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small></div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_ocom')}} </label></div>
<div class="col-md-4"><input id="n3_p1_ocom" name="n3_p1_ocom" placeholder="{{ trans('calendar.reg_ocom')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_ocom_help')}}</small></div>
</div>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_instructor_name')}} </label></div>
<div class="col-md-3">
<select name="n3_p1_instructor" id="n3_p1_instructor" class="form-control">
@foreach ($Userslist as $user)
<option value=" {{ $user->id }}"> {{ $user->lastname." ".$user->firstname}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_location')}} </label></div>
<div class="col-md-3">
<select name="n3_p1_local" id="n3_p1_local" class="form-control">
@foreach ($LocalsList as $local)
<option value=" {{ $local->id }}"> {{ $local->name}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col col-md-2">
<label for="disabled-input" class=" form-control-label"> {{ trans("calendar.reg_plan_done")}} </label>
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="n3_p1_plandone" name="n3_p1_plandone" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
<small class="form-text text-muted"> {{trans('calendar.reg_plan_done_help')}}</small>
</div>
</div>
</div>
<hr style="margin-top: 25px; margin-bottom: 40px;">
<!-- Second periode -->
<div>
<h3> {{ trans('calendar.reg_p2') }} </h3>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_classe_name')}} </label></div>
<div class="col-md-5"><input id="n3_p2_name" name="n3_p2_name" placeholder="{{ trans('calendar.reg_classe_name')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small></div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_ocom')}} </label></div>
<div class="col-md-4"><input id="n3_p2_ocom" name="n3_p2_ocom" placeholder="{{ trans('calendar.reg_ocom')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_ocom_help')}}</small></div>
</div>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_instructor_name')}} </label></div>
<div class="col-md-3">
<select name="n3_p2_instructor" id="n3_p2_instructor" class="form-control">
@foreach ($Userslist as $user)
<option value=" {{ $user->id }}"> {{ $user->lastname." ".$user->firstname}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_location')}} </label></div>
<div class="col-md-3">
<select name="n3_p2_local" id="n3_p2_local" class="form-control">
@foreach ($LocalsList as $local)
<option value=" {{ $local->id }}"> {{ $local->name}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col col-md-2">
<label for="disabled-input" class=" form-control-label"> {{ trans("calendar.reg_plan_done")}} </label>
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="n3_p2_plandone" name="n3_p2_plandone" class="switch-input" type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
<small class="form-text text-muted"> {{trans('calendar.reg_plan_done_help')}}</small>
</div>
</div>
</div>
</div>
</form>
</div>
<div class="card-footer">
<button type="submit" class="btn btn-primary btn-sm">
@@ -144,6 +300,8 @@
<i class="fa fa-ban"></i> Reset
</button>
</div>
</form>
</div>
</div>
</div>
@endsection

View File

@@ -22,7 +22,7 @@
</div>
</div>
<div class="modal fade" id="scrollmodal" tabindex="-1" role="dialog" aria-labelledby="scrollmodalLabel" style="display: none;" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-dialog modal-lg" style="max-width:1500px !important;" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="scrollmodalLabel">Scrolling Long Content Modal</h5>
@@ -69,4 +69,25 @@
@section('custom_scripts')
<script src="/assets/js/calendar/calendar.js"></script>
<div class="log"></div>
<script>
function deleteEvent($id){
swal({
title: 'Êtes vous sure ?',
text: "Vous ne pourrez annuler cette action",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.value) {
swal(
'Deleted!',
'Your file has been deleted.',
'success'
)
}
})
}
</script>
@endsection

View File

@@ -0,0 +1,369 @@
@extends('layouts.admin.main')
@section('content')
<div class="col-sm-12 col-lg-12">
<div class="card">
<div class="card-header">
<strong> {{ trans('calendar.add_title')}} </strong> {{ ucfirst(strftime("%A le %e %B %Y", strtotime($RequestSchedule->date)))}}
</div>
<div class="card-body card-block">
<form action="/admin/calendar/edit/{{$RequestSchedule->id}}" method="post" enctype="multipart/form-data" class="form-horizontal">
{{ csrf_field() }}
{{ method_field('patch') }}
<div class="row form-group">
<div class="col col-md-3"><label for="select" class=" form-control-label"> {{ trans('calendar.add_form_event_type')}} </label></div>
<div class="col-12 col-md-9">
<select name="event_type" id="event_type" class="form-control" onload="console.log('yas')">
@switch($RequestSchedule->type)
@case("regular")
<option value="regular"> {{trans('calendar.add_form_event_type_instruction')}} </option>
@break
@case("pilotage")
<option value="pilotage"> {{trans('calendar.add_form_event_type_pilotage')}} </option>
@break
@case("drill")
<option value="drill"> {{trans('calendar.add_form_event_type_dril')}} </option>
@break
@case("music")
<option value="music"> {{trans('calendar.add_form_event_type_music')}} </option>
@break
@case("biathlon")
<option value="biathlon"> {{trans('calendar.add_form_event_type_biathlon')}} </option>
@break
@case("marksmanship")
<option value="marksmanship"> {{trans('calendar.add_form_event_type_marksmanship')}} </option>
@break
@case("founding")
<option value="founding"> {{trans('calendar.add_form_event_type_founding')}} </option>
@break
@case("volunteer")
<option value="volunteer"> {{trans('calendar.add_form_event_type_volunteer')}} </option>
@break
@case("other")
<option value="other"> {{trans('calendar.add_form_event_type_other')}} </option>
@break
@default
<option value="null"> {{trans('calendar.add_form_event_type_select')}} </option>
@endswitch
</select>
</div>
</div>
<div class="row form-group">
<div class="col col-md-3"><label for="text-input" class=" form-control-label"> {{ trans('calendar.add_form_event_name') }}</label></div>
<div class="col-12 col-md-6"><input id="event_name" name="event_name" value="{{ $RequestSchedule->data['event_name'] }}" placeholder="{{ trans('calendar.add_form_event_name_placeholder')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.add_form_event_name_help')}}</small></div>
<div class="col col-md-3">
<label for="disabled-input" class=" form-control-label"> {{ trans("calendar.add_form_event_mandatory")}} </label>
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="is_event_mandatory" name="is_event_mandatory" class="switch-input" @if($RequestSchedule->data['is_event_mandatory'] == "on") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
<small class="form-text text-muted"> {{trans('calendar.add_form_event_mandatory_help')}}</small>
</div>
</div>
<div class="row form-group">
<div class="col col-md-3"><label for="disabled-input" class=" form-control-label"> {{ trans("calendar.add_form_event_date")}} </label></div>
<div class="col-12 col-md-9"><input id="event_date" name="event_date" readonly class="form-control" value="{{ $RequestSchedule->date}}" type="text"></div>
</div>
<div class="row form-group">
<div class="col col-md-3"><label for="disabled-input" class=" form-control-label"> {{ trans("calendar.add_form_event_time_begin")}} </label></div>
<div class="col-12 col-md-4"><input id="event_begin_time" value="{{ $RequestSchedule->data['event_begin_time'] }}" name="event_begin_time" class="form-control" type="time"><small class="form-text text-muted"> {{trans('calendar.add_form_event_time_begin_help')}}</small></div>
<div class="col col-md-1"><label for="disabled-input" class=" form-control-label"> {{ trans("calendar.add_form_event_time_end")}} </label></div>
<div class="col-12 col-md-4"><input id="event_end_time" value="{{ $RequestSchedule->data['event_end_time'] }}" name="event_end_time" class="form-control" type="time"><small class="form-text text-muted"> {{trans('calendar.add_form_event_time_end_help')}}</small></div>
</div>
<div class="row form-group">
<div class="col col-md-3"><label for="text-input" class=" form-control-label"> {{ trans('calendar.add_form_event_place') }}</label></div>
<div class="col-12 col-md-9"><input id="event_location" name="event_location" value="{{ $RequestSchedule->data['event_location'] }}" placeholder="{{ trans('calendar.add_form_event_place_placeholder')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.add_form_event_name_help')}}</small></div>
</div>
<div class="row form-group">
<div class="col col-md-3"><label for="textarea-input" class=" form-control-label">{{ trans('calendar.add_form_event_desc')}}</label></div>
<div class="col-12 col-md-9"><textarea name="event_desc" id="event_desc" rows="9" placeholder="{{ trans('calendar.add_form_event_desc_placeholder') }}" class="form-control">{{ $RequestSchedule->data['event_desc'] }}</textarea>
<small class="form-text text-muted"> {{trans('calendar.add_form_event_desc_help')}}</small></div>
</div>
<!-- Special section ONLY for regular event type -->
<div id="special_section" style="display: none">
<div class="row form-group">
<button type="button" class="btn btn-primary btn-lg col-md-4 col-sm-12 active" id="btn_grade_1" onclick="switchToLevelOne()">Niveau 1</button>
<button type="button" class="btn btn-primary btn-lg col-md-4 col-sm-12" id="btn_grade_2" onclick="switchToLevelTwo()">Niveau 2</button>
<button type="button" class="btn btn-primary btn-lg col-md-4 col-sm-12" id="btn_grade_3" onclick="switchToLevelThree()">Niveau 3</button>
</div>
<div id="grade_1">
<!-- First periode -->
<div>
<h3> {{ trans('calendar.reg_p1') }} </h3>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_classe_name')}} </label></div>
<div class="col-md-5"><input id="n1_p1_name" value="{{ $RequestSchedule->data['n1_p1_name'] }}" name="n1_p1_name" placeholder="{{ trans('calendar.reg_classe_name')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small></div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_ocom')}} </label></div>
<div class="col-md-4"><input id="n1_p1_ocom" value="{{ $RequestSchedule->data['n1_p1_ocom'] }}" name="n1_p1_ocom" placeholder="{{ trans('calendar.reg_ocom')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_ocom_help')}}</small></div>
</div>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_instructor_name')}} </label></div>
<div class="col-md-3">
<select name="n1_p1_instructor" id="n1_p1_instructor" class="form-control">
<option value="{{ $RequestSchedule->data['n1_p1_instructor'] }}"> {{ '*'.\App\User::find($RequestSchedule->data['n1_p1_instructor'])->fullname() }} </option>
@foreach ($Userslist as $user)
<option value="{{ $user->id }}"> {{ $user->lastname." ".$user->firstname}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_location')}} </label></div>
<div class="col-md-3">
<select name="n1_p1_local" id="n1_p1_local" class="form-control">
<option value="{{ $RequestSchedule->data['n1_p1_local'] }}"> {{ '*'.\App\Local::find($RequestSchedule->data['n1_p1_local'])->name }} </option>
@foreach ($LocalsList as $local)
<option value="{{ $local->id }}"> {{ $local->name}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col col-md-2">
<label for="disabled-input" class=" form-control-label"> {{ trans("calendar.reg_plan_done")}} </label>
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="n1_p1_plandone" name="n1_p1_plandone" class="switch-input" @if($RequestSchedule->data['n1_p1_plandone'] == "on") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
<small class="form-text text-muted"> {{trans('calendar.reg_plan_done_help')}}</small>
</div>
</div>
</div>
<hr style="margin-top: 25px; margin-bottom: 40px;">
<!-- Second periode -->
<div>
<h3> {{ trans('calendar.reg_p2') }} </h3>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_classe_name')}} </label></div>
<div class="col-md-5"><input id="n1_p2_name" value="{{ $RequestSchedule->data['n1_p2_name'] }}" name="n1_p2_name" placeholder="{{ trans('calendar.reg_classe_name')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small></div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_ocom')}} </label></div>
<div class="col-md-4"><input id="n1_p2_ocom" value="{{ $RequestSchedule->data['n1_p2_ocom'] }}" name="n1_p2_ocom" placeholder="{{ trans('calendar.reg_ocom')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_ocom_help')}}</small></div>
</div>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_instructor_name')}} </label></div>
<div class="col-md-3">
<select name="n1_p2_instructor" id="n1_p2_instructor" class="form-control">
<option value="{{ $RequestSchedule->data['n1_p2_instructor'] }}"> {{ \App\User::find($RequestSchedule->data['n1_p2_instructor'])->fullname() }} </option>
@foreach ($Userslist as $user)
<option value="{{ $user->id }}"> {{ $user->lastname." ".$user->firstname}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_location')}} </label></div>
<div class="col-md-3">
<select name="n1_p2_local" id="n1_p2_local" class="form-control">
<option value="{{ $RequestSchedule->data['n1_p2_local'] }}"> {{ '*'.\App\Local::find($RequestSchedule->data['n1_p2_local'])->name }} </option>
@foreach ($LocalsList as $local)
<option value="{{ $local->id }}"> {{ $local->name}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col col-md-2">
<label for="disabled-input" class=" form-control-label"> {{ trans("calendar.reg_plan_done")}} </label>
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="n1_p2_plandone" name="n1_p2_plandone" class="switch-input" @if($RequestSchedule->data['n1_p2_plandone'] == "on") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
<small class="form-text text-muted"> {{trans('calendar.reg_plan_done_help')}}</small>
</div>
</div>
</div>
</div>
<div id="grade_2" style="display: none">
<!-- First periode -->
<div>
<h3> {{ trans('calendar.reg_p1') }} </h3>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_classe_name')}} </label></div>
<div class="col-md-5"><input id="n2_p1_name" value="{{ $RequestSchedule->data['n2_p1_name'] }}" name="n2_p1_name" placeholder="{{ trans('calendar.reg_classe_name')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small></div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_ocom')}} </label></div>
<div class="col-md-4"><input id="n2_p1_ocom" value="{{ $RequestSchedule->data['n2_p1_ocom'] }}" name="n2_p1_ocom" placeholder="{{ trans('calendar.reg_ocom')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_ocom_help')}}</small></div>
</div>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_instructor_name')}} </label></div>
<div class="col-md-3">
<select name="n2_p1_instructor" id="n2_p1_instructor" class="form-control">
<option value="{{ $RequestSchedule->data['n2_p1_instructor'] }}"> {{ \App\User::find($RequestSchedule->data['n2_p1_instructor'])->fullname() }} </option>
@foreach ($Userslist as $user)
<option value="{{ $user->id }}"> {{ $user->lastname." ".$user->firstname}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_location')}} </label></div>
<div class="col-md-3">
<select name="n2_p1_local" id="n2_p1_local" class="form-control">
<option value="{{ $RequestSchedule->data['n2_p1_local'] }}"> {{ '*'.\App\Local::find($RequestSchedule->data['n2_p1_local'])->name }} </option>
@foreach ($LocalsList as $local)
<option value="{{ $local->id }}"> {{ $local->name}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col col-md-2">
<label for="disabled-input" class=" form-control-label"> {{ trans("calendar.reg_plan_done")}} </label>
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="n2_p1_plandone" name="n2_p1_plandone" class="switch-input" @if($RequestSchedule->data['n2_p1_plandone'] == "on") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
<small class="form-text text-muted"> {{trans('calendar.reg_plan_done_help')}}</small>
</div>
</div>
</div>
<hr style="margin-top: 25px; margin-bottom: 40px;">
<!-- Second periode -->
<div>
<h3> {{ trans('calendar.reg_p2') }} </h3>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_classe_name')}} </label></div>
<div class="col-md-5"><input id="n2_p2_name" value="{{ $RequestSchedule->data['n2_p2_name'] }}" name="n2_p2_name" placeholder="{{ trans('calendar.reg_classe_name')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small></div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_ocom')}} </label></div>
<div class="col-md-4"><input id="n2_p2_ocom" value="{{ $RequestSchedule->data['n2_p2_ocom'] }}" name="n2_p2_ocom" placeholder="{{ trans('calendar.reg_ocom')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_ocom_help')}}</small></div>
</div>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_instructor_name')}} </label></div>
<div class="col-md-3">
<select name="n2_p2_instructor" id="n2_p2_instructor" class="form-control">
<option value="{{ $RequestSchedule->data['n2_p2_instructor'] }}"> {{ \App\User::find($RequestSchedule->data['n2_p2_instructor'])->fullname() }} </option>
@foreach ($Userslist as $user)
<option value="{{ $user->id }}"> {{ $user->lastname." ".$user->firstname}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_location')}} </label></div>
<div class="col-md-3">
<select name="n2_p2_local" id="n2_p2_local" class="form-control">
<option value="{{ $RequestSchedule->data['n2_p2_local'] }}"> {{ '*'.\App\Local::find($RequestSchedule->data['n2_p2_local'])->name }} </option>
@foreach ($LocalsList as $local)
<option value="{{ $local->id }}"> {{ $local->name}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col col-md-2">
<label for="disabled-input" class=" form-control-label"> {{ trans("calendar.reg_plan_done")}} </label>
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="n2_p2_plandone" name="n2_p2_plandone" class="switch-input" @if($RequestSchedule->data['n2_p2_plandone'] == "on") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
<small class="form-text text-muted"> {{trans('calendar.reg_plan_done_help')}}</small>
</div>
</div>
</div>
</div>
<div id="grade_3" style="display: none">
<!-- First periode -->
<div>
<h3> {{ trans('calendar.reg_p1') }} </h3>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_classe_name')}} </label></div>
<div class="col-md-5"><input id="n3_p1_name" value="{{ $RequestSchedule->data['n3_p1_name'] }}" name="n3_p1_name" placeholder="{{ trans('calendar.reg_classe_name')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small></div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_ocom')}} </label></div>
<div class="col-md-4"><input id="n3_p1_ocom" value="{{ $RequestSchedule->data['n3_p1_ocom'] }}" name="n3_p1_ocom" placeholder="{{ trans('calendar.reg_ocom')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_ocom_help')}}</small></div>
</div>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_instructor_name')}} </label></div>
<div class="col-md-3">
<select name="n3_p1_instructor" id="n3_p1_instructor" class="form-control">
<option value="{{ $RequestSchedule->data['n3_p1_instructor'] }}"> {{ \App\User::find($RequestSchedule->data['n3_p1_instructor'])->fullname() }} </option>
@foreach ($Userslist as $user)
<option value="{{ $user->id }}"> {{ $user->lastname." ".$user->firstname}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_location')}} </label></div>
<div class="col-md-3">
<select name="n3_p1_local" id="n3_p1_local" class="form-control">
<option value="{{ $RequestSchedule->data['n3_p1_local'] }}"> {{ '*'.\App\Local::find($RequestSchedule->data['n3_p1_local'])->name }} </option>
@foreach ($LocalsList as $local)
<option value="{{ $local->id }}"> {{ $local->name}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col col-md-2">
<label for="disabled-input" class=" form-control-label"> {{ trans("calendar.reg_plan_done")}} </label>
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="n3_p1_plandone" name="n3_p1_plandone" class="switch-input" @if($RequestSchedule->data['n3_p1_plandone'] == "on") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
<small class="form-text text-muted"> {{trans('calendar.reg_plan_done_help')}}</small>
</div>
</div>
</div>
<hr style="margin-top: 25px; margin-bottom: 40px;">
<!-- Second periode -->
<div>
<h3> {{ trans('calendar.reg_p2') }} </h3>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_classe_name')}} </label></div>
<div class="col-md-5"><input id="n3_p2_name" value="{{ $RequestSchedule->data['n3_p2_name'] }}" name="n3_p2_name" placeholder="{{ trans('calendar.reg_classe_name')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small></div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_ocom')}} </label></div>
<div class="col-md-4"><input id="n3_p2_ocom" value="{{ $RequestSchedule->data['n3_p2_ocom'] }}" name="n3_p2_ocom" placeholder="{{ trans('calendar.reg_ocom')}}" class="form-control" type="text"><small class="form-text text-muted"> {{trans('calendar.reg_ocom_help')}}</small></div>
</div>
<div class="row form-group">
<div class="col-md-2"><label class=" form-control-label"> {{ trans('calendar.reg_instructor_name')}} </label></div>
<div class="col-md-3">
<select name="n3_p2_instructor" id="n3_p2_instructor" class="form-control">
<option value="{{ $RequestSchedule->data['n3_p2_instructor'] }}"> {{ \App\User::find($RequestSchedule->data['n3_p2_instructor'])->fullname() }} </option>
@foreach ($Userslist as $user)
<option value="{{ $user->id }}"> {{ $user->lastname." ".$user->firstname}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col-md-1"><label for="select" class=" form-control-label"> {{ trans('calendar.reg_location')}} </label></div>
<div class="col-md-3">
<select name="n3_p2_local" id="n3_p2_local" class="form-control">
<option value="{{ $RequestSchedule->data['n3_p2_local'] }}"> {{ '*'.\App\Local::find($RequestSchedule->data['n3_p2_local'])->name }} </option>
@foreach ($LocalsList as $local)
<option value="{{ $local->id }}"> {{ $local->name}} </option>
@endforeach
</select>
<small class="form-text text-muted"> {{trans('calendar.reg_classe_name_help')}}</small>
</div>
<div class="col col-md-2">
<label for="disabled-input" class=" form-control-label"> {{ trans("calendar.reg_plan_done")}} </label>
<label class="switch switch-3d switch-primary mr-3" style="margin-left: 3rem;"><input id="n3_p2_plandone" name="n3_p2_plandone" class="switch-input" @if($RequestSchedule->data['n3_p2_plandone'] == "on") checked="true" @endif type="checkbox"><span class="switch-label"></span><span class="switch-handle"></span></label>
<small class="form-text text-muted"> {{trans('calendar.reg_plan_done_help')}}</small>
</div>
</div>
</div>
</div>
</div>
<div class="card-footer">
<button type="submit" class="btn btn-primary btn-sm">
<i class="fa fa-dot-circle-o"></i> Submit
</button>
<button type="reset" class="btn btn-danger btn-sm">
<i class="fa fa-ban"></i> Reset
</button>
</div>
</form>
</div>
</div>
</div>
@endsection
@section('breadcrumb')
<div class="breadcrumbs">
<div class="col-sm-4">
<div class="page-header float-left">
<div class="page-title">
<h1>{{ trans('calendar.add_title')}}</h1>
</div>
</div>
</div>
<div class="col-sm-8">
<div class="page-header float-right">
<div class="page-title">
<ol class="breadcrumb text-right">
<li class="active">{{ trans('calendar.add_breadcrumb')}}</li>
</ol>
</div>
</div>
</div>
</div>
@endsection
@section('custom_scripts')
<script src="/assets/js/calendar/calendar.js"></script>
<script>switchTypeWithoutOverride();checkBox()</script>
<div class="log"></div>
@endsection

View File

@@ -13,7 +13,6 @@
{{ session('status') }}
</div>
@endif
You are logged in!
</div>
</div>

View File

@@ -2,6 +2,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js"></script>
<script src="/assets/admin/assets/js/plugins.js"></script>
<script src="/assets/admin/assets/js/main.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@7.26.11/dist/sweetalert2.all.min.js"></script>
<script src="/assets/admin/assets/js/lib/chart-js/Chart.bundle.js"></script>

View File

@@ -26,17 +26,15 @@ Route::get('/admin/update', 'AdminController@update');
Route::get('/admin/calendar', 'CalendarController@index');
Route::get('/admin/calendar/add/{date}', ['uses' =>'CalendarController@add']);
Route::get('/admin/calendar/edit/{id}', ['uses' =>'CalendarController@edit']);
Route::post('/admin/calendar/add', 'CalendarController@store');
Route::patch('/admin/calendar/edit/{id}', ['uses' =>'CalendarController@patch']);
/* Other Route */
Route::get('/test', function () {
$today = new \App\Schedule;
$today->date = "2018-07-18";
$today->type = "pilotage";
$today->data = ['begin_at' => '09:30','end_at' => '12:00'];
$today->save();
dd(\App\Schedule::all());
});