alliance moon testing

This commit is contained in:
2020-06-22 20:30:53 -05:00
parent 405a785b65
commit db91d9410c

View File

@@ -229,7 +229,6 @@ class MoonsController extends Controller
$today = Carbon::now(); $today = Carbon::now();
$table = array(); $table = array();
$moonprice = null; $moonprice = null;
$color = null;
//Get the user type from the user Auth class //Get the user type from the user Auth class
$type = auth()->user()->getUserType(); $type = auth()->user()->getUserType();
@@ -241,6 +240,10 @@ class MoonsController extends Controller
//For each of the moons let's format the data for the display table //For each of the moons let's format the data for the display table
foreach($moons as $moon) { foreach($moons as $moon) {
$color = null;
$rentalTemp = null;
$rentalEnd = null;
//Check if someone is currently renting the moon //Check if someone is currently renting the moon
if(($moon->rental_type == 'In Alliance' || $moon->rental_type == 'Out of Alliance') && ($moon->paid == 'Yes')) { if(($moon->rental_type == 'In Alliance' || $moon->rental_type == 'Out of Alliance') && ($moon->paid == 'Yes')) {
$rentalTemp = new Carbon($moon->rental_until); $rentalTemp = new Carbon($moon->rental_until);
@@ -271,10 +274,10 @@ class MoonsController extends Controller
} else if($today->lessThan($rentalTemp)) { } else if($today->lessThan($rentalTemp)) {
$color = 'table-danger'; $color = 'table-danger';
} }
} } else if($moon->rental_type == 'Alliance') {
if($moon->rental_type == 'Alliance') {
$color = 'table-info'; $color = 'table-info';
} else {
$color = 'table-primary';
} }
//Add the data to the html array to be passed to the view //Add the data to the html array to be passed to the view