diff --git a/app/Http/Controllers/Dashboard/AdminController.php b/app/Http/Controllers/Dashboard/AdminController.php index ba12bb1ff..e36216494 100644 --- a/app/Http/Controllers/Dashboard/AdminController.php +++ b/app/Http/Controllers/Dashboard/AdminController.php @@ -23,16 +23,79 @@ class AdminController extends Controller $this->middleware('role:Admin'); } - public function displayDashboard() { + public function displayUsers(Request $request) { + //Declare array variables + $user = array(); + $permission = array(); + $userArr = array(); + + /** + * For each user we want to build their name and permission set into one array + * Having all of the data in one array will allow us to build the table for the admin page more fluently. + * Example: userArr[0]['name'] = Minerva Arbosa + * userArr[0]['role'] = W4RP + * userArr[0]['permissions'] = ['admin', 'contract.admin', superuser] + */ + $usersTable = User::orderBy('name', 'asc')->get()->toArray(); + foreach($usersTable as $user) { + $perms = UserPermission::where([ + 'character_id' => $user['character_id'], + ])->get('permission')->toArray(); + + $tempUser['name'] = $user['name']; + $tempUser['role'] = $user['user_type']; + $tempUser['permissions'] = $perms; + + array_push($userArr, $tempUser); + } + + //Get a user count for the view so we can do pagination + $userCount = User::orderBy('name', 'asc')->count(); + //Set the amount of pages for the data + $userPages = ceil($userCount / 50); + + /** + * Miscellaneous data for populating arrays + * + */ + $users = User::pluck('name')->all(); + + return view('admin.dashboards.users')->with('users', $users) + ->with('userArr', $userArr) + ->with('page', $page) + ->with('userCount', $userCount) + ->with('userPages', $userPages); + } + + public function displayAllowedLogins() { + //Declare array variables + $entities = array(); + + /** Entities for allowed logins */ + $legacys = AllowedLogin::where(['login_type' => 'Legacy'])->pluck('entity_name')->toArray(); + $renters = AllowedLogin::where(['login_type' => 'Renter'])->pluck('entity_name')->toArray(); + //Compile a list of entities by their entity_id + foreach($legacys as $legacy) { + $entities[] = $legacy; + } + foreach($renters as $renter) { + $entities[] = $renter; + } + + return view('admin.dashboards.allowed_logins')->with('entities', $entities); + } + + public function displayPurgeWiki() { + return view('admin.dashboards.purge_wiki'); + } + + public function displayTaxes() { //Declare variables needed for displaying items on the page $months = 3; $pi = array(); $industry = array(); $reprocessing = array(); $office = array(); - $user = array(); - $permission = array(); - $entities = array(); $corpId = 98287666; $srpActual = array(); $srpLoss = array(); @@ -93,57 +156,15 @@ class AdminController extends Controller ]; } - /** Users & Permissions Pane */ - $userArr = array(); - /** - * For each user we want to build their name and permission set into one array - * Having all of the data in one array will allow us to build the table for the admin page more fluently. - * Example: userArr[0]['name'] = Minerva Arbosa - * userArr[0]['role'] = W4RP - * userArr[0]['permissions'] = ['admin', 'contract.admin', superuser] - */ - $usersTable = User::orderBy('name', 'asc')->get()->toArray(); - foreach($usersTable as $user) { - $perms = UserPermission::where([ - 'character_id' => $user['character_id'], - ])->get('permission')->toArray(); - - $tempUser['name'] = $user['name']; - $tempUser['role'] = $user['user_type']; - $tempUser['permissions'] = $perms; - - array_push($userArr, $tempUser); - } - - /** - * Miscellaneous data for populating arrays - * - */ - $users = User::pluck('name')->all(); - - /** Entities for allowed logins */ - $legacys = AllowedLogin::where(['login_type' => 'Legacy'])->pluck('entity_name')->toArray(); - $renters = AllowedLogin::where(['login_type' => 'Renter'])->pluck('entity_name')->toArray(); - //Compile a list of entities by their entity_id - foreach($legacys as $legacy) { - $entities[] = $legacy; - } - foreach($renters as $renter) { - $entities[] = $renter; - } - - return view('admin.dashboard')->with('users', $users) - ->with('userArr', $userArr) - ->with('pis', $pis) - ->with('industrys', $industrys) - ->with('offices', $offices) - ->with('markets', $markets) - ->with('jumpgates', $jumpgates) - ->with('reprocessings', $reprocessings) - ->with('entities', $entities) - ->with('pigross', $pigross) - ->with('srpActual', $srpActual) - ->with('srpLoss', $srpLoss); + return view('admin.dashboards.taxes')->with('pis', $pis) + ->with('industrys', $industrys) + ->with('offices', $offices) + ->with('markets', $markets) + ->with('jumpgates', $jumpgates) + ->with('reprocessings', $reprocessings) + ->with('pigross', $pigross) + ->with('sprActual', $srpActual) + ->with('srpLoss', $srpLoss); } public function displayModifyUser(Request $request) { diff --git a/resources/views/admin/dashboards/allowed_logins.blade.php b/resources/views/admin/dashboards/allowed_logins.blade.php new file mode 100644 index 000000000..51b64d986 --- /dev/null +++ b/resources/views/admin/dashboards/allowed_logins.blade.php @@ -0,0 +1,51 @@ +@extends('admin.layouts.b4') +@section('content') +
+
+
+
+
+ Add Allowed Login +
+
+ {!! Form::open(['action' => 'Dashboard\AdminController@addAllowedLogin', 'method' => 'POST']) !!} +
+ {{ Form::label('allowedEntityId', 'Allowed Entity ID') }} + {{ Form::text('allowedEntityId', '', ['class' => 'form-control']) }} +
+
+ {{ Form::label('allowedEntityType', 'Allowed Entity Type') }} + {{ Form::select('allowedEtntityType', ['Corporation' => 'Corporation', 'Alliance' => 'Alliance'], null, ['class' => 'form-control']) }} +
+
+ {{ Form::label('allowedEntityName', 'Allowed Entity Name') }} + {{ Form::text('allowedEntityName', '', ['class' => 'form-control']) }} +
+
+ {{ Form::label('allowedLoginType', 'Allowed Login Type') }} + {{ Form::select('allowedLoginType', ['Legacy' => 'Legacy', 'Renter' => 'Renter'], null, ['class' => 'form-control']) }} +
+ {{ Form::submit('Submit', ['class' => 'btn btn-primary']) }} + {!! Form::close() !!} +
+
+
+
+
+
+ Remove Allowed Login +
+
+ {!! Form::open(['action' => 'Dashboard\AdminController@removeAllowedLogin', 'method' => 'POST']) !!} +
+ {{ Form::label('removeAllowedLogin', 'Remove Entity') }} + {{ Form::select('removeAllowedLogin', $entities, null, ['class' => 'form-control']) }} +
+ {{ Form::submit('Submit', ['class' => 'btn btn-primary']) }} + {!! Form::close() !!} +
+
+
+
+
+@endsection \ No newline at end of file diff --git a/resources/views/admin/dashboards/purge_wiki.blade.php b/resources/views/admin/dashboards/purge_wiki.blade.php new file mode 100644 index 000000000..8b6e0527b --- /dev/null +++ b/resources/views/admin/dashboards/purge_wiki.blade.php @@ -0,0 +1,14 @@ +@extends('admin.layouts.b4') +@section('content') +
+
+ {!! Form::open(['action' => 'Wiki\WikiController@purgeUsers', 'method' => 'POST']) !!} +
+ {{ Form::label('admin', 'This action will log the administrator who peformed the action.') }} + {{ Form::hidden('admin', auth()->user()->character_id) }} +
+ {{ Form::submit('Purge Wiki', ['class' => 'btn btn-primary']) }} + {!! Form::close() !!} +
+
+@endsection \ No newline at end of file diff --git a/resources/views/admin/dashboards/taxes.blade.php b/resources/views/admin/dashboards/taxes.blade.php new file mode 100644 index 000000000..6336d8903 --- /dev/null +++ b/resources/views/admin/dashboards/taxes.blade.php @@ -0,0 +1,231 @@ +@extends('admin.layouts.b4') +@section('content') + +
+
+

Taxes Dashboard

+
+
+
+
+
+
+
+
+ PI Taxes +
+
+ + + + + + + @foreach($pis as $pi) + + + + + @endforeach + +
MonthPI Taxes
{{ $pi['date'] }}{{ $pi['gross'] }}
+
+
+
+
+
+
+ Office Taxes +
+
+ + + + + + + @foreach($offices as $office) + + + + + @endforeach + +
MonthOffice Taxes
{{ $office['date'] }}{{ $office['gross'] }}
+
+
+
+
+
+
+ Industry Taxes +
+
+ + + + + + + @foreach($industrys as $industry) + + + + + @endforeach + +
MonthIndustry Taxes
{{ $industry['date'] }}{{ $industry['gross'] }}
+
+
+
+
+
+
+
+
+
+
+
+ Reprocessing Taxes +
+
+ + + + + + + @foreach($reprocessings as $reprocessing) + + + + + @endforeach + +
MonthReprocessing Taxes
{{ $reprocessing['date'] }}{{ $reprocessing['gross'] }}
+
+
+
+
+
+
+ Market Taxes +
+
+ + + + + + + @foreach($markets as $market) + + + + + @endforeach + +
MonthMarket Taxes
{{ $market['date'] }}{{ $market['gross'] }}
+
+
+
+
+
+
+ Jump Gate Taxes +
+
+ + + + + + + @foreach($jumpgates as $jumpgate) + + + + + @endforeach + +
MonthJump Gate Taxes
{{ $jumpgate['date'] }}{{ $jumpgate['gross'] }}
+
+
+
+
+
+
+
+
+
+
+
+ PI Transactions +
+
+ + + + + + + @foreach($pigross as $pi) + + + + + @endforeach + +
MonthPI Transactions
{{ $pi['date'] }}{{ $pi['gross'] }}
+
+
+
+
+
+
+ SRP Actual Paid Out +
+
+ + + + + + + @foreach($srpActual as $actual) + + + + + @endforeach + +
MonthSRP Actual
{{ $actual['date'] }}{{ $actual['gross'] }}
+
+
+
+
+
+
+ SRP Loss Values +
+
+ + + + + + + @foreach($srpLoss as $loss) + + + + + @endforeach + +
MonthSRP Loss
{{ $loss['date'] }}{{ $loss['gross'] }}
+
+
+
+
+
+@endsection \ No newline at end of file diff --git a/resources/views/layouts/navbar.blade.php b/resources/views/layouts/navbar.blade.php index 9d365c6d3..ab16b3a6e 100644 --- a/resources/views/layouts/navbar.blade.php +++ b/resources/views/layouts/navbar.blade.php @@ -89,8 +89,14 @@ Add Esi Scopes @if(auth()->user()->hasRole('Admin')) - @endif