@extends('layouts.app') @section('title', 'Element 11: Emergency Preparedness and Contingency Planning') @section('content')

Element 11: Emergency Preparedness and Contingency Planning

Define emergency response plans, conduct drills, and maintain escalation contacts

Emergency Readiness Dashboard

Response Plans

{{ $responsePlans->count() }}

{{ $responsePlans->where('approval_status', 'approved')->count() }} approved

Drills This Year
@php $drillsThisYear = $drills->where('status', 'completed')->filter(function($drill) { return $drill->scheduled_date && $drill->scheduled_date->year == date('Y'); })->count(); @endphp

{{ $drillsThisYear }}

Completed drills

Upcoming Drills

{{ $drills->whereIn('status', ['scheduled'])->count() }}

Scheduled drills

Active Contacts

{{ $contacts->count() }}

Escalation contacts

Drill Performance Trends

@php $performanceRatings = [ 'excellent' => ['label' => 'Excellent', 'color' => 'green'], 'good' => ['label' => 'Good', 'color' => 'blue'], 'satisfactory' => ['label' => 'Satisfactory', 'color' => 'yellow'], 'needs_improvement' => ['label' => 'Needs Improvement', 'color' => 'orange'], 'unsatisfactory' => ['label' => 'Unsatisfactory', 'color' => 'red'] ]; $completedDrills = $drills->where('status', 'completed')->whereNotNull('performance_rating'); $totalRated = max($completedDrills->count(), 1); @endphp @foreach($performanceRatings as $rating => $info) @php $count = $completedDrills->where('performance_rating', $rating)->count(); $percentage = ($count / $totalRated) * 100; @endphp
{{ $info['label'] }}
{{ $count }}
@endforeach

Periodic Testing Status

@php $now = now(); $thisQuarter = $drills->where('status', 'completed')->filter(function($drill) use ($now) { return $drill->scheduled_date && $drill->scheduled_date->isCurrentQuarter(); })->count(); $lastQuarter = $drills->where('status', 'completed')->filter(function($drill) use ($now) { return $drill->scheduled_date && $drill->scheduled_date->between($now->copy()->subQuarter(), $now->copy()->subQuarter()->endOfQuarter()); })->count(); @endphp
This Quarter {{ $thisQuarter }} drills completed
Last Quarter {{ $lastQuarter }} drills completed
Next Scheduled @php $nextDrill = $drills->where('status', 'scheduled')->sortBy('scheduled_date')->first(); @endphp @if($nextDrill) {{ $nextDrill->scheduled_date->format('d M Y') }} @else No drills scheduled @endif
Emergency readiness tested quarterly

Emergency Response Plans

@forelse($responsePlans as $plan) @empty @endforelse
Plan # Plan Title Emergency Type Responsible Person Approval Status Version
{{ $plan->plan_number }} {{ $plan->plan_title }} {{ $plan->emergency_type }} {{ $plan->responsible_person }} {{ ucfirst(str_replace('_', ' ', $plan->approval_status)) }} {{ $plan->version }}
No emergency response plans found.

Emergency Drills and Exercises

@forelse($drills as $drill) @empty @endforelse
Drill # Drill Title Drill Type Scheduled Date Participants Status Performance
{{ $drill->drill_number }} {{ $drill->drill_title }} {{ $drill->drill_type }} {{ $drill->scheduled_date ? $drill->scheduled_date->format('d M Y H:i') : 'N/A' }} @if($drill->participants_actual) {{ $drill->participants_actual }}/{{ $drill->participants_expected }} @else Target: {{ $drill->participants_expected }} @endif {{ ucfirst(str_replace('_', ' ', $drill->status)) }} @if($drill->performance_rating) {{ ucfirst(str_replace('_', ' ', $drill->performance_rating)) }} @else Not rated @endif
No emergency drills found.

Emergency Escalation Contacts

@forelse($contacts as $contact) @empty @endforelse
Contact Type Organization Contact Person Phone Availability Priority Last Verified
{{ $contact->contact_type }} {{ $contact->organization_name }} {{ $contact->contact_person }}
{{ $contact->phone_primary }}
{{ $contact->availability }} {{ ucfirst($contact->priority_level) }} @if($contact->last_verified_date) {{ $contact->last_verified_date->diffForHumans() }} @else Needs verification @endif
No emergency contacts found.
@endsection