@extends('layouts.app') @section('tab', 'dashboard') @section('content') @php $ref = $data['ref']; $k = $data['kpis']; $threshold = $data['threshold']; $colors = ['Selesai' => '#2E8B57', 'Berjalan' => '#2F75B5', 'OPEN' => '#D64545', 'Terlambat' => '#C55A11']; $kpiCards = [ ['TOTAL TASK', $k['total'], '#1F3864'], ['SELESAI', $k['done'], $colors['Selesai']], ['BERJALAN', $k['running'], $colors['Berjalan']], ['OPEN', $k['open'], $colors['OPEN']], ['TERLAMBAT', $k['late'], $colors['Terlambat']], ['DUE ≤ '.$threshold.' HARI', $k['due_soon'], '#BF9000'], ['PROGRES TOTAL', $k['progress'].'%', '#2F5597'], ]; $circumference = 2 * M_PI * 54; $offset = 0; $months = [1 => 'Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Agu', 'Sep', 'Okt', 'Nov', 'Des']; @endphp
DASHBOARD PROGRES  |  Posisi per: {{ $ref->day }} {{ $months[$ref->month] }} {{ $ref->year }}
@if ($sbuId) Reset @endif
@foreach ($kpiCards as [$label, $value, $color])
{{ $label }}
{{ $value }}
@endforeach

Status task

@foreach ($data['status_counts'] as $row) @php $length = $k['total'] > 0 ? $row['count'] / $k['total'] * $circumference : 0; @endphp @if ($length > 0) @endif @php $offset += $length; @endphp @endforeach {{ $k['total'] }} task
@foreach ($data['status_counts'] as $row)
{{ $row['status'] }} {{ $row['count'] }}
@endforeach
@foreach ($data['status_counts'] as $row) @endforeach
StatusJumlah%
{{ $row['status'] }} {{ $row['count'] }} {{ number_format($row['percent'], 1, ',', '.') }}%
Total {{ $k['total'] }} {{ $k['total'] > 0 ? '100%' : '0%' }}

Progres per modul

@foreach ($data['modules'] as $row) @endforeach @if ($data['modules_other']['total'] > 0) @php $other = $data['modules_other']; @endphp @endif
ModulTotalSelesaiBerjalan OPENTerlambatDue segeraProgres
{{ $row['name'] }} {{ $row['total'] }} {{ $row['done'] }} {{ $row['running'] }} {{ $row['open'] }} {{ $row['late'] }} {{ $row['due_soon'] }} @if ($row['progress'] !== null)
{{ number_format($row['progress'], 0, ',', '.') }}%
@endif
{{ $other['name'] }} {{ $other['total'] }} {{ $other['done'] }} {{ $other['running'] }} {{ $other['open'] }} {{ $other['late'] }} {{ $other['due_soon'] }}
Total {{ $k['total'] }} {{ $k['done'] }} {{ $k['running'] }} {{ $k['open'] }} {{ $k['late'] }} {{ $k['due_soon'] }} {{ $k['progress'] }}%

Progres per SBU

@forelse ($data['sbus'] as $row) @empty @endforelse @if (($data['sbus_other']['total'] ?? 0) > 0) @php $otherSbu = $data['sbus_other']; @endphp @endif
SBUTotalSelesaiBerjalan OPENTerlambatDue segeraProgres
{{ $row['name'] }} {{ $row['total'] }} {{ $row['done'] }} {{ $row['running'] }} {{ $row['open'] }} {{ $row['late'] }} {{ $row['due_soon'] }} @if ($row['progress'] !== null)
{{ number_format($row['progress'], 0, ',', '.') }}%
@endif
Belum ada SBU pada proyek ini.
{{ $otherSbu['name'] }} {{ $otherSbu['total'] }} {{ $otherSbu['done'] }} {{ $otherSbu['running'] }} {{ $otherSbu['open'] }} {{ $otherSbu['late'] }} {{ $otherSbu['due_soon'] }}

Due date per periode ({{ $project->scaleLabel() }})

@php $periods = $data['periods']; $max = max(1, collect($periods)->max(fn ($p) => $p['done'] + $p['todo'])); $height = 230; $chartWidth = 900; $padLeft = 30; $padBottom = 40; $chartHeight = $height - $padBottom - 12; $band = ($chartWidth - $padLeft) / count($periods); @endphp @for ($tick = 0; $tick <= $max; $tick += max(1, (int) ceil($max / 4))) @php $y = 12 + $chartHeight - ($tick / $max) * $chartHeight; @endphp {{ $tick }} @endfor @foreach ($periods as $index => $period) @php $x = $padLeft + $index * $band + $band * 0.18; $w = $band * 0.64; $doneHeight = $period['done'] / $max * $chartHeight; $todoHeight = $period['todo'] / $max * $chartHeight; $label = $period['start']->day.' '.$months[$period['start']->month]; @endphp {{ $label }}: {{ $period['done'] }} selesai {{ $label }}: {{ $period['todo'] }} belum {{ $label }} @endforeach
Selesai Belum
@endsection