diff --git a/app/Http/Controllers/SystemRentals/RentalAdminController.php b/app/Http/Controllers/SystemRentals/RentalAdminController.php index f1d0e4af3..b468f5357 100644 --- a/app/Http/Controllers/SystemRentals/RentalAdminController.php +++ b/app/Http/Controllers/SystemRentals/RentalAdminController.php @@ -32,6 +32,20 @@ class RentalAdminController extends Controller //Get the rental systems from the database $rentals = RentalSystem::all(); + foreach($rentals as $rental) { + //Format the rental cost + if($rental->rental_cost > 1000000000.00) { + $rental->rental_cost = $rental->rental_cost / 1000000000.00; + $rental->rental_cost = $rental->rental_cost . "B"; + } else if($rental->rental_cost > 1000000.00 && $rental->rental_cost < 999999999.99) { + $rental->rental_cost = $rental->rental_cost / 1000000.00; + $rental->rental_cost = $rental->rental_cost . "M"; + } + + //Format the date + $rental->paid_until = Carbon::parse($rental->paid_until)->format('Y-m-d'); + } + //Return the view with the data return view('rental.list')->with('rentals', $rentals); } diff --git a/resources/views/rental/list.blade.php b/resources/views/rental/list.blade.php index 28b9646bb..7e52a5b86 100644 --- a/resources/views/rental/list.blade.php +++ b/resources/views/rental/list.blade.php @@ -25,7 +25,7 @@ {{ $rental->corporation_name }} {{ $rental->system_name }} {{ number_format($rental->rental_cost, 0, ".", ",") }} - {{ date_format($rental->paid_until, "Y-m-d") }} + {{ $rental->paid_until }} {!! Form::open(['action' => 'SystemRentals\RentalAdminController@updateRentalSystem', 'method' => 'POST']) !!} {{ Form::date('paid_until', \Carbon\Carbon::now()->endOfMonth(), ['class' => 'form-control']) }}