@extends('layouts.app') @section('content')

🏢 Centers Dashboard

Monitor and manage all Nyota Programme training centers efficiently.

@if(auth()->check()) Add Center @endif
@php $centerStats = [ ['title' => 'Total Centers', 'count' => $totalCenters ?? 0, 'desc' => 'Registered centers', 'icon' => 'bi bi-building-check'], ['title' => 'Active Centers', 'count' => $activeCenters ?? 0, 'desc' => 'Currently running', 'icon' => 'bi bi-activity'], ['title' => 'Inactive Centers', 'count' => $inactiveCenters ?? 0, 'desc' => 'Paused operations', 'icon' => 'bi bi-pause-circle'], ['title' => 'Total Trainers', 'count' => $totalTrainers ?? 0, 'desc' => 'Across all centers', 'icon' => 'bi bi-person-badge-fill'], ['title' => 'Master Trainers', 'count' => $totalMasterTrainers ?? 0, 'desc' => 'Expert trainers', 'icon' => 'bi bi-person-check-fill'], ['title' => 'Deputy Lead Trainers', 'count' => $totalDeputyLeads ?? 0, 'desc' => 'Supporting lead trainers', 'icon' => 'bi bi-person-fill-gear'], ['title' => 'Total Trainees', 'count' => $totalTrainees ?? 0, 'desc' => 'Active trainees', 'icon' => 'bi bi-people-fill'], ['title' => 'Top Performing', 'count' => $topCenter->name ?? '—', 'desc' => 'Based on performance', 'icon' => 'bi bi-trophy-fill'], ]; @endphp @foreach ($centerStats as $stat)
{{ $stat['title'] }}

{{ $stat['count'] }}

{{ $stat['desc'] }}
@endforeach

Center Performance Overview

@foreach ($centers as $center)
{{ $center->name }}
{{ ucfirst($center->status ?? 'Active') }}

Sub-county: {{ $center->subCounty->name ?? 'N/A' }}

  • Senior Trainers: {{ $center->trainers_count ?? 0 }}
  • Assistant Trainers:{{ $center->assistantTrainers->count() ?? 0 }}
  • Lead Trainers: {{ $center->leadTrainers?->count() ?? 0 }}
  • Deputy Lead Trainers: {{ $center->deputyLeadTrainers?->count() ?? 0 }}
  • Master Trainers: {{ $center->masterTrainers?->count() ?? 0 }}
  • Trainees: {{ $center->trainees_count ?? 0 }}
  • Head Teachers: {{ $center->headTeachers?->count() ?? 0 }}
  • Teachers on Duty: {{ $center->teachersOnDuty?->count() ?? 0 }}
  • ICT Agents: {{ $center->ictAgents?->count() ?? 0 }}
  • Recce Agents: {{ $center->recceAgents?->count() ?? 0 }}
  • Cleaners: {{ $center->cleaners?->count() ?? 0 }}
  • Child Minders: {{ $center->childMinders?->count() ?? 0 }}
  • Coordinators: {{ $center->coordinators_count ?? 0 }}
Updated {{ $center->updated_at?->diffForHumans() ?? 'N/A' }} View
@endforeach
@forelse ($centers as $center) @empty @endforelse
# Center Name Location Trainers Lead Trainers Deputy Lead Trainers Master Trainers Trainees Status Updated Actions
{{ $loop->iteration }} {{ $center->name }} {{ $center->subCounty->name ?? 'N/A' }} {{ $center->trainers_count ?? 0 }} {{ $center->leadTrainers?->count() ?? 0 }} {{ $center->deputyLeadTrainers?->count() ?? 0 }} {{ $center->masterTrainers?->count() ?? 0 }} {{ $center->trainees_count ?? 0 }} {{ ucfirst($center->status) }} {{ $center->updated_at?->diffForHumans() ?? 'N/A'}}
@csrf @method('DELETE')
No centers found.
{{ $centers->onEachSide(1)->links('pagination::bootstrap-5') }}
@endsection