From 22f5df84fd3819d2cc3d8146ed7de9cc81daf551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=20=D0=9B=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D0=BE=D0=BD=D0=BE=D0=B2?= Date: Mon, 13 Nov 2023 21:47:12 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D1=80=D0=B0=D0=B7=D0=BE=D0=B2=D0=B0=D0?= =?UTF-8?q?=BD=D0=B8=D0=B5=20=D1=82=D0=B0=D0=B1=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Admin/EducationController.php | 10 + resources/views/admin/education/form.blade.php | 394 +++++++++++++++++--- .../views/admin/education/program-edit.blade.php | 45 +++ routes/web.php | 4 + 4 files changed, 404 insertions(+), 49 deletions(-) create mode 100644 resources/views/admin/education/program-edit.blade.php diff --git a/app/Http/Controllers/Admin/EducationController.php b/app/Http/Controllers/Admin/EducationController.php index 06d1243..56db14f 100644 --- a/app/Http/Controllers/Admin/EducationController.php +++ b/app/Http/Controllers/Admin/EducationController.php @@ -121,6 +121,16 @@ class EducationController extends Controller return redirect()->route('admin.education.edit', ['education' => $education]); } + public function edit_program(ProgramEducation $program, Education $education) { + $id_education = $education->id; + return view('admin.education.program-edit', compact('id_education', 'education', 'program')); + } + + public function update_program(ProgramEducationRequest $request, ProgramEducation $program, Education $education) { + $program->update($request->all()); + return redirect()->route('admin.education.edit', ['education' => $education]); + } + public function delete_program(ProgramEducation $program, Education $education) { $education = $education->id; $program->delete(); diff --git a/resources/views/admin/education/form.blade.php b/resources/views/admin/education/form.blade.php index e697afb..3f2a6ac 100644 --- a/resources/views/admin/education/form.blade.php +++ b/resources/views/admin/education/form.blade.php @@ -101,58 +101,106 @@ @isset($education) -
-
Специалитеты и категории:
-
-
-
-
- @if ($program->count()) - @php $bool = true; - $i = 1; - $level = ""; - @endphp - - @foreach ($program as $pro) - @if ((!empty($level)) && ($level <> $pro->level )) - -
- @php $bool = true; $i++; @endphp - @endif - @if ($bool == true) -
- - -
- - @php $bool = false; - $level = $pro->level; - @endphp - @endif -

- @endforeach +
+

+ Программы образования +

+
+

- @else - Нет записей - @endif - @endisset + + +
+ @if ($program->count()) + @php $bool = true; + $i = 1; + $level = ""; + @endphp + + @foreach ($program as $pro) + @if ((!empty($level)) && ($level <> $pro->level )) + @php $bool = true; $i++; @endphp + @endif + @if ($bool == true) +
+ +
+ @php $bool = false; + $level = $pro->level; + @endphp + @endif + @endforeach + @endif +
+
+ @if ($program->count()) + @php $bool = true; + $i = 1; + $level = ""; + @endphp + + @foreach ($program as $pro) + @if ((!empty($level)) && ($level <> $pro->level)) + + +
+ @php $bool = true; $i++; @endphp + @endif + + @if ($bool == true) +
+ + + + + + + + + + @php $bool = false; + $level = $pro->level; + @endphp + @endif + + + + + + @endforeach + @endif + + + @endisset + @@ -163,3 +211,251 @@ filebrowserUploadMethod: 'form' }); + + diff --git a/resources/views/admin/education/program-edit.blade.php b/resources/views/admin/education/program-edit.blade.php new file mode 100644 index 0000000..0376d3c --- /dev/null +++ b/resources/views/admin/education/program-edit.blade.php @@ -0,0 +1,45 @@ +@extends('layout.admin', ['title' => 'Админка - Образование - Редактирование программы обучения']) + +@section('content') + + @csrf + +
+ + + +
+ +
+ +
+
+ +
+
+
+ + +@endsection diff --git a/routes/web.php b/routes/web.php index b901f71..f3596f9 100644 --- a/routes/web.php +++ b/routes/web.php @@ -228,6 +228,10 @@ Route::group([ Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); + + Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); + Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education'); + Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); -- 1.7.10.4
СпециализацияОписаниеРедактирование
+
+
+

Специальность:

+

+ {{$pro->name}} +

+
+
+
+ Описание: {{$pro->text}} + + Изменить | + Удалить + +