<?php $__env->startSection("content"); ?>
<?php $__env->startSection("title","Add Employees"); ?>

<div class="row">
    <div class="col-xl-12 col-lg-12">
        <div class="alert alert-success my-3" style="display:none;" id="success"></div>
        
        <div class="card">
            <div class="card-header d-flex justify-content-between align-items-center">
                <h4 class="card-title mb-0">Add Employees</h4>
                <a href="javascript:history.back()" class="btn btn-sm btn-light">
                    <i class="ri-arrow-left-line"></i> Back
                </a>
            </div>
            
            <div class="card-body">
                <form accept-charset="utf-8" name="add-form" id="add-form" enctype="multipart/form-data">
                    <?php echo csrf_field(); ?>
                    <div class="row">

<div class="mt-2 col-xs-12 col-sm-12 col-md-4 col-lg-4">        
<label class='form-label'><?php echo e($dbs_employees['client_id_req']); ?><?php echo e($dbs_employees['client_id_title']); ?>: </label>
 <select name="client_id" id="add-client_id"  class="chosen-select form-control form-select">
    <option value=""><?php echo e($dbs_employees['client_id_req']); ?>Select <?php echo e($dbs_employees['client_id_title']); ?> </option>
    <?php $__currentLoopData = $client_id; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $name): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <?php
    $selected = ($id == '') ? 'selected="selected"' : '';
?>
        <option value="<?php echo e($id); ?>"  <?php echo e($selected); ?>><?php echo e($name); ?></option>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<script>
    $(function() {
        $('#add-client_id').chosen({
              width: '100%',
              search_contains: true
            });
        });
</script>
<span class='text-danger' id='add-client_idError'></span>
</div>


<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_employees['employee_code_req']); ?><?php echo e($dbs_employees['employee_code_title']); ?>:</label>
        <input type = '<?php echo e($dbs_employees['employee_code_html5_type']); ?>' name = "employee_code" id = "add-employee_code" autocomplete = 'off' maxlength ='<?php echo e($dbs_employees['employee_code_max']); ?>'  value='' <?php if($dbs_employees['employee_code_html5_req']!=''): ?> <?php echo e($dbs_employees['employee_code_html5_req']); ?> = <?php echo e($dbs_employees['employee_code_html5_req']); ?> <?php endif; ?> class= 'form-control'  >
        <span class='text-danger' id='add-employee_codeError'></span>
    </div>
</div>


<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_employees['first_name_req']); ?><?php echo e($dbs_employees['first_name_title']); ?>:</label>
        <input type = '<?php echo e($dbs_employees['first_name_html5_type']); ?>' name = "first_name" id = "add-first_name" autocomplete = 'off' maxlength ='<?php echo e($dbs_employees['first_name_max']); ?>'  value='' <?php if($dbs_employees['first_name_html5_req']!=''): ?> <?php echo e($dbs_employees['first_name_html5_req']); ?> = <?php echo e($dbs_employees['first_name_html5_req']); ?> <?php endif; ?> class= 'form-control'  >
        <span class='text-danger' id='add-first_nameError'></span>
    </div>
</div>


<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_employees['last_name_req']); ?><?php echo e($dbs_employees['last_name_title']); ?>:</label>
        <input type = '<?php echo e($dbs_employees['last_name_html5_type']); ?>' name = "last_name" id = "add-last_name" autocomplete = 'off' maxlength ='<?php echo e($dbs_employees['last_name_max']); ?>'  value='' <?php if($dbs_employees['last_name_html5_req']!=''): ?> <?php echo e($dbs_employees['last_name_html5_req']); ?> = <?php echo e($dbs_employees['last_name_html5_req']); ?> <?php endif; ?> class= 'form-control'  >
        <span class='text-danger' id='add-last_nameError'></span>
    </div>
</div>


<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_employees['email_req']); ?><?php echo e($dbs_employees['email_title']); ?>:</label>
        <input type = '<?php echo e($dbs_employees['email_html5_type']); ?>' name = "email" id = "add-email" autocomplete = 'off' maxlength ='<?php echo e($dbs_employees['email_max']); ?>'  value='' <?php if($dbs_employees['email_html5_req']!=''): ?> <?php echo e($dbs_employees['email_html5_req']); ?> = <?php echo e($dbs_employees['email_html5_req']); ?> <?php endif; ?> class= 'form-control'   oninput='validateEmailInput(this)' >
        <span class='text-danger' id='add-emailError'></span>
    </div>
</div>


<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_employees['phone_req']); ?><?php echo e($dbs_employees['phone_title']); ?>:</label>
        <input type = '<?php echo e($dbs_employees['phone_html5_type']); ?>' name = "phone" id = "add-phone" autocomplete = 'off' maxlength ='<?php echo e($dbs_employees['phone_max']); ?>'  value='' <?php if($dbs_employees['phone_html5_req']!=''): ?> <?php echo e($dbs_employees['phone_html5_req']); ?> = <?php echo e($dbs_employees['phone_html5_req']); ?> <?php endif; ?> class= 'form-control'  >
        <span class='text-danger' id='add-phoneError'></span>
    </div>
