

<?php $__env->startSection('content'); ?>
    <?php echo $__env->make('frontend.components.accordion', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

    <div class="card mp-20">
        <h2 class="title">Payment Log</h2>
        <div class="table-header">
            <form method="GET" action="<?php echo e(route('user.log.payments')); ?>" class="table-search-form">
                <div class="table-search">
                    <input type="text" name="search" class="search-input" placeholder="Search payments..." value="<?php echo e($search ?? ''); ?>">
                    <i class="ti ti-search"></i>
                </div>
                <button type="submit" class="btn btn-secondary search-btn"><i class="ti ti-search"></i> Search</button>
                <?php if(!empty($search)): ?>
                    <a href="<?php echo e(route('user.log.payments')); ?>" class="btn btn-outline">Clear</a>
                <?php endif; ?>
            </form>
        </div>
        <div class="table-responsive">
            <table class="table">
                <thead>
                    <tr>
                        <th>Date</th>
                        <th>Method</th>
                        <th>Amount</th>
                        <th>Reference</th>
                        <th>Status</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $payments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $payment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td><?php echo e($payment->created_at?->format('Y-m-d H:i')); ?></td>
                            <td><?php echo e(ucfirst($payment->method)); ?></td>
                            <td><?php echo e($payment->currency); ?> <?php echo e(number_format($payment->amount, 2)); ?></td>
                            <td><?php echo e($payment->reference); ?></td>
                            <td>
                                <?php
                                    $class = match ($payment->status) {
                                        'success'  => 'status success',
                                        'pending'  => 'status pending',
                                        'failed'   => 'status failed',
                                        'cancelled'=> 'status failed',
                                        default    => 'status',
                                    };
                                ?>
                                <span class="<?php echo e($class); ?>"><?php echo e(ucfirst($payment->status)); ?></span>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr>
                            <td colspan="5" class="text-center">No payments yet.</td>
                        </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
        <?php if($payments->hasPages()): ?>
            <?php echo e($payments->links('vendor.pagination.default')); ?>

        <?php endif; ?>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('frontend.layout.dash', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\HP\Desktop\social\product\core\resources\views/frontend/user/log/payments.blade.php ENDPATH**/ ?>