ALPHA 3.0.3

This commit is contained in:
TheGamecraft
2018-09-08 12:39:49 -04:00
parent d5fe4d6eb6
commit 7fe13ae0a7
88 changed files with 13952 additions and 112 deletions

View File

@@ -0,0 +1,331 @@
@extends('layouts.admin.main')
@section('content')
<div class="col-md-12">
@foreach ($schedules as $schedule)
<div class="card">
<div class="card-header">
<strong class="card-title">Réservation de matériel du {{$schedule->date}}</strong>
</div>
<div class="card-body">
<?php
$remove = [0 => ""];
$n1_p1_items = array_diff(explode("-",$schedule->n1_p1_item),$remove);
$n1_p2_items = array_diff(explode("-",$schedule->n1_p2_item),$remove);
$n2_p1_items = array_diff(explode("-",$schedule->n2_p1_item),$remove);
$n2_p2_items = array_diff(explode("-",$schedule->n2_p2_item),$remove);
$n3_p1_items = array_diff(explode("-",$schedule->n3_p1_item),$remove);
$n3_p2_items = array_diff(explode("-",$schedule->n3_p2_item),$remove);
?>
<table id="data_{{$schedule->id}}" 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; width:50%">{{ \App\User::find($schedule->data['n1_p1_instructor'])->fullname()}}</td>
<td style="border:none;width:50%">{{ $schedule->data['n1_p1_ocom'].' - '.$schedule->data['n1_p1_name']}}</td>
</tr>
</tbody>
</table>
<hr>
@if (!count($n1_p1_items) == 0)
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<thead>
<tr style="border:none;">
<th style="border:none;">ID</th>
<th style="border:none;">Item</th>
<th style="border:none;">Description</th>
</tr>
</thead>
<tbody>
@foreach ($n1_p1_items as $item)
<tr style="border:none;">
<td style="border:none; width:10%">{{$item}}</td>
<td style="border:none;">{{\App\Item::find($item)->name}}</td>
<td style="border:none;">{{\App\Item::find($item)->desc}}</td>
</tr>
@endforeach
</tbody>
</table>
@else
<div style="text-align:center;"><span class="badge badge-danger" style="display: initial;">Aucune réservation de matériel</span></div>
@endif
</td>
<td>
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<tbody>
<tr style="border:none;">
<td style="border:none; width:50%">{{ \App\User::find($schedule->data['n1_p2_instructor'])->fullname()}}</td>
<td style="border:none;width:50%">{{ $schedule->data['n1_p2_ocom'].' - '.$schedule->data['n1_p2_name']}}</td>
</tr>
</tbody>
</table>
<hr>
@if (!count($n1_p2_items) == 0)
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<thead>
<tr style="border:none;">
<th style="border:none;">ID</th>
<th style="border:none;">Item</th>
<th style="border:none;">Description</th>
</tr>
</thead>
<tbody>
@foreach ($n1_p2_items as $item)
<tr style="border:none;">
<td style="border:none; width:10%">{{$item}}</td>
<td style="border:none;">{{\App\Item::find($item)->name}}</td>
<td style="border:none;">{{\App\Item::find($item)->desc}}</td>
</tr>
@endforeach
</tbody>
</table>
@else
<div style="text-align:center;"><span class="badge badge-danger" style="display: initial;">Aucune réservation de matériel</span></div>
@endif
</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; width:50%">{{ \App\User::find($schedule->data['n2_p1_instructor'])->fullname()}}</td>
<td style="border:none;width:50%">{{ $schedule->data['n2_p1_ocom'].' - '.$schedule->data['n2_p1_name']}}</td>
</tr>
</tbody>
</table>
<hr>
@if (!count($n2_p1_items) == 0)
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<thead>
<tr style="border:none;">
<th style="border:none;">ID</th>
<th style="border:none;">Item</th>
<th style="border:none;">Description</th>
</tr>
</thead>
<tbody>
@foreach ($n2_p1_items as $item)
<tr style="border:none;">
<td style="border:none; width:10%">{{$item}}</td>
<td style="border:none;">{{\App\Item::find($item)->name}}</td>
<td style="border:none;">{{\App\Item::find($item)->desc}}</td>
</tr>
@endforeach
</tbody>
</table>
@else
<div style="text-align:center;"><span class="badge badge-danger" style="display: initial;">Aucune réservation de matériel</span></div>
@endif
</td>
<td>
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<tbody>
<tr style="border:none;">
<td style="border:none; width:50%">{{ \App\User::find($schedule->data['n2_p2_instructor'])->fullname()}}</td>
<td style="border:none;width:50%">{{ $schedule->data['n2_p2_ocom'].' - '.$schedule->data['n2_p2_name']}}</td>
</tr>
</tbody>
</table>
<hr>
@if (!count($n2_p2_items) == 0)
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<thead>
<tr style="border:none;">
<th style="border:none;">ID</th>
<th style="border:none;">Item</th>
<th style="border:none;">Description</th>
</tr>
</thead>
<tbody>
@foreach ($n2_p2_items as $item)
<tr style="border:none;">
<td style="border:none; width:10%">{{$item}}</td>
<td style="border:none;">{{\App\Item::find($item)->name}}</td>
<td style="border:none;">{{\App\Item::find($item)->desc}}</td>
</tr>
@endforeach
</tbody>
</table>
@else
<div style="text-align:center;"><span class="badge badge-danger" style="display: initial;">Aucune réservation de matériel</span></div>
@endif
</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; width:50%">{{ \App\User::find($schedule->data['n3_p1_instructor'])->fullname()}}</td>
<td style="border:none;width:50%">{{ $schedule->data['n3_p1_ocom'].' - '.$schedule->data['n3_p1_name']}}</td>
</tr>
</tbody>
</table>
<hr>
@if (!count($n3_p1_items) == 0)
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<thead>
<tr style="border:none;">
<th style="border:none;">ID</th>
<th style="border:none;">Item</th>
<th style="border:none;">Description</th>
</tr>
</thead>
<tbody>
@foreach ($n3_p1_items as $item)
<tr style="border:none;">
<td style="border:none; width:10%">{{$item}}</td>
<td style="border:none;">{{\App\Item::find($item)->name}}</td>
<td style="border:none;">{{\App\Item::find($item)->desc}}</td>
</tr>
@endforeach
</tbody>
</table>
@else
<div style="text-align:center;"><span class="badge badge-danger" style="display: initial;">Aucune réservation de matériel</span></div>
@endif
</td>
<td>
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<tbody>
<tr style="border:none;">
<td style="border:none; width:50%">{{ \App\User::find($schedule->data['n3_p2_instructor'])->fullname()}}</td>
<td style="border:none;width:50%">{{ $schedule->data['n3_p2_ocom'].' - '.$schedule->data['n3_p2_name']}}</td>
</tr>
</tbody>
</table>
<hr>
@if (!count($n3_p2_items) == 0)
<table class="table float center" style="border:none; max-width:80%; margin:auto;">
<thead>
<tr style="border:none;">
<th style="border:none;">ID</th>
<th style="border:none;">Item</th>
<th style="border:none;">Description</th>
</tr>
</thead>
<tbody>
@foreach ($n3_p2_items as $item)
<tr style="border:none;">
<td style="border:none; width:10%">{{$item}}</td>
<td style="border:none;">{{\App\Item::find($item)->name}}</td>
<td style="border:none;">{{\App\Item::find($item)->desc}}</td>
</tr>
@endforeach
</tbody>
</table>
@else
<div style="text-align:center;"><span class="badge badge-danger" style="display: initial;">Aucune réservation de matériel</span></div>
@endif
</td>
</tr>
</tbody>
</table>
</div>
</div>
@endforeach
</div>
@endsection
@section('breadcrumb')
<div class="breadcrumbs">
<div class="col-sm-4">
<div class="page-header float-left">
<div class="page-title">
<h1>Inventaire</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">Inventaire</li>
</ol>
</div>
</div>
</div>
</div>
@endsection
@section('custom_scripts')
<script src="/assets/admin/assets/js/lib/data-table/datatables.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/dataTables.bootstrap.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/dataTables.buttons.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/buttons.bootstrap.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/jszip.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/pdfmake.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/vfs_fonts.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/buttons.html5.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/buttons.print.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/buttons.colVis.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/datatables-init.js"></script>
@foreach ($schedules as $schedule)
<script>
(function($) {
$(document).ready(function() {
$('#data_{{$schedule->id}}').DataTable({
"order": [[ 0, "asc" ]],
"lengthMenu": [[25, 50, -1], [25, 50, "All"]],
});
} );
})(jQuery);
</script>
@endforeach
<script type="text/javascript">
function deleteEvent(pid){
swal({
title: 'Êtes vous certain ?',
text: "Vous ne pourrez annuler cette action",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Oui',
cancelButtonText: 'Non'
}).then((result) => {
if (result.value) {
(function($) {
$.post('/api/item/delete?api_token='+api_token, { id: pid } , function(data) {
console.log('Delete');
});
})(jQuery);
swal(
'Supprimé!',
"L'item a été supprimé",
'success'
).then((result) => {
if (result.value) {
location.reload();
}
})
}
})
}
</script>
@endsection

