@extends('layouts.app') @section('titlepage', 'Dashboard') @section('content') @section('navigasi') Dashboard @endsection
@php $authUser = auth()->user(); $fullName = $authUser->name ?? 'Pengguna'; $userName = explode(' ', $fullName)[0]; // Ambil nama depan saja $currentHour = (int) date('H'); if ($currentHour >= 5 && $currentHour < 12) { $greeting = 'Selamat Pagi'; } elseif ($currentHour >= 12 && $currentHour < 15) { $greeting = 'Selamat Siang'; } elseif ($currentHour >= 15 && $currentHour < 19) { $greeting = 'Selamat Sore'; } else { $greeting = 'Selamat Malam'; } $tanggalHariIni = getnamaHari(date('D')) . ', ' . DateToIndo(date('Y-m-d')); @endphp
{{ $greeting }},
{{ $userName }} 👋
{{ $tanggalHariIni }}
@php $presenceStats = [ [ 'title' => 'Total Hadir', 'value' => $rekappresensi->hadir ?? 0, 'meta' => 'Karyawan hadir hari ini', 'trend' => 'Live update', 'icon' => 'ti ti-user-check', 'class' => 'stat-card--highlight ', ], [ 'title' => 'Izin', 'value' => $rekappresensi->izin ?? 0, 'meta' => 'Sedang izin resmi', 'trend' => 'Terverifikasi', 'icon' => 'ti ti-file-description', 'accent' => '#2563eb', ], [ 'title' => 'Sakit', 'value' => $rekappresensi->sakit ?? 0, 'meta' => 'Sedang sakit', 'trend' => 'Realtime update', 'icon' => 'ti ti-ambulance', 'accent' => '#d97706', ], [ 'title' => 'Cuti', 'value' => $rekappresensi->cuti ?? 0, 'meta' => 'Sedang cuti ', 'trend' => 'Terjadwal', 'icon' => 'ti ti-briefcase', 'accent' => '#7c3aed', ], ]; @endphp
@foreach ($presenceStats as $stat)

{{ $stat['title'] }}

{{ $stat['value'] }}

@if (isset($stat['is_storage']))

{{ $stat['meta'] }} {{ $stat['trend'] }}

@else

{{ $stat['meta'] }}

@endif
@endforeach

Data Karyawan Aktif

{{ $status_karyawan->jml_aktif }}

view sales
@foreach ($status_karyawan->rekap_status as $rekap) @php // Cycle through images karyawan2, karyawan3, karyawan4 $imgIndex = ($loop->index % 3) + 2; $ext = ($imgIndex == 2 || $imgIndex == 4) ? 'webp' : 'png'; $borderClass = ($loop->last) ? '' : 'border-end'; $widgetClass = 'card-widget-' . (($loop->iteration % 4) + 1); @endphp

{{ $rekap->nama_status_karyawan }}

{{ $rekap->total }}

view sales
@endforeach
@php $contractTabs = [ [ 'id' => 'lewatjatuhtempo', 'label' => 'Lewat Jatuh Tempo', 'badge' => 'bg-label-danger', 'icon' => 'ti ti-alert-octagon', 'items' => $kontrak_lewat, 'showRemaining' => false, 'accent' => '#dc2626', 'active' => false, ], [ 'id' => 'bulanini', 'label' => 'Bulan Ini', 'badge' => 'bg-label-danger', 'icon' => 'ti ti-calendar-event', 'items' => $kontrak_bulanini, 'showRemaining' => true, 'accent' => '#f97316', 'active' => true, ], [ 'id' => 'bulandepan', 'label' => 'Bulan Depan', 'badge' => 'bg-label-warning', 'icon' => 'ti ti-calendar-stats', 'items' => $kontrak_bulandepan, 'showRemaining' => true, 'accent' => '#facc15', 'active' => false, ], [ 'id' => 'duabulan', 'label' => '2 Bulan Lagi', 'badge' => 'bg-label-success', 'icon' => 'ti ti-calendar-time', 'items' => $kontrak_duabulan, 'showRemaining' => true, 'accent' => '#22c55e', 'active' => false, ], ]; $contractSummary = [ [ 'label' => 'Lewat Tempo', 'count' => count($kontrak_lewat), 'icon' => 'ti ti-alert-triangle', 'accent' => 'linear-gradient(120deg,#f43f5e,#b91c1c)', ], [ 'label' => 'Bulan Ini', 'count' => count($kontrak_bulanini), 'icon' => 'ti ti-calendar-event', 'accent' => 'linear-gradient(120deg,#f97316,#ea580c)', ], [ 'label' => 'Bulan Depan', 'count' => count($kontrak_bulandepan), 'icon' => 'ti ti-calendar-stats', 'accent' => 'linear-gradient(120deg,#facc15,#eab308)', ], [ 'label' => '2 Bulan', 'count' => count($kontrak_duabulan), 'icon' => 'ti ti-calendar-time', 'accent' => 'linear-gradient(120deg,#34d399,#059669)', ], ]; @endphp

Karyawan Habis Kontrak

Pantau kontrak yang segera atau sudah melewati jatuh tempo
Total {{ count($kontrak_lewat) + count($kontrak_bulanini) + count($kontrak_bulandepan) + count($kontrak_duabulan) }} Kontrak
@foreach ($contractSummary as $summary)

{{ $summary['label'] }}

{{ $summary['count'] }}

@endforeach
@endsection @push('myscript') {{ $chart->script() }} {{ $jkchart->script() }} {{ $pddchart->script() }} @endpush