diff --git a/app/Http/Controllers/MoonsController.php b/app/Http/Controllers/MoonsController.php index 6e19e9b63..158c7dc30 100644 --- a/app/Http/Controllers/MoonsController.php +++ b/app/Http/Controllers/MoonsController.php @@ -42,8 +42,9 @@ class MoonsController extends Controller 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'); + $rentalTemp = new Carbon($moon->RentalEnd); + $rentalEnd = $rentalTemp->format('m-d'); + $today = Carbon::now(); $price = $moonCalc->SpatialMoonsOnlyGoo($moon->FirstOre, $moon->FirstQuantity, $moon->SecondOre, $moon->SecondQuantity, $moon->ThirdOre, $moon->ThirdQuantity, $moon->FourthOre, $moon->FourthQuantity); @@ -56,6 +57,12 @@ class MoonsController extends Controller } else { $moonprice = $price['outofalliance']; } + + if($today > $rentalTemp) { + $color = 'success'; + } else { + $color = 'warning'; + } //Add the data to the html string to be passed to the view array_push($table, [ @@ -72,6 +79,7 @@ class MoonsController extends Controller 'Price' => $moonprice, 'Worth' => number_format($worth, "2", ".", ","), 'RentalEnd' => $rentalEnd, + 'RowColor' => $color, ]); } diff --git a/resources/views/moons/user/moon.blade.php b/resources/views/moons/user/moon.blade.php index cdb5be293..67f51bff1 100644 --- a/resources/views/moons/user/moon.blade.php +++ b/resources/views/moons/user/moon.blade.php @@ -19,7 +19,7 @@ @foreach($table as $row) - + {{ $row['SPM'] }} {{ $row['StructureName'] }} {{ $row['FirstOre'] }}