1
0
forked from s421507/eOSP2
This commit is contained in:
czup 2020-01-03 05:13:30 +01:00
commit 6a1804f158
24 changed files with 615 additions and 16 deletions

View File

@ -0,0 +1,40 @@
<?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');
}
}

View File

@ -0,0 +1,72 @@
<?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()->fireStationID != null ){
$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 "Brak dostepu";
}
}
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 back();
}
}

View File

@ -90,6 +90,7 @@ class VehiclesController extends Controller
'chassisPoductionYear' => $request-> chassisPoductionYear,
'entryIntoServiceDate' => formatDate($request-> entryIntoServiceDate),
'fireEnginePumpDescription' => $request-> fireEnginePumpDescription,
'status' => $request-> status
]);
return redirect()->to('/pojazdy');
@ -137,6 +138,7 @@ class VehiclesController extends Controller
$vehicle-> chassisPoductionYear = $request-> chassisPoductionYear;
$vehicle-> entryIntoServiceDate = formatDate($request-> entryIntoServiceDate);
$vehicle-> fireEnginePumpDescription = $request-> fireEnginePumpDescription;
$vehicle-> status = $request-> status;
$vehicle->save();
return redirect()->to('/pojazdy');;
@ -147,4 +149,22 @@ class VehiclesController extends Controller
vehicle::where('id',$id)->delete();
return redirect()->to('/pojazdy');
}
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');
}
}

View File

@ -24,7 +24,7 @@ class fireStationController extends Controller
if(auth()->user() != null && auth()->user()->fireStationID != null )
{
$id = auth()->user()->fireStationID;
$fireStation = DB::table('firestations')->where("id", $id)->first();
$fireStation = DB::table('fireStations')->where("id", $id)->first();
$voivodeships = DB::table('wojewodztwa')->pluck("name","id");
return view('fireStationEdit', ["fireStation" => $fireStation], compact('voivodeships'));
}

View File

@ -69,4 +69,30 @@ class userProfileController extends Controller
return redirect()->to('/userprofile');;
}
public function userTrainings(){
if(auth()->user() != null && auth()->user()->fireStationID != null ){
$userTrainings = DB::table('trainingsFirefighters')->where("trainingsFirefighters.firefighterID", '=', auth()->user()->id)
->leftJoin('trainings', 'trainingsFirefighters.trainingID', '=', 'trainings.id')
->select('trainingsFirefighters.id','trainings.trainingName','trainingsFirefighters.dateOfComplete', 'trainingsFirefighters.dateOfExpiry')
->get();
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";
}
}
}

View File

@ -0,0 +1,41 @@
<?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.';
}
}

View File

@ -0,0 +1,15 @@
<?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'];
}

View File

@ -12,7 +12,7 @@ class vehicle extends Model
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'
'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'
];
}

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddStatusToVehiclesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('vehicles', function (Blueprint $table) {
//
$table->integer('status')->default('0');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('vehicles', function (Blueprint $table) {
//
});
}
}

View File

@ -0,0 +1,42 @@
<?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->integer('id');
$table->string('decorationName');
});
DB::table('decorations')->insert([ 'id' => '1', 'decorationName' => 'Odznaka "Młodzieżowa Drużyna Pożarnicza" - brązowa' ]);
DB::table('decorations')->insert([ 'id' => '2', 'decorationName' => 'Odznaka "Młodzieżowa Drużyna Pożarnicza" - srebrna' ]);
DB::table('decorations')->insert([ 'id' => '3', 'decorationName' => 'Odznaka "Młodzieżowa Drużyna Pożarnicza" - złota' ]);
DB::table('decorations')->insert([ 'id' => '4', 'decorationName' => 'Odznaka "Za wysługę lat"' ]);
DB::table('decorations')->insert([ 'id' => '5', 'decorationName' => 'Odznaka "Strażak Wzorowy"' ]);
DB::table('decorations')->insert([ 'id' => '6', 'decorationName' => 'Medal "Za Zasługi dla Pożarnictwa" - brązowy' ]);
DB::table('decorations')->insert([ 'id' => '7', 'decorationName' => 'Medal "Za Zasługi dla Pożarnictwa" - srebrny' ]);
DB::table('decorations')->insert([ 'id' => '8', 'decorationName' => 'Medal "Za Zasługi dla Pożarnictwa" - złoty' ]);
DB::table('decorations')->insert([ 'id' => '9', 'decorationName' => 'Medal Honorowy im. Bolesława Chomicza' ]);
DB::table('decorations')->insert([ 'id' => '10', 'decorationName' => 'Złoty Znak Związku Ochotniczych Straży Pożarnych Rzeczypospolitej Polskiej' ]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('decorations');
}
}

