@extends('user.layouts') @section('title', 'Users Agent') @section('header') {{-- ========================================================= DATATABLE CSS ========================================================== --}} @endsection @section('content')
{{-- ========================================================= PAGE HEADER ========================================================== --}} {{-- ========================================================= AGENT PROFILE ========================================================== --}}
@php $agentInitial = !empty($user_agent->name) ? strtoupper( substr( trim($user_agent->name), 0, 1 ) ) : 'A'; @endphp
{{ $agentInitial }}
{{ $user_agent->name ?? 'Agent' }}

Agent Code: {{ $user_agent->agent_code ?? '-' }}

{{-- ========================================================= SUMMARY CARDS ========================================================== --}}
{{-- WALLET BALANCE --}}

Wallet Balance

₹{{ number_format((float) ($user_agent->wallet ?? 0), 2) }}

{{-- TOTAL REWARD --}}

Total Reward

₹{{ number_format((float) ($reward ?? 0), 2) }}

{{-- WITHDRAW --}}

Withdraw

₹{{ number_format((float) ($withdraw ?? 0), 2) }}

{{-- TOTAL REFERRAL --}}

Total Referral

{{ number_format((int) ($referrals ?? 0)) }}

{{-- ========================================================= REFERRAL TABLE ========================================================== --}}
{{-- ===================================================== TABLE HEADER ====================================================== --}}
Total Referrals

View and filter referral history

{{-- ================================================= MONTH FILTER ================================================== --}}
@csrf
{{-- ===================================================== TABLE ====================================================== --}}
@foreach($referral_users as $user) @php $referralInitial = !empty($user->name) ? strtoupper( substr( trim($user->name), 0, 1 ) ) : 'U'; @endphp {{-- SN --}} {{-- DATE --}} {{-- AGENT ID --}} {{-- NAME --}} {{-- PHONE --}} {{-- REFERRAL ID --}} {{-- STATUS --}} @endforeach
SN DATE AGENT ID NAME PHONE NO REFERRAL ID STATUS
{{ $loop->iteration }} {{ !empty($user->created_at) ? $user->created_at->format('d-m-Y') : '-' }} {{ $user->agent_code ?? '-' }}
{{ $referralInitial }}
{{ $user->name ?? '-' }}
{{ $user->phone_number ?? '-' }} {{ $user_agent->agent_code ?? '-' }} @if($user->is_active) Active @else Inactive @endif
{{-- ========================================================= CONVERT MODAL Existing functionality preserved ========================================================== --}}
@endsection @section('footer') {{-- ========================================================= JILLA ID ========================================================== --}} {{-- ========================================================= JQUERY ========================================================== --}} {{-- ========================================================= DATATABLE ========================================================== --}} {{-- ========================================================= PREVENT DOUBLE CONVERT SUBMIT ========================================================== --}} @endsection