@extends('admin.layouts.app') @section('title', 'EMI Cards | EMI CREDITS') @section('page-title', 'EMI Cards') @section( 'page-description', 'Manage client EMI cards' ) @push('styles') @endpush @section('content')
{{-- ================================================= ALERTS ================================================== --}} @if(session('success'))
✓ {{ session('success') }}
@endif @if(session('error'))
✕ {{ session('error') }}
@endif @if($errors->any())
Please check:
@endif {{-- ================================================= HEADING ================================================== --}}

EMI Card Management

Generate, activate, block and manage client EMI cards.

{{-- ================================================= STATS ================================================== --}}
Active Cards
{{ $activeCards }}
Pending Cards
{{ $pendingCards }}
Blocked Cards
{{ $blockedCards }}
Expired Cards
{{ $expiredCards }}
{{-- ================================================= GENERATE ================================================== --}}
Generate New EMI Card
Eligible clients must have completed Personal Details, verified KYC and Job Details.
@if($eligibleClients->count()) @else No Eligible Clients @endif
{{-- ================================================= SEARCH / FILTER ================================================== --}}
@if($search !== '' || $status) Clear @endif
{{-- ================================================= ELIGIBLE CLIENT LIST ================================================== --}} @if($eligibleClients->count())

Eligible Clients

{{ $eligibleClientCount }} available
@foreach($eligibleClients as $client) @endforeach
Client Verification Action
{{ strtoupper( substr( $client->name, 0, 1 ) ) }}
{{ $client->name }} {{ $client->email }} @if($client->mobile) · {{ $client->mobile }} @endif
Personal KYC Job
@endif {{-- ================================================= EMI CARDS TABLE ================================================== --}}

EMI Cards

Showing {{ $cards->firstItem() ?? 0 }} - {{ $cards->lastItem() ?? 0 }} of {{ $cards->total() }}
@if($cards->count()) @foreach($cards as $card) @php $user = $card->user; $name = $user->name ?? 'Unknown Client'; $email = $user->email ?? ''; $initial = strtoupper( substr( $name, 0, 1 ) ); $hasPaidPayment = $user ? $user->payments() ->where( 'status', 'paid' ) ->exists() : false; $isExpired = $card->expires_at && $card->expires_at->isPast(); @endphp {{-- CLIENT --}} {{-- CARD NUMBER --}} {{-- LIMIT --}} {{-- AVAILABLE --}} {{-- PAYMENT --}} {{-- EXPIRY --}} {{-- STATUS --}} {{-- LOANS --}} {{-- ACTIONS --}} @endforeach
Client Card Number Limit Available Payment Expiry Status Loans Actions
{{ $initial }}
{{ $name }} @if($email) {{ $email }} @endif
{{ $card->card_number }} {{ money((float)($card->card_limit ?? 0)) }} {{ money((float)($card->available_limit ?? 0)) }} @if($card->status === 'active')
Available
@endif
@if($hasPaidPayment) ✓ Paid @else ⏳ Pending @endif @if($card->expires_at) {{ $card->expires_at->format('d M Y') }} @else - @endif @if($isExpired) Expired @else @switch($card->status) @case('pending') Pending @break @case('active') Active @break @case('blocked') Blocked @break @case('expired') Expired @break @default {{ ucfirst($card->status) }} @endswitch @endif @if($user && method_exists($user, 'loans')) @php $activeLoanCount = $user->loans() ->whereIn( 'status', [ 'approved', 'disbursed', 'active', 'overdue' ] ) ->count(); @endphp @if($activeLoanCount > 0) {{ $activeLoanCount }} Active @else No Active Loan @endif @else @endif
{{-- VIEW --}} View {{-- PENDING ACTIONS --}} @if( $card->status === 'pending' && !$isExpired ) {{-- LIMIT --}} {{-- APPROVE --}} @if($hasPaidPayment) @if((float)$card->card_limit > 0)
@csrf
@else Set Limit @endif @else Payment Pending @endif @endif {{-- ACTIVE → BLOCK --}} @if( $card->status === 'active' && !$isExpired )
@csrf
@endif {{-- BLOCKED → ACTIVATE --}} @if($card->status === 'blocked') @if(!$isExpired)
@csrf
@else Expired @endif @endif {{-- EXPIRED --}} @if($card->status === 'expired') Expired @endif
@else
💳
No EMI cards found.
@endif
{{-- ================================================= PAGINATION ================================================== --}} @if($cards->hasPages())
Page {{ $cards->currentPage() }} of {{ $cards->lastPage() }}
@endif
{{-- ===================================================== GENERATE MODAL ====================================================== --}}

Generate EMI Card

@csrf
New EMI Card

Status: Pending
Loan Limit: {{ money(0) }}
Card will be activated only after payment and admin approval.
{{-- ===================================================== LIMIT MODAL ====================================================== --}}

Update Loan Limit

@csrf @method('PUT')
Client:
Changing the loan limit does not activate the card.
Payment and admin approval are still required.
@endsection @push('scripts') @endpush