Commit f5849d4dfe3f20c77b427aaf5ec5cf91db4704df

Authored by Андрей Ларионов
Exists in master

Правки по образованию

Showing 3 changed files 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 211 <<<<<<< HEAD
212 <!--<script src="{{ asset('/ckeditor/ckeditor.js') }}"></script>--> 212
213 213 <!--<script src="{{ asset('/ckeditor/ckeditor.js') }}"></script>-->
214 <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script> 214
215 215 <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>
216 <!--<script src="{{ asset('./ckeditor/ckeditor.js') }}"></script>--> 216
217 217 <!--<script src="{{ asset('./ckeditor/ckeditor.js') }}"></script>-->
218 <script> 218
219 CKEDITOR.replace( 'text', { 219 =======
220 filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", 220 <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>
221 filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", 221
222 filebrowserUploadMethod: 'form' 222 <!--<script src="{{ asset('./ckeditor/ckeditor.js') }}"></script>-->
223 }); 223 >>>>>>> 8018b079503aa01fce021d8de2a8631691fbe310
224 </script> 224 <script>
225 <script> 225 CKEDITOR.replace( 'text', {
226 window.addEventListener('DOMContentLoaded', () => { 226 filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
227 227 filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
228 setTabs(3); 228 filebrowserUploadMethod: 'form'
229 229 });
230 function setTabs(qty) { 230 </script>
231 231 <script>
232 const tabs = document.querySelector('.js_tabs'); 232 window.addEventListener('DOMContentLoaded', () => {
233 const tabsForm = tabs.querySelector('.js_tabs_form'); 233
234 const tabsInput = tabs.querySelector('.js_tabs_input'); 234 setTabs(3);
235 const tabsSubmitBtn = tabs.querySelector('.js_tabs_submit_btn'); 235
236 const tabsButtons = tabs.querySelector('.js_tabs_buttons'); 236 function setTabs(qty) {
237 const tabsContent = tabs.querySelector('.js_tabs_content'); 237
238 238 const tabs = document.querySelector('.js_tabs');
239 tabsForm.addEventListener('submit', (e) => { 239 const tabsForm = tabs.querySelector('.js_tabs_form');
240 240 const tabsInput = tabs.querySelector('.js_tabs_input');
241 //e.preventDefault(); 241 const tabsSubmitBtn = tabs.querySelector('.js_tabs_submit_btn');
242 242 const tabsButtons = tabs.querySelector('.js_tabs_buttons');
243 const tabsInputValue = tabsInput.value; 243 const tabsContent = tabs.querySelector('.js_tabs_content');
244 const tabsBtns = tabsButtons.querySelectorAll('.js_tabs_btn'); 244
245 const id = Date.now(); 245 tabsForm.addEventListener('submit', (e) => {
246 246
247 247 //e.preventDefault();
248 if (tabsBtns.length >= qty) { 248
249 console.log('Ветка выполнена'); 249 const tabsInputValue = tabsInput.value;
250 e.preventDefault(); 250 const tabsBtns = tabsButtons.querySelectorAll('.js_tabs_btn');
251 } 251 const id = Date.now();
252 252
253
254 if (tabsBtns.length >= qty) {
255 console.log('Ветка выполнена');
256 e.preventDefault();
257 }
258
259 if (tabsInput.dataset.edit) {
260
261 tabsBtns.forEach(btn => {
262 if (tabsInput.dataset.edit === btn.dataset.id) {
263 console.log('oldname: '+btn.textContent+' newname: '+tabsInputValue+' id_education: '+<?=$education->id?>+'');
253 /*if (tabsInput.dataset.edit) { 264 $.ajax({
254 265 url: '{{ route('admin.rename-program-education') }}',
255 tabsBtns.forEach(btn => { 266 method: 'get', /* Метод запроса (post или get) */
256 if (tabsInput.dataset.edit === btn.dataset.id) { 267 dataType: 'html', /* Тип данных в ответе (xml, json, script, html). */
257 btn.textContent = tabsInputValue; 268 data: {oldname: btn.textContent, newname:tabsInputValue, id_education: <?=$education->id?>}, /* Данные передаваемые в массиве */
258 btn.dataset.btn = tabsInputValue; 269 success: function(data){ /* функция которая будет выполнена после успешного запроса. */
259 } 270 console.log(data); /* В переменной data содержится ответ от index.php. */
260 }); 271 }
261 console.log('Эта ветка выполнилась'); 272 });
262 tabsInput.removeAttribute('data-edit'); 273
263 274 btn.textContent = tabsInputValue;
264 } else { 275 btn.dataset.btn = tabsInputValue;
265 276 }
266 if (!tabsBtns.length) { 277 });
267 tabsButtons.innerHTML += getTabsBtnTemplate(tabsInputValue, id); 278 console.log('Эта ветка выполнилась');
268 tabsContent.innerHTML += getTabsItemTemplate(id); 279 tabsInput.removeAttribute('data-edit');
269 } 280
270 281 } else {
271 if (tabsBtns.length && tabsBtns.length < qty) { 282
272 283 if (!tabsBtns.length) {
273 let isMatch = false; 284 tabsButtons.innerHTML += getTabsBtnTemplate(tabsInputValue, id);
274 285 //tabsContent.innerHTML += getTabsItemTemplate(id);
275 tabsBtns.forEach(btn => { 286 }
276 if (tabsInputValue === btn.dataset.btn) { 287
277 isMatch = true; 288 if (tabsBtns.length && tabsBtns.length < qty) {
278 } 289
279 }); 290 let isMatch = false;
280 291
281 console.log('Альтернативная ветка!'); 292 tabsBtns.forEach(btn => {
282 if (!isMatch) { 293 if (tabsInputValue === btn.dataset.btn) {
283 tabsButtons.innerHTML += getTabsBtnTemplate(tabsInputValue, id); 294 isMatch = true;
284 tabsContent.innerHTML += getTabsItemTemplate(id, 'hidden'); 295 }
285 } 296 });
286 } 297
287 }*/ 298 console.log('Альтернативная ветка!');
288 299 if (!isMatch) {
289 //tabsInput.value = ''; 300 tabsButtons.innerHTML += getTabsBtnTemplate(tabsInputValue, id);
290 addDisabledBtnStatus(tabsSubmitBtn); 301 tabsContent.innerHTML += getTabsItemTemplate(id, 'hidden');
291 302 }
292 }); 303 }
293 304 }
294 tabsInput.addEventListener('input', () => { 305
295 if (tabsInput.value !== '') { 306 //tabsInput.value = '';
296 removeDisabledBtnStatus(tabsSubmitBtn); 307 addDisabledBtnStatus(tabsSubmitBtn);
297 } else { 308
298 addDisabledBtnStatus(tabsSubmitBtn); 309 });
299 } 310
300 }); 311 tabsInput.addEventListener('input', () => {
301 312 if (tabsInput.value !== '') {
302 tabsButtons.addEventListener('click', (e) => { 313 removeDisabledBtnStatus(tabsSubmitBtn);
303 314 } else {
304 const target = e.target.closest('.js_tabs_btn'); 315 addDisabledBtnStatus(tabsSubmitBtn);
305 316 }
306 if (target) { 317 });
307 318
308 const tabsItems = tabs.querySelectorAll('.js_tabs_item'); 319 tabsButtons.addEventListener('click', (e) => {
309 320
310 tabsItems.forEach(item => { 321 const target = e.target.closest('.js_tabs_btn');
311 322
312 item.classList.add('hidden'); 323 if (target) {
313 324
314 if (target.dataset.id === item.dataset.id) { 325 const tabsItems = tabs.querySelectorAll('.js_tabs_item');
315 item.classList.remove('hidden'); 326
316 } 327 tabsItems.forEach(item => {
317 }); 328
318 } 329 item.classList.add('hidden');
319 330
320 }); 331 if (target.dataset.id === item.dataset.id) {
321 332 item.classList.remove('hidden');
322 tabsButtons.addEventListener('dblclick', (e) => { 333 }
323 const target = e.target.closest('.js_tabs_btn'); 334 });
324 335 }
325 if (target) { 336
326 tabsInput.value = target.dataset.btn; 337 });
327 tabsInput.dataset.edit = target.dataset.id; 338
328 removeDisabledBtnStatus(tabsSubmitBtn); 339 tabsButtons.addEventListener('dblclick', (e) => {
329 } 340 const target = e.target.closest('.js_tabs_btn');
330 }); 341
331 342 if (target) {
332 function getTabsBtnTemplate(btnName, id) { 343 tabsInput.value = target.dataset.btn;
333 return ` 344 tabsInput.dataset.edit = target.dataset.id;
334 <div> 345 removeDisabledBtnStatus(tabsSubmitBtn);
335 <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> 346 }
336 </div> 347 });
337 `; 348
338 } 349 function getTabsBtnTemplate(btnName, id) {
339 350 return `
340 function getTabsItemTemplate(id, className = '') { 351 <div>
341 return ` 352 <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 <div class="tabs__item js_tabs_item ${className}" data-id="${id}"> 353 </div>
343 <div class="mb-4">${id}</div> 354 `;
344 <table class="mb-4 w-full whitespace-no-wrap"> 355 }
345 <thead> 356
346 <tr 357 function getTabsItemTemplate(id, className = '') {
347 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" 358 return `
348 > 359 <div class="tabs__item js_tabs_item ${className}" data-id="${id}">
349 <th class="px-4 py-3">Client</th> 360 <div class="mb-4">${id}</div>
350 <th class="px-4 py-3">Amount</th> 361 <table class="mb-4 w-full whitespace-no-wrap">
351 <th class="px-4 py-3">Status</th> 362 <thead>
352 <th class="px-4 py-3">Date</th> 363 <tr
353 </tr> 364 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 </thead> 365 >
355 <tbody 366 <th class="px-4 py-3">Client</th>
356 class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800" 367 <th class="px-4 py-3">Amount</th>
357 > 368 <th class="px-4 py-3">Status</th>
358 <tr class="text-gray-700 dark:text-gray-400"> 369 <th class="px-4 py-3">Date</th>
359 <td class="px-4 py-3"> 370 </tr>
360 <div class="flex items-center text-sm"> 371 </thead>
361 <!-- Avatar with inset shadow --> 372 <tbody
362 <div 373 class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"
363 class="relative hidden w-8 h-8 mr-3 rounded-full md:block" 374 >
364 > 375 <tr class="text-gray-700 dark:text-gray-400">
365 <img 376 <td class="px-4 py-3">
366 class="object-cover w-full h-full rounded-full" 377 <div class="flex items-center text-sm">
367 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" 378 <!-- Avatar with inset shadow -->
368 alt="" 379 <div
369 loading="lazy" 380 class="relative hidden w-8 h-8 mr-3 rounded-full md:block"
370 /> 381 >
371 <div 382 <img
372 class="absolute inset-0 rounded-full shadow-inner" 383 class="object-cover w-full h-full rounded-full"
373 aria-hidden="true" 384 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 ></div> 385 alt=""
375 </div> 386 loading="lazy"
376 <div> 387 />
377 <p class="font-semibold">Hans Burger</p> 388 <div
378 <p class="text-xs text-gray-600 dark:text-gray-400"> 389 class="absolute inset-0 rounded-full shadow-inner"
379 10x Developer 390 aria-hidden="true"
380 </p> 391 ></div>
381 </div> 392 </div>
382 </div> 393 <div>
383 </td> 394 <p class="font-semibold">Hans Burger</p>
384 <td class="px-4 py-3 text-sm"> 395 <p class="text-xs text-gray-600 dark:text-gray-400">
385 $ 863.45 396 10x Developer
386 </td> 397 </p>
387 <td class="px-4 py-3 text-xs"> 398 </div>
388 <span 399 </div>
389 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" 400 </td>
390 > 401 <td class="px-4 py-3 text-sm">
391 Approved 402 $ 863.45
392 </span> 403 </td>
393 </td> 404 <td class="px-4 py-3 text-xs">
394 <td class="px-4 py-3 text-sm"> 405 <span
395 6/10/2020 406 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 </td> 407 >
397 </tr> 408 Approved
398 409 </span>
399 <tr class="text-gray-700 dark:text-gray-400"> 410 </td>
400 <td class="px-4 py-3"> 411 <td class="px-4 py-3 text-sm">
401 <div class="flex items-center text-sm"> 412 6/10/2020
402 <!-- Avatar with inset shadow --> 413 </td>
403 <div 414 </tr>
404 class="relative hidden w-8 h-8 mr-3 rounded-full md:block" 415
405 > 416 <tr class="text-gray-700 dark:text-gray-400">
406 <img 417 <td class="px-4 py-3">
407 class="object-cover w-full h-full rounded-full" 418 <div class="flex items-center text-sm">
408 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" 419 <!-- Avatar with inset shadow -->
409 alt="" 420 <div
410 loading="lazy" 421 class="relative hidden w-8 h-8 mr-3 rounded-full md:block"
411 /> 422 >
412 <div 423 <img
413 class="absolute inset-0 rounded-full shadow-inner" 424 class="object-cover w-full h-full rounded-full"
414 aria-hidden="true" 425 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 ></div> 426 alt=""
416 </div> 427 loading="lazy"
417 <div> 428 />
418 <p class="font-semibold">Jolina Angelie</p> 429 <div
419 <p class="text-xs text-gray-600 dark:text-gray-400"> 430 class="absolute inset-0 rounded-full shadow-inner"
420 Unemployed 431 aria-hidden="true"
421 </p> 432 ></div>
422 </div> 433 </div>
423 </div> 434 <div>
424 </td> 435 <p class="font-semibold">Jolina Angelie</p>
425 <td class="px-4 py-3 text-sm"> 436 <p class="text-xs text-gray-600 dark:text-gray-400">
426 $ 369.95 437 Unemployed
427 </td> 438 </p>
428 <td class="px-4 py-3 text-xs"> 439 </div>
429 <span 440 </div>
430 class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:text-white dark:bg-orange-600" 441 </td>
431 > 442 <td class="px-4 py-3 text-sm">
432 Pending 443 $ 369.95
433 </span> 444 </td>
434 </td> 445 <td class="px-4 py-3 text-xs">
435 <td class="px-4 py-3 text-sm"> 446 <span
436 6/10/2020 447 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 </td> 448 >
438 </tr> 449 Pending
439 </tbody> 450 </span>
440 </table> 451 </td>
441 452 <td class="px-4 py-3 text-sm">
442 <div class="flex flex-col flex-wrap mb-4 md:flex-row md:space-x-4"> 453 6/10/2020
443 <div> 454 </td>
444 <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> 455 </tr>
445 </div> 456 </tbody>
446 <div> 457 </table>
447 <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> 458
448 </div> 459 <div class="flex flex-col flex-wrap mb-4 md:flex-row md:space-x-4">
449 </div> 460 <div>
450 </div> 461 <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 `; 462 </div>
452 } 463 <div>
453 464 <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 function addDisabledBtnStatus(btn) { 465 </div>
455 btn.disabled = true; 466 </div>
456 btn.classList.add('opacity-50', 'cursor-not-allowed'); 467 </div>
457 btn.classList.remove('active:bg-purple-600', 'hover:bg-purple-700', 'focus:shadow-outline-purple'); 468 `;
458 } 469 }
459 470
460 function removeDisabledBtnStatus(btn) { 471 function addDisabledBtnStatus(btn) {
461 btn.disabled = false; 472 btn.disabled = true;
462 btn.classList.remove('opacity-50', 'cursor-not-allowed'); 473 btn.classList.add('opacity-50', 'cursor-not-allowed');
463 btn.classList.add('active:bg-purple-600', 'hover:bg-purple-700', 'focus:shadow-outline-purple'); 474 btn.classList.remove('active:bg-purple-600', 'hover:bg-purple-700', 'focus:shadow-outline-purple');
464 } 475 }
465 476
466 } 477 function removeDisabledBtnStatus(btn) {
467 console.log('main.js init'); 478 btn.disabled = false;
468 479 btn.classList.remove('opacity-50', 'cursor-not-allowed');
469 }); 480 btn.classList.add('active:bg-purple-600', 'hover:bg-purple-700', 'focus:shadow-outline-purple');
470 481 }
471 </script> 482
472 483 }
473 484 console.log('main.js init');
485
486 });
487
488 </script>
489
490
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