@extends('admin.admin_dashboard') @section('admin')
Home MSC Reports @if(App\Support\MscPermissions::canAccessDashboard(auth()->user())) Dashboard @endif @if(App\Support\MscPermissions::canViewReports(auth()->user())) Downloads @endif @if(App\Support\MscPermissions::canCreateReport(auth()->user())) New report @endif
@if(($pendingDeletionReports ?? collect())->isNotEmpty())
@foreach($pendingDeletionReports as $pendingReport) @endforeach
Date Branch Requested by Reason Actions
{{ $pendingReport->report_date?->format('d M Y') }} {{ $pendingReport->branch->name ?? '—' }} {{ $pendingReport->deletionRequestedBy->name ?? '—' }} {{ \Illuminate\Support\Str::limit($pendingReport->deletion_reason, 80) }} Review
@endif
@if($canViewAll)
@endif
@if(App\Support\MscPermissions::canViewReports(auth()->user())) @include('admin.chs.msc.partials.download-section', [ 'branches' => $branches, 'canViewAll' => $canViewAll, 'canViewSummary' => App\Support\MscPermissions::canViewSummary(auth()->user()), 'selectedBranch' => request('branch_id'), 'selectedYear' => request('from_date') ? (int) date('Y', strtotime(request('from_date'))) : (int) now()->format('Y'), 'fromDate' => request('from_date'), 'toDate' => request('to_date'), ]) @endif
@if($reports->isEmpty()) @else # Date Branch Status Created by Updated Actions @foreach($reports as $report) {{ $reports->firstItem() + $loop->index }} {{ $report->report_date?->format('d M Y') }} {{ $report->branch->name ?? '—' }} @php $statusColor = match ($report->status) { 'submitted' => 'success', 'pending_deletion' => 'danger', default => 'warning', }; @endphp {{ $report->creator->name ?? '—' }} {{ $report->updated_at?->diffForHumans() }} View PDF @endforeach @endif
@endsection @push('scripts') @endpush