



<?php $__env->startSection('title'); ?>
All Accounts 
<?php $__env->stopSection(); ?>

<?php $__env->startSection('breadcrumb'); ?>
<ol class="breadcrumb pull-right">
        <li><a href="<?php echo e(route('home')); ?>"><i class="fa fa-dashboard"></i> Home</a></li>

        <li class="active">All Account</li>
      </ol>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>


            <div class="container-fluid">
                <!-- /row -->
                <div class="row">
                    <div class="col-sm-12">
                        <div class="white-box">
                        	<div class="pull-right" style="margin-top: 10px;">
                                
								<a href="<?php echo e(route('account.addView')); ?>" class="btn  btn-primary">
									<i class="fa fa-plus-square"></i>&nbsp; Add new User
								</a>
							</div>
                            <h3 class="box-title">All Accounts</h3>

                            <div class="table-responsive">
                                <table id="myTable" class="table table-striped">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>Name</th>
                                            <th>Email</th>
                                            <th>Phone Number</th>
                                            <th>OTP</th>
                                            <th>Role</th>
                                            <th>Action</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php $count =1;?>
                                        <?php $__currentLoopData = $allUsers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr>
                                            <td><?php echo e($count++); ?></td>
                                            <td><?php echo e($user->name); ?></td>
                                             <td><?php echo e($user->email); ?></td>
                                             <td><?php echo e($user->phone_number); ?></td>
                                             <td><?php if($user->otp): ?><?php echo e($user->otp->otp); ?><?php endif; ?></td>
                                             
                                               <?php if($user->roles): ?>
                                               <td>
                                                <?php $__currentLoopData = $user->roles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php $__currentLoopData = $role->projects; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $project): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php echo e($project->name); ?>

                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                  --- 
                                                <b><?php echo e($role->name); ?></b><br>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                               </td>
                                                   <?php else: ?>
                                                   <td>
                                               </td>
                                               <?php endif; ?>
                                        

                                            <td class="text-nowrap">
                                                <?php if (\Illuminate\Support\Facades\Blade::check('role', 'admin')): ?>
                                                <a href="<?php echo e(route('account.edit',['id'=>$user->id])); ?>" data-toggle="tooltip" data-original-title="Edit User"> <i class="fa fa-pencil text-primary"></i> </a>
                                                &nbsp;
                                                &nbsp;
                                                &nbsp;
                                                <a href="<?php echo e(route('account.delete',['id'=>$user->id])); ?>" data-toggle="confirmation" data-title="Are you sure to delete?" > <i class="fa fa-close text-danger"></i> </a>
                                                <?php endif; ?>
                                            </td>
                                        </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /.row -->
              </div>
            <!-- /.container-fluid -->

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

<?php $__env->startSection('js'); ?>
<script>
    $(function() {
        $('#myTable').DataTable();

        });
        </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\erpv7\resources\views/Setting/account/index.blade.php ENDPATH**/ ?>