@extends('adminlte::page') @section('title', 'Employee Dashboard') @include('partials.ui-polish') @section('content_header')

Employee Dashboard

Personal dashboard, announcements, requests, leave, attendance, payslips, and timesheets
Leave Timesheets @if($advanceModuleActive) Advances @endif
@stop @section('css') @stop @section('js') @stop @section('content') @if(session('success')) {{ session('success') }} @endif @if($errors->any()) @endif @unless($employee) No employee record was found for this user. @endunless @foreach($projectOptions as $project) @endforeach @foreach($activityOptions as $activity) @endforeach
@if($employee)
@if($employee->profile_photo_path) {{ $employee->full_name }} @else {{ strtoupper(substr($employee->full_name, 0, 1)) }} @endif
{{ $employee->full_name }}
{{ $employee->employee_code }} ยท {{ $employee->position->title ?? 'Employee' }}
Phone
{{ $employee->phone ?? 'Not set' }}
Emergency
{{ $employee->emergency_contact ?? 'Not set' }}
2FA
{{ auth()->user()?->two_factor_enabled ? 'Enabled' : 'Disabled' }}
@csrf @method('PUT')
{{ old('address', $employee->address) }}
@csrf @method('PUT')
@csrf @method('PUT')
user()?->two_factor_enabled)>
@else
No employee profile linked.
@endif
@php $employeeModuleCards = [ [ 'title' => 'Leave Management', 'subtitle' => 'Apply and track leave', 'icon' => 'fas fa-calendar-check', 'theme' => 'primary', 'metric' => number_format((float) $metrics['remainingLeave'], 1), 'metricLabel' => 'Leave Balance days available', 'url' => '#leave-management', 'actions' => [ ['label' => 'Apply', 'url' => '#leave-management'], ['label' => 'History', 'url' => '#leave-management'], ], ], [ 'title' => 'Attendance', 'subtitle' => 'Clock in and corrections', 'icon' => 'fas fa-user-clock', 'theme' => 'success', 'metric' => $metrics['attendanceThisMonth'], 'metricLabel' => 'records this month', 'url' => '#employee-attendance', 'actions' => [ ['label' => 'Clock In', 'url' => '#employee-attendance'], ['label' => 'Correction', 'url' => '#employee-attendance'], ], ], [ 'title' => 'Timesheets', 'subtitle' => 'Project/activity hours', 'icon' => 'fas fa-clock', 'theme' => 'info', 'metric' => $metrics['latestTimesheetStatus'], 'metricLabel' => 'Timesheet Status', 'url' => '#self-service-timesheets', 'actions' => [ ['label' => 'Submit', 'url' => '#self-service-timesheets'], ['label' => 'Status', 'url' => '#self-service-timesheets'], ], ], [ 'title' => 'Payroll & Payslips', 'subtitle' => 'Salary and PDF payslips', 'icon' => 'fas fa-receipt', 'theme' => 'warning', 'metric' => $metrics['latestPayslip'], 'metricLabel' => 'Latest Payslip', 'url' => '#employee-payroll', 'actions' => [ ['label' => 'Payslips', 'url' => '#employee-payroll'], ['label' => 'Download', 'url' => '#employee-payroll'], ], ], [ 'title' => 'Documents', 'subtitle' => 'Contracts and HR files', 'icon' => 'fas fa-folder-open', 'theme' => 'secondary', 'metric' => $documents->count(), 'metricLabel' => 'personal documents', 'url' => '#employee-documents', 'actions' => [ ['label' => 'Upload', 'url' => '#employee-documents'], ['label' => 'Contracts', 'url' => '#employee-documents'], ], ], [ 'title' => 'Requests', 'subtitle' => 'Advance and retirement', 'icon' => 'fas fa-hand-holding-usd', 'theme' => 'teal', 'metric' => $metrics['openAdvances'], 'metricLabel' => 'open advances', 'url' => '#my-advances', 'actions' => [ ['label' => 'Request', 'url' => '#my-advances'], ['label' => 'Retire', 'url' => '#my-advances'], ], 'active' => $advanceModuleActive, ], ]; $employeeModuleCards = collect($employeeModuleCards) ->filter(fn ($card) => $card['active'] ?? true) ->values(); @endphp
Personal Dashboard

Welcome, {{ $employee?->full_name ?? auth()->user()?->name }}

