@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')
@yield('title', 'Dashboard')
@if(!request()->routeIs('dashboard'))
@yield('subtitle', '')
@endif
{{ now()->format('F d, Y') }}
{{ now()->format('h:i A') }}
Notifications
You have 3 new notifications
{{ Auth::user()->name }}
{{ Auth::user()->email }}
@if(session('success'))
@endif
@if(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)
@endforeach
Visit Status Distribution
@foreach($visitStatusData as $item)
@endforeach
Leave Request Status
@foreach($leaveStatusData as $item)
@endforeach
@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