

<?php $__env->startSection('title'); ?>
    الموظفين |عرض الموظفين
<?php $__env->stopSection(); ?>

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

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

<?php $__env->startSection('header-content'); ?>
عرض الموظفين
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content-body'); ?>
  <!--**********************************
            Content body start
        ***********************************-->
        <?php echo $__env->make('massages', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

            <!-- row -->
			<div class="container-fluid">
                    <div class="col-xl-12 col-lg-12 col-xxl-12 col-sm-12">
                        <div class="card">
                            <div class="card-header">
                                <h4 class="card-title">الموظفين</h4>
                                <button type="button" class="btn btn-primary  me-1" data-bs-toggle="modal" data-bs-target="#addNewEmployee">
                                    <i class="mdi mdi-plus-circle ms-2"></i>اضافة موظف جديد
                                </button>
                            </div>
                            <div class="card-body">
                                <!--**********************************
                                    start tables
                                ***********************************-->

                                    <?php echo $__env->make('employees.tables.all', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

                                <!--**********************************
                                    end tables
                                ***********************************-->
                            </div>
                            
                            
                        </div>
                    </div>
                    <!--**********************************
                        start modals
                    ***********************************-->
                        <?php echo $__env->make('employees.modals.new', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                        <?php echo $__env->make('employees.modals.update', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                        <?php echo $__env->make('toggle.toggle', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                        <?php echo $__env->make("registry.registry", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

                    <!--**********************************
                        end modals
                    ***********************************-->
            </div>

            
        <!--**********************************
            Content body end
        ***********************************-->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script  src="<?php echo e(asset('/js/registry.js')); ?>"></script>

<script>
    //edit modal
    const edit = document.querySelectorAll('.edit');
    document.querySelectorAll('.edit').forEach(item => {
        item.addEventListener('click', e => {
            document.getElementById("id").value = item.dataset.id;
            document.getElementById("roles").value = item.dataset.role;
            document.getElementById("name").value = item.dataset.name;
            document.getElementById("phone").value = item.dataset.phone;
            document.getElementById("address").value = item.dataset.address;

            // const selectRoles = document.querySelector("#roles");
            // for(var i=0; i < selectRoles.options.length; i++)
            //     {
            //         console.log(selectRoles.options[i])
            //             if(selectRoles.options[i].value === item.dataset.role)
            //             {
            //                 selectRoles.selectedIndex = i;
            //                 // console.log(selectRoles.options[i].text,selectRoles.selectedIndex);
            //                 break;
            //             }
            //     }
            
            $('#editModal').modal('show');
        })
    })
</script>

<script src="<?php echo e(asset('/vendor/datatables/js/jquery.dataTables.min.js')); ?>"></script>
<script src="<?php echo e(asset('/js/plugins-init/datatables.init.js')); ?>"></script>


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

<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\Users\Nasser\Desktop\petrol_store\resources\views/employees/list.blade.php ENDPATH**/ ?>