@extends('dining.layouts.dining-member') @section('title', 'My Transactions - The LaLiT Dining') @section('content')

My Transactions

Back to Dashboard
@if(session('success'))
@endif @if(session('error'))
@endif
@if(isset($transactions) && count($transactions) > 0) @foreach($transactions as $transaction) @php // Handle trans_date which might be in d/m/Y H:i:s format if ($transaction->trans_date) { try { $transactionDate = \Carbon\Carbon::createFromFormat('d/m/Y H:i:s', $transaction->trans_date)->format('M d, Y'); } catch (\Exception $e) { // Fallback to created_at if trans_date format is different $transactionDate = \Carbon\Carbon::parse($transaction->created_at)->format('M d, Y'); } } else { $transactionDate = \Carbon\Carbon::parse($transaction->created_at)->format('M d, Y'); } $statusColor = match(strtolower($transaction->order_status)) { 'success' => '#28a745', // Green 'failure' => '#dc3545', // Red 'aborted' => '#ffc107', // Yellow 'pending' => '#17a2b8', // Info blue default => '#6c757d' // Gray }; @endphp @endforeach @else @endif
Order ID Date Amount Payment Mode Status Actions
{{ $transaction->order_id }}
@if($transaction->tracking_id) Tracking: {{ $transaction->tracking_id }} @endif
{{ $transactionDate }}
₹{{ number_format($transaction->amount, 2) }}
{{ $transaction->currency }}
{{ ucfirst($transaction->payment_mode ?? 'N/A') }}
@if($transaction->card_name) {{ $transaction->card_name }} @endif
{{ ucfirst($transaction->order_status) }}
@if($transaction->invoice_path && file_exists(public_path($transaction->invoice_path))) View Invoice @else
@csrf
@endif
No transactions found.
Your dining membership transactions will appear here.
@if(isset($transactions) && count($transactions) > 0)
Transaction Summary
Total Transactions: {{ count($transactions) }}
Total Amount Paid: ₹{{ number_format($transactions->sum('amount'), 2) }}
@endif
@include('dining.modals.transaction-details-modal') @endsection