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();
|
$moons = DB::table('Moons')->orderBy('System', 'asc')->get();
|
||||||
//declare the html variable and set it to null
|
//declare the html variable and set it to null
|
||||||
$html = '';
|
$html = '';
|
||||||
|
$table = array();
|
||||||
|
$moonprice = null;
|
||||||
foreach($moons as $moon) {
|
foreach($moons as $moon) {
|
||||||
//Setup formats as needed
|
//Setup formats as needed
|
||||||
$spm = $moon->System . ' - ' . $moon->Planet . ' - ' . $moon->Moon;
|
$spm = $moon->System . ' - ' . $moon->Planet . ' - ' . $moon->Moon;
|
||||||
$rentalEnd = new Carbon($moon->RentalEnd);
|
$rentalEnd = new Carbon($moon->RentalEnd);
|
||||||
$rentalEnd = $rentalEnd->format('m-d');
|
$rentalEnd = $rentalEnd->format('m-d');
|
||||||
|
|
||||||
$price = $moonCalc->SpatialMoonsOnlyGoo($moon->FirstOre, $moon->FirstQuantity, $moon->SecondOre, $moon->SecondQuantity,
|
$price = $moonCalc->SpatialMoonsOnlyGoo($moon->FirstOre, $moon->FirstQuantity, $moon->SecondOre, $moon->SecondQuantity,
|
||||||
$moon->ThirdOre, $moon->ThirdQuantity, $moon->FourthOre, $moon->FourthQuantity);
|
$moon->ThirdOre, $moon->ThirdQuantity, $moon->FourthOre, $moon->FourthQuantity);
|
||||||
|
|
||||||
$worth = $moonCalc->SpatialMoonsTotalWorth($moon->FirstOre, $moon->FirstQuantity, $moon->SecondOre, $moon->SecondQuantity,
|
$worth = $moonCalc->SpatialMoonsTotalWorth($moon->FirstOre, $moon->FirstQuantity, $moon->SecondOre, $moon->SecondQuantity,
|
||||||
$moon->ThirdOre, $moon->ThirdQuantity, $moon->FourthOre, $moon->FourthQuantity);
|
$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
|
//Add the data to the html string to be passed to the view
|
||||||
$html .= '<tr>';
|
array_push($table, [
|
||||||
$html .= '<td>' . $spm . '</td>';
|
'SPM' => $spm,
|
||||||
$html .= '<td>' . $moon->StructureName . '</td>';
|
'StructureName' => $moon->StrucutreName,
|
||||||
$html .= '<td>' . $moon->FirstOre . '</td>';
|
'FirstOre' => $moon->FirstOre,
|
||||||
$html .= '<td>' . $moon->FirstQuantity . '</td>';
|
'FirstQuantity' => $moon->FirstQuantity,
|
||||||
$html .= '<td>' . $moon->SecondOre . '</td>';
|
'SecondOre' => $moon->SecondOre,
|
||||||
$html .= '<td>' . $moon->SecondQuantity . '</td>';
|
'SecondQuantity' => $moon->SecondQuantity,
|
||||||
$html .= '<td>' . $moon->ThirdOre . '</td>';
|
'ThirdOre' => $moon->ThirdOre,
|
||||||
$html .= '<td>' . $moon->ThirdQuantity . '</td>';
|
'ThirdQuantity' => $moon->ThirdQuantity,
|
||||||
$html .= '<td>' . $moon->FourthOre . '</td>';
|
'FourthQuantity' => $moon->FourthQuantity,
|
||||||
$html .= '<td>' . $moon->FourthQuantity . '</td>';
|
'Price' => $moonprice,
|
||||||
if($type == 'W4RP') {
|
'Worth' => number_format($worth, "2", ".", ","),
|
||||||
$html .= '<td>' . $price['alliance'] . '</td>';
|
'RentalEnd' => $rentalEnd,
|
||||||
} 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>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('moons/user/moon')->with('html', $html);
|
return view('moons/user/moon')->with('table', $table);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayTotalWorthForm() {
|
public function displayTotalWorthForm() {
|
||||||
|
|||||||
@@ -18,7 +18,23 @@
|
|||||||
<th>Rental End</th>
|
<th>Rental End</th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{!! $html !!}
|
@foreach($tables as $row)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $row['SPM'] }}</td>
|
||||||
|
<td>{{ $row['StructureName'] }}</td>
|
||||||
|
<td>{{ $row['FirstOre'] }}</td>
|
||||||
|
<td>{{ $row['FirstQuantity'] }}</td>
|
||||||
|
<td>{{ $row['SecondOre'] }}</td>
|
||||||
|
<td>{{ $row['SecondQuantity'] }}</td>
|
||||||
|
<td>{{ $row['ThirdOre'] }}</td>
|
||||||
|
<td>{{ $row['ThirdQuantity'] }}</td>
|
||||||
|
<td>{{ $row['FourthOre'] }}</td>
|
||||||
|
<td>{{ $row['FourthQuantity'] }}</td>
|
||||||
|
<td>{{ $row['Price'] }}</td>
|
||||||
|
<td>{{ $row['Worth'] }}</td>
|
||||||
|
<td>{{ $row['RentalEnd'] }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user