@extends('admin.layouts.master') @section('title', __('Admin Dashboard')) @php use App\Enums\TransactionCalcType; use App\Enums\TransactionType; $currency = base_currency(); @endphp @section('content')

{{ __("Overview") }}

{{ __("Here is an insight of what's going on.") }}

@if (!count(available_payment_methods()) > 0 || count($pending) > 0 || is_demo())
@if(is_demo())
{!! 'All the additional Module and Add-ons are NOT part of main product. Please feel free to contact us for more information or to get those.' !!}
@endif @if(!count(available_payment_methods())>0)
{!! __("Important: Please setup at least one :link to receive payments.", ['link' => ''.__("payment method").'']) !!}
@endif @if(count($pending)>0)
{{ __("Attention:") }} {{ __("You have few pending request, that need to review.") }}
 
@endif
@endif
{{-- .card-title-group --}}
{{-- .col --}}
{{ to_amount($deposit['total'], $currency) }} {{ $currency }}
{{ __("Last month") }} {{ to_amount($deposit['last_month'], $currency) }} {{ $currency }}
{{ __("Deposit") }}
{{ to_amount($withdraw['total'], $currency) }} {{ $currency }}
{{ __("Last month") }} {{ to_amount($withdraw['last_month'], $currency) }} {{ $currency }}
{{ __("Withdraw") }}
{{-- .col --}}
{{-- .nk-insight --}}
{{-- .card-inner --}}
{{-- .card --}}
{{-- .col --}}
{{ __("Total Deposit") }}
{{ to_amount($deposit['total'], $currency) }} {{ $currency }}
{{ __("This Month") }}
{{ to_amount($deposit['this_month'], $currency) }} @if($deposit['prtc_monthly'] > 0) {{ abs($deposit['prtc_monthly']) }}% @elseif($deposit['prtc_monthly'] < 0) {{ abs($deposit['prtc_monthly']) }}% @endif
{{ __("This Week") }}
{{ to_amount($deposit['this_week'], $currency) }} @if($deposit['prtc_weekly'] > 0) {{ abs($deposit['prtc_weekly']) }}% @elseif($deposit['prtc_weekly'] < 0) {{ abs($deposit['prtc_weekly']) }}% @endif
{{ __("Total Withdraw") }}
{{ to_amount($withdraw['total'], $currency) }} {{ $currency }}
{{ __("This Month") }}
{{ to_amount($withdraw['this_month'], $currency) }} @if($withdraw['prtc_monthly'] > 0) {{ abs($withdraw['prtc_monthly']) }}% @elseif($withdraw['prtc_monthly'] < 0) {{ abs($withdraw['prtc_monthly']) }}% @endif
{{ __("This Week") }}
{{ to_amount($withdraw['this_week'], $currency) }} @if($withdraw['prtc_weekly'] > 0) {{ abs($withdraw['prtc_weekly']) }}% @elseif($withdraw['prtc_weekly'] < 0) {{ abs($withdraw['prtc_weekly']) }}% @endif
{{-- .card --}}
{{-- .col --}}
{{-- .col --}}
@if(filled($transactions['all_tnx'])) @foreach ($transactions['all_tnx'] as $tnx) @if($tnx->calc===TransactionCalcType::CREDIT)
{{ $tnx->type_of_fund }}
{{ show_date($tnx->completed_at) }} {{ show_time($tnx->completed_at) }}
+ {{ to_amount($tnx->tnx_amount, $tnx->tnx_currency) }} {{ $tnx->tnx_currency}}
+ {{ to_amount($tnx->amount, $tnx->currency) }} {{ $tnx->currency}}
{{-- .pro-item --}} @elseif($tnx->calc===TransactionCalcType::DEBIT)
{{ $tnx->type_of_fund }}
{{ show_date($tnx->completed_at) }} {{ show_time($tnx->completed_at,true) }}
- {{ to_amount($tnx->tnx_amount, $tnx->tnx_currency) }} {{ $tnx->tnx_currency}}
- {{ to_amount($tnx->amount, $tnx->currency) }} {{ $tnx->currency}}
{{-- .pro-item --}} @endif @endforeach @else
{{ __("No transaction available!") }}
@endif
@if(filled($transactions['debits'])) @foreach ($transactions['debits'] as $debit)
{{ $debit->type_of_fund }}
{{ show_date($debit->completed_at) }} {{ show_time($debit->completed_at) }}
- {{ to_amount($debit->tnx_amount, $debit->tnx_currency) }} {{ $debit->tnx_currency}}
- {{ to_amount($debit->amount, $currency) }} {{ $debit->currency}}
{{-- .pro-item --}} @endforeach @else
{{ __("No transaction available!") }}
@endif
@if(filled($transactions['credits'])) @foreach ($transactions['credits'] as $credit)
{{ $credit->type_of_fund }}
{{ show_date($credit->completed_at) }} {{ show_time($credit->completed_at) }}
+ {{ to_amount($credit->tnx_amount, $credit->tnx_currency) }} {{ $credit->tnx_currency}}
+ {{ to_amount($credit->amount, $credit->currency) }} {{ $credit->currency}}
{{-- .pro-item --}} @endforeach @else
{{ __("No transaction available!") }}
@endif
{{-- .card --}}
{{-- .col --}}
{{__("Investment Activities") }}
{{-- .card-inner --}}
@if(filled($transactions['investments'])) @foreach ($transactions['investments'] as $iv)
    {{ strtoupper(substr($iv->scheme['short'], 0, 2)) }}
{{ $iv->scheme['name'] }} - {{ $iv->calc_details_alter }}
{{ show_date($iv->created_at) }} {{ show_time($iv->created) }}
+ {{ to_amount($iv->amount, $currency) }} {{ $currency }}
@endforeach @else
{{ __("No activities available!") }}
@endif
{{-- .card-inner --}}
{{-- .card --}}
{{-- .col --}}
{{ __("User Activities") }}

{{ __("In last 30 days") }}

{{ $stats['this_month'] }} {{ __("Direct Join") }}
{{ $stats['ref_count'] }} {{ __("Referral Join") }}
{{-- .card --}}
{{-- .col --}}
{{ __("Total Stats") }}
{{ __("Deposits") }}
{{ $transactions['dp_count'] }}
{{ $transactions['dp_since'] }} {{ __("since last month") }}
{{ __("Withdraws") }}
{{ $transactions['wd_count'] }}
{{ $transactions['wd_since'] }} {{ __("since last month") }}
{{ __("Transactions") }}
{{ $transactions['tnx_count'] }}
{{ $transactions['tnx_since'] }} {{ __("since last month") }}
{{ __("Users") }}
{{ $stats['user_count'] }}
{{ $stats['this_month'] }} {{ __("since last month") }}
{{-- .nk-ovb --}}
{{-- .card --}}
{{-- .col --}}
{{-- .row --}}
{{-- .col --}}
@endsection @push('scripts') @php $inout = array_merge(array_values($dailyInsights['deposit']), array_values($dailyInsights['withdraw'])); $minio = array_filter($inout, function($item){ return $item > 0; }); $max = max($inout); $min = (is_array($minio) && !empty($minio)) ? (min($minio) === $max ? 0 : min($minio)) : 0; @endphp @endpush