<div class="table-responsive">
    <table class="table table-bordered">
        <thead  style="background: #78716C;color:white;">
            <tr>
                <th scope="col" class="">
                    ID
                </th>

                <th scope="col" class="">
                    User name
                </th>

                <th scope="col" class="">
                    Expire Date
                </th>

                <th scope="col" class="">
                    Bill Cycle
                </th>

                <?php if(!auth()->check() || ! auth()->user()->hasRole('Sub Reseller')): ?>
                    <th scope="col" class="">
                        Package
                    </th>
                <?php endif; ?>
                <th scope="col" class="">
                    Sub Package
                </th>

                <th scope="col" class="">
                    Contact No
                </th>

                <th scope="col" class="">
                    action
                </th>
            </tr>
        </thead>
        <tbody class="">
            
            <?php $__empty_1 = true; $__currentLoopData = $r; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr>



                    <td>
                        
                        <?php echo e($row->id); ?>

                    </td>
                    <td>
                        <?php echo e($row->userid); ?>

                    </td>

                    <td class="whitespace-nowrap">
                        <?php echo e(date('d-M-Y', strtotime($row->expire_date))); ?>

                    </td>


                    <td>
                        <?php echo e($row->billing_cycle); ?>

                    </td>
                    <?php if(!auth()->check() || ! auth()->user()->hasRole('Sub Reseller')): ?>
                        <td>
                            <?php echo e($row->packages->package_name); ?>

                        </td>
                    <?php endif; ?>

                    <td>
                        <?php if($row->subpack): ?>
                            <?php echo e($row->subpack->name); ?>

                        <?php endif; ?>
                    </td>

                    <td>
                        <?php echo e($row->clientsinfo->contact_no ?? ''); ?>

                    </td>
                    <td class="px-6 text-left text-sm font-medium">




                        <?php if(!empty($packages)): ?>
                            <form action="<?php echo e(route('userPackageChange', $row->id)); ?>" method="POST"
                                class="flex flex-wrap">


                                <?php echo csrf_field(); ?>
                                <input type="hidden" name="id" value="<?php echo e($row->id); ?>">
                                <input type="hidden" id="uuid" name="uuid" value="<?php echo e(createUUID()); ?>">

                                <div class="row">
                                    <div class="col-md-7">


                                        <?php if($row->pop->subreseller == 'yes'): ?>
                                            <select name="package_id" class="form-control" required>
                                                <option value="">Select</option>
                                                <?php $__currentLoopData = $packages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($p->id); ?>"
                                                        <?php if($p->id == $row->sub_package_id): ?> selected <?php endif; ?>>
                                                        (<?php echo e($p->id); ?>)
                                                        - <?php echo e($p->name); ?> <?php if(globalPermission('package-change-price-show')): ?>
                                                            (<?php echo e($p->rate); ?> TK)
                                                        <?php endif; ?>
                                                    </option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                            </select>
                                        <?php else: ?>
                                            <select name="package_id" class="form-control" required>
                                                <option value="">Select</option>
                                                <?php $__currentLoopData = $packages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option value="<?php echo e($p->id); ?>"
                                                        <?php if($p->id == $row->package_id): ?> selected <?php endif; ?>>
                                                        (<?php echo e($p->id); ?>)
                                                        - <?php echo e($p->package_name); ?>

                                                        <?php if(globalPermission('package-change-price-show')): ?>
                                                            (<?php echo e($p->package_rate); ?> TK)
                                                        <?php endif; ?>
                                                    </option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                            </select>
                                        <?php endif; ?>

                                    </div>
                                    <div class="col-md-5">
                                        <button type="submit" class="btn btn-primary">Change Package</button>
                                    </div>
                                </div>



                            </form>
                        <?php else: ?>
                            <form action="<?php echo e(route('userBillingCycleChange', $row->id)); ?>" method="POST"
                                class="flex flex-wrap">


                                <?php echo csrf_field(); ?>
                                <input type="hidden" name="id" value="<?php echo e($row->id); ?>">
                                <input type="hidden" id="uuid" name="uuid" value="<?php echo e(createUUID()); ?>">
                                <div class="row">
                                    <div class="col-md-7">
                                        <select name="billCycle" class="form-control" required>
                                            <option value="">Select Date</option>
                                            <?php $__currentLoopData = explode(',', $confday); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($item); ?>"
                                                    <?php if($row->billing_cycle == $item): ?> selected <?php endif; ?>>
                                                    <?php echo e($item); ?>

                                                </option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>


                                        </select>
                                    </div>
                                    <div class="col-md-5">
                                        <button type="submit" class="btn btn-primary">Billing Cycle Change</button>
                                    </div>
                                </div>




                            </form>
                        <?php endif; ?>







                    </td>
                </tr>

            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>

            <?php endif; ?>

            <!-- More items... -->
        </tbody>
    </table>
</div>
<?php /**PATH /var/www/html/powermedia/radius-circle/resources/views/clients/result.blade.php ENDPATH**/ ?>