diff --git a/app/Http/Controllers/fireFightersController.php b/app/Http/Controllers/fireFightersController.php index 3a3fecb..37afd87 100644 --- a/app/Http/Controllers/fireFightersController.php +++ b/app/Http/Controllers/fireFightersController.php @@ -15,7 +15,11 @@ class fireFightersController extends Controller if(auth()->user() != null && auth()->user()->fireStationID != null ){ // $users = user::where("fireStationID", auth()->user()->fireStationID)->get(); - $users = DB::table('users')->where("fireStationID", '=', auth()->user()->fireStationID)->get(); +// $users = DB::table('users')->where("fireStationID", '=', auth()->user()->fireStationID)->get(); + $users = DB::table('users')->where("fireStationID", '=', auth()->user()->fireStationID) + ->leftJoin('ranks', 'users.degreeID', '=', 'ranks.id') + ->leftJoin('unitFunctions', 'users.functionID', '=', 'unitFunctions.id') + ->get(); return view("fireFighters", ["users" => $users]); } else{ return view('fireFighters'); diff --git a/app/ranks.php b/app/ranks.php new file mode 100644 index 0000000..18cde60 --- /dev/null +++ b/app/ranks.php @@ -0,0 +1,13 @@ +id }}">{{ $user->surname }} {{ $user->PESEL }} {{ $user->email }} - Zast. Naczelnika - Dowódca + {{ $user->unitFunction }} + {{$user->rank}} @if( $user->statusID == 0) Czynny @else Wyłączony @endif diff --git a/resources/views/inc/menu.blade.php b/resources/views/inc/menu.blade.php index 10c4594..2b58051 100644 --- a/resources/views/inc/menu.blade.php +++ b/resources/views/inc/menu.blade.php @@ -1,11 +1,11 @@ @section('menu')
    -
  1. Jednostka
  2. -
  3. Strażacy
  4. -
  5. Pojazdy
  6. -
  7. Strażnica
  8. -
  9. Wyjazdy
  10. -
  11. Dokumentacja
  12. +
  13. Jednostka
  14. +
  15. Strażacy
  16. +
  17. Pojazdy
  18. +
  19. Strażnica
  20. +
  21. Wyjazdy
  22. +
  23. Dokumentacja
diff --git a/resources/views/layout/app.blade.php b/resources/views/layout/app.blade.php index 30989e2..b2c49e7 100644 --- a/resources/views/layout/app.blade.php +++ b/resources/views/layout/app.blade.php @@ -17,7 +17,7 @@ Register @endif