@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') @include('layouts.breadcrumb', [ 'title' => 'Overview', 'current' => 'Overview', 'homeRoute' => 'dashboard', ]) @include('staff_attendance.layouts.profile-index')
Overview
@include('staff_attendance.components.card-analytics') @php $attendanceOverviewMonthLabel = (string) ($profileAttendanceOverviewMonthLabel ?? now('Asia/Jakarta')->format('F')); $attendanceOverviewSeries = array_values($profileAttendanceOverviewSeries ?? [0, 0, 0, 0]); $attendanceOverviewChartSeries = array_sum($attendanceOverviewSeries) > 0 ? $attendanceOverviewSeries : [1]; $attendanceOverviewChartColors = array_sum($attendanceOverviewSeries) > 0 ? ['#27BC48', '#FF3282', '#1EA7C5', '#FFBC11'] : ['#F2F3F8']; $attendanceProgressPercent = (float) ($profileAttendanceProgressPercent ?? 0); $daysWorkedProgressPercent = (float) ($profileDaysWorkedProgressPercent ?? 0); $attendanceDaysCount = (int) ($profileAttendanceDaysCount ?? 0); $elapsedWorkingDaysCount = (int) ($profileElapsedWorkingDaysCount ?? 0); $workingDaysCount = (int) ($profileWorkingDaysCount ?? 0); $progressOnTimePercent = (float) ($profileProgressOnTimePercent ?? 0); $progressOnTimeLabel = number_format($progressOnTimePercent, 0, '.', ''); $progressOnTimeCount = (int) ($profileProgressOnTimeCount ?? 0); $progressOnTimeTotal = (int) ($profileProgressOnTimeTotal ?? $attendanceDaysCount); $progressLatePercent = (float) ($profileProgressLatePercent ?? 0); $progressLateLabel = number_format($progressLatePercent, 0, '.', ''); $progressLateCount = (int) ($profileProgressLateCount ?? 0); $progressLateTotal = (int) ($profileProgressLateTotal ?? $attendanceDaysCount); $weeklyRequiredHours = (float) ($profileWeeklyRequiredHours ?? 0); $weeklyRequiredHoursTarget = (int) ($profileWeeklyRequiredHoursTarget ?? 40); $weeklyRequiredHoursPercent = (int) ($profileWeeklyRequiredHoursPercent ?? 0); $weeklyOvertimeHours = (float) ($profileWeeklyOvertimeHours ?? 0); $weeklyOvertimeHoursTarget = (int) ($profileWeeklyOvertimeHoursTarget ?? 18); $weeklyOvertimeHoursPercent = (int) ($profileWeeklyOvertimeHoursPercent ?? 0); $weeklyRequiredHoursLabel = rtrim(rtrim(number_format($weeklyRequiredHours, 2, '.', ''), '0'), '.'); $weeklyOvertimeHoursLabel = rtrim(rtrim(number_format($weeklyOvertimeHours, 2, '.', ''), '0'), '.'); $defaultYearMonthLabels = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; $emptyYearSeries = array_fill(0, 12, 0); $yearChartYear = (int) ($profileYearChartYear ?? now('Asia/Jakarta')->year); $yearMonthLabels = array_values($profileYearMonthLabels ?? []); $yearMonthLabels = count($yearMonthLabels) === 12 ? $yearMonthLabels : $defaultYearMonthLabels; $yearAttendanceOnTimeSeries = array_values($profileYearAttendanceOnTimeSeries ?? $emptyYearSeries); $yearAttendanceLateSeries = array_values($profileYearAttendanceLateSeries ?? $emptyYearSeries); $yearAttendanceLeaveSeries = array_values($profileYearAttendanceLeaveSeries ?? $emptyYearSeries); $yearLeaveSeries = array_values($profileYearLeaveSeries ?? $emptyYearSeries); $yearSickSeries = array_values($profileYearSickSeries ?? $emptyYearSeries); $yearBusinessTripSeries = array_values($profileYearBusinessTripSeries ?? $emptyYearSeries); $yearOvertimeHoursSeries = array_values($profileYearOvertimeHoursSeries ?? $emptyYearSeries); @endphp

Attendance Overview ({{ $attendanceOverviewMonthLabel }})

  • On Time
  • Late
  • Leave
  • Alpha

Progress ({{ $attendanceOverviewMonthLabel }})

Days Worked ({{ $elapsedWorkingDaysCount }}/{{ $workingDaysCount }} Days)

Tracking working days that have elapsed against scheduled working days for the current month.

{{ $progressOnTimeCount }}/{{ max($progressOnTimeTotal, 1) }}

On Time ({{ $progressOnTimeLabel }}%)

{{ $progressOnTimeCount }} {{ Str::plural('Day', $progressOnTimeCount) }} / {{ $progressOnTimeTotal }} {{ Str::plural('Day', $progressOnTimeTotal) }}
{{ $progressLateCount }}/{{ max($progressLateTotal, 1) }}

Late ({{ $progressLateLabel }}%)

{{ $progressLateCount }} {{ Str::plural('Day', $progressLateCount) }} / {{ $progressLateTotal }} {{ Str::plural('Day', $progressLateTotal) }}
{{ $weeklyRequiredHours }}/{{ max($weeklyRequiredHoursTarget, 1) }}

Required Hours ({{ $weeklyRequiredHoursPercent }}%)

{{ $weeklyRequiredHoursLabel }} Hrs / {{ $weeklyRequiredHoursTarget }} Hrs Per Week
{{ $weeklyOvertimeHours }}/{{ max($weeklyOvertimeHoursTarget, 1) }}

Overtime Logged ({{ $weeklyOvertimeHoursPercent }}%)

{{ $weeklyOvertimeHoursLabel }} Hrs / {{ $weeklyOvertimeHoursTarget }} Hrs Per Week

Attendance Overview ({{ $yearChartYear }})

Leave Overview ({{ $yearChartYear }})

Business Trip Overview ({{ $yearChartYear }})

Overtime Overview ({{ $yearChartYear }})

@endsection @section('script') @php $dashboardJsPath = public_path('assets/js/dashboard.js'); $dashboardJsVersion = file_exists($dashboardJsPath) ? filemtime($dashboardJsPath) : time(); $chartJsPath = public_path('assets/vendor/chart-js/chart.bundle.min.js'); $chartJsVersion = file_exists($chartJsPath) ? filemtime($chartJsPath) : time(); @endphp @endsection