ultimatepos/Modules/ManagementTools/Resources/views/executive_cockpit/email_brief.blade.php

93 lines
4.3 KiB
PHP

<div style="font-family:Arial,sans-serif;line-height:1.7;color:#1f2937;">
<h2 style="margin:0 0 8px;">@lang('managementtools::lang.executive_brief_title') - {{ $business->name }}</h2>
<p style="margin:0 0 14px;">@lang('managementtools::lang.date'): {{ $date }}</p>
@php $summary = $data['executive_summary'] ?? []; @endphp
@if(!empty($summary))
<div style="background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:14px;margin-bottom:16px;">
<h3 style="margin:0 0 8px;">{{ $summary['headline'] ?? '' }}</h3>
<p style="margin:0 0 10px;">{{ $summary['opening'] ?? '' }}</p>
@if(!empty($summary['highlights']))
<p style="margin:8px 0 4px;font-weight:bold;">@lang('managementtools::lang.summary_highlights')</p>
<ul style="margin:0 0 8px;padding-left:18px;">
@foreach($summary['highlights'] as $item)
<li>{{ $item }}</li>
@endforeach
</ul>
@endif
@if(!empty($summary['concerns']))
<p style="margin:8px 0 4px;font-weight:bold;">@lang('managementtools::lang.summary_concerns')</p>
<ul style="margin:0 0 8px;padding-left:18px;">
@foreach($summary['concerns'] as $item)
<li>{{ $item }}</li>
@endforeach
</ul>
@endif
</div>
@endif
<table style="width:100%;border-collapse:collapse;margin-bottom:14px;">
<thead>
<tr>
<th style="text-align:left;border:1px solid #e5e7eb;padding:8px;background:#f9fafb;">@lang('managementtools::lang.metric')</th>
<th style="text-align:left;border:1px solid #e5e7eb;padding:8px;background:#f9fafb;">@lang('managementtools::lang.actual')</th>
<th style="text-align:left;border:1px solid #e5e7eb;padding:8px;background:#f9fafb;">@lang('managementtools::lang.vs_previous_period')</th>
</tr>
</thead>
<tbody>
@foreach($data['kpis'] as $key => $val)
@php $cmp = $data['kpi_comparisons'][$key] ?? null; @endphp
<tr>
<td style="border:1px solid #e5e7eb;padding:8px;">{{ __('managementtools::lang.' . $key) }}</td>
<td style="border:1px solid #e5e7eb;padding:8px;">{{ is_numeric($val) ? number_format((float) $val, 2) : $val }}</td>
<td style="border:1px solid #e5e7eb;padding:8px;">
@if($cmp)
@if(($cmp['direction'] ?? 'flat') === 'flat')
@lang('managementtools::lang.no_change')
@else
{{ ($cmp['delta_pct'] ?? 0) > 0 ? '+' : '' }}{{ number_format((float) ($cmp['delta_pct'] ?? 0), 1) }}%
@endif
@else
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
@if(!empty($data['alerts']))
<h3 style="margin:0 0 8px;">@lang('managementtools::lang.executive_alert_center')</h3>
<ul>
@foreach($data['alerts'] as $alert)
<li>{{ $alert['title'] }}: {{ $alert['value'] }}</li>
@endforeach
</ul>
@endif
@if(!empty($data['drilldown']))
<h3 style="margin:16px 0 8px;">@lang('managementtools::lang.board_drilldown_section')</h3>
@foreach($data['drilldown'] as $tabKey => $section)
<h4 style="margin:12px 0 6px;">{{ $data['drilldown_labels'][$tabKey] ?? $tabKey }}</h4>
@if(!empty($section['top_items']))
<ul>
@foreach(array_slice($section['top_items'], 0, 3) as $item)
<li>
{{ $item['label'] }}:
@if(!empty($item['currency']))
{{ number_format((float) ($item['value'] ?? 0), 2) }}
@else
{{ $item['value'] ?? '-' }}
@endif
</li>
@endforeach
</ul>
@endif
@endforeach
@endif
<p style="margin-top:16px;">
<a href="{{ url('/management-tools/executive-cockpit') }}">@lang('managementtools::lang.open_executive_cockpit')</a>
</p>
</div>