forked from s421507/eOSP2
Merge branch 'master' of https://git.wmi.amu.edu.pl/s421507/eOSP2
This commit is contained in:
commit
d8a7b998ec
95
app/Http/Controllers/EquipmentController.php
Normal file
95
app/Http/Controllers/EquipmentController.php
Normal file
@ -0,0 +1,95 @@
|
||||
<?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')->get();
|
||||
return view("equipment", ["equipment" => $equipment]);
|
||||
} else{
|
||||
return view('equipment');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function addForm(){
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ){
|
||||
return view('equipmentAdd');
|
||||
|
||||
} else return view("login");
|
||||
}
|
||||
|
||||
public function editForm($id)
|
||||
{
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null )
|
||||
{
|
||||
|
||||
$equipment = DB::table('equipment')->where("id", $id)->first();
|
||||
|
||||
return view('equipmentEdit', ["equipment" => $equipment]);
|
||||
}
|
||||
else
|
||||
return view("login");
|
||||
|
||||
}
|
||||
|
||||
public function store(){
|
||||
$this->validate(request(), [
|
||||
|
||||
'name' => 'required',
|
||||
'amount' => 'required|numeric',
|
||||
],
|
||||
[
|
||||
'required' => ':attribute jest wymagany(a).',
|
||||
'numeric' => ':attribute powinna zawierać tylko cyfry.',
|
||||
]);
|
||||
|
||||
|
||||
$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',
|
||||
'amount' => 'required|numeric',
|
||||
],
|
||||
[
|
||||
'required' => ':attribute jest wymagany(a).',
|
||||
'numeric' => ':attribute powinna zawierać tylko cyfry.'
|
||||
]);
|
||||
|
||||
|
||||
$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 redirect()->to('/sprzet');
|
||||
}
|
||||
}
|
@ -9,8 +9,11 @@ use Carbon\Carbon; // formatowanie daty
|
||||
|
||||
function formatDate($date)
|
||||
{
|
||||
$fdate = Carbon::parse($date);
|
||||
return $fdate;
|
||||
if ($date == null)
|
||||
return $date;
|
||||
else
|
||||
$fdate = Carbon::parse($date);
|
||||
return $fdate;
|
||||
}
|
||||
|
||||
class VehiclesController extends Controller
|
||||
@ -19,7 +22,7 @@ class VehiclesController extends Controller
|
||||
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ){
|
||||
$vehicles = DB::table('vehicles')->where("fireStationID", '=', auth()->user()->fireStationID)
|
||||
->get();
|
||||
->whereNull('deleted_at')->get();
|
||||
return view("vehicles", ["vehicles" => $vehicles]);
|
||||
} else{
|
||||
return view('vehicles');
|
||||
@ -30,7 +33,6 @@ class VehiclesController extends Controller
|
||||
public function addForm(){
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ){
|
||||
return view('vehiclesAdd');
|
||||
|
||||
} else return view("login");
|
||||
}
|
||||
|
||||
@ -38,32 +40,25 @@ class VehiclesController extends Controller
|
||||
{
|
||||
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');
|
||||
|
||||
$vehicle = DB::table('vehicles')->where("id", $id)->first();
|
||||
|
||||
$vehicle = DB::table('vehicles')->where("id", $id)->first();
|
||||
return view('vehiclesEdit', ["vehicle" => $vehicle]);
|
||||
}
|
||||
}
|
||||
else
|
||||
return "Brak dostepu";
|
||||
|
||||
return "Brak dostepu";
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function store(){
|
||||
$this->validate(request(), [
|
||||
|
||||
'name' => 'required',
|
||||
'productionYear' => 'digits:4',
|
||||
'foamAgent' => 'numeric',
|
||||
'enginePower' => 'numeric',
|
||||
'crewNumber' => 'numeric',
|
||||
'mass' => 'numeric',
|
||||
'chassisPoductionYear' => 'numeric',
|
||||
//dokończyć! Wypytać Adriana które mają być required
|
||||
'codename' => 'required',
|
||||
'productionYear' => 'digits:4|nullable',
|
||||
'foamAgent' => 'numeric|nullable',
|
||||
'enginePower' => 'numeric|nullable',
|
||||
'crewNumber' => 'numeric|nullable',
|
||||
'mass' => 'numeric|nullable',
|
||||
'chassisPoductionYear' => 'numeric|nullable',
|
||||
],
|
||||
[
|
||||
'required' => ':attribute jest wymagany(e).',
|
||||
@ -105,13 +100,13 @@ class VehiclesController extends Controller
|
||||
$this->validate(request(), [
|
||||
|
||||
'name' => 'required',
|
||||
'productionYear' => 'digits:4',
|
||||
'foamAgent' => 'numeric',
|
||||
'enginePower' => 'numeric',
|
||||
'crewNumber' => 'numeric',
|
||||
'mass' => 'numeric',
|
||||
'chassisPoductionYear' => 'numeric',
|
||||
//dokończyć! Wypytać Adriana które mają być required
|
||||
'codename' => 'required',
|
||||
'productionYear' => 'digits:4|nullable',
|
||||
'foamAgent' => 'numeric|nullable',
|
||||
'enginePower' => 'numeric|nullable',
|
||||
'crewNumber' => 'numeric|nullable',
|
||||
'mass' => 'numeric|nullable',
|
||||
'chassisPoductionYear' => 'numeric|nullable',
|
||||
],
|
||||
[
|
||||
'required' => ':attribute jest wymagany(e).',
|
||||
@ -144,6 +139,12 @@ class VehiclesController extends Controller
|
||||
$vehicle-> fireEnginePumpDescription = $request-> fireEnginePumpDescription;
|
||||
$vehicle->save();
|
||||
|
||||
return VehiclesController::create();
|
||||
return redirect()->to('/pojazdy');;
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
vehicle::where('id',$id)->delete();
|
||||
return redirect()->to('/pojazdy');
|
||||
}
|
||||
}
|
||||
|
@ -15,14 +15,27 @@ class fireStationController extends Controller
|
||||
return view('unit', ["fireStation" => $fireStation]);
|
||||
} else{
|
||||
$voivodeships = DB::table('wojewodztwa')->pluck("name","id");
|
||||
return view('unit',compact('voivodeships'));
|
||||
//return view('unit');
|
||||
return view('unit',compact('voivodeships'));
|
||||
}
|
||||
}
|
||||
|
||||
public function editForm()
|
||||
{
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null )
|
||||
{
|
||||
$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 "Brak dostępu";
|
||||
}
|
||||
|
||||
public function store()
|
||||
{
|
||||
$this->validate(request(),[
|
||||
'unitName' => 'required|min:3|max:45',
|
||||
'fireStationName' => 'required|min:3|max:45',
|
||||
'number' => 'required|numeric',
|
||||
'voivodeship' => 'required',
|
||||
'county' => 'required',
|
||||
@ -57,7 +70,7 @@ class fireStationController extends Controller
|
||||
$community = DB::table('gminy')->select('name')->where('id', $request -> community)->first();
|
||||
|
||||
$jednostka = fireStation::create([
|
||||
'name' => $request -> unitName,
|
||||
'name' => $request -> fireStationName,
|
||||
'number' => $request -> number,
|
||||
'voivodeship' => $voivodeship -> name,
|
||||
'county' => $county -> name,
|
||||
@ -81,4 +94,60 @@ 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');;
|
||||
}
|
||||
}
|
||||
|
18
app/equipment.php
Normal file
18
app/equipment.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?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',
|
||||
];
|
||||
|
||||
}
|
@ -3,9 +3,11 @@
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class vehicle extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
protected $primaryKey = 'id';
|
||||
protected $table = 'vehicles';
|
||||
|
||||
|
494
database/db/eOSP.sql
Normal file
494
database/db/eOSP.sql
Normal file
@ -0,0 +1,494 @@
|
||||
-- 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;
|
BIN
database/db/osp.mwb
Normal file
BIN
database/db/osp.mwb
Normal file
Binary file not shown.
BIN
database/db/osp.mwb.bak
Normal file
BIN
database/db/osp.mwb.bak
Normal file
Binary file not shown.
@ -18,24 +18,25 @@ class CreateVehiclesTable extends Migration
|
||||
$table->integer('fireStationID');
|
||||
$table->string('name', 45);
|
||||
$table->string('codename', 45);
|
||||
$table->string('brand',45);
|
||||
$table->string('registrationNumber', 15);
|
||||
$table->integer('productionYear');
|
||||
$table->date('examExpirationDate'); //Data ważności przegladu
|
||||
$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->string('chassisNumber');
|
||||
$table->string('engineNumber');
|
||||
$table->string('fuelType',45);
|
||||
$table->integer('chassisPoductionYear');
|
||||
$table->date('entryIntoServiceDate');
|
||||
$table->string('fireEnginePumpDescription');// Opis autopompy
|
||||
$table->string('brand',45)->nullable();
|
||||
$table->string('registrationNumber', 15)->nullable();
|
||||
$table->integer('productionYear')->nullable();
|
||||
$table->date('examExpirationDate')->nullable(); //Data ważności przegladu
|
||||
$table->date('insuranceExpirationDate')->nullable();
|
||||
$table->string('driveType',45)->nullable(); //układ napędowy
|
||||
$table->string('chassisType',45)->nullable(); //typ podwozia
|
||||
$table->string('bodyProducer',45)->nullable(); //producent nadwozia
|
||||
$table->integer('crewNumber')->nullable();
|
||||
$table->integer('foamAgent')->nullable(); //Ilość środka pianotwórczego w litrach
|
||||
$table->integer('enginePower')->nullable(); //Moc silnika w kW
|
||||
$table->integer('mass')->nullable(); //Masa całkowita pojazdu
|
||||
$table->string('chassisNumber')->nullable();
|
||||
$table->string('engineNumber')->nullable();
|
||||
$table->string('fuelType',45)->nullable();
|
||||
$table->integer('chassisPoductionYear')->nullable();
|
||||
$table->date('entryIntoServiceDate')->nullable();
|
||||
$table->string('fireEnginePumpDescription')->nullable();// Opis autopompy
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
@ -0,0 +1,36 @@
|
||||
<?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('fireStationID');
|
||||
$table->string('name', 45);
|
||||
$table->integer('amount');
|
||||
$table->string('parameter', 45)->nullable();
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('equipment');
|
||||
}
|
||||
}
|
@ -161,6 +161,7 @@ return [
|
||||
'unitName' => 'nazwa jednostki',
|
||||
'longitude' => 'długość geograficzna',
|
||||
'latitude' => 'szerokość geograficzna',
|
||||
'amount' => 'ilość'
|
||||
],
|
||||
|
||||
|
||||
|
@ -3,14 +3,16 @@
|
||||
@section('left-menu')
|
||||
@parent
|
||||
<ul>
|
||||
<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>
|
||||
<a href="/sprzet"><li>Sprzęt<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 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>
|
||||
<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 są braki w umundurowaniu).</p>
|
||||
|
||||
|
||||
@stop
|
47
resources/views/equipment.blade.php
Normal file
47
resources/views/equipment.blade.php
Normal file
@ -0,0 +1,47 @@
|
||||
@extends('layout.app')
|
||||
|
||||
@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>
|
||||
</ul>
|
||||
@stop
|
||||
|
||||
@section('center-area')
|
||||
@parent
|
||||
|
||||
@if( auth()->check())
|
||||
@if( auth()->user()->fireStationID == NULL)
|
||||
Jednostka nie istnieje
|
||||
@else
|
||||
<p align='center'>
|
||||
<table class='firefighterViewTable'>
|
||||
<tr class='table-header'>
|
||||
<td>Nazwa</td>
|
||||
<td>Ilość</td>
|
||||
<td>Param. charakterystyczny</td>
|
||||
@foreach($equipment as $item)
|
||||
<tr>
|
||||
<form action="{{ route('equipment.destroy', $item->id)}}" method="post">
|
||||
<td id="name{{ $item->id }}">{{ $item->name }}</td>
|
||||
<td id="amount{{ $item->id }}">{{ $item->amount }}</td>
|
||||
<td id="parameter{{ $item->id }}">{{ $item->parameter }}</td>
|
||||
<td><a href="{{ URL::asset('sprzet/edit/'.$item->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>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</p>
|
||||
|
||||
@endif
|
||||
@else
|
||||
Brak autoryzacji
|
||||
@endif
|
||||
|
||||
@stop
|
36
resources/views/equipmentAdd.blade.php
Normal file
36
resources/views/equipmentAdd.blade.php
Normal file
@ -0,0 +1,36 @@
|
||||
@extends('layout.app')
|
||||
|
||||
@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>
|
||||
</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">Zatwierdź</button>
|
||||
</div>
|
||||
@include('inc.formerrors')
|
||||
</form>
|
||||
@stop
|
38
resources/views/equipmentEdit.blade.php
Normal file
38
resources/views/equipmentEdit.blade.php
Normal file
@ -0,0 +1,38 @@
|
||||
@extends('layout.app')
|
||||
|
||||
@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>
|
||||
</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">Zatwierdź</button>
|
||||
</div>
|
||||
@include('inc.formerrors')
|
||||
</form>
|
||||
@stop
|
165
resources/views/fireStationEdit.blade.php
Normal file
165
resources/views/fireStationEdit.blade.php
Normal file
@ -0,0 +1,165 @@
|
||||
@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">Submit</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
|
@ -4,7 +4,7 @@
|
||||
@parent
|
||||
|
||||
<head>
|
||||
<title>Laravel Dependent Dropdown Tutorial With Example</title>
|
||||
<title>Dodawanie 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>
|
||||
@ -16,7 +16,7 @@
|
||||
{{ csrf_field() }}
|
||||
<div class="form-group">
|
||||
<label for="name">Nazwa Jednostki:</label>
|
||||
<input type="text" class="form-control" id="unitName" name="unitName" value="{{ old('unitName') }} ">
|
||||
<input type="text" class="form-control" id="fireStationName" name="fireStationName" value="{{ old('fireStationName') }} ">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
@ -4,7 +4,7 @@
|
||||
@parent
|
||||
<ul>
|
||||
|
||||
<li>Edytuj<img src="img/left_menu_icon/edit.png"></li>
|
||||
<a href="/jednostka/edit"><li>Edytuj<img src="img/left_menu_icon/edit.png"></li></a>
|
||||
|
||||
</ul>
|
||||
@stop
|
||||
|
@ -36,6 +36,7 @@
|
||||
$lp = $lp + 1
|
||||
@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>
|
||||
@ -46,6 +47,11 @@
|
||||
<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>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
|
@ -54,6 +54,8 @@ Route::post('/strazacy/edit', 'fireFightersController@update');
|
||||
|
||||
Route::get('/jednostka', 'fireStationController@create');
|
||||
Route::post('/jednostka', 'fireStationController@store');
|
||||
Route::get('/jednostka/edit', 'fireStationController@editForm');
|
||||
Route::post('/jednostka/edit', 'fireStationController@update');
|
||||
|
||||
Route::get('/jednostka/getcounties/{id}','DataController@getCounties');
|
||||
Route::get('/jednostka/getcommunities/{id}','DataController@getCommunities');
|
||||
@ -63,7 +65,14 @@ Route::get('/pojazdy/add', 'VehiclesController@addForm');
|
||||
Route::post('/pojazdy', 'VehiclesController@store');
|
||||
Route::get('/pojazdy/edit/{id}', 'VehiclesController@editForm');
|
||||
Route::post('/pojazdy/edit', 'VehiclesController@update');
|
||||
Route::resource('vehicles', 'VehiclesController');
|
||||
|
||||
Route::get('/sprzet', 'EquipmentController@create');
|
||||
Route::get('/sprzet/add', 'EquipmentController@addForm');
|
||||
Route::post('/sprzet', 'EquipmentController@store');
|
||||
Route::get('/sprzet/edit/{id}', 'EquipmentController@editForm');
|
||||
Route::post('/sprzet/edit', 'EquipmentController@update');
|
||||
Route::resource('equipment', 'EquipmentController');
|
||||
|
||||
Route::get('register/verify/{confirmationCode}', [
|
||||
'as' => 'confirmation_path',
|
||||
|
Loading…
Reference in New Issue
Block a user