View File

@ -0,0 +1,35 @@
<?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('decorationsFirefighters', function (Blueprint $table) {
$table->increments('id');
$table->integer('firefighterID');
$table->integer('decorationID');
$table->date('dateOfAward');
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('decorationsFirefighters');
}
}

View File

@ -161,7 +161,9 @@ return [
'unitName' => 'nazwa jednostki',
'longitude' => 'długość geograficzna',
'latitude' => 'szerokość geograficzna',
'amount' => 'ilość'
'amount' => 'ilość',
'decoration' => 'odznaczenie',
'dateOfAward' => 'data przyznania'
],

View File

@ -0,0 +1,62 @@
@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

View File

@ -0,0 +1,70 @@
@extends('layout.app')
@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')
@parent
@if( auth()->check())
@if( auth()->user()->fireStationID == NULL)
Jednostka nie istnieje
@else
@if(count($awardedDecorations) > 0)
<p align='center'>
<table class='firefighterViewTable'>
<tr class='table-header'>
<th colspan="2" scope="colgroup" style="text-align:center">{{ $firefighter->name }} {{ $firefighter->surname }} - odznaczenia</th>
</tr>
<tr class='table-header'>
<td>Odznaczenie</td>
<td>Data przyznania</td>
@foreach($awardedDecorations as $awardedDecoration)
<tr>
<form action="{{ route('decorations.destroy', $awardedDecoration->decorationsFirefightersID)}}" method="post">
<td id="decorationName{{ $awardedDecoration->decorationsFirefightersID }}">{{ $awardedDecoration->decorationName }}</td>
<td id="dateOfAward{{ $awardedDecoration->decorationsFirefightersID }}">{{ $awardedDecoration->dateOfAward }}</td>
<td>
{{ csrf_field() }}
@method('DELETE')
<button class="btn btn-danger" type="submit">Usuń</button>
</td>
</form>
</tr>
@endforeach
</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)
<option value="{{ $key }}">{{ $value }}</option>
@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

View File

@ -4,7 +4,6 @@
@parent
<ul>
<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>
@ -88,6 +87,8 @@
<td id="userDegree{{ $user->id }}"> {{$user->rank}}</td>
<td id="userStatus{{ $user->id }}">@if( $user->statusID == 0) Czynny @else Wyłączony @endif</td>
<td><a href="{{ URL::asset('strazacy/edit/'.$user->id) }}"><input type="button" onclick="" value="Edytuj"> </a></td>
<td><a href="{{ URL::asset('strazacy/odznaczenia/'.$user->id) }}"><input type="button" onclick="" value="Odznaczenia"> </a></td>
</tr>
{{-- <tr>--}}
{{-- <form id="editForm{{$user->id}}" method="POST" action="/strazacy">--}}

View File

