{{-- Document Row Partial --}} @php $extension = pathinfo($doc->docname, PATHINFO_EXTENSION); $icons = [ 'docx' => 'fas fa-file-word text-primary', 'doc' => 'fas fa-file-word text-primary', 'ppt' => 'fas fa-file-powerpoint text-orange', 'pptx' => 'fas fa-file-powerpoint text-orange', 'pdf' => 'fas fa-file-pdf text-danger', 'xls' => 'fas fa-file-excel text-success', 'xlsx' => 'fas fa-file-excel text-success', 'csv' => 'fas fa-file-csv text-success', 'png' => 'fas fa-file-image text-info', 'jpg' => 'fas fa-file-image text-info', 'jpeg' => 'fas fa-file-image text-info', 'default' => 'far fa-file text-secondary', ]; $fileIcon = $icons[$extension] ?? $icons['default']; $filename = pathinfo($doc->docname)['filename']; @endphp {{ $doc->id }} @if ($type === 'company' && $doc->req_read == 1) @php $getRead = \app\models\FileRead::where('doc_id', $doc->id)->where('employee_id', $user->id)->first(); $DLTS = strtotime($user->probation_date); $todayTS = now()->getTimestamp(); @endphp @if ($getRead && $getRead->read_flag === 0 && $DLTS < $todayTS) {{ $filename }} OVERDUE @elseif($getRead && $getRead->read_flag === 0) {{ $filename }} UNREAD @else {{ $filename }} @endif @else {{ $filename }} @endif {{ $doc->description }} {{ date('d/m/Y H:i', strtotime($doc->updated_at)) }}
@if ($type === 'company' && $doc->req_read === 1 && isset($getRead) && $getRead->read_flag === 0) @endif
@if ($type === 'company' && $doc->req_read === 1 && isset($getRead) && $getRead->read_flag === 0) @include('documents._read-confirmation-modal', ['doc' => $doc]) @endif