@extends('admin.layouts.app')
@section('title',get_setting('site_name').' | Admin Dashboard')
@section('content')
@if(\App\Support\BranchWiseFeature::missingBranchAssignment())
{{ __('Your branch is not assigned. Contact HQ admin to assign a warehouse/branch.') }}
@endif
@php
$todayAtt = $attDate ?? now()->toDateString();
$dashboardStatRoutes = [
'total' => route('staffs.index'),
'active' => route('staffs.index'),
'inactive' => route('inactive.staffs'),
'present' => route('dashboard', ['att_date' => $todayAtt, 'daily_status' => 'P']).'#daily-attendance',
'absent' => route('dashboard', ['att_date' => $todayAtt, 'daily_status' => 'A']).'#daily-attendance',
'movement' => auth()->user()?->can('Visit-list')
? route('admin.visit.application', ['movement_date' => $todayAtt, 'status' => '1'])
: null,
'leave' => route('dashboard', ['att_date' => $todayAtt, 'daily_status' => 'L']).'#daily-attendance',
'late' => route('dashboard', ['att_date' => $todayAtt, 'daily_status' => 'D']).'#daily-attendance',
'Extra late' => route('dashboard', ['att_date' => $todayAtt, 'daily_status' => 'E']).'#daily-attendance',
];
$inactiveSettlementPendingTotal = (int) ($statsInactiveSettlementPending['total'] ?? 0);
@endphp
@foreach([
['key' => 'total', 'label' => __('Total Employee'), 'icon' => 'fas fa-users', 'color' => 'text-dark', 'data' => $statsTotal],
['key' => 'active', 'label' => __('Active Employee'), 'icon' => 'fas fa-user-check', 'color' => 'text-success', 'data' => $statsActiveEmployees],
['key' => 'inactive', 'label' => __('Inactive Employee'), 'icon' => 'fas fa-user-slash', 'color' => 'text-danger', 'data' => $statsInactiveEmployees],
['key' => 'present', 'label' => __('Present'), 'icon' => 'fas fa-user-check', 'color' => 'text-success', 'data' => $statsPresent],
['key' => 'absent', 'label' => __('Absent'), 'icon' => 'fas fa-user-slash', 'color' => 'text-danger', 'data' => $statsAbsent],
['key' => 'movement', 'label' => __('Movement'), 'icon' => 'fas fa-running', 'color' => 'text-info', 'data' => $statsMovement],
['key' => 'leave', 'label' => __('Leave'), 'icon' => 'fas fa-procedures', 'color' => 'text-stat-leave', 'data' => $statsLeave],
['key' => 'late', 'label' => __('Late'), 'icon' => 'fas fa-clock', 'color' => 'text-warning', 'data' => $statsLate],
['key' => 'Extra late', 'label' => __('Extra Late'), 'icon' => 'fas fa-clock', 'color' => 'text-primary', 'data' => $statsExtra],
] as $stat)
@php $statRoute = $dashboardStatRoutes[$stat['key']] ?? null; @endphp
@endforeach
@foreach($fundLoanCards as $loanCard)
@endforeach
@if(!empty($moduleMiniCards) || !empty($probationaryStaffCard))