</div>


<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_employees['cnic_req']); ?><?php echo e($dbs_employees['cnic_title']); ?>:</label>
        <input type = '<?php echo e($dbs_employees['cnic_html5_type']); ?>' name = "cnic" id = "add-cnic" autocomplete = 'off' maxlength ='<?php echo e($dbs_employees['cnic_max']); ?>'  value='' <?php if($dbs_employees['cnic_html5_req']!=''): ?> <?php echo e($dbs_employees['cnic_html5_req']); ?> = <?php echo e($dbs_employees['cnic_html5_req']); ?> <?php endif; ?> class= 'form-control'  >
        <span class='text-danger' id='add-cnicError'></span>
    </div>
</div>

<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_employees['gender_req']); ?><?php echo e($dbs_employees['gender_title']); ?>:</label><br/>
        <div class="mt-2">
            <?php
            $options = $dbs_employees['gender_array'];
            ?>

            <?php $__currentLoopData = $options; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php
                $checked = ($key == '') ? 'checked="checked"' : '';
                ?>

                <label class="btn btn-outline-primary">
                    <input type="radio" name="gender" value="<?php echo e($key); ?>" id="add-gender" <?php echo e($checked); ?>/> <?php echo e($value); ?>

                </label>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    </div>
</div>

<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_employees['date_of_birth_req']); ?><?php echo e($dbs_employees['date_of_birth_title']); ?>:</label>
        <input type = '<?php echo e($dbs_employees['date_of_birth_html5_type']); ?>' name = "date_of_birth" id = "add-date_of_birth" autocomplete = 'off' <?php if($dbs_employees['date_of_birth_html5_req']!=''): ?> <?php echo e($dbs_employees['date_of_birth_html5_req']); ?> = <?php echo e($dbs_employees['date_of_birth_html5_req']); ?> <?php endif; ?> class= 'form-control dateBox' >
        <span class='text-danger' id='add-date_of_birthError'></span>
        
        <script>
            $(function() {
                $( '#add-date_of_birth' ).datepicker({
                    changeMonth: true,
                    changeYear: true
                });
                $( '#add-date_of_birth' ).datepicker( 'option', 'yearRange', 'c-100:c+10' );
                $( '#add-date_of_birth' ).datepicker( 'option', 'dateFormat', 'yy-mm-dd' );
                $('#add-date_of_birth').datepicker('setDate', '<?php echo e(date("y-m-d")); ?>' );                
            });
        </script>
    </div>
</div>

<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_employees['joining_date_req']); ?><?php echo e($dbs_employees['joining_date_title']); ?>:</label>
        <input type = '<?php echo e($dbs_employees['joining_date_html5_type']); ?>' name = "joining_date" id = "add-joining_date" autocomplete = 'off' <?php if($dbs_employees['joining_date_html5_req']!=''): ?> <?php echo e($dbs_employees['joining_date_html5_req']); ?> = <?php echo e($dbs_employees['joining_date_html5_req']); ?> <?php endif; ?> class= 'form-control dateBox' >
        <span class='text-danger' id='add-joining_dateError'></span>
        
        <script>
            $(function() {
                $( '#add-joining_date' ).datepicker({
                    changeMonth: true,
                    changeYear: true
                });
                $( '#add-joining_date' ).datepicker( 'option', 'yearRange', 'c-100:c+10' );
                $( '#add-joining_date' ).datepicker( 'option', 'dateFormat', 'yy-mm-dd' );
                $('#add-joining_date').datepicker('setDate', '<?php echo e(date("y-m-d")); ?>' );                
            });
        </script>
    </div>
</div>

<div class="mt-2 col-xs-12 col-sm-12 col-md-4 col-lg-4">        
<label class='form-label'><?php echo e($dbs_employees['department_id_req']); ?><?php echo e($dbs_employees['department_id_title']); ?>: </label>
 <select name="department_id" id="add-department_id"  class="chosen-select form-control form-select">
    <option value=""><?php echo e($dbs_employees['department_id_req']); ?>Select <?php echo e($dbs_employees['department_id_title']); ?> </option>
    <?php $__currentLoopData = $department_id; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $name): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <?php
    $selected = ($id == '') ? 'selected="selected"' : '';
?>
        <option value="<?php echo e($id); ?>"  <?php echo e($selected); ?>><?php echo e($name); ?></option>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<script>
    $(function() {
        $('#add-department_id').chosen({
              width: '100%',
              search_contains: true
            });
        });
</script>
<span class='text-danger' id='add-department_idError'></span>
</div>

