@extends('layouts.admin') @section('title', $user->name) @section('page-title', 'User Profile') @section('content')
{{ strtoupper(substr($user->name, 0, 1)) }}

{{ $user->name }}

{{ $user->email }}

{{ ucfirst($user->currentPlan()) }} {{ $user->is_banned ? 'Banned' : 'Active' }}
@csrf @method('DELETE')

Business

{{ $user->business_name ?: 'Not set' }}

Phone

{{ $user->phone ?: 'Not set' }}

Storage

{{ number_format(($user->storage_used_bytes ?? 0) / 1048576, 2) }} MB

Country

{{ $user->country_code ?: 'Not set' }}

Currency

{{ $user->currency_code ?: 'Not set' }}

Last Seen

{{ $user->last_seen_at?->diffForHumans() ?? 'Never' }}

Change Plan

Override plan and optional expiry from the admin panel.

@csrf
@if($user->is_banned)
@csrf
@else
@csrf
@endif Back to Users
{{-- Sync Activity --}}

Sync Activity

Sync history for this user.

View Logs

Syncs Today

{{ number_format($syncStats['today']) }}

Total Syncs

{{ number_format($syncStats['total']) }}

Failed

{{ number_format($syncStats['failed']) }}

Last Sync

{{ $syncStats['last_sync'] ? \Carbon\Carbon::parse($syncStats['last_sync'])->diffForHumans() : 'Never' }}

{{-- Module Data Counts --}}

Module Data Counts

Records synced from this user's device(s).

@foreach($dataCounts as $module => $count)

{{ ucfirst($module) }}

{{ number_format($count) }}

@endforeach
{{-- Synced Media --}} @if($userImages->isNotEmpty() || $userPdfs->isNotEmpty())

Synced Media

@if($userImages->isNotEmpty())

Images ({{ $userImages->count() }})

@foreach($userImages as $img) {{ $img->table_ref }} @endforeach
@endif @if($userPdfs->isNotEmpty())

PDFs ({{ $userPdfs->count() }})

@foreach($userPdfs as $pdf)

{{ basename($pdf->file_path) }}

{{ $pdf->table_ref }} · {{ number_format($pdf->size_bytes / 1024, 1) }} KB · {{ $pdf->created_at->format('d M Y') }}

Download
@endforeach
@endif
@endif

Recent Subscriptions

@forelse($user->subscriptions as $subscription)

{{ ucfirst($subscription->plan) }} · {{ ucfirst($subscription->source) }}

{{ ucfirst($subscription->period ?: 'custom') }} · {{ $subscription->starts_at?->format('d M Y') ?: 'Unknown start' }}

@if($subscription->source === 'crypto' && ($subscription->payment_status ?? '') === 'pending') 🕐 Pending @elseif($subscription->source === 'crypto' && ($subscription->payment_status ?? '') === 'rejected') Rejected @elseif(($subscription->payment_status ?? '') === 'cancelled') Cancelled @elseif($subscription->isExpired() || !$subscription->is_active) Expired @else Active @endif
Amount: {{ strtoupper($subscription->currency ?: 'USD') }} {{ number_format($subscription->amount_paid ?? 0, 2) }} @if($subscription->expires_at) · Expires {{ $subscription->expires_at->format('d M Y') }} @endif
@empty
No subscriptions found.
@endforelse

Registered Devices

@forelse($user->devices as $device)

{{ strtoupper($device->platform ?: 'N/A') }} · {{ $device->model ?: 'Unknown device' }}

{{ $device->device_id }}

{{ $device->is_revoked ? 'Revoked' : 'Active' }}
Last sync: {{ $device->last_sync_at?->diffForHumans() ?? 'Never' }}
@empty
No devices found.
@endforelse
{{-- Staff Members --}}

Staff Members

Manage staff for this POS. PINs are set on-device for security.

{{ $user->staffUsers->count() }}
@if (session('success'))
{{ session('success') }}
@endif
@forelse($user->staffUsers as $staff)

{{ $staff->name }}

{{ ucfirst($staff->role) }}

{{ $staff->is_active ? 'Active' : 'Inactive' }}
@csrf @method('PUT')
@csrf @method('DELETE')
@empty
No staff members yet. Add one below.
@endforelse

Add Staff Member

@csrf
@endsection