@extends('layouts.admin') @section('title', 'User Profile Analytics') @section('content')

User Profile Analytics

Detailed analytics for {{ $user->name ?? 'User' }}

{{ substr($user->name ?? 'U', 0, 1) }}

{{ $user->name ?? 'User Name' }}

{{ $user->email ?? 'No email' }}

{{ $user->role ?? 'Student' }} Joined {{ $user->created_at ? $user->created_at->format('M d, Y') : 'Unknown' }}

{{ $analytics['activity_score'] ?? '0' }}%

Activity Score

{{ $analytics['total_events'] ?? '0' }}

Events Attended

Login Sessions

{{ $analytics['total_logins'] ?? '0' }}

+{{ $analytics['login_growth'] ?? '0' }}% this month
Events Registered

{{ $analytics['registered_events'] ?? '0' }}

{{ $analytics['attendance_rate'] ?? '0' }}% attendance
Applications

{{ $analytics['total_applications'] ?? '0' }}

{{ $analytics['approved_applications'] ?? '0' }} approved
Total Payments

${{ number_format($analytics['total_payments'] ?? 0, 2) }}

{{ $analytics['payment_count'] ?? '0' }} transactions
Activity Timeline
Engagement Breakdown
Events
{{ $analytics['event_engagement'] ?? '0' }}%
Applications
{{ $analytics['application_engagement'] ?? '0' }}%
Payments
{{ $analytics['payment_engagement'] ?? '0' }}%
Recent Events
@forelse($recentEvents ?? [] as $event)
{{ $event->title ?? 'Event Title' }}

{{ $event->attended ? 'Attended' : 'Registered' }} • {{ $event->date ? $event->date->format('M d, Y') : 'Date TBD' }}

@if($event->attended) Attended @else Registered @endif
@empty
No recent events
@endforelse
Recent Applications
@forelse($recentApplications ?? [] as $application)
{{ $application->type ?? 'Application' }}

Submitted {{ $application->created_at ? $application->created_at->format('M d, Y') : 'recently' }}

@if($application->status == 'approved') Approved @elseif($application->status == 'pending') Pending @else Rejected @endif
@empty
No recent applications
@endforelse
Login History
@if($loginHistory->isNotEmpty())
@foreach($loginHistory as $session) @endforeach
Date & Time IP Address Device Location Duration Status
{{ $session->created_at ? $session->created_at->format('M d, Y H:i') : 'Unknown' }} {{ $session->ip_address ?? 'Unknown' }} {{ $session->user_agent ?? 'Unknown Device' }} {{ $session->location ?? 'Unknown' }} {{ $session->duration ?? 'Active' }} @if($session->is_active) Active @else Ended @endif
@else
No login history available
@endif
@if($loginHistory->isNotEmpty()) @endif
@endsection @section('scripts') @endsection