@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) @section('content') @include('layouts.navbars.auth.topnav', ['title' => 'Dashboard']) @php $totals = $dashboardTotals ?? ['need_action' => 0, 'expiring' => 0, 'expired' => 0, 'still_valid' => 0, 'lifetime' => 0]; $grandTotal = array_sum($totals); $safeGrandTotal = max($grandTotal, 1); $healthPercent = $dashboardHealthPercent ?? 0; $safeDocuments = ($totals['still_valid'] ?? 0) + ($totals['lifetime'] ?? 0); $pNeed = round(($totals['need_action'] / $safeGrandTotal) * 100, 2); $pExpiring = round(($totals['expiring'] / $safeGrandTotal) * 100, 2); $pExpired = round(($totals['expired'] / $safeGrandTotal) * 100, 2); $pStillValid = round(($totals['still_valid'] / $safeGrandTotal) * 100, 2); $pLifetime = round(($totals['lifetime'] / $safeGrandTotal) * 100, 2); $stopNeed = $pNeed; $stopExpiring = $stopNeed + $pExpiring; $stopExpired = $stopExpiring + $pExpired; $stopStillValid = $stopExpired + $pStillValid; @endphp @if (!in_array('purchs', $roles))
MSJ Document Management
{{--

Ringkasan status dokumen legal dan sertifikasi dalam satu dashboard.

--}}
Total Dokumen : {{ number_format($grandTotal) }}
Grafik Status Dokumen

Presentase dokumen sesuai status dari total seluruh dokumen

{{-- {{ $healthPercent }}% --}}
Perlu Diurus
Akan Expired
Sudah Expired
Masih Berlaku
{{--
Masih Berlaku: {{ number_format($safeDocuments) }} dari {{ number_format($grandTotal) }}
--}}
Distribusi berdasarkan Tipe

Rincian persebaran status dokumen per tipe

@foreach (($dashboardCards ?? []) as $card) @php $countAction = (int) ($card['need_action'] ?? 0); $countExpiring = (int) ($card['expiring'] ?? 0); $countExpired = (int) ($card['expired'] ?? 0); $countStillValid = (int) ($card['still_valid'] ?? 0); $countLifetime = (int) ($card['lifetime'] ?? 0); $categoryTotal = max(((int) ($card['total'] ?? 0)), 1); $pAction = round(($countAction / $categoryTotal) * 100, 2); $pExpiring = round(($countExpiring / $categoryTotal) * 100, 2); $pExpired = round(($countExpired / $categoryTotal) * 100, 2); $pStillValid = round(($countStillValid / $categoryTotal) * 100, 2); $pLifetime = round(($countLifetime / $categoryTotal) * 100, 2); @endphp
{{ $card['title'] }} {{ number_format($card['total'] ?? 0) }} Dokumen
@if ($countAction > 0) {{ number_format($countAction) }} @endif @if ($countExpiring > 0) {{ number_format($countExpiring) }} @endif @if ($countExpired > 0) {{ number_format($countExpired) }} @endif @if ($countStillValid > 0) {{ number_format($countStillValid) }} @endif @if ($countLifetime > 0) {{ number_format($countLifetime) }} @endif
@endforeach
@foreach (($dashboardCards ?? []) as $idx => $card) @php $pAction = $card['percent_need_action'] ?? 0; $pExpiring = $card['percent_expiring'] ?? 0; $pExpired = $card['percent_expired'] ?? 0; $pStillValid = $card['percent_still_valid'] ?? 0; $pLifetime = $card['percent_lifetime'] ?? 0; $modalId = 'modalDashboardDetail' . $idx; @endphp
{{ $card['title'] }}
Data Perlu Diurus
{{ number_format($card['need_action']) }}
dokumen
Data Akan Expired
{{ number_format($card['expiring']) }}
dokumen
Data Sudah Expired
{{ number_format($card['expired']) }}
dokumen
Masih Berlaku
{{ number_format($card['still_valid']) }}
dokumen
@endforeach
@else

Email Belum Dikirim

{{ $countpo }}

Total Email Terkirim Hari Ini

{{ $emailtudei }}
@endif @endsection