<?php $__env->startSection('content'); ?>
    <div class="flex flex-col mt-5">
        <div class=" bg-white p-6 rounded-lg">

            <div class="card">
                <div class="card-body">
                    <div class="table-responsive">
                        <table id="dataTable" class="table table-bordered">
                            <thead class="bg-gray-50">
                                <tr>
                                    <th scope="col">
                                        ID
                                    </th>
                                    <th scope="col">
                                        Package Name
                                    </th>
                                    

                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(['show-sub-package-rate', 'specific_management_services'])): ?>

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

                                    <?php if(in_array('show-mother-package', $permissions)): ?>
                                        <th scope="col">
                                            Manager Name
                                        </th>
                                    <?php endif; ?>
                                    <?php if(in_array('show-mother-package', $permissions)): ?>
                                        <th scope="col">
                                            Mother Package
                                        </th>
                                    <?php endif; ?>

                                    <?php if(in_array('show-motherpackage-rate', $permissions)): ?>
                                        <th scope="col">
                                            Mother Package Rate
                                        </th>
                                    <?php endif; ?>
                                    <?php if(in_array('sub-pack-commission', $permissions)): ?>
                                        <th scope="col">
                                            Commission
                                        </th>
                                    <?php endif; ?>
                                    <th scope="col">

                                    </th>
                                </tr>
                            </thead>
                            <tbody class="bg-white divide-y divide-gray-200">

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

                                        </td>
                                        <td class="whitespace-nowrap">
                                            <?php echo e($r->name); ?>

                                        </td>

                                        


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

                                            </td>
                                        <?php endif; ?>

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

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



                                        <?php if(in_array('show-mother-package', $permissions)): ?>
                                            <td class="whitespace-nowrap text-sm text-gray-500">
                                                <?php echo e($r->reseller->name ?? ''); ?>

                                            </td>
                                        <?php endif; ?>
                                        <?php if(in_array('show-mother-package', $permissions)): ?>
                                            <td class="whitespace-nowrap text-sm text-gray-500">
                                                <?php echo e($r->package->package_name ?? ''); ?>

                                            </td>
                                        <?php endif; ?>
                                        <?php if(in_array('show-motherpackage-rate', $permissions)): ?>
                                            <td class="whitespace-nowrap text-sm text-gray-500">
                                                <?php echo e($r->package->package_rate ?? ''); ?>

                                            </td>
                                        <?php endif; ?>
                                        <?php if(in_array('sub-pack-commission', $permissions)): ?>
                                            <td class="whitespace-nowrap text-sm text-gray-500">
                                                <?php echo e($r->commission ?? ''); ?>

                                            </td>
                                        <?php endif; ?>

                                        <td class="whitespace-nowrap text-right text-sm font-medium">
                                            <?php if(in_array('sub-package_edit', $permissions)): ?>
                                                <a href="<?php echo e(route('sub-packages.edit', $r->id)); ?>"
                                                    class="btn btn-primary">Edit</a>
                                            <?php endif; ?>

                                            <?php if(in_array('sub-package_destroy', $permissions)): ?>
                                                <form action="<?php echo e(route('sub-packages.destroy', $r->id)); ?>" method="POST"
                                                    class="float-right pl-2"
                                                    onsubmit="return confirm('Do you really want to Delete?');">
                                                    <?php echo method_field('DELETE'); ?>
                                                    <?php echo csrf_field(); ?>
                                                    <button class="btn btn-info">Delete</button>
                                                </form>
                                            <?php endif; ?>

                                            <?php if(in_array('view-sub-package-log-history', $permissions)): ?>
                                                <a href="<?php echo e(route('editLog-history', ['id' => $r->id, 'type' => 'Sub-Package'])); ?>"
                                                    class="btn btn-primary pull-right">History</a>
                                            <?php endif; ?>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

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

                        </table>
                    </div>

                    <div class="p-5">
                        
                    </div>
                </div>
            </div>
        </div>
    </div>


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


<?php $__env->startSection('ajax'); ?>
    <script type="text/javascript">
        $(document).ready(function() {
            $('#dataTable').DataTable();
        });
    </script>
<?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/sub_package/index.blade.php ENDPATH**/ ?>