errors
This commit is contained in:
@@ -101,8 +101,11 @@ class FleetsController extends Controller
|
||||
$fleet = DB::table('Fleets')->where('fleet', $fleetId)->get();
|
||||
//Add a pilot to the fleet
|
||||
$error = $newPilot->AddPilot($fleet[0]->character_id, $charId);
|
||||
|
||||
return redirect('/fleets/display');
|
||||
if($error) {
|
||||
return view('fleets.displayfleet')->with($error)->with('data', null);
|
||||
} else {
|
||||
return redirect('/fleets/display');
|
||||
}
|
||||
}
|
||||
|
||||
public function updateFleet() {
|
||||
|
||||
@@ -2,11 +2,16 @@
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<h2>Fleets</h2>
|
||||
@if(isset($error))
|
||||
<?php var_dump($error); ?>
|
||||
@endif
|
||||
@if(isset($data))
|
||||
@for($i = 0; $i < count($data[0]); $i++)
|
||||
<a href="{{ route('addpilot', [$data[1][$i], Auth::user()->character_id]) }}">Join {{ $data[2][$i] }}</a><br>
|
||||
@if(Auth::user()->character_id == $data[0][$i])
|
||||
<a href="{{ route('deletefleet', [$data[1][$i]]) }}">Delete Fleet</a><br><br>
|
||||
@endif
|
||||
@endfor
|
||||
@endif
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user