<div class="mt-2 col-xs-12 col-sm-12 col-md-4 col-lg-4">        
<label class='form-label'><?php echo e($dbs_employees['designation_id_req']); ?><?php echo e($dbs_employees['designation_id_title']); ?>: </label>
 <select name="designation_id" id="add-designation_id"  class="chosen-select form-control form-select">
    <option value=""><?php echo e($dbs_employees['designation_id_req']); ?>Select <?php echo e($dbs_employees['designation_id_title']); ?> </option>
    <?php $__currentLoopData = $designation_id; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $name): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <?php
    $selected = ($id == '') ? 'selected="selected"' : '';
?>
        <option value="<?php echo e($id); ?>"  <?php echo e($selected); ?>><?php echo e($name); ?></option>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<script>
    $(function() {
        $('#add-designation_id').chosen({
              width: '100%',
              search_contains: true
            });
        });
</script>
<span class='text-danger' id='add-designation_idError'></span>
</div>

<div class="mt-2 col-xs-12 col-sm-12 col-md-4 col-lg-4">        
<label class='form-label'><?php echo e($dbs_employees['shift_id_req']); ?><?php echo e($dbs_employees['shift_id_title']); ?>: </label>
 <select name="shift_id" id="add-shift_id"  class="chosen-select form-control form-select">
    <option value=""><?php echo e($dbs_employees['shift_id_req']); ?>Select <?php echo e($dbs_employees['shift_id_title']); ?> </option>
    <?php $__currentLoopData = $shift_id; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $name): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <?php
    $selected = ($id == '') ? 'selected="selected"' : '';
?>
        <option value="<?php echo e($id); ?>"  <?php echo e($selected); ?>><?php echo e($name); ?></option>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<script>
    $(function() {
        $('#add-shift_id').chosen({
              width: '100%',
              search_contains: true
            });
        });
</script>
<span class='text-danger' id='add-shift_idError'></span>
</div>

<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_employees['employment_type_req']); ?><?php echo e($dbs_employees['employment_type_title']); ?>:</label><br/>
        <div class="mt-2">
            <?php
            $options = $dbs_employees['employment_type_array'];
            ?>

            <?php $__currentLoopData = $options; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php
                $checked = ($key == '') ? 'checked="checked"' : '';
                ?>

                <label class="btn btn-outline-primary">
                    <input type="radio" name="employment_type" value="<?php echo e($key); ?>" id="add-employment_type" <?php echo e($checked); ?>/> <?php echo e($value); ?>

                </label>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    </div>
</div>

<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_employees['basic_salary_req']); ?><?php echo e($dbs_employees['basic_salary_title']); ?>:</label>
        <input type = '<?php echo e($dbs_employees['basic_salary_html5_type']); ?>' name = "basic_salary" id = "add-basic_salary" data-maxlen='<?php echo e($dbs_employees['basic_salary_max']); ?>' data-scale='<?php echo e($dbs_employees['basic_salary_scale'] ?? ''); ?>' autocomplete = 'off'   value='' <?php if($dbs_employees['basic_salary_html5_req']!=''): ?> <?php echo e($dbs_employees['basic_salary_html5_req']); ?> = <?php echo e($dbs_employees['basic_salary_html5_req']); ?> <?php endif; ?> class= 'form-control'   onkeydown='validateFloatInput(event)'  oninput='validateInput(this,<?php echo e($dbs_employees['basic_salary_max']); ?>)' />
        <span class='text-danger' id='add-basic_salaryError'></span>
    </div>
</div>


<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_employees['bank_name_req']); ?><?php echo e($dbs_employees['bank_name_title']); ?>:</label>
        <input type = '<?php echo e($dbs_employees['bank_name_html5_type']); ?>' name = "bank_name" id = "add-bank_name" autocomplete = 'off' maxlength ='<?php echo e($dbs_employees['bank_name_max']); ?>'  value='' <?php if($dbs_employees['bank_name_html5_req']!=''): ?> <?php echo e($dbs_employees['bank_name_html5_req']); ?> = <?php echo e($dbs_employees['bank_name_html5_req']); ?> <?php endif; ?> class= 'form-control'  >
        <span class='text-danger' id='add-bank_nameError'></span>
    </div>
</div>


<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_employees['bank_account_number_req']); ?><?php echo e($dbs_employees['bank_account_number_title']); ?>:</label>
        <input type = '<?php echo e($dbs_employees['bank_account_number_html5_type']); ?>' name = "bank_account_number" id = "add-bank_account_number" autocomplete = 'off' maxlength ='<?php echo e($dbs_employees['bank_account_number_max']); ?>'  value='' <?php if($dbs_employees['bank_account_number_html5_req']!=''): ?> <?php echo e($dbs_employees['bank_account_number_html5_req']); ?> = <?php echo e($dbs_employees['bank_account_number_html5_req']); ?> <?php endif; ?> class= 'form-control'  >
        <span class='text-danger' id='add-bank_account_numberError'></span>
    </div>
