@php $totalCategorySeconds = $categoryUsageSummary->sum('total_usage'); $catLabels = []; $catPercentages = []; $catTimes = []; foreach ($categoryUsageSummary as $row) { $catLabels[] = $row->category_name; $percent = round(($row->total_usage / $totalCategorySeconds) * 100, 2); $catPercentages[] = $percent; $h = floor($row->total_usage / 3600); $m = floor(($row->total_usage % 3600) / 60); $s = $row->total_usage % 60; $catTimes[] = sprintf('%02d:%02d:%02d', $h, $m, $s); } $totalSubSeconds = $subCategoryUsageSummary->sum('total_usage'); $subCatLabels = []; $subCatPercentages = []; $subCatTimes = []; foreach ($subCategoryUsageSummary as $row) { $subCatLabels[] = $row->subcategory_name; $percent = round(($row->total_usage / $totalSubSeconds) * 100, 2); $subCatPercentages[] = $percent; $h = floor($row->total_usage / 3600); $m = floor(($row->total_usage % 3600) / 60); $s = $row->total_usage % 60; $subCatTimes[] = sprintf('%02d:%02d:%02d', $h, $m, $s); } @endphp
# | Application | Title | Usage Time | MAC Address | Logged At | Created At |
---|---|---|---|---|---|---|
{{ $index + 1 }} | {{ $log->application }} | {{ $log->title }} | @php $hours = floor($log->usage_seconds / 3600); $minutes = floor(($log->usage_seconds % 3600) / 60); $seconds = $log->usage_seconds % 60; @endphp {{ sprintf('%02d:%02d:%02d', $hours, $minutes, $seconds) }} | {{ $log->mac_address }} | {{ \Carbon\Carbon::parse($log->logged_at)->format('Y-m-d H:i') }} | {{ \Carbon\Carbon::parse($log->created_at)->format('Y-m-d H:i') }} |
No logs found for the selected date range.
@endif