diff --git a/app/Http/Controllers/Dashboard/DashboardController.php b/app/Http/Controllers/Dashboard/DashboardController.php index eb739693c..01112629b 100644 --- a/app/Http/Controllers/Dashboard/DashboardController.php +++ b/app/Http/Controllers/Dashboard/DashboardController.php @@ -7,6 +7,7 @@ use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; +use Khill\Lavacharts\Lavacharts; //Models use App\Models\Esi\EsiScope; @@ -61,7 +62,7 @@ class DashboardController extends Controller $approved = SRPShip::where([ 'character_id' => auth()->user()->character_id, 'approved' => 'Approved', - ])->get(); + ])->take(10)->get(); } //See if we can get all of the closed and denied SRP requests @@ -73,10 +74,40 @@ class DashboardController extends Controller $denied = SRPShip::where([ 'character_id' => auth()->user()->character_id, 'approved' => 'Denied', - ])->get(); + ])->take(10)->get(); } - return view('dashboard'); + //Create a chart of number of approved, denied, and open requests via a fuel gauge chart + $lava = new Lavacharts; + + $adur = $lava->DataTable(); + + $adur->addStringColumn('Type') + ->addNumberColumn('Number') + ->addRow(['Under Review', $openCount]); + + $lava->GaugeChart('SRP', $adur, [ + 'width' => 300, + 'greenFrom' => 0, + 'greenTo' => 5, + 'yellowFrom' => 6, + 'yellowTo' => 10, + 'redFrom' => 11, + 'redTo' => 15, + 'majorTicks' => [ + 'Safe', + 'Warning', + 'Critical', + ], + ]); + + return view('dashboard')->with('openCount', $openCount) + ->with('approvedCount', $approvedCount) + ->with('deniedCount', $deniedCount) + ->with('open', $open) + ->with('approved', $approved) + ->with('denied', $denied) + ->with('lava', $lava); } /** diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index 5c88da6fb..b1fa10fab 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -19,4 +19,121 @@ +
+
+
+
+
+
+ Open SRP Requests
+ # Open: {{ $openCount }}
+
+ {!! $lava->redner('GaugeChart', 'SRP', 'under-review-div') !!} +
+
+ @if($openCount > 0) + + + + + + + + + @foreach($open as $o) + + + + + + + @endforeach + +
Fleet CommanderShip TypeLoss ValueStatus
{{ $o->fleet_commander_name }}{{ $o->ship_type }}{{ $o->loss_value }}{{ $o->approved }}
+ @else + No Open SRP Requests + @endif +
+
+
+
+
+
+
+
+
+
+
+ Denied SRP Requests
+ # Denied: {{ $deniedCount }} +
+
+ @if($deniedCount > 0) + + + + + + + + + + @foreach($denied as $d) + + + + + + + + @endforeach + +
Fleet CommanderShip TypeLoss ValueStatusNotes
{{ $d->fleet_commander_name }}{{ $d->ship_type }}{{ $d->loss_value }}{{ $d->approved }}{{ $d->notes }}
+ @else + No Denied SRP Requests + @endif +
+
+
+
+
+
+
+
+
+
+
+ Approved SRP Requests
+ # Approved: {{ $approvedCount }} +
+
+ @if($approvedCount > 0) + + + + + + + + + @foreach($approved as $a) + + + + + + + @endforeach + +
Fleet CommanderShip TypeLoss ValueStatus
{{ $a->fleet_commander_name }}{{ $a->ship_type }}{{ $a->loss_value }}{{ $a->approved }}
+ @else + No Approved SRP Requests + @endif +
+
+
+
+
+ + @endsection