<?php $__env->startSection('content'); ?>
    <div class="card">
        <div class="card-body">
            <div class="table-responsive">
                <table id="dataTable" class="display">
                    <thead class="bg-gray-50">
                        <tr>
                            <th scope="col" class="text-center">
                                ID
                            </th>
                            <th scope="col" class="text-center">
                                Package Name
                            </th>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(['show-package-rate', 'specific_management_services'])): ?>

                                <th scope="col" class="text-center">
                                    Package Rate
                                </th>
                            <?php endif; ?>

                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(['show-package-rate', 'specific_management_services'])): ?>
                                <?php if(checkSettings('ResellerClientOnlineRecharge') == 'enable' && checkSettings('setClientPaymentAmountToClient') != 'enable' ): ?>
                                    <th scope="col" class="text-center">
                                        Client payment amount
                                    </th>
                                <?php endif; ?>
                            <?php endif; ?>


                            <?php if(checkSettings('resseller-name-in-package') == 'enable'): ?>
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('reseller-show-in-package')): ?>
                                    <th scope="col" class="text-center">Reseller Name</th>
                                <?php endif; ?>
                            <?php endif; ?>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('ip-pool')): ?>
                                <th scope="col" class="text-center">
                                    <?php if(checkAPI()): ?>
                                        Profile Name
                                    <?php else: ?>
                                        Pool Name
                                    <?php endif; ?>
                                </th>
                            <?php endif; ?>


                            <th scope="col" class="text-center">
                                Create Date
                            </th>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('pack-commission')): ?>
                                <th scope="col">
                                    Commission
                                </th>
                            <?php endif; ?>
                            <th scope="col" class="text-center">

                            </th>
                        </tr>
                    </thead>
                    <tbody>

                        <?php $__currentLoopData = $list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td class="text-center">
                                    <?php echo e($r->id); ?>

                                </td>
                                <td class="text-center">
                                    <?php echo e($r->package_name); ?>

                                </td>


                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(['show-package-rate', 'specific_management_services'])): ?>
                                    <td class="text-center">
                                        <?php echo e($r->package_rate); ?>

                                    </td>
                                <?php endif; ?>

                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(['show-package-rate', 'specific_management_services'])): ?>
                                <?php if(checkSettings('ResellerClientOnlineRecharge') == 'enable' && checkSettings('setClientPaymentAmountToClient') != 'enable' ): ?>
                                    <td class="text-center">
                                        <?php echo e($r->client_payment_amount); ?>

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

                                <?php if(checkSettings('resseller-name-in-package') == 'enable'): ?>
                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('reseller-show-in-package')): ?>
                                        <td class="overflow-auto">
                                            <div class="overflow-auto" style="height:100px">
                                                <?php $__currentLoopData = $resellers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $reseller): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <?php if(in_array($r->id, explode(',', $reseller->package_list))): ?>
                                                        <span class="btn btn-warning p-1 mb-1"><?php echo e($reseller->name); ?></span>
                                                    <?php endif; ?>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

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

                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('ip-pool')): ?>
                                    <th scope="col" class="text-center">
                                        <?php if(checkAPI()): ?>
                                            <?php echo e($r->profile_name); ?>

                                        <?php else: ?>
                                            <?php echo e($r->pool_name); ?>

                                        <?php endif; ?>
                                    </th>
                                <?php endif; ?>



                                <td class="text-center">
                                    <?php echo e(date('d-M-Y H:i:s A', strtotime($r->created_at))); ?>

                                </td>
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('pack-commission')): ?>
                                    <td class="text-center">
                                        <?php echo e($r->commission); ?>

                                    </td>
                                <?php endif; ?>
                                <td class="d-flex">
                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('package_edit')): ?>
                                        <a href="<?php echo e(route('packages.edit', $r->id)); ?>" class="btn btn-primary btn-sm">Edit</a>
                                    <?php endif; ?>
                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('package_destroy')): ?>
                                        <form id="deltepackage" action="<?php echo e(route('packages.destroy', $r->id)); ?>" method="POST"
                                            class="">
                                            <?php echo method_field('DELETE'); ?>
                                            <?php echo csrf_field(); ?>
                                            <button onclick="return confirm('are you want to delete the package?')"
                                                type="delete" class="btn btn-danger btn-sm">Delete</button>
                                        </form>
                                    <?php endif; ?>
                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('view-package-log-history')): ?>
                                        <a href="<?php echo e(route('editLog-history', ['id' => $r->id, 'type' => 'Package'])); ?>"
                                            class="btn btn-primary pull-right btn-sm">History</a>
                                    <?php endif; ?>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                        <!-- More items... -->
                    </tbody>
                </table>
            </div>
        </div>

    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layout.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/spacewalker/radius-circle/resources/views/packages/index.blade.php ENDPATH**/ ?>