@php $d = $this->getComputedData(); $fmt = fn($n) => number_format($n ?? 0, 0, ',', '.'); $fmtUsd = fn($n) => '$' . number_format($n ?? 0, 2, '.', ','); $pct = $d['pctChange']; $pctBadgeClass = function(?float $v): string { if ($v === null) return 'bg-gray-100 text-gray-500'; return $v >= 0 ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-700'; }; $pctLabel = fn(?float $v) => $v === null ? 'N/A' : ($v >= 0 ? '+' : '') . $v . '%'; $kpiBarColor = fn(string $c) => match($c) { 'green' => 'bg-green-500', 'yellow' => 'bg-yellow-400', default => 'bg-red-500', }; $kpiBadgeColor = fn(string $c) => match($c) { 'green' => 'bg-green-100 text-green-700', 'yellow' => 'bg-yellow-100 text-yellow-700', default => 'bg-red-100 text-red-700', }; $statusBadge = fn(string $s) => match($s) { 'in_progress' => 'bg-blue-100 text-blue-700', 'in_review' => 'bg-lime-100 text-lime-700', 'pending' => 'bg-yellow-100 text-yellow-700', 'hold' => 'bg-orange-100 text-orange-700', default => 'bg-gray-100 text-gray-600', }; $statusLabel = fn(string $s) => match($s) { 'in_progress' => 'In Progress', 'in_review' => 'In Review', 'pending' => 'Pending', 'hold' => 'Hold', default => ucfirst($s), }; $inputClass = 'rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 text-sm px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500'; $slideHeaderClass = 'flex items-center justify-between mb-6 pb-4 border-b border-gray-200 dark:border-gray-700'; $slideTitleClass = 'text-2xl font-bold text-gray-900 dark:text-white'; $sectionLabelClass = 'text-xs font-bold uppercase tracking-widest text-gray-400 dark:text-gray-500 mb-1'; $lastMonthLabel = $d['lastMonth']->format('F Y'); $thisMonthLabel = $d['thisMonth']->format('F Y'); @endphp {{-- ═══════════════════════════════════════════════════════════════ OUTER ALPINE SCOPE: slide state + fullscreen + keyboard nav ═══════════════════════════════════════════════════════════════ --}}
{{-- ─── CONTROLS BAR ─────────────────────────────────────────────── --}}
{{-- Filters --}}
Last Month: {{ $lastMonthLabel }}
This Month: {{ $thisMonthLabel }}
{{-- Navigation + actions --}}
Slide / {{ 7 }} {{-- Slide dots --}}
@for($i = 0; $i < 7; $i++) @endfor
{{-- ─── PRESENTATION AREA ────────────────────────────────────────── --}}
{{-- Fullscreen inner controls (visible only in fullscreen) --}}
/ 7
{{-- ════════════════════════════════════════════════════════════════ SLIDE 1 — Finance Overview (Last Month) ════════════════════════════════════════════════════════════════ --}}

Last Month Report — {{ $lastMonthLabel }}

Finance Overview

1 / 7
@if(!$d['finLast'])

No finance report found for {{ $lastMonthLabel }}

@else @php $income = $d['finLast']->total_income ?? 0; $expense = $d['finLast']->total_expense ?? 0; $profit = $d['finProfitLast']; $incomeChange = $pct($income, $d['finTwoAgo']?->total_income ?? null); $expenseChange = $pct($expense, $d['finTwoAgo']?->total_expense ?? null); $profitChange = $pct($profit, $d['finProfitTwoAgo'] ?: null); @endphp {{-- Stat Cards --}}
@foreach([ ['label' => 'Total Income', 'value' => $income, 'change' => $incomeChange, 'color' => 'blue'], ['label' => 'Total Expense', 'value' => $expense, 'change' => $expenseChange, 'color' => 'orange'], ['label' => 'Profit', 'value' => $profit, 'change' => $profitChange, 'color' => $profit >= 0 ? 'green' : 'red'], ] as $card)

{{ $card['label'] }}

Rp {{ $fmt($card['value']) }}

@php $chg = $card['change']; @endphp {{ $pctLabel($chg) }} @if($chg !== null) vs prev period @endif
@endforeach
{{-- Category Breakdown --}}
{{-- Income by Category --}}

Income by Category

@if(empty($d['finCategoryBreakdown']['income']))

No income transactions

@else
@foreach($d['finCategoryBreakdown']['income'] as $cat)
{{ $cat['name'] }} Rp {{ $fmt($cat['amount']) }}
@endforeach
@endif
{{-- Expense by Category --}}

Expense by Category

@if(empty($d['finCategoryBreakdown']['expense']))

No expense transactions

@else
@foreach($d['finCategoryBreakdown']['expense'] as $cat)
{{ $cat['name'] }} Rp {{ $fmt($cat['amount']) }}
@endforeach
@endif
@endif {{-- Hidden data for Chart.js --}}
{{-- ════════════════════════════════════════════════════════════════ SLIDE 2 — Marketing Report (Last Month) ════════════════════════════════════════════════════════════════ --}}

Last Month Report — {{ $lastMonthLabel }}

Marketing Report

2 / 7
{{-- Proposal / Lead Stat Cards --}}

Proposals

{{ $d['proposalCount'] }}

Leads

{{ $d['leadCount'] }}

{{-- Platform Chart --}} @if($d['marketingByPlatform']->isEmpty())

No marketing data for {{ $lastMonthLabel }}

@else
{{-- Platform Table --}}
@foreach($d['marketingByPlatform'] as $row) @endforeach
Platform Badge Connect Profile Views Boost Impressions Clicks
{{ $row['platform'] }} {{ number_format($row['badge_connect']) }} {{ number_format($row['total_profile_view']) }} {{ number_format($row['boost_profile']) }} {{ number_format($row['total_impression']) }} {{ number_format($row['click']) }}
@endif
{{-- ════════════════════════════════════════════════════════════════ SLIDE 3 — KPI Report (Last Month) ════════════════════════════════════════════════════════════════ --}}

Last Month Report — {{ $lastMonthLabel }}

KPI Report

3 / 7
@if(empty($d['kpiGroupedLast']))

No KPI objectives found for {{ $lastMonthLabel }}

@else
@foreach($d['kpiGroupedLast'] as $group)

{{ $group['group_name'] }}

@foreach($group['objectives'] as $obj)
{{ $obj['name'] }} {{ $obj['progress'] }}%
{{ $obj['realized'] }} / {{ $obj['target'] }} @if($obj['unit']) {{ $obj['unit'] }} @endif
@endforeach
@endforeach
@endif
{{-- ════════════════════════════════════════════════════════════════ SLIDE 4 — Talent Report (Last Month) ════════════════════════════════════════════════════════════════ --}}

Last Month Report — {{ $lastMonthLabel }}

Talent Report

4 / 7
@if($d['sdmRecords']->isEmpty())

No talent data for {{ $lastMonthLabel }}

@else
@foreach($d['sdmRecords'] as $sdm)
{{-- Avatar + Name --}}
{{ mb_strtoupper(mb_substr($sdm['name'], 0, 1)) }}
{{ $sdm['name'] }}
{{-- Update --}} @if($sdm['new_update'])

Update Terbaru

{!! $sdm['new_update'] !!}
@endif {{-- Future Target --}} @if($sdm['future_target'])

Target Kedepan

{!! $sdm['future_target'] !!}
@endif
@endforeach
@endif
{{-- ════════════════════════════════════════════════════════════════ SLIDE 5 — Forecasting Finance (This Month) ════════════════════════════════════════════════════════════════ --}}

Plan — {{ $thisMonthLabel }}

Forecasting Finance

5 / 7
@if(!$d['forecasting'])

No forecasting data for {{ $thisMonthLabel }}

@else @php $fc = $d['forecasting']; @endphp {{-- Scenario Summary Table --}}
@foreach([ ['label' => 'Real', 'suffix' => 'real'], ['label' => 'Target', 'suffix' => 'target'], ['label' => 'Rl. Inc / Est. Exp', 'suffix' => 'real_income_estimated_expenses'], ] as $row) @php $p = $fc->{'estimated_profit_' . $row['suffix']} ?? 0; @endphp @endforeach
Scenario Income Expense Profit Ending Balance
{{ $row['label'] }} Rp {{ $fmt($fc->{'income_total_nominal_' . $row['suffix']} ?? 0) }} Rp {{ $fmt($fc->{'expense_total_nominal_' . $row['suffix']} ?? 0) }} Rp {{ $fmt($p) }} Rp {{ $fmt($fc->{'ending_balance_' . $row['suffix']} ?? 0) }}
{{-- Scenario Chart --}}
{{-- Line Items --}}
@if($fc->estimatedIncomes->isNotEmpty())

Estimated Income Items

@foreach($fc->estimatedIncomes as $item) @endforeach
Item Real Target
{{ $item->description }} Rp {{ $fmt($item->nominal_real) }} Rp {{ $fmt($item->nominal_target) }}
@endif @if($fc->estimatedExpenses->isNotEmpty())

Estimated Expense Items

@foreach($fc->estimatedExpenses as $item) @endforeach
Item Real Target
{{ $item->description }} Rp {{ $fmt($item->nominal_real) }} Rp {{ $fmt($item->nominal_target) }}
@endif
@endif
{{-- ════════════════════════════════════════════════════════════════ SLIDE 6 — Project Overview (This Month) ════════════════════════════════════════════════════════════════ --}}

Plan — {{ $thisMonthLabel }}

Project Overview

{{ $d['projectsData']->count() }} active projects 6 / 7
@if($d['projectsData']->isEmpty())

No active projects this month

@else {{-- Summary stat cards --}}
@foreach(['in_progress' => 'In Progress', 'pending' => 'Pending', 'in_review' => 'In Review', 'hold' => 'Hold'] as $s => $sl) @php $count = $d['projectsData']->where('status', $s)->count(); @endphp

{{ $sl }}

{{ $count }}

@endforeach
{{-- Project Table --}}
@foreach($d['projectsData'] as $proj) @endforeach
Project Status Project Manager Developers Earning (USD)
{{ $proj['name'] }} {{ $statusLabel($proj['status']) }} {{ $proj['pm'] }} {{ $proj['developers'] ?: '-' }} {{ $proj['earning_usd'] > 0 ? $fmtUsd($proj['earning_usd']) : '-' }}
Total Earning {{ $fmtUsd($d['projectsData']->sum('earning_usd')) }}
@endif
{{-- ════════════════════════════════════════════════════════════════ SLIDE 7 — KPI Report (This Month) ════════════════════════════════════════════════════════════════ --}}

Plan — {{ $thisMonthLabel }}

KPI Report

7 / 7
@if(empty($d['kpiGroupedThis']))

No KPI objectives found for {{ $thisMonthLabel }}

@else
@foreach($d['kpiGroupedThis'] as $group)

{{ $group['group_name'] }}

@foreach($group['objectives'] as $obj)
{{ $obj['name'] }} {{ $obj['progress'] }}%
{{ $obj['realized'] }} / {{ $obj['target'] }} @if($obj['unit']) {{ $obj['unit'] }} @endif
@endforeach
@endforeach
@endif
{{-- /presentation area --}}
{{-- /x-data --}} @push('styles') @endpush @push('scripts') @endpush