@foreach($section->subSection as $subSection)
@foreach($subSection->items as $item)
@php
$detail = $inspection->details->where('inspection_id', $inspection->id)->where('item_id', $item->id);
if ($detail->count() > 0){
$detail = $detail->first();
}else{
$detail = null;
}
// dd($detail);
@endphp
{{$item->id}}. {{$item->name}}
@php
$out='';
$in='';
$na='';
$no ='';
$cos='';
$r='';
if($detail){
if($detail->out==1){
$out='OUT';
}
if ($detail->in==1) {
$in='IN';
}
if ($detail->no==1) {
$no='NO';
}
if ($detail->na==1) {
$na='NA';
}
if ($detail->cos==1) {
$cos='COS';
}
if ($detail->r==1) {
$r='R';
}
}
// dd($st);
@endphp
@if ($item->is_in == '1')
@endif
@if ($item->is_out == '1')
@endif
@if ($item->is_no == '1')
@endif
@if ($item->is_na == '1')
@endif
{{-- {{ dd($item->submitedCode) }} --}}
@php
$itemCodes = $submittedCodes[$item->id] ?? collect();
// dd($itemCodes);
@endphp
@if($itemCodes->count())
{{-- {{ dd($item->submitedCode) }} --}}
{{-- {{ dd($itemCodes) }} --}}
@foreach ($itemCodes as $sc)
{{-- {{ dd($sc) }} --}}
{{-- --}}
{{--
--}}
@endforeach
@else
{{-- --}}
{{--
--}}
@endif
@endforeach
@endforeach