@extends('admin.layout')

@section('title', 'Transaction Status')

@section('content')
<h3 align="center">Détails des status transactions</h3>

<section class="content">
    <div class="container-fluid">
        <!-- Success/Error Messages -->
        @if(session('success'))
            <div class="alert alert-success">
                {{ session('success') }}
            </div>
        @elseif(session('error'))
            <div class="alert alert-danger">
                {{ session('error') }}
            </div>
        @endif

        <!-- Transaction Status Table -->
        <div class="table-responsive">
            <table id="example1" class="table table-bordered table-striped">
                <thead class="thead-dark">
                    <tr>
                        <th>Date</th>
                        <th>Type</th>
                        <th>Alias</th>
                        <th>Currency</th>
                        <th>Amount</th>
                        <th>Request Code</th>
                        <th>Response Code</th>
                        <th>Response Message</th>
                        <th>Status</th>
                        <th>Reference Number</th>
                    </tr>
                </thead>
                <tbody>
                    @forelse($transactions as $transaction)
                        <tr>
                            <td>{{ $transaction->date }}</td>
                            <td>{{ $transaction->type }}</td>
                            <td>{{ $transaction->alias }}</td>
                            <td>{{ $transaction->currency }}</td>
                            <td>{{ number_format($transaction->amount, 2) }}</td>
                            <td>{{ $transaction->request_code }}</td>
                            <td>{{ $transaction->response_code }}</td>
                            <td>{{ $transaction->response_message }}</td>
                            <td>{{ $transaction->status }}</td>
                            <td>{{ $transaction->reference_number }}</td>
                        </tr>
                    @empty
                        <tr>
                            <td colspan="10" class="text-center">Aucune transaction trouvée</td>
                        </tr>
                    @endforelse
                </tbody>
            </table>
        </div>
    </div>
</section>
@stop