Use the cards below to open a module. Detailed records can stay inside reports and registers.

{{ $metrics['pendingRequests'] }}
{{ count($announcements) }} active
{{ $metrics['attendanceThisMonth'] }} records
@foreach($employeeModuleCards as $card)
{{ $card['subtitle'] }}
{{ $card['title'] }}
{{ $card['metric'] }}
{{ $card['metricLabel'] }}
@endforeach
    @foreach($announcements as $announcement)
  • {{ $announcement }}
  • @endforeach
Leave requests {{ $metrics['pendingLeave'] }}
Timesheets awaiting review {{ $metrics['submittedTimesheets'] }}
Open advances {{ $metrics['openAdvances'] }}
@forelse($leaveBalances as $balance)
{{ number_format((float) $balance->remaining_days, 1) }} days
Used {{ number_format((float) $balance->used_days, 1) }} of {{ number_format((float) $balance->allocated_days, 1) }}
@empty
No balances allocated.
@endforelse
@php $leavePendingCount = $leaveRequests->whereIn('status', ['Submitted', 'Supervisor Approved'])->count(); $leaveApprovedCount = $leaveRequests->where('status', 'Approved')->count(); $leaveTakenCount = $leaveRequests->where('status', 'Taken')->count(); @endphp
Leave Management

Apply for leave, view balances, and track current approval status.

Leave Balance{{ number_format((float) $metrics['remainingLeave'], 1) }}
Pending{{ $leavePendingCount }}
Approved{{ $leaveApprovedCount }}
Taken{{ $leaveTakenCount }}
@csrf
@foreach($leaveBalances as $balance) @if($balance->leaveType) @endif @endforeach
{{ old('reason') }}
My Leave Register
@forelse($leaveRequests->take(5) as $leaveRequest) @php $leaveStatusTheme = match ($leaveRequest->status) { 'Approved' => 'success', 'Rejected' => 'danger', 'Cancelled' => 'secondary', 'Supervisor Approved' => 'warning', default => 'info', }; @endphp @empty @endforelse
Leave Type Dates Days Status Comments Actions
{{ $leaveRequest->leaveType->name ?? 'Leave' }}
Own request only
{{ $leaveRequest->start_date->format('M d') }} - {{ $leaveRequest->end_date->format('M d, Y') }} {{ number_format((float) $leaveRequest->days_requested, 1) }} {{ $leaveRequest->status }}
{{ $leaveRequest->reason ?? 'No comment' }}
@if(in_array($leaveRequest->status, ['Draft', 'Submitted', 'Supervisor Approved'], true))
@csrf
@else No action @endif
No leave requests yet.
@php $attendanceCompleteCount = $attendanceRecords->where('status', 'Present')->count(); $attendancePendingCorrections = $attendanceCorrections->where('status', 'Pending')->count(); @endphp
Attendance

Clock in, clock out, and request corrections when your attendance record needs review.

