{{ __('patients.file_number') }}: {{ $menu->patient?->file_number ?? '—' }} ·
{{ __('patients.reviewer_name') }}: {{ $menu->patient?->full_name ?? '—' }} ·
{{ __('patients.consultant_name') }}: {{ $menu->patient?->consultant?->name ?? '—' }}
{{ $menu->title ?? $menu->dietType?->name }} ·
{{ $menu->starts_on?->format('Y-m-d') }} ·
{{ $menu->duration_days }} {{ __('common.days') }}
@foreach ([
[__('patients.target_calories'), number_format($menu->target_calories) . ' ' . __('common.kcal'), '#5F8A31'],
[__('patients.protein'), $menu->protein_g . __('common.grams'), '#0c6bab'],
[__('patients.carbs'), $menu->carbs_g . __('common.grams'), '#5F8A31'],
[__('patients.fat'), $menu->fat_g . __('common.grams'), '#c98a06'],
] as [$label, $value, $color])
|
{{ $label }}
{{ $value }}
|
@endforeach
@foreach ($days as $index => $day)
@php $dayTotal = $totals[$index] ?? null; @endphp
{{ __('common.day') }} {{ $day['day'] }}
@if ($dayTotal)
· {{ number_format($dayTotal['calories']) }} {{ __('common.kcal') }}
@endif
@foreach ($day['meals'] as $meal)
@php
$mealColor = ['breakfast' => '#17b8a6', 'lunch' => '#F2B705', 'dinner' => '#E8792A'][$meal['slot']] ?? '#5F8A31';
$actual = $meal['actual_calories'] ?? collect($meal['items'])->sum('calories');
$pct = $meal['target_calories'] > 0 ? min(100, round(($actual / $meal['target_calories']) * 100)) : 0;
@endphp
| {{ __('menus.slots.' . $meal['slot']) }} |
{{ round($actual) }} / {{ $meal['target_calories'] }} {{ __('common.kcal') }}
|
@foreach ($meal['items'] as $item)
@php
$itemName = collect([$item['name_en'] ?? null, $item['name_ar'] ?? null])
->filter()
->unique()
->implode(' / ');
if ($itemName === '') {
$itemName = $item['name'] ?? (app()->getLocale() === 'ar' ? ($item['name_ar'] ?? null) : ($item['name_en'] ?? null));
}
@endphp
| {{ $itemName }} |
{{ $item['grams'] }}{{ ($item['unit'] ?? null) === 'ml' ? __('common.ml') : __('common.grams') }} |
@endforeach
@endforeach
@endforeach
@if ($totalDays > count($days))
@endif