@php $count = 0 @endphp
@if(isset($init->activeCurricula) && !empty($init->activeCurricula))
The following are goals which haven’t been achieved yet.
@foreach($init->activeCurricula as $key => $curricula)
@if(isset($curricula->themes) && !empty($curricula->themes))
@php $achivedCurricula = collect($init->curricula)->where('curriculum', $curricula->_id)->first(); @endphp
@foreach($curricula->themes as $theme)
@php $achivedTheme = [];
if(isset($achivedCurricula->themes)) {
$achivedTheme = collect($achivedCurricula->themes)->where('_id', $theme->_id)->first();
}
@endphp
@if($theme->hasAim == true && isset($theme->aims) && !empty($theme->aims))
@foreach($theme->aims as $aims)
{{$aims->name}}
@if(isset($aims->description) && !empty($aims->description)) ({{$aims->description}}) @endif
@if(isset($aims->goals) && !empty($aims->goals))
@php $achivedAims = [];
if(isset($achivedTheme->aims)) {
$achivedAims = collect($achivedTheme->aims)->where('_id', $aims->_id)->first();
}
@endphp
@foreach($aims->goals as $goal)
@php $achivedGoal = 0;
if(isset($achivedAims->goals)) {
$achivedGoal = collect($achivedAims->goals)->where('_id', $goal->_id)->count();
}
@endphp
@if(!isset($init->goals) || ($achivedGoal) || (isset($init->goals) && !in_array($goal->_id, $init->goals)))
@endif
@endforeach
@endif
@endforeach
@else
@if(isset($theme->goals) && !empty($theme->goals))
@foreach($theme->goals as $goal)
@php $achivedGoal = 0;
if(isset($achivedTheme->goals)) {
$achivedGoal = collect($achivedTheme->goals)->where('_id', $goal->_id)->count();
}
@endphp
@if(!isset($init->goals) || ($achivedGoal) || (isset($init->goals) && !in_array($goal->_id, $init->goals)))
@endif
@endforeach
@endif
@endif
@php $count++ @endphp
@endforeach
@endif
@endforeach
@endif