This Month{{ $metrics['attendanceThisMonth'] }}
Clock In{{ $todayAttendance?->clock_in ?? '--:--' }}
Clock Out{{ $todayAttendance?->clock_out ?? '--:--' }}
Corrections{{ $attendancePendingCorrections }}
Today
{{ today()->format('M d, Y') }}
{{ $todayAttendance?->clock_out ? 'Completed' : ($todayAttendance?->clock_in ? 'Clocked In' : 'Not Started') }}
@csrf
@csrf
GPS capture is optional and used only when the browser allows location access.
@csrf
{{ old('reason') }}
Recent Attendance
@forelse($attendanceRecords->take(5) as $record) @empty @endforelse
Date Clock In Clock Out Status
{{ $record->attendance_date->format('M d, Y') }} {{ $record->clock_in ?? '--:--' }} {{ $record->clock_out ?? '--:--' }} {{ $record->status }}
No attendance records yet.
@php $timesheetCount = $timesheets->count(); $submittedCount = $timesheets->where('status', 'Submitted')->count(); $approvedCount = $timesheets->where('status', 'Approved')->count(); $totalHours = $timesheets->sum(fn ($timesheet) => $timesheet->entries->sum('hours_worked')); @endphp
@if($timesheetModuleActive && $employee) @endif Attendance
{{ $timesheetCount }}
{{ $submittedCount }}
{{ $approvedCount }}
{{ number_format((float) $totalHours, 2) }}
@if($timesheetModuleActive && $employee)
@csrf
Record hours by project and activity. Timesheets are for records and project charging; they do not affect payroll.
@foreach($weekDays as $day) @endforeach @php $employeeTimesheetRows = old('entries', [[ 'project' => '', 'activity' => '', 'hours' => [], ]]); @endphp @foreach($employeeTimesheetRows as $row => $entryRow) @foreach($weekDays as $dayIndex => $day) @endforeach @endforeach @foreach($weekDays as $dayIndex => $day) @endforeach
Project Charged Activity Charged {{ $day->format('j') }}
{{ $day->format('D') }}
Action
Daily Totals0.00
@endif
Timesheet Register
@forelse($timesheets as $timesheet) @empty @endforelse
Employee Week Status Hours Actions
{{ $employee?->full_name ?? auth()->user()?->name }}
{{ $employee?->employee_number ?? 'Employee' }}
{{ $timesheet->period_start->format('M d') }} - {{ $timesheet->period_end->format('M d, Y') }} @if($timesheet->entries->isNotEmpty())
{{ $timesheet->entries->pluck('project')->unique()->take(2)->join(', ') }}
@endif
{{ $timesheet->status }} @if($timesheet->review_comment)
{{ $timesheet->review_comment }}
@endif
{{ number_format((float) $timesheet->entries->sum('hours_worked'), 2) }}
@forelse($timesheet->entries as $entry)
{{ $entry->project }} / {{ $entry->activity }} {{ number_format((float) $entry->hours_worked, 2) }} hrs
@empty No project/activity entries recorded. @endforelse
No timesheets yet.
@php $latestPayslip = $payslips->first(); $payrollNetTotal = $payslips->sum(fn ($payslip) => (float) ($payslip->item->net_salary ?? 0)); $payrollAllowanceTotal = $payslips->sum(fn ($payslip) => (float) ($payslip->item->total_allowances ?? 0)); $payrollDeductionTotal = $payslips->sum(fn ($payslip) => (float) ($payslip->item->total_deductions ?? 0)); $latestItem = $latestPayslip?->item; @endphp
Payroll & Payslips
View payslip history, salary breakdown, allowances, deductions, and PDF downloads.
{{ $payslips->count() }}
{{ number_format((float) ($latestPayslip?->item?->net_salary ?? 0), 2) }}
{{ number_format((float) $payrollAllowanceTotal, 2) }}
{{ number_format((float) $payrollDeductionTotal, 2) }}
Latest Payslip
@if($latestPayslip)
{{ $latestPayslip->payslip_number }}
{{ $latestItem?->run?->period?->name ?? $latestPayslip->generated_at?->format('M Y') }}
Download PDF
Basic Salary {{ number_format((float) ($latestItem?->basic_salary ?? 0), 2) }}
Allowances {{ number_format((float) ($latestItem?->total_allowances ?? 0), 2) }}
Deductions / Taxes {{ number_format((float) ($latestItem?->total_deductions ?? 0), 2) }}
Net Salary {{ number_format((float) ($latestItem?->net_salary ?? 0), 2) }}
@else
No latest payslip available.
@endif
Salary Breakdown
Gross Salary
{{ number_format((float) ($latestItem?->gross_salary ?? 0), 2) }}
Net Salary
{{ number_format((float) ($latestItem?->net_salary ?? 0), 2) }}
Allowances
{{ number_format((float) ($latestItem?->total_allowances ?? 0), 2) }}
Tax / Social Security / Deductions
{{ number_format((float) ($latestItem?->total_deductions ?? 0), 2) }}
Payslip Register
@forelse($payslips as $payslip) @empty @endforelse @if($payslips->isNotEmpty()) @endif
Payslip Period Basic Allowances Deductions Net Actions
{{ $payslip->payslip_number }}
{{ $payslip->generated_at?->format('M d, Y') }}
{{ $payslip->item->run->period->name ?? $payslip->generated_at?->format('M Y') }} {{ number_format((float) ($payslip->item->basic_salary ?? 0), 2) }} {{ number_format((float) ($payslip->item->total_allowances ?? 0), 2) }} {{ number_format((float) ($payslip->item->total_deductions ?? 0), 2) }} {{ number_format((float) ($payslip->item->net_salary ?? 0), 2) }} View Download PDF
No payslips generated.
Total Net Pay In View {{ number_format((float) $payrollNetTotal, 2) }}
@php $expiringDocumentsCount = $documents->filter(fn ($document) => $document->expires_at && $document->expires_at->isBetween(today(), today()->addDays(30), true))->count(); $expiredDocumentsCount = $documents->filter(fn ($document) => $document->expires_at && $document->expires_at->isPast())->count(); @endphp
Employee Documents

