File: /var/www/html/fieldsblaze-heroku/resources/views/admin/annual-leaves.blade.php
@extends('admin.include.master')
@section('content')
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Annual Leaves</h1>
</div>
<div class="col-sm-6 text-right">
<button type="button" class="btn btn-sm btn-outline-info mx-1" data-toggle="modal" data-target="#addAnnualLeave">Add Leave</button>
</div>
</div>
</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">
<a href="{{ ('annual-leaves') }}" class="btn btn-info btn-sm card-title px-2 mx-1">All (7)</a>
</div>
<!-- /.card-header -->
<div class="card-body">
<!--<table id="attendanceTable" class="table table-bordered table-striped">
<thead>
<tr>
<th>S.N.</th>
<th>Employee</th>
<th>Leave Type</th>
<th>Start Date</th>
<th>End Date</th>
<th>Total</th>
<th>Approved By</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Ajay Gupta</td>
<td>CL</td>
<td>2021-05-23</td>
<td>2021-05-23</td>
<td>1</td>
<td>Rohit Sharma</td>
<td><span class="badge badge-success">Approved</span></td>
<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 type="submit" class="dropdown-item btn btn-default" href="{{ url('view-leave') }}">View</a>
<button class="dropdown-item btn btn-default" data-toggle="modal" data-target="#editLeaveApplication">Edit</button>
<button type="submit" class="dropdown-item btn btn-default" id="approveLeave">Approve</button>
<button type="submit" class="dropdown-item btn btn-default" id="rejectLeave">Reject</button>
<button type="submit" class="dropdown-item btn btn-default" id="deleteLeave">Delete</button>
</div>
</div>
</td>
</tr>
<tr>
<td>2</td>
<td>Manoj Yadav</td>
<td>CL</td>
<td>2021-05-23</td>
<td>2021-05-23</td>
<td>1</td>
<td>Rohit Sharma</td>
<td><span class="badge badge-success">Approved</span></td>
<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 type="submit" class="dropdown-item btn btn-default" href="{{ url('view-leave') }}">View</a>
<button class="dropdown-item btn btn-default" data-toggle="modal" data-target="#editLeaveApplication">Edit</button>
<button type="submit" class="dropdown-item btn btn-default" id="approveLeave">Approve</button>
<button type="submit" class="dropdown-item btn btn-default" id="rejectLeave">Reject</button>
<button type="submit" class="dropdown-item btn btn-default" id="deleteLeave">Delete</button>
</div>
</div>
</td>
</tr>
<tr>
<td>3</td>
<td>Rahul Maurya</td>
<td>CL</td>
<td>2021-05-23</td>
<td>2021-05-23</td>
<td>1</td>
<td>Rohit Sharma</td>
<td><span class="badge badge-success">Approved</span></td>
<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 type="submit" class="dropdown-item btn btn-default" href="{{ url('view-leave') }}">View</a>
<button class="dropdown-item btn btn-default" data-toggle="modal" data-target="#editLeaveApplication">Edit</button>
<button type="submit" class="dropdown-item btn btn-default" id="approveLeave">Approve</button>
<button type="submit" class="dropdown-item btn btn-default" id="rejectLeave">Reject</button>
<button type="submit" class="dropdown-item btn btn-default" id="deleteLeave">Delete</button>
</div>
</div>
</td>
</tr>
</tbody>
</table>-->
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</section>
<!-- /.content -->
</div>
<script>
//Delete Customer
$("#deleteLeave").click(function() {
Swal.fire({
title: 'Delete Leave?',
text: "Are you sure you want to delete this Leave",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.isConfirmed) {
Swal.fire(
'Deleted!',
'Leave has been deleted.',
'success'
)
}
});
});
$("#rejectLeave").click(function() {
Swal.fire({
//title: "Comment!",
//input: 'text',
html: '<textarea id="rejectComment" placeholder="Comment" name="rejectComment" class="form-control" style="width:100%" required></textarea>',
showCancelButton: true,
confirmButtonText: 'Submit',
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
}).then((result) => {
if (result.value) {
//Swal.fire('Comment:'+result.value);
Swal.fire(
'Rejected',
'Leave has been rejected.',
'success'
);
}
});
});
$("#approveLeave").click(function() {
Swal.fire({
//title: "Comment!",
//input: 'text',
html: '<textarea id="rejectComment" placeholder="Comment" name="rejectComment" class="form-control" style="width:100%" required></textarea>',
showCancelButton: true,
confirmButtonText: 'Submit',
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
}).then((result) => {
if (result.value) {
//Swal.fire('Comment:'+result.value);
Swal.fire(
'Approved',
'Leave has been approved.',
'success'
);
}
});
});
</script>
<x-LeaveModal/>
<!-- /.content-wrapper -->
@endsection