@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))
Ringkasan status dokumen legal dan sertifikasi dalam satu dashboard.
--}}Presentase dokumen sesuai status dari total seluruh dokumen
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