101 lines
5.4 KiB
PHP
101 lines
5.4 KiB
PHP
|
|
<div class="responsive-table m-0">
|
||
|
|
<table class="table" id="datatable">
|
||
|
|
<thead>
|
||
|
|
<tr>
|
||
|
|
@usercan('leaves.delete')
|
||
|
|
<th class="w-60">
|
||
|
|
<div class="d-flex align-items-center gap-3">
|
||
|
|
<input type="checkbox" class="select-all-delete multi-delete">
|
||
|
|
</div>
|
||
|
|
</th>
|
||
|
|
@endusercan
|
||
|
|
<th>{{ __('SL') }}.</th>
|
||
|
|
<th class="text-start">{{ __('Employee') }}</th>
|
||
|
|
@if (auth()->user()->accessToMultiBranch())
|
||
|
|
<th class="text-start">{{ __('Branch') }}</th>
|
||
|
|
@endif
|
||
|
|
<th class="text-start">{{ __('Month') }}</th>
|
||
|
|
<th class="text-start">{{ __('Department') }}</th>
|
||
|
|
<th class="text-start">{{ __('Start Date') }}</th>
|
||
|
|
<th class="text-start">{{ __('End Date') }}</th>
|
||
|
|
<th class="text-start">{{ __('Leave Type') }}</th>
|
||
|
|
<th class="text-start">{{ __('Leave Duration') }}</th>
|
||
|
|
<th class="text-center">{{ __('Status') }}</th>
|
||
|
|
<th>{{ __('Action') }}</th>
|
||
|
|
</tr>
|
||
|
|
</thead>
|
||
|
|
<tbody>
|
||
|
|
@foreach ($leaves as $leave)
|
||
|
|
<tr>
|
||
|
|
@usercan('leaves.delete')
|
||
|
|
<td class="w-60 checkbox">
|
||
|
|
<input type="checkbox" name="ids[]" class="delete-checkbox-item multi-delete"
|
||
|
|
value="{{ $leave->id }}">
|
||
|
|
</td>
|
||
|
|
@endusercan
|
||
|
|
<td>{{ ($leaves->currentPage() - 1) * $leaves->perPage() + $loop->iteration }}</td>
|
||
|
|
<td class="text-start">{{ $leave->employee->name ?? '' }}</td>
|
||
|
|
@if (auth()->user()->accessToMultiBranch())
|
||
|
|
<td class="text-start">{{ $leave->branch->name ?? '' }}</td>
|
||
|
|
@endif
|
||
|
|
<td class="text-start">{{ ucfirst($leave->month) }}</td>
|
||
|
|
<td class="text-start">{{ $leave->department->name ?? '' }}</td>
|
||
|
|
<td class="text-start">{{ formatted_date($leave->start_date) }}</td>
|
||
|
|
<td class="text-start">{{ formatted_date($leave->end_date) }}</td>
|
||
|
|
<td class="text-start">{{ $leave->leave_type->name ?? '' }}</td>
|
||
|
|
<td class="text-start">{{ $leave->leave_duration }} {{ __('Days') }}</td>
|
||
|
|
@if ($leave->status == 'pending')
|
||
|
|
<td class="text-warning text-center">
|
||
|
|
<div class="padding-status">Pending</div>
|
||
|
|
</td>
|
||
|
|
@elseif ($leave->status == 'approved')
|
||
|
|
<td class="text-warning text-center">
|
||
|
|
<div class="approved-status">Approved</div>
|
||
|
|
</td>
|
||
|
|
@elseif ($leave->status == 'rejected')
|
||
|
|
<td class="text-warning text-center">
|
||
|
|
<div class="rejected-status">Rejected</div>
|
||
|
|
</td>
|
||
|
|
@endif
|
||
|
|
<td class="print-d-none">
|
||
|
|
<div class="dropdown table-action">
|
||
|
|
<button type="button" data-bs-toggle="dropdown">
|
||
|
|
<i class="far fa-ellipsis-v"></i>
|
||
|
|
</button>
|
||
|
|
<ul class="dropdown-menu">
|
||
|
|
@usercan('leaves.update')
|
||
|
|
<li>
|
||
|
|
<a href="#leaves-edit-modal" data-bs-toggle="modal" class="leaves-edit-btn"
|
||
|
|
data-url="{{ route('hrm.leaves.update', $leave->id) }}"
|
||
|
|
data-employee-id="{{ $leave->employee_id }}" data-month="{{ $leave->month }}"
|
||
|
|
data-leave-type-id="{{ $leave->leave_type_id }}"
|
||
|
|
data-start-date="{{ $leave->start_date }}"
|
||
|
|
data-end-date="{{ $leave->end_date }}"
|
||
|
|
data-leave-duration="{{ $leave->leave_duration }}"
|
||
|
|
data-status="{{ $leave->status }}"
|
||
|
|
data-description="{{ $leave->description }}">
|
||
|
|
<i class="fal fa-pencil-alt"></i>{{ __('Edit') }}</a>
|
||
|
|
</li>
|
||
|
|
@endusercan
|
||
|
|
@usercan('leaves.delete')
|
||
|
|
<li>
|
||
|
|
<a href="{{ route('hrm.leaves.destroy', $leave->id) }}" class="confirm-action"
|
||
|
|
data-method="DELETE">
|
||
|
|
<i class="fal fa-trash-alt"></i>
|
||
|
|
{{ __('Delete') }}
|
||
|
|
</a>
|
||
|
|
</li>
|
||
|
|
@endusercan
|
||
|
|
</ul>
|
||
|
|
</div>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
@endforeach
|
||
|
|
|
||
|
|
</tbody>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
<div class="mt-3">
|
||
|
|
{{ $leaves->links('vendor.pagination.bootstrap-5') }}
|
||
|
|
</div>
|