srp testing

This commit is contained in:
2019-07-08 22:44:42 -05:00
parent f194d91d90
commit d81ca33b0a
2 changed files with 8 additions and 1 deletions

View File

@@ -137,6 +137,7 @@ class SRPAdminController extends Controller
//Get the losses by Fleet Commander Name, and populate variables for the table //Get the losses by Fleet Commander Name, and populate variables for the table
$fcNames = SRPShip::pluck('fleet_commander_name'); $fcNames = SRPShip::pluck('fleet_commander_name');
dd($fcNames);
foreach($fcNames as $name) { foreach($fcNames as $name) {
$total = SRPShip::where(['fleet_commander_name' => $name]) $total = SRPShip::where(['fleet_commander_name' => $name])
->sum('loss_value'); ->sum('loss_value');
@@ -148,6 +149,8 @@ class SRPAdminController extends Controller
array_push($barChartData, $temp); array_push($barChartData, $temp);
} }
dd($barChartData);
//Pie Chart for approval, denied, and under review //Pie Chart for approval, denied, and under review
$lava = new Lavacharts; // See note below for Laravel $lava = new Lavacharts; // See note below for Laravel

View File

@@ -59,10 +59,14 @@ class SRPController extends Controller
$lossValue = str_replace(',', '', $lossValue); $lossValue = str_replace(',', '', $lossValue);
$lossValue = floatval($lossValue); $lossValue = floatval($lossValue);
//Convert the FC name to a regular case of characters
$tempFcName = strtolower($request->FC);
$tempFcName = ucwords($tempFcName);
$ship = new SRPShip; $ship = new SRPShip;
$ship->character_id = auth()->user()->character_id; $ship->character_id = auth()->user()->character_id;
$ship->character_name = auth()->user()->name; $ship->character_name = auth()->user()->name;
$ship->fleet_commander_name = $request->FC; $ship->fleet_commander_name = $tempFcName;
if(isset($fcId[0])) { if(isset($fcId[0])) {
$ship->fleet_commander_id = $fcId[0]->character_id; $ship->fleet_commander_id = $fcId[0]->character_id;
} }