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

<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 Attendances</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" >
                    <?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_attendances['client_id_req']); ?><?php echo e($dbs_attendances['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_attendances['client_id_req']); ?>Select <?php echo e($dbs_attendances['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="mt-2 col-xs-12 col-sm-12 col-md-4 col-lg-4">        
<label class='form-label'><?php echo e($dbs_attendances['employee_id_req']); ?><?php echo e($dbs_attendances['employee_id_title']); ?>: </label>
 <select name="employee_id" id="add-employee_id"  class="chosen-select form-control form-select">
    <option value=""><?php echo e($dbs_attendances['employee_id_req']); ?>Select <?php echo e($dbs_attendances['employee_id_title']); ?> </option>
    <?php $__currentLoopData = $employee_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-employee_id').chosen({
              width: '100%',
              search_contains: true
            });
        });
</script>
<span class='text-danger' id='add-employee_idError'></span>
</div>

<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_attendances['attendance_date_req']); ?><?php echo e($dbs_attendances['attendance_date_title']); ?>:</label>
        <input type = '<?php echo e($dbs_attendances['attendance_date_html5_type']); ?>' name = "attendance_date" id = "add-attendance_date" autocomplete = 'off' <?php if($dbs_attendances['attendance_date_html5_req']!=''): ?> <?php echo e($dbs_attendances['attendance_date_html5_req']); ?> = <?php echo e($dbs_attendances['attendance_date_html5_req']); ?> <?php endif; ?> class= 'form-control dateBox' >
        <span class='text-danger' id='add-attendance_dateError'></span>
        
        <script>
            $(function() {
                $( '#add-attendance_date' ).datepicker({
                    changeMonth: true,
                    changeYear: true
                });
                $( '#add-attendance_date' ).datepicker( 'option', 'yearRange', 'c-100:c+10' );
                $( '#add-attendance_date' ).datepicker( 'option', 'dateFormat', 'yy-mm-dd' );
                $('#add-attendance_date').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_attendances['check_in_req']); ?><?php echo e($dbs_attendances['check_in_title']); ?>:</label>
        <input type="<?php echo e($dbs_attendances['check_in_html5_type']); ?>" name="check_in" id="add-check_in" autocomplete="off" class="form-control" value='' <?php if($dbs_attendances['check_in_html5_req']!=''): ?> <?php echo e($dbs_attendances['check_in_html5_req']); ?> = <?php echo e($dbs_attendances['check_in_html5_req']); ?> <?php endif; ?> >
        <span class='text-danger' id='add-check_inError'></span>
    </div>
</div>

<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_attendances['check_out_req']); ?><?php echo e($dbs_attendances['check_out_title']); ?>:</label>
        <input type="<?php echo e($dbs_attendances['check_out_html5_type']); ?>" name="check_out" id="add-check_out" autocomplete="off" class="form-control" value='' <?php if($dbs_attendances['check_out_html5_req']!=''): ?> <?php echo e($dbs_attendances['check_out_html5_req']); ?> = <?php echo e($dbs_attendances['check_out_html5_req']); ?> <?php endif; ?> >
        <span class='text-danger' id='add-check_outError'></span>
    </div>
</div>

<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_attendances['working_hours_req']); ?><?php echo e($dbs_attendances['working_hours_title']); ?>:</label>
        <input type = '<?php echo e($dbs_attendances['working_hours_html5_type']); ?>' name = "working_hours" id = "add-working_hours" data-maxlen='<?php echo e($dbs_attendances['working_hours_max']); ?>' data-scale='<?php echo e($dbs_attendances['working_hours_scale'] ?? ''); ?>' autocomplete = 'off'   value='' <?php if($dbs_attendances['working_hours_html5_req']!=''): ?> <?php echo e($dbs_attendances['working_hours_html5_req']); ?> = <?php echo e($dbs_attendances['working_hours_html5_req']); ?> <?php endif; ?> class= 'form-control'   onkeydown='validateFloatInput(event)'  oninput='validateInput(this,<?php echo e($dbs_attendances['working_hours_max']); ?>)' />
        <span class='text-danger' id='add-working_hoursError'></span>
    </div>
</div>

<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_attendances['overtime_hours_req']); ?><?php echo e($dbs_attendances['overtime_hours_title']); ?>:</label>
        <input type = '<?php echo e($dbs_attendances['overtime_hours_html5_type']); ?>' name = "overtime_hours" id = "add-overtime_hours" data-maxlen='<?php echo e($dbs_attendances['overtime_hours_max']); ?>' data-scale='<?php echo e($dbs_attendances['overtime_hours_scale'] ?? ''); ?>' autocomplete = 'off'   value='' <?php if($dbs_attendances['overtime_hours_html5_req']!=''): ?> <?php echo e($dbs_attendances['overtime_hours_html5_req']); ?> = <?php echo e($dbs_attendances['overtime_hours_html5_req']); ?> <?php endif; ?> class= 'form-control'   onkeydown='validateFloatInput(event)'  oninput='validateInput(this,<?php echo e($dbs_attendances['overtime_hours_max']); ?>)' />
        <span class='text-danger' id='add-overtime_hoursError'></span>
    </div>
</div>

<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_attendances['late_minutes_req']); ?><?php echo e($dbs_attendances['late_minutes_title']); ?>:</label>
        <input type = '<?php echo e($dbs_attendances['late_minutes_html5_type']); ?>' name = "late_minutes" id = "add-late_minutes" data-maxlen='<?php echo e($dbs_attendances['late_minutes_max']); ?>' data-scale='<?php echo e($dbs_attendances['late_minutes_scale'] ?? ''); ?>' autocomplete = 'off'   value='' <?php if($dbs_attendances['late_minutes_html5_req']!=''): ?> <?php echo e($dbs_attendances['late_minutes_html5_req']); ?> = <?php echo e($dbs_attendances['late_minutes_html5_req']); ?> <?php endif; ?> class= 'form-control'   onkeydown='validateNumericInput(event)'  oninput='validateInput(this,<?php echo e($dbs_attendances['late_minutes_max']); ?>)' />
        <span class='text-danger' id='add-late_minutesError'></span>
    </div>
</div>

<div class="col-lg-4">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_attendances['status_req']); ?><?php echo e($dbs_attendances['status_title']); ?>:</label><br/>
        <div class="mt-2">
            <?php
            $options = $dbs_attendances['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 class="col-lg-12">
    <div class="mb-3">
        <label class='form-label'><?php echo e($dbs_attendances['remarks_req']); ?><?php echo e($dbs_attendances['remarks_title']); ?>:</label>
        <textarea type = '<?php echo e($dbs_attendances['remarks_html5_type']); ?>' name = "remarks" id = "add-remarks" autocomplete = 'off' maxlength ='<?php echo e($dbs_attendances['remarks_max']); ?>' <?php if($dbs_attendances['remarks_html5_req']!=''): ?> <?php echo e($dbs_attendances['remarks_html5_req']); ?> = <?php echo e($dbs_attendances['remarks_html5_req']); ?> <?php endif; ?> class= 'form-control'   oninput='updateCharCount(this,"add-remarkscharCount")'></textarea>
        <span class='text-danger' id='add-remarkscharCount'></span> 
        <span class='text-danger' id='add-remarksError'></span>
    </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("attendances.store")); ?>' data-args2='admin/attendances' onclick='addUpdate(event, "add")'>
                                    <i class="ri-save-line"></i> Save 
                                </button>
                            </div>
                            <div class="col-lg-2">
                                <a href="<?php echo e(route('attendances.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/attendances/create.blade.php ENDPATH**/ ?>