@extends('layouts.app') @section('content')
@include('layouts.left-menu')

Sub-Admin Management

@if(auth()->user()->role == 'admin') Add New Sub-Admin @endif
@include('session-messages')

{{ count($subadmins) }}

Total Sub-Admins

{{ $subadmins->where('is_active', true)->count() ?? count($subadmins) }}

Active

{{ auth()->user()->role == 'admin' ? 'Full' : 'Limited' }}

Your Access

{{ $subadmins->count() > 0 ? $subadmins->first()->created_at->format('M Y') : 'N/A' }}

Last Added

Sub-Admin List
@forelse ($subadmins as $index => $subadmin) @empty @endforelse
# Photo Name Email Phone Gender Role Actions
{{ $index + 1 }} @if($subadmin->photo) {{ $subadmin->first_name }} @else
@endif
{{ $subadmin->first_name }} {{ $subadmin->last_name }} @if($subadmin->nationality)
{{ $subadmin->nationality }} @endif
{{ $subadmin->email }} {{ $subadmin->phone }} @if($subadmin->gender == 'Male') Male @elseif($subadmin->gender == 'Female') Female @else {{ $subadmin->gender }} @endif @php $roleInfo = [ 'academic' => ['icon' => 'bi-book', 'color' => 'info', 'text' => 'Academic'], 'finance' => ['icon' => 'bi-cash', 'color' => 'success', 'text' => 'Finance'], 'operations' => ['icon' => 'bi-gear', 'color' => 'warning', 'text' => 'Operations'], 'limited' => ['icon' => 'bi-lock', 'color' => 'secondary', 'text' => 'Limited'], ]; $role = $roleInfo[$subadmin->role] ?? ['icon' => 'bi-person', 'color' => 'secondary', 'text' => 'Sub-Admin']; @endphp {{ $role['text'] }}
@if(auth()->user()->role == 'admin')
@csrf @method('DELETE')
@else @endif

No Sub-Admins Found

@if(auth()->user()->role == 'admin') Add First Sub-Admin @endif
About Sub-Admins

Sub-admins help manage day-to-day operations of the madrasa. They have limited permissions compared to the main administrator and cannot access critical system settings. Different roles have different levels of access to various modules.

@if(auth()->user()->role == 'admin') View Documentation @endif
@include('layouts.footer')
@endsection