<?php $__env->startSection('section', admin_trans('Premium')); ?>
<?php $__env->startSection('title', admin_trans('Transactions')); ?>
<?php $__env->startSection('container', 'container-max-xxl'); ?>
<?php $__env->startSection('content'); ?>
    <div class="row row-cols-1 row-cols-lg-2 row-cols-xxl-4 g-3 mb-4">
        <div class="col">
            <div class="vironeer-counter-card bg-secondary">
                <div class="vironeer-counter-card-bg"></div>
                <div class="vironeer-counter-card-icon">
                    <i class="fa-solid fa-basket-shopping"></i>
                </div>
                <div class="vironeer-counter-card-meta">
                    <p class="vironeer-counter-card-title"><?php echo e(admin_trans('Unpaid')); ?>

                        (<?php echo e(number_format($counters['unpaid']['number'])); ?>)</p>
                    <p class="vironeer-counter-card-number"><?php echo e(priceSymbol($counters['unpaid']['amount'])); ?></p>
                </div>
            </div>
        </div>
        <div class="col">
            <div class="vironeer-counter-card bg-orange">
                <div class="vironeer-counter-card-bg"></div>
                <div class="vironeer-counter-card-icon">
                    <i class="fa-regular fa-hourglass-half"></i>
                </div>
                <div class="vironeer-counter-card-meta">
                    <p class="vironeer-counter-card-title"><?php echo e(admin_trans('Pending')); ?>

                        (<?php echo e(number_format($counters['pending']['number'])); ?>)</p>
                    <p class="vironeer-counter-card-number"><?php echo e(priceSymbol($counters['pending']['amount'])); ?></p>
                </div>
            </div>
        </div>
        <div class="col">
            <div class="vironeer-counter-card bg-green">
                <div class="vironeer-counter-card-bg"></div>
                <div class="vironeer-counter-card-icon">
                    <i class="fa-solid fa-receipt"></i>
                </div>
                <div class="vironeer-counter-card-meta">
                    <p class="vironeer-counter-card-title"><?php echo e(admin_trans('Paid')); ?>

                        (<?php echo e(number_format($counters['paid']['number'])); ?>)</p>
                    <p class="vironeer-counter-card-number"><?php echo e(priceSymbol($counters['paid']['amount'])); ?></p>
                </div>
            </div>
        </div>
        <div class="col">
            <div class="vironeer-counter-card bg-red">
                <div class="vironeer-counter-card-bg"></div>
                <div class="vironeer-counter-card-icon">
                    <i class="fa-solid fa-xmark"></i>
                </div>
                <div class="vironeer-counter-card-meta">
                    <p class="vironeer-counter-card-title"><?php echo e(admin_trans('Cancelled')); ?>

                        (<?php echo e(number_format($counters['cancelled']['number'])); ?>)</p>
                    <p class="vironeer-counter-card-number"><?php echo e(priceSymbol($counters['cancelled']['amount'])); ?></p>
                </div>
            </div>
        </div>
    </div>
    <div class="card">
        <div class="card-header p-3 border-bottom-small">
            <form action="<?php echo e(request()->url()); ?>" method="GET">
                <div class="row g-3">
                    <div class="col-12 col-lg-12">
                        <input type="text" name="search" class="form-control"
                            placeholder="<?php echo e(admin_trans('Search...')); ?>" value="<?php echo e(request('search') ?? ''); ?>">
                    </div>
                    <div class="col-12 col-lg-4">
                        <?php echo $__env->make('backend.partials.users-select', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                    </div>
                    <div class="col-12 col-lg-2">
                        <select name="status" class="form-select selectpicker" title="<?php echo e(admin_trans('Status')); ?>">
                            <option value="0" <?php echo e(request('status') == '0' ? 'selected' : ''); ?>>
                                <?php echo e(admin_trans('Unpaid')); ?></option>
                            <option value="1" <?php echo e(request('status') == '1' ? 'selected' : ''); ?>>
                                <?php echo e(admin_trans('Pending')); ?></option>
                            <option value="2" <?php echo e(request('status') == '2' ? 'selected' : ''); ?>>
                                <?php echo e(admin_trans('Paid')); ?></option>
                            <option value="3" <?php echo e(request('status') == '3' ? 'selected' : ''); ?>>
                                <?php echo e(admin_trans('Cancelled')); ?></option>
                        </select>
                    </div>
                    <div class="col-12 col-lg-3">
                        <select name="payment_method" class="form-select selectpicker"
                            title="<?php echo e(admin_trans('Payment Method')); ?>" data-live-search="true">
                            <?php $__currentLoopData = $paymentGateways; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $paymentGateway): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($paymentGateway->id); ?>"
                                    <?php echo e(request('payment_method') == $paymentGateway->id ? 'selected' : ''); ?>>
                                    <?php echo e($paymentGateway->name); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    </div>
                    <div class="col">
                        <button class="btn btn-primary w-100"><i class="fa fa-search"></i></button>
                    </div>
                    <div class="col">
                        <a href="<?php echo e(route('admin.premium.transactions.index')); ?>"
                            class="btn btn-secondary w-100"><?php echo e(admin_trans('Reset')); ?></a>
                    </div>
                </div>
            </form>
        </div>
        <div>
            <?php if($transactions->count() > 0): ?>
                <div class="table-responsive">
                    <table class="vironeer-normal-table table w-100">
                        <thead>
                            <tr class="bg-light">
                                <th><?php echo e(admin_trans('ID')); ?></th>
                                <th><?php echo e(admin_trans('User')); ?></th>
                                <th><?php echo e(admin_trans('Interval')); ?></th>
                                <th><?php echo e(admin_trans('Price')); ?></th>
                                <th><?php echo e(admin_trans('Payment Method')); ?></th>
                                <th><?php echo e(admin_trans('Status')); ?></th>
                                <th><?php echo e(admin_trans('Date')); ?></th>
                                <th></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $__currentLoopData = $transactions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $trx): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td><a href="<?php echo e(route('admin.premium.transactions.edit', $trx->id)); ?>"><i
                                                class="fa-solid fa-receipt me-2"></i>#<?php echo e($trx->id); ?></a>
                                    </td>
                                    <td>
                                        <a href="<?php echo e(route('admin.members.users.edit', $trx->user->id)); ?>"
                                            class="text-dark"><i class="fa fa-user me-2"></i><?php echo e($trx->user->name); ?>

                                            (<?php echo e($trx->user->email); ?>)
                                        </a>
                                    </td>
                                    <td>
                                        <?php echo e($trx->interval); ?>

                                        <?php if($trx->interval == 1): ?>
                                            <?php echo e(admin_trans('day')); ?>

                                        <?php else: ?>
                                            <?php echo e(admin_trans('days')); ?>

                                        <?php endif; ?>
                                    </td>
                                    <td><strong><?php echo e(priceSymbol($trx->price)); ?></strong></td>
                                    <td>
                                        <a href="<?php echo e(route('admin.premium.payment-gateways.edit', $trx->paymentGateway->id)); ?>"
                                            class="text-dark"><i
                                                class="fa-regular fa-credit-card me-2"></i><?php echo e($trx->paymentGateway->name); ?></a>
                                    </td>
                                    <td>
                                        <?php if($trx->isUnpaid()): ?>
                                            <span class="badge bg-secondary"><?php echo e(admin_trans('Unpaid')); ?></span>
                                        <?php elseif($trx->isPending()): ?>
                                            <span class="badge bg-orange"><?php echo e(admin_trans('Pending')); ?></span>
                                        <?php elseif($trx->isPaid()): ?>
                                            <span class="badge bg-green"><?php echo e(admin_trans('Paid')); ?></span>
                                        <?php elseif($trx->isCancelled()): ?>
                                            <span class="badge bg-red"><?php echo e(admin_trans('Cancelled')); ?></span>
                                        <?php endif; ?>
                                    </td>
                                    <td><?php echo e(dateFormat($trx->created_at)); ?></td>
                                    <td>
                                        <div class="text-end">
                                            <button type="button" class="btn btn-sm rounded-3" data-bs-toggle="dropdown"
                                                aria-expanded="true">
                                                <i class="fa fa-ellipsis-v fa-sm text-muted"></i>
                                            </button>
                                            <ul class="dropdown-menu dropdown-menu-lg dropdown-menu-sm-end"
                                                data-popper-placement="bottom-end">
                                                <li>
                                                    <a class="dropdown-item"
                                                        href="<?php echo e(route('admin.premium.transactions.edit', $trx->id)); ?>"><i
                                                            class="fa-regular fa-pen-to-square me-2"></i><?php echo e(admin_trans('Edit')); ?></a>
                                                </li>
                                                <li>
                                                    <hr class="dropdown-divider" />
                                                </li>
                                                <li>
                                                    <form
                                                        action="<?php echo e(route('admin.premium.transactions.destroy', $trx->id)); ?>"
                                                        method="POST">
                                                        <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                                                        <button class="vironeer-able-to-delete dropdown-item text-danger"><i
                                                                class="far fa-trash-alt me-2"></i><?php echo e(admin_trans('Delete')); ?></button>
                                                    </form>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                </div>
            <?php else: ?>
                <?php echo $__env->make('backend.partials.empty', ['class' => 'empty-lg'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
            <?php endif; ?>
        </div>
    </div>
    <?php echo e($transactions->links()); ?>

    <?php $__env->startPush('styles_libs'); ?>
        <link rel="stylesheet" href="<?php echo e(asset('vendor/libs/bootstrap/select/bootstrap-select.min.css')); ?>">
    <?php $__env->stopPush(); ?>
    <?php $__env->startPush('scripts_libs'); ?>
        <script src="<?php echo e(asset('vendor/libs/bootstrap/select/bootstrap-select.min.js')); ?>"></script>
    <?php $__env->stopPush(); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('backend.layouts.grid', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /www/wwwroot/neofiles.codenine.biz.id/resources/views/backend/premium/transactions/index.blade.php ENDPATH**/ ?>