Commit b17c06a2334adca962a811e9ba644a1977743bba
1 parent
492296b6f5
Exists in
master
and in
1 other branch
Коммит по системе авторизации работодателя/работника
Showing 3 changed files with 86 additions and 5 deletions Inline Diff
app/Http/Controllers/EmployerController.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Http\Controllers; | 3 | namespace App\Http\Controllers; |
4 | 4 | ||
5 | use App\Classes\RusDate; | 5 | use App\Classes\RusDate; |
6 | use App\Classes\Tools; | 6 | use App\Classes\Tools; |
7 | use App\Http\Requests\FlotRequest; | 7 | use App\Http\Requests\FlotRequest; |
8 | use App\Http\Requests\MessagesRequiest; | 8 | use App\Http\Requests\MessagesRequiest; |
9 | use App\Http\Requests\VacancyRequestEdit; | 9 | use App\Http\Requests\VacancyRequestEdit; |
10 | use App\Http\Requests\VacansiaRequiest; | 10 | use App\Http\Requests\VacansiaRequiest; |
11 | use App\Mail\MailSotrudnichestvo; | 11 | use App\Mail\MailSotrudnichestvo; |
12 | use App\Mail\SendAllMessages; | 12 | use App\Mail\SendAllMessages; |
13 | use App\Models\Ad_employer; | 13 | use App\Models\Ad_employer; |
14 | use App\Models\Ad_jobs; | 14 | use App\Models\Ad_jobs; |
15 | use App\Models\ad_response; | 15 | use App\Models\ad_response; |
16 | use App\Models\Category; | 16 | use App\Models\Category; |
17 | use App\Models\Education; | 17 | use App\Models\Education; |
18 | use App\Models\Employer; | 18 | use App\Models\Employer; |
19 | use App\Models\employers_main; | 19 | use App\Models\employers_main; |
20 | use App\Models\Flot; | 20 | use App\Models\Flot; |
21 | use App\Models\Job_title; | 21 | use App\Models\Job_title; |
22 | use App\Models\Like_vacancy; | 22 | use App\Models\Like_vacancy; |
23 | use App\Models\Like_worker; | 23 | use App\Models\Like_worker; |
24 | use App\Models\Message; | 24 | use App\Models\Message; |
25 | use App\Models\Positions; | 25 | use App\Models\Positions; |
26 | use App\Models\Worker; | 26 | use App\Models\Worker; |
27 | use Carbon\Carbon; | 27 | use Carbon\Carbon; |
28 | use Illuminate\Auth\Events\Registered; | 28 | use Illuminate\Auth\Events\Registered; |
29 | use Illuminate\Database\Eloquent\Builder; | 29 | use Illuminate\Database\Eloquent\Builder; |
30 | use Illuminate\Database\Eloquent\Model; | 30 | use Illuminate\Database\Eloquent\Model; |
31 | use Illuminate\Foundation\Auth\User; | 31 | use Illuminate\Foundation\Auth\User; |
32 | use Illuminate\Http\Request; | 32 | use Illuminate\Http\Request; |
33 | use Illuminate\Support\Facades\Auth; | 33 | use Illuminate\Support\Facades\Auth; |
34 | use Illuminate\Support\Facades\Hash; | 34 | use Illuminate\Support\Facades\Hash; |
35 | use Illuminate\Support\Facades\Mail; | 35 | use Illuminate\Support\Facades\Mail; |
36 | use Illuminate\Support\Facades\Storage; | 36 | use Illuminate\Support\Facades\Storage; |
37 | use App\Models\User as User_Model; | 37 | use App\Models\User as User_Model; |
38 | use Illuminate\Support\Facades\Validator; | 38 | use Illuminate\Support\Facades\Validator; |
39 | 39 | ||
40 | class EmployerController extends Controller | 40 | class EmployerController extends Controller |
41 | { | 41 | { |
42 | public function vacancie($vacancy, Request $request) { | 42 | public function vacancie($vacancy, Request $request) { |
43 | $title = 'Заголовок вакансии'; | 43 | $title = 'Заголовок вакансии'; |
44 | $Query = Ad_employer::with('jobs')-> | 44 | $Query = Ad_employer::with('jobs')-> |
45 | with('cat')-> | 45 | with('cat')-> |
46 | with('employer')-> | 46 | with('employer')-> |
47 | with('jobs_code')-> | 47 | with('jobs_code')-> |
48 | select('ad_employers.*')-> | 48 | select('ad_employers.*')-> |
49 | where('id', '=', $vacancy)->get(); | 49 | where('id', '=', $vacancy)->get(); |
50 | 50 | ||
51 | if (isset(Auth()->user()->id)) | 51 | if (isset(Auth()->user()->id)) |
52 | $uid = Auth()->user()->id; | 52 | $uid = Auth()->user()->id; |
53 | else | 53 | else |
54 | $uid = 0; | 54 | $uid = 0; |
55 | $title = $Query[0]->name; | 55 | $title = $Query[0]->name; |
56 | if ($request->ajax()) { | 56 | if ($request->ajax()) { |
57 | return view('ajax.vacance-item', compact('Query','uid')); | 57 | return view('ajax.vacance-item', compact('Query','uid')); |
58 | } else { | 58 | } else { |
59 | return view('vacance-item', compact('title', 'Query', 'uid')); | 59 | return view('vacance-item', compact('title', 'Query', 'uid')); |
60 | } | 60 | } |
61 | } | 61 | } |
62 | 62 | ||
63 | public function logout() { | 63 | public function logout() { |
64 | Auth::logout(); | 64 | Auth::logout(); |
65 | return redirect()->route('index') | 65 | return redirect()->route('index') |
66 | ->with('success', 'Вы вышли из личного кабинета'); | 66 | ->with('success', 'Вы вышли из личного кабинета'); |
67 | } | 67 | } |
68 | 68 | ||
69 | public function cabinet() { | 69 | public function cabinet() { |
70 | $id = Auth()->user()->id; | 70 | $id = Auth()->user()->id; |
71 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | 71 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
72 | WhereHas('users', | 72 | WhereHas('users', |
73 | function (Builder $query) use ($id) {$query->Where('id', $id); | 73 | function (Builder $query) use ($id) {$query->Where('id', $id); |
74 | })->get(); | 74 | })->get(); |
75 | return view('employers.cabinet45', compact('Employer')); | 75 | return view('employers.cabinet45', compact('Employer')); |
76 | } | 76 | } |
77 | 77 | ||
78 | public function slider_flot() { | 78 | public function slider_flot() { |
79 | $id = Auth()->user()->id; | 79 | $id = Auth()->user()->id; |
80 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | 80 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
81 | WhereHas('users', | 81 | WhereHas('users', |
82 | function (Builder $query) use ($id) {$query->Where('id', $id); | 82 | function (Builder $query) use ($id) {$query->Where('id', $id); |
83 | })->get(); | 83 | })->get(); |
84 | return view('employers.fly-flot', compact('Employer')); | 84 | return view('employers.fly-flot', compact('Employer')); |
85 | } | 85 | } |
86 | 86 | ||
87 | public function cabinet_save(Employer $Employer, Request $request) { | 87 | public function cabinet_save(Employer $Employer, Request $request) { |
88 | $params = $request->all(); | 88 | $params = $request->all(); |
89 | $params['user_id'] = Auth()->user()->id; | 89 | $params['user_id'] = Auth()->user()->id; |
90 | $id = $Employer->id; | 90 | $id = $Employer->id; |
91 | 91 | ||
92 | if ($request->has('logo')) { | 92 | if ($request->has('logo')) { |
93 | if (!empty($Employer->logo)) { | 93 | if (!empty($Employer->logo)) { |
94 | Storage::delete($Employer->logo); | 94 | Storage::delete($Employer->logo); |
95 | } | 95 | } |
96 | $params['logo'] = $request->file('logo')->store("employer/$id", 'public'); | 96 | $params['logo'] = $request->file('logo')->store("employer/$id", 'public'); |
97 | } | 97 | } |
98 | 98 | ||
99 | $Employer->update($params); | 99 | $Employer->update($params); |
100 | 100 | ||
101 | return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены'); | 101 | return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены'); |
102 | } | 102 | } |
103 | 103 | ||
104 | public function save_add_flot(FlotRequest $request) { | 104 | public function save_add_flot(FlotRequest $request) { |
105 | // отмена | 105 | // отмена |
106 | $params = $request->all(); | 106 | $params = $request->all(); |
107 | 107 | ||
108 | if ($request->has('image')) { | 108 | if ($request->has('image')) { |
109 | $params['image'] = $request->file('image')->store("flot", 'public'); | 109 | $params['image'] = $request->file('image')->store("flot", 'public'); |
110 | } | 110 | } |
111 | Flot::create($params); | 111 | Flot::create($params); |
112 | $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get(); | 112 | $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get(); |
113 | return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); | 113 | return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); |
114 | } | 114 | } |
115 | 115 | ||
116 | public function delete_flot(Flot $Flot) { | 116 | public function delete_flot(Flot $Flot) { |
117 | $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get(); | 117 | $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get(); |
118 | 118 | ||
119 | if (isset($Flot->id)) $Flot->delete(); | 119 | if (isset($Flot->id)) $Flot->delete(); |
120 | return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален'); | 120 | return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален'); |
121 | } | 121 | } |
122 | 122 | ||
123 | // Форма добавления вакансий | 123 | // Форма добавления вакансий |
124 | public function cabinet_vacancie() { | 124 | public function cabinet_vacancie() { |
125 | $id = Auth()->user()->id; | 125 | $id = Auth()->user()->id; |
126 | 126 | ||
127 | $categories = Category::query()->active()->get(); | 127 | $categories = Category::query()->active()->get(); |
128 | $Positions = Category::query()->active()->get(); | 128 | $Positions = Category::query()->active()->get(); |
129 | if ($Positions->count()) { | 129 | if ($Positions->count()) { |
130 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get(); | 130 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get(); |
131 | } else { | 131 | } else { |
132 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get(); | 132 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get(); |
133 | } | 133 | } |
134 | 134 | ||
135 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | 135 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
136 | WhereHas('users', | 136 | WhereHas('users', |
137 | function (Builder $query) use ($id) {$query->Where('id', $id); | 137 | function (Builder $query) use ($id) {$query->Where('id', $id); |
138 | })->get(); | 138 | })->get(); |
139 | 139 | ||
140 | return view('employers.add_vacancy', compact('Employer', 'jobs' , 'categories', 'Positions')); | 140 | return view('employers.add_vacancy', compact('Employer', 'jobs' , 'categories', 'Positions')); |
141 | } | 141 | } |
142 | 142 | ||
143 | // Сохранение вакансии | 143 | // Сохранение вакансии |
144 | public function cabinet_vacancy_save1(VacancyRequestEdit $request) { | 144 | public function cabinet_vacancy_save1(VacancyRequestEdit $request) { |
145 | $params = $request->all(); | 145 | $params = $request->all(); |
146 | 146 | ||
147 | $ad_jobs = Ad_employer::create($params); | 147 | $ad_jobs = Ad_employer::create($params); |
148 | return redirect()->route('employer.vacancy_list'); | 148 | return redirect()->route('employer.vacancy_list'); |
149 | } | 149 | } |
150 | 150 | ||
151 | // Список вакансий | 151 | // Список вакансий |
152 | public function vacancy_list(Request $request) { | 152 | public function vacancy_list(Request $request) { |
153 | $id = Auth()->user()->id; | 153 | $id = Auth()->user()->id; |
154 | $Employer = Employer::query()->where('user_id', $id)->first(); | 154 | $Employer = Employer::query()->where('user_id', $id)->first(); |
155 | $vacancy_list = Ad_employer::query()->with('jobs')->with('jobs_code')->where('employer_id', $Employer->id); | 155 | $vacancy_list = Ad_employer::query()->with('jobs')->with('jobs_code')->where('employer_id', $Employer->id); |
156 | 156 | ||
157 | 157 | ||
158 | if ($request->get('sort')) { | 158 | if ($request->get('sort')) { |
159 | $sort = $request->get('sort'); | 159 | $sort = $request->get('sort'); |
160 | switch ($sort) { | 160 | switch ($sort) { |
161 | case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break; | 161 | case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break; |
162 | case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break; | 162 | case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break; |
163 | case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break; | 163 | case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break; |
164 | case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break; | 164 | case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break; |
165 | case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; | 165 | case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; |
166 | default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; | 166 | default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; |
167 | } | 167 | } |
168 | } | 168 | } |
169 | $vacancy_list = $vacancy_list->paginate(4); | 169 | $vacancy_list = $vacancy_list->paginate(4); |
170 | 170 | ||
171 | //ajax | 171 | //ajax |
172 | if ($request->ajax()) { | 172 | if ($request->ajax()) { |
173 | return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); | 173 | return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); |
174 | } else { | 174 | } else { |
175 | return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); | 175 | return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); |
176 | } | 176 | } |
177 | } | 177 | } |
178 | 178 | ||
179 | // Карточка вакансии | 179 | // Карточка вакансии |
180 | public function vacancy_edit(Ad_employer $ad_employer) { | 180 | public function vacancy_edit(Ad_employer $ad_employer) { |
181 | $id = Auth()->user()->id; | 181 | $id = Auth()->user()->id; |
182 | 182 | ||
183 | $Positions = Category::query()->active()->get(); | 183 | $Positions = Category::query()->active()->get(); |
184 | if ($Positions->count()) { | 184 | if ($Positions->count()) { |
185 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get(); | 185 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get(); |
186 | } else { | 186 | } else { |
187 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get(); | 187 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get(); |
188 | } | 188 | } |
189 | $categories = Category::query()->get(); | 189 | $categories = Category::query()->get(); |
190 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | 190 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
191 | where('user_id', $id)->first(); | 191 | where('user_id', $id)->first(); |
192 | 192 | ||
193 | return view('employers.edit_vacancy', compact('ad_employer', 'Positions', 'categories','Employer', 'jobs')); | 193 | return view('employers.edit_vacancy', compact('ad_employer', 'Positions', 'categories','Employer', 'jobs')); |
194 | } | 194 | } |
195 | 195 | ||
196 | // Сохранение-редактирование записи | 196 | // Сохранение-редактирование записи |
197 | public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { | 197 | public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { |
198 | $params = $request->all(); | 198 | $params = $request->all(); |
199 | 199 | ||
200 | //$jobs['flot'] = $params['flot']; | 200 | //$jobs['flot'] = $params['flot']; |
201 | //$jobs['job_title_id'] = $params['job_title_id']; | 201 | //$jobs['job_title_id'] = $params['job_title_id']; |
202 | //$titles['position_id'] = $params['position_id']; | 202 | //$titles['position_id'] = $params['position_id']; |
203 | //unset($params['job_title_id']); | 203 | //unset($params['job_title_id']); |
204 | 204 | ||
205 | $ad_employer->update($params); | 205 | $ad_employer->update($params); |
206 | 206 | ||
207 | //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])-> | 207 | //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])-> |
208 | // where('ad_employer_id', $ad_employer->id)->first(); | 208 | // where('ad_employer_id', $ad_employer->id)->first(); |
209 | //$data = Ad_jobs::find($job_->id); | 209 | //$data = Ad_jobs::find($job_->id); |
210 | //$ad_jobs = $data->update($jobs); | 210 | //$ad_jobs = $data->update($jobs); |
211 | 211 | ||
212 | return redirect()->route('employer.vacancy_list'); | 212 | return redirect()->route('employer.vacancy_list'); |
213 | } | 213 | } |
214 | 214 | ||
215 | // Сохранение карточки вакансии | 215 | // Сохранение карточки вакансии |
216 | public function vacancy_save(Request $request, Ad_employer $ad_employer) { | 216 | public function vacancy_save(Request $request, Ad_employer $ad_employer) { |
217 | $all = $request->all(); | 217 | $all = $request->all(); |
218 | $ad_employer->update($all); | 218 | $ad_employer->update($all); |
219 | return redirect()->route('employer.cabinet_vacancie'); | 219 | return redirect()->route('employer.cabinet_vacancie'); |
220 | } | 220 | } |
221 | 221 | ||
222 | // Удаление карточки вакансии | 222 | // Удаление карточки вакансии |
223 | public function vacancy_delete(Ad_employer $ad_employer) { | 223 | public function vacancy_delete(Ad_employer $ad_employer) { |
224 | $ad_employer->delete(); | 224 | $ad_employer->delete(); |
225 | 225 | ||
226 | return redirect()->route('employer.vacancy_list') | 226 | return redirect()->route('employer.vacancy_list') |
227 | ->with('success', 'Данные были успешно сохранены'); | 227 | ->with('success', 'Данные были успешно сохранены'); |
228 | } | 228 | } |
229 | 229 | ||
230 | // Обновление даты | 230 | // Обновление даты |
231 | public function vacancy_up(Ad_employer $ad_employer) { | 231 | public function vacancy_up(Ad_employer $ad_employer) { |
232 | $up = date('m/d/Y h:i:s', time());; | 232 | $up = date('m/d/Y h:i:s', time());; |
233 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); | 233 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); |
234 | $vac_emp->updated_at = $up; | 234 | $vac_emp->updated_at = $up; |
235 | $vac_emp->save(); | 235 | $vac_emp->save(); |
236 | 236 | ||
237 | return redirect()->route('employer.vacancy_list'); | 237 | return redirect()->route('employer.vacancy_list'); |
238 | // начало конца | 238 | // начало конца |
239 | } | 239 | } |
240 | 240 | ||
241 | //Видимость вакансии | 241 | //Видимость вакансии |
242 | public function vacancy_eye(Ad_employer $ad_employer, $status) { | 242 | public function vacancy_eye(Ad_employer $ad_employer, $status) { |
243 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); | 243 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); |
244 | $vac_emp->active_is = $status; | 244 | $vac_emp->active_is = $status; |
245 | $vac_emp->save(); | 245 | $vac_emp->save(); |
246 | 246 | ||
247 | return redirect()->route('employer.vacancy_list'); | 247 | return redirect()->route('employer.vacancy_list'); |
248 | } | 248 | } |
249 | 249 | ||
250 | //Вакансия редактирования (шаблон) | 250 | //Вакансия редактирования (шаблон) |
251 | public function vacancy_update(Ad_employer $id) { | 251 | public function vacancy_update(Ad_employer $id) { |
252 | 252 | ||
253 | } | 253 | } |
254 | 254 | ||
255 | //Отклики на вакансию - лист | 255 | //Отклики на вакансию - лист |
256 | public function answers(Employer $employer, Request $request) { | 256 | public function answers(Employer $employer, Request $request) { |
257 | $user_id = Auth()->user()->id; | 257 | $user_id = Auth()->user()->id; |
258 | $answer = Ad_employer::query()->where('employer_id', $employer->id); | 258 | $answer = Ad_employer::query()->where('employer_id', $employer->id); |
259 | if ($request->has('search')) { | 259 | if ($request->has('search')) { |
260 | $search = trim($request->get('search')); | 260 | $search = trim($request->get('search')); |
261 | if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); | 261 | if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); |
262 | } | 262 | } |
263 | 263 | ||
264 | $answer = $answer->with('response')->get(); | 264 | $answer = $answer->with('response')->get(); |
265 | 265 | ||
266 | return view('employers.list_answer', compact('answer', 'user_id', 'employer')); | 266 | return view('employers.list_answer', compact('answer', 'user_id', 'employer')); |
267 | } | 267 | } |
268 | 268 | ||
269 | //Обновление статуса | 269 | //Обновление статуса |
270 | public function supple_status(employer $employer, ad_response $ad_response, $flag) { | 270 | public function supple_status(employer $employer, ad_response $ad_response, $flag) { |
271 | $ad_response->update(Array('flag' => $flag)); | 271 | $ad_response->update(Array('flag' => $flag)); |
272 | return redirect()->route('employer.answers', ['employer' => $employer->id]); | 272 | return redirect()->route('employer.answers', ['employer' => $employer->id]); |
273 | } | 273 | } |
274 | 274 | ||
275 | //Страницы сообщений список | 275 | //Страницы сообщений список |
276 | public function messages($type_message) { | 276 | public function messages($type_message) { |
277 | $user_id = Auth()->user()->id; | 277 | $user_id = Auth()->user()->id; |
278 | 278 | ||
279 | $messages_input = Message::query()->with('vacancies')->with('user_from')-> | 279 | $messages_input = Message::query()->with('vacancies')->with('user_from')-> |
280 | Where('to_user_id', $user_id)->OrderByDesc('created_at'); | 280 | Where('to_user_id', $user_id)->OrderByDesc('created_at'); |
281 | 281 | ||
282 | $messages_output = Message::query()->with('vacancies')-> | 282 | $messages_output = Message::query()->with('vacancies')-> |
283 | with('user_to')->where('user_id', $user_id)-> | 283 | with('user_to')->where('user_id', $user_id)-> |
284 | OrderByDesc('created_at'); | 284 | OrderByDesc('created_at'); |
285 | 285 | ||
286 | 286 | ||
287 | $count_input = $messages_input->count(); | 287 | $count_input = $messages_input->count(); |
288 | $count_output = $messages_output->count(); | 288 | $count_output = $messages_output->count(); |
289 | 289 | ||
290 | if ($type_message == 'input') { | 290 | if ($type_message == 'input') { |
291 | $messages = $messages_input->paginate(15); | 291 | $messages = $messages_input->paginate(15); |
292 | } | 292 | } |
293 | 293 | ||
294 | if ($type_message == 'output') { | 294 | if ($type_message == 'output') { |
295 | $messages = $messages_output->paginate(15); | 295 | $messages = $messages_output->paginate(15); |
296 | } | 296 | } |
297 | 297 | ||
298 | return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); | 298 | return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); |
299 | } | 299 | } |
300 | 300 | ||
301 | // Диалог между пользователями | 301 | // Диалог между пользователями |
302 | public function dialog(User_Model $user1, User_Model $user2) { | 302 | public function dialog(User_Model $user1, User_Model $user2) { |
303 | if (isset($user2->id)) { | 303 | if (isset($user2->id)) { |
304 | $companion = User_Model::query()->with('workers')-> | 304 | $companion = User_Model::query()->with('workers')-> |
305 | with('employers')-> | 305 | with('employers')-> |
306 | where('id', $user2->id)->first(); | 306 | where('id', $user2->id)->first(); |
307 | } | 307 | } |
308 | 308 | ||
309 | $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) { | 309 | $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) { |
310 | $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); | 310 | $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); |
311 | })->orWhere(function($query) use ($user1, $user2) { | 311 | })->orWhere(function($query) use ($user1, $user2) { |
312 | $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); | 312 | $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); |
313 | })->OrderBy('created_at')->get(); | 313 | })->OrderBy('created_at')->get(); |
314 | 314 | ||
315 | $id_vac = null; | 315 | $id_vac = null; |
316 | foreach ($Messages as $it) { | 316 | foreach ($Messages as $it) { |
317 | if (isset($it->response)) { | 317 | if (isset($it->response)) { |
318 | foreach ($it->response as $r) { | 318 | foreach ($it->response as $r) { |
319 | if (isset($r->ad_employer_id)) { | 319 | if (isset($r->ad_employer_id)) { |
320 | $id_vac = $r->ad_employer_id; | 320 | $id_vac = $r->ad_employer_id; |
321 | break; | 321 | break; |
322 | } | 322 | } |
323 | } | 323 | } |
324 | } | 324 | } |
325 | if (!is_null($id_vac)) break; | 325 | if (!is_null($id_vac)) break; |
326 | } | 326 | } |
327 | 327 | ||
328 | $ad_employer = null; | 328 | $ad_employer = null; |
329 | if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); | 329 | if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); |
330 | $sender = $user1; | 330 | $sender = $user1; |
331 | 331 | ||
332 | return view('employers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); | 332 | return view('employers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); |
333 | } | 333 | } |
334 | 334 | ||
335 | // Регистрация работодателя | 335 | // Регистрация работодателя |
336 | public function register_employer(Request $request) { | 336 | public function register_employer(Request $request) { |
337 | $params = $request->all(); | 337 | $params = $request->all(); |
338 | 338 | ||
339 | $rules = [ | 339 | $rules = [ |
340 | //'surname' => ['required', 'string', 'max:255'], | 340 | //'surname' => ['required', 'string', 'max:255'], |
341 | //'name_man' => ['required', 'string', 'max:255'], | 341 | //'name_man' => ['required', 'string', 'max:255'], |
342 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], | 342 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], |
343 | 'name_company' => ['required', 'string', 'max:255'], | 343 | 'name_company' => ['required', 'string', 'max:255'], |
344 | 'password' => ['required', 'string', 'min:8'], | 344 | 'password' => ['required', 'string', 'min:8'], |
345 | ]; | 345 | ]; |
346 | 346 | ||
347 | 347 | ||
348 | $messages = [ | 348 | $messages = [ |
349 | 'required' => 'Укажите обязательное поле', | 349 | 'required' => 'Укажите обязательное поле', |
350 | 'min' => [ | 350 | 'min' => [ |
351 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 351 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
352 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 352 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
353 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 353 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
354 | ], | 354 | ], |
355 | 'max' => [ | 355 | 'max' => [ |
356 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 356 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
357 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 357 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
358 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 358 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
359 | ] | 359 | ] |
360 | ]; | 360 | ]; |
361 | 361 | ||
362 | if ($request->get('password') !== $request->get('confirmed')){ | 362 | if ($request->get('password') !== $request->get('confirmed')){ |
363 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); | 363 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); |
364 | } | 364 | } |
365 | 365 | ||
366 | if (strlen($request->get('password')) < 8) { | ||
367 | return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); | ||
368 | } | ||
369 | |||
370 | $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); | ||
371 | $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', | ||
372 | 'X', 'C', 'V', 'B', 'N', 'M'); | ||
373 | $spec_bool = false; | ||
374 | $alpha_bool = false; | ||
375 | |||
376 | $haystack = $request->get('password'); | ||
377 | |||
378 | foreach ($specsumbol as $it) { | ||
379 | if (strpos($haystack, $it) !== false) { | ||
380 | $spec_bool = true; | ||
381 | } | ||
382 | } | ||
383 | |||
384 | foreach ($alpha as $it) { | ||
385 | if (strpos($haystack, $it) !== false) { | ||
386 | $alpha_bool = true; | ||
387 | } | ||
388 | } | ||
389 | |||
390 | if ((!$spec_bool) || (!$alpha_bool)) { | ||
391 | return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); | ||
392 | } | ||
393 | |||
366 | if (empty($request->get('surname'))) { | 394 | if (empty($request->get('surname'))) { |
367 | $params['surname'] = 'Неизвестно'; | 395 | $params['surname'] = 'Неизвестно'; |
368 | } | 396 | } |
369 | |||
370 | if (empty($request->get('name_man'))) { | 397 | if (empty($request->get('name_man'))) { |
371 | $params['name_man'] = 'Неизвестно'; | 398 | $params['name_man'] = 'Неизвестно'; |
372 | } | 399 | } |
373 | |||
374 | $validator = Validator::make($params, $rules, $messages); | 400 | $validator = Validator::make($params, $rules, $messages); |
375 | 401 | ||
376 | if ($validator->fails()) { | 402 | if ($validator->fails()) { |
377 | return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); | 403 | return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); |
378 | } else { | 404 | } else { |
379 | $user = $this->create($params); | 405 | $user = $this->create($params); |
380 | event(new Registered($user)); | 406 | event(new Registered($user)); |
381 | |||
382 | Auth::guard()->login($user); | 407 | Auth::guard()->login($user); |
383 | } | 408 | } |
409 | |||
384 | if ($user) { | 410 | if ($user) { |
385 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; | 411 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; |
386 | } else { | 412 | } else { |
387 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); | 413 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); |
388 | } | 414 | } |
389 | } | 415 | } |
390 | 416 | ||
391 | // Создание пользователя | 417 | // Создание пользователя |
392 | protected function create(array $data) | 418 | protected function create(array $data) |
393 | { | 419 | { |
394 | $Use = new User_Model(); | 420 | $Use = new User_Model(); |
395 | $Code_user = $Use->create([ | 421 | $Code_user = $Use->create([ |
396 | 'name' => $data['surname']." ".$data['name_man'], | 422 | 'name' => $data['surname']." ".$data['name_man'], |
397 | 'name_man' => $data['name_man'], | 423 | 'name_man' => $data['name_man'], |
398 | 'surname' => $data['surname'], | 424 | 'surname' => $data['surname'], |
399 | 'surname2' => $data['surname2'], | 425 | 'surname2' => $data['surname2'], |
400 | 'subscribe_email' => $data['email'], | 426 | 'subscribe_email' => $data['email'], |
401 | 'email' => $data['email'], | 427 | 'email' => $data['email'], |
402 | 'telephone' => $data['telephone'], | 428 | 'telephone' => $data['telephone'], |
403 | 'is_worker' => 0, | 429 | 'is_worker' => 0, |
404 | 'password' => Hash::make($data['password']), | 430 | 'password' => Hash::make($data['password']), |
405 | 'pubpassword' => base64_encode($data['password']), | 431 | 'pubpassword' => base64_encode($data['password']), |
406 | 'email_verified_at' => Carbon::now() | 432 | 'email_verified_at' => Carbon::now() |
407 | ]); | 433 | ]); |
408 | 434 | ||
409 | if ($Code_user->id > 0) { | 435 | if ($Code_user->id > 0) { |
410 | $Employer = new Employer(); | 436 | $Employer = new Employer(); |
411 | $Employer->user_id = $Code_user->id; | 437 | $Employer->user_id = $Code_user->id; |
412 | $Employer->name_company = $data['name_company']; | 438 | $Employer->name_company = $data['name_company']; |
413 | $Employer->email = $data['email']; | 439 | $Employer->email = $data['email']; |
414 | $Employer->telephone = $data['telephone']; | 440 | $Employer->telephone = $data['telephone']; |
415 | $Employer->code = Tools::generator_id(10); | 441 | $Employer->code = Tools::generator_id(10); |
416 | $Employer->save(); | 442 | $Employer->save(); |
417 | 443 | ||
418 | return $Code_user; | 444 | return $Code_user; |
419 | } | 445 | } |
420 | } | 446 | } |
421 | 447 | ||
422 | // Отправка сообщения от работодателя | 448 | // Отправка сообщения от работодателя |
423 | public function send_message(MessagesRequiest $request) { | 449 | public function send_message(MessagesRequiest $request) { |
424 | $params = $request->all(); | 450 | $params = $request->all(); |
425 | dd($params); | 451 | dd($params); |
426 | $user1 = $params['user_id']; | 452 | $user1 = $params['user_id']; |
427 | $user2 = $params['to_user_id']; | 453 | $user2 = $params['to_user_id']; |
428 | 454 | ||
429 | if ($request->has('file')) { | 455 | if ($request->has('file')) { |
430 | $params['file'] = $request->file('file')->store("messages", 'public'); | 456 | $params['file'] = $request->file('file')->store("messages", 'public'); |
431 | } | 457 | } |
432 | Message::create($params); | 458 | Message::create($params); |
433 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); | 459 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); |
434 | } | 460 | } |
435 | 461 | ||
436 | public function test123(Request $request) { | 462 | public function test123(Request $request) { |
437 | $params = $request->all(); | 463 | $params = $request->all(); |
438 | $user1 = $params['user_id']; | 464 | $user1 = $params['user_id']; |
439 | $user2 = $params['to_user_id']; | 465 | $user2 = $params['to_user_id']; |
440 | 466 | ||
441 | $rules = [ | 467 | $rules = [ |
442 | 'text' => 'required|min:1|max:150000', | 468 | 'text' => 'required|min:1|max:150000', |
443 | 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' | 469 | 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' |
444 | ]; | 470 | ]; |
445 | $messages = [ | 471 | $messages = [ |
446 | 'required' => 'Укажите обязательное поле', | 472 | 'required' => 'Укажите обязательное поле', |
447 | 'min' => [ | 473 | 'min' => [ |
448 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 474 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
449 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 475 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
450 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 476 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
451 | ], | 477 | ], |
452 | 'max' => [ | 478 | 'max' => [ |
453 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 479 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
454 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 480 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
455 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 481 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
456 | ] | 482 | ] |
457 | ]; | 483 | ]; |
458 | 484 | ||
459 | $validator = Validator::make($request->all(), $rules, $messages); | 485 | $validator = Validator::make($request->all(), $rules, $messages); |
460 | 486 | ||
461 | if ($validator->fails()) { | 487 | if ($validator->fails()) { |
462 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) | 488 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) |
463 | ->withErrors($validator); | 489 | ->withErrors($validator); |
464 | } else { | 490 | } else { |
465 | if ($request->has('file')) { | 491 | if ($request->has('file')) { |
466 | $params['file'] = $request->file('file')->store("messages", 'public'); | 492 | $params['file'] = $request->file('file')->store("messages", 'public'); |
467 | } | 493 | } |
468 | Message::create($params); | 494 | Message::create($params); |
469 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); | 495 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); |
470 | 496 | ||
471 | } | 497 | } |
472 | } | 498 | } |
473 | 499 | ||
474 | //Избранные люди | 500 | //Избранные люди |
475 | public function favorites(Request $request) { | 501 | public function favorites(Request $request) { |
476 | $IP_address = RusDate::ip_addr_client(); | 502 | $IP_address = RusDate::ip_addr_client(); |
477 | $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); | 503 | $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); |
478 | 504 | ||
479 | if ($Arr->count()) { | 505 | if ($Arr->count()) { |
480 | $A = Array(); | 506 | $A = Array(); |
481 | foreach ($Arr as $it) { | 507 | foreach ($Arr as $it) { |
482 | $A[] = $it->code_record; | 508 | $A[] = $it->code_record; |
483 | } | 509 | } |
484 | 510 | ||
485 | $Workers = Worker::query()->whereIn('id', $A); | 511 | $Workers = Worker::query()->whereIn('id', $A); |
486 | } else { | 512 | } else { |
487 | $Workers = Worker::query()->where('id', '=', '0'); | 513 | $Workers = Worker::query()->where('id', '=', '0'); |
488 | } | 514 | } |
489 | 515 | ||
490 | if (($request->has('search')) && (!empty($request->get('search')))) { | 516 | if (($request->has('search')) && (!empty($request->get('search')))) { |
491 | $search = $request->get('search'); | 517 | $search = $request->get('search'); |
492 | 518 | ||
493 | $Workers = $Workers->WhereHas('users', | 519 | $Workers = $Workers->WhereHas('users', |
494 | function (Builder $query) use ($search) { | 520 | function (Builder $query) use ($search) { |
495 | $query->Where('surname', 'LIKE', "%$search%") | 521 | $query->Where('surname', 'LIKE', "%$search%") |
496 | ->orWhere('name_man', 'LIKE', "%$search%") | 522 | ->orWhere('name_man', 'LIKE', "%$search%") |
497 | ->orWhere('surname2', 'LIKE', "%$search%"); | 523 | ->orWhere('surname2', 'LIKE', "%$search%"); |
498 | }); | 524 | }); |
499 | } else { | 525 | } else { |
500 | $Workers = $Workers->with('users'); | 526 | $Workers = $Workers->with('users'); |
501 | } | 527 | } |
502 | 528 | ||
503 | $Workers = $Workers->get(); | 529 | $Workers = $Workers->get(); |
504 | return view('employers.favorite', compact('Workers')); | 530 | return view('employers.favorite', compact('Workers')); |
505 | } | 531 | } |
506 | 532 | ||
507 | // База данных | 533 | // База данных |
508 | public function bd(Request $request) { | 534 | public function bd(Request $request) { |
509 | // для типа BelongsTo | 535 | // для типа BelongsTo |
510 | //$documents = Document::query()->orderBy(Location::select('name') | 536 | //$documents = Document::query()->orderBy(Location::select('name') |
511 | // ->whereColumn('locations.id', 'documents.location_id') | 537 | // ->whereColumn('locations.id', 'documents.location_id') |
512 | //); | 538 | //); |
513 | 539 | ||
514 | // для типа HasOne/Many | 540 | // для типа HasOne/Many |
515 | // $documents = Document::::query()->orderBy(Location::select('name') | 541 | // $documents = Document::::query()->orderBy(Location::select('name') |
516 | // ->whereColumn('locations.document_id', 'documents.id') | 542 | // ->whereColumn('locations.document_id', 'documents.id') |
517 | //); | 543 | //); |
518 | 544 | ||
519 | 545 | ||
520 | $users = User_Model::query()->with('workers'); | 546 | $users = User_Model::query()->with('workers'); |
521 | 547 | ||
522 | if ($request->has('search')) { | 548 | if ($request->has('search')) { |
523 | $find_key = $request->get('search'); | 549 | $find_key = $request->get('search'); |
524 | $users = $users->where('name', 'LIKE', "%$find_key%") | 550 | $users = $users->where('name', 'LIKE', "%$find_key%") |
525 | ->orWhere('surname', 'LIKE', "%$find_key%") | 551 | ->orWhere('surname', 'LIKE', "%$find_key%") |
526 | ->orWhere('name_man', 'LIKE', "%$find_key%") | 552 | ->orWhere('name_man', 'LIKE', "%$find_key%") |
527 | ->orWhere('email', 'LIKE', "%$find_key%") | 553 | ->orWhere('email', 'LIKE', "%$find_key%") |
528 | ->orWhere('telephone', 'LIKE', "%$find_key%"); | 554 | ->orWhere('telephone', 'LIKE', "%$find_key%"); |
529 | } | 555 | } |
530 | 556 | ||
531 | // Данные | 557 | // Данные |
532 | $users = $users->Baseuser()-> | 558 | $users = $users->Baseuser()-> |
533 | orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id'))-> | 559 | orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id'))-> |
534 | paginate(5); | 560 | paginate(5); |
535 | 561 | ||
536 | 562 | ||
537 | return view('employers.bd', compact('users')); | 563 | return view('employers.bd', compact('users')); |
538 | } | 564 | } |
539 | 565 | ||
540 | //Настройка уведомлений | 566 | //Настройка уведомлений |
541 | public function subscribe() { | 567 | public function subscribe() { |
542 | return view('employers.subcribe'); | 568 | return view('employers.subcribe'); |
543 | } | 569 | } |
544 | 570 | ||
545 | //Установка уведомлений сохранение | 571 | //Установка уведомлений сохранение |
546 | public function save_subscribe(Request $request) { | 572 | public function save_subscribe(Request $request) { |
547 | dd($request->all()); | 573 | dd($request->all()); |
548 | $msg = $request->validate([ | 574 | $msg = $request->validate([ |
549 | 'subscribe_email' => 'required|email|min:5|max:255', | 575 | 'subscribe_email' => 'required|email|min:5|max:255', |
550 | ]); | 576 | ]); |
551 | return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); | 577 | return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); |
552 | } | 578 | } |
553 | 579 | ||
554 | //Сбросить форму с паролем | 580 | //Сбросить форму с паролем |
555 | public function password_reset() { | 581 | public function password_reset() { |
556 | $email = Auth()->user()->email; | 582 | $email = Auth()->user()->email; |
557 | return view('employers.password-reset', compact('email')); | 583 | return view('employers.password-reset', compact('email')); |
558 | } | 584 | } |
559 | 585 | ||
560 | //Обновление пароля | 586 | //Обновление пароля |
561 | public function new_password(Request $request) { | 587 | public function new_password(Request $request) { |
562 | $use = Auth()->user(); | 588 | $use = Auth()->user(); |
563 | $request->validate([ | 589 | $request->validate([ |
564 | 'password' => 'required|string', | 590 | 'password' => 'required|string', |
565 | 'new_password' => 'required|string', | 591 | 'new_password' => 'required|string', |
566 | 'new_password2' => 'required|string' | 592 | 'new_password2' => 'required|string' |
567 | ]); | 593 | ]); |
568 | 594 | ||
569 | if ($request->get('new_password') == $request->get('new_password2')) | 595 | if ($request->get('new_password') == $request->get('new_password2')) |
570 | if ($request->get('password') !== $request->get('new_password')) { | 596 | if ($request->get('password') !== $request->get('new_password')) { |
571 | $credentials = $request->only('email', 'password'); | 597 | $credentials = $request->only('email', 'password'); |
572 | if (Auth::attempt($credentials)) { | 598 | if (Auth::attempt($credentials)) { |
573 | 599 | ||
574 | if (!is_null($use->email_verified_at)){ | 600 | if (!is_null($use->email_verified_at)){ |
575 | 601 | ||
576 | $user_data = User_Model::find($use->id); | 602 | $user_data = User_Model::find($use->id); |
577 | $user_data->update([ | 603 | $user_data->update([ |
578 | 'password' => Hash::make($request->get('new_password')), | 604 | 'password' => Hash::make($request->get('new_password')), |
579 | 'pubpassword' => base64_encode($request->get('new_password')), | 605 | 'pubpassword' => base64_encode($request->get('new_password')), |
580 | ]); | 606 | ]); |
581 | return redirect() | 607 | return redirect() |
582 | ->route('employer.password_reset') | 608 | ->route('employer.password_reset') |
583 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); | 609 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); |
584 | } | 610 | } |
585 | 611 | ||
586 | return redirect() | 612 | return redirect() |
587 | ->route('employer.password_reset') | 613 | ->route('employer.password_reset') |
588 | ->withError('Данная учетная запись не было верифицированна!'); | 614 | ->withError('Данная учетная запись не было верифицированна!'); |
589 | } | 615 | } |
590 | } | 616 | } |
591 | 617 | ||
592 | return redirect() | 618 | return redirect() |
593 | ->route('employer.password_reset') | 619 | ->route('employer.password_reset') |
594 | ->withErrors('Не совпадение данных, обновите пароли!'); | 620 | ->withErrors('Не совпадение данных, обновите пароли!'); |
595 | } | 621 | } |
596 | 622 | ||
597 | 623 | ||
598 | 624 | ||
599 | // Форма Удаление пипла | 625 | // Форма Удаление пипла |
600 | public function delete_people() { | 626 | public function delete_people() { |
601 | $login = Auth()->user()->email; | 627 | $login = Auth()->user()->email; |
602 | return view('employers.delete_people', compact('login')); | 628 | return view('employers.delete_people', compact('login')); |
603 | } | 629 | } |
604 | 630 | ||
605 | // Удаление аккаунта | 631 | // Удаление аккаунта |
606 | public function action_delete_user(Request $request) { | 632 | public function action_delete_user(Request $request) { |
607 | $Answer = $request->all(); | 633 | $Answer = $request->all(); |
608 | $user_id = Auth()->user()->id; | 634 | $user_id = Auth()->user()->id; |
609 | $request->validate([ | 635 | $request->validate([ |
610 | 'password' => 'required|string', | 636 | 'password' => 'required|string', |
611 | ]); | 637 | ]); |
612 | 638 | ||
613 | $credentials = $request->only('email', 'password'); | 639 | $credentials = $request->only('email', 'password'); |
614 | if (Auth::attempt($credentials)) { | 640 | if (Auth::attempt($credentials)) { |
615 | Auth::logout(); | 641 | Auth::logout(); |
616 | $it = User_Model::find($user_id); | 642 | $it = User_Model::find($user_id); |
617 | $it->delete(); | 643 | $it->delete(); |
618 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); | 644 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); |
619 | } else { | 645 | } else { |
620 | return redirect()->route('employer.delete_people') | 646 | return redirect()->route('employer.delete_people') |
621 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); | 647 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); |
622 | } | 648 | } |
623 | } | 649 | } |
624 | 650 | ||
625 | public function ajax_delete_user(Request $request) { | 651 | public function ajax_delete_user(Request $request) { |
626 | $Answer = $request->all(); | 652 | $Answer = $request->all(); |
627 | $user_id = Auth()->user()->id; | 653 | $user_id = Auth()->user()->id; |
628 | $request->validate([ | 654 | $request->validate([ |
629 | 'password' => 'required|string', | 655 | 'password' => 'required|string', |
630 | ]); | 656 | ]); |
631 | $credentials = $request->only('email', 'password'); | 657 | $credentials = $request->only('email', 'password'); |
632 | if (Auth::attempt($credentials)) { | 658 | if (Auth::attempt($credentials)) { |
633 | 659 | ||
634 | return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', | 660 | return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', |
635 | 'email' => $request->get('email'), | 661 | 'email' => $request->get('email'), |
636 | 'password' => $request->get('password'))); | 662 | 'password' => $request->get('password'))); |
637 | } else { | 663 | } else { |
638 | return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); | 664 | return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); |
639 | } | 665 | } |
640 | } | 666 | } |
641 | 667 | ||
642 | // FAQ - Вопросы/ответы для работодателей и соискателей | 668 | // FAQ - Вопросы/ответы для работодателей и соискателей |
643 | public function faq() { | 669 | public function faq() { |
644 | return view('employers.faq'); | 670 | return view('employers.faq'); |
645 | } | 671 | } |
646 | 672 | ||
647 | // Рассылка сообщений | 673 | // Рассылка сообщений |
648 | public function send_all_messages() { | 674 | public function send_all_messages() { |
649 | return view('employers.send_all'); | 675 | return view('employers.send_all'); |
650 | } | 676 | } |
651 | 677 | ||
652 | // Отправка сообщений для информации | 678 | // Отправка сообщений для информации |
653 | public function send_all_post(Request $request) { | 679 | public function send_all_post(Request $request) { |
654 | $data = $request->all(); | 680 | $data = $request->all(); |
655 | 681 | ||
656 | $emails = User_Model::query()->where('is_worker', '1')->get(); | 682 | $emails = User_Model::query()->where('is_worker', '1')->get(); |
657 | 683 | ||
658 | foreach ($emails as $e) { | 684 | foreach ($emails as $e) { |
659 | Mail::to($e->email)->send(new SendAllMessages($data)); | 685 | Mail::to($e->email)->send(new SendAllMessages($data)); |
660 | } | 686 | } |
661 | 687 | ||
662 | return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); | 688 | return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); |
663 | } | 689 | } |
664 | 690 | ||
665 | // База резюме | 691 | // База резюме |
666 | public function bd_tupe(Request $request) { | 692 | public function bd_tupe(Request $request) { |
667 | $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); | 693 | $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); |
668 | 694 | ||
669 | return view('employers.bd_tupe', compact('Resume')); | 695 | return view('employers.bd_tupe', compact('Resume')); |
670 | } | 696 | } |
671 | 697 | ||
672 | ////////////////////////////////////////////////////////////////// | 698 | ////////////////////////////////////////////////////////////////// |
673 | // Отправил сообщение | 699 | // Отправил сообщение |
674 | ////////////////////////////////////////////////////////////////// | 700 | ////////////////////////////////////////////////////////////////// |
675 | public function new_message(Request $request) { | 701 | public function new_message(Request $request) { |
676 | $params = $request->all(); | 702 | $params = $request->all(); |
677 | $id = $params['_user_id']; | 703 | $id = $params['_user_id']; |
678 | $message = new Message(); | 704 | $message = new Message(); |
679 | $message->user_id = $params['_user_id']; | 705 | $message->user_id = $params['_user_id']; |
680 | $message->to_user_id = $params['_to_user_id']; | 706 | $message->to_user_id = $params['_to_user_id']; |
681 | $message->title = $params['title']; | 707 | $message->title = $params['title']; |
682 | $message->text = $params['text']; | 708 | $message->text = $params['text']; |
683 | if ($request->has('_file')) { | 709 | if ($request->has('_file')) { |
684 | $message->file = $request->file('_file')->store("worker/$id", 'public'); | 710 | $message->file = $request->file('_file')->store("worker/$id", 'public'); |
685 | } | 711 | } |
686 | $message->flag_new = 1; | 712 | $message->flag_new = 1; |
687 | $id_message = $message->save(); | 713 | $id_message = $message->save(); |
688 | 714 | ||
689 | $data['message_id'] = $id_message; | 715 | $data['message_id'] = $id_message; |
690 | $data['ad_employer_id'] = $params['_vacancy']; | 716 | $data['ad_employer_id'] = $params['_vacancy']; |
691 | $data['job_title_id'] = 0; | 717 | $data['job_title_id'] = 0; |
692 | 718 | ||
693 | $data['flag'] = 1; | 719 | $data['flag'] = 1; |
694 | $ad_responce = ad_response::create($data); | 720 | $ad_responce = ad_response::create($data); |
695 | return redirect()->route('employer.messages', ['type_message' => 'output']); | 721 | return redirect()->route('employer.messages', ['type_message' => 'output']); |
696 | } | 722 | } |
697 | 723 | ||
698 | // Восстановление пароля | 724 | // Восстановление пароля |
699 | public function repair_password(Request $request) { | 725 | public function repair_password(Request $request) { |
700 | $params = $request->get('email'); | 726 | $params = $request->get('email'); |
701 | } | 727 | } |
702 | 728 | ||
703 | // Избранные люди на корабль | 729 | // Избранные люди на корабль |
704 | public function selected_people(Request $request) { | 730 | public function selected_people(Request $request) { |
705 | $id = $request->get('id'); | 731 | $id = $request->get('id'); |
706 | $favorite_people = Job_title::query()->Notbdif()->where('position_id', $id)->get(); | 732 | $favorite_people = Job_title::query()->Notbdif()->where('position_id', $id)->get(); |
707 | return view('favorite_people', compact('favorite_people')); | 733 | return view('favorite_people', compact('favorite_people')); |
app/Http/Controllers/WorkerController.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Http\Controllers; | 3 | namespace App\Http\Controllers; |
4 | 4 | ||
5 | use App\Classes\RusDate; | 5 | use App\Classes\RusDate; |
6 | use App\Http\Requests\DocumentsRequest; | 6 | use App\Http\Requests\DocumentsRequest; |
7 | use App\Http\Requests\PrevCompanyRequest; | 7 | use App\Http\Requests\PrevCompanyRequest; |
8 | use App\Http\Requests\SertificationRequest; | 8 | use App\Http\Requests\SertificationRequest; |
9 | use App\Models\Ad_employer; | 9 | use App\Models\Ad_employer; |
10 | use App\Models\ad_response; | 10 | use App\Models\ad_response; |
11 | use App\Models\Category; | 11 | use App\Models\Category; |
12 | use App\Models\Dop_info; | 12 | use App\Models\Dop_info; |
13 | use App\Models\Employer; | 13 | use App\Models\Employer; |
14 | use App\Models\infobloks; | 14 | use App\Models\infobloks; |
15 | use App\Models\Job_title; | 15 | use App\Models\Job_title; |
16 | use App\Models\Like_vacancy; | 16 | use App\Models\Like_vacancy; |
17 | use App\Models\Like_worker; | 17 | use App\Models\Like_worker; |
18 | use App\Models\Message; | 18 | use App\Models\Message; |
19 | use App\Models\place_works; | 19 | use App\Models\place_works; |
20 | use App\Models\PrevCompany; | 20 | use App\Models\PrevCompany; |
21 | use App\Models\reclame; | 21 | use App\Models\reclame; |
22 | use App\Models\ResponseWork; | 22 | use App\Models\ResponseWork; |
23 | use App\Models\sertification; | 23 | use App\Models\sertification; |
24 | use App\Models\Static_worker; | 24 | use App\Models\Static_worker; |
25 | use App\Models\Title_worker; | ||
25 | use App\Models\User; | 26 | use App\Models\User; |
26 | use App\Models\User as User_Model; | 27 | use App\Models\User as User_Model; |
27 | use App\Models\Worker; | 28 | use App\Models\Worker; |
28 | use Barryvdh\DomPDF\Facade\Pdf; | 29 | use Barryvdh\DomPDF\Facade\Pdf; |
29 | use Carbon\Carbon; | 30 | use Carbon\Carbon; |
30 | use Illuminate\Auth\Events\Registered; | 31 | use Illuminate\Auth\Events\Registered; |
31 | use Illuminate\Database\Eloquent\Builder; | 32 | use Illuminate\Database\Eloquent\Builder; |
32 | use Illuminate\Database\Eloquent\Model; | 33 | use Illuminate\Database\Eloquent\Model; |
33 | use Illuminate\Http\JsonResponse; | 34 | use Illuminate\Http\JsonResponse; |
34 | use Illuminate\Http\Request; | 35 | use Illuminate\Http\Request; |
35 | use Illuminate\Support\Facades\Auth; | 36 | use Illuminate\Support\Facades\Auth; |
36 | use Illuminate\Support\Facades\Hash; | 37 | use Illuminate\Support\Facades\Hash; |
37 | use Illuminate\Support\Facades\Storage; | 38 | use Illuminate\Support\Facades\Storage; |
38 | use Illuminate\Support\Facades\Validator; | 39 | use Illuminate\Support\Facades\Validator; |
39 | 40 | ||
40 | class WorkerController extends Controller | 41 | class WorkerController extends Controller |
41 | { | 42 | { |
42 | public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу'); | 43 | public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу'); |
43 | 44 | ||
44 | //профиль | 45 | //профиль |
45 | public function profile(Worker $worker) | 46 | public function profile(Worker $worker) |
46 | { | 47 | { |
47 | $get_date = date('Y.m'); | 48 | $get_date = date('Y.m'); |
48 | 49 | ||
49 | $c = Static_worker::query()->where('year_month', '=', $get_date) | 50 | $c = Static_worker::query()->where('year_month', '=', $get_date) |
50 | ->where('user_id', '=', $worker->users->id) | 51 | ->where('user_id', '=', $worker->users->id) |
51 | ->get(); | 52 | ->get(); |
52 | 53 | ||
53 | if ($c->count() > 0) { | 54 | if ($c->count() > 0) { |
54 | $upd = Static_worker::find($c[0]->id); | 55 | $upd = Static_worker::find($c[0]->id); |
55 | $upd->lookin = $upd->lookin + 1; | 56 | $upd->lookin = $upd->lookin + 1; |
56 | $upd->save(); | 57 | $upd->save(); |
57 | } else { | 58 | } else { |
58 | $crt = new Static_worker(); | 59 | $crt = new Static_worker(); |
59 | $crt->lookin = 1; | 60 | $crt->lookin = 1; |
60 | $crt->year_month = $get_date; | 61 | $crt->year_month = $get_date; |
61 | $crt->user_id = $worker->user_id; | 62 | $crt->user_id = $worker->user_id; |
62 | $crt->save(); | 63 | $crt->save(); |
63 | } | 64 | } |
64 | 65 | ||
65 | $stat = Static_worker::query()->where('year_month', '=', $get_date) | 66 | $stat = Static_worker::query()->where('year_month', '=', $get_date) |
66 | ->where('user_id', '=', $worker->users->id) | 67 | ->where('user_id', '=', $worker->users->id) |
67 | ->get(); | 68 | ->get(); |
68 | 69 | ||
69 | return view('public.workers.profile', compact('worker', 'stat')); | 70 | return view('public.workers.profile', compact('worker', 'stat')); |
70 | } | 71 | } |
71 | 72 | ||
72 | // лист база резюме | 73 | // лист база резюме |
73 | public function bd_resume(Request $request) | 74 | public function bd_resume(Request $request) |
74 | { | 75 | { |
75 | if (isset(Auth()->user()->id)) { | 76 | if (isset(Auth()->user()->id)) { |
76 | $idiot = Auth()->user()->id; | 77 | $idiot = Auth()->user()->id; |
77 | } else { | 78 | } else { |
78 | $idiot = 0; | 79 | $idiot = 0; |
79 | } | 80 | } |
80 | 81 | ||
81 | $status_work = $this->status_work; | 82 | $status_work = $this->status_work; |
82 | $resumes = Worker::query()->with('users')->with('job_titles'); | 83 | $resumes = Worker::query()->with('users')->with('job_titles'); |
83 | $resumes = $resumes->whereHas('users', function (Builder $query) { | 84 | $resumes = $resumes->whereHas('users', function (Builder $query) { |
84 | $query->Where('is_worker', '=', '1') | 85 | $query->Where('is_worker', '=', '1') |
85 | ->Where('is_bd', '=', '0'); | 86 | ->Where('is_bd', '=', '0'); |
86 | }); | 87 | }); |
87 | 88 | ||
88 | //dd($request->get('job')); | 89 | //dd($request->get('job')); |
89 | if (($request->has('job')) && ($request->get('job') > 0)) { | 90 | if (($request->has('job')) && ($request->get('job') > 0)) { |
90 | $resumes = $resumes->whereHas('job_titles', function(Builder $query) use ($request) { | 91 | $resumes = $resumes->whereHas('job_titles', function(Builder $query) use ($request) { |
91 | $query->Where('job_titles.id', $request->get('job')); | 92 | $query->Where('job_titles.id', $request->get('job')); |
92 | }); | 93 | }); |
93 | } | 94 | } |
94 | 95 | ||
95 | $Job_title = Job_title::query()->get(); | 96 | $Job_title = Job_title::query()->get(); |
96 | 97 | ||
97 | if ($request->get('sort')) { | 98 | if ($request->get('sort')) { |
98 | $sort = $request->get('sort'); | 99 | $sort = $request->get('sort'); |
99 | switch ($sort) { | 100 | switch ($sort) { |
100 | case 'name_up': | 101 | case 'name_up': |
101 | $resumes = $resumes->orderBy(User::select('surname') | 102 | $resumes = $resumes->orderBy(User::select('surname') |
102 | ->whereColumn('Workers.user_id', 'users.id') | 103 | ->whereColumn('Workers.user_id', 'users.id') |
103 | ); | 104 | ); |
104 | break; | 105 | break; |
105 | case 'name_down': | 106 | case 'name_down': |
106 | $resumes = $resumes->orderByDesc(User::select('surname') | 107 | $resumes = $resumes->orderByDesc(User::select('surname') |
107 | ->whereColumn('Workers.user_id', 'users.id') | 108 | ->whereColumn('Workers.user_id', 'users.id') |
108 | ); | 109 | ); |
109 | break; | 110 | break; |
110 | case 'created_at_up': $resumes = $resumes->OrderBy('created_at')->orderBy('id'); break; | 111 | case 'created_at_up': $resumes = $resumes->OrderBy('created_at')->orderBy('id'); break; |
111 | case 'created_at_down': $resumes = $resumes->orderByDesc('created_at')->orderBy('id'); break; | 112 | case 'created_at_down': $resumes = $resumes->orderByDesc('created_at')->orderBy('id'); break; |
112 | case 'default': $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; | 113 | case 'default': $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; |
113 | default: $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; | 114 | default: $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; |
114 | } | 115 | } |
115 | } | 116 | } |
116 | 117 | ||
117 | $res_count = $resumes->count(); | 118 | $res_count = $resumes->count(); |
118 | //$resumes = $resumes->get(); | 119 | //$resumes = $resumes->get(); |
119 | 120 | ||
120 | $resumes = $resumes->paginate(4); | 121 | $resumes = $resumes->paginate(4); |
121 | if ($request->ajax()) { | 122 | if ($request->ajax()) { |
122 | // Условия обставлены | 123 | // Условия обставлены |
123 | if ($request->has('block') && ($request->get('block') == 1)) { | 124 | if ($request->has('block') && ($request->get('block') == 1)) { |
124 | return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot')); | 125 | return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot')); |
125 | } | 126 | } |
126 | 127 | ||
127 | if ($request->has('block') && ($request->get('block') == 2)) { | 128 | if ($request->has('block') && ($request->get('block') == 2)) { |
128 | return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot')); | 129 | return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot')); |
129 | } | 130 | } |
130 | } else { | 131 | } else { |
131 | return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot', 'Job_title')); | 132 | return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot', 'Job_title')); |
132 | } | 133 | } |
133 | } | 134 | } |
134 | 135 | ||
135 | //Лайк резюме | 136 | //Лайк резюме |
136 | public function like_controller() { | 137 | public function like_controller() { |
137 | 138 | ||
138 | } | 139 | } |
139 | 140 | ||
140 | // анкета соискателя | 141 | // анкета соискателя |
141 | public function resume_profile(Worker $worker) | 142 | public function resume_profile(Worker $worker) |
142 | { | 143 | { |
143 | if (isset(Auth()->user()->id)) { | 144 | if (isset(Auth()->user()->id)) { |
144 | $idiot = Auth()->user()->id; | 145 | $idiot = Auth()->user()->id; |
145 | } else { | 146 | } else { |
146 | $idiot = 0; | 147 | $idiot = 0; |
147 | } | 148 | } |
148 | 149 | ||
149 | $status_work = $this->status_work; | 150 | $status_work = $this->status_work; |
150 | $Query = Worker::query()->with('users')->with('job_titles') | 151 | $Query = Worker::query()->with('users')->with('job_titles') |
151 | ->with('place_worker')->with('sertificate')->with('prev_company') | 152 | ->with('place_worker')->with('sertificate')->with('prev_company') |
152 | ->with('infobloks'); | 153 | ->with('infobloks'); |
153 | $Query = $Query->where('id', '=', $worker->id); | 154 | $Query = $Query->where('id', '=', $worker->id); |
154 | $Query = $Query->get(); | 155 | $Query = $Query->get(); |
155 | 156 | ||
156 | $get_date = date('Y.m'); | 157 | $get_date = date('Y.m'); |
157 | $c = Static_worker::query()->where('year_month', '=', $get_date) | 158 | $c = Static_worker::query()->where('year_month', '=', $get_date) |
158 | ->where('user_id', '=', $worker->id) | 159 | ->where('user_id', '=', $worker->id) |
159 | ->get(); | 160 | ->get(); |
160 | 161 | ||
161 | if ($c->count() > 0) { | 162 | if ($c->count() > 0) { |
162 | $upd = Static_worker::find($c[0]->id); | 163 | $upd = Static_worker::find($c[0]->id); |
163 | $upd->lookin = $upd->lookin + 1; | 164 | $upd->lookin = $upd->lookin + 1; |
164 | $upd->save(); | 165 | $upd->save(); |
165 | } else { | 166 | } else { |
166 | $crt = new Static_worker(); | 167 | $crt = new Static_worker(); |
167 | $crt->lookin = 1; | 168 | $crt->lookin = 1; |
168 | $crt->year_month = $get_date; | 169 | $crt->year_month = $get_date; |
169 | $crt->user_id = $worker->user_id; | 170 | $crt->user_id = $worker->user_id; |
170 | $crt->save(); | 171 | $crt->save(); |
171 | } | 172 | } |
172 | $stat = Static_worker::query()->where('year_month', '=', $get_date) | 173 | $stat = Static_worker::query()->where('year_month', '=', $get_date) |
173 | ->where('user_id', '=', $worker->id) | 174 | ->where('user_id', '=', $worker->id) |
174 | ->get(); | 175 | ->get(); |
175 | return view('worker', compact('Query', 'status_work', 'idiot')); | 176 | return view('worker', compact('Query', 'status_work', 'idiot')); |
176 | } | 177 | } |
177 | 178 | ||
178 | // скачать анкету соискателя | 179 | // скачать анкету соискателя |
179 | public function resume_download(Worker $worker) | 180 | public function resume_download(Worker $worker) |
180 | { | 181 | { |
181 | $status_work = $this->status_work; | 182 | $status_work = $this->status_work; |
182 | $Query = Worker::query()->with('users')->with('job_titles') | 183 | $Query = Worker::query()->with('users')->with('job_titles') |
183 | ->with('place_worker')->with('sertificate')->with('prev_company') | 184 | ->with('place_worker')->with('sertificate')->with('prev_company') |
184 | ->with('infobloks'); | 185 | ->with('infobloks'); |
185 | $Query = $Query->where('id', '=', $worker->id); | 186 | $Query = $Query->where('id', '=', $worker->id); |
186 | $Query = $Query->get()->toArray(); | 187 | $Query = $Query->get()->toArray(); |
187 | 188 | ||
188 | view()->share('Query',$Query); | 189 | view()->share('Query',$Query); |
189 | 190 | ||
190 | $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape'); | 191 | $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape'); |
191 | 192 | ||
192 | return $pdf->stream(); | 193 | return $pdf->stream(); |
193 | } | 194 | } |
194 | 195 | ||
195 | public function resume_download_all() { | 196 | public function resume_download_all() { |
196 | $status_work = $this->status_work; | 197 | $status_work = $this->status_work; |
197 | $Query = Worker::query()->with('users')->with('job_titles') | 198 | $Query = Worker::query()->with('users')->with('job_titles') |
198 | ->with('place_worker')->with('sertificate')->with('prev_company') | 199 | ->with('place_worker')->with('sertificate')->with('prev_company') |
199 | ->with('infobloks'); | 200 | ->with('infobloks'); |
200 | //$Query = $Query->where('id', '=', $worker->id); | 201 | //$Query = $Query->where('id', '=', $worker->id); |
201 | $Query = $Query->get()->toArray(); | 202 | $Query = $Query->get()->toArray(); |
202 | 203 | ||
203 | view()->share('Query',$Query); | 204 | view()->share('Query',$Query); |
204 | 205 | ||
205 | $pdf = PDF::loadView('layout.pdf-list-people', $Query); //->setPaper('a4', 'landscape'); | 206 | $pdf = PDF::loadView('layout.pdf-list-people', $Query); //->setPaper('a4', 'landscape'); |
206 | 207 | ||
207 | return $pdf->stream(); | 208 | return $pdf->stream(); |
208 | } | 209 | } |
209 | 210 | ||
210 | // Кабинет работника | 211 | // Кабинет работника |
211 | public function cabinet(Request $request) | 212 | public function cabinet(Request $request) |
212 | { | 213 | { |
213 | // дата год и месяц | 214 | // дата год и месяц |
214 | $get_date = date('Y.m'); | 215 | $get_date = date('Y.m'); |
215 | 216 | ||
216 | $id = Auth()->user()->id; | 217 | $id = Auth()->user()->id; |
217 | 218 | ||
218 | $Infobloks = infobloks::query()->get(); | 219 | $Infobloks = infobloks::query()->get(); |
219 | 220 | ||
220 | $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')-> | 221 | $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')-> |
221 | with('infobloks')->with('place_worker')-> | 222 | with('infobloks')->with('place_worker')-> |
222 | WhereHas('users', | 223 | WhereHas('users', |
223 | function (Builder $query) use ($id) {$query->Where('id', $id); | 224 | function (Builder $query) use ($id) {$query->Where('id', $id); |
224 | })->get(); | 225 | })->get(); |
225 | 226 | ||
226 | $Job_titles = Job_title::query()->OrderBy('name')->get(); | 227 | $Job_titles = Job_title::query()->OrderBy('name')->get(); |
227 | $Infoblocks = infobloks::query()->OrderBy('name')->get(); | 228 | $Infoblocks = infobloks::query()->OrderBy('name')->get(); |
228 | 229 | ||
229 | $stat = Static_worker::query()->where('year_month', '=', $get_date) | 230 | $stat = Static_worker::query()->where('year_month', '=', $get_date) |
230 | ->where('user_id', '=', $Worker[0]->id) | 231 | ->where('user_id', '=', $Worker[0]->id) |
231 | ->get(); | 232 | ->get(); |
232 | 233 | ||
233 | // 10% | 234 | // 10% |
234 | 235 | ||
235 | $persent = 10; | 236 | $persent = 10; |
236 | $persent1 = 0; | 237 | $persent1 = 0; |
237 | $persent2 = 0; | 238 | $persent2 = 0; |
238 | $persent3 = 0; | 239 | $persent3 = 0; |
239 | $persent4 = 0; | 240 | $persent4 = 0; |
240 | $persent5 = 0; | 241 | $persent5 = 0; |
241 | 242 | ||
242 | if ((!empty($Worker[0]->telephone)) && | 243 | if ((!empty($Worker[0]->telephone)) && |
243 | (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) && | 244 | (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) && |
244 | (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) { | 245 | (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) { |
245 | // 40% | 246 | // 40% |
246 | $persent = $persent + 40; | 247 | $persent = $persent + 40; |
247 | $persent1 = 40; | 248 | $persent1 = 40; |
248 | } | 249 | } |
249 | 250 | ||
250 | //dd($Worker[0]->status_work, $Worker[0]->telephone, $Worker[0]->email, $Worker[0]->experience, $Worker[0]->city, $Worker[0]->old_year); | 251 | //dd($Worker[0]->status_work, $Worker[0]->telephone, $Worker[0]->email, $Worker[0]->experience, $Worker[0]->city, $Worker[0]->old_year); |
251 | 252 | ||
252 | if ($Worker[0]->sertificate->count() > 0) { | 253 | if ($Worker[0]->sertificate->count() > 0) { |
253 | // 15% | 254 | // 15% |
254 | $persent = $persent + 15; | 255 | $persent = $persent + 15; |
255 | $persent2 = 15; | 256 | $persent2 = 15; |
256 | } | 257 | } |
257 | 258 | ||
258 | if ($Worker[0]->infobloks->count() > 0) { | 259 | if ($Worker[0]->infobloks->count() > 0) { |
259 | // 20% | 260 | // 20% |
260 | $persent = $persent + 20; | 261 | $persent = $persent + 20; |
261 | $persent3 = 20; | 262 | $persent3 = 20; |
262 | } | 263 | } |
263 | 264 | ||
264 | if ($Worker[0]->prev_company->count() > 0) { | 265 | if ($Worker[0]->prev_company->count() > 0) { |
265 | // 10% | 266 | // 10% |
266 | $persent = $persent + 10; | 267 | $persent = $persent + 10; |
267 | $persent4 = 10; | 268 | $persent4 = 10; |
268 | } | 269 | } |
269 | 270 | ||
270 | if (!empty($Worker[0]->photo)) { | 271 | if (!empty($Worker[0]->photo)) { |
271 | // 5% | 272 | // 5% |
272 | $persent = $persent + 5; | 273 | $persent = $persent + 5; |
273 | $persent5 = 5; | 274 | $persent5 = 5; |
274 | } | 275 | } |
275 | 276 | ||
276 | //dd($persent1, $persent2, $persent3, $persent4, $persent5); | 277 | //dd($persent1, $persent2, $persent3, $persent4, $persent5); |
277 | 278 | ||
278 | if ($request->has('print')) { | 279 | if ($request->has('print')) { |
279 | dd($Worker); | 280 | dd($Worker); |
280 | } else { | 281 | } else { |
281 | return view('workers.cabinet', compact('Worker', 'Infobloks', 'persent', 'Job_titles', 'Infoblocks', 'stat')); | 282 | return view('workers.cabinet', compact('Worker', 'Infobloks', 'persent', 'Job_titles', 'Infoblocks', 'stat')); |
282 | } | 283 | } |
283 | } | 284 | } |
284 | 285 | ||
285 | // Сохранение данных | 286 | // Сохранение данных |
286 | public function cabinet_save(Worker $worker, Request $request) | 287 | public function cabinet_save(Worker $worker, Request $request) |
287 | { | 288 | { |
288 | $id = $worker->id; | 289 | $id = $worker->id; |
289 | $params = $request->all(); | 290 | $params = $request->all(); |
290 | 291 | ||
291 | $job_title_id = $request->get('job_title_id'); | 292 | $job_title_id = $request->get('job_title_id'); |
292 | 293 | ||
293 | unset($params['new_diplom']); | 294 | unset($params['new_diplom']); |
294 | unset($params['new_data_begin']); | 295 | unset($params['new_data_begin']); |
295 | unset($params['new_data_end']); | 296 | unset($params['new_data_end']); |
296 | unset($params['new_job_title']); | 297 | unset($params['new_job_title']); |
297 | unset($params['new_teplohod']); | 298 | unset($params['new_teplohod']); |
298 | unset($params['new_GWT']); | 299 | unset($params['new_GWT']); |
299 | unset($params['new_KBT']); | 300 | unset($params['new_KBT']); |
300 | unset($params['new_Begin_work']); | 301 | unset($params['new_Begin_work']); |
301 | unset($params['new_End_work']); | 302 | unset($params['new_End_work']); |
302 | unset($params['new_name_company']); | 303 | unset($params['new_name_company']); |
303 | 304 | ||
304 | $rules = [ | 305 | $rules = [ |
305 | 'surname' => ['required', 'string', 'max:255'], | 306 | 'surname' => ['required', 'string', 'max:255'], |
306 | 'name_man' => ['required', 'string', 'max:255'], | 307 | 'name_man' => ['required', 'string', 'max:255'], |
307 | 'email' => ['required', 'string', 'email', 'max:255'], | 308 | 'email' => ['required', 'string', 'email', 'max:255'], |
308 | 309 | ||
309 | ]; | 310 | ]; |
310 | 311 | ||
311 | $messages = [ | 312 | $messages = [ |
312 | 'required' => 'Укажите обязательное поле', | 313 | 'required' => 'Укажите обязательное поле', |
313 | 'min' => [ | 314 | 'min' => [ |
314 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 315 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
315 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 316 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
316 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 317 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
317 | ], | 318 | ], |
318 | 'max' => [ | 319 | 'max' => [ |
319 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 320 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
320 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 321 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
321 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 322 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
322 | ] | 323 | ] |
323 | ]; | 324 | ]; |
324 | 325 | ||
325 | $validator = Validator::make($params, $rules, $messages); | 326 | $validator = Validator::make($params, $rules, $messages); |
326 | 327 | ||
327 | if ($validator->fails()) { | 328 | if ($validator->fails()) { |
328 | return redirect()->route('worker.cabinet')->withErrors($validator); | 329 | return redirect()->route('worker.cabinet')->withErrors($validator); |
329 | } else { | 330 | } else { |
330 | 331 | ||
331 | if ($request->has('photo')) { | 332 | if ($request->has('photo')) { |
332 | if (!empty($Worker->photo)) { | 333 | if (!empty($Worker->photo)) { |
333 | Storage::delete($Worker->photo); | 334 | Storage::delete($Worker->photo); |
334 | } | 335 | } |
335 | $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); | 336 | $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); |
336 | } | 337 | } |
337 | 338 | ||
338 | if ($request->has('file')) { | 339 | if ($request->has('file')) { |
339 | if (!empty($Worker->file)) { | 340 | if (!empty($Worker->file)) { |
340 | Storage::delete($Worker->file); | 341 | Storage::delete($Worker->file); |
341 | } | 342 | } |
342 | $params['file'] = $request->file('file')->store("worker/$id", 'public'); | 343 | $params['file'] = $request->file('file')->store("worker/$id", 'public'); |
343 | } | 344 | } |
344 | 345 | ||
345 | $id_wor = $worker->update($params); | 346 | $id_wor = $worker->update($params); |
346 | 347 | ||
347 | $use = User_Model::find($id_wor); | 348 | $use = User_Model::find($id_wor); |
348 | $use->surname = $request->get('surname'); | 349 | $use->surname = $request->get('surname'); |
349 | $use->name_man = $request->get('name_man'); | 350 | $use->name_man = $request->get('name_man'); |
350 | $use->surname2 = $request->get('surname2'); | 351 | $use->surname2 = $request->get('surname2'); |
351 | 352 | ||
352 | $use->save(); | 353 | $use->save(); |
353 | $worker->job_titles()->sync($job_title_id); | 354 | $worker->job_titles()->sync($job_title_id); |
354 | 355 | ||
355 | return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); | 356 | return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); |
356 | } | 357 | } |
357 | } | 358 | } |
358 | 359 | ||
359 | // Сообщения данные | 360 | // Сообщения данные |
360 | public function messages($type_message) | 361 | public function messages($type_message) |
361 | { | 362 | { |
362 | $user_id = Auth()->user()->id; | 363 | $user_id = Auth()->user()->id; |
363 | 364 | ||
364 | $messages_input = Message::query()->with('vacancies')->with('user_from')-> | 365 | $messages_input = Message::query()->with('vacancies')->with('user_from')-> |
365 | Where('to_user_id', $user_id)->OrderByDesc('created_at'); | 366 | Where('to_user_id', $user_id)->OrderByDesc('created_at'); |
366 | 367 | ||
367 | $messages_output = Message::query()->with('vacancies')-> | 368 | $messages_output = Message::query()->with('vacancies')-> |
368 | with('user_to')->where('user_id', $user_id)-> | 369 | with('user_to')->where('user_id', $user_id)-> |
369 | OrderByDesc('created_at'); | 370 | OrderByDesc('created_at'); |
370 | 371 | ||
371 | 372 | ||
372 | $count_input = $messages_input->count(); | 373 | $count_input = $messages_input->count(); |
373 | $count_output = $messages_output->count(); | 374 | $count_output = $messages_output->count(); |
374 | 375 | ||
375 | if ($type_message == 'input') { | 376 | if ($type_message == 'input') { |
376 | $messages = $messages_input->paginate(15); | 377 | $messages = $messages_input->paginate(15); |
377 | } | 378 | } |
378 | 379 | ||
379 | if ($type_message == 'output') { | 380 | if ($type_message == 'output') { |
380 | $messages = $messages_output->paginate(15); | 381 | $messages = $messages_output->paginate(15); |
381 | } | 382 | } |
382 | // Вернуть все 100% | 383 | // Вернуть все 100% |
383 | return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); | 384 | return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); |
384 | } | 385 | } |
385 | 386 | ||
386 | // Избранный | 387 | // Избранный |
387 | public function favorite() | 388 | public function favorite() |
388 | { | 389 | { |
389 | return view('workers.favorite'); | 390 | return view('workers.favorite'); |
390 | } | 391 | } |
391 | 392 | ||
392 | // Сменить пароль | 393 | // Сменить пароль |
393 | public function new_password() | 394 | public function new_password() |
394 | { | 395 | { |
395 | $email = Auth()->user()->email; | 396 | $email = Auth()->user()->email; |
396 | return view('workers.new_password', compact('email')); | 397 | return view('workers.new_password', compact('email')); |
397 | } | 398 | } |
398 | 399 | ||
399 | // Обновление пароля | 400 | // Обновление пароля |
400 | public function save_new_password(Request $request) { | 401 | public function save_new_password(Request $request) { |
401 | $use = Auth()->user(); | 402 | $use = Auth()->user(); |
402 | $request->validate([ | 403 | $request->validate([ |
403 | 'password' => 'required|string', | 404 | 'password' => 'required|string', |
404 | 'new_password' => 'required|string', | 405 | 'new_password' => 'required|string', |
405 | 'new_password2' => 'required|string' | 406 | 'new_password2' => 'required|string' |
406 | ]); | 407 | ]); |
407 | 408 | ||
408 | if ($request->get('new_password') == $request->get('new_password2')) | 409 | if ($request->get('new_password') == $request->get('new_password2')) |
409 | if ($request->get('password') !== $request->get('new_password')) { | 410 | if ($request->get('password') !== $request->get('new_password')) { |
410 | $credentials = $request->only('email', 'password'); | 411 | $credentials = $request->only('email', 'password'); |
411 | if (Auth::attempt($credentials, $request->has('save_me'))) { | 412 | if (Auth::attempt($credentials, $request->has('save_me'))) { |
412 | 413 | ||
413 | if (!is_null($use->email_verified_at)){ | 414 | if (!is_null($use->email_verified_at)){ |
414 | 415 | ||
415 | $user_data = User_Model::find($use->id); | 416 | $user_data = User_Model::find($use->id); |
416 | $user_data->update([ | 417 | $user_data->update([ |
417 | 'password' => Hash::make($request->get('new_password')), | 418 | 'password' => Hash::make($request->get('new_password')), |
418 | 'pubpassword' => base64_encode($request->get('new_password')), | 419 | 'pubpassword' => base64_encode($request->get('new_password')), |
419 | ]); | 420 | ]); |
420 | return redirect() | 421 | return redirect() |
421 | ->route('worker.new_password') | 422 | ->route('worker.new_password') |
422 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); | 423 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); |
423 | } | 424 | } |
424 | 425 | ||
425 | return redirect() | 426 | return redirect() |
426 | ->route('worker.new_password') | 427 | ->route('worker.new_password') |
427 | ->withError('Данная учетная запись не было верифицированна!'); | 428 | ->withError('Данная учетная запись не было верифицированна!'); |
428 | } | 429 | } |
429 | } | 430 | } |
430 | 431 | ||
431 | return redirect() | 432 | return redirect() |
432 | ->route('worker.new_password') | 433 | ->route('worker.new_password') |
433 | ->withErrors('Не совпадение данных, обновите пароли!'); | 434 | ->withErrors('Не совпадение данных, обновите пароли!'); |
434 | } | 435 | } |
435 | 436 | ||
436 | // Удаление профиля форма | 437 | // Удаление профиля форма |
437 | public function delete_profile() | 438 | public function delete_profile() |
438 | { | 439 | { |
439 | $login = Auth()->user()->email; | 440 | $login = Auth()->user()->email; |
440 | return view('workers.delete_profile', compact('login')); | 441 | return view('workers.delete_profile', compact('login')); |
441 | } | 442 | } |
442 | 443 | ||
443 | // Удаление профиля код | 444 | // Удаление профиля код |
444 | public function delete_profile_result(Request $request) { | 445 | public function delete_profile_result(Request $request) { |
445 | $Answer = $request->all(); | 446 | $Answer = $request->all(); |
446 | $user_id = Auth()->user()->id; | 447 | $user_id = Auth()->user()->id; |
447 | $request->validate([ | 448 | $request->validate([ |
448 | 'password' => 'required|string', | 449 | 'password' => 'required|string', |
449 | ]); | 450 | ]); |
450 | 451 | ||
451 | $credentials = $request->only('email', 'password'); | 452 | $credentials = $request->only('email', 'password'); |
452 | if (Auth::attempt($credentials)) { | 453 | if (Auth::attempt($credentials)) { |
453 | Auth::logout(); | 454 | Auth::logout(); |
454 | $it = User_Model::find($user_id); | 455 | $it = User_Model::find($user_id); |
455 | $it->delete(); | 456 | $it->delete(); |
456 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); | 457 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); |
457 | } else { | 458 | } else { |
458 | return redirect()->route('worker.delete_profile') | 459 | return redirect()->route('worker.delete_profile') |
459 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); | 460 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); |
460 | } | 461 | } |
461 | } | 462 | } |
462 | 463 | ||
463 | // Регистрация соискателя | 464 | // Регистрация соискателя |
464 | public function register_worker(Request $request) | 465 | public function register_worker(Request $request) |
465 | { | 466 | { |
466 | $params = $request->all(); | 467 | $params = $request->all(); |
467 | $params['is_worker'] = 1; | 468 | $params['is_worker'] = 1; |
468 | 469 | ||
469 | $rules = [ | 470 | $rules = [ |
470 | 'surname' => ['required', 'string', 'max:255'], | 471 | 'surname' => ['required', 'string', 'max:255'], |
471 | 'name_man' => ['required', 'string', 'max:255'], | 472 | 'name_man' => ['required', 'string', 'max:255'], |
472 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], | 473 | 'email' => ['required', 'email', 'max:255', 'unique:users'], |
473 | 'password' => ['required', 'string', 'min:8'] | 474 | 'password' => ['required', 'string', 'min:8'] |
474 | ]; | 475 | ]; |
475 | 476 | ||
476 | $messages = [ | 477 | $messages = [ |
477 | 'required' => 'Укажите обязательное поле', | 478 | 'required' => 'Укажите обязательное поле', |
478 | 'min' => [ | 479 | 'min' => [ |
479 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 480 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
480 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 481 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
481 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 482 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
482 | ], | 483 | ], |
483 | 'max' => [ | 484 | 'max' => [ |
484 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 485 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
485 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 486 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
486 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 487 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
487 | ] | 488 | ] |
488 | ]; | 489 | ]; |
489 | 490 | ||
491 | if (empty($request->get('email'))) { | ||
492 | return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); | ||
493 | } | ||
494 | |||
490 | if ($request->get('password') !== $request->get('confirmed')){ | 495 | if ($request->get('password') !== $request->get('confirmed')){ |
491 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); | 496 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); |
492 | } | 497 | } |
493 | 498 | ||
494 | $haystack = $request->get('password'); | 499 | $haystack = $request->get('password'); |
495 | 500 | ||
496 | $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); | 501 | $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); |
497 | $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', | 502 | $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', |
498 | 'X', 'C', 'V', 'B', 'N', 'M'); | 503 | 'X', 'C', 'V', 'B', 'N', 'M'); |
504 | $lenpwd_bool = true; | ||
499 | $spec_bool = false; | 505 | $spec_bool = false; |
500 | $alpha_bool = false; | 506 | $alpha_bool = false; |
501 | 507 | ||
508 | if (strlen($haystack) < 8) $lenpwd_bool = false; | ||
509 | |||
502 | foreach ($specsumbol as $it) { | 510 | foreach ($specsumbol as $it) { |
503 | if (strpos($haystack, $it) !== false) { | 511 | if (strpos($haystack, $it) !== false) { |
504 | $spec_bool = true; | 512 | $spec_bool = true; |
505 | } | 513 | } |
506 | } | 514 | } |
507 | 515 | ||
508 | foreach ($alpha as $it) { | 516 | foreach ($alpha as $it) { |
509 | if (strpos($haystack, $it) !== false) { | 517 | if (strpos($haystack, $it) !== false) { |
510 | $alpha_bool = true; | 518 | $alpha_bool = true; |
511 | } | 519 | } |
512 | } | 520 | } |
513 | 521 | ||
522 | if (!$lenpwd_bool) { | ||
523 | return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); | ||
524 | } | ||
525 | |||
514 | if ((!$spec_bool) || (!$alpha_bool)) { | 526 | if ((!$spec_bool) || (!$alpha_bool)) { |
515 | return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); | 527 | return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); |
516 | } | 528 | } |
517 | 529 | ||
518 | if (($request->has('politik')) && ($request->get('politik') == 1)) { | 530 | if (($request->has('politik')) && ($request->get('politik') == 1)) { |
519 | $validator = Validator::make($params, $rules, $messages); | 531 | $validator = Validator::make($params, $rules, $messages); |
520 | 532 | ||
521 | if ($validator->fails()) { | 533 | if ($validator->fails()) { |
522 | return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); | 534 | return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); |
523 | } else { | 535 | } else { |
524 | 536 | //dd($params); | |
525 | $user = $this->create($params); | 537 | $user = $this->create($params); |
526 | event(new Registered($user)); | 538 | event(new Registered($user)); |
527 | Auth::guard()->login($user); | 539 | Auth::guard()->login($user); |
528 | } | 540 | } |
529 | if ($user) { | 541 | if ($user) { |
530 | return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; | 542 | return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; |
531 | } else { | 543 | } else { |
532 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); | 544 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); |
533 | } | 545 | } |
534 | 546 | ||
535 | } else { | 547 | } else { |
536 | return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!")); | 548 | return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!")); |
537 | } | 549 | } |
538 | } | 550 | } |
539 | 551 | ||
540 | // Звездная оценка и ответ | 552 | // Звездная оценка и ответ |
541 | public function stars_answer(Request $request) { | 553 | public function stars_answer(Request $request) { |
542 | $params = $request->all(); | 554 | $params = $request->all(); |
543 | $rules = [ | 555 | $rules = [ |
544 | 'message' => ['required', 'string', 'max:255'], | 556 | 'message' => ['required', 'string', 'max:255'], |
545 | ]; | 557 | ]; |
546 | 558 | ||
547 | $messages = [ | 559 | $messages = [ |
548 | 'required' => 'Укажите обязательное поле', | 560 | 'required' => 'Укажите обязательное поле', |
549 | 'min' => [ | 561 | 'min' => [ |
550 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 562 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
551 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 563 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
552 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 564 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
553 | ], | 565 | ], |
554 | 'max' => [ | 566 | 'max' => [ |
555 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 567 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
556 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 568 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
557 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 569 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
558 | ] | 570 | ] |
559 | ]; | 571 | ]; |
560 | $response_worker = ResponseWork::create($params); | 572 | $response_worker = ResponseWork::create($params); |
561 | return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); | 573 | return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); |
562 | } | 574 | } |
563 | 575 | ||
576 | public function TestWorker() | ||
577 | { | ||
578 | $Use = new User(); | ||
579 | |||
580 | $Code_user = $Use->create([ | ||
581 | 'name' => 'surname name_man', | ||
582 | 'name_man' => 'name_man', | ||
583 | 'surname' => 'surname', | ||
584 | 'surname2' => 'surname2', | ||
585 | 'subscribe_email' => '1', | ||
586 | 'email' => 'email@mail.com', | ||
587 | 'telephone' => '1234567890', | ||
588 | 'password' => Hash::make('password'), | ||
589 | 'pubpassword' => base64_encode('password'), | ||
590 | 'email_verified_at' => Carbon::now(), | ||
591 | 'is_worker' => 1, | ||
592 | ]); | ||
593 | |||
594 | if ($Code_user->id > 0) { | ||
595 | $Worker = new Worker(); | ||
596 | $Worker->user_id = $Code_user->id; | ||
597 | $Worker->position_work = 1; //'job_titles'; | ||
598 | $Worker->email = 'email@email.com'; | ||
599 | $Worker->telephone = '1234567890'; | ||
600 | $status = $Worker->save(); | ||
601 | |||
602 | $Title_Worker = new Title_worker(); | ||
603 | $Title_Worker->worker_id = $Worker->id; | ||
604 | $Title_Worker->job_title_id = 1; | ||
605 | $Title_Worker->save(); | ||
606 | } | ||
607 | } | ||
608 | |||
564 | // Создание пользователя | 609 | // Создание пользователя |
565 | protected function create(array $data) | 610 | protected function create(array $data) |
566 | { | 611 | { |
567 | $Use = new User(); | 612 | $Use = new User(); |
613 | |||
568 | $Code_user = $Use->create([ | 614 | $Code_user = $Use->create([ |
569 | 'name' => $data['surname']." ".$data['name_man'], | 615 | 'name' => $data['surname']." ".$data['name_man'], |
570 | 'name_man' => $data['name_man'], | 616 | 'name_man' => $data['name_man'], |
571 | 'surname' => $data['surname'], | 617 | 'surname' => $data['surname'], |
572 | 'surname2' => $data['surname2'], | 618 | 'surname2' => $data['surname2'], |
573 | 'subscribe_email' => $data['email'], | 619 | 'subscribe_email' => $data['email'], |
574 | 'email' => $data['email'], | 620 | 'email' => $data['email'], |
575 | 'telephone' => $data['telephone'], | 621 | 'telephone' => $data['telephone'], |
576 | 'password' => Hash::make($data['password']), | 622 | 'password' => Hash::make($data['password']), |
577 | 'pubpassword' => base64_encode($data['password']), | 623 | 'pubpassword' => base64_encode($data['password']), |
578 | 'email_verified_at' => Carbon::now(), | 624 | 'email_verified_at' => Carbon::now(), |
579 | 'is_worker' => $data['is_worker'], | 625 | 'is_worker' => $data['is_worker'], |
580 | ]); | 626 | ]); |
627 | |||
581 | if ($Code_user->id > 0) { | 628 | if ($Code_user->id > 0) { |
582 | $Worker = new Worker(); | 629 | $Worker = new Worker(); |
583 | $Worker->user_id = $Code_user->id; | 630 | $Worker->user_id = $Code_user->id; |
584 | $Worker->position_work = $data['job_titles']; | 631 | $Worker->position_work = $data['job_titles']; |
585 | $Worker->email = $data['email']; | 632 | $Worker->email = $data['email']; |
586 | $Worker->telephone = $data['telephone']; | 633 | $Worker->telephone = $data['telephone']; |
587 | $Worker->save(); | 634 | $Worker->save(); |
588 | 635 | ||
636 | if (isset($Worker->id)) { | ||
637 | $Title_Worker = new Title_worker(); | ||
638 | $Title_Worker->worker_id = $Worker->id; | ||
639 | $Title_Worker->job_title_id = $data['job_titles']; | ||
640 | $Title_Worker->save(); | ||
641 | } | ||
642 | |||
589 | return $Code_user; | 643 | return $Code_user; |
590 | } | 644 | } |
591 | } | 645 | } |
592 | 646 | ||
593 | // Вакансии избранные | 647 | // Вакансии избранные |
594 | public function colorado(Request $request) { | 648 | public function colorado(Request $request) { |
595 | $IP_address = RusDate::ip_addr_client(); | 649 | $IP_address = RusDate::ip_addr_client(); |
596 | $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); | 650 | $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); |
597 | 651 | ||
598 | if ($Arr->count()) { | 652 | if ($Arr->count()) { |
599 | $A = Array(); | 653 | $A = Array(); |
600 | foreach ($Arr as $it) { | 654 | foreach ($Arr as $it) { |
601 | $A[] = $it->code_record; | 655 | $A[] = $it->code_record; |
602 | } | 656 | } |
603 | 657 | ||
604 | $Query = Ad_employer::query()->whereIn('id', $A); | 658 | $Query = Ad_employer::query()->whereIn('id', $A); |
605 | } else { | 659 | } else { |
606 | $Query = Ad_employer::query()->where('id', '=', '0'); | 660 | $Query = Ad_employer::query()->where('id', '=', '0'); |
607 | } | 661 | } |
608 | 662 | ||
609 | $Query = $Query->with('jobs')-> | 663 | $Query = $Query->with('jobs')-> |
610 | with('cat')-> | 664 | with('cat')-> |
611 | with('employer')-> | 665 | with('employer')-> |
612 | whereHas('jobs_code', function ($query) use ($request) { | 666 | whereHas('jobs_code', function ($query) use ($request) { |
613 | if ($request->ajax()) { | 667 | if ($request->ajax()) { |
614 | if (null !== ($request->get('job'))) { | 668 | if (null !== ($request->get('job'))) { |
615 | $query->where('job_title_id', $request->get('job')); | 669 | $query->where('job_title_id', $request->get('job')); |
616 | } | 670 | } |
617 | } | 671 | } |
618 | })->select('ad_employers.*'); | 672 | })->select('ad_employers.*'); |
619 | 673 | ||
620 | $Job_title = Job_title::query()->OrderBy('name')->get(); | 674 | $Job_title = Job_title::query()->OrderBy('name')->get(); |
621 | 675 | ||
622 | $Query_count = $Query->count(); | 676 | $Query_count = $Query->count(); |
623 | 677 | ||
624 | $Query = $Query->OrderBy('updated_at')->paginate(3); | 678 | $Query = $Query->OrderBy('updated_at')->paginate(3); |
625 | 679 | ||
626 | return view('workers.favorite', compact('Query', | 680 | return view('workers.favorite', compact('Query', |
627 | 'Query_count', | 681 | 'Query_count', |
628 | 'Job_title')); | 682 | 'Job_title')); |
629 | 683 | ||
630 | } | 684 | } |
631 | 685 | ||
632 | //Переписка | 686 | //Переписка |
633 | public function dialog(User_Model $user1, User_Model $user2) { | 687 | public function dialog(User_Model $user1, User_Model $user2) { |
634 | if (isset($user2->id)) { | 688 | if (isset($user2->id)) { |
635 | $companion = User_Model::query()->with('workers')-> | 689 | $companion = User_Model::query()->with('workers')-> |
636 | with('employers')-> | 690 | with('employers')-> |
637 | where('id', $user2->id)->first(); | 691 | where('id', $user2->id)->first(); |
638 | } | 692 | } |
639 | 693 | ||
640 | $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) { | 694 | $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) { |
641 | $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); | 695 | $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); |
642 | })->orWhere(function($query) use ($user1, $user2) { | 696 | })->orWhere(function($query) use ($user1, $user2) { |
643 | $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); | 697 | $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); |
644 | })->OrderBy('created_at')->get(); | 698 | })->OrderBy('created_at')->get(); |
645 | 699 | ||
646 | $id_vac = null; | 700 | $id_vac = null; |
647 | foreach ($Messages as $it) { | 701 | foreach ($Messages as $it) { |
648 | if (isset($it->response)) { | 702 | if (isset($it->response)) { |
649 | foreach ($it->response as $r) { | 703 | foreach ($it->response as $r) { |
650 | if (isset($r->ad_employer_id)) { | 704 | if (isset($r->ad_employer_id)) { |
651 | $id_vac = $r->ad_employer_id; | 705 | $id_vac = $r->ad_employer_id; |
652 | break; | 706 | break; |
653 | } | 707 | } |
654 | } | 708 | } |
655 | } | 709 | } |
656 | if (!is_null($id_vac)) break; | 710 | if (!is_null($id_vac)) break; |
657 | } | 711 | } |
658 | 712 | ||
659 | $ad_employer = null; | 713 | $ad_employer = null; |
660 | if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); | 714 | if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); |
661 | $sender = $user1; | 715 | $sender = $user1; |
662 | 716 | ||
663 | return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); | 717 | return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); |
664 | } | 718 | } |
665 | 719 | ||
666 | // Даунылоады | 720 | // Даунылоады |
667 | public function download(Worker $worker) { | 721 | public function download(Worker $worker) { |
668 | $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; | 722 | $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; |
669 | view()->share('house',$arr_house); | 723 | view()->share('house',$arr_house); |
670 | $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); | 724 | $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); |
671 | return $pdf->stream(); | 725 | return $pdf->stream(); |
672 | } | 726 | } |
673 | 727 | ||
674 | // Поднятие анкеты | 728 | // Поднятие анкеты |
675 | public function up(Worker $worker) { | 729 | public function up(Worker $worker) { |
676 | $worker->updated_at = Carbon::now(); | 730 | $worker->updated_at = Carbon::now(); |
677 | $worker->save(); | 731 | $worker->save(); |
678 | // 0 | 732 | // 0 |
679 | return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); | 733 | return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); |
680 | } | 734 | } |
681 | 735 | ||
682 | // Форма сертификате | 736 | // Форма сертификате |
683 | public function new_sertificate(Worker $worker) { | 737 | public function new_sertificate(Worker $worker) { |
684 | return view('workers.sertificate_add', compact('worker')); | 738 | return view('workers.sertificate_add', compact('worker')); |
685 | } | 739 | } |
686 | 740 | ||
687 | // Добавление сертификата | 741 | // Добавление сертификата |
688 | public function add_serificate(SertificationRequest $request) { | 742 | public function add_serificate(SertificationRequest $request) { |
689 | $params = $request->all(); | 743 | $params = $request->all(); |
690 | 744 | ||
691 | $Sertificate = new sertification(); | 745 | $Sertificate = new sertification(); |
692 | $Sertificate->create($params); | 746 | $Sertificate->create($params); |
693 | $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get(); | 747 | $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get(); |
694 | return redirect()->route('worker.cabinet'); | 748 | return redirect()->route('worker.cabinet'); |
695 | //return view('ajax.documents', compact('Docs')); | 749 | //return view('ajax.documents', compact('Docs')); |
696 | } | 750 | } |
697 | 751 | ||
698 | // Удалить сертификат | 752 | // Удалить сертификат |
699 | public function delete_sertificate(sertification $doc) { | 753 | public function delete_sertificate(sertification $doc) { |
700 | $doc->delete(); | 754 | $doc->delete(); |
701 | 755 | ||
702 | return redirect()->route('worker.cabinet'); | 756 | return redirect()->route('worker.cabinet'); |
703 | } | 757 | } |
704 | 758 | ||
705 | // Редактирование сертификата | 759 | // Редактирование сертификата |
706 | public function edit_sertificate(Worker $worker, sertification $doc) { | 760 | public function edit_sertificate(Worker $worker, sertification $doc) { |
707 | return view('workers.sertificate_edit', compact('doc', 'worker')); | 761 | return view('workers.sertificate_edit', compact('doc', 'worker')); |
708 | } | 762 | } |
709 | 763 | ||
710 | // Редактирование обновление сертификата | 764 | // Редактирование обновление сертификата |
711 | public function update_serificate(SertificationRequest $request, sertification $doc) { | 765 | public function update_serificate(SertificationRequest $request, sertification $doc) { |
712 | $all = $request->all(); | 766 | $all = $request->all(); |
713 | $doc->worker_id = $all['worker_id']; | 767 | $doc->worker_id = $all['worker_id']; |
714 | $doc->name = $all['name']; | 768 | $doc->name = $all['name']; |
715 | $doc->end_begin = $all['end_begin']; | 769 | $doc->end_begin = $all['end_begin']; |
716 | $doc->save(); | 770 | $doc->save(); |
717 | 771 | ||
718 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); | 772 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); |
719 | } | 773 | } |
720 | 774 | ||
721 | public function delete_add_diplom(Request $request, Worker $worker) { | 775 | public function delete_add_diplom(Request $request, Worker $worker) { |
722 | $infoblok_id = $request->get('infoblok_id'); | 776 | $infoblok_id = $request->get('infoblok_id'); |
723 | 777 | ||
724 | if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0) | 778 | if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0) |
725 | $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete(); | 779 | $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete(); |
726 | else { | 780 | else { |
727 | $params['infoblok_id'] = $infoblok_id; | 781 | $params['infoblok_id'] = $infoblok_id; |
728 | $params['worker_id'] = $worker->id; | 782 | $params['worker_id'] = $worker->id; |
729 | $id = Dop_info::create($params); | 783 | $id = Dop_info::create($params); |
730 | //$id = $worker->infobloks()->sync([$infoblok_id]); | 784 | //$id = $worker->infobloks()->sync([$infoblok_id]); |
731 | } | 785 | } |
732 | 786 | ||
733 | //$Infoblocks = infobloks::query()->get(); | 787 | //$Infoblocks = infobloks::query()->get(); |
734 | return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks')); | 788 | return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks')); |
735 | } | 789 | } |
736 | 790 | ||
737 | 791 | ||
738 | 792 | ||
739 | // Добавление диплома | 793 | // Добавление диплома |
740 | public function add_diplom_ajax(Request $request) { | 794 | public function add_diplom_ajax(Request $request) { |
741 | // конец | 795 | // конец |
742 | $params = $request->all(); | 796 | $params = $request->all(); |
743 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); | 797 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); |
744 | 798 | ||
745 | if ($count == 0) $dop_info = Dop_info::create($params); | 799 | if ($count == 0) $dop_info = Dop_info::create($params); |
746 | $Infoblocks = infobloks::query()->get(); | 800 | $Infoblocks = infobloks::query()->get(); |
747 | $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); | 801 | $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); |
748 | $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); | 802 | $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); |
749 | return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); | 803 | return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); |
750 | } | 804 | } |
751 | 805 | ||
752 | // Добавление диплома без ajax | 806 | // Добавление диплома без ajax |
753 | public function add_diplom(Worker $worker) { | 807 | public function add_diplom(Worker $worker) { |
754 | $worker_id = $worker->id; | 808 | $worker_id = $worker->id; |
755 | $Infoblocks = infobloks::query()->get(); | 809 | $Infoblocks = infobloks::query()->get(); |
756 | return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); | 810 | return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); |
757 | } | 811 | } |
758 | // Сохранить | 812 | // Сохранить |
759 | // Сохраняю диплом | 813 | // Сохраняю диплом |
760 | public function add_diplom_save(Request $request) { | 814 | public function add_diplom_save(Request $request) { |
761 | $params = $request->all(); | 815 | $params = $request->all(); |
762 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); | 816 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); |
763 | if ($count == 0) $dop_info = Dop_info::create($params); | 817 | if ($count == 0) $dop_info = Dop_info::create($params); |
764 | return redirect()->route('worker.cabinet'); | 818 | return redirect()->route('worker.cabinet'); |
765 | } | 819 | } |
766 | 820 | ||
767 | // Добавление стандартного документа | 821 | // Добавление стандартного документа |
768 | public function add_document(Worker $worker) { | 822 | public function add_document(Worker $worker) { |
769 | return view('workers.docs', compact('worker')); | 823 | return view('workers.docs', compact('worker')); |
770 | } | 824 | } |
771 | 825 | ||
772 | //Сохранение стандартого документа | 826 | //Сохранение стандартого документа |
773 | public function add_document_save(DocumentsRequest $request) { | 827 | public function add_document_save(DocumentsRequest $request) { |
774 | $params = $request->all(); | 828 | $params = $request->all(); |
775 | $place_work = place_works::create($params); | 829 | $place_work = place_works::create($params); |
776 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!'); | 830 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!'); |
777 | } | 831 | } |
778 | 832 | ||
779 | // Редактирование документа | 833 | // Редактирование документа |
780 | public function edit_document(place_works $doc, Worker $worker) { | 834 | public function edit_document(place_works $doc, Worker $worker) { |
781 | return view('workers.docs-edit', compact('doc', 'worker')); | 835 | return view('workers.docs-edit', compact('doc', 'worker')); |
782 | } | 836 | } |
783 | 837 | ||
784 | //Сохранение отредактированного документа | 838 | //Сохранение отредактированного документа |
785 | public function edit_document_save(DocumentsRequest $request, place_works $doc) { | 839 | public function edit_document_save(DocumentsRequest $request, place_works $doc) { |
786 | $params = $request->all(); | 840 | $params = $request->all(); |
787 | $doc->update($params); | 841 | $doc->update($params); |
788 | 842 | ||
789 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); | 843 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); |
790 | } | 844 | } |
791 | 845 | ||
792 | // Удаление документа | 846 | // Удаление документа |
793 | public function delete_document(place_works $doc) { | 847 | public function delete_document(place_works $doc) { |
794 | $doc->delete(); | 848 | $doc->delete(); |
795 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); | 849 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); |
796 | } | 850 | } |
797 | 851 | ||
798 | //Отправка нового сообщения | 852 | //Отправка нового сообщения |
799 | public function new_message(Request $request) { | 853 | public function new_message(Request $request) { |
800 | $params = $request->all(); | 854 | $params = $request->all(); |
801 | 855 | ||
802 | $id = $params['send_user_id']; | 856 | $id = $params['send_user_id']; |
803 | $message = new Message(); | 857 | $message = new Message(); |
804 | $message->user_id = $params['send_user_id']; | 858 | $message->user_id = $params['send_user_id']; |
805 | $message->to_user_id = $params['send_to_user_id']; | 859 | $message->to_user_id = $params['send_to_user_id']; |
806 | $message->title = $params['send_title']; | 860 | $message->title = $params['send_title']; |
807 | $message->text = $params['send_text']; | 861 | $message->text = $params['send_text']; |
808 | if ($request->has('send_file')) { | 862 | if ($request->has('send_file')) { |
809 | $message->file = $request->file('send_file')->store("worker/$id", 'public'); | 863 | $message->file = $request->file('send_file')->store("worker/$id", 'public'); |
810 | } | 864 | } |
811 | $message->flag_new = 1; | 865 | $message->flag_new = 1; |
812 | $id_message = $message->save(); | 866 | $id_message = $message->save(); |
813 | 867 | ||
814 | $data['message_id'] = $id_message; | 868 | $data['message_id'] = $id_message; |
815 | $data['ad_employer_id'] = $params['send_vacancy']; | 869 | $data['ad_employer_id'] = $params['send_vacancy']; |
816 | $data['job_title_id'] = $params['send_job_title_id']; | 870 | $data['job_title_id'] = $params['send_job_title_id']; |
817 | $data['flag'] = 1; | 871 | $data['flag'] = 1; |
818 | $ad_responce = ad_response::create($data); | 872 | $ad_responce = ad_response::create($data); |
819 | return redirect()->route('worker.messages', ['type_message' => 'output']); | 873 | return redirect()->route('worker.messages', ['type_message' => 'output']); |
820 | } | 874 | } |
821 | 875 | ||
822 | // Информация о предыдущих компаниях | 876 | // Информация о предыдущих компаниях |
823 | public function new_prev_company(Worker $worker) { | 877 | public function new_prev_company(Worker $worker) { |
824 | return view('workers.prev_company_form', compact('worker')); | 878 | return view('workers.prev_company_form', compact('worker')); |
825 | } | 879 | } |
826 | 880 | ||
827 | // Добавление контакта компании | 881 | // Добавление контакта компании |
828 | public function add_prev_company(PrevCompanyRequest $request) { | 882 | public function add_prev_company(PrevCompanyRequest $request) { |
829 | // Возвращение параметров | 883 | // Возвращение параметров |
830 | $all = $request->all(); | 884 | $all = $request->all(); |
831 | $PrevCompany = PrevCompany::create($all); | 885 | $PrevCompany = PrevCompany::create($all); |
832 | 886 | ||
833 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись'); | 887 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись'); |
834 | } | 888 | } |
835 | 889 | ||
836 | // Удаление контакта предыдущей компании | 890 | // Удаление контакта предыдущей компании |
837 | public function delete_prev_company(PrevCompany $doc) { | 891 | public function delete_prev_company(PrevCompany $doc) { |
838 | $doc->delete(); | 892 | $doc->delete(); |
839 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); | 893 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); |
840 | } | 894 | } |
841 | } | 895 | } |
842 | 896 | ||
843 | 897 |
routes/web.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | use App\Http\Controllers\Ad_jobsController; | 3 | use App\Http\Controllers\Ad_jobsController; |
4 | use App\Http\Controllers\AdEmployerController; | 4 | use App\Http\Controllers\AdEmployerController; |
5 | use App\Http\Controllers\Admin\AdminController; | 5 | use App\Http\Controllers\Admin\AdminController; |
6 | use App\Http\Controllers\Admin\CategoryController; | 6 | use App\Http\Controllers\Admin\CategoryController; |
7 | use App\Http\Controllers\Admin\CategoryEmpController; | 7 | use App\Http\Controllers\Admin\CategoryEmpController; |
8 | use App\Http\Controllers\Admin\EducationController; | 8 | use App\Http\Controllers\Admin\EducationController; |
9 | use App\Http\Controllers\Admin\EmployersController; | 9 | use App\Http\Controllers\Admin\EmployersController; |
10 | use App\Http\Controllers\EmployerController as FrontEmployersController; | 10 | use App\Http\Controllers\EmployerController as FrontEmployersController; |
11 | use App\Http\Controllers\Admin\InfoBloksController; | 11 | use App\Http\Controllers\Admin\InfoBloksController; |
12 | use App\Http\Controllers\Admin\JobTitlesController; | 12 | use App\Http\Controllers\Admin\JobTitlesController; |
13 | use App\Http\Controllers\Admin\UsersController; | 13 | use App\Http\Controllers\Admin\UsersController; |
14 | use App\Http\Controllers\Admin\WorkersController; | 14 | use App\Http\Controllers\Admin\WorkersController; |
15 | use App\Http\Controllers\Auth\ForgotPasswordController; | 15 | use App\Http\Controllers\Auth\ForgotPasswordController; |
16 | use App\Http\Controllers\Auth\LoginController; | 16 | use App\Http\Controllers\Auth\LoginController; |
17 | use App\Http\Controllers\Auth\RegisterController; | 17 | use App\Http\Controllers\Auth\RegisterController; |
18 | use App\Http\Controllers\CKEditorController; | 18 | use App\Http\Controllers\CKEditorController; |
19 | use App\Http\Controllers\MediaController; | 19 | use App\Http\Controllers\MediaController; |
20 | use App\Http\Controllers\WorkerController; | 20 | use App\Http\Controllers\WorkerController; |
21 | use App\Models\Ad_jobs; | 21 | use App\Models\Ad_jobs; |
22 | use App\Models\User; | 22 | use App\Models\User; |
23 | use App\Http\Controllers\MainController; | 23 | use App\Http\Controllers\MainController; |
24 | use App\Http\Controllers\HomeController; | 24 | use App\Http\Controllers\HomeController; |
25 | use Illuminate\Support\Facades\Route; | 25 | use Illuminate\Support\Facades\Route; |
26 | use App\Http\Controllers\Admin\CompanyController; | 26 | use App\Http\Controllers\Admin\CompanyController; |
27 | use App\Http\Controllers\Admin\Ad_EmployersController; | 27 | use App\Http\Controllers\Admin\Ad_EmployersController; |
28 | use App\Http\Controllers\Admin\MsgAnswersController; | 28 | use App\Http\Controllers\Admin\MsgAnswersController; |
29 | use App\Http\Controllers\Admin\GroupsController; | 29 | use App\Http\Controllers\Admin\GroupsController; |
30 | use App\Http\Controllers\PagesController; | 30 | use App\Http\Controllers\PagesController; |
31 | use Illuminate\Support\Facades\Storage; | 31 | use Illuminate\Support\Facades\Storage; |
32 | use App\Http\Controllers\EmployerController; | 32 | use App\Http\Controllers\EmployerController; |
33 | use App\Http\Controllers\CompanyController as FrontCompanyController; | 33 | use App\Http\Controllers\CompanyController as FrontCompanyController; |
34 | 34 | ||
35 | 35 | ||
36 | /* | 36 | /* |
37 | |-------------------------------------------------------------------------- | 37 | |-------------------------------------------------------------------------- |
38 | | Web Routes | 38 | | Web Routes |
39 | |-------------------------------------------------------------------------- | 39 | |-------------------------------------------------------------------------- |
40 | | | 40 | | |
41 | | Here is where you can register web routes for your application. These | 41 | | Here is where you can register web routes for your application. These |
42 | | routes are loaded by the RouteServiceProvider within a group which | 42 | | routes are loaded by the RouteServiceProvider within a group which |
43 | | contains the "web" middleware group. Now create something great! | 43 | | contains the "web" middleware group. Now create something great! |
44 | | | 44 | | |
45 | */ | 45 | */ |
46 | /* | 46 | /* |
47 | Route::get('/', function () { | 47 | Route::get('/', function () { |
48 | return view('welcome'); | 48 | return view('welcome'); |
49 | })->name('index'); | 49 | })->name('index'); |
50 | */ | 50 | */ |
51 | 51 | ||
52 | Route::get('/', [MainController::class, 'index'])->name('index'); | 52 | Route::get('/', [MainController::class, 'index'])->name('index'); |
53 | 53 | ||
54 | //Роуты авторизации, регистрации, восстановления, аутентификации | 54 | //Роуты авторизации, регистрации, восстановления, аутентификации |
55 | Auth::routes(['verify' => true]); | 55 | Auth::routes(['verify' => true]); |
56 | 56 | ||
57 | // роуты регистрации, авторизации, восстановления пароля, верификации почты | 57 | // роуты регистрации, авторизации, восстановления пароля, верификации почты |
58 | /*Route::group([ | 58 | /*Route::group([ |
59 | 'as' => 'auth.', //имя маршрута, например auth.index | 59 | 'as' => 'auth.', //имя маршрута, например auth.index |
60 | 'prefix' => 'auth', // префикс маршрута, например, auth/index | 60 | 'prefix' => 'auth', // префикс маршрута, например, auth/index |
61 | ], function () { | 61 | ], function () { |
62 | //форма регистрации | 62 | //форма регистрации |
63 | Route::get('register', [RegisterController::class, 'register'])->name('register'); | 63 | Route::get('register', [RegisterController::class, 'register'])->name('register'); |
64 | 64 | ||
65 | //создание пользователя | 65 | //создание пользователя |
66 | Route::post('register', [RegisterController::class, 'create'])->name('create'); | 66 | Route::post('register', [RegisterController::class, 'create'])->name('create'); |
67 | 67 | ||
68 | //форма входа авторизации | 68 | //форма входа авторизации |
69 | Route::get('login', [LoginController::class, 'login'])->name('login'); | 69 | Route::get('login', [LoginController::class, 'login'])->name('login'); |
70 | 70 | ||
71 | //аутентификация | 71 | //аутентификация |
72 | Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); | 72 | Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); |
73 | 73 | ||
74 | //выход | 74 | //выход |
75 | Route::get('logout', [LoginController::class, 'logout'])->name('logout'); | 75 | Route::get('logout', [LoginController::class, 'logout'])->name('logout'); |
76 | 76 | ||
77 | //форма ввода адреса почты | 77 | //форма ввода адреса почты |
78 | Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); | 78 | Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); |
79 | 79 | ||
80 | //письмо на почту | 80 | //письмо на почту |
81 | Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); | 81 | Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); |
82 | 82 | ||
83 | //форма восстановления пароля | 83 | //форма восстановления пароля |
84 | Route::get('reset-password/token/{token}/email/{email}', | 84 | Route::get('reset-password/token/{token}/email/{email}', |
85 | [ResetPasswordController::class, 'form'] | 85 | [ResetPasswordController::class, 'form'] |
86 | )->name('reset-form'); | 86 | )->name('reset-form'); |
87 | 87 | ||
88 | //восстановление пароля | 88 | //восстановление пароля |
89 | Route::post('reset-password', | 89 | Route::post('reset-password', |
90 | [ResetPasswordController::class, 'reset'] | 90 | [ResetPasswordController::class, 'reset'] |
91 | )->name('reset-password'); | 91 | )->name('reset-password'); |
92 | 92 | ||
93 | //сообщение о необходимости проверки адреса почты | 93 | //сообщение о необходимости проверки адреса почты |
94 | Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); | 94 | Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); |
95 | 95 | ||
96 | //подтверждение адреса почты нового пользователя | 96 | //подтверждение адреса почты нового пользователя |
97 | Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) | 97 | Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) |
98 | ->where('token', '[a-f0-9]{32}') | 98 | ->where('token', '[a-f0-9]{32}') |
99 | ->where('id', '[0-9]+') | 99 | ->where('id', '[0-9]+') |
100 | ->name('verify-email'); | 100 | ->name('verify-email'); |
101 | });*/ | 101 | });*/ |
102 | 102 | ||
103 | //Личный кабинет пользователя | 103 | //Личный кабинет пользователя |
104 | Route::get('/home', [HomeController::class, 'index'])->name('home'); | 104 | Route::get('/home', [HomeController::class, 'index'])->name('home'); |
105 | 105 | ||
106 | /* | 106 | /* |
107 | Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { | 107 | Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { |
108 | $user = User::where('email',$request->input('email'))->first(); | 108 | $user = User::where('email',$request->input('email'))->first(); |
109 | 109 | ||
110 | $user->sendEmailVerificationNotification(); | 110 | $user->sendEmailVerificationNotification(); |
111 | 111 | ||
112 | return 'your response'; | 112 | return 'your response'; |
113 | })->middleware('throttle:6,1')->name('verification.resend'); | 113 | })->middleware('throttle:6,1')->name('verification.resend'); |
114 | */ | 114 | */ |
115 | 115 | ||
116 | // Авторизация, регистрация в админку | 116 | // Авторизация, регистрация в админку |
117 | Route::group([ | 117 | Route::group([ |
118 | 'as' => 'admin.', // имя маршрута, например auth.index | 118 | 'as' => 'admin.', // имя маршрута, например auth.index |
119 | 'prefix' => 'admin', // префикс маршрута, например auth/index | 119 | 'prefix' => 'admin', // префикс маршрута, например auth/index |
120 | 'middleware' => ['guest'], | 120 | 'middleware' => ['guest'], |
121 | ], function () { | 121 | ], function () { |
122 | // Форма регистрации | 122 | // Форма регистрации |
123 | Route::get('register', [AdminController::class, 'register'])->name('register'); | 123 | Route::get('register', [AdminController::class, 'register'])->name('register'); |
124 | // Создание пользователя | 124 | // Создание пользователя |
125 | Route::post('register', [AdminController::class, 'create'])->name('create'); | 125 | Route::post('register', [AdminController::class, 'create'])->name('create'); |
126 | 126 | ||
127 | //Форма входа | 127 | //Форма входа |
128 | Route::get('login', [AdminController::class, 'login'])->name('login'); | 128 | Route::get('login', [AdminController::class, 'login'])->name('login'); |
129 | 129 | ||
130 | // аутентификация | 130 | // аутентификация |
131 | Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); | 131 | Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); |
132 | 132 | ||
133 | }); | 133 | }); |
134 | 134 | ||
135 | // Личный кабинет админки | 135 | // Личный кабинет админки |
136 | Route::group([ | 136 | Route::group([ |
137 | 'as' => 'admin.', // имя маршрута, например auth.index | 137 | 'as' => 'admin.', // имя маршрута, например auth.index |
138 | 'prefix' => 'admin', // префикс маршрута, например auth/index | 138 | 'prefix' => 'admin', // префикс маршрута, например auth/index |
139 | 'middleware' => ['auth'], ['admin'], | 139 | 'middleware' => ['auth'], ['admin'], |
140 | ], function() { | 140 | ], function() { |
141 | 141 | ||
142 | // выход | 142 | // выход |
143 | Route::get('logout', [AdminController::class, 'logout'])->name('logout'); | 143 | Route::get('logout', [AdminController::class, 'logout'])->name('logout'); |
144 | 144 | ||
145 | // кабинет главная страница | 145 | // кабинет главная страница |
146 | Route::get('cabinet', [AdminController::class, 'index'])->name('index'); | 146 | Route::get('cabinet', [AdminController::class, 'index'])->name('index'); |
147 | 147 | ||
148 | // кабинет профиль админа - форма | 148 | // кабинет профиль админа - форма |
149 | Route::get('profile', [AdminController::class, 'profile'])->name('profile'); | 149 | Route::get('profile', [AdminController::class, 'profile'])->name('profile'); |
150 | // кабинет профиль админа - сохранение формы | 150 | // кабинет профиль админа - сохранение формы |
151 | Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); | 151 | Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); |
152 | 152 | ||
153 | //кабинет сообщения админа | 153 | //кабинет сообщения админа |
154 | //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); | 154 | //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); |
155 | 155 | ||
156 | 156 | ||
157 | // кабинет профиль - форма пароли | 157 | // кабинет профиль - форма пароли |
158 | Route::get('password', [AdminController::class, 'profile_password'])->name('password'); | 158 | Route::get('password', [AdminController::class, 'profile_password'])->name('password'); |
159 | // кабинет профиль - сохранение формы пароля | 159 | // кабинет профиль - сохранение формы пароля |
160 | Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); | 160 | Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); |
161 | 161 | ||
162 | 162 | ||
163 | // кабинет профиль пользователя - форма | 163 | // кабинет профиль пользователя - форма |
164 | Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); | 164 | Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); |
165 | // кабинет профиль пользователя - сохранение формы | 165 | // кабинет профиль пользователя - сохранение формы |
166 | Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); | 166 | Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); |
167 | 167 | ||
168 | // кабинет профиль работодатель - форма | 168 | // кабинет профиль работодатель - форма |
169 | Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); | 169 | Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); |
170 | // кабинет профиль работодатель - сохранение формы | 170 | // кабинет профиль работодатель - сохранение формы |
171 | Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); | 171 | Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); |
172 | // кабинет удаление профиль работодателя и юзера | 172 | // кабинет удаление профиль работодателя и юзера |
173 | Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); | 173 | Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); |
174 | 174 | ||
175 | // кабинет профиль работник - форма | 175 | // кабинет профиль работник - форма |
176 | Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); | 176 | Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); |
177 | Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); | 177 | Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); |
178 | Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); | 178 | Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); |
179 | // кабинет профиль работник - сохранение формы | 179 | // кабинет профиль работник - сохранение формы |
180 | Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); | 180 | Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); |
181 | 181 | ||
182 | // Медиа | 182 | // Медиа |
183 | Route::get('media', [MediaController::class, 'index'])->name('media'); | 183 | Route::get('media', [MediaController::class, 'index'])->name('media'); |
184 | Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media'); | 184 | Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media'); |
185 | 185 | ||
186 | // кабинет настройки сайта - форма | 186 | // кабинет настройки сайта - форма |
187 | Route::get('config', [AdminController::class, 'config_form'])->name('config'); | 187 | Route::get('config', [AdminController::class, 'config_form'])->name('config'); |
188 | // кабинет настройки сайта сохранение формы | 188 | // кабинет настройки сайта сохранение формы |
189 | Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); | 189 | Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); |
190 | 190 | ||
191 | // кабинет - новости | 191 | // кабинет - новости |
192 | Route::get('news-list', [AdminController::class, 'news_admin'])->name('news_admin'); | 192 | Route::get('news-list', [AdminController::class, 'news_admin'])->name('news_admin'); |
193 | Route::get('news/add', [AdminController::class, 'new_admin_add'])->name('new_admin_add'); | 193 | Route::get('news/add', [AdminController::class, 'new_admin_add'])->name('new_admin_add'); |
194 | Route::post('news/add', [AdminController::class, 'new_admin_add_save'])->name('new_admin_save_add'); | 194 | Route::post('news/add', [AdminController::class, 'new_admin_add_save'])->name('new_admin_save_add'); |
195 | Route::get('news/edit/{new}', [AdminController::class, 'new_admin_edit'])->name('new_admin_edit'); | 195 | Route::get('news/edit/{new}', [AdminController::class, 'new_admin_edit'])->name('new_admin_edit'); |
196 | Route::post('news/edit/{new}', [AdminController::class, 'new_admin_update_save'])->name('new_admin_update'); | 196 | Route::post('news/edit/{new}', [AdminController::class, 'new_admin_update_save'])->name('new_admin_update'); |
197 | Route::get('news/delete/{new}', [AdminController::class, 'new_admin_delete'])->name('new_admin_delete'); | 197 | Route::get('news/delete/{new}', [AdminController::class, 'new_admin_delete'])->name('new_admin_delete'); |
198 | 198 | ||
199 | // кабинет - пользователи | 199 | // кабинет - пользователи |
200 | Route::get('users', [UsersController::class, 'index'])->name('users'); | 200 | Route::get('users', [UsersController::class, 'index'])->name('users'); |
201 | 201 | ||
202 | // кабинет - пользователи | 202 | // кабинет - пользователи |
203 | Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); | 203 | Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); |
204 | 204 | ||
205 | // кабинет - работодатели | 205 | // кабинет - работодатели |
206 | Route::get('employers', [EmployersController::class, 'index'])->name('employers'); | 206 | Route::get('employers', [EmployersController::class, 'index'])->name('employers'); |
207 | 207 | ||
208 | Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); | 208 | Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); |
209 | 209 | ||
210 | Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add'); | 210 | Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add'); |
211 | Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save'); | 211 | Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save'); |
212 | Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot'); | 212 | Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot'); |
213 | Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit'); | 213 | Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit'); |
214 | Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete'); | 214 | Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete'); |
215 | 215 | ||
216 | // кабинет - соискатели | 216 | // кабинет - соискатели |
217 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); | 217 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); |
218 | 218 | ||
219 | // кабинет - база данных | 219 | // кабинет - база данных |
220 | Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); | 220 | Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); |
221 | Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); | 221 | Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); |
222 | Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); | 222 | Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); |
223 | Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); | 223 | Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); |
224 | Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); | 224 | Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); |
225 | Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); | 225 | Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); |
226 | Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); | 226 | Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); |
227 | 227 | ||
228 | // кабинет - вакансии | 228 | // кабинет - вакансии |
229 | Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); | 229 | Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); |
230 | Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers'); | 230 | Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers'); |
231 | Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers'); | 231 | Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers'); |
232 | Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); | 232 | Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); |
233 | Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); | 233 | Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); |
234 | Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer'); | 234 | Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer'); |
235 | 235 | ||
236 | // Редактирование должности в вакансии | 236 | // Редактирование должности в вакансии |
237 | Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs'); | 237 | Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs'); |
238 | Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs'); | 238 | Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs'); |
239 | 239 | ||
240 | 240 | ||
241 | // кабинет - категории | 241 | // кабинет - категории |
242 | //Route::get('categories', [AdminController::class, 'index'])->name('categories'); | 242 | //Route::get('categories', [AdminController::class, 'index'])->name('categories'); |
243 | 243 | ||
244 | // СRUD-операции над Справочником Категории | 244 | // СRUD-операции над Справочником Категории |
245 | 245 | ||
246 | Route::resource('categories', CategoryController::class, ['except' => ['show']]); | 246 | Route::resource('categories', CategoryController::class, ['except' => ['show']]); |
247 | 247 | ||
248 | // CRUD-операции над справочником Категории для работодателей | 248 | // CRUD-операции над справочником Категории для работодателей |
249 | Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); | 249 | Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); |
250 | 250 | ||
251 | // CRUD-операции над справочником Образование | 251 | // CRUD-операции над справочником Образование |
252 | Route::resource('education', EducationController::class, ['except' => ['show']]); | 252 | Route::resource('education', EducationController::class, ['except' => ['show']]); |
253 | 253 | ||
254 | Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education'); | 254 | Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education'); |
255 | Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); | 255 | Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); |
256 | Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); | 256 | Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); |
257 | 257 | ||
258 | Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); | 258 | Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); |
259 | Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education'); | 259 | Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education'); |
260 | 260 | ||
261 | Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); | 261 | Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); |
262 | 262 | ||
263 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); | 263 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); |
264 | /* | 264 | /* |
265 | * кабинет - CRUD-операции по справочнику должности | 265 | * кабинет - CRUD-операции по справочнику должности |
266 | * | 266 | * |
267 | */ | 267 | */ |
268 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); | 268 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); |
269 | 269 | ||
270 | // кабинет - сообщения (чтение чужих) | 270 | // кабинет - сообщения (чтение чужих) |
271 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); | 271 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); |
272 | // кабинет - просмотр сообщения чужого (чтение) | 272 | // кабинет - просмотр сообщения чужого (чтение) |
273 | Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); | 273 | Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); |
274 | 274 | ||
275 | // кабинет - сообщения (админские) | 275 | // кабинет - сообщения (админские) |
276 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); | 276 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); |
277 | // кабинет - сообщения (админские) | 277 | // кабинет - сообщения (админские) |
278 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); | 278 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); |
279 | // кабинет - sql - конструкция запросов | 279 | // кабинет - sql - конструкция запросов |
280 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); | 280 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); |
281 | 281 | ||
282 | /* | 282 | /* |
283 | * Расписанный подход в описании каждой директорий групп пользователей. | 283 | * Расписанный подход в описании каждой директорий групп пользователей. |
284 | */ | 284 | */ |
285 | // кабинет - группы пользователей | 285 | // кабинет - группы пользователей |
286 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); | 286 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); |
287 | // кабинет - добавление форма группы пользователей | 287 | // кабинет - добавление форма группы пользователей |
288 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); | 288 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); |
289 | // кабинет - сохранение формы группы пользователей | 289 | // кабинет - сохранение формы группы пользователей |
290 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); | 290 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); |
291 | // кабинет - редактирование форма группы пользователей | 291 | // кабинет - редактирование форма группы пользователей |
292 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); | 292 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); |
293 | // кабинет - сохранение редактированной формы группы пользователей | 293 | // кабинет - сохранение редактированной формы группы пользователей |
294 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); | 294 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); |
295 | // кабинет - удаление группы пользователей | 295 | // кабинет - удаление группы пользователей |
296 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); | 296 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); |
297 | 297 | ||
298 | 298 | ||
299 | // кабинет - список админов | 299 | // кабинет - список админов |
300 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); | 300 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); |
301 | 301 | ||
302 | // справочник Позиции | 302 | // справочник Позиции |
303 | Route::get('positions', [AdminController::class, 'position'])->name('position'); | 303 | Route::get('positions', [AdminController::class, 'position'])->name('position'); |
304 | Route::get('positions/add', [AdminController::class, 'position_add'])->name('add-position'); | 304 | Route::get('positions/add', [AdminController::class, 'position_add'])->name('add-position'); |
305 | Route::post('positions/add', [AdminController::class, 'position_add_save'])->name('add-save-position'); | 305 | Route::post('positions/add', [AdminController::class, 'position_add_save'])->name('add-save-position'); |
306 | Route::get('positions/edit/{position}', [AdminController::class, 'position_edit'])->name('edit-position'); | 306 | Route::get('positions/edit/{position}', [AdminController::class, 'position_edit'])->name('edit-position'); |
307 | Route::post('position/edit/{position}', [AdminController::class, 'position_update'])->name('update-position'); | 307 | Route::post('position/edit/{position}', [AdminController::class, 'position_update'])->name('update-position'); |
308 | Route::get('position/delete/{position}', [AdminController::class, 'position_delete'])->name('delete-position'); | 308 | Route::get('position/delete/{position}', [AdminController::class, 'position_delete'])->name('delete-position'); |
309 | 309 | ||
310 | /////редактор////// кабинет - редактор сайта//////////////////////// | 310 | /////редактор////// кабинет - редактор сайта//////////////////////// |
311 | Route::get('editor-site', function() { | 311 | Route::get('editor-site', function() { |
312 | return view('admin.editor.index'); | 312 | return view('admin.editor.index'); |
313 | })->name('editor-site'); | 313 | })->name('editor-site'); |
314 | 314 | ||
315 | 315 | ||
316 | // кабинет - редактор шапки-футера сайта | 316 | // кабинет - редактор шапки-футера сайта |
317 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); | 317 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); |
318 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); | 318 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); |
319 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); | 319 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); |
320 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); | 320 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); |
321 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); | 321 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); |
322 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); | 322 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); |
323 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); | 323 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); |
324 | 324 | ||
325 | 325 | ||
326 | // кабинет - редактор должности на главной | 326 | // кабинет - редактор должности на главной |
327 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); | 327 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); |
328 | 328 | ||
329 | // кабинет - редактор работодатели на главной | 329 | // кабинет - редактор работодатели на главной |
330 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); | 330 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); |
331 | 331 | ||
332 | 332 | ||
333 | // кабинет - редактор seo-сайта | 333 | // кабинет - редактор seo-сайта |
334 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); | 334 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); |
335 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); | 335 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); |
336 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); | 336 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); |
337 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); | 337 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); |
338 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); | 338 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); |
339 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); | 339 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); |
340 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); | 340 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); |
341 | 341 | ||
342 | 342 | ||
343 | // кабинет - редактор страниц | 343 | // кабинет - редактор страниц |
344 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); | 344 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); |
345 | // кабинет - добавление страницы | 345 | // кабинет - добавление страницы |
346 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); | 346 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); |
347 | // кабинет - сохранение формы страницы | 347 | // кабинет - сохранение формы страницы |
348 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); | 348 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); |
349 | // кабинет - редактирование форма страницы | 349 | // кабинет - редактирование форма страницы |
350 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); | 350 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); |
351 | // кабинет - сохранение редактированной формы страницы | 351 | // кабинет - сохранение редактированной формы страницы |
352 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); | 352 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); |
353 | // кабинет - удаление страницы | 353 | // кабинет - удаление страницы |
354 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); | 354 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); |
355 | 355 | ||
356 | 356 | ||
357 | // кабинет - реклама сайта | 357 | // кабинет - реклама сайта |
358 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); | 358 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); |
359 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); | 359 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); |
360 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); | 360 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); |
361 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); | 361 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); |
362 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); | 362 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); |
363 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); | 363 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); |
364 | //////////////////////////////////////////////////////////////////////// | 364 | //////////////////////////////////////////////////////////////////////// |
365 | 365 | ||
366 | 366 | ||
367 | // кабинет - отзывы о работодателе для модерации | 367 | // кабинет - отзывы о работодателе для модерации |
368 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); | 368 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); |
369 | 369 | ||
370 | // Общая страница статистики | 370 | // Общая страница статистики |
371 | Route::get('statics', function () { | 371 | Route::get('statics', function () { |
372 | return view('admin.static.index'); | 372 | return view('admin.static.index'); |
373 | })->name('statics'); | 373 | })->name('statics'); |
374 | 374 | ||
375 | // кабинет - статистика работников | 375 | // кабинет - статистика работников |
376 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); | 376 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); |
377 | 377 | ||
378 | // кабинет - статистика вакансий работодателя | 378 | // кабинет - статистика вакансий работодателя |
379 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); | 379 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); |
380 | 380 | ||
381 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника | 381 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника |
382 | /* | 382 | /* |
383 | * CRUD-операции над справочником дипломы и документы | 383 | * CRUD-операции над справочником дипломы и документы |
384 | */ | 384 | */ |
385 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); | 385 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); |
386 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); | 386 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); |
387 | 387 | ||
388 | // кабинет - роли пользователя | 388 | // кабинет - роли пользователя |
389 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); | 389 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); |
390 | 390 | ||
391 | Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles'); | 391 | Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles'); |
392 | 392 | ||
393 | Route::get('logs', function() { | 393 | Route::get('logs', function() { |
394 | $files = Storage::files('logs/laravel.log'); | 394 | $files = Storage::files('logs/laravel.log'); |
395 | })->name('logs'); | 395 | })->name('logs'); |
396 | }); | 396 | }); |
397 | 397 | ||
398 | // Инструментальные страницы | 398 | // Инструментальные страницы |
399 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); | 399 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); |
400 | 400 | ||
401 | Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); | 401 | Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); |
402 | 402 | ||
403 | Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); | 403 | Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); |
404 | 404 | ||
405 | // Страницы с произвольным контентом | 405 | // Страницы с произвольным контентом |
406 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); | 406 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); |
407 | 407 | ||
408 | // Публичные страницы соискателя | 408 | // Публичные страницы соискателя |
409 | Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); | 409 | Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); |
410 | 410 | ||
411 | //Страница вакансии | 411 | //Страница вакансии |
412 | Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); | 412 | Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); |
413 | 413 | ||
414 | //Вакансии | 414 | //Вакансии |
415 | Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies'); | 415 | Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies'); |
416 | 416 | ||
417 | //Вакансии поиск на главной | 417 | //Вакансии поиск на главной |
418 | Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies'); | 418 | Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies'); |
419 | 419 | ||
420 | //Вакансии категория детальная | 420 | //Вакансии категория детальная |
421 | Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies'); | 421 | Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies'); |
422 | 422 | ||
423 | // Лайк вакансии | 423 | // Лайк вакансии |
424 | Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy'); | 424 | Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy'); |
425 | 425 | ||
426 | //Детальная страница вакансии - работодателя | 426 | //Детальная страница вакансии - работодателя |
427 | Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie'); | 427 | Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie'); |
428 | 428 | ||
429 | //Судоходные компании | 429 | //Судоходные компании |
430 | Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies'); | 430 | Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies'); |
431 | 431 | ||
432 | //Детальная инфа о компании | 432 | //Детальная инфа о компании |
433 | Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company'); | 433 | Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company'); |
434 | 434 | ||
435 | //Образование | 435 | //Образование |
436 | Route::get('education', [MainController::class, 'education'])->name('education'); | 436 | Route::get('education', [MainController::class, 'education'])->name('education'); |
437 | 437 | ||
438 | //Новости | 438 | //Новости |
439 | Route::get('news', [MainController::class, 'news'])->name('news'); | 439 | Route::get('news', [MainController::class, 'news'])->name('news'); |
440 | Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new'); | 440 | Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new'); |
441 | 441 | ||
442 | //Контакты | 442 | //Контакты |
443 | Route::get('contacts', [MainController::class, 'contacts'])->name('contacts'); | 443 | Route::get('contacts', [MainController::class, 'contacts'])->name('contacts'); |
444 | 444 | ||
445 | //База резюме | 445 | //База резюме |
446 | Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume'); | 446 | Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume'); |
447 | 447 | ||
448 | Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume'); | 448 | Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume'); |
449 | 449 | ||
450 | //Анкета соискателя | 450 | //Анкета соискателя |
451 | Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile'); | 451 | Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile'); |
452 | 452 | ||
453 | //Скачать резюме | 453 | //Скачать резюме |
454 | Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download'); | 454 | Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download'); |
455 | Route::get('resume-download/all', [WorkerController::class, 'resume_download_all'])->name('resume_download_all2'); | 455 | Route::get('resume-download/all', [WorkerController::class, 'resume_download_all'])->name('resume_download_all2'); |
456 | Route::get('resume-download', [WorkerController::class, 'resume_download_all'])->name('resume_download_all'); | 456 | Route::get('resume-download', [WorkerController::class, 'resume_download_all'])->name('resume_download_all'); |
457 | 457 | ||
458 | 458 | ||
459 | //Вход в кабинет | 459 | //Вход в кабинет |
460 | Route::get('login', [MainController::class, 'input_login'])->name('login'); | 460 | Route::get('login', [MainController::class, 'input_login'])->name('login'); |
461 | 461 | ||
462 | // Выход из кабинета | 462 | // Выход из кабинета |
463 | Route::get('logout', [EmployerController::class, 'logout'])->name('logout'); | 463 | Route::get('logout', [EmployerController::class, 'logout'])->name('logout'); |
464 | 464 | ||
465 | Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker'); | 465 | Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker'); |
466 | Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer'); | 466 | Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer'); |
467 | 467 | ||
468 | //восстановление пароля | 468 | //восстановление пароля |
469 | Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password'); | 469 | Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password'); |
470 | // Звезда сообщения | 470 | // Звезда сообщения |
471 | Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer'); | 471 | Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer'); |
472 | 472 | ||
473 | // Борьба | 473 | // Борьба |
474 | Route::get('clear_cookie', function() { | 474 | Route::get('clear_cookie', function() { |
475 | \App\Classes\Cookies_vacancy::clear_vacancy(); | 475 | \App\Classes\Cookies_vacancy::clear_vacancy(); |
476 | return redirect()->route('index'); | 476 | return redirect()->route('index'); |
477 | })->name('clear_cookie'); | 477 | })->name('clear_cookie'); |
478 | 478 | ||
479 | Route::get('cookies', function() { | 479 | Route::get('cookies', function() { |
480 | return view('cookies'); | 480 | return view('cookies'); |
481 | })->name('cookies'); | 481 | })->name('cookies'); |
482 | 482 | ||
483 | 483 | ||
484 | 484 | ||
485 | 485 | ||
486 | // Личный кабинет работник | 486 | // Личный кабинет работник |
487 | Route::group([ | 487 | Route::group([ |
488 | 'as' => 'worker.', // имя маршрута, например auth.index | 488 | 'as' => 'worker.', // имя маршрута, например auth.index |
489 | 'prefix' => 'worker', // префикс маршрута, например auth/index | 489 | 'prefix' => 'worker', // префикс маршрута, например auth/index |
490 | 'middleware' => ['auth'], ['is_worker'], | 490 | 'middleware' => ['auth'], ['is_worker'], |
491 | ], function() { | 491 | ], function() { |
492 | // 1 страница - Моя анкета | 492 | // 1 страница - Моя анкета |
493 | Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); | 493 | Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); |
494 | Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); | 494 | Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); |
495 | 495 | ||
496 | // 2 страница - Сообщения | 496 | // 2 страница - Сообщения |
497 | Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); | 497 | Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); |
498 | Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog'); | 498 | Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog'); |
499 | // 3 страница - Избранные вакансии | 499 | // 3 страница - Избранные вакансии |
500 | Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); | 500 | Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); |
501 | // Продолжение борьбы против колорадов - избранные вакансии | 501 | // Продолжение борьбы против колорадов - избранные вакансии |
502 | Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); | 502 | Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); |
503 | 503 | ||
504 | // 4 страница - Сменить пароль | 504 | // 4 страница - Сменить пароль |
505 | Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); | 505 | Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); |
506 | Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password'); | 506 | Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password'); |
507 | 507 | ||
508 | // 5 страница - Удалить профиль | 508 | // 5 страница - Удалить профиль |
509 | Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); | 509 | Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); |
510 | Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); | 510 | Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); |
511 | 511 | ||
512 | // Резюме -pdf | 512 | // Резюме -pdf |
513 | Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); | 513 | Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); |
514 | 514 | ||
515 | // Поднятие анкеты | 515 | // Поднятие анкеты |
516 | Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); | 516 | Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); |
517 | 517 | ||
518 | // Добавление сертификата | 518 | // Добавление сертификата |
519 | Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate'); | 519 | Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate'); |
520 | Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); | 520 | Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); |
521 | Route::get('кабинет/edit_sertificate/{worker}/{doc}', [WorkerController::class, 'edit_sertificate'])->name('edit_sertificate'); | 521 | Route::get('кабинет/edit_sertificate/{worker}/{doc}', [WorkerController::class, 'edit_sertificate'])->name('edit_sertificate'); |
522 | Route::get('кабинет/edit_sertificate/{doc}', [WorkerController::class, 'update_serificate'])->name('update_serificate'); | 522 | Route::get('кабинет/edit_sertificate/{doc}', [WorkerController::class, 'update_serificate'])->name('update_serificate'); |
523 | Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); | 523 | Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); |
524 | 524 | ||
525 | // Добавление предыдущих контактов компании | 525 | // Добавление предыдущих контактов компании |
526 | Route::get('кабинет/prev_company/{worker}', [WorkerController::class, 'new_prev_company'])->name('new_prev_company'); | 526 | Route::get('кабинет/prev_company/{worker}', [WorkerController::class, 'new_prev_company'])->name('new_prev_company'); |
527 | Route::get('кабинет/add_prev_company', [WorkerController::class, 'add_prev_company'])->name('add_prev_company'); | 527 | Route::get('кабинет/add_prev_company', [WorkerController::class, 'add_prev_company'])->name('add_prev_company'); |
528 | Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company'); | 528 | Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company'); |
529 | 529 | ||
530 | // Добавление документа-диплома | 530 | // Добавление документа-диплома |
531 | Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); | 531 | Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); |
532 | Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); | 532 | Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); |
533 | Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom'); | 533 | Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom'); |
534 | 534 | ||
535 | // Добавление стандартного диплома | 535 | // Добавление стандартного диплома |
536 | Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); | 536 | Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); |
537 | Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); | 537 | Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); |
538 | Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); | 538 | Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); |
539 | Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); | 539 | Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); |
540 | Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); | 540 | Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); |
541 | 541 | ||
542 | // Отправка сообщения работодателю от соискателя | 542 | // Отправка сообщения работодателю от соискателя |
543 | Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message'); | 543 | Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message'); |
544 | }); | 544 | }); |
545 | 545 | ||
546 | // Личный кабинет работодателя | 546 | // Личный кабинет работодателя |
547 | Route::group([ | 547 | Route::group([ |
548 | 'as' => 'employer.', // имя маршрута, например auth.index | 548 | 'as' => 'employer.', // имя маршрута, например auth.index |
549 | 'prefix' => 'employer', // префикс маршрута, например auth/index | 549 | 'prefix' => 'employer', // префикс маршрута, например auth/index |
550 | 'middleware' => ['auth'], !['is_worker'], | 550 | 'middleware' => ['auth'], !['is_worker'], |
551 | ], function() { | 551 | ], function() { |
552 | // 1 страница - Профиль | 552 | // 1 страница - Профиль |
553 | Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); | 553 | Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); |
554 | Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); | 554 | Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); |
555 | Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); | 555 | Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); |
556 | Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); | 556 | Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); |
557 | Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot'); | 557 | Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot'); |
558 | 558 | ||
559 | // 2 страница - Добавление вакансий | 559 | // 2 страница - Добавление вакансий |
560 | Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); | 560 | Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); |
561 | Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); | 561 | Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); |
562 | 562 | ||
563 | 563 | ||
564 | Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); | 564 | Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); |
565 | 565 | ||
566 | 566 | ||
567 | // 3 страница - Мои вакансии | 567 | // 3 страница - Мои вакансии |
568 | Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); | 568 | Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); |
569 | Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); | 569 | Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); |
570 | Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); | 570 | Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); |
571 | Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); | 571 | Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); |
572 | Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); | 572 | Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); |
573 | Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); | 573 | Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); |
574 | Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); | 574 | Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); |
575 | 575 | ||
576 | // 4.1Ю. | 576 | // 4.1Ю. |
577 | Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac'); | 577 | Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac'); |
578 | Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save'); | 578 | Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save'); |
579 | Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac'); | 579 | Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac'); |
580 | Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save'); | 580 | Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save'); |
581 | Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac'); | 581 | Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac'); |
582 | 582 | ||
583 | // 4 страница - Отклики на вакансии | 583 | // 4 страница - Отклики на вакансии |
584 | Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); | 584 | Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); |
585 | Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); | 585 | Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); |
586 | Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); | 586 | Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); |
587 | 587 | ||
588 | // 5 страница - Сообщения | 588 | // 5 страница - Сообщения |
589 | Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); | 589 | Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); |
590 | Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); | 590 | Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); |
591 | Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); | 591 | Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); |
592 | Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); | 592 | Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); |
593 | 593 | ||
594 | // 6 страница - Избранный | 594 | // 6 страница - Избранный |
595 | Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); | 595 | Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); |
596 | 596 | ||
597 | //7 страница - База данных | 597 | //7 страница - База данных |
598 | Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); | 598 | Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); |
599 | 599 | ||
600 | //8 страница - База резюме | 600 | //8 страница - База резюме |
601 | Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); | 601 | Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); |
602 | 602 | ||
603 | // 9 рассылка сообщений | 603 | // 9 рассылка сообщений |
604 | Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); | 604 | Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); |
605 | Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); | 605 | Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); |
606 | 606 | ||
607 | // 10 страница FAQ вопросы | 607 | // 10 страница FAQ вопросы |
608 | Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq'); | 608 | Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq'); |
609 | 609 | ||
610 | // 11 страница - Настройка уведомлений | 610 | // 11 страница - Настройка уведомлений |
611 | Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); | 611 | Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); |
612 | Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); | 612 | Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); |
613 | 613 | ||
614 | // 12 страница - Сменить пароль | 614 | // 12 страница - Сменить пароль |
615 | Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); | 615 | Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); |
616 | Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); | 616 | Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); |
617 | 617 | ||
618 | // 13 страница - Удаление профиля | 618 | // 13 страница - Удаление профиля |
619 | Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); | 619 | Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); |
620 | Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); | 620 | Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); |
621 | Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); | 621 | Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); |
622 | 622 | ||
623 | // Отправил сообщение | 623 | // Отправил сообщение |
624 | Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); | 624 | Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); |
625 | }); | 625 | }); |
626 | 626 | ||
627 | Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker'); | ||
627 | 628 | ||
628 | 629 |