@extends('backend.layout.exposcale')
@section('page_title', 'Ad Accounts')
@section('topbar_actions')
9 accounts
@endsection
@section('content')
| Account Name | Platform | Client Fee | Fee | Currency | Balance โ | Status | Actions |
@forelse($accounts as $account)
@php
$name = $account->account_name ?? $account->alias_name ?? '';
$id = $account->external_id ?? '';
$status = strtolower($account->status ?? 'processing');
$platformName = $account->account_platform ?? 'Meta Ads';
// Determine Gradyn vs Rockads using the provider column
$platType = $account->provider ?? 'gradyn';
$platLetter = $platType === 'rockads' ? 'R' : 'G';
$mdotLetter = $platType === 'rockads' ? 'R' : 'M';
$platClass = $platType === 'rockads' ? 'acct-plat-r' : 'acct-plat-g';
$mdotStyle = $platType === 'rockads' ? 'style="background:linear-gradient(135deg,#3b82f6,#60a5fa);"' : '';
$feeColor = $platType === 'rockads' ? 'var(--rockads)' : 'var(--gradyn)';
$clientFee = '4.00%'; // fallback / dummy
$actualFee = $platType === 'rockads' ? '2.5%' : '1.5%'; // fallback / dummy
$currency = $account->currency ?? 'USD';
$balance = (float) ($account->balance ?? 0);
$statusClass = 'bpend';
$statusIcon = 'โณ';
$statusText = 'Processing';
if (in_array($status, ['approved', 'active', 'ACTIVE', 'accepted'])) {
$statusClass = 'ba';
$statusIcon = 'โ';
$statusText = 'Approved';
} elseif (in_array($status, ['disabled', 'suspended', 'inactive'])) {
$statusClass = 'br';
$statusIcon = 'โ';
$statusText = 'Disabled';
} elseif ($status === 'deleted') {
$statusClass = 'br';
$statusIcon = '๐';
$statusText = 'Deleted';
}
@endphp
{{ $mdotLetter }}
@if(in_array($status, ['disabled', 'suspended', 'deleted']))
{{ $name }}
@else
{{ $name }}
@endif
|
{{ $platLetter }}{{ $platformName }}
|
{{ $clientFee }} |
{{ $actualFee }} |
{{ $currency }} |
{{ $currency === 'USD' ? '$' : 'โฌ' }}{{ number_format($balance, 2) }}
|
{{ $statusIcon }} {{ $statusText }}
|
|
@empty
| No ad accounts found. |
@endforelse
@if($pagination['last_page'] > 1)
@endif
Account Activity
โ entries
{{-- Account dropdown - built from $allAccounts passed by index() --}}
{{-- Type dropdown --}}
{{-- Currency dropdown - client-side filter over loaded rows --}}
| Reference | Account | Platform | Type | Amount | Fee | Description | Date |
| Loading activity... |
{{-- Activity Pagination --}}
@endsection
@section('page_scripts')
@endsection