@extends('admin.layouts.app') @section('title', $client->name . ' | PG Finsev Admin') @section('page-title', 'Client Details') @section( 'page-description', 'View and manage complete client information' ) @push('styles') @endpush @section('content')
{{-- ===================================================== ALERTS ====================================================== --}} @if(session('success'))
✓ {{ session('success') }}
@endif @if(session('error'))
✕ {{ session('error') }}
@endif @if($errors->any())
Please check the following:
@endif {{-- ===================================================== BACK ====================================================== --}} ← Back to Clients {{-- ===================================================== LOAD DATA ====================================================== --}} @php $profile = $client->clientProfile; $kyc = $client->clientKyc; $employment = $client->clientEmployment; $hasPaidPayment = $payments ->where('status', 'paid') ->count() > 0; $cardUnlockPayment = $payments->first(function ($payment) { return $payment->status === 'paid' && str_starts_with( (string) $payment->order_id, 'CARD-UNLOCK-' ); }); @endphp {{-- ===================================================== PROFILE HEADER ====================================================== --}}
{{ strtoupper( substr( $client->name, 0, 1 ) ) }}

{{ $client->name }}

Client ID #{{ $client->id }}

✉ {{ $client->email }} 📱 {{ $client->mobile ?? 'Not available' }}
CLIENT
{{-- ===================================================== STATUS SUMMARY ====================================================== --}}
{{-- PERSONAL --}}
Personal Details
@if($profile)
✓ Complete
@else
! Pending
@endif
{{-- KYC --}}
KYC Verification
@if(!$kyc)
! Pending
@elseif($kyc->status === 'verified')
✓ Verified
@elseif($kyc->status === 'rejected')
✕ Rejected
@else
! Pending
@endif
{{-- EMPLOYMENT --}}
Employment
@if($employment)
✓ Submitted
@else
! Pending
@endif
{{-- PAYMENT --}}
Card Payment
@if($hasPaidPayment)
✓ Paid
@else
Locked
@endif
{{-- ===================================================== DETAILS GRID ====================================================== --}}
{{-- ================================================= PERSONAL DETAILS ================================================== --}}

Personal Details

👤
@if($profile)
{{ $profile->full_name ?? $client->name }}
@if($profile->date_of_birth) {{ \Carbon\Carbon::parse( $profile->date_of_birth )->format('d M Y') }} @else Not provided @endif
{{ $profile->mobile ?? $client->mobile ?? 'Not provided' }}
{{ $profile->city ?? 'Not provided' }}
{{ $profile->state ?? 'Not provided' }}
{{ $profile->pincode ?? 'Not provided' }}
{{ $profile->address ?? 'Not provided' }}
@else Personal details have not been submitted yet. @endif
{{-- ================================================= EMPLOYMENT ================================================== --}}

Employment Details

💼
@if($employment)
{{ ucfirst( str_replace( '_', ' ', $employment->employment_type ) ) }}
{{ $employment->company_name ?? 'Not provided' }}
{{ $employment->job_title ?? 'Not provided' }}
@if( $employment->monthly_income !== null ) ₹{{ number_format( $employment->monthly_income, 2 ) }} @else Not provided @endif
{{ $employment->work_experience ?? 'Not provided' }}
{{ $employment->office_city ?? 'Not provided' }}
@else Employment details have not been submitted yet. @endif
{{-- ================================================= KYC ================================================== --}}

KYC Details

🪪
@if($kyc) @php $aadhaar = $kyc->aadhaar_number; $pan = $kyc->pan_number; /* |-------------------------------------------------------------------------- | Try decrypting KYC values |-------------------------------------------------------------------------- */ try { if ($aadhaar) { $aadhaar = \Illuminate\Support\Facades\Crypt::decryptString( $aadhaar ); } } catch (\Throwable $e) { // Keep original value. } try { if ($pan) { $pan = \Illuminate\Support\Facades\Crypt::decryptString( $pan ); } } catch (\Throwable $e) { // Keep original value. } /* |-------------------------------------------------------------------------- | Aadhaar Mask |-------------------------------------------------------------------------- */ if ($aadhaar) { $aadhaarDigits = preg_replace( '/\D/', '', $aadhaar ); if ( strlen( $aadhaarDigits ) >= 4 ) { $aadhaarDisplay = 'XXXX XXXX ' . substr( $aadhaarDigits, -4 ); } else { $aadhaarDisplay = 'XXXX'; } } else { $aadhaarDisplay = null; } /* |-------------------------------------------------------------------------- | PAN Mask |-------------------------------------------------------------------------- */ if ($pan) { $panClean = strtoupper( trim($pan) ); if ( strlen( $panClean ) >= 4 ) { $panDisplay = 'XXXXXX' . substr( $panClean, -4 ); } else { $panDisplay = 'XXXX'; } } else { $panDisplay = null; } @endphp
{{-- STATUS --}}
@if( $kyc->status === 'verified' ) Verified @elseif( $kyc->status === 'rejected' ) Rejected @else Pending Verification @endif
{{-- AADHAAR --}}
@if($aadhaarDisplay) {{ $aadhaarDisplay }} @else Not provided @endif
{{-- PAN --}}
@if($panDisplay) {{ $panDisplay }} @else Not provided @endif
{{-- AADHAAR DOCUMENT --}}
@if( !empty( $kyc->aadhaar_document ) ) 👁 View Aadhaar @else Not Uploaded @endif
{{-- PAN DOCUMENT --}}
@if( !empty( $kyc->pan_document ) ) 👁 View PAN @else Not Uploaded @endif
{{-- SUBMITTED DATE --}}
@if($kyc->created_at) {{ $kyc->created_at->format( 'd M Y, h:i A' ) }} @else Not available @endif
{{-- ================================================= KYC ACTIONS ================================================== --}}
@if($kyc->status === 'pending')
{{-- VERIFY --}}
@csrf
{{-- REJECT --}}
{{-- REJECTION FORM --}}
@csrf
@elseif( $kyc->status === 'verified' )
✓ KYC Verified @if($kyc->verified_at) on {{ $kyc->verified_at->format( 'd M Y, h:i A' ) }} @endif
{{-- CARD UNLOCK PAYMENT --}} @if($cardUnlockPayment)
✓ Card Unlocked
Payment of ₹{{ number_format((float)$cardUnlockPayment->amount, 2) }} completed @if($cardUnlockPayment->paid_at) on {{ $cardUnlockPayment->paid_at->format('d M Y, h:i A') }} @endif
@else
@csrf
This uses the Card Unlock Amount configured in Loan Settings.
@endif @elseif( $kyc->status === 'rejected' )
✕ KYC Rejected
@if( $kyc->rejection_reason )
Reason: {{ $kyc->rejection_reason }}
@endif
@endif
🔒 Privacy protected: Aadhaar and PAN numbers are masked in the admin overview. Only the last four characters are displayed.
@else KYC details have not been submitted yet. @endif
{{-- ================================================= PAYMENT HISTORY ================================================== --}}

Payment History

💰
@forelse( $payments as $payment )
{{ $payment->order_id ?? $payment->payment_id ?? 'Payment #' . $payment->id }} {{ $payment->created_at ? $payment->created_at->format( 'd M Y, h:i A' ) : 'Date unavailable' }}
₹{{ number_format( $payment->amount ?? 0, 2 ) }} @if( $payment->status === 'paid' ) Paid @elseif( in_array( $payment->status, [ 'pending', 'created' ] ) ) Pending @else {{ ucfirst( $payment->status ) }} @endif
@empty No payment records found. @endforelse
@endsection @push('scripts') @endpush