@extends('layouts.app') @section('title','HR Dashboard') @section('page-title',auth()->user()->isDeptHead() ? 'Department Overview' : 'HR Dashboard') @push('styles') @endpush @section('content') {{-- Stat cards --}}
{{ $total_employees }}
Active Staff
{{ $pending_leaves }}
{{ auth()->user()->isDeptHead() ? 'Pending (Your Dept)' : 'Pending HR Review' }}
{{ $discipline_open }}
Open Cases
{{ $evaluations_pending }}
Evals Pending
{{-- Pending approvals --}}
{{ auth()->user()->isDeptHead() ? 'Leaves Awaiting Your Approval' : 'Leaves Awaiting HR Approval' }} View All
@forelse($pending_approvals as $leave)
{{ strtoupper(substr($leave->employee->first_name,0,1)) }}
{{ $leave->employee->full_name }}
{{ $leave->leaveType->name }} · {{ $leave->total_days }} days
@if(auth()->user()->isDeptHead())
@csrf
@else
@csrf
@endif
@empty
No pending approvals
@endforelse
{{-- New hires this month --}}
New Hires — {{ now()->format('F Y') }} @if(auth()->user()->isHrOrAdmin()) + Add @endif
@forelse($new_employees as $emp)
{{ strtoupper(substr($emp->first_name,0,1).substr($emp->last_name,0,1)) }}
{{ $emp->full_name }}
{{ $emp->position }} · {{ $emp->department->name ?? '' }} · {{ $emp->date_of_employment?->format('M j') }}
@empty
No new hires this month
@endforelse
{{-- Department overview table --}} @if($dept_summary->count())
Department Overview
@foreach($dept_summary as $dept) @endforeach
Department Active On Leave Pending Leaves Open Cases
{{ $dept->name }} {{ $dept->active_count ?? 0 }} {{ $dept->on_leave_count ?? 0 }} {{ $dept->pending_leaves ?? 0 }} {{ $dept->open_cases ?? 0 }}
@endif @endsection @push('scripts') @endpush