75 lines
3.7 KiB
PHP
75 lines
3.7 KiB
PHP
|
|
<div class="responsive-table m-0">
|
||
|
|
<table class="table" id="datatable">
|
||
|
|
<thead>
|
||
|
|
<tr>
|
||
|
|
@usercan('department.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">{{ __('Name') }}</th>
|
||
|
|
<th class="text-start">{{ __('Description') }}</th>
|
||
|
|
<th>{{ __('Status') }}</th>
|
||
|
|
<th>{{ __('Action') }}</th>
|
||
|
|
</tr>
|
||
|
|
</thead>
|
||
|
|
<tbody>
|
||
|
|
@foreach ($departments as $department)
|
||
|
|
<tr>
|
||
|
|
@usercan('department.delete')
|
||
|
|
<td class="w-60 checkbox">
|
||
|
|
<input type="checkbox" name="ids[]" class="delete-checkbox-item multi-delete"
|
||
|
|
value="{{ $department->id }}">
|
||
|
|
</td>
|
||
|
|
@endusercan
|
||
|
|
<td>{{ ($departments->currentPage() - 1) * $departments->perPage() + $loop->iteration }}</td>
|
||
|
|
|
||
|
|
<td class="text-start">{{ $department->name }}</td>
|
||
|
|
<td class="text-start">{{ Str::limit($department->description, 20, '...') }}</td>
|
||
|
|
<td>
|
||
|
|
<label class="switch">
|
||
|
|
<input type="checkbox" {{ $department->status == 1 ? 'checked' : '' }} class="status"
|
||
|
|
data-url="{{ route('hrm.department.status', $department->id) }}">
|
||
|
|
<span class="slider round"></span>
|
||
|
|
</label>
|
||
|
|
</td>
|
||
|
|
<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('department.update')
|
||
|
|
<li>
|
||
|
|
<a href="#department-edit-modal" data-bs-toggle="modal" class="department-edit-btn"
|
||
|
|
data-url="{{ route('hrm.department.update', $department->id) }}"
|
||
|
|
data-department-name="{{ $department->name }}"
|
||
|
|
data-department-description="{{ $department->description }}">
|
||
|
|
<i class="fal fa-pencil-alt"></i>{{ __('Edit') }}</a>
|
||
|
|
</li>
|
||
|
|
@endusercan
|
||
|
|
@usercan('department.delete')
|
||
|
|
<li>
|
||
|
|
<a href="{{ route('hrm.department.destroy', $department->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">
|
||
|
|
{{ $departments->links('vendor.pagination.bootstrap-5') }}
|
||
|
|
</div>
|