IMMREX7
<?php $__env->startSection('content'); ?>
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
<div class="header">
<h2><strong><a href="<?php echo e(url('school/add-leave-requests')); ?>" class="btn btn-raised btn-primary btn-round waves-effect" style="background:black;">Add New</a></strong></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(['method' => 'GET', 'action' => ['School\LeaveController@leaveRequests'], 'class' => 'form-horizontal']); ?>
<div class="row clearfix">
<div class="col-sm-2 form-control-label required">
<label for="classname">From Date</label>
</div>
<div class="col-sm-2">
<div class="form-group">
<?php echo Form::text('fromDate',null,['class' => 'form-control datepicker']); ?>
<?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 class="col-sm-2 form-control-label required">
<label for="classname">To Date</label>
</div>
<div class="col-sm-2">
<div class="form-group">
<?php echo Form::text('toDate',null,['class' => 'form-control datepicker']); ?>
<?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 class="col-sm-2 form-control-label">
<?php echo Form::submit('Search',['class' => 'btn btn-raised btn-primary btn-round waves-effect','id'=>'submit-btn']); ?>
<?php echo Form::close(); ?>
</div>
</div>
</div>
<div class="body table-responsive">
<table class="table table-bordered table-striped table-hover js-basic-example dataTable">
<thead>
<tr>
<th>EC No.</th>
<th>Name</th>
<th>Department</th>
<th>Designation</th>
<th>From Date</th>
<th>To Date</th>
<th>Leave Type</th>
<th>Message</th>
<th>Document</th>
<th>Issued By</th>
<th colspan="2">Action</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $empleaves; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if(isset($value->employee)): ?>
<tr>
<td><?php echo e($value->employee->enrollmentNo); ?></td>
<td><?php echo e($value->employee->firstName); ?> <?php echo e($value->employee->middleName); ?> <?php echo e($value->employee->lastName); ?></td>
<td><?php echo e($value->employee->department->departmentName); ?></td>
<td><?php echo e($value->employee->designation->designationName); ?></td>
<td><?php echo e(Carbon\Carbon::parse($value->leave_from)->format("d-m-Y")); ?></td>
<td><?php echo e(Carbon\Carbon::parse($value->leave_to)->format("d-m-Y")); ?></td>
<td><?php echo e($value->leave_type); ?></td>
<td><?php echo e($value->leave_message); ?></td>
<td> <?php if(isset($value->documents)): ?> <a href="<?php echo e(url('/school/leave-document/' . $value->idLeave.'/view')); ?>" target="_blank">View Document</a> <?php else: ?> NA <?php endif; ?></td>
<td>
<?php $emp = \App\Employee::where('idEmployee', '=', $value->updated_by)->first(); ?>
<?php if($emp != null): ?> <?php echo e($emp->name); ?> <?php endif; ?>
<?php if($value->name != null): ?> <?php echo e($value->name); ?> <?php endif; ?>
</td>
<td><?php if($value->status != null): ?> <?php echo e($value->status); ?> <?php endif; ?></td>
<td><?php if($value->status != null): ?> <?php echo e($value->remarks); ?> <?php else: ?> <a class="btn btn-sm btn-success" href="<?php echo e(url('/school/leave-window/'.$value->idLeave)); ?>" target="_blank">Update Status</a> <?php endif; ?></td>
</tr>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
$(document).ready(function() {
$('select[name="idClass"]').on('change', function() {
var classID = $(this).val();
if(classID) {
$.ajax({
url: "<?php echo e(url('/school/class')); ?>"+'/' +classID + "/sections",
type: "GET",
dataType: "json",
success:function(data) {
$('#idSection').empty();
$('#idSection').append('<option value="">--Select--</option>');
$.each(data, function(key, value) {
$('#idSection').append('<option value="'+key+'">'+value+'</option>');
});
}
});
}else{
$('select[name="idSection"]').empty();
}
});
var cur_class = $('select[name="idClass"]').val();
if (cur_class) {
$.ajax({
url: "<?php echo e(url('/school/class')); ?>"+'/' +cur_class + "/sections",
type: "GET",
dataType: "json",
success:function(data) {
$('#idSection').empty();
$('#idSection').append('<option value="">--Select--</option>');
$.each(data, function(key, value) {
$('#idSection').append('<option value="'+key+'">'+value+'</option>');
});
}
});
}
});
$(document).ready(function(){
$('#bouncecharge').hide();
$('#chqstatus').change(function() {
var val = $(this).val();
if((val == 'R')){
$('#bouncecharge').show();
}else{
$('#bouncecharge').hide();
}
});
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Copyright © 2021 -