@extends('backend.layout.exposcale') @section('page_title', 'Ad Account — ' . ($adAccount->account_name ?? $adAccount->alias_name ?? $externalId)) @section('content') @php $name = $adAccount->account_name ?? $adAccount->alias_name ?? $externalId; $currency = $adAccount->currency ?? 'USD'; $balance = (float)($adAccount->balance ?? 0); $provider = $adAccount->provider ?? 'gradyn'; $platform = strtolower($adAccount->account_platform ?? 'meta'); $statusRaw = strtolower($adAccount->status ?? 'processing'); $statusMap = ['approved'=>'ba','active'=>'ba','accepted'=>'ba','disabled'=>'br','suspended'=>'br','deleted'=>'br']; $statusCls = $statusMap[$statusRaw] ?? 'bpend'; $statusTxt = match($statusMap[$statusRaw] ?? 'bpend') { 'ba' => 'Approved', 'br' => in_array($statusRaw,['deleted']) ? 'Deleted' : 'Disabled', default => 'Processing', }; $platIcons = ['meta'=>'M','google'=>'G','tiktok'=>'T','snapchat'=>'S','twitter'=>'X','linkedin'=>'L']; $platIcon = $platIcons[$platform] ?? 'M'; $platLabel = ucfirst($platform); $sym = $currency === 'EUR' ? '€' : '$'; $isActive = in_array($statusRaw, ['approved','active','accepted']); // Owner $owner = $adAccount->user; $hasOwner = !is_null($adAccount->user_id); $ownerName = $owner ? trim(($owner->first_name ?? '').' '.($owner->last_name ?? '')) : null; $ownerInitials = $owner ? strtoupper(substr($owner->first_name ?? '?',0,1).substr($owner->last_name ?? '',0,1)) : '?'; @endphp
← Ad Accounts
{{ $platIcon }}
{{ $name }}
Currency: {{ $currency }}
Balance
{{ $sym }}{{ number_format($balance, 2) }}
Status
{{ $statusTxt }}
Platform
{{ $platLabel }}
Provider
{{ $provider === 'rockads' ? 'Rockads' : 'Gradyn' }}
Top-ups
↑—
Account Owner
{{ $ownerInitials }}
{{ $hasOwner ? ($ownerName ?: $owner->email) : 'Not assigned' }}
{{ $hasOwner ? $owner->email : '—' }}
Quick Stats
Total Topped Up
—
Total Withdrawn
—
Transactions
—
Transaction History Loading…
Reference Amount Fee Date Description Type Status
Loading transactions…
@endsection @section('page_scripts') @endsection