ldc-supportweb/resources/views/users/stats.blade.php

61 lines
2.3 KiB
PHP
Raw Normal View History

2022-02-09 13:11:29 +00:00
@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
2022-02-11 11:13:54 +01:00
$workdays = 260;
2022-02-09 13:11:29 +00:00
if (strpos($index, '2021') !== false) {
2022-02-11 11:13:54 +01:00
$workdays = 105;
2022-02-09 13:11:29 +00:00
}
$sum = 0;
@endphp
@foreach ($stat as $data)
<tr class="{{ Str::slug('celltype-'. CellType::make($data->activity->value)->label) }}">
2022-02-09 13:11:29 +00:00
<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>
2022-02-09 13:11:29 +00:00
</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>
2022-02-09 13:11:29 +00:00
</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