admin pane

This commit is contained in:
2019-05-20 01:27:42 -05:00
parent af51db6b7f
commit feb1ad2ac0
2 changed files with 23 additions and 10 deletions

View File

@@ -100,6 +100,13 @@ class AdminController extends Controller
array_push($userArr, $tempUser); array_push($userArr, $tempUser);
} }
/**
* Miscellaneous data for populating arrays
*
*/
$users = User::pluck('name')->all();
$permissions = AvailableUserPermission::pluck('permission')->all();
/** Entities for allowed logins */ /** Entities for allowed logins */
$legacys = AllowedLogin::where(['login_type' => 'Legacy'])->pluck('entity_name')->toArray(); $legacys = AllowedLogin::where(['login_type' => 'Legacy'])->pluck('entity_name')->toArray();
$renters = AllowedLogin::where(['login_type' => 'Renter'])->pluck('entity_name')->toArray(); $renters = AllowedLogin::where(['login_type' => 'Renter'])->pluck('entity_name')->toArray();
@@ -111,7 +118,9 @@ class AdminController extends Controller
$entities[] = $renter; $entities[] = $renter;
} }
return view('admin.dashboard')->with('userArr', $userArr) return view('admin.dashboard')->with('users', $users)
->with('permissions', $permissions)
->with('userArr', $userArr)
->with('pis', $pis) ->with('pis', $pis)
->with('industrys', $industrys) ->with('industrys', $industrys)
->with('offices', $offices) ->with('offices', $offices)

View File

@@ -59,8 +59,8 @@
{!! Form::open(['action' => 'Dashboard\AdminController@addPermission', 'method' => 'POST']) !!} {!! Form::open(['action' => 'Dashboard\AdminController@addPermission', 'method' => 'POST']) !!}
<div class="form-group"> <div class="form-group">
{{ Form::label('user', 'User') }} {{ Form::label('user', 'User') }}
{{ Form::select('user', $data['users'], null, ['class' => 'form-control']) }} {{ Form::select('user', $users, null, ['class' => 'form-control']) }}
{{ Form::select('permission', $data['permissions'], null, ['class' => 'form-control']) }} {{ Form::select('permission', $permissions, null, ['class' => 'form-control']) }}
</div> </div>
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }} {{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!} {!! Form::close() !!}
@@ -80,7 +80,7 @@
{!! Form::open(['action' => 'Dashboard\AdminController@modifyRole', 'method' => 'POST']) !!} {!! Form::open(['action' => 'Dashboard\AdminController@modifyRole', 'method' => 'POST']) !!}
<div class="form-group"> <div class="form-group">
{{ Form::label('user', 'User') }} {{ Form::label('user', 'User') }}
{{ Form::select('user', $data['users'], null, ['class' => 'form-control']) }} {{ Form::select('user', $users, null, ['class' => 'form-control']) }}
</div> </div>
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }} {{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!} {!! Form::close() !!}
@@ -140,6 +140,8 @@
</div> </div>
</div> </div>
<div id="wiki" class="tab-pane fade"> <div id="wiki" class="tab-pane fade">
<div class="container">
<div class="row">
{!! Form::open(['action' => 'Wiki\WikiController@purgeUsers', 'method' => 'POST']) !!} {!! Form::open(['action' => 'Wiki\WikiController@purgeUsers', 'method' => 'POST']) !!}
<div class="form-group"> <div class="form-group">
{{ Form::label('admin', 'This action will log the administrator who peformed the action.') }} {{ Form::label('admin', 'This action will log the administrator who peformed the action.') }}
@@ -148,6 +150,8 @@
{{ Form::submit('Purge Wiki', ['class' => 'btn btn-primary']) }} {{ Form::submit('Purge Wiki', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!} {!! Form::close() !!}
</div> </div>
</div>
</div>
<div id="taxes" class="tab-pane fade"> <div id="taxes" class="tab-pane fade">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">