Uzupełnienie reszty pól przy Karcie ewidencji oraz nadaniu użytkownika

This commit is contained in:
s421507 2020-07-20 18:07:27 +02:00
parent 5615842349
commit 8b0f642601
6 changed files with 99 additions and 13 deletions

View File

@ -3,8 +3,11 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="adc1032e-2c5f-4e68-bc22-d140f965f9d5" name="Default Changelist" comment=""> <list default="true" id="adc1032e-2c5f-4e68-bc22-d140f965f9d5" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/documentApplicationController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/documentApplicationController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/documentCreators.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/documentCreators.php" afterDir="false" /> <change beforePath="$PROJECT_DIR$/app/Http/Controllers/documentCreators.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/documentCreators.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/documentOverlayController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/documentOverlayController.php" afterDir="false" /> <change beforePath="$PROJECT_DIR$/app/Http/Controllers/documentOverlayController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/documentOverlayController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/fireFightersController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/fireFightersController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/userProfileController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/userProfileController.php" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -165,7 +168,7 @@
<property name="WebServerToolWindowFactoryState" value="false" /> <property name="WebServerToolWindowFactoryState" value="false" />
<property name="js.buildTools.grunt.grunt-cli.package" value="" /> <property name="js.buildTools.grunt.grunt-cli.package" value="" />
<property name="js.buildTools.gulp.gulp_package_dir" value="" /> <property name="js.buildTools.gulp.gulp_package_dir" value="" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/app/Common" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/database/migrations/a" />
<property name="nodejs.jest.jest_package" value="" /> <property name="nodejs.jest.jest_package" value="" />
<property name="nodejs.mocha.mocha_node_package_dir" value="" /> <property name="nodejs.mocha.mocha_node_package_dir" value="" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" /> <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
@ -180,11 +183,11 @@
<recent name="$PROJECT_DIR$/database/migrations" /> <recent name="$PROJECT_DIR$/database/migrations" />
</key> </key>
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="C:\Users\czup\PhpstormProjects\eOSP2\database\migrations\a" />
<recent name="C:\Users\czup\PhpstormProjects\eOSP2\app\Common" /> <recent name="C:\Users\czup\PhpstormProjects\eOSP2\app\Common" />
<recent name="C:\Users\czup\PhpstormProjects\eOSP2\public\img\left_menu_icon" /> <recent name="C:\Users\czup\PhpstormProjects\eOSP2\public\img\left_menu_icon" />
<recent name="C:\Users\czup\PhpstormProjects\eOSP2\app\Http\Controllers" /> <recent name="C:\Users\czup\PhpstormProjects\eOSP2\app\Http\Controllers" />
<recent name="C:\Users\czup\PhpstormProjects\eOSP2" /> <recent name="C:\Users\czup\PhpstormProjects\eOSP2" />
<recent name="C:\Users\czup\PhpstormProjects\eOSP2\vendor" />
</key> </key>
</component> </component>
<component name="RunManager"> <component name="RunManager">
@ -263,7 +266,7 @@
<workItem from="1592276510207" duration="28000" /> <workItem from="1592276510207" duration="28000" />
<workItem from="1592478779386" duration="40397000" /> <workItem from="1592478779386" duration="40397000" />
<workItem from="1593829053562" duration="35796000" /> <workItem from="1593829053562" duration="35796000" />
<workItem from="1595090372365" duration="10211000" /> <workItem from="1595090372365" duration="28007000" />
</task> </task>
<servers /> <servers />
</component> </component>

View File

@ -41,7 +41,7 @@ class documentApplicationController extends Controller
$userData = DB::table('users')->where("users.id", '=', $request->fireFighterID) $userData = DB::table('users')->where("users.id", '=', $request->fireFighterID)
->leftJoin('ranks', 'users.degreeID', '=', 'ranks.id') ->leftJoin('ranks', 'users.degreeID', '=', 'ranks.id')
->leftJoin('unitFunctions', 'users.functionID', '=', 'unitFunctions.id') ->leftJoin('unitFunctions', 'users.functionID', '=', 'unitFunctions.id')
->select('users.id','users.name', 'users.surname', 'users.PESEL', 'users.fireStationID','users.phoneNumber', 'users.email', 'ranks.rank', 'unitFunctions.unitFunction', 'users.number') ->select('users.id','users.name', 'users.surname', 'users.PESEL', 'users.fireStationID','users.phoneNumber', 'users.email', 'ranks.rank', 'unitFunctions.unitFunction', 'users.number', 'users.fathersName', 'users.apartment', 'users.address')
->first(); ->first();
$awardedDecorations = DB::table('decorationsFirefighters')->where("decorationsFirefighters.firefighterID", '=', $request->fireFighterID) $awardedDecorations = DB::table('decorationsFirefighters')->where("decorationsFirefighters.firefighterID", '=', $request->fireFighterID)
@ -65,7 +65,7 @@ class documentApplicationController extends Controller
$userData = DB::table('users')->where("users.id", '=', $request->fireFighterID) $userData = DB::table('users')->where("users.id", '=', $request->fireFighterID)
->leftJoin('ranks', 'users.degreeID', '=', 'ranks.id') ->leftJoin('ranks', 'users.degreeID', '=', 'ranks.id')
->leftJoin('unitFunctions', 'users.functionID', '=', 'unitFunctions.id') ->leftJoin('unitFunctions', 'users.functionID', '=', 'unitFunctions.id')
->select('users.id','users.name', 'users.surname', 'users.PESEL', 'users.fireStationID','users.phoneNumber', 'users.email', 'ranks.rank', 'unitFunctions.unitFunction', 'users.number') ->select('users.id','users.name', 'users.surname', 'users.PESEL', 'users.fireStationID','users.phoneNumber', 'users.email', 'ranks.rank', 'unitFunctions.unitFunction', 'users.number', 'users.secondName', 'users.fathersName', 'users.mothersName', 'users.placeOfBirth', 'users.joiningOSPDate', 'users.driversLicense', 'users.address', 'users.apartment', 'users.homePhoneNumber', 'users.identityCardNumber', 'users.education', 'users.profession', 'users.IDSeries', 'users.IDNumber', 'users.IDValidUntil')
->first(); ->first();
$userTrainings = DB::table('trainingsFirefighters')->where("trainingsFirefighters.firefighterID", '=', $request->fireFighterID) $userTrainings = DB::table('trainingsFirefighters')->where("trainingsFirefighters.firefighterID", '=', $request->fireFighterID)

