60 lines
2.3 KiB
PHP
60 lines
2.3 KiB
PHP
@extends('layout.app')
|
|
|
|
@section('content')
|
|
<div class="container">
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-8">
|
|
<div class="card">
|
|
<div class="card-header">{{ __('Statistiques') }}</div>
|
|
|
|
<div class="card-body">
|
|
@foreach ($stats as $index => $stat)
|
|
<table class="table">
|
|
<thead class="table-dark">
|
|
<tr>
|
|
<th>{{ $index }}</th>
|
|
<th>{{ __('Jour(s)') }}</th>
|
|
<th>%</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@php
|
|
$workdays = 260;
|
|
if (strpos($index, '2021') !== false) {
|
|
$workdays = 105;
|
|
}
|
|
$sum = 0;
|
|
@endphp
|
|
@foreach ($stat as $data)
|
|
<tr class="{{ Str::slug('celltype-'. CellType::make($data->activity->value)->label) }}">
|
|
<td><b>{{ $data->activity->label }}</b></td>
|
|
<td><b>{{ $data->nb / Config::get('schedules.daySlots') }}</b></td>
|
|
<td>{{ round((($data->nb / Config::get('schedules.daySlots')) / $workdays) * 100) }}%</td>
|
|
</tr>
|
|
@php $sum += $data->nb; @endphp
|
|
@endforeach
|
|
<tr>
|
|
<td><b>{{ __('Total') }}</b></td>
|
|
<td><b>{{ $sum / Config::get('schedules.daySlots') }} / {{ $workdays }}</b></td>
|
|
<td><b>{{ round((($sum / 8) / $workdays) * 100) }}%</b></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
@push('styles')
|
|
<style nonce="{{ $nonce }}">
|
|
@foreach(CellType::toArray() as $type)
|
|
.{{ Str::slug("celltype-$type->label") }} {
|
|
background-color: {{ $type->value }};
|
|
border: 1px solid black;
|
|
}
|
|
@endforeach
|
|
</style>
|
|
@endpush
|