{{-- resources/views/admin/user-management/show.blade.php --}} @extends('admin.layouts.app') @section('title', 'User Details - ' . $user->name) @section('page-title', 'User Details') @section('page-description', 'Comprehensive view of user account, activities, and statistics.') @php $breadcrumbs = [ ['title' => 'Users', 'url' => route('admin.users.index')], ['title' => $user->name] ]; @endphp @section('content')

Trips Created

{{ $user->createdTrips->count() }}

Savings Wallets

{{ $user->savingsWallets->count() }}

Total Savings

{{ $user->currency }}{{ number_format($user->total_savings ?? 0, 2) }}

Transactions

{{ $user->walletTransactions->count() }}

@if($user->profile_photo_path) {{ $user->name }} @else
{{ $user->initials }}
@endif

{{ $user->name }}

{{ $user->email }}

@php $statusColors = [ 'active' => 'bg-green-100 text-green-800', 'inactive' => 'bg-gray-100 text-gray-800', 'suspended' => 'bg-red-100 text-red-800' ]; @endphp {{ ucfirst($user->account_status) }} @if($user->isAdmin()) {{ ucfirst($user->admin_role) }} @endif
@if($user->id !== auth()->id()) @endif

Account Information

Account Number: {{ $user->account_number }}
Phone: {{ $user->phone_number ?? 'Not provided' }}
Date of Birth: {{ $user->date_of_birth ? $user->date_of_birth->format('M j, Y') : 'Not provided' }}
Gender: {{ $user->gender ? ucfirst($user->gender) : 'Not provided' }}
Nationality: {{ $user->nationality ?? 'Not provided' }}
Currency: {{ $user->currency }}
Account Type: {{ ucfirst($user->account_type) }}
Payment Method: {{ ucfirst(str_replace('_', ' ', $user->preferred_payment_method)) }}
Daily Limit: {{ $user->currency }}{{ number_format($user->daily_transaction_limit ?? 0, 2) }}
Joined: {{ $user->created_at->format('M j, Y') }}
Last Activity: {{ $user->updated_at->format('M j, Y') }}
Email Verified:
@if($user->email_verified_at) Verified
{{ $user->email_verified_at->format('M j, Y') }}
@else Not Verified @endif

Recent Trips

@if($user->createdTrips->count() > 5) Showing 5 of {{ $user->createdTrips->count() }} trips @endif
@if($user->createdTrips->count() > 0)
@foreach($user->createdTrips->take(5) as $trip) @endforeach
Trip Destination Dates Status Budget Actions
{{ $trip->title }}
@if($trip->is_featured) Featured @endif
{{ $trip->destination }} {{ $trip->start_date->format('M j') }} - {{ $trip->end_date->format('M j, Y') }} @php $tripStatusColors = [ 'active' => 'bg-green-100 text-green-800', 'completed' => 'bg-blue-100 text-blue-800', 'cancelled' => 'bg-red-100 text-red-800', 'pending' => 'bg-yellow-100 text-yellow-800' ]; @endphp {{ ucfirst($trip->status) }} {{ $trip->budget ? $user->currency . number_format($trip->budget, 2) : 'N/A' }}
@else

No trips created yet.

@endif

Savings Wallets

@if($user->savingsWallets->count() > 3) Showing 3 of {{ $user->savingsWallets->count() }} @endif
@if($user->savingsWallets->count() > 0)
@foreach($user->savingsWallets->take(3) as $wallet)
{{ $wallet->name['en'] ?? $wallet->name }}
@if($wallet->admin_flagged) Flagged @endif
Goal: {{ $wallet->currency }}{{ number_format($wallet->target_amount, 2) }} Current: {{ $wallet->currency }}{{ number_format($wallet->current_amount, 2) }}
{{ $wallet->progress_percentage }}% complete View Details
@endforeach
@else

No savings wallets created yet.

@endif

Recent Transactions

@if($user->walletTransactions->count() > 5) Showing 5 of {{ $user->walletTransactions->count() }} @endif
@if($user->walletTransactions->count() > 0)
@foreach($user->walletTransactions->take(5) as $transaction)
@if($transaction->type === 'deposit')
@else
@endif

{{ ucfirst($transaction->type) }}

{{ $transaction->created_at->format('M j, Y g:i A') }}

{{ $user->currency }}{{ number_format($transaction->amount, 2) }}

@php $transactionStatusColors = [ 'completed' => 'bg-green-100 text-green-800', 'pending' => 'bg-yellow-100 text-yellow-800', 'failed' => 'bg-red-100 text-red-800' ]; @endphp {{ ucfirst($transaction->status) }}
@endforeach
@else

No transactions found.

@endif
@endsection