@ -0,0 +1,41 @@
@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/passwordchange"><li>Zmiana hasła<img src="../img/left_menu_icon/edit.png"></li></a>
</ul>
@stop
@section('center-area')
@parent
@if( auth()->check())
@if( auth()->user()->fireStationID == NULL)
Jednostka nie istnieje
@else
@if(count($userDecorations) > 0)
<p align='center'>
<table class='firefighterViewTable'>
<tr class='table-header'>
<td>Odznaczenie</td>
<td>Data przyznania</td>
@foreach($userDecorations as $userDecoration)
<tr>
<td id="decorationName{{ $userDecoration->id }}">{{ $userDecoration->decorationName }}</td>
<td id="amount{{ $userDecoration->id }}">{{ $userDecoration->dateOfAward }}</td>
</tr>
@endforeach
</table>
</p>
@else
Nie posiadasz jeszcze żadnych odznaczeń.
@endif
@endif
@else
Brak autoryzacji
@endif
@stop

View File

@ -4,6 +4,8 @@
@parent
<ul>
<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>
<a href="/userprofile/passwordchange"><li>Zmiana hasła<img src="../img/left_menu_icon/edit.png"></li></a>
</ul>
@stop
@ -12,6 +14,15 @@
@parent
@if( auth()->check())
@if (\Session::has('success'))
<div class="alert alert-success">
<ul>
<li>{!! \Session::get('success') !!}</li>
</ul>
</div>
@endif
<p align='center'>
<table class='firefighterViewTable'>
<tr>

View File

@ -3,6 +3,9 @@
@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/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>
<a href="/userprofile/passwordchange"><li>Zmiana hasła<img src="../img/left_menu_icon/edit.png"></li></a>
</ul>
@stop

View File

@ -0,0 +1,37 @@
@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/odznaczenia"><li>Odznaczenia<img src="../img/left_menu_icon/more.png"></li></a>
<a href="/userprofile/passwordchange"><li>Zmiana hasła<img src="../img/left_menu_icon/edit.png"></li></a>
</ul>
@stop
@section('center-area')
@parent
@if( auth()->check())
<p align='center'>
<table class='firefighterViewTable'>
<tr class='table-header'>
<td>Szkolenie</td>
<td>Data ukończenia</td>
<td>Data ważności</td>
@foreach($userTrainings as $userTraining)
<tr>
<td id="trainingName{{ $userTraining->id }}">{{ $userTraining->trainingName }}</td>
<td id="dateOfComplete{{ $userTraining->id }}">{{ $userTraining->dateOfComplete }}</td>
<td id="dateOfExpiry{{ $userTraining->id }}">{{ $userTraining->dateOfExpiry }}</td>
</tr>
@endforeach
</table>
</p>
@else
Brak autoryzacji
@endif
@stop

View File

@ -4,9 +4,6 @@
@parent
<ul>
<a href="/pojazdy/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>Usuń<img src="img/left_menu_icon/delete.png"></li>
<li>Zawieś<img src="img/left_menu_icon/suspended.png"></li>
</ul>
@stop
@ -47,11 +44,25 @@
<td id="examExpirationDate{{ $vehicle->id }}">{{ $vehicle->examExpirationDate }}</td>
<td id="insuranceExpirationDate{{ $vehicle->id }}">{{ $vehicle->insuranceExpirationDate }}</td>
<td><a href="{{ URL::asset('pojazdy/edit/'.$vehicle->id) }}"><input type="button" onclick="" value="Edytuj"> </a></td>
<td>
{{ csrf_field() }}
@method('DELETE')
<button class="btn btn-danger" type="submit">Usuń</button>
</form></td>
<td><button class="btn btn-danger" type="submit">Usuń</button></td>
</form>
@if ($vehicle->status == 1)
<form method="POST" action="/pojazdy/deactivate">
{{ csrf_field() }}
<input type="hidden" class="form-control" name="vehicleID" value="{{ $vehicle->id }}">
<td><button style="cursor:pointer" type="submit" class="btn btn-primary">Zawieś</button></td>
</form>
@elseif ($vehicle->status == 0)
<form method="POST" action="/pojazdy/activate">
{{ csrf_field() }}
<input type="hidden" class="form-control" name="vehicleID" value="{{ $vehicle->id }}">
<td><button style="cursor:pointer" type="submit" class="btn btn-primary">Przywróć do służby</button></td>
</form>
@endif
</tr>
@endforeach
</table>

