@extends($viewVars['loadTeacherLayout'] ? 'layouts.teacher' : 'layouts.vertical') @section('css') @endsection @php $selectedChild = ""; $is_child_exist = false; if(app('request')->input('child')){ $selectedChild = app('request')->input('child'); } $page = 1; if(app('request')->input('page')){ $page = app('request')->input('page'); } @endphp @section('breadcrumb')
Child

Edit goals for {{ $init->child->name }}

Added on {{ \Carbon\Carbon::parse($init->_createdAt)->format('d/m/Y') }}

@endsection @section('content')
@csrf @php $dob = \Carbon\Carbon::parse($init->child->dob)->diffInMonths(\Carbon\Carbon::now()); @endphp
Write comment
@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
@endsection @section('script-bottom') @endsection