View File

@@ -0,0 +1,117 @@
@extends('layouts.admin.main')
@section('content')
<div class="col-md-12">
<div class="card">
<div class="card-header">
<strong class="card-title">Inventaire <a href="#"><i class="fa fa-question-circle" aria-hidden="true"></i>
</a></strong>
</div>
<div class="card-body">
<a name="add" id="add" class="btn btn-primary btn-block" href="/admin/item/add" role="button">Ajouter un item a l'inventaire</a>
<hr>
<table id="log-data" class="table table-striped table-bordered">
<thead>
<tr>
<th>ID </th>
<th>Nom</th>
<th>Description</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach ($items as $item)
<tr>
<td style="width:5%;">{{$item->id}}</td>
<td>{{$item->name}}</td>
<td>{{$item->desc}}</td>
<td style="width: 12%;"><a href="/admin/item/edit/{{$item->id}}" type="button" class="btn btn-secondary"><i class="fa fa-cog"></i>&nbsp; Modifier</a><a type="button" class="btn btn-danger" onclick="deleteEvent({{$item->id}});"><i class="fa fa-times-circle" style="color:white;"></i></a></td>
</tr>
@endforeach
</tbody>
</table>
</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>Inventaire</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">Inventaire</li>
</ol>
</div>
</div>
</div>
</div>
@endsection
@section('custom_scripts')
<script src="/assets/admin/assets/js/lib/data-table/datatables.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/dataTables.bootstrap.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/dataTables.buttons.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/buttons.bootstrap.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/jszip.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/pdfmake.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/vfs_fonts.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/buttons.html5.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/buttons.print.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/buttons.colVis.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/datatables-init.js"></script>
<script type="text/javascript">
(function($) {
$(document).ready(function() {
$('#log-data').DataTable({
"order": [[ 0, "desc" ]],
"lengthMenu": [[25, 50, -1], [25, 50, "All"]],
});
} );
})(jQuery);
function deleteEvent(pid){
swal({
title: 'Êtes vous certain ?',
text: "Vous ne pourrez annuler cette action",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Oui',
cancelButtonText: 'Non'
}).then((result) => {
if (result.value) {
(function($) {
$.post('/api/item/delete?api_token='+api_token, { id: pid } , function(data) {
console.log('Delete');
});
})(jQuery);
swal(
'Supprimé!',
"L'item a été supprimé",
'success'
).then((result) => {
if (result.value) {
location.reload();
}
})
}
})
}
</script>
@endsection

