{{-- Header --}}
← Back
{{ $kpiPeriodId ? 'Edit KPI Period' : 'Create New KPI Period' }} {{ $kpiPeriodId ? 'Update the period details and department assignments' : 'Define a new KPI period for a specific year' }}
{{-- Success Message --}} @if (session()->has('success')) {{ session('success') }} @endif
{{-- Basic Information Card --}}
Period Information
{{-- Year Field --}} Year * @error('year') {{ $message }} @enderror {{-- First Month Field --}} First Month * @error('firstMonth') {{ $message }} @enderror {{-- Last Month Field (Read Only) --}} Last Month @if ($firstMonth == 1) Same year @else Next year @endif {{-- Status Field --}} Status * @error('status') {{ $message }} @enderror
{{-- Department Assignments Card --}}
Department Assignments Assign KPI Sets to departments for this period @if ($kpiSetsByYear->isEmpty()) No KPI Sets available for year {{ $year }}. Please create KPI Sets for this year first. @endif {{-- Departments Table --}}
@forelse ($departments as $department) @empty @endforelse
Department KPI Set Performance
{{ $department->name }} @foreach ($kpiSetsByYear as $kpiSet) @endforeach @error('departmentAssignments.' . $department->id) {{ $message }} @enderror @if ($kpiPeriodId && isset($departmentAssignments[$department->id]) && $departmentAssignments[$department->id]) Performance @else Performance @endif
No departments found. Please create departments first.
{{-- Action Buttons --}}
Cancel
@php $assignedCount = count(array_filter($departmentAssignments)); @endphp {{ $assignedCount }} department(s) assigned {{ $kpiPeriodId ? 'Update Period' : 'Create Period' }}