Commit 14681d2d2daf27aaaad4618adcda3911e1b99fc3
1 parent
415bebd6cd
Exists in
master
and in
1 other branch
Работодатели кабинет - редактирование флота
Showing 5 changed files with 181 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\BaseUser_min_Request; | 7 | use App\Http\Requests\BaseUser_min_Request; |
8 | use App\Http\Requests\BaseUserRequest; | 8 | use App\Http\Requests\BaseUserRequest; |
9 | use App\Http\Requests\FlotRequest; | 9 | use App\Http\Requests\FlotRequest; |
10 | use App\Http\Requests\MessagesRequiest; | 10 | use App\Http\Requests\MessagesRequiest; |
11 | use App\Http\Requests\VacancyRequestEdit; | 11 | use App\Http\Requests\VacancyRequestEdit; |
12 | use App\Http\Requests\VacansiaRequiest; | 12 | use App\Http\Requests\VacansiaRequiest; |
13 | use App\Mail\MailSotrudnichestvo; | 13 | use App\Mail\MailSotrudnichestvo; |
14 | use App\Mail\SendAllMessages; | 14 | use App\Mail\SendAllMessages; |
15 | use App\Models\Ad_employer; | 15 | use App\Models\Ad_employer; |
16 | use App\Models\Ad_jobs; | 16 | use App\Models\Ad_jobs; |
17 | use App\Models\ad_response; | 17 | use App\Models\ad_response; |
18 | use App\Models\Category; | 18 | use App\Models\Category; |
19 | use App\Models\Education; | 19 | use App\Models\Education; |
20 | use App\Models\Employer; | 20 | use App\Models\Employer; |
21 | use App\Models\employers_main; | 21 | use App\Models\employers_main; |
22 | use App\Models\Flot; | 22 | use App\Models\Flot; |
23 | use App\Models\Job_title; | 23 | use App\Models\Job_title; |
24 | use App\Models\Like_vacancy; | 24 | use App\Models\Like_vacancy; |
25 | use App\Models\Like_worker; | 25 | use App\Models\Like_worker; |
26 | use App\Models\Message; | 26 | use App\Models\Message; |
27 | use App\Models\Positions; | 27 | use App\Models\Positions; |
28 | use App\Models\Worker; | 28 | use App\Models\Worker; |
29 | use Carbon\Carbon; | 29 | use Carbon\Carbon; |
30 | use Illuminate\Auth\Events\Registered; | 30 | use Illuminate\Auth\Events\Registered; |
31 | use Illuminate\Database\Eloquent\Builder; | 31 | use Illuminate\Database\Eloquent\Builder; |
32 | use Illuminate\Database\Eloquent\Model; | 32 | use Illuminate\Database\Eloquent\Model; |
33 | use Illuminate\Foundation\Auth\User; | 33 | use Illuminate\Foundation\Auth\User; |
34 | use Illuminate\Http\Request; | 34 | use Illuminate\Http\Request; |
35 | use Illuminate\Support\Facades\Auth; | 35 | use Illuminate\Support\Facades\Auth; |
36 | use Illuminate\Support\Facades\Hash; | 36 | use Illuminate\Support\Facades\Hash; |
37 | use Illuminate\Support\Facades\Mail; | 37 | use Illuminate\Support\Facades\Mail; |
38 | use Illuminate\Support\Facades\Storage; | 38 | use Illuminate\Support\Facades\Storage; |
39 | use App\Models\User as User_Model; | 39 | use App\Models\User as User_Model; |
40 | use Illuminate\Support\Facades\Validator; | 40 | use Illuminate\Support\Facades\Validator; |
41 | 41 | ||
42 | class EmployerController extends Controller | 42 | class EmployerController extends Controller |
43 | { | 43 | { |
44 | public function vacancie($vacancy, Request $request) { | 44 | public function vacancie($vacancy, Request $request) { |
45 | $title = 'Заголовок вакансии'; | 45 | $title = 'Заголовок вакансии'; |
46 | $Query = Ad_employer::with('jobs')-> | 46 | $Query = Ad_employer::with('jobs')-> |
47 | with('cat')-> | 47 | with('cat')-> |
48 | with('employer')-> | 48 | with('employer')-> |
49 | with('jobs_code')-> | 49 | with('jobs_code')-> |
50 | select('ad_employers.*')-> | 50 | select('ad_employers.*')-> |
51 | where('id', '=', $vacancy)->get(); | 51 | where('id', '=', $vacancy)->get(); |
52 | 52 | ||
53 | if (isset(Auth()->user()->id)) | 53 | if (isset(Auth()->user()->id)) |
54 | $uid = Auth()->user()->id; | 54 | $uid = Auth()->user()->id; |
55 | else | 55 | else |
56 | $uid = 0; | 56 | $uid = 0; |
57 | $title = $Query[0]->name; | 57 | $title = $Query[0]->name; |
58 | if ($request->ajax()) { | 58 | if ($request->ajax()) { |
59 | return view('ajax.vacance-item', compact('Query','uid')); | 59 | return view('ajax.vacance-item', compact('Query','uid')); |
60 | } else { | 60 | } else { |
61 | return view('vacance-item', compact('title', 'Query', 'uid')); | 61 | return view('vacance-item', compact('title', 'Query', 'uid')); |
62 | } | 62 | } |
63 | } | 63 | } |
64 | 64 | ||
65 | public function logout() { | 65 | public function logout() { |
66 | Auth::logout(); | 66 | Auth::logout(); |
67 | return redirect()->route('index') | 67 | return redirect()->route('index') |
68 | ->with('success', 'Вы вышли из личного кабинета'); | 68 | ->with('success', 'Вы вышли из личного кабинета'); |
69 | } | 69 | } |
70 | 70 | ||
71 | public function employer_info() { | 71 | public function employer_info() { |
72 | // код юзера | 72 | // код юзера |
73 | $user_info = Auth()->user(); | 73 | $user_info = Auth()->user(); |
74 | // вьюшка для вывода данных | 74 | // вьюшка для вывода данных |
75 | return view('employers.info', compact('user_info')); | 75 | return view('employers.info', compact('user_info')); |
76 | } | 76 | } |
77 | 77 | ||
78 | public function employer_info_save(User_Model $user, BaseUser_min_Request $request) { | 78 | public function employer_info_save(User_Model $user, BaseUser_min_Request $request) { |
79 | // Все данные через реквест | 79 | // Все данные через реквест |
80 | $all = $request->all(); | 80 | $all = $request->all(); |
81 | unset($all['_token']); | 81 | unset($all['_token']); |
82 | // обновление | 82 | // обновление |
83 | $user->update($all); | 83 | $user->update($all); |
84 | return redirect()->route('employer.employer_info'); | 84 | return redirect()->route('employer.employer_info'); |
85 | } | 85 | } |
86 | 86 | ||
87 | public function cabinet() { | 87 | public function cabinet() { |
88 | $id = Auth()->user()->id; | 88 | $id = Auth()->user()->id; |
89 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | 89 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
90 | WhereHas('users', | 90 | WhereHas('users', |
91 | function (Builder $query) use ($id) {$query->Where('id', $id); | 91 | function (Builder $query) use ($id) {$query->Where('id', $id); |
92 | })->get(); | 92 | })->get(); |
93 | return view('employers.cabinet45', compact('Employer')); | 93 | return view('employers.cabinet45', compact('Employer')); |
94 | } | 94 | } |
95 | 95 | ||
96 | public function slider_flot() { | 96 | public function slider_flot() { |
97 | $id = Auth()->user()->id; | 97 | $id = Auth()->user()->id; |
98 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | 98 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
99 | WhereHas('users', | 99 | WhereHas('users', |
100 | function (Builder $query) use ($id) {$query->Where('id', $id); | 100 | function (Builder $query) use ($id) {$query->Where('id', $id); |
101 | })->get(); | 101 | })->get(); |
102 | return view('employers.fly-flot', compact('Employer')); | 102 | return view('employers.fly-flot', compact('Employer')); |
103 | } | 103 | } |
104 | 104 | ||
105 | public function cabinet_save(Employer $Employer, Request $request) { | 105 | public function cabinet_save(Employer $Employer, Request $request) { |
106 | $params = $request->all(); | 106 | $params = $request->all(); |
107 | $params['user_id'] = Auth()->user()->id; | 107 | $params['user_id'] = Auth()->user()->id; |
108 | $id = $Employer->id; | 108 | $id = $Employer->id; |
109 | 109 | ||
110 | if ($request->has('logo')) { | 110 | if ($request->has('logo')) { |
111 | if (!empty($Employer->logo)) { | 111 | if (!empty($Employer->logo)) { |
112 | Storage::delete($Employer->logo); | 112 | Storage::delete($Employer->logo); |
113 | } | 113 | } |
114 | $params['logo'] = $request->file('logo')->store("employer/$id", 'public'); | 114 | $params['logo'] = $request->file('logo')->store("employer/$id", 'public'); |
115 | } | 115 | } |
116 | 116 | ||
117 | $Employer->update($params); | 117 | $Employer->update($params); |
118 | 118 | ||
119 | return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены'); | 119 | return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены'); |
120 | } | 120 | } |
121 | 121 | ||
122 | public function save_add_flot(FlotRequest $request) { | 122 | public function save_add_flot(FlotRequest $request) { |
123 | // отмена | 123 | // отмена |
124 | $params = $request->all(); | 124 | $params = $request->all(); |
125 | 125 | ||
126 | if ($request->has('image')) { | 126 | if ($request->has('image')) { |
127 | $params['image'] = $request->file('image')->store("flot", 'public'); | 127 | $params['image'] = $request->file('image')->store("flot", 'public'); |
128 | } | 128 | } |
129 | Flot::create($params); | 129 | Flot::create($params); |
130 | $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get(); | 130 | $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get(); |
131 | return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); | 131 | return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); |
132 | } | 132 | } |
133 | 133 | ||
134 | public function edit_flot(Flot $Flot, Employer $Employer) { | ||
135 | return view('employers.edit-flot', compact('Flot', 'Employer')); | ||
136 | } | ||
137 | |||
138 | public function update_flot(FlotRequest $request, Flot $Flot) { | ||
139 | $params = $request->all(); | ||
140 | |||
141 | if ($request->has('image')) { | ||
142 | if (!empty($flot->image)) { | ||
143 | Storage::delete($flot->image); | ||
144 | } | ||
145 | $params['image'] = $request->file('image')->store("flot", 'public'); | ||
146 | } else { | ||
147 | if (!empty($flot->image)) $params['image'] = $flot->image; | ||
148 | } | ||
149 | |||
150 | $Flot->update($params); | ||
151 | return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); | ||
152 | } | ||
153 | |||
134 | public function delete_flot(Flot $Flot) { | 154 | public function delete_flot(Flot $Flot) { |
135 | $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get(); | 155 | $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get(); |
136 | 156 | ||
137 | if (isset($Flot->id)) $Flot->delete(); | 157 | if (isset($Flot->id)) $Flot->delete(); |
138 | return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален'); | 158 | return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален'); |
139 | } | 159 | } |
140 | 160 | ||
141 | // Форма добавления вакансий | 161 | // Форма добавления вакансий |
142 | public function cabinet_vacancie() { | 162 | public function cabinet_vacancie() { |
143 | $id = Auth()->user()->id; | 163 | $id = Auth()->user()->id; |
144 | 164 | ||
145 | $categories = Category::query()->active()->get(); | 165 | $categories = Category::query()->active()->get(); |
146 | $Positions = Category::query()->active()->get(); | 166 | $Positions = Category::query()->active()->get(); |
147 | if ($Positions->count()) { | 167 | if ($Positions->count()) { |
148 | $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->Notbdif()->where('position_id', $Positions[0]->id)->get(); | 168 | $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->Notbdif()->where('position_id', $Positions[0]->id)->get(); |
149 | } else { | 169 | } else { |
150 | $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->Notbdif()->where('position_id', 0)->get(); | 170 | $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->Notbdif()->where('position_id', 0)->get(); |
151 | } | 171 | } |
152 | 172 | ||
153 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | 173 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
154 | WhereHas('users', | 174 | WhereHas('users', |
155 | function (Builder $query) use ($id) {$query->Where('id', $id); | 175 | function (Builder $query) use ($id) {$query->Where('id', $id); |
156 | })->get(); | 176 | })->get(); |
157 | 177 | ||
158 | return view('employers.add_vacancy', compact('Employer', 'jobs' , 'categories', 'Positions')); | 178 | return view('employers.add_vacancy', compact('Employer', 'jobs' , 'categories', 'Positions')); |
159 | } | 179 | } |
160 | 180 | ||
161 | // Сохранение вакансии | 181 | // Сохранение вакансии |
162 | public function cabinet_vacancy_save1(VacancyRequestEdit $request) { | 182 | public function cabinet_vacancy_save1(VacancyRequestEdit $request) { |
163 | $params_emp = $request->all(); | 183 | $params_emp = $request->all(); |
164 | $params_job["job_title_id"] = $params_emp['job_title_id']; | 184 | $params_job["job_title_id"] = $params_emp['job_title_id']; |
165 | $params_job["min_salary"] = $params_emp['min_salary']; | 185 | $params_job["min_salary"] = $params_emp['min_salary']; |
166 | $params_job["max_salary"] = $params_emp['max_salary']; | 186 | $params_job["max_salary"] = $params_emp['max_salary']; |
167 | $params_job["region"] = $params_emp['region']; | 187 | $params_job["region"] = $params_emp['region']; |
168 | $params_job["power"] = $params_emp['power']; | 188 | $params_job["power"] = $params_emp['power']; |
169 | $params_job["sytki"] = $params_emp['sytki']; | 189 | $params_job["sytki"] = $params_emp['sytki']; |
170 | $params_job["start"] = $params_emp['start']; | 190 | $params_job["start"] = $params_emp['start']; |
171 | $params_job["flot"] = $params_emp['flot']; | 191 | $params_job["flot"] = $params_emp['flot']; |
172 | $params_job["description"] = $params_emp['description']; | 192 | $params_job["description"] = $params_emp['description']; |
173 | 193 | ||
174 | $ad_jobs = Ad_employer::create($params_emp); | 194 | $ad_jobs = Ad_employer::create($params_emp); |
175 | $params_job['ad_employer_id'] = $ad_jobs->id; | 195 | $params_job['ad_employer_id'] = $ad_jobs->id; |
176 | Ad_jobs::create($params_job); | 196 | Ad_jobs::create($params_job); |
177 | return redirect()->route('employer.vacancy_list'); | 197 | return redirect()->route('employer.vacancy_list'); |
178 | } | 198 | } |
179 | 199 | ||
180 | // Список вакансий | 200 | // Список вакансий |
181 | public function vacancy_list(Request $request) { | 201 | public function vacancy_list(Request $request) { |
182 | $id = Auth()->user()->id; | 202 | $id = Auth()->user()->id; |
183 | $Employer = Employer::query()->where('user_id', $id)->first(); | 203 | $Employer = Employer::query()->where('user_id', $id)->first(); |
184 | $vacancy_list = Ad_employer::query()->with('jobs')-> | 204 | $vacancy_list = Ad_employer::query()->with('jobs')-> |
185 | with('jobs_code')-> | 205 | with('jobs_code')-> |
186 | where('employer_id', $Employer->id); | 206 | where('employer_id', $Employer->id); |
187 | 207 | ||
188 | if ($request->get('sort')) { | 208 | if ($request->get('sort')) { |
189 | $sort = $request->get('sort'); | 209 | $sort = $request->get('sort'); |
190 | switch ($sort) { | 210 | switch ($sort) { |
191 | case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break; | 211 | case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break; |
192 | case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break; | 212 | case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break; |
193 | case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break; | 213 | case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break; |
194 | case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break; | 214 | case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break; |
195 | case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; | 215 | case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; |
196 | default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; | 216 | default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; |
197 | } | 217 | } |
198 | } | 218 | } |
199 | $vacancy_list = $vacancy_list->paginate(4); | 219 | $vacancy_list = $vacancy_list->paginate(4); |
200 | 220 | ||
201 | //ajax | 221 | //ajax |
202 | if ($request->ajax()) { | 222 | if ($request->ajax()) { |
203 | return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); | 223 | return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); |
204 | } else { | 224 | } else { |
205 | return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); | 225 | return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); |
206 | } | 226 | } |
207 | } | 227 | } |
208 | 228 | ||
209 | // Карточка вакансии | 229 | // Карточка вакансии |
210 | public function vacancy_edit(Ad_employer $ad_employer) { | 230 | public function vacancy_edit(Ad_employer $ad_employer) { |
211 | $id = Auth()->user()->id; | 231 | $id = Auth()->user()->id; |
212 | 232 | ||
213 | $Positions = Category::query()->where('is_remove', '=', '0')->get(); | 233 | $Positions = Category::query()->where('is_remove', '=', '0')->get(); |
214 | if ($Positions->count()) { | 234 | if ($Positions->count()) { |
215 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get(); | 235 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get(); |
216 | } else { | 236 | } else { |
217 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get(); | 237 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get(); |
218 | } | 238 | } |
219 | 239 | ||
220 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | 240 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
221 | where('user_id', $id)->first(); | 241 | where('user_id', $id)->first(); |
222 | 242 | ||
223 | return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); | 243 | return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); |
224 | } | 244 | } |
225 | 245 | ||
226 | // Сохранение-редактирование записи | 246 | // Сохранение-редактирование записи |
227 | public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { | 247 | public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { |
228 | $params = $request->all(); | 248 | $params = $request->all(); |
229 | 249 | ||
230 | //$jobs['flot'] = $params['flot']; | 250 | //$jobs['flot'] = $params['flot']; |
231 | //$jobs['job_title_id'] = $params['job_title_id']; | 251 | //$jobs['job_title_id'] = $params['job_title_id']; |
232 | //$titles['position_id'] = $params['position_id']; | 252 | //$titles['position_id'] = $params['position_id']; |
233 | //unset($params['job_title_id']); | 253 | //unset($params['job_title_id']); |
234 | 254 | ||
235 | $ad_employer->update($params); | 255 | $ad_employer->update($params); |
236 | 256 | ||
237 | //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])-> | 257 | //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])-> |
238 | // where('ad_employer_id', $ad_employer->id)->first(); | 258 | // where('ad_employer_id', $ad_employer->id)->first(); |
239 | //$data = Ad_jobs::find($job_->id); | 259 | //$data = Ad_jobs::find($job_->id); |
240 | //$ad_jobs = $data->update($jobs); | 260 | //$ad_jobs = $data->update($jobs); |
241 | 261 | ||
242 | return redirect()->route('employer.vacancy_list'); | 262 | return redirect()->route('employer.vacancy_list'); |
243 | } | 263 | } |
244 | 264 | ||
245 | // Сохранение карточки вакансии | 265 | // Сохранение карточки вакансии |
246 | public function vacancy_save(Request $request, Ad_employer $ad_employer) { | 266 | public function vacancy_save(Request $request, Ad_employer $ad_employer) { |
247 | $all = $request->all(); | 267 | $all = $request->all(); |
248 | $ad_employer->update($all); | 268 | $ad_employer->update($all); |
249 | return redirect()->route('employer.cabinet_vacancie'); | 269 | return redirect()->route('employer.cabinet_vacancie'); |
250 | } | 270 | } |
251 | 271 | ||
252 | // Удаление карточки вакансии | 272 | // Удаление карточки вакансии |
253 | public function vacancy_delete(Ad_employer $ad_employer) { | 273 | public function vacancy_delete(Ad_employer $ad_employer) { |
254 | $ad_employer->delete(); | 274 | $ad_employer->delete(); |
255 | 275 | ||
256 | return redirect()->route('employer.vacancy_list') | 276 | return redirect()->route('employer.vacancy_list') |
257 | ->with('success', 'Данные были успешно сохранены'); | 277 | ->with('success', 'Данные были успешно сохранены'); |
258 | } | 278 | } |
259 | 279 | ||
260 | // Обновление даты | 280 | // Обновление даты |
261 | public function vacancy_up(Ad_employer $ad_employer) { | 281 | public function vacancy_up(Ad_employer $ad_employer) { |
262 | $up = date('m/d/Y h:i:s', time());; | 282 | $up = date('m/d/Y h:i:s', time());; |
263 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); | 283 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); |
264 | $vac_emp->updated_at = $up; | 284 | $vac_emp->updated_at = $up; |
265 | $vac_emp->save(); | 285 | $vac_emp->save(); |
266 | 286 | ||
267 | return redirect()->route('employer.vacancy_list'); | 287 | return redirect()->route('employer.vacancy_list'); |
268 | // начало конца | 288 | // начало конца |
269 | } | 289 | } |
270 | 290 | ||
271 | //Видимость вакансии | 291 | //Видимость вакансии |
272 | public function vacancy_eye(Ad_employer $ad_employer, $status) { | 292 | public function vacancy_eye(Ad_employer $ad_employer, $status) { |
273 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); | 293 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); |
274 | $vac_emp->active_is = $status; | 294 | $vac_emp->active_is = $status; |
275 | $vac_emp->save(); | 295 | $vac_emp->save(); |
276 | 296 | ||
277 | return redirect()->route('employer.vacancy_list'); | 297 | return redirect()->route('employer.vacancy_list'); |
278 | } | 298 | } |
279 | 299 | ||
280 | //Вакансия редактирования (шаблон) | 300 | //Вакансия редактирования (шаблон) |
281 | public function vacancy_update(Ad_employer $id) { | 301 | public function vacancy_update(Ad_employer $id) { |
282 | 302 | ||
283 | } | 303 | } |
284 | 304 | ||
285 | //Отклики на вакансию - лист | 305 | //Отклики на вакансию - лист |
286 | public function answers(Employer $employer, Request $request) { | 306 | public function answers(Employer $employer, Request $request) { |
287 | $user_id = Auth()->user()->id; | 307 | $user_id = Auth()->user()->id; |
288 | $answer = Ad_employer::query()->where('employer_id', $employer->id); | 308 | $answer = Ad_employer::query()->where('employer_id', $employer->id); |
289 | if ($request->has('search')) { | 309 | if ($request->has('search')) { |
290 | $search = trim($request->get('search')); | 310 | $search = trim($request->get('search')); |
291 | if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); | 311 | if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); |
292 | } | 312 | } |
293 | 313 | ||
294 | $answer = $answer->with('response')->get(); | 314 | $answer = $answer->with('response')->get(); |
295 | 315 | ||
296 | return view('employers.list_answer', compact('answer', 'user_id', 'employer')); | 316 | return view('employers.list_answer', compact('answer', 'user_id', 'employer')); |
297 | } | 317 | } |
298 | 318 | ||
299 | //Обновление статуса | 319 | //Обновление статуса |
300 | public function supple_status(employer $employer, ad_response $ad_response, $flag) { | 320 | public function supple_status(employer $employer, ad_response $ad_response, $flag) { |
301 | $ad_response->update(Array('flag' => $flag)); | 321 | $ad_response->update(Array('flag' => $flag)); |
302 | return redirect()->route('employer.answers', ['employer' => $employer->id]); | 322 | return redirect()->route('employer.answers', ['employer' => $employer->id]); |
303 | } | 323 | } |
304 | 324 | ||
305 | //Страницы сообщений список | 325 | //Страницы сообщений список |
306 | public function messages($type_message) { | 326 | public function messages($type_message) { |
307 | $user_id = Auth()->user()->id; | 327 | $user_id = Auth()->user()->id; |
308 | 328 | ||
309 | $messages_input = Message::query()->with('vacancies')->with('user_from')-> | 329 | $messages_input = Message::query()->with('vacancies')->with('user_from')-> |
310 | Where('to_user_id', $user_id)->OrderByDesc('created_at'); | 330 | Where('to_user_id', $user_id)->OrderByDesc('created_at'); |
311 | 331 | ||
312 | $messages_output = Message::query()->with('vacancies')-> | 332 | $messages_output = Message::query()->with('vacancies')-> |
313 | with('user_to')->where('user_id', $user_id)-> | 333 | with('user_to')->where('user_id', $user_id)-> |
314 | OrderByDesc('created_at'); | 334 | OrderByDesc('created_at'); |
315 | 335 | ||
316 | 336 | ||
317 | $count_input = $messages_input->count(); | 337 | $count_input = $messages_input->count(); |
318 | $count_output = $messages_output->count(); | 338 | $count_output = $messages_output->count(); |
319 | 339 | ||
320 | if ($type_message == 'input') { | 340 | if ($type_message == 'input') { |
321 | $messages = $messages_input->paginate(5); | 341 | $messages = $messages_input->paginate(5); |
322 | } | 342 | } |
323 | 343 | ||
324 | if ($type_message == 'output') { | 344 | if ($type_message == 'output') { |
325 | $messages = $messages_output->paginate(5); | 345 | $messages = $messages_output->paginate(5); |
326 | } | 346 | } |
327 | 347 | ||
328 | //dd($user_id, $messages[2]->vacancies); | 348 | //dd($user_id, $messages[2]->vacancies); |
329 | //jobs); | 349 | //jobs); |
330 | 350 | ||
331 | return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); | 351 | return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); |
332 | } | 352 | } |
333 | 353 | ||
334 | // Диалог между пользователями | 354 | // Диалог между пользователями |
335 | public function dialog(Request $request, User_Model $user1, User_Model $user2) { | 355 | public function dialog(Request $request, User_Model $user1, User_Model $user2) { |
336 | // Получение параметров. | 356 | // Получение параметров. |
337 | if ($request->has('ad_employer')){ | 357 | if ($request->has('ad_employer')){ |
338 | $ad_employer = $request->get('ad_employer'); | 358 | $ad_employer = $request->get('ad_employer'); |
339 | } else { | 359 | } else { |
340 | $ad_employer = 0; | 360 | $ad_employer = 0; |
341 | } | 361 | } |
342 | 362 | ||
343 | if (isset($user2->id)) { | 363 | if (isset($user2->id)) { |
344 | $companion = User_Model::query()->with('workers')-> | 364 | $companion = User_Model::query()->with('workers')-> |
345 | with('employers')-> | 365 | with('employers')-> |
346 | where('id', $user2->id)->first(); | 366 | where('id', $user2->id)->first(); |
347 | } | 367 | } |
348 | 368 | ||
349 | $Messages = Message::query()-> | 369 | $Messages = Message::query()-> |
350 | where('ad_employer_id', '=', $ad_employer)-> | 370 | where('ad_employer_id', '=', $ad_employer)-> |
351 | where(function($query) use ($user1, $user2) { | 371 | where(function($query) use ($user1, $user2) { |
352 | $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); | 372 | $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); |
353 | })->orWhere(function($query) use ($user1, $user2) { | 373 | })->orWhere(function($query) use ($user1, $user2) { |
354 | $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); | 374 | $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); |
355 | })->where('ad_employer_id', '=', $ad_employer)->OrderBy('created_at')->get(); | 375 | })->where('ad_employer_id', '=', $ad_employer)->OrderBy('created_at')->get(); |
356 | 376 | ||
357 | $id_vac = $Messages[$Messages->count() - 1]->ad_employer_id; | 377 | $id_vac = $Messages[$Messages->count() - 1]->ad_employer_id; |
358 | 378 | ||
359 | //$ad_employer = null; | 379 | //$ad_employer = null; |
360 | //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); | 380 | //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); |
361 | $sender = $user1; | 381 | $sender = $user1; |
362 | 382 | ||
363 | return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages')); | 383 | return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages')); |
364 | } | 384 | } |
365 | 385 | ||
366 | // Регистрация работодателя | 386 | // Регистрация работодателя |
367 | public function register_employer(Request $request) { | 387 | public function register_employer(Request $request) { |
368 | $params = $request->all(); | 388 | $params = $request->all(); |
369 | 389 | ||
370 | $rules = [ | 390 | $rules = [ |
371 | //'surname' => ['required', 'string', 'max:255'], | 391 | //'surname' => ['required', 'string', 'max:255'], |
372 | //'name_man' => ['required', 'string', 'max:255'], | 392 | //'name_man' => ['required', 'string', 'max:255'], |
373 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], | 393 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], |
374 | 'name_company' => ['required', 'string', 'max:255'], | 394 | 'name_company' => ['required', 'string', 'max:255'], |
375 | 'password' => ['required', 'string', 'min:6'], | 395 | 'password' => ['required', 'string', 'min:6'], |
376 | ]; | 396 | ]; |
377 | 397 | ||
378 | 398 | ||
379 | $messages = [ | 399 | $messages = [ |
380 | 'required' => 'Укажите обязательное поле', | 400 | 'required' => 'Укажите обязательное поле', |
381 | 'min' => [ | 401 | 'min' => [ |
382 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 402 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
383 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 403 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
384 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 404 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
385 | ], | 405 | ], |
386 | 'max' => [ | 406 | 'max' => [ |
387 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 407 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
388 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 408 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
389 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 409 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
390 | ] | 410 | ] |
391 | ]; | 411 | ]; |
392 | 412 | ||
393 | $email = $request->get('email'); | 413 | $email = $request->get('email'); |
394 | if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { | 414 | if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { |
395 | return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); | 415 | return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); |
396 | } | 416 | } |
397 | 417 | ||
398 | if ($request->get('password') !== $request->get('confirmed')){ | 418 | if ($request->get('password') !== $request->get('confirmed')){ |
399 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); | 419 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); |
400 | } | 420 | } |
401 | 421 | ||
402 | if (strlen($request->get('password')) < 6) { | 422 | if (strlen($request->get('password')) < 6) { |
403 | return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); | 423 | return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); |
404 | } | 424 | } |
405 | /* | 425 | /* |
406 | $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); | 426 | $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); |
407 | $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', | 427 | $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', |
408 | 'X', 'C', 'V', 'B', 'N', 'M'); | 428 | 'X', 'C', 'V', 'B', 'N', 'M'); |
409 | $spec_bool = false; | 429 | $spec_bool = false; |
410 | $alpha_bool = false; | 430 | $alpha_bool = false; |
411 | 431 | ||
412 | $haystack = $request->get('password'); | 432 | $haystack = $request->get('password'); |
413 | 433 | ||
414 | foreach ($specsumbol as $it) { | 434 | foreach ($specsumbol as $it) { |
415 | if (strpos($haystack, $it) !== false) { | 435 | if (strpos($haystack, $it) !== false) { |
416 | $spec_bool = true; | 436 | $spec_bool = true; |
417 | } | 437 | } |
418 | } | 438 | } |
419 | 439 | ||
420 | foreach ($alpha as $it) { | 440 | foreach ($alpha as $it) { |
421 | if (strpos($haystack, $it) !== false) { | 441 | if (strpos($haystack, $it) !== false) { |
422 | $alpha_bool = true; | 442 | $alpha_bool = true; |
423 | } | 443 | } |
424 | } | 444 | } |
425 | 445 | ||
426 | if ((!$spec_bool) || (!$alpha_bool)) { | 446 | if ((!$spec_bool) || (!$alpha_bool)) { |
427 | return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); | 447 | return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); |
428 | }*/ | 448 | }*/ |
429 | 449 | ||
430 | if (empty($request->get('surname'))) { | 450 | if (empty($request->get('surname'))) { |
431 | $params['surname'] = 'Неизвестно'; | 451 | $params['surname'] = 'Неизвестно'; |
432 | } | 452 | } |
433 | if (empty($request->get('name_man'))) { | 453 | if (empty($request->get('name_man'))) { |
434 | $params['name_man'] = 'Неизвестно'; | 454 | $params['name_man'] = 'Неизвестно'; |
435 | } | 455 | } |
436 | $validator = Validator::make($params, $rules, $messages); | 456 | $validator = Validator::make($params, $rules, $messages); |
437 | 457 | ||
438 | if ($validator->fails()) { | 458 | if ($validator->fails()) { |
439 | return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); | 459 | return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); |
440 | } else { | 460 | } else { |
441 | $user = $this->create($params); | 461 | $user = $this->create($params); |
442 | event(new Registered($user)); | 462 | event(new Registered($user)); |
443 | Auth::guard()->login($user); | 463 | Auth::guard()->login($user); |
444 | } | 464 | } |
445 | 465 | ||
446 | if ($user) { | 466 | if ($user) { |
447 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; | 467 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; |
448 | } else { | 468 | } else { |
449 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); | 469 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); |
450 | } | 470 | } |
451 | } | 471 | } |
452 | 472 | ||
453 | // Создание пользователя | 473 | // Создание пользователя |
454 | protected function create(array $data) | 474 | protected function create(array $data) |
455 | { | 475 | { |
456 | $Use = new User_Model(); | 476 | $Use = new User_Model(); |
457 | $Code_user = $Use->create([ | 477 | $Code_user = $Use->create([ |
458 | 'name' => $data['surname']." ".$data['name_man'], | 478 | 'name' => $data['surname']." ".$data['name_man'], |
459 | 'name_man' => $data['name_man'], | 479 | 'name_man' => $data['name_man'], |
460 | 'surname' => $data['surname'], | 480 | 'surname' => $data['surname'], |
461 | 'surname2' => $data['surname2'], | 481 | 'surname2' => $data['surname2'], |
462 | 'subscribe_email' => $data['email'], | 482 | 'subscribe_email' => $data['email'], |
463 | 'email' => $data['email'], | 483 | 'email' => $data['email'], |
464 | 'telephone' => $data['telephone'], | 484 | 'telephone' => $data['telephone'], |
465 | 'is_worker' => 0, | 485 | 'is_worker' => 0, |
466 | 'password' => Hash::make($data['password']), | 486 | 'password' => Hash::make($data['password']), |
467 | 'pubpassword' => base64_encode($data['password']), | 487 | 'pubpassword' => base64_encode($data['password']), |
468 | 'email_verified_at' => Carbon::now() | 488 | 'email_verified_at' => Carbon::now() |
469 | ]); | 489 | ]); |
470 | 490 | ||
471 | if ($Code_user->id > 0) { | 491 | if ($Code_user->id > 0) { |
472 | $Employer = new Employer(); | 492 | $Employer = new Employer(); |
473 | $Employer->user_id = $Code_user->id; | 493 | $Employer->user_id = $Code_user->id; |
474 | $Employer->name_company = $data['name_company']; | 494 | $Employer->name_company = $data['name_company']; |
475 | $Employer->email = $data['email']; | 495 | $Employer->email = $data['email']; |
476 | $Employer->telephone = $data['telephone']; | 496 | $Employer->telephone = $data['telephone']; |
477 | $Employer->code = Tools::generator_id(10); | 497 | $Employer->code = Tools::generator_id(10); |
478 | $Employer->save(); | 498 | $Employer->save(); |
479 | 499 | ||
480 | return $Code_user; | 500 | return $Code_user; |
481 | } | 501 | } |
482 | } | 502 | } |
483 | 503 | ||
484 | // Отправка сообщения от работодателя | 504 | // Отправка сообщения от работодателя |
485 | public function send_message(MessagesRequiest $request) { | 505 | public function send_message(MessagesRequiest $request) { |
486 | $params = $request->all(); | 506 | $params = $request->all(); |
487 | dd($params); | 507 | dd($params); |
488 | $user1 = $params['user_id']; | 508 | $user1 = $params['user_id']; |
489 | $user2 = $params['to_user_id']; | 509 | $user2 = $params['to_user_id']; |
490 | 510 | ||
491 | if ($request->has('file')) { | 511 | if ($request->has('file')) { |
492 | $params['file'] = $request->file('file')->store("messages", 'public'); | 512 | $params['file'] = $request->file('file')->store("messages", 'public'); |
493 | } | 513 | } |
494 | Message::create($params); | 514 | Message::create($params); |
495 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); | 515 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); |
496 | } | 516 | } |
497 | 517 | ||
498 | public function test123(Request $request) { | 518 | public function test123(Request $request) { |
499 | $params = $request->all(); | 519 | $params = $request->all(); |
500 | $user1 = $params['user_id']; | 520 | $user1 = $params['user_id']; |
501 | $user2 = $params['to_user_id']; | 521 | $user2 = $params['to_user_id']; |
502 | 522 | ||
503 | $rules = [ | 523 | $rules = [ |
504 | 'text' => 'required|min:1|max:150000', | 524 | 'text' => 'required|min:1|max:150000', |
505 | 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' | 525 | 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' |
506 | ]; | 526 | ]; |
507 | $messages = [ | 527 | $messages = [ |
508 | 'required' => 'Укажите обязательное поле', | 528 | 'required' => 'Укажите обязательное поле', |
509 | 'min' => [ | 529 | 'min' => [ |
510 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 530 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
511 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 531 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
512 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 532 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
513 | ], | 533 | ], |
514 | 'max' => [ | 534 | 'max' => [ |
515 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 535 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
516 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 536 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
517 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 537 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
518 | ] | 538 | ] |
519 | ]; | 539 | ]; |
520 | 540 | ||
521 | $validator = Validator::make($request->all(), $rules, $messages); | 541 | $validator = Validator::make($request->all(), $rules, $messages); |
522 | 542 | ||
523 | if ($validator->fails()) { | 543 | if ($validator->fails()) { |
524 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) | 544 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) |
525 | ->withErrors($validator); | 545 | ->withErrors($validator); |
526 | } else { | 546 | } else { |
527 | if ($request->has('file')) { | 547 | if ($request->has('file')) { |
528 | $params['file'] = $request->file('file')->store("messages", 'public'); | 548 | $params['file'] = $request->file('file')->store("messages", 'public'); |
529 | } | 549 | } |
530 | Message::create($params); | 550 | Message::create($params); |
531 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); | 551 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); |
532 | 552 | ||
533 | } | 553 | } |
534 | } | 554 | } |
535 | 555 | ||
536 | //Избранные люди | 556 | //Избранные люди |
537 | public function favorites(Request $request) { | 557 | public function favorites(Request $request) { |
538 | $IP_address = RusDate::ip_addr_client(); | 558 | $IP_address = RusDate::ip_addr_client(); |
539 | $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); | 559 | $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); |
540 | 560 | ||
541 | if ($Arr->count()) { | 561 | if ($Arr->count()) { |
542 | $A = Array(); | 562 | $A = Array(); |
543 | foreach ($Arr as $it) { | 563 | foreach ($Arr as $it) { |
544 | $A[] = $it->code_record; | 564 | $A[] = $it->code_record; |
545 | } | 565 | } |
546 | 566 | ||
547 | $Workers = Worker::query()->whereIn('id', $A); | 567 | $Workers = Worker::query()->whereIn('id', $A); |
548 | } else { | 568 | } else { |
549 | $Workers = Worker::query()->where('id', '=', '0'); | 569 | $Workers = Worker::query()->where('id', '=', '0'); |
550 | } | 570 | } |
551 | 571 | ||
552 | if (($request->has('search')) && (!empty($request->get('search')))) { | 572 | if (($request->has('search')) && (!empty($request->get('search')))) { |
553 | $search = $request->get('search'); | 573 | $search = $request->get('search'); |
554 | 574 | ||
555 | $Workers = $Workers->WhereHas('users', | 575 | $Workers = $Workers->WhereHas('users', |
556 | function (Builder $query) use ($search) { | 576 | function (Builder $query) use ($search) { |
557 | $query->Where('surname', 'LIKE', "%$search%") | 577 | $query->Where('surname', 'LIKE', "%$search%") |
558 | ->orWhere('name_man', 'LIKE', "%$search%") | 578 | ->orWhere('name_man', 'LIKE', "%$search%") |
559 | ->orWhere('surname2', 'LIKE', "%$search%"); | 579 | ->orWhere('surname2', 'LIKE', "%$search%"); |
560 | }); | 580 | }); |
561 | } else { | 581 | } else { |
562 | $Workers = $Workers->with('users'); | 582 | $Workers = $Workers->with('users'); |
563 | } | 583 | } |
564 | 584 | ||
565 | $Workers = $Workers->get(); | 585 | $Workers = $Workers->get(); |
566 | 586 | ||
567 | 587 | ||
568 | return view('employers.favorite', compact('Workers')); | 588 | return view('employers.favorite', compact('Workers')); |
569 | } | 589 | } |
570 | 590 | ||
571 | // База данных | 591 | // База данных |
572 | public function bd(Request $request) { | 592 | public function bd(Request $request) { |
573 | // для типа BelongsTo | 593 | // для типа BelongsTo |
574 | //$documents = Document::query()->orderBy(Location::select('name') | 594 | //$documents = Document::query()->orderBy(Location::select('name') |
575 | // ->whereColumn('locations.id', 'documents.location_id') | 595 | // ->whereColumn('locations.id', 'documents.location_id') |
576 | //); | 596 | //); |
577 | 597 | ||
578 | // для типа HasOne/Many | 598 | // для типа HasOne/Many |
579 | // $documents = Document::::query()->orderBy(Location::select('name') | 599 | // $documents = Document::::query()->orderBy(Location::select('name') |
580 | // ->whereColumn('locations.document_id', 'documents.id') | 600 | // ->whereColumn('locations.document_id', 'documents.id') |
581 | //); | 601 | //); |
582 | 602 | ||
583 | 603 | ||
584 | $users = User_Model::query()->with('workers'); | 604 | $users = User_Model::query()->with('workers'); |
585 | 605 | ||
586 | if ($request->has('search')) { | 606 | if ($request->has('search')) { |
587 | $find_key = $request->get('search'); | 607 | $find_key = $request->get('search'); |
588 | $users = $users->where('name', 'LIKE', "%$find_key%") | 608 | $users = $users->where('name', 'LIKE', "%$find_key%") |
589 | ->orWhere('surname', 'LIKE', "%$find_key%") | 609 | ->orWhere('surname', 'LIKE', "%$find_key%") |
590 | ->orWhere('name_man', 'LIKE', "%$find_key%") | 610 | ->orWhere('name_man', 'LIKE', "%$find_key%") |
591 | ->orWhere('email', 'LIKE', "%$find_key%") | 611 | ->orWhere('email', 'LIKE', "%$find_key%") |
592 | ->orWhere('telephone', 'LIKE', "%$find_key%"); | 612 | ->orWhere('telephone', 'LIKE', "%$find_key%"); |
593 | } | 613 | } |
594 | 614 | ||
595 | // Данные | 615 | // Данные |
596 | $users = $users->Baseuser()-> | 616 | $users = $users->Baseuser()-> |
597 | orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id')); | 617 | orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id')); |
598 | $count_users = $users; | 618 | $count_users = $users; |
599 | $users = $users->paginate(5); | 619 | $users = $users->paginate(5); |
600 | 620 | ||
601 | 621 | ||
602 | return view('employers.bd', compact('users', 'count_users')); | 622 | return view('employers.bd', compact('users', 'count_users')); |
603 | } | 623 | } |
604 | 624 | ||
605 | //Настройка уведомлений | 625 | //Настройка уведомлений |
606 | public function subscribe() { | 626 | public function subscribe() { |
607 | return view('employers.subcribe'); | 627 | return view('employers.subcribe'); |
608 | } | 628 | } |
609 | 629 | ||
610 | //Установка уведомлений сохранение | 630 | //Установка уведомлений сохранение |
611 | public function save_subscribe(Request $request) { | 631 | public function save_subscribe(Request $request) { |
612 | dd($request->all()); | 632 | dd($request->all()); |
613 | $msg = $request->validate([ | 633 | $msg = $request->validate([ |
614 | 'subscribe_email' => 'required|email|min:5|max:255', | 634 | 'subscribe_email' => 'required|email|min:5|max:255', |
615 | ]); | 635 | ]); |
616 | return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); | 636 | return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); |
617 | } | 637 | } |
618 | 638 | ||
619 | //Сбросить форму с паролем | 639 | //Сбросить форму с паролем |
620 | public function password_reset() { | 640 | public function password_reset() { |
621 | $email = Auth()->user()->email; | 641 | $email = Auth()->user()->email; |
622 | return view('employers.password-reset', compact('email')); | 642 | return view('employers.password-reset', compact('email')); |
623 | } | 643 | } |
624 | 644 | ||
625 | //Обновление пароля | 645 | //Обновление пароля |
626 | public function new_password(Request $request) { | 646 | public function new_password(Request $request) { |
627 | $use = Auth()->user(); | 647 | $use = Auth()->user(); |
628 | $request->validate([ | 648 | $request->validate([ |
629 | 'password' => 'required|string', | 649 | 'password' => 'required|string', |
630 | 'new_password' => 'required|string', | 650 | 'new_password' => 'required|string', |
631 | 'new_password2' => 'required|string' | 651 | 'new_password2' => 'required|string' |
632 | ]); | 652 | ]); |
633 | 653 | ||
634 | if ($request->get('new_password') == $request->get('new_password2')) | 654 | if ($request->get('new_password') == $request->get('new_password2')) |
635 | if ($request->get('password') !== $request->get('new_password')) { | 655 | if ($request->get('password') !== $request->get('new_password')) { |
636 | $credentials = $request->only('email', 'password'); | 656 | $credentials = $request->only('email', 'password'); |
637 | if (Auth::attempt($credentials)) { | 657 | if (Auth::attempt($credentials)) { |
638 | 658 | ||
639 | if (!is_null($use->email_verified_at)){ | 659 | if (!is_null($use->email_verified_at)){ |
640 | 660 | ||
641 | $user_data = User_Model::find($use->id); | 661 | $user_data = User_Model::find($use->id); |
642 | $user_data->update([ | 662 | $user_data->update([ |
643 | 'password' => Hash::make($request->get('new_password')), | 663 | 'password' => Hash::make($request->get('new_password')), |
644 | 'pubpassword' => base64_encode($request->get('new_password')), | 664 | 'pubpassword' => base64_encode($request->get('new_password')), |
645 | ]); | 665 | ]); |
646 | return redirect() | 666 | return redirect() |
647 | ->route('employer.password_reset') | 667 | ->route('employer.password_reset') |
648 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); | 668 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); |
649 | } | 669 | } |
650 | 670 | ||
651 | return redirect() | 671 | return redirect() |
652 | ->route('employer.password_reset') | 672 | ->route('employer.password_reset') |
653 | ->withError('Данная учетная запись не было верифицированна!'); | 673 | ->withError('Данная учетная запись не было верифицированна!'); |
654 | } | 674 | } |
655 | } | 675 | } |
656 | 676 | ||
657 | return redirect() | 677 | return redirect() |
658 | ->route('employer.password_reset') | 678 | ->route('employer.password_reset') |
659 | ->withErrors('Не совпадение данных, обновите пароли!'); | 679 | ->withErrors('Не совпадение данных, обновите пароли!'); |
660 | } | 680 | } |
661 | 681 | ||
662 | 682 | ||
663 | 683 | ||
664 | // Форма Удаление пипла | 684 | // Форма Удаление пипла |
665 | public function delete_people() { | 685 | public function delete_people() { |
666 | $login = Auth()->user()->email; | 686 | $login = Auth()->user()->email; |
667 | return view('employers.delete_people', compact('login')); | 687 | return view('employers.delete_people', compact('login')); |
668 | } | 688 | } |
669 | 689 | ||
670 | // Удаление аккаунта | 690 | // Удаление аккаунта |
671 | public function action_delete_user(Request $request) { | 691 | public function action_delete_user(Request $request) { |
672 | $Answer = $request->all(); | 692 | $Answer = $request->all(); |
673 | $user_id = Auth()->user()->id; | 693 | $user_id = Auth()->user()->id; |
674 | $request->validate([ | 694 | $request->validate([ |
675 | 'password' => 'required|string', | 695 | 'password' => 'required|string', |
676 | ]); | 696 | ]); |
677 | 697 | ||
678 | $credentials = $request->only('email', 'password'); | 698 | $credentials = $request->only('email', 'password'); |
679 | if (Auth::attempt($credentials)) { | 699 | if (Auth::attempt($credentials)) { |
680 | Auth::logout(); | 700 | Auth::logout(); |
681 | $it = User_Model::find($user_id); | 701 | $it = User_Model::find($user_id); |
682 | $it->delete(); | 702 | $it->delete(); |
683 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); | 703 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); |
684 | } else { | 704 | } else { |
685 | return redirect()->route('employer.delete_people') | 705 | return redirect()->route('employer.delete_people') |
686 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); | 706 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); |
687 | } | 707 | } |
688 | } | 708 | } |
689 | 709 | ||
690 | public function ajax_delete_user(Request $request) { | 710 | public function ajax_delete_user(Request $request) { |
691 | $Answer = $request->all(); | 711 | $Answer = $request->all(); |
692 | $user_id = Auth()->user()->id; | 712 | $user_id = Auth()->user()->id; |
693 | $request->validate([ | 713 | $request->validate([ |
694 | 'password' => 'required|string', | 714 | 'password' => 'required|string', |
695 | ]); | 715 | ]); |
696 | $credentials = $request->only('email', 'password'); | 716 | $credentials = $request->only('email', 'password'); |
697 | if (Auth::attempt($credentials)) { | 717 | if (Auth::attempt($credentials)) { |
698 | 718 | ||
699 | return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', | 719 | return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', |
700 | 'email' => $request->get('email'), | 720 | 'email' => $request->get('email'), |
701 | 'password' => $request->get('password'))); | 721 | 'password' => $request->get('password'))); |
702 | } else { | 722 | } else { |
703 | return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); | 723 | return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); |
704 | } | 724 | } |
705 | } | 725 | } |
706 | 726 | ||
707 | // FAQ - Вопросы/ответы для работодателей и соискателей | 727 | // FAQ - Вопросы/ответы для работодателей и соискателей |
708 | public function faq() { | 728 | public function faq() { |
709 | return view('employers.faq'); | 729 | return view('employers.faq'); |
710 | } | 730 | } |
711 | 731 | ||
712 | // Рассылка сообщений | 732 | // Рассылка сообщений |
713 | public function send_all_messages() { | 733 | public function send_all_messages() { |
714 | return view('employers.send_all'); | 734 | return view('employers.send_all'); |
715 | } | 735 | } |
716 | 736 | ||
717 | // Отправка сообщений для информации | 737 | // Отправка сообщений для информации |
718 | public function send_all_post(Request $request) { | 738 | public function send_all_post(Request $request) { |
719 | $data = $request->all(); | 739 | $data = $request->all(); |
720 | 740 | ||
721 | $emails = User_Model::query()->where('is_worker', '1')->get(); | 741 | $emails = User_Model::query()->where('is_worker', '1')->get(); |
722 | 742 | ||
723 | foreach ($emails as $e) { | 743 | foreach ($emails as $e) { |
724 | Mail::to($e->email)->send(new SendAllMessages($data)); | 744 | Mail::to($e->email)->send(new SendAllMessages($data)); |
725 | } | 745 | } |
726 | 746 | ||
727 | return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); | 747 | return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); |
728 | } | 748 | } |
729 | 749 | ||
730 | // База резюме | 750 | // База резюме |
731 | public function bd_tupe(Request $request) { | 751 | public function bd_tupe(Request $request) { |
732 | $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); | 752 | $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); |
733 | 753 | ||
734 | return view('employers.bd_tupe', compact('Resume')); | 754 | return view('employers.bd_tupe', compact('Resume')); |
735 | } | 755 | } |
736 | 756 | ||
737 | ////////////////////////////////////////////////////////////////// | 757 | ////////////////////////////////////////////////////////////////// |
738 | // Отправил сообщение | 758 | // Отправил сообщение |
739 | ////////////////////////////////////////////////////////////////// | 759 | ////////////////////////////////////////////////////////////////// |
740 | public function new_message(Request $request) { | 760 | public function new_message(Request $request) { |
741 | $params = $request->all(); | 761 | $params = $request->all(); |
742 | $id = $params['_user_id']; | 762 | $id = $params['_user_id']; |
743 | $message = new Message(); | 763 | $message = new Message(); |
744 | $message->user_id = $params['_user_id']; | 764 | $message->user_id = $params['_user_id']; |
745 | $message->to_user_id = $params['_to_user_id']; | 765 | $message->to_user_id = $params['_to_user_id']; |
746 | $message->title = $params['title']; | 766 | $message->title = $params['title']; |
747 | $message->text = $params['text']; | 767 | $message->text = $params['text']; |
748 | if ($request->has('_file')) { | 768 | if ($request->has('_file')) { |
749 | $message->file = $request->file('_file')->store("worker/$id", 'public'); | 769 | $message->file = $request->file('_file')->store("worker/$id", 'public'); |
750 | } | 770 | } |
751 | $message->ad_employer_id = $params['_vacancy']; | 771 | $message->ad_employer_id = $params['_vacancy']; |
752 | $message->flag_new = 1; | 772 | $message->flag_new = 1; |
753 | $id_message = $message->save(); | 773 | $id_message = $message->save(); |
754 | 774 | ||
755 | //$data['message_id'] = $id_message; | 775 | //$data['message_id'] = $id_message; |
756 | //$data['ad_employer_id'] = $params['_vacancy']; | 776 | //$data['ad_employer_id'] = $params['_vacancy']; |
757 | //$data['job_title_id'] = 0; | 777 | //$data['job_title_id'] = 0; |
758 | 778 | ||
759 | $data['flag'] = 1; | 779 | $data['flag'] = 1; |
760 | //$ad_responce = ad_response::create($data); | 780 | //$ad_responce = ad_response::create($data); |
761 | return redirect()->route('employer.messages', ['type_message' => 'output']); | 781 | return redirect()->route('employer.messages', ['type_message' => 'output']); |
762 | } | 782 | } |
763 | 783 | ||
764 | // Восстановление пароля | 784 | // Восстановление пароля |
765 | public function repair_password(Request $request) { | 785 | public function repair_password(Request $request) { |
766 | $params = $request->get('email'); | 786 | $params = $request->get('email'); |
767 | } | 787 | } |
768 | 788 | ||
769 | // Избранные люди на корабль | 789 | // Избранные люди на корабль |
770 | public function selected_people(Request $request) { | 790 | public function selected_people(Request $request) { |
771 | $id = $request->get('id'); | 791 | $id = $request->get('id'); |
772 | $favorite_people = Job_title::query()->Notbdif()->where('is_remove', '=', '0')->where('position_id', $id)->get(); | 792 | $favorite_people = Job_title::query()->Notbdif()->where('is_remove', '=', '0')->where('position_id', $id)->get(); |
773 | return view('favorite_people', compact('favorite_people')); | 793 | return view('favorite_people', compact('favorite_people')); |
774 | } | 794 | } |
775 | } | 795 | } |
776 | 796 |
app/Http/Requests/FlotRequest.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Http\Requests; | 3 | namespace App\Http\Requests; |
4 | 4 | ||
5 | use Illuminate\Foundation\Http\FormRequest; | 5 | use Illuminate\Foundation\Http\FormRequest; |
6 | 6 | ||
7 | class FlotRequest extends FormRequest | 7 | class FlotRequest extends FormRequest |
8 | { | 8 | { |
9 | /** | 9 | /** |
10 | * Determine if the user is authorized to make this request. | 10 | * Determine if the user is authorized to make this request. |
11 | * | 11 | * |
12 | * @return bool | 12 | * @return bool |
13 | */ | 13 | */ |
14 | public function authorize() | 14 | public function authorize() |
15 | { | 15 | { |
16 | return true; | 16 | return true; |
17 | } | 17 | } |
18 | 18 | ||
19 | /** | 19 | /** |
20 | * Get the validation rules that apply to the request. | 20 | * Get the validation rules that apply to the request. |
21 | * | 21 | * |
22 | * @return array<string, mixed> | 22 | * @return array<string, mixed> |
23 | */ | 23 | */ |
24 | public function rules() | 24 | public function rules() |
25 | { | 25 | { |
26 | return [ | 26 | return [ |
27 | 'name' => 'required|min:3|max:255', | 27 | 'name' => 'required|min:3|max:255', |
28 | 'text' => 'required|min:5', | 28 | 'text' => 'required|min:5', |
29 | 'image' => [ | 29 | //'image' => [ |
30 | 'mimes:jpeg,jpg,png', | 30 | // 'mimes:jpeg,jpg,png', |
31 | 'max:20000' | 31 | // 'max:20000' |
32 | ], | 32 | //], |
33 | 'region' => 'required|min:3|max:255', | 33 | 'region' => 'required|min:3|max:255', |
34 | 'power' => 'required|min:3|max:255' | 34 | 'power' => 'required|min:3|max:255' |
35 | ]; | 35 | ]; |
36 | } | 36 | } |
37 | 37 | ||
38 | public function messages() { | 38 | public function messages() { |
39 | return [ | 39 | return [ |
40 | 'required' => 'Поле :attribute обязательно для ввода', | 40 | 'required' => 'Поле :attribute обязательно для ввода', |
41 | 'min' => [ | 41 | 'min' => [ |
42 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 42 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
43 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 43 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
44 | ], | 44 | ], |
45 | 'max' => [ | 45 | 'max' => [ |
46 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 46 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
47 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 47 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
48 | ], | 48 | ], |
49 | 'email' => 'Введите корректный емайл' | 49 | 'email' => 'Введите корректный емайл' |
50 | 50 | ||
51 | ]; | 51 | ]; |
52 | } | 52 | } |
53 | } | 53 | } |
54 | 54 |
resources/views/employers/edit-flot.blade.php
File was created | 1 | @extends('layout.frontend', ['title' => 'Редактирование флота - РекаМоре']) | |
2 | |||
3 | @section('scripts') | ||
4 | <script src="https://cdn.ckeditor.com/ckeditor5/23.0.0/classic/ckeditor.js"></script> | ||
5 | <script> | ||
6 | ClassicEditor | ||
7 | .create( document.querySelector( '#txtarea' ) ) | ||
8 | .catch( error => { | ||
9 | console.error( error ); | ||
10 | } ); | ||
11 | </script> | ||
12 | @endsection | ||
13 | @section('content') | ||
14 | <section class="cabinet"> | ||
15 | <div class="container"> | ||
16 | <ul class="breadcrumbs cabinet__breadcrumbs"> | ||
17 | <li><a href="{{ route('index') }}">Главная</a></li> | ||
18 | <li><b>Личный кабинет</b></li> | ||
19 | </ul> | ||
20 | <div class="cabinet__wrapper"> | ||
21 | <div class="cabinet__side"> | ||
22 | <div class="cabinet__side-toper"> | ||
23 | @include('employers.emblema') | ||
24 | </div> | ||
25 | |||
26 | @include('employers.menu', ['item' => 12]) | ||
27 | |||
28 | </div> | ||
29 | <div class="cabinet__body"> | ||
30 | @include('messages_error') | ||
31 | |||
32 | <div class="cabinet__body-item"> | ||
33 | <div class="cabinet__descr"> | ||
34 | <h2 class="title cabinet__title">Редактирование флота</h2> | ||
35 | </div> | ||
36 | |||
37 | <form action="{{ route('employer.update_flot_save', ['Flot' => $Flot->id]) }}" enctype="multipart/form-data" method="POST" class="cabinet__add"> | ||
38 | @csrf | ||
39 | <label class="cabinet__add-pic" style="vertical-align: top"> | ||
40 | <input type="file" name="image" id="image"> | ||
41 | @error('image') | ||
42 | <span class="text-xs text-red-600"> | ||
43 | {{ $message }} | ||
44 | </span> | ||
45 | @enderror | ||
46 | <input type="hidden" name="employer_id" id="employer_id" value="{{ $Employer->id }}"/> | ||
47 | <svg> | ||
48 | <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> | ||
49 | </svg> | ||
50 | <span> | ||
51 | <svg> | ||
52 | <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use> | ||
53 | </svg> | ||
54 | Загрузить фото | ||
55 | </span> | ||
56 | </label> | ||
57 | |||
58 | <div class="cabinet__add-body"> | ||
59 | <div class="form-group"> | ||
60 | <label class="form-group__label">Название</label> | ||
61 | <div class="form-group__item"> | ||
62 | <input type="text" name="name" id="flot_name" class="input" value="{{ old('name') ?? $Flot->name ?? '' }}" placeholder="Корабль №000001" required> | ||
63 | @error('name') | ||
64 | <span class="text-xs text-red-600"> | ||
65 | {{ $message }} | ||
66 | </span> | ||
67 | @enderror | ||
68 | </div> | ||
69 | </div> | ||
70 | <div class="form-group" style="display:none"> | ||
71 | <label class="form-group__label">Описание</label> | ||
72 | <div class="form-group__item"> | ||
73 | <input type="text" name="text" id="flot_text" class="input" placeholder="Это судно находится..." value="{{ old('text') ?? $Flot->text ?? '' }}"> | ||
74 | @error('text') | ||
75 | <span class="text-xs text-red-600"> | ||
76 | {{ $message }} | ||
77 | </span> | ||
78 | @enderror | ||
79 | </div> | ||
80 | </div> | ||
81 | <div class="form-group" style="display:none"> | ||
82 | <label class="form-group__label">Регион</label> | ||
83 | <div class="form-group__item"> | ||
84 | <input type="text" name="region" id="region" class="input" placeholder="Мурманск" value="{{ old('region') ?? $Flot->region ?? '' }}"> | ||
85 | @error('region') | ||
86 | <span class="text-xs text-red-600"> | ||
87 | {{ $message }} | ||
88 | </span> | ||
89 | @enderror | ||
90 | </div> | ||
91 | </div> | ||
92 | <div class="form-group" style="display:none"> | ||
93 | <label class="form-group__label">Мощность</label> | ||
94 | <div class="form-group__item"> | ||
95 | <input type="text" name="power" id="flot_power" class="input" placeholder="Dw 40000 9000Kw" value="{{ old('power') ?? $Flot->power ?? '' }}"> | ||
96 | @error('power') | ||
97 | <span class="text-xs text-red-600"> | ||
98 | {{ $message }} | ||
99 | </span> | ||
100 | @enderror | ||
101 | </div> | ||
102 | </div> | ||
103 | <div class="form-group"> | ||
104 | <label class="form-group__label">DWT</label> | ||
105 | <div class="form-group__item"> | ||
106 | <input type="text" name="DWT" id="flot_DWT" class="input" placeholder="4000 т" value="{{ old('DWT') ?? $Flot->DWT ?? '' }}"> | ||
107 | @error('DWT') | ||
108 | <span class="text-xs text-red-600"> | ||
109 | {{ $message }} | ||
110 | </span> | ||
111 | @enderror | ||
112 | </div> | ||
113 | </div> | ||
114 | <div class="form-group"> | ||
115 | <label class="form-group__label">Мощность ГД (кВт)</label> | ||
116 | <div class="form-group__item"> | ||
117 | <input type="text" name="POWER_GD" id="flot_POWER_GD" class="input" placeholder="14000 кВт" value="{{ old('POWER_GD') ?? $Flot->POWER_GD ?? '' }}"> | ||
118 | @error('POWER_GD') | ||
119 | <span class="text-xs text-red-600"> | ||
120 | {{ $message }} | ||
121 | </span> | ||
122 | @enderror | ||
123 | </div> | ||
124 | </div> | ||
125 | <div class="form-group" style=""> | ||
126 | <label class="form-group__label">IMO</label> | ||
127 | <div class="form-group__item"> | ||
128 | <input type="text" name="IMO" id="flot_IMO" class="input" placeholder="8814275" value="{{ old('IMO') ?? $Flot->IMO ?? '' }}"> | ||
129 | @error('IMO') | ||
130 | <span class="text-xs text-red-600"> | ||
131 | {{ $message }} | ||
132 | </span> | ||
133 | @enderror | ||
134 | </div> | ||
135 | </div> | ||
136 | <button type="submit" class="button" id="ajax_flot-" name="ajax_flot-">Сохранить флот</button> | ||
137 | </div> | ||
138 | </form> | ||
139 | </div> | ||
140 | </div> | ||
141 | </div> | ||
142 | </div> | ||
143 | |||
144 | </section> | ||
145 | </div> | ||
146 | <!-- END TOP WRAPPER --> | ||
147 | @endsection | ||
148 |
resources/views/employers/fly-flot.blade.php
1 | @extends('layout.frontend', ['title' => 'Мой флот - РекаМоре']) | 1 | @extends('layout.frontend', ['title' => 'Мой флот - РекаМоре']) |
2 | 2 | ||
3 | @section('scripts') | 3 | @section('scripts') |
4 | <script src="https://cdn.ckeditor.com/ckeditor5/23.0.0/classic/ckeditor.js"></script> | 4 | <script src="https://cdn.ckeditor.com/ckeditor5/23.0.0/classic/ckeditor.js"></script> |
5 | <script> | 5 | <script> |
6 | ClassicEditor | 6 | ClassicEditor |
7 | .create( document.querySelector( '#txtarea' ) ) | 7 | .create( document.querySelector( '#txtarea' ) ) |
8 | .catch( error => { | 8 | .catch( error => { |
9 | console.error( error ); | 9 | console.error( error ); |
10 | } ); | 10 | } ); |
11 | </script> | 11 | </script> |
12 | @endsection | 12 | @endsection |
13 | @section('content') | 13 | @section('content') |
14 | <section class="cabinet"> | 14 | <section class="cabinet"> |
15 | <div class="container"> | 15 | <div class="container"> |
16 | <ul class="breadcrumbs cabinet__breadcrumbs"> | 16 | <ul class="breadcrumbs cabinet__breadcrumbs"> |
17 | <li><a href="{{ route('index') }}">Главная</a></li> | 17 | <li><a href="{{ route('index') }}">Главная</a></li> |
18 | <li><b>Личный кабинет</b></li> | 18 | <li><b>Личный кабинет</b></li> |
19 | </ul> | 19 | </ul> |
20 | <div class="cabinet__wrapper"> | 20 | <div class="cabinet__wrapper"> |
21 | <div class="cabinet__side"> | 21 | <div class="cabinet__side"> |
22 | <div class="cabinet__side-toper"> | 22 | <div class="cabinet__side-toper"> |
23 | @include('employers.emblema') | 23 | @include('employers.emblema') |
24 | </div> | 24 | </div> |
25 | 25 | ||
26 | @include('employers.menu', ['item' => 12]) | 26 | @include('employers.menu', ['item' => 12]) |
27 | 27 | ||
28 | </div> | 28 | </div> |
29 | <div class="cabinet__body"> | 29 | <div class="cabinet__body"> |
30 | @include('messages_error') | 30 | @include('messages_error') |
31 | 31 | ||
32 | <div class="cabinet__body-item"> | 32 | <div class="cabinet__body-item"> |
33 | <div class="cabinet__descr"> | 33 | <div class="cabinet__descr"> |
34 | <h2 class="title cabinet__title">Мой флот</h2> | 34 | <h2 class="title cabinet__title">Мой флот</h2> |
35 | </div> | 35 | </div> |
36 | 36 | ||
37 | <form action="{{ route('employer.save_add_flot') }}" method="POST" class="cabinet__add" enctype="multipart/form-data"> | 37 | <form action="{{ route('employer.save_add_flot') }}" method="POST" class="cabinet__add" enctype="multipart/form-data"> |
38 | @csrf | 38 | @csrf |
39 | <label class="cabinet__add-pic" style="vertical-align: top"> | 39 | <label class="cabinet__add-pic" style="vertical-align: top"> |
40 | <input type="file" name="image" id="image"> | 40 | <input type="file" name="image" id="image"> |
41 | @error('image') | 41 | @error('image') |
42 | <span class="text-xs text-red-600"> | 42 | <span class="text-xs text-red-600"> |
43 | {{ $message }} | 43 | {{ $message }} |
44 | </span> | 44 | </span> |
45 | @enderror | 45 | @enderror |
46 | <input type="hidden" name="employer_id" id="employer_id" value="{{ $Employer[0]->id }}"/> | 46 | <input type="hidden" name="employer_id" id="employer_id" value="{{ $Employer[0]->id }}"/> |
47 | <svg> | 47 | <svg> |
48 | <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> | 48 | <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> |
49 | </svg> | 49 | </svg> |
50 | <span> | 50 | <span> |
51 | <svg> | 51 | <svg> |
52 | <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use> | 52 | <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use> |
53 | </svg> | 53 | </svg> |
54 | Загрузить фото | 54 | Загрузить фото |
55 | </span> | 55 | </span> |
56 | </label> | 56 | </label> |
57 | 57 | ||
58 | <div class="cabinet__add-body"> | 58 | <div class="cabinet__add-body"> |
59 | <div class="form-group"> | 59 | <div class="form-group"> |
60 | <label class="form-group__label">Название</label> | 60 | <label class="form-group__label">Название</label> |
61 | <div class="form-group__item"> | 61 | <div class="form-group__item"> |
62 | <input type="text" name="name" id="flot_name" class="input" placeholder="Корабль №000001" required> | 62 | <input type="text" name="name" id="flot_name" class="input" placeholder="Корабль №000001" required> |
63 | @error('name') | 63 | @error('name') |
64 | <span class="text-xs text-red-600"> | 64 | <span class="text-xs text-red-600"> |
65 | {{ $message }} | 65 | {{ $message }} |
66 | </span> | 66 | </span> |
67 | @enderror | 67 | @enderror |
68 | </div> | 68 | </div> |
69 | </div> | 69 | </div> |
70 | <div class="form-group" style="display:none"> | 70 | <div class="form-group" style="display:none"> |
71 | <label class="form-group__label">Описание</label> | 71 | <label class="form-group__label">Описание</label> |
72 | <div class="form-group__item"> | 72 | <div class="form-group__item"> |
73 | <input type="text" name="text" id="flot_text" class="input" placeholder="Это судно находится..." value="True info"> | 73 | <input type="text" name="text" id="flot_text" class="input" placeholder="Это судно находится..." value="True info"> |
74 | @error('text') | 74 | @error('text') |
75 | <span class="text-xs text-red-600"> | 75 | <span class="text-xs text-red-600"> |
76 | {{ $message }} | 76 | {{ $message }} |
77 | </span> | 77 | </span> |
78 | @enderror | 78 | @enderror |
79 | </div> | 79 | </div> |
80 | </div> | 80 | </div> |
81 | <div class="form-group" style="display:none"> | 81 | <div class="form-group" style="display:none"> |
82 | <label class="form-group__label">Регион</label> | 82 | <label class="form-group__label">Регион</label> |
83 | <div class="form-group__item"> | 83 | <div class="form-group__item"> |
84 | <input type="text" name="region" id="region" class="input" placeholder="Мурманск" value="True Region"> | 84 | <input type="text" name="region" id="region" class="input" placeholder="Мурманск" value="True Region"> |
85 | @error('region') | 85 | @error('region') |
86 | <span class="text-xs text-red-600"> | 86 | <span class="text-xs text-red-600"> |
87 | {{ $message }} | 87 | {{ $message }} |
88 | </span> | 88 | </span> |
89 | @enderror | 89 | @enderror |
90 | </div> | 90 | </div> |
91 | </div> | 91 | </div> |
92 | <div class="form-group" style="display:none"> | 92 | <div class="form-group" style="display:none"> |
93 | <label class="form-group__label">Мощность</label> | 93 | <label class="form-group__label">Мощность</label> |
94 | <div class="form-group__item"> | 94 | <div class="form-group__item"> |
95 | <input type="text" name="power" id="flot_power" class="input" placeholder="Dw 40000 9000Kw" value="Power"> | 95 | <input type="text" name="power" id="flot_power" class="input" placeholder="Dw 40000 9000Kw" value="Power"> |
96 | @error('power') | 96 | @error('power') |
97 | <span class="text-xs text-red-600"> | 97 | <span class="text-xs text-red-600"> |
98 | {{ $message }} | 98 | {{ $message }} |
99 | </span> | 99 | </span> |
100 | @enderror | 100 | @enderror |
101 | </div> | 101 | </div> |
102 | </div> | 102 | </div> |
103 | <div class="form-group"> | 103 | <div class="form-group"> |
104 | <label class="form-group__label">DWT</label> | 104 | <label class="form-group__label">DWT</label> |
105 | <div class="form-group__item"> | 105 | <div class="form-group__item"> |
106 | <input type="text" name="DWT" id="flot_DWT" class="input" placeholder="4000 т"> | 106 | <input type="text" name="DWT" id="flot_DWT" class="input" placeholder="4000 т"> |
107 | @error('DWT') | 107 | @error('DWT') |
108 | <span class="text-xs text-red-600"> | 108 | <span class="text-xs text-red-600"> |
109 | {{ $message }} | 109 | {{ $message }} |
110 | </span> | 110 | </span> |
111 | @enderror | 111 | @enderror |
112 | </div> | 112 | </div> |
113 | </div> | 113 | </div> |
114 | <div class="form-group"> | 114 | <div class="form-group"> |
115 | <label class="form-group__label">Мощность ГД (кВт)</label> | 115 | <label class="form-group__label">Мощность ГД (кВт)</label> |
116 | <div class="form-group__item"> | 116 | <div class="form-group__item"> |
117 | <input type="text" name="POWER_GD" id="flot_POWER_GD" class="input" placeholder="14000 кВт"> | 117 | <input type="text" name="POWER_GD" id="flot_POWER_GD" class="input" placeholder="14000 кВт"> |
118 | @error('POWER_GD') | 118 | @error('POWER_GD') |
119 | <span class="text-xs text-red-600"> | 119 | <span class="text-xs text-red-600"> |
120 | {{ $message }} | 120 | {{ $message }} |
121 | </span> | 121 | </span> |
122 | @enderror | 122 | @enderror |
123 | </div> | 123 | </div> |
124 | </div> | 124 | </div> |
125 | <div class="form-group" style=""> | 125 | <div class="form-group" style=""> |
126 | <label class="form-group__label">IMO</label> | 126 | <label class="form-group__label">IMO</label> |
127 | <div class="form-group__item"> | 127 | <div class="form-group__item"> |
128 | <input type="text" name="IMO" id="flot_IMO" class="input" placeholder="8814275" value=""> | 128 | <input type="text" name="IMO" id="flot_IMO" class="input" placeholder="8814275" value=""> |
129 | @error('IMO') | 129 | @error('IMO') |
130 | <span class="text-xs text-red-600"> | 130 | <span class="text-xs text-red-600"> |
131 | {{ $message }} | 131 | {{ $message }} |
132 | </span> | 132 | </span> |
133 | @enderror | 133 | @enderror |
134 | </div> | 134 | </div> |
135 | </div> | 135 | </div> |
136 | <button type="submit" class="button" id="ajax_flot" name="ajax_flot">Добавить флот</button> | 136 | <button type="submit" class="button" id="ajax_flot_" name="ajax_flot_">Добавить флот</button> |
137 | </div> | 137 | </div> |
138 | 138 | ||
139 | </form> | 139 | </form> |
140 | 140 | ||
141 | <div class="cabinet__fleet" id="ajax_flot_div" name="ajax_flot_div"> | 141 | <div class="cabinet__fleet" id="ajax_flot_div" name="ajax_flot_div"> |
142 | @if (isset($Employer[0]->flots)) | 142 | @if (isset($Employer[0]->flots)) |
143 | @if ($Employer[0]->flots->count()) | 143 | @if ($Employer[0]->flots->count()) |
144 | @foreach ($Employer[0]->flots as $it) | 144 | @foreach ($Employer[0]->flots as $it) |
145 | <div class="cabinet__fleet-item main__employer-page-one-item"> | 145 | <div class="cabinet__fleet-item main__employer-page-one-item"> |
146 | <div style="margin-bottom: -10px"> | ||
146 | <a class="del die_black" href="{{ route('employer.delete_flot', ['Flot' => $it->id]) }}"> | 147 | <a class="del die_black" href="{{ route('employer.delete_flot', ['Flot' => $it->id]) }}"> |
147 | <svg> | 148 | <svg> |
148 | <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> | 149 | <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> |
149 | </svg> | 150 | </svg> |
150 | </a> | 151 | </a> |
152 | <a href="{{ route('employer.edit_flot', ['Flot' => $it->id, 'Employer' => $Employer[0]->id]) }}" class="del die_black" style="margin-left: 40px"> | ||
153 | <svg> | ||
154 | <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> | ||
155 | </svg> | ||
156 | </a> | ||
157 | </div> | ||
151 | @if (!empty($it->image)) | 158 | @if (!empty($it->image)) |
152 | <img src="{{ asset(Storage::url($it->image)) }}" alt="{{ $it->name }}"> | 159 | <img src="{{ asset(Storage::url($it->image)) }}" alt="{{ $it->name }}"> |
153 | @else | 160 | @else |
154 | <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $it->name }}"/> | 161 | <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $it->name }}"/> |
155 | @endif | 162 | @endif |
156 | <b>{{ $it->name }}</b> | 163 | <b>{{ $it->name }}</b> |
157 | <!--<span> $it->region }}</span>--> | 164 | <!--<span> $it->region }}</span>--> |
158 | <span><i>DWT</i>{{ $it->DWT }}</span> | 165 | <span><i>DWT</i>{{ $it->DWT }}</span> |
159 | <span><i>Мощность ГД (кВт)</i>{{ $it->POWER_GD }}</span> | 166 | <span><i>Мощность ГД (кВт)</i>{{ $it->POWER_GD }}</span> |
160 | <span><i>IMO</i>{{ $it->IMO }}</span> | 167 | <span><i>IMO</i>{{ $it->IMO }}</span> |
161 | <!--<span> $it->power }}</span>--> | 168 | <!--<span> $it->power }}</span>--> |
162 | </div> | 169 | </div> |
163 | @endforeach | 170 | @endforeach |
164 | @endif | 171 | @endif |
165 | @endif | 172 | @endif |
166 | </div> | 173 | </div> |
167 | </div> | 174 | </div> |
168 | </div> | 175 | </div> |
169 | </div> | 176 | </div> |
170 | </div> | 177 | </div> |
171 | 178 | ||
172 | </section> | 179 | </section> |
173 | </div> | 180 | </div> |
174 | <!-- END TOP WRAPPER --> | 181 | <!-- END TOP WRAPPER --> |
175 | @endsection | 182 | @endsection |
176 | 183 |
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 | Route::group([ | 484 | Route::group([ |
485 | 'as' => 'worker.', // имя маршрута, например auth.index | 485 | 'as' => 'worker.', // имя маршрута, например auth.index |
486 | 'prefix' => 'worker', // префикс маршрута, например auth/index | 486 | 'prefix' => 'worker', // префикс маршрута, например auth/index |
487 | 'middleware' => ['auth'], ['is_worker'], | 487 | 'middleware' => ['auth'], ['is_worker'], |
488 | ], function() { | 488 | ], function() { |
489 | // 1 страница - Моя анкета | 489 | // 1 страница - Моя анкета |
490 | Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); | 490 | Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); |
491 | Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); | 491 | Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); |
492 | 492 | ||
493 | // 2 страница - Сообщения | 493 | // 2 страница - Сообщения |
494 | Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); | 494 | Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); |
495 | Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog'); | 495 | Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog'); |
496 | // 3 страница - Избранные вакансии | 496 | // 3 страница - Избранные вакансии |
497 | Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); | 497 | Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); |
498 | // Продолжение борьбы против колорадов - избранные вакансии | 498 | // Продолжение борьбы против колорадов - избранные вакансии |
499 | Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); | 499 | Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); |
500 | 500 | ||
501 | // 4 страница - Сменить пароль | 501 | // 4 страница - Сменить пароль |
502 | Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); | 502 | Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); |
503 | Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password'); | 503 | Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password'); |
504 | 504 | ||
505 | // 5 страница - Удалить профиль | 505 | // 5 страница - Удалить профиль |
506 | Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); | 506 | Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); |
507 | Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); | 507 | Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); |
508 | 508 | ||
509 | // Резюме -pdf | 509 | // Резюме -pdf |
510 | Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); | 510 | Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); |
511 | 511 | ||
512 | // Поднятие анкеты | 512 | // Поднятие анкеты |
513 | Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); | 513 | Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); |
514 | 514 | ||
515 | // Добавление сертификата | 515 | // Добавление сертификата |
516 | Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate'); | 516 | Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate'); |
517 | Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); | 517 | Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); |
518 | Route::get('кабинет/edit_sertificate/{worker}/{doc}', [WorkerController::class, 'edit_sertificate'])->name('edit_sertificate'); | 518 | Route::get('кабинет/edit_sertificate/{worker}/{doc}', [WorkerController::class, 'edit_sertificate'])->name('edit_sertificate'); |
519 | Route::get('кабинет/edit_sertificate/{doc}', [WorkerController::class, 'update_serificate'])->name('update_serificate'); | 519 | Route::get('кабинет/edit_sertificate/{doc}', [WorkerController::class, 'update_serificate'])->name('update_serificate'); |
520 | Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); | 520 | Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); |
521 | 521 | ||
522 | // Добавление предыдущих контактов компании | 522 | // Добавление предыдущих контактов компании |
523 | Route::get('кабинет/prev_company/{worker}', [WorkerController::class, 'new_prev_company'])->name('new_prev_company'); | 523 | Route::get('кабинет/prev_company/{worker}', [WorkerController::class, 'new_prev_company'])->name('new_prev_company'); |
524 | Route::get('кабинет/add_prev_company', [WorkerController::class, 'add_prev_company'])->name('add_prev_company'); | 524 | Route::get('кабинет/add_prev_company', [WorkerController::class, 'add_prev_company'])->name('add_prev_company'); |
525 | Route::get('кабинет/edit_prev_company/{doc}/{worker}', [WorkerController::class, 'edit_prev_company'])->name('edit_prev_company'); | 525 | Route::get('кабинет/edit_prev_company/{doc}/{worker}', [WorkerController::class, 'edit_prev_company'])->name('edit_prev_company'); |
526 | Route::post('кабинет/update_prev_company/{doc}', [WorkerController::class, 'update_prev_company'])->name('update_prev_company'); | 526 | Route::post('кабинет/update_prev_company/{doc}', [WorkerController::class, 'update_prev_company'])->name('update_prev_company'); |
527 | Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company'); | 527 | Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company'); |
528 | 528 | ||
529 | // Добавление документа-диплома | 529 | // Добавление документа-диплома |
530 | Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); | 530 | Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); |
531 | Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); | 531 | Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); |
532 | Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom'); | 532 | Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom'); |
533 | 533 | ||
534 | // Добавление стандартного диплома | 534 | // Добавление стандартного диплома |
535 | Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); | 535 | Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); |
536 | Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); | 536 | Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); |
537 | Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); | 537 | Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); |
538 | Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); | 538 | Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); |
539 | Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); | 539 | Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); |
540 | 540 | ||
541 | // Отправка сообщения работодателю от соискателя | 541 | // Отправка сообщения работодателю от соискателя |
542 | Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message'); | 542 | Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message'); |
543 | }); | 543 | }); |
544 | 544 | ||
545 | // Личный кабинет работодателя | 545 | // Личный кабинет работодателя |
546 | Route::group([ | 546 | Route::group([ |
547 | 'as' => 'employer.', // имя маршрута, например auth.index | 547 | 'as' => 'employer.', // имя маршрута, например auth.index |
548 | 'prefix' => 'employer', // префикс маршрута, например auth/index | 548 | 'prefix' => 'employer', // префикс маршрута, например auth/index |
549 | 'middleware' => ['auth'], !['is_worker'], | 549 | 'middleware' => ['auth'], !['is_worker'], |
550 | ], function() { | 550 | ], function() { |
551 | // 0 страница - Личные данные работодателя | 551 | // 0 страница - Личные данные работодателя |
552 | Route::get('cabinet/employer_info', [EmployerController::class, 'employer_info'])->name('employer_info'); | 552 | Route::get('cabinet/employer_info', [EmployerController::class, 'employer_info'])->name('employer_info'); |
553 | Route::post('cabinet/employer_info/{user}', [EmployerController::class, 'employer_info_save'])->name('employer_info_save'); | 553 | Route::post('cabinet/employer_info/{user}', [EmployerController::class, 'employer_info_save'])->name('employer_info_save'); |
554 | 554 | ||
555 | // 1 страница - Профиль | 555 | // 1 страница - Профиль |
556 | Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); | 556 | Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); |
557 | Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); | 557 | Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); |
558 | Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); | 558 | Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); |
559 | Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); | 559 | Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); |
560 | Route::get('cabinet/flot_edit/{Flot}/{Employer}', [EmployerController::class, 'edit_flot'])->name('edit_flot'); | ||
561 | Route::post('cabinet/flot_edit/{Flot}', [EmployerController::class, 'update_flot'])->name('update_flot_save'); | ||
560 | Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot'); | 562 | Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot'); |
561 | 563 | ||
562 | // 2 страница - Добавление вакансий | 564 | // 2 страница - Добавление вакансий |
563 | Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); | 565 | Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); |
564 | Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); | 566 | Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); |
565 | 567 | ||
566 | Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); | 568 | Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); |
567 | 569 | ||
568 | // 3 страница - Мои вакансии | 570 | // 3 страница - Мои вакансии |
569 | Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); | 571 | Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); |
570 | Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); | 572 | Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); |
571 | Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); | 573 | Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); |
572 | Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); | 574 | Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); |
573 | Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); | 575 | Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); |
574 | Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); | 576 | Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); |
575 | Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); | 577 | Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); |
576 | 578 | ||
577 | // 4.1Ю. | 579 | // 4.1Ю. |
578 | Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac'); | 580 | Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac'); |
579 | Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save'); | 581 | Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save'); |
580 | Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac'); | 582 | Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac'); |
581 | Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save'); | 583 | Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save'); |
582 | Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac'); | 584 | Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac'); |
583 | 585 | ||
584 | // 4 страница - Отклики на вакансии | 586 | // 4 страница - Отклики на вакансии |
585 | Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); | 587 | Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); |
586 | Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); | 588 | Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); |
587 | Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); | 589 | Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); |
588 | 590 | ||
589 | // 5 страница - Сообщения | 591 | // 5 страница - Сообщения |
590 | Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); | 592 | Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); |
591 | Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); | 593 | Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); |
592 | Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); | 594 | Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); |
593 | Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); | 595 | Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); |
594 | 596 | ||
595 | // 6 страница - Избранный | 597 | // 6 страница - Избранный |
596 | Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); | 598 | Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); |
597 | 599 | ||
598 | //7 страница - База данных | 600 | //7 страница - База данных |
599 | Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); | 601 | Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); |
600 | 602 | ||
601 | //8 страница - База резюме | 603 | //8 страница - База резюме |
602 | Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); | 604 | Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); |
603 | 605 | ||
604 | // 9 рассылка сообщений | 606 | // 9 рассылка сообщений |
605 | Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); | 607 | Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); |
606 | Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); | 608 | Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); |
607 | 609 | ||
608 | // 10 страница FAQ вопросы | 610 | // 10 страница FAQ вопросы |
609 | Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq'); | 611 | Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq'); |
610 | 612 | ||
611 | // 11 страница - Настройка уведомлений | 613 | // 11 страница - Настройка уведомлений |
612 | Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); | 614 | Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); |
613 | Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); | 615 | Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); |
614 | 616 | ||
615 | // 12 страница - Сменить пароль | 617 | // 12 страница - Сменить пароль |
616 | Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); | 618 | Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); |
617 | Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); | 619 | Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); |
618 | 620 | ||
619 | // 13 страница - Удаление профиля | 621 | // 13 страница - Удаление профиля |
620 | Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); | 622 | Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); |
621 | Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); | 623 | Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); |
622 | Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); | 624 | Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); |
623 | 625 | ||
624 | // Отправил сообщение | 626 | // Отправил сообщение |
625 | Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); | 627 | Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); |
626 | }); | 628 | }); |
627 | 629 | ||
628 | Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker'); | 630 | Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker'); |
629 | 631 | ||
630 | 632 |