This commit is contained in:
Krzysztof Strzelecki 2019-11-08 00:46:38 +01:00
commit cb9965cd95
6 changed files with 39 additions and 10 deletions

View File

@ -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');

13
app/ranks.php Normal file
View File

@ -0,0 +1,13 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class ranks extends Model
{
//
protected $primaryKey = 'id';
protected $fillable = ['rank'];
}

12
app/unitFunctions.php Normal file
View File

@ -0,0 +1,12 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class unitFunctions extends Model
{
//
protected $primaryKey = 'id';
protected $fillable = [ 'unitFunction' ];
}

View File

@ -84,8 +84,8 @@
<td id="userSurname{{ $user->id }}">{{ $user->surname }}</td>
<td id="userPESEL{{ $user->id }}">{{ $user->PESEL }}</td>
<td id="userEmail{{ $user->id }}">{{ $user->email }}</td>
<td id="userFunction{{ $user->id }}">Zast. Naczelnika</td>
<td id="userDegree{{ $user->id }}">Dowódca</td>
<td id="userFunction{{ $user->id }}">{{ $user->unitFunction }}</td>
<td id="userDegree{{ $user->id }}">{{$user->rank}}</td>
<td id="userStatus{{ $user->id }}">@if( $user->statusID == 0) Czynny @else Wyłączony @endif</td>
<td><a href="{{ URL::asset('strazacy/edit/'.$user->id) }}"><input type="button" onclick="" value="Edytuj"> </a></td>
</tr>

View File

@ -1,11 +1,11 @@
@section('menu')
<div class="top-menu">
<ol>
<a href="/jednostka"><li name="jednostka"><img src="img/jednostka.png">Jednostka</li></a>
<a href="/strazacy"><li name="strazacy"><img src="img/strazacy2.png">Strażacy</li></a>
<a href="/pojazdy"> <li name="pojazdy"><img src="img/car.png">Pojazdy</li></a>
<a href="/straznica"><li name="straznica"><img src="img/straznica.png">Strażnica</li></a>
<a href="/wyjazdy"><li name="wyjazdy"><img src="img/wyjazdy.png">Wyjazdy</li></a>
<a href="/dokumentacja"><li name="dokumentacja"><img src="img/documents.png">Dokumentacja</li></a>
<a href="/jednostka"><li name="jednostka"><img src="../img/jednostka.png">Jednostka</li></a>
<a href="/strazacy"><li name="strazacy"><img src="../img/strazacy2.png">Strażacy</li></a>
<a href="/pojazdy"> <li name="pojazdy"><img src="../img/car.png">Pojazdy</li></a>
<a href="/straznica"><li name="straznica"><img src="../img/straznica.png">Strażnica</li></a>
<a href="/wyjazdy"><li name="wyjazdy"><img src="../img/wyjazdy.png">Wyjazdy</li></a>
<a href="/dokumentacja"><li name="dokumentacja"><img src="../img/documents.png">Dokumentacja</li></a>
</ol>
</div>

View File

@ -17,7 +17,7 @@
<a href="/register">Register</a>
@endif
<div id="header">
<div class="logo"><a href="/register"><img src="img/logo.png"></a></div>
<div class="logo"><a href="/register"><img src="../img/logo.png"></a></div>
@include('inc.menu')
<div class="userInfo">
<?php