{{ $user->name }}
{{ $sickness->employeeref }}
{{ $sickness->persontype }}
{{ $sickness->department }}
{{ $sickness->division }}
{{ $sickness->location }}
{{ $sickness->category }}
@if ($sickness->status == 1)
Open
@else
Closed
@endif
{{ date('d/m/Y', strtotime($sickness->start)) }}
@if (!empty($sickness->end))
{{ date('d/m/Y', strtotime($sickness->end)) }}
@endif
{{ $sickness->days }}
{{ $sickness->reason }}
{{ $sickness->reviewnotes }}
@php
// Define the function before using it
function getFileTypeIcon($extension)
{
$icons = [
'docx' => 'fas fa-file-word fa-lg text-primary',
'doc' => 'fas fa-file-word fa-lg text-primary',
'ppt' => 'fas fa-file-powerpoint fa-lg text-orange',
'pttx' => 'fas fa-file-powerpoint fa-lg text-orange',
'pdf' => 'fas fa-file-pdf fa-lg text-danger',
'xls' => 'fas fa-file-excel fa-lg text-success',
'csv' => 'fas fa-file-csv fa-lg text-success',
'png' => 'fas fa-file-image fa-lg text-info',
'jpg' => 'fas fa-file-image fa-lg text-info',
'jpeg' => 'fas fa-file-image fa-lg text-info',
'psd' => 'fas fa-file-image fa-lg text-info',
'gif' => 'fas fa-file-image fa-lg text-info',
'bmp' => 'fas fa-file-image fa-lg text-info',
'mov' => 'fas fa-file-video fa-lg text-Purple',
'avi' => 'fas fa-file-video fa-lg text-Purple',
'mp4' => 'fas fa-file-video fa-lg text-Purple',
'mp3' => 'fas fa-file-audio fa-lg text-warning',
'wav' => 'fas fa-file-audio fa-lg text-warning',
'aiff' => 'fas fa-file-audio fa-lg text-warning',
'wma' => 'fas fa-file-audio fa-lg text-warning',
'default' => 'far fa-file fa-lg',
];
return $icons[$extension] ?? $icons['default'];
}
@endphp
@if (!empty($Docs))
@foreach ($Docs as $doc)
@php
$extension = pathinfo($doc->docname, PATHINFO_EXTENSION);
// Display file icon (using the corrected function call)
$fileIcon = getFileTypeIcon($extension);
@endphp
@endforeach
@else
No document(s) found.
@endif