@extends('adminlte::page') @section('title', config('adminlte.title') . ' | Emergency Contacts') @section('content_header')

Emergency Contacts

@stop @section('content') {{-- Main Content Card --}}
@if (session('success')) @endif
Create new emergency contact @if ($recycleBin->isNotEmpty()) @php $user = Auth::user(); $recycleCount = App\Models\EmergencyContact::onlyTrashed() ->where('employee_id', $user->id) ->count(); @endphp @endif

{{-- Statistics Cards --}} @php $totalContacts = $emergencies->count(); $primaryContacts = $emergencies->where('primary', 1)->count(); $secondaryContacts = $emergencies->where('primary', 0)->count(); $deletedContacts = $recycleBin->count(); @endphp
Total {{ $totalContacts }}
Primary {{ $primaryContacts }}
Secondary {{ $secondaryContacts }}
{{-- Recycle Bin --}} {{-- Data --}}

Emergency Contacts Records

@foreach ($emergencies as $emergency) {{-- Fixed typo in 'relationship' --}} {{-- Modal for this row --}} @endforeach
# Name Relationship Telephone Mobile Type Actions
{{ $emergency->id }} {{ $emergency->name }} {{ $emergency->relationship }}{{ $emergency->telephone }} {{ $emergency->mobile }} @if ($emergency->primary == 1) Primary @else - @endif
@stop @section('footer')   @stop