@extends('layouts.app')
@section('title', 'Информация о студенте')
{{--
Ports app/Views/student/show.php (legacy, 1716 lines) + the render()
payload from App\Controllers\StudentController::show()
(app/Controllers/StudentController.php:756-959) — see the Phase 8 plan.
Every write form on this page is Laravel-native (@csrf) as of Phase 14 —
payments/charges (PaymentController, Phases 9-10/12), frozen days
(Phase 11), student edit/responsibles (Phase 13), and status
change/tariff assignment (Phase 14) each moved once their last legacy
caller was confirmed gone. The lessonStatusModal's fetch() still has no
CSRF field at all, matching legacy LessonController::updateStudentStatus(),
which never called verifyCsrf() either — its endpoint moved to
LessonAttendanceController::updateStudentStatus() in Phase 27 (the JS
here is unchanged, still posts the same JSON to the same URL).
Role gating below mirrors the legacy view's per-section
in_array($role, [...]) checks exactly — the page itself has no
page-level role restriction (only SessionAuth::check()), which is a
pre-existing gap flagged (not fixed) in the Phase 8 plan.
--}}
@php
$attColorClass = $attendancePct < 50 ? 'ax-metric-value--danger' : ($attendancePct < 80 ? 'ax-metric-value--warning' : 'ax-metric-value--success');
$latenessColorClass = $latenessCount > 0 ? 'ax-metric-value--danger' : '';
$absencesColorClass = $absences > 0 ? 'ax-metric-value--danger' : '';
@endphp
@section('content')
{{--
Удаление ученика — admin only, and only for a student with no
history behind them. StudentProfileController::destroyStudent()
re-checks both server-side and refuses with a message naming
what blocked it; this modal just states the rule up front so an
admin isn't surprised by the refusal.
--}}
@if ($role === 'admin')
@forelse ($attempt['sections'] as $section)
{{ $section['name'] }}: {{ $entFmt($section['score']) }}/{{ $entFmt($section['max_score']) }}
@empty
{{-- Rows entered before ent_scores.section_id existed have no subject. --}}
без разбивки по предметам
@endforelse
{{ $attempt['note'] ?: '—' }}
@endforeach
@endif
@endif
{{-- Frozen days --}}
@if (in_array($role, ['admin', 'adviser'], true))
Замороженные дни
@if ($frozenDays)
С
По
Причина
Действие
@foreach ($frozenDays as $freeze)
{{ $freeze->date_from }}
{{ $freeze->date_to }}
{!! nl2br(e($freeze->reason)) !!}
@endforeach
@else
Нет замороженных дней.
@endif
Добавить заморозку
@endif
{{-- Status history --}}
@if (in_array($role, ['admin', 'adviser'], true))
{{-- Both tables below carry the student's full history (no row cap), so
this filter is what keeps an old account readable: it hides rows by
year client-side and re-totals what's left. --}}