diff --git a/app/Http/Controllers/userProfileController.php b/app/Http/Controllers/userProfileController.php
index 03209cc..f894f1a 100644
--- a/app/Http/Controllers/userProfileController.php
+++ b/app/Http/Controllers/userProfileController.php
@@ -69,4 +69,20 @@ class userProfileController extends Controller
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');;
+ }
+ }
}
diff --git a/resources/views/changePassword.blade.php b/resources/views/changePassword.blade.php
index 7128616..474fc9c 100644
--- a/resources/views/changePassword.blade.php
+++ b/resources/views/changePassword.blade.php
@@ -5,6 +5,7 @@
@stop
diff --git a/resources/views/userProfile.blade.php b/resources/views/userProfile.blade.php
index b956bdb..a8f3b14 100644
--- a/resources/views/userProfile.blade.php
+++ b/resources/views/userProfile.blade.php
@@ -4,6 +4,7 @@
@parent
@stop
diff --git a/resources/views/userProfileEdit.blade.php b/resources/views/userProfileEdit.blade.php
index 013c0ba..54edf17 100644
--- a/resources/views/userProfileEdit.blade.php
+++ b/resources/views/userProfileEdit.blade.php
@@ -4,6 +4,7 @@
@parent
@stop
diff --git a/resources/views/userTrainings.blade.php b/resources/views/userTrainings.blade.php
new file mode 100644
index 0000000..ef4a943
--- /dev/null
+++ b/resources/views/userTrainings.blade.php
@@ -0,0 +1,36 @@
+@extends('layout.app')
+
+@section('left-menu')
+ @parent
+
+@stop
+
+@section('center-area')
+ @parent
+
+ @if( auth()->check())
+
+
+
+
+ {{ $userTraining->trainingName }} |
+ {{ $userTraining->dateOfComplete }} |
+ {{ $userTraining->dateOfExpiry }} |
+
+ @endforeach
+
+
+ @else
+ Brak autoryzacji
+ @endif
+
+@stop
\ No newline at end of file
diff --git a/routes/web.php b/routes/web.php
index 75444b4..d630725 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -84,7 +84,8 @@ Route::get('/userprofile', 'userProfileController@create');
Route::get('/userprofile/edit', 'userProfileController@editForm');
Route::post('/userprofile/edit', 'userProfileController@update');
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}', [