update to moon blade
This commit is contained in:
@@ -37,42 +37,44 @@ class MoonsController extends Controller
|
||||
$moons = DB::table('Moons')->orderBy('System', 'asc')->get();
|
||||
//declare the html variable and set it to null
|
||||
$html = '';
|
||||
$table = array();
|
||||
$moonprice = null;
|
||||
foreach($moons as $moon) {
|
||||
//Setup formats as needed
|
||||
$spm = $moon->System . ' - ' . $moon->Planet . ' - ' . $moon->Moon;
|
||||
$rentalEnd = new Carbon($moon->RentalEnd);
|
||||
$rentalEnd = $rentalEnd->format('m-d');
|
||||
|
||||
$price = $moonCalc->SpatialMoonsOnlyGoo($moon->FirstOre, $moon->FirstQuantity, $moon->SecondOre, $moon->SecondQuantity,
|
||||
$moon->ThirdOre, $moon->ThirdQuantity, $moon->FourthOre, $moon->FourthQuantity);
|
||||
|
||||
$worth = $moonCalc->SpatialMoonsTotalWorth($moon->FirstOre, $moon->FirstQuantity, $moon->SecondOre, $moon->SecondQuantity,
|
||||
$moon->ThirdOre, $moon->ThirdQuantity, $moon->FourthOre, $moon->FourthQuantity);
|
||||
|
||||
if($type == 'W4RP') {
|
||||
$moonprice = $price['alliance'];
|
||||
} else {
|
||||
$moonprice = $price['outofalliance'];
|
||||
}
|
||||
|
||||
//Add the data to the html string to be passed to the view
|
||||
$html .= '<tr>';
|
||||
$html .= '<td>' . $spm . '</td>';
|
||||
$html .= '<td>' . $moon->StructureName . '</td>';
|
||||
$html .= '<td>' . $moon->FirstOre . '</td>';
|
||||
$html .= '<td>' . $moon->FirstQuantity . '</td>';
|
||||
$html .= '<td>' . $moon->SecondOre . '</td>';
|
||||
$html .= '<td>' . $moon->SecondQuantity . '</td>';
|
||||
$html .= '<td>' . $moon->ThirdOre . '</td>';
|
||||
$html .= '<td>' . $moon->ThirdQuantity . '</td>';
|
||||
$html .= '<td>' . $moon->FourthOre . '</td>';
|
||||
$html .= '<td>' . $moon->FourthQuantity . '</td>';
|
||||
if($type == 'W4RP') {
|
||||
$html .= '<td>' . $price['alliance'] . '</td>';
|
||||
} else if ($type == 'Legacy') {
|
||||
$html .= '<td>' . $price['outofalliance'] . '</td>';
|
||||
} else {
|
||||
$html .= '<td>N/A</td>';
|
||||
}
|
||||
$html .= '<td>' . number_format($worth, "2", ".", ",") . '</td>';
|
||||
$html .= '<td>' . $rentalEnd . '</td>';
|
||||
$html .= '</tr>';
|
||||
array_push($table, [
|
||||
'SPM' => $spm,
|
||||
'StructureName' => $moon->StrucutreName,
|
||||
'FirstOre' => $moon->FirstOre,
|
||||
'FirstQuantity' => $moon->FirstQuantity,
|
||||
'SecondOre' => $moon->SecondOre,
|
||||
'SecondQuantity' => $moon->SecondQuantity,
|
||||
'ThirdOre' => $moon->ThirdOre,
|
||||
'ThirdQuantity' => $moon->ThirdQuantity,
|
||||
'FourthQuantity' => $moon->FourthQuantity,
|
||||
'Price' => $moonprice,
|
||||
'Worth' => number_format($worth, "2", ".", ","),
|
||||
'RentalEnd' => $rentalEnd,
|
||||
]);
|
||||
}
|
||||
|
||||
return view('moons/user/moon')->with('html', $html);
|
||||
return view('moons/user/moon')->with('table', $table);
|
||||
}
|
||||
|
||||
public function displayTotalWorthForm() {
|
||||
|
||||
Reference in New Issue
Block a user