Personal files, contracts, HR policies, handbook, and training materials.

@if($employee) @endif
Personal Documents {{ $documents->count() }}
Contracts {{ $contracts->count() }}
Forms & Policies {{ count($hrForms) }}
Expiring Soon {{ $expiringDocumentsCount }}
@if($employee)
@csrf
@foreach($documentTypes as $type) @endforeach
@endif
Personal Document Register @if($expiredDocumentsCount > 0) {{ $expiredDocumentsCount }} expired @endif
@forelse($documents as $document) @php $documentStatus = 'Active'; $documentBadge = 'success'; if ($document->expires_at && $document->expires_at->isPast()) { $documentStatus = 'Expired'; $documentBadge = 'danger'; } elseif ($document->expires_at && $document->expires_at->lte(today()->addDays(30))) { $documentStatus = 'Expiring Soon'; $documentBadge = 'warning'; } @endphp @empty @endforelse
Document Type Expiry Status Action
{{ $document->title }}
Uploaded {{ $document->created_at?->format('M d, Y') }}
{{ $document->document_type }} {{ $document->expires_at?->format('M d, Y') ?? 'No expiry' }} {{ $documentStatus }} Download
No personal documents uploaded.
Employment Contracts
@forelse($contracts as $contract)
{{ $contract->status }}
{{ $contract->start_date->format('M d, Y') }} - {{ $contract->end_date->format('M d, Y') }}
@if($contract->signed_contract_path) Download @else Pending signature @endif
@empty
No contracts available.
@endforelse
HR Forms, Policies & Training
@foreach($hrForms as $key => $label) {{ $label }} @endforeach
@php $attentionNotifications = $notifications->filter(fn ($notification) => in_array($notification['badge'] ?? 'secondary', ['warning', 'danger'], true))->count(); $announcementCount = $notifications->where('category', 'Announcement')->count(); $payrollNotificationCount = $notifications->where('category', 'Payroll')->count(); $leaveNotificationCount = $notifications->where('category', 'Leave')->count(); @endphp
Employee Notifications

HR announcements, leave decisions, payslip alerts, contract reminders, and timesheet updates.

Dashboard
Total Notices {{ $notifications->count() }}
Leave Updates {{ $leaveNotificationCount }}
Payroll Alerts {{ $payrollNotificationCount }}
Needs Attention {{ $attentionNotifications }}
Notification Register
@forelse($notifications as $notification) @php $notificationTarget = match ($notification['category'] ?? '') { 'Leave' => '#leave-management', 'Payroll' => '#employee-payroll', 'Documents' => '#employee-documents', 'Timesheets' => '#self-service-timesheets', 'Advance' => '#my-advances', default => '#employee-dashboard', }; @endphp @empty @endforelse
Type Notification Date Status Action
{{ $notification['category'] ?? 'Notice' }} {{ $notification['title'] }}
{{ $notification['body'] }}
{{ $notification['date']?->format('M d, Y') ?? 'Today' }} {{ $notification['status'] ?? 'New' }} View
No notifications yet.
@if($advanceModuleActive) @php $advanceTotalRequested = $advances->sum(fn ($advance) => (float) $advance->amount_requested); $advanceOutstanding = $advances->sum(fn ($advance) => $advance->balanceDue()); $advanceAwaitingReview = $advances->whereIn('status', ['Submitted', 'Finance Review', 'Supervisor Recommended'])->count(); $advanceEvidenceRequired = $advances->filter(fn ($advance) => in_array($advance->status, ['Paid', 'Partially Retired'], true) && $advance->balanceDue() > 0)->count(); @endphp
Advance Request & Retirement

Request staff advances, track approval, and upload retirement evidence for finance review.

