Compare commits
No commits in common. "master" and "master" have entirely different histories.
2
.idea/.gitignore
vendored
2
.idea/.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
# Datasource local storage ignored files
|
||||
/dataSources.local.xml
|
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||
<data-source source="LOCAL" name="MySQL - homestead@127.0.0.1" uuid="c1b0f5b5-72cf-4997-ad36-886071681a36">
|
||||
<driver-ref>mysql.8</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
|
||||
<jdbc-url>jdbc:mysql://127.0.0.1:3306/homestead</jdbc-url>
|
||||
</data-source>
|
||||
</component>
|
||||
</project>
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
@ -2,7 +2,7 @@
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/eOSP3.iml" filepath="$PROJECT_DIR$/.idea/eOSP3.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/../eOSP/.idea/eOSP.iml" filepath="$PROJECT_DIR$/../eOSP/.idea/eOSP.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -97,19 +97,12 @@
|
||||
<path value="$PROJECT_DIR$/vendor/jakub-onderka/php-console-color" />
|
||||
<path value="$PROJECT_DIR$/vendor/nikic/php-parser" />
|
||||
<path value="$PROJECT_DIR$/vendor/vlucas/phpdotenv" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/error-handler" />
|
||||
<path value="$PROJECT_DIR$/vendor/nexmo/client-core" />
|
||||
<path value="$PROJECT_DIR$/vendor/codedge/laravel-fpdf" />
|
||||
<path value="$PROJECT_DIR$/vendor/twbs/bootstrap" />
|
||||
<path value="$PROJECT_DIR$/vendor/setasign/fpdf" />
|
||||
<path value="$PROJECT_DIR$/vendor/setasign/fpdi" />
|
||||
<path value="$PROJECT_DIR$/vendor/setasign/fpdi-fpdf" />
|
||||
</include_path>
|
||||
</component>
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="7.1" />
|
||||
<component name="PhpUnit">
|
||||
<phpunit_settings>
|
||||
<PhpUnitSettings custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" />
|
||||
<PhpUnitSettings load_method="CUSTOM_LOADER" custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" />
|
||||
</phpunit_settings>
|
||||
</component>
|
||||
</project>
|
@ -2,6 +2,5 @@
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/eOSP2" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -1,12 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="cbf98ec0-77c0-422b-85b4-f0d9dbb3b1d9" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/modules.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/vcs.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/views/login.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/login.blade.php" afterDir="false" />
|
||||
</list>
|
||||
<list default="true" id="adc1032e-2c5f-4e68-bc22-d140f965f9d5" name="Default Changelist" comment="" />
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
@ -18,9 +14,19 @@
|
||||
<executable />
|
||||
</execution>
|
||||
</component>
|
||||
<component name="FileEditorManager">
|
||||
<leaf />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/test.php" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="PhpWorkspaceProjectConfiguration">
|
||||
<include_path>
|
||||
<path value="$PROJECT_DIR$/vendor/monolog/monolog" />
|
||||
@ -118,42 +124,103 @@
|
||||
<path value="$PROJECT_DIR$/vendor/jakub-onderka/php-console-color" />
|
||||
<path value="$PROJECT_DIR$/vendor/nikic/php-parser" />
|
||||
<path value="$PROJECT_DIR$/vendor/vlucas/phpdotenv" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/error-handler" />
|
||||
<path value="$PROJECT_DIR$/vendor/nexmo/client-core" />
|
||||
<path value="$PROJECT_DIR$/vendor/codedge/laravel-fpdf" />
|
||||
<path value="$PROJECT_DIR$/vendor/twbs/bootstrap" />
|
||||
<path value="$PROJECT_DIR$/vendor/setasign/fpdf" />
|
||||
<path value="$PROJECT_DIR$/vendor/setasign/fpdi" />
|
||||
<path value="$PROJECT_DIR$/vendor/setasign/fpdi-fpdf" />
|
||||
</include_path>
|
||||
</component>
|
||||
<component name="ProjectId" id="1fYGfYgzMx5ivxG1B92kGmdiogy" />
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showExcludedFiles" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
<component name="ProjectFrameBounds" extendedState="6">
|
||||
<option name="x" value="293" />
|
||||
<option name="y" value="53" />
|
||||
<option name="width" value="1400" />
|
||||
<option name="height" value="1000" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator proportions="" version="1">
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="Scope" />
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<expand>
|
||||
<path>
|
||||
<item name="eOSP" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="eOSP" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="eOSP" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="External Libraries" type="bcb0276e:PhpExternalLibrariesNodePatcher$PatchedExternalLibrariesNode" />
|
||||
</path>
|
||||
</expand>
|
||||
<select />
|
||||
</subPane>
|
||||
</pane>
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
||||
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
|
||||
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
|
||||
<property name="nodejs_package_manager_path" value="npm" />
|
||||
</component>
|
||||
<component name="RunDashboard">
|
||||
<option name="ruleStates">
|
||||
<list>
|
||||
<RuleState>
|
||||
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
|
||||
</RuleState>
|
||||
<RuleState>
|
||||
<option name="name" value="StatusDashboardGroupingRule" />
|
||||
</RuleState>
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="SvnConfiguration">
|
||||
<configuration />
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="cbf98ec0-77c0-422b-85b4-f0d9dbb3b1d9" name="Default Changelist" comment="" />
|
||||
<created>1596387716447</created>
|
||||
<changelist id="adc1032e-2c5f-4e68-bc22-d140f965f9d5" name="Default Changelist" comment="" />
|
||||
<created>1562880822430</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1596387716447</updated>
|
||||
<workItem from="1596387717887" duration="59000" />
|
||||
<workItem from="1596388128573" duration="74000" />
|
||||
<updated>1562880822430</updated>
|
||||
<workItem from="1562880823859" duration="7000" />
|
||||
<workItem from="1562880905757" duration="737000" />
|
||||
<workItem from="1562881688607" duration="256000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TimeTrackingManager">
|
||||
<option name="totallyTimeSpent" value="1000000" />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="67" y="25" width="1853" height="1055" extended-state="6" />
|
||||
<layout>
|
||||
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.255119" />
|
||||
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
|
||||
<window_info id="Favorites" order="2" side_tool="true" />
|
||||
<window_info anchor="bottom" id="Message" order="0" />
|
||||
<window_info anchor="bottom" id="Find" order="1" />
|
||||
<window_info anchor="bottom" id="Run" order="2" />
|
||||
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
|
||||
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
|
||||
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
|
||||
<window_info anchor="bottom" id="TODO" order="6" />
|
||||
<window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
|
||||
<window_info anchor="bottom" id="Database Changes" order="8" />
|
||||
<window_info anchor="bottom" id="Version Control" order="9" weight="0.32937366" />
|
||||
<window_info active="true" anchor="bottom" id="Terminal" order="10" visible="true" weight="0.32937366" />
|
||||
<window_info anchor="bottom" id="Event Log" order="11" side_tool="true" />
|
||||
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
|
||||
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
|
||||
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
|
||||
<window_info anchor="right" id="Database" order="3" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="1" />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/test.php" />
|
||||
</component>
|
||||
</project>
|
@ -1,66 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Common;
|
||||
|
||||
class Helpers
|
||||
{
|
||||
public static function peselBirthdayDate($pesel){
|
||||
$pesel = (String) $pesel;
|
||||
$output = $pesel[2];
|
||||
$output = (int)$output;
|
||||
if( $output == 0 || $output == 1){
|
||||
$year = '19'."".(String)$pesel[0]."".(String)$pesel[1];
|
||||
}elseif( $output == 2 || $output == 3){
|
||||
$year = '20'."".(String)$pesel[0]."".(String)$pesel[1];
|
||||
}elseif( $output == 4 || $output == 5){
|
||||
$year = '21'."".(String)$pesel[0]."".(String)$pesel[1];
|
||||
}elseif( $output == 6 || $output == 7){
|
||||
$year = '22'."".(String)$pesel[0]."".(String)$pesel[1];
|
||||
}elseif( $output == 8 || $output == 9){
|
||||
$year = '18'."".(String)$pesel[0]."".(String)$pesel[1];
|
||||
}
|
||||
|
||||
if($output % 2 == 0 ){
|
||||
$month = '0'."".(String)$pesel[3];
|
||||
}else{
|
||||
$month = '1'."".(String)$pesel[3];
|
||||
}
|
||||
|
||||
$day = (String)$pesel[4]."".(String)$pesel[5];
|
||||
|
||||
return $day.".".$month.".".$year;
|
||||
}
|
||||
|
||||
public static function peselBirthdayDateARRAY($pesel){
|
||||
$pesel = (String) $pesel;
|
||||
$output = $pesel[2];
|
||||
$output = (int)$output;
|
||||
if( $output == 0 || $output == 1){
|
||||
$year = '19'."".(String)$pesel[0]."".(String)$pesel[1];
|
||||
}elseif( $output == 2 || $output == 3){
|
||||
$year = '20'."".(String)$pesel[0]."".(String)$pesel[1];
|
||||
}elseif( $output == 4 || $output == 5){
|
||||
$year = '21'."".(String)$pesel[0]."".(String)$pesel[1];
|
||||
}elseif( $output == 6 || $output == 7){
|
||||
$year = '22'."".(String)$pesel[0]."".(String)$pesel[1];
|
||||
}elseif( $output == 8 || $output == 9){
|
||||
$year = '18'."".(String)$pesel[0]."".(String)$pesel[1];
|
||||
}
|
||||
|
||||
if($output % 2 == 0 ){
|
||||
$month = '0'."".(String)$pesel[3];
|
||||
}else{
|
||||
$month = '1'."".(String)$pesel[3];
|
||||
}
|
||||
|
||||
$day = (String)$pesel[4]."".(String)$pesel[5];
|
||||
|
||||
return array($day, $month, $year);
|
||||
}
|
||||
|
||||
public static function textConvert($text){
|
||||
return iconv('utf-8','iso-8859-2',$text);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,132 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Common;
|
||||
|
||||
|
||||
class PDF extends FPDF
|
||||
{
|
||||
function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false, $maxline=0){
|
||||
//Output text with automatic or explicit line breaks, at most $maxline lines
|
||||
$cw=&$this->CurrentFont['cw'];
|
||||
if($w==0)
|
||||
$w=$this->w-$this->rMargin-$this->x;
|
||||
$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
|
||||
$s=str_replace("\r",'',$txt);
|
||||
$nb=strlen($s);
|
||||
if($nb>0 && $s[$nb-1]=="\n")
|
||||
$nb--;
|
||||
$b=0;
|
||||
if($border)
|
||||
{
|
||||
if($border==1)
|
||||
{
|
||||
$border='LTRB';
|
||||
$b='LRT';
|
||||
$b2='LR';
|
||||
}
|
||||
else
|
||||
{
|
||||
$b2='';
|
||||
if(is_int(strpos($border,'L')))
|
||||
$b2.='L';
|
||||
if(is_int(strpos($border,'R')))
|
||||
$b2.='R';
|
||||
$b=is_int(strpos($border,'T')) ? $b2.'T' : $b2;
|
||||
}
|
||||
}
|
||||
$sep=-1;
|
||||
$i=0;
|
||||
$j=0;
|
||||
$l=0;
|
||||
$ns=0;
|
||||
$nl=1;
|
||||
while($i<$nb)
|
||||
{
|
||||
//Get next character
|
||||
$c=$s[$i];
|
||||
if($c=="\n")
|
||||
{
|
||||
//Explicit line break
|
||||
if($this->ws>0)
|
||||
{
|
||||
$this->ws=0;
|
||||
$this->_out('0 Tw');
|
||||
}
|
||||
$this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
|
||||
$i++;
|
||||
$sep=-1;
|
||||
$j=$i;
|
||||
$l=0;
|
||||
$ns=0;
|
||||
$nl++;
|
||||
if($border && $nl==2)
|
||||
$b=$b2;
|
||||
if($maxline && $nl>$maxline)
|
||||
return substr($s,$i);
|
||||
continue;
|
||||
}
|
||||
if($c==' ')
|
||||
{
|
||||
$sep=$i;
|
||||
$ls=$l;
|
||||
$ns++;
|
||||
}
|
||||
$l+=$cw[$c];
|
||||
if($l>$wmax)
|
||||
{
|
||||
//Automatic line break
|
||||
if($sep==-1)
|
||||
{
|
||||
if($i==$j)
|
||||
$i++;
|
||||
if($this->ws>0)
|
||||
{
|
||||
$this->ws=0;
|
||||
$this->_out('0 Tw');
|
||||
}
|
||||
$this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
|
||||
}
|
||||
else
|
||||
{
|
||||
if($align=='J')
|
||||
{
|
||||
$this->ws=($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0;
|
||||
$this->_out(sprintf('%.3F Tw',$this->ws*$this->k));
|
||||
}
|
||||
$this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill);
|
||||
$i=$sep+1;
|
||||
}
|
||||
$sep=-1;
|
||||
$j=$i;
|
||||
$l=0;
|
||||
$ns=0;
|
||||
$nl++;
|
||||
if($border && $nl==2)
|
||||
$b=$b2;
|
||||
if($maxline && $nl>$maxline)
|
||||
{
|
||||
if($this->ws>0)
|
||||
{
|
||||
$this->ws=0;
|
||||
$this->_out('0 Tw');
|
||||
}
|
||||
return substr($s,$i);
|
||||
}
|
||||
}
|
||||
else
|
||||
$i++;
|
||||
}
|
||||
//Last chunk
|
||||
if($this->ws>0)
|
||||
{
|
||||
$this->ws=0;
|
||||
$this->_out('0 Tw');
|
||||
}
|
||||
if($border && is_int(strpos($border,'B')))
|
||||
$b.='B';
|
||||
$this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
|
||||
$this->x=$this->lMargin;
|
||||
return '';
|
||||
}
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
<?php
|
||||
$type='Type1';
|
||||
$name='ArialMT';
|
||||
$desc=array('Ascent'=>905,'Descent'=>-212,'CapHeight'=>716,'Flags'=>32,'FontBBox'=>'[-46 -283 979 896]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>750);
|
||||
$up=-106;
|
||||
$ut=73;
|
||||
$cw=array(
|
||||
chr(0)=>750,chr(1)=>750,chr(2)=>750,chr(3)=>750,chr(4)=>750,chr(5)=>750,chr(6)=>750,chr(7)=>750,chr(8)=>750,chr(9)=>750,chr(10)=>750,chr(11)=>750,chr(12)=>750,chr(13)=>750,chr(14)=>750,chr(15)=>750,chr(16)=>750,chr(17)=>750,chr(18)=>750,chr(19)=>750,chr(20)=>750,chr(21)=>750,
|
||||
chr(22)=>750,chr(23)=>750,chr(24)=>750,chr(25)=>750,chr(26)=>750,chr(27)=>750,chr(28)=>750,chr(29)=>750,chr(30)=>750,chr(31)=>750,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
|
||||
','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
|
||||
'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
|
||||
'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
|
||||
'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>750,chr(128)=>750,chr(129)=>750,chr(130)=>750,chr(131)=>750,
|
||||
chr(132)=>750,chr(133)=>750,chr(134)=>750,chr(135)=>750,chr(136)=>750,chr(137)=>750,chr(138)=>750,chr(139)=>750,chr(140)=>750,chr(141)=>750,chr(142)=>750,chr(143)=>750,chr(144)=>750,chr(145)=>750,chr(146)=>750,chr(147)=>750,chr(148)=>750,chr(149)=>750,chr(150)=>750,chr(151)=>750,chr(152)=>750,chr(153)=>750,
|
||||
chr(154)=>750,chr(155)=>750,chr(156)=>750,chr(157)=>750,chr(158)=>750,chr(159)=>750,chr(160)=>278,chr(161)=>667,chr(162)=>333,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>667,chr(167)=>556,chr(168)=>333,chr(169)=>667,chr(170)=>667,chr(171)=>611,chr(172)=>611,chr(173)=>333,chr(174)=>611,chr(175)=>611,
|
||||
chr(176)=>400,chr(177)=>556,chr(178)=>333,chr(179)=>222,chr(180)=>333,chr(181)=>292,chr(182)=>500,chr(183)=>333,chr(184)=>333,chr(185)=>500,chr(186)=>500,chr(187)=>375,chr(188)=>500,chr(189)=>333,chr(190)=>500,chr(191)=>500,chr(192)=>722,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>556,
|
||||
chr(198)=>722,chr(199)=>722,chr(200)=>722,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>667,chr(205)=>278,chr(206)=>278,chr(207)=>722,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
|
||||
chr(220)=>722,chr(221)=>667,chr(222)=>611,chr(223)=>611,chr(224)=>333,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>222,chr(230)=>500,chr(231)=>500,chr(232)=>500,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>556,chr(237)=>278,chr(238)=>278,chr(239)=>615,chr(240)=>556,chr(241)=>556,
|
||||
chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>549,chr(248)=>333,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>278,chr(255)=>333);
|
||||
$enc='iso-8859-2';
|
||||
$diff='128 /.notdef 130 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 142 /.notdef 145 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 158 /.notdef /.notdef 161 /Aogonek /breve /Lslash 165 /Lcaron /Sacute 169 /Scaron /Scedilla /Tcaron /Zacute 174 /Zcaron /Zdotaccent 177 /aogonek /ogonek /lslash 181 /lcaron /sacute /caron 185 /scaron /scedilla /tcaron /zacute /hungarumlaut /zcaron /zdotaccent /Racute 195 /Abreve 197 /Lacute /Cacute 200 /Ccaron 202 /Eogonek 204 /Ecaron 207 /Dcaron /Dcroat /Nacute /Ncaron 213 /Ohungarumlaut 216 /Rcaron /Uring 219 /Uhungarumlaut 222 /Tcommaaccent 224 /racute 227 /abreve 229 /lacute /cacute 232 /ccaron 234 /eogonek 236 /ecaron 239 /dcaron /dcroat /nacute /ncaron 245 /ohungarumlaut 248 /rcaron /uring 251 /uhungarumlaut 254 /tcommaaccent /dotaccent';
|
||||
$file='arialpl.z';
|
||||
$size1=5911;
|
||||
$size2=25241;
|
||||
?>
|
Binary file not shown.
@ -1,26 +0,0 @@
|
||||
<?php
|
||||
$type='Type1';
|
||||
$name='Arial-BoldMT';
|
||||
$desc=array('Ascent'=>905,'Descent'=>-212,'CapHeight'=>716,'Flags'=>32,'FontBBox'=>'[-46 -319 972 919]','ItalicAngle'=>0,'StemV'=>120,'MissingWidth'=>750);
|
||||
$up=-106;
|
||||
$ut=105;
|
||||
$cw=array(
|
||||
chr(0)=>750,chr(1)=>750,chr(2)=>750,chr(3)=>750,chr(4)=>750,chr(5)=>750,chr(6)=>750,chr(7)=>750,chr(8)=>750,chr(9)=>750,chr(10)=>750,chr(11)=>750,chr(12)=>750,chr(13)=>750,chr(14)=>750,chr(15)=>750,chr(16)=>750,chr(17)=>750,chr(18)=>750,chr(19)=>750,chr(20)=>750,chr(21)=>750,
|
||||
chr(22)=>750,chr(23)=>750,chr(24)=>750,chr(25)=>750,chr(26)=>750,chr(27)=>750,chr(28)=>750,chr(29)=>750,chr(30)=>750,chr(31)=>750,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
|
||||
','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
|
||||
'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
|
||||
'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
|
||||
'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>750,chr(128)=>750,chr(129)=>750,chr(130)=>750,chr(131)=>750,
|
||||
chr(132)=>750,chr(133)=>750,chr(134)=>750,chr(135)=>750,chr(136)=>750,chr(137)=>750,chr(138)=>750,chr(139)=>750,chr(140)=>750,chr(141)=>750,chr(142)=>750,chr(143)=>750,chr(144)=>750,chr(145)=>750,chr(146)=>750,chr(147)=>750,chr(148)=>750,chr(149)=>750,chr(150)=>750,chr(151)=>750,chr(152)=>750,chr(153)=>750,
|
||||
chr(154)=>750,chr(155)=>750,chr(156)=>750,chr(157)=>750,chr(158)=>750,chr(159)=>750,chr(160)=>278,chr(161)=>722,chr(162)=>333,chr(163)=>611,chr(164)=>556,chr(165)=>611,chr(166)=>667,chr(167)=>556,chr(168)=>333,chr(169)=>667,chr(170)=>667,chr(171)=>611,chr(172)=>611,chr(173)=>333,chr(174)=>611,chr(175)=>611,
|
||||
chr(176)=>400,chr(177)=>556,chr(178)=>333,chr(179)=>278,chr(180)=>333,chr(181)=>385,chr(182)=>556,chr(183)=>333,chr(184)=>333,chr(185)=>556,chr(186)=>556,chr(187)=>479,chr(188)=>500,chr(189)=>333,chr(190)=>500,chr(191)=>500,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>611,
|
||||
chr(198)=>722,chr(199)=>722,chr(200)=>722,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>667,chr(205)=>278,chr(206)=>278,chr(207)=>722,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
|
||||
chr(220)=>722,chr(221)=>667,chr(222)=>611,chr(223)=>611,chr(224)=>389,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>278,chr(230)=>556,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>556,chr(237)=>278,chr(238)=>278,chr(239)=>719,chr(240)=>611,chr(241)=>611,
|
||||
chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>549,chr(248)=>389,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>333,chr(255)=>333);
|
||||
$enc='iso-8859-2';
|
||||
$diff='128 /.notdef 130 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 142 /.notdef 145 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef 158 /.notdef /.notdef 161 /Aogonek /breve /Lslash 165 /Lcaron /Sacute 169 /Scaron /Scedilla /Tcaron /Zacute 174 /Zcaron /Zdotaccent 177 /aogonek /ogonek /lslash 181 /lcaron /sacute /caron 185 /scaron /scedilla /tcaron /zacute /hungarumlaut /zcaron /zdotaccent /Racute 195 /Abreve 197 /Lacute /Cacute 200 /Ccaron 202 /Eogonek 204 /Ecaron 207 /Dcaron /Dcroat /Nacute /Ncaron 213 /Ohungarumlaut 216 /Rcaron /Uring 219 /Uhungarumlaut 222 /Tcommaaccent 224 /racute 227 /abreve 229 /lacute /cacute 232 /ccaron 234 /eogonek 236 /ecaron 239 /dcaron /dcroat /nacute /ncaron 245 /ohungarumlaut 248 /rcaron /uring 251 /uhungarumlaut 254 /tcommaaccent /dotaccent';
|
||||
$file='arialplb.z';
|
||||
$size1=5925;
|
||||
$size2=25741;
|
||||
?>
|
||||
© 2020 GitHub, Inc.
|
Binary file not shown.
@ -1,73 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Codedge\Fpdf\Fpdf\Fpdf;
|
||||
|
||||
class AlphaPDF extends FPDF
|
||||
{
|
||||
protected $extgstates = array();
|
||||
|
||||
// alpha: real value from 0 (transparent) to 1 (opaque)
|
||||
// bm: blend mode, one of the following:
|
||||
// Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn,
|
||||
// HardLight, SoftLight, Difference, Exclusion, Hue, Saturation, Color, Luminosity
|
||||
function SetAlpha($alpha, $bm='Normal')
|
||||
{
|
||||
// set alpha for stroking (CA) and non-stroking (ca) operations
|
||||
$gs = $this->AddExtGState(array('ca'=>$alpha, 'CA'=>$alpha, 'BM'=>'/'.$bm));
|
||||
$this->SetExtGState($gs);
|
||||
}
|
||||
|
||||
function AddExtGState($parms)
|
||||
{
|
||||
$n = count($this->extgstates)+1;
|
||||
$this->extgstates[$n]['parms'] = $parms;
|
||||
return $n;
|
||||
}
|
||||
|
||||
function SetExtGState($gs)
|
||||
{
|
||||
$this->_out(sprintf('/GS%d gs', $gs));
|
||||
}
|
||||
|
||||
function _enddoc()
|
||||
{
|
||||
if(!empty($this->extgstates) && $this->PDFVersion<'1.4')
|
||||
$this->PDFVersion='1.4';
|
||||
parent::_enddoc();
|
||||
}
|
||||
|
||||
function _putextgstates()
|
||||
{
|
||||
for ($i = 1; $i <= count($this->extgstates); $i++)
|
||||
{
|
||||
$this->_newobj();
|
||||
$this->extgstates[$i]['n'] = $this->n;
|
||||
$this->_put('<</Type /ExtGState');
|
||||
$parms = $this->extgstates[$i]['parms'];
|
||||
$this->_put(sprintf('/ca %.3F', $parms['ca']));
|
||||
$this->_put(sprintf('/CA %.3F', $parms['CA']));
|
||||
$this->_put('/BM '.$parms['BM']);
|
||||
$this->_put('>>');
|
||||
$this->_put('endobj');
|
||||
}
|
||||
}
|
||||
|
||||
function _putresourcedict()
|
||||
{
|
||||
parent::_putresourcedict();
|
||||
$this->_put('/ExtGState <<');
|
||||
foreach($this->extgstates as $k=>$extgstate)
|
||||
$this->_put('/GS'.$k.' '.$extgstate['n'].' 0 R');
|
||||
$this->_put('>>');
|
||||
}
|
||||
|
||||
function _putresources()
|
||||
{
|
||||
$this->_putextgstates();
|
||||
parent::_putresources();
|
||||
}
|
||||
}
|
||||
?>
|
Binary file not shown.
Before Width: | Height: | Size: 34 KiB |
@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Rules\ComparePasswords;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use App\User;
|
||||
|
||||
class ChangePasswordController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('changePassword');
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'current_password' => new ComparePasswords,
|
||||
'password' => 'required|confirmed|min:6|different:current_password',
|
||||
],
|
||||
[
|
||||
'required' => 'Podaj nowe hasło.',
|
||||
'confirmed' => 'Nowe hasło się nie zgadza.',
|
||||
'min' => ':attribute musi mieć przynajmniej :min znaków.',
|
||||
'different' => 'Stare i nowe hasło nie mogą być identyczne.'
|
||||
]);
|
||||
|
||||
User::find(auth()->user()->id)->update(['password'=> $request-> password]);
|
||||
|
||||
return redirect()->to('/userprofile')->with('success','Hasło zostało zmienione');
|
||||
}
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\User;
|
||||
use App\decorationsFirefighters;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Carbon\Carbon; // formatowanie daty
|
||||
|
||||
function formatDate($date)
|
||||
{
|
||||
if ($date == null)
|
||||
return $date;
|
||||
else
|
||||
$fdate = Carbon::parse($date);
|
||||
return $fdate;
|
||||
}
|
||||
|
||||
class DecorationsController extends Controller
|
||||
{
|
||||
public function create($id){
|
||||
if(auth()->user() != null && auth()->user()->accessLevel() == 50 ){ //prezes,naczelnik
|
||||
$awardedDecorations = DB::table('decorationsFirefighters')->where("decorationsFirefighters.firefighterID", '=', $id)
|
||||
->whereNull('decorationsFirefighters.deleted_at')
|
||||
->leftJoin('decorations', 'decorationsFirefighters.decorationID', '=', 'decorations.id')
|
||||
->select('decorationName', 'dateOfAward', 'firefighterID', 'decorations.id AS decorationsId', 'decorationsFirefighters.id AS decorationsFirefightersID')
|
||||
->get();
|
||||
$alreadyAwarded = $awardedDecorations->pluck('decorationsId')->toArray(); // tablica id wszystkich wyróżnień już posiadanych
|
||||
$firefighter = User::find($id, ['id', 'name', 'surname']);
|
||||
$decoration = DB::table('decorations')
|
||||
->whereNotIn('id', $alreadyAwarded) //ograniczenie wyboru do wyróżnień jeszcze nie posiadanych
|
||||
->pluck('decorationName', 'id');
|
||||
|
||||
return View::make("decorations")
|
||||
->with(compact('firefighter'))
|
||||
->with(compact('awardedDecorations'))
|
||||
->with(compact('decoration'));
|
||||
|
||||
} else{
|
||||
return redirect()->to('/strazacy');
|
||||
}
|
||||
}
|
||||
|
||||
public function store()
|
||||
{
|
||||
$this->validate(request(),[
|
||||
'decoration' => 'required',
|
||||
'dateOfAward' => 'required',
|
||||
],
|
||||
[
|
||||
'required' => ':attribute jest wymagany(e).',
|
||||
]);
|
||||
|
||||
$request = request();
|
||||
$decoration = decorationsFirefighters::create([
|
||||
'firefighterID' => $request-> firefighterID,
|
||||
'decorationID' => $request-> decoration,
|
||||
'dateOfAward' => formatDate($request-> dateOfAward),
|
||||
]);
|
||||
|
||||
return back();
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
decorationsFirefighters::where('id',$id)->delete();
|
||||
|
||||
return response()->json([
|
||||
'success' => 'Record deleted successfully!'
|
||||
]);
|
||||
}
|
||||
}
|
@ -1,115 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\equipment;
|
||||
use DB;
|
||||
|
||||
class EquipmentController extends Controller
|
||||
{
|
||||
public function create(){
|
||||
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ){
|
||||
$equipment = DB::table('equipment')->where("fireStationID", '=', auth()->user()->fireStationID)
|
||||
->whereNull('deleted_at')->paginate(10);
|
||||
return view("equipment", ["equipment" => $equipment]);
|
||||
} else{
|
||||
return view('equipment');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function addForm(){
|
||||
if(auth()->user() != null && auth()->user()->accessLevel() == 50 ){ //prezes,naczelnik
|
||||
return view('equipmentAdd');
|
||||
|
||||
} else return redirect()->to('/sprzet');
|
||||
}
|
||||
|
||||
public function editForm($id)
|
||||
{
|
||||
if(auth()->user() != null && auth()->user()->accessLevel() == 50 ) //prezes,naczelnik
|
||||
{
|
||||
|
||||
$equipment = DB::table('equipment')->where("id", $id)->first();
|
||||
|
||||
return view('equipmentEdit', ["equipment" => $equipment]);
|
||||
}
|
||||
else
|
||||
return redirect()->to('/sprzet');
|
||||
|
||||
}
|
||||
|
||||
public function store(){
|
||||
$this->validate(request(), [
|
||||
|
||||
'name' => 'required|max:45',
|
||||
'amount' => 'required|numeric|digits_between:1,10',
|
||||
'parameter' => 'max:45|nullable',
|
||||
],
|
||||
[
|
||||
'required' => ':attribute jest wymagany(a).',
|
||||
'name.required' => 'nazwa jest wymagany(a).',
|
||||
'name.max' => 'nazwa musi mieć nie więcej niż :max znaków.',
|
||||
'max' => ':attribute musi mieć nie więcej niż :max znaków.',
|
||||
'numeric' => ':attribute powinna zawierać tylko cyfry.',
|
||||
'digits_between' => ':attribute jest za duży(a)'
|
||||
]);
|
||||
|
||||
|
||||
$request = request();
|
||||
$equipment = equipment::create([
|
||||
'fireStationID' => auth()->user()->fireStationID,
|
||||
'name' => $request-> name,
|
||||
'amount' => $request-> amount,
|
||||
'parameter' => $request-> parameter,
|
||||
]);
|
||||
|
||||
return redirect()->to('/sprzet');
|
||||
}
|
||||
|
||||
public function update(){
|
||||
$this->validate(request(), [
|
||||
|
||||
'name' => 'required|max:45',
|
||||
'amount' => 'required|numeric|digits_between:1,10',
|
||||
'parameter' => 'max:45|nullable',
|
||||
],
|
||||
[
|
||||
'required' => ':attribute jest wymagany(a).',
|
||||
'name.required' => 'nazwa jest wymagany(a).',
|
||||
'name.max' => 'nazwa musi mieć nie więcej niż :max znaków.',
|
||||
'max' => ':attribute musi mieć nie więcej niż :max znaków.',
|
||||
'numeric' => ':attribute powinna zawierać tylko cyfry.',
|
||||
'digits_between' => ':attribute jest za duży(a)'
|
||||
]);
|
||||
|
||||
|
||||
$request = request();
|
||||
$equipment = equipment::find( $request->equipmentID);
|
||||
$equipment-> name = $request-> name;
|
||||
$equipment-> amount = $request-> amount;
|
||||
$equipment-> parameter = $request-> parameter;
|
||||
$equipment->save();
|
||||
|
||||
return redirect()->to('/sprzet');
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
equipment::where('id',$id)->delete();
|
||||
|
||||
return response()->json([
|
||||
'success' => 'Record deleted successfully!'
|
||||
]);
|
||||
}
|
||||
|
||||
public function createAllEquipmentPDF(){
|
||||
if (auth()->user() != null && auth()->user()->fireStationID != null) {
|
||||
$request = request();
|
||||
$test = new documentCreators();
|
||||
$test->createAllEquipmentPDF($request->fireStationID);
|
||||
}
|
||||
}
|
||||
}
|
@ -8,6 +8,7 @@ use App\User;
|
||||
use Mail;
|
||||
use App\Rules\Pesel;
|
||||
|
||||
/* 'phoneNumber' => 'required|regex:/^([0-9\s\-\+\(\)]*)$/|min:9' */
|
||||
class RegistrationController extends Controller
|
||||
{
|
||||
public function create()
|
||||
@ -19,18 +20,19 @@ class RegistrationController extends Controller
|
||||
{
|
||||
$this->validate(request(), [
|
||||
|
||||
'name' => 'required|min:2|max:45|regex:/^[A-Za-zżźćńółęąśŻŹĆĄŚĘŁÓŃ\040\x27-]+$/',
|
||||
'surname' => 'required|min:2|max:45|regex:/^[A-Za-zżźćńółęąśŻŹĆĄŚĘŁÓŃ\040\x27-]+$/',
|
||||
'name' => 'required|alpha|min:3|max:45',
|
||||
'surname' => 'required|alpha|min:3|max:45',
|
||||
'PESEL' => new Pesel,
|
||||
'phoneNumber' => 'required|digits:9',
|
||||
'email' => 'required|email|unique:users',
|
||||
'password' => 'required|confirmed|min:6|max:45',
|
||||
'password' => 'required|confirmed|min:6',
|
||||
],
|
||||
[
|
||||
'required' => ':attribute jest wymagany(e).',
|
||||
'min' => ':attribute musi mieć przynajmniej :min znaki.',
|
||||
'max' => ':attribute musi mieć nie więcej niż :max znaków.',
|
||||
'regex' => ':attribute może zawierać tylko litery, spacje, myślniki i apostrofy',
|
||||
'alpha' => ':attribute może zawierać tylko litery.',
|
||||
'alpha_num' => ':attribute może zawierać tylko litery i cyfry.',
|
||||
'digits' => ':attribute musi składać się z :digits cyfr.',
|
||||
'unique' =>':attribute jest już zajęty.',
|
||||
'confirmed' =>':attribute się nie zgadza.',
|
||||
@ -55,9 +57,9 @@ class RegistrationController extends Controller
|
||||
'confirmation_code' => $confirmation_code
|
||||
]);
|
||||
|
||||
// Mail::send('emails.verify', compact('confirmation_code'), function($message) {
|
||||
// $message->to(Input::get('email'), Input::get('name'))->subject('Weryfikacja adresu e-mail');
|
||||
// });
|
||||
Mail::send('emails.verify', compact('confirmation_code'), function($message) {
|
||||
$message->to(Input::get('email'), Input::get('name'))->subject('Weryfikacja adresu e-mail');
|
||||
});
|
||||
|
||||
//Flash::message('Thanks for signing up! Please check your email.');
|
||||
|
||||
|
@ -15,14 +15,7 @@ class SessionsController extends Controller
|
||||
{
|
||||
if (auth()->attempt(request(['email', 'password'])) == false) {
|
||||
return back()->withErrors([
|
||||
'message' => 'Podany adres email lub hasło jest nieprawidłowe, proszę spróbować ponownie.'
|
||||
]);
|
||||
}
|
||||
elseif(auth()->user()->statusID == 1)
|
||||
{
|
||||
auth()->logout();
|
||||
return back()->withErrors([
|
||||
'message' => 'Twoje konto zostało zawieszone.'
|
||||
'message' => 'The email or password is incorrect, please try again'
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -1,216 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\vehicle;
|
||||
use DB;
|
||||
use Carbon\Carbon; // formatowanie daty
|
||||
|
||||
function formatDate($date)
|
||||
{
|
||||
if ($date == null)
|
||||
return $date;
|
||||
else
|
||||
$fdate = Carbon::parse($date);
|
||||
return $fdate;
|
||||
}
|
||||
|
||||
class VehiclesController extends Controller
|
||||
{
|
||||
public function create(){
|
||||
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ){
|
||||
$vehicles = DB::table('vehicles')->where("fireStationID", '=', auth()->user()->fireStationID)
|
||||
->whereNull('deleted_at')->paginate(10);
|
||||
return view("vehicles", ["vehicles" => $vehicles]);
|
||||
} else{
|
||||
return view('vehicles');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function addForm(){
|
||||
if(auth()->user() != null && auth()->user()->accessLevel() == 50 ){ //prezes,naczelnik
|
||||
return view('vehiclesAdd');
|
||||
} else return redirect()->to('/pojazdy');
|
||||
}
|
||||
|
||||
public function editForm($id)
|
||||
{
|
||||
if(auth()->user() != null && auth()->user()->accessLevel() == 50 ) //prezes,naczelnik
|
||||
{
|
||||
|
||||
$vehicle = DB::table('vehicles')->where("id", $id)->first();
|
||||
return view('vehiclesEdit', ["vehicle" => $vehicle]);
|
||||
}
|
||||
else
|
||||
redirect()->to('/pojazdy');
|
||||
}
|
||||
|
||||
public function store(){
|
||||
$this->validate(request(), [
|
||||
|
||||
'vehicleName' => 'required|max:45',
|
||||
'codename' => 'required|max:45',
|
||||
'brand' => 'max:45',
|
||||
'registrationNumber' => 'max:15',
|
||||
'productionYear' => 'digits:4|nullable',
|
||||
'driveType' => 'max:45',
|
||||
'chassisType' => 'max:45',
|
||||
'bodyProducer' => 'max:45',
|
||||
'crewNumber' => 'numeric|nullable|digits_between:1,2',
|
||||
'foamAgent' => 'numeric|nullable|digits_between:1,10',
|
||||
'enginePower' => 'numeric|nullable|digits_between:1,10',
|
||||
'mass' => 'numeric|nullable|digits_between:1,10',
|
||||
'chassisNumber' => 'max:45',
|
||||
'engineNumber' => 'max:45',
|
||||
'fuelType' => 'max:45',
|
||||
'chassisPoductionYear' => 'digits:4|nullable',
|
||||
'fireEnginePumpDescription' => 'max:250',
|
||||
],
|
||||
[
|
||||
|
||||
'name' => 'nazwa',
|
||||
'required' => ':attribute jest wymagany(e).',
|
||||
'numeric' => ':attribute może zawierać tylko cyfry.',
|
||||
'digits' => ':attribute musi składać się z :digits cyfr.',
|
||||
'max' => ':attribute musi mieć nie więcej niż :max znaków.',
|
||||
'digits_between' => ':attribute jest za duży(a)'
|
||||
|
||||
]);
|
||||
|
||||
|
||||
$request = request();
|
||||
$vehicle = vehicle::create([
|
||||
'fireStationID' => auth()->user()->fireStationID,
|
||||
'name' => $request-> vehicleName,
|
||||
'codename' => $request-> codename,
|
||||
'brand' => $request-> brand,
|
||||
'registrationNumber' => $request-> registrationNumber,
|
||||
'productionYear' => $request-> productionYear,
|
||||
'examExpirationDate' => formatDate($request-> examExpirationDate),
|
||||
'insuranceExpirationDate' => formatDate($request-> insuranceExpirationDate),
|
||||
'driveType' => $request-> driveType,
|
||||
'chassisType' => $request-> chassisType,
|
||||
'bodyProducer' => $request-> bodyProducer,
|
||||
'crewNumber' => $request-> crewNumber,
|
||||
'foamAgent' => $request-> foamAgent,
|
||||
'enginePower' => $request-> enginePower,
|
||||
'mass' => $request-> mass,
|
||||
'chassisNumber' => $request-> chassisNumber,
|
||||
'engineNumber' => $request-> engineNumber,
|
||||
'fuelType' => $request-> fuelType,
|
||||
'chassisPoductionYear' => $request-> chassisPoductionYear,
|
||||
'entryIntoServiceDate' => formatDate($request-> entryIntoServiceDate),
|
||||
'fireEnginePumpDescription' => $request-> fireEnginePumpDescription,
|
||||
'status' => $request-> status
|
||||
]);
|
||||
|
||||
return redirect()->to('/pojazdy');
|
||||
}
|
||||
|
||||
|
||||
public function update(){
|
||||
$this->validate(request(), [
|
||||
|
||||
'vehicleName' => 'required|max:45',
|
||||
'codename' => 'required|max:45',
|
||||
'brand' => 'max:45',
|
||||
'registrationNumber' => 'max:15',
|
||||
'productionYear' => 'digits:4|nullable',
|
||||
'driveType' => 'max:45',
|
||||
'chassisType' => 'max:45',
|
||||
'bodyProducer' => 'max:45',
|
||||
'crewNumber' => 'numeric|nullable|digits_between:1,2',
|
||||
'foamAgent' => 'numeric|nullable|digits_between:1,10',
|
||||
'enginePower' => 'numeric|nullable|digits_between:1,10',
|
||||
'mass' => 'numeric|nullable|digits_between:1,10',
|
||||
'chassisNumber' => 'max:45',
|
||||
'engineNumber' => 'max:45',
|
||||
'fuelType' => 'max:45',
|
||||
'chassisPoductionYear' => 'digits:4|nullable',
|
||||
'fireEnginePumpDescription' => 'max:250',
|
||||
],
|
||||
[
|
||||
|
||||
'name' => 'nazwa',
|
||||
'required' => ':attribute jest wymagany(e).',
|
||||
'numeric' => ':attribute może zawierać tylko cyfry.',
|
||||
'digits' => ':attribute musi składać się z :digits cyfr.',
|
||||
'max' => ':attribute musi mieć nie więcej niż :max znaków.',
|
||||
'digits_between' => ':attribute jest za duży(a)'
|
||||
|
||||
]);
|
||||
|
||||
|
||||
$request = request();
|
||||
$vehicle = vehicle::find( $request->vehicleID);
|
||||
$vehicle-> name = $request-> vehicleName;
|
||||
$vehicle-> codename = $request-> codename;
|
||||
$vehicle-> brand = $request-> brand;
|
||||
$vehicle-> registrationNumber = $request-> registrationNumber;
|
||||
$vehicle-> productionYear = $request-> productionYear;
|
||||
$vehicle-> examExpirationDate = formatDate($request-> examExpirationDate);
|
||||
$vehicle-> insuranceExpirationDate = formatDate($request-> insuranceExpirationDate);
|
||||
$vehicle-> driveType = $request-> driveType;
|
||||
$vehicle-> chassisType = $request-> chassisType;
|
||||
$vehicle-> bodyProducer = $request-> bodyProducer;
|
||||
$vehicle-> crewNumber = $request-> crewNumber;
|
||||
$vehicle-> foamAgent = $request-> foamAgent;
|
||||
$vehicle-> enginePower = $request-> enginePower;
|
||||
$vehicle-> mass = $request-> mass;
|
||||
$vehicle-> chassisNumber = $request-> chassisNumber;
|
||||
$vehicle-> engineNumber = $request-> engineNumber;
|
||||
$vehicle-> fuelType = $request-> fuelType;
|
||||
$vehicle-> chassisPoductionYear = $request-> chassisPoductionYear;
|
||||
$vehicle-> entryIntoServiceDate = formatDate($request-> entryIntoServiceDate);
|
||||
$vehicle-> fireEnginePumpDescription = $request-> fireEnginePumpDescription;
|
||||
$vehicle-> status = $request-> status;
|
||||
$vehicle->save();
|
||||
|
||||
return redirect()->to('/pojazdy');;
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
vehicle::where('id',$id)->delete();
|
||||
return response()->json([
|
||||
'success' => 'Record deleted successfully!'
|
||||
]);
|
||||
}
|
||||
|
||||
public function activate()
|
||||
{
|
||||
$request = request();
|
||||
$vehicle = vehicle::find( $request-> vehicleID);
|
||||
$vehicle-> status = 1;
|
||||
$vehicle->save();
|
||||
return redirect()->to('/pojazdy');
|
||||
}
|
||||
|
||||
public function deactivate()
|
||||
{
|
||||
$request = request();
|
||||
$vehicle = vehicle::find( $request-> vehicleID);
|
||||
$vehicle-> status = 0;
|
||||
$vehicle->save();
|
||||
return redirect()->to('/pojazdy');
|
||||
}
|
||||
|
||||
public function createAllVehiclesPDF(){
|
||||
if (auth()->user() != null && auth()->user()->fireStationID != null) {
|
||||
$request = request();
|
||||
$test = new documentCreators();
|
||||
$test->createAllVehiclesPDF($request->fireStationID);
|
||||
}
|
||||
}
|
||||
|
||||
public function createSingleVehiclePDF(){
|
||||
if (auth()->user() != null && auth()->user()->fireStationID != null) {
|
||||
$request = request();
|
||||
$test = new documentCreators();
|
||||
$test->createSingleVehiclePDF($request->vehicleID);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class documentApplicationController extends Controller
|
||||
{
|
||||
public function createWniosekNadanieForm(){
|
||||
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ){
|
||||
$fireFighters = DB::table('users')->where("fireStationID", "=", auth()->user()->fireStationID )->get();
|
||||
$decoration = DB::table('decorations')->pluck('decorationName', 'id');
|
||||
return view("wniosekNadanieForm")
|
||||
->with(compact('decoration'))
|
||||
->with(compact('fireFighters'));
|
||||
|
||||
} else{
|
||||
return view('home');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function createKartaEwidencyjnaForm(){
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ){
|
||||
$fireFighters = DB::table('users')->where("fireStationID", "=", auth()->user()->fireStationID )->get();
|
||||
$decoration = DB::table('decorations')->pluck('decorationName', 'id');
|
||||
return view("kartaEwidencyjnaForm")
|
||||
->with(compact('fireFighters'));
|
||||
}else{
|
||||
return view('home');
|
||||
}
|
||||
}
|
||||
|
||||
public function printWniosekNadaniePDF(){
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ) {
|
||||
$request = request();
|
||||
$test = new documentOverlayController();
|
||||
|
||||
$userData = DB::table('users')->where("users.id", '=', $request->fireFighterID)
|
||||
->leftJoin('ranks', 'users.degreeID', '=', 'ranks.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', 'users.fathersName', 'users.apartment', 'users.address')
|
||||
->first();
|
||||
|
||||
$awardedDecorations = DB::table('decorationsFirefighters')->where("decorationsFirefighters.firefighterID", '=', $request->fireFighterID)
|
||||
->whereNull('decorationsFirefighters.deleted_at')
|
||||
->leftJoin('decorations', 'decorationsFirefighters.decorationID', '=', 'decorations.id')
|
||||
->select('decorationName', 'dateOfAward', 'firefighterID', 'decorations.id AS decorationsId', 'decorationsFirefighters.id AS decorationsFirefightersID')
|
||||
->get();
|
||||
|
||||
$fireStation = DB::table('fireStations')->where("id", '=', $userData->fireStationID)->first();
|
||||
|
||||
$test->wniosekNadaniePDF($userData, $request->decoration, $fireStation, $awardedDecorations);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function printKartaEwidencyjnaPDF(){
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ) {
|
||||
$request = request();
|
||||
$test = new documentOverlayController();
|
||||
|
||||
$userData = DB::table('users')->where("users.id", '=', $request->fireFighterID)
|
||||
->leftJoin('ranks', 'users.degreeID', '=', 'ranks.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', '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();
|
||||
|
||||
$userTrainings = DB::table('trainingsFirefighters')->where("trainingsFirefighters.firefighterID", '=', $request->fireFighterID)
|
||||
->leftJoin('trainings', 'trainingsFirefighters.trainingID', '=', 'trainings.id')
|
||||
->get();
|
||||
|
||||
$fireStation = DB::table('fireStations')->where("id", '=', $userData->fireStationID)->first();
|
||||
|
||||
$test->kartaEwidencyjnaPDF($userData, $fireStation, $userTrainings);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,739 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
|
||||
#use Codedge\Fpdf\Fpdf\Fpdf;
|
||||
use DB;
|
||||
use App\fireStation;
|
||||
use Carbon;
|
||||
use Illuminate\Routing\Controller;
|
||||
use App\Http\Controllers\AlphaPDF;
|
||||
use setasign\Fpdi\Fpdi;
|
||||
|
||||
class documentCreators extends Controller
|
||||
{
|
||||
public function textConvert($text){
|
||||
return iconv('utf-8','iso-8859-2',$text);
|
||||
}
|
||||
|
||||
public function setWatermark($pdf){
|
||||
$pdf->SetAlpha(0.5);
|
||||
$pdf->Image('/home/czup/PhpstormProjects/untitled7/eOSP2/app/Http/Controllers/logo.jpg',120,30,100);
|
||||
$pdf->SetAlpha(1);
|
||||
}
|
||||
|
||||
public function createSingleOperationPDF2($operationID){
|
||||
|
||||
$operation = DB::table('operations')->where([
|
||||
['operations.fireStationID', "=", auth()->user()->fireStationID],
|
||||
['operations.id', '=', $operationID],
|
||||
])
|
||||
->whereNull('deleted_at')
|
||||
->leftJoin('users', 'operations.commanderID', '=', 'users.id')
|
||||
->select('operations.id', 'operations.operationDate', 'operations.location', 'operations.target', 'operations.dangerType', 'operations.description', 'operations.commanderID', 'operations.fireStationID', 'users.name', 'users.surname')
|
||||
->first();
|
||||
|
||||
$fireFighters = array();
|
||||
$trucks = array();
|
||||
|
||||
$fireFighters = DB::table('users')->where("fireStationID", "=", auth()->user()->fireStationID )
|
||||
->Join('operationsMembers', function ($join) use($operationID){
|
||||
$join->on('users.id', '=', 'operationsMembers.memberID');
|
||||
$join->where('operationsMembers.operationID', '=', $operationID);
|
||||
})
|
||||
->select('users.*', 'operationsMembers.memberID', 'operationsMembers.privateTransport')
|
||||
->get();
|
||||
|
||||
$trucks = DB::table('vehicles')->where([
|
||||
["vehicles.fireStationID", "=", auth()->user()->fireStationID ],
|
||||
])
|
||||
->Join('operationsTrucks', function ($join) use($operationID){
|
||||
$join->on('vehicles.id', '=', 'operationsTrucks.truckID');
|
||||
$join->where('operationsTrucks.operationID', '=', $operationID);
|
||||
})
|
||||
->leftJoin('users', 'operationsTrucks.driverID', '=', 'users.id')
|
||||
->select('vehicles.*', 'operationsTrucks.truckID', 'operationsTrucks.driverID', 'users.name as driverName', 'users.surname as driverSurname')
|
||||
->get();
|
||||
|
||||
|
||||
|
||||
$pdf = new Fpdi();
|
||||
$pdf->fontpath = "../app/Common/fonts/";
|
||||
$fill = false;
|
||||
$pdf->AddPage();
|
||||
$pdf->AddFont('arialpl', '', 'arialpl.php');
|
||||
$pdf->AddFont('arialpl', 'B', 'arialplb.php');
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(40,10, $this->textConvert("Data wyjazdu:"));
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(60,10,$this->textConvert($operation->operationDate), 0, 0, '', $fill);
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(25,10, $this->textConvert("Miejsce:"));
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(40,10,$this->textConvert($operation->location), 0, 0, '', $fill);
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(15,10, $this->textConvert("Cel:"));
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(80,10,$this->textConvert($operation->target), 0, 0, '', $fill);
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(55,10, $this->textConvert("Rodzaj zagrożenia:"));
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(60,10,$this->textConvert($operation->dangerType), 0, 0, '', $fill);
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(35,10, $this->textConvert("Dowodzący:"));
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(60,10,$this->textConvert($operation->name.' '.$operation->surname), 0, 0, '', $fill);
|
||||
$pdf->Ln();
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(0,10, $this->textConvert("Opis Wyjazdu"),0,1,'C');
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Write(8,$this->textConvert($operation->description));
|
||||
$pdf->Ln();
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(28,10, $this->textConvert("Członkowie wyjazdu:"));
|
||||
$pdf->Ln();
|
||||
$pdf->SetFillColor(152,152,152);
|
||||
$pdf->Cell(135,10, $this->textConvert("Członkowie akcji"), 1, 0, 'C', true);
|
||||
$pdf->Cell(55,10, $this->textConvert("Transport własny"), 1, 0, 'C', true);
|
||||
$pdf->Ln();
|
||||
|
||||
$pdf->SetFont('arialpl','',14);
|
||||
$fill = false;
|
||||
$pdf->SetFillColor(224,224,224);
|
||||
foreach( $fireFighters as $fireFighter){
|
||||
$text = $fireFighter->name." ".$fireFighter->surname;
|
||||
$pdf->Cell(135,10,$this->textConvert($text), 1, 0, '', $fill);
|
||||
if($fireFighter->privateTransport == 1){
|
||||
$privateTransport = 'Tak';
|
||||
}else{
|
||||
$privateTransport = 'Nie';
|
||||
}
|
||||
$pdf->Cell(55,10,$this->textConvert($privateTransport), 1, 0, 'C', $fill);
|
||||
$pdf->Ln();
|
||||
|
||||
$fill = !$fill;
|
||||
}
|
||||
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(28,10, $this->textConvert("Pojazdy biorące udział w akcji:"));
|
||||
$pdf->Ln();
|
||||
$pdf->SetFillColor(152,152,152);
|
||||
$pdf->Cell(115,10, $this->textConvert("Pojazd"), 1, 0, 'C', true);
|
||||
$pdf->Cell(75,10, $this->textConvert("Kierowca"), 1, 0, 'C', true);
|
||||
$pdf->Ln();
|
||||
|
||||
$pdf->SetFont('arialpl','',14);
|
||||
$fill = false;
|
||||
$pdf->SetFillColor(224,224,224);
|
||||
foreach( $trucks as $truck){
|
||||
$pdf->Cell(115,10,$this->textConvert($truck->name.' '.$truck->brand.' '.$truck->registrationNumber), 1, 0, '', $fill);
|
||||
$pdf->Cell(75,10,$this->textConvert($truck->driverName.' '.$truck->driverSurname), 1, 0, 'C', $fill);
|
||||
$pdf->Ln();
|
||||
$fill = !$fill;
|
||||
}
|
||||
|
||||
$pdf->Ln();
|
||||
ob_end_clean();
|
||||
// $this->setWatermark($pdf);
|
||||
$pdf->Ln();
|
||||
$pdf->Output();
|
||||
exit;
|
||||
}
|
||||
|
||||
public function createAllOperationsPDF($fireSationID){
|
||||
$operations = DB::table('operations')->where('operations.fireStationID', "=", $fireSationID)
|
||||
->whereNull('deleted_at')
|
||||
->leftJoin('users', 'operations.commanderID', '=', 'users.id')
|
||||
->select('operations.id', 'operations.operationDate', 'operations.location', 'operations.target', 'operations.dangerType', 'operations.description', 'operations.commanderID', 'operations.fireStationID', 'users.name', 'users.surname')
|
||||
->get();
|
||||
|
||||
$pdf = new Fpdi();
|
||||
$pdf->fontpath = "../app/Common/fonts/";
|
||||
$fill = false;
|
||||
$pdf->AddPage();
|
||||
|
||||
$pdf->AddFont('arialpl', '', 'arialpl.php');
|
||||
$pdf->AddFont('arialpl', 'B', 'arialplb.php');
|
||||
|
||||
$pdf->SetFont('arialpl','B',20);
|
||||
$pdf->Cell(190,10, $this->textConvert("Lista wyjazdów:"),0,0,'C');
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',14);
|
||||
$pdf->SetFillColor(152,152,152);
|
||||
|
||||
|
||||
$pdf->SetFont('arialpl','',14);
|
||||
$pdf->SetFillColor(224,224,224);
|
||||
foreach( $operations as $operation){
|
||||
$pdf->Cell(50,10, $this->textConvert("Dowódca: "), 1, 0, '', true);
|
||||
$pdf->Cell(70,10, $this->textConvert($operation->name." ".$operation->surname), 1, 0, 'C' );
|
||||
$pdf->Cell(20,10, $this->textConvert("Data: "), 1, 0, 'C', true);
|
||||
$pdf->Cell(50,10, $this->textConvert($operation->operationDate), 1, 0, '');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50,10,$this->textConvert("Miejsce: "), 1, 0, '', true);
|
||||
$pdf->Cell(140,10,$this->textConvert($operation->location), 1, 0, '');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50,10,$this->textConvert("Cel: "), 1, 0, '', true);
|
||||
$pdf->Cell(140,10,$this->textConvert($operation->target), 1, 0, '');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50,10, $this->textConvert("Rodzaj zagrożenia: "), 1, 0, '', true);
|
||||
$pdf->Cell(140,10, $this->textConvert($operation->dangerType), 1, 0, '');
|
||||
$pdf->Ln();
|
||||
$pdf->Ln();
|
||||
}
|
||||
|
||||
|
||||
$pdf->Ln();
|
||||
ob_end_clean();
|
||||
$pdf->Output();
|
||||
exit;
|
||||
}
|
||||
|
||||
public function createSingleUnitPDF2(){
|
||||
$fireStation = fireStation::find(auth()->user()->fireStationID);
|
||||
$pdf = new Fpdi();
|
||||
$pdf->fontpath = "../app/Common/fonts/";
|
||||
$fill = false;
|
||||
$pdf->AddPage();
|
||||
|
||||
$pdf->AddFont('arialpl', '', 'arialpl.php');
|
||||
$pdf->AddFont('arialpl', 'B', 'arialplb.php');
|
||||
|
||||
$pdf->SetFont('arialpl','B',20);
|
||||
$pdf->Cell(190,10, $this->textConvert($fireStation->name),0,0,'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(45,10, $this->textConvert("Województwo:"),0,0,'');
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(40,10, $this->textConvert($fireStation->voivodeship),0,0,'');
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(25,10, $this->textConvert("Powiat:"),0,0,'');
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(30,10, $this->textConvert($fireStation->county),0,0,'');
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(85,10, $this->textConvert("Gmina i numer Ewidencyjny:"),0,0,'');
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(30,10, $this->textConvert($fireStation->community.' '.$fireStation->number),0,0,'');
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(85 ,10, $this->textConvert("Kod pocztowy, Miejscowość:"),0,0,'');
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(30,10, $this->textConvert($fireStation->zipCode.' '.$fireStation->name),0,0,'');
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(45,10, $this->textConvert("Ulica i Numer:"),0,0,'');
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(30,10, $this->textConvert($fireStation->address),0,0,'');
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(100,10, $this->textConvert("Szerokość i długość geograficzna:"),0,0,'');
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(0,10, $this->textConvert($fireStation->latitude.'° | '.$fireStation->longitude.'°'),0,0,'');
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(20,10, $this->textConvert("KRS:"),0,0,'');
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(30,10, $this->textConvert($fireStation->KRS),0,0,'');
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(20,10, $this->textConvert("NIP:"),0,0,'');
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(30,10, $this->textConvert($fireStation->NIP),0,0,'');
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(30,10, $this->textConvert("Telefon:"),0,0,'');
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(30,10, $this->textConvert($fireStation->phoneNumber),0,0,'');
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(25,10, $this->textConvert("Email:"),0,0,'');
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(30,10, $this->textConvert($fireStation->email),0,0,'');
|
||||
$pdf->Ln();
|
||||
ob_end_clean();
|
||||
$pdf->Output();
|
||||
exit;
|
||||
}
|
||||
|
||||
public function createSingleFireFighterPDF($userID){
|
||||
|
||||
$user = DB::table('users')->where("users.id", '=', $userID)
|
||||
->leftJoin('ranks', 'users.degreeID', '=', 'ranks.id')
|
||||
->leftJoin('unitFunctions', 'users.functionID', '=', 'unitFunctions.id')
|
||||
->select('users.id','users.name', 'users.surname', 'users.PESEL', 'users.email','users.phoneNumber', 'users.number', 'users.statusID', 'ranks.rank', 'unitFunctions.unitFunction')
|
||||
->first();
|
||||
|
||||
$userTrainings = DB::table('trainingsFirefighters')->where("trainingsFirefighters.firefighterID", '=', $userID)
|
||||
->leftJoin('trainings', 'trainingsFirefighters.trainingID', '=', 'trainings.id')
|
||||
->whereNull('deleted_at')
|
||||
->select('trainingsFirefighters.id','trainings.trainingName','trainingsFirefighters.dateOfComplete', 'trainingsFirefighters.dateOfExpiry')
|
||||
->get();
|
||||
|
||||
$userDecorations = DB::table('decorationsFirefighters')->where("decorationsFirefighters.firefighterID", '=', $userID)
|
||||
->whereNull('decorationsFirefighters.deleted_at')
|
||||
->leftJoin('decorations', 'decorationsFirefighters.decorationID', '=', 'decorations.id')
|
||||
->get();
|
||||
|
||||
$pdf = new Fpdi();
|
||||
$pdf->fontpath = "../app/Common/fonts/";
|
||||
$fill = false;
|
||||
$pdf->AddPage();
|
||||
|
||||
$pdf->AddFont('arialpl', '', 'arialpl.php');
|
||||
$pdf->AddFont('arialpl', 'B', 'arialplb.php');
|
||||
|
||||
|
||||
$pdf->SetFont('arialpl','B',20);
|
||||
$pdf->Cell(190,10, $this->textConvert($user->name.' '.$user->surname),0,0,'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Ln();
|
||||
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(25,10, $this->textConvert("Pesel:"),0,0,'');
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(30,10, $this->textConvert($user->PESEL),0,0,'');
|
||||
$pdf->Ln();
|
||||
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(25,10, $this->textConvert("Telefon:"),0,0,'');
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(30,10, $this->textConvert($user->phoneNumber),0,0,'');
|
||||
$pdf->Ln();
|
||||
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(25,10, $this->textConvert("Email:"),0,0,'');
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(30,10, $this->textConvert($user->email ),0,0,'');
|
||||
$pdf->Ln();
|
||||
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(60,10, $this->textConvert("Numer ewidencyjny:"),0,0,'');
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(30,10, $this->textConvert($user->number ),0,0,'');
|
||||
$pdf->Ln();
|
||||
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(30,10, $this->textConvert("Stopień:"),0,0,'');
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(30,10, $this->textConvert($user->rank ),0,0,'');
|
||||
$pdf->Ln();
|
||||
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(30,10, $this->textConvert("Funkcja:"),0,0,'');
|
||||
$pdf->SetFont('arialpl','',16);
|
||||
$pdf->Cell(30,10, $this->textConvert($user->unitFunction ),0,0,'');
|
||||
$pdf->Ln();
|
||||
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(190,10, $this->textConvert("Ukończone szkolenia:"),0,0,'C');
|
||||
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',14);
|
||||
$pdf->SetFillColor(152,152,152);
|
||||
$pdf->Cell(10,10, $this->textConvert("#"), 1, 0, 'C', true);
|
||||
$pdf->Cell(100,10, $this->textConvert("Szkolenie"), 1, 0, 'C', true);
|
||||
$pdf->Cell(40,10, $this->textConvert("Data ukończenia"), 1, 0, 'C', true);
|
||||
$pdf->Cell(40,10, $this->textConvert("Data ważności"), 1, 0, 'C', true);
|
||||
$pdf->Ln();
|
||||
|
||||
$pdf->SetFont('arialpl','',14);
|
||||
$fill = false;
|
||||
$pdf->SetFillColor(224,224,224);
|
||||
$i=1;
|
||||
foreach( $userTrainings as $userTraining){
|
||||
$pdf->Cell(10,10, $i, 1, 0, 'C', $fill);
|
||||
$pdf->Cell(100,10,$this->textConvert($userTraining->trainingName), 1, 0, '', $fill);
|
||||
$pdf->Cell(40,10,$this->textConvert($userTraining->dateOfComplete), 1, 0, 'C', $fill);
|
||||
$pdf->Cell(40,10,$this->textConvert($userTraining->dateOfExpiry), 1, 0, 'C', $fill);
|
||||
$pdf->Ln();
|
||||
$fill = !$fill;
|
||||
$i++;
|
||||
}
|
||||
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(190,10, $this->textConvert("Nadane odznaczenia:"),0,0,'C');
|
||||
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',14);
|
||||
$pdf->SetFillColor(152,152,152);
|
||||
$pdf->Cell(10,10, $this->textConvert("#"), 1, 0, 'C', true);
|
||||
$pdf->Cell(140,10, $this->textConvert("Odznaczenie"), 1, 0, 'C', true);
|
||||
$pdf->Cell(40,10, $this->textConvert("Data przyznania"), 1, 0, 'C', true);;
|
||||
$pdf->Ln();
|
||||
|
||||
$pdf->SetFont('arialpl','',14);
|
||||
$fill = false;
|
||||
$pdf->SetFillColor(224,224,224);
|
||||
$i=1;
|
||||
foreach( $userDecorations as $userDecoration){
|
||||
$pdf->Cell(10,10, $i, 1, 0, 'C', $fill);
|
||||
$pdf->Cell(140,10,$this->textConvert($userDecoration->decorationName), 1, 0, '', $fill);
|
||||
$pdf->Cell(40,10,$this->textConvert($userDecoration->dateOfAward), 1, 0, 'C', $fill);
|
||||
$pdf->Ln();
|
||||
$fill = !$fill;
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
$pdf->Ln();
|
||||
ob_end_clean();
|
||||
$pdf->Output();
|
||||
exit;
|
||||
}
|
||||
|
||||
public function CreateAllFireFightersPDF($fireStationID){
|
||||
|
||||
$users = DB::table('users')->where("fireStationID", '=', $fireStationID)
|
||||
->leftJoin('ranks', 'users.degreeID', '=', 'ranks.id')
|
||||
->leftJoin('unitFunctions', 'users.functionID', '=', 'unitFunctions.id')
|
||||
->select('users.id','users.name', 'users.surname', 'users.phoneNumber', 'users.PESEL', 'users.email', 'users.statusID', 'ranks.rank', 'unitFunctions.unitFunction')
|
||||
->get();
|
||||
|
||||
$pdf = new Fpdi();
|
||||
$fill = false;
|
||||
$pdf->AddPage();
|
||||
$pdf->fontpath = "../app/Common/fonts/";
|
||||
$pdf->AddFont('arialpl', '', 'arialpl.php');
|
||||
$pdf->AddFont('arialpl', 'B', 'arialplb.php');
|
||||
|
||||
$pdf->SetFont('arialpl','B',20);
|
||||
$pdf->Cell(190,10, $this->textConvert("Lista strażaków"),0,0,'C');
|
||||
$pdf->Ln();
|
||||
|
||||
foreach( $users as $user) {
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl', '', 14);
|
||||
$pdf->SetFillColor(152, 152, 152);
|
||||
$pdf->Cell(190, 10, $this->textConvert($user->name . ' ' . $user->surname), 1, 0, 'C', 'fill');
|
||||
$pdf->SetFillColor(224, 224, 224);
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(130, 10, $this->textConvert($user->email), 1, 0, 'C', 'fill');
|
||||
$pdf->Cell(60, 10, $this->textConvert('tel: '.$user->phoneNumber), 1, 0, 'C', 'fill');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(90, 10, $this->textConvert('Stopień: ' . $user->rank), 1, 0, 'C', 'fill');
|
||||
$pdf->Cell(100, 10, $this->textConvert('Funkcja:' . $user->unitFunction), 1, 0, 'C', 'fill');
|
||||
$pdf->Ln();
|
||||
}
|
||||
|
||||
$pdf->Ln();
|
||||
ob_end_clean();
|
||||
$pdf->Output();
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
public function createAllEquipmentPDF($fireStationID){
|
||||
|
||||
$equipment = DB::table('equipment')->where("fireStationID", '=', $fireStationID)
|
||||
->whereNull('deleted_at')->get();
|
||||
|
||||
$pdf = new Fpdi();
|
||||
$pdf->fontpath = "../app/Common/fonts/";
|
||||
$fill = false;
|
||||
$pdf->AddPage();
|
||||
|
||||
$pdf->AddFont('arialpl', '', 'arialpl.php');
|
||||
$pdf->AddFont('arialpl', 'B', 'arialplb.php');
|
||||
|
||||
$pdf->SetFont('arialpl','B',20);
|
||||
$pdf->Cell(190,10, $this->textConvert("Stan sprzętu"),0,0,'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',14);
|
||||
$pdf->SetFillColor(152,152,152);
|
||||
$pdf->Cell(10,10, $this->textConvert("# "), 1, 0, 'C', true);
|
||||
$pdf->Cell(85,10, $this->textConvert("Nazwa "), 1, 0, 'C', true);
|
||||
$pdf->Cell(80,10, $this->textConvert("Param. char. "), 1, 0, 'C', true);
|
||||
$pdf->Cell(15,10, $this->textConvert("Ilość"), 1, 0, 'C', true);
|
||||
$pdf->Ln();
|
||||
|
||||
$pdf->SetFont('arialpl','',14);
|
||||
$fill = false;
|
||||
$pdf->SetFillColor(224,224,224);
|
||||
$i=1;
|
||||
foreach( $equipment as $item){
|
||||
// $pdf->Cell(10,10, $i, 1, 0, 'C', $fill);
|
||||
// $pdf->Cell(85,10,$this->textConvert($item->name), 1, 0, '', $fill);
|
||||
// $pdf->Cell(80,10,$this->textConvert($item->parameter), 1, 0, '', $fill);
|
||||
// $pdf->Cell(15,10,$this->textConvert($item->amount), 1, 0, 'C', $fill);
|
||||
$cellHeight = 10;
|
||||
$calculateHeight = new Fpdi();
|
||||
$calculateHeight->fontpath = "../app/Common/fonts/";
|
||||
$calculateHeight->AddFont('arialpl', '', 'arialpl.php');
|
||||
$calculateHeight->SetFont('arialpl','',14);
|
||||
$calculateHeight->addPage();
|
||||
$calculateHeight->setXY(0, 0);
|
||||
$calculateHeight->MultiCell(85, 10, $this->textConvert($item->name), 0, 'L', 1);
|
||||
$descriptionHeight = $calculateHeight->getY();
|
||||
$calculateHeight->setXY(100, 100);
|
||||
$calculateHeight->Cell(15,10,$descriptionHeight, 1, 0, 'C', $fill);
|
||||
|
||||
//
|
||||
// $calculateHeight->Ln();
|
||||
// ob_end_clean();
|
||||
// $calculateHeight->Output();
|
||||
// exit;
|
||||
|
||||
$start_X = $pdf->GetX();
|
||||
$start_Y = $pdf->GetY();
|
||||
$pdf->Cell(10, $descriptionHeight, $i, 1, 0, 'C', $fill);
|
||||
$pdf->MultiCell(85, 10, $this->textConvert($item->name), 1, 'L' , $fill);
|
||||
$pdf->SetXY($start_X+95, $start_Y);
|
||||
$pdf->Cell(80, $descriptionHeight, $this->textConvert($item->parameter), 1, 0, 'L', $fill);
|
||||
$pdf->Cell(15, $descriptionHeight, $this->textConvert($item->amount), 1, 0, 'C', $fill);
|
||||
|
||||
$pdf->Ln();
|
||||
$fill = !$fill;
|
||||
$i++;
|
||||
}
|
||||
|
||||
$pdf->Ln();
|
||||
ob_end_clean();
|
||||
$pdf->Output();
|
||||
exit;
|
||||
}
|
||||
|
||||
public function createAllTrainingsPDF($fireStationID){
|
||||
|
||||
$trainings = DB::table('trainings')->where("fireStationID", '=', $fireStationID)
|
||||
->whereNull('deleted_at')
|
||||
->paginate(10);
|
||||
|
||||
$howMuch = array();
|
||||
foreach($trainings as $training) {
|
||||
$id = $training->id;
|
||||
$howMuch[$id] = DB::table('trainingsFirefighters')->where('trainingID', '=', $id)->count();
|
||||
|
||||
}
|
||||
|
||||
$pdf = new Fpdi();
|
||||
$pdf->fontpath = "../app/Common/fonts/";
|
||||
$fill = false;
|
||||
$pdf->AddPage();
|
||||
|
||||
$pdf->AddFont('arialpl', '', 'arialpl.php');
|
||||
$pdf->AddFont('arialpl', 'B', 'arialplb.php');
|
||||
|
||||
$pdf->SetFont('arialpl','B',20);
|
||||
$pdf->Cell(190,10, $this->textConvert("Lista badań/szkoleń"),0,0,'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',14);
|
||||
$pdf->SetFillColor(152,152,152);
|
||||
$pdf->Cell(10,10, $this->textConvert("# "), 1, 0, 'C', true);
|
||||
$pdf->Cell(130,10, $this->textConvert("Nazwa "), 1, 0, 'C', true);
|
||||
$pdf->Cell(50,10, $this->textConvert("Ilość z ukończonym"), 1, 0, 'C', true);
|
||||
$pdf->Ln();
|
||||
|
||||
$pdf->SetFont('arialpl','',14);
|
||||
$fill = false;
|
||||
$pdf->SetFillColor(224,224,224);
|
||||
$i=1;
|
||||
foreach( $trainings as $training){
|
||||
$pdf->Cell(10,10, $i, 1, 0, 'C', $fill);
|
||||
$pdf->Cell(130 ,10,$this->textConvert($training->trainingName), 1, 0, '', $fill);
|
||||
$pdf->Cell(50,10,$this->textConvert($howMuch[$training->id]), 1, 0, 'C', $fill);
|
||||
$pdf->Ln();
|
||||
$fill = !$fill;
|
||||
$i++;
|
||||
}
|
||||
|
||||
$pdf->Ln();
|
||||
ob_end_clean();
|
||||
$pdf->Output();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
public function createSingleTrainingPDF($trainingID){
|
||||
$training = DB::table('trainings')->where("id", '=', $trainingID)
|
||||
->first();
|
||||
$fireFighters = DB::table('users')->where("fireStationID", "=", auth()->user()->fireStationID)
|
||||
->Join('trainingsFirefighters', function ($join) use ($trainingID) {
|
||||
$join->on('users.id', '=', 'trainingsFirefighters.firefighterID');
|
||||
$join->where('trainingsFirefighters.trainingID', '=', $trainingID);
|
||||
})
|
||||
->select('trainingsFirefighters.*', 'users.name', 'users.surname', 'users.id as userID')
|
||||
->get();
|
||||
|
||||
$pdf = new Fpdi();
|
||||
$pdf->fontpath = "../app/Common/fonts/";
|
||||
$fill = false;
|
||||
$pdf->AddPage();
|
||||
|
||||
$pdf->AddFont('arialpl', '', 'arialpl.php');
|
||||
$pdf->AddFont('arialpl', 'B', 'arialplb.php');
|
||||
|
||||
$pdf->SetFont('arialpl','B',20);
|
||||
$pdf->Cell(190,10, $this->textConvert("Lista z ukończonym: ".$training->trainingName),0,0,'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',14);
|
||||
$pdf->SetFillColor(152,152,152);
|
||||
$pdf->Cell(10,10, $this->textConvert("# "), 1, 0, 'C', true);
|
||||
$pdf->Cell(100,10, $this->textConvert("Imię i Nazwisko "), 1, 0, 'C', true);
|
||||
$pdf->Cell(45,10, $this->textConvert("Data ukończenia"), 1, 0, 'C', true);
|
||||
$pdf->Cell(35,10, $this->textConvert("Ważne do"), 1, 0, 'C', true);
|
||||
$pdf->Ln();
|
||||
|
||||
$pdf->SetFont('arialpl','',14);
|
||||
$fill = false;
|
||||
$pdf->SetFillColor(224,224,224);
|
||||
$i=1;
|
||||
foreach( $fireFighters as $fireFighter){
|
||||
$pdf->Cell(10,10, $i, 1, 0, 'C', $fill);
|
||||
$pdf->Cell(100 ,10,$this->textConvert($fireFighter->name.' '.$fireFighter->surname), 1, 0, '', $fill);
|
||||
$pdf->Cell(45 ,10,$this->textConvert($fireFighter->dateOfComplete), 1, 0, 'C', $fill);
|
||||
$pdf->Cell(35 , 10,$this->textConvert($fireFighter->dateOfExpiry), 1, 0, 'C', $fill);
|
||||
$pdf->Ln();
|
||||
$fill = !$fill;
|
||||
$i++;
|
||||
}
|
||||
|
||||
$pdf->Ln();
|
||||
ob_end_clean();
|
||||
$pdf->Output();
|
||||
exit;
|
||||
}
|
||||
|
||||
public function createAllVehiclesPDF($fireStationID){
|
||||
$vehicles = DB::table('vehicles')->where("fireStationID", '=', auth()->user()->fireStationID)
|
||||
->whereNull('deleted_at')->paginate(10);
|
||||
|
||||
$pdf = new Fpdi();
|
||||
$pdf->fontpath = "../app/Common/fonts/";
|
||||
$fill = false;
|
||||
$pdf->AddPage();
|
||||
|
||||
$pdf->AddFont('arialpl', '', 'arialpl.php');
|
||||
$pdf->AddFont('arialpl', 'B', 'arialplb.php');
|
||||
|
||||
$pdf->SetFont('arialpl','B',20);
|
||||
$pdf->Cell(190,10, $this->textConvert("Lista pojazdów:"),0,0,'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','B',14);
|
||||
$pdf->SetFillColor(152,152,152);
|
||||
$pdf->Cell(70,10, $this->textConvert("Nazwa"), 1, 0, 'C', true);
|
||||
$pdf->Cell(50,10, $this->textConvert("Marka"), 1, 0, 'C', true);
|
||||
$pdf->Cell(35,10, $this->textConvert("Numer rej."), 1, 0, 'C', true);
|
||||
$pdf->Cell(35,10, $this->textConvert("Rok prod."), 1, 0, 'C', true);
|
||||
$pdf->Ln();
|
||||
|
||||
$pdf->SetFont('arialpl','',14);
|
||||
$fill = false;
|
||||
$pdf->SetFillColor(224,224,224);
|
||||
foreach( $vehicles as $vehicle){
|
||||
$pdf->Cell(70 ,10,$this->textConvert($vehicle->name), 1, 0, '', $fill);
|
||||
$pdf->Cell(50 ,10,$this->textConvert($vehicle->brand), 1, 0, 'C', $fill);
|
||||
$pdf->Cell(35 , 10,$this->textConvert($vehicle->registrationNumber), 1, 0, 'C', $fill);
|
||||
$pdf->Cell(35 , 10,$this->textConvert($vehicle->productionYear), 1, 0, 'C', $fill);
|
||||
$pdf->Ln();
|
||||
$fill = !$fill;
|
||||
}
|
||||
|
||||
|
||||
$pdf->Ln();
|
||||
ob_end_clean();
|
||||
$pdf->Output();
|
||||
exit;
|
||||
}
|
||||
|
||||
public function createSingleVehiclePDF($vehicleID){
|
||||
$vehicle = DB::table('vehicles')->where("id", '=', $vehicleID)
|
||||
->first();
|
||||
|
||||
$pdf = new Fpdi();
|
||||
$pdf->fontpath = "../app/Common/fonts/";
|
||||
$fill = false;
|
||||
$pdf->AddPage();
|
||||
|
||||
$pdf->AddFont('arialpl', '', 'arialpl.php');
|
||||
$pdf->AddFont('arialpl', 'B', 'arialplb.php');
|
||||
|
||||
$pdf->SetFont('arialpl','B',20);
|
||||
$pdf->Cell(190,10, $this->textConvert($vehicle->name),0,0,'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','',14);
|
||||
$pdf->SetFillColor(224,224,224);
|
||||
|
||||
$pdf->Cell(50 ,10,$this->textConvert("Kryptonim: "), 1, 0, '', true);
|
||||
$pdf->Cell(140 , 10,$this->textConvert($vehicle->codename), 1, 0, 'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50 ,10,$this->textConvert("Marka: "), 1, 0, '', true);
|
||||
$pdf->Cell(140 , 10,$this->textConvert($vehicle->brand), 1, 0, 'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50 ,10,$this->textConvert("Numer rej: "), 1, 0, '', true);
|
||||
$pdf->Cell(140 , 10,$this->textConvert($vehicle->registrationNumber), 1, 0, 'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50 ,10,$this->textConvert("Rok Produkcji: "), 1, 0, '', true);
|
||||
$pdf->Cell(140 , 10,$this->textConvert($vehicle->productionYear), 1, 0, 'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50 ,10,$this->textConvert("Ważność przeglądu: "), 1, 0, '', true);
|
||||
$pdf->Cell(140 , 10,$this->textConvert($vehicle->examExpirationDate), 1, 0, 'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50 ,10,$this->textConvert("Termin ważności OC: "), 1, 0, '', true);
|
||||
$pdf->Cell(140 , 10,$this->textConvert($vehicle->insuranceExpirationDate), 1, 0, 'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50 ,10,$this->textConvert("Układ napędowy: "), 1, 0, '', true);
|
||||
$pdf->Cell(140 , 10,$this->textConvert($vehicle->driveType), 1, 0, 'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50 ,10,$this->textConvert("Typ podwozia: "), 1, 0, '', true);
|
||||
$pdf->Cell(140 , 10,$this->textConvert($vehicle->chassisType), 1, 0, 'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50 ,10,$this->textConvert("Producent nadwozia: "), 1, 0, '', true);
|
||||
$pdf->Cell(140 , 10,$this->textConvert($vehicle->bodyProducer), 1, 0, 'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50 ,10,$this->textConvert("Ilość osób w załodze: "), 1, 0, '', true);
|
||||
$pdf->Cell(140 , 10,$this->textConvert($vehicle->crewNumber), 1, 0, 'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50 ,10,$this->textConvert("Ilość piany w L: "), 1, 0, '', true);
|
||||
$pdf->Cell(140 , 10,$this->textConvert($vehicle->foamAgent), 1, 0, 'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50 ,10,$this->textConvert("Moc silnika w kW: "), 1, 0, '', true);
|
||||
$pdf->Cell(140 , 10,$this->textConvert($vehicle->enginePower), 1, 0, 'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50 ,10,$this->textConvert("Masa pojazdu: "), 1, 0, '', true);
|
||||
$pdf->Cell(140 , 10,$this->textConvert($vehicle->mass), 1, 0, 'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50 ,10,$this->textConvert("Numer podwozia: "), 1, 0, '', true);
|
||||
$pdf->Cell(140 , 10,$this->textConvert($vehicle->chassisNumber), 1, 0, 'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50 ,10,$this->textConvert("Numer Silnika: "), 1, 0, '', true);
|
||||
$pdf->Cell(140 , 10,$this->textConvert($vehicle->engineNumber), 1, 0, 'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50 ,10,$this->textConvert("Rodzaj paliwa: "), 1, 0, '', true);
|
||||
$pdf->Cell(140 , 10,$this->textConvert($vehicle->fuelType), 1, 0, 'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50 ,10,$this->textConvert("Rok prod. podwozia: "), 1, 0, '', true);
|
||||
$pdf->Cell(140 , 10,$this->textConvert($vehicle->chassisPoductionYear), 1, 0, 'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50 ,10,$this->textConvert("Data wprowadzenia: "), 1, 0, '', true);
|
||||
$pdf->Cell(140 , 10,$this->textConvert($vehicle->entryIntoServiceDate), 1, 0, 'C');
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(50 ,10,$this->textConvert("Opis Autopompy: "), 1, 0, '', true);
|
||||
$pdf->Cell(140 , 10,$this->textConvert($vehicle->fireEnginePumpDescription), 1, 0, 'C');
|
||||
$pdf->Ln();
|
||||
|
||||
|
||||
$pdf->Ln();
|
||||
ob_end_clean();
|
||||
$pdf->Output();
|
||||
exit;
|
||||
}
|
||||
}
|
@ -1,252 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Codedge\Fpdf\Fpdf\Fpdf;
|
||||
use Illuminate\Http\Request;
|
||||
use setasign\Fpdi\Fpdi;
|
||||
|
||||
use App\Common\Helpers;
|
||||
|
||||
class documentOverlayController extends Controller
|
||||
{
|
||||
public function wniosekNadaniePDF($userData, $decoration, $fireStation, $awardedDecorations){
|
||||
// initiate FPDI
|
||||
$pdf = new Fpdi();
|
||||
$pdf->fontpath = "../app/Common/fonts/";
|
||||
$pdf->AddFont('arialpl', '', 'arialpl.php');
|
||||
#$pdf->AddFont('arialpl', 'B', 'arialplb.php');
|
||||
// set the source file
|
||||
$pageCount = $pdf->setSourceFile("../app/Http/Controllers/documentTemplates/a.pdf");
|
||||
// import page 1
|
||||
|
||||
for ($pageNo = 1; $pageNo <= $pageCount; $pageNo++) {
|
||||
// import a page
|
||||
$templateId = $pdf->importPage($pageNo);
|
||||
// get the size of the imported page
|
||||
$size = $pdf->getTemplateSize($templateId);
|
||||
|
||||
// create a page (landscape or portrait depending on the imported page size)
|
||||
if ($size[0] > $size[1]) {
|
||||
$pdf->AddPage('L', array($size[0], $size[1]));
|
||||
} else {
|
||||
$pdf->AddPage('P', array($size[0], $size[1]));
|
||||
}
|
||||
$pdf->useTemplate($templateId);
|
||||
|
||||
if($pageNo == 1){
|
||||
$str = iconv('UTF-8', 'cp1250', 'zazółcić gęślą jaźń');
|
||||
// $xyz = iconv('UTF-8', 'cp1250', $fireFighterID);
|
||||
$dec = iconv('UTF-8', 'cp1250', $decoration);
|
||||
// now write some text above the imported page
|
||||
$pdf->SetFont('arialpl');
|
||||
$pdf->SetTextColor(128, 128, 128);
|
||||
|
||||
#Pieczęć
|
||||
$pdf->SetXY(30, 30);
|
||||
// $pdf->Write(0, $decoration);
|
||||
|
||||
#Nazwa odznaczenia
|
||||
$pdf->SetXY(120, 50);
|
||||
//$pdf->Write(0, $decoration);
|
||||
$pdf->Cell(20,10, Helpers::textConvert($decoration), 0, 0, 'C');
|
||||
|
||||
#Imie
|
||||
$pdf->SetXY(35, 74);
|
||||
//$pdf->Write(0, $decoration);
|
||||
$pdf->Cell(20,10, Helpers::textConvert($userData->name), 0, 0, 'C');
|
||||
|
||||
|
||||
#Nazwisko
|
||||
$pdf->SetXY(95, 74);
|
||||
//$pdf->Write(0, $decoration);
|
||||
$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
|
||||
$pdf->SetXY(35, 93);
|
||||
//$pdf->Write(0, $decoration);
|
||||
$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
|
||||
$pdf->SetXY(124, 113);
|
||||
$pdf->Cell(20,10, Helpers::textConvert($userData->unitFunction), 0, 0, 'C');
|
||||
|
||||
#Funkcja
|
||||
$pdf->SetXY(35, 113);
|
||||
$pdf->Cell(20,10, Helpers::textConvert($fireStation->postOffice), 0, 0, 'C');
|
||||
|
||||
$txt = "";
|
||||
foreach($awardedDecorations as $awardedDecoration){
|
||||
$txt = $txt." ".$awardedDecoration->decorationName." (".substr($awardedDecoration->dateOfAward,0,4).")\n";
|
||||
}
|
||||
$pdf->SetXY(18, 132);
|
||||
$pdf->MultiCell(86,4, Helpers::textConvert($txt), 0, 'l', 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$pdf->Output();
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
public function kartaEwidencyjnaPDF($userData, $fireStation, $userTrainings){
|
||||
// initiate FPDI
|
||||
$pdf = new Fpdi();
|
||||
$pdf->fontpath = "../app/Common/fonts/";
|
||||
$pdf->AddFont('arialpl', '', 'arialpl.php');
|
||||
// set the source file
|
||||
$pageCount = $pdf->setSourceFile("../app/Http/Controllers/documentTemplates/b.pdf");
|
||||
// import page 1
|
||||
|
||||
for ($pageNo = 1; $pageNo <= $pageCount; $pageNo++) {
|
||||
// import a page
|
||||
$templateId = $pdf->importPage($pageNo);
|
||||
// get the size of the imported page
|
||||
$size = $pdf->getTemplateSize($templateId);
|
||||
|
||||
// create a page (landscape or portrait depending on the imported page size)
|
||||
if ($size[0] > $size[1]) {
|
||||
$pdf->AddPage('L', array($size[0], $size[1]));
|
||||
} else {
|
||||
$pdf->AddPage('P', array($size[0], $size[1]));
|
||||
}
|
||||
$pdf->useTemplate($templateId);
|
||||
|
||||
|
||||
if($pageNo == 1) {
|
||||
$pdf->SetFont('arialpl');
|
||||
$pdf->SetTextColor(128, 128, 128);
|
||||
|
||||
# Imie i nazwisko
|
||||
$pdf->SetXY(85.5, 31.5);
|
||||
$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
|
||||
$peselArray = str_split($userData->PESEL);
|
||||
$x = 116;
|
||||
foreach ($peselArray as $char) {
|
||||
$pdf->SetXY($x, 62.5);
|
||||
$pdf->Cell(0, 10, $char, 0, 0, 'l');
|
||||
$x = $x + 7.35;
|
||||
}
|
||||
|
||||
# Numer Telefonu
|
||||
$pdf->SetXY(102, 102.5);
|
||||
$pdf->Cell(0, 10, $userData->phoneNumber, 0, 0, 'l');
|
||||
|
||||
# Data urodzenia
|
||||
$birthdayArray = Helpers::peselBirthdayDateARRAY($userData->PESEL);
|
||||
#Day
|
||||
$pdf->SetXY(16, 62.5);
|
||||
$pdf->Cell(0, 10, $birthdayArray[0], 0, 0, 'l');
|
||||
#Month
|
||||
$pdf->SetXY(26.5, 62.5);
|
||||
$pdf->Cell(0, 10, $birthdayArray[1], 0, 0, 'l');
|
||||
#Month
|
||||
$pdf->SetXY(37.5, 62.5);
|
||||
$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;
|
||||
$lp = 1;
|
||||
foreach($userTrainings as $userTraining){
|
||||
$pdf->SetXY(20, $y);
|
||||
$pdf->Cell(0, 10, $lp, 0, 0, 'l');
|
||||
$pdf->SetXY(26, $y);
|
||||
$pdf->Cell(0, 10, Helpers::textConvert($userTraining->trainingName), 0, 0, 'l');
|
||||
$pdf->SetXY(162, $y);
|
||||
$pdf->Cell(0, 10, Helpers::textConvert($userTraining->dateOfComplete), 0, 0, 'l');
|
||||
$y = $y + 5.5;
|
||||
$lp = $lp + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$pdf->Output();
|
||||
exit;
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -8,57 +8,59 @@ use App\User;
|
||||
use App\fireStation;
|
||||
use App\Rules\Pesel;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Input;
|
||||
use Mail;
|
||||
|
||||
class fireFightersController extends Controller
|
||||
{
|
||||
public function create(){
|
||||
|
||||
if(auth()->user() != null && auth()->user()->accessLevel() >= 20) //prezes,naczelnik,sekretarz
|
||||
{
|
||||
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)
|
||||
->leftJoin('ranks', 'users.degreeID', '=', 'ranks.id')
|
||||
->leftJoin('unitFunctions', 'users.functionID', '=', 'unitFunctions.id')
|
||||
->select('users.id','users.name', 'users.surname', 'users.PESEL', 'users.email', 'users.statusID', 'ranks.rank', 'unitFunctions.unitFunction')
|
||||
->paginate(10);
|
||||
->get();
|
||||
return view("fireFighters", ["users" => $users]);
|
||||
} else{
|
||||
return redirect()->to('/userprofile');
|
||||
return view('fireFighters');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function addForm(){
|
||||
if(auth()->user() != null && auth()->user()->accessLevel() == 50 ){ //prezes,naczelnik
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ){
|
||||
$fireStation = fireStation::find(auth()->user()->fireStationID);
|
||||
if($fireStation-> creatorID == auth()->user()->id){
|
||||
//return view('fireFightersAdd');
|
||||
$ranks = DB::table('ranks')->pluck("rank","id");
|
||||
$unitFunctions = DB::table('unitFunctions')->pluck("unitFunction","id");
|
||||
return view('fireFightersAdd',compact('ranks'), compact('unitFunctions'));
|
||||
} else return redirect()->to('/strazacy');
|
||||
} else return fireFightersController::create();
|
||||
} else return view("unit");
|
||||
}
|
||||
|
||||
public function editForm($id){
|
||||
if(auth()->user() != null && auth()->user()->accessLevel() == 50 ){ //prezes,naczelnik
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ){
|
||||
$userFireStation = auth()->user()->fireStationID;
|
||||
$fireFighterFireStation = DB::table('users')->where("id", $id)->value('fireStationID');
|
||||
$fireStationCreatorId = DB::table('fireStations')->where("id", $userFireStation)->value('creatorID');
|
||||
|
||||
$fireFighter = DB::table('users')->where("id", $id)->first();
|
||||
if($userFireStation == $fireFighterFireStation && auth()->user()->id == $fireStationCreatorId) {
|
||||
return view('fireFightersEdit', ["fireFighter" => $fireFighter]);
|
||||
} else{
|
||||
return "Brak dostepu";
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect()->to('/strazacy');
|
||||
}else{
|
||||
return view('unit');
|
||||
}
|
||||
}
|
||||
|
||||
public function store(){
|
||||
$this->validate(request(), [
|
||||
|
||||
'name' =>'required|min:2|max:45|regex:/^[A-Za-zżźćńółęąśŻŹĆĄŚĘŁÓŃ\040\x27-]+$/',
|
||||
'surname' =>'required|min:2|max:45|regex:/^[A-Za-zżźćńółęąśŻŹĆĄŚĘŁÓŃ\040\x27-]+$/',
|
||||
'name' => 'required|alpha|min:3|max:45',
|
||||
'surname' => 'required|alpha|min:3|max:45',
|
||||
'PESEL' => new Pesel,
|
||||
'phoneNumber' => 'required|digits:9',
|
||||
'email' => 'required|email|unique:users',
|
||||
@ -69,7 +71,8 @@ class fireFightersController extends Controller
|
||||
'required' => ':attribute jest wymagany(e).',
|
||||
'min' => ':attribute musi mieć przynajmniej :min znaki.',
|
||||
'max' => ':attribute musi mieć nie więcej niż :max znaków.',
|
||||
'regex' => ':attribute może zawierać tylko litery, spacje, myślniki i apostrofy',
|
||||
'alpha' => ':attribute może zawierać tylko litery.',
|
||||
'alpha_num' => ':attribute może zawierać tylko litery i cyfry.',
|
||||
'digits' => ':attribute musi składać się z :digits cyfr.',
|
||||
'unique' =>':attribute jest już zajęty.',
|
||||
'confirmed' =>':attribute się nie zgadza.',
|
||||
@ -78,11 +81,8 @@ class fireFightersController extends Controller
|
||||
|
||||
|
||||
$request = request();
|
||||
$confirmation_code = str_random(30);
|
||||
$password = str_random(10);
|
||||
|
||||
$user = User::create([
|
||||
'password' => $password,
|
||||
'password' => '123',
|
||||
'email' => $request-> email,
|
||||
'name' => $request-> name,
|
||||
'surname' => $request-> surname,
|
||||
@ -93,42 +93,25 @@ class fireFightersController extends Controller
|
||||
'number' => 'ABC123',
|
||||
'fireStationID' => auth()->user()->fireStationID,
|
||||
'creatorID' => auth()->user()-> id,
|
||||
'changingID' => auth()->user()-> id,
|
||||
'confirmation_code' => $confirmation_code,
|
||||
'changingID' => auth()->user()-> id
|
||||
]);
|
||||
|
||||
Mail::send('emails.newUserVerification', compact('password', 'confirmation_code'), function($message) {
|
||||
$message->to(Input::get('email'), Input::get('name'))->subject('Witamy w serwisie eOSP');
|
||||
});
|
||||
|
||||
return fireFightersController::create();
|
||||
}
|
||||
|
||||
public function update(){
|
||||
$this->validate(request(), [
|
||||
'name' =>'required|min:2|max:45|regex:/^[A-Za-zżźćńółęąśŻŹĆĄŚĘŁÓŃ\040\x27-]+$/',
|
||||
'surname' =>'required|min:2|max:45|regex:/^[A-Za-zżźćńółęąśŻŹĆĄŚĘŁÓŃ\040\x27-]+$/',
|
||||
'name' => 'required|alpha|min:3|max:45',
|
||||
'surname' => 'required|alpha|min:3|max:45',
|
||||
'PESEL' => new Pesel,
|
||||
'phoneNumber' => 'required|digits:9',
|
||||
'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).',
|
||||
'min' => ':attribute musi mieć przynajmniej :min znaki.',
|
||||
'max' => ':attribute musi mieć nie więcej niż :max znaków.',
|
||||
'regex' => ':attribute może zawierać tylko litery, spacje, myślniki i apostrofy',
|
||||
'alpha' => ':attribute może zawierać tylko litery.',
|
||||
'alpha_num' => ':attribute może zawierać tylko litery i cyfry.',
|
||||
'digits' => ':attribute musi składać się z :digits cyfr.',
|
||||
'unique' =>':attribute jest już zajęty.',
|
||||
'confirmed' =>':attribute się nie zgadza.',
|
||||
@ -141,61 +124,10 @@ class fireFightersController extends Controller
|
||||
$fireFighter-> surname = $request->surname;
|
||||
$fireFighter-> PESEL = $request->PESEL;
|
||||
$fireFighter-> phoneNumber = $request->phoneNumber;
|
||||
$fireFighter-> changingID = auth()->user()-> id;
|
||||
$fireFighter-> secondName = $request->secondName;
|
||||
$fireFighter-> fathersName = $request->fathersName;
|
||||
$fireFighter-> mothersName = $request->mothersName;
|
||||
$fireFighter-> homePhoneNumber = $request->homePhoneNumber;
|
||||
$fireFighter-> address = $request->address;
|
||||
$fireFighter-> apartment = $request->apartment;
|
||||
$fireFighter-> placeOfBirth = $request->placeOfBirth;
|
||||
$fireFighter-> joiningOSPDate = $request->joiningOSPDate;
|
||||
$fireFighter-> IDSeries = $request->IDSeries;
|
||||
$fireFighter-> IDNumber = $request->IDNumber;
|
||||
$fireFighter-> IDValidUntil = $request->IDValidUntil;
|
||||
$fireFighter-> identityCardNumber = $request->identityCardNumber;
|
||||
$fireFighter-> driversLicense= $request->driversLicense;
|
||||
$fireFighter-> education = $request->education;
|
||||
$fireFighter-> profession = $request->profession;
|
||||
$fireFighter->save();
|
||||
|
||||
return fireFightersController::create();
|
||||
}
|
||||
|
||||
|
||||
public function createSingleFireFighterPDF(){
|
||||
if (auth()->user() != null && auth()->user()->fireStationID != null) {
|
||||
$request = request();
|
||||
$test = new documentCreators();
|
||||
$test->createSingleFireFighterPDF($request->userID);
|
||||
}
|
||||
}
|
||||
|
||||
public function CreateAllFireFightersPDF(){
|
||||
if (auth()->user() != null && auth()->user()->fireStationID != null) {
|
||||
$request = request();
|
||||
$test = new documentCreators();
|
||||
$test->CreateAllFireFightersPDF($request->fireStationID);
|
||||
}
|
||||
}
|
||||
|
||||
public function activate()
|
||||
{
|
||||
$request = request();
|
||||
$user = User::find( $request-> userID);
|
||||
$user-> statusID = 0;
|
||||
$user->save();
|
||||
return redirect()->to('/strazacy');
|
||||
}
|
||||
|
||||
public function deactivate()
|
||||
{
|
||||
$request = request();
|
||||
$user = User::find( $request-> userID);
|
||||
$user-> statusID = 1;
|
||||
$user->save();
|
||||
return redirect()->to('/strazacy');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -6,41 +6,23 @@ namespace App\Http\Controllers;
|
||||
use Illuminate\Http\Request;
|
||||
use App\fireStation;
|
||||
use DB;
|
||||
use Illuminate\Support\Facades\View;
|
||||
|
||||
class fireStationController extends Controller
|
||||
{
|
||||
public function create(){
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ){
|
||||
$users = DB::table('users')
|
||||
->where('fireStationID', '=', auth()->user()->fireStationID)
|
||||
->count();
|
||||
$fireStation = fireStation::find(auth()->user()->fireStationID);
|
||||
return View::make('unit')->with(compact('fireStation', 'users'));
|
||||
|
||||
return view('unit', ["fireStation" => $fireStation]);
|
||||
} else{
|
||||
$voivodeships = DB::table('wojewodztwa')->pluck("name","id");
|
||||
return view('unit',compact('voivodeships'));
|
||||
//return view('unit');
|
||||
}
|
||||
}
|
||||
|
||||
public function editForm()
|
||||
{
|
||||
if(auth()->user() != null && auth()->user()->accessLevel() == 50) //prezes/naczelnik
|
||||
{
|
||||
$id = auth()->user()->fireStationID;
|
||||
$fireStation = DB::table('fireStations')->where("id", $id)->first();
|
||||
$voivodeships = DB::table('wojewodztwa')->pluck("name","id");
|
||||
return view('fireStationEdit', ["fireStation" => $fireStation], compact('voivodeships'));
|
||||
}
|
||||
else
|
||||
return redirect()->to('/jednostka');
|
||||
}
|
||||
|
||||
public function store()
|
||||
{
|
||||
$this->validate(request(),[
|
||||
'fireStationName' => 'required|min:3|max:45',
|
||||
'unitName' => 'required|min:3|max:45',
|
||||
'number' => 'required|numeric',
|
||||
'voivodeship' => 'required',
|
||||
'county' => 'required',
|
||||
@ -75,7 +57,7 @@ class fireStationController extends Controller
|
||||
$community = DB::table('gminy')->select('name')->where('id', $request -> community)->first();
|
||||
|
||||
$jednostka = fireStation::create([
|
||||
'name' => $request -> fireStationName,
|
||||
'name' => $request -> unitName,
|
||||
'number' => $request -> number,
|
||||
'voivodeship' => $voivodeship -> name,
|
||||
'county' => $county -> name,
|
||||
@ -99,68 +81,4 @@ class fireStationController extends Controller
|
||||
|
||||
return redirect()->to('/jednostka');
|
||||
}
|
||||
public function update(){
|
||||
$this->validate(request(),[
|
||||
'fireStationName' => 'required|min:3|max:45',
|
||||
'number' => 'required|numeric',
|
||||
'voivodeship' => 'required',
|
||||
'county' => 'required',
|
||||
'community' => 'required',
|
||||
'postOffice' => 'required|min:3|max:45',
|
||||
'zipCode' => 'required|digits:5',
|
||||
'latitude' => ['required', 'regex:/^[-]?(([0-8]?[0-9])\.(\d+))|(90(\.0+)?)$/'],
|
||||
'longitude' => ['required', 'regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\.(\d+))|180(\.0+)?)$/'],
|
||||
'address' => 'required|min:3|max:45',
|
||||
'KRS' => 'required|digits:10',
|
||||
'NIP' => 'required|digits:10',
|
||||
'phoneNumber' => 'required|digits:9',
|
||||
'email' => 'required|email|unique:fireStations,email,'.auth()->user()->fireStationID, //wymagaj unikalnego adresu email ale pozwól na zachowanie starego adresu
|
||||
],
|
||||
[
|
||||
'required' => ':attribute jest wymagany(e).',
|
||||
'min' => ':attribute musi mieć przynajmniej :min znaki.',
|
||||
'max' => ':attribute musi mieć nie więcej niż :max znaków.',
|
||||
'numeric' => ':attribute może zawierać tylko cyfry.',
|
||||
'digits' => ':attribute musi składać się z :digits cyfr.',
|
||||
'unique' =>':attribute jest już zajęty.',
|
||||
'email' => 'Niepoprawny adres e-mail.',
|
||||
'latitude.regex' =>':attribute ma zakres od -90.0 do 90.0',
|
||||
'longitude.regex' =>':attribute ma zakres od -180.0 do 180.0'
|
||||
]);
|
||||
|
||||
|
||||
$request = request();
|
||||
|
||||
$voivodeship = DB::table('wojewodztwa')->select('name')->where('id', $request -> voivodeship)->first();
|
||||
$county = DB::table('powiaty')->select('name')->where('id', $request -> county)->first();
|
||||
$community = DB::table('gminy')->select('name')->where('id', $request -> community)->first();
|
||||
|
||||
$fireStation = fireStation::find($request->fireStationID);
|
||||
$fireStation-> name = $request-> fireStationName;
|
||||
$fireStation-> number = $request-> number;
|
||||
$fireStation-> voivodeship = $voivodeship-> name;
|
||||
$fireStation-> county = $county-> name;
|
||||
$fireStation-> community = $community-> name;
|
||||
$fireStation-> postOffice = $request-> postOffice;
|
||||
$fireStation-> zipCode = $request-> zipCode;
|
||||
$fireStation-> address = $request-> address;
|
||||
$fireStation-> latitude = $request-> latitude;
|
||||
$fireStation-> longitude = $request-> longitude;
|
||||
$fireStation-> KRS = $request-> KRS;
|
||||
$fireStation-> NIP = $request-> NIP;
|
||||
$fireStation-> phoneNumber = $request-> phoneNumber;
|
||||
$fireStation-> email = $request-> email;
|
||||
$fireStation-> changingID = auth()->user()->id;
|
||||
$fireStation->save();
|
||||
|
||||
return redirect()->to('/jednostka');;
|
||||
}
|
||||
|
||||
public function createSingleUnitPDF(){
|
||||
if (auth()->user() != null && auth()->user()->fireStationID != null) {
|
||||
$request = request();
|
||||
$test = new documentCreators();
|
||||
$test->createSingleUnitPDF2($request->fireStationID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 34 KiB |
@ -1,347 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
|
||||
use App\User;
|
||||
use App\operations;
|
||||
use App\operationsMembers;
|
||||
use App\vehicle;
|
||||
use App\operationsDrivers;
|
||||
use App\operationsTrucks;
|
||||
use App\Http\Controllers\documentCreators;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\View;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
const basicTrainingID = 1; //szkolenie podstawowe
|
||||
const leaderTrainingID = 2; //szkolenie dowódcy
|
||||
const driverTrainingID = 3; //szkolenie kierowcy-mechanika
|
||||
|
||||
class operationsController extends Controller
|
||||
{
|
||||
//
|
||||
|
||||
|
||||
public function create(){
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ){
|
||||
$operations = DB::table('operations')->where('operations.fireStationID', "=", auth()->user()->fireStationID)
|
||||
->whereNull('deleted_at')
|
||||
->leftJoin('users', 'operations.commanderID', '=', 'users.id')
|
||||
->select('operations.id', 'operations.operationDate', 'operations.location', 'operations.target', 'operations.dangerType', 'operations.description', 'operations.commanderID', 'operations.fireStationID', 'users.name', 'users.surname')
|
||||
->paginate(10);
|
||||
$fireFighters = array();
|
||||
$trucks = array();
|
||||
foreach($operations as $operation){
|
||||
$id =$operation->id;
|
||||
$fireFighters[$id] = DB::table('users')->where("fireStationID", "=", auth()->user()->fireStationID )
|
||||
->leftJoin('operationsMembers', function ($join) use($id){
|
||||
$join->on('users.id', '=', 'operationsMembers.memberID');
|
||||
$join->where('operationsMembers.operationID', '=', $id);
|
||||
})
|
||||
->select('users.*', 'operationsMembers.memberID', 'operationsMembers.privateTransport')
|
||||
->get();
|
||||
|
||||
$trucks[$id] = DB::table('vehicles')->where([
|
||||
["vehicles.fireStationID", "=", auth()->user()->fireStationID ],
|
||||
])
|
||||
->leftJoin('operationsTrucks', function ($join) use($id){
|
||||
$join->on('vehicles.id', '=', 'operationsTrucks.truckID');
|
||||
$join->where('operationsTrucks.operationID', '=', $id);
|
||||
})
|
||||
->leftJoin('users', 'operationsTrucks.driverID', '=', 'users.id')
|
||||
->select('vehicles.*', 'operationsTrucks.truckID', 'operationsTrucks.driverID', 'users.name as driverName', 'users.surname as driverSurname')
|
||||
->get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// return view('operation', ["operations" => $operations], ["fireFighters" => $fireFighters], ["trucks" => $trucks]);
|
||||
return View::make('/operation')->with(compact('operations', 'fireFighters', 'trucks'));
|
||||
} else{
|
||||
return view('operation');
|
||||
}
|
||||
}
|
||||
|
||||
public function addForm(){
|
||||
if(auth()->user() != null && auth()->user()->accessLevel() == 50 ){ //prezes,naczelnik
|
||||
$fireFighters = DB::table('users')->where("fireStationID", "=", auth()->user()->fireStationID )
|
||||
->leftJoin('trainingsFirefighters', 'trainingsFirefighters.firefighterID', '=', 'users.id')
|
||||
->where('trainingsFirefighters.trainingID', '=', basicTrainingID)
|
||||
->select('users.*')
|
||||
->get();
|
||||
$leaders = DB::table('users')->where("fireStationID", "=", auth()->user()->fireStationID )
|
||||
->leftJoin('trainingsFirefighters', 'trainingsFirefighters.firefighterID', '=', 'users.id')
|
||||
->where('trainingsFirefighters.trainingID', '=', leaderTrainingID)
|
||||
->select('users.*')
|
||||
->get();
|
||||
$drivers = DB::table('users')->where("fireStationID", "=", auth()->user()->fireStationID )
|
||||
->leftJoin('trainingsFirefighters', 'trainingsFirefighters.firefighterID', '=', 'users.id')
|
||||
->where('trainingsFirefighters.trainingID', '=', driverTrainingID)
|
||||
->select('users.*')
|
||||
->get();
|
||||
$vehicles = DB::table('vehicles')->where([
|
||||
["fireStationID", '=', auth()->user()->fireStationID],
|
||||
["vehicles.status", "=", 1],
|
||||
["vehicles.deleted_at", "=", null],
|
||||
])
|
||||
->get();
|
||||
//return view("operationAdd", ["fireFighters" => $fireFighters], ["vehicles" => $vehicles]);
|
||||
return view("operationAdd")
|
||||
->with(compact('fireFighters'))
|
||||
->with(compact('leaders'))
|
||||
->with(compact('drivers'))
|
||||
->with(compact('vehicles'));
|
||||
|
||||
} else return redirect()->to('/wyjazdy');
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function editForm($id){
|
||||
if(auth()->user() != null && auth()->user()->accessLevel() == 50 ){ //prezes,naczelnik
|
||||
|
||||
// $fireFighters = DB::table('users')->where("fireStationID", "=", auth()->user()->fireStationID )->get();
|
||||
$vehicles = DB::table('vehicles')->where([
|
||||
["fireStationID", '=', auth()->user()->fireStationID],
|
||||
//["vehicles.status", "=", 1],
|
||||
])
|
||||
->get();
|
||||
$operation = DB::table('operations')->where('operations.id', '=', $id)->first();
|
||||
$operationMembers = DB::table('operationsMembers')->where('operationID', '=', $id)->get();
|
||||
// $operation = DB::table('operations')->where('operations.id', '=', $id)
|
||||
// ->leftJoin('users', 'operations.commanderID', '=', 'users.id')
|
||||
// ->select('operations.id', 'operations.operationDate', 'operations.location', 'operations.target', 'operations.dangerType', 'operations.description', 'operations.commanderID', 'operations.fireStationID', 'users.id', 'users.name', 'users.surname')
|
||||
// ->get();
|
||||
$fireFighters = DB::table('users')->where("fireStationID", "=", auth()->user()->fireStationID )
|
||||
->leftJoin('trainingsFirefighters', 'trainingsFirefighters.firefighterID', '=', 'users.id')
|
||||
->where('trainingsFirefighters.trainingID', '=', basicTrainingID)
|
||||
->leftJoin('operationsMembers', function ($join) use($id){
|
||||
$join->on('users.id', '=', 'operationsMembers.memberID');
|
||||
$join->where('operationsMembers.operationID', '=', $id);
|
||||
})
|
||||
->select('users.*', 'operationsMembers.memberID', 'operationsMembers.privateTransport')
|
||||
->get();
|
||||
$drivers = DB::table('users')->where("fireStationID", "=", auth()->user()->fireStationID )
|
||||
->leftJoin('trainingsFirefighters', 'trainingsFirefighters.firefighterID', '=', 'users.id')
|
||||
->where('trainingsFirefighters.trainingID', '=', driverTrainingID)
|
||||
->leftJoin('operationsMembers', function ($join) use($id){
|
||||
$join->on('users.id', '=', 'operationsMembers.memberID');
|
||||
$join->where('operationsMembers.operationID', '=', $id);
|
||||
})
|
||||
->select('users.*', 'operationsMembers.memberID', 'operationsMembers.privateTransport')
|
||||
->get();
|
||||
$leaders = DB::table('users')->where("fireStationID", "=", auth()->user()->fireStationID )
|
||||
->leftJoin('trainingsFirefighters', 'trainingsFirefighters.firefighterID', '=', 'users.id')
|
||||
->where('trainingsFirefighters.trainingID', '=', leaderTrainingID)
|
||||
->leftJoin('operationsMembers', function ($join) use($id){
|
||||
$join->on('users.id', '=', 'operationsMembers.memberID');
|
||||
$join->where('operationsMembers.operationID', '=', $id);
|
||||
})
|
||||
->select('users.*', 'operationsMembers.memberID', 'operationsMembers.privateTransport')
|
||||
->get();
|
||||
|
||||
|
||||
// $operationsTrucks = DB::table('vehicles')->where("vehicles.fireStationID", "=", auth()->user()->fireStationID )
|
||||
// ->leftJoin('operationsTrucks', function ($join) use($id){
|
||||
// $join->on('vehicles.id', '=', 'operationsTrucks.truckID');
|
||||
// $join->where('operationsTrucks.operationID', '=', $id);
|
||||
// })
|
||||
// ->leftJoin('users', 'operationsTrucks.driverID', '=', 'users.id')
|
||||
// ->select('vehicles.*', 'operationsTrucks.truckID', 'operationsTrucks.driverID', 'users.name as driverName', 'users.surname as driverSurname')
|
||||
// ->get();
|
||||
|
||||
$operationsTrucks = DB::table('operationsTrucks')->where("operationsTrucks.operationID", "=", $id)
|
||||
->join('users', 'operationsTrucks.driverID', '=', 'users.ID')
|
||||
->join('vehicles', 'operationsTrucks.truckID', '=', 'vehicles.ID')
|
||||
->select('vehicles.*', 'operationsTrucks.truckID', 'operationsTrucks.driverID', 'users.name as driverName', 'users.surname as driverSurname')
|
||||
->get();
|
||||
|
||||
// if($userFireStation == $fireFighterFireStation && auth()->user()->id == $fireStationCreatorId) {
|
||||
// return view('operationEdit', ["operation" => $operation], ["fireFighters" => $fireFighters], ["operationMembers" => $operationMembers] );
|
||||
return View::make('/operationEdit')->with(compact('fireFighters', 'drivers', 'leaders', 'operation', 'operationMembers', 'vehicles', 'operationsTrucks'));
|
||||
// } else{
|
||||
// return "Brak dostepu";
|
||||
// }
|
||||
} else{
|
||||
return redirect()->to('/wyjazdy');
|
||||
}
|
||||
}
|
||||
|
||||
public function store(){
|
||||
$this->validate(request(),[
|
||||
'operationDate' => 'required',
|
||||
'operationLocation' => 'required|max:100',
|
||||
'operationTarget' => 'required|max:100',
|
||||
'operationDangerType' => 'required|max:100',
|
||||
'operationDescription' => 'required|max:250',
|
||||
'operationLeader' => 'required',
|
||||
'operationDriver.*' => 'required',
|
||||
'operationVehicle.*' => 'required',
|
||||
'attendance.*' => 'required',
|
||||
'transport.*' => 'required',
|
||||
],
|
||||
[
|
||||
'required' => ':attribute jest wymagany(e)',
|
||||
'max' => ':attribute musi mieć nie więcej niż :max znaków.'
|
||||
]);
|
||||
|
||||
//
|
||||
$request = request();
|
||||
$operations = operations::create([
|
||||
'operationDate' => $request-> operationDate,
|
||||
'location' => $request-> operationLocation,
|
||||
'target' => $request-> operationTarget,
|
||||
'dangerType' => $request-> operationDangerType,
|
||||
'description' => $request-> operationDescription,
|
||||
'commanderID' => $request-> operationLeader,
|
||||
'fireStationID' => auth()->user()->fireStationID,
|
||||
]);
|
||||
|
||||
// Add trucks
|
||||
$operationDriver = $request ->operationDriver;
|
||||
$operationVehicle = $request -> operationVehicle;
|
||||
for($count = 0; $count < count($operationDriver); $count++){
|
||||
$operationsTrucks = operationsTrucks::create([
|
||||
'operationID' => $operations->id,
|
||||
'truckID' => $operationVehicle[$count],
|
||||
'driverID' => $operationDriver[$count]
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
// Add members
|
||||
$attendance = $request-> attendance;
|
||||
$transport = $request-> transport;
|
||||
|
||||
// Count of firefighters (need for length of array)
|
||||
$fireFightersCount = DB::table('users')->where("fireStationID", "=", auth()->user()->fireStationID )
|
||||
->leftJoin('trainingsFirefighters', 'trainingsFirefighters.firefighterID', '=', 'users.id')
|
||||
->where('trainingsFirefighters.trainingID', '=', basicTrainingID)
|
||||
->count();
|
||||
for($count = 0; $count < $fireFightersCount; $count++){
|
||||
|
||||
// Check privateTransport checklist
|
||||
$privateTransport = 2;
|
||||
if(isset($transport[$count])){
|
||||
$privateTransport = 1;
|
||||
} else{
|
||||
$privateTransport = 0;
|
||||
}
|
||||
|
||||
if(isset($attendance[$count])){
|
||||
$operationsMembers = operationsMembers::create([
|
||||
'operationID' => $operations->id,
|
||||
'memberID' => $attendance[$count],
|
||||
'privateTransport' => $privateTransport,
|
||||
]);
|
||||
};
|
||||
}
|
||||
|
||||
//return operationsController::create();
|
||||
return redirect()->to('/wyjazdy');
|
||||
}
|
||||
|
||||
public function update(){
|
||||
$this->validate(request(),[
|
||||
'operationDate' => 'required',
|
||||
'operationLocation' => 'required|max:100',
|
||||
'operationTarget' => 'required|max:100',
|
||||
'operationDangerType' => 'required|max:100',
|
||||
'operationDescription' => 'required|max:250',
|
||||
'operationLeader' => 'required',
|
||||
'operationDriver.*' => 'required',
|
||||
'operationVehicle.*' => 'required',
|
||||
'attendance.*' => 'required',
|
||||
'transport.*' => 'required',
|
||||
],
|
||||
[
|
||||
'required' => ':attribute jest wymagany(e)',
|
||||
'max' => ':attribute musi mieć nie więcej niż :max znaków.'
|
||||
]);
|
||||
|
||||
|
||||
$request = request();
|
||||
$operation = operations::where('id', $request->operationID)->update(array(
|
||||
'operationDate' => $request-> operationDate,
|
||||
'location' => $request-> operationLocation,
|
||||
'target' => $request-> operationTarget,
|
||||
'dangerType' => $request-> operationDangerType,
|
||||
'description' => $request-> operationDescription,
|
||||
'commanderID' => $request-> operationLeader,
|
||||
'fireStationID' => auth()->user()->fireStationID
|
||||
));
|
||||
|
||||
|
||||
operationsTrucks::where('operationID', $request->operationID)->delete();
|
||||
|
||||
// Add trucks
|
||||
$operationDriver = $request ->operationDriver;
|
||||
$operationVehicle = $request -> operationVehicle;
|
||||
for($count = 0; $count < count($operationDriver); $count++){
|
||||
$operationsTrucks = operationsTrucks::create([
|
||||
'operationID' => $request->operationID,
|
||||
'truckID' => $operationVehicle[$count],
|
||||
'driverID' => $operationDriver[$count]
|
||||
]);
|
||||
}
|
||||
|
||||
operationsMembers::where('operationID', $request->operationID)->delete();
|
||||
|
||||
|
||||
// Add members
|
||||
$attendance = $request-> attendance;
|
||||
$transport = $request-> transport;
|
||||
|
||||
// Count of firefighters (need for length of array)
|
||||
$fireFightersCount = DB::table('users')->where("fireStationID", "=", auth()->user()->fireStationID )->count();
|
||||
for($count = 0; $count < $fireFightersCount; $count++){
|
||||
|
||||
// Check privateTransport checklist
|
||||
$privateTransport = 2;
|
||||
if(isset($transport[$count])){
|
||||
$privateTransport = 1;
|
||||
} else{
|
||||
$privateTransport = 0;
|
||||
}
|
||||
|
||||
if(isset($attendance[$count])){
|
||||
$operationsMembers = operationsMembers::create([
|
||||
'operationID' => $request->operationID,
|
||||
'memberID' => $attendance[$count],
|
||||
'privateTransport' => $privateTransport,
|
||||
]);
|
||||
};
|
||||
}
|
||||
|
||||
return redirect()->to('/wyjazdy');
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
operations::find($id)->delete($id);
|
||||
//redirect()->to('/wyjazdy');
|
||||
|
||||
return response()->json([
|
||||
'success' => 'Record deleted successfully!'
|
||||
]);
|
||||
}
|
||||
|
||||
public function createSingleOperationPDF(){
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ) {
|
||||
$request = request();
|
||||
$test = new documentCreators();
|
||||
$test->createSingleOperationPDF2($request->operationID );
|
||||
}
|
||||
}
|
||||
|
||||
public function createAllOperationsPDF(){
|
||||
if (auth()->user() != null && auth()->user()->fireStationID != null) {
|
||||
$request = request();
|
||||
$test = new documentCreators();
|
||||
$test->createAllOperationsPDF($request->fireStationID);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,111 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
use Codedge\Fpdf\Fpdf\Fpdf;
|
||||
use DB;
|
||||
use Carbon;
|
||||
class pdfController extends Controller
|
||||
{
|
||||
public function textConvert($text){
|
||||
return iconv('utf-8','iso-8859-2',$text);
|
||||
}
|
||||
|
||||
public function createViewEquipment(){
|
||||
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ){
|
||||
$equipment = DB::table('equipment')->where("fireStationID", '=', auth()->user()->fireStationID)
|
||||
->whereNull('deleted_at')->get();
|
||||
}
|
||||
|
||||
$pdf = new FPDF();
|
||||
$pdf->AddPage();
|
||||
$pdf->AddFont('arialpl', '', 'arialpl.php');
|
||||
$pdf->AddFont('arialpl', 'B', 'arialplb.php');
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(40,10, $this->textConvert("5. Sprzęt na wyposażeniu jednostki:"));
|
||||
$pdf->Ln();
|
||||
$pdf->SetFillColor(152,152,152);
|
||||
$pdf->Cell(165,10, $this->textConvert("Nazwa sprzętu"), 1, 0, 'C', true);
|
||||
$pdf->Cell(25,10, $this->textConvert("Ilość"), 1, 0, 'C', true);
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','',14);
|
||||
|
||||
$fill = false;
|
||||
$pdf->SetFillColor(224,224,224);
|
||||
foreach( $equipment as $item){
|
||||
$text = $item->name." ".$item->parameter;
|
||||
$pdf->Cell(165,10,$this->textConvert($text), 1, 0, '', $fill);
|
||||
$pdf->Cell(25,10,$this->textConvert($item->amount), 1, 0, 'C', $fill);
|
||||
$pdf->Ln();
|
||||
|
||||
$fill = !$fill;
|
||||
}
|
||||
|
||||
$pdf->SetLeftMargin(140);
|
||||
$pdf->Ln();
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(40,5,".........................................");
|
||||
$pdf->SetFont('arialpl','',10);
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(60,5, "(podpis naczelnika OSP)", 0, 0, 'C');
|
||||
$pdf->Output();
|
||||
exit;
|
||||
}
|
||||
|
||||
public function createViewDecoration(){
|
||||
|
||||
$pdf = new FPDF();
|
||||
|
||||
$pdf->AddFont('arialpl', '', 'arialpl.php');
|
||||
$pdf->AddFont('arialpl', 'B', 'arialplb.php');
|
||||
$pdf->AddPage();
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(40,10, $this->textConvert("5. Sprzęt na wyposażeniu jednostki:"));
|
||||
$pdf->Output();
|
||||
exit;
|
||||
}
|
||||
|
||||
public function createViewFireFighters(){
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ){
|
||||
$users = DB::table('users')->where("fireStationID", '=', auth()->user()->fireStationID)->get();
|
||||
}
|
||||
|
||||
$mytime = Carbon\Carbon::now()->toDateString('Y-m-d');
|
||||
|
||||
$pdf = new FPDF();
|
||||
$pdf->AddPage();
|
||||
$pdf->AddFont('arialpl', '', 'arialpl.php');
|
||||
$pdf->AddFont('arialpl', 'B', 'arialplb.php');
|
||||
$pdf->SetFont('arialpl','B',16);
|
||||
$pdf->Cell(200,10, $this->textConvert("Wykaz strażaków na dzień: ".$mytime), 0, 0, 'C');
|
||||
$pdf->Ln();
|
||||
$pdf->SetFillColor(152,152,152);
|
||||
$pdf->Cell(60,10, $this->textConvert("Imię i Nazwisko"), 1, 0, 'C', true);
|
||||
$pdf->Cell(90,10, $this->textConvert("Email"), 1, 0, 'C', true);
|
||||
$pdf->Cell(40,10, $this->textConvert("Telefon"), 1, 0, 'C', true);
|
||||
$pdf->Ln();
|
||||
$pdf->SetFont('arialpl','',14);
|
||||
|
||||
$fill = false;
|
||||
$pdf->SetFillColor(224,224,224);
|
||||
foreach( $users as $user){
|
||||
$text = $user->name." ".$user->surname;
|
||||
$pdf->Cell(60,10,$this->textConvert($text), 1, 0, 'C', $fill);
|
||||
$pdf->Cell(90,10,$this->textConvert($user->email), 1, 0, 'C', $fill);
|
||||
$pdf->Cell(40,10,$this->textConvert($user->phoneNumber), 1, 0, 'C', $fill);
|
||||
$pdf->Ln();
|
||||
|
||||
$fill = !$fill;
|
||||
}
|
||||
|
||||
$pdf->SetLeftMargin(140);
|
||||
$pdf->Ln();
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(40,5,".........................................");
|
||||
$pdf->SetFont('arialpl','',10);
|
||||
$pdf->Ln();
|
||||
$pdf->Cell(60,5, "(podpis naczelnika OSP)", 0, 0, 'C');
|
||||
$pdf->Output();
|
||||
exit;
|
||||
}
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\Input;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Http\Request;
|
||||
use App\User;
|
||||
use Mail;
|
||||
|
||||
class resetPasswordController extends Controller
|
||||
{
|
||||
public function create()
|
||||
{
|
||||
return view('forgottenPassword');
|
||||
}
|
||||
|
||||
public function reset()
|
||||
{
|
||||
|
||||
$this->validate(request(), [
|
||||
'email' => 'required|email',
|
||||
],
|
||||
[
|
||||
'required' => ':attribute jest wymagany.',
|
||||
'email' => 'Niepoprawny adres e-mail.'
|
||||
]);
|
||||
|
||||
$request = request();
|
||||
$user = DB::table('users')->where('email', '=', $request->email)
|
||||
->first();
|
||||
|
||||
if($user){
|
||||
$password = str_random(10);
|
||||
User::where('email', '=', $request->email)
|
||||
->update(['password' => Hash::make($password)]);
|
||||
Mail::send('emails.passwordReset', compact('password'), function($message) {
|
||||
$message->to(Input::get('email'))->subject('Zmiana hasła');
|
||||
});
|
||||
}
|
||||
|
||||
return redirect()->to('/login')->with('success','Jeśli podany adres email jest poprawny, nowe hasło zostało wysłane');
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,199 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\equipment;
|
||||
use App\trainings;
|
||||
use App\trainingsFirefighters;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
class trainingsController extends Controller
|
||||
{
|
||||
public function create(){
|
||||
|
||||
if(auth()->user() != null && auth()->user()->accessLevel() == 50 ){ //prezes,naczelnik
|
||||
$trainings = DB::table('trainings')->where("fireStationID", '=', auth()->user()->fireStationID)->orWhere("fireStationID", '=', 0)
|
||||
->whereNull('deleted_at')
|
||||
->paginate(10);
|
||||
|
||||
|
||||
|
||||
$fireFighters = array();
|
||||
$howMuch = array();
|
||||
foreach($trainings as $training) {
|
||||
$id = $training->id;
|
||||
$howMuch[$id] = DB::table('trainingsFirefighters')->where('trainingID', '=', $id)->count();
|
||||
$fireFighters[$id] = DB::table('users')->where("fireStationID", "=", auth()->user()->fireStationID)
|
||||
->leftJoin('trainingsFirefighters', function ($join) use ($id) {
|
||||
$join->on('users.id', '=', 'trainingsFirefighters.firefighterID');
|
||||
$join->where('trainingsFirefighters.trainingID', '=', $id);
|
||||
})
|
||||
->select('trainingsFirefighters.*', 'users.name', 'users.surname', 'users.id as userID')
|
||||
->get();
|
||||
}
|
||||
return View::make("trainings")->with(compact( "trainings", "fireFighters", "howMuch"));
|
||||
} else{
|
||||
return redirect()->to('/strazacy');
|
||||
}
|
||||
}
|
||||
|
||||
public function store(){
|
||||
$this->validate(request(), [
|
||||
'name' => 'required|max:45',
|
||||
],
|
||||
[
|
||||
'required' => 'Nazwa jest wymagana.',
|
||||
'max' => 'Nazwa musi mieć nie więcej niż :max znaków.',
|
||||
]);
|
||||
|
||||
|
||||
$request = request();
|
||||
$equipment = trainings::create([
|
||||
'fireStationID' => auth()->user()->fireStationID,
|
||||
'trainingName' => $request-> name,
|
||||
]);
|
||||
|
||||
return redirect()->to('/szkolenia');
|
||||
}
|
||||
|
||||
public function addForm(){
|
||||
|
||||
}
|
||||
|
||||
public function addTrainingsFireFighters($id){
|
||||
|
||||
if(auth()->user() != null && auth()->user()->accessLevel() == 50 ){ //prezes,naczelnik
|
||||
$fireFighters = DB::table('users')->where("fireStationID", "=", auth()->user()->fireStationID )
|
||||
->leftJoin('trainingsFirefighters', function ($join) use($id){
|
||||
$join->on('users.id', '=', 'trainingsFirefighters.firefighterID');
|
||||
$join->where('trainingsFirefighters.trainingID', '=', $id);
|
||||
})
|
||||
->select('trainingsFirefighters.*', 'users.name', 'users.surname', 'users.id as userID')
|
||||
->paginate(10);
|
||||
|
||||
$training = DB::table('trainings')->where("id", '=', $id)
|
||||
->whereNull('deleted_at')->first();
|
||||
return View::make("trainingsAddFireFighters")->with(compact( "training", "fireFighters"));
|
||||
} else{
|
||||
return redirect()->to('/strazacy');
|
||||
}
|
||||
}
|
||||
|
||||
public function ajaxRequest(Request $request){
|
||||
$validator = Validator::make($request->all(), [
|
||||
'firefighterID' => 'required',
|
||||
'trainingID' => 'required',
|
||||
'dateOfComplete' => 'required|date',
|
||||
'dateOfExpiry' => 'required|date',
|
||||
],
|
||||
[
|
||||
'required' => ':attribute jest wymagany(a).',
|
||||
'dateOfComplete.required' => 'Data wystawienia szkolenia/badania jest wymagana.',
|
||||
'dateOfExpiry.required' => 'Data ważności szkolenia/badania jest wymagana.'
|
||||
]);
|
||||
|
||||
|
||||
// WALIDACJA
|
||||
if ($validator->fails()) {
|
||||
|
||||
if($request->ajax())
|
||||
{
|
||||
return response()->json(array(
|
||||
'success' => false,
|
||||
'message' => 'There are incorect values in the form!',
|
||||
'errors' => $validator->getMessageBag()->toArray()
|
||||
), 422);
|
||||
}
|
||||
|
||||
$this->throwValidationException(
|
||||
|
||||
$request, $validator
|
||||
|
||||
);
|
||||
|
||||
// WYKONANIE ZAPYTAŃ PO POPRAWNEJ WALIDACJI
|
||||
} else{
|
||||
|
||||
$trainingFirefighter = trainingsFirefighters::where([
|
||||
['firefighterID', '=', $request->firefighterID],
|
||||
['trainingID', '=', $request-> trainingID]
|
||||
])->first();
|
||||
|
||||
if($trainingFirefighter == null){
|
||||
// CREATE
|
||||
$trainings = trainingsFirefighters::create([
|
||||
'firefighterID' => $request-> firefighterID,
|
||||
'trainingID' => $request-> trainingID,
|
||||
'dateOfComplete' => $request-> dateOfComplete,
|
||||
'dateOfExpiry' => $request-> dateOfExpiry,
|
||||
'lifetime' => 1,
|
||||
]);
|
||||
}else{
|
||||
// UPDATE
|
||||
$trainingFirefighter->update([
|
||||
'dateOfComplete' => $request-> dateOfComplete,
|
||||
'dateOfExpiry' => $request-> dateOfExpiry,
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function deleteFireFighterTrainings(Request $request){
|
||||
$validator = Validator::make($request->all(), [
|
||||
'firefighterID' => 'required',
|
||||
'trainingID' => 'required',
|
||||
]);
|
||||
|
||||
trainingsFirefighters::where([
|
||||
['fireFighterID', '=', $request->firefighterID],
|
||||
['trainingID', '=', $request->trainingID],
|
||||
])->delete();
|
||||
|
||||
}
|
||||
|
||||
public function update(){
|
||||
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
trainings::find($id)->delete($id);
|
||||
|
||||
return response()->json([
|
||||
'success' => 'Record deleted successfully!'
|
||||
]);
|
||||
}
|
||||
|
||||
public function trainingsRename(Request $request){
|
||||
$validator = Validator::make($request->all(), [
|
||||
'trainingID' => 'required',
|
||||
'trainingName' => 'required',
|
||||
]);
|
||||
|
||||
trainings::where('id', '=', $request->trainingID)
|
||||
->update(['trainingName' => $request->trainingName]);
|
||||
}
|
||||
|
||||
public function createAllTrainingsPDF(){
|
||||
if (auth()->user() != null && auth()->user()->fireStationID != null) {
|
||||
$request = request();
|
||||
$test = new documentCreators();
|
||||
$test->createAllTrainingsPDF($request->fireStationID);
|
||||
}
|
||||
}
|
||||
|
||||
public function createSingleTrainingPDF(){
|
||||
if (auth()->user() != null && auth()->user()->fireStationID != null) {
|
||||
$request = request();
|
||||
$test = new documentCreators();
|
||||
$test->createSingleTrainingPDF($request->trainingID);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,126 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use DB;
|
||||
use App\User;
|
||||
use App\Rules\Pesel;
|
||||
|
||||
class userProfileController extends Controller
|
||||
{
|
||||
public function create(){
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ){
|
||||
$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', '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{
|
||||
return redirect()->to('/login');
|
||||
}
|
||||
}
|
||||
|
||||
public function editForm()
|
||||
{
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null )
|
||||
{
|
||||
|
||||
$userData = DB::table('users')->where("id", '=', auth()->user()->id)
|
||||
->first();
|
||||
|
||||
return view("userProfileEdit", ["userData" => $userData]);
|
||||
}
|
||||
else
|
||||
return redirect()->to('/login');
|
||||
|
||||
}
|
||||
|
||||
public function update(){
|
||||
$this->validate(request(), [
|
||||
'name' =>'required|min:2|max:45|regex:/^[A-Za-zżźćńółęąśŻŹĆĄŚĘŁÓŃ\040\x27-]+$/',
|
||||
'surname' =>'required|min:2|max:45|regex:/^[A-Za-zżźćńółęąśŻŹĆĄŚĘŁÓŃ\040\x27-]+$/',
|
||||
'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).',
|
||||
'min' => ':attribute musi mieć przynajmniej :min znaki.',
|
||||
'max' => ':attribute musi mieć nie więcej niż :max znaków.',
|
||||
'regex' => ':attribute może zawierać tylko litery, spacje, myślniki i apostrofy',
|
||||
'digits' => ':attribute musi składać się z :digits cyfr.',
|
||||
'unique' =>':attribute jest już zajęty.',
|
||||
'confirmed' =>':attribute się nie zgadza.',
|
||||
'email' => 'Niepoprawny adres e-mail.'
|
||||
]);
|
||||
|
||||
$request = request();
|
||||
$user = User::find( $request->userID);
|
||||
$user-> name = $request->name;
|
||||
$user-> surname = $request->surname;
|
||||
$user-> PESEL = $request->PESEL;
|
||||
$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');;
|
||||
}
|
||||
|
||||
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')
|
||||
->whereNull('deleted_at')
|
||||
->select('trainingsFirefighters.id','trainings.trainingName','trainingsFirefighters.dateOfComplete', 'trainingsFirefighters.dateOfExpiry')
|
||||
->get();
|
||||
return view("userTrainings", ["userTrainings" => $userTrainings]);
|
||||
}
|
||||
else{
|
||||
return redirect()->to('/login');;
|
||||
}
|
||||
}
|
||||
|
||||
public function userDecorations(){
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ){
|
||||
$userDecorations = DB::table('decorationsFirefighters')->where("decorationsFirefighters.firefighterID", '=', auth()->user()->id)
|
||||
->whereNull('decorationsFirefighters.deleted_at')
|
||||
->leftJoin('decorations', 'decorationsFirefighters.decorationID', '=', 'decorations.id')
|
||||
->get();
|
||||
return view("userDecorations", ["userDecorations" => $userDecorations]);
|
||||
} else{
|
||||
return "Brak dostepu";
|
||||
}
|
||||
}
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Rules;
|
||||
|
||||
use Illuminate\Contracts\Validation\Rule;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class ComparePasswords implements Rule
|
||||
{
|
||||
/**
|
||||
* Create a new rule instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the validation rule passes.
|
||||
*
|
||||
* @param string $attribute
|
||||
* @param mixed $value
|
||||
* @return bool
|
||||
*/
|
||||
public function passes($attribute, $value)
|
||||
{
|
||||
return Hash::check($value, auth()->user()->password);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation error message.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function message()
|
||||
{
|
||||
return 'Obecne hasło jest niepoprawne.';
|
||||
}
|
||||
}
|
18
app/User.php
18
app/User.php
@ -18,7 +18,7 @@ class User extends Authenticatable
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name', 'surname', 'password', 'PESEL', 'phoneNumber', 'email', 'fireStationID', 'functionID', 'degreeID', 'number', 'statusID', 'deleted', 'creatorID', 'changingID', 'confirmation_code','secondName','fathersName','mothersName','address','apartment','placeOfBirth','driversLicense','joiningOSPDate','IDSeries','IDNumber','IDValidUntil','identityCardNumber','homePhoneNumber','education','profession',
|
||||
'name', 'surname', 'password', 'PESEL', 'phoneNumber', 'email', 'fireStationID', 'functionID', 'degreeID', 'number', 'statusID', 'deleted', 'creatorID', 'changingID', 'confirmation_code',
|
||||
];
|
||||
|
||||
/**
|
||||
@ -43,20 +43,4 @@ class User extends Authenticatable
|
||||
{
|
||||
$this->attributes['password'] = bcrypt($password);
|
||||
}
|
||||
|
||||
public function accessLevel()
|
||||
{
|
||||
if (auth()->user() != null && auth()->user()->fireStationID != null)
|
||||
if ($this->functionID == 1 or $this->functionID == 5) //prezes lub naczelnik
|
||||
return 50;
|
||||
elseif ($this->functionID == 3) //skarbnik
|
||||
return 30;
|
||||
elseif($this->functionID == 4) //sekretarz
|
||||
return 20;
|
||||
else
|
||||
return 0; //brak specjalnych uprawnień
|
||||
else
|
||||
return -1; //jednostka nie istnieje
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class decorationsFirefighters extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
protected $primaryKey = 'id';
|
||||
protected $table = 'decorationsFirefighters';
|
||||
|
||||
protected $fillable = ['decorationID', 'firefighterID', 'dateOfAward'];
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class equipment extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
protected $primaryKey = 'id';
|
||||
protected $table = 'equipment';
|
||||
|
||||
protected $fillable = [
|
||||
'fireStationID','name', 'amount', 'parameter',
|
||||
];
|
||||
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class operations extends Model
|
||||
{
|
||||
//
|
||||
use SoftDeletes;
|
||||
protected $primaryKey = 'id';
|
||||
protected $fillable = ['fireStationID', 'operationDate', 'location', 'target', 'dangerType', 'description', 'commanderID'];
|
||||
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class operationsMembers extends Model
|
||||
{
|
||||
//
|
||||
protected $primaryKey = 'id';
|
||||
protected $table = 'operationsMembers';
|
||||
|
||||
protected $fillable = ['operationID', 'memberID', 'privateTransport'];
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class operationsTrucks extends Model
|
||||
{
|
||||
//
|
||||
protected $primaryKey = 'id';
|
||||
protected $table = 'operationsTrucks';
|
||||
|
||||
protected $fillable = ['operationID', 'truckID', 'driverID'];
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
|
||||
class trainings extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
protected $primaryKey = 'id';
|
||||
protected $fillable = ['fireStationID', 'trainingName'];
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class trainingsFirefighters extends Model
|
||||
{
|
||||
protected $primaryKey = 'id';
|
||||
protected $table = 'trainingsFirefighters';
|
||||
|
||||
protected $fillable = ['trainingID', 'firefighterID', 'dateOfComplete', 'dateOfExpiry', 'lifetime'];
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class vehicle extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
protected $primaryKey = 'id';
|
||||
protected $table = 'vehicles';
|
||||
|
||||
protected $fillable = [
|
||||
'fireStationID','name', 'codename', 'brand', 'registrationNumber', 'productionYear', 'examExpirationDate', 'insuranceExpirationDate', 'driveType', 'chassisType', 'bodyProducer', 'crewNumber', 'foamAgent', 'enginePower', 'mass', 'chassisNumber', 'engineNumber', 'fuelType', 'chassisPoductionYear', 'entryIntoServiceDate', 'fireEnginePumpDescription', 'created_at', 'updated_at', 'status'
|
||||
];
|
||||
|
||||
}
|
@ -9,13 +9,9 @@
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^7.1.3",
|
||||
"codedge/laravel-fpdf": "^1.5",
|
||||
"fideloper/proxy": "^4.0",
|
||||
"laravel/framework": "5.7.*",
|
||||
"laravel/tinker": "^1.0",
|
||||
"setasign/fpdi-fpdf": "2.3",
|
||||
"symfony/translation": "4.3.8",
|
||||
"twbs/bootstrap": "4.4.1"
|
||||
"laravel/tinker": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"beyondcode/laravel-dump-server": "^1.0",
|
||||
|
1667
composer.lock
generated
1667
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -174,6 +174,7 @@ return [
|
||||
// App\Providers\BroadcastServiceProvider::class,
|
||||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
@ -222,6 +223,7 @@ return [
|
||||
'URL' => Illuminate\Support\Facades\URL::class,
|
||||
'Validator' => Illuminate\Support\Facades\Validator::class,
|
||||
'View' => Illuminate\Support\Facades\View::class,
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
|
@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default configuration for FPDF
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Specify the default values for creating a PDF with FPDF
|
||||
|
|
||||
*/
|
||||
|
||||
'orientation' => 'P',
|
||||
'unit' => 'mm',
|
||||
'size' => 'A4',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| With Laravel Vapor hosting
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If the application is to be hosted in the Laravel Vapor hosting platform,
|
||||
| a special header needs to be attached to each download response.
|
||||
|
|
||||
*/
|
||||
'useVaporHeaders' => env('FPDF_VAPOR_HEADERS', false),
|
||||
|
||||
];
|
@ -1,494 +0,0 @@
|
||||
-- MySQL Script generated by MySQL Workbench
|
||||
-- Sun Nov 24 02:38:19 2019
|
||||
-- Model: New Model Version: 1.0
|
||||
-- MySQL Workbench Forward Engineering
|
||||
|
||||
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
|
||||
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
|
||||
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Schema osp
|
||||
-- -----------------------------------------------------
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Schema osp
|
||||
-- -----------------------------------------------------
|
||||
CREATE SCHEMA IF NOT EXISTS `osp` DEFAULT CHARACTER SET utf16 COLLATE utf16_polish_ci ;
|
||||
USE `osp` ;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `osp`.`uzytkownik`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `osp`.`uzytkownik` (
|
||||
`Id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`login` VARCHAR(45) NOT NULL,
|
||||
`haslo` VARCHAR(45) NOT NULL,
|
||||
`imie` VARCHAR(45) NOT NULL,
|
||||
`nazwisko` VARCHAR(45) NOT NULL,
|
||||
`data_urodzenia` DATE NOT NULL,
|
||||
`pesel` INT NOT NULL,
|
||||
`adres` VARCHAR(45) NULL,
|
||||
`funkcja` VARCHAR(45) NOT NULL,
|
||||
`stopien` VARCHAR(45) NOT NULL,
|
||||
`aktywny` TINYINT NOT NULL DEFAULT 1,
|
||||
`edytor_id` INT UNSIGNED NOT NULL,
|
||||
`data_edycji` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`Id`),
|
||||
CONSTRAINT `edytor`
|
||||
FOREIGN KEY (`edytor_id`)
|
||||
REFERENCES `osp`.`uzytkownik` (`Id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE UNIQUE INDEX `Id_UNIQUE` ON `osp`.`uzytkownik` (`Id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `edytor_idx` ON `osp`.`uzytkownik` (`edytor_id` ASC) VISIBLE;
|
||||
|
||||
CREATE UNIQUE INDEX `login_UNIQUE` ON `osp`.`uzytkownik` (`login` ASC) VISIBLE;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `osp`.`typ_szkolenia`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `osp`.`typ_szkolenia` (
|
||||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`nazwa` VARCHAR(45) NOT NULL,
|
||||
`szkolenie_kpp` TINYINT NOT NULL DEFAULT 0,
|
||||
`usuniety` TINYINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
`edytor_id` INT UNSIGNED NOT NULL,
|
||||
`data_edycji` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `edytor`
|
||||
FOREIGN KEY (`edytor_id`)
|
||||
REFERENCES `osp`.`uzytkownik` (`Id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE UNIQUE INDEX `id_UNIQUE` ON `osp`.`typ_szkolenia` (`id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `edytor_idx` ON `osp`.`typ_szkolenia` (`edytor_id` ASC) VISIBLE;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `osp`.`szkolenie_uzytkownika`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `osp`.`szkolenie_uzytkownika` (
|
||||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`typ_szkolenia_id` INT UNSIGNED NOT NULL,
|
||||
`uzytkownik_id` INT UNSIGNED NOT NULL,
|
||||
`data_szkolenia` DATE NOT NULL,
|
||||
`data_waznosci` DATE NULL,
|
||||
`usuniety` TINYINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
`edytor_id` INT UNSIGNED NOT NULL,
|
||||
`data_edycji` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `typ_szkolenia`
|
||||
FOREIGN KEY (`typ_szkolenia_id`)
|
||||
REFERENCES `osp`.`typ_szkolenia` (`id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `uzytkownik`
|
||||
FOREIGN KEY (`uzytkownik_id`)
|
||||
REFERENCES `osp`.`uzytkownik` (`Id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `edytor`
|
||||
FOREIGN KEY (`edytor_id`)
|
||||
REFERENCES `osp`.`uzytkownik` (`Id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE UNIQUE INDEX `id_UNIQUE` ON `osp`.`szkolenie_uzytkownika` (`id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `typ_szkolenia_idx` ON `osp`.`szkolenie_uzytkownika` (`typ_szkolenia_id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `uzytkownik_idx` ON `osp`.`szkolenie_uzytkownika` (`uzytkownik_id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `edytor_idx` ON `osp`.`szkolenie_uzytkownika` (`edytor_id` ASC) VISIBLE;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `osp`.`badanie`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `osp`.`badanie` (
|
||||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`uzytkownik_id` INT UNSIGNED NOT NULL,
|
||||
`data_badania` DATE NOT NULL,
|
||||
`waznosc_badania` DATE NOT NULL,
|
||||
`lekarz` VARCHAR(45) NOT NULL,
|
||||
`edytor_id` INT UNSIGNED NOT NULL,
|
||||
`data_edycji` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `uzytkownik0`
|
||||
FOREIGN KEY (`uzytkownik_id`)
|
||||
REFERENCES `osp`.`uzytkownik` (`Id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `edytor0`
|
||||
FOREIGN KEY (`edytor_id`)
|
||||
REFERENCES `osp`.`uzytkownik` (`Id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE UNIQUE INDEX `id_UNIQUE` ON `osp`.`badanie` (`id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `uzytkownik_idx` ON `osp`.`badanie` (`uzytkownik_id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `edytor_idx` ON `osp`.`badanie` (`edytor_id` ASC) VISIBLE;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `osp`.`uzytkownik_historia`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `osp`.`uzytkownik_historia` (
|
||||
`Id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`uzytkownik_id` INT UNSIGNED NOT NULL,
|
||||
`login` VARCHAR(45) NOT NULL,
|
||||
`haslo` VARCHAR(45) NOT NULL,
|
||||
`imie` VARCHAR(45) NOT NULL,
|
||||
`nazwisko` VARCHAR(45) NOT NULL,
|
||||
`data_urodzenia` DATE NOT NULL,
|
||||
`pesel` INT NOT NULL,
|
||||
`adres` VARCHAR(45) NULL,
|
||||
`funkcja` VARCHAR(45) NOT NULL,
|
||||
`stopien` VARCHAR(45) NOT NULL,
|
||||
`aktywny` TINYINT NOT NULL DEFAULT 1,
|
||||
`edytor_id` INT UNSIGNED NOT NULL,
|
||||
`data_edycji` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`Id`),
|
||||
CONSTRAINT `edytor1`
|
||||
FOREIGN KEY (`edytor_id`)
|
||||
REFERENCES `osp`.`uzytkownik` (`Id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `uzytkownik`
|
||||
FOREIGN KEY (`uzytkownik_id`)
|
||||
REFERENCES `osp`.`uzytkownik` (`Id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE UNIQUE INDEX `Id_UNIQUE` ON `osp`.`uzytkownik_historia` (`Id` ASC) VISIBLE;
|
||||
|
||||
CREATE UNIQUE INDEX `login_UNIQUE` ON `osp`.`uzytkownik_historia` (`login` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `edytor1_idx` ON `osp`.`uzytkownik_historia` (`edytor_id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `uzytkownik_idx` ON `osp`.`uzytkownik_historia` (`uzytkownik_id` ASC) VISIBLE;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `osp`.`zastep`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `osp`.`zastep` (
|
||||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`pojazd_id` INT UNSIGNED NOT NULL,
|
||||
`kierowca` INT UNSIGNED NOT NULL,
|
||||
`dowodca` INT UNSIGNED NOT NULL,
|
||||
`przod_roty_1` INT UNSIGNED NOT NULL,
|
||||
`pom_przod_roty_1` INT UNSIGNED NOT NULL,
|
||||
`przod_roty_2` INT UNSIGNED NOT NULL,
|
||||
`pom_przod_roty_2` INT UNSIGNED NOT NULL,
|
||||
`edytor_id` INT UNSIGNED NOT NULL,
|
||||
`data_edycji` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `edytor`
|
||||
FOREIGN KEY (`edytor_id`)
|
||||
REFERENCES `osp`.`uzytkownik` (`Id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE UNIQUE INDEX `id_UNIQUE` ON `osp`.`zastep` (`id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `edytor_idx` ON `osp`.`zastep` (`edytor_id` ASC) VISIBLE;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `osp`.`zastep_historia`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `osp`.`zastep_historia` (
|
||||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`zastep_id` INT UNSIGNED NOT NULL,
|
||||
`pojazd_id` INT UNSIGNED NOT NULL,
|
||||
`kierowca` INT UNSIGNED NOT NULL,
|
||||
`dowodca` INT UNSIGNED NOT NULL,
|
||||
`przod_roty_1` INT UNSIGNED NOT NULL,
|
||||
`pom_przod_roty_1` INT UNSIGNED NOT NULL,
|
||||
`przod_roty_2` INT UNSIGNED NOT NULL,
|
||||
`pom_przod_roty_2` INT UNSIGNED NOT NULL,
|
||||
`edytor_id` INT UNSIGNED NOT NULL,
|
||||
`data_edycji` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `edytor2`
|
||||
FOREIGN KEY (`edytor_id`)
|
||||
REFERENCES `osp`.`uzytkownik` (`Id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `zastep`
|
||||
FOREIGN KEY (`zastep_id`)
|
||||
REFERENCES `osp`.`zastep` (`id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE UNIQUE INDEX `id_UNIQUE` ON `osp`.`zastep_historia` (`id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `edytor_idx` ON `osp`.`zastep_historia` (`edytor_id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `zastep_idx` ON `osp`.`zastep_historia` (`zastep_id` ASC) VISIBLE;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `osp`.`wyjazd`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `osp`.`wyjazd` (
|
||||
`id` INT NOT NULL,
|
||||
`zastep_id` INT UNSIGNED NOT NULL,
|
||||
`adres` VARCHAR(45) NOT NULL,
|
||||
`opis` VARCHAR(45) NOT NULL,
|
||||
`godzina_wyjazdu` DATETIME NOT NULL,
|
||||
`godzina_powrotu` DATETIME NOT NULL,
|
||||
`edytor_id` INT UNSIGNED NOT NULL,
|
||||
`data_edycji` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `zastep`
|
||||
FOREIGN KEY (`zastep_id`)
|
||||
REFERENCES `osp`.`zastep_historia` (`id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `edytor`
|
||||
FOREIGN KEY (`edytor_id`)
|
||||
REFERENCES `osp`.`uzytkownik` (`Id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE INDEX `zastep_idx` ON `osp`.`wyjazd` (`zastep_id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `edytor_idx` ON `osp`.`wyjazd` (`edytor_id` ASC) VISIBLE;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `osp`.`pojazdy`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `osp`.`pojazdy` (
|
||||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`nazwa` VARCHAR(45) NOT NULL,
|
||||
`numer_rejestracyjny` VARCHAR(45) NULL,
|
||||
`marka_pojazdu` VARCHAR(45) NULL,
|
||||
`typ_model_podwozia` VARCHAR(45) NULL,
|
||||
`producent_podwozia` VARCHAR(45) NULL,
|
||||
`układ_napedowy` VARCHAR(45) NULL,
|
||||
`ilosc_osob_w_zalodze` INT NULL,
|
||||
`ilosc_srodka_pianotworczego` FLOAT NULL,
|
||||
`moc_silnika` FLOAT NULL,
|
||||
`masa_calkowita` FLOAT NULL,
|
||||
`numer_podwozia` VARCHAR(45) NULL,
|
||||
`numer_silnika` VARCHAR(45) NULL,
|
||||
`rodzaj_paliwa` VARCHAR(45) NULL,
|
||||
`rok_produkcji_podwozia` INT NULL,
|
||||
`data_wprowadzenia_do_eksploatacji` DATE NULL,
|
||||
`opis_autopompy` VARCHAR(45) NULL,
|
||||
`data_waznosci_przegladu_technicznego` DATE NULL,
|
||||
`termin_waznosci_ubezpieczenia_OC` DATE NULL,
|
||||
`usuniety` TINYINT NOT NULL DEFAULT 0,
|
||||
`edytor_id` INT UNSIGNED NOT NULL,
|
||||
`data_edycji` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `edytor_id`
|
||||
FOREIGN KEY (`edytor_id`)
|
||||
REFERENCES `osp`.`uzytkownik` (`Id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE UNIQUE INDEX `idpojazdy_UNIQUE` ON `osp`.`pojazdy` (`id` ASC) INVISIBLE;
|
||||
|
||||
CREATE INDEX `edytor_id_idx` ON `osp`.`pojazdy` (`edytor_id` ASC) VISIBLE;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `osp`.`pojazdy_historia`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `osp`.`pojazdy_historia` (
|
||||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`pojazdy_id` INT UNSIGNED NOT NULL,
|
||||
`nazwa` VARCHAR(45) NOT NULL,
|
||||
`numer_rejestracyjny` VARCHAR(45) NULL,
|
||||
`marka_pojazdu` VARCHAR(45) NULL,
|
||||
`typ_model_podwozia` VARCHAR(45) NULL,
|
||||
`producent_podwozia` VARCHAR(45) NULL,
|
||||
`układ_napedowy` VARCHAR(45) NULL,
|
||||
`ilosc_osob_w_zalodze` INT NULL,
|
||||
`ilosc_srodka_pianotworczego` FLOAT NULL,
|
||||
`moc_silnika` FLOAT NULL,
|
||||
`masa_calkowita` FLOAT NULL,
|
||||
`numer_podwozia` VARCHAR(45) NULL,
|
||||
`numer_silnika` VARCHAR(45) NULL,
|
||||
`rodzaj_paliwa` VARCHAR(45) NULL,
|
||||
`rok_produkcji_podwozia` INT NULL,
|
||||
`data_wprowadzenia_do_eksploatacji` DATE NULL,
|
||||
`opis_autopompy` VARCHAR(45) NULL,
|
||||
`data_waznosci_przegladu_technicznego` DATE NULL,
|
||||
`termin_waznosci_ubezpieczenia_OC` DATE NULL,
|
||||
`usuniety` TINYINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
`edytor_id` INT UNSIGNED NOT NULL,
|
||||
`data_edycji` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `edytor_id`
|
||||
FOREIGN KEY (`edytor_id`)
|
||||
REFERENCES `osp`.`uzytkownik` (`Id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `pojazdy_id`
|
||||
FOREIGN KEY (`pojazdy_id`)
|
||||
REFERENCES `osp`.`pojazdy` (`id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE UNIQUE INDEX `idpojazdy_UNIQUE` ON `osp`.`pojazdy_historia` (`id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `pojazdy_id_idx` ON `osp`.`pojazdy_historia` (`pojazdy_id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `edytor_id_idx` ON `osp`.`pojazdy_historia` (`edytor_id` ASC) VISIBLE;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `osp`.`typ_szkolenia_historia`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `osp`.`typ_szkolenia_historia` (
|
||||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`typ_szkolenia_id` INT UNSIGNED NOT NULL,
|
||||
`nazwa` VARCHAR(45) NOT NULL,
|
||||
`szkolenie_kpp` TINYINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
`usuniety` TINYINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
`edytor_id` INT UNSIGNED NOT NULL,
|
||||
`data_edycji` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `edytor`
|
||||
FOREIGN KEY (`edytor_id`)
|
||||
REFERENCES `osp`.`uzytkownik` (`Id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `typ_szkolenia_id`
|
||||
FOREIGN KEY (`typ_szkolenia_id`)
|
||||
REFERENCES `osp`.`typ_szkolenia` (`id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE UNIQUE INDEX `id_UNIQUE` ON `osp`.`typ_szkolenia_historia` (`id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `edytor_idx` ON `osp`.`typ_szkolenia_historia` (`edytor_id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `typ_szkolenia_id_idx` ON `osp`.`typ_szkolenia_historia` (`typ_szkolenia_id` ASC) VISIBLE;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `osp`.`szkolenie_uzytkownika_historia`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `osp`.`szkolenie_uzytkownika_historia` (
|
||||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`szkolenie_uzytkownika_id` INT UNSIGNED NOT NULL,
|
||||
`typ_szkolenia_id` INT UNSIGNED NOT NULL,
|
||||
`uzytkownik_id` INT UNSIGNED NOT NULL,
|
||||
`data_szkolenia` DATE NOT NULL,
|
||||
`data_waznosci` DATE NULL,
|
||||
`usuniety` TINYINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
`edytor_id` INT UNSIGNED NOT NULL,
|
||||
`data_edycji` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `typ_szkolenia`
|
||||
FOREIGN KEY (`typ_szkolenia_id`)
|
||||
REFERENCES `osp`.`typ_szkolenia` (`id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `uzytkownik`
|
||||
FOREIGN KEY (`uzytkownik_id`)
|
||||
REFERENCES `osp`.`uzytkownik` (`Id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `edytor`
|
||||
FOREIGN KEY (`edytor_id`)
|
||||
REFERENCES `osp`.`uzytkownik` (`Id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE UNIQUE INDEX `id_UNIQUE` ON `osp`.`szkolenie_uzytkownika_historia` (`id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `typ_szkolenia_idx` ON `osp`.`szkolenie_uzytkownika_historia` (`typ_szkolenia_id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `uzytkownik_idx` ON `osp`.`szkolenie_uzytkownika_historia` (`uzytkownik_id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `edytor_idx` ON `osp`.`szkolenie_uzytkownika_historia` (`edytor_id` ASC) VISIBLE;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `osp`.`sprzet`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `osp`.`sprzet` (
|
||||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`nazwa` VARCHAR(45) NOT NULL,
|
||||
`ilosc` INT NOT NULL DEFAULT 0,
|
||||
`parametr_charakterystyczny` VARCHAR(45) NULL,
|
||||
`rodzaj_sprzetu` VARCHAR(45) NOT NULL,
|
||||
`usuniety` TINYINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
`edytor_id` INT UNSIGNED NOT NULL,
|
||||
`data_edycji` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `edytor_id`
|
||||
FOREIGN KEY (`edytor_id`)
|
||||
REFERENCES `osp`.`uzytkownik` (`Id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE UNIQUE INDEX `id_UNIQUE` ON `osp`.`sprzet` (`id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `edytor_id_idx` ON `osp`.`sprzet` (`edytor_id` ASC) VISIBLE;
|
||||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `osp`.`sprzet_historia`
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS `osp`.`sprzet_historia` (
|
||||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`sprzet_id` INT UNSIGNED NOT NULL,
|
||||
`nazwa` VARCHAR(45) NOT NULL,
|
||||
`ilosc` INT NOT NULL,
|
||||
`parametr_charakterystyczny` VARCHAR(45) NULL,
|
||||
`rodzaj_sprzetu` VARCHAR(45) NOT NULL,
|
||||
`usuniety` TINYINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
`edytor_id` INT UNSIGNED NOT NULL,
|
||||
`data_edycji` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `edytor_id`
|
||||
FOREIGN KEY (`edytor_id`)
|
||||
REFERENCES `osp`.`uzytkownik` (`Id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `sprzet_id`
|
||||
FOREIGN KEY (`sprzet_id`)
|
||||
REFERENCES `osp`.`sprzet` (`id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE UNIQUE INDEX `id_UNIQUE` ON `osp`.`sprzet_historia` (`id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `edytor_id_idx` ON `osp`.`sprzet_historia` (`edytor_id` ASC) VISIBLE;
|
||||
|
||||
CREATE INDEX `sprzet_id_idx` ON `osp`.`sprzet_historia` (`sprzet_id` ASC) VISIBLE;
|
||||
|
||||
|
||||
SET SQL_MODE=@OLD_SQL_MODE;
|
||||
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
|
||||
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
|
Binary file not shown.
Binary file not shown.
@ -15,43 +15,25 @@ class CreateUsersTable extends Migration
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('password');
|
||||
$table->string('name');
|
||||
$table->string('surname');
|
||||
$table->string('password', 100);
|
||||
$table->string('name', 45);
|
||||
$table->string('surname', 45);
|
||||
$table->string('PESEL',11);
|
||||
$table->string('phoneNumber', 20);
|
||||
$table->string('email', 100)->unique();
|
||||
$table->integer('fire_station_id')->unsigned()->nullable();
|
||||
$table->foreign('fire_station_id')->references('id')->on('fire_stations')->onDelete('cascade');
|
||||
$table->integer('unit_function_id')->unsigned()->nullable();
|
||||
$table->foreign('unit_function_id')->references('id')->on('unit_functions')->onDelete('set null');
|
||||
$table->integer('rank_id')->unsigned()->nullable();
|
||||
$table->foreign('rank_id')->references('id')->on('ranks')->onDelete('set null');
|
||||
$table->string('number')->nullable()->default(null);
|
||||
$table->string('second_name')->nullable()->default(null);
|
||||
$table->string('fathers_name')->nullable()->default(null);
|
||||
$table->string('mothers_name')->nullable()->default(null);
|
||||
$table->string('address')->nullable()->default(null);
|
||||
$table->string('apartment')->nullable()->default(null); //nr domu
|
||||
$table->string('place_of_birth')->nullable()->default(null);
|
||||
$table->string('drivers_license')->nullable()->default(null);
|
||||
$table->date('joining_osp_date')->nullable()->default(null);
|
||||
$table->string('id_series', 3)->nullable()->default(null);
|
||||
$table->string('id_number', 6)->nullable()->default(null); //nr dowodu osobistego
|
||||
$table->date('id_valid_until')->nullable()->default(null);
|
||||
$table->string('identity_card_number')->nullable()->default(null); //nr legitymacji strażackiej
|
||||
$table->string('home_phone_number', 20)->nullable()->default(null);
|
||||
$table->string('education')->nullable()->default(null);
|
||||
$table->string('profession')->nullable()->default(null);
|
||||
$table->integer('status_id')->default(0); //aktywny/zawieszony
|
||||
$table->integer('creator_id')->nullable()->default(null);
|
||||
$table->integer('editor_id')->nullable()->default(null);
|
||||
$table->string('phoneNumber', 9);
|
||||
$table->string('email', 50)->unique();
|
||||
$table->integer('fireStationID')->nullable();
|
||||
$table->integer('functionID');
|
||||
$table->integer('degreeID');
|
||||
$table->string('number', 45)->nullable()->default(null);
|
||||
$table->integer('statusID')->default(0);
|
||||
$table->integer('deleted')->default(0);
|
||||
$table->integer('creatorID')->nullable()->default(null);
|
||||
$table->integer('changingID')->nullable()->default(null);
|
||||
$table->boolean('confirmed')->default(0);
|
||||
$table->string('confirmation_code')->nullable();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -13,28 +13,25 @@ class CreateFireStationsTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('fire_stations', function (Blueprint $table) {
|
||||
Schema::create('fireStations', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->string('name', 45);
|
||||
$table->integer('number');
|
||||
$table->integer('province_id')->unsigned();
|
||||
$table->foreign('province_id')->references('id')->on('provinces');
|
||||
$table->integer('district_id')->unsigned();
|
||||
$table->foreign('district_id')->references('id')->on('districts');
|
||||
$table->integer('commune_id')->unsigned();
|
||||
$table->foreign('commune_id')->references('id')->on('communes');
|
||||
$table->string('post_office');
|
||||
$table->string('zip_code');
|
||||
$table->string('address');
|
||||
$table->string('voivodeship', 45);
|
||||
$table->string('county', 45);
|
||||
$table->string('community', 45);
|
||||
$table->string('postOffice', 45);
|
||||
$table->string('zipCode', 6);
|
||||
$table->string('address', 45);
|
||||
$table->float('latitude', 9,5);
|
||||
$table->float('longitude', 9,5);
|
||||
$table->string('KRS', 10);
|
||||
$table->string('NIP', 10);
|
||||
$table->string('phone_number', 20);
|
||||
$table->string('email');
|
||||
$table->string('phoneNumber', 11);
|
||||
$table->string('email', 100);
|
||||
$table->integer('deleted')->default(0);
|
||||
$table->integer('creator_id')->nullable()->default(null);
|
||||
$table->integer('editor_id')->nullable()->default(null);
|
||||
$table->integer('creatorID')->nullable()->default(null);
|
||||
$table->integer('changingID')->nullable()->default(null);
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
@ -47,6 +44,6 @@ class CreateFireStationsTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('fire_stations');
|
||||
Schema::dropIfExists('fireStations');
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class JednostkiTerytorialne extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('wojewodztwa', function (Blueprint $table) {
|
||||
// $table->increments('id');
|
||||
$table->integer('id');
|
||||
$table->string('name');
|
||||
});
|
||||
|
||||
Schema::create('powiaty', function (Blueprint $table) {
|
||||
$table->integer('id');
|
||||
$table->integer('wojewodztwo_id');
|
||||
$table->string('name');
|
||||
});
|
||||
|
||||
Schema::create('gminy', function (Blueprint $table) {
|
||||
$table->integer('id');
|
||||
$table->integer('wojewodztwo_id');
|
||||
$table->integer('powiat_id');
|
||||
$table->string('name');
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('wojewodztwa');
|
||||
Schema::dropIfExists('powiaty');
|
||||
Schema::dropIfExists('gminy');
|
||||
}
|
||||
}
|
@ -14,9 +14,18 @@ class CreateRanksTable extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create('ranks', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('rank');
|
||||
$table->integer('id');
|
||||
$table->string('rank', 60);
|
||||
});
|
||||
|
||||
|
||||
DB::table('ranks')->insert([ 'id' => '1', 'rank' => 'strażak' ]);
|
||||
DB::table('ranks')->insert([ 'id' => '2', 'rank' => 'starszy strażak' ]);
|
||||
DB::table('ranks')->insert([ 'id' => '3', 'rank' => 'dowódca roty' ]);
|
||||
DB::table('ranks')->insert([ 'id' => '4', 'rank' => 'pomocnik dowódcy sekcji' ]);
|
||||
DB::table('ranks')->insert([ 'id' => '5', 'rank' => 'dowódca sekcji' ]);
|
||||
DB::table('ranks')->insert([ 'id' => '6', 'rank' => 'pomocnik dowódcy plutonu' ]);
|
||||
DB::table('ranks')->insert([ 'id' => '7', 'rank' => 'dowódca plutonu' ]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -13,10 +13,18 @@ class CreateUnitFunctionsTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('unit_functions', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('unit_function');
|
||||
Schema::create('unitFunctions', function (Blueprint $table) {
|
||||
$table->integer('id');
|
||||
$table->string('unitFunction', 60);
|
||||
});
|
||||
|
||||
DB::table('unitFunctions')->insert([ 'id' => '1', 'unitFunction' => 'naczelnik' ]);
|
||||
DB::table('unitFunctions')->insert([ 'id' => '2', 'unitFunction' => 'zastępca naczelnika' ]);
|
||||
DB::table('unitFunctions')->insert([ 'id' => '3', 'unitFunction' => 'skarbnik' ]);
|
||||
DB::table('unitFunctions')->insert([ 'id' => '4', 'unitFunction' => 'sekretarz' ]);
|
||||
DB::table('unitFunctions')->insert([ 'id' => '5', 'unitFunction' => 'prezes' ]);
|
||||
DB::table('unitFunctions')->insert([ 'id' => '6', 'unitFunction' => 'przewodniczący komisji rewizyjnej' ]);
|
||||
DB::table('unitFunctions')->insert([ 'id' => '7', 'unitFunction' => 'członek komisji rewizyjnej' ]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -26,6 +34,6 @@ class CreateUnitFunctionsTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('unit_functions');
|
||||
Schema::dropIfExists('unitFunctions');
|
||||
}
|
||||
}
|
||||
|
@ -15,32 +15,26 @@ class CreateVehiclesTable extends Migration
|
||||
{
|
||||
Schema::create('vehicles', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('fire_station_id')->unsigned();
|
||||
$table->foreign('fire_station_id')->references('id')->on('fire_stations')->onDelete('cascade');
|
||||
$table->string('name');
|
||||
$table->string('codename');
|
||||
$table->string('brand')->nullable();
|
||||
$table->string('registration_number', 20)->nullable();
|
||||
$table->integer('production_year')->nullable();
|
||||
$table->date('exam_expiration_date')->nullable(); //Data ważności przegladu
|
||||
$table->date('insurance_expiration_date')->nullable();
|
||||
$table->string('drive_type')->nullable(); //układ napędowy
|
||||
$table->string('chassis_type')->nullable(); //typ podwozia
|
||||
$table->string('body_producer')->nullable(); //producent nadwozia
|
||||
$table->integer('crew_number')->nullable();
|
||||
$table->integer('foam_agent')->nullable(); //Ilość środka pianotwórczego w litrach
|
||||
$table->integer('engine_power')->nullable(); //Moc silnika w kW
|
||||
$table->integer('mass')->nullable(); //Masa całkowita pojazdu
|
||||
$table->string('chassis_number')->nullable();
|
||||
$table->string('engine_number')->nullable();
|
||||
$table->string('fuel_type')->nullable();
|
||||
$table->integer('chassis_poduction_year')->nullable();
|
||||
$table->date('entry_into_service_date')->nullable();
|
||||
$table->string('fire_engine_pump_description')->nullable();// Opis autopompy
|
||||
$table->integer('status')->default('0');
|
||||
$table->integer('editor_id')->nullable()->default(null);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->string('name', 45);
|
||||
$table->string('codename', 45);
|
||||
$table->string('brand',45);
|
||||
$table->string('registrationNumber', 15);
|
||||
$table->integer('productionYear');
|
||||
$table->date('ExaminationExpirationDate');
|
||||
$table->date('insuranceExpirationDate');
|
||||
$table->string('driveType',45); //układ napędowy
|
||||
$table->string('chassisType',45); //typ podwozia
|
||||
$table->string('bodyProducer',45); //producent nadwozia
|
||||
$table->integer('crewNumber');
|
||||
$table->integer('foamAgent'); //Ilość środka pianotwórczego w litrach
|
||||
$table->integer('enginePower'); //Moc silnika w kW
|
||||
$table->integer('mass'); //Masa całkowita pojazdu
|
||||
$table->integer('chassisNumber');
|
||||
$table->integer('engineNumber');
|
||||
$table->string('fuelType',45);
|
||||
$table->integer('chassisPoductionYear');
|
||||
$table->date('entryIntoServiceDate');
|
||||
$table->string('fireEnginePumpDescription');// Opis autopompy
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateOperationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.5
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('operations', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('fire_station_id')->unsigned();
|
||||
$table->foreign('fire_station_id')->references('id')->on('fire_stations')->onDelete('cascade');
|
||||
$table->dateTime('operation_date');
|
||||
$table->string('location');
|
||||
$table->string('target');
|
||||
$table->string('danger_type');
|
||||
$table->longtext('description');
|
||||
$table->integer('commander_id')->unsigned();
|
||||
$table->foreign('commander_id')->references('id')->on('users');
|
||||
$table->integer('editor_id')->nullable()->default(null);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('operations');
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateOperationsTrucksTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('operations_vehicles', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('operation_id')->unsigned();
|
||||
$table->foreign('operation_id')->references('id')->on('operations')->onDelete('cascade');
|
||||
$table->integer('vehicle_id')->unsigned();
|
||||
$table->foreign('vehicle_id')->references('id')->on('vehicles');
|
||||
$table->integer('driver_id')->unsigned();
|
||||
$table->foreign('driver_id')->references('id')->on('users');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('operations_vehicles');
|
||||
}
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateOperationsMembersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('operations_members', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('operation_id')->unsigned();
|
||||
$table->foreign('operation_id')->references('id')->on('operations')->onDelete('cascade');
|
||||
$table->integer('member_id')->unsigned();
|
||||
$table->foreign('member_id')->references('id')->on('users');
|
||||
$table->boolean('private_transport');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('operations_members');
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateEquipmentTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('equipment', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('fire_station_id')->unsigned();
|
||||
$table->foreign('fire_station_id')->references('id')->on('fire_stations')->onDelete('cascade');
|
||||
$table->string('name');
|
||||
$table->integer('amount');
|
||||
$table->string('parameter')->nullable();
|
||||
$table->integer('editor_id')->nullable()->default(null);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('equipment');
|
||||
}
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateTrainingsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('trainings', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('fire_station_id')->unsigned()->nullable();
|
||||
$table->foreign('fire_station_id')->references('id')->on('fire_stations')->onDelete('cascade');
|
||||
$table->string('training_name');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('trainings');
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateTrainingsFireFightersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('trainings_firefighters', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('user_id')->unsigned();
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
$table->integer('training_id')->unsigned();
|
||||
$table->foreign('training_id')->references('id')->on('trainings')->onDelete('cascade');
|
||||
$table->date('date_of_completion');
|
||||
$table->date('date_of_expiry');
|
||||
$table->boolean('lifetime');
|
||||
$table->integer('editor_id')->nullable()->default(null);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('trainings_firefighters');
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateDecorationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('decorations', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('decoration_name');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('decorations');
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateDecorationsFirefightersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('decorations_firefighters', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('user_id')->unsigned();
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
$table->integer('decoration_id')->unsigned();
|
||||
$table->foreign('decoration_id')->references('id')->on('decorations')->onDelete('cascade');
|
||||
$table->date('date_of_award');
|
||||
$table->integer('editor_id')->nullable()->default(null);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('decorations_firefighters');
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateProvincesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('provinces', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('provinces');
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateDistrictsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('districts', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('province_id')->unsigned();
|
||||
$table->foreign('province_id')->references('id')->on('provinces')->onDelete('cascade');
|
||||
$table->string('name');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('districts');
|
||||
}
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateCommunesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('communes', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('province_id')->unsigned();
|
||||
$table->foreign('province_id')->references('id')->on('provinces')->onDelete('cascade');
|
||||
$table->integer('district_id')->unsigned();
|
||||
$table->foreign('district_id')->references('id')->on('districts')->onDelete('cascade');
|
||||
$table->string('name');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('communes');
|
||||
}
|
||||
}
|
@ -11,7 +11,6 @@ class DatabaseSeeder extends Seeder
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
|
||||
//województwa
|
||||
DB::table('wojewodztwa')->insert([ 'id' => '1020000', 'name' => 'dolnośląskie' ]);
|
||||
DB::table('wojewodztwa')->insert([ 'id' => '1040000', 'name' => 'kujawsko-pomorskie' ]);
|
||||
@ -2914,62 +2913,5 @@ class DatabaseSeeder extends Seeder
|
||||
DB::table('gminy')->insert([ 'id' => '1326101', 'wojewodztwo_id' => '1320000', 'powiat_id' => '1326100', 'name' => 'm. Koszalin' ]);
|
||||
DB::table('gminy')->insert([ 'id' => '1326201', 'wojewodztwo_id' => '1320000', 'powiat_id' => '1326200', 'name' => 'm. Szczecin' ]);
|
||||
DB::table('gminy')->insert([ 'id' => '1326301', 'wojewodztwo_id' => '1320000', 'powiat_id' => '1326300', 'name' => 'm. Świnoujście' ]);
|
||||
//jednostki
|
||||
DB::table('fireStations')->insert(['id'=>'1100','name'=>'Kębłowo','number'=>'1100','voivodeship'=>'wielkopolskie','county'=>'wolsztyński','community'=>'gm. Wolsztyn','postOffice'=>'Kębłowo','zipCode'=>'64223','address'=>'ul. Nowa 8a','latitude'=>'52.0485042','longitude'=>'16.1052983','KRS'=>'0000232331','NIP'=>'9231571641','phoneNumber'=>'501234567','email'=>'straz@keblowo.pl','deleted'=>'0','creatorID'=>'1101','changingID'=>'1101','remember_token'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('fireStations')->insert(['id'=>'1200','name'=>'Obra','number'=>'1200','voivodeship'=>'wielkopolskie','county'=>'wolsztyński','community'=>'gm. Wolsztyn','postOffice'=>'Obra','zipCode'=>'64211','address'=>'ul. Cmentarna 5a','latitude'=>'52.0768963','longitude'=>'16.0427013','KRS'=>'0000096776','NIP'=>'9231571629','phoneNumber'=>'501234567','email'=>'osp.obra@wp.pl','deleted'=>'0','creatorID'=>'1201','changingID'=>'1201','remember_token'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
//użytkownicy
|
||||
DB::table('users')->insert(['id'=>'1101','password'=>'$2y$10$hSeo4pAvQLmV8KzQWoOEXuMEiN7dqOb4jEU80g.xsUS6W5.sh5I4m','name'=>'Szymon','surname'=>'Tomys','PESEL'=>'74073147926','phoneNumber'=>'501234567','email'=>'szymon.tomys@eosp.projektstudencki.pl','fireStationID'=>'1100','functionID'=>'1','degreeID'=>'1','number'=>'ABC123','statusID'=>'0','deleted'=>'0','creatorID'=>NULL,'changingID'=>NULL,'confirmed'=>'0','confirmation_code'=>NULL,'email_verified_at'=>NULL,'remember_token'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('users')->insert(['id'=>'1102','password'=>'$2y$10$hSeo4pAvQLmV8KzQWoOEXuMEiN7dqOb4jEU80g.xsUS6W5.sh5I4m','name'=>'Hanna','surname'=>'Nowacka','PESEL'=>'74073147926','phoneNumber'=>'501234567','email'=>'hanna.nowacka@eosp.projektstudencki.pl','fireStationID'=>'1100','functionID'=>'2','degreeID'=>'2','number'=>'ABC123','statusID'=>'0','deleted'=>'0','creatorID'=>NULL,'changingID'=>NULL,'confirmed'=>'0','confirmation_code'=>NULL,'email_verified_at'=>NULL,'remember_token'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('users')->insert(['id'=>'1103','password'=>'$2y$10$hSeo4pAvQLmV8KzQWoOEXuMEiN7dqOb4jEU80g.xsUS6W5.sh5I4m','name'=>'Dominik','surname'=>'Klupsz','PESEL'=>'74073147926','phoneNumber'=>'501234567','email'=>'dominik.klupsz@eosp.projektstudencki.pl','fireStationID'=>'1100','functionID'=>'3','degreeID'=>'3','number'=>'ABC123','statusID'=>'0','deleted'=>'0','creatorID'=>NULL,'changingID'=>NULL,'confirmed'=>'0','confirmation_code'=>NULL,'email_verified_at'=>NULL,'remember_token'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('users')->insert(['id'=>'1104','password'=>'$2y$10$hSeo4pAvQLmV8KzQWoOEXuMEiN7dqOb4jEU80g.xsUS6W5.sh5I4m','name'=>'Kamila','surname'=>'Prządka','PESEL'=>'74073147926','phoneNumber'=>'501234567','email'=>'kamila.przadka@eosp.projektstudencki.pl','fireStationID'=>'1100','functionID'=>'4','degreeID'=>'4','number'=>'ABC123','statusID'=>'0','deleted'=>'0','creatorID'=>NULL,'changingID'=>NULL,'confirmed'=>'0','confirmation_code'=>NULL,'email_verified_at'=>NULL,'remember_token'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('users')->insert(['id'=>'1105','password'=>'$2y$10$hSeo4pAvQLmV8KzQWoOEXuMEiN7dqOb4jEU80g.xsUS6W5.sh5I4m','name'=>'Rafał','surname'=>'Smerdka','PESEL'=>'74073147926','phoneNumber'=>'501234567','email'=>'rafal.smerdka@eosp.projektstudencki.pl','fireStationID'=>'1100','functionID'=>'5','degreeID'=>'5','number'=>'ABC123','statusID'=>'0','deleted'=>'0','creatorID'=>NULL,'changingID'=>NULL,'confirmed'=>'0','confirmation_code'=>NULL,'email_verified_at'=>NULL,'remember_token'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('users')->insert(['id'=>'1201','password'=>'$2y$10$hSeo4pAvQLmV8KzQWoOEXuMEiN7dqOb4jEU80g.xsUS6W5.sh5I4m','name'=>'Damian','surname'=>'Kotlarski','PESEL'=>'74073147926','phoneNumber'=>'501234567','email'=>'damian.kotlarski@eosp.projektstudencki.pl','fireStationID'=>'1200','functionID'=>'1','degreeID'=>'1','number'=>'ABC123','statusID'=>'0','deleted'=>'0','creatorID'=>NULL,'changingID'=>NULL,'confirmed'=>'0','confirmation_code'=>NULL,'email_verified_at'=>NULL,'remember_token'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('users')->insert(['id'=>'1202','password'=>'$2y$10$hSeo4pAvQLmV8KzQWoOEXuMEiN7dqOb4jEU80g.xsUS6W5.sh5I4m','name'=>'Artur','surname'=>'Orwat','PESEL'=>'74073147926','phoneNumber'=>'501234567','email'=>'artur.orwat@eosp.projektstudencki.pl','fireStationID'=>'1200','functionID'=>'2','degreeID'=>'2','number'=>'ABC123','statusID'=>'0','deleted'=>'0','creatorID'=>NULL,'changingID'=>NULL,'confirmed'=>'0','confirmation_code'=>NULL,'email_verified_at'=>NULL,'remember_token'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('users')->insert(['id'=>'1203','password'=>'$2y$10$hSeo4pAvQLmV8KzQWoOEXuMEiN7dqOb4jEU80g.xsUS6W5.sh5I4m','name'=>'Michał','surname'=>'Rogozinski','PESEL'=>'74073147926','phoneNumber'=>'501234567','email'=>'michal.rogozinski@eosp.projektstudencki.pl','fireStationID'=>'1200','functionID'=>'3','degreeID'=>'3','number'=>'ABC123','statusID'=>'0','deleted'=>'0','creatorID'=>NULL,'changingID'=>NULL,'confirmed'=>'0','confirmation_code'=>NULL,'email_verified_at'=>NULL,'remember_token'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('users')->insert(['id'=>'1204','password'=>'$2y$10$hSeo4pAvQLmV8KzQWoOEXuMEiN7dqOb4jEU80g.xsUS6W5.sh5I4m','name'=>'Lidia','surname'=>'Kaczmarek','PESEL'=>'74073147926','phoneNumber'=>'501234567','email'=>'lidia.kaczmarek@eosp.projektstudencki.pl','fireStationID'=>'1200','functionID'=>'4','degreeID'=>'4','number'=>'ABC123','statusID'=>'0','deleted'=>'0','creatorID'=>NULL,'changingID'=>NULL,'confirmed'=>'0','confirmation_code'=>NULL,'email_verified_at'=>NULL,'remember_token'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('users')->insert(['id'=>'1205','password'=>'$2y$10$hSeo4pAvQLmV8KzQWoOEXuMEiN7dqOb4jEU80g.xsUS6W5.sh5I4m','name'=>'Michał','surname'=>'Nowak','PESEL'=>'74073147926','phoneNumber'=>'501234567','email'=>'michal.nowak@eosp.projektstudencki.pl','fireStationID'=>'1200','functionID'=>'5','degreeID'=>'5','number'=>'ABC123','statusID'=>'0','deleted'=>'0','creatorID'=>NULL,'changingID'=>NULL,'confirmed'=>'0','confirmation_code'=>NULL,'email_verified_at'=>NULL,'remember_token'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
|
||||
//pojazdy
|
||||
DB::table('vehicles')->insert(['id'=>'1101','fireStationID'=>'1100','name'=>'Peugeot Boxer','codename'=>'649P28','brand'=>'Peugeot','registrationNumber'=>'PWL37998','productionYear'=>'2017','examExpirationDate'=>'2020-12-31','insuranceExpirationDate'=>'2020-12-31','driveType'=>'4x2','chassisType'=>'Peugeot Boxer GLBA','bodyProducer'=>'IUVO CARS','crewNumber'=>'6','foamAgent'=>'20','enginePower'=>'163','mass'=>'3500','chassisNumber'=>'1ABCD23EFGH456789','engineNumber'=>'123456','fuelType'=>'diesel','chassisPoductionYear'=>'2017','entryIntoServiceDate'=>'2017-02-08','fireEnginePumpDescription'=>'motopompa','deleted_at'=>NULL,'created_at'=>now(),'updated_at'=>now(),'status'=>'0']);
|
||||
DB::table('vehicles')->insert(['id'=>'1102','fireStationID'=>'1100','name'=>'MAN','codename'=>'649P08','brand'=>'MAN','registrationNumber'=>'PWL32998','productionYear'=>'2016','examExpirationDate'=>'2020-12-31','insuranceExpirationDate'=>'2020-12-31','driveType'=>'4x4','chassisType'=>'MAN TGM 18.340 4x4','bodyProducer'=>'Stolarczyk','crewNumber'=>'6','foamAgent'=>'600','enginePower'=>'350','mass'=>'6000','chassisNumber'=>'1ABCD23EFGH456789','engineNumber'=>'123456','fuelType'=>'diesel','chassisPoductionYear'=>'2016','entryIntoServiceDate'=>'2016-02-16','fireEnginePumpDescription'=>'autopompa dwuzakresowa','deleted_at'=>NULL,'created_at'=>now(),'updated_at'=>now(),'status'=>'0']);
|
||||
DB::table('vehicles')->insert(['id'=>'1201','fireStationID'=>'1200','name'=>'TIMON','codename'=>'649P09','brand'=>'Volvo','registrationNumber'=>'PWL52295','productionYear'=>'2019','examExpirationDate'=>'2020-12-31','insuranceExpirationDate'=>'2020-12-31','driveType'=>'4x4','chassisType'=>'Volvo FL 4X4','bodyProducer'=>'Bocar','crewNumber'=>'6','foamAgent'=>'300','enginePower'=>'285','mass'=>'5000','chassisNumber'=>'1ABCD23EFGH456789','engineNumber'=>'123456','fuelType'=>'diesel','chassisPoductionYear'=>'2019','entryIntoServiceDate'=>'2019-11-19','fireEnginePumpDescription'=>'autopompa dwuzakresowa','deleted_at'=>NULL,'created_at'=>now(),'updated_at'=>now(),'status'=>'0']);
|
||||
DB::table('vehicles')->insert(['id'=>'1202','fireStationID'=>'1200','name'=>'RAFI','codename'=>'649P26','brand'=>'STAR','registrationNumber'=>'PWL40CK','productionYear'=>'2000','examExpirationDate'=>'2020-12-31','insuranceExpirationDate'=>'2020-12-31','driveType'=>'4x2','chassisType'=>'Star 12-185','bodyProducer'=>'Stolarczyk','crewNumber'=>'6','foamAgent'=>'300','enginePower'=>'200','mass'=>'5000','chassisNumber'=>'1ABCD23EFGH456789','engineNumber'=>'123456','fuelType'=>'diesel','chassisPoductionYear'=>'2000','entryIntoServiceDate'=>'2010-04-01','fireEnginePumpDescription'=>'motopompa','deleted_at'=>NULL,'created_at'=>now(),'updated_at'=>now(),'status'=>'0']);
|
||||
//sprzęt
|
||||
DB::table('equipment')->insert(['id'=>'1101','fireStationID'=>'1100','name'=>'Wąż tłoczny W-52','amount'=>'13','parameter'=>NULL,'deleted_at'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('equipment')->insert(['id'=>'1102','fireStationID'=>'1100','name'=>'Przełącznik 75/52','amount'=>'1','parameter'=>NULL,'deleted_at'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('equipment')->insert(['id'=>'1103','fireStationID'=>'1100','name'=>'Prądownica wodna typu TURBO - 400dm3/min','amount'=>'2','parameter'=>NULL,'deleted_at'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('equipment')->insert(['id'=>'1104','fireStationID'=>'1100','name'=>'Piła łańcuchowa Stihl MS 290','amount'=>'1','parameter'=>NULL,'deleted_at'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('equipment')->insert(['id'=>'1105','fireStationID'=>'1100','name'=>'Motopompa przenośna - 800 dm3/min PO5','amount'=>'1','parameter'=>'800l/min 8 atm.','deleted_at'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('equipment')->insert(['id'=>'1201','fireStationID'=>'1200','name'=>'Wąż tłoczny W-52','amount'=>'13','parameter'=>NULL,'deleted_at'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('equipment')->insert(['id'=>'1202','fireStationID'=>'1200','name'=>'Przełącznik 75/52','amount'=>'1','parameter'=>NULL,'deleted_at'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('equipment')->insert(['id'=>'1203','fireStationID'=>'1200','name'=>'Prądownica wodna typu TURBO - 400dm3/min','amount'=>'2','parameter'=>NULL,'deleted_at'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('equipment')->insert(['id'=>'1204','fireStationID'=>'1200','name'=>'Piła łańcuchowa Stihl MS 290','amount'=>'1','parameter'=>NULL,'deleted_at'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('equipment')->insert(['id'=>'1205','fireStationID'=>'1200','name'=>'Motopompa przenośna - 800 dm3/min PO5','amount'=>'1','parameter'=>'800l/min 8 atm.','deleted_at'=>NULL,'created_at'=>now(),'updated_at'=>now()]);
|
||||
//szkolenia
|
||||
DB::table('trainings')->insert(['id'=>'1110','fireStationID'=>'1100','trainingName'=>'Certyfikowany kurs ratownictwa medycznego','created_at'=>now(),'updated_at'=>now(),'deleted_at'=>NULL]);
|
||||
DB::table('trainings')->insert(['id'=>'1120','fireStationID'=>'1100','trainingName'=>'Kurs drwali-pilarzy','created_at'=>now(),'updated_at'=>now(),'deleted_at'=>NULL]);
|
||||
DB::table('trainings')->insert(['id'=>'1210','fireStationID'=>'1200','trainingName'=>'Kurs kwalifikowanej pierwszej pomocy','created_at'=>now(),'updated_at'=>now(),'deleted_at'=>NULL]);
|
||||
DB::table('trainings')->insert(['id'=>'1220','fireStationID'=>'1200','trainingName'=>'Nabycie uprawnień do napełniania butli powietrzem','created_at'=>now(),'updated_at'=>now(),'deleted_at'=>NULL]);
|
||||
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1111','firefighterID'=>'1101','trainingID'=>'1110','dateOfComplete'=>'2009-03-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1112','firefighterID'=>'1102','trainingID'=>'1110','dateOfComplete'=>'2009-03-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1113','firefighterID'=>'1103','trainingID'=>'1110','dateOfComplete'=>'2009-03-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1114','firefighterID'=>'1104','trainingID'=>'1110','dateOfComplete'=>'2009-03-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1115','firefighterID'=>'1105','trainingID'=>'1110','dateOfComplete'=>'2009-03-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1121','firefighterID'=>'1101','trainingID'=>'1120','dateOfComplete'=>'2010-02-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1122','firefighterID'=>'1102','trainingID'=>'1120','dateOfComplete'=>'2010-02-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1123','firefighterID'=>'1103','trainingID'=>'1120','dateOfComplete'=>'2010-02-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1124','firefighterID'=>'1104','trainingID'=>'1120','dateOfComplete'=>'2010-02-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1125','firefighterID'=>'1105','trainingID'=>'1120','dateOfComplete'=>'2010-02-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1211','firefighterID'=>'1201','trainingID'=>'1210','dateOfComplete'=>'2010-03-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1212','firefighterID'=>'1202','trainingID'=>'1210','dateOfComplete'=>'2010-03-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1213','firefighterID'=>'1203','trainingID'=>'1210','dateOfComplete'=>'2010-03-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1214','firefighterID'=>'1204','trainingID'=>'1210','dateOfComplete'=>'2010-03-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1215','firefighterID'=>'1205','trainingID'=>'1210','dateOfComplete'=>'2010-03-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1221','firefighterID'=>'1201','trainingID'=>'1220','dateOfComplete'=>'2009-10-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1222','firefighterID'=>'1202','trainingID'=>'1220','dateOfComplete'=>'2009-10-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1223','firefighterID'=>'1203','trainingID'=>'1220','dateOfComplete'=>'2009-10-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1224','firefighterID'=>'1204','trainingID'=>'1220','dateOfComplete'=>'2009-10-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
DB::table('trainingsFirefighters')->insert(['id'=>'1225','firefighterID'=>'1205','trainingID'=>'1220','dateOfComplete'=>'2009-10-01','dateOfExpiry'=>'2021-12-31','lifetime'=>'1','created_at'=>now(),'updated_at'=>now()]);
|
||||
}
|
||||
}
|
||||
|
@ -20,10 +20,6 @@
|
||||
"resolve-url-loader": "^2.3.1",
|
||||
"sass": "^1.15.2",
|
||||
"sass-loader": "^7.1.0",
|
||||
"vue": "^2.5.17",
|
||||
"vue-template-compiler": "^2.6.11"
|
||||
},
|
||||
"dependencies": {
|
||||
"mtr-datepicker": "^0.3.7"
|
||||
"vue": "^2.5.17"
|
||||
}
|
||||
}
|
||||
|
11365
public/css/app.css
vendored
11365
public/css/app.css
vendored
File diff suppressed because one or more lines are too long
2
public/css/theme.css
vendored
2
public/css/theme.css
vendored
@ -106,7 +106,7 @@ body {
|
||||
}
|
||||
|
||||
#left-menu ul li {
|
||||
width: 198px;
|
||||
width: 170px;
|
||||
height: 50px;
|
||||
border-radius: 5px;
|
||||
background: linear-gradient(white, #d6d6dd, white);
|
||||
|
49495
public/js/app.js
vendored
49495
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
@ -1,4 +0,0 @@
|
||||
{
|
||||
"/js/app.js": "/js/app.js",
|
||||
"/css/app.css": "/css/app.css"
|
||||
}
|
@ -161,34 +161,8 @@ return [
|
||||
'unitName' => 'nazwa jednostki',
|
||||
'longitude' => 'długość geograficzna',
|
||||
'latitude' => 'szerokość geograficzna',
|
||||
'amount' => 'ilość',
|
||||
'decoration' => 'odznaczenie',
|
||||
'dateOfAward' => 'data przyznania',
|
||||
'brand' => 'marka',
|
||||
'vehicleName' => 'nazwa pojazdu',
|
||||
'registrationNumber' => 'numer rejestracyjny',
|
||||
'productionYear' => 'rok produkcji',
|
||||
'driveType' => 'układ napędowy',
|
||||
'chassisType' => 'typ podwozia',
|
||||
'bodyProducer' => 'producent nadwozia',
|
||||
'crewNumber' => 'ilość osób w załodze',
|
||||
'mass' => 'masa',
|
||||
'chassisNumber' => 'numer podwozia',
|
||||
'engineNumber' => 'numer silnika',
|
||||
'fuelType' => 'rodzaj paliwa',
|
||||
'chassisPoductionYear' => 'rok produkcji podwozia',
|
||||
'fireEnginePumpDescription' => 'opis autopompy',
|
||||
'operationDate' =>'data wyjazdu',
|
||||
'operationLocation' =>'miejsce akcji',
|
||||
'operationTarget' =>'cel wyjazdu',
|
||||
'operationDangerType' =>'rodzaj zagrożenia',
|
||||
'operationDescription' =>'opis akcji',
|
||||
'operationLeader' =>'dowodzący',
|
||||
'operationDriver.*' =>'kierowca',
|
||||
'operationVehicle.*' =>'pojazd',
|
||||
'parameter' =>'parametr charakterystyczny',
|
||||
|
||||
],
|
||||
|
||||
|
||||
|
||||
];
|
||||
|
201
resources/views/bootstable.js
vendored
201
resources/views/bootstable.js
vendored
@ -1,201 +0,0 @@
|
||||
/*
|
||||
Bootstable
|
||||
@description Javascript library to make HMTL tables editable, using Bootstrap
|
||||
@version 1.1
|
||||
@autor Tito Hinostroza
|
||||
*/
|
||||
"use strict";
|
||||
//Global variables
|
||||
var params = null; //Parameters
|
||||
var colsEdi =null;
|
||||
var newColHtml = '<div class="btn-group pull-right">'+
|
||||
'<button id="bEdit" type="button" class="btn btn-sm btn-default" onclick="rowEdit(this);">' +
|
||||
'<span class="glyphicon glyphicon-pencil" > </span>'+
|
||||
'</button>'+
|
||||
'<button id="bElim" type="button" class="btn btn-sm btn-default" onclick="rowElim(this);">' +
|
||||
'<span class="glyphicon glyphicon-trash" > </span>'+
|
||||
'</button>'+
|
||||
'<button id="bAcep" type="button" class="btn btn-sm btn-default" style="display:none;" onclick="rowAcep(this);">' +
|
||||
'<span class="glyphicon glyphicon-ok" > </span>'+
|
||||
'</button>'+
|
||||
'<button id="bCanc" type="button" class="btn btn-sm btn-default" style="display:none;" onclick="rowCancel(this);">' +
|
||||
'<span class="glyphicon glyphicon-remove" > </span>'+
|
||||
'</button>'+
|
||||
'</div>';
|
||||
var colEdicHtml = '<td name="buttons">'+newColHtml+'</td>';
|
||||
|
||||
$.fn.SetEditable = function (options) {
|
||||
var defaults = {
|
||||
columnsEd: null, //Index to editable columns. If null all td editables. Ex.: "1,2,3,4,5"
|
||||
$addButton: null, //Jquery object of "Add" button
|
||||
onEdit: function() {}, //Called after edition
|
||||
onBeforeDelete: function() {}, //Called before deletion
|
||||
onDelete: function() {}, //Called after deletion
|
||||
onAdd: function() {} //Called when added a new row
|
||||
};
|
||||
params = $.extend(defaults, options);
|
||||
this.find('thead tr').append('<th name="buttons"></th>'); //encabezado vacío
|
||||
this.find('tbody tr').append(colEdicHtml);
|
||||
var $tabedi = this; //Read reference to the current table, to resolve "this" here.
|
||||
//Process "addButton" parameter
|
||||
if (params.$addButton != null) {
|
||||
//Se proporcionó parámetro
|
||||
params.$addButton.click(function() {
|
||||
rowAddNew($tabedi.attr("id"));
|
||||
});
|
||||
}
|
||||
//Process "columnsEd" parameter
|
||||
if (params.columnsEd != null) {
|
||||
//Extract felds
|
||||
colsEdi = params.columnsEd.split(',');
|
||||
}
|
||||
};
|
||||
function IterarCamposEdit($cols, tarea) {
|
||||
//Itera por los campos editables de una fila
|
||||
var n = 0;
|
||||
$cols.each(function() {
|
||||
n++;
|
||||
if ($(this).attr('name')=='buttons') return; //excluye columna de botones
|
||||
if (!EsEditable(n-1)) return; //noe s campo editable
|
||||
tarea($(this));
|
||||
});
|
||||
|
||||
function EsEditable(idx) {
|
||||
//Indica si la columna pasada está configurada para ser editable
|
||||
if (colsEdi==null) { //no se definió
|
||||
return true; //todas son editable
|
||||
} else { //hay filtro de campos
|
||||
//alert('verificando: ' + idx);
|
||||
for (var i = 0; i < colsEdi.length; i++) {
|
||||
if (idx == colsEdi[i]) return true;
|
||||
}
|
||||
return false; //no se encontró
|
||||
}
|
||||
}
|
||||
}
|
||||
function FijModoNormal(but) {
|
||||
$(but).parent().find('#bAcep').hide();
|
||||
$(but).parent().find('#bCanc').hide();
|
||||
$(but).parent().find('#bEdit').show();
|
||||
$(but).parent().find('#bElim').show();
|
||||
var $row = $(but).parents('tr'); //accede a la fila
|
||||
$row.attr('id', ''); //quita marca
|
||||
}
|
||||
function FijModoEdit(but) {
|
||||
$(but).parent().find('#bAcep').show();
|
||||
$(but).parent().find('#bCanc').show();
|
||||
$(but).parent().find('#bEdit').hide();
|
||||
$(but).parent().find('#bElim').hide();
|
||||
var $row = $(but).parents('tr'); //accede a la fila
|
||||
$row.attr('id', 'editing'); //indica que está en edición
|
||||
}
|
||||
function ModoEdicion($row) {
|
||||
if ($row.attr('id')=='editing') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function rowAcep(but) {
|
||||
//Acepta los cambios de la edición
|
||||
var $row = $(but).parents('tr'); //accede a la fila
|
||||
var $cols = $row.find('td'); //lee campos
|
||||
if (!ModoEdicion($row)) return; //Ya está en edición
|
||||
//Está en edición. Hay que finalizar la edición
|
||||
IterarCamposEdit($cols, function($td) { //itera por la columnas
|
||||
var cont = $td.find('input').val(); //lee contenido del input
|
||||
$td.html(cont); //fija contenido y elimina controles
|
||||
});
|
||||
FijModoNormal(but);
|
||||
params.onEdit($row);
|
||||
}
|
||||
function rowCancel(but) {
|
||||
//Rechaza los cambios de la edición
|
||||
var $row = $(but).parents('tr'); //accede a la fila
|
||||
var $cols = $row.find('td'); //lee campos
|
||||
if (!ModoEdicion($row)) return; //Ya está en edición
|
||||
//Está en edición. Hay que finalizar la edición
|
||||
IterarCamposEdit($cols, function($td) { //itera por la columnas
|
||||
var cont = $td.find('div').html(); //lee contenido del div
|
||||
$td.html(cont); //fija contenido y elimina controles
|
||||
});
|
||||
FijModoNormal(but);
|
||||
}
|
||||
function rowEdit(but) { //Inicia la edición de una fila
|
||||
var $row = $(but).parents('tr'); //accede a la fila
|
||||
var $cols = $row.find('td'); //lee campos
|
||||
if (ModoEdicion($row)) return; //Ya está en edición
|
||||
//Pone en modo de edición
|
||||
IterarCamposEdit($cols, function($td) { //itera por la columnas
|
||||
var cont = $td.html(); //lee contenido
|
||||
var div = '<div style="display: none;">' + cont + '</div>'; //guarda contenido
|
||||
var input = '<input class="form-control input-sm" value="' + cont + '">';
|
||||
$td.html(div + input); //fija contenido
|
||||
});
|
||||
FijModoEdit(but);
|
||||
}
|
||||
function rowElim(but) { //Elimina la fila actual
|
||||
var $row = $(but).parents('tr'); //accede a la fila
|
||||
params.onBeforeDelete($row);
|
||||
$row.remove();
|
||||
params.onDelete();
|
||||
}
|
||||
function rowAddNew(tabId) { //Agrega fila a la tabla indicada.
|
||||
var $tab_en_edic = $("#" + tabId); //Table to edit
|
||||
var $filas = $tab_en_edic.find('tbody tr');
|
||||
if ($filas.length==0) {
|
||||
//No hay filas de datos. Hay que crearlas completas
|
||||
var $row = $tab_en_edic.find('thead tr'); //encabezado
|
||||
var $cols = $row.find('th'); //lee campos
|
||||
//construye html
|
||||
var htmlDat = '';
|
||||
$cols.each(function() {
|
||||
if ($(this).attr('name')=='buttons') {
|
||||
//Es columna de botones
|
||||
htmlDat = htmlDat + colEdicHtml; //agrega botones
|
||||
} else {
|
||||
htmlDat = htmlDat + '<td></td>';
|
||||
}
|
||||
});
|
||||
$tab_en_edic.find('tbody').append('<tr>'+htmlDat+'</tr>');
|
||||
} else {
|
||||
//Hay otras filas, podemos clonar la última fila, para copiar los botones
|
||||
var $ultFila = $tab_en_edic.find('tr:last');
|
||||
$ultFila.clone().appendTo($ultFila.parent());
|
||||
$ultFila = $tab_en_edic.find('tr:last');
|
||||
var $cols = $ultFila.find('td'); //lee campos
|
||||
$cols.each(function() {
|
||||
if ($(this).attr('name')=='buttons') {
|
||||
//Es columna de botones
|
||||
} else {
|
||||
$(this).html(''); //limpia contenido
|
||||
}
|
||||
});
|
||||
}
|
||||
params.onAdd();
|
||||
}
|
||||
function TableToCSV(tabId, separator) { //Convierte tabla a CSV
|
||||
var datFil = '';
|
||||
var tmp = '';
|
||||
var $tab_en_edic = $("#" + tabId); //Table source
|
||||
$tab_en_edic.find('tbody tr').each(function() {
|
||||
//Termina la edición si es que existe
|
||||
if (ModoEdicion($(this))) {
|
||||
$(this).find('#bAcep').click(); //acepta edición
|
||||
}
|
||||
var $cols = $(this).find('td'); //lee campos
|
||||
datFil = '';
|
||||
$cols.each(function() {
|
||||
if ($(this).attr('name')=='buttons') {
|
||||
//Es columna de botones
|
||||
} else {
|
||||
datFil = datFil + $(this).html() + separator;
|
||||
}
|
||||
});
|
||||
if (datFil!='') {
|
||||
datFil = datFil.substr(0, datFil.length-separator.length);
|
||||
}
|
||||
tmp = tmp + datFil + '\n';
|
||||
});
|
||||
return tmp;
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
@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/szkolenia"><li>Szkolenia<img src="../img/left_menu_icon/more.png"></li></a>
|
||||
<a href="/userprofile/odznaczenia"><li>Odznaczenia<img src="../img/left_menu_icon/more.png"></li></a>
|
||||
</ul>
|
||||
@stop
|
||||
|
||||
@section('center-area')
|
||||
@parent
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">Zmiana hasła</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form method="POST" action="/userprofile/passwordchange">
|
||||
@csrf
|
||||
<div class="form-group row">
|
||||
<label for="password" class="col-md-4 col-form-label text-md-right">Obecne hasło</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="current_password" type="password" class="form-control" name="current_password">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="password" class="col-md-4 col-form-label text-md-right">Nowe hasło</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password" type="password" class="form-control" name="password">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="password_confirmation" class="col-md-4 col-form-label text-md-right">Powtórz nowe hasło</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password_confirmation" type="password" class="form-control" name="password_confirmation">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mb-0">
|
||||
<div class="col-md-8 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
Zmień hasło
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@include('inc.formerrors')
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
@ -1,113 +0,0 @@
|
||||
@extends('layout.app')
|
||||
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
|
||||
@section('left-menu')
|
||||
@parent
|
||||
<ul>
|
||||
<a href="/strazacy"><li>Powrót<img src="/img/left_menu_icon/edit.png"></li></a>
|
||||
</ul>
|
||||
@stop
|
||||
@section('center-area')
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
@parent
|
||||
|
||||
@if( auth()->check())
|
||||
@if( auth()->user()->fireStationID == NULL)
|
||||
Jednostka nie istnieje
|
||||
@else
|
||||
@if(count($awardedDecorations) > 0)
|
||||
<p align='center'>
|
||||
<table class='table'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3" scope="colgroup" style="text-align:center">{{ $firefighter->name }} {{ $firefighter->surname }} - odznaczenia</th>
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<th>Odznaczenie</th>
|
||||
<th>Data przyznania</th>
|
||||
<th>Operacja</th>
|
||||
@foreach($awardedDecorations as $awardedDecoration)
|
||||
<tr>
|
||||
<td id="decorationName{{ $awardedDecoration->decorationsFirefightersID }}">{{ $awardedDecoration->decorationName }}</td>
|
||||
<td id="dateOfAward{{ $awardedDecoration->decorationsFirefightersID }}">{{ $awardedDecoration->dateOfAward }}</td>
|
||||
<td>
|
||||
<button class="btn btn-danger" type="submit" id="{{$awardedDecoration->decorationsFirefightersID}}" onclick="deleteButton('{{$awardedDecoration->decorationsFirefightersID}}')">Usuń</button>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
@else
|
||||
{{ $firefighter->name }} {{ $firefighter->surname }} nie posiada żadnych odznaczeń.
|
||||
@endif
|
||||
|
||||
<form method="POST" action="/strazacy/odznaczenia/.$firefighter->id">
|
||||
{{ csrf_field() }}
|
||||
<input type="hidden" class="form-control" name="firefighterID" value="{{ $firefighter->id }}">
|
||||
<div class="form-group">
|
||||
<label for="decoration">Wybierz odznaczenie:</label>
|
||||
<select name="decoration" class="form-control" style="width:300px">
|
||||
<option value="">--- Wybierz odznaczenie ---</option>
|
||||
@foreach ($decoration as $key => $value)
|
||||
@if(Illuminate\Support\Facades\Input::old('decoration') == $key)
|
||||
<option value="{{ $key }}" selected >{{ $value }}</option>
|
||||
@else
|
||||
<option value="{{ $key }}">{{ $value }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dateOfAward">Data przyznania:</label>
|
||||
<input type="date" class="form-control" style="width:300px" id="dateOfAward" name="dateOfAward" value="{{ old('dateOfAward') }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Przyznaj odznaczenie</button>
|
||||
</div>
|
||||
@include('inc.formerrors')
|
||||
</form>
|
||||
@endif
|
||||
@else
|
||||
Brak autoryzacji
|
||||
@endif
|
||||
|
||||
@stop
|
||||
|
||||
<script>
|
||||
|
||||
function deleteButton(decorationID){
|
||||
swal.fire({
|
||||
title: "Czy chcesz usunąć odznaczenie?",
|
||||
width: 'auto',
|
||||
confirmButtonText: 'Tak',
|
||||
cancelButtonText: 'Nie',
|
||||
showCancelButton: true,
|
||||
}).then((result) => {
|
||||
if(result.value){
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: "delete/"+decorationID,
|
||||
type: 'DELETE',
|
||||
data: {
|
||||
"id": decorationID,
|
||||
},
|
||||
success: function (){
|
||||
console.log("it Works");
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
</script>
|
@ -3,13 +3,14 @@
|
||||
@section('left-menu')
|
||||
@parent
|
||||
<ul>
|
||||
<a href="/sprzet"><li>Sprzęt<img src="img/left_menu_icon/more.png"></li></a>
|
||||
<li>Dodaj<img src="img/left_menu_icon/add.png"></li>
|
||||
<li>Edytuj<img src="img/left_menu_icon/edit.png"></li>
|
||||
<li>Usuń<img src="img/left_menu_icon/delete.png"></li>
|
||||
</ul>
|
||||
@stop
|
||||
|
||||
@section('center-area')
|
||||
@parent
|
||||
Strona w budowie
|
||||
<p>Zawarte są tutaj informacje o sprzęcie jaki jest na wyposażeniu strażnicy. W przyszłej wersji eOSP do strażnicy dodane zostaną informacje o posiadanym umundurowaniu oraz gdzie umundurowanie się znajduje(druhowie mundury koszarowe oraz galowe miewają w domach, informacja ta pozwoli na sprawdzenie np jakie są braki w umundurowaniu).</p>
|
||||
|
||||
<p>Zawarte będą tutaj informację o umundurowaniu oraz sprzęcie jaki jest na wyposarzeniu strażnicy oraz informacje gdzie umundurowanie się znajduje(druhowie mundury koszarowe oraz galowe mają w w domach, informacja ta pozwoli na sprawdzenie np jakie są braki w umundurowaniu)</p>
|
||||
@stop
|
@ -1,36 +1,17 @@
|
||||
@extends('layout.app')
|
||||
|
||||
@section('left-menu')
|
||||
@parent
|
||||
<ul>
|
||||
<li>Wnioski</li>
|
||||
<li>Sprawozdania</li>
|
||||
<li>Karta Jednostki</li>
|
||||
|
||||
</ul>
|
||||
@stop
|
||||
|
||||
@section('center-area')
|
||||
@parent
|
||||
@if( auth()->check())
|
||||
@if( auth()->user()->fireStationID != NULL)
|
||||
@if(auth()->user()->accessLevel() == 50)
|
||||
<form action="/pdf/sprzet" method="post">
|
||||
{{ csrf_field() }}
|
||||
<button class="btn btn-info" type="submit">Stan sprzętu</button>
|
||||
</form>
|
||||
@include('inc.loginXX')
|
||||
|
||||
<form action="/pdf/strazacy" method="post">
|
||||
{{ csrf_field() }}
|
||||
<button class="btn btn-info" type="submit">Wykaz strażaków wraz z kontaktem</button>
|
||||
</form>
|
||||
|
||||
<form action="/dokumentacja/wniosek_o_nadanie" method="post">
|
||||
{{ csrf_field() }}
|
||||
<button class="btn btn-info" type="submit">Wniosek o przyznanie odznaczenia</button>
|
||||
</form>
|
||||
|
||||
<form action="/dokumentacja/karta_ewidencyjna" method="post">
|
||||
{{ csrf_field() }}
|
||||
<button class="btn btn-info" type="submit">Karta Ewidencyjna</button>
|
||||
</form>
|
||||
@else
|
||||
Brak dostępu.
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@stop
|
||||
|
@ -1,21 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<h2>Witamy w serwisie eOSP</h2>
|
||||
|
||||
<div>
|
||||
Twoje konto w serwisie eOSP zostało utworzone. Proszę kliknąć w link poniżej by dokonać weryfikacji adresu e-mail {{ URL::to('register/verify/' . $confirmation_code) }}<br/>
|
||||
|
||||
W razie problemów proszę wkleić powyższy link w polu adresowym przeglądarki internetowej.<br/>
|
||||
|
||||
Twoje domyślne hasło w serwisie eOSP: {{ $password }}<br/>
|
||||
|
||||
Po zalogowaniu możesz zmienić hasło w panelu Mój profil -> zmiana hasła.
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,17 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<h2>Twoje hasło w serwisie eOSP zostało zresetowane</h2>
|
||||
|
||||
<div>
|
||||
Twoje nowe hasło to: {{ $password }}<br/>
|
||||
|
||||
Po zalogowaniu możesz zmienić hasło w panelu Mój profil -> zmiana hasła.
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,113 +0,0 @@
|
||||
@extends('layout.app')
|
||||
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
|
||||
@section('left-menu')
|
||||
@parent
|
||||
@if( auth()->check() )
|
||||
@if( auth()->user()->fireStationID != NULL)
|
||||
@if(auth()->user()->accessLevel() == 50)
|
||||
<ul>
|
||||
<a href="sprzet/add"><li>Dodaj<img src="/img/left_menu_icon/add.png"></li></a>
|
||||
@if(auth()->user()->accessLevel() == 50)
|
||||
<form id="myForm" action="{{ route('equipment.pdfALL') }}" method="post" style="display:inline;">
|
||||
{{ csrf_field() }}
|
||||
<input type="hidden" class="form-control" name="fireStationID" value="{{auth()->user()->fireStationID}}">
|
||||
<li onclick="myForm.submit();">Drukuj sprzęt</li>
|
||||
</form>
|
||||
@endif
|
||||
</ul>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@stop
|
||||
|
||||
@section('center-area')
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
@parent
|
||||
|
||||
@if( auth()->check())
|
||||
@if( auth()->user()->fireStationID == NULL)
|
||||
Jednostka nie istnieje
|
||||
@else
|
||||
<p align='center'>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Nazwa</th>
|
||||
<th>Ilość</th>
|
||||
<th>Param. charakterystyczny</th>
|
||||
@if(auth()->user()->accessLevel() == 50)
|
||||
<th>Operacja</th>
|
||||
@endif
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@php
|
||||
$i=1;
|
||||
@endphp
|
||||
@foreach($equipment as $item)
|
||||
<tr>
|
||||
<th>{{$i}}</th>
|
||||
<td id="name{{ $item->id }}">{{ $item->name }}</td>
|
||||
<td id="amount{{ $item->id }}">{{ $item->amount }}</td>
|
||||
<td id="parameter{{ $item->id }}">{{ $item->parameter }}</td>
|
||||
@if(auth()->user()->accessLevel() == 50)
|
||||
<td>
|
||||
<a href="{{ URL::asset('sprzet/edit/'.$item->id) }}" class="btn btn-secondary" role="button">Edytuj</a>
|
||||
<button class="btn btn-danger" type="submit" id="{{$item->id}}" onclick="deleteButton('{{$item->id}}')">Usuń</button>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
|
||||
@php
|
||||
$i++;
|
||||
@endphp
|
||||
@endforeach
|
||||
</table>
|
||||
{{ $equipment->links() }}
|
||||
</p>
|
||||
|
||||
@endif
|
||||
@else
|
||||
Brak autoryzacji
|
||||
@endif
|
||||
|
||||
@stop
|
||||
|
||||
<script>
|
||||
|
||||
function deleteButton(itemID){
|
||||
swal.fire({
|
||||
title: "Czy chcesz usunąć sprzęt?",
|
||||
width: 'auto',
|
||||
confirmButtonText: 'Tak',
|
||||
cancelButtonText: 'Nie',
|
||||
showCancelButton: true,
|
||||
}).then((result) => {
|
||||
if(result.value){
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: "sprzet/"+itemID,
|
||||
type: 'DELETE',
|
||||
data: {
|
||||
"id": itemID,
|
||||
},
|
||||
success: function (){
|
||||
console.log("it Works");
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
</script>
|
@ -1,34 +0,0 @@
|
||||
@extends('layout.app')
|
||||
|
||||
@section('left-menu')
|
||||
@parent
|
||||
<ul>
|
||||
<a href="/sprzet"><li>Przeglądaj<img src="/img/left_menu_icon/more.png"></li></a>
|
||||
</ul>
|
||||
@stop
|
||||
|
||||
@section('center-area')
|
||||
@parent
|
||||
<form method="POST" action="/sprzet">
|
||||
{{ csrf_field() }}
|
||||
<div class="form-group">
|
||||
<label for="name">Nazwa:</label>
|
||||
<input type="text" class="form-control" id="name" name="name" value="{{ old('name') }} ">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="amount">Ilość:</label>
|
||||
<input type="text" class="form-control" id="amount" name="amount" value="{{ old('amount') }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parameter">Parametr charakterystyczny:</label>
|
||||
<input type="text" class="form-control" id="parameter" name="parameter" value="{{ old('parameter') }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Utwórz</button>
|
||||
</div>
|
||||
@include('inc.formerrors')
|
||||
</form>
|
||||
@stop
|
@ -1,37 +0,0 @@
|
||||
@extends('layout.app')
|
||||
|
||||
@section('left-menu')
|
||||
@parent
|
||||
<ul>
|
||||
<a href="/sprzet/add"><li>Dodaj<img src="/img/left_menu_icon/add.png"></li></a>
|
||||
<a href="/sprzet"><li>Przeglądaj<img src="/img/left_menu_icon/more.png"></li></a>
|
||||
</ul>
|
||||
@stop
|
||||
|
||||
@section('center-area')
|
||||
@parent
|
||||
<form method="POST" action="/sprzet/edit">
|
||||
{{ csrf_field() }}
|
||||
|
||||
<input type="hidden" class="form-control" name="equipmentID" value="{{ $equipment->id }}">
|
||||
<div class="form-group">
|
||||
<label for="name">Nazwa:</label>
|
||||
<input type="text" class="form-control" id="name" name="name" value="{{ $equipment->name }} ">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="amount">Ilość:</label>
|
||||
<input type="text" class="form-control" id="amount" name="amount" value="{{ $equipment->amount }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parameter">Parametr charakterystyczny:</label>
|
||||
<input type="text" class="form-control" id="parameter" name="parameter" value="{{ $equipment->parameter }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zapisz</button>
|
||||
</div>
|
||||
@include('inc.formerrors')
|
||||
</form>
|
||||
@stop
|
@ -2,23 +2,13 @@
|
||||
|
||||
@section('left-menu')
|
||||
@parent
|
||||
@if( auth()->check() )
|
||||
@if( auth()->user()->fireStationID != NULL)
|
||||
@if(auth()->user()->accessLevel() == 50)
|
||||
<ul>
|
||||
<a href="/strazacy/add"><li>Dodaj<img src="img/left_menu_icon/add.png"></li></a>
|
||||
<a href="/szkolenia"><li><font size="-2">Badania/Szkolenia</font><img src="/img/left_menu_icon/more.png"></li></a>
|
||||
@if(auth()->user()->accessLevel() == 50)
|
||||
<form id="myForm" action="{{ route('fireFighters.pdfAll') }}" method="post" style="display:inline;">
|
||||
{{ csrf_field() }}
|
||||
<input type="hidden" class="form-control" name="fireStationID" value="{{auth()->user()->fireStationID}}">
|
||||
<li onclick="myForm.submit();">Drukuj wszystkich</li>
|
||||
</form>
|
||||
@endif
|
||||
<li>Edytuj<img src="img/left_menu_icon/edit.png"></li>
|
||||
<li>Wyklucz<img src="img/left_menu_icon/delete.png"></li>
|
||||
<li>Zawieś<img src="img/left_menu_icon/suspended.png"></li>
|
||||
<li>Więcej<img src="img/left_menu_icon/more.png"></li>
|
||||
</ul>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@stop
|
||||
|
||||
<head>
|
||||
@ -77,31 +67,19 @@
|
||||
Jednostka nie istnieje
|
||||
@else
|
||||
|
||||
|
||||
<table class='table'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Imię</th>
|
||||
<th>Nazwisko</th>
|
||||
<th>PESEL</th>
|
||||
<th>E-mail</th>
|
||||
<th>Funkcja</th>
|
||||
<th>Stopień</th>
|
||||
<th>Status</th>
|
||||
@if(auth()->user()->accessLevel() == 50)
|
||||
<th>Operacja</th>
|
||||
@endif
|
||||
<table class='firefighterViewTable'>
|
||||
<tr class='table-header'>
|
||||
<td>Imie</td>
|
||||
<td>Nazwisko</td>
|
||||
<td>PESEL</td>
|
||||
<td>E-mail</td>
|
||||
<td>Funkcja</td>
|
||||
<td>Stopień</td>
|
||||
<td>Status</td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@php
|
||||
$i = 1;
|
||||
@endphp
|
||||
@foreach($users as $user)
|
||||
<tr>
|
||||
<th>{{$i}}</th>
|
||||
<td id="userName{{ $user->id }}">{{ $user->name }}</td>
|
||||
<td id="userSurname{{ $user->id }}">{{ $user->surname }}</td>
|
||||
<td id="userPESEL{{ $user->id }}">{{ $user->PESEL }}</td>
|
||||
@ -109,43 +87,20 @@
|
||||
<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>
|
||||
@if(auth()->user()->accessLevel() == 50)
|
||||
<td>
|
||||
<a href="{{ URL::asset('strazacy/edit/'.$user->id) }}" class="btn btn-secondary" role="button">Edytuj</a>
|
||||
<a href="{{ URL::asset('strazacy/odznaczenia/'.$user->id) }}" class="btn btn-success" role="button">Odznaczenia</a>
|
||||
|
||||
<form action="{{ route('fireFighters.pdfSingle') }}" method="post" style="display:inline;">
|
||||
{{ csrf_field() }}
|
||||
<input type="hidden" class="form-control" name="userID" value="{{$user->id}}">
|
||||
<button class="btn btn-dark" type="submit">Drukuj</button>
|
||||
</form>
|
||||
|
||||
@if( auth()->user()->id != $user->id)
|
||||
@if ($user->statusID == 0)
|
||||
<form method="POST" action="/strazacy/deactivate" style="display:inline;">
|
||||
{{ csrf_field() }}
|
||||
<input type="hidden" class="form-control" name="userID" value="{{ $user->id }}">
|
||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zawieś</button>
|
||||
</form>
|
||||
@elseif ($user->statusID == 1)
|
||||
<form method="POST" action="/strazacy/activate" style="display:inline;" >
|
||||
{{ csrf_field() }}
|
||||
<input type="hidden" class="form-control" name="userID" value="{{ $user->id }}">
|
||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Przywróć</button>
|
||||
</form>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
</td>
|
||||
@endif
|
||||
<td><a href="{{ URL::asset('strazacy/edit/'.$user->id) }}"><input type="button" onclick="" value="Edytuj"> </a></td>
|
||||
</tr>
|
||||
@php
|
||||
$i++;
|
||||
@endphp
|
||||
{{-- <tr>--}}
|
||||
{{-- <form id="editForm{{$user->id}}" method="POST" action="/strazacy">--}}
|
||||
{{-- {{ csrf_field() }}--}}
|
||||
{{-- <div class="form-group">--}}
|
||||
{{-- <label for="name">Imię:</label>--}}
|
||||
{{-- <input type="text" class="form-control" id="name" name="name" value="{{ old('name') }} ">--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </form>--}}
|
||||
{{-- </tr>--}}
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
{{ $users->links() }}
|
||||
</table>"
|
||||
|
||||
@endif
|
||||
@else
|
||||
Brak autoryzacji
|
||||
@ -156,3 +111,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -3,8 +3,11 @@
|
||||
@section('left-menu')
|
||||
@parent
|
||||
<ul>
|
||||
<a href="/strazacy"><li>Przeglądaj<img src="/img/left_menu_icon/more.png"></li></a>
|
||||
<a href="/szkolenia"><li><font size="-2">Badania/Szkolenia</font><img src="/img/left_menu_icon/more.png"></li></a>
|
||||
<a href="/strazacy/add"><li>Dodaj<img src="../img/left_menu_icon/add.png"></li></a>
|
||||
<li>Edytuj<img src="../img/left_menu_icon/edit.png"></li>
|
||||
<li>Wyklucz<img src="../img/left_menu_icon/delete.png"></li>
|
||||
<li>Zawieś<img src="../img/left_menu_icon/suspended.png"></li>
|
||||
<li>Więcej<img src="../img/left_menu_icon/more.png"></li>
|
||||
</ul>
|
||||
@stop
|
||||
|
||||
@ -59,7 +62,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Utwórz</button>
|
||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
@include('inc.formerrors')
|
||||
</form>
|
||||
|
@ -3,8 +3,11 @@
|
||||
@section('left-menu')
|
||||
@parent
|
||||
<ul>
|
||||
<a href="/strazacy"><li>Przeglądaj<img src="/img/left_menu_icon/more.png"></li></a>
|
||||
<a href="/szkolenia"><li><font size="-2">Badania/Szkolenia</font><img src="/img/left_menu_icon/more.png"></li></a>
|
||||
<a href="/strazacy/add"><li>Dodaj<img src="img/left_menu_icon/add.png"></li></a>
|
||||
<li>Edytuj<img src="img/left_menu_icon/edit.png"></li>
|
||||
<li>Wyklucz<img src="img/left_menu_icon/delete.png"></li>
|
||||
<li>Zawieś<img src="img/left_menu_icon/suspended.png"></li>
|
||||
<li>Więcej<img src="img/left_menu_icon/more.png"></li>
|
||||
</ul>
|
||||
@stop
|
||||
|
||||
@ -24,94 +27,19 @@
|
||||
<input type="text" class="form-control" id="surname" name="surname" value="{{ $fireFighter->surname }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parameter">Drugie imię:</label>
|
||||
<input type="text" class="form-control" id="secondName" name="secondName" value="{{ $fireFighter->secondName }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parameter">Imię ojca:</label>
|
||||
<input type="text" class="form-control" id="fathersName" name="fathersName" value="{{ $fireFighter->fathersName }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parameter">Imię matki:</label>
|
||||
<input type="text" class="form-control" id="mothersName" name="mothersName" value="{{ $fireFighter->mothersName }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Pesel:</label>
|
||||
<input type="text" class="form-control" id="PESEL" name="PESEL" value="{{ $fireFighter->PESEL }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Numer telefonu komórkowego:</label>
|
||||
<label for="name">Numer telefonu:</label>
|
||||
<input type="text" class="form-control" id="phoneNumber" name="phoneNumber" value="{{ $fireFighter->phoneNumber }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parameter">Telefon domowy:</label>
|
||||
<input type="text" class="form-control" id="homePhoneNumber" name="homePhoneNumber" value="{{ $fireFighter->homePhoneNumber }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parameter">Adres zamieszkania:</label>
|
||||
<input type="text" class="form-control" id="address" name="address" value="{{ $fireFighter->address }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parameter">Numer domu:</label>
|
||||
<input type="text" class="form-control" id="apartment" name="apartment" value="{{ $fireFighter->apartment }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parameter">Miejsce urodzenia:</label>
|
||||
<input type="text" class="form-control" id="placeOfBirth" name="placeOfBirth" value="{{ $fireFighter->placeOfBirth }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parameter">Data wstąpienia do OSP:</label>
|
||||
<input type="date" class="form-control" id="joiningOSPDate" name="joiningOSPDate" value="{{ $fireFighter->joiningOSPDate }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parameter">Seria dowodu osobistego:</label>
|
||||
<input type="text" class="form-control" id="IDSeries" name="IDSeries" value="{{ $fireFighter->IDSeries }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parameter">Numer dowodu osobistego:</label>
|
||||
<input type="text" class="form-control" id="IDNumber" name="IDNumber" value="{{ $fireFighter->IDNumber }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parameter">Dowód osobisty ważny do:</label>
|
||||
<input type="date" class="form-control" id="IDValidUntil" name="IDValidUntil" value="{{ $fireFighter->IDValidUntil }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parameter">Numer legitymacji członkowskiej:</label>
|
||||
<input type="text" class="form-control" id="identityCardNumber" name="identityCardNumber" value="{{ $fireFighter->identityCardNumber }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parameter">Prawo jazdy (kategorie):</label>
|
||||
<input type="text" class="form-control" id="driversLicense" name="driversLicense" value="{{ $fireFighter->driversLicense }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parameter">Wykształcenie:</label>
|
||||
<input type="text" class="form-control" id="education" name="education" value="{{ $fireFighter->education }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="parameter">Zawód wyuczony:</label>
|
||||
<input type="text" class="form-control" id="profession" name="profession" value="{{ $fireFighter->profession }}">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zapisz</button>
|
||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Edytuj</button>
|
||||
</div>
|
||||
@include('inc.formerrors')
|
||||
</form>
|
||||
|
@ -1,165 +0,0 @@
|
||||
@extends('layout.app')
|
||||
|
||||
@section('center-area')
|
||||
@parent
|
||||
|
||||
<head>
|
||||
<title>Edycja jednostki straży pożarnej</title>
|
||||
<link rel="stylesheet" href="{{asset('css/app.css')}}">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
|
||||
</head>
|
||||
|
||||
|
||||
<h2>Edytuj jednostkę</h2>
|
||||
<form method="POST" action="/jednostka/edit">
|
||||
{{ csrf_field() }}
|
||||
<input type="hidden" class="form-control" name="fireStationID" value="{{ $fireStation->id }}">
|
||||
<div class="form-group">
|
||||
<label for="name">Nazwa Jednostki:</label>
|
||||
<input type="text" class="form-control" id="fireStationName" name="fireStationName" value="{{ $fireStation->name }} ">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Numer Jednostki:</label>
|
||||
<input type="text" class="form-control" id="number" name="number" value="{{ $fireStation->number }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="voivodeship">Województwo:</label>
|
||||
<select name="voivodeship" class="form-control" style="width:250px">
|
||||
<option value="">--- Wybierz województwo ---</option>
|
||||
@foreach ($voivodeships as $key => $value)
|
||||
<option value="{{ $key }}">{{ $value }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="county">Powiat:</label>
|
||||
<select name="county" class="form-control"style="width:250px">
|
||||
<option>--Wybierz powiat--</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="community">Gmina:</label>
|
||||
<select name="community" class="form-control"style="width:250px">
|
||||
<option>--Wybierz gminę--</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Urząd Pocztowy:</label>
|
||||
<input type="text" class="form-control" id="postOffice" name="postOffice" value="{{ $fireStation->postOffice }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Kod Pocztowy:</label>
|
||||
<input type="text" class="form-control" id="zipCode" name="zipCode" value="{{ $fireStation->zipCode }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Ulica:</label>
|
||||
<input type="text" class="form-control" id="address" name="address" value="{{ $fireStation->address }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Szerokość Geograficzna:</label>
|
||||
<input type="text" class="form-control" id="latitude" name="latitude" value="{{ $fireStation->latitude }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Długość Geograficzna:</label>
|
||||
<input type="text" class="form-control" id="longitude" name="longitude" value="{{ $fireStation->longitude }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">KRS:</label>
|
||||
<input type="text" class="form-control" id="KRS" name="KRS" value="{{ $fireStation->KRS }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">NIP:</label>
|
||||
<input type="text" class="form-control" id="NIP" name="NIP" value="{{ $fireStation->NIP }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Numer telefonu:</label>
|
||||
<input type="text" class="form-control" id="phoneNumber" name="phoneNumber" value="{{ $fireStation->phoneNumber }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Email:</label>
|
||||
<input type="email" class="form-control" id="email" name="email" value="{{ $fireStation->email }}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zapisz</button>
|
||||
</div>
|
||||
@include('inc.formerrors')
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function ()
|
||||
{
|
||||
jQuery('select[name="voivodeship"]').on('change',function(){
|
||||
var voivodeshipID = jQuery(this).val();
|
||||
if(voivodeshipID)
|
||||
{
|
||||
jQuery.ajax({
|
||||
url : '/./jednostka/getcounties/' +voivodeshipID,
|
||||
type : "GET",
|
||||
dataType : "json",
|
||||
success:function(data)
|
||||
{
|
||||
//console.log(data);
|
||||
jQuery('select[name="county"]').empty();
|
||||
jQuery('select[name="county"]').append(new Option('--Wybierz powiat--', ''));
|
||||
jQuery('select[name="community"]').empty();
|
||||
jQuery.each(data, function(key,value){
|
||||
$('select[name="county"]').append('<option value="'+ key +'">'+ value +'</option>');
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$('select[name="county"]').empty();
|
||||
$('select[name="community"]').empty();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
jQuery('select[name="county"]').on('change',function(){
|
||||
var countyID = jQuery(this).val();
|
||||
if(countyID)
|
||||
{
|
||||
jQuery.ajax({
|
||||
url : '/./jednostka/getcommunities/' +countyID,
|
||||
type : "GET",
|
||||
dataType : "json",
|
||||
success:function(data)
|
||||
{
|
||||
//console.log(data);
|
||||
jQuery('select[name="community"]').empty();
|
||||
jQuery.each(data, function(key,value){
|
||||
$('select[name="community"]').append('<option value="'+ key +'">'+ value +'</option>');
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$('select[name="community"]').empty();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
@stop
|
@ -1,20 +0,0 @@
|
||||
|
||||
|
||||
@extends('layout.app')
|
||||
|
||||
@section('center-area')
|
||||
@parent
|
||||
|
||||
Podaj adres email przypisany do Twojego konta. Nowe hasło zostanie wysłane na ten adres. <br><br>
|
||||
<form method="POST" action="/forgottenPassword">
|
||||
{{ csrf_field() }}
|
||||
<div class="form-group">
|
||||
<input type="email" class="form-control" id="email" name="email">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Wyślij</button>
|
||||
</div>
|
||||
@include('inc.formerrors')
|
||||
</form>
|
||||
|
||||
@endsection
|
@ -4,7 +4,7 @@
|
||||
@parent
|
||||
|
||||
<head>
|
||||
<title>Dodawanie jednostki straży pożarnej</title>
|
||||
<title>Laravel Dependent Dropdown Tutorial With Example</title>
|
||||
<link rel="stylesheet" href="{{asset('css/app.css')}}">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
|
||||
@ -16,7 +16,7 @@
|
||||
{{ csrf_field() }}
|
||||
<div class="form-group">
|
||||
<label for="name">Nazwa Jednostki:</label>
|
||||
<input type="text" class="form-control" id="fireStationName" name="fireStationName" value="{{ old('fireStationName') }} ">
|
||||
<input type="text" class="form-control" id="unitName" name="unitName" value="{{ old('unitName') }} ">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
@ -94,7 +94,7 @@
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Utwórz</button>
|
||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
@include('inc.formerrors')
|
||||
</form>
|
||||
|
@ -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="/sprzet"><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>
|
||||
|
@ -1,34 +0,0 @@
|
||||
@extends('layout.app')
|
||||
@section('center-area')
|
||||
@parent
|
||||
|
||||
@if( auth()->check())
|
||||
@if( auth()->user()->fireStationID == NULL)
|
||||
Jednostka nie istnieje
|
||||
@else
|
||||
<form method="POST" action="/dokumentacja/karta_ewidencyjna/pdf">
|
||||
{{ csrf_field() }}
|
||||
<div class="form-group row">
|
||||
<div class="col-auto">
|
||||
<label for="location">Wnioskujacy:</label>
|
||||
<select name="fireFighterID" class="form-control">
|
||||
<option value="">--- Wybierz strażaka ---</option>
|
||||
@foreach ($fireFighters as $fireFighter)
|
||||
<option value="{{$fireFighter->id}}">{{ $fireFighter->name }} {{$fireFighter->surname }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Drukuj</button>
|
||||
</div>
|
||||
@include('inc.formerrors')
|
||||
</form>
|
||||
@endif
|
||||
@else
|
||||
Brak autoryzacji
|
||||
@endif
|
||||
|
||||
@stop
|
@ -4,29 +4,20 @@
|
||||
|
||||
<title>E-OSP</title>
|
||||
<link rel="stylesheet" href="{{ asset('css/theme.css') }}">
|
||||
<link rel="stylesheet" href="{{asset('css/app.css')}}">
|
||||
|
||||
{{-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">--}}
|
||||
|
||||
<script src="js/app.js"></script>
|
||||
{{-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" />--}}
|
||||
{{-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>--}}
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script>
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
@if( auth()->check() )
|
||||
{{ auth()->user()->name }}
|
||||
{{ auth()->user()->surname }}
|
||||
<a href="/logout">Wyloguj</a>
|
||||
<a href="/userprofile">Mój profil</a>
|
||||
<a href="/logout">Logout</a>
|
||||
@else
|
||||
<a href="/login">Zaloguj się</a>
|
||||
<a href="/register">Rejestracja</a>
|
||||
<a href="/login">Login</a>
|
||||
<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
|
||||
|
@ -2,19 +2,7 @@
|
||||
|
||||
@section('center-area')
|
||||
@parent
|
||||
|
||||
@if (\Session::has('success'))
|
||||
<div class="alert alert-success">
|
||||
<ul>
|
||||
<li>{!! \Session::get('success') !!}</li>
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if( auth()->check())
|
||||
Jesteś już zalogowany. xd
|
||||
@else
|
||||
<h2>Zaloguj się</h2>
|
||||
<h2>Log In</h2>
|
||||
|
||||
<form method="POST" action="/login">
|
||||
{{ csrf_field() }}
|
||||
@ -24,7 +12,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="password">Hasło:</label>
|
||||
<label for="password">Password:</label>
|
||||
<input type="password" class="form-control" id="password" name="password">
|
||||
</div>
|
||||
|
||||
@ -34,6 +22,4 @@
|
||||
@include('inc.formerrors')
|
||||
</form>
|
||||
|
||||
<a href="/forgottenPassword">Nie pamiętam hasła<a>
|
||||
@endif
|
||||
@endsection
|
||||
|
@ -1,197 +1,16 @@
|
||||
@extends('layout.app')
|
||||
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
|
||||
@section('left-menu')
|
||||
@parent
|
||||
@if( auth()->check() )
|
||||
@if( auth()->user()->fireStationID != NULL)
|
||||
@if(auth()->user()->accessLevel() == 50)
|
||||
<ul>
|
||||
<a href="/wyjazdy/add"><li>Dodaj<img src="/img/left_menu_icon/add.png"></li></a>
|
||||
@if(auth()->user()->accessLevel() == 50)
|
||||
<form id="myForm" action="{{ route('operations.allPDF') }}" method="post" style="display:inline;">
|
||||
{{ csrf_field() }}
|
||||
<input type="hidden" class="form-control" name="fireStationID" value="{{auth()->user()->fireStationID}}">
|
||||
<li onclick="myForm.submit();">Drukuj wyjazdy</li>
|
||||
</form>
|
||||
@endif
|
||||
@parent<ul>
|
||||
<a href="?addOperation"><li>Dodaj<img src="img/left_menu_icon/add.png"></li></a>
|
||||
<li>Edytuj<img src="img/left_menu_icon/edit.png"></li>
|
||||
<li>Usuń<img src="img/left_menu_icon/delete.png"></li>
|
||||
|
||||
</ul>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@stop
|
||||
|
||||
@section('center-area')
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
@parent
|
||||
@if( auth()->check())
|
||||
@if( auth()->user()->fireStationID == NULL)
|
||||
Jednostka nie istnieje
|
||||
@else
|
||||
|
||||
<table class='table'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Data</th>
|
||||
<th>Miejsce</th>
|
||||
<th>Cel</th>
|
||||
<th>Rodzaj zagrożenia</th>
|
||||
<th>Dowódca</th>
|
||||
@if(auth()->user()->accessLevel() == 50)
|
||||
<th>Operacja</th>
|
||||
<th>Szczegóły</th>
|
||||
@endif
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@php
|
||||
$i=1;
|
||||
@endphp
|
||||
@foreach($operations as $operation)
|
||||
<tr>
|
||||
<th>{{$i}}</th>
|
||||
<td id="operationDate{{ $operation->id }}">{{ $operation->operationDate }}</td>
|
||||
<td id="operationLocation{{ $operation->id }}">{{ $operation->location }}</td>
|
||||
<td id="operationTarget{{ $operation->id }}">{{ $operation->target }}</td>
|
||||
<td id="operationDangerType{{ $operation->id }}">{{ $operation->dangerType }}</td>
|
||||
<td id="operationCommander{{ $operation->id }}">{{$operation->name}} {{$operation->surname}}</td>
|
||||
@if(auth()->user()->accessLevel() == 50)
|
||||
<td>
|
||||
<a href="{{ URL::asset('wyjazdy/edit/'.$operation->id) }}" class="btn btn-secondary" role="button">Edytuj</a>
|
||||
<button class="btn btn-danger" type="submit" id="{{$operation->id}}" onclick="deleteButton('{{$operation->id}}')">Usuń</button>
|
||||
<form action="{{ route('operations.singlePDF') }}" method="post" style="display:inline;">
|
||||
{{ csrf_field() }}
|
||||
<input type="hidden" class="form-control" name="operationID" value="{{$operation->id}}">
|
||||
<button class="btn btn-dark" type="submit">Drukuj</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
<td>
|
||||
<button class="btn btn-info" type="button" id="more{{$operation->id}}" onclick="showMoreInformation('{{$operation->id}}')">Więcej</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="moreInformation{{$operation->id}}" style="visibility:collapse;">
|
||||
{{-- bgcolor="#C0C0C0"--}}
|
||||
<td colspan="8">
|
||||
<center>
|
||||
<table class="table table-dark">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="8"><center>Opis Akcji</center></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="8">{{$operation->description}}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><center>Pojazdy</center></th>
|
||||
<th><center>Kierowcy</center></th>
|
||||
</tr>
|
||||
@foreach($trucks[$operation->id] as $truck)
|
||||
@if($truck->truckID != null)
|
||||
<tr>
|
||||
<td>{{$truck->name}} {{$truck->codename }} {{$truck->brand}} {{$truck->registrationNumber}}</td>
|
||||
<td colspan="8">{{$truck->driverName }} {{ $truck->driverSurname}}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><center>Członkowie Akcji</center></th>
|
||||
<th><center>Transport Własny</center></th>
|
||||
</tr>
|
||||
|
||||
@foreach($fireFighters[$operation->id] as $fireFighter)
|
||||
@if($fireFighter->memberID != null)
|
||||
<tr>
|
||||
<td>{{$fireFighter->name}} {{$fireFighter->surname }}</td>
|
||||
<td>{{($fireFighter->privateTransport == 1) ? "Tak" : "Nie"}}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</center>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@php
|
||||
$i++;
|
||||
@endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
{{ $operations->links() }}
|
||||
@endif
|
||||
@else
|
||||
Brak autoryzacji
|
||||
@endif
|
||||
Strona w budowie
|
||||
|
||||
@stop
|
||||
|
||||
<script>
|
||||
function showMoreInformation(operationID){
|
||||
if( $('#more'+operationID).val() == "Więcej"){
|
||||
$('#more'+operationID).val("Ukryj");
|
||||
$("#moreInformation"+operationID).css('visibility', 'visible');
|
||||
} else{
|
||||
$('#more'+operationID).val("Więcej");
|
||||
$("#moreInformation"+operationID).css('visibility', 'collapse');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function deleteButton(operationID){
|
||||
swal.fire({
|
||||
title: "Czy chcesz usunąć wyjazd?",
|
||||
width: 'auto',
|
||||
confirmButtonText: 'Tak',
|
||||
cancelButtonText: 'Nie',
|
||||
showCancelButton: true,
|
||||
}).then((result) => {
|
||||
if(result.value){
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: "wyjazdy/"+operationID,
|
||||
type: 'DELETE',
|
||||
data: {
|
||||
"id": operationID,
|
||||
},
|
||||
success: function (){
|
||||
console.log("it Works");
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
@ -1,169 +0,0 @@
|
||||
@extends('layout.app')
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
|
||||
@section('left-menu')
|
||||
@parent<ul>
|
||||
<a href="/wyjazdy"><li>Przeglądaj<img src="/img/left_menu_icon/more.png"></li></a>
|
||||
</ul>
|
||||
@stop
|
||||
|
||||
@section('center-area')
|
||||
@parent
|
||||
<form method="POST" action="/wyjazdy" id="dynamic_form">
|
||||
{{ csrf_field() }}
|
||||
<div class="form-group row">
|
||||
<div class="col-auto">
|
||||
<label for="date">Data wyjazdu: </label>
|
||||
<input type="datetime-local" id="operationDate" name="operationDate" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="location">Miejsce akcji:</label>
|
||||
<input type="text" class="form-control" id="operationLocation" name="operationLocation">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="location">Cel wyjazdu:</label>
|
||||
<input type="text" class="form-control" id="operationTarget" name="operationTarget">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="location">Rodzaj zagrożenia:</label>
|
||||
<input type="text" class="form-control" id="operationDangerType" name="operationDangerType">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="location">Opis akcji:</label>
|
||||
<textarea class="form-control" id="'operationDescription" name="operationDescription" placeholder="Opis akcji..."></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-auto">
|
||||
<label for="location">Dowodzący:</label>
|
||||
<select name="operationLeader" class="form-control">
|
||||
<option value="">--- Wybierz dowódcę ---</option>
|
||||
@foreach ($leaders as $leader)
|
||||
@if(Illuminate\Support\Facades\Input::old('operationLeader') == $leader->id)
|
||||
<option value="{{$leader->id}}" selected>{{ $leader->name }} {{$leader->surname }}</option>
|
||||
@else
|
||||
<option value="{{$leader->id}}">{{ $leader->name }} {{$leader->surname }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class=form-group">
|
||||
<div id="drivers">
|
||||
|
||||
</div>
|
||||
</br>
|
||||
<button type="button" name="add" id="add" class="btn btn-success">Dodaj Pojazd</button>
|
||||
</div>
|
||||
|
||||
</br>
|
||||
|
||||
<div class="form-group">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col">Imię i Nazwisko</th>
|
||||
<th scope="col">Obecność</th>
|
||||
<th scope="col">Transport własny</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@php
|
||||
$i = 0;
|
||||
@endphp
|
||||
@foreach($fireFighters as $fireFighterChecklist)
|
||||
<tr>
|
||||
<th scope="row">{{$i+1}}</th>
|
||||
<td>{{ $fireFighterChecklist->name }} {{$fireFighterChecklist->surname }}</td>
|
||||
<td><input type="checkbox" name="attendance[{{$i}}]" value="{{$fireFighterChecklist->id}}"></td>
|
||||
<td><input type="checkbox" name="transport[{{$i}}]" value="{{$i}}"></td>
|
||||
</tr>
|
||||
@php
|
||||
$i++;
|
||||
@endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zapisz</button>
|
||||
</div>
|
||||
|
||||
@include('inc.formerrors')
|
||||
</form>
|
||||
@stop
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
var count = 1;
|
||||
|
||||
dynamic_field(count);
|
||||
|
||||
function dynamic_field(number)
|
||||
{
|
||||
|
||||
html = '<div id="singleDriver">';
|
||||
html += '<div class="row align-items-end">';
|
||||
html += '<div class="col-auto">';
|
||||
html += '<label for="location">Kierowca:</label>';
|
||||
html += '<select name="operationDriver[]" class="form-control">';
|
||||
html += '<option value="">--- Wybierz kierowcę ---</option>';
|
||||
html += '@foreach ($drivers as $driver)';
|
||||
html += '<option value="{{$driver->id}}">{{ $driver->name }} {{$driver->surname }}</option>';
|
||||
html += '@endforeach';
|
||||
html += '</select>';
|
||||
html += '</div>';
|
||||
html += '<div class="col-auto">';
|
||||
html += '<label for="location">Pojazd:</label>';
|
||||
html += '<select name="operationVehicle[]" class="form-control">';
|
||||
html += '<option value="">--- Wybierz pojazd ---</option>';
|
||||
html += '@foreach ($vehicles as $vehicle)';
|
||||
html += '<option value="{{$vehicle->id}}">{{ $vehicle->name }} {{$vehicle->codename }} {{$vehicle->registrationNumber }}</option>';
|
||||
html += '@endforeach';
|
||||
html += '</select>';
|
||||
html += '</div>';
|
||||
html += '<div class="col-auto">';
|
||||
html += '<button type="button" name="remove" id="" class="btn btn-danger remove form-control">Usuń</button>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
|
||||
$('#drivers').append(html);
|
||||
|
||||
}
|
||||
|
||||
$(document).on('click', '#add', function(){
|
||||
count++;
|
||||
dynamic_field(count);
|
||||
});
|
||||
|
||||
$(document).on('click', '.remove', function(){
|
||||
count--;
|
||||
|
||||
swal.fire({
|
||||
html: "Czy na pewno chcesz usunąć pojazd?",// this will output "Error 422: Unprocessable Entity"
|
||||
width: 'auto',
|
||||
confirmButtonText: 'Tak',
|
||||
cancelButtonText: 'Nie',
|
||||
showCancelButton: true,
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
$(this).closest("#singleDriver").remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
@ -1,200 +0,0 @@
|
||||
@extends('layout.app')
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
|
||||
@section('left-menu')
|
||||
@parent<ul>
|
||||
<a href="/wyjazdy/add"><li>Dodaj<img src="/img/left_menu_icon/add.png"></li></a>
|
||||
<a href="/wyjazdy"><li>Przeglądaj<img src="/img/left_menu_icon/more.png"></li></a>
|
||||
</ul>
|
||||
@stop
|
||||
|
||||
@section('center-area')
|
||||
@parent
|
||||
<form method="POST" action="/wyjazdy/edit" id="dynamic_form" >
|
||||
{{ csrf_field() }}
|
||||
|
||||
<input type="hidden" class="form-control" name="operationID" value="{{ $operation->id }}">
|
||||
<div class="form-group row">
|
||||
<div class="col-auto">
|
||||
<label for="date">Data wyjazdu: </label>
|
||||
<input type="datetime-local" id="operationDate" name="operationDate" value="{{ \Carbon\Carbon::parse($operation->operationDate)->format('Y-m-d\TH:i') }}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="location">Miejsce akcji:</label>
|
||||
<input type="text" class="form-control is-valid" id="operationLocation" name="operationLocation" value="{{ $operation->location}}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="location" >Cel wyjazdu:</label>
|
||||
<input type="text" class="form-control" id="operationTarget" name="operationTarget" value="{{ $operation->target }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="location">Rodzaj zagrożenia:</label>
|
||||
<input type="text" class="form-control is-valid" id="operationDangerType" name="operationDangerType" value="{{ $operation->dangerType }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="location">Opis akcji:</label>
|
||||
<textarea class="form-control" id="'operationDescription" name="operationDescription">{{ $operation->description }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-auto">
|
||||
<label for="location">Dowodzący:</label>
|
||||
<select name="operationLeader" class="form-control">
|
||||
<option value="">--- Wybierz dowódcę ---</option>
|
||||
@foreach ($leaders as $leader)
|
||||
<option value="{{$leader->id}}" {{$leader->id == $operation->commanderID ? 'selected' : ''}}>{{ $leader->name }} {{$leader->surname }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=form-group">
|
||||
<div id="drivers">
|
||||
@foreach($operationsTrucks as $operationTruck)
|
||||
<div id="singleDriver">
|
||||
<div class="row align-items-end">
|
||||
<div class="col-auto">
|
||||
<label for="location">Kierowca:</label>
|
||||
<select name="operationDriver[]" class="form-control">
|
||||
<option value="">--- Wybierz kierowcę ---</option>
|
||||
@foreach ($drivers as $driver)
|
||||
<option {{$driver->id == $operationTruck->driverID ? 'selected' : ''}} value="{{$driver->id}}">{{ $driver->name }} {{$driver->surname }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<label for="location">Pojazd:</label>
|
||||
<select name="operationVehicle[]" class="form-control">
|
||||
<option value="">--- Wybierz pojazd ---</option>
|
||||
@foreach ($vehicles as $vehicle)
|
||||
<option {{$vehicle->id == $operationTruck->truckID ? 'selected' : ''}} value="{{$vehicle->id}}">{{ $vehicle->name }} {{$vehicle->codename }} {{$vehicle->registrationNumber }}
|
||||
@if ($vehicle->deleted_at)
|
||||
(USUNIĘTY {{$vehicle->deleted_at }})
|
||||
@elseif ($vehicle->status == 0)
|
||||
(zawieszony)
|
||||
@endif
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="button" name="remove" id="" class="btn btn-danger remove form-control">Usuń</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
</br>
|
||||
<button type="button" name="add" id="add" class="btn btn-success">Dodaj Pojazd</button>
|
||||
</div>
|
||||
|
||||
</br>
|
||||
|
||||
<div class="form-group">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col">Imię i Nazwisko</th>
|
||||
<th scope="col">Obecność</th>
|
||||
<th scope="col">Transport własny</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@php
|
||||
$i = 0;
|
||||
@endphp
|
||||
@foreach($fireFighters as $fireFighterChecklist)
|
||||
<tr>
|
||||
<th scope="row">{{$i+1}}</th>
|
||||
<td>{{ $fireFighterChecklist->name }} {{$fireFighterChecklist->surname }}</td>
|
||||
<td><input type="checkbox" name="attendance[{{$i}}]" value="{{$fireFighterChecklist->id}}" {{$fireFighterChecklist->memberID != null ? 'checked' : ''}} ></td>
|
||||
<td><input type="checkbox" name="transport[{{$i}}]" value="{{$i}}" {{$fireFighterChecklist->privateTransport == 1 ? 'checked' : ''}}></td>
|
||||
</tr>
|
||||
@php
|
||||
$i++;
|
||||
@endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zapisz</button>
|
||||
</div>
|
||||
|
||||
@include('inc.formerrors')
|
||||
</form>
|
||||
@stop
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
|
||||
var count = 1;
|
||||
|
||||
|
||||
function dynamic_field(number)
|
||||
{
|
||||
html = '<div id="singleDriver">';
|
||||
html += '<div class="row align-items-end">';
|
||||
html += '<div class="col-auto">';
|
||||
html += '<label for="location">Kierowca:</label>';
|
||||
html += '<select name="operationDriver[]" class="form-control">';
|
||||
html += '<option value="">--- Wybierz kierowcę ---</option>';
|
||||
html += '@foreach ($fireFighters as $fireFighter)';
|
||||
html += '<option value="{{$fireFighter->id}}">{{ $fireFighter->name }} {{$fireFighter->surname }}</option>';
|
||||
html += '@endforeach';
|
||||
html += '</select>';
|
||||
html += '</div>';
|
||||
html += '<div class="col-auto">';
|
||||
html += '<label for="location">Pojazd:</label>';
|
||||
html += '<select name="operationVehicle[]" class="form-control">';
|
||||
html += '<option value="">--- Wybierz pojazd ---</option>';
|
||||
html += '@foreach ($vehicles as $vehicle)';
|
||||
html += '<option value="{{$vehicle->id}}">{{ $vehicle->name }} {{$vehicle->codename }} {{$vehicle->registrationNumber }}</option>';
|
||||
html += '@endforeach';
|
||||
html += '</select>';
|
||||
html += '</div>';
|
||||
html += '<div class="col-auto">';
|
||||
html += '<button type="button" name="remove" id="" class="btn btn-danger remove form-control">Usuń</button>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
|
||||
$('#drivers').append(html);
|
||||
}
|
||||
|
||||
$(document).on('click', '#add', function(){
|
||||
count++;
|
||||
dynamic_field(count);
|
||||
});
|
||||
|
||||
$(document).on('click', '.remove', function(){
|
||||
count--;
|
||||
|
||||
swal.fire({
|
||||
html: "Czy na pewno chcesz usunąć pojazd?",// this will output "Error 422: Unprocessable Entity"
|
||||
width: 'auto',
|
||||
confirmButtonText: 'Tak',
|
||||
cancelButtonText: 'Nie',
|
||||
showCancelButton: true,
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
$(this).closest("#singleDriver").remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -1,13 +1,9 @@
|
||||
@extends('layout.app')
|
||||
@if( auth()->check() )
|
||||
|
||||
|
||||
@section('center-area')
|
||||
@parent
|
||||
Jesteś już zarejestrowany(a).
|
||||
@stop
|
||||
@else
|
||||
@section('center-area')
|
||||
@parent
|
||||
<h2>Rejestracja</h2>
|
||||
<h2>Register</h2>
|
||||
<form method="POST" action="/register">
|
||||
{{ csrf_field() }}
|
||||
<div class="form-group">
|
||||
@ -49,11 +45,9 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zarejestruj</button>
|
||||
<button style="cursor:pointer" type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
@include('inc.formerrors')
|
||||
</form>
|
||||
|
||||
@stop
|
||||
|
||||
@endif
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user