2024-04-04 10:35:27 +00:00
|
|
|
@extends('layouts.app')
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
<div class="page-content">
|
|
|
|
<div class="container-fluid">
|
|
|
|
<!-- start page title -->
|
|
|
|
{{-- <div class="row">
|
|
|
|
<div class="col-12">
|
|
|
|
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
|
|
|
|
<h4 class="mb-sm-0">Projects</h4>
|
|
|
|
|
|
|
|
<div class="page-title-right">
|
|
|
|
<ol class="breadcrumb m-0">
|
|
|
|
<li class="breadcrumb-item"><a href="javascript: void(0);">Dashboards</a></li>
|
|
|
|
<li class="breadcrumb-item active">Projects</li>
|
|
|
|
</ol>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div> --}}
|
|
|
|
<!-- end page title -->
|
|
|
|
|
|
|
|
{{-- <div class="card">
|
|
|
|
<div class="card-body text-align-center">
|
|
|
|
<div class="row g-2">
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<div class="search-box">
|
|
|
|
<input type="text" class="form-control" id="searchMemberList"
|
|
|
|
placeholder="Search for name or designation..." autocomplete="off">
|
|
|
|
<i class="ri-search-line search-icon"></i>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-auto ms-auto">
|
|
|
|
<div class="list-grid-nav hstack gap-1">
|
|
|
|
<button type="button" id="dropdownMenuLink1" data-bs-toggle="dropdown" aria-expanded="false"
|
|
|
|
class="btn btn-sm btn-danger">Reset</button>
|
|
|
|
<button class="btn btn-sm btn-warning" data-bs-toggle="modal"
|
|
|
|
data-bs-target="#addmemberModal">Search</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div> --}}
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12">
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-header align-items-center d-flex">
|
|
|
|
<h5 class="card-title flex-grow-1 mb-0">Leave Lists</h5>
|
|
|
|
<div class="flex-shrink-0">
|
2024-04-05 12:11:16 +00:00
|
|
|
<a href="{{ route('leave.create') }}" class="btn btn-success waves-effect waves-light btn-sm"><i
|
2024-04-04 10:35:27 +00:00
|
|
|
class="ri-add-fill me-1 align-bottom"></i> Add</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="card-body">
|
|
|
|
<div class="table-responsive">
|
2024-04-05 12:11:16 +00:00
|
|
|
<table id="buttons-datatables" class="display table-sm table-bordered table" style="width:100%">
|
2024-04-04 10:35:27 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2024-04-05 12:11:16 +00:00
|
|
|
<th>S.N</th>
|
|
|
|
<th>Employee Name</th>
|
|
|
|
<th>Start Date</th>
|
|
|
|
<th>End Date</th>
|
|
|
|
<th>Created At</th>
|
|
|
|
<th>Action</th>
|
2024-04-04 10:35:27 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2024-04-05 12:11:16 +00:00
|
|
|
@forelse ($leaves as $key => $leave)
|
|
|
|
<tr>
|
|
|
|
<td>{{ $key + 1 }}</td>
|
|
|
|
<td>{{ $leave->employee_id }}</td>
|
|
|
|
<td>{{ $leave->start_date }}</td>
|
|
|
|
<td>{{ $leave->end_date }}</td>
|
|
|
|
<td>{{ $leave->created_at }}</td>
|
|
|
|
<td>
|
|
|
|
<div class="hstack flex-wrap gap-3">
|
|
|
|
<a href="javascript:void(0);" class="link-info fs-15 view-item-btn" data-bs-toggle="modal"
|
|
|
|
data-bs-target="#viewModal">
|
|
|
|
<i class="ri-eye-line"></i>
|
|
|
|
</a>
|
|
|
|
<a href="{{ route('leave.edit', $leave->leave_id) }}"
|
|
|
|
class="link-success fs-15 edit-item-btn"><i class="ri-edit-2-line"></i></a>
|
2024-04-04 10:35:27 +00:00
|
|
|
|
2024-04-05 12:11:16 +00:00
|
|
|
<a href="{{ route('leave.destroy', $leave->leave_id) }}" data-id="{{ $leave->leave_id }}"
|
|
|
|
class="link-danger fs-15 remove-item-btn"><i class="ri-delete-bin-line"></i></a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@empty
|
|
|
|
@endforelse
|
|
|
|
</tbody>
|
2024-04-04 10:35:27 +00:00
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div><!--end row-->
|
|
|
|
</div>
|
|
|
|
<!-- container-fluid -->
|
|
|
|
</div>
|
2024-04-05 12:11:16 +00:00
|
|
|
@include('leave::partials.view')
|
2024-04-04 10:35:27 +00:00
|
|
|
@endsection
|
2024-04-05 12:11:16 +00:00
|
|
|
|
|
|
|
@push('js')
|
|
|
|
<script>
|
|
|
|
$('.remove-item-btn').on('click', function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
let url = $(this).attr('href');
|
|
|
|
let id = $(this).data('id');
|
|
|
|
|
|
|
|
Swal.fire({
|
|
|
|
title: 'Are you sure?',
|
|
|
|
text: "You won't be able to revert this!",
|
|
|
|
icon: 'warning',
|
|
|
|
showCancelButton: true,
|
|
|
|
confirmButtonColor: '#3085d6',
|
|
|
|
cancelButtonColor: '#d33',
|
|
|
|
confirmButtonText: 'Yes, delete it!'
|
|
|
|
}).then((result) => {
|
|
|
|
if (result.isConfirmed) {
|
|
|
|
$.ajax({
|
|
|
|
url: url,
|
|
|
|
type: 'DELETE',
|
|
|
|
headers: {
|
|
|
|
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
|
|
|
},
|
|
|
|
data: {
|
|
|
|
id: id
|
|
|
|
},
|
|
|
|
success: function(response) {
|
|
|
|
location.reload();
|
|
|
|
},
|
|
|
|
error: function(xhr, status, error) {
|
|
|
|
console.error(xhr.responseText);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@endpush
|