1
0
forked from s421507/eOSP2

Dodanie drukowania widoków - naprawa konfliktów przy merge

This commit is contained in:
czup 2020-02-01 01:18:26 +01:00
commit b85769b644
39 changed files with 420 additions and 232 deletions

View File

@ -21,7 +21,7 @@ function formatDate($date)
class DecorationsController extends Controller
{
public function create($id){
if(auth()->user() != null && auth()->user()->fireStationID != null ){
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')
@ -39,7 +39,7 @@ class DecorationsController extends Controller
->with(compact('decoration'));
} else{
return "Brak dostepu";
return redirect()->to('/strazacy');
}
}
@ -67,6 +67,8 @@ class DecorationsController extends Controller
{
decorationsFirefighters::where('id',$id)->delete();
return back();
return response()->json([
'success' => 'Record deleted successfully!'
]);
}
}

View File

@ -21,15 +21,15 @@ class EquipmentController extends Controller
}
public function addForm(){
if(auth()->user() != null && auth()->user()->fireStationID != null ){
if(auth()->user() != null && auth()->user()->accessLevel() == 50 ){ //prezes,naczelnik
return view('equipmentAdd');
} else return view("login");
} else return redirect()->to('/sprzet');
}
public function editForm($id)
{
if(auth()->user() != null && auth()->user()->fireStationID != null )
if(auth()->user() != null && auth()->user()->accessLevel() == 50 ) //prezes,naczelnik
{
$equipment = DB::table('equipment')->where("id", $id)->first();
@ -37,19 +37,24 @@ class EquipmentController extends Controller
return view('equipmentEdit', ["equipment" => $equipment]);
}
else
return view("login");
return redirect()->to('/sprzet');
}
public function store(){
$this->validate(request(), [
'name' => 'required',
'amount' => 'required|numeric',
'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)'
]);
@ -67,12 +72,17 @@ class EquipmentController extends Controller
public function update(){
$this->validate(request(), [
'name' => 'required',
'amount' => 'required|numeric',
'name' => 'required|max:45',
'amount' => 'required|numeric|digits_between:1,10',
'parameter' => 'max:45|nullable',
],
[
'required' => ':attribute jest wymagany(a).',
'numeric' => ':attribute powinna zawierać tylko cyfry.'
'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)'
]);

View File

@ -8,7 +8,6 @@ use App\User;
use Mail;
use App\Rules\Pesel;
/* 'phoneNumber' => 'required|regex:/^([0-9\s\-\+\(\)]*)$/|min:9' */
class RegistrationController extends Controller
{
public function create()
@ -20,19 +19,18 @@ class RegistrationController extends Controller
{
$this->validate(request(), [
'name' => 'required|alpha|min:3|max:45',
'surname' => 'required|alpha|min:3|max:45',
'name' => 'required|min:2|max:45|regex:/^[\p{L}\040\x27-]+$/',
'surname' => 'required|min:2|max:45|regex:/^[\p{L}\040\x27-]+$/',
'PESEL' => new Pesel,
'phoneNumber' => 'required|digits:9',
'email' => 'required|email|unique:users',
'password' => 'required|confirmed|min:6',
'password' => 'required|confirmed|min:6|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.',
'alpha' => ':attribute może zawierać tylko litery.',
'alpha_num' => ':attribute może zawierać tylko litery i cyfry.',
'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.',

View File

@ -15,9 +15,16 @@ class SessionsController extends Controller
{
if (auth()->attempt(request(['email', 'password'])) == false) {
return back()->withErrors([
'message' => 'The email or password is incorrect, please try again'
'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.'
]);
}
return redirect()->to('/jednostka');
}

View File

@ -31,46 +31,60 @@ class VehiclesController extends Controller
}
public function addForm(){
if(auth()->user() != null && auth()->user()->fireStationID != null ){
if(auth()->user() != null && auth()->user()->accessLevel() == 50 ){ //prezes,naczelnik
return view('vehiclesAdd');
} else return view("login");
} else return redirect()->to('/pojazdy');
}
public function editForm($id)
{
if(auth()->user() != null && auth()->user()->fireStationID != null )
if(auth()->user() != null && auth()->user()->accessLevel() == 50 ) //prezes,naczelnik
{
$vehicle = DB::table('vehicles')->where("id", $id)->first();
return view('vehiclesEdit', ["vehicle" => $vehicle]);
}
else
return "Brak dostepu";
redirect()->to('/pojazdy');
}
public function store(){
$this->validate(request(), [
'name' => 'required',
'codename' => 'required',
'vehicleName' => 'required|max:45',
'codename' => 'required|max:45',
'brand' => 'max:45',
'registrationNumber' => 'max:15',
'productionYear' => 'digits:4|nullable',
'foamAgent' => 'numeric|nullable',
'enginePower' => 'numeric|nullable',
'crewNumber' => 'numeric|nullable',
'mass' => 'numeric|nullable',
'chassisPoductionYear' => 'numeric|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 zawiera tylko cyfry.',
'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-> name,
'name' => $request-> vehicleName,
'codename' => $request-> codename,
'brand' => $request-> brand,
'registrationNumber' => $request-> registrationNumber,
@ -100,25 +114,39 @@ class VehiclesController extends Controller
public function update(){
$this->validate(request(), [
'name' => 'required',
'codename' => 'required',
'vehicleName' => 'required|max:45',
'codename' => 'required|max:45',
'brand' => 'max:45',
'registrationNumber' => 'max:15',
'productionYear' => 'digits:4|nullable',
'foamAgent' => 'numeric|nullable',
'enginePower' => 'numeric|nullable',
'crewNumber' => 'numeric|nullable',
'mass' => 'numeric|nullable',
'chassisPoductionYear' => 'numeric|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 zawiera tylko cyfry.',
'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-> name;
$vehicle-> name = $request-> vehicleName;
$vehicle-> codename = $request-> codename;
$vehicle-> brand = $request-> brand;
$vehicle-> registrationNumber = $request-> registrationNumber;
@ -147,7 +175,9 @@ class VehiclesController extends Controller
public function destroy($id)
{
vehicle::where('id',$id)->delete();
return redirect()->to('/pojazdy');
return response()->json([
'success' => 'Record deleted successfully!'
]);
}
public function activate()

View File

@ -15,55 +15,55 @@ class fireFightersController extends Controller
{
public function create(){
if(auth()->user() != null && auth()->user()->fireStationID != null ){
if(auth()->user() != null && auth()->user()->accessLevel() >= 20) //prezes,naczelnik,sekretarz
{
// $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);
->paginate(10);
return view("fireFighters", ["users" => $users]);
} else{
return view('fireFighters');
} else {
return redirect()->to('/userprofile');
}
}
public function addForm(){
if(auth()->user() != null && auth()->user()->fireStationID != null ){
if(auth()->user() != null && auth()->user()->accessLevel() == 50 ){ //prezes,naczelnik
$fireStation = fireStation::find(auth()->user()->fireStationID);
if($fireStation-> creatorID == auth()->user()->id){
//return view('fireFightersAdd');
if($fireStation-> creatorID == auth()->user()->id){ //if do usunięcia w pzyszłości
$ranks = DB::table('ranks')->pluck("rank","id");
$unitFunctions = DB::table('unitFunctions')->pluck("unitFunction","id");
return view('fireFightersAdd',compact('ranks'), compact('unitFunctions'));
} else return fireFightersController::create();
} else return view("unit");
} else return fireFightersController::create(); // ???
} else return redirect()->to('/strazacy');
}
public function editForm($id){
if(auth()->user() != null && auth()->user()->fireStationID != null ){
if(auth()->user() != null && auth()->user()->accessLevel() == 50 ){ //prezes,naczelnik
$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) {
if($userFireStation == $fireFighterFireStation && auth()->user()->id == $fireStationCreatorId) { // if do usunięcia w pzyszłości
return view('fireFightersEdit', ["fireFighter" => $fireFighter]);
} else{
return "Brak dostepu";
}
}else{
return view('unit');
return redirect()->to('/strazacy');
}
}
public function store(){
$this->validate(request(), [
'name' => 'required|alpha|min:3|max:45',
'surname' => 'required|alpha|min:3|max:45',
'name' =>'required|min:2|max:45|regex:/^[\p{L}\040\x27-]+$/',
'surname' =>'required|min:2|max:45|regex:/^[\p{L}\040\x27-]+$/',
'PESEL' => new Pesel,
'phoneNumber' => 'required|digits:9',
'email' => 'required|email|unique:users',
@ -74,8 +74,7 @@ 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.',
'alpha' => ':attribute może zawierać tylko litery.',
'alpha_num' => ':attribute może zawierać tylko litery i cyfry.',
'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.',
@ -112,8 +111,8 @@ class fireFightersController extends Controller
public function update(){
$this->validate(request(), [
'name' => 'required|alpha|min:3|max:45',
'surname' => 'required|alpha|min:3|max:45',
'name' =>'required|min:2|max:45|regex:/^[\p{L}\040\x27-]+$/',
'surname' =>'required|min:2|max:45|regex:/^[\p{L}\040\x27-]+$/',
'PESEL' => new Pesel,
'phoneNumber' => 'required|digits:9',
],
@ -121,8 +120,7 @@ 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.',
'alpha' => ':attribute może zawierać tylko litery.',
'alpha_num' => ':attribute może zawierać tylko litery i cyfry.',
'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.',
@ -140,6 +138,7 @@ class fireFightersController extends Controller
return fireFightersController::create();
}
public function createSingleFireFighterPDF(){
if (auth()->user() != null && auth()->user()->fireStationID != null) {
$request = request();
@ -156,5 +155,23 @@ class fireFightersController extends Controller
}
}
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');
}
}

View File

@ -26,7 +26,7 @@ class fireStationController extends Controller
public function editForm()
{
if(auth()->user() != null && auth()->user()->fireStationID != null )
if(auth()->user() != null && auth()->user()->accessLevel() == 50) //prezes/naczelnik
{
$id = auth()->user()->fireStationID;
$fireStation = DB::table('fireStations')->where("id", $id)->first();
@ -34,7 +34,7 @@ class fireStationController extends Controller
return view('fireStationEdit', ["fireStation" => $fireStation], compact('voivodeships'));
}
else
return "Brak dostępu";
return redirect()->to('/jednostka');
}
public function store()

View File

@ -60,7 +60,7 @@ class operationsController extends Controller
}
public function addForm(){
if(auth()->user() != null && auth()->user()->fireStationID != null ){
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],
@ -69,13 +69,13 @@ class operationsController extends Controller
])
->get();
return view("operationAdd", ["fireFighters" => $fireFighters], ["vehicles" => $vehicles]);
} else return view("unit");
} else return redirect()->to('/wyjazdy');
}
public function editForm($id){
if(auth()->user() != null && auth()->user()->fireStationID != null ){
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([
@ -120,17 +120,17 @@ class operationsController extends Controller
// return "Brak dostepu";
// }
} else{
return view('unit');
return redirect()->to('/wyjazdy');
}
}
public function store(){
$this->validate(request(),[
'operationDate' => 'required',
'operationLocation' => 'required',
'operationTarget' => 'required',
'operationDangerType' => 'required',
'operationDescription' => 'required',
'operationLocation' => 'required|max:100',
'operationTarget' => 'required|max:100',
'operationDangerType' => 'required|max:100',
'operationDescription' => 'required|max:250',
'operationLeader' => 'required',
'operationDriver.*' => 'required',
'operationVehicle.*' => 'required',
@ -138,7 +138,8 @@ class operationsController extends Controller
'transport.*' => 'required',
],
[
'required' => ':attribute jest wymagany(e)'
'required' => ':attribute jest wymagany(e)',
'max' => ':attribute musi mieć nie więcej niż :max znaków.'
]);
//
@ -197,10 +198,10 @@ class operationsController extends Controller
public function update(){
$this->validate(request(),[
'operationDate' => 'required',
'operationLocation' => 'required',
'operationTarget' => 'required',
'operationDangerType' => 'required',
'operationDescription' => 'required',
'operationLocation' => 'required|max:100',
'operationTarget' => 'required|max:100',
'operationDangerType' => 'required|max:100',
'operationDescription' => 'required|max:250',
'operationLeader' => 'required',
'operationDriver.*' => 'required',
'operationVehicle.*' => 'required',
@ -209,7 +210,7 @@ class operationsController extends Controller
],
[
'required' => ':attribute jest wymagany(e)',
'operationTarget.required' => 'Cel jest wyma gany'
'max' => ':attribute musi mieć nie więcej niż :max znaków.'
]);

View File

@ -34,9 +34,7 @@ class resetPasswordController extends Controller
if($user){
$password = str_random(10);
User::where('email', '=', $request->email)
->update(['password' => Hash::make($password)]); // this will also update the record
//$user->password = $password;
//$user->save();
->update(['password' => Hash::make($password)]);
Mail::send('emails.passwordReset', compact('password'), function($message) {
$message->to(Input::get('email'))->subject('Zmiana hasła');
});

View File

@ -14,7 +14,7 @@ class trainingsController extends Controller
{
public function create(){
if(auth()->user() != null && auth()->user()->fireStationID != null ){
if(auth()->user() != null && auth()->user()->accessLevel() == 50 ){ //prezes,naczelnik
$trainings = DB::table('trainings')->where("fireStationID", '=', auth()->user()->fireStationID)
->whereNull('deleted_at')
->paginate(10);
@ -32,16 +32,17 @@ class trainingsController extends Controller
}
return View::make("trainings")->with(compact( "trainings", "fireFighters"));
} else{
return view('trainings');
return redirect()->to('/strazacy');
}
}
public function store(){
$this->validate(request(), [
'name' => 'required',
'name' => 'required|max:45',
],
[
'required' => ':attribute jest wymagany(a).',
'required' => 'Nazwa jest wymagana.',
'max' => 'Nazwa musi mieć nie więcej niż :max znaków.',
]);
@ -60,7 +61,7 @@ class trainingsController extends Controller
public function addTrainingsFireFighters($id){
if(auth()->user() != null && auth()->user()->fireStationID != null ){
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');
@ -73,7 +74,7 @@ class trainingsController extends Controller
->whereNull('deleted_at')->first();
return View::make("trainingsAddFireFighters")->with(compact( "training", "fireFighters"));
} else{
return view('trainings');
return redirect()->to('/strazacy');
}
}

View File

@ -39,8 +39,8 @@ class userProfileController extends Controller
public function update(){
$this->validate(request(), [
'name' => 'required|alpha|min:3|max:45',
'surname' => 'required|alpha|min:3|max:45',
'name' =>'required|min:2|max:45|regex:/^[\p{L}\040\x27-]+$/',
'surname' =>'required|min:2|max:45|regex:/^[\p{L}\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
@ -49,8 +49,7 @@ class userProfileController 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.',
'alpha' => ':attribute może zawierać tylko litery.',
'alpha_num' => ':attribute może zawierać tylko litery i cyfry.',
'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.',

View File

@ -43,4 +43,20 @@ 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
}
}

View File

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

View File

@ -2913,5 +2913,19 @@ 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 Nowacka','surname'=>'','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 Klupsz','surname'=>'','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 Prządka','surname'=>'','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ł Smerdka','surname'=>'','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 Kotlarski','surname'=>'','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 Orwat','surname'=>'','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ł Rogozinski','surname'=>'','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 Kaczmarek','surname'=>'','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ł Nowak','surname'=>'','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()]);
}
}

View File

@ -163,9 +163,32 @@ return [
'latitude' => 'szerokość geograficzna',
'amount' => 'ilość',
'decoration' => 'odznaczenie',
'dateOfAward' => 'data przyznania'
'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',
],
];

View File

@ -1,5 +1,7 @@
@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>
@ -7,6 +9,7 @@
</ul>
@stop
@section('center-area')
<meta name="csrf-token" content="{{ csrf_token() }}">
@parent
@if( auth()->check())
@ -28,15 +31,11 @@
<th>Operacja</th>
@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>
<button class="btn btn-danger" type="submit" id="{{$awardedDecoration->decorationsFirefightersID}}" onclick="deleteButton('{{$awardedDecoration->decorationsFirefightersID}}')">Usuń</button>
</td>
</form>
</tr>
@endforeach
</tbody>
@ -54,7 +53,11 @@
<select name="decoration" class="form-control" style="width:300px">
<option value="">--- Wybierz odznaczenie ---</option>
@foreach ($decoration as $key => $value)
<option value="{{ $key }}">{{ $value }}</option>
@if(Illuminate\Support\Facades\Input::old('decoration') == $key)
<option value="{{ $key }}" selected >{{ $value }}</option>
@else
<option value="{{ $key }}">{{ $value }}</option>
@endif
@endforeach
</select>
</div>
@ -73,3 +76,38 @@
@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>

View File

@ -4,16 +4,12 @@
@parent
<ul>
<a href="/sprzet"><li>Sprzęt<img src="img/left_menu_icon/more.png"></li></a>
<a href="/szkolenia"><li>Badania/Szkolenia<img src="img/left_menu_icon/more.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>
@stop
@section('center-area')
@parent
Strona w budowie
<p>Zawarte będą tutaj informacje o umundurowaniu oraz sprzęcie jaki jest na wyposażeniu strażnicy oraz informacje gdzie umundurowanie się znajduje(druhowie mundury koszarowe oraz galowe mają w w domach, informacja ta pozwoli na sprawdzenie np jakie braki w umundurowaniu).</p>
<p>Zawarte 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 braki w umundurowaniu).</p>
@stop

View File

@ -1,13 +1,18 @@
@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>
<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')
@ -26,7 +31,9 @@
<th>Nazwa</th>
<th>Ilość</th>
<th>Param. charakterystyczny</th>
@if(auth()->user()->accessLevel() == 50)
<th>Operacja</th>
@endif
</tr>
</thead>
@ -39,10 +46,12 @@
<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

View File

@ -3,9 +3,7 @@
@section('left-menu')
@parent
<ul>
<a href="/sprzet/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>
<a href="/sprzet"><li>Przeglądaj<img src="/img/left_menu_icon/more.png"></li></a>
</ul>
@stop
@ -29,7 +27,7 @@
</div>
<div class="form-group">
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zatwierdź</button>
<button style="cursor:pointer" type="submit" class="btn btn-primary">Utwórz</button>
</div>
@include('inc.formerrors')
</form>

View File

@ -4,8 +4,7 @@
@parent
<ul>
<a href="/sprzet/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>
<a href="/sprzet"><li>Przeglądaj<img src="/img/left_menu_icon/more.png"></li></a>
</ul>
@stop
@ -31,7 +30,7 @@
</div>
<div class="form-group">
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zatwierdź</button>
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zapisz</button>
</div>
@include('inc.formerrors')
</form>

View File

@ -2,12 +2,16 @@
@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>
<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>
<a href="/szkolenia"><li><font size="-2">Badania/Szkolenia</font><img src="/img/left_menu_icon/more.png"></li></a>
</ul>
@endif
@endif
@endif
@stop
<head>
@ -70,14 +74,16 @@
<thead>
<tr>
<th>#</th>
<th>Imie</th>
<th>Imię</th>
<th>Nazwisko</th>
<th>PESEL</th>
<th>E-mail</th>
<th>Funkcja</th>
<th>Stopień</th>
<th>Status</th>
<th>Operacje</th>
@if(auth()->user()->accessLevel() == 50)
<th>Operacja</th>
@endif
</tr>
</thead>
@ -95,25 +101,36 @@
<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="strazacy/pdf/single/" 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óć do służby</button>
</form>
@endif
@endif
</td>
@endif
</tr>
{{-- <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>--}}
@php
$i++;
@endphp

View File

@ -3,11 +3,8 @@
@section('left-menu')
@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>
<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>
</ul>
@stop
@ -62,7 +59,7 @@
</div>
<div class="form-group">
<button style="cursor:pointer" type="submit" class="btn btn-primary">Submit</button>
<button style="cursor:pointer" type="submit" class="btn btn-primary">Utwórz</button>
</div>
@include('inc.formerrors')
</form>

View File

@ -3,11 +3,8 @@
@section('left-menu')
@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>
<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>
</ul>
@stop
@ -39,7 +36,7 @@
<div class="form-group">
<button style="cursor:pointer" type="submit" class="btn btn-primary">Edytuj</button>
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zapisz</button>
</div>
@include('inc.formerrors')
</form>

View File

@ -95,7 +95,7 @@
<div class="form-group">
<button style="cursor:pointer" type="submit" class="btn btn-primary">Submit</button>
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zapisz</button>
</div>
@include('inc.formerrors')
</form>

View File

@ -94,7 +94,7 @@
<div class="form-group">
<button style="cursor:pointer" type="submit" class="btn btn-primary">Submit</button>
<button style="cursor:pointer" type="submit" class="btn btn-primary">Utwórz</button>
</div>
@include('inc.formerrors')
</form>

View File

@ -11,6 +11,9 @@
</div>
@endif
@if( auth()->check())
Jesteś już zalogowany.
@else
<h2>Zaloguj się</h2>
<form method="POST" action="/login">
@ -21,7 +24,7 @@
</div>
<div class="form-group">
<label for="password">Password:</label>
<label for="password">Hasło:</label>
<input type="password" class="form-control" id="password" name="password">
</div>
@ -32,5 +35,5 @@
</form>
<a href="/forgottenPassword">Nie pamiętam hasła<a>
@endif
@endsection

View File

@ -3,9 +3,16 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
@section('left-menu')
@parent<ul>
@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>
</ul>
@endif
@endif
@endif
@stop
@section('center-area')
@ -33,8 +40,12 @@
<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
<th>Szczegóły</th>
</tr>
</thead>
@ -50,6 +61,7 @@
<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>
@ -59,6 +71,7 @@
<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>

View File

@ -3,7 +3,7 @@
<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>Wróć<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
@ -44,7 +44,11 @@
<select name="operationLeader" class="form-control">
<option value="">--- Wybierz dowódcę ---</option>
@foreach ($fireFighters as $fireFighter)
<option value="{{$fireFighter->id}}">{{ $fireFighter->name }} {{$fireFighter->surname }}</option>
@if(Illuminate\Support\Facades\Input::old('operationLeader') == $fireFighter->id)
<option value="{{$fireFighter->id}}" selected>{{ $fireFighter->name }} {{$fireFighter->surname }}</option>
@else
<option value="{{$fireFighter->id}}">{{ $fireFighter->name }} {{$fireFighter->surname }}</option>
@endif
@endforeach
</select>
</div>
@ -162,6 +166,4 @@
});
</script>
</script>

View File

@ -3,7 +3,8 @@
<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>Wróc<img src="/img/left_menu_icon/add.png"></li></a>
<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

View File

@ -3,7 +3,7 @@
@section('center-area')
@parent
<h2>Register</h2>
<h2>Rejestracja</h2>
<form method="POST" action="/register">
{{ csrf_field() }}
<div class="form-group">
@ -45,7 +45,7 @@
</div>
<div class="form-group">
<button style="cursor:pointer" type="submit" class="btn btn-primary">Submit</button>
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zarejestruj</button>
</div>
@include('inc.formerrors')
</form>

View File

@ -8,9 +8,7 @@
@section('left-menu')
@parent
<ul>
<a href="sprzet/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>
<a href="/strazacy"><li>Strażacy<img src="/img/left_menu_icon/more.png"></li></a>
</ul>
@stop
@ -25,7 +23,7 @@
<form method="POST" action="/szkolenia">
{{ csrf_field() }}
<div class="form-group">
<label for="name">Nazwa Szkolenia/Badana:</label>
<label for="name">Nazwa nowego szkolenia/badania:</label>
<input type="text" class="form-control" id="name" name="name" value="{{ old('name') }} ">
</div>
@ -122,7 +120,7 @@
title: "Podaj nową nazwę",
width: 'auto',
input: 'text',
confirmButtonText: 'Tak',
confirmButtonText: 'Zapisz',
cancelButtonText: 'Anuluj',
showCancelButton: true,
inputValidator: (value) => {
@ -157,7 +155,7 @@
function deleteButton(trainingID){
swal.fire({
title: "Czy chcesz usunąć wyjazd?",
title: "Czy chcesz usunąć badanie/szkolenie?",
width: 'auto',
confirmButtonText: 'Tak',
cancelButtonText: 'Nie',

View File

@ -7,9 +7,8 @@
@section('left-menu')
@parent
<ul>
<a href="sprzet/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>
<a href="/strazacy"><li>Strażacy<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>
</ul>
@stop

View File

@ -2,11 +2,15 @@
@section('left-menu')
@parent
@if( auth()->check() )
@if( auth()->user()->fireStationID != NULL)
@if(auth()->user()->accessLevel() == 50)
<ul>
<a href="/jednostka/edit"><li>Edytuj<img src="img/left_menu_icon/edit.png"></li></a>
</ul>
@endif
@endif
@endif
@stop
@section('center-area')
@ -75,21 +79,7 @@
<div>
@endif
@else
<div>
<p><b>Nazwa:</b> Ochotnicza Straż Pożarna w Łuszczewie</p>
<p><b>Województwo:</b> Wielkopolskie</p>
<p><b>Powiat:</b> Koniński</p>
<p><b>Gmina i numer ewidencyjny:</b> Skulsk 3010092</p>
<p><b>Kod pocztowy, Miejscowość:</b> 62-560 Skulsk</p>
<p><b>Ulica i numer:</b> Łuszczewo 81</p>
<p><b>Szerokość i długość geograficzna:</b> 523113.08 | 182155.88</p>
<p><b>KRS:</b> 0000003716</p>
<p><b>NIP:</b> 665 524 497 69 </p>
<p><b>Telefon:</b> ??? - ??? - ???</p>
<p><b>E-mail:</b> twojanazwa@domena.com</p>
<hr>
<p><b>Liczba członków:</b> 40</p>
</div>
Witamy na stronie eOSP! <a href="/login">Zaloguj się</a> lub <a href="/register">Zarejestruj nową jednostkę</a>.
<div>
@endif
</div>

View File

@ -41,10 +41,10 @@
<th>Adres e-mail:</th>
<td>{{ $userData->email}}</td>
</tr>
<tr>
<th>Numer ewidencyjny:</th>
<td>{{ $userData->number}}</td>
</tr>
{{-- <tr> --}}
{{-- <th>Numer ewidencyjny:</th> --}}
{{-- <td>{{ $userData->number}}</td> --}}
{{-- </tr> --}}
<tr>
<th>Stopień:</th>
<td>{{ $userData->rank}}</td>

View File

@ -41,7 +41,7 @@
</div>
<div class="form-group">
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zatwierdź</button>
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zapisz</button>
</div>
@include('inc.formerrors')
</form>

View File

@ -1,13 +1,22 @@
@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="/pojazdy/add"><li>Dodaj<img src="img/left_menu_icon/add.png"></li></a>
</ul>
@endif
@endif
@endif
@stop
@section('center-area')
<meta name="csrf-token" content="{{ csrf_token() }}">
@parent
@if( auth()->check())
@if( auth()->user()->fireStationID == NULL)
@ -26,7 +35,9 @@
<th>Rodzaj napędu</th>
<th>Przegląd</th>
<th>OC</th>
@if(auth()->user()->accessLevel() == 50)
<th>Operacja</th>
@endif
</tr>
</thead>
@ -39,7 +50,6 @@
@endphp
<tr>
<form action="{{ route('vehicles.destroy', $vehicle->id)}}" method="post">
<td>{{ $lp }}</td>
<td id="name{{ $vehicle->id }}">{{ $vehicle->name }}</td>
<td id="brand{{ $vehicle->id }}">{{ $vehicle->brand }}</td>
@ -49,12 +59,10 @@
<td id="driveType{{ $vehicle->id }}">{{ $vehicle->driveType }}</td>
<td id="examExpirationDate{{ $vehicle->id }}">{{ $vehicle->examExpirationDate }}</td>
<td id="insuranceExpirationDate{{ $vehicle->id }}">{{ $vehicle->insuranceExpirationDate }}</td>
@if(auth()->user()->accessLevel() == 50)
<td style="display:inline;">
<a href="{{ URL::asset('pojazdy/edit/'.$vehicle->id) }}" class="btn btn-secondary" role="button">Edytuj</a>
{{ csrf_field() }}
@method('DELETE')
<button class="btn btn-danger" type="submit">Usuń</button>
</form>
<button class="btn btn-danger" type="submit" id="{{$vehicle->id}}" onclick="deleteButton('{{$vehicle->id}}')">Usuń</button>
@if ($vehicle->status == 1)
<form method="POST" action="/pojazdy/deactivate" style="display:inline;">
{{ csrf_field() }}
@ -70,6 +78,7 @@
@endif
</td>
@endif
</tr>
@endforeach
</table>
@ -79,3 +88,39 @@
Brak autoryzacji
@endif
@stop
<script>
function deleteButton(vehicleID){
swal.fire({
title: "Czy chcesz usunąć pojazd?",
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: "pojazdy/"+vehicleID,
type: 'DELETE',
data: {
"id": vehicleID,
},
success: function (){
console.log("it Works");
location.reload();
}
});
}
})
}
</script>

View File

@ -3,7 +3,7 @@
@section('left-menu')
@parent
<ul>
<a href="/pojazdy"><li>Przeglądaj<img src="img/left_menu_icon/add.png"></li></a>
<a href="/pojazdy"><li>Przeglądaj<img src="/img/left_menu_icon/more.png"></li></a>
</ul>
@stop
@ -12,8 +12,8 @@
<form method="POST" action="/pojazdy">
{{ csrf_field() }}
<div class="form-group">
<label for="name">Nazwa:</label>
<input type="text" class="form-control" id="name" name="name" value="{{ old('name') }} ">
<label for="vehicleName">Nazwa:</label>
<input type="text" class="form-control" id="vehicleName" name="vehicleName" value="{{ old('vehicleName') }} ">
</div>
<div class="form-group">
@ -120,7 +120,7 @@
</div>
<div class="form-group">
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zatwierdź</button>
<button style="cursor:pointer" type="submit" class="btn btn-primary">Utwórz</button>
</div>
@include('inc.formerrors')
</form>

View File

@ -3,10 +3,8 @@
@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/add"><li>Dodaj<img src="/img/left_menu_icon/add.png"></li></a>
<a href="/pojazdy"><li>Przeglądaj<img src="/img/left_menu_icon/more.png"></li></a>
</ul>
@stop
@ -17,8 +15,8 @@
<input type="hidden" class="form-control" name="vehicleID" value="{{ $vehicle->id }}">
<div class="form-group">
<label for="name">Nazwa:</label>
<input type="text" class="form-control" id="name" name="name" value="{{ $vehicle->name }} ">
<label for="vehicleName">Nazwa:</label>
<input type="text" class="form-control" id="vehicleName" name="vehicleName" value="{{ $vehicle->name }} ">
</div>
<div class="form-group">
@ -125,7 +123,7 @@
</div>
<div class="form-group">
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zatwierdź zmiany</button>
<button style="cursor:pointer" type="submit" class="btn btn-primary">Zapisz</button>
</div>
@include('inc.formerrors')
</form>

View File

@ -57,10 +57,14 @@ Route::post('/strazacy', 'fireFightersController@store');
Route::get('/strazacy/edit/{id}', 'fireFightersController@editForm');
Route::post('/strazacy/edit', 'fireFightersController@update');
Route::post('/strazacy/pdf/single/', 'fireFightersController@createSingleFireFighterPDF');
Route::post('strazacy/activate', 'fireFightersController@activate');
Route::post('strazacy/deactivate', 'fireFightersController@deactivate');
Route::get('/strazacy/odznaczenia/{id}', 'DecorationsController@create');
Route::post('/strazacy/odznaczenia/{id}', 'DecorationsController@store');
Route::resource('decorations', 'DecorationsController');
Route::delete('/strazacy/odznaczenia/delete/{id}', 'DecorationsController@destroy')->name('DecorationsController.destroy');
Route::get('/jednostka', 'fireStationController@create');
Route::post('/jednostka', 'fireStationController@store');
@ -79,6 +83,7 @@ Route::post('/pojazdy/edit', 'VehiclesController@update');
Route::resource('vehicles', 'VehiclesController');
Route::post('pojazdy/activate', 'VehiclesController@activate');
Route::post('pojazdy/deactivate', 'VehiclesController@deactivate');
Route::delete('pojazdy/{id}', 'VehiclesController@destroy')->name('VehiclesController.destroy');
Route::get('/sprzet', 'EquipmentController@create');
Route::get('/sprzet/add', 'EquipmentController@addForm');