IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/c673eea17ddd24a861560ae0417f977ca8bd1678.php

<?php $__env->startSection('content'); ?>
<div class="row clearfix">
    <div class="col-sm-12">
        <div class="card">
            <div class="header">
                <h2><strong>Edit Attendance</strong></h2>
            </div>
            <div class="body">
                <?php echo Form::open(['url' => 'school/manage-employee-attendance', 'class' => 'form-horizontal','id'=>'form','files'=>true]); ?>

                <div class="row clearfix">
                    <div class="col-sm-2 form-control-label required">
                        <label for="classname">Employee</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            <?php echo Form::select('idEmployee',$employees,null,['class' => 'form-control show-tick ms select2', 'id' => "employee_id"]); ?>

                            <?php if($errors->has('idEmployee')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('idEmployee')); ?></strong>
                            </label>
                            <?php endif; ?>
                            <span id='depterror'></span>
                        </div>
                    </div>
                    <div class="col-sm-2 form-control-label required">
                        <label for="classname">Select Date</label>
                    </div>
                    <div class="col-sm-3">
                        <div class="form-group">
                            <?php echo Form::date('attendance_date',null,['class' => 'form-control','required'=>'required', 'id' => 'ad_date']); ?>

                            <?php if($errors->has('attendance_date')): ?>
                            <label id="minmaxlength-error" class="error" for="minmaxlength">
                                <strong><?php echo e($errors->first('attendance_date')); ?></strong>
                            </label>
                            <?php endif; ?>
                            <span id='leaveerror'></span>
                        </div>
                    </div>
                    
                </div>
                <div class="row clearfix demo-masked-input">
                    <div class="col-sm-2 form-control-label">
                        <label for="classname">IN TIME</label>
                    </div>
                    <div class="col-sm-3">
                        <?php echo Form::text('in_time',null,['class' => 'form-control time24','placeholder' => '00:00','id' => "in_time"]); ?>

                    </div>
                    <div class="col-sm-2">
                        <?php echo Form::select('in_am',['AM' => 'AM' , 'PM' => 'PM'],['class' => 'form-control','placeholder' => 'AM']); ?>

                    </div>
                </div>
                <br>
                <div class="row clearfix demo-masked-input">
                    <div class="col-sm-2 form-control-label">
                        <label for="classname">OUT TIME</label>
                    </div>
                    <div class="col-sm-3">
                        <?php echo Form::text('out_time',null,['class' => 'form-control time24','placeholder' => '00:00','id' => "out_time"]); ?>

                    </div>
                    <div class="col-sm-2">
                        <?php echo Form::select('out_am',['AM' => 'AM' , 'PM' => 'PM'],['class' => 'form-control','placeholder' => 'AM']); ?>

                    </div>
                </div>
                <br>
                <div class="row clearfix">
                    <div class="col-sm-2 form-control-label required">
                        <label for="classname">Status</label>
                    </div>
                    <div class="col-sm-3">
                        <?php echo Form::select('status',["P" => "Present","OD" => "OD","A" =>  "Absent", "H" => "Half Day"],['class' => 'form-control','required'=>'required']); ?>

                    </div>
                </div>
                <br>
                <div class="row clearfix">
                    <div class="col-sm-2 form-control-label">
                        <label for="classname">Remarks</label>
                    </div>
                    <div class="col-sm-3">
                        <?php echo Form::text('remarks',null,['class' => 'form-control']); ?>

                    </div>
                </div>
                <div class="row clearfix">
                    <div class="col-sm-10" id='formerror'>
                    </div>
                </div>
                <div class="row clearfix">
                    <div class="col-sm-8 offset-sm-2">
                        <?php if(auth()->user()->isSchool == 'N'): ?>
                        <?php echo Form::submit('Update',['class' => 'btn btn-raised btn-primary btn-round waves-effect','id'=>'submit-btn']); ?>

                        <?php else: ?>
                        <p style="color:red"><u>Note</u>: You cannot manage attendance as administrator user please make user and use that user login for edit attendance.</p>
                        <?php endif; ?>
                        <?php echo Form::close(); ?> 
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
// Saving form data
<?php if(auth()->user()->isSchool == 'N'): ?>
$('#form').on('submit',function(e){
    e.preventDefault();
    $.ajaxSetup({
    header:$('meta[name="_token"]').attr('content')
});
 var formData =  new FormData($('#form')[0]);
 $("#submit-btn").prop('disabled', true);
    $.ajax({
        type:"POST",
        url: "<?php echo e(url('school/manage-employee-attendance')); ?>",
        processData: false,
        contentType: false,
        data:formData,
        dataType: 'json',
        success:function(data){
            $("#submit-btn").prop('disabled', false);
            if( data[Object.keys(data)[0]] === 'SUCCESS' ){
                swal("Updated!", "Attendance has been updated.", "success");
            }
            else {                  //False Case: With error msg
                $("#msg").html(data);   //$msg is the id of empty msg
            }

        },

        error: function(data){
            console.log(data.responseJSON);
                    if( data.status === 422 ) {
                    $("#submit-btn").prop('disabled', false);
                    if(data.responseJSON.message){
                        var errorHtml = '<div class="alert alert-danger"><ul><li><span class="help-block" style="color:white;"><strong>'+data.responseJSON.message+'</strong></span></li></ul></div>';
                        $('#formerror').empty();
                        $('#formerror').html(errorHtml);
                    }else{
                        var errors = data.responseJSON.errors;
                       
                    }      
                }
            }
    });
    return false;
});
<?php endif; ?>


$(function() {
    var $demoMaskedInput = $('.demo-masked-input');
    $demoMaskedInput.find('.time24').inputmask('hh:mm', { placeholder: '__:__ _m', alias: 'time24', hourFormat: '12' });
    $('#ad_date').change(function() {
        $('#in_time').val("");
        $('#out_time').val("");
        var date = $(this).val();
        var id = $('#employee_id').val();
        $.getJSON("<?php echo e(url('school/fetch-attendance')); ?>/"+date+"/"+id, function(jd) {
                if(jd.in_time){
                    $('#in_time').val(jd.in_time);
                }
                if(jd.out_time){
                    $('#out_time').val(jd.out_time);
                }
        });
    });
})
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

Copyright © 2021 - 2025 IMMREX7