@extends('dashboard.layouts.app') @section('title', 'Rapport présence - ' . $user->name . ' - UAC eservices') @section('page-title', 'Rapport de présence - ' . $user->name) @section('breadcrumb') @endsection @section('content')
{{ strtoupper(substr($user->name, 0, 1)) }}

{{ $user->name }}

{{ $user->email }}

{{ $user->role->nom }}

Statistiques - {{ $dateDebut->locale('fr')->isoFormat('MMMM YYYY') }}

{{ $stats['taux_presence'] }}%

Présence

{{ $stats['jours_present'] }}

Jours présents

{{ $stats['jours_absent'] }}

Absences

{{ $stats['nombre_retards'] }}

Retards

{{ $stats['total_jours'] }}

Total jours
Taux de présence {{ $stats['taux_presence'] }}%
@php $taux = $stats['taux_presence']; $bgClass = $taux >= 90 ? 'bg-success' : ($taux >= 75 ? 'bg-warning' : 'bg-danger'); @endphp

Retour à la liste
{{ $dateDebut->locale('fr')->isoFormat('MMMM YYYY') }}
Calendrier mensuel
@php $firstDayOfMonth = $dateDebut->copy()->startOfMonth(); $lastDayOfMonth = $dateFin->copy()->endOfMonth(); $startDate = $firstDayOfMonth->copy()->startOfWeek(); $endDate = $lastDayOfMonth->copy()->endOfWeek(); $currentDate = $startDate->copy(); $weekNumber = 0; $timezone = config('app.timezone', 'Africa/Porto-Novo'); $aujourdhui = \Carbon\Carbon::now($timezone)->toDateString(); @endphp @while($currentDate <= $endDate) @if($currentDate->dayOfWeek == 1 || $weekNumber == 0) @php $weekNumber++ @endphp @endif @php $dateKey = $currentDate->format('Y-m-d'); $presence = $presences->get($dateKey); $isWeekend = in_array($currentDate->dayOfWeek, [0, 6]); // Dim=0, Sam=6 $isToday = $dateKey === $aujourdhui; $isOutsideMonth = $currentDate->month != $dateDebut->month; @endphp @if($currentDate->dayOfWeek == 0) @endif @php $currentDate->addDay() @endphp @endwhile
Lun Mar Mer Jeu Ven Sam Dim
@if(!$isOutsideMonth)
{{ $currentDate->day }} @if($isWeekend) @endif
@if($presence) @php $estEnRetard = method_exists($presence, 'estEnRetard') ? $presence->estEnRetard() : false; @endphp
@if($presence->statut === 'Présent') @if($estEnRetard) Retard @else Présent @endif @if($presence->heure_arrivee)
{{ $presence->heure_arrivee }} @if(property_exists($presence, 'latitude_arrivee') && $presence->latitude_arrivee && property_exists($presence, 'longitude_arrivee') && $presence->longitude_arrivee) @endif
@if($presence->heure_depart)
{{ $presence->heure_depart }} @if(property_exists($presence, 'latitude_depart') && $presence->latitude_depart && property_exists($presence, 'longitude_depart') && $presence->longitude_depart) @endif
@endif @endif @else Absent @endif
@if($dateKey < $aujourdhui && !$isWeekend) @elseif($dateKey >= $aujourdhui)
@endif @endif @endif
Légende
Présent à l'heure
En retard
Absent
À venir
@endsection @push('scripts') @endpush