From 7a9272b8650cbaa9308d2186d0eb94ad5f47c18c Mon Sep 17 00:00:00 2001 From: Krzysztof Strzelecki Date: Thu, 27 Feb 2020 15:32:33 +0100 Subject: [PATCH] =?UTF-8?q?Dodanie=203=20szkole=C5=84=20wsp=C3=B3lnych=20d?= =?UTF-8?q?la=20wszystkich=20jednostek,=20wymaganych=20by=20bra=C4=87=20ud?= =?UTF-8?q?zia=C5=82=20w=20wyjazdach=20w=20roli=20stra=C5=BCaka/kierowcy/d?= =?UTF-8?q?ow=C3=B3dcy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/trainingsController.php | 2 +- ...add_trainings_necessary_for_operations.php | 35 +++++++++++++++++++ resources/views/trainings.blade.php | 4 +++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2020_02_27_134925_add_trainings_necessary_for_operations.php diff --git a/app/Http/Controllers/trainingsController.php b/app/Http/Controllers/trainingsController.php index d68a6a5..39e9a08 100644 --- a/app/Http/Controllers/trainingsController.php +++ b/app/Http/Controllers/trainingsController.php @@ -15,7 +15,7 @@ class trainingsController extends Controller public function create(){ if(auth()->user() != null && auth()->user()->accessLevel() == 50 ){ //prezes,naczelnik - $trainings = DB::table('trainings')->where("fireStationID", '=', auth()->user()->fireStationID) + $trainings = DB::table('trainings')->where("fireStationID", '=', auth()->user()->fireStationID)->orWhere("fireStationID", '=', 0) ->whereNull('deleted_at') ->paginate(10); diff --git a/database/migrations/2020_02_27_134925_add_trainings_necessary_for_operations.php b/database/migrations/2020_02_27_134925_add_trainings_necessary_for_operations.php new file mode 100644 index 0000000..ec84c54 --- /dev/null +++ b/database/migrations/2020_02_27_134925_add_trainings_necessary_for_operations.php @@ -0,0 +1,35 @@ +insert([ 'id' => '1', 'fireStationID' => '0', 'trainingName' => 'szkolenie podstawowe' ]); + DB::table('trainings')->insert([ 'id' => '2', 'fireStationID' => '0', 'trainingName' => 'dowódca' ]); + DB::table('trainings')->insert([ 'id' => '3', 'fireStationID' => '0', 'trainingName' => 'kierowca-mechanik' ]); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('trainings', function (Blueprint $table) { + // + }); + } +} \ No newline at end of file diff --git a/resources/views/trainings.blade.php b/resources/views/trainings.blade.php index d5f98a7..f9a07e2 100644 --- a/resources/views/trainings.blade.php +++ b/resources/views/trainings.blade.php @@ -60,9 +60,13 @@ {{ $training->trainingName }} {{$howMuch[$training->id]}} + @if($training->fireStationID != 0) + @endif Zarządzaj + @if($training->fireStationID != 0) + @endif
{{ csrf_field() }}