Profil użytkownika - wyświetlanie szkoleń
This commit is contained in:
parent
1c9f20dd80
commit
0538c51db9
@ -69,4 +69,20 @@ class userProfileController extends Controller
|
|||||||
|
|
||||||
return redirect()->to('/userprofile');;
|
return redirect()->to('/userprofile');;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function userTrainings(){
|
||||||
|
|
||||||
|
if(auth()->user() != null && auth()->user()->fireStationID != null ){
|
||||||
|
$userTrainings = DB::table('trainingsfirefighters')->where("trainingsfirefighters.firefighterID", '=', auth()->user()->id)
|
||||||
|
->leftJoin('trainings', 'trainingsfirefighters.trainingID', '=', 'trainings.id')
|
||||||
|
->select('trainingsfirefighters.id','trainings.trainingName','trainingsfirefighters.dateOfComplete', 'trainingsfirefighters.dateOfExpiry')
|
||||||
|
->get();
|
||||||
|
//DB::table('trainings')->where("fireStationID", '=', auth()->user()->fireStationID)
|
||||||
|
//->whereNull('deleted_at')->get();
|
||||||
|
return view("userTrainings", ["userTrainings" => $userTrainings]);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return redirect()->to('/login');;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<a href="/userprofile"><li>Mój profil<img src="../img/left_menu_icon/edit.png"></li></a>
|
<a href="/userprofile"><li>Mój profil<img src="../img/left_menu_icon/edit.png"></li></a>
|
||||||
<a href="/userprofile/edit"><li>Edytuj profil<img src="../img/left_menu_icon/edit.png"></li></a>
|
<a href="/userprofile/edit"><li>Edytuj profil<img src="../img/left_menu_icon/edit.png"></li></a>
|
||||||
|
<a href="/userprofile/szkolenia"><li>Moje szkolenia<img src="../img/left_menu_icon/more.png"></li></a>
|
||||||
</ul>
|
</ul>
|
||||||
@stop
|
@stop
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
@parent
|
@parent
|
||||||
<ul>
|
<ul>
|
||||||
<a href="/userprofile/edit"><li>Edytuj profil<img src="../img/left_menu_icon/edit.png"></li></a>
|
<a href="/userprofile/edit"><li>Edytuj profil<img src="../img/left_menu_icon/edit.png"></li></a>
|
||||||
|
<a href="/userprofile/szkolenia"><li>Moje szkolenia<img src="../img/left_menu_icon/more.png"></li></a>
|
||||||
<a href="/userprofile/passwordchange"><li>Zmiana hasła<img src="../img/left_menu_icon/edit.png"></li></a>
|
<a href="/userprofile/passwordchange"><li>Zmiana hasła<img src="../img/left_menu_icon/edit.png"></li></a>
|
||||||
</ul>
|
</ul>
|
||||||
@stop
|
@stop
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
@parent
|
@parent
|
||||||
<ul>
|
<ul>
|
||||||
<a href="/userprofile"><li>Mój profil<img src="../img/left_menu_icon/edit.png"></li></a>
|
<a href="/userprofile"><li>Mój profil<img src="../img/left_menu_icon/edit.png"></li></a>
|
||||||
|
<a href="/userprofile/szkolenia"><li>Moje szkolenia<img src="../img/left_menu_icon/more.png"></li></a>
|
||||||
<a href="/userprofile/passwordchange"><li>Zmiana hasła<img src="../img/left_menu_icon/edit.png"></li></a>
|
<a href="/userprofile/passwordchange"><li>Zmiana hasła<img src="../img/left_menu_icon/edit.png"></li></a>
|
||||||
</ul>
|
</ul>
|
||||||
@stop
|
@stop
|
||||||
|
36
resources/views/userTrainings.blade.php
Normal file
36
resources/views/userTrainings.blade.php
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
@extends('layout.app')
|
||||||
|
|
||||||
|
@section('left-menu')
|
||||||
|
@parent
|
||||||
|
<ul>
|
||||||
|
<a href="/userprofile"><li>Mój profil<img src="../img/left_menu_icon/edit.png"></li></a>
|
||||||
|
<a href="/userprofile/edit"><li>Edytuj profil<img src="../img/left_menu_icon/edit.png"></li></a>
|
||||||
|
<a href="/userprofile/passwordchange"><li>Zmiana hasła<img src="../img/left_menu_icon/edit.png"></li></a>
|
||||||
|
</ul>
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('center-area')
|
||||||
|
@parent
|
||||||
|
|
||||||
|
@if( auth()->check())
|
||||||
|
|
||||||
|
<p align='center'>
|
||||||
|
<table class='firefighterViewTable'>
|
||||||
|
<tr class='table-header'>
|
||||||
|
<td>Szkolenie</td>
|
||||||
|
<td>Data ukończenia</td>
|
||||||
|
<td>Data ważności</td>
|
||||||
|
@foreach($userTrainings as $userTraining)
|
||||||
|
<tr>
|
||||||
|
<td id="trainingName{{ $userTraining->id }}">{{ $userTraining->trainingName }}</td>
|
||||||
|
<td id="dateOfComplete{{ $userTraining->id }}">{{ $userTraining->dateOfComplete }}</td>
|
||||||
|
<td id="dateOfExpiry{{ $userTraining->id }}">{{ $userTraining->dateOfExpiry }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</table>
|
||||||
|
</p>
|
||||||
|
@else
|
||||||
|
Brak autoryzacji
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@stop
|
@ -84,7 +84,8 @@ Route::get('/userprofile', 'userProfileController@create');
|
|||||||
Route::get('/userprofile/edit', 'userProfileController@editForm');
|
Route::get('/userprofile/edit', 'userProfileController@editForm');
|
||||||
Route::post('/userprofile/edit', 'userProfileController@update');
|
Route::post('/userprofile/edit', 'userProfileController@update');
|
||||||
Route::get('/userprofile/passwordchange', 'ChangePasswordController@create');
|
Route::get('/userprofile/passwordchange', 'ChangePasswordController@create');
|
||||||
Route::post('/userprofile/passwordchange', 'ChangePasswordController@update');;
|
Route::post('/userprofile/passwordchange', 'ChangePasswordController@update');
|
||||||
|
Route::get('/userprofile/szkolenia', 'userProfileController@userTrainings');
|
||||||
|
|
||||||
|
|
||||||
Route::get('register/verify/{confirmationCode}', [
|
Route::get('register/verify/{confirmationCode}', [
|
||||||
|
Loading…
Reference in New Issue
Block a user