@extends('user.layouts') @section('title', 'Transaction') @section('header') @endsection @section('content')
{{-- HEADER --}}

Transaction

View and manage all transaction details

{{-- ================================ INDIVIDUAL FILTERS ================================= --}}
Filter Transactions
{{-- FROM DATE --}}
{{-- TO DATE --}}
{{-- USER NAME / USER ID --}}
{{-- PHONE --}}
{{-- TRANSACTION ID --}}
{{-- PAYMENT ID --}}
{{-- BUSINESS NAME --}}
{{-- STATUS --}}
{{-- RESET --}}
{{-- ================================ TABLE ================================= --}}
Transaction History {{ $subscription->count() }}
@foreach ($subscription as $sub) @php $status = strtolower( trim( $sub->payment_status ?? $sub->status ?? '' ) ); if ( in_array( $status, [ 'success', 'completed', 'approved' ] ) ) { $statusText = 'Completed'; $statusClass = 'status-completed'; } elseif ( in_array( $status, [ 'pending', 'processing' ] ) ) { $statusText = 'Pending'; $statusClass = 'status-pending'; } elseif ( in_array( $status, [ 'failed', 'failure', 'cancelled', 'canceled', 'rejected' ] ) ) { $statusText = 'Failed'; $statusClass = 'status-failed'; } else { $statusText = $status ? ucfirst($status) : 'N/A'; $statusClass = 'status-other'; } $customerName = optional($sub->user)->name ?? 'N/A'; $customerInitial = $customerName !== 'N/A' ? strtoupper( substr( trim($customerName), 0, 1 ) ) : 'U'; /* | Change user_id display here if your users table | has another custom ID like unique_id/user_code. */ $userId = optional($sub->user)->user_id ?? $sub->user_id ?? 'N/A'; $businessName = optional($sub->business)->business_name ?? 'N/A'; @endphp {{-- SN --}} {{-- NAME / USER ID --}} {{-- PHONE --}} {{-- BUSINESS --}} {{-- TRANSACTION ID --}} {{-- PAYMENT ID --}} {{-- PLAN / AMOUNT --}} {{-- DATE --}} @php $transactionTime = $sub->created_at ? $sub->created_at->copy()->timezone('Asia/Kolkata') : null; @endphp {{-- STATUS --}} @endforeach
SN NAME / USER ID PHONE NO BUSINESS NAME TRANSACTION ID PAYMENT ID PLAN DATE & TIME STATUS
{{ $loop->iteration }}
{{ $customerInitial }}
{{ $customerName }}
{{ optional($sub->user)->phone_number ?? 'N/A' }}
{{ $businessName }}
{{ $sub->transaction_id ?? 'N/A' }} {{ $sub->payment_id ?? 'N/A' }} @if( $sub->amount !== null && $sub->amount !== '' ) ₹{{ number_format( (float) $sub->amount, 2 ) }} @else N/A @endif @if($transactionTime)
{{ $transactionTime->format('d-m-Y') }}
{{ $transactionTime->format('h:i A') }}
@else N/A @endif
{{ $statusText }}
@endsection @section('footer') @endsection