Update source into github
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
@extends("admin.main")
|
||||
@section("content")
|
||||
@if(auth()->guard('admins')->user()->can("manager administrator"))
|
||||
<div class="card card-primary card-outline">
|
||||
<div class="card-header">
|
||||
<a href="{{ route('admin.user.create') }}" class="btn btn-outline-secondary"><i class="fas fa-plus-circle"></i> Add New Administrator</a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-invoice table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 10px">
|
||||
<label for=""></label><input type="checkbox" name="check" class="check-all" id="">
|
||||
</th>
|
||||
<th>Name</th>
|
||||
<th>Email Address</th>
|
||||
<th>Username</th>
|
||||
<th>Admin Role</th>
|
||||
<th style="width: 40px"></th>
|
||||
<th style="width: 40px"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if($users->count())
|
||||
@foreach($users->all() as $item)
|
||||
<tr>
|
||||
<td><input type="checkbox" name="id[]" id="" value="{{ $item->id }}"></td>
|
||||
<td>{{ $item->firstname . ' ' . $item->lastname }}</td>
|
||||
<td>{{ $item->email }}</td>
|
||||
<td>{{ $item->username }}</td>
|
||||
<td>{{ $item->roles->first()->name ?? 'Chưa phân loại' }}</td>
|
||||
<td>
|
||||
<a class="btn btn-warning btn-sm" href="{{ route('admin.user.edit',['id' => $item->id]) }}">
|
||||
<i class="fas fa-user-edit"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
@if(auth()->guard('admins')->user()->can("delete administrator") && $item->id != 1)
|
||||
<form method="post" class="d-inline"
|
||||
action="{{ route('admin.user.destroy',['id' => $item->id]) }}">
|
||||
@csrf
|
||||
@method('delete')
|
||||
<button type="submit" data-toggle="tooltip" data-placement="top" title=""
|
||||
class="btn btn-sm btn-danger" data-original-title="Xoá">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
{{ $users->withQueryString()->links() }}
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-danger alert-dismissible">
|
||||
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any administrator management department</h5>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@endsection
|
||||
Reference in New Issue
Block a user