another one
This commit is contained in:
@@ -9,6 +9,7 @@ use Seat\Eseye\Configuration;
|
|||||||
use Seat\Eseye\Containers\EsiAuthentication;
|
use Seat\Eseye\Containers\EsiAuthentication;
|
||||||
use Seat\Eseye\Eseye;
|
use Seat\Eseye\Eseye;
|
||||||
use DB;
|
use DB;
|
||||||
|
use App\Library\MoonCalc;
|
||||||
|
|
||||||
class MoonsController extends Controller
|
class MoonsController extends Controller
|
||||||
{
|
{
|
||||||
@@ -16,6 +17,10 @@ class MoonsController extends Controller
|
|||||||
* Function to display the moons and pass data to the blade template
|
* Function to display the moons and pass data to the blade template
|
||||||
*/
|
*/
|
||||||
public function displayMoons() {
|
public function displayMoons() {
|
||||||
|
//Setup calls to the MoonCalc class
|
||||||
|
$moonCalc = new MoonCalc();
|
||||||
|
//Update the prices for the moon
|
||||||
|
$moonCalc->FetchNewPrices();
|
||||||
//get all of the moons from the database
|
//get all of the moons from the database
|
||||||
$moons = DB::table('moons')->get();
|
$moons = DB::table('moons')->get();
|
||||||
//declare the html variable and set it to null
|
//declare the html variable and set it to null
|
||||||
@@ -24,6 +29,8 @@ class MoonsController extends Controller
|
|||||||
//Setup formats as needed
|
//Setup formats as needed
|
||||||
$spm = $moon->System . ' - ' . $moon->Planet . ' - ' . $moon->Moon;
|
$spm = $moon->System . ' - ' . $moon->Planet . ' - ' . $moon->Moon;
|
||||||
$rentalEnd = date('d.m.Y', $moon->RentalEnd);
|
$rentalEnd = date('d.m.Y', $moon->RentalEnd);
|
||||||
|
$price = $moonCalc->SpatialMoons($moon->FirstOre, $moon->FirstQuantity, $moon->SecondOre, $moon->SecondQuantity,
|
||||||
|
$moon->ThirdOre, $moon->ThirdQuantity, $moon->FourthOre, $moon->FourthQuantity);
|
||||||
//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>';
|
$html .= '<tr>';
|
||||||
$html .= '<td>' . $spm . '</td>';
|
$html .= '<td>' . $spm . '</td>';
|
||||||
@@ -36,7 +43,7 @@ class MoonsController extends Controller
|
|||||||
$html .= '<td>' . $moon->ThirdQuantity . '</td>';
|
$html .= '<td>' . $moon->ThirdQuantity . '</td>';
|
||||||
$html .= '<td>' . $moon->FourthOre . '</td>';
|
$html .= '<td>' . $moon->FourthOre . '</td>';
|
||||||
$html .= '<td>' . $moon->FourthQuantity . '</td>';
|
$html .= '<td>' . $moon->FourthQuantity . '</td>';
|
||||||
$html .= '<td>' . $moon->Price . '</td>';
|
$html .= '<td>' . $price . '</td>';
|
||||||
$html .= '<td>' . $moon->Renter . '</td>';
|
$html .= '<td>' . $moon->Renter . '</td>';
|
||||||
$html .= '<td>' . $rentalEnd . '</td>';
|
$html .= '<td>' . $rentalEnd . '</td>';
|
||||||
$html .= '</tr>';
|
$html .= '</tr>';
|
||||||
|
|||||||
@@ -14,12 +14,8 @@ use GuzzleHttp\Exception\GuzzleException;
|
|||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
|
|
||||||
class MoonCalc {
|
class MoonCalc {
|
||||||
|
|
||||||
public function __construct() {
|
|
||||||
|
|
||||||
}
|
public function SpatialMoons($firstOre, $firstQuan, $secondOre, $secondQuan, $thirdOre, $thirdQuan, $fourthOre, $fourthQuan) {
|
||||||
|
|
||||||
public function SpatialMoons($firstOre, $firstQuan, $secondOre, $secondQuan, $thirdOre, $thirdQuan, $fourthOre, $fourthQuan){
|
|
||||||
//Always assume a 1 month pull which equates to 5.55m3 per second or 2,592,000 seconds
|
//Always assume a 1 month pull which equates to 5.55m3 per second or 2,592,000 seconds
|
||||||
//Total pull size is 14,385,600 m3
|
//Total pull size is 14,385,600 m3
|
||||||
$totalPull = 5.55 * (3600.00 * 24.00 * 30.00);
|
$totalPull = 5.55 * (3600.00 * 24.00 * 30.00);
|
||||||
|
|||||||
Reference in New Issue
Block a user