

<?php $__env->startSection('content'); ?>
    <?php Fun::lang()?>
    <div class="top-header">
        <ol class="breadcrumb">
            <li><a href="#"><?php echo e(__('administrator.Dashboard')); ?></a></li>
            <li><a href="<?php echo e(route('hr-employee.index')); ?>"><?php echo e(__('administrator.employee')); ?></a></li>
        </ol>
    </div>
    <div class="page">
        <div class="top-content">
            <div class="row">
                <div class="col-sm-6 col-xs-12">
                    <div class="title-add">
                        <div class="pull-left">
                            <h3><?php echo e(__('administrator.employee')); ?> </h3>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6 col-xs-12">
                    <div class="title-add">
                        <div class="pull-right">
                            <?php if(Gate::check('Employee Create')): ?>
                                <a href="<?php echo e(route('hr-employee.create')); ?>"
                                   class="button_primary"><?php echo e(__('administrator.add_new')); ?></a>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="box-body">
            <table id="datatable_products" class="table table-striped">
                <thead>
                    <tr>
                        <th>#</th>
                        <th><?php echo e(__('administrator.photo')); ?></th>
                        <th><?php echo e(__('administrator.khmer_name')); ?></th>
                        <th><?php echo e(__('administrator.english_name')); ?></th>
                        <th><?php echo e(__('administrator.code')); ?></th>
                        <th><?php echo e(__('administrator.contact')); ?></th>
                        <th><?php echo e(__('administrator.joined_date')); ?></th>
                        <th><?php echo e(__('administrator.sex')); ?></th>
                        <th><?php echo e(__('administrator.branch')); ?></th>
                        <th><?php echo e(__('administrator.department')); ?></th>
                        <th><?php echo e(__('administrator.role')); ?></th>
                        <th><?php echo e(__('administrator.position')); ?></th>
                        <th><?php echo e(__('administrator.status')); ?></th>
                        <th style="width: 200px;"><?php echo e(__('administrator.action')); ?></th>
                    </tr>
                </thead>
                <tbody>

                </tbody>
            </table>
        </div>
    </div>
    <div class="modal fade bs-modal-lg" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-dm">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                    <h3 class="modal-title"><?php echo e(__('administrator.are_you_sure')); ?></h3>
                </div>
                <br/>
                <form role="form" method="POST" id="form_update">
                    <?php echo e(csrf_field()); ?>

                    <div class="row">
                        <div class="col-md-12">
                            <div class="col-md-12">
                                <input type="hidden" name="id" id="id">
                            </div>
                            <div class="form-group col-sm-12 col-xs-12">
                                <label class="required"><?php echo e(__('administrator.status')); ?></label>
                                <select name="status" class="form-control input-lg select2" required>
                                    <option value=""><?php echo e(__('administrator.please_select')); ?></option>
                                    <option value="1"><?php echo e(__('administrator.activate')); ?>

                                    </option>
                                    <option value="0"><?php echo e(__('administrator.deactivate')); ?>

                                    </option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" data-dismiss="modal" class="btn btn-danger"><i
                                    class="fa fa-close"></i> <?php echo e(__('administrator.close')); ?>

                        </button>
                        <button type="submit" class="btn btn-success" data-toggle="modal"><i
                                    class="fa fa-save"></i> <?php echo e(__('administrator.save')); ?>

                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('js'); ?>
    <script type="text/javascript">
        let table = $('#datatable_products');
        $(document).ready(function () {
            getTable();
            $(document).on('click', '.viewPopLink', function () {
                var id = $(this).data('id');
                $('#id').val(id);
                var url = "<?php echo e(route('hr.employee-change-status')); ?>";
                $('#form_update').attr('action', url);
                $('#myModal').modal('show');
            });
            table.on('click', '.account-setting', function () {
                getHtmlForm($(this).data('href'),'<?php echo e(__('administrator.account_setting')); ?>','500px');
            });


        });
        function getTable() {
            table.DataTable().destroy();
            table.DataTable({
                ordering: false,
                serverSide: true,
                ajax: "<?php echo e(route('datatable.hr-get-employee')); ?>",
                lengthMenu: [20, 30, 50, 100, 200, 500, 1000],
                columns:
                    [
                        {
                            data: 'DT_RowIndex',
                            orderable: false,
                            searchable: false
                        },
                        {
                            "data": "photo",
                            "render": function (data, type, row) {
                                return '<center><img src="' + data + '" border="0" width="35" height="35" class="img-circle" align="center" loading="lazy" /></center>';
                            }
                        },
                        {
                            data: 'name_kh'
                        },
                        {
                            data: 'name'
                        },
                        {
                            data: 'code'
                        },
                        {
                            data: 'phone'
                        },
                        {
                            data: 'joined_date'
                        },
                        {
                            data: 'gender'
                        },
                        {
                            data: 'branch_id'
                        },
                        {
                            data: 'department_id'
                        },
                        {
                            data: 'role_id',
                            searchable: false
                        },
                        {
                            data: 'position_id',
                            searchable: false
                        },
                        {
                            data: 'status'
                        },
                        {
                            data: 'action',
                            searchable: false
                        },
                    ],

                "initComplete": function (settings, json) {

                }

            });
            $.fn.dataTable.ext.errMode = 'throw';
        }
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app-hr', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/nsowos/public_html/shr-brand/resources/views/hr/employee/index.blade.php ENDPATH**/ ?>