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

<?php
    
?>
<?php $__env->startSection('content'); ?>
<div class="content d-flex flex-column flex-column-fluid" id="kt_content">
    <div class="d-flex flex-column-fluid pb-20">
        <div class="container">
            <div class="d-flex align-items-stretch justify-content-between mb-2">
                <div class="d-flex align-items-center justify-content-between flex-wrap flex-sm-nowrap mr-15">
                    
                </div>

                <div class="d-flex align-items-center justify-content-between flex-wrap flex-sm-nowrap">
                    <a href="" class="btn btn-primary font-weight-bold btnAddUser" data-toggle="modal" data-target="#edit_User"><i class="la la-plus"></i>Add User</a>
                    
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12" id="ListTable">                   
                    <!-- Datatable (JS in datatable-custom.js) -->
                    <table class="table table-bordered mt-15 table_pm_staff_settings table-hover" id="pm_staff_settings">
                        <thead>
                            <tr>
                                <th>#</th>                                                         
                                <th>Name</th>
                                <th>Email</th>
                                <th>Contact</th>
                                <th>Role</th>
                                <th>Project</th>                           
                                <th>Status</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                        <?php
                            $count = 0;
                            
                        ?>
                        <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php                       
                            // $user = $user[0];   
                            $status = ($user->status) == 0 ? "Inactive" : "Active";                  
                            $count++;
                        ?>
                            <tr>
                                <td><?php echo e($count); ?></td>                                
                                <td style="text-align:left;"><?php echo e($user->name); ?></td>
                                <td style="text-align:left;"><?php echo e($user->email); ?></td>
                                <td><?php echo e($user->tel); ?></td>
                                <td><?php echo e($user->role); ?></td>
                                <td>Arte Cheras</td>      
                                <td><?php echo e($status); ?></td>
                                <td data-id="<?php echo e($user->id); ?>"></td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>                            
                        </tbody>
                    </table>
                </div>

                
            </div>


            <!-- Modal Edit User -->
            

            <div class="modal fade" id="edit_User" tabindex="-1" role="dialog" aria-labelledby="edit_User" aria-hidden="true">
                <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h5 class="modal-title user-name"></h5>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <i aria-hidden="true" class="ki ki-close"></i>
                            </button>
                        </div>
                        <div class="modal-body">
                            <form>
                                <div class="form-group row">
                                    
                                    <div class="col-lg-6">
                                        <label>Role</label>
                                        <select class="form-control selectpicker" data-size="3" id="user-role">
                                        <?php $__currentLoopData = $role_list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($list->id); ?>"><?php echo e($list->name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>                                           
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group" id="user-project">
                                    <label>Projects</label>
                                    <div class="checkbox-inline row">
                                    <?php $__currentLoopData = $res_list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <div class="col-sm-4">
                                            <label class="checkbox">
                                                <input type="checkbox" name="project" value="<?php echo e($list->id); ?>" />
                                                <span></span>
                                                <?php echo e($list->name); ?> - <?php echo e($list->id); ?>

                                            </label>
                                        </div>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </div>
                                </div>
                                
                                <div class="form-group row">
                                    <div class="col-lg-6">
                                        <label>Name</label>
                                        <input id="user-name" class="form-control user-name" type="text" value="">
                                    </div>
                                    <div class="col-lg-6">
                                        <label>Contact</label>
                                        <input id="user-contact" class="form-control" type="text" value="">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <div class="col-lg-6">
                                        <label>Email</label>
                                        <input id="user-email" class="form-control" type="email" value="">
                                    </div>
                                    <div class="col-lg-6">
                                        <label>Status</label>
                                        <select class="form-control selectpicker" data-size="3" id="user-status">
                                            <option value="1">Active</option>
                                            <option value="0">Inactive</option>
                                        </select>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-light-success font-weight-bold btnSaveStaff" data-id="">Save</button>
                            <button type="button" class="btn btn-light-primary font-weight-bold" data-dismiss="modal">Cancel</button>
                        </div>

                        <div class="confirm">
                            <div></div>
                            <div>
                                <div id="confirmMessage">Confirm text</div>
                                <div>
                                    <input class="btn btn-sm btn-light-success font-weight-bold" id="confirmYes" type="button" value="Yes" />
                                    <input class="btn btn-sm btn-light-primary font-weight-bold" id="confirmNo" type="button" value="No" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>


            <!-- Modal Add User -->           
            

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

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

<?php $__env->startSection('custom_js'); ?>
<script src="<?php echo e(asset('js/user.js')); ?>"></script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\laravel\inventory\resources\views/admin/users/index.blade.php ENDPATH**/ ?>