@extends('layouts.default') @section('title', 'Goal Details') @section('content')
@if ($errors->any()) @endif @if (session()->has('message')) @endif
{{-- goal details tab --}}
@if ( ! $details['goal_details']->isEmpty() ) @foreach ($details['goal_details'] as $goal)

{{ $goal->gl_name }}

{{ $goal->gl_amount }}

{{ $goal->gl_type }}

@php $date = new DateTime($goal->gl_target_date); @endphp {{ $date->format('d-m-Y') }}

{{ $goal->gl_days ?? '-' }}

@php $cr_date = new DateTime($goal->created_at); @endphp {{ $cr_date->format('d-m-Y') }}

@php $up_date = new DateTime($goal->updated_at); @endphp {{ $up_date->format('d-m-Y') }}

@endforeach @else

Data Not Found...

@endif

{{ $details['goal_details'][0]['gl_amount'] }}

@if ( empty($details["exceeding_amount"]) )

{{ round($details['daily_savings'], 2) }}

{{ round($details['weekly_savings'], 2) }}

{{ round($details['monthly_savings'], 2) }}

{{ round($details['remaining_amount'], 2) }}

{{ $details['remaining_days'] }}

@endif @if ( ! empty($details["exceeding_amount"]) )

{{ round($details['exceeding_amount'], 2) }}

@endif
@if ( $details['percentage'] <= 0 && $details['percentage'] <= 40 )

{{ round($details['percentage'], 2) }}%

@elseif( ( $details["percentage"] <= 80 && $details["percentage"]>= 40 ) )

{{ round($details['percentage'], 2) }}%

@else

{{ round($details['percentage'], 2) }}%

@endif
{{-- savings details tab --}}
{{--
@if (!$details['savings_details']->isEmpty()) @foreach ($details['savings_details'] as $savings) @endforeach @else @endif
Saving Note Saving Amount Saving Type Saving Date
{{ $savings->sv_note }} {{ $savings->sv_amount }} {{ $savings->sv_type }} @php $date = new DateTime($savings->sv_date); @endphp {{ $date->format('d-m-Y') }}
Data Not Found...
--}}
Savings Timeline
@php $count = count($details['savings_details']); @endphp @if ( ! $details['savings_details']->isEmpty() )
@php $i = 0; @endphp @foreach ( $details['savings_details'] as $savings ) @php $i++; if ( $i % 2 == 0 ) { $position = 'timeline-item-right'; $bg_class = 'bg-success'; $txt_class = 'text-warning'; } else { $position = 'timeline-item-left'; $bg_class = 'bg-danger'; $txt_class = 'text-dark'; } @endphp
@php $date = new DateTime($savings->updated_at); @endphp {{ $date->format('d-m-Y H:i:s A') }}

{{ $savings->sv_note }}

{{ $savings->sv_amount }}

{{ $savings->sv_type }}

@php $date = new DateTime($savings->sv_date); @endphp {{ $date->format('d-m-Y') }}

@endforeach
@else
Timeline isn't available!
@endif
@endsection @section('pagespecificscripts') @endsection