@extends('layouts.app') @section('title', auth()->user()->isEmployee() ? 'My Evaluations' : 'Performance Evaluation') @section('page-title', auth()->user()->isEmployee() ? 'My Evaluations' : 'Performance Evaluations') @section('content')
{{ $total }}
Total
{{ $pending }}
{{ auth()->user()->isEmployee() ? 'Pending Ack.' : 'Pending Review' }}
{{ $completed }}
Completed
{{ $avg_score ? round($avg_score).'%' : '—' }}
{{ auth()->user()->isEmployee() ? 'Your Avg.' : 'Dept. Avg.' }}
{{-- Filters --}}
@if(auth()->user()->isEmployee()) {{-- Employee: card grid --}}
@forelse($evaluations as $eval) @php $score = $eval->weighted_score ? round($eval->weighted_score) : 0; $rMap = ['excellent'=>'#059669','very_good'=>'#0055b3','satisfactory'=>'#0284c7','needs_improvement'=>'#f59e0b','unsatisfactory'=>'#dc2626']; $rCol = $rMap[$eval->overall_rating ?? ''] ?? '#6c757d'; @endphp
{{ $eval->period->name ?? '—' }}
{{ $eval->eval_number }}
{{ ucfirst($eval->status) }}
{{ $score }}%
{{ $eval->rating_label }}
Details @if($eval->status === 'submitted')
@csrf
@endif
@empty
No evaluations on record yet
Your evaluations will appear here once submitted by your manager
@endforelse
@if($evaluations->hasPages())
{{ $evaluations->links('pagination::bootstrap-5') }}
@endif @else {{-- HR / Admin / Dept Head: table --}}
{{ $evaluations->total() }} Evaluations
@forelse($evaluations as $eval) @empty @endforelse
Eval #Employee Dept. Period ScoreRatingStatus Actions
{{ $eval->eval_number }}
{{ strtoupper(substr($eval->employee->first_name??'?',0,1)) }}
{{ $eval->employee->full_name ?? '—' }}
{{ $eval->employee->department->name ?? '—' }} {{ $eval->period->name ?? '—' }} {{ $eval->weighted_score ? round($eval->weighted_score).'%' : '—' }} @if($eval->overall_rating) {{ $eval->rating_label }} @else — @endif {{ ucfirst($eval->status) }}
@if(auth()->user()->isHrOrAdmin() && $eval->status === 'acknowledged')
@csrf
@endif
No evaluations found
@if($evaluations->hasPages())
{{ $evaluations->links('pagination::bootstrap-5') }}
@endif
@endif @endsection