@extends('layouts.mainlayout') @section('fullwidth', true) @section('content') @php $canColumn = function ($key) { return Auth::user()->canSeeElement("summary", "columns", $key); }; $visibleColumnCount = collect(["date", "direction", "location", "staff", "route", "transport", "status"])->filter($canColumn)->count(); $sortUrl = function ($column) use ($sort, $sortDirection) { $nextDirection = $sort === $column && $sortDirection === 'asc' ? 'desc' : 'asc'; return request()->fullUrlWithQuery(['sort' => $column, 'direction' => $nextDirection, 'page' => null]); }; $statusMap = [ 1 => ['Ticketed', 'is-ticketed'], 2 => ['In progress', 'is-progress'], 3 => ['Arrived', 'is-arrived'], 4 => ['Issue', 'is-issue'], ]; $transportLabel = function ($row) { $airportFrom = trim((string) $row->airport_from); $airportWhere = trim((string) $row->airport_where); if ($airportFrom !== '' && $airportWhere !== '' && $airportFrom !== '0' && $airportWhere !== '0') { return $airportFrom.' – '.$airportWhere; } $bus = (string) $row->bus; if (isset($bus[0]) && $bus[0] === '3') return 'Own cost'; if (isset($bus[0]) && $bus[0] === '4') return 'Bus'; if (isset($bus[0]) && in_array($bus[0], ['1', '2'], true)) return 'Airplane'; return 'Not specified'; }; @endphp

Transit summary

The operational data used by the general transit summary email.

{{ number_format($summaryRows->total()) }} records
Search and filter
@foreach($selectedDates as $selectedDate)@endforeach
@if(Auth::user()->canSeeElement("summary", "buttons", "apply_filter"))@endif @if(Auth::user()->canSeeElement("summary", "buttons", "reset_filter") && ($search !== '' || $dateFrom !== '' || $dateTo !== '' || $selectedDates)) Reset @endif
General summary
@foreach(['date'=>'Date','direction'=>'Direction','location'=>'Location','staff'=>'Staff','route'=>'Route','transport'=>'Transport','status'=>'Status'] as $columnKey=>$columnLabel)@if($canColumn($columnKey))@endif @endforeach @forelse($summaryRows as $row) @php $isArrival = $row->from === 'Home'; $isDeparture = $row->where === 'Home'; $direction = $isArrival ? 'Arrival' : ($isDeparture ? 'Departure' : 'Transfer'); $location = $isArrival ? $row->where : ($isDeparture ? $row->from : $row->where); [$statusLabel, $statusClass] = $statusMap[(int) $row->status] ?? ['Unknown', 'is-muted']; @endphp @if($canColumn("date"))@endif @if($canColumn("direction"))@endif @if($canColumn("location"))@endif @if($canColumn("staff"))@endif @if($canColumn("route"))@endif @if($canColumn("transport"))@endif @if($canColumn("status"))@endif @empty @endforelse
@if($columnKey === 'date')@else{{ $columnLabel }}@endif
{{ $row->arrival_date }}{{ $direction }}{{ $location }}{{ trim($row->firstname.' '.$row->lastname) ?: 'Unknown staff' }}{{ $row->from }} {{ $row->where }}{{ $transportLabel($row) }} {{ $statusLabel }} @if(($row->lifecycle_status ?? null) === 'modified') Modified @endif
No summary records foundChange the search term or date interval.
@if($summaryRows->hasPages())
Showing {{ $summaryRows->firstItem() }}–{{ $summaryRows->lastItem() }} of {{ $summaryRows->total() }} {{ $summaryRows->links() }}
@endif
@endsection