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');
СпециализацияОписаниеРедактирование
+
+
+

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

+

+ {{$pro->name}} +

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