@extends('layouts.app') @section('title', 'Push into Revised PC-I') @section('contents') @php $p = $score['project']; $rev = $score['revised']; $formOptions = collect($score['forms'])->mapWithKeys(fn ($f) => [ (string) $f['id'] => '#'.$f['id'].' · '.$f['role'].' · '.$f['state'].' · loc '.($f['fills']['locations'] ?? 0), ]); @endphp
← Back
{{ $p['code'] }} — {{ $p['name'] }}
Daddy target: @if ($rev) Revised #{{ $rev['id'] }} ({{ $rev['state'] }}{{ $rev['status_active'] ? ', active' : ', inactive' }}). @else none found. @endif Tick sections to copy, pick the source form (defaults use fill + newer date), then Push.
@if (! $rev)
No Revised PC-I on this scheme — cannot push.
@else
@csrf
Forms overview
@foreach ($score['forms'] as $f) @endforeach
IDRoleStateActiveUpdatedLocationsFill total
#{{ $f['id'] }} {{ $f['role'] }} {{ $f['state'] }} {{ $f['status_active'] ? 'yes' : 'no' }} {{ $f['updated_at'] }} {{ $f['fills']['locations'] ?? 0 }} {{ $f['fill_total'] }}
Select sections to push into Revised #{{ $rev['id'] }}
@foreach ($score['sections'] as $key => $section) @php $suggested = $section['suggested_form_id'] ?? null; $shouldCheck = $suggested && (int) $suggested !== (int) $rev['id'] && (int) ($section['best_fill'] ?? 0) > 0 && (int) ($section['revised_fill'] ?? 0) < (int) ($section['best_fill'] ?? 0); $oldChecked = old('sections'); $isChecked = is_array($oldChecked) ? in_array($key, $oldChecked, true) : $shouldCheck; $sourceVal = (int) (old('source.'.$key) ?: ($suggested ?: $rev['id'])); @endphp @endforeach
Push? Section Revised fill Best fill Source form Why
{{ $section['label'] }} {{ $section['revised_fill'] }} {{ $section['best_fill'] }} {{ $section['suggested_reason'] }}
@endif
@push('scripts') @endpush @endsection