@extends('adminlte::page') @section('title', config('adminlte.title') . ' | Medical Facts') @section('content_header')

Medical Facts

@stop @section('content')
@if (session('success')) @endif
Create New Medical Facts @if ($recycleBin->isNotEmpty()) @php $user = Auth::user(); $RecycleCount = App\Models\MedicalFacts::onlyTrashed() ->where('employee_id', $user->id) ->count(); @endphp @endif

@php $medicalColl = collect($medical); $total = $medicalColl->count(); // counts as a Collection (key => count) $bySeverity = $medicalColl->countBy('severity'); // Ensure keys exist $mild = $bySeverity->get('Mild', 0); $mod = $bySeverity->get('Moderate', 0); $sev = $bySeverity->get('Severe', 0); @endphp {{-- statistics --}}
Total {{ $total }}
Mild {{ $mild }}
Moderate {{ $mod }}
Severe {{ $sev }}
{{-- Recycle Bin --}} {{-- Data --}}

Medical Records

@foreach ($medical as $med) @if (!empty($med->id)) @endif @endforeach
# Fact Severity Fact Type Last Updated Actions
{{ $med->id }} {{ $med->fact }} {{ $med->severity }} {{ $med->facttype }} {{ date('d/m/Y H:i', strtotime($med->updated_at)) }}
@stop @section('footer')   @stop