@extends($activeTemplate . 'layouts.master')
@section('content')
    <div class="transaction-section padding-top padding-bottom">
        <div class="container">
            <div class="row justify-content-center">

            </div>
            <div class="primary-bg item-rounded">
                <table class="deposite-table">
                    <thead class="custom--table">
                        <tr>
                            <th>@lang('User ID')</th>
                            <th>@lang('Payer')</th>
                            <th>@lang('Amount')</th>
                            <th>@lang('Screenshot')</th>
                            <th>@lang('UTR No')</th>
                            <th>@lang('Payment Mode')</th>
                            <th>@lang('Status')</th>
                            <th>@lang('Confirmed At')</th>
                            <th>@lang('Created At')</th>
                            <th>@lang('Action')</th>
                        </tr>
                    </thead>
                    <tbody>
                        @forelse($payments as $payment)
                            @php
                                $path = getFilePath('withdrawMethod') . '/' . $payment->screen_short;
                                $image = getImage($path, getFileSize('withdrawMethod'));
                            @endphp
                            <tr>
                                <td>{{ $payment->payerUser->system_id }}</td>
                                <td>{{ $payment->payerUser->fullname }}</td>
                                <td>{{ getAmount($payment->amount) }} {{ __($general->cur_text) }}</td>
                                <td> <a href="{{ $image }}" target="_blank">see file</a></td>
                                <td>{{ $payment->utr_no }}</td>
                                <td>{{ $payment->payment_mode }}</td>
                                <td>
                                    {!! $payment->statusBadge !!}
                                </td>
                                <td>{{ showDateTime($payment->payment_status_confirmed_at) }}</td>
                                <td>{{ showDateTime($payment->created_at) }}</td>

                                <td>
                                    @if ($payment->payment_status_confirmed_at == null)
                                        <button class="btn btn--success confirmationBtn"
                                            data-question="@lang('Are you sure to confirm this payment?')"
                                            data-action="{{ route('user.donations.status', $payment->id) }}"
                                            data-values='{"status":"accept"}'><i class="la la-check" style="font-size: 20px;"></i></button>
                                        <button class="btn btn--danger confirmationBtn"
                                            data-question="@lang('Are you sure to reject this payment?')"
                                            data-action="{{ route('user.donations.status', $payment->id) }}"
                                            data-values='{"status":"reject"}'><i class="la la-times" style="font-size: 20px;"></i></button>
                                    @endif
                                </td>
                            </tr>
                        @empty
                            <tr>
                                <td colspan="100%">{{ __($emptyMessage) }}</td>
                            </tr>
                        @endforelse
                    </tbody>
                </table>
                @if ($payments->hasPages())
                    <div class="py-3">
                        {{ paginateLinks($payments) }}
                    </div>
                @endif
            </div>
        </div>
    </div>

    <x-confirmation-modal />
@endsection
