remove moon logistics

This commit is contained in:
2019-12-08 22:58:25 -06:00
parent 5635fbf57b
commit e9adf4fa4b
3 changed files with 0 additions and 80 deletions

View File

@@ -29,82 +29,6 @@ class MoonsAdminController extends Controller
$this->middleware('auth');
}
/**
* Function to display the moons to logistics personnel
*/
public function displayMoonsLogistics() {
$this->middleware('permissions:logistics.manager');
$lookup = new LookupHelper;
$rentalEnd = '';
$ticker = '';
//Setup calls to the MoonCalc class
$moonCalc = new MoonCalc();
//Get all of the moons from the database
$moons = Moon::orderBy('System', 'asc')->get();
//Declare the html variable and set it to null
$table = array();
//Set carbon dates as needed
$lastMonth = Carbon::now()->subMonth();
$today = Carbon::now();
foreach($moons as $moon) {
//Get the rental data for the moon
$count = MoonRental::where([
'System' => $moon->System,
'Planet' => $moon->Planet,
'Moon' => $moon->Moon,
])->count();
//Check if their is a current rental for a moon going on
if($count == 0) {
//If we don't find a rental record, mark the moon as not paid
$paid = 'No';
//If we don't find a rental record, set the rental date as last month
$rentalTemp = $lastMonth;
$rentalEnd = $rentalTemp->format('m-d');
//Set the ticker info
$ticker = 'N/A';
} else {
//Get the rental data for the moon
$rental = MoonRental::where([
'System' => $moon->System,
'Planet' => $moon->Planet,
'Moon' => $moon->Moon,
])->first();
//If we find a rental record, mark the moon as whether it's paid or not
$paid = $rental->Paid;
//Set the rental date up
$rentalTemp = new Carbon($rental->RentalEnd);
$rentalEnd = $rentalTemp->format('m-d');
}
//Set the color for the table
if($rentalTemp->diffInDays($today) < 3 ) {
$color = 'table-warning';
} else if( $today > $rentalTemp) {
$color = 'table-success';
} else {
$color = 'table-danger';
}
//Add the data to the html string to be passed to the view
array_push($table, [
'SPM' => $moon->System . ' - ' . $moon->Planet . ' - ' . $moon->Moon,
'StructureName' => $moon->StructureName,
'RentalEnd' => $rentalEnd,
'RowColor' => $color,
]);
}
return view('moons.logistics.adminmoon')->with('table', $table);
}
/**
* Function to display the moons to admins
*/

View File

@@ -19,9 +19,6 @@
<a class="dropdown-item" href="/moons/admin/updatemoon">Update Moon</a>
<a class="dropdown-item" href="/moons/admin/journal">Journal</a>
@endif
@if(auth()->user()->hasPermission('logistics.manager'))
<a class="dropdown-item" href="/moons/logistics/display">Moons for Logistics</a>
@endif
</div>
</li>
@endif

View File

@@ -121,7 +121,6 @@ Route::group(['middleware' => ['auth']], function(){
Route::post('/moons/admin/updatemoon', 'Moons\MoonsAdminController@storeUpdateMoon');
Route::get('/moons/admin/journal', 'Moons\MoonsAdminController@showJournalEntries');
Route::post('/moons/admin/display', 'Moons\MoonsAdminController@storeMoonRemoval');
Route::get('/moons/logistics/display', 'Moons\MoonsAdminController@displayMoonsLogistics');
/**
* Scopes Controller display pages