@extends('layouts.app') @section('title', 'Информация о преподавателе') {{-- Ports app/Views/admin/teachers/show.php (legacy) + the render() payload from App\Controllers\TeacherController::show() — see the Phase 42 plan. All 4 write actions (update_info/update_price/update_password/delete) post to this same URL with a hidden _action field, dispatched server-side by TeacherController::dispatchAction() — mirroring the legacy closure route exactly. None of the three edit modals repopulate old input on a validation failure (confirmed: legacy's own view never references Old:: for these fields) — only a plain flash message is shown, matching legacy exactly. Schedule grid is rendered server-side with the exact same PHP loop logic as legacy, including its exact-string match on a computed "HH:00 - HH:50" range — a non-hour-aligned begin_time silently never appears in the grid. getGroupsWithSchedule() also has no end_date filter, so stale/expired schedule slots can still render here (both preserved, not fixed). --}} @section('content')
Email: {{ $teacher['email'] }}
ИИН: {{ $teacher['iin'] ?? '' }}
Ставка: {{ $teacher['price_value'] !== null ? $teacher['price_value'].' тг' : 'Не указана' }}
| Время | @foreach ($daysOfWeek as $day){{ $day }} | @endforeach
|---|---|
| {{ $timeSlot }} | @foreach ($daysOfWeek as $index => $day)
@php
$isScheduled = false;
$cellGroupNames = [];
foreach ($groups as $group) {
foreach ($group['schedule'] as $scheduleItem) {
$weekdaysValue = $scheduleItem['weekdays'];
if (($weekdaysValue & (1 << $index)) !== 0) {
$scheduleTime = $scheduleItem['begin_time'];
$scheduleTimeFormatted = date('H:i', strtotime($scheduleTime)) . ' - ' . date('H:i', strtotime('+50 minutes', strtotime($scheduleTime)));
if ($scheduleTimeFormatted == $timeSlot) {
$isScheduled = true;
$cellGroupNames[] = $group['group_name'];
}
}
}
}
@endphp
@if ($isScheduled)
@foreach ($cellGroupNames as $gn)
{{ $gn }} @endforeach @else @endif |
@endforeach
Нет данных за выбранный период.
@else| Группа | Уроков | Студентов | Начислено | Зарплата | Аренда | Прибыль | Маржа |
|---|---|---|---|---|---|---|---|
| {{ $r['group_name'] }} | {{ $r['lessons_count'] }} | {{ $r['student_count'] }} | {{ number_format($r['revenue'], 0, ',', ' ') }} | {{ number_format($tCost, 0, ',', ' ') }} | {{ number_format($rent, 0, ',', ' ') }} | {{ number_format($profit, 0, ',', ' ') }} | {{ $margin }}% |
| Итого | — | — | {{ number_format($finTotalRevenue, 0, ',', ' ') }} | {{ number_format($finTotalTeacher, 0, ',', ' ') }} | {{ number_format($finTotalRent, 0, ',', ' ') }} | {{ number_format($finTotalProfit, 0, ',', ' ') }} | {{ $finTotalRevenue > 0 ? round($finTotalProfit / $finTotalRevenue * 100, 1) : 0 }}% |