@extends('layout.report', ['max_width' => '100%']) @section('report') @php $sums = []; @endphp
{{ $group->name }} {{ 'Week ' . $from . ' to ' . $to }} {{ 'exported at: ' . date('d-m-Y H:i') }}
| no | Name | @foreach ($courses as $course){{ $course->name }} | @endforeach {{--Morning Assembly | --}}Total | ||||
|---|---|---|---|---|---|---|---|---|
| missed | execuse | @endforeach @php $sums['morning'] = [ 'missed' => 0, 'excused_hours' => 0, ]; $sums['total'] = [ 'missed' => 0, 'excused_hours' => 0, ]; @endphp {{--missed | --}} {{--execuse | --}}missed | execuse | |||
| {{ $loop->iteration }} | {{ $student->user->name }} | @foreach ($courses as $course) @php $missed = $student->missedHours($course->id, $from, $to); $excused = $student->excusedHours($course->id, $from, $to); $sums[$course->id]['missed'] += $missed; $sums[$course->id]['excused_hours'] += $excused; @endphp{{ $missed }} | {{ $excused }} | @endforeach @php // $total_morning = max(0,$student->morningAbsences($from, $to)->sum('total_missed_hours')); // $excused_morning = $student->morningAbsences($from, $to, false, true)->sum('excused_hours'); $total_missed = $student->missedHours(null, $from, $to); $total_excused = $student->excusedHours(null, $from, $to, false, true); $sums['total']['missed'] += $total_missed; $sums['total']['excused_hours'] += $total_excused; // $sums['morning']['missed'] += $total_morning; // $sums['morning']['excused_hours'] += $excused_morning; @endphp {{--{{ $total_morning }} | --}} {{--{{ $excused_morning }} | --}}{{ $total_missed }} | {{ $total_excused }} | |
| Total | @foreach ($courses as $course){{ $sums[$course->id]['missed'] }} | {{ $sums[$course->id]['excused_hours'] }} | @endforeach {{--{{ $sums['morning']['missed'] }} | --}} {{--{{ $sums['morning']['excused_hours'] }} | --}}{{ $sums['total']['missed'] }} | {{ $sums['total']['excused_hours'] }} | ||