@extends('layouts.app') @section('title', 'Element 12: Measurement & Improvement') @section('content')

Element 12: Measurement, Analysis and Improvement

Measure and analyze performance for continuous improvement

Performance Dashboard

{{ $kpis->count() }}

Total KPIs defined

@php $kpisWithValues = $kpis->where('current_value', '!=', null); $achievedKpis = $kpisWithValues->filter(fn($kpi) => $kpi->current_value >= $kpi->target_value); $achievementRate = $kpisWithValues->count() > 0 ? round(($achievedKpis->count() / $kpisWithValues->count()) * 100) : 0; @endphp

{{ $achievementRate }}%

KPI achievement rate

{{ $inspections->where('status', 'completed')->count() }}

of {{ $inspections->count() }} inspections completed

@php $completionRate = $actions->count() > 0 ? round(($actions->where('status', 'completed')->count() / $actions->count()) * 100) : 0; @endphp

{{ $completionRate }}%

Actions completed

KPI Performance by Category (Reviewable)

@php $categories = $kpis->groupBy('category'); @endphp
@foreach($categories as $category => $categoryKpis) @php $withValues = $categoryKpis->where('current_value', '!=', null); $achieved = $withValues->filter(fn($kpi) => $kpi->current_value >= $kpi->target_value)->count(); $total = $withValues->count(); $percentage = $total > 0 ? round(($achieved / $total) * 100) : 0; @endphp
{{ $category }} {{ $achieved }}/{{ $total }} ({{ $percentage }}%)
@endforeach

Inspection & Audit Status Overview

@php $statusCounts = [ 'completed' => $inspections->where('status', 'completed')->count(), 'in_progress' => $inspections->where('status', 'in_progress')->count(), 'scheduled' => $inspections->where('status', 'scheduled')->count(), 'cancelled' => $inspections->where('status', 'cancelled')->count(), ]; $maxCount = max(array_merge($statusCounts, [1])); @endphp @foreach($statusCounts as $status => $count)
{{ ucfirst($status) }} {{ $count }}
@endforeach

Performance Data Review Status

Last KPI Review

@php $lastKpiUpdate = $kpis->where('current_value', '!=', null)->sortByDesc('updated_at')->first(); @endphp @if($lastKpiUpdate)

{{ $lastKpiUpdate->kpi_name }}

Updated {{ $lastKpiUpdate->updated_at->diffForHumans() }}

@else

No recent updates

@endif

Last Inspection

@php $lastInspection = $inspections->sortByDesc('scheduled_date')->first(); @endphp @if($lastInspection)

{{ Str::limit($lastInspection->inspection_title, 30) }}

{{ $lastInspection->scheduled_date ? $lastInspection->scheduled_date->format('d M Y') : 'N/A' }}

@else

No inspections found

@endif

Latest Action

@php $latestAction = $actions->sortByDesc('updated_at')->first(); @endphp @if($latestAction)

{{ Str::limit($latestAction->action_title, 30) }}

Status: {{ ucfirst($latestAction->status) }}

@else

No actions found

@endif
All performance data is reviewable and tracked for continuous improvement

Performance KPIs (Define & Track)

@forelse($kpis as $kpi) @empty @endforelse
KPI Number KPI Name Category Target Current Achievement Frequency Status Last Review
{{ $kpi->kpi_number }} {{ $kpi->kpi_name }} {{ $kpi->category }} {{ $kpi->target_value }} {{ $kpi->measurement_unit }} @if($kpi->current_value) {{ $kpi->current_value }} {{ $kpi->measurement_unit }} @else Not measured @endif @if($kpi->current_value && $kpi->target_value > 0) @php $achievement = round(($kpi->current_value / $kpi->target_value) * 100); @endphp
{{ $achievement }}%
@else N/A @endif
{{ $kpi->measurement_frequency }} {{ ucfirst($kpi->status) }} {{ $kpi->updated_at->diffForHumans() }}
No performance KPIs defined

Quality Inspections & Audits

@forelse($inspections as $inspection) @empty @endforelse
Inspection Number Title Type Scheduled Date Inspector Status Rating Follow-up
{{ $inspection->inspection_number }} {{ Str::limit($inspection->inspection_title, 40) }} {{ str_replace('_', ' ', ucfirst($inspection->inspection_type)) }} {{ $inspection->scheduled_date ? $inspection->scheduled_date->format('d M Y') : 'N/A' }} {{ $inspection->inspector_name }} {{ ucfirst($inspection->status) }} @if($inspection->overall_rating) {{ str_replace('_', ' ', ucfirst($inspection->overall_rating)) }} @else Not rated @endif {{ $inspection->follow_up_required ? 'Yes' : 'No' }}
No quality inspections found

Improvement Actions (Track & Verify)

@forelse($actions as $action) @empty @endforelse
Action Number Title Type Priority Target Date Responsible Status Verification Effectiveness
{{ $action->action_number }} {{ Str::limit($action->action_title, 40) }} {{ str_replace('_', ' ', ucfirst($action->action_type)) }} {{ ucfirst($action->priority) }} {{ $action->target_completion_date ? $action->target_completion_date->format('d M Y') : 'N/A' }} {{ $action->responsible_person }} {{ ucfirst($action->status) }} {{ str_replace('_', ' ', ucfirst($action->verification_status)) }} @if($action->effectiveness_rating && $action->effectiveness_rating !== 'not_assessed') {{ str_replace('_', ' ', ucfirst($action->effectiveness_rating)) }} @else Not assessed @endif
No improvement actions tracked
@endsection