</div>


<div class="col-lg-12">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_employees['address_req']); ?><?php echo e($dbs_employees['address_title']); ?>:</label>
        <textarea type = '<?php echo e($dbs_employees['address_html5_type']); ?>' name = "address" id = "add-address" autocomplete = 'off' maxlength ='<?php echo e($dbs_employees['address_max']); ?>' <?php if($dbs_employees['address_html5_req']!=''): ?> <?php echo e($dbs_employees['address_html5_req']); ?> = <?php echo e($dbs_employees['address_html5_req']); ?> <?php endif; ?> class= 'form-control'   oninput='updateCharCount(this,"add-addresscharCount")'></textarea>
        <span class='text-danger' id='add-addresscharCount'></span> 
        <span class='text-danger' id='add-addressError'></span>
    </div>
</div>


<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_employees['profile_picture_req']); ?><?php echo e($dbs_employees['profile_picture_title']); ?>:</label>
        <input type="file" name="profile_picture" id="add-profile_picture" class="form-control" <?php if($dbs_employees['profile_picture_html5_req']!=''): ?> <?php echo e($dbs_employees['profile_picture_html5_req']); ?> = <?php echo e($dbs_employees['profile_picture_html5_req']); ?> <?php endif; ?> >
        <div class="mt-1"><?php echo e($getSettings['allowed_file_formats'] ?? ''); ?></div>
        
        
        <span class='text-danger' id='add-profile_pictureError'></span>
    </div>
</div>


<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_employees['resume_req']); ?><?php echo e($dbs_employees['resume_title']); ?>:</label>
        <input type = '<?php echo e($dbs_employees['resume_html5_type']); ?>' name = "resume" id = "add-resume" autocomplete = 'off' maxlength ='<?php echo e($dbs_employees['resume_max']); ?>'  value='' <?php if($dbs_employees['resume_html5_req']!=''): ?> <?php echo e($dbs_employees['resume_html5_req']); ?> = <?php echo e($dbs_employees['resume_html5_req']); ?> <?php endif; ?> class= 'form-control'  >
        <span class='text-danger' id='add-resumeError'></span>
    </div>
</div>

<div class="mt-2 col-xs-12 col-sm-12 col-md-12 col-lg-12">
<label class='form-label'><?php echo e($dbs_employees['skills_req']); ?><?php echo e($dbs_employees['skills_title']); ?>: </label>
 <select name="skills[]" id="add-skills" class="chosen-select form-control form-select" multiple>
    <?php
        $selectedValues = [];
        if (!empty('')) {
            $selectedValues = is_array('') ? '' : explode(',', '');
        }
        $selectedValues = array_filter(array_map('trim', $selectedValues), function($v){ return $v !== ''; });
    ?>
    <?php $__currentLoopData = $skills; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $id => $name): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <option value="<?php echo e($id); ?>" <?php if(in_array((string)$id, array_map('strval', $selectedValues), true)): ?> selected <?php endif; ?>><?php echo e($name); ?></option>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
<script>
    $(function() {
        $('#add-skills').chosen({
              width: '100%',
              search_contains: true
            });
        });
</script>
<span class='text-danger' id='add-skillsError'></span>
</div>

<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_employees['status_req']); ?><?php echo e($dbs_employees['status_title']); ?>:</label><br/>
        <div class="mt-2">
            <?php
            $options = $dbs_employees['status_array'];
            ?>

            <?php $__currentLoopData = $options; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php
                $checked = ($key == 'Active') ? 'checked="checked"' : '';
                ?>

                <label class="btn btn-outline-primary">
                    <input type="radio" name="status" value="<?php echo e($key); ?>" id="add-status" <?php echo e($checked); ?>/> <?php echo e($value); ?>

                </label>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    </div>
</div>

    
                    </div>
                    

                    <div class="p-3 mb-3 rounded">
                        <div class="row justify-content-end g-2">
                            <div class="col-lg-3">
                                <button type='submit' name='add-submit' id='add-submit' class='btn btn-outline-secondary w-100' data-args1='<?php echo e(route("employees.store")); ?>' data-args2='admin/employees' onclick='addUpdate(event, "add")'>
                                    <i class="ri-save-line"></i> Save 
                                </button>
                            </div>
                            <div class="col-lg-2">
                                <a href="<?php echo e(route('employees.index')); ?>" class="btn btn-primary w-100">
                                    <i class="ri-close-circle-line"></i> Cancel
                                </a>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

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


<?php echo $__env->make("layouts.metor.admin", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Applications/MAMP/htdocs/payroll/resources/views/employees/create.blade.php ENDPATH**/ ?>