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 @@
+
+
+
+
+
+
+
+ @if($openCount > 0)
+
+
+ | Fleet Commander |
+ Ship Type |
+ Loss Value |
+ Status |
+
+
+ @foreach($open as $o)
+
+ | {{ $o->fleet_commander_name }} |
+ {{ $o->ship_type }} |
+ {{ $o->loss_value }} |
+ {{ $o->approved }} |
+
+ @endforeach
+
+
+ @else
+ No Open SRP Requests
+ @endif
+
+
+
+
+
+
+
+
+
+
+
+
+ @if($deniedCount > 0)
+
+
+ | Fleet Commander |
+ Ship Type |
+ Loss Value |
+ Status |
+ Notes |
+
+
+ @foreach($denied as $d)
+
+ | {{ $d->fleet_commander_name }} |
+ {{ $d->ship_type }} |
+ {{ $d->loss_value }} |
+ {{ $d->approved }} |
+ {{ $d->notes }} |
+
+ @endforeach
+
+
+ @else
+ No Denied SRP Requests
+ @endif
+
+
+
+
+
+
+
+
+
+
+
+
+ @if($approvedCount > 0)
+
+
+ | Fleet Commander |
+ Ship Type |
+ Loss Value |
+ Status |
+
+
+ @foreach($approved as $a)
+
+ | {{ $a->fleet_commander_name }} |
+ {{ $a->ship_type }} |
+ {{ $a->loss_value }} |
+ {{ $a->approved }} |
+
+ @endforeach
+
+
+ @else
+ No Approved SRP Requests
+ @endif
+
+
+
+
+
+
+
@endsection