@extends("front.layout.master") @php $user = Auth::user(); require_once(base_path().'/app/Http/Controllers/price.php'); $defCurValue = $defCurrency->currency_symbol ?? 'fa fa-dollar'; $referLink = route('register', ['refercode' => $user->refer_code]); $totalReferred = $aff_history->total(); $sessionCur = session()->get('currency'); $needsConvert = isset($user->wallet) && isset($defCurrency->currency->code) && isset($sessionCur['id']) && $defCurrency->currency->code !== $sessionCur['id']; @endphp @section('title', __('staticwords.AffiliateDB') . ' | ') @section('body')
{{-- Sidebar --}} {{-- Main column --}}
{{-- Header --}}

{{ __('staticwords.AffiliateDB') }}

{{ __('staticwords.referdesc') }}

{{-- Stat tiles --}}
{{ __('Total earning') }}
{{ number_format((float) $earning, 2) }}
@if($needsConvert)
{{ sprintf('%.2f', currency($earning, $defCurrency->currency->code, $sessionCur['id'], false)) }}
@endif
{{ __('Total referrals') }}
{{ $totalReferred }}
{{ __('Friends signed up via your link') }}
{{ __('Your code') }}
{{ $user->refer_code }}
{{ __('Share with friends') }}
{{-- Refer link card --}}
{{ __('staticwords.referHeading') }}

{{ __('Invite friends, earn rewards') }}

{{ __('staticwords.referdesc') }}

{{-- History list --}}

{{ __('staticwords.affhistory') }}

{{ $totalReferred }} {{ __('records') }}
@if($aff_history->count())
@foreach($aff_history as $history)
{{ $history->log }}
@if(isset($history->user)) {{ $history->user->email }} · @endif {{ \Illuminate\Support\Carbon::parse($history->created_at)->diffForHumans() }}
+ {{ sprintf('%.2f', $history->amount) }}
@if($history->procces == 0) {{ __('staticwords.Pending') }} @else {{ __('staticwords.creditedtowallet') }} @endif
@endforeach
{!! $aff_history->links() !!}
@else

{{ __('No referrals yet') }}

{{ __('Share your link above to start earning when friends sign up and shop with us.') }}

@endif
{{-- How it works modal --}} @endsection @section('script') @endsection