@extends('layouts.app') @section('content')

User Details

@can('manage-users') Edit @endcan Back
{{ substr($user->username, 0, 1) }}
{{ $user->username }}

{{ $user->email }}

@if($user->id === auth()->id()) Your Account @endif
Username: {{ $user->username }}
Email: {{ $user->email }}
Phone: {{ $user->phone ?? 'N/A' }}
Role: {{ $user->role_name }}
Status: @if($user->is_active) Active @else Inactive @endif
Last Login: @if($user->last_login_at) {{ $user->last_login_at->format('M d, Y H:i') }} @else Never @endif
Created: {{ $user->created_at->format('M d, Y') }}
Last Updated: {{ $user->updated_at->format('M d, Y') }}
@if($user->profile)
{{ $user->isTeacher() ? 'Teacher' : 'Student' }} Profile View Full Profile
@if($user->isTeacher() && $user->teacher)
Employee Code: {{ $user->teacher->employee_code }}
Department: {{ $user->teacher->department ?? 'N/A' }}
Join Date: {{ $user->teacher->joined_at ? $user->teacher->joined_at->format('M d, Y') : 'N/A' }}
Active Subjects: {{ $user->teacher->classes->where('active', true)->count() }}
@elseif($user->isStudent() && $user->student)
Student ID: {{ $user->student->student_id }}
Batch: {{ $user->student->batch->name ?? 'N/A' }}
Enrollment Date: {{ $user->student->enrolled_at ? $user->student->enrolled_at->format('M d, Y') : 'N/A' }}
Status: {{ $user->student->status }}
@endif
@endif
Recent Activity
View All Logs
@if($user->auditLogs->count() > 0)
@foreach($user->auditLogs as $log)
{{ $log->action }} {{ $log->created_at->diffForHumans() }}
{{ $log->description }} @if($log->ip_address)
IP: {{ $log->ip_address }} @endif
@endforeach
@else

No recent activity found.

@endif
Statistics
Account Age: {{ $user->created_at->diffForHumans(null, true) }}
Activity Logs: {{ $user->auditLogs->count() }}
@if($user->isTeacher() && $user->teacher)
Classes Taken: {{ $user->teacher->classes->count() }}
Assignments Created: Active Subjects: {{ $user->teacher->classes?->where('active', true)->count() ?? 0 }}
@elseif($user->isStudent() && $user->student)
Assignments Submitted: {{ $user->student->assignmentSubmissions ? $user->student->assignmentSubmissions->count() : 'N/A' }}
Attendance Rate: 85%
@endif
Quick Actions
@if($user->id !== auth()->id())
@csrf
@csrf
@endif @if($user->profile) View {{ $user->isTeacher() ? 'Teacher' : 'Student' }} Profile @endif View Activity Logs
@endsection