{{-- Ports app/Views/student/show.php's renderGroupCard() (legacy, lines 76-282) — see the Phase 8 plan. Stats/tariff/month-grouping are precomputed in StudentProfileController@loadGroupInfo/computeGroupStats/resolveGroupTariff (Blade partials shouldn't run SQL or business logic), not recomputed here. --}} @php $tariff = $group->tariff; $stats = $group->stats; $uniqueId = $group->uniqueId; @endphp
{{ $group->group_name }}
{{ $group->is_active ? 'Активен' : 'Неактивен' }}

Предмет: {{ $group->discipline_name }}

Учитель: {{ $group->teacher_name ?? '—' }}

С: {{ date('d.m.Y', strtotime($group->joined_at)) }} @if ($group->end_date) по {{ date('d.m.Y', strtotime($group->end_date)) }} @endif

@if ($tariff)
@if ($tariff->source === 'student') Инд. тариф @elseif ($tariff->source === 'general') Общий тариф @else Тариф группы @endif {{ preg_replace('/^\[manual\]\s*/', '', $tariff->name) }}  ·  @if (!empty($tariff->discounted_price)) {{ number_format((float) $tariff->price, 0, ',', ' ') }} ₸ {{ number_format($tariff->discounted_price, 0, ',', ' ') }} ₸ -{{ $tariff->discount_percent }}% @else {{ number_format((float) $tariff->price, 0, ',', ' ') }} ₸ @endif / {{ $tariff->lessons_count }} уроков @if ($tariff->lessons_count > 0) @php $perLessonBase = $tariff->discounted_price ?? (float) $tariff->price; @endphp ({{ number_format($perLessonBase / $tariff->lessons_count, 0, ',', ' ') }} ₸/ур.) @endif @if ($tariff->start_date && $tariff->end_date)
{{ date('d.m.Y', strtotime($tariff->start_date)) }} — {{ date('d.m.Y', strtotime($tariff->end_date)) }} @endif @if ($tariff->source === 'student' && $tariff->lessons_remaining !== null)  ·  осталось уроков: {{ (int) $tariff->lessons_remaining }} @endif
@if ($tariff->source === 'student') @else @endif
@else
⚠ Тариф не назначен
@endif @if ($stats)
@foreach (['week' => '📅 За 7 дней', 'month' => '📆 За 30 дней'] as $key => $label) @php $s = $stats[$key]; $pctColor = $s['percent'] < 50 ? 'red' : ($s['percent'] < 80 ? 'warning' : 'green'); $pctHex = ['green' => '#28a745', 'amber' => '#ffc107', 'red' => '#dc3545'][$pctColor] ?? ''; @endphp
{{ $label }}
Уроков: {{ $s['total'] }}  |  Посетил: {{ $s['attended'] }}  |  Пропуски: {{ $s['absences'] }}
Процент: {{ $s['percent'] }}%  |  КР: {{ $s['krAvg'] }}  |  ДЗ: {{ $s['dzAvg'] }}
@endforeach
@endif @if (!empty($group->lessons))
Уроки и посещаемость:
@foreach ($group->months as $monthKey => $monthLessons) @endforeach
@endif