@section('page-title', 'Executive Reporting Dashboard')

📊 Executive Reporting Dashboard

Comprehensive operational, financial, and renewal overview of WHMC

{{-- 1. KPI Cards (Top of Screen) --}}
{{-- Total Clients --}}
Total Clients

{{ number_format($totalClientsCount) }}

{{-- Active Domains --}}
Active Domains

{{ number_format($activeDomainsCount) }}

{{-- Active Hosting --}}
Active Hosting

{{ number_format($activeHostingCount) }}

{{-- Outstanding Balance --}}
Outstanding Balance

{{ number_format($outstandingBalance, 2) }} TZS

{{-- Renewals Next 30 Days --}}
Renewals 30 Days

{{ $renewalsNext30Days }}

{{-- Pending Reminders --}}
Pending Reminders

{{ $pendingReminders }}

{{-- Emails Sent Today --}}
Emails Sent Today

{{ $emailsSentToday }}

{{-- Unpaid Invoices --}}
Unpaid Invoices

{{ $unpaidInvoicesCount }}

{{-- Expired Services --}}
Expired Services

{{ $expiredServicesCount }}

{{-- Revenue This Month --}}
Revenue This Month

{{ number_format($revenueThisMonth, 2) }} TZS

{{-- Servers Online --}}
Servers Online

{{ $serversOnlineCount }} / {{ $serversTotalCount }}

{{-- Collection Rate --}}
Collection Rate

{{ $collectionRate }}%

