@extends('layouts.app') @section('title','Discipline Management') @section('page-title','Discipline Management') @section('content') @if(!auth()->user()->canAccess('discipline'))
You do not have permission to access Discipline Management.
@else
{{ $counts['open'] ?? 0 }}
Open
{{ $counts['in_progress'] ?? 0 }}
In Progress
{{ $counts['resolved'] ?? 0 }}
Resolved
{{ $counts['closed'] ?? 0 }}
Closed
{{ $records->total() }} Cases @if(auth()->user()->isDeptHead()) Your Dept. Only @endif @if(auth()->user()->isHrOrAdmin()) @endif
@forelse($records as $rec) @php $sevStyle = match($rec->infraction_type ?? '') { 'Harassment', 'Gross Negligence' => 'background:#fee2e2;color:#991b1b', 'Policy Violation', 'Insubordination' => 'background:#fef3c7;color:#92400e', default => 'background:#f1f5f9;color:var(--text-1)', }; @endphp @empty @endforelse
Case #EmployeeInfraction Incident Date Action Taken Status Actions
{{ $rec->case_number }}
{{ strtoupper(substr($rec->employee->first_name??'?',0,1)) }}
{{ $rec->employee->full_name ?? '—' }}
{{ $rec->employee->department->name ?? '' }}
{{ $rec->infraction_type }} {{ $rec->incident_date?->format('M d, Y') }} @if($rec->action_taken) {{ ucfirst(str_replace('_',' ',$rec->action_taken)) }} @else Pending @endif {{ ucfirst($rec->status) }}
@if(auth()->user()->isHrOrAdmin() && $rec->status === 'open') @endif
No discipline records found
@if($records->hasPages())
{{ $records->links('pagination::bootstrap-5') }}
@endif
@endif @endsection