@section('page-title', 'WHM Account Sync')
WHM Server Status & Sync
@if(!$servers->isEmpty())
@csrf
@endif @if(\App\Models\WhmAccount::exists())
@csrf
@endif
@if(session('success')) @endif @if(session('error')) @endif @if($servers->isEmpty())

No active WHM Servers available. Activate servers in the Servers page first.

@else
@foreach($servers as $server)
{{ $server->name }}
{{ $server->hostname }}
Status: Active
Sync: {{ $server->enable_sync ? 'Enabled' : 'Disabled' }}
@csrf
@endforeach
@endif
WHM Account Assignment & Mapping

List of all synchronized WHM accounts. Unassigned accounts are highlighted in yellow. Link them to a client to assign them to your core Billing/Hosting system.

@if($whmAccounts->isEmpty())
No accounts synced yet

Run "Sync All Servers" or "Fetch & Sync Now" above to load WHM account records.

@else
@foreach($whmAccounts as $acc) @php $isUnassigned = is_null($acc->local_client_id); @endphp @endforeach
Domain WHM Username WHM Server WHM Package Client Link Status
{{ $acc->domain }} {{ $acc->username }} {{ $acc->server->name }} {{ $acc->package }} @if($isUnassigned)
@csrf
@else
Assigned: {{ $acc->client->name ?? 'Client #' . $acc->local_client_id }}
@csrf
@endif
@endif