Commit 636d814c5300f2fd514fcd45315c913ef282ff09

Authored by Андрей Ларионов
1 parent b1a7d3c76c

Редактор табов образования

Showing 3 changed files with 32 additions and 3 deletions Inline Diff

app/Http/Controllers/Admin/EducationController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers\Admin; 3 namespace App\Http\Controllers\Admin;
4 4
5 use App\Http\Controllers\Controller; 5 use App\Http\Controllers\Controller;
6 use App\Http\Requests\EducationRequest; 6 use App\Http\Requests\EducationRequest;
7 use App\Http\Requests\ProgramEducationRequest; 7 use App\Http\Requests\ProgramEducationRequest;
8 use App\Models\Education; 8 use App\Models\Education;
9 use App\Models\ProgramEducation; 9 use App\Models\ProgramEducation;
10 use Illuminate\Http\Request; 10 use Illuminate\Http\Request;
11 use Illuminate\Support\Facades\DB;
11 use Illuminate\Support\Facades\Storage; 12 use Illuminate\Support\Facades\Storage;
12 13
13 class EducationController extends Controller 14 class EducationController extends Controller
14 { 15 {
15 /** 16 /**
16 * Display a listing of the resource. 17 * Display a listing of the resource.
17 * 18 *
18 * @return \Illuminate\Http\Response 19 * @return \Illuminate\Http\Response
19 */ 20 */
20 public function index() 21 public function index()
21 { 22 {
22 $education = Education::query()->active()->paginate(15); 23 $education = Education::query()->active()->paginate(15);
23 return view('admin.education.index', compact('education')); 24 return view('admin.education.index', compact('education'));
24 } 25 }
25 26
26 /** 27 /**
27 * Show the form for creating a new resource. 28 * Show the form for creating a new resource.
28 * 29 *
29 * @return \Illuminate\Http\Response 30 * @return \Illuminate\Http\Response
30 */ 31 */
31 public function create() 32 public function create()
32 { 33 {
33 return view('admin.education.add'); 34 return view('admin.education.add');
34 } 35 }
35 36
36 /** 37 /**
37 * Store a newly created resource in storage. 38 * Store a newly created resource in storage.
38 * 39 *
39 * @param \Illuminate\Http\Request $request 40 * @param \Illuminate\Http\Request $request
40 * @return \Illuminate\Http\Response 41 * @return \Illuminate\Http\Response
41 */ 42 */
42 public function store(EducationRequest $request) 43 public function store(EducationRequest $request)
43 { 44 {
44 $params = $request->all(); 45 $params = $request->all();
45 if ($request->has('image')) { 46 if ($request->has('image')) {
46 $params['image'] = $request->file('image')->store("education", 'public'); 47 $params['image'] = $request->file('image')->store("education", 'public');
47 } 48 }
48 Education::create($params); 49 Education::create($params);
49 50
50 51
51 return redirect()->route('admin.education.index'); 52 return redirect()->route('admin.education.index');
52 } 53 }
53 54
54 /** 55 /**
55 * Display the specified resource. 56 * Display the specified resource.
56 * 57 *
57 * @param \App\Models\Education $education 58 * @param \App\Models\Education $education
58 * @return \Illuminate\Http\Response 59 * @return \Illuminate\Http\Response
59 */ 60 */
60 public function show(Education $education) 61 public function show(Education $education)
61 { 62 {
62 // 63 //
63 } 64 }
64 65
65 /** 66 /**
66 * Show the form for editing the specified resource. 67 * Show the form for editing the specified resource.
67 * 68 *
68 * @param \App\Models\Education $education 69 * @param \App\Models\Education $education
69 * @return \Illuminate\Http\Response 70 * @return \Illuminate\Http\Response
70 */ 71 */
71 public function edit(Education $education) 72 public function edit(Education $education)
72 { 73 {
73 $program = ProgramEducation::query()->where('education_id', '=', $education->id) 74 $program = ProgramEducation::query()->where('education_id', '=', $education->id)
74 ->orderBy('level')->get(); 75 ->orderBy('level')->get();
75 return view('admin.education.edit', compact('education', 'program')); 76 return view('admin.education.edit', compact('education', 'program'));
76 } 77 }
77 78
78 /** 79 /**
79 * Update the specified resource in storage. 80 * Update the specified resource in storage.
80 * 81 *
81 * @param \Illuminate\Http\Request $request 82 * @param \Illuminate\Http\Request $request
82 * @param \App\Models\Education $education 83 * @param \App\Models\Education $education
83 * @return \Illuminate\Http\Response 84 * @return \Illuminate\Http\Response
84 */ 85 */
85 public function update(EducationRequest $request, Education $education) 86 public function update(EducationRequest $request, Education $education)
86 { 87 {
87 $params = $request->all(); 88 $params = $request->all();
88 if ($request->has('image')) { 89 if ($request->has('image')) {
89 if (!empty($education->image)) { 90 if (!empty($education->image)) {
90 Storage::delete($education->image); 91 Storage::delete($education->image);
91 } 92 }
92 $params['image'] = $request->file('image')->store("education", 'public'); 93 $params['image'] = $request->file('image')->store("education", 'public');
93 } 94 }
94 95
95 $education->update($params); 96 $education->update($params);
96 return redirect()->route('admin.education.index'); 97 return redirect()->route('admin.education.index');
97 } 98 }
98 99
99 /** 100 /**
100 * Remove the specified resource from storage. 101 * Remove the specified resource from storage.
101 * 102 *
102 * @param \App\Models\Education $education 103 * @param \App\Models\Education $education
103 * @return \Illuminate\Http\Response 104 * @return \Illuminate\Http\Response
104 */ 105 */
105 public function destroy(Education $education) 106 public function destroy(Education $education)
106 { 107 {
107 $education->update(['is_remove' => 1]); 108 $education->update(['is_remove' => 1]);
108 return redirect()->route('admin.education.index'); 109 return redirect()->route('admin.education.index');
109 } 110 }
110 111
112 public function rename_program(Request $request) {
113 if ($request->ajax()) {
114 $oldnamelevel = $request->oldname;
115 $newnamelevel = $request->newname;
116 $id_education = $request->id_education;
117
118 $result = DB::table('program_education')
119 ->where('education_id', '=', $id_education)
120 ->where('level', '=', $oldnamelevel)
121 ->update(['level' => $newnamelevel]);
122
123 return $result;
124 } else return "";
125
126 }
127
111 public function add_program(Request $request) { 128 public function add_program(Request $request) {
112 $id_education = $request->id; 129 $id_education = $request->id;
113 $level = $request->level; 130 $level = $request->level;
114 return view('admin.education.program', compact('id_education', 'level')); 131 return view('admin.education.program', compact('id_education', 'level'));
115 } 132 }
116 133
117 public function store_program(ProgramEducationRequest $request) { 134 public function store_program(ProgramEducationRequest $request) {
118 $education = $request->education_id; 135 $education = $request->education_id;
119 ProgramEducation::create($request->all()); 136 ProgramEducation::create($request->all());
120 137
121 return redirect()->route('admin.education.edit', ['education' => $education]); 138 return redirect()->route('admin.education.edit', ['education' => $education]);
122 } 139 }
123 140
124 public function edit_program(ProgramEducation $program, Education $education) { 141 public function edit_program(ProgramEducation $program, Education $education) {
125 $id_education = $education->id; 142 $id_education = $education->id;
126 return view('admin.education.program-edit', compact('id_education', 'education', 'program')); 143 return view('admin.education.program-edit', compact('id_education', 'education', 'program'));
127 } 144 }
128 145
129 public function update_program(ProgramEducationRequest $request, ProgramEducation $program, Education $education) { 146 public function update_program(ProgramEducationRequest $request, ProgramEducation $program, Education $education) {
130 $program->update($request->all()); 147 $program->update($request->all());
131 return redirect()->route('admin.education.edit', ['education' => $education]); 148 return redirect()->route('admin.education.edit', ['education' => $education]);
132 } 149 }
133 150
134 public function delete_program(ProgramEducation $program, Education $education) { 151 public function delete_program(ProgramEducation $program, Education $education) {
135 $education = $education->id; 152 $education = $education->id;
136 $program->delete(); 153 $program->delete();
137 154
138 return redirect()->route('admin.education.edit', ['education' => $education]); 155 return redirect()->route('admin.education.edit', ['education' => $education]);
139 } 156 }
140 } 157 }
141 158
resources/views/admin/education/form.blade.php
1 @csrf 1 @csrf
2 2
3 @isset($education) 3 @isset($education)
4 @method('PUT') 4 @method('PUT')
5 @endisset 5 @endisset
6 6
7 <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> 7 <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800">
8 <form method="POST" action="{{ route('admin.education.update', ['education' => $education->id]) }}" enctype="multipart/form-data"> 8 <form method="POST" action="{{ route('admin.education.update', ['education' => $education->id]) }}" enctype="multipart/form-data">
9 <label class="block text-sm"> 9 <label class="block text-sm">
10 <span class="text-gray-700 dark:text-gray-400">Название учебного заведения</span> 10 <span class="text-gray-700 dark:text-gray-400">Название учебного заведения</span>
11 <input name="name" id="name" 11 <input name="name" id="name"
12 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 12 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
13 placeholder="Название учебного заведения" value="{{ old('name') ?? $education->name ?? '' }}" 13 placeholder="Название учебного заведения" value="{{ old('name') ?? $education->name ?? '' }}"
14 /> 14 />
15 @error('name') 15 @error('name')
16 <span class="text-xs text-red-600 dark:text-red-400"> 16 <span class="text-xs text-red-600 dark:text-red-400">
17 {{ $message }} 17 {{ $message }}
18 </span> 18 </span>
19 @enderror 19 @enderror
20 </label><br> 20 </label><br>
21 21
22 <label class="block text-sm"> 22 <label class="block text-sm">
23 <span class="text-gray-700 dark:text-gray-400">Текст</span> 23 <span class="text-gray-700 dark:text-gray-400">Текст</span>
24 <textarea class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-textarea focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray ckeditor_" name="text" placeholder="Текст (html)" required 24 <textarea class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-textarea focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray ckeditor_" name="text" placeholder="Текст (html)" required
25 rows="10">{{ old('text') ?? $education->text ?? '' }}</textarea> 25 rows="10">{{ old('text') ?? $education->text ?? '' }}</textarea>
26 @error('text') 26 @error('text')
27 <span class="text-xs text-red-600 dark:text-red-400"> 27 <span class="text-xs text-red-600 dark:text-red-400">
28 {{ $message }} 28 {{ $message }}
29 </span> 29 </span>
30 @enderror 30 @enderror
31 </label><br> 31 </label><br>
32 32
33 <label class="block text-sm"> 33 <label class="block text-sm">
34 <span class="text-gray-700 dark:text-gray-400">Картинка</span> 34 <span class="text-gray-700 dark:text-gray-400">Картинка</span>
35 <input type="file" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 35 <input type="file" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700
36 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple 36 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple
37 dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 37 dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
38 id="image" name="image" accept="image/png, image/jpeg"> 38 id="image" name="image" accept="image/png, image/jpeg">
39 @error('image') 39 @error('image')
40 <span class="text-xs text-red-600 dark:text-red-400"> 40 <span class="text-xs text-red-600 dark:text-red-400">
41 {{ $message }} 41 {{ $message }}
42 </span> 42 </span>
43 @enderror 43 @enderror
44 @isset($education->image) 44 @isset($education->image)
45 <img src="{{asset(Storage::url($education->image))}}" width="100px"/> 45 <img src="{{asset(Storage::url($education->image))}}" width="100px"/>
46 @endisset 46 @endisset
47 </label><br> 47 </label><br>
48 48
49 <hr> 49 <hr>
50 <h5 class="text-gray-700 dark:text-gray-400">Контакты: </h5> 50 <h5 class="text-gray-700 dark:text-gray-400">Контакты: </h5>
51 <label class="block text-sm"> 51 <label class="block text-sm">
52 <span class="text-gray-700 dark:text-gray-400">Адрес</span> 52 <span class="text-gray-700 dark:text-gray-400">Адрес</span>
53 <input name="address" id="address" 53 <input name="address" id="address"
54 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 54 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
55 placeholder="Адрес" value="{{ old('address') ?? $education->address ?? '' }}" 55 placeholder="Адрес" value="{{ old('address') ?? $education->address ?? '' }}"
56 /> 56 />
57 @error('address') 57 @error('address')
58 <span class="text-xs text-red-600 dark:text-red-400"> 58 <span class="text-xs text-red-600 dark:text-red-400">
59 {{ $message }} 59 {{ $message }}
60 </span> 60 </span>
61 @enderror 61 @enderror
62 </label><br> 62 </label><br>
63 63
64 <label class="block text-sm"> 64 <label class="block text-sm">
65 <span class="text-gray-700 dark:text-gray-400">Email</span> 65 <span class="text-gray-700 dark:text-gray-400">Email</span>
66 <input name="email" id="email" 66 <input name="email" id="email"
67 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 67 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
68 placeholder="Email" value="{{ old('email') ?? $education->email ?? '' }}" 68 placeholder="Email" value="{{ old('email') ?? $education->email ?? '' }}"
69 /> 69 />
70 @error('email') 70 @error('email')
71 <span class="text-xs text-red-600 dark:text-red-400"> 71 <span class="text-xs text-red-600 dark:text-red-400">
72 {{ $message }} 72 {{ $message }}
73 </span> 73 </span>
74 @enderror 74 @enderror
75 </label><br> 75 </label><br>
76 76
77 <label class="block text-sm"> 77 <label class="block text-sm">
78 <span class="text-gray-700 dark:text-gray-400">Телефон</span> 78 <span class="text-gray-700 dark:text-gray-400">Телефон</span>
79 <input name="telephone" id="telephone" 79 <input name="telephone" id="telephone"
80 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 80 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
81 placeholder="Телефон" value="{{ old('telephone') ?? $education->telephone ?? '' }}" 81 placeholder="Телефон" value="{{ old('telephone') ?? $education->telephone ?? '' }}"
82 /> 82 />
83 @error('telephone') 83 @error('telephone')
84 <span class="text-xs text-red-600 dark:text-red-400"> 84 <span class="text-xs text-red-600 dark:text-red-400">
85 {{ $message }} 85 {{ $message }}
86 </span> 86 </span>
87 @enderror 87 @enderror
88 </label><br> 88 </label><br>
89 89
90 <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> 90 <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4">
91 <div> 91 <div>
92 <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"> 92 <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
93 Сохранить 93 Сохранить
94 </button> 94 </button>
95 <a href="{{ route('admin.education.index') }}" 95 <a href="{{ route('admin.education.index') }}"
96 class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" 96 class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"
97 style="display: -webkit-inline-box; height: 30px!important;" 97 style="display: -webkit-inline-box; height: 30px!important;"
98 >Назад</a> 98 >Назад</a>
99 </div> 99 </div>
100 </div> 100 </div>
101 </form> 101 </form>
102 102
103 @isset($education) 103 @isset($education)
104 <div class="tabs_ js_tabs px-4 py-3 bg-white rounded-lg shadow-md dark:bg-gray-800"> 104 <div class="tabs_ js_tabs px-4 py-3 bg-white rounded-lg shadow-md dark:bg-gray-800">
105 <h2 class="my-6 text-2xl font-semibold text-gray-700 dark:text-gray-200"> 105 <h2 class="my-6 text-2xl font-semibold text-gray-700 dark:text-gray-200">
106 Программы образования 106 Программы образования
107 </h2> 107 </h2>
108 <form class="tabs__form js_tabs_form" method="GET" action="{{ route('admin.add-program-education') }}"> 108 <form class="tabs__form js_tabs_form" method="GET" action="{{ route('admin.add-program-education') }}">
109 <label class="tabs__label block mt-4 text-sm"> 109 <label class="tabs__label block mt-4 text-sm">
110 <div class="relative text-gray-500 focus-within:text-purple-600"> 110 <div class="relative text-gray-500 focus-within:text-purple-600">
111 <input type="hidden" name="id" value="{{ $education->id }}"/> 111 <input type="hidden" name="id" value="{{ $education->id }}"/>
112 <input name="level" class="tabs__input js_tabs_input block w-full pr-20 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input" placeholder="Введите название таба"/> 112 <input name="level" class="tabs__input js_tabs_input block w-full pr-20 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input" placeholder="Введите название таба"/>
113 <!-- For disabled buttons ADD these classes: opacity-50 cursor-not-allowed 113 <!-- For disabled buttons ADD these classes: opacity-50 cursor-not-allowed
114 And REMOVE these classes: active:bg-purple-600 hover:bg-purple-700 focus:shadow-outline-purple --> 114 And REMOVE these classes: active:bg-purple-600 hover:bg-purple-700 focus:shadow-outline-purple -->
115 <button class="tabs__submit-btn js_tabs_submit_btn absolute inset-y-0 right-0 px-4 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-r-md focus:outline-none opacity-50 cursor-not-allowed" disabled>+</button> 115 <button class="tabs__submit-btn js_tabs_submit_btn absolute inset-y-0 right-0 px-4 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-r-md focus:outline-none opacity-50 cursor-not-allowed" disabled>+</button>
116 <!-- <button class="tabs__submit-btn js_tabs_submit_btn absolute inset-y-0 right-0 px-4 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-r-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">+</button> --> 116 <!-- <button class="tabs__submit-btn js_tabs_submit_btn absolute inset-y-0 right-0 px-4 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-r-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">+</button> -->
117 </div> 117 </div>
118 </label> 118 </label>
119 </form> 119 </form>
120 <div class="tabs__buttons js_tabs_buttons flex flex-col flex-wrap mb-4 md:flex-row md:space-x-4"> 120 <div class="tabs__buttons js_tabs_buttons flex flex-col flex-wrap mb-4 md:flex-row md:space-x-4">
121 @if ($program->count()) 121 @if ($program->count())
122 @php $bool = true; 122 @php $bool = true;
123 $i = 1; 123 $i = 1;
124 $level = ""; 124 $level = "";
125 @endphp 125 @endphp
126 126
127 @foreach ($program as $pro) 127 @foreach ($program as $pro)
128 @if ((!empty($level)) && ($level <> $pro->level )) 128 @if ((!empty($level)) && ($level <> $pro->level ))
129 @php $bool = true; $i++; @endphp 129 @php $bool = true; $i++; @endphp
130 @endif 130 @endif
131 @if ($bool == true) 131 @if ($bool == true)
132 <div> 132 <div>
133 <button class="tabs__btn js_tabs_btn mt-4 px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" data-btn="{{ $pro->level }}" data-id="{{$i}}">{{ $pro->level }}</button> 133 <button class="tabs__btn js_tabs_btn mt-4 px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" data-btn="{{ $pro->level }}" data-id="{{$i}}">{{ $pro->level }}</button>
134 </div> 134 </div>
135 @php $bool = false; 135 @php $bool = false;
136 $level = $pro->level; 136 $level = $pro->level;
137 @endphp 137 @endphp
138 @endif 138 @endif
139 @endforeach 139 @endforeach
140 @endif 140 @endif
141 </div> 141 </div>
142 <div class="tabs__content js_tabs_content"> 142 <div class="tabs__content js_tabs_content">
143 @if ($program->count()) 143 @if ($program->count())
144 @php $bool = true; 144 @php $bool = true;
145 $i = 1; 145 $i = 1;
146 $level = ""; 146 $level = "";
147 @endphp 147 @endphp
148 148
149 @foreach ($program as $pro) 149 @foreach ($program as $pro)
150 @php $name_tab = $pro->level; @endphp 150 @php $name_tab = $pro->level; @endphp
151 @if ((!empty($level)) && ($level <> $pro->level)) 151 @if ((!empty($level)) && ($level <> $pro->level))
152 </tbody> 152 </tbody>
153 </table> 153 </table>
154 </div> 154 </div>
155 @php $bool = true; $i++; @endphp 155 @php $bool = true; $i++; @endphp
156 @endif 156 @endif
157 157
158 @if ($bool == true) 158 @if ($bool == true)
159 <div class="tabs__item js_tabs_item @php echo($i>1) ? 'hidden' : ''; @endphp" data-id="{{$i}}"> 159 <div class="tabs__item js_tabs_item @php echo($i>1) ? 'hidden' : ''; @endphp" data-id="{{$i}}">
160 <form action="{{ route('admin.add-program-education') }}" method="GET" class="flex flex-col flex-wrap mb-4 md:flex-row md:space-x-4"> 160 <form action="{{ route('admin.add-program-education') }}" method="GET" class="flex flex-col flex-wrap mb-4 md:flex-row md:space-x-4">
161 <div> 161 <div>
162 <input type="hidden" name="id" value="{{ $education->id }}"/> 162 <input type="hidden" name="id" value="{{ $education->id }}"/>
163 <input type="hidden" name="level" value="{{$name_tab}}"/> 163 <input type="hidden" name="level" value="{{$name_tab}}"/>
164 <button type="submit" class="mt-4 px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">Добавить</button> 164 <button type="submit" class="mt-4 px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">Добавить</button>
165 </div> 165 </div>
166 </form> 166 </form>
167 <table class="mb-4 w-full whitespace-no-wrap"> 167 <table class="mb-4 w-full whitespace-no-wrap">
168 <thead> 168 <thead>
169 <tr 169 <tr
170 class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800" 170 class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800"
171 > 171 >
172 <th class="px-4 py-3">Специализация</th> 172 <th class="px-4 py-3">Специализация</th>
173 <th class="px-4 py-3">Описание</th> 173 <th class="px-4 py-3">Описание</th>
174 <th class="px-4 py-3">Редактирование</th> 174 <th class="px-4 py-3">Редактирование</th>
175 175
176 </tr> 176 </tr>
177 </thead> 177 </thead>
178 <tbody 178 <tbody
179 class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800" 179 class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"
180 > 180 >
181 @php $bool = false; 181 @php $bool = false;
182 $level = $pro->level; 182 $level = $pro->level;
183 @endphp 183 @endphp
184 @endif 184 @endif
185 <tr class="text-gray-700 dark:text-gray-400"> 185 <tr class="text-gray-700 dark:text-gray-400">
186 <td class="px-4 py-3"> 186 <td class="px-4 py-3">
187 <div class="flex items-center text-sm"> 187 <div class="flex items-center text-sm">
188 <div> 188 <div>
189 <p class="font-semibold">Специальность: </p> 189 <p class="font-semibold">Специальность: </p>
190 <p class="text-xs text-gray-600 dark:text-gray-400"> 190 <p class="text-xs text-gray-600 dark:text-gray-400">
191 {{ mb_strimwidth($pro->name, 0, 50, "...") }} 191 {{ mb_strimwidth($pro->name, 0, 50, "...") }}
192 </p> 192 </p>
193 </div> 193 </div>
194 </div> 194 </div>
195 </td> 195 </td>
196 <td class="px-4 py-3 text-sm"> 196 <td class="px-4 py-3 text-sm">
197 <span class="text-gray-700 dark:text-gray-400">Описание: {{ mb_strimwidth($pro->text, 0, 100, "...")}}</span> 197 <span class="text-gray-700 dark:text-gray-400">Описание: {{ mb_strimwidth($pro->text, 0, 100, "...")}}</span>
198 </td> 198 </td>
199 <td class="px-4 py-3 text-xs"> 199 <td class="px-4 py-3 text-xs">
200 <a href="{{ route('admin.edit-program-education', ['program' => $pro->id, 'education' => $education->id]) }}">Изменить</a> | 200 <a href="{{ route('admin.edit-program-education', ['program' => $pro->id, 'education' => $education->id]) }}">Изменить</a> |
201 <a href="{{ route('admin.delete-program-education', ['program' => $pro->id, 'education' => $education->id]) }}">Удалить</a> 201 <a href="{{ route('admin.delete-program-education', ['program' => $pro->id, 'education' => $education->id]) }}">Удалить</a>
202 </td> 202 </td>
203 </tr> 203 </tr>
204 @endforeach 204 @endforeach
205 @endif 205 @endif
206 </div> 206 </div>
207 </div> 207 </div>
208 @endisset 208 @endisset
209 </div> 209 </div>
210 210
211 <!--<script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>--> 211 <!--<script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>-->
212 212
213 <script src="{{ asset('./ckeditor/ckeditor.js') }}"></script> 213 <script src="{{ asset('./ckeditor/ckeditor.js') }}"></script>
214 <script> 214 <script>
215 CKEDITOR.replace( 'text', { 215 CKEDITOR.replace( 'text', {
216 filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", 216 filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
217 filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", 217 filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
218 filebrowserUploadMethod: 'form' 218 filebrowserUploadMethod: 'form'
219 }); 219 });
220 </script> 220 </script>
221 <script> 221 <script>
222 window.addEventListener('DOMContentLoaded', () => { 222 window.addEventListener('DOMContentLoaded', () => {
223 223
224 setTabs(3); 224 setTabs(3);
225 225
226 function setTabs(qty) { 226 function setTabs(qty) {
227 227
228 const tabs = document.querySelector('.js_tabs'); 228 const tabs = document.querySelector('.js_tabs');
229 const tabsForm = tabs.querySelector('.js_tabs_form'); 229 const tabsForm = tabs.querySelector('.js_tabs_form');
230 const tabsInput = tabs.querySelector('.js_tabs_input'); 230 const tabsInput = tabs.querySelector('.js_tabs_input');
231 const tabsSubmitBtn = tabs.querySelector('.js_tabs_submit_btn'); 231 const tabsSubmitBtn = tabs.querySelector('.js_tabs_submit_btn');
232 const tabsButtons = tabs.querySelector('.js_tabs_buttons'); 232 const tabsButtons = tabs.querySelector('.js_tabs_buttons');
233 const tabsContent = tabs.querySelector('.js_tabs_content'); 233 const tabsContent = tabs.querySelector('.js_tabs_content');
234 234
235 tabsForm.addEventListener('submit', (e) => { 235 tabsForm.addEventListener('submit', (e) => {
236 236
237 //e.preventDefault(); 237 //e.preventDefault();
238 238
239 const tabsInputValue = tabsInput.value; 239 const tabsInputValue = tabsInput.value;
240 const tabsBtns = tabsButtons.querySelectorAll('.js_tabs_btn'); 240 const tabsBtns = tabsButtons.querySelectorAll('.js_tabs_btn');
241 const id = Date.now(); 241 const id = Date.now();
242 242
243 243
244 if (tabsBtns.length >= qty) { 244 if (tabsBtns.length >= qty) {
245 console.log('Ветка выполнена'); 245 console.log('Ветка выполнена');
246 e.preventDefault(); 246 e.preventDefault();
247 } 247 }
248 248
249 /*if (tabsInput.dataset.edit) { 249 if (tabsInput.dataset.edit) {
250 250
251 tabsBtns.forEach(btn => { 251 tabsBtns.forEach(btn => {
252 if (tabsInput.dataset.edit === btn.dataset.id) { 252 if (tabsInput.dataset.edit === btn.dataset.id) {
253 console.log('oldname: '+btn.textContent+' newname: '+tabsInputValue+' id_education: '+<?=$education->id?>+'');
254 $.ajax({
255 url: '{{ route('admin.rename-program-education') }}',
256 method: 'get', /* Метод запроса (post или get) */
257 dataType: 'html', /* Тип данных в ответе (xml, json, script, html). */
258 data: {oldname: btn.textContent, newname:tabsInputValue, id_education: <?=$education->id?>}, /* Данные передаваемые в массиве */
259 success: function(data){ /* функция которая будет выполнена после успешного запроса. */
260 console.log(data); /* В переменной data содержится ответ от index.php. */
261 }
262 });
263
253 btn.textContent = tabsInputValue; 264 btn.textContent = tabsInputValue;
254 btn.dataset.btn = tabsInputValue; 265 btn.dataset.btn = tabsInputValue;
255 } 266 }
256 }); 267 });
257 console.log('Эта ветка выполнилась'); 268 console.log('Эта ветка выполнилась');
258 tabsInput.removeAttribute('data-edit'); 269 tabsInput.removeAttribute('data-edit');
259 270
260 } else { 271 } else {
261 272
262 if (!tabsBtns.length) { 273 if (!tabsBtns.length) {
263 tabsButtons.innerHTML += getTabsBtnTemplate(tabsInputValue, id); 274 tabsButtons.innerHTML += getTabsBtnTemplate(tabsInputValue, id);
264 tabsContent.innerHTML += getTabsItemTemplate(id); 275 //tabsContent.innerHTML += getTabsItemTemplate(id);
265 } 276 }
266 277
267 if (tabsBtns.length && tabsBtns.length < qty) { 278 if (tabsBtns.length && tabsBtns.length < qty) {
268 279
269 let isMatch = false; 280 let isMatch = false;
270 281
271 tabsBtns.forEach(btn => { 282 tabsBtns.forEach(btn => {
272 if (tabsInputValue === btn.dataset.btn) { 283 if (tabsInputValue === btn.dataset.btn) {
273 isMatch = true; 284 isMatch = true;
274 } 285 }
275 }); 286 });
276 287
277 console.log('Альтернативная ветка!'); 288 console.log('Альтернативная ветка!');
278 if (!isMatch) { 289 if (!isMatch) {
279 tabsButtons.innerHTML += getTabsBtnTemplate(tabsInputValue, id); 290 tabsButtons.innerHTML += getTabsBtnTemplate(tabsInputValue, id);
280 tabsContent.innerHTML += getTabsItemTemplate(id, 'hidden'); 291 tabsContent.innerHTML += getTabsItemTemplate(id, 'hidden');
281 } 292 }
282 } 293 }
283 }*/ 294 }
284 295
285 //tabsInput.value = ''; 296 //tabsInput.value = '';
286 addDisabledBtnStatus(tabsSubmitBtn); 297 addDisabledBtnStatus(tabsSubmitBtn);
287 298
288 }); 299 });
289 300
290 tabsInput.addEventListener('input', () => { 301 tabsInput.addEventListener('input', () => {
291 if (tabsInput.value !== '') { 302 if (tabsInput.value !== '') {
292 removeDisabledBtnStatus(tabsSubmitBtn); 303 removeDisabledBtnStatus(tabsSubmitBtn);
293 } else { 304 } else {
294 addDisabledBtnStatus(tabsSubmitBtn); 305 addDisabledBtnStatus(tabsSubmitBtn);
295 } 306 }
296 }); 307 });
297 308
298 tabsButtons.addEventListener('click', (e) => { 309 tabsButtons.addEventListener('click', (e) => {
299 310
300 const target = e.target.closest('.js_tabs_btn'); 311 const target = e.target.closest('.js_tabs_btn');
301 312
302 if (target) { 313 if (target) {
303 314
304 const tabsItems = tabs.querySelectorAll('.js_tabs_item'); 315 const tabsItems = tabs.querySelectorAll('.js_tabs_item');
305 316
306 tabsItems.forEach(item => { 317 tabsItems.forEach(item => {
307 318
308 item.classList.add('hidden'); 319 item.classList.add('hidden');
309 320
310 if (target.dataset.id === item.dataset.id) { 321 if (target.dataset.id === item.dataset.id) {
311 item.classList.remove('hidden'); 322 item.classList.remove('hidden');
312 } 323 }
313 }); 324 });
314 } 325 }
315 326
316 }); 327 });
317 328
318 tabsButtons.addEventListener('dblclick', (e) => { 329 tabsButtons.addEventListener('dblclick', (e) => {
319 const target = e.target.closest('.js_tabs_btn'); 330 const target = e.target.closest('.js_tabs_btn');
320 331
321 if (target) { 332 if (target) {
322 tabsInput.value = target.dataset.btn; 333 tabsInput.value = target.dataset.btn;
323 tabsInput.dataset.edit = target.dataset.id; 334 tabsInput.dataset.edit = target.dataset.id;
324 removeDisabledBtnStatus(tabsSubmitBtn); 335 removeDisabledBtnStatus(tabsSubmitBtn);
325 } 336 }
326 }); 337 });
327 338
328 function getTabsBtnTemplate(btnName, id) { 339 function getTabsBtnTemplate(btnName, id) {
329 return ` 340 return `
330 <div> 341 <div>
331 <button class="tabs__btn js_tabs_btn mt-4 px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" data-btn="${btnName}" data-id="${id}">${btnName}</button> 342 <button class="tabs__btn js_tabs_btn mt-4 px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" data-btn="${btnName}" data-id="${id}">${btnName}</button>
332 </div> 343 </div>
333 `; 344 `;
334 } 345 }
335 346
336 function getTabsItemTemplate(id, className = '') { 347 function getTabsItemTemplate(id, className = '') {
337 return ` 348 return `
338 <div class="tabs__item js_tabs_item ${className}" data-id="${id}"> 349 <div class="tabs__item js_tabs_item ${className}" data-id="${id}">
339 <div class="mb-4">${id}</div> 350 <div class="mb-4">${id}</div>
340 <table class="mb-4 w-full whitespace-no-wrap"> 351 <table class="mb-4 w-full whitespace-no-wrap">
341 <thead> 352 <thead>
342 <tr 353 <tr
343 class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800" 354 class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800"
344 > 355 >
345 <th class="px-4 py-3">Client</th> 356 <th class="px-4 py-3">Client</th>
346 <th class="px-4 py-3">Amount</th> 357 <th class="px-4 py-3">Amount</th>
347 <th class="px-4 py-3">Status</th> 358 <th class="px-4 py-3">Status</th>
348 <th class="px-4 py-3">Date</th> 359 <th class="px-4 py-3">Date</th>
349 </tr> 360 </tr>
350 </thead> 361 </thead>
351 <tbody 362 <tbody
352 class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800" 363 class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"
353 > 364 >
354 <tr class="text-gray-700 dark:text-gray-400"> 365 <tr class="text-gray-700 dark:text-gray-400">
355 <td class="px-4 py-3"> 366 <td class="px-4 py-3">
356 <div class="flex items-center text-sm"> 367 <div class="flex items-center text-sm">
357 <!-- Avatar with inset shadow --> 368 <!-- Avatar with inset shadow -->
358 <div 369 <div
359 class="relative hidden w-8 h-8 mr-3 rounded-full md:block" 370 class="relative hidden w-8 h-8 mr-3 rounded-full md:block"
360 > 371 >
361 <img 372 <img
362 class="object-cover w-full h-full rounded-full" 373 class="object-cover w-full h-full rounded-full"
363 src="https://images.unsplash.com/flagged/photo-1570612861542-284f4c12e75f?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=200&fit=max&ixid=eyJhcHBfaWQiOjE3Nzg0fQ" 374 src="https://images.unsplash.com/flagged/photo-1570612861542-284f4c12e75f?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=200&fit=max&ixid=eyJhcHBfaWQiOjE3Nzg0fQ"
364 alt="" 375 alt=""
365 loading="lazy" 376 loading="lazy"
366 /> 377 />
367 <div 378 <div
368 class="absolute inset-0 rounded-full shadow-inner" 379 class="absolute inset-0 rounded-full shadow-inner"
369 aria-hidden="true" 380 aria-hidden="true"
370 ></div> 381 ></div>
371 </div> 382 </div>
372 <div> 383 <div>
373 <p class="font-semibold">Hans Burger</p> 384 <p class="font-semibold">Hans Burger</p>
374 <p class="text-xs text-gray-600 dark:text-gray-400"> 385 <p class="text-xs text-gray-600 dark:text-gray-400">
375 10x Developer 386 10x Developer
376 </p> 387 </p>
377 </div> 388 </div>
378 </div> 389 </div>
379 </td> 390 </td>
380 <td class="px-4 py-3 text-sm"> 391 <td class="px-4 py-3 text-sm">
381 $ 863.45 392 $ 863.45
382 </td> 393 </td>
383 <td class="px-4 py-3 text-xs"> 394 <td class="px-4 py-3 text-xs">
384 <span 395 <span
385 class="px-2 py-1 font-semibold leading-tight text-green-700 bg-green-100 rounded-full dark:bg-green-700 dark:text-green-100" 396 class="px-2 py-1 font-semibold leading-tight text-green-700 bg-green-100 rounded-full dark:bg-green-700 dark:text-green-100"
386 > 397 >
387 Approved 398 Approved
388 </span> 399 </span>
389 </td> 400 </td>
390 <td class="px-4 py-3 text-sm"> 401 <td class="px-4 py-3 text-sm">
391 6/10/2020 402 6/10/2020
392 </td> 403 </td>
393 </tr> 404 </tr>
394 405
395 <tr class="text-gray-700 dark:text-gray-400"> 406 <tr class="text-gray-700 dark:text-gray-400">
396 <td class="px-4 py-3"> 407 <td class="px-4 py-3">
397 <div class="flex items-center text-sm"> 408 <div class="flex items-center text-sm">
398 <!-- Avatar with inset shadow --> 409 <!-- Avatar with inset shadow -->
399 <div 410 <div
400 class="relative hidden w-8 h-8 mr-3 rounded-full md:block" 411 class="relative hidden w-8 h-8 mr-3 rounded-full md:block"
401 > 412 >
402 <img 413 <img
403 class="object-cover w-full h-full rounded-full" 414 class="object-cover w-full h-full rounded-full"
404 src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=200&facepad=3&fit=facearea&s=707b9c33066bf8808c934c8ab394dff6" 415 src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=200&facepad=3&fit=facearea&s=707b9c33066bf8808c934c8ab394dff6"
405 alt="" 416 alt=""
406 loading="lazy" 417 loading="lazy"
407 /> 418 />
408 <div 419 <div
409 class="absolute inset-0 rounded-full shadow-inner" 420 class="absolute inset-0 rounded-full shadow-inner"
410 aria-hidden="true" 421 aria-hidden="true"
411 ></div> 422 ></div>
412 </div> 423 </div>
413 <div> 424 <div>
414 <p class="font-semibold">Jolina Angelie</p> 425 <p class="font-semibold">Jolina Angelie</p>
415 <p class="text-xs text-gray-600 dark:text-gray-400"> 426 <p class="text-xs text-gray-600 dark:text-gray-400">
416 Unemployed 427 Unemployed
417 </p> 428 </p>
418 </div> 429 </div>
419 </div> 430 </div>
420 </td> 431 </td>
421 <td class="px-4 py-3 text-sm"> 432 <td class="px-4 py-3 text-sm">
422 $ 369.95 433 $ 369.95
423 </td> 434 </td>
424 <td class="px-4 py-3 text-xs"> 435 <td class="px-4 py-3 text-xs">
425 <span 436 <span
426 class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:text-white dark:bg-orange-600" 437 class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:text-white dark:bg-orange-600"
427 > 438 >
428 Pending 439 Pending
429 </span> 440 </span>
430 </td> 441 </td>
431 <td class="px-4 py-3 text-sm"> 442 <td class="px-4 py-3 text-sm">
432 6/10/2020 443 6/10/2020
433 </td> 444 </td>
434 </tr> 445 </tr>
435 </tbody> 446 </tbody>
436 </table> 447 </table>
437 448
438 <div class="flex flex-col flex-wrap mb-4 md:flex-row md:space-x-4"> 449 <div class="flex flex-col flex-wrap mb-4 md:flex-row md:space-x-4">
439 <div> 450 <div>
440 <a href="#" class="mt-4 px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">Редактировать</a> 451 <a href="#" class="mt-4 px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">Редактировать</a>
441 </div> 452 </div>
442 <div> 453 <div>
443 <a href="#" class="mt-4 px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">Удалить</a> 454 <a href="#" class="mt-4 px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">Удалить</a>
444 </div> 455 </div>
445 </div> 456 </div>
446 </div> 457 </div>
447 `; 458 `;
448 } 459 }
449 460
450 function addDisabledBtnStatus(btn) { 461 function addDisabledBtnStatus(btn) {
451 btn.disabled = true; 462 btn.disabled = true;
452 btn.classList.add('opacity-50', 'cursor-not-allowed'); 463 btn.classList.add('opacity-50', 'cursor-not-allowed');
453 btn.classList.remove('active:bg-purple-600', 'hover:bg-purple-700', 'focus:shadow-outline-purple'); 464 btn.classList.remove('active:bg-purple-600', 'hover:bg-purple-700', 'focus:shadow-outline-purple');
454 } 465 }
455 466
456 function removeDisabledBtnStatus(btn) { 467 function removeDisabledBtnStatus(btn) {
457 btn.disabled = false; 468 btn.disabled = false;
458 btn.classList.remove('opacity-50', 'cursor-not-allowed'); 469 btn.classList.remove('opacity-50', 'cursor-not-allowed');
459 btn.classList.add('active:bg-purple-600', 'hover:bg-purple-700', 'focus:shadow-outline-purple'); 470 btn.classList.add('active:bg-purple-600', 'hover:bg-purple-700', 'focus:shadow-outline-purple');
460 } 471 }
461 472
462 } 473 }
463 console.log('main.js init'); 474 console.log('main.js init');
464 475
465 }); 476 });
466 477
467 </script> 478 </script>
468 479
469 480
1 <?php 1 <?php
2 2
3 use App\Http\Controllers\AdEmployerController; 3 use App\Http\Controllers\AdEmployerController;
4 use App\Http\Controllers\Admin\AdminController; 4 use App\Http\Controllers\Admin\AdminController;
5 use App\Http\Controllers\Admin\CategoryController; 5 use App\Http\Controllers\Admin\CategoryController;
6 use App\Http\Controllers\Admin\CategoryEmpController; 6 use App\Http\Controllers\Admin\CategoryEmpController;
7 use App\Http\Controllers\Admin\EducationController; 7 use App\Http\Controllers\Admin\EducationController;
8 use App\Http\Controllers\Admin\EmployersController; 8 use App\Http\Controllers\Admin\EmployersController;
9 use App\Http\Controllers\Admin\InfoBloksController; 9 use App\Http\Controllers\Admin\InfoBloksController;
10 use App\Http\Controllers\Admin\JobTitlesController; 10 use App\Http\Controllers\Admin\JobTitlesController;
11 use App\Http\Controllers\Admin\UsersController; 11 use App\Http\Controllers\Admin\UsersController;
12 use App\Http\Controllers\Admin\WorkersController; 12 use App\Http\Controllers\Admin\WorkersController;
13 use App\Http\Controllers\Auth\ForgotPasswordController; 13 use App\Http\Controllers\Auth\ForgotPasswordController;
14 use App\Http\Controllers\Auth\LoginController; 14 use App\Http\Controllers\Auth\LoginController;
15 use App\Http\Controllers\Auth\RegisterController; 15 use App\Http\Controllers\Auth\RegisterController;
16 use App\Http\Controllers\CKEditorController; 16 use App\Http\Controllers\CKEditorController;
17 use App\Http\Controllers\MediaController; 17 use App\Http\Controllers\MediaController;
18 use App\Http\Controllers\WorkerController; 18 use App\Http\Controllers\WorkerController;
19 use App\Models\User; 19 use App\Models\User;
20 use App\Http\Controllers\MainController; 20 use App\Http\Controllers\MainController;
21 use App\Http\Controllers\HomeController; 21 use App\Http\Controllers\HomeController;
22 use Illuminate\Support\Facades\Route; 22 use Illuminate\Support\Facades\Route;
23 use App\Http\Controllers\Admin\CompanyController; 23 use App\Http\Controllers\Admin\CompanyController;
24 use App\Http\Controllers\Admin\Ad_EmployersController; 24 use App\Http\Controllers\Admin\Ad_EmployersController;
25 use App\Http\Controllers\Admin\MsgAnswersController; 25 use App\Http\Controllers\Admin\MsgAnswersController;
26 use App\Http\Controllers\Admin\GroupsController; 26 use App\Http\Controllers\Admin\GroupsController;
27 use App\Http\Controllers\PagesController; 27 use App\Http\Controllers\PagesController;
28 use Illuminate\Support\Facades\Storage; 28 use Illuminate\Support\Facades\Storage;
29 29
30 30
31 /* 31 /*
32 |-------------------------------------------------------------------------- 32 |--------------------------------------------------------------------------
33 | Web Routes 33 | Web Routes
34 |-------------------------------------------------------------------------- 34 |--------------------------------------------------------------------------
35 | 35 |
36 | Here is where you can register web routes for your application. These 36 | Here is where you can register web routes for your application. These
37 | routes are loaded by the RouteServiceProvider within a group which 37 | routes are loaded by the RouteServiceProvider within a group which
38 | contains the "web" middleware group. Now create something great! 38 | contains the "web" middleware group. Now create something great!
39 | 39 |
40 */ 40 */
41 /* 41 /*
42 Route::get('/', function () { 42 Route::get('/', function () {
43 return view('welcome'); 43 return view('welcome');
44 })->name('index'); 44 })->name('index');
45 */ 45 */
46 Route::get('/', [MainController::class, 'index'])->name('index'); 46 Route::get('/', [MainController::class, 'index'])->name('index');
47 47
48 //Роуты авторизации, регистрации, восстановления, аутентификации 48 //Роуты авторизации, регистрации, восстановления, аутентификации
49 Auth::routes(['verify' => true]); 49 Auth::routes(['verify' => true]);
50 50
51 // роуты регистрации, авторизации, восстановления пароля, верификации почты 51 // роуты регистрации, авторизации, восстановления пароля, верификации почты
52 /*Route::group([ 52 /*Route::group([
53 'as' => 'auth.', //имя маршрута, например auth.index 53 'as' => 'auth.', //имя маршрута, например auth.index
54 'prefix' => 'auth', // префикс маршрута, например, auth/index 54 'prefix' => 'auth', // префикс маршрута, например, auth/index
55 ], function () { 55 ], function () {
56 //форма регистрации 56 //форма регистрации
57 Route::get('register', [RegisterController::class, 'register'])->name('register'); 57 Route::get('register', [RegisterController::class, 'register'])->name('register');
58 58
59 //создание пользователя 59 //создание пользователя
60 Route::post('register', [RegisterController::class, 'create'])->name('create'); 60 Route::post('register', [RegisterController::class, 'create'])->name('create');
61 61
62 //форма входа авторизации 62 //форма входа авторизации
63 Route::get('login', [LoginController::class, 'login'])->name('login'); 63 Route::get('login', [LoginController::class, 'login'])->name('login');
64 64
65 //аутентификация 65 //аутентификация
66 Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); 66 Route::post('login', [LoginController::class, 'authenticate'])->name('auth');
67 67
68 //выход 68 //выход
69 Route::get('logout', [LoginController::class, 'logout'])->name('logout'); 69 Route::get('logout', [LoginController::class, 'logout'])->name('logout');
70 70
71 //форма ввода адреса почты 71 //форма ввода адреса почты
72 Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); 72 Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form');
73 73
74 //письмо на почту 74 //письмо на почту
75 Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); 75 Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail');
76 76
77 //форма восстановления пароля 77 //форма восстановления пароля
78 Route::get('reset-password/token/{token}/email/{email}', 78 Route::get('reset-password/token/{token}/email/{email}',
79 [ResetPasswordController::class, 'form'] 79 [ResetPasswordController::class, 'form']
80 )->name('reset-form'); 80 )->name('reset-form');
81 81
82 //восстановление пароля 82 //восстановление пароля
83 Route::post('reset-password', 83 Route::post('reset-password',
84 [ResetPasswordController::class, 'reset'] 84 [ResetPasswordController::class, 'reset']
85 )->name('reset-password'); 85 )->name('reset-password');
86 86
87 //сообщение о необходимости проверки адреса почты 87 //сообщение о необходимости проверки адреса почты
88 Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); 88 Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message');
89 89
90 //подтверждение адреса почты нового пользователя 90 //подтверждение адреса почты нового пользователя
91 Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) 91 Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify'])
92 ->where('token', '[a-f0-9]{32}') 92 ->where('token', '[a-f0-9]{32}')
93 ->where('id', '[0-9]+') 93 ->where('id', '[0-9]+')
94 ->name('verify-email'); 94 ->name('verify-email');
95 });*/ 95 });*/
96 96
97 //Личный кабинет пользователя 97 //Личный кабинет пользователя
98 Route::get('/home', [HomeController::class, 'index'])->name('home'); 98 Route::get('/home', [HomeController::class, 'index'])->name('home');
99 99
100 /* 100 /*
101 Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { 101 Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) {
102 $user = User::where('email',$request->input('email'))->first(); 102 $user = User::where('email',$request->input('email'))->first();
103 103
104 $user->sendEmailVerificationNotification(); 104 $user->sendEmailVerificationNotification();
105 105
106 return 'your response'; 106 return 'your response';
107 })->middleware('throttle:6,1')->name('verification.resend'); 107 })->middleware('throttle:6,1')->name('verification.resend');
108 */ 108 */
109 109
110 // Авторизация, регистрация в админку 110 // Авторизация, регистрация в админку
111 Route::group([ 111 Route::group([
112 'as' => 'admin.', // имя маршрута, например auth.index 112 'as' => 'admin.', // имя маршрута, например auth.index
113 'prefix' => 'admin', // префикс маршрута, например auth/index 113 'prefix' => 'admin', // префикс маршрута, например auth/index
114 'middleware' => ['guest'], 114 'middleware' => ['guest'],
115 ], function () { 115 ], function () {
116 // Форма регистрации 116 // Форма регистрации
117 Route::get('register', [AdminController::class, 'register'])->name('register'); 117 Route::get('register', [AdminController::class, 'register'])->name('register');
118 // Создание пользователя 118 // Создание пользователя
119 Route::post('register', [AdminController::class, 'create'])->name('create'); 119 Route::post('register', [AdminController::class, 'create'])->name('create');
120 120
121 //Форма входа 121 //Форма входа
122 Route::get('login', [AdminController::class, 'login'])->name('login'); 122 Route::get('login', [AdminController::class, 'login'])->name('login');
123 123
124 // аутентификация 124 // аутентификация
125 Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); 125 Route::post('login', [AdminController::class, 'autenticate'])->name('auth');
126 126
127 }); 127 });
128 128
129 // Личный кабинет админки 129 // Личный кабинет админки
130 Route::group([ 130 Route::group([
131 'as' => 'admin.', // имя маршрута, например auth.index 131 'as' => 'admin.', // имя маршрута, например auth.index
132 'prefix' => 'admin', // префикс маршрута, например auth/index 132 'prefix' => 'admin', // префикс маршрута, например auth/index
133 'middleware' => ['auth'], ['admin'], 133 'middleware' => ['auth'], ['admin'],
134 ], function() { 134 ], function() {
135 135
136 // выход 136 // выход
137 Route::get('logout', [AdminController::class, 'logout'])->name('logout'); 137 Route::get('logout', [AdminController::class, 'logout'])->name('logout');
138 138
139 // кабинет главная страница 139 // кабинет главная страница
140 Route::get('cabinet', [AdminController::class, 'index'])->name('index'); 140 Route::get('cabinet', [AdminController::class, 'index'])->name('index');
141 141
142 // кабинет профиль админа - форма 142 // кабинет профиль админа - форма
143 Route::get('profile', [AdminController::class, 'profile'])->name('profile'); 143 Route::get('profile', [AdminController::class, 'profile'])->name('profile');
144 // кабинет профиль админа - сохранение формы 144 // кабинет профиль админа - сохранение формы
145 Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); 145 Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile');
146 146
147 //кабинет сообщения админа 147 //кабинет сообщения админа
148 //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); 148 //Route::get('messages', [AdminController::class, 'profile'])->name('profile');
149 149
150 150
151 // кабинет профиль - форма пароли 151 // кабинет профиль - форма пароли
152 Route::get('password', [AdminController::class, 'profile_password'])->name('password'); 152 Route::get('password', [AdminController::class, 'profile_password'])->name('password');
153 // кабинет профиль - сохранение формы пароля 153 // кабинет профиль - сохранение формы пароля
154 Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); 154 Route::post('password', [AdminController::class, 'profile_password_new'])->name('password');
155 155
156 156
157 // кабинет профиль пользователя - форма 157 // кабинет профиль пользователя - форма
158 Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); 158 Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile');
159 // кабинет профиль пользователя - сохранение формы 159 // кабинет профиль пользователя - сохранение формы
160 Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); 160 Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile');
161 161
162 // кабинет профиль работодатель - форма 162 // кабинет профиль работодатель - форма
163 Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); 163 Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile');
164 // кабинет профиль работодатель - сохранение формы 164 // кабинет профиль работодатель - сохранение формы
165 Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); 165 Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile');
166 // кабинет удаление профиль работодателя и юзера 166 // кабинет удаление профиль работодателя и юзера
167 Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); 167 Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer');
168 168
169 // кабинет профиль работник - форма 169 // кабинет профиль работник - форма
170 Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); 170 Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add');
171 Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); 171 Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store');
172 Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); 172 Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit');
173 // кабинет профиль работник - сохранение формы 173 // кабинет профиль работник - сохранение формы
174 Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); 174 Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update');
175 175
176 // Медиа 176 // Медиа
177 Route::get('media', [MediaController::class, 'index'])->name('media'); 177 Route::get('media', [MediaController::class, 'index'])->name('media');
178 Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media'); 178 Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media');
179 179
180 // кабинет настройки сайта - форма 180 // кабинет настройки сайта - форма
181 Route::get('config', [AdminController::class, 'config_form'])->name('config'); 181 Route::get('config', [AdminController::class, 'config_form'])->name('config');
182 // кабинет настройки сайта сохранение формы 182 // кабинет настройки сайта сохранение формы
183 Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); 183 Route::post('config', [AdminController::class, 'store_config'])->name('store_config');
184 184
185 // кабинет - пользователи 185 // кабинет - пользователи
186 Route::get('users', [UsersController::class, 'index'])->name('users'); 186 Route::get('users', [UsersController::class, 'index'])->name('users');
187 187
188 // кабинет - пользователи 188 // кабинет - пользователи
189 Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); 189 Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users');
190 190
191 // кабинет - работодатели 191 // кабинет - работодатели
192 Route::get('employers', [EmployersController::class, 'index'])->name('employers'); 192 Route::get('employers', [EmployersController::class, 'index'])->name('employers');
193 193
194 Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); 194 Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer');
195 195
196 // кабинет - соискатели 196 // кабинет - соискатели
197 Route::get('workers', [WorkersController::class, 'index'])->name('workers'); 197 Route::get('workers', [WorkersController::class, 'index'])->name('workers');
198 198
199 // кабинет - база данных 199 // кабинет - база данных
200 Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); 200 Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata');
201 Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); 201 Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata');
202 Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); 202 Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata');
203 Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); 203 Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata');
204 Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); 204 Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata');
205 Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); 205 Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata');
206 Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); 206 Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata');
207 207
208 // кабинет - вакансии 208 // кабинет - вакансии
209 Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); 209 Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers');
210 Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers'); 210 Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers');
211 Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers'); 211 Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers');
212 Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); 212 Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers');
213 Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); 213 Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers');
214 Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer'); 214 Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer');
215 215
216 // кабинет - категории 216 // кабинет - категории
217 //Route::get('categories', [AdminController::class, 'index'])->name('categories'); 217 //Route::get('categories', [AdminController::class, 'index'])->name('categories');
218 /* 218 /*
219 * CRUD-операции над Справочником Категории 219 * CRUD-операции над Справочником Категории
220 */ 220 */
221 Route::resource('categories', CategoryController::class, ['except' => ['show']]); 221 Route::resource('categories', CategoryController::class, ['except' => ['show']]);
222 222
223 // CRUD-операции над справочником Категории для работодателей 223 // CRUD-операции над справочником Категории для работодателей
224 Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); 224 Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]);
225 225
226 // CRUD-операции над справочником Образование 226 // CRUD-операции над справочником Образование
227 Route::resource('education', EducationController::class, ['except' => ['show']]); 227 Route::resource('education', EducationController::class, ['except' => ['show']]);
228 228
229 Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education');
229 Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); 230 Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education');
230 Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); 231 Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education');
231 232
232 Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); 233 Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education');
233 Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education'); 234 Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education');
234 235
235 Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); 236 Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education');
236 237
237 //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); 238 //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles');
238 /* 239 /*
239 * кабинет - CRUD-операции по справочнику должности 240 * кабинет - CRUD-операции по справочнику должности
240 * 241 *
241 */ 242 */
242 Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); 243 Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]);
243 244
244 // кабинет - сообщения (чтение чужих) 245 // кабинет - сообщения (чтение чужих)
245 Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); 246 Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages');
246 // кабинет - просмотр сообщения чужого (чтение) 247 // кабинет - просмотр сообщения чужого (чтение)
247 Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); 248 Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message');
248 249
249 // кабинет - сообщения (админские) 250 // кабинет - сообщения (админские)
250 Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); 251 Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages');
251 // кабинет - сообщения (админские) 252 // кабинет - сообщения (админские)
252 Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); 253 Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post');
253 // кабинет - sql - конструкция запросов 254 // кабинет - sql - конструкция запросов
254 Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); 255 Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql');
255 256
256 /* 257 /*
257 * Расписанный подход в описании каждой директорий групп пользователей. 258 * Расписанный подход в описании каждой директорий групп пользователей.
258 */ 259 */
259 // кабинет - группы пользователей 260 // кабинет - группы пользователей
260 Route::get('groups', [GroupsController::class, 'index'])->name('groups'); 261 Route::get('groups', [GroupsController::class, 'index'])->name('groups');
261 // кабинет - добавление форма группы пользователей 262 // кабинет - добавление форма группы пользователей
262 Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); 263 Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group');
263 // кабинет - сохранение формы группы пользователей 264 // кабинет - сохранение формы группы пользователей
264 Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); 265 Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store');
265 // кабинет - редактирование форма группы пользователей 266 // кабинет - редактирование форма группы пользователей
266 Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); 267 Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group');
267 // кабинет - сохранение редактированной формы группы пользователей 268 // кабинет - сохранение редактированной формы группы пользователей
268 Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); 269 Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group');
269 // кабинет - удаление группы пользователей 270 // кабинет - удаление группы пользователей
270 Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); 271 Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group');
271 272
272 273
273 // кабинет - список админов 274 // кабинет - список админов
274 Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); 275 Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin');
275 276
276 277
277 /////редактор////// кабинет - редактор сайта//////////////////////// 278 /////редактор////// кабинет - редактор сайта////////////////////////
278 Route::get('editor-site', function() { 279 Route::get('editor-site', function() {
279 return view('admin.editor.index'); 280 return view('admin.editor.index');
280 })->name('editor-site'); 281 })->name('editor-site');
281 282
282 283
283 // кабинет - редактор шапки-футера сайта 284 // кабинет - редактор шапки-футера сайта
284 Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); 285 Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks');
285 Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); 286 Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block');
286 Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); 287 Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store');
287 Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); 288 Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block');
288 Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); 289 Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block');
289 Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); 290 Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block');
290 Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); 291 Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block');
291 292
292 293
293 // кабинет - редактор должности на главной 294 // кабинет - редактор должности на главной
294 Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); 295 Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main');
295 296
296 // кабинет - редактор работодатели на главной 297 // кабинет - редактор работодатели на главной
297 Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); 298 Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main');
298 299
299 300
300 // кабинет - редактор seo-сайта 301 // кабинет - редактор seo-сайта
301 Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); 302 Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo');
302 Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); 303 Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo');
303 Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); 304 Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store');
304 Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); 305 Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo');
305 Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); 306 Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo');
306 Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); 307 Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo');
307 Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); 308 Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo');
308 309
309 310
310 // кабинет - редактор страниц 311 // кабинет - редактор страниц
311 Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); 312 Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages');
312 // кабинет - добавление страницы 313 // кабинет - добавление страницы
313 Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); 314 Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page');
314 // кабинет - сохранение формы страницы 315 // кабинет - сохранение формы страницы
315 Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); 316 Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store');
316 // кабинет - редактирование форма страницы 317 // кабинет - редактирование форма страницы
317 Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); 318 Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page');
318 // кабинет - сохранение редактированной формы страницы 319 // кабинет - сохранение редактированной формы страницы
319 Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); 320 Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page');
320 // кабинет - удаление страницы 321 // кабинет - удаление страницы
321 Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); 322 Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page');
322 323
323 324
324 // кабинет - реклама сайта 325 // кабинет - реклама сайта
325 Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); 326 Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames');
326 Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); 327 Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames');
327 Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); 328 Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store');
328 Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); 329 Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames');
329 Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); 330 Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames');
330 Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); 331 Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames');
331 //////////////////////////////////////////////////////////////////////// 332 ////////////////////////////////////////////////////////////////////////
332 333
333 334
334 // кабинет - отзывы о работодателе для модерации 335 // кабинет - отзывы о работодателе для модерации
335 Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); 336 Route::get('answers', [EmployersController::class, 'answers'])->name('answers');
336 337
337 // Общая страница статистики 338 // Общая страница статистики
338 Route::get('statics', function () { 339 Route::get('statics', function () {
339 return view('admin.static.index'); 340 return view('admin.static.index');
340 })->name('statics'); 341 })->name('statics');
341 342
342 // кабинет - статистика работников 343 // кабинет - статистика работников
343 Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); 344 Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers');
344 345
345 // кабинет - статистика вакансий работодателя 346 // кабинет - статистика вакансий работодателя
346 Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); 347 Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads');
347 348
348 // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника 349 // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника
349 /* 350 /*
350 * CRUD-операции над справочником дипломы и документы 351 * CRUD-операции над справочником дипломы и документы
351 */ 352 */
352 //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); 353 //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks');
353 Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); 354 Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]);
354 355
355 // кабинет - роли пользователя 356 // кабинет - роли пользователя
356 Route::get('roles', [UsersController::class, 'roles'])->name('roles'); 357 Route::get('roles', [UsersController::class, 'roles'])->name('roles');
357 358
358 Route::get('logs', function() { 359 Route::get('logs', function() {
359 $files = Storage::files('logs/laravel.log'); 360 $files = Storage::files('logs/laravel.log');
360 print_r($files); 361 print_r($files);
361 })->name('logs'); 362 })->name('logs');
362 363
363 }); 364 });
364 365
365 // Инструментальные страницы 366 // Инструментальные страницы
366 Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); 367 Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload');
367 368
368 Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); 369 Route::get('redis/', [PagesController::class, 'redis'])->name('redis');
369 370
370 Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); 371 Route::get('excel/', [PagesController::class, 'excel'])->name('excel');
371 372
372 // Страницы с произвольным контентом 373 // Страницы с произвольным контентом
373 Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); 374 Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page');
374 375
375 // Публичные страницы соискателя 376 // Публичные страницы соискателя
376 Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); 377 Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page');
377 378
378 //Страница вакансии 379 //Страница вакансии
379 Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); 380 Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer');
380 381