@php $navDark = '#1a2035'; $tealAccent = '#2dd4bf'; $primary = '#008060'; $appName = config('app.name', 'TaskCo'); $company = $company ?? []; $companyName = $company['name'] ?? $appName; $companyEmail = $company['email'] ?? null; $companyPhone = $company['phone'] ?? null; $companyAddr = $company['address'] ?? null; $companyCity = trim(implode(', ', array_filter([$company['city'] ?? null, $company['state'] ?? null]))); $companyCountry = trim(implode(', ', array_filter([$company['country'] ?? null, $company['zip'] ?? null]))); $logoDataUri = $logoDataUri ?? null; $reportLabel = $reportLabel ?? 'Report'; $reportUid = $reportUid ?? ('RPT-' . strtoupper(substr(md5(uniqid()), 0, 8))); $filterSummary = $filterSummary ?? ''; $generatedBy = $generatedBy ?? (auth()->user()?->name ?? 'System'); $generatedAt = now()->format('d M Y, H:i'); $sections = $sections ?? []; $svgData = $svgData ?? []; $summary = $summary ?? []; $subSummary = $subSummary ?? []; $inSections = fn(string $k) => in_array($k, $sections); // Build filter pills $filterPills = []; if ($filterSummary && $filterSummary !== 'All records') { foreach (explode(' | ', $filterSummary) as $part) { if (trim($part) !== '') $filterPills[] = trim($part); } } // Summary card icon colors (by index) $cardColors = [ ['icon' => '#2563eb', 'border' => '#3b82f6', 'bg' => '#eff6ff'], ['icon' => '#16a34a', 'border' => '#22c55e', 'bg' => '#f0fdf4'], ['icon' => '#7c3aed', 'border' => '#a78bfa', 'bg' => '#faf5ff'], ['icon' => '#d97706', 'border' => '#fbbf24', 'bg' => '#fffbeb'], ]; // KPI color map $kpiColorMap = [ 'teal' => ['bg' => '#f0fdfa', 'border' => '#5eead4', 'icon' => '#0d9488', 'text' => '#0f766e'], 'green' => ['bg' => '#f0fdf4', 'border' => '#86efac', 'icon' => '#16a34a', 'text' => '#15803d'], 'blue' => ['bg' => '#eff6ff', 'border' => '#93c5fd', 'icon' => '#2563eb', 'text' => '#1d4ed8'], 'red' => ['bg' => '#fef2f2', 'border' => '#fca5a5', 'icon' => '#dc2626', 'text' => '#b91c1c'], 'amber' => ['bg' => '#fffbeb', 'border' => '#fcd34d', 'icon' => '#d97706', 'text' => '#b45309'], 'purple' => ['bg' => '#faf5ff', 'border' => '#d8b4fe', 'icon' => '#9333ea', 'text' => '#7e22ce'], 'orange' => ['bg' => '#fff7ed', 'border' => '#fdba74', 'icon' => '#ea580c', 'text' => '#c2410c'], ]; // Subtracted text color for card subtitle $subtitleColorMap = [ 'green' => '#16a34a', 'red' => '#dc2626', 'amber' => '#d97706', 'gray' => '#6b7280', 'blue' => '#2563eb', ]; @endphp {{ $reportLabel }} {{-- Fixed dark footer --}} {{-- ══ Repeating page header ════════════════════════════════════════ --}} {{-- ══ Report content ══════════════════════════════════════════════ --}}
{{-- Dark header --}}
{{-- LEFT: Logo + company --}} {{-- RIGHT: Report info --}}
@if($logoDataUri) @else
{{ strtoupper(substr($companyName, 0, 1)) }}
@endif
{{ $companyName }}
@if($companyEmail)
{{ $companyEmail }}
@endif @if($companyPhone)
{{ $companyPhone }}
@endif @if($companyAddr || $companyCity || $companyCountry)
{{ implode(', ', array_filter([$companyAddr, $companyCity, $companyCountry])) }}
@endif
Generated Report
{{ $reportLabel }}
UID: {{ $reportUid }}
Generated: {{ $generatedAt }}
Generated By: {{ $generatedBy }}
Export Type: Visual / Graph
{{-- Filter pills bar --}}
◈ Applied Filters @if(count($filterPills)) @foreach($filterPills as $pill) {{ $pill }} @endforeach @else No filters applied — all records @endif
{{-- Info bar --}}
Sections: {{ count($sections) }} | Export Type: Visual / Graph ⚠ Confidential
{{-- ── SUMMARY OVERVIEW CARDS ──────────────────────────── --}} @if($inSections('summary') && count($summary))
Summary Overview
@foreach($summary as $ci => $card) @php $cc = $cardColors[$ci % 4]; @endphp @endforeach @for($i = count($summary); $i < 4; $i++) @endfor
{{ ['$','☰','✓','!'][$ci % 4] }}
{{ $card['title'] ?? '' }}
{{ $card['value'] ?? '' }}
{{ $card['subtitle'] ?? '' }}
@endif {{-- ── KPI METRICS ─────────────────────────────────────── --}} @if($inSections('sub_summary') && count($subSummary))
KPI Metrics
@foreach($subSummary as $ki => $kpi) @php $kc = $kpiColorMap[$kpi['color'] ?? 'blue'] ?? $kpiColorMap['blue']; @endphp @endforeach @for($i = count($subSummary); $i < 4; $i++) @endfor
{{ ['■','✓','△','○'][$ki % 4] }}
{{ $kpi['label'] ?? '' }}
{{ $kpi['value'] ?? '' }}
@endif {{-- ── PRIMARY TREND CHART ─────────────────────────────── --}} @if($inSections('primary_chart') && !empty($svgData['primary_chart']))
Primary Trend Chart
{{ $reportLabel }} — Trend Overview
@foreach($svgData['primary_chart'] as $b64) @endforeach
@endif {{-- ── ANALYTICS CHARTS ────────────────────────────────── --}} @if($inSections('aux_charts') && !empty($svgData['aux_charts']))
Analytics Charts
@php $chartPairs = array_chunk($svgData['aux_charts'], 2); @endphp @foreach($chartPairs as $chartPair) @foreach($chartPair as $b64) @endforeach @if(count($chartPair) === 1) @endif
@endforeach
@endif {{-- Empty state --}} @if(!count($sections))
No sections were selected for this export.
@endif {{-- ── REPORT SUMMARY BOX ──────────────────────────────── --}}
Report Summary
This report provides an overview of {{ strtolower($reportLabel) }} performance for the selected period. It includes key metrics, trend analysis, and visual breakdowns of the selected data. @if($filterSummary && $filterSummary !== 'All records') Applied filters: {{ $filterSummary }}. @endif