IMMREX7
<?php $__env->startSection('content'); ?>
<div class="row clearfix">
<div class="col-sm-8">
<div class="card">
<div class="header">
<h2><strong>Leave</strong> Window</h2>
</div>
<div class="body">
<?php if(\Session::has('error')): ?>
<div class="alert alert-danger">
<p>Problem found</p>
<ul>
<li><?php echo \Session::get('error'); ?></li>
</ul>
</div>
<?php endif; ?>
<?php echo Form::open(['url' => 'school/add-leave-requests', 'class' => 'form-horizontal']); ?>
<div class="row clearfix">
<div class="col-sm-5 form-control-label required">
<label for="classname">Select Employee</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::select('idEmployee',$employees,null,['class' => 'form-control show-tick ms select2', 'required'=>'required']); ?>
<?php if($errors->has('idEmployee')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('idEmployee')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-5 form-control-label required">
<label for="classname">Select Leave Type</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::select('leave_type',$leaves,null,['class' => 'form-control show-tick ms', 'required'=>'required']); ?>
<?php if($errors->has('leave_type')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('leave_type')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-5 form-control-label">
<label for="classname">Leaves Allowed</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<ul class="list-group">
<li class="list-group-item">Monthly <span class="badge badge-success" id="month-leave"></span></li>
<li class="list-group-item">Yearly <span class="badge badge-success" id="year-leave"></span></li>
<li class="list-group-item">Available Leaves <span class="badge badge-success" id="left-leave"></span></li>
</ul>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-5 form-control-label required">
<label for="classname">From Date</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::text('fromDate',null,['class' => 'form-control datepicker', 'required'=>'required']); ?>
<?php if($errors->has('fromDate')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('fromDate')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-5 form-control-label required">
<label for="classname">To Date</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::text('toDate',null,['class' => 'form-control datepicker', 'required'=>'required']); ?>
<?php if($errors->has('toDate')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('toDate')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-5 form-control-label required">
<label for="classname">Remarks</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::text('remarks',null,['class' => 'form-control', 'required'=>'required']); ?>
<?php if($errors->has('remarks')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('remarks')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-5 form-control-label required">
<label for="classname">Status</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::select('status',getLeaveStatus(),null,['class' => 'form-control show-tick ms','id'=>'chqstatus','style'=>'background-color: #fff']); ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-8 offset-sm-2">
<?php echo Form::submit('SAVE',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
$(document).ready(function(){
$('select[name="idEmployee"]').on('change', function() {
var idEmp = $(this).val();
if(idEmp) {
$.ajax({
url: "<?php echo e(url('/school/employee-leaves')); ?>"+'/' +idEmp ,
type: "GET",
dataType: "json",
success:function(data) {
$('#month-leave').empty();
$('#month-leave').html(data['totalMonthLeaves']+' leaves');
$('#year-leave').empty();
$('#year-leave').html(data['totalYearLeaves']+' leaves');
$('#left-leave').empty();
$('#left-leave').html(data['left_leaves']+' leaves');
}
});
}else{
$('#month-leave').empty();
}
});
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Copyright © 2021 -