@php use App\Services\PC\PcFormPcIiiBLandingService; $pciIiiBLocEdit = canField('pc-forms', 'project_brief_descriptions', 'edit'); $pciIiiBPeriodLoc = old('pc_iii_b_reporting_period'); if (! is_array($pciIiiBPeriodLoc)) { $pciIiiBPeriodLoc = $pcForm?->pc_iii_b_reporting_period ?? ($pciCrudDraftFill['pc_iii_b_reporting_period'] ?? []); if (! is_array($pciIiiBPeriodLoc)) { $pciIiiBPeriodLoc = []; } } $pciIiiBDistrictBlocks = app(PcFormPcIiiBLandingService::class) ->normalizeDistrictsPayload($pciIiiBPeriodLoc['districts'] ?? []); if ($pciIiiBDistrictBlocks === []) { $legacyTaluka = trim((string) ($pciIiiBPeriodLoc['taluka'] ?? '')); $legacyUc = trim((string) ($pciIiiBPeriodLoc['union_council'] ?? '')); $pciIiiBDistrictBlocks = [[ 'district' => trim((string) ($pciIiiBPeriodLoc['district'] ?? '')), 'rows' => [[ 'taluka' => $legacyTaluka, 'union_council' => $legacyUc, 'unit' => '', 'contractor' => '', 'consultant' => '', ]], ]]; } @endphp @once @push('stylesheets') @endpush @endonce

Reports are district-based. Enter a district, then add Taluka / U.C. / Unit / Contractor / Consultant rows. Use Add District for another district in the same report.

District sections @if($pciIiiBLocEdit) @endif
@foreach($pciIiiBDistrictBlocks as $dIndex => $block) @php $dName = (string) ($block['district'] ?? ''); $dRows = is_array($block['rows'] ?? null) ? $block['rows'] : [[]]; if ($dRows === []) { $dRows = [[]]; } @endphp
@if($pciIiiBLocEdit) @endif
@if($pciIiiBLocEdit)@endif @foreach($dRows as $rIndex => $row) @if($pciIiiBLocEdit) @endif @endforeach
Taluka U.C Unit Contractor Consultant
@endforeach
{{-- Keep legacy ids so scheme-detail JS does not error --}} @once @push('scripts') @endpush @endonce