<?php $__env->startSection('content'); ?>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<div class="container-fluid px-4">
  <script>
    $('#myDataTable').hide(); // Hide the table initially
      $(document).ready(function() {
          $('#myDataTable').DataTable({
              order: [
                  [0, 'desc']
              ], // Sort by the first column (index 0) in descending order
              orderMulti: false, // Disable multi-column ordering
              initComplete: function(settings, json) {
                  $('#myDataTable')
                      .show(); // Show the table after DataTable initialization
              }
          });
      });
</script>
    <div class="card mt-4">
                   <div class="card-header">
                    <?php if(session('status')): ?>
                    <div class="alert alert-success"><?php echo e(session('status')); ?></div>
                <?php endif; ?>

                                  
                                  <div class="d-flex justify-content-between align-items-center mb-3">
                                    <h1 class=""><?php echo e(__('adminList')); ?></h1>
                                    <a href="<?php echo e(route('add-admin-profile')); ?>" class="btn btn-primary"><?php echo e(__('addAdmin')); ?></a>
                                </div>
                                
                                  <div class="table-responsive text-nowrap">
                                  <table id="myDataTable" class="table" width="100%" cellspacing="0">
                                    <thead>
                                        <tr>
                                          <th><?php echo e(__('Shop id')); ?></th>
                                          <th><?php echo e(__('shopname')); ?></th>
                                          <th><?php echo e(__('contactdetails')); ?></th>
                                          <th><?php echo e(__('plantype')); ?></th>
                                          <th><?php echo e(__('status')); ?></th>
                                          <th><?php echo e(__('action')); ?></th>
                                            

                                        </tr>
                                    </thead>
                                    <tbody  class="table-border-bottom-0">
                                        <!-- Table rows -->
                                        <?php $__currentLoopData = $adminList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $admin): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php if($admin->delete_flag == 0): ?>
                                        <tr>
                                          <td><?php echo e($admin->id); ?></td>
                                            <td>  <img src="<?php echo e(asset($admin->shopimage)); ?>" width="40px" height="40px" alt="Img">
                                              <br> 
                                            <b>  <?php echo e($admin->shopname); ?></b>
                                        </td>
                                            <td> <p><strong><?php echo e(__('name')); ?>:</strong> <?php echo e($admin->name); ?></p>
                                              <p><strong><?php echo e(__('address')); ?>:</strong> <?php echo e(substr($admin->adress, 0, 50) . (strlen($admin->adress) > 50 ? '...' : '')); ?></p>
                                              <p><strong><?php echo e(__('Phone')); ?>:</strong> <?php echo e($admin->shopnumber); ?></p>
                                              <p><strong><?php echo e(__('Email')); ?>:</strong> <?php echo e($admin->email); ?></p></td>
                                              <td>
                                                <?php if($admin->plan_type == 0 ): ?>
                                                <span class="badge rounded-pill bg-primary"><?php echo e(__('free')); ?></span>
                                            <?php elseif($admin->plan_type == 1): ?>    
                                            <span class="badge rounded-pill bg-primary"><?php echo e(__('standard')); ?></span>
                                            <?php else: ?>
                                            <span class="badge rounded-pill bg-primary"><?php echo e(__('premium')); ?></span>
                                    
                                            <?php endif; ?>
                                              </td>
                                            <td> 
                                              <?php if($admin->active_status == 1): ?>
                                                <button
                                                type="button"
                                                class="btn btn-outline-success dropdown-toggle"
                                                data-bs-toggle="dropdown"
                                                aria-expanded="false"
                                              >
                                              <?php echo e(__('active')); ?>

                                              </button>
                                              <ul class="dropdown-menu">
                                                <li><a href="<?php echo e(url('super-admin/update-admin-active_sts/'.$admin->id)); ?>"  class="dropdown-item" href="javascript:void(0);"><?php echo e(__('makeDeactive')); ?></a></li>
                                              </ul>
                                                <?php else: ?>
                                                <button
                                                type="button"
                                                class="btn btn-outline-danger dropdown-toggle"
                                                data-bs-toggle="dropdown"
                                                aria-expanded="false"
                                              >
                                                deactive
                                              </button>
                                              <ul class="dropdown-menu">
                                                <li><a href="<?php echo e(url('super-admin/update-admin-active_sts/'.$admin->id)); ?>"  class="dropdown-item" href="javascript:void(0);"><?php echo e(__('makeActive')); ?></a></li>
                                              </ul>
                                                
                                                <?php endif; ?>
                                            </td>
                                            <td>
                                              <a href="<?php echo e(url('super-admin/edit-admin-profile?admin_id='.$admin->id)); ?>" class="btn btn-primary"> <?php echo e(__('edit')); ?></a>
                                              <a href="<?php echo e(url('super-admin/delete-admin/'.$admin->id)); ?>" onclick="return confirmDelete()" class="btn btn-danger"><?php echo e(__('delete')); ?></a>

                                            </td>

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

                                </table>
                            </div>
                   </div>



                 <script>
function confirmDelete() {
    return confirm('Are you sure you want to delete this user?');
}
</script>

    </div>

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

<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/xorgeekc/public_html/medishop/resources/views/admin/admin_profile/view_ad_list.blade.php ENDPATH**/ ?>