admin test dashboard
This commit is contained in:
@@ -31,7 +31,37 @@ class AdminController extends Controller
|
||||
}
|
||||
|
||||
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() {
|
||||
|
||||
@@ -4,10 +4,18 @@
|
||||
<h2>Admin Dashboard Test</h2><br>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>user Information</h2>
|
||||
<h2>User Information</h2>
|
||||
</div>
|
||||
<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">
|
||||
<thead>
|
||||
<th>Name</th>
|
||||
@@ -16,14 +24,23 @@
|
||||
<th>Action</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for ($i = 0; $i < 50; $i++)
|
||||
@foreach($usersArr as $user)
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Role</td>
|
||||
<td>Permissions</td>
|
||||
<td>Form</td>
|
||||
<td>{{ $user->name }}</td>
|
||||
<td>{{ $user->role }}</td>
|
||||
<td>{{ $user->permission }}</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>
|
||||
@endfor
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user