<?php $__env->startSection('title', 'Payment History'); ?>

<?php $__env->startSection('content'); ?>

<div class="d-flex justify-content-between align-items-center mb-4">
    <div>
        <h1 class="h3 mb-1 text-gray-800 fw-bold">Payment History</h1>
        <p class="text-muted small">All your purchase transactions in one place</p>
    </div>
</div>

<div class="card shadow-lg border-0 overflow-hidden">
    <div class="card-header py-4 text-white text-center fw-bold"
         style="background: linear-gradient(90deg, #4e73df, #224abe);">
        <h5 class="mb-0">
            Payment Transactions
        </h5>
    </div>

    <div class="card-body p-4 p-lg-5">
        <p class="text-muted mb-4">Track all your payments and purchase history</p>

        <div class="table-responsive">
            <table class="table table-hover align-middle mb-0">
                <thead class="table-light">
                    <tr class="text-center">
                        <th style="width: 100px;">Order #</th>
                        <th>Provider</th>
                        <th>Package</th>
                        <th>Payer Name</th>
                        <th>Amount</th>
                        <th>Status</th>
                        <th>Date & Time</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $history; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $info): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr class="text-center align-middle">
                            
                            <td class="fw-bold text-primary">#<?php echo e($info->payment_id); ?></td>

                            
                            <td class="text-capitalize fw-semibold">
                                <?php if($info->payment_provider === 'razorpay'): ?>
                                    <i class="fab fa-google-pay text-primary me-1"></i> Razorpay
                                <?php elseif($info->payment_provider === 'paypal'): ?>
                                    <i class="fab fa-paypal text-primary me-1"></i> PayPal
                                <?php else: ?>
                                    <?php echo e(ucfirst($info->payment_provider)); ?>

                                <?php endif; ?>
                            </td>

                            
                            <td class="fw-bold">
                                <?php
                                    $pkg = \App\Packages::find($info->package_id);
                                ?>
                                <?php if($pkg): ?>
                                    <?php echo e($pkg->package_name); ?>

                                <?php else: ?>
                                    <span class="text-muted small">Deleted Package</span>
                                <?php endif; ?>
                            </td>

                            
                            <td><?php echo e($info->payment_payer ?: '—'); ?></td>

                            
                            <td class="fw-bold fs-5 text-dark">
                                ₹<?php echo e(number_format($info->payment_amount)); ?>

                            </td>

                            
                            <td>
                                <?php if($info->payment_status === 'successful'): ?>
                                    <span class="badge bg-success px-4 py-2 fw-bold">
                                        Success
                                    </span>
                                <?php elseif($info->payment_status === 'failed'): ?>
                                    <span class="badge bg-danger px-4 py-2 fw-bold">
                                        Failed
                                    </span>
                                <?php else: ?>
                                    <span class="badge bg-warning text-dark px-4 py-2 fw-bold">
                                        <?php echo e(ucfirst($info->payment_status)); ?>

                                    </span>
                                <?php endif; ?>
                            </td>

                            
                            <td class="text-muted small">
                                <?php echo e($info->created_at->format('d M, Y')); ?><br>
                                <span class="text-primary fw-600"><?php echo e($info->created_at->format('h:i A')); ?></span>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr>
                            <td colspan="7" class="text-center py-6">
                                <i class="fas fa-receipt fa-4x text-muted opacity-30 mb-4"></i>
                                <h5 class="text-muted mb-2">No transactions yet</h5>
                                <p class="text-muted small">Your payment history will appear here once you make a purchase.</p>
                            </td>
                        </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
    </div>
</div>


<style>
    .table-hover tbody tr:hover {
        background-color: #f0f5ff !important;
        transition: all 0.3s;
    }
    .card {
        transition: all 0.4s ease;
    }
    .card:hover {
        transform: translateY(-8px);
        box-shadow: 0 2rem 4rem rgba(0,0,0,.22) !important;
    }
    .badge {
        font-size: 0.9rem;
        padding: 0.6em 1.2em;
    }
</style>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('manage.user.index', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp8.2\htdocs\MCCMS\resources\views/manage/user/paymenthistory/index.blade.php ENDPATH**/ ?>