@extends('frontend.layouts.app') @section('content')
@include('frontend.inc.user_side_nav')

{{ translate('Affiliate') }}

{{ single_price(Auth::user()->affiliate_user->balance) }}
{{ translate('Affiliate Balance') }}
{{ translate('Affiliate Withdraw Request') }}
@if (addon_is_activated('affiliate_system') && \App\Models\AffiliateOption::where('type', 'user_registration_first_purchase')->first()->status)
@php if(Auth::user()->referral_code == null){ Auth::user()->referral_code = substr(Auth::user()->id.Str::random(), 0, 10); Auth::user()->save(); } $referral_code = Auth::user()->referral_code; $referral_code_url = URL::to('/users/registration')."?referral_code=$referral_code"; @endphp
@endif
{{translate('Affiliate Earning History')}}
@foreach($affiliate_logs as $key => $affiliate_log) @endforeach
# {{ translate('Referral User')}} {{ translate('Amount')}} {{ translate('Order Id')}} {{ translate('Referral Type') }} {{ translate('Product') }} {{ translate('Date') }}
{{ ($key+1) + ($affiliate_logs->currentPage() - 1)*$affiliate_logs->perPage() }} @if($affiliate_log->user_id !== null) {{ $affiliate_log->user->name }} @else {{ translate('Guest').' ('. $affiliate_log->guest_id.')' }} @endif {{ single_price($affiliate_log->amount) }} @if($affiliate_log->order_id != null) {{ $affiliate_log->order->code }} @else {{ $affiliate_log->order_detail->order->code }} @endif {{ ucwords(str_replace('_',' ', $affiliate_log->affiliate_type)) }} @if($affiliate_log->order_detail_id != null) {{ $affiliate_log->order_detail->product->name }} @endif {{ $affiliate_log->created_at->format('d, F Y') }}
{{ $affiliate_logs->links() }}
{{--
{{ translate('Affiliate payment history')}}
@foreach ($affiliate_payments as $key => $affiliate_payment) @endforeach
# {{ translate('Date') }} {{translate('Amount')}} {{translate('Payment Method')}}
{{ $key+1 }} {{ date('d-m-Y', strtotime($affiliate_payment->created_at)) }} {{ single_price($affiliate_payment->amount) }} {{ ucfirst(str_replace('_', ' ', $affiliate_payment ->payment_method)) }}
{{ $affiliate_payments->links() }}
{{ translate('Affiliate withdraw request history')}}
@foreach ($affiliate_withdraw_requests as $key => $affiliate_withdraw_request) @endforeach
# {{ translate('Date') }} {{ translate('Amount')}} {{ translate('Status')}}
{{ $key+1 }} {{ date('d-m-Y', strtotime($affiliate_withdraw_request->created_at)) }} {{ single_price($affiliate_withdraw_request->amount) }} @if($affiliate_withdraw_request->status == 1) {{translate('Approved')}} @elseif($affiliate_withdraw_request->status == 2) {{translate('Rejected')}} @else {{translate('Pending')}} @endif
{{ $affiliate_withdraw_requests->links() }}
--}}
@endsection @section('modal') @endsection @section('script') @endsection