@extends('layouts.main') @section('title', 'Dashboard Andalan') @section('css') @php $dashboardCssPath = public_path('assets/css/dashboard.css'); $dashboardCssVersion = file_exists($dashboardCssPath) ? filemtime($dashboardCssPath) : time(); @endphp @endsection @section('navbarTitle', 'Overview') @section('content') @php $dailyAttendanceDateLabel = (string) ($dailyAttendanceDateLabel ?? now('Asia/Jakarta')->format('d F Y')); $dailyTotalStaffCount = (int) ($dailyTotalStaffCount ?? 0); $dailyPresentStaffCount = (int) ($dailyPresentStaffCount ?? 0); $dailyOnTimeCount = (int) ($dailyOnTimeCount ?? 0); $dailyLateCount = (int) ($dailyLateCount ?? 0); $dailyLeaveCount = (int) ($dailyLeaveCount ?? 0); $dailyDeviationCount = (int) ($dailyDeviationCount ?? 0); $dailyOnTimePercent = (int) ($dailyOnTimePercent ?? 0); $dailyLatePercent = (int) ($dailyLatePercent ?? 0); $dailyLeavePercent = (int) ($dailyLeavePercent ?? 0); $dailyDeviationPercent = (int) ($dailyDeviationPercent ?? 0); $dailyOnTimeDonutValue = (string) ($dailyOnTimeDonutValue ?? '0/1'); $dailyLateDonutValue = (string) ($dailyLateDonutValue ?? '0/1'); $dailyLeaveDonutValue = (string) ($dailyLeaveDonutValue ?? '0/1'); $dailyDeviationDonutValue = (string) ($dailyDeviationDonutValue ?? '0/1'); $attendanceProgressPercent = (int) ($attendanceProgressPercent ?? 0); $attendanceOverviewSeries = array_values($attendanceOverviewSeries ?? [0, 0, 0, 0]); $attendanceOverviewChartSeries = array_sum($attendanceOverviewSeries) > 0 ? $attendanceOverviewSeries : [1]; $attendanceOverviewChartColors = array_sum($attendanceOverviewSeries) > 0 ? ['#2BC155', '#F94687', '#1EA7C5', '#FFBC11'] : ['#F2F3F8']; $weeklyAttendanceRangeLabel = (string) ($weeklyAttendanceRangeLabel ?? now('Asia/Jakarta')->startOfWeek()->format('d').' - '.now('Asia/Jakarta')->startOfWeek()->addDays(4)->format('d F Y')); $weeklyDayLabels = array_values($weeklyDayLabels ?? []); $weeklyAttendanceSeries = array_values($weeklyAttendanceSeries ?? [ ['name' => 'On Time', 'data' => [0, 0, 0, 0, 0]], ['name' => 'Late', 'data' => [0, 0, 0, 0, 0]], ]); $weeklyOutOfOfficeSeries = array_values($weeklyOutOfOfficeSeries ?? [ ['name' => 'Leave', 'data' => [0, 0, 0, 0, 0]], ['name' => 'Business Trip', 'data' => [0, 0, 0, 0, 0]], ['name' => 'Deviation', 'data' => [0, 0, 0, 0, 0]], ]); $weeklyOvertimeHoursSeries = array_values($weeklyOvertimeHoursSeries ?? [0, 0, 0, 0, 0]); $monthlyAttendanceRangeLabel = (string) ($monthlyAttendanceRangeLabel ?? now('Asia/Jakarta')->startOfMonth()->format('d').' - '.now('Asia/Jakarta')->endOfMonth()->format('d F Y')); $monthlyDayLabels = array_values($monthlyDayLabels ?? []); $monthlyAttendanceSeries = array_values($monthlyAttendanceSeries ?? [ ['name' => 'On Time', 'data' => []], ['name' => 'Late', 'data' => []], ]); $monthlyOutOfOfficeSeries = array_values($monthlyOutOfOfficeSeries ?? [ ['name' => 'Leave', 'data' => []], ['name' => 'Business Trip', 'data' => []], ['name' => 'Deviation', 'data' => []], ]); $yearToDateYearLabel = (string) ($yearToDateYearLabel ?? now('Asia/Jakarta')->format('Y')); $yearToDateMonthLabels = array_values($yearToDateMonthLabels ?? ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']); $yearToDateLeaveSeries = array_values($yearToDateLeaveSeries ?? [ ['name' => 'Leave', 'data' => array_fill(0, 12, 0)], ]); $yearToDateOvertimeHoursSeries = array_values($yearToDateOvertimeHoursSeries ?? array_fill(0, 12, 0)); @endphp @include('admin_attendance.layout.navbar')