View File

@@ -0,0 +1,161 @@
@extends('layouts.admin.main')
@section('content')
<div class="col-md-12">
<div class="card">
<div class="card-header">
<strong class="card-title">Matériel {{$schedule->data['n'.$niveau.'_p'.$periode.'_name']}} - {{$schedule->data['n'.$niveau.'_p'.$periode.'_ocom']}}<a href="#"><i class="fa fa-question-circle" aria-hidden="true"></i>
</a></strong>
</div>
<div class="card-body">
<div class="row">
<div class="col-6">
<h3>Matériel Réservé</h3>
<br>
<p>Cliquer sur la flèche a droite d'un item pour annuler la réservation</p>
<hr>
<table id="log-data" class="table table-striped table-bordered">
<thead>
<tr>
<th>Nom</th>
<th>Description</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach ($items as $item)
@if ($item !== null)
<tr>
<td>{{$item->name}}</td>
<td>{{$item->desc}}</td>
<td style="width: 12%;"><form action="/admin/inventory/remove/{{$schedule->id}}/{{$periode}}/{{$niveau}}" method="post">{{ csrf_field() }}<button type="submit" name="remove" value="{{$item->id}}" class="btn btn-danger"><i class="fa fa-arrow-right" style="color:white;"></i></button></form></td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
<div class="col-6">
<h3>Matériel Disponible</h3>
<br>
<p>Cliquer sur la flèche a gauche d'un item pour le réserver</p>
<hr>
<table id="log-data_2" class="table table-striped table-bordered">
<thead>
<tr>
<th></th>
<th>Nom</th>
<th>Description</th>
</tr>
</thead>
<tbody>
@foreach ($dispo_item as $item)
@if ($item !== null)
<tr>
<td style="width: 12%;"><form action="/admin/inventory/add/{{$schedule->id}}/{{$periode}}/{{$niveau}}" method="post">{{ csrf_field() }}<button type="submit" name="add" class="btn btn-success" value="{{$item->id}}"><i class="fa fa-arrow-left" style="color:white;"></i></button></form></td>
<td>{{$item->name}}</td>
<td>{{$item->desc}}</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
</div>
<hr>
<a href="/admin/calendar" class="btn btn-primary btn-block">Retour a l'horaire</a>
</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>Inventaire</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">Inventaire</li>
</ol>
</div>
</div>
</div>
</div>
@endsection
@section('custom_scripts')
<script src="/assets/admin/assets/js/lib/data-table/datatables.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/dataTables.bootstrap.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/dataTables.buttons.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/buttons.bootstrap.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/jszip.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/pdfmake.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/vfs_fonts.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/buttons.html5.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/buttons.print.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/buttons.colVis.min.js"></script>
<script src="/assets/admin/assets/js/lib/data-table/datatables-init.js"></script>
<script type="text/javascript">
(function($) {
$(document).ready(function() {
$('#log-data').DataTable({
"order": [[ 0, "desc" ]],
"lengthMenu": [[25, 50, -1], [25, 50, "All"]],
});
} );
})(jQuery);
(function($) {
$(document).ready(function() {
$('#log-data_2').DataTable({
"order": [[ 0, "desc" ]],
"lengthMenu": [[25, 50, -1], [25, 50, "All"]],
});
} );
})(jQuery);
function deleteEvent(pid){
swal({
title: 'Êtes vous certain ?',
text: "Vous ne pourrez annuler cette action",
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Oui',
cancelButtonText: 'Non'
}).then((result) => {
if (result.value) {
(function($) {
$.post('/api/item/delete?api_token='+api_token, { id: pid } , function(data) {
console.log('Delete');
});
})(jQuery);
swal(
'Supprimé!',
"L'item a été supprimé",
'success'
).then((result) => {
if (result.value) {
location.reload();
}
})
}
})
}
</script>
@endsection