@php $configData = Helper::appClasses(); @endphp @extends('layouts/layoutMaster') @section('title', __('Attendance Reports')) @section('vendor-style') @vite([ 'resources/assets/vendor/libs/apex-charts/apex-charts.scss', 'resources/assets/vendor/libs/flatpickr/flatpickr.scss' ]) @endsection @section('vendor-script') @vite([ 'resources/assets/vendor/libs/apex-charts/apexcharts.js', 'resources/assets/vendor/libs/flatpickr/flatpickr.js' ]) @endsection @section('page-script') @vite(['resources/assets/js/app/hrcore-attendance-reports.js']) @endsection @section('content')
{{-- Breadcrumb --}} {{-- Report Filters --}}
{{ __('Report Filters') }}
{{-- Summary Cards --}}
@php $totalWorkingDays = 22; // This should be calculated based on the period $totalPresent = array_sum(array_column($monthlyStats, 'present')); $totalAbsent = array_sum(array_column($monthlyStats, 'absent')); $totalLate = array_sum(array_column($monthlyStats, 'late')); $totalHours = array_sum(array_column($monthlyStats, 'total_hours')); $avgHours = count($monthlyStats) > 0 ? round($totalHours / count($monthlyStats), 1) : 0; $attendanceRate = $totalWorkingDays > 0 ? round(($totalPresent / $totalWorkingDays) * 100, 1) : 0; @endphp

{{ __('Attendance Rate') }}

{{ $attendanceRate }}%

{{ __('Good') }}

{{ __('Total Present') }}

{{ $totalPresent }}

{{ __('days') }}
{{ __('Out of :days days', ['days' => $totalWorkingDays]) }}

{{ __('Late Arrivals') }}

{{ $totalLate }}

{{ __('times') }}
{{ __('Needs improvement') }}

{{ __('Avg. Work Hours') }}

{{ $avgHours }}

{{ __('hrs/month') }}
{{ __('Total: :hours hrs', ['hours' => $totalHours]) }}
{{-- Charts Row --}}
{{-- Monthly Attendance Trend --}}
{{ __('Monthly Attendance Trend') }}
{{-- Attendance Distribution --}}
{{ __('Attendance Distribution') }}
{{ __('Present') }} {{ $totalPresent }} {{ __('days') }}
{{ __('Absent') }} {{ $totalAbsent }} {{ __('days') }}
{{ __('Late') }} {{ $totalLate }} {{ __('days') }}
{{-- Detailed Monthly Report --}}
{{ __('Monthly Breakdown') }}
@foreach($monthlyStats as $stat) @php $workingDays = 22; // This should be calculated $attendancePercent = $workingDays > 0 ? round(($stat['present'] / $workingDays) * 100, 1) : 0; @endphp @endforeach
{{ __('Month') }} {{ __('Working Days') }} {{ __('Present') }} {{ __('Absent') }} {{ __('Late') }} {{ __('Half Day') }} {{ __('Total Hours') }} {{ __('Attendance %') }}
{{ $stat['month'] }} {{ $workingDays }} {{ $stat['present'] }} {{ $stat['absent'] }} {{ $stat['late'] }} {{ $stat['half_day'] }} {{ $stat['total_hours'] }} {{ __('hrs') }}
{{ $attendancePercent }}%
{{ __('Total') }} -- {{ $totalPresent }} {{ $totalAbsent }} {{ $totalLate }} -- {{ $totalHours }} {{ __('hrs') }} {{ $attendanceRate }}%
{{-- Pass data to JavaScript --}} @endsection