dashboard controller and view
This commit is contained in:
@@ -23,6 +23,7 @@ class DashboardController extends Controller
|
||||
|
||||
//Declare array variable
|
||||
$contracts = array();
|
||||
$num = 0;
|
||||
|
||||
//Get the current amount of contracts availabe to the corporation for displaying on the dashboard with the relevant
|
||||
//information such as pickup and destination, jumps, and profit margin.
|
||||
@@ -61,11 +62,10 @@ class DashboardController extends Controller
|
||||
];
|
||||
|
||||
array_push($contracts, $final);
|
||||
$num++;
|
||||
}
|
||||
}
|
||||
|
||||
$num = sizeof($contracts);
|
||||
|
||||
return view('dashboard.dashboard')->with('contracts', $contracts)
|
||||
->with('num', $num);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
@if($num > 0)
|
||||
<div class="container">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
@@ -40,4 +41,5 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
||||
Reference in New Issue
Block a user