diff --git a/app/Http/Controllers/userProfileController.php b/app/Http/Controllers/userProfileController.php index 0c6772c..a38ad4d 100644 --- a/app/Http/Controllers/userProfileController.php +++ b/app/Http/Controllers/userProfileController.php @@ -14,7 +14,7 @@ class userProfileController extends Controller $userData = DB::table('users')->where("users.id", '=', auth()->user()->id) ->leftJoin('ranks', 'users.degreeID', '=', 'ranks.id') ->leftJoin('unitFunctions', 'users.functionID', '=', 'unitFunctions.id') - ->select('users.id','users.name', 'users.surname', 'users.PESEL','users.phoneNumber', 'users.email', 'ranks.rank', 'unitFunctions.unitFunction', 'users.number') + ->select('users.id','users.name', 'users.surname', 'users.PESEL','users.phoneNumber', 'users.email', 'ranks.rank', 'unitFunctions.unitFunction', 'users.number', 'users.secondName', 'users.fathersName', 'users.mothersName', 'users.address', 'users.apartment', 'users.placeOfBirth', 'users.driversLicense', 'users.joiningOSPDate', 'users.IDSeries', 'users.IDNumber', 'users.IDValidUntil', 'users.identityCardNumber', 'users.homePhoneNumber', 'users.education', 'users.profession',) ->first(); return view("userProfile", ["userData" => $userData]); } else{ @@ -44,6 +44,19 @@ class userProfileController extends Controller 'PESEL' => new Pesel, 'phoneNumber' => 'required|digits:9', 'email' => 'required|email|unique:users,email,'.auth()->user()->id, //wymagaj unikalnego adresu email ale pozwól na zachowanie starego adresu + 'secondName' => 'max:45', + 'fathersName' => 'max:45', + 'mothersName' => 'max:45', + 'homePhoneNumber' => 'max:20', + 'address' => 'max:45', + 'apartment'=> 'max:45', + 'placeOfBirth'=> 'max:45', + 'IDSeries'=> 'max:3', + 'IDNumber'=> 'max:6', + 'identityCardNumber'=> 'max:20', + 'driversLicense'=> 'max:20', + 'education'=> 'max:45', + 'profession'=> 'max:45', ], [ 'required' => ':attribute jest wymagany(e).', @@ -64,6 +77,21 @@ class userProfileController extends Controller $user-> phoneNumber = $request->phoneNumber; $user-> email = $request->email; $user-> changingID = auth()->user()-> id; + $user-> secondName = $request->secondName; + $user-> fathersName = $request->fathersName; + $user-> mothersName = $request->mothersName; + $user-> homePhoneNumber = $request->homePhoneNumber; + $user-> address = $request->address; + $user-> apartment = $request->apartment; + $user-> placeOfBirth = $request->placeOfBirth; + $user-> joiningOSPDate = $request->joiningOSPDate; + $user-> IDSeries = $request->IDSeries; + $user-> IDNumber = $request->IDNumber; + $user-> IDValidUntil = $request->IDValidUntil; + $user-> identityCardNumber = $request->identityCardNumber; + $user-> driversLicense= $request->driversLicense; + $user-> education = $request->education; + $user-> profession = $request->profession; $user->save(); return redirect()->to('/userprofile');; diff --git a/database/migrations/2020_07_19_203706_add_additional_data_about_firefighters.php b/database/migrations/2020_07_19_203706_add_additional_data_about_firefighters.php new file mode 100644 index 0000000..bb8da60 --- /dev/null +++ b/database/migrations/2020_07_19_203706_add_additional_data_about_firefighters.php @@ -0,0 +1,47 @@ +string('secondName', 45)->nullable()->default(null); + $table->string('fathersName', 45)->nullable()->default(null); + $table->string('mothersName', 45)->nullable()->default(null); + $table->string('address', 45)->nullable()->default(null); + $table->string('apartment', 45)->nullable()->default(null); //nr domu + $table->string('placeOfBirth', 45)->nullable()->default(null); + $table->string('driversLicense', 20)->nullable()->default(null); + $table->date('joiningOSPDate', 20)->nullable()->default(null); + $table->string('IDSeries', 3)->nullable()->default(null); + $table->string('IDNumber', 6)->nullable()->default(null); //nr dowodu osobistego + $table->date('IDValidUntil', 20)->nullable()->default(null); + $table->string('identityCardNumber', 20)->nullable()->default(null); //nr legitymacji strażackiej + $table->string('homePhoneNumber', 20)->nullable()->default(null); + $table->string('education', 45)->nullable()->default(null); + $table->string('profession', 45)->nullable()->default(null); + + + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +} diff --git a/resources/views/documents.blade.php b/resources/views/documents.blade.php index 7898c8c..2e7dce6 100644 --- a/resources/views/documents.blade.php +++ b/resources/views/documents.blade.php @@ -1,13 +1,7 @@ @extends('layout.app') @section('left-menu') - @parent - @stop @section('center-area') diff --git a/resources/views/userProfile.blade.php b/resources/views/userProfile.blade.php index 6e17770..5c1aa6d 100644 --- a/resources/views/userProfile.blade.php +++ b/resources/views/userProfile.blade.php @@ -29,22 +29,18 @@ Imię i nazwisko: {{ $userData->name }} {{ $userData->surname }} + + Drugie imię: + {{ $userData->secondName}} + + + Imię ojca i matki: + {{ $userData->fathersName}} {{ $userData->mothersName}} + PESEL: {{ $userData->PESEL}} - - Nr telefonu: - {{ $userData->phoneNumber}} - - - Adres e-mail: - {{ $userData->email}} - - {{-- --}} - {{-- Numer ewidencyjny: --}} - {{-- {{ $userData->number}} --}} - {{-- --}} Stopień: {{ $userData->rank}} @@ -53,6 +49,62 @@ Funkcja: {{ $userData->unitFunction}} + + Nr telefonu komórkowego: + {{ $userData->phoneNumber}} + + + Telefon domowy: + {{ $userData->homePhoneNumber}} + + + Adres e-mail: + {{ $userData->email}} + + + Adres zamieszkania: + {{ $userData->address}} + + + Numer domu: + {{ $userData->apartment}} + + {{-- --}} + {{-- Numer ewidencyjny: --}} + {{-- {{ $userData->number}} --}} + {{-- --}} + + Miejsce urodzenia: + {{ $userData->placeOfBirth}} + + + Data wstąpienia do OSP: + {{ $userData->joiningOSPDate}} + + + Seria i numer dowodu osobistego: + {{ $userData->IDSeries}} {{ $userData->IDNumber}} + + + Dowód osobisty ważny do: + {{ $userData->IDValidUntil}} + + + Numer legitymacji członkowskiej: + {{ $userData->identityCardNumber}} + + + Prawo jazdy (kategorie): + {{ $userData->driversLicense}} + + + Wykształcenie: + {{ $userData->education}} + + + Zawód wyuczony: + {{ $userData->profession}} +

@else diff --git a/resources/views/userProfileEdit.blade.php b/resources/views/userProfileEdit.blade.php index 24c8290..b1dc243 100644 --- a/resources/views/userProfileEdit.blade.php +++ b/resources/views/userProfileEdit.blade.php @@ -26,20 +26,96 @@ +
+ + +
+ +
+ + +
+ +
+ + +
+
- +
+ +
+ + +
+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+