View File

@ -3,10 +3,7 @@
@section('left-menu')
@parent
<ul>
<a href="/pojazdy/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>Usuń<img src="img/left_menu_icon/delete.png"></li>
<li>Zawieś<img src="img/left_menu_icon/suspended.png"></li>
<a href="/pojazdy"><li>Przeglądaj<img src="img/left_menu_icon/add.png"></li></a>
</ul>
@stop
@ -114,6 +111,14 @@
<input type="text" class="form-control" id="fireEnginePumpDescription" name="fireEnginePumpDescription" value="{{ old('fireEnginePumpDescription') }}">
</div>
<div class="form-group">
<label for="status">Stan:</label>
<select name="status" class="form-control">
<option value="1" selected='selected'>Aktywny</option>
<option value="0">Zawieszony</option>
</select>
</div>
<div class="form-group">
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zatwierdź</button>
</div>

View File

@ -116,6 +116,14 @@
<input type="text" class="form-control" id="fireEnginePumpDescription" name="fireEnginePumpDescription" value="{{ $vehicle->fireEnginePumpDescription }}">
</div>
<div class="form-group">
<label for="status">Stan:</label>
<select name="status" class="form-control">
<option value="1" selected='selected'>Aktywny</option>
<option value="0">Zawieszony</option>
</select>
</div>
<div class="form-group">
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zatwierdź zmiany</button>
</div>

View File

@ -52,6 +52,10 @@ Route::post('/strazacy', 'fireFightersController@store');
Route::get('/strazacy/edit/{id}', 'fireFightersController@editForm');
Route::post('/strazacy/edit', 'fireFightersController@update');
Route::get('/strazacy/odznaczenia/{id}', 'DecorationsController@create');
Route::post('/strazacy/odznaczenia/{id}', 'DecorationsController@store');
Route::resource('decorations', 'DecorationsController');
Route::get('/jednostka', 'fireStationController@create');
Route::post('/jednostka', 'fireStationController@store');
Route::get('/jednostka/edit', 'fireStationController@editForm');
@ -66,6 +70,8 @@ Route::post('/pojazdy', 'VehiclesController@store');
Route::get('/pojazdy/edit/{id}', 'VehiclesController@editForm');
Route::post('/pojazdy/edit', 'VehiclesController@update');
Route::resource('vehicles', 'VehiclesController');
Route::post('pojazdy/activate', 'VehiclesController@activate');
Route::post('pojazdy/deactivate', 'VehiclesController@deactivate');
Route::get('/sprzet', 'EquipmentController@create');
Route::get('/sprzet/add', 'EquipmentController@addForm');
@ -85,6 +91,10 @@ Route::resource('trainings', 'trainingsController');
Route::get('/userprofile', 'userProfileController@create');
Route::get('/userprofile/edit', 'userProfileController@editForm');
Route::post('/userprofile/edit', 'userProfileController@update');
Route::get('/userprofile/passwordchange', 'ChangePasswordController@create');
Route::post('/userprofile/passwordchange', 'ChangePasswordController@update');
Route::get('/userprofile/szkolenia', 'userProfileController@userTrainings');
Route::get('/userprofile/odznaczenia', 'userProfileController@userDecorations');
Route::get('register/verify/{confirmationCode}', [

14
update.sh Normal file
View File

@ -0,0 +1,14 @@
#!/bin/bash
php artisan down
#git reset --hard FETCH_HEAD
#git clean -df
git pull -f https://git.wmi.amu.edu.pl/s421507/eOSP2.git master
url=$(basename "$PWD")
chown -R www-data:www-data ../$url
chmod -R 755 ../$url
php artisan migrate
php artisan db:seed
php artisan queue:restart
php artisan cache:clear
php artisan up