 
<?php $__env->startSection('title', 'Editable Datatable'); ?>
<?php $__env->startSection('content'); ?>
    <!-- push external head elements to head -->
    <?php $__env->startPush('head'); ?>
        <link rel="stylesheet" href="<?php echo e(asset('plugins/DataTables/datatables.min.css')); ?>">
        <link rel="stylesheet" href="<?php echo e(asset('plugins/jquery-ui/jquery-ui.css')); ?>">
    <?php $__env->stopPush(); ?>

    
    <div class="container-fluid">
         <div class="page-header">
            <div class="row align-items-end">
                <div class="col-lg-8">
                    <div class="page-header-title">
                        <i class="ik ik-pie-chart bg-blue"></i>
                        <div class="d-inline">
                            <h5><?php echo e(__('Employee Mater View Data')); ?></h5>
                            <span><?php echo e(__('EJAF.')); ?></span>
                        </div>
                    </div>
                </div>
                <div class="col-lg-4">
                    <nav class="breadcrumb-container" aria-label="breadcrumb">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item">
                                <a href="<?php echo e(route('dashboard')); ?>"><i class="ik ik-home"></i></a>
                            </li>
                            
                           <li class="breadcrumb-item active" aria-current="page"><?php echo e(__('Employee Mater View')); ?></li>
                        </ol>
                    </nav>
                </div>
            </div>
        </div>
        
        <?php
        use App\User;
        $id = Auth::user()->id;
        $user  = User::with('roles','permissions')->find($id);
        $permissions = $user->getAllPermissions();
        $add_perm = 0;
        $edit_perm = 0;
        $delete_perm = 0;
        if(count($permissions) > 0)
        {
            foreach($permissions as $data)
            {
                if($data->name == "Add")
                {
                    $add_perm = 1;
                }
                if($data->name == "Modify")
                {
                    $edit_perm = 1;
                }
                if($data->name == "Delete")
                {
                    $delete_perm = 1;
                }
            }
        }
        ?>
        
        <div class="row clearfix">
            <div class="col-md-12">
                <div class="card">
                    <div class="card-header">
                        <h3><?php echo e(__('Editable Data Table')); ?></h3>
                        <?php if($add_perm == 1): ?>
                        <a href='<?php echo e('employee-master'); ?>' style='margin-left: 75%;' class='btn btn-primary'><?php echo e(__('Add Employee')); ?></a>
                        <?php endif; ?>
                    </div>
                    <div class="card-body">
                        <table id="myAdvancedTable" class="table p-3">
                            <thead>
                                <tr>
                                    <th><?php echo e(__('Employee Name')); ?></th>
                                    <th><?php echo e(__('Employee Code')); ?></th>
                                    <th><?php echo e(__('District Code')); ?></th>
                                    <th><?php echo e(__('State Code')); ?></th>
                                    <th><?php echo e(__('Action')); ?></th>
                                </tr>
                            </thead>
                            <tbody>
                                 <?php $__currentLoopData = $getdata; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $getdatas): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td><?php echo e($getdatas->emp_name); ?></td>
                                    <td><?php echo e($getdatas->emp_code); ?></td>
                                    <td><?php echo e($getdatas->dist_code); ?></td>
                                    <td><?php echo e($getdatas->state_code); ?></td>
                                    <td>
                                        <?php if($edit_perm == 1): ?>
                                        <a href='<?php echo e('editemployee/'.$getdatas->id); ?>' class='btn btn-success'>Edit</a> 
                                        <?php endif; ?>
                                        <?php if($delete_perm == 1): ?>
                                        <?php echo e(__(' | ')); ?><a href='<?php echo e('deleteemployee/'.$getdatas->id); ?>' class='btn btn-danger'>Delete</a>
                                        <?php endif; ?>
                                    </td>
                                </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                
                            </tbody>
                        </table>
                    </div>
                </div> 
            </div>
        </div>
    </div>

    <!-- push external js -->
    <?php $__env->startPush('script'); ?>
    <script src="<?php echo e(asset('plugins/jquery-ui/jquery-ui.min.js')); ?>"></script>
    <script src="<?php echo e(asset('plugins/DataTables/datatables.min.js')); ?>"></script>
    <!--<script src="<?php echo e(asset('plugins/DataTables/Cell-edit/dataTables.cellEdit.js')); ?>"></script>-->
    <!--get editable datatable script-->
    <script src="<?php echo e(asset('js/editable-datatable.js')); ?>"></script>
    <?php $__env->stopPush(); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/viruxyz/public_html/ejaf/resources/views/pages/employee-master-data.blade.php ENDPATH**/ ?>