File: /var/www/html/hrms-production/storage/framework/views/0b5cd0fcfbf90f91ec0e694ef6fa908631db76a5.php
<?php $__env->startSection('content'); ?>
<style>
.cmpadding-6 {
padding: 0px;
margin: 0px;
padding: 7px;
}
</style>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="container-fluid">
</div><!-- /.container-fluid -->
</section>
<!-- Main content -->
<!-- <section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<div class="row">
<div class="col-8">
<h5>Leave Details</h5>
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="emplaoyeeLeaveTable" class="table">
<thead>
<tr>
<th>Type</th>
<?php $__currentLoopData = $LeaveTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $LeaveType): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<th><?php echo e($LeaveType->LeaveTypeName); ?></th>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tr>
</thead>
<tbody>
<?php $i=1; ?>
<tr>
<td><strong>Opening</strong></td>
<?php $__currentLoopData = $LeaveTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $LeaveType): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<td><?php echo e($LeaveType->TotalDays); ?></td>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tr>
<tr>
<td><strong>Availed</strong></td>
<?php $__currentLoopData = $LeaveTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $LeaveType): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<td><?php echo e(0); ?></td>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tr>
<tr>
<td><strong>Balance</strong></td>
<?php $__currentLoopData = $LeaveTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $LeaveType): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<td><?php echo e(0); ?></td>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tr>
<tr>
<td><strong>Pending</strong></td>
<?php $__currentLoopData = $LeaveTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $LeaveType): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<td><?php echo e($LeaveType->TotalLeaveDayCount); ?></td>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</section> -->
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h5>List of Leave Application</h5>
<div class="text-right">
<a type="button" class="btn btn-sm btn-outline-info" href="<?php echo e(url('new-application')); ?>">
+Add New</a>
</div>
</div>
<!-- /.card-header -->
<div class="card-body">
<table id="emplaoyeeTable" class="table table-bordered table-striped table-sm">
<thead>
<tr>
<th>S.No.</th>
<th>Employee Code</th>
<th>Employee Name</th>
<th>Leave Type</th>
<th>No. of Days</th>
<th>From Date</th>
<th>To Date</th>
<th>Description</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $Leaves; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $Leave): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td><?php echo e($loop->iteration); ?></td>
<td>
<a href="<?php echo e(url('view-employee', $Leave->EmployeeId)); ?>"
target="_blank"><?php echo e($Leave->EmployeeCode); ?></a>
</td>
<td><?php echo e($Leave->EmployeeName); ?></td>
<td><?php echo e($Leave->LeaveTypeName); ?></td>
<td><?php echo e($Leave->TotalLeave); ?></td>
<td><?php echo e(date('d-M-Y', strtotime($Leave->StartDate))); ?></td>
<td>
<?php if($Leave->ReformDate == 'Yes'): ?>
<?php echo e(date('d-M-Y', strtotime($Leave->ReformDate))); ?>
<?php else: ?>
<?php echo e(date('d-M-Y', strtotime($Leave->EndDate))); ?>
<?php endif; ?>
</td>
<td><?php echo e($Leave->Description); ?></td>
<td>
<?php if($Leave->ApprovalStatus == '0'): ?>
<span class="badge badge-warning btn-flat btn-xs" readonly>Pending</span>
<?php elseif($NumberOfRejectStatus == '1'): ?>
<span class="badge badge-danger btn-xs" readonly>Rejected</span>
<?php elseif($Leave->ApprovalStatus == '2'): ?>
<span class="badge badge-danger btn-xs" readonly>Rejected</span>
<?php elseif($Leave->NumberOfLeaveId == $Leave->NumberOfApprovalStatus): ?>
<span class="badge badge-success btn-xs" readonly>Approved</span>
<?php elseif($Leave->NumberOfLeaveId != $Leave->NumberOfApprovalStatus): ?>
<span class="badge badge-info btn-xs" readonly>Under Process</span>
<?php endif; ?>
</td>
<?php if ($Leave->ApprovalStatus == '1' OR $Leave->ApprovalStatus == '2' OR $Leave->ApprovalStatus == '3'){ ?>
<td>
<div class="btn-group">
<button type="button"
class="btn btn-default btn-sm dropdown-toggle dropdown-icon"
data-toggle="dropdown" aria-expanded="false">
</button>
<div class="dropdown-menu dropdown-menu-right" role="menu">
<a href="<?php echo url('/details-application'); ?>/<?php echo e($Leave->LeaveId); ?>" class="dropdown-item btn btn-default" target="_blank">View Application</a>
<?php if($Leave->NumberOfLeaveId == $Leave->NumberOfApprovalStatus): ?>
<a href="<?php echo url('/details-application'); ?>/<?php echo e($Leave->LeaveId); ?>/Order"
class="dropdown-item btn btn-default"
target="_blank">Application Order</a>
<?php endif; ?>
<a href="<?php echo url('/application-detail'); ?>/<?php echo e($Leave->LeaveId); ?>"
class="dropdown-item btn btn-default" target="_blank">
Application Status</a>
<button type="button" class="dropdown-item btn btn-default" title="Edit" data-id="'.$EmployeeQualificationId.'" onclick="reformLeaveApplication('<?php echo e($Leave->LeaveId); ?>')">Reform Application</button>
</div>
</div>
</td>
<?php } else { ?>
<td>
<div class="btn-group">
<button type="button"
class="btn btn-default btn-sm dropdown-toggle dropdown-icon"
data-toggle="dropdown" aria-expanded="false">
</button>
<div class="dropdown-menu dropdown-menu-right" role="menu">
<button type="button" class="dropdown-item btn btn-default" title="Edit" data-id="'.$EmployeeQualificationId.'" onclick="editLeave('<?php echo e($Leave->LeaveId); ?>')">Edit</button>
<button type="button" class="dropdown-item btn btn-default" title="Delete" data-id="'.$EmployeeQualificationId.'" onclick="deleteLeave('<?php echo e($Leave->LeaveId); ?>')">Delete</button>
</div>
</div>
</td>
<?php } ?>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</section>
<!-- /.content -->
</div>
<script>
$(function() {
$("#emplaoyeeTable").DataTable({
"responsive": true,
"lengthChange": true,
"autoWidth": false,
"lengthMenu": [10, 20, 50, 100, 250, 500],
"buttons": ["csv", "excel", "pdf", "print"]
}).buttons().container().appendTo('#emplaoyeeTable_wrapper .col-md-6:eq(0)');
});
function editLeave(LeaveId='')
{
window.location.href="<?php echo url('/edit-application'); ?>/"+LeaveId;
}
function reformLeaveApplication(LeaveId='')
{
window.location.href="<?php echo url('/reform-application'); ?>/"+LeaveId;
}
function deleteLeave(LeaveId='')
{
var token = '<?php echo e(csrf_token()); ?>';
Swal.fire({
title: "Delete Leave Application?",
text: "Are you sure you want to delete this Leave Application?",
icon: "warning",
showCancelButton: true,
confirmButtonColor: "#3085d6",
cancelButtonColor: "#d33",
confirmButtonText: "Yes, delete it!",
})
.then((result) => {
if (result.isConfirmed) {
$.ajax({
type: "post",
data:{LeaveId: LeaveId, _token : token},
url:"<?php echo e(url('/')); ?>/ajax/leave/delete",
success: function (response) {
Swal.fire({
icon: "success",
title: "Leave Application has been deleted!",
showConfirmButton: false,
timer: 1500,
}).then(function () {
location.reload();
});
},
});
}
});
}
</script>
<script>
// ApprovalStatus
function ApprovedLeaveApplication(LeaveId) {
var LeaveId = LeaveId;
Swal.fire({
title: 'Approved/Rejected Leave Application?',
text: "Are you sure you want to Approved/Rejected Leave Application!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, Approved it!',
cancelButtonText: 'No, Rejected it!',
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
type: "get",
url: "<?php echo e(url('/')); ?>/change-leave-application/" + LeaveId,
data:{status:1},
success: function(response) {
Swal.fire({
icon: 'success',
title: 'Leave Application has been Approved!',
showConfirmButton: false,
timer: 1500
}).then(function() {
location.reload();
});
}
});
}
else {
$.ajax({
type: "get",
url: "<?php echo e(url('/')); ?>/change-leave-application/" + LeaveId,
data:{status:2},
success: function(response) {
Swal.fire({
icon: 'success',
title: 'Leave Application has been Rejected!',
showCancelButton: false,
timer: 1500
}).then(function() {
location.reload();
});
}
});
}
});
}
</script>
<!-- /.content-wrapper -->
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.include.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/hrms/resources/views/admin/LeaveManagement/all-application.blade.php ENDPATH**/ ?>