@extends($activeTemplate . 'layouts.master')
@section('content')
    <div class="dashboard-inner">
        <div class="mb-4">
            <h3 class="mb-2">@lang('My Investments')</h3>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="card custom--card">
                    @if (!blank($investment))
                        <div class="card-body p-0">
                            <div class="table-responsive">
                                <table class="table--responsive--md table">
                                    <thead>
                                        <tr>
                                             <th scope="col">@lang('SL')</th>
                                             <th scope="col">@lang('Amount')</th>
                                             <th scope="col">@lang('Investment Date')</th>
                                             <th scope="col">@lang('ROI')</th>
                                             <th scope="col">@lang('Received Amount')</th>
                                             <th scope="col">@lang('Upcoming Payment')</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        @forelse($investment as $key => $invest)
                                            <tr>
                                                <td>{{ $key+1}}</td>
                                                <td> {{getAmount($invest->amount)}}</td>
                                                <td> {{($invest->created_at)}}</td>
                                                <td> {{getAmount($invest->profit)}}</td>
                                                <td> {{$invest->recurring_time}} x {{ $invest->profit }} =  {{getAmount($invest->recurring_time*$invest->profit) }} </td>
                                                <td> {{($invest->afterward)}}</td>
                                            </tr>
                                        @empty
                                            <tr>
                                                <td class="text-muted text-center" colspan="100%">{{ __($emptyMessage) }}</td>
                                            </tr>
                                        @endforelse
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    @else
                        <div class="card-body text-center">
                            <h4 class="text--muted"><i class="far fa-frown"></i> {{ __($emptyMessage) }}</h4>
                        </div>
                    @endif
                    @if ($investment->hasPages())
                        <div class="card-footer py-4">
                            {{ paginateLinks($investment) }}
                        </div>
                    @endif
                </div>
            </div>
        </div>
    </div>
@endsection
