@extends('layouts.app') @section('title','My Dashboard') @section('page-title','My Dashboard') @push('styles') @endpush @section('content') @if(isset($setup_required) && $setup_required)
Your employee profile has not been set up yet. Please contact HR. Go to Profile →
@else {{-- Stat cards --}}
{{ $employee->years_of_service ?? 0 }}
Years of Service
{{ $attendance_summary['present'] ?? 0 }}
Present (Mo.)
{{ $pending_leaves }}
Pending Leaves
{{ $discipline_active }}
Active Cases
{{-- Attendance + clock --}}
Attendance — {{ now()->format('M Y') }}
{{-- ── Clock In / Out form ── --}} @php $gpsRestrict = config('hrms.gps_restrict'); @endphp
@csrf {{-- Hidden fields populated by JS before submit --}} @if($gpsRestrict) {{-- Location status indicator --}}
Checking your location…
@endif
{{ now()->format('h:i A · D, M j') }}
{{ $attendance_summary['present'] ?? 0 }}
Present
{{ $attendance_summary['absent'] ?? 0 }}
Absent
{{ $attendance_summary['late'] ?? 0 }}
Late
{{ $attendance_summary['on_leave'] ?? 0 }}
On Leave
{{-- Leave balances --}}
Leave Balances Request
@forelse($leave_balances as $balance)
{{ $balance->leaveType->name }} {{ $balance->taken_days }}/{{ $balance->entitled_days }} days
@php $pct = $balance->entitled_days > 0 ? ($balance->taken_days/$balance->entitled_days)*100 : 0; @endphp
{{ max(0,$balance->remaining) }} days remaining
@empty
Leave balances not configured
@endforelse
{{-- Latest evaluation --}}
Latest Evaluation
@if($latest_evaluation) @php $score = $latest_evaluation->weighted_score ? round($latest_evaluation->weighted_score) : 0; $rMap = ['excellent'=>'#4ade80','very_good'=>'#60a5fa','satisfactory'=>'#22d3ee','needs_improvement'=>'#fbbf24','unsatisfactory'=>'#f87171']; $rCol = $rMap[$latest_evaluation->rating ?? ''] ?? '#94a3b8'; @endphp
{{ $score }}%
{{ $latest_evaluation->rating_label }}
{{ $latest_evaluation->period->name ?? '' }}
@if($latest_evaluation->status === 'submitted')
@csrf
@else View Full Evaluation @endif @else
No evaluations yet
@endif {{-- Upcoming trainings --}}
Upcoming Trainings
@forelse($upcoming_trainings as $t)
{{ $t->title }}
{{ $t->start_date->format('M d') }} · {{ ucfirst($t->type) }}
View
@empty
No upcoming trainings
@endforelse
{{-- My Performance Goals --}}
My Performance Goals Manage All
@if(isset($active_goals) && $active_goals->count())
@foreach($active_goals as $goal) @php $statusColors = ['draft'=>'#64748b','active'=>'#3b82f6','achieved'=>'#22c55e','partially_met'=>'#f59e0b','not_met'=>'#ef4444','cancelled'=>'#6b7280']; $priorityIcons = ['high'=>'🔴','medium'=>'🟡','low'=>'🟢']; $sc = $statusColors[$goal->status] ?? '#64748b'; @endphp
{{ $priorityIcons[$goal->priority] ?? '🟡' }}
{{ $goal->title }}
@if($goal->target_metric)
{{ Str::limit($goal->target_metric, 60) }}
@endif @if($goal->target_date) @php $isOverdue = $goal->target_date->isPast() && in_array($goal->status,['draft','active']); @endphp
{{ $goal->target_date->format('d M Y') }} @if($isOverdue) · Overdue@endif
@endif
{{ $goal->status_label }} @if(!$goal->self_rating && $goal->status === 'active') Self-assess @endif
@endforeach
@else
No goals set yet for this period
Set My First Goal
@endif
{{-- Recent leaves --}}
My Recent Leave Requests View All
@forelse($recent_leaves as $leave) @empty @endforelse
Leave #TypeFromToDaysStatus
{{ $leave->leave_number }} {{ $leave->leaveType->name }} {{ $leave->date_from->format('M d, Y') }} {{ $leave->date_to->format('M d, Y') }} {{ $leave->total_days }} {{ $leave->status_label }}
No leave requests found
@endif @endsection @push('scripts') @endpush