admin test dashboard
This commit is contained in:
@@ -31,7 +31,37 @@ class AdminController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function displayTestAdminDashboard() {
|
public function displayTestAdminDashboard() {
|
||||||
return view('admin.dashboards.testdashboard');
|
//Declare array variables
|
||||||
|
$user = array();
|
||||||
|
$permission = array();
|
||||||
|
$userArr = array();
|
||||||
|
$permString = null;
|
||||||
|
|
||||||
|
$usersArr = User::orderBy('name', 'asc')->paginate(50);
|
||||||
|
|
||||||
|
foreach($usersArr as $user) {
|
||||||
|
$user->role = $user->getRole();
|
||||||
|
|
||||||
|
$permCount = UserPermission::where([
|
||||||
|
'character_id' => $user->character_id,
|
||||||
|
])->count();
|
||||||
|
|
||||||
|
if($permCount > 0) {
|
||||||
|
$perms = UserPermission::where([
|
||||||
|
'character_id' => $user->character_id,
|
||||||
|
])->get('permission')->toArray();
|
||||||
|
|
||||||
|
foreach($perms as $perm) {
|
||||||
|
$permString .= $perm['permission'] . ', ';
|
||||||
|
}
|
||||||
|
|
||||||
|
$user->permission = $permString;
|
||||||
|
} else {
|
||||||
|
$user->permission = 'No Permissions';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('admin.dashboards.testdashboard')->with('usersArr', $usersArr);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showJournalEntries() {
|
public function showJournalEntries() {
|
||||||
|
|||||||
@@ -4,10 +4,18 @@
|
|||||||
<h2>Admin Dashboard Test</h2><br>
|
<h2>Admin Dashboard Test</h2><br>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h2>user Information</h2>
|
<h2>User Information</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
Form<br>
|
<div class="container">
|
||||||
|
{!! Form::open(['action' => 'Dashboard\AdminController@searchUsers', 'method' => 'POST']) !!}
|
||||||
|
<div class="form-group">
|
||||||
|
{{ Form::label('parameter', 'Seach For A User') }}
|
||||||
|
{{ Form::text('parameter', '', ['class' => 'form-control', 'placeholder' => 'CCP Antiquarian']) }}
|
||||||
|
</div>
|
||||||
|
{{ Form::submit('Search', ['class' => 'btn btn-primary']) }}
|
||||||
|
{!! Form::close() !!}
|
||||||
|
</div>
|
||||||
<table class="table table-striped table-bordered">
|
<table class="table table-striped table-bordered">
|
||||||
<thead>
|
<thead>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
@@ -16,14 +24,23 @@
|
|||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@for ($i = 0; $i < 50; $i++)
|
@foreach($usersArr as $user)
|
||||||
<tr>
|
<tr>
|
||||||
<td>Name</td>
|
<td>{{ $user->name }}</td>
|
||||||
<td>Role</td>
|
<td>{{ $user->role }}</td>
|
||||||
<td>Permissions</td>
|
<td>{{ $user->permission }}</td>
|
||||||
<td>Form</td>
|
<td>
|
||||||
|
{!! Form::open(['action' => 'Dashboard\AdminController@displayModifyUser', 'method' => 'POST']) !!}
|
||||||
|
{{ Form::hidden('user', $user->name) }}
|
||||||
|
{{ Form::submit('Modify User', ['class' => 'btn btn-primary']) }}
|
||||||
|
{!! Form::close() !!}
|
||||||
|
{!! Form::open(['action' => 'Dashboard\AdminController@removeUser', 'method' => 'POST']) !!}
|
||||||
|
{{ Form::hidden('user', $user->name) }}
|
||||||
|
{{ Form::submit('Remove User', ['class' => 'btn btn-danger']) }}
|
||||||
|
{!! Form::close() !!}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endfor
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user