@extends('admin.admin_dashboard') @section('customcss') @endsection @section('admin')
{{-- Header & Breadcrumb --}} {{-- Filter Section --}}
Staff Performance Report
{{-- Report Cards per Employee --}} @if(isset($reportData) && $reportData->isNotEmpty()) @foreach($reportData as $data) @php $emp = $data['employee']; $primaryId = (!empty($emp->primary_id) && $emp->primary_id !== '0' && $emp->primary_id !== 0) ? $emp->primary_id : '-'; $secondaryId = (!empty($emp->e_id) && $emp->e_id !== '0' && $emp->e_id !== 0) ? $emp->e_id : '-'; $post = $emp->postDetails->name ?? ($emp->post ?? '-'); $avgEff = $data['avg_efficiency']; $effColor = $avgEff >= 90 ? 'text-success' : ($avgEff >= 75 ? 'text-warning' : 'text-danger'); @endphp
{{-- School Header for Print --}} {{-- Employee Header for Web View --}}
{{ $emp->name }}
Primary ID: {{ $primaryId }} | Secondary ID: {{ $secondaryId }} | Post: {{ $post }}
Period: {{ $fromDate->format('d M, Y') }} - {{ $toDate->format('d M, Y') }}
{{-- Employee Information Table --}}
Employee Name: {{ $emp->name }} Primary ID: {{ $primaryId }} Secondary ID: {{ $secondaryId }} Designation: {{ $post }}
{{-- Performance Summary Table --}}
Working Days Present Days Expected Hours Worked Hours Shortage/Excess Total Late Avg Efficiency
{{ $data['total_working_days'] }} {{ $data['present_days'] }} {{ $data['total_expected'] }} {{ $data['total_worked'] }} @if($data['total_shortage_minutes'] > 0) {{ $data['total_shortage'] }} @else 0h 0m @endif {{ $data['total_late_minutes'] }}m {{ $avgEff }}%
{{-- Daily Performance Breakdown Table --}}
@foreach($data['daily_performance'] as $p) @php $st = strtolower($p['status']); $badgeClass = match ($st) { 'present', 'partial', 'p' => 'success', 'leave' => 'info', 'off_day', 'weeklyoff' => 'secondary', 'holiday' => 'dark', default => 'danger', }; $eff = $p['efficiency']; $effClass = $eff >= 90 ? 'text-success' : ($eff >= 75 ? 'text-warning' : 'text-danger'); @endphp {{-- MORNING --}} {{-- DAY --}} @endforeach
Date Day Morning Shift Day Shift Expected Worked Shortage Late Efficiency Status
In Out Late In Out Late
{{ \Carbon\Carbon::parse($p['date'])->format('d-m-Y') }} {{ $p['day_name'] }}{{ $p['morning_in'] }} {{ $p['morning_out'] }} @if($p['morning_late'] !== '-') {{ $p['morning_late'] }} @else - @endif {{ $p['day_in'] }} {{ $p['day_out'] }} @if($p['day_late'] !== '-') {{ $p['day_late'] }} @else - @endif {{ $p['expected_hours'] }} {{ $p['worked_hours'] }} @if($p['shortage_minutes'] > 0) {{ $p['shortage_hours'] }} @else 0h 0m @endif @if($p['late_minutes'] > 0) {{ $p['late_hours'] }} @else 0h 0m @endif {{ $eff }}% {{ strtoupper($p['status']) }}
@endforeach @elseif(request()->has('from_date'))
No performance data found for the selected criteria.
@endif
@endsection