View File

@ -143,7 +143,7 @@ class documentCreators extends Controller
} }
$pdf->Ln(); $pdf->Ln();
ob_end_clean();
// $this->setWatermark($pdf); // $this->setWatermark($pdf);
$pdf->Ln(); $pdf->Ln();
$pdf->Output(); $pdf->Output();

View File

@ -56,16 +56,27 @@ class documentOverlayController extends Controller
//$pdf->Write(0, $decoration); //$pdf->Write(0, $decoration);
$pdf->Cell(20,10, Helpers::textConvert($userData->name), 0, 0, 'C'); $pdf->Cell(20,10, Helpers::textConvert($userData->name), 0, 0, 'C');
#Nazwisko #Nazwisko
$pdf->SetXY(95, 74); $pdf->SetXY(95, 74);
//$pdf->Write(0, $decoration); //$pdf->Write(0, $decoration);
$pdf->Cell(20,10, Helpers::textConvert($userData->surname), 0, 0, 'C'); $pdf->Cell(20,10, Helpers::textConvert($userData->surname), 0, 0, 'C');
#Imie Ojca
$pdf->SetXY(153.5, 74);
//$pdf->Write(0, $decoration);
$pdf->Cell(20,10, Helpers::textConvert($userData->fathersName), 0, 0, 'C');
#Data Urodzenia #Data Urodzenia
$pdf->SetXY(35, 93); $pdf->SetXY(35, 93);
//$pdf->Write(0, $decoration); //$pdf->Write(0, $decoration);
$pdf->Cell(20,10, Helpers::textConvert(Helpers::peselBirthdayDate($userData->PESEL)), 0, 0, 'C'); $pdf->Cell(20,10, Helpers::textConvert(Helpers::peselBirthdayDate($userData->PESEL)), 0, 0, 'C');
#Data Urodzenia
$pdf->SetXY(124, 93);
//$pdf->Write(0, $decoration);
$pdf->Cell(20,10, Helpers::textConvert($userData->address.' '.$userData->apartment), 0, 0, 'C');
#Funkcja #Funkcja
$pdf->SetXY(124, 113); $pdf->SetXY(124, 113);
@ -120,9 +131,21 @@ class documentOverlayController extends Controller
$pdf->SetTextColor(128, 128, 128); $pdf->SetTextColor(128, 128, 128);
# Imie i nazwisko # Imie i nazwisko
$pdf->SetXY(84, 31.5); $pdf->SetXY(85.5, 31.5);
$pdf->Cell(0, 10, Helpers::textConvert($userData->surname . ' ' . $userData->name), 0, 0, 'l'); $pdf->Cell(0, 10, Helpers::textConvert($userData->surname . ' ' . $userData->name), 0, 0, 'l');
# Drugie Imie
$pdf->SetXY(85.5, 39.0);
$pdf->Cell(0, 10, Helpers::textConvert($userData->secondName), 0, 0, 'l');
# Imie Ojca
$pdf->SetXY(85.5, 46.5);
$pdf->Cell(0, 10, Helpers::textConvert($userData->fathersName), 0, 0, 'l');
# Imie Mama
$pdf->SetXY(137.5, 46.5);
$pdf->Cell(0, 10, Helpers::textConvert($userData->mothersName), 0, 0, 'l');
# PESEL # PESEL
$peselArray = str_split($userData->PESEL); $peselArray = str_split($userData->PESEL);
$x = 116; $x = 116;
@ -133,7 +156,7 @@ class documentOverlayController extends Controller
} }
# Numer Telefonu # Numer Telefonu
$pdf->SetXY(102, 103); $pdf->SetXY(102, 102.5);
$pdf->Cell(0, 10, $userData->phoneNumber, 0, 0, 'l'); $pdf->Cell(0, 10, $userData->phoneNumber, 0, 0, 'l');
# Data urodzenia # Data urodzenia
@ -148,6 +171,66 @@ class documentOverlayController extends Controller
$pdf->SetXY(37.5, 62.5); $pdf->SetXY(37.5, 62.5);
$pdf->Cell(0, 10, $birthdayArray[2], 0, 0, 'l'); $pdf->Cell(0, 10, $birthdayArray[2], 0, 0, 'l');
# Miejsce Urodzenia
$pdf->SetXY(54, 62.5);
$pdf->Cell(0, 10, Helpers::textConvert($userData->placeOfBirth), 0, 0, 'l');
# Data wstąpienia do OSP
$pdf->SetXY(16, 84.5);
$pdf->Cell(0, 10, Helpers::textConvert($userData->joiningOSPDate), 0, 0, 'l');
# Kategorie prawa jazdy
$pdf->SetXY(55, 84.5);
$pdf->Cell(0, 10, Helpers::textConvert($userData->driversLicense), 0, 0, 'l');
# Adres zamieszkania
$pdf->SetXY(48, 95.5);
$pdf->Cell(0, 10, Helpers::textConvert($userData->address), 0, 0, 'l');
# Numer mieszkania
$pdf->SetXY(136, 95.5);
$pdf->Cell(0, 10, Helpers::textConvert($userData->apartment), 0, 0, 'l');
# Numer telefonu
$pdf->SetXY(37, 102.5);
$pdf->Cell(0, 10, Helpers::textConvert($userData->homePhoneNumber), 0, 0, 'l');
# Numer identyfikacji członskowkiej
$pdf->SetXY(158, 102.5);
$pdf->Cell(0, 10, Helpers::textConvert($userData->identityCardNumber), 0, 0, 'l');
# Wykształcenie
$pdf->SetXY(39, 112.5);
$pdf->Cell(0, 10, Helpers::textConvert($userData->education), 0, 0, 'l');
# Zawód wyuczony
$pdf->SetXY(123, 112.5);
$pdf->Cell(0, 10, Helpers::textConvert($userData->profession), 0, 0, 'l');
# Seria i numer dowodu osobistego oraz data
$seria_x = 96.3;
$seria = $userData->IDSeries;
for ($i=0; $i<3; $i++) {
$pdf->SetXY($seria_x, 81.3);
$pdf->Cell(0, 10, Helpers::textConvert($seria[$i]), 0, 0, 'l');
$seria_x = $seria_x + 6.65;
}
$numer_x = 123.4;
$numer = $userData->IDNumber;
for ($i=0; $i<6; $i++) {
$pdf->SetXY($numer_x, 81.3);
$pdf->Cell(0, 10, Helpers::textConvert($numer[$i]), 0, 0, 'l');
$numer_x = $numer_x + 6.65;
}
$pdf->SetXY(169.8, 81.3);
$pdf->Cell(0, 10, Helpers::textConvert($userData->IDValidUntil), 0, 0, 'l');
$y = 182; $y = 182;
$lp = 1; $lp = 1;
foreach($userTrainings as $userTraining){ foreach($userTrainings as $userTraining){

View File

@ -49,11 +49,11 @@ class fireFightersController extends Controller
$fireStationCreatorId = DB::table('fireStations')->where("id", $userFireStation)->value('creatorID'); $fireStationCreatorId = DB::table('fireStations')->where("id", $userFireStation)->value('creatorID');
$fireFighter = DB::table('users')->where("id", $id)->first(); $fireFighter = DB::table('users')->where("id", $id)->first();
if($userFireStation == $fireFighterFireStation && auth()->user()->id == $fireStationCreatorId) { // if do usunięcia w pzyszłości // if($userFireStation == $fireFighterFireStation && auth()->user()->id == $fireStationCreatorId) { // if do usunięcia w pzyszłości
return view('fireFightersEdit', ["fireFighter" => $fireFighter]); return view('fireFightersEdit', ["fireFighter" => $fireFighter]);
} else{ // } else{
return "Brak dostepu"; // return "Brak dostepu";
} // }
}else{ }else{
return redirect()->to('/strazacy'); return redirect()->to('/strazacy');
} }

View File

@ -14,7 +14,7 @@ class userProfileController extends Controller
$userData = DB::table('users')->where("users.id", '=', auth()->user()->id) $userData = DB::table('users')->where("users.id", '=', auth()->user()->id)
->leftJoin('ranks', 'users.degreeID', '=', 'ranks.id') ->leftJoin('ranks', 'users.degreeID', '=', 'ranks.id')
->leftJoin('unitFunctions', 'users.functionID', '=', 'unitFunctions.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', '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',) ->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(); ->first();
return view("userProfile", ["userData" => $userData]); return view("userProfile", ["userData" => $userData]);
} else{ } else{