@extends('layouts.sneat') @section('content')

CSF PRO Audit Checklist & Category Management

@once @php if (!function_exists('renderOptions')) { function renderOptions($categories, $selectedId = null, $level = 0) { foreach ($categories as $category) { $isSelected = $category->id == $selectedId ? 'selected' : ''; echo ''; if ($category->children && $category->children->count() > 0) { renderOptions($category->children, $selectedId, $level + 1); } } } } @endphp @endonce
Add Category / Subcategory
@csrf
Existing Categories
@include('isms.category-tree', ['iscategories' => $iscategories])

Existing Checklists
@foreach($iscategories as $index => $category)
@php // Get all checklists under this main category (including its subcategories) $categoryIds = collect($category->children)->pluck('id')->push($category->id)->toArray(); $categoryChecklists = $checklists->whereIn('category_id', $categoryIds); @endphp @if($categoryChecklists->count() > 0) @foreach($categoryChecklists as $index2 => $item)
Edit Checklist
@csrf @method('PUT')
@endforeach
# Questionnaire Answer Control Ref Standard Evidence Category Status Remarks Action
{{ $index2 + 1 }} {{ $item->assessment_questionnaire }} {{ $item->answer ?? '-' }} {{ $item->control_reference_number ?? '-' }} {{ $item->iso_standard ?? '-' }} {{ $item->evidence ?? '-' }} {{ $item->category->name ?? '-' }} {{ $item->status ?? '-' }} {{ $item->remarks ?? '-' }}
@csrf @method('DELETE')
@else
No checklist items found under {{ $category->name }}.
@endif
@endforeach
@endsection