@php $appName = config('settings.app_name', 'Innovaxcess Attendance'); $favicon = config('settings.favicon'); $logo = config('settings.logo'); $theme = config('settings.theme', 'light'); $primaryColor = config('settings.primary_color', '#3b82f6'); $secondaryColor = config('settings.secondary_color', '#6b7280'); // Get stats for dashboard $stats = [ 'totalDepartments' => \App\Models\Department::count(), 'totalUsers' => \App\Models\User::count(), 'activeUsers' => \App\Models\User::where('status', 'active')->count(), 'inactiveUsers' => \App\Models\User::where('status', 'inactive')->count(), 'totalClients' => \App\Models\Client::count(), 'totalVisits' => \App\Models\Visit::count(), 'completedVisits' => \App\Models\Visit::where('status', 'completed')->count(), 'pendingVisits' => \App\Models\Visit::where('status', 'pending')->count(), 'pendingLeaves' => \App\Models\LeaveRequest::where('status', 'pending')->count(), 'approvedLeaves' => \App\Models\LeaveRequest::where('status', 'approved')->count(), 'rejectedLeaves' => \App\Models\LeaveRequest::where('status', 'rejected')->count(), 'totalPayrolls' => \App\Models\Payroll::count(), 'processedPayrolls' => \App\Models\Payroll::where('status', 'completed')->count(), ]; // Data for pie charts $userStatusData = [ ['status' => 'Active', 'count' => $stats['activeUsers'], 'color' => '#10B981'], ['status' => 'Inactive', 'count' => $stats['inactiveUsers'], 'color' => '#EF4444'] ]; $visitStatusData = [ ['status' => 'Completed', 'count' => $stats['completedVisits'], 'color' => '#10B981'], ['status' => 'Pending', 'count' => $stats['pendingVisits'], 'color' => '#F59E0B'] ]; $leaveStatusData = [ ['status' => 'Approved', 'count' => $stats['approvedLeaves'], 'color' => '#10B981'], ['status' => 'Pending', 'count' => $stats['pendingLeaves'], 'color' => '#F59E0B'], ['status' => 'Rejected', 'count' => $stats['rejectedLeaves'], 'color' => '#EF4444'] ]; @endphp @yield('title', 'Innovaxcess Attendance') @if($favicon) @endif @stack('styles')
@if(session('success'))

{{ session('success') }}

@endif @if(session('error'))

{{ session('error') }}

@endif @yield('content') @if(!isset($content) && request()->routeIs('dashboard'))

System Statistics

Total Users

{{ $stats['totalUsers'] }}

{{ $stats['activeUsers'] }} active{{ $stats['inactiveUsers'] }} inactive

Departments

{{ $stats['totalDepartments'] }}

Organizational units

Clients

{{ $stats['totalClients'] }}

Business partners

Total Visits

{{ $stats['totalVisits'] }}

{{ $stats['completedVisits'] }} completed{{ $stats['pendingVisits'] }} pending

Data Visualization

User Status Distribution

@foreach($userStatusData as $item)
{{ $item['status'] }}
{{ $item['count'] }}
@endforeach

Visit Status Distribution

@foreach($visitStatusData as $item)
{{ $item['status'] }}
{{ $item['count'] }}
@endforeach

Leave Request Status

@foreach($leaveStatusData as $item)
{{ $item['status'] }}
{{ $item['count'] }}
@endforeach

Recent Visits

View All
@php $recentVisits = \App\Models\Visit::with(['user', 'client']) ->latest() ->take(8) ->get(); @endphp @forelse($recentVisits as $visit)

{{ $visit->client->name ?? 'Unknown Client' }}

{{ $visit->user->name }} • {{ $visit->visit_date->format('M d, Y') }} • {{ $visit->visit_time }}

{{ ucfirst($visit->status) }}

{{ $visit->created_at->diffForHumans() }}

@empty

No recent visits found.

Start by creating your first visit.

@endforelse
@endif