@php $canManageSubscription = ! session()->has('staff_id') && \App\Support\AdminAccess::canAction('settings', 'edit'); $currentPackage = $admin->package; $pendingRequest = $admin->pendingSubscriptionRequest; @endphp

{{ __('Subscription') }}

{{ __('Manage your current plan, see history, and switch to another package when needed.') }}

{{ __('Logged in as') }} {{ $admin->name }}
{{ __('Current Plan') }}
{{ __('Your active subscription snapshot') }}
@if ($currentPackage) {{ $currentPackage->isExpired() ? __('Expired') : __('Active') }} @else {{ __('None') }} @endif
@if ($currentPackage)
{{ $currentPackage->name }}
{{ $currentPackage->price_label }}
{{ __('Started') }} {{ $admin->activeSubscriptionHistory?->started_at?->format('d M Y') ?? $admin->created_at?->format('d M Y') }}
{{ __('Expires') }} {{ $currentPackage->expiry_label }}
{{ __('Duration') }} {{ $currentPackage->duration_label }}
@foreach ($currentPackage->limits_summary as $label => $value) {{ $label }}: {{ $value }} @endforeach
@else
{{ __('No package is currently assigned to this admin account.') }}
@endif
@if ($pendingRequest)
{{ __('Pending Request') }}
{{ __('Waiting for super admin approval before the package changes.') }}
{{ ucfirst($pendingRequest->status) }}
{{ __('Requested Package') }} {{ $pendingRequest->package_name }}
{{ __('Requested At') }} {{ $pendingRequest->requested_at?->format('d M Y, h:i A') }}
{{ __('Payment Ref') }} {{ $pendingRequest->payment_reference ?: __('Not provided') }}
{{ __('Payment Proof') }} @if ($pendingRequest->payment_proof_path) {{ __('View Proof') }} @else {{ __('Not provided') }} @endif
@endif
{{ __('Switch Package') }}
{{ __('Choose a package, add your payment reference, and send it for approval.') }}
{{ __('Add the reference of the payment you sent to the super admin.') }}
{{ __('Upload a screenshot, receipt image, or PDF. Max 5MB.') }}
@forelse ($packages as $package)
{{ $package->name }}
{{ $package->price_label }}
{{ ucfirst($package->status) }} @if ($currentPackage && (int) $currentPackage->id === (int) $package->id)
{{ __('Current') }}
@endif
{{ $package->description ?: __('No description added.') }}
{{ __('Validity') }} {{ $package->duration_label }}
{{ __('Modules') }} {{ count($package->modules ?? []) }}
{{ __('Admins') }} {{ $package->admins_count }}
@foreach ($package->limits_summary as $label => $value) {{ $label }}: {{ $value }} @endforeach
@empty
{{ __('No packages matched your search.') }}
@endforelse
{{ __('Subscription History') }}
{{ __('Each row shows when a plan started, ended, and what was active at the time.') }}
@forelse ($history as $record) @empty @endforelse
{{ __('Package') }} {{ __('Started') }} {{ __('Ended') }} {{ __('Price Snapshot') }} {{ __('Status') }}
{{ $record->package_name }}
@if ($record->previousPackage) {{ __('Upgraded from') }} {{ $record->previousPackage->name }} @else {{ __('Initial assignment') }} @endif
{{ $record->started_at?->format('d M Y, h:i A') }} {{ $record->ended_at?->format('d M Y, h:i A') ?: __('Still active') }} {{ $record->package_price !== null ? 'PKR ' . number_format((float) $record->package_price, 2) : __('Free') }} {{ $record->ended_at ? __('Closed') : __('Active') }}
{{ __('No subscription history found yet.') }}