@extends('layouts.admin') @section('title', 'Manajemen User — SMKN 1 BOYOLANGU') @section('header_title', 'Manajemen User') @section('header_subtitle', 'Kelola data akun pengguna, hak akses per manajemen, dan status langsung dari database') @section('styles') @endsection @section('content')
{{-- Flash Notifications --}}
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
{{-- Header Banner --}}

Manajemen Akun Pengguna

Kelola seluruh hak akses login, peran manajemen, status aktif, dan keamanan sistem informasi.

{{ now()->locale('id')->isoFormat('dddd, D MMMM Y') }}
{{-- KPI Cards --}}
{{ $totalUser }}
TOTAL AKUN
Terdaftar di Database
{{ $totalActive }}
AKUN AKTIF
{{ $totalUser > 0 ? round(($totalActive / $totalUser) * 100) : 0 }}% Akses Diizinkan
{{ $totalAdmin }}
ADMINISTRATOR
Hak Akses Penuh Sistem
{{ $totalGuru }}
DEWAN GURU
Wali & Pengampu Mapel
{{-- Quick Role Tabs (Melihat User di Tiap Manajemen) --}} {{-- Filter & Action Bar --}}
@if(!empty($role) && $role !== 'all') @endif
Cari Pengguna
Status Akun
@if($search || ($status !== null && $status !== '') || ($role && $role !== 'all')) @endif
{{-- Table Section --}}
Daftar Akun Pengguna {{ $userList->total() }} User
@forelse($userList as $index => $u) @php $roleLabel = match($u->role) { 'admin' => 'Administrator', 'wali_kelas' => 'Wali Kelas', 'guru_mapel' => 'Guru Mapel', 'guru_piket' => 'Guru Piket', 'waka_kurikulum' => 'Waka Kurikulum', 'waka_sdm' => 'Waka SDM', 'wali_murid' => 'Wali Murid', 'kepala_sekolah' => 'Kepala Sekolah', 'waka' => 'Waka', 'satpam' => 'Satpam', default => ucfirst(str_replace('_', ' ', $u->role)) }; $roleIcon = match($u->role) { 'admin' => 'fa-user-shield', 'wali_kelas' => 'fa-user-tie', 'guru_mapel' => 'fa-book-open-reader', 'guru_piket' => 'fa-clipboard-check', 'waka_kurikulum' => 'fa-book-bookmark', 'waka_sdm' => 'fa-user-gear', 'wali_murid' => 'fa-users', 'kepala_sekolah' => 'fa-graduation-cap', 'waka' => 'fa-briefcase', 'satpam' => 'fa-shield-halved', default => 'fa-user' }; $avatarUrl = $u->photo ? Storage::url($u->photo) : 'https://ui-avatars.com/api/?name='.urlencode($u->name).'&background=eaeff8&color=2b43b9&bold=true&rounded=true'; @endphp @empty @endforelse
No Pengguna Role / Manajemen Status Akun Tanggal Terdaftar Aksi
{{ $userList->firstItem() + $index }} {{ $roleLabel }} @if($u->is_active) Aktif @else Non-Aktif @endif {{ $u->created_at ? $u->created_at->locale('id')->isoFormat('D MMM Y') : '-' }}
{{-- Toggle Aktif --}}
@csrf
{{-- Detail Modal --}} {{-- Edit Modal --}} {{-- Hapus Modal --}}
Tidak ada data pengguna ditemukan
Coba ubah kata kunci pencarian atau filter role.
{{-- Pagination --}} @if($userList->hasPages())
Menampilkan {{ $userList->firstItem() }} - {{ $userList->lastItem() }} dari {{ $userList->total() }} pengguna
{{ $userList->links() }}
@endif
{{-- MODAL TAMBAH USER --}}
@csrf
{{-- MODAL EDIT USER --}}
@csrf @method('PUT')
{{-- MODAL DETAIL USER --}}
{{-- MODAL DELETE KONFIRMASI --}}
@csrf @method('DELETE')
@endsection @section('scripts') @endsection