{{-- Header --}}
@if ($department) {{ $department->name }} @endif KPI Progress Entry
@if (session('success')) {{ session('success') }} @endif @if (session('error')) {{ session('error') }} @endif @if (!$department) You are not assigned to any department. Please contact your administrator. @else {{-- Period Selection --}} Select KPI Period @foreach ($availablePeriods as $periodOption) @endforeach @if ($period && !$kpiSet) No KPI Set has been assigned to your department for this period. @endif @if ($period && $kpiSet) {{-- Period Info --}}
Period {{ $period->year }}
Duration {{ $this->getMonthName($period->first_month) }} - {{ $this->getMonthName($period->last_month) }}
Status @if ($period->status === 'published') Published @elseif ($period->status === 'closed') Closed @else {{ ucfirst($period->status) }} @endif
@if ($period->status === 'closed') This period is closed. You can view the data but cannot make any changes. @endif {{-- KPI Progress Table --}}
@foreach ($monthHeaders as $header) @endforeach {{-- Projects --}} @foreach ($projectsData as $projectData) {{-- Project Header --}} {{-- Activities in Project --}} @foreach ($projectData['activities'] as $activityData) {{-- Activity Header --}} {{-- KPIs in Activity --}} @foreach ($activityData['kpis'] as $item) @foreach ($monthHeaders as $header) @endforeach @endforeach @endforeach @endforeach {{-- Ungrouped Activities --}} @if (count($ungroupedActivitiesData) > 0) @foreach ($ungroupedActivitiesData as $activityData) {{-- Activity Header --}} {{-- KPIs in Activity --}} @foreach ($activityData['kpis'] as $item) @foreach ($monthHeaders as $header) @endforeach @endforeach @endforeach @endif {{-- Ungrouped KPIs --}} @if (count($ungroupedKpisData) > 0) @foreach ($ungroupedKpisData as $item) @foreach ($monthHeaders as $header) @endforeach @endforeach @endif {{-- Empty State --}} @if (count($projectsData) === 0 && count($ungroupedActivitiesData) === 0 && count($ungroupedKpisData) === 0) @endif
KPI Target Progress {{ $header['name'] }}
📁 {{ $projectData['project']->name }}
{{ $activityData['group']->name }}
{{ $item['kpi']->title }} @if ($item['kpi']->description) {{ $item['kpi']->description }} @endif
{{ number_format($item['target'], 2) }}
{{ number_format($item['total_progress'], 2) }} @if ($item['target'] > 0) {{ number_format(($item['total_progress'] / $item['target']) * 100, 1) }}% @endif
@if ($period->status === 'published') @else {{ isset($monthlyValues[$item['kpi']->id][$header['number']]) && $monthlyValues[$item['kpi']->id][$header['number']] !== null ? number_format($monthlyValues[$item['kpi']->id][$header['number']], 2) : '-' }} @endif
Ungrouped Activities
{{ $activityData['group']->name }}
{{ $item['kpi']->title }} @if ($item['kpi']->description) {{ $item['kpi']->description }} @endif
{{ number_format($item['target'], 2) }}
{{ number_format($item['total_progress'], 2) }} @if ($item['target'] > 0) {{ number_format(($item['total_progress'] / $item['target']) * 100, 1) }}% @endif
@if ($period->status === 'published') @else {{ isset($monthlyValues[$item['kpi']->id][$header['number']]) && $monthlyValues[$item['kpi']->id][$header['number']] !== null ? number_format($monthlyValues[$item['kpi']->id][$header['number']], 2) : '-' }} @endif
Ungrouped KPIs
{{ $item['kpi']->title }} @if ($item['kpi']->description) {{ $item['kpi']->description }} @endif
{{ number_format($item['target'], 2) }}
{{ number_format($item['total_progress'], 2) }} @if ($item['target'] > 0) {{ number_format(($item['total_progress'] / $item['target']) * 100, 1) }}% @endif
@if ($period->status === 'published') @else {{ isset($monthlyValues[$item['kpi']->id][$header['number']]) && $monthlyValues[$item['kpi']->id][$header['number']] !== null ? number_format($monthlyValues[$item['kpi']->id][$header['number']], 2) : '-' }} @endif
No KPIs found in this set.
@if ($period->status === 'published' && (count($projectsData) > 0 || count($ungroupedActivitiesData) > 0 || count($ungroupedKpisData) > 0))
Save Progress
@endif
@endif @endif