URA SACCOS Users Activity Report

Generated on: {{ $generated_at }}

Generated by: {{ $generated_by }}

Summary Statistics

{{ number_format($total_count) }}
Total Users
{{ number_format($users->where('status', 'active')->count()) }}
Active Users
{{ number_format($users->where('last_login', '>=', now()->subDays(7))->count()) }}
Active This Week

Detailed User Activity

@foreach($users as $index => $user) @if(($index + 1) % 25 == 0 && $index + 1 < $total_count)
Name Email Phone Branch Department Role Status Last Login Attempts Created
{{ Str::limit($user->name, 20) }} {{ Str::limit($user->email, 25) }} {{ $user->phone_number }} {{ Str::limit($user->branch->name ?? 'N/A', 15) }} {{ Str::limit($user->department->name ?? 'N/A', 15) }} {{ Str::limit($user->roles->first()->name ?? 'N/A', 10) }} {{ $user->status === 'active' ? 'Active' : 'Inactive' }} {{ $user->last_login ? $user->last_login->format('m/d H:i') : 'Never' }} {{ $user->login_attempts }} {{ $user->created_at->format('m/d/y') }}
@endif @endforeach
Name Email Phone Branch Department Role Status Last Login Login Attempts Created

Activity Analysis

Key Insights:

@php $departmentStats = $users->groupBy('department.name')->map(function($deptUsers) { return [ 'total' => $deptUsers->count(), 'active' => $deptUsers->where('status', 'active')->count(), 'recent' => $deptUsers->where('last_login', '>=', now()->subDays(7))->count() ]; }); @endphp @if($departmentStats->count() > 0)

Department Breakdown:

@foreach($departmentStats as $deptName => $stats) @endforeach
Department Total Users Active Users Recent Activity Activity Rate
{{ $deptName ?: 'Unassigned' }} {{ $stats['total'] }} {{ $stats['active'] }} {{ $stats['recent'] }} {{ $stats['total'] > 0 ? number_format(($stats['recent'] / $stats['total']) * 100, 1) : 0 }}%
@endif