Refactor global stats handling and user ID access

Moved global stats logic from LayoutHelper to Domain model and updated views/controllers to use the new stats structure. Replaced direct $_SESSION['user_id'] access with Core\Auth::id() for consistency. Cleaned up redundant code and improved isolation mode handling for statistics.
This commit is contained in:
Hosteroid
2025-10-20 18:38:58 +03:00
parent 719fb86c7a
commit 7ad01a7da0
8 changed files with 47 additions and 91 deletions

View File

@@ -84,7 +84,7 @@
</div>
<span class="text-gray-400 text-xs">Total</span>
</div>
<span class="text-white font-semibold text-sm"><?= $globalStats['total'] ?? 0 ?></span>
<span class="text-white font-semibold text-sm"><?= $stats['total'] ?? 0 ?></span>
</div>
</div>
@@ -94,9 +94,9 @@
<div class="w-7 h-7 bg-orange-500/20 rounded flex items-center justify-center mr-2.5">
<i class="fas fa-exclamation-triangle text-orange-400 text-xs"></i>
</div>
<span class="text-gray-400 text-xs" title="Within <?= $globalStats['expiring_threshold'] ?? 30 ?> days">Expiring</span>
<span class="text-gray-400 text-xs" title="Within <?= $stats['expiring_threshold'] ?? 30 ?> days">Expiring</span>
</div>
<span class="text-orange-400 font-semibold text-sm"><?= $globalStats['expiring_soon'] ?? 0 ?></span>
<span class="text-orange-400 font-semibold text-sm"><?= $stats['expiring_soon'] ?? 0 ?></span>
</div>
</div>
@@ -108,7 +108,7 @@
</div>
<span class="text-gray-400 text-xs">Active</span>
</div>
<span class="text-green-400 font-semibold text-sm"><?= $globalStats['active'] ?? 0 ?></span>
<span class="text-green-400 font-semibold text-sm"><?= $stats['active'] ?? 0 ?></span>
</div>
</div>
</div>