Admin Report - eService Applications

e-Service Applications Admin Report

@php $currentFilters = request()->only(['time', 'status', 'application_type', 'window', 'officer']); @endphp
Reset
@if (collect($currentFilters)->filter(fn($value) => !empty($value) && $value !== 'all')->isNotEmpty()) @php $activeFilters = []; if (!empty($currentFilters['time']) && $currentFilters['time'] !== 'all') { $activeFilters[] = "Time: " . ucfirst($currentFilters['time']); } if (!empty($currentFilters['status']) && $currentFilters['status'] !== 'all') { $activeFilters[] = "Status: " . ucfirst($currentFilters['status']); } if (!empty($currentFilters['application_type']) && $currentFilters['application_type'] !== 'all') { $activeFilters[] = "Type: " . ucfirst($currentFilters['application_type']); } if (!empty($currentFilters['window']) && $currentFilters['window'] !== 'all') { $window = $windows->firstWhere('id', $currentFilters['window']); $windowName = $window ? (is_array($window->name) ? $window->name[app()->getLocale()] ?? ($window->name['en'] ?? current($window->name)) : $window->name) : 'N/A'; $activeFilters[] = "Window: " . $windowName; } if (!empty($currentFilters['officer']) && $currentFilters['officer'] !== 'all') { $officer = $officers->firstWhere('id', $currentFilters['officer']); $officerName = $officer ? (is_array($officer->name) ? $officer->name[app()->getLocale()] ?? ($officer->name['en'] ?? current($officer->name)) : $officer->name) : 'N/A'; $activeFilters[] = "Officer: " . $officerName; } @endphp
Active Filters: {{ implode(' • ', $activeFilters) }}
Showing {{ $applications->total() }} applications matching your criteria
@endif

Total Applications

{{ $totalApplications }}

Pending

{{ $pendingCount }}

Appointed

{{ $appointedCount }}

Rejected

{{ $rejectedCount }}

Approved

{{ $approvedCount }}

Application Records

@forelse($applications as $index => $application) @empty @endforelse
# Application Number Applicant Gender Service Window Type Officer Status Date
{{ ($applications->currentPage() - 1) * $applications->perPage() + $index + 1 }} APP-{{ str_pad($application->id, 6, '0', STR_PAD_LEFT) }} @if ($application->user && $application->user->gender) {{ ucfirst($application->user->gender) }} @else N/A @endif @if ($application->service && $application->service->name) @php $serviceName = is_array($application->service->name) ? $application->service->name[app()->getLocale()] ?? ($application->service->name['en'] ?? current($application->service->name)) : $application->service->name; @endphp {{ $serviceName }} @else N/A @endif @if ($application->service && $application->service->window && $application->service->window->name) @php $windowName = is_array($application->service->window->name) ? $application->service->window->name[app()->getLocale()] ?? ($application->service->window->name['en'] ?? current($application->service->window->name)) : $application->service->window->name; @endphp {{ $windowName }} @else N/A @endif {{ ucfirst($application->apply_type) }} @php $officerNames = ($application->service->users ?? collect()) ->map(function ($officer) { return is_array($officer->name) ? $officer->name[app()->getLocale()] ?? ($officer->name['en'] ?? current($officer->name)) : $officer->name; }); @endphp {{ $officerNames->isNotEmpty() ? $officerNames->join(', ') : 'N/A' }} {{ ucfirst($application->status) }} {{ $application->created_at->format('M d, Y') }}

No applications found for the selected filters.

Try adjusting your filter criteria or check if there are applications in the database.

Total Records: {{ $applications->total() }}
Last Updated: {{ now()->format('M d, Y H:i') }}
Male: {{ $totalMale }} | Female: {{ $totalFemale }} | Online: {{ $totalOnline }} | Physical: {{ $totalPhysical }}
@if ($applications->hasPages())
{{ $applications->withQueryString()->links('pagination::bootstrap-5') }}
@endif