@extends('layouts.admin.base') @section('page-title') {{ $plan->name }} Profit Calendar @endsection @php $canEdit = $plan->investments->count() == 0; @endphp @section('content')

{{ $plan->minimum_profit }}% - {{ $plan->profit }}% ROI


@php $frequency = $plan->profits_frequency(); $total_fixed_frequency = 0; @endphp @if(count((array)$frequency) == 0)

No Frequency was set, so calendar value below is totally random

@else @foreach ($frequency as $data) @php $total_fixed_frequency+=$data->value; @endphp {{ $data->percentage }}% {{ $data->value }} Times @endforeach @endif @php $remaining_unfixed = $plan->duration - $total_fixed_frequency; @endphp {{-- @if ($remaining_unfixed > 0) Remaining {{ $remaining_unfixed }} Days has random ROI @endif --}}
@csrf @foreach (json_decode($plan->profit_ledger->raw_json) as $date => $val)
@php $date_string = "2000-".$date; // $carbon_date = \Carbon\Carbon::parse($date_string); @endphp
{{ formatDay($date_string) }}
@endforeach
@if($canEdit) @endif
@endsection @section('scripts') @endsection