This commit is contained in:
2019-11-07 00:15:30 -06:00
parent 77dd47c435
commit 09ea2a5511
2 changed files with 8 additions and 12 deletions

View File

@@ -176,8 +176,10 @@ class MoonsController extends Controller
$reprocessing = $request->reprocessing;
}
//Set the reprocessing level for 84%
$reprocessing = 0.84;
//Set the reprocessing level for 84% if the value is null
if($request->reprocessing == null) {
$reprocessing = 0.84;
}
//Calculate the total moon goo value
$totalGoo = $moonCalc->SpatialMoonsOnlyGooTotalWorth($firstOre, $firstQuantity, $secondOre, $secondQuantity,
@@ -332,16 +334,6 @@ class MoonsController extends Controller
$composition['Thulium'] += floor(($fourthComp->Thulium * $rUnits) * $reprocessing);
}
//Remove any items which don't equal a number above 0 in the composition in order to remove them from the total.
//The less we display on the table the better.
foreach($composition as $key => $value) {
if($composition[$key] === 0) {
unset($composition[$key]);
}
}
dd($composition);
return view('moons.user.displayTotalWorth')->with('totalWorth', $totalWorth)
->with('totalGoo', $totalGoo)
->with('composition', $composition)

View File

@@ -172,6 +172,10 @@
], 'None') }}
{{ Form::text('fourthQuantity', '', ['class' => 'form-control']) }}
</div>
<div class="form-group col-md-2">
{{ Form::label('reprocessing', 'Reprocessing') }}
{{ Form::text('reprocessing', '', ['class' => 'form-control', 'placeholder' = '0.84']) }}
</div>
<div class="form-group col-md-1">
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
{!! Form::close() !!}