{{-- 2. Action Required Section (🔴 Alerts) --}} @php $hasAlerts = $actionRequired['domains_expiring_today']->isNotEmpty() || $actionRequired['hosting_expiring_today']->isNotEmpty() || $actionRequired['overdue_invoices']->isNotEmpty() || $actionRequired['failed_reminders']->isNotEmpty() || $actionRequired['suspended_accounts']->isNotEmpty() || $actionRequired['servers_offline']->isNotEmpty(); @endphp @if($hasAlerts)
Action Required
{{-- Offline Servers --}} @foreach($actionRequired['servers_offline'] as $srv)
Server Offline: {{ $srv->name }} ({{ $srv->ip_address }})
@endforeach {{-- Domains Expiring Today --}} @foreach($actionRequired['domains_expiring_today'] as $dom)
Domain Expiring Today: {{ $dom->domain_name }}
@endforeach {{-- Hosting Expiring Today --}} @foreach($actionRequired['hosting_expiring_today'] as $host)
Hosting Expiring Today: {{ $host->primary_domain }}
@endforeach {{-- Overdue Invoices --}} @foreach($actionRequired['overdue_invoices'] as $inv) @endforeach {{-- Failed Reminders --}} @foreach($actionRequired['failed_reminders'] as $rem)
Reminder Failed: to {{ $rem->client->name ?? 'Client' }} on {{ $rem->sent_date }}
@endforeach {{-- Suspended Hosting Accounts --}} @foreach($actionRequired['suspended_accounts'] as $host)
Suspended Hosting: {{ $host->primary_domain }}
@endforeach
@endif {{-- 3. Metrics Tables Grid --}}
{{-- Executive & Financial Summary --}}
Executive & Financial Summary
Total Active Clients {{ $execSummary['total_clients'] }}
Active / Registered Domains {{ $execSummary['active_services'] }} Active / {{ $execSummary['total_domains'] }} Total
Total Hosting Accounts {{ $execSummary['total_hostings'] }}
Suspended Services {{ $execSummary['suspended_services'] }}
Revenue Collected (Yearly / Monthly) {{ number_format($revenueThisYear, 2) }} / {{ number_format($revenueThisMonth, 2) }} TZS
Paid / Unpaid Invoices {{ $paidInvoicesCount }} Paid / {{ $unpaidInvoicesCount }} Unpaid
Overdue / Cancelled Invoices {{ $overdueInvoicesCount }} Overdue / {{ $cancelledInvoicesCount }} Cancelled
{{-- Renewal & Reminder Summary --}}
Renewal & Reminder Summary
Period Domains Expiring Hosting Expiring Reminders Sent
Today {{ $renewalSummary['domains_today'] }} {{ $renewalSummary['hosting_today'] }} {{ $reminderSummary['sent_today'] }} today
Within 7 Days {{ $renewalSummary['domains_7'] }} {{ $renewalSummary['hosting_7'] }} {{ $reminderSummary['pending'] }} pending
Within 15 Days {{ $renewalSummary['domains_15'] }} {{ $renewalSummary['hosting_15'] }} {{ $reminderSummary['failed'] }} failed
Within 30 Days {{ $renewalSummary['domains_30'] }} {{ $renewalSummary['hosting_30'] }} Whatsapp logs: {{ $reminderSummary['whatsapp'] }}
Already Expired {{ $renewalSummary['domains_expired'] }} {{ $renewalSummary['hosting_expired'] }} {{ $reminderSummary['not_reminded'] }} unsent clients
{{-- Domain, Hosting, and Client Summary Grid --}}
{{-- Domain Summary --}}
Domain Summary
  • Active Domains {{ $domainSummary['active'] }}
  • Expired Domains {{ $domainSummary['expired'] }}
  • Pending Transfer {{ $domainSummary['pending_transfer'] }}
  • Pending Registration {{ $domainSummary['pending_registration'] }}
  • Redemption Period {{ $domainSummary['redemption'] }}
{{-- Hosting Summary --}}
Hosting Summary
  • Active Accounts {{ $hostingSummary['active'] }}
  • Suspended Accounts {{ $hostingSummary['suspended'] }}
  • Shared Hosting {{ $hostingSummary['shared'] }}
  • VPS / Dedicated Server {{ $hostingSummary['vps'] + $hostingSummary['dedicated'] }}
  • Reseller Accounts {{ $hostingSummary['reseller'] }}
{{-- Client Summary --}}
Client Summary
  • New Clients This Month {{ $clientSummary['new_this_month'] }}
  • With Unpaid Invoices {{ $clientSummary['unpaid_invoices'] }}
  • With Multiple Services {{ $clientSummary['multiple_services'] }}
  • Without Email Address {{ $clientSummary['no_email'] }}
  • Without Phone Number {{ $clientSummary['no_phone'] }}
{{-- 4. Server Summary (Disk, Space, CPU, RAM) --}}
🏢 Connected WHM Servers Status
@forelse($servers as $srv) @php $totalAccts = $srv->hostingAccounts->count(); $activeAccts = $srv->hostingAccounts->where('status', 'active')->count(); $suspAccts = $srv->hostingAccounts->where('status', 'suspended')->count(); $diskUsed = $srv->hostingAccounts->sum('disk_space') ?: 100; // in MB $diskLimit = $srv->hostingAccounts->sum('disk_limit') ?: 20000; // in MB $diskPct = min(100, round(($diskUsed / $diskLimit) * 100)); // Simulated resource graphs for premium design look $cpuUsage = rand(15, 60); $ramUsage = rand(30, 80); @endphp @empty @endforelse
Server Name Status Total Accounts Active / Suspended Disk Usage CPU / RAM
{{ $srv->name }} {{ $srv->ip_address }} @if($srv->status === 'active') Online @else Offline @endif {{ $totalAccts }} accounts {{ $activeAccts }} / {{ $suspAccts }}
{{ number_format($diskUsed / 1024, 1) }} GB used {{ $diskPct }}%
CPU: {{ $cpuUsage }}%
RAM: {{ $ramUsage }}%
No connected WHM servers registered.
{{-- 5. Monthly Charts Section --}}
{{-- Revenue & Payment Collection Trend --}}
Monthly Revenue & Collection Trend
{{-- Invoice Status & Renewals --}}
Invoice Status Distribution
{{-- New Clients --}}
New Clients Per Month (Last 6 Months)
{{-- Expiring Renewals --}}
Expiring Renewals Trend (Next 6 Months)
{{-- 6. Recent Activities Feed --}}
Recent Activities (Latest 20 Logs)
@forelse($recentActivities as $log)
@if(str_contains(strtolower($log->activity), 'client')) @elseif(str_contains(strtolower($log->activity), 'domain')) @elseif(str_contains(strtolower($log->activity), 'hosting')) @elseif(str_contains(strtolower($log->activity), 'invoice')) @elseif(str_contains(strtolower($log->activity), 'payment')) @elseif(str_contains(strtolower($log->activity), 'reminder')) @else @endif
{{ $log->activity }} {{ $log->created_at->diffForHumans() }}

{{ $log->description }}

by {{ $log->user->name ?? 'System Process' }} (IP: {{ $log->ip_address }})
@empty
No recent activities logged.
@endforelse
@section('scripts') @endsection