From 8f97ef60fac2be6ac0e960194e665b28a463c486 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Sat, 5 Jan 2019 23:32:00 -0600 Subject: [PATCH] industry taxes testing --- app/Http/Controllers/StructureController.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/StructureController.php b/app/Http/Controllers/StructureController.php index fd36dc3e8..70ca8c8a6 100644 --- a/app/Http/Controllers/StructureController.php +++ b/app/Http/Controllers/StructureController.php @@ -88,6 +88,7 @@ class StructureController extends Controller $helper = new Esi(); $months = 3; + $totalTaxes = array(); //Get the character's corporation from esi $corpId = $helper->FindCorporationId(Auth::user()->character_id); @@ -107,6 +108,8 @@ class StructureController extends Controller ]; } + dd($totalTaxes); + return view('structures.taxes')->with('totalTaxes', $totalTaxes); } @@ -129,11 +132,11 @@ class StructureController extends Controller //Build the array for displaying the data on the view $totalTaxes = array(); - for($i = 0; $i < $months; $i++) { - $totalTaxes[$i] = [ - 'MarketTaxes' => number_format($sHelper->GetTaxes($corpId, 'Market', $dates[$i]['start'], $dates[$i]['end']), 2, '.', ','), - 'MarketRevenue' => number_format($Helper->GetRevenue($corpId, 'Market', $dates[$i]['start'], $dates[$i]['end']), 2, '.', ','), - 'MonthStart' => $dates[$i]['start']->toFormattedDateString(), + foreach($dates as $date) { + $totalTaxes[] = [ + 'date' => $date['start']->toFormattedDateString(), + 'tax' => number_format($sHelper->GetTaxes($corpId, 'Market', $date['start'], $date['end']), 2, '.', ','), + 'revenue' => number_format($sHelper->GetRevenue($corpId, 'Market', $date['start'], $date['end']), 2, '.', ',') ]; }