@extends('layouts.app') @section('title', 'Staff Performance Dashboard') @section('content')

Staff Performance Dashboard

Track production staff productivity and performance metrics

@if($staffFilter || $dateFrom != now()->subDays(30)->format('Y-m-d') || $dateTo != now()->format('Y-m-d')) Reset @endif
Period: {{ \Carbon\Carbon::parse($dateFrom)->format('d M Y') }} - {{ \Carbon\Carbon::parse($dateTo)->format('d M Y') }} ({{ \Carbon\Carbon::parse($dateFrom)->diffInDays(\Carbon\Carbon::parse($dateTo)) + 1 }} days)
@if(count($staffPerformance) > 0)
Total Orders Packed
{{ number_format($staffPerformance->sum('total_packed')) }}
Total Orders Completed
{{ number_format($staffPerformance->sum('total_completed')) }}
Active Staff Members
{{ count($staffPerformance) }}

Individual Staff Performance

Detailed breakdown of each staff member's productivity

@foreach($staffPerformance as $index => $staff) @php $totalOrders = $staff['total_packed'] + $staff['total_completed']; $dayCount = \Carbon\Carbon::parse($dateFrom)->diffInDays(\Carbon\Carbon::parse($dateTo)) + 1; $dailyAverage = round($totalOrders / $dayCount, 1); // Performance rating if ($dailyAverage >= 100) { $performanceClass = 'bg-green-100 dark:bg-green-900/50 text-green-800 dark:text-green-300'; $performanceLabel = 'Excellent'; } elseif ($dailyAverage >= 80) { $performanceClass = 'bg-blue-100 dark:bg-blue-900/50 text-blue-800 dark:text-blue-300'; $performanceLabel = 'Good'; } elseif ($dailyAverage >= 65) { $performanceClass = 'bg-yellow-100 dark:bg-yellow-900/50 text-yellow-800 dark:text-yellow-300'; $performanceLabel = 'Average'; } else { $performanceClass = 'bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-300'; $performanceLabel = 'Below Average'; } @endphp @endforeach
Rank Staff Name Orders Packed Orders Completed Total Orders Daily Average Performance Report
@if($index == 0) 🏆 @elseif($index == 1) 🥈 @elseif($index == 2) 🥉 @else {{ $index + 1 }} @endif
{{ $staff['staff_name'] }}
ID: {{ $staff['staff_id'] }}
{{ number_format($staff['total_packed']) }} {{ number_format($staff['total_completed']) }} {{ number_format($totalOrders) }} {{ $dailyAverage }} /day {{ $performanceLabel }} Print
@else

No performance data

No staff activity found for the selected period.

@endif
@endsection