

<?php $__env->startSection('content'); ?>

<!-- Content wrapper scroll start -->
<div class="content-wrapper-scroll">

<!-- Content wrapper start -->
<div class="content-wrapper">

    <!-- Row start -->
    <div class="row gutters">
        <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12"> 
            <div class="card">
            <div class="container" style="margin-top:30px">
                         <h5>ADMINISTRATORS</h5>
                    </div>
                <div class="card-body">
                    
                    <div class="table-responsive">
                    <table id="basicExample" class="table custom-table">
                            <thead>
                                <tr>
                                  <th>Name</th>
                                  <th>Branch</th>
                                  <th>Category</th>
                                  <th>Role</th>
                                  <th>Email</th>													  
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__currentLoopData = $admins; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $users): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                  <td><?php echo e(@strtoupper($users->name)); ?></td>
                                  <td>
                                      <?php echo e(@strtoupper($users->branch)); ?>

                                  </td>
                                  <td><?php echo e(@strtoupper($users->sales_person_category)); ?></td>
                                  <td><?php echo e(@strtoupper($users->role)); ?></td>

                                  <td>
                                      <div class="actions">
                                          <a href="<?php echo e(route('editUser', $users->id)); ?>">
                                              <i class="icon-edit1 text-info"></i>
                                          </a>

                                          <a href="#" data-toggle="tooltip" id="<?php echo e($users->id); ?>" onclick="deleteUser(this.id)" data-placement="top" title="" data-original-title="Delete">
                                              <i class="icon-x-circle text-danger"></i>
                                          </a>
                                      </div>
                                  </td>
                                </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                    </table>
                    </div>

                </div>
            </div>

        </div>
    </div>
    <!-- Row end -->




    <!-- Row start -->
    <div class="row gutters">
        <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
            
            <div class="card">
            <div class="container" style="margin-top:30px">
                       <h5>OTHER USERS</h5>
                    </div>
                <div class="card-body">
                
                    <div class="table-responsive">
                        <table id="copy-print-csv" class="table v-middle">
                            <thead>
                                <tr>
                                  <th>Name</th>
                                  <th>Branch</th>
                                  <th>Category</th>
                                  <th>Role</th>
                                  <th>Email</th>													  
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__currentLoopData = $allusers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user_): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                  <td><?php echo e(@strtoupper($user_->name)); ?></td>
                                  <td>
                                      <?php echo e(@strtoupper($user_->branch)); ?>

                                  </td>
                                  <td><?php echo e(@strtoupper($user_->sales_person_category)); ?></td>
                                  <td><?php echo e(@strtoupper($user_->role)); ?></td>

                                  <td>
                                      <div class="actions">
                                      <a href="<?php echo e(route('editUser', $user_->id)); ?>">
                                              <i class="icon-edit1 text-info"></i>
                                          </a>
                
                                          <a href="#" data-toggle="tooltip" id="<?php echo e($user_->id); ?>" onclick="deleteUser(this.id)" data-placement="top" title="" data-original-title="Delete">
                                              <i class="icon-x-circle text-danger"></i>
                                          </a>
                                      </div>
                                  </td>
                                </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                    </table>
                    </div>

                </div>
            </div>

        </div>
    </div>
    <!-- Row end -->

    <script>
        function deleteUser(id) {
            Swal.fire({
                title: 'Are you sure?',
                text: "You won't be able to revert this!",
                icon: 'warning',
                showCancelButton: true,
                confirmButtonColor: '#3085d6',
                cancelButtonColor: '#d33',
                confirmButtonText: 'Yes, delete it!'
                }).then((result) => {
                if (result.isConfirmed) {
                    const xhttp = new XMLHttpRequest();
                    xhttp.onload = function() {
                        $("#copy-print-csv").load(" #copy-print-csv");
                        Swal.fire(
                            'Deleted!',
                            'Your file has been deleted.',
                            'success'
                            )
                    }
                    xhttp.open("GET", "/ceqa-dashboard/users/delete-user/"+id);
                    xhttp.send();
                    }
                })
        }
    </script>

</div>
<!-- Content wrapper end -->

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/morttsons/public_html/morttsonsposfiles/resources/views/user.blade.php ENDPATH**/ ?>