@can('advance.request') @if($employee) @endif @endcan
Total Requests {{ $advances->count() }}
Awaiting Review {{ $advanceAwaitingReview }}
Total Requested {{ number_format($advanceTotalRequested, 2) }}
Outstanding {{ number_format($advanceOutstanding, 2) }}
Workflow
Draft -> Submitted -> Supervisor Approval -> Approved -> Paid -> Retirement
Policy
Max {{ $advancePolicy->maximum_amount ? number_format((float) $advancePolicy->maximum_amount, 2) : 'not capped' }}
Retire within {{ $advancePolicy->default_retirement_days }} days.
@can('advance.request') @if($employee)
@csrf
@foreach($advancePolicy->categories ?? [] as $category) @endforeach
@php $advanceItemRows = old('items', [[ 'project' => '', 'activity' => '', 'item_requested' => '', 'number_of_days' => '', 'location' => '', 'start_date' => '', 'end_date' => '', 'rate_amount' => '', 'quantity' => 1, ]]); @endphp
@foreach($projectOptions as $projectOption) @endforeach @foreach($activityOptions as $activityOption) @endforeach
@foreach($advanceItemRows as $row => $itemRow) @endforeach
Project Activity Item Requested Days Location Start End Rate / Amount Qty Total Amount Action
{{ old('notes') }}
@endif @endcan
Request Register @if($advanceEvidenceRequired > 0) {{ $advanceEvidenceRequired }} need retirement evidence @else Own requests only @endif
@forelse($advances as $advance) @php $statusTheme = match ($advance->status) { 'Submitted' => 'info', 'Finance Review', 'Supervisor Recommended' => 'primary', 'Approved', 'Paid' => 'success', 'Partially Retired' => 'warning', 'Correction Required' => 'secondary', 'Retired' => 'dark', 'Rejected' => 'danger', default => 'secondary', }; $isRetirementOverdue = $advance->retirement_due_date && $advance->retirement_due_date->isPast() && ! in_array($advance->status, ['Retired', 'Rejected'], true); @endphp @empty @endforelse
Request Purpose Status Requested Approved Retired Balance Retirement Evidence
{{ $advance->request_number }}
Requested {{ $advance->requested_date->format('M d, Y') }}
{{ $advance->purpose }} @if($advance->category) {{ $advance->category }} @endif @if($advance->project)
{{ $advance->project }}
@endif @if($advance->items->isNotEmpty())
@foreach($advance->items->take(2) as $item)
{{ $item->item_requested }} {{ $item->project ? ' / '.$item->project : '' }} {{ $item->activity ? ' / '.$item->activity : '' }} {{ $item->location ? ' / '.$item->location : '' }} {{ number_format((float) $item->line_total, 2) }}
@endforeach @if($advance->items->count() > 2) +{{ $advance->items->count() - 2 }} more item(s) @endif
@endif
Requested by {{ $advance->requested_by_signature ?? $advance->requester?->name ?? 'Employee' }} @if($advance->requested_signed_at) on {{ $advance->requested_signed_at->format('M d, Y') }} @endif @if($advance->supervisor_signature)
Reviewed by {{ $advance->supervisor_signature }}{{ $advance->supervisor_signed_at ? ' on '.$advance->supervisor_signed_at->format('M d, Y') : '' }} @endif @if($advance->approved_by_signature)
Approved by {{ $advance->approved_by_signature }}{{ $advance->approved_signed_at ? ' on '.$advance->approved_signed_at->format('M d, Y') : '' }} @endif
{{ $advance->status }} {{ number_format((float) $advance->amount_requested, 2) }} {{ number_format((float) $advance->amount_approved, 2) }} {{ number_format((float) $advance->amount_retired, 2) }} {{ number_format($advance->balanceDue(), 2) }} @if($advance->retirement_due_date) Due {{ $advance->retirement_due_date->format('M d, Y') }} @else Set after approval @endif @if(in_array($advance->status, ['Paid', 'Partially Retired'], true)) @endif @forelse($advance->documents as $document) @empty @unless(in_array($advance->status, ['Paid', 'Partially Retired'], true)) Not required yet @else No evidence @endunless @endforelse
No advance requests yet.
@endif
@if($advanceModuleActive) @foreach($advances as $advance)
@csrf @foreach(['Receipt', 'Invoice', 'Payment Voucher', 'Approval Memo', 'Retirement Form', 'Other'] as $type) @endforeach
@endforeach @endif @stop