Commit 5725a36363a04d6fe4a749a4938a2acbef02563f

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

Обновление понедельник

Showing 21 changed files with 583 additions and 44 deletions Inline Diff

app/Classes/LikesClass.php
File was created 1 <?php
2
3
4 namespace App\Classes;
5
6
7 use App\Models\Ad_employer;
8 use App\Models\Like_vacancy;
9 use App\Models\Like_worker;
10 use App\Models\Worker;
11
12 class LikesClass
13 {
14 // Вывод всех избранных вакансий у пользователя
15 public static function ListVacancy(Ad_employer $ad_employer) {
16 $ListVacancy = Like_vacancy::query()->where('code_record', '=', $ad_employer->id)->get();
17 return $ListVacancy;
18 }
19
20 // Вывод всех избранных работников у пользователя
21 public static function ListWorkers(Worker $worker) {
22 $ListWorker = Like_worker::query()->where('code_record', '=', $worker->id)->get();
23 }
24
25 // Возвращение кода вакансии
26 public static function get_status_vacancy(Ad_employer $ad_employer) {
27 if (Like_vacancy::query()->where('code_record', '=', $ad_employer->id)->count() > 0)
28 $IdVacancy = " active ";
29 else
30 $IdVacancy = "";
31
32 return $IdVacancy;
33 }
34
35 public static function get_status_worker(Worker $worker) {
36 if (Like_worker::query()->where('code_record', '=', $worker->id)->count() > 0)
37 { $IdWorker = " active"; } else { $IdWorker = "123"; }
38
39 return $IdWorker;
40 }
41 }
42
app/Http/Controllers/EmployerController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Classes\RusDate; 5 use App\Classes\RusDate;
6 use App\Classes\Tools; 6 use App\Classes\Tools;
7 use App\Http\Requests\FlotRequest; 7 use App\Http\Requests\FlotRequest;
8 use App\Http\Requests\MessagesRequiest; 8 use App\Http\Requests\MessagesRequiest;
9 use App\Http\Requests\VacancyRequestEdit; 9 use App\Http\Requests\VacancyRequestEdit;
10 use App\Http\Requests\VacansiaRequiest; 10 use App\Http\Requests\VacansiaRequiest;
11 use App\Mail\MailSotrudnichestvo; 11 use App\Mail\MailSotrudnichestvo;
12 use App\Mail\SendAllMessages; 12 use App\Mail\SendAllMessages;
13 use App\Models\Ad_employer; 13 use App\Models\Ad_employer;
14 use App\Models\Ad_jobs; 14 use App\Models\Ad_jobs;
15 use App\Models\ad_response; 15 use App\Models\ad_response;
16 use App\Models\Category; 16 use App\Models\Category;
17 use App\Models\Education; 17 use App\Models\Education;
18 use App\Models\Employer; 18 use App\Models\Employer;
19 use App\Models\employers_main; 19 use App\Models\employers_main;
20 use App\Models\Flot; 20 use App\Models\Flot;
21 use App\Models\Job_title; 21 use App\Models\Job_title;
22 use App\Models\Like_vacancy;
23 use App\Models\Like_worker;
22 use App\Models\Message; 24 use App\Models\Message;
23 use App\Models\Worker; 25 use App\Models\Worker;
24 use Carbon\Carbon; 26 use Carbon\Carbon;
25 use Illuminate\Auth\Events\Registered; 27 use Illuminate\Auth\Events\Registered;
26 use Illuminate\Database\Eloquent\Builder; 28 use Illuminate\Database\Eloquent\Builder;
27 use Illuminate\Database\Eloquent\Model; 29 use Illuminate\Database\Eloquent\Model;
28 use Illuminate\Foundation\Auth\User; 30 use Illuminate\Foundation\Auth\User;
29 use Illuminate\Http\Request; 31 use Illuminate\Http\Request;
30 use Illuminate\Support\Facades\Auth; 32 use Illuminate\Support\Facades\Auth;
31 use Illuminate\Support\Facades\Hash; 33 use Illuminate\Support\Facades\Hash;
32 use Illuminate\Support\Facades\Mail; 34 use Illuminate\Support\Facades\Mail;
33 use Illuminate\Support\Facades\Storage; 35 use Illuminate\Support\Facades\Storage;
34 use App\Models\User as User_Model; 36 use App\Models\User as User_Model;
35 use Illuminate\Support\Facades\Validator; 37 use Illuminate\Support\Facades\Validator;
36 38
37 class EmployerController extends Controller 39 class EmployerController extends Controller
38 { 40 {
39 public function vacancie($vacancy, Request $request) { 41 public function vacancie($vacancy, Request $request) {
40 $title = 'Заголовок вакансии'; 42 $title = 'Заголовок вакансии';
41 $Query = Ad_employer::with('jobs')-> 43 $Query = Ad_employer::with('jobs')->
42 with('cat')-> 44 with('cat')->
43 with('employer')-> 45 with('employer')->
44 with('jobs_code')-> 46 with('jobs_code')->
45 select('ad_employers.*')-> 47 select('ad_employers.*')->
46 where('id', '=', $vacancy)->get(); 48 where('id', '=', $vacancy)->get();
47 49
48 if (isset(Auth()->user()->id)) 50 if (isset(Auth()->user()->id))
49 $uid = Auth()->user()->id; 51 $uid = Auth()->user()->id;
50 else 52 else
51 $uid = 0; 53 $uid = 0;
52 $title = $Query[0]->name; 54 $title = $Query[0]->name;
53 if ($request->ajax()) { 55 if ($request->ajax()) {
54 return view('ajax.vacance-item', compact('Query','uid')); 56 return view('ajax.vacance-item', compact('Query','uid'));
55 } else { 57 } else {
56 return view('vacance-item', compact('title', 'Query', 'uid')); 58 return view('vacance-item', compact('title', 'Query', 'uid'));
57 } 59 }
58 } 60 }
59 61
60 public function logout() { 62 public function logout() {
61 Auth::logout(); 63 Auth::logout();
62 return redirect()->route('index') 64 return redirect()->route('index')
63 ->with('success', 'Вы вышли из личного кабинета'); 65 ->with('success', 'Вы вышли из личного кабинета');
64 } 66 }
65 67
66 public function cabinet() { 68 public function cabinet() {
67 $id = Auth()->user()->id; 69 $id = Auth()->user()->id;
68 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 70 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
69 WhereHas('users', 71 WhereHas('users',
70 function (Builder $query) use ($id) {$query->Where('id', $id); 72 function (Builder $query) use ($id) {$query->Where('id', $id);
71 })->get(); 73 })->get();
72 return view('employers.cabinet45', compact('Employer')); 74 return view('employers.cabinet45', compact('Employer'));
73 } 75 }
74 76
75 public function cabinet_save(Employer $Employer, Request $request) { 77 public function cabinet_save(Employer $Employer, Request $request) {
76 $params = $request->all(); 78 $params = $request->all();
77 $params['user_id'] = Auth()->user()->id; 79 $params['user_id'] = Auth()->user()->id;
78 $id = $Employer->id; 80 $id = $Employer->id;
79 81
80 if ($request->has('logo')) { 82 if ($request->has('logo')) {
81 if (!empty($Employer->logo)) { 83 if (!empty($Employer->logo)) {
82 Storage::delete($Employer->logo); 84 Storage::delete($Employer->logo);
83 } 85 }
84 $params['logo'] = $request->file('logo')->store("employer/$id", 'public'); 86 $params['logo'] = $request->file('logo')->store("employer/$id", 'public');
85 } 87 }
86 88
87 $Employer->update($params); 89 $Employer->update($params);
88 90
89 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены'); 91 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены');
90 } 92 }
91 93
92 public function save_add_flot(FlotRequest $request) { 94 public function save_add_flot(FlotRequest $request) {
93 // отмена 95 // отмена
94 $params = $request->all(); 96 $params = $request->all();
95 97
96 if ($request->has('image')) { 98 if ($request->has('image')) {
97 $params['image'] = $request->file('image')->store("flot", 'public'); 99 $params['image'] = $request->file('image')->store("flot", 'public');
98 } 100 }
99 Flot::create($params); 101 Flot::create($params);
100 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get(); 102 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get();
101 return redirect()->route('employer.cabinet')->with('success', 'Новый корабль был добавлен'); 103 return redirect()->route('employer.cabinet')->with('success', 'Новый корабль был добавлен');
102 } 104 }
103 105
104 public function delete_flot(Flot $Flot) { 106 public function delete_flot(Flot $Flot) {
105 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get(); 107 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get();
106 108
107 if (isset($Flot->id)) $Flot->delete(); 109 if (isset($Flot->id)) $Flot->delete();
108 return redirect()->route('employer.cabinet')->with('success', 'Корабль был удален'); 110 return redirect()->route('employer.cabinet')->with('success', 'Корабль был удален');
109 } 111 }
110 112
111 // Форма добавления вакансий 113 // Форма добавления вакансий
112 public function cabinet_vacancie() { 114 public function cabinet_vacancie() {
113 $id = Auth()->user()->id; 115 $id = Auth()->user()->id;
114 $jobs = Job_title::query()->OrderBy('name')->get(); 116 $jobs = Job_title::query()->OrderBy('name')->get();
115 $categories = Category::query()->get(); 117 $categories = Category::query()->get();
116 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 118 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
117 WhereHas('users', 119 WhereHas('users',
118 function (Builder $query) use ($id) {$query->Where('id', $id); 120 function (Builder $query) use ($id) {$query->Where('id', $id);
119 })->get(); 121 })->get();
120 122
121 return view('employers.add_vacancy', compact('Employer', 'jobs' , 'categories')); 123 return view('employers.add_vacancy', compact('Employer', 'jobs' , 'categories'));
122 } 124 }
123 125
124 // Сохранение вакансии 126 // Сохранение вакансии
125 public function cabinet_vacancy_save1(VacancyRequestEdit $request) { 127 public function cabinet_vacancy_save1(VacancyRequestEdit $request) {
126 $params = $request->all(); 128 $params = $request->all();
127 $jobs['min_salary'] = $params['min_salary']; 129 $jobs['min_salary'] = $params['min_salary'];
128 $jobs['max_salary'] = $params['max_salary']; 130 $jobs['max_salary'] = $params['max_salary'];
129 $jobs['flot'] = $params['flot']; 131 $jobs['flot'] = $params['flot'];
130 $jobs['power'] = $params['power']; 132 $jobs['power'] = $params['power'];
131 $jobs['sytki'] = $params['sytki']; 133 $jobs['sytki'] = $params['sytki'];
132 $jobs['start'] = $params['start']; 134 $jobs['start'] = $params['start'];
133 $jobs['job_title_id'] = $params['job_title_id']; 135 $jobs['job_title_id'] = $params['job_title_id'];
134 $jobs['description'] = $params['description']; 136 $jobs['description'] = $params['description'];
135 $jobs['region'] = $params['city']; 137 $jobs['region'] = $params['city'];
136 $jobs['position_ship'] = $params['position_ship']; 138 $jobs['position_ship'] = $params['position_ship'];
137 unset($params['min_salary']); 139 unset($params['min_salary']);
138 unset($params['max_salary']); 140 unset($params['max_salary']);
139 unset($params['flot']); 141 unset($params['flot']);
140 unset($params['sytki']); 142 unset($params['sytki']);
141 unset($params['start']); 143 unset($params['start']);
142 unset($params['job_title_id']); 144 unset($params['job_title_id']);
143 unset($params['description']); 145 unset($params['description']);
144 146
145 $id = Ad_employer::create($params)->id; 147 $id = Ad_employer::create($params)->id;
146 $jobs['ad_employer_id'] = $id; 148 $jobs['ad_employer_id'] = $id;
147 Ad_jobs::create($jobs); 149 Ad_jobs::create($jobs);
148 return redirect()->route('employer.vacancy_list'); 150 return redirect()->route('employer.vacancy_list');
149 } 151 }
150 152
151 // Список вакансий 153 // Список вакансий
152 public function vacancy_list(Request $request) { 154 public function vacancy_list(Request $request) {
153 $id = Auth()->user()->id; 155 $id = Auth()->user()->id;
154 $Employer = Employer::query()->where('user_id', $id)->first(); 156 $Employer = Employer::query()->where('user_id', $id)->first();
155 $vacancy_list = Ad_employer::query()->where('employer_id', $Employer->id); 157 $vacancy_list = Ad_employer::query()->where('employer_id', $Employer->id);
156 158
157 if ($request->get('sort')) { 159 if ($request->get('sort')) {
158 $sort = $request->get('sort'); 160 $sort = $request->get('sort');
159 switch ($sort) { 161 switch ($sort) {
160 case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break; 162 case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break;
161 case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break; 163 case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break;
162 case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break; 164 case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break;
163 case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break; 165 case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break;
164 case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; 166 case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break;
165 default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; 167 default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break;
166 } 168 }
167 } 169 }
168 $vacancy_list = $vacancy_list->get(); 170 $vacancy_list = $vacancy_list->get();
169 171
170 //ajax 172 //ajax
171 if ($request->ajax()) { 173 if ($request->ajax()) {
172 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); 174 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer'));
173 } else { 175 } else {
174 return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); 176 return view('employers.list_vacancy', compact('vacancy_list', 'Employer'));
175 } 177 }
176 } 178 }
177 179
178 // Карточка вакансии 180 // Карточка вакансии
179 public function vacancy_edit(Ad_employer $ad_employer) { 181 public function vacancy_edit(Ad_employer $ad_employer) {
180 $id = Auth()->user()->id; 182 $id = Auth()->user()->id;
181 $jobs = Job_title::query()->OrderBy('name')->get(); 183 $jobs = Job_title::query()->OrderBy('name')->get();
182 $categories = Category::query()->get(); 184 $categories = Category::query()->get();
183 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 185 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
184 where('user_id', $id)->first(); 186 where('user_id', $id)->first();
185 187
186 return view('employers.edit_vacancy', compact('ad_employer', 'categories','Employer', 'jobs')); 188 return view('employers.edit_vacancy', compact('ad_employer', 'categories','Employer', 'jobs'));
187 } 189 }
188 190
189 // Сохранение-редактирование записи 191 // Сохранение-редактирование записи
190 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { 192 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) {
191 $all = $request->all(); 193 $all = $request->all();
192 194
193 $ad_employer->update($all); 195 $ad_employer->update($all);
194 196
195 return redirect()->route('employer.vacancy_list'); 197 return redirect()->route('employer.vacancy_list');
196 } 198 }
197 199
198 // Сохранение карточки вакансии 200 // Сохранение карточки вакансии
199 public function vacancy_save(Request $request, Ad_employer $ad_employer) { 201 public function vacancy_save(Request $request, Ad_employer $ad_employer) {
200 $all = $request->all(); 202 $all = $request->all();
201 $ad_employer->update($all); 203 $ad_employer->update($all);
202 return redirect()->route('employer.cabinet_vacancie'); 204 return redirect()->route('employer.cabinet_vacancie');
203 } 205 }
204 206
205 // Удаление карточки вакансии 207 // Удаление карточки вакансии
206 public function vacancy_delete(Ad_employer $ad_employer) { 208 public function vacancy_delete(Ad_employer $ad_employer) {
207 $ad_employer->delete(); 209 $ad_employer->delete();
208 210
209 return redirect()->route('employer.vacancy_list') 211 return redirect()->route('employer.vacancy_list')
210 ->with('success', 'Данные были успешно сохранены'); 212 ->with('success', 'Данные были успешно сохранены');
211 } 213 }
212 214
213 // Обновление даты 215 // Обновление даты
214 public function vacancy_up(Ad_employer $ad_employer) { 216 public function vacancy_up(Ad_employer $ad_employer) {
215 $up = date('m/d/Y h:i:s', time());; 217 $up = date('m/d/Y h:i:s', time());;
216 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 218 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
217 $vac_emp->updated_at = $up; 219 $vac_emp->updated_at = $up;
218 $vac_emp->save(); 220 $vac_emp->save();
219 221
220 return redirect()->route('employer.vacancy_list'); 222 return redirect()->route('employer.vacancy_list');
221 // начало конца 223 // начало конца
222 } 224 }
223 225
224 //Видимость вакансии 226 //Видимость вакансии
225 public function vacancy_eye(Ad_employer $ad_employer, $status) { 227 public function vacancy_eye(Ad_employer $ad_employer, $status) {
226 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 228 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
227 $vac_emp->active_is = $status; 229 $vac_emp->active_is = $status;
228 $vac_emp->save(); 230 $vac_emp->save();
229 231
230 return redirect()->route('employer.vacancy_list'); 232 return redirect()->route('employer.vacancy_list');
231 } 233 }
232 234
233 //Вакансия редактирования (шаблон) 235 //Вакансия редактирования (шаблон)
234 public function vacancy_update(Ad_employer $id) { 236 public function vacancy_update(Ad_employer $id) {
235 237
236 } 238 }
237 239
238 //Отклики на вакансию - лист 240 //Отклики на вакансию - лист
239 public function answers(Employer $employer, Request $request) { 241 public function answers(Employer $employer, Request $request) {
240 $user_id = Auth()->user()->id; 242 $user_id = Auth()->user()->id;
241 $answer = Ad_employer::query()->where('employer_id', $employer->id); 243 $answer = Ad_employer::query()->where('employer_id', $employer->id);
242 if ($request->has('search')) { 244 if ($request->has('search')) {
243 $search = trim($request->get('search')); 245 $search = trim($request->get('search'));
244 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); 246 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%");
245 } 247 }
246 248
247 $answer = $answer->with('response')->get(); 249 $answer = $answer->with('response')->get();
248 250
249 return view('employers.list_answer', compact('answer', 'user_id', 'employer')); 251 return view('employers.list_answer', compact('answer', 'user_id', 'employer'));
250 } 252 }
251 253
252 //Обновление статуса 254 //Обновление статуса
253 public function supple_status(employer $employer, ad_response $ad_response, $flag) { 255 public function supple_status(employer $employer, ad_response $ad_response, $flag) {
254 $ad_response->update(Array('flag' => $flag)); 256 $ad_response->update(Array('flag' => $flag));
255 return redirect()->route('employer.answers', ['employer' => $employer->id]); 257 return redirect()->route('employer.answers', ['employer' => $employer->id]);
256 } 258 }
257 259
258 //Страницы сообщений список 260 //Страницы сообщений список
259 public function messages($type_message) { 261 public function messages($type_message) {
260 $user_id = Auth()->user()->id; 262 $user_id = Auth()->user()->id;
261 263
262 $messages_input = Message::query()->with('vacancies')->with('user_from')-> 264 $messages_input = Message::query()->with('vacancies')->with('user_from')->
263 Where('to_user_id', $user_id)->OrderByDesc('created_at'); 265 Where('to_user_id', $user_id)->OrderByDesc('created_at');
264 266
265 $messages_output = Message::query()->with('vacancies')-> 267 $messages_output = Message::query()->with('vacancies')->
266 with('user_to')->where('user_id', $user_id)-> 268 with('user_to')->where('user_id', $user_id)->
267 OrderByDesc('created_at'); 269 OrderByDesc('created_at');
268 270
269 271
270 $count_input = $messages_input->count(); 272 $count_input = $messages_input->count();
271 $count_output = $messages_output->count(); 273 $count_output = $messages_output->count();
272 274
273 if ($type_message == 'input') { 275 if ($type_message == 'input') {
274 $messages = $messages_input->paginate(15); 276 $messages = $messages_input->paginate(15);
275 } 277 }
276 278
277 if ($type_message == 'output') { 279 if ($type_message == 'output') {
278 $messages = $messages_output->paginate(15); 280 $messages = $messages_output->paginate(15);
279 } 281 }
280 282
281 return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); 283 return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id'));
282 } 284 }
283 285
284 // Диалог между пользователями 286 // Диалог между пользователями
285 public function dialog(User_Model $user1, User_Model $user2) { 287 public function dialog(User_Model $user1, User_Model $user2) {
286 if (isset($user2->id)) { 288 if (isset($user2->id)) {
287 $companion = User_Model::query()->with('workers')-> 289 $companion = User_Model::query()->with('workers')->
288 with('employers')-> 290 with('employers')->
289 where('id', $user2->id)->first(); 291 where('id', $user2->id)->first();
290 } 292 }
291 293
292 $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) { 294 $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) {
293 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); 295 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id);
294 })->orWhere(function($query) use ($user1, $user2) { 296 })->orWhere(function($query) use ($user1, $user2) {
295 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); 297 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id);
296 })->OrderBy('created_at')->get(); 298 })->OrderBy('created_at')->get();
297 299
298 $id_vac = null; 300 $id_vac = null;
299 foreach ($Messages as $it) { 301 foreach ($Messages as $it) {
300 if (isset($it->response)) { 302 if (isset($it->response)) {
301 foreach ($it->response as $r) { 303 foreach ($it->response as $r) {
302 if (isset($r->ad_employer_id)) { 304 if (isset($r->ad_employer_id)) {
303 $id_vac = $r->ad_employer_id; 305 $id_vac = $r->ad_employer_id;
304 break; 306 break;
305 } 307 }
306 } 308 }
307 } 309 }
308 if (!is_null($id_vac)) break; 310 if (!is_null($id_vac)) break;
309 } 311 }
310 312
311 $ad_employer = null; 313 $ad_employer = null;
312 if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); 314 if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first();
313 $sender = $user1; 315 $sender = $user1;
314 316
315 return view('employers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); 317 return view('employers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer'));
316 } 318 }
317 319
318 // Регистрация работодателя 320 // Регистрация работодателя
319 public function register_employer(Request $request) { 321 public function register_employer(Request $request) {
320 $params = $request->all(); 322 $params = $request->all();
321 323
322 $rules = [ 324 $rules = [
323 'surname' => ['required', 'string', 'max:255'], 325 'surname' => ['required', 'string', 'max:255'],
324 'name_man' => ['required', 'string', 'max:255'], 326 'name_man' => ['required', 'string', 'max:255'],
325 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 327 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
326 'name_company' => ['required', 'string', 'max:255'], 328 'name_company' => ['required', 'string', 'max:255'],
327 'password' => ['required', 'string', 'min:8'], 329 'password' => ['required', 'string', 'min:8'],
328 ]; 330 ];
329 331
330 332
331 $messages = [ 333 $messages = [
332 'required' => 'Укажите обязательное поле', 334 'required' => 'Укажите обязательное поле',
333 'min' => [ 335 'min' => [
334 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 336 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
335 'integer' => 'Поле «:attribute» должно быть :min или больше', 337 'integer' => 'Поле «:attribute» должно быть :min или больше',
336 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 338 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
337 ], 339 ],
338 'max' => [ 340 'max' => [
339 'string' => 'Поле «:attribute» должно быть не больше :max символов', 341 'string' => 'Поле «:attribute» должно быть не больше :max символов',
340 'integer' => 'Поле «:attribute» должно быть :max или меньше', 342 'integer' => 'Поле «:attribute» должно быть :max или меньше',
341 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 343 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
342 ] 344 ]
343 ]; 345 ];
344 346
345 if ($request->get('password') !== $request->get('confirmed')){ 347 if ($request->get('password') !== $request->get('confirmed')){
346 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 348 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
347 } 349 }
348 350
349 $validator = Validator::make($request->all(), $rules, $messages); 351 $validator = Validator::make($request->all(), $rules, $messages);
350 352
351 if ($validator->fails()) { 353 if ($validator->fails()) {
352 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 354 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
353 } else { 355 } else {
354 $user = $this->create($params); 356 $user = $this->create($params);
355 event(new Registered($user)); 357 event(new Registered($user));
356 358
357 Auth::guard()->login($user); 359 Auth::guard()->login($user);
358 } 360 }
359 if ($user) { 361 if ($user) {
360 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; 362 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));;
361 } else { 363 } else {
362 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 364 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
363 } 365 }
364 } 366 }
365 367
366 // Создание пользователя 368 // Создание пользователя
367 protected function create(array $data) 369 protected function create(array $data)
368 { 370 {
369 $Use = new User_Model(); 371 $Use = new User_Model();
370 $Code_user = $Use->create([ 372 $Code_user = $Use->create([
371 'name' => $data['surname']." ".$data['name_man'], 373 'name' => $data['surname']." ".$data['name_man'],
372 'name_man' => $data['name_man'], 374 'name_man' => $data['name_man'],
373 'surname' => $data['surname'], 375 'surname' => $data['surname'],
374 'surname2' => $data['surname2'], 376 'surname2' => $data['surname2'],
375 'subscribe_email' => $data['email'], 377 'subscribe_email' => $data['email'],
376 'email' => $data['email'], 378 'email' => $data['email'],
377 'telephone' => $data['telephone'], 379 'telephone' => $data['telephone'],
378 'is_worker' => 0, 380 'is_worker' => 0,
379 'password' => Hash::make($data['password']), 381 'password' => Hash::make($data['password']),
380 'pubpassword' => base64_encode($data['password']), 382 'pubpassword' => base64_encode($data['password']),
381 'email_verified_at' => Carbon::now() 383 'email_verified_at' => Carbon::now()
382 ]); 384 ]);
383 385
384 if ($Code_user->id > 0) { 386 if ($Code_user->id > 0) {
385 $Employer = new Employer(); 387 $Employer = new Employer();
386 $Employer->user_id = $Code_user->id; 388 $Employer->user_id = $Code_user->id;
387 $Employer->name_company = $data['name_company']; 389 $Employer->name_company = $data['name_company'];
388 $Employer->email = $data['email']; 390 $Employer->email = $data['email'];
389 $Employer->telephone = $data['telephone']; 391 $Employer->telephone = $data['telephone'];
390 $Employer->code = Tools::generator_id(10); 392 $Employer->code = Tools::generator_id(10);
391 $Employer->save(); 393 $Employer->save();
392 394
393 return $Code_user; 395 return $Code_user;
394 } 396 }
395 } 397 }
396 398
397 // Отправка сообщения от работодателя 399 // Отправка сообщения от работодателя
398 public function send_message(MessagesRequiest $request) { 400 public function send_message(MessagesRequiest $request) {
399 $params = $request->all(); 401 $params = $request->all();
400 dd($params); 402 dd($params);
401 $user1 = $params['user_id']; 403 $user1 = $params['user_id'];
402 $user2 = $params['to_user_id']; 404 $user2 = $params['to_user_id'];
403 405
404 if ($request->has('file')) { 406 if ($request->has('file')) {
405 $params['file'] = $request->file('file')->store("messages", 'public'); 407 $params['file'] = $request->file('file')->store("messages", 'public');
406 } 408 }
407 Message::create($params); 409 Message::create($params);
408 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 410 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
409 } 411 }
410 412
411 public function test123(Request $request) { 413 public function test123(Request $request) {
412 $params = $request->all(); 414 $params = $request->all();
413 $user1 = $params['user_id']; 415 $user1 = $params['user_id'];
414 $user2 = $params['to_user_id']; 416 $user2 = $params['to_user_id'];
415 417
416 $rules = [ 418 $rules = [
417 'text' => 'required|min:1|max:150000', 419 'text' => 'required|min:1|max:150000',
418 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' 420 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000'
419 ]; 421 ];
420 $messages = [ 422 $messages = [
421 'required' => 'Укажите обязательное поле', 423 'required' => 'Укажите обязательное поле',
422 'min' => [ 424 'min' => [
423 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 425 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
424 'integer' => 'Поле «:attribute» должно быть :min или больше', 426 'integer' => 'Поле «:attribute» должно быть :min или больше',
425 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 427 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
426 ], 428 ],
427 'max' => [ 429 'max' => [
428 'string' => 'Поле «:attribute» должно быть не больше :max символов', 430 'string' => 'Поле «:attribute» должно быть не больше :max символов',
429 'integer' => 'Поле «:attribute» должно быть :max или меньше', 431 'integer' => 'Поле «:attribute» должно быть :max или меньше',
430 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 432 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
431 ] 433 ]
432 ]; 434 ];
433 435
434 $validator = Validator::make($request->all(), $rules, $messages); 436 $validator = Validator::make($request->all(), $rules, $messages);
435 437
436 if ($validator->fails()) { 438 if ($validator->fails()) {
437 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) 439 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2])
438 ->withErrors($validator); 440 ->withErrors($validator);
439 } else { 441 } else {
440 if ($request->has('file')) { 442 if ($request->has('file')) {
441 $params['file'] = $request->file('file')->store("messages", 'public'); 443 $params['file'] = $request->file('file')->store("messages", 'public');
442 } 444 }
443 Message::create($params); 445 Message::create($params);
444 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 446 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
445 447
446 } 448 }
447 } 449 }
448 450
449 //Избранные люди 451 //Избранные люди
450 public function favorites(Request $request) { 452 public function favorites(Request $request) {
451 if (isset($_COOKIE['favorite_worker'])) { 453 $IP_address = RusDate::ip_addr_client();
452 $items = RusDate::count_item_fav(); 454 $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get();
453 $it = $_COOKIE['favorite_worker']; 455
454 $it = str_replace('"', "", $it); 456 if ($Arr->count()) {
455 $it = str_replace('[', "", $it); 457 $A = Array();
456 $it = str_replace(']', "", $it); 458 foreach ($Arr as $it) {
457 $Arr = explode(",", $it); 459 $A[] = $it->code_record;
460 }
461
462 $Workers = Worker::query()->whereIn('id', $A);
458 } else { 463 } else {
459 $Arr = Array(); 464 $Workers = Worker::query();
460 } 465 }
461 466
462 $Workers = Worker::query();
463 $Workers = $Workers->whereIn('id', $Arr);
464
465 if (($request->has('search')) && (!empty($request->get('search')))) { 467 if (($request->has('search')) && (!empty($request->get('search')))) {
466 $search = $request->get('search'); 468 $search = $request->get('search');
467 469
468 $Workers = $Workers->WhereHas('users', 470 $Workers = $Workers->WhereHas('users',
469 function (Builder $query) use ($search) { 471 function (Builder $query) use ($search) {
470 $query->Where('surname', 'LIKE', "%$search%") 472 $query->Where('surname', 'LIKE', "%$search%")
471 ->orWhere('name_man', 'LIKE', "%$search%") 473 ->orWhere('name_man', 'LIKE', "%$search%")
472 ->orWhere('surname2', 'LIKE', "%$search%"); 474 ->orWhere('surname2', 'LIKE', "%$search%");
473 }); 475 });
474 } else { 476 } else {
475 $Workers = $Workers->with('users'); 477 $Workers = $Workers->with('users');
476 } 478 }
477 479
478 $Workers = $Workers->get(); 480 $Workers = $Workers->get();
479 return view('employers.favorite', compact('Workers')); 481 return view('employers.favorite', compact('Workers'));
480 } 482 }
481 483
482 // База данных 484 // База данных
483 public function bd(Request $request) { 485 public function bd(Request $request) {
484 // для типа BelongsTo 486 // для типа BelongsTo
485 //$documents = Document::query()->orderBy(Location::select('name') 487 //$documents = Document::query()->orderBy(Location::select('name')
486 // ->whereColumn('locations.id', 'documents.location_id') 488 // ->whereColumn('locations.id', 'documents.location_id')
487 //); 489 //);
488 490
489 // для типа HasOne/Many 491 // для типа HasOne/Many
490 // $documents = Document::::query()->orderBy(Location::select('name') 492 // $documents = Document::::query()->orderBy(Location::select('name')
491 // ->whereColumn('locations.document_id', 'documents.id') 493 // ->whereColumn('locations.document_id', 'documents.id')
492 //); 494 //);
493 495
494 $users = User_Model::query()->with('workers'); 496 $users = User_Model::query()->with('workers');
495 if (isset($request->find)) { 497 if (isset($request->find)) {
496 $find_key = $request->find; 498 $find_key = $request->find;
497 $users = $users->where('name', 'LIKE', "%$find_key%") 499 $users = $users->where('name', 'LIKE', "%$find_key%")
498 ->orWhere('email', 'LIKE', "%$find_key%") 500 ->orWhere('email', 'LIKE', "%$find_key%")
499 ->orWhere('telephone', 'LIKE', "%$find_key%"); 501 ->orWhere('telephone', 'LIKE', "%$find_key%");
500 } 502 }
501 503
502 // Данные 504 // Данные
503 $users = $users->Baseuser()-> 505 $users = $users->Baseuser()->
504 orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id'))-> 506 orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id'))->
505 paginate(5); 507 paginate(5);
506 508
507 return view('employers.bd', compact('users')); 509 return view('employers.bd', compact('users'));
508 } 510 }
509 511
510 //Настройка уведомлений 512 //Настройка уведомлений
511 public function subscribe() { 513 public function subscribe() {
512 return view('employers.subcribe'); 514 return view('employers.subcribe');
513 } 515 }
514 516
515 //Установка уведомлений сохранение 517 //Установка уведомлений сохранение
516 public function save_subscribe(Request $request) { 518 public function save_subscribe(Request $request) {
517 dd($request->all()); 519 dd($request->all());
518 $msg = $request->validate([ 520 $msg = $request->validate([
519 'subscribe_email' => 'required|email|min:5|max:255', 521 'subscribe_email' => 'required|email|min:5|max:255',
520 ]); 522 ]);
521 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); 523 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку');
522 } 524 }
523 525
524 //Сбросить форму с паролем 526 //Сбросить форму с паролем
525 public function password_reset() { 527 public function password_reset() {
526 $email = Auth()->user()->email; 528 $email = Auth()->user()->email;
527 return view('employers.password-reset', compact('email')); 529 return view('employers.password-reset', compact('email'));
528 } 530 }
529 531
530 //Обновление пароля 532 //Обновление пароля
531 public function new_password(Request $request) { 533 public function new_password(Request $request) {
532 $use = Auth()->user(); 534 $use = Auth()->user();
533 $request->validate([ 535 $request->validate([
534 'password' => 'required|string', 536 'password' => 'required|string',
535 'new_password' => 'required|string', 537 'new_password' => 'required|string',
536 'new_password2' => 'required|string' 538 'new_password2' => 'required|string'
537 ]); 539 ]);
538 540
539 if ($request->get('new_password') == $request->get('new_password2')) 541 if ($request->get('new_password') == $request->get('new_password2'))
540 if ($request->get('password') !== $request->get('new_password')) { 542 if ($request->get('password') !== $request->get('new_password')) {
541 $credentials = $request->only('email', 'password'); 543 $credentials = $request->only('email', 'password');
542 if (Auth::attempt($credentials)) { 544 if (Auth::attempt($credentials)) {
543 545
544 if (!is_null($use->email_verified_at)){ 546 if (!is_null($use->email_verified_at)){
545 547
546 $user_data = User_Model::find($use->id); 548 $user_data = User_Model::find($use->id);
547 $user_data->update([ 549 $user_data->update([
548 'password' => Hash::make($request->get('new_password')), 550 'password' => Hash::make($request->get('new_password')),
549 'pubpassword' => base64_encode($request->get('new_password')), 551 'pubpassword' => base64_encode($request->get('new_password')),
550 ]); 552 ]);
551 return redirect() 553 return redirect()
552 ->route('employer.password_reset') 554 ->route('employer.password_reset')
553 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 555 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
554 } 556 }
555 557
556 return redirect() 558 return redirect()
557 ->route('employer.password_reset') 559 ->route('employer.password_reset')
558 ->withError('Данная учетная запись не было верифицированна!'); 560 ->withError('Данная учетная запись не было верифицированна!');
559 } 561 }
560 } 562 }
561 563
562 return redirect() 564 return redirect()
563 ->route('employer.password_reset') 565 ->route('employer.password_reset')
564 ->withErrors('Не совпадение данных, обновите пароли!'); 566 ->withErrors('Не совпадение данных, обновите пароли!');
565 } 567 }
566 568
567 569
568 570
569 // Форма Удаление пипла 571 // Форма Удаление пипла
570 public function delete_people() { 572 public function delete_people() {
571 $login = Auth()->user()->email; 573 $login = Auth()->user()->email;
572 return view('employers.delete_people', compact('login')); 574 return view('employers.delete_people', compact('login'));
573 } 575 }
574 576
575 // Удаление аккаунта 577 // Удаление аккаунта
576 public function action_delete_user(Request $request) { 578 public function action_delete_user(Request $request) {
577 $Answer = $request->all(); 579 $Answer = $request->all();
578 $user_id = Auth()->user()->id; 580 $user_id = Auth()->user()->id;
579 $request->validate([ 581 $request->validate([
580 'password' => 'required|string', 582 'password' => 'required|string',
581 ]); 583 ]);
582 584
583 $credentials = $request->only('email', 'password'); 585 $credentials = $request->only('email', 'password');
584 if (Auth::attempt($credentials)) { 586 if (Auth::attempt($credentials)) {
585 Auth::logout(); 587 Auth::logout();
586 $it = User_Model::find($user_id); 588 $it = User_Model::find($user_id);
587 //$it->delete(); 589 $it->delete();
588 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 590 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
589 } else { 591 } else {
590 return redirect()->route('employer.delete_people') 592 return redirect()->route('employer.delete_people')
591 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 593 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
592 } 594 }
593 } 595 }
594 596
595 public function ajax_delete_user(Request $request) { 597 public function ajax_delete_user(Request $request) {
596 $Answer = $request->all(); 598 $Answer = $request->all();
597 $user_id = Auth()->user()->id; 599 $user_id = Auth()->user()->id;
598 $request->validate([ 600 $request->validate([
599 'password' => 'required|string', 601 'password' => 'required|string',
600 ]); 602 ]);
601 $credentials = $request->only('email', 'password'); 603 $credentials = $request->only('email', 'password');
602 if (Auth::attempt($credentials)) { 604 if (Auth::attempt($credentials)) {
603 605
604 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', 606 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт',
605 'email' => $request->get('email'), 607 'email' => $request->get('email'),
606 'password' => $request->get('password'))); 608 'password' => $request->get('password')));
607 } else { 609 } else {
608 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); 610 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль'));
609 } 611 }
610 } 612 }
611 613
612 614
613 // FAQ - Вопросы/ответы для работодателей и соискателей 615 // FAQ - Вопросы/ответы для работодателей и соискателей
614 public function faq() { 616 public function faq() {
615 return view('employers.faq'); 617 return view('employers.faq');
616 } 618 }
617 619
618 // Рассылка сообщений 620 // Рассылка сообщений
619 public function send_all_messages() { 621 public function send_all_messages() {
620 return view('employers.send_all'); 622 return view('employers.send_all');
621 } 623 }
622 624
623 // Отправка сообщений для информации 625 // Отправка сообщений для информации
624 public function send_all_post(Request $request) { 626 public function send_all_post(Request $request) {
625 $data = $request->all(); 627 $data = $request->all();
626 628
627 $emails = User_Model::query()->where('is_worker', '1')->get(); 629 $emails = User_Model::query()->where('is_worker', '1')->get();
628 630
629 foreach ($emails as $e) { 631 foreach ($emails as $e) {
630 Mail::to($e->email)->send(new SendAllMessages($data)); 632 Mail::to($e->email)->send(new SendAllMessages($data));
631 } 633 }
632 634
633 return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); 635 return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены');
634 } 636 }
635 637
636 // База резюме 638 // База резюме
637 public function bd_tupe(Request $request) { 639 public function bd_tupe(Request $request) {
638 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); 640 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get();
639 641
640 return view('employers.bd_tupe', compact('Resume')); 642 return view('employers.bd_tupe', compact('Resume'));
641 } 643 }
642 644
643 ////////////////////////////////////////////////////////////////// 645 //////////////////////////////////////////////////////////////////
644 // 646 //
645 // 647 //
646 // Отправил сообщение 648 // Отправил сообщение
647 // 649 //
648 // 650 //
649 // 651 //
650 // 652 //
651 ////////////////////////////////////////////////////////////////// 653 //////////////////////////////////////////////////////////////////
652 public function new_message(Request $request) { 654 public function new_message(Request $request) {
653 $params = $request->all(); 655 $params = $request->all();
654 656
655 $id = $params['_user_id']; 657 $id = $params['_user_id'];
656 $message = new Message(); 658 $message = new Message();
657 $message->user_id = $params['_user_id']; 659 $message->user_id = $params['_user_id'];
658 $message->to_user_id = $params['_to_user_id']; 660 $message->to_user_id = $params['_to_user_id'];
659 $message->title = $params['title']; 661 $message->title = $params['title'];
660 $message->text = $params['text']; 662 $message->text = $params['text'];
661 if ($request->has('_file')) { 663 if ($request->has('_file')) {
662 $message->file = $request->file('_file')->store("worker/$id", 'public'); 664 $message->file = $request->file('_file')->store("worker/$id", 'public');
663 } 665 }
664 $message->flag_new = 1; 666 $message->flag_new = 1;
665 $id_message = $message->save(); 667 $id_message = $message->save();
666 668
667 $data['message_id'] = $id_message; 669 $data['message_id'] = $id_message;
668 $data['ad_employer_id'] = $params['_vacancy']; 670 $data['ad_employer_id'] = $params['_vacancy'];
669 $data['job_title_id'] = 0; 671 $data['job_title_id'] = 0;
670 672
671 $data['flag'] = 1; 673 $data['flag'] = 1;
672 $ad_responce = ad_response::create($data); 674 $ad_responce = ad_response::create($data);
673 return redirect()->route('employer.messages', ['type_message' => 'output']); 675 return redirect()->route('employer.messages', ['type_message' => 'output']);
674 } 676 }
675 677
676 // Восстановление пароля 678 // Восстановление пароля
677 public function repair_password(Request $request) { 679 public function repair_password(Request $request) {
678 $params = $request->get('email'); 680 $params = $request->get('email');
679 681
680 682
app/Http/Controllers/MainController.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\Tools; 6 use App\Classes\Tools;
6 use App\Mail\MailRegistration; 7 use App\Mail\MailRegistration;
7 use App\Mail\MailRepair; 8 use App\Mail\MailRepair;
8 use App\Models\Ad_employer; 9 use App\Models\Ad_employer;
9 use App\Models\Ad_jobs; 10 use App\Models\Ad_jobs;
10 use App\Models\Category; 11 use App\Models\Category;
11 use App\Models\Education; 12 use App\Models\Education;
12 use App\Models\Employer; 13 use App\Models\Employer;
13 use App\Models\employers_main; 14 use App\Models\employers_main;
14 use App\Models\Job_title; 15 use App\Models\Job_title;
16 use App\Models\Like_vacancy;
17 use App\Models\Like_worker;
15 use App\Models\News; 18 use App\Models\News;
16 use App\Models\reclame; 19 use App\Models\reclame;
17 use App\Models\User; 20 use App\Models\User;
18 use Illuminate\Http\Request; 21 use Illuminate\Http\Request;
19 use Illuminate\Support\Facades\Auth; 22 use Illuminate\Support\Facades\Auth;
20 use Illuminate\Support\Facades\DB; 23 use Illuminate\Support\Facades\DB;
21 use Illuminate\Support\Facades\Hash; 24 use Illuminate\Support\Facades\Hash;
22 use Illuminate\Support\Facades\Mail; 25 use Illuminate\Support\Facades\Mail;
23 use Illuminate\Support\Facades\Validator; 26 use Illuminate\Support\Facades\Validator;
24 use App\Classes\StatusUser; 27 use App\Classes\StatusUser;
25 28
26 class MainController extends Controller 29 class MainController extends Controller
27 { 30 {
28 // Главная страница публичной части 31 // Главная страница публичной части
29 public function index() { 32 public function index() {
30 $news = News::query()->orderBy('id')->limit(6)->get(); 33 $news = News::query()->orderBy('id')->limit(6)->get();
31 34
32 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') 35 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*')
33 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') 36 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id')
34 ->OrderByDesc('created_at') 37 ->OrderByDesc('created_at')
35 ->GroupBy('categories.id') 38 ->GroupBy('categories.id')
36 ->get(); 39 ->get();
37 40
38 $flot_paluba = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')-> 41 $flot_paluba = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')->
39 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 42 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
40 where('position_ship', 'Палуба'); 43 where('position_ship', 'Палуба');
41 44
42 45
43 46
44 $flot_paluba = $flot_paluba->groupby('job_title_id')->get(); 47 $flot_paluba = $flot_paluba->groupby('job_title_id')->get();
45 $flot_MO = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')-> 48 $flot_MO = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')->
46 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 49 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
47 where('position_ship', '=', 'МО'); 50 where('position_ship', '=', 'МО');
48 51
49 $flot_MO = $flot_MO->groupby('ad_jobs.id')->get(); 52 $flot_MO = $flot_MO->groupby('ad_jobs.id')->get();
50 53
51 $flot_radovie = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')-> 54 $flot_radovie = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')->
52 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 55 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
53 where('position_ship', '=', 'Рядовые'); 56 where('position_ship', '=', 'Рядовые');
54 57
55 $flot_radovie = $flot_radovie->groupby('ad_jobs.id')->get(); 58 $flot_radovie = $flot_radovie->groupby('ad_jobs.id')->get();
56 59
57 $flot_prochee = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')-> 60 $flot_prochee = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')->
58 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 61 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
59 where('position_ship', '=', 'Прочее'); 62 where('position_ship', '=', 'Прочее');
60 $flot_prochee = $flot_prochee->groupby('ad_jobs.id')->get(); 63 $flot_prochee = $flot_prochee->groupby('ad_jobs.id')->get();
61 $employers = employers_main::query()->with('employer')->orderBy('id')->limit(8)->get(); 64 $employers = employers_main::query()->with('employer')->orderBy('id')->limit(8)->get();
62 $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get(); 65 $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get();
63 return view('index', compact('news', 'categories', 'employers', 'vacancy', 66 return view('index', compact('news', 'categories', 'employers', 'vacancy',
64 'flot_paluba', 'flot_MO', 'flot_radovie', 'flot_prochee' 67 'flot_paluba', 'flot_MO', 'flot_radovie', 'flot_prochee'
65 )); 68 ));
66 } 69 }
67 70
68 public function search_vacancies(Request $request) { 71 public function search_vacancies(Request $request) {
69 if ($request->has('search')) { 72 if ($request->has('search')) {
70 $search = $request->get('search'); 73 $search = $request->get('search');
71 $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first(); 74 $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first();
72 if (isset($job_titles->id)) 75 if (isset($job_titles->id))
73 if ($job_titles->id > 0) 76 if ($job_titles->id > 0)
74 return redirect()->route('vacancies', ['job' => $job_titles->id]); 77 return redirect()->route('vacancies', ['job' => $job_titles->id]);
75 } 78 }
76 } 79 }
77 80
81 // Лайк вакансии
82 public function like_vacancy(Request $request) {
83 $IP_address = RusDate::ip_addr_client();
84
85 if ($request->has('code_record')) {
86 if ($request->has('delete')) {
87 $atomic_era = Like_vacancy::select('id')->
88 where('code_record', '=', $request->
89 get('code_record'))->first();
90
91 DB::table('like_vacancy')->where('code_record', $request->get('code_record'))->delete();
92
93 } else {
94 $params = $request->all();
95 $params['ip_address'] = $IP_address;
96 Like_vacancy::create($params);
97 }
98 }
99 }
100
101 // Лайк соискателю.
102 public function like_worker(Request $request) {
103 $IP_address = RusDate::ip_addr_client();
104
105 if ($request->has('code_record')) {
106 if ($request->has('delete')) {
107 $atomic_era = Like_worker::select('id')->
108 where('code_record', '=', $request->
109 get('code_record'))->first();
110
111 DB::table('like_worker')->where('code_record', $request->get('code_record'))->delete();
112
113 return "Вот и результат удаления!";
114
115 } else {
116 $params = $request->all();
117 $params['ip_address'] = $IP_address;
118 Like_worker::create($params);
119 }
120 }
121 }
122
123
78 public function vacancies(Request $request) { 124 public function vacancies(Request $request) {
79 //должности 125 //должности
80 $Job_title = Job_title::query()->orderBy('name')->get(); 126 $Job_title = Job_title::query()->orderBy('name')->get();
81 127
82 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') 128 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*')
83 ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary') 129 ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary')
84 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') 130 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id')
85 ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id'); 131 ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id');
86 132
87 //категории и вакансии 133 //категории и вакансии
88 if (($request->has('job')) && ($request->get('job') > 0)) { 134 if (($request->has('job')) && ($request->get('job') > 0)) {
89 $categories = $categories->Where('job_title_id', '=', $request->get('job')); 135 $categories = $categories->Where('job_title_id', '=', $request->get('job'));
90 } 136 }
91 137
92 $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get(); 138 $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get();
93 139
94 140
95 $flot_paluba = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')-> 141 $flot_paluba = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')->
96 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 142 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
97 where('position_ship', 'Палуба'); 143 where('position_ship', 'Палуба');
98 if (!empty($request->get('job'))) { 144 if (!empty($request->get('job'))) {
99 $flot_paluba = $flot_paluba->where('job_title_id', '=', $request->get('job')); 145 $flot_paluba = $flot_paluba->where('job_title_id', '=', $request->get('job'));
100 } 146 }
101 $flot_paluba = $flot_paluba->groupby('job_title_id')->get(); 147 $flot_paluba = $flot_paluba->groupby('job_title_id')->get();
102 148
103 $flot_MO = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')-> 149 $flot_MO = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')->
104 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 150 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
105 where('position_ship', '=', 'МО'); 151 where('position_ship', '=', 'МО');
106 if (!empty($request->get('job'))) { 152 if (!empty($request->get('job'))) {
107 $flot_MO = $flot_MO->where('job_title_id', '=', $request->get('job')); 153 $flot_MO = $flot_MO->where('job_title_id', '=', $request->get('job'));
108 } 154 }
109 $flot_MO = $flot_MO->groupby('ad_jobs.id')->get(); 155 $flot_MO = $flot_MO->groupby('ad_jobs.id')->get();
110 156
111 $flot_radovie = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')-> 157 $flot_radovie = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')->
112 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 158 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
113 where('position_ship', '=', 'Рядовые'); 159 where('position_ship', '=', 'Рядовые');
114 if (!empty($request->get('job'))) { 160 if (!empty($request->get('job'))) {
115 $flot_radovie = $flot_radovie->where('job_title_id', '=', $request->get('job')); 161 $flot_radovie = $flot_radovie->where('job_title_id', '=', $request->get('job'));
116 } 162 }
117 $flot_radovie = $flot_radovie->groupby('ad_jobs.id')->get(); 163 $flot_radovie = $flot_radovie->groupby('ad_jobs.id')->get();
118 164
119 $flot_prochee = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')-> 165 $flot_prochee = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')->
120 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 166 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
121 where('position_ship', '=', 'Прочее'); 167 where('position_ship', '=', 'Прочее');
122 if (!empty($request->get('job'))) { 168 if (!empty($request->get('job'))) {
123 $flot_prochee = $flot_prochee->where('job_title_id', '=', $request->get('job')); 169 $flot_prochee = $flot_prochee->where('job_title_id', '=', $request->get('job'));
124 } 170 }
125 $flot_prochee = $flot_prochee->groupby('ad_jobs.id')->get(); 171 $flot_prochee = $flot_prochee->groupby('ad_jobs.id')->get();
126 172
173
127 if ($request->ajax()) { 174 if ($request->ajax()) {
128 return view('ajax.new_sky', compact('categories', 'flot_paluba', 'flot_MO', 'flot_radovie', 'flot_prochee')); 175 return view('ajax.new_sky', compact('categories', 'flot_paluba', 'flot_MO', 'flot_radovie', 'flot_prochee'));
129 } else { 176 } else {
130 return view('new_sky', compact('Job_title', 'categories', 177 return view('new_sky', compact('Job_title', 'categories',
131 'flot_paluba', 'flot_MO', 'flot_radovie', 'flot_prochee')); 178 'flot_paluba', 'flot_MO', 'flot_radovie', 'flot_prochee'));
132 } 179 }
133 } 180 }
134 181
135 //Вакансии категория детальная 182 //Вакансии категория детальная
136 public function list_vacancies(Category $categories, Request $request) { 183 public function list_vacancies(Category $categories, Request $request) {
137 if (isset(Auth()->user()->id)) 184 if (isset(Auth()->user()->id))
138 $uid = Auth()->user()->id; 185 $uid = Auth()->user()->id;
139 else 186 else
140 $uid = 0; 187 $uid = 0;
141 188
142 $Query = Ad_employer::with('jobs')-> 189 $Query = Ad_employer::with('jobs')->
143 with('cat')-> 190 with('cat')->
144 with('employer')-> 191 with('employer')->
145 whereHas('jobs_code', function ($query) use ($request) { 192 whereHas('jobs_code', function ($query) use ($request) {
146 if (null !== ($request->get('job')) && ($request->get('job') !== 0)) { 193 if (null !== ($request->get('job')) && ($request->get('job') !== 0)) {
147 $query->where('job_title_id', $request->get('job')); 194 $query->where('job_title_id', $request->get('job'));
148 } 195 }
149 }) 196 })
150 ->select('ad_employers.*'); 197 ->select('ad_employers.*');
151 198
152 199
153 if (isset($categories->id) && ($categories->id > 0)) { 200 if (isset($categories->id) && ($categories->id > 0)) {
154 $Query = $Query->where('category_id', '=', $categories->id); 201 $Query = $Query->where('category_id', '=', $categories->id);
155 $Name_categori = Category::query()->where('id', '=', $categories->id)->get(); 202 $Name_categori = Category::query()->where('id', '=', $categories->id)->get();
156 } else { 203 } else {
157 $Name_categori = ''; 204 $Name_categori = '';
158 } 205 }
159 206
160 207 if ($request->get('sort')) {
161
162 if ($request->get('sort')) {
163 $sort = $request->get('sort'); 208 $sort = $request->get('sort');
164 209
165 210
166 switch ($sort) { 211 switch ($sort) {
167 case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break; 212 case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break;
168 case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break; 213 case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break;
169 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; 214 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
170 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; 215 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
171 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; 216 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
172 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; 217 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break;
173 } 218 }
174 } 219 }
175 220
176 $Job_title = Job_title::query()->OrderBy('name')->get(); 221 $Job_title = Job_title::query()->OrderBy('name')->get();
177 222
178 $Query_count = $Query->count(); 223 $Query_count = $Query->count();
179 224
180 $Query = $Query->OrderBy('updated_at')->paginate(3); 225 $Query = $Query->OrderBy('updated_at')->paginate(3);
181 226
182 $Reclama = reclame::query()->get(); 227 $Reclama = reclame::query()->get();
183 228
184 229
185 230
186 if ($request->ajax()) { 231 if ($request->ajax()) {
187 if ($request->has('title')) { 232 if ($request->has('title')) {
188 return view('ajax.list_category', compact( 233 return view('ajax.list_category', compact(
189 'Name_categori' 234 'Name_categori'
190 )); 235 ));
191 } else { 236 } else {
192 return view('ajax.list_vacancies', compact('Query', 237 return view('ajax.list_vacancies', compact('Query',
193 'Query_count', 238 'Query_count',
194 'Name_categori', 239 'Name_categori',
195 'Reclama', 240 'Reclama',
196 'categories', 241 'categories',
197 'Job_title', 242 'Job_title',
198 'uid')); 243 'uid'));
199 } 244 }
200 } else { 245 } else {
201 //Вернуть все 246 //Вернуть все
202 return view('list_vacancies', compact('Query', 247 return view('list_vacancies', compact('Query',
203 'Query_count', 248 'Query_count',
204 'Reclama', 249 'Reclama',
205 'Name_categori', 250 'Name_categori',
206 'categories', 251 'categories',
207 'Job_title', 252 'Job_title',
208 'uid')); 253 'uid'));
209 } 254 }
210 } 255 }
211 256
212 // Образование 257 // Образование
213 public function education(Request $request) { 258 public function education(Request $request) {
214 $educations = Education::query(); 259 $educations = Education::query();
215 if (($request->has('search')) && (!empty($request->get('search')))) { 260 if (($request->has('search')) && (!empty($request->get('search')))) {
216 $search = trim($request->get('search')); 261 $search = trim($request->get('search'));
217 $educations = $educations->where('name', 'LIKE', "%$search%"); 262 $educations = $educations->where('name', 'LIKE', "%$search%");
218 } 263 }
219 264
220 if ($request->get('sort')) { 265 if ($request->get('sort')) {
221 $sort = $request->get('sort'); 266 $sort = $request->get('sort');
222 switch ($sort) { 267 switch ($sort) {
223 case 'name_up': $educations = $educations->orderBy('name')->orderBy('id'); break; 268 case 'name_up': $educations = $educations->orderBy('name')->orderBy('id'); break;
224 case 'name_down': $educations = $educations->orderByDesc('name')->orderby('id'); break; 269 case 'name_down': $educations = $educations->orderByDesc('name')->orderby('id'); break;
225 case 'created_at_up': $educations = $educations->OrderBy('created_at')->orderBy('id'); break; 270 case 'created_at_up': $educations = $educations->OrderBy('created_at')->orderBy('id'); break;
226 case 'created_at_down': $educations = $educations->orderByDesc('created_at')->orderBy('id'); break; 271 case 'created_at_down': $educations = $educations->orderByDesc('created_at')->orderBy('id'); break;
227 case 'default': $educations = $educations->orderBy('id')->orderby('updated_at'); break; 272 case 'default': $educations = $educations->orderBy('id')->orderby('updated_at'); break;
228 default: $educations = $educations->orderBy('id')->orderby('updated_at'); break; 273 default: $educations = $educations->orderBy('id')->orderby('updated_at'); break;
229 } 274 }
230 } 275 }
231 276
232 $count_edu = $educations->count(); 277 $count_edu = $educations->count();
233 $educations = $educations->paginate(6); 278 $educations = $educations->paginate(6);
234 if ($request->ajax()) { 279 if ($request->ajax()) {
235 return view('ajax.education', compact('educations')); 280 return view('ajax.education', compact('educations'));
236 } else { 281 } else {
237 return view('education', compact('educations', 'count_edu')); 282 return view('education', compact('educations', 'count_edu'));
238 } 283 }
239 } 284 }
240 285
241 // Контакты 286 // Контакты
242 public function contacts() { 287 public function contacts() {
243 return view('contacts'); 288 return view('contacts');
244 } 289 }
245 290
246 // Вход в личный кабинет 291 // Вход в личный кабинет
247 public function input_login(Request $request) 292 public function input_login(Request $request)
248 { 293 {
249 $params = $request->all(); 294 $params = $request->all();
250 295
251 296
252 $rules = [ 297 $rules = [
253 'email' => 'required|string|email', 298 'email' => 'required|string|email',
254 'password' => 'required|string|min:3|max:25', 299 'password' => 'required|string|min:3|max:25',
255 ]; 300 ];
256 301
257 $messages = [ 302 $messages = [
258 'required' => 'Укажите обязательное поле «:attribute»', 303 'required' => 'Укажите обязательное поле «:attribute»',
259 'email' => 'Введите корректный email', 304 'email' => 'Введите корректный email',
260 'min' => [ 305 'min' => [
261 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 306 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
262 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 307 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
263 ], 308 ],
264 'max' => [ 309 'max' => [
265 'string' => 'Поле «:attribute» должно быть не больше :max символов', 310 'string' => 'Поле «:attribute» должно быть не больше :max символов',
266 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 311 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
267 ], 312 ],
268 ]; 313 ];
269 314
270 $validator = Validator::make($request->all(), $rules, $messages); 315 $validator = Validator::make($request->all(), $rules, $messages);
271 316
272 317
273 if ($validator->fails()) { 318 if ($validator->fails()) {
274 return redirect()->route('index')->with('Error', "Email или пароль невалидный"); 319 return redirect()->route('index')->with('Error', "Email или пароль невалидный");
275 } else { 320 } else {
276 $credentials = $request->only('email', 'password'); 321 $credentials = $request->only('email', 'password');
277 322
278 if (Auth::attempt($credentials, $request->has('remember'))) { 323 if (Auth::attempt($credentials, $request->has('remember'))) {
279 324
280 if (is_null(Auth::user()->email_verified_at)) { 325 if (is_null(Auth::user()->email_verified_at)) {
281 Auth::logout(); 326 Auth::logout();
282 return json_encode(Array("ERROR" => "Адрес почты не подтвержден")); 327 return json_encode(Array("ERROR" => "Адрес почты не подтвержден"));
283 } 328 }
284 329
285 if (Auth::user()->is_worker) { 330 if (Auth::user()->is_worker) {
286 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl())); 331 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));
287 } else { 332 } else {
288 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl())); 333 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));
289 } 334 }
290 335
291 return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет")); 336 return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет"));
292 //->route('index') 337 //->route('index')
293 //->with('success', 'Вы вошли в личный кабинет.'); 338 //->with('success', 'Вы вошли в личный кабинет.');
294 } else { 339 } else {
295 return json_encode(Array("ERROR" => "Неверный логин или пароль!")); 340 return json_encode(Array("ERROR" => "Неверный логин или пароль!"));
296 } 341 }
297 } 342 }
298 } 343 }
299 344
300 // Восстановление пароля 345 // Восстановление пароля
301 public function repair_password(Request $request) { 346 public function repair_password(Request $request) {
302 $rules = [ 347 $rules = [
303 'email' => 'required|string|email', 348 'email' => 'required|string|email',
304 ]; 349 ];
305 350
306 $messages = [ 351 $messages = [
307 'required' => 'Укажите обязательное поле «:attribute»', 352 'required' => 'Укажите обязательное поле «:attribute»',
308 'email' => 'Введите корректный email', 353 'email' => 'Введите корректный email',
309 'min' => [ 354 'min' => [
310 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 355 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
311 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 356 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
312 ], 357 ],
313 'max' => [ 358 'max' => [
314 'string' => 'Поле «:attribute» должно быть не больше :max символов', 359 'string' => 'Поле «:attribute» должно быть не больше :max символов',
315 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 360 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
316 ], 361 ],
317 ]; 362 ];
318 363
319 $validator = Validator::make($request->all(), $rules, $messages); 364 $validator = Validator::make($request->all(), $rules, $messages);
320 365
321 if ($validator->fails()) { 366 if ($validator->fails()) {
322 return redirect()->back()->with('Error', "Email невалидный"); 367 return redirect()->back()->with('Error', "Email невалидный");
323 } else { 368 } else {
324 $new_password = Tools::generator_id(10); 369 $new_password = Tools::generator_id(10);
325 $hash_password = Hash::make($new_password); 370 $hash_password = Hash::make($new_password);
326 $user = User::query()->where('email', $request->get('email'))->first(); 371 $user = User::query()->where('email', $request->get('email'))->first();
327 $EditRec = User::find($user->id); 372 $EditRec = User::find($user->id);
328 $EditRec->password = $hash_password; 373 $EditRec->password = $hash_password;
329 $EditRec->save(); 374 $EditRec->save();
330 375
331 foreach ([$request->get('email')] as $recipient) { 376 foreach ([$request->get('email')] as $recipient) {
332 Mail::to($recipient)->send(new MailRepair($new_password)); 377 Mail::to($recipient)->send(new MailRepair($new_password));
333 } 378 }
334 return redirect()->route('index'); 379 return redirect()->route('index');
335 380
336 } 381 }
337 382
338 } 383 }
339 384
340 // Вывод новостей 385 // Вывод новостей
341 public function news(Request $request) { 386 public function news(Request $request) {
342 $Query = News::query(); 387 $Query = News::query();
343 if ($request->has('search')) { 388 if ($request->has('search')) {
344 $search = $request->get('search'); 389 $search = $request->get('search');
345 $Query = $Query->where('title', 'LIKE', "%$search%")-> 390 $Query = $Query->where('title', 'LIKE', "%$search%")->
346 orWhere('text', 'LIKE', "%$search%"); 391 orWhere('text', 'LIKE', "%$search%");
347 } 392 }
348 393
349 if ($request->ajax()) { 394 if ($request->ajax()) {
350 if ($request->get('sort')) { 395 if ($request->get('sort')) {
351 $sort = $request->get('sort'); 396 $sort = $request->get('sort');
352 switch ($sort) { 397 switch ($sort) {
353 case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break; 398 case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break;
354 case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break; 399 case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break;
355 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; 400 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
356 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; 401 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
357 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; 402 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
358 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; 403 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break;
359 } 404 }
360 } 405 }
361 } 406 }
362 $Query_count = $Query->count(); 407 $Query_count = $Query->count();
363 $Query = $Query->paginate(6); 408 $Query = $Query->paginate(6);
364 409
365 if ($request->ajax()) { 410 if ($request->ajax()) {
366 return view('ajax.news-list', compact('Query', 'Query_count')); 411 return view('ajax.news-list', compact('Query', 'Query_count'));
367 } else { 412 } else {
368 return view('news-list', compact('Query', 'Query_count')); 413 return view('news-list', compact('Query', 'Query_count'));
369 } 414 }
370 } 415 }
371 416
372 //Детальная новость 417 //Детальная новость
373 public function detail_new(News $new) { 418 public function detail_new(News $new) {
374 // Выборка 419 // Выборка
375 $Query = News::query()->where('id', $new->id)->get(); 420 $Query = News::query()->where('id', $new->id)->get();
376 $title = $Query[0]->title; 421 $title = $Query[0]->title;
377 $All_Query = News::query()->paginate(8); 422 $All_Query = News::query()->paginate(8);
378 return view('detail_new', compact('Query', 'All_Query', 'title')); 423 return view('detail_new', compact('Query', 'All_Query', 'title'));
379 } 424 }
app/Http/Controllers/WorkerController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Classes\RusDate; 5 use App\Classes\RusDate;
6 use App\Http\Requests\DocumentsRequest; 6 use App\Http\Requests\DocumentsRequest;
7 use App\Models\Ad_employer; 7 use App\Models\Ad_employer;
8 use App\Models\ad_response; 8 use App\Models\ad_response;
9 use App\Models\Category; 9 use App\Models\Category;
10 use App\Models\Dop_info; 10 use App\Models\Dop_info;
11 use App\Models\Employer; 11 use App\Models\Employer;
12 use App\Models\infobloks; 12 use App\Models\infobloks;
13 use App\Models\Job_title; 13 use App\Models\Job_title;
14 use App\Models\Like_vacancy;
15 use App\Models\Like_worker;
14 use App\Models\Message; 16 use App\Models\Message;
15 use App\Models\place_works; 17 use App\Models\place_works;
16 use App\Models\reclame; 18 use App\Models\reclame;
17 use App\Models\ResponseWork; 19 use App\Models\ResponseWork;
18 use App\Models\sertification; 20 use App\Models\sertification;
19 use App\Models\Static_worker; 21 use App\Models\Static_worker;
20 use App\Models\User; 22 use App\Models\User;
21 use App\Models\User as User_Model; 23 use App\Models\User as User_Model;
22 use App\Models\Worker; 24 use App\Models\Worker;
23 use Barryvdh\DomPDF\Facade\Pdf; 25 use Barryvdh\DomPDF\Facade\Pdf;
24 use Carbon\Carbon; 26 use Carbon\Carbon;
25 use Illuminate\Auth\Events\Registered; 27 use Illuminate\Auth\Events\Registered;
26 use Illuminate\Database\Eloquent\Builder; 28 use Illuminate\Database\Eloquent\Builder;
27 use Illuminate\Database\Eloquent\Model; 29 use Illuminate\Database\Eloquent\Model;
28 use Illuminate\Http\JsonResponse; 30 use Illuminate\Http\JsonResponse;
29 use Illuminate\Http\Request; 31 use Illuminate\Http\Request;
30 use Illuminate\Support\Facades\Auth; 32 use Illuminate\Support\Facades\Auth;
31 use Illuminate\Support\Facades\Hash; 33 use Illuminate\Support\Facades\Hash;
32 use Illuminate\Support\Facades\Storage; 34 use Illuminate\Support\Facades\Storage;
33 use Illuminate\Support\Facades\Validator; 35 use Illuminate\Support\Facades\Validator;
34 36
35 class WorkerController extends Controller 37 class WorkerController extends Controller
36 { 38 {
37 public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу'); 39 public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу');
38 40
39 //профиль 41 //профиль
40 public function profile(Worker $worker) 42 public function profile(Worker $worker)
41 { 43 {
42 $get_date = date('Y.m'); 44 $get_date = date('Y.m');
43 45
44 $c = Static_worker::query()->where('year_month', '=', $get_date) 46 $c = Static_worker::query()->where('year_month', '=', $get_date)
45 ->where('user_id', '=', $worker->users->id) 47 ->where('user_id', '=', $worker->users->id)
46 ->get(); 48 ->get();
47 49
48 if ($c->count() > 0) { 50 if ($c->count() > 0) {
49 $upd = Static_worker::find($c[0]->id); 51 $upd = Static_worker::find($c[0]->id);
50 $upd->lookin = $upd->lookin + 1; 52 $upd->lookin = $upd->lookin + 1;
51 $upd->save(); 53 $upd->save();
52 } else { 54 } else {
53 $crt = new Static_worker(); 55 $crt = new Static_worker();
54 $crt->lookin = 1; 56 $crt->lookin = 1;
55 $crt->year_month = $get_date; 57 $crt->year_month = $get_date;
56 $crt->user_id = $worker->user_id; 58 $crt->user_id = $worker->user_id;
57 $crt->save(); 59 $crt->save();
58 } 60 }
59 61
60 $stat = Static_worker::query()->where('year_month', '=', $get_date) 62 $stat = Static_worker::query()->where('year_month', '=', $get_date)
61 ->where('user_id', '=', $worker->users->id) 63 ->where('user_id', '=', $worker->users->id)
62 ->get(); 64 ->get();
63 65
64 return view('public.workers.profile', compact('worker', 'stat')); 66 return view('public.workers.profile', compact('worker', 'stat'));
65 } 67 }
66 68
67 // лист база резюме 69 // лист база резюме
68 public function bd_resume(Request $request) 70 public function bd_resume(Request $request)
69 { 71 {
70 if (isset(Auth()->user()->id)) { 72 if (isset(Auth()->user()->id)) {
71 $idiot = Auth()->user()->id; 73 $idiot = Auth()->user()->id;
72 } else { 74 } else {
73 $idiot = 0; 75 $idiot = 0;
74 } 76 }
75 77
76 $status_work = $this->status_work; 78 $status_work = $this->status_work;
77 $resumes = Worker::query()->with('users')->with('job_titles'); 79 $resumes = Worker::query()->with('users')->with('job_titles');
78 $resumes = $resumes->whereHas('users', function (Builder $query) { 80 $resumes = $resumes->whereHas('users', function (Builder $query) {
79 $query->Where('is_worker', '=', '1') 81 $query->Where('is_worker', '=', '1')
80 ->Where('is_bd', '=', '0'); 82 ->Where('is_bd', '=', '0');
81 }); 83 });
82 84
83 if ($request->get('sort')) { 85 if ($request->get('sort')) {
84 $sort = $request->get('sort'); 86 $sort = $request->get('sort');
85 switch ($sort) { 87 switch ($sort) {
86 case 'name_up': 88 case 'name_up':
87 $resumes = $resumes->orderBy(User::select('surname') 89 $resumes = $resumes->orderBy(User::select('surname')
88 ->whereColumn('Workers.user_id', 'users.id') 90 ->whereColumn('Workers.user_id', 'users.id')
89 ); 91 );
90 break; 92 break;
91 case 'name_down': 93 case 'name_down':
92 $resumes = $resumes->orderByDesc(User::select('surname') 94 $resumes = $resumes->orderByDesc(User::select('surname')
93 ->whereColumn('Workers.user_id', 'users.id') 95 ->whereColumn('Workers.user_id', 'users.id')
94 ); 96 );
95 break; 97 break;
96 case 'created_at_up': $resumes = $resumes->OrderBy('created_at')->orderBy('id'); break; 98 case 'created_at_up': $resumes = $resumes->OrderBy('created_at')->orderBy('id'); break;
97 case 'created_at_down': $resumes = $resumes->orderByDesc('created_at')->orderBy('id'); break; 99 case 'created_at_down': $resumes = $resumes->orderByDesc('created_at')->orderBy('id'); break;
98 case 'default': $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; 100 case 'default': $resumes = $resumes->orderBy('id')->orderby('updated_at'); break;
99 default: $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; 101 default: $resumes = $resumes->orderBy('id')->orderby('updated_at'); break;
100 } 102 }
101 } 103 }
102 104
103 $res_count = $resumes->count(); 105 $res_count = $resumes->count();
104 $resumes = $resumes->paginate(6); 106 $resumes = $resumes->paginate(6);
105 if ($request->ajax()) { 107 if ($request->ajax()) {
106 // Условия обставлены 108 // Условия обставлены
107 if ($request->has('block') && ($request->get('block') == 1)) { 109 if ($request->has('block') && ($request->get('block') == 1)) {
108 return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot')); 110 return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot'));
109 } 111 }
110 112
111 if ($request->has('block') && ($request->get('block') == 2)) { 113 if ($request->has('block') && ($request->get('block') == 2)) {
112 return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot')); 114 return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot'));
113 } 115 }
114 } else { 116 } else {
115 return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot')); 117 return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot'));
116 } 118 }
117 } 119 }
118 120
121 //Лайк резюме
122 public function like_controller() {
123
124 }
125
119 // анкета соискателя 126 // анкета соискателя
120 public function resume_profile(Worker $worker) 127 public function resume_profile(Worker $worker)
121 { 128 {
122 $status_work = $this->status_work; 129 $status_work = $this->status_work;
123 $Query = Worker::query()->with('users')->with('job_titles') 130 $Query = Worker::query()->with('users')->with('job_titles')
124 ->with('place_worker')->with('sertificate')->with('prev_company') 131 ->with('place_worker')->with('sertificate')->with('prev_company')
125 ->with('infobloks'); 132 ->with('infobloks');
126 $Query = $Query->where('id', '=', $worker->id); 133 $Query = $Query->where('id', '=', $worker->id);
127 $Query = $Query->get(); 134 $Query = $Query->get();
128 135
129 $get_date = date('Y.m'); 136 $get_date = date('Y.m');
130 $c = Static_worker::query()->where('year_month', '=', $get_date) 137 $c = Static_worker::query()->where('year_month', '=', $get_date)
131 ->where('user_id', '=', $worker->id) 138 ->where('user_id', '=', $worker->id)
132 ->get(); 139 ->get();
133 140
134 if ($c->count() > 0) { 141 if ($c->count() > 0) {
135 $upd = Static_worker::find($c[0]->id); 142 $upd = Static_worker::find($c[0]->id);
136 $upd->lookin = $upd->lookin + 1; 143 $upd->lookin = $upd->lookin + 1;
137 $upd->save(); 144 $upd->save();
138 } else { 145 } else {
139 $crt = new Static_worker(); 146 $crt = new Static_worker();
140 $crt->lookin = 1; 147 $crt->lookin = 1;
141 $crt->year_month = $get_date; 148 $crt->year_month = $get_date;
142 $crt->user_id = $worker->user_id; 149 $crt->user_id = $worker->user_id;
143 $crt->save(); 150 $crt->save();
144 } 151 }
145 152
146 $stat = Static_worker::query()->where('year_month', '=', $get_date) 153 $stat = Static_worker::query()->where('year_month', '=', $get_date)
147 ->where('user_id', '=', $worker->id) 154 ->where('user_id', '=', $worker->id)
148 ->get(); 155 ->get();
149 156
150 return view('worker', compact('Query', 'status_work')); 157 return view('worker', compact('Query', 'status_work'));
151 } 158 }
152 159
153 // скачать анкету соискателя 160 // скачать анкету соискателя
154 public function resume_download(Worker $worker) 161 public function resume_download(Worker $worker)
155 { 162 {
156 $status_work = $this->status_work; 163 $status_work = $this->status_work;
157 $Query = Worker::query()->with('users')->with('job_titles') 164 $Query = Worker::query()->with('users')->with('job_titles')
158 ->with('place_worker')->with('sertificate')->with('prev_company') 165 ->with('place_worker')->with('sertificate')->with('prev_company')
159 ->with('infobloks'); 166 ->with('infobloks');
160 $Query = $Query->where('id', '=', $worker->id); 167 $Query = $Query->where('id', '=', $worker->id);
161 $Query = $Query->get()->toArray(); 168 $Query = $Query->get()->toArray();
162 169
163 view()->share('Query',$Query); 170 view()->share('Query',$Query);
164 171
165 $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape'); 172 $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape');
166 173
167 return $pdf->stream(); 174 return $pdf->stream();
168 } 175 }
169 176
170 // Кабинет работника 177 // Кабинет работника
171 public function cabinet(Request $request) 178 public function cabinet(Request $request)
172 { 179 {
173 $get_date = date('Y.m'); 180 $get_date = date('Y.m');
174 181
175 $id = Auth()->user()->id; 182 $id = Auth()->user()->id;
176 $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')-> 183 $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')->
177 with('infobloks')->with('place_worker')-> 184 with('infobloks')->with('place_worker')->
178 WhereHas('users', 185 WhereHas('users',
179 function (Builder $query) use ($id) {$query->Where('id', $id); 186 function (Builder $query) use ($id) {$query->Where('id', $id);
180 })->get(); 187 })->get();
181 188
182 $Job_titles = Job_title::query()->OrderBy('name')->get(); 189 $Job_titles = Job_title::query()->OrderBy('name')->get();
183 $Infoblocks = infobloks::query()->OrderBy('name')->get(); 190 $Infoblocks = infobloks::query()->OrderBy('name')->get();
184 191
185 $stat = Static_worker::query()->where('year_month', '=', $get_date) 192 $stat = Static_worker::query()->where('year_month', '=', $get_date)
186 ->where('user_id', '=', $Worker[0]->id) 193 ->where('user_id', '=', $Worker[0]->id)
187 ->get(); 194 ->get();
188 195
189 $persent = 10; 196 $persent = 10;
190 if ((!empty($Worker[0]->status_work)) && (!empty($Worker[0]->telephone)) && 197 if ((!empty($Worker[0]->status_work)) && (!empty($Worker[0]->telephone)) &&
191 (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) && 198 (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) &&
192 (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) { 199 (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) {
193 $persent = $persent + 40; 200 $persent = $persent + 40;
194 } 201 }
195 202
196 if ($Worker[0]->sertificate->count() > 0) { 203 if ($Worker[0]->sertificate->count() > 0) {
197 $persent = $persent + 15; 204 $persent = $persent + 15;
198 } 205 }
199 206
200 if ($Worker[0]->infobloks->count() > 0) { 207 if ($Worker[0]->infobloks->count() > 0) {
201 $persent = $persent + 20; 208 $persent = $persent + 20;
202 } 209 }
203 210
204 if ($Worker[0]->prev_company->count() > 0) { 211 if ($Worker[0]->prev_company->count() > 0) {
205 $persent = $persent + 10; 212 $persent = $persent + 10;
206 } 213 }
207 214
208 if (!empty($Worker[0]->photo)) { 215 if (!empty($Worker[0]->photo)) {
209 // 5% 216 // 5%
210 $persent = $persent + 5; 217 $persent = $persent + 5;
211 } 218 }
212 219
213 if ($request->has('print')) { 220 if ($request->has('print')) {
214 dd($Worker); 221 dd($Worker);
215 } else { 222 } else {
216 return view('workers.cabinet', compact('Worker', 'persent', 'Job_titles', 'Infoblocks', 'stat')); 223 return view('workers.cabinet', compact('Worker', 'persent', 'Job_titles', 'Infoblocks', 'stat'));
217 } 224 }
218 } 225 }
219 226
220 // Сохранение данных 227 // Сохранение данных
221 public function cabinet_save(Worker $worker, Request $request) 228 public function cabinet_save(Worker $worker, Request $request)
222 { 229 {
223 $id = $worker->id; 230 $id = $worker->id;
224 $params = $request->all(); 231 $params = $request->all();
225 232
226 $job_title_id = $request->get('job_title_id'); 233 $job_title_id = $request->get('job_title_id');
227 234
228 unset($params['new_diplom']); 235 unset($params['new_diplom']);
229 unset($params['new_data_begin']); 236 unset($params['new_data_begin']);
230 unset($params['new_data_end']); 237 unset($params['new_data_end']);
231 unset($params['new_job_title']); 238 unset($params['new_job_title']);
232 unset($params['new_teplohod']); 239 unset($params['new_teplohod']);
233 unset($params['new_GWT']); 240 unset($params['new_GWT']);
234 unset($params['new_KBT']); 241 unset($params['new_KBT']);
235 unset($params['new_Begin_work']); 242 unset($params['new_Begin_work']);
236 unset($params['new_End_work']); 243 unset($params['new_End_work']);
237 unset($params['new_name_company']); 244 unset($params['new_name_company']);
238 245
239 $rules = [ 246 $rules = [
240 'surname' => ['required', 'string', 'max:255'], 247 'surname' => ['required', 'string', 'max:255'],
241 'name_man' => ['required', 'string', 'max:255'], 248 'name_man' => ['required', 'string', 'max:255'],
242 'email' => ['required', 'string', 'email', 'max:255'], 249 'email' => ['required', 'string', 'email', 'max:255'],
243 250
244 ]; 251 ];
245 252
246 $messages = [ 253 $messages = [
247 'required' => 'Укажите обязательное поле', 254 'required' => 'Укажите обязательное поле',
248 'min' => [ 255 'min' => [
249 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 256 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
250 'integer' => 'Поле «:attribute» должно быть :min или больше', 257 'integer' => 'Поле «:attribute» должно быть :min или больше',
251 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 258 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
252 ], 259 ],
253 'max' => [ 260 'max' => [
254 'string' => 'Поле «:attribute» должно быть не больше :max символов', 261 'string' => 'Поле «:attribute» должно быть не больше :max символов',
255 'integer' => 'Поле «:attribute» должно быть :max или меньше', 262 'integer' => 'Поле «:attribute» должно быть :max или меньше',
256 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 263 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
257 ] 264 ]
258 ]; 265 ];
259 266
260 $validator = Validator::make($params, $rules, $messages); 267 $validator = Validator::make($params, $rules, $messages);
261 268
262 if ($validator->fails()) { 269 if ($validator->fails()) {
263 return redirect()->route('worker.cabinet')->withErrors($validator); 270 return redirect()->route('worker.cabinet')->withErrors($validator);
264 } else { 271 } else {
265 272
266 if ($request->has('photo')) { 273 if ($request->has('photo')) {
267 if (!empty($Worker->photo)) { 274 if (!empty($Worker->photo)) {
268 Storage::delete($Worker->photo); 275 Storage::delete($Worker->photo);
269 } 276 }
270 $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); 277 $params['photo'] = $request->file('photo')->store("worker/$id", 'public');
271 } 278 }
272 279
273 if ($request->has('file')) { 280 if ($request->has('file')) {
274 if (!empty($Worker->file)) { 281 if (!empty($Worker->file)) {
275 Storage::delete($Worker->file); 282 Storage::delete($Worker->file);
276 } 283 }
277 $params['file'] = $request->file('file')->store("worker/$id", 'public'); 284 $params['file'] = $request->file('file')->store("worker/$id", 'public');
278 } 285 }
279 286
280 $id_wor = $worker->update($params); 287 $id_wor = $worker->update($params);
281 288
282 $use = User_Model::find($id_wor); 289 $use = User_Model::find($id_wor);
283 $use->surname = $request->get('surname'); 290 $use->surname = $request->get('surname');
284 $use->name_man = $request->get('name_man'); 291 $use->name_man = $request->get('name_man');
285 $use->surname2 = $request->get('surname2'); 292 $use->surname2 = $request->get('surname2');
286 293
287 $use->save(); 294 $use->save();
288 $worker->job_titles()->sync($job_title_id); 295 $worker->job_titles()->sync($job_title_id);
289 296
290 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); 297 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены');
291 } 298 }
292 } 299 }
293 300
294 // Сообщения данные 301 // Сообщения данные
295 public function messages($type_message) 302 public function messages($type_message)
296 { 303 {
297 $user_id = Auth()->user()->id; 304 $user_id = Auth()->user()->id;
298 305
299 $messages_input = Message::query()->with('vacancies')->with('user_from')-> 306 $messages_input = Message::query()->with('vacancies')->with('user_from')->
300 Where('to_user_id', $user_id)->OrderByDesc('created_at'); 307 Where('to_user_id', $user_id)->OrderByDesc('created_at');
301 308
302 $messages_output = Message::query()->with('vacancies')-> 309 $messages_output = Message::query()->with('vacancies')->
303 with('user_to')->where('user_id', $user_id)-> 310 with('user_to')->where('user_id', $user_id)->
304 OrderByDesc('created_at'); 311 OrderByDesc('created_at');
305 312
306 313
307 $count_input = $messages_input->count(); 314 $count_input = $messages_input->count();
308 $count_output = $messages_output->count(); 315 $count_output = $messages_output->count();
309 316
310 if ($type_message == 'input') { 317 if ($type_message == 'input') {
311 $messages = $messages_input->paginate(15); 318 $messages = $messages_input->paginate(15);
312 } 319 }
313 320
314 if ($type_message == 'output') { 321 if ($type_message == 'output') {
315 $messages = $messages_output->paginate(15); 322 $messages = $messages_output->paginate(15);
316 } 323 }
317 // Вернуть все 100% 324 // Вернуть все 100%
318 return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); 325 return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id'));
319 } 326 }
320 327
321 // Избранный 328 // Избранный
322 public function favorite() 329 public function favorite()
323 { 330 {
324 return view('workers.favorite'); 331 return view('workers.favorite');
325 } 332 }
326 333
327 // Сменить пароль 334 // Сменить пароль
328 public function new_password() 335 public function new_password()
329 { 336 {
330 $email = Auth()->user()->email; 337 $email = Auth()->user()->email;
331 return view('workers.new_password', compact('email')); 338 return view('workers.new_password', compact('email'));
332 } 339 }
333 340
334 // Обновление пароля 341 // Обновление пароля
335 public function save_new_password(Request $request) { 342 public function save_new_password(Request $request) {
336 $use = Auth()->user(); 343 $use = Auth()->user();
337 $request->validate([ 344 $request->validate([
338 'password' => 'required|string', 345 'password' => 'required|string',
339 'new_password' => 'required|string', 346 'new_password' => 'required|string',
340 'new_password2' => 'required|string' 347 'new_password2' => 'required|string'
341 ]); 348 ]);
342 349
343 if ($request->get('new_password') == $request->get('new_password2')) 350 if ($request->get('new_password') == $request->get('new_password2'))
344 if ($request->get('password') !== $request->get('new_password')) { 351 if ($request->get('password') !== $request->get('new_password')) {
345 $credentials = $request->only('email', 'password'); 352 $credentials = $request->only('email', 'password');
346 if (Auth::attempt($credentials, $request->has('save_me'))) { 353 if (Auth::attempt($credentials, $request->has('save_me'))) {
347 354
348 if (!is_null($use->email_verified_at)){ 355 if (!is_null($use->email_verified_at)){
349 356
350 $user_data = User_Model::find($use->id); 357 $user_data = User_Model::find($use->id);
351 $user_data->update([ 358 $user_data->update([
352 'password' => Hash::make($request->get('new_password')), 359 'password' => Hash::make($request->get('new_password')),
353 'pubpassword' => base64_encode($request->get('new_password')), 360 'pubpassword' => base64_encode($request->get('new_password')),
354 ]); 361 ]);
355 return redirect() 362 return redirect()
356 ->route('worker.new_password') 363 ->route('worker.new_password')
357 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 364 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
358 } 365 }
359 366
360 return redirect() 367 return redirect()
361 ->route('worker.new_password') 368 ->route('worker.new_password')
362 ->withError('Данная учетная запись не было верифицированна!'); 369 ->withError('Данная учетная запись не было верифицированна!');
363 } 370 }
364 } 371 }
365 372
366 return redirect() 373 return redirect()
367 ->route('worker.new_password') 374 ->route('worker.new_password')
368 ->withErrors('Не совпадение данных, обновите пароли!'); 375 ->withErrors('Не совпадение данных, обновите пароли!');
369 } 376 }
370 377
371 // Удаление профиля форма 378 // Удаление профиля форма
372 public function delete_profile() 379 public function delete_profile()
373 { 380 {
374 $login = Auth()->user()->email; 381 $login = Auth()->user()->email;
375 return view('workers.delete_profile', compact('login')); 382 return view('workers.delete_profile', compact('login'));
376 } 383 }
377 384
378 // Удаление профиля код 385 // Удаление профиля код
379 public function delete_profile_result(Request $request) { 386 public function delete_profile_result(Request $request) {
380 $Answer = $request->all(); 387 $Answer = $request->all();
381 $user_id = Auth()->user()->id; 388 $user_id = Auth()->user()->id;
382 $request->validate([ 389 $request->validate([
383 'password' => 'required|string', 390 'password' => 'required|string',
384 ]); 391 ]);
385 392
386 $credentials = $request->only('email', 'password'); 393 $credentials = $request->only('email', 'password');
387 if (Auth::attempt($credentials)) { 394 if (Auth::attempt($credentials)) {
388 Auth::logout(); 395 Auth::logout();
389 $it = User_Model::find($user_id); 396 $it = User_Model::find($user_id);
390 //$it->delete(); 397 $it->delete();
391 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 398 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
392 } else { 399 } else {
393 return redirect()->route('worker.delete_profile') 400 return redirect()->route('worker.delete_profile')
394 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 401 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
395 } 402 }
396 } 403 }
397 404
398 // Регистрация соискателя 405 // Регистрация соискателя
399 public function register_worker(Request $request) 406 public function register_worker(Request $request)
400 { 407 {
401 $params = $request->all(); 408 $params = $request->all();
402 409
403 410
404 dd($params); 411 dd($params);
405 412
406 $rules = [ 413 $rules = [
407 'surname' => ['required', 'string', 'max:255'], 414 'surname' => ['required', 'string', 'max:255'],
408 'name_man' => ['required', 'string', 'max:255'], 415 'name_man' => ['required', 'string', 'max:255'],
409 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 416 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
410 'password' => ['required', 'string', 'min:8'] 417 'password' => ['required', 'string', 'min:8']
411 ]; 418 ];
412 419
413 $messages = [ 420 $messages = [
414 'required' => 'Укажите обязательное поле', 421 'required' => 'Укажите обязательное поле',
415 'min' => [ 422 'min' => [
416 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 423 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
417 'integer' => 'Поле «:attribute» должно быть :min или больше', 424 'integer' => 'Поле «:attribute» должно быть :min или больше',
418 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 425 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
419 ], 426 ],
420 'max' => [ 427 'max' => [
421 'string' => 'Поле «:attribute» должно быть не больше :max символов', 428 'string' => 'Поле «:attribute» должно быть не больше :max символов',
422 'integer' => 'Поле «:attribute» должно быть :max или меньше', 429 'integer' => 'Поле «:attribute» должно быть :max или меньше',
423 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 430 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
424 ] 431 ]
425 ]; 432 ];
426 433
427 if ($request->get('password') !== $request->get('confirmed')){ 434 if ($request->get('password') !== $request->get('confirmed')){
428 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 435 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
429 } 436 }
430 437
431 if (($request->has('politik')) && ($request->get('politik') == 1)) { 438 if (($request->has('politik')) && ($request->get('politik') == 1)) {
432 $validator = Validator::make($request->all(), $rules, $messages); 439 $validator = Validator::make($request->all(), $rules, $messages);
433 440
434 if ($validator->fails()) { 441 if ($validator->fails()) {
435 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 442 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
436 } else { 443 } else {
437 $user = $this->create($params); 444 $user = $this->create($params);
438 event(new Registered($user)); 445 event(new Registered($user));
439 446
440 Auth::guard()->login($user); 447 Auth::guard()->login($user);
441 } 448 }
442 449
443 if ($user) { 450 if ($user) {
444 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; 451 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));;
445 } else { 452 } else {
446 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 453 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
447 } 454 }
448 455
449 } else { 456 } else {
450 return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!")); 457 return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!"));
451 } 458 }
452 459
453 460
454 } 461 }
455 462
456 463
457 // Звездная оценка и ответ 464 // Звездная оценка и ответ
458 public function stars_answer(Request $request) { 465 public function stars_answer(Request $request) {
459 $params = $request->all(); 466 $params = $request->all();
460 $rules = [ 467 $rules = [
461 'message' => ['required', 'string', 'max:255'], 468 'message' => ['required', 'string', 'max:255'],
462 ]; 469 ];
463 470
464 $messages = [ 471 $messages = [
465 'required' => 'Укажите обязательное поле', 472 'required' => 'Укажите обязательное поле',
466 'min' => [ 473 'min' => [
467 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 474 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
468 'integer' => 'Поле «:attribute» должно быть :min или больше', 475 'integer' => 'Поле «:attribute» должно быть :min или больше',
469 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 476 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
470 ], 477 ],
471 'max' => [ 478 'max' => [
472 'string' => 'Поле «:attribute» должно быть не больше :max символов', 479 'string' => 'Поле «:attribute» должно быть не больше :max символов',
473 'integer' => 'Поле «:attribute» должно быть :max или меньше', 480 'integer' => 'Поле «:attribute» должно быть :max или меньше',
474 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 481 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
475 ] 482 ]
476 ]; 483 ];
477 $response_worker = ResponseWork::create($params); 484 $response_worker = ResponseWork::create($params);
478 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); 485 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!');
479 } 486 }
480 487
481 // Создание пользователя 488 // Создание пользователя
482 protected function create(array $data) 489 protected function create(array $data)
483 { 490 {
484 $Use = new User(); 491 $Use = new User();
485 $Code_user = $Use->create([ 492 $Code_user = $Use->create([
486 'name' => $data['surname']." ".$data['name_man'], 493 'name' => $data['surname']." ".$data['name_man'],
487 'name_man' => $data['name_man'], 494 'name_man' => $data['name_man'],
488 'surname' => $data['surname'], 495 'surname' => $data['surname'],
489 'surname2' => $data['surname2'], 496 'surname2' => $data['surname2'],
490 'subscribe_email' => $data['email'], 497 'subscribe_email' => $data['email'],
491 'email' => $data['email'], 498 'email' => $data['email'],
492 'telephone' => $data['telephone'], 499 'telephone' => $data['telephone'],
493 'password' => Hash::make($data['password']), 500 'password' => Hash::make($data['password']),
494 'pubpassword' => base64_encode($data['password']), 501 'pubpassword' => base64_encode($data['password']),
495 'email_verified_at' => Carbon::now() 502 'email_verified_at' => Carbon::now()
496 ]); 503 ]);
497 if ($Code_user->id > 0) { 504 if ($Code_user->id > 0) {
498 $Worker = new Worker(); 505 $Worker = new Worker();
499 $Worker->user_id = $Code_user->id; 506 $Worker->user_id = $Code_user->id;
500 $Worker->position_work = $data['job_titles']; 507 $Worker->position_work = $data['job_titles'];
501 $Worker->email = $data['email']; 508 $Worker->email = $data['email'];
502 $Worker->telephone = $data['telephone']; 509 $Worker->telephone = $data['telephone'];
503 $Worker->save(); 510 $Worker->save();
504 511
505 return $Code_user; 512 return $Code_user;
506 } 513 }
507 } 514 }
508 515
509 // Борьба против колорадских жуков, хотя жуков победил все таки 45. 516 // Вакансии избранные
510 public function colorado(Request $request) { 517 public function colorado(Request $request) {
511 if (isset($_COOKIE['favorit_vacancy'])) { 518 $IP_address = RusDate::ip_addr_client();
512 $items = RusDate::count_vacancy_fav(); 519 $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get();
513 $it = $_COOKIE['favorit_vacancy']; 520
514 $it = str_replace('"', "", $it); 521 if ($Arr->count()) {
515 $it = str_replace('[', "", $it); 522 $A = Array();
516 $it = str_replace(']', "", $it); 523 foreach ($Arr as $it) {
517 $Arr = explode(",", $it); 524 $A[] = $it->code_record;
525 }
526
527 $Query = Ad_employer::query()->whereIn('id', $A);
518 } else { 528 } else {
519 $Arr = Array('$0'); 529 $Query = Ad_employer::query();
520 } 530 }
521 531
522 $Query = Ad_employer::Query();
523 if (count($Arr) > 0) {
524 $Query = $Query->whereIn('id', $Arr);
525 }
526 $Query = $Query->with('jobs')-> 532 $Query = $Query->with('jobs')->
527 with('cat')-> 533 with('cat')->
528 with('employer')-> 534 with('employer')->
529 whereHas('jobs_code', function ($query) use ($request) { 535 whereHas('jobs_code', function ($query) use ($request) {
530 if ($request->ajax()) { 536 if ($request->ajax()) {
531 if (null !== ($request->get('job'))) { 537 if (null !== ($request->get('job'))) {
532 $query->where('job_title_id', $request->get('job')); 538 $query->where('job_title_id', $request->get('job'));
533 } 539 }
534 } 540 }
535 })->select('ad_employers.*'); 541 })->select('ad_employers.*');
536 542
537 $Job_title = Job_title::query()->OrderBy('name')->get(); 543 $Job_title = Job_title::query()->OrderBy('name')->get();
538 544
539 $Query_count = $Query->count(); 545 $Query_count = $Query->count();
540 546
541 $Query = $Query->OrderBy('updated_at')->paginate(3); 547 $Query = $Query->OrderBy('updated_at')->paginate(3);
542 548
543 return view('workers.favorite', compact('Query', 549 return view('workers.favorite', compact('Query',
544 'Query_count', 550 'Query_count',
545 'Job_title')); 551 'Job_title'));
546 552
547 } 553 }
548 554
549 //Переписка 555 //Переписка
550 public function dialog(User_Model $user1, User_Model $user2) { 556 public function dialog(User_Model $user1, User_Model $user2) {
551 if (isset($user2->id)) { 557 if (isset($user2->id)) {
552 $companion = User_Model::query()->with('workers')-> 558 $companion = User_Model::query()->with('workers')->
553 with('employers')-> 559 with('employers')->
554 where('id', $user2->id)->first(); 560 where('id', $user2->id)->first();
555 } 561 }
556 562
557 $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) { 563 $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) {
558 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); 564 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id);
559 })->orWhere(function($query) use ($user1, $user2) { 565 })->orWhere(function($query) use ($user1, $user2) {
560 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); 566 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id);
561 })->OrderBy('created_at')->get(); 567 })->OrderBy('created_at')->get();
562 568
563 $id_vac = null; 569 $id_vac = null;
564 foreach ($Messages as $it) { 570 foreach ($Messages as $it) {
565 if (isset($it->response)) { 571 if (isset($it->response)) {
566 foreach ($it->response as $r) { 572 foreach ($it->response as $r) {
567 if (isset($r->ad_employer_id)) { 573 if (isset($r->ad_employer_id)) {
568 $id_vac = $r->ad_employer_id; 574 $id_vac = $r->ad_employer_id;
569 break; 575 break;
570 } 576 }
571 } 577 }
572 } 578 }
573 if (!is_null($id_vac)) break; 579 if (!is_null($id_vac)) break;
574 } 580 }
575 581
576 $ad_employer = null; 582 $ad_employer = null;
577 if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); 583 if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first();
578 $sender = $user1; 584 $sender = $user1;
579 585
580 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); 586 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer'));
581 } 587 }
582 588
583 // Даунылоады 589 // Даунылоады
584 public function download(Worker $worker) { 590 public function download(Worker $worker) {
585 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; 591 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...'];
586 view()->share('house',$arr_house); 592 view()->share('house',$arr_house);
587 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); 593 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape');
588 return $pdf->stream(); 594 return $pdf->stream();
589 } 595 }
590 596
591 // Поднятие анкеты 597 // Поднятие анкеты
592 public function up(Worker $worker) { 598 public function up(Worker $worker) {
593 $worker->updated_at = Carbon::now(); 599 $worker->updated_at = Carbon::now();
594 $worker->save(); 600 $worker->save();
595 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); 601 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных');
596 } 602 }
597 603
598 // Добавление сертификата 604 // Добавление сертификата
599 public function add_serificate(Request $request) { 605 public function add_serificate(Request $request) {
600 $params = $request->all(); 606 $params = $request->all();
601 $params['date_begin'] = date('d.m.Y', strtotime($params['date_begin'])); 607 $params['date_begin'] = date('d.m.Y', strtotime($params['date_begin']));
602 $params['end_begin'] = date('d.m.Y', strtotime($params['end_begin'])); 608 $params['end_begin'] = date('d.m.Y', strtotime($params['end_begin']));
603 $Sertificate = new sertification(); 609 $Sertificate = new sertification();
604 $Sertificate->create($params); 610 $Sertificate->create($params);
605 $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get(); 611 $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get();
606 return view('ajax.documents', compact('Docs')); 612 return view('ajax.documents', compact('Docs'));
607 } 613 }
608 614
609 615
610 // Удалить сертификат 616 // Удалить сертификат
611 public function delete_sertificate(sertification $doc) { 617 public function delete_sertificate(sertification $doc) {
612 $doc->delete(); 618 $doc->delete();
613 619
614 return redirect()->route('worker.cabinet'); 620 return redirect()->route('worker.cabinet');
615 } 621 }
616 622
617 // Добавление диплома 623 // Добавление диплома
618 public function add_diplom_ajax(Request $request) { 624 public function add_diplom_ajax(Request $request) {
619 // конец 625 // конец
620 $params = $request->all(); 626 $params = $request->all();
621 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 627 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
622 628
623 if ($count == 0) $dop_info = Dop_info::create($params); 629 if ($count == 0) $dop_info = Dop_info::create($params);
624 $Infoblocks = infobloks::query()->get(); 630 $Infoblocks = infobloks::query()->get();
625 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); 631 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get();
626 $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); 632 $data = Dop_info::query()->where('worker_id', $request->has('worker_id'));
627 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); 633 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker'));
628 } 634 }
629 635
630 // Добавление диплома без ajax 636 // Добавление диплома без ajax
631 public function add_diplom(Worker $worker) { 637 public function add_diplom(Worker $worker) {
632 $worker_id = $worker->id; 638 $worker_id = $worker->id;
633 $Infoblocks = infobloks::query()->get(); 639 $Infoblocks = infobloks::query()->get();
634 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); 640 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks'));
635 } 641 }
636 // Сохранить 642 // Сохранить
637 // Сохраняю диплом 643 // Сохраняю диплом
638 public function add_diplom_save(Request $request) { 644 public function add_diplom_save(Request $request) {
639 $params = $request->all(); 645 $params = $request->all();
640 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 646 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
641 if ($count == 0) $dop_info = Dop_info::create($params); 647 if ($count == 0) $dop_info = Dop_info::create($params);
642 return redirect()->route('worker.cabinet'); 648 return redirect()->route('worker.cabinet');
643 } 649 }
644 650
645 // Добавление стандартного документа 651 // Добавление стандартного документа
646 public function add_document(Worker $worker) { 652 public function add_document(Worker $worker) {
647 return view('workers.docs', compact('worker')); 653 return view('workers.docs', compact('worker'));
648 } 654 }
649 655
650 //Сохранение стандартого документа 656 //Сохранение стандартого документа
651 public function add_document_save(DocumentsRequest $request) { 657 public function add_document_save(DocumentsRequest $request) {
652 $params = $request->all(); 658 $params = $request->all();
653 $place_work = place_works::create($params); 659 $place_work = place_works::create($params);
654 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!'); 660 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!');
655 } 661 }
656 662
657 // Редактирование документа 663 // Редактирование документа
658 public function edit_document(place_works $doc, Worker $worker) { 664 public function edit_document(place_works $doc, Worker $worker) {
659 return view('workers.docs-edit', compact('doc', 'worker')); 665 return view('workers.docs-edit', compact('doc', 'worker'));
660 } 666 }
661 667
662 //Сохранение отредактированного документа 668 //Сохранение отредактированного документа
663 public function edit_document_save(DocumentsRequest $request, place_works $doc) { 669 public function edit_document_save(DocumentsRequest $request, place_works $doc) {
664 $params = $request->all(); 670 $params = $request->all();
665 $doc->update($params); 671 $doc->update($params);
666 672
667 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); 673 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!');
668 } 674 }
669 675
670 // Удаление документа 676 // Удаление документа
671 public function delete_document(place_works $doc) { 677 public function delete_document(place_works $doc) {
672 $doc->delete(); 678 $doc->delete();
673 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); 679 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!');
674 } 680 }
675 681
676 //Отправка нового сообщения 682 //Отправка нового сообщения
677 public function new_message(Request $request) { 683 public function new_message(Request $request) {
678 $params = $request->all(); 684 $params = $request->all();
679 685
680 $id = $params['send_user_id']; 686 $id = $params['send_user_id'];
681 $message = new Message(); 687 $message = new Message();
682 $message->user_id = $params['send_user_id']; 688 $message->user_id = $params['send_user_id'];
683 $message->to_user_id = $params['send_to_user_id']; 689 $message->to_user_id = $params['send_to_user_id'];
684 $message->title = $params['send_title']; 690 $message->title = $params['send_title'];
685 $message->text = $params['send_text']; 691 $message->text = $params['send_text'];
686 if ($request->has('send_file')) { 692 if ($request->has('send_file')) {
687 $message->file = $request->file('send_file')->store("worker/$id", 'public'); 693 $message->file = $request->file('send_file')->store("worker/$id", 'public');
688 } 694 }
689 $message->flag_new = 1; 695 $message->flag_new = 1;
690 $id_message = $message->save(); 696 $id_message = $message->save();
691 697
692 $data['message_id'] = $id_message; 698 $data['message_id'] = $id_message;
693 $data['ad_employer_id'] = $params['send_vacancy']; 699 $data['ad_employer_id'] = $params['send_vacancy'];
694 $data['job_title_id'] = $params['send_job_title_id']; 700 $data['job_title_id'] = $params['send_job_title_id'];
695 $data['flag'] = 1; 701 $data['flag'] = 1;
696 $ad_responce = ad_response::create($data); 702 $ad_responce = ad_response::create($data);
697 return redirect()->route('worker.messages', ['type_message' => 'output']); 703 return redirect()->route('worker.messages', ['type_message' => 'output']);
698 } 704 }
app/Models/Like_vacancy.php
File was created 1 <?php
2
3 namespace App\Models;
4
5 use Illuminate\Database\Eloquent\Factories\HasFactory;
6 use Illuminate\Database\Eloquent\Model;
7
8 class Like_vacancy extends Model
9 {
10 use HasFactory;
11
12 public $table = 'like_vacancy';
13
14 public $fillable = [
15 'code_record',
16 'ip_address'
17 ];
18 }
19
app/Models/Like_worker.php
File was created 1 <?php
2
3 namespace App\Models;
4
5 use Illuminate\Database\Eloquent\Factories\HasFactory;
6 use Illuminate\Database\Eloquent\Model;
7
8 class Like_worker extends Model
9 {
10 use HasFactory;
11
12 public $table = 'like_worker';
13
14 public $fillable = [
15 'code_record',
16 'ip_address'
17 ];
18
19 /*
20 один-ко-многим
21 */
22 public function worker() {
23 return $this->hasMany(Worker::class);
24 }
25 }
26
database/migrations/2024_03_24_082538_create_table_like_worker.php
File was created 1 <?php
2
3 use Illuminate\Database\Migrations\Migration;
4 use Illuminate\Database\Schema\Blueprint;
5 use Illuminate\Support\Facades\Schema;
6
7 return new class extends Migration
8 {
9 /**
10 * Run the migrations.
11 *
12 * @return void
13 */
14 public function up()
15 {
16 Schema::create('like_worker', function (Blueprint $table) {
17 $table->id();
18 $table->string('ip_address', 255)->nullable(false);
19 $table->string('code_record')->nullable(false);
20 $table->timestamps();
21 });
22 }
23
24 /**
25 * Reverse the migrations.
26 *
27 * @return void
28 */
29 public function down()
30 {
31 Schema::dropIfExists('like_worker');
32 }
33 };
34
database/migrations/2024_03_24_082648_create_table_like_vacancy.php
File was created 1 <?php
2
3 use Illuminate\Database\Migrations\Migration;
4 use Illuminate\Database\Schema\Blueprint;
5 use Illuminate\Support\Facades\Schema;
6
7 return new class extends Migration
8 {
9 /**
10 * Run the migrations.
11 *
12 * @return void
13 */
14 public function up()
15 {
16 Schema::create('like_vacancy', function (Blueprint $table) {
17 $table->id();
18 $table->string('ip_address', 255)->nullable(false);
19 $table->string('code_record')->nullable(false);
20 $table->timestamps();
21 });
22 }
23
24 /**
25 * Reverse the migrations.
26 *
27 * @return void
28 */
29 public function down()
30 {
31 Schema::dropIfExists('table_like_vacancy');
32 }
33 };
34
public/js/script145.js
File was created 1 let scripts = function () {
2
3 $('.js-toggle').on('click', function () {
4 $(this).toggleClass('active');
5 });
6 $('.js-parent-toggle').on('click', function () {
7 $(this).parent().toggleClass('active');
8 });
9 $('.js-parent-remove').on('click', function () {
10 $(this).parent().remove();
11 });
12 $('.js-menu-toggle').on('click', function () {
13 window.scrollTo(0, 0);
14 $('#body').toggleClass('menu-is-actived');
15 });
16 $('.js-cookies-close').on('click', function () {
17 $('#body').removeClass('cookies-is-actived');
18 });
19 $('.js-works-edit').on('click', function () {
20 $(this).parent().parent().parent().addClass('active');
21 });
22 $('.js-works-remove').on('click', function () {
23 $(this).parent().parent().parent().parent().remove();
24 });
25
26 $('[data-tab]').on('click', function () {
27 $('[data-tab]').removeClass('active');
28 $('[data-body]').removeClass('showed');
29 $(this).addClass('active');
30 var id = $(this).data('tab');
31 $('[data-body=' + id + ']').addClass('showed');
32 });
33
34 $('.js-password-show').on('click', function () {
35 $(this).parent().addClass('active');
36 $(this).parent().parent().find('input').attr('type', 'text');
37 });
38
39 $('.js-password-hide').on('click', function () {
40 $(this).parent().removeClass('active');
41 $(this).parent().parent().find('input').attr('type', 'password');
42 });
43
44 let checkScrollTop = function () {
45 if ($(document).scrollTop() == 0) {
46 $('#body').removeClass('begin');
47 } else {
48 $('#body').addClass('begin');
49 }
50 }
51 checkScrollTop();
52 $(document).on('scroll', function () {
53 checkScrollTop();
54 });
55
56 let closeAll = function () {
57 $('.js-toggle').removeClass('active');
58 $('.js-parent-toggle').parent().removeClass('active');
59 $('#body').removeClass('menu-is-actived');
60 $('#body').removeClass('cookies-is-actived');
61 }
62
63 $(document).keyup(function (e) {
64 if (e.key === "Escape") {
65 closeAll();
66 }
67 });
68
69 $('.js-scroll-to').bind('click', function (e) {
70 let anchor = $(this);
71 $('html,body').stop().animate({
72 scrollTop: $(anchor.attr('href')).offset().top
73 }, 300);
74 e.preventDefault();
75 });
76
77 if ($('[type=tel]').is('[type=tel]')) {
78 $('[type=tel]').mask('+7 (999) 999-99-99');
79 }
80
81 if ($('.js-select2').is('.js-select2')) {
82 $('.js-select2').select2();
83 }
84
85 const starRating = document.querySelectorAll(".js-stars");
86 if (starRating.length) {
87 starRating.forEach(item => {
88 new StarRating(item);
89 });
90 }
91 };
92
93 document.addEventListener("DOMContentLoaded", () => {
94 scripts();
95 swipers();
96 });
97
98 $(window).resize(function () {
99 swipers();
100 });
101
102 let swipers = function () {
103
104 if ($('.js-employer-swiper').is('.js-employer-swiper')) {
105 let slider = new Swiper('.js-employer-swiper', {
106 autoplay: {
107 delay: 5000,
108 },
109 pagination: {
110 el: '.swiper-pagination',
111 clickable: true
112 },
113 breakpoints: {
114 768: {
115 slidesPerView: 2,
116 },
117 992: {
118 slidesPerView: 3,
119 },
120 1280: {
121 slidesPerView: 4,
122 },
123 }
124 });
125 }
126
127 if ($('.js-news-swiper').is('.js-news-swiper')) {
128 let slider = new Swiper('.js-news-swiper', {
129 spaceBetween: 20,
130 pagination: {
131 el: '.swiper-pagination',
132 clickable: true
133 },
134 navigation: {
135 prevEl: '.js-news-swiper-button-prev',
136 nextEl: '.js-news-swiper-button-next',
137 },
138 breakpoints: {
139 768: {
140 slidesPerView: 2,
141 },
142 992: {
143 slidesPerView: 3,
144 },
145 }
146 });
147 }
148
149 // cookies
150 /*const cookieItems = document.querySelectorAll(".js-ck");
151 if (cookieItems.length) {
152 cookieItems.forEach(item => {
153 const id = item.dataset.id;
154 const like = item.querySelector(".like");
155 const checkLike = function () {
156 if (like.classList.contains("active")) {
157 Cookies.set('favor_vacan-'+id, id);
158 } else {
159 Cookies.remove(id);
160 }
161 }
162
163 like.addEventListener("click", () => {
164 checkLike();
165 });
166
167 if (Cookies.get('favor_vacan-'+id) == id) {
168 like.classList.add("active");
169 }
170 });
171 }
172 console.log(Cookies.get());
173
174
175 */
176 };
177
178
179
180
181
public/js/script45.js
1 let scripts = function () { 1 let scripts = function () {
2 2
3 $('.js-toggle').on('click', function () { 3 $('.js-toggle').on('click', function () {
4 $(this).toggleClass('active'); 4 $(this).toggleClass('active');
5 }); 5 });
6 $('.js-parent-toggle').on('click', function () { 6 $('.js-parent-toggle').on('click', function () {
7 $(this).parent().toggleClass('active'); 7 $(this).parent().toggleClass('active');
8 }); 8 });
9 $('.js-parent-remove').on('click', function () { 9 $('.js-parent-remove').on('click', function () {
10 $(this).parent().remove(); 10 $(this).parent().remove();
11 }); 11 });
12 $('.js-menu-toggle').on('click', function () { 12 $('.js-menu-toggle').on('click', function () {
13 window.scrollTo(0, 0); 13 window.scrollTo(0, 0);
14 $('#body').toggleClass('menu-is-actived'); 14 $('#body').toggleClass('menu-is-actived');
15 }); 15 });
16 $('.js-cookies-close').on('click', function () { 16 $('.js-cookies-close').on('click', function () {
17 $('#body').removeClass('cookies-is-actived'); 17 $('#body').removeClass('cookies-is-actived');
18 }); 18 });
19 $('.js-works-edit').on('click', function () { 19 $('.js-works-edit').on('click', function () {
20 $(this).parent().parent().parent().addClass('active'); 20 $(this).parent().parent().parent().addClass('active');
21 }); 21 });
22 $('.js-works-remove').on('click', function () { 22 $('.js-works-remove').on('click', function () {
23 $(this).parent().parent().parent().parent().remove(); 23 $(this).parent().parent().parent().parent().remove();
24 }); 24 });
25 25
26 $('[data-tab]').on('click', function () { 26 $('[data-tab]').on('click', function () {
27 $('[data-tab]').removeClass('active'); 27 $('[data-tab]').removeClass('active');
28 $('[data-body]').removeClass('showed'); 28 $('[data-body]').removeClass('showed');
29 $(this).addClass('active'); 29 $(this).addClass('active');
30 var id = $(this).data('tab'); 30 var id = $(this).data('tab');
31 $('[data-body=' + id + ']').addClass('showed'); 31 $('[data-body=' + id + ']').addClass('showed');
32 }); 32 });
33 33
34 $('.js-password-show').on('click', function () { 34 $('.js-password-show').on('click', function () {
35 $(this).parent().addClass('active'); 35 $(this).parent().addClass('active');
36 $(this).parent().parent().find('input').attr('type', 'text'); 36 $(this).parent().parent().find('input').attr('type', 'text');
37 }); 37 });
38 38
39 $('.js-password-hide').on('click', function () { 39 $('.js-password-hide').on('click', function () {
40 $(this).parent().removeClass('active'); 40 $(this).parent().removeClass('active');
41 $(this).parent().parent().find('input').attr('type', 'password'); 41 $(this).parent().parent().find('input').attr('type', 'password');
42 }); 42 });
43 43
44 let checkScrollTop = function () { 44 let checkScrollTop = function () {
45 if ($(document).scrollTop() == 0) { 45 if ($(document).scrollTop() == 0) {
46 $('#body').removeClass('begin'); 46 $('#body').removeClass('begin');
47 } else { 47 } else {
48 $('#body').addClass('begin'); 48 $('#body').addClass('begin');
49 } 49 }
50 } 50 }
51 checkScrollTop(); 51 checkScrollTop();
52 $(document).on('scroll', function () { 52 $(document).on('scroll', function () {
53 checkScrollTop(); 53 checkScrollTop();
54 }); 54 });
55 55
56 let closeAll = function () { 56 let closeAll = function () {
57 $('.js-toggle').removeClass('active'); 57 $('.js-toggle').removeClass('active');
58 $('.js-parent-toggle').parent().removeClass('active'); 58 $('.js-parent-toggle').parent().removeClass('active');
59 $('#body').removeClass('menu-is-actived'); 59 $('#body').removeClass('menu-is-actived');
60 $('#body').removeClass('cookies-is-actived'); 60 $('#body').removeClass('cookies-is-actived');
61 } 61 }
62 62
63 $(document).keyup(function (e) { 63 $(document).keyup(function (e) {
64 if (e.key === "Escape") { 64 if (e.key === "Escape") {
65 closeAll(); 65 closeAll();
66 } 66 }
67 }); 67 });
68 68
69 $('.js-scroll-to').bind('click', function (e) { 69 $('.js-scroll-to').bind('click', function (e) {
70 let anchor = $(this); 70 let anchor = $(this);
71 $('html,body').stop().animate({ 71 $('html,body').stop().animate({
72 scrollTop: $(anchor.attr('href')).offset().top 72 scrollTop: $(anchor.attr('href')).offset().top
73 }, 300); 73 }, 300);
74 e.preventDefault(); 74 e.preventDefault();
75 }); 75 });
76 76
77 if ($('[type=tel]').is('[type=tel]')) { 77 if ($('[type=tel]').is('[type=tel]')) {
78 $('[type=tel]').mask('+7 (999) 999-99-99'); 78 $('[type=tel]').mask('+7 (999) 999-99-99');
79 } 79 }
80 80
81 if ($('.js-select2').is('.js-select2')) { 81 if ($('.js-select2').is('.js-select2')) {
82 $('.js-select2').select2(); 82 $('.js-select2').select2();
83 } 83 }
84 84
85 const starRating = document.querySelectorAll(".js-stars"); 85 const starRating = document.querySelectorAll(".js-stars");
86 if (starRating.length) { 86 if (starRating.length) {
87 starRating.forEach(item => { 87 starRating.forEach(item => {
88 new StarRating(item); 88 new StarRating(item);
89 }); 89 });
90 } 90 }
91 }; 91 };
92 92
93 document.addEventListener("DOMContentLoaded", () => { 93 document.addEventListener("DOMContentLoaded", () => {
94 scripts(); 94 scripts();
95 swipers(); 95 swipers();
96 }); 96 });
97 97
98 $(window).resize(function () { 98 $(window).resize(function () {
99 swipers(); 99 swipers();
100 }); 100 });
101 101
102 let swipers = function () { 102 let swipers = function () {
103 103
104 if ($('.js-employer-swiper').is('.js-employer-swiper')) { 104 if ($('.js-employer-swiper').is('.js-employer-swiper')) {
105 let slider = new Swiper('.js-employer-swiper', { 105 let slider = new Swiper('.js-employer-swiper', {
106 autoplay: { 106 autoplay: {
107 delay: 5000, 107 delay: 5000,
108 }, 108 },
109 pagination: { 109 pagination: {
110 el: '.swiper-pagination', 110 el: '.swiper-pagination',
111 clickable: true 111 clickable: true
112 }, 112 },
113 breakpoints: { 113 breakpoints: {
114 768: { 114 768: {
115 slidesPerView: 2, 115 slidesPerView: 2,
116 }, 116 },
117 992: { 117 992: {
118 slidesPerView: 3, 118 slidesPerView: 3,
119 }, 119 },
120 1280: { 120 1280: {
121 slidesPerView: 4, 121 slidesPerView: 4,
122 }, 122 },
123 } 123 }
124 }); 124 });
125 } 125 }
126 126
127 if ($('.js-news-swiper').is('.js-news-swiper')) { 127 if ($('.js-news-swiper').is('.js-news-swiper')) {
128 let slider = new Swiper('.js-news-swiper', { 128 let slider = new Swiper('.js-news-swiper', {
129 spaceBetween: 20, 129 spaceBetween: 20,
130 pagination: { 130 pagination: {
131 el: '.swiper-pagination', 131 el: '.swiper-pagination',
132 clickable: true 132 clickable: true
133 }, 133 },
134 navigation: { 134 navigation: {
135 prevEl: '.js-news-swiper-button-prev', 135 prevEl: '.js-news-swiper-button-prev',
136 nextEl: '.js-news-swiper-button-next', 136 nextEl: '.js-news-swiper-button-next',
137 }, 137 },
138 breakpoints: { 138 breakpoints: {
139 768: { 139 768: {
140 slidesPerView: 2, 140 slidesPerView: 2,
141 }, 141 },
142 992: { 142 992: {
143 slidesPerView: 3, 143 slidesPerView: 3,
144 }, 144 },
145 } 145 }
146 }); 146 });
147 } 147 }
148 148
149 // cookies 149 // cookies
150 const cookieItems = document.querySelectorAll(".js-ck"); 150 /*const cookieItems = document.querySelectorAll(".js-ck");
151 if (cookieItems.length) { 151 if (cookieItems.length) {
152 cookieItems.forEach(item => { 152 cookieItems.forEach(item => {
153 const id = item.dataset.id; 153 const id = item.dataset.id;
154 const like = item.querySelector(".like"); 154 const like = item.querySelector(".like");
155 const checkLike = function () { 155 const checkLike = function () {
156 if (like.classList.contains("active")) { 156 if (like.classList.contains("active")) {
157 Cookies.set('favor_vacan-'+id, id); 157 Cookies.set('favor_vacan-'+id, id);
158 } else { 158 } else {
159 Cookies.remove(id); 159 Cookies.remove(id);
160 } 160 }
161 } 161 }
162 162
163 like.addEventListener("click", () => { 163 like.addEventListener("click", () => {
164 checkLike(); 164 checkLike();
165 }); 165 });
166 166
167 if (Cookies.get('favor_vacan-'+id) == id) { 167 if (Cookies.get('favor_vacan-'+id) == id) {
168 like.classList.add("active"); 168 like.classList.add("active");
169 } 169 }
170 }); 170 });
171 } 171 }
172 console.log(Cookies.get()); 172 console.log(Cookies.get());
173 173
174
175 */
174 }; 176 };
175 177
176 178
177 179
178 180
179 181
resources/views/employers/favorite.blade.php
1 @extends('layout.frontend', ['title' => 'Избраннные соискатели - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Избраннные соискатели - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 console.log('Test system'); 5 console.log('Test system');
6 $(document).on('change', '#sort_ajax', function() { 6 $(document).on('change', '#sort_ajax', function() {
7 var this_ = $(this); 7 var this_ = $(this);
8 var val_ = this_.val(); 8 var val_ = this_.val();
9 console.log('sort items '+val_); 9 console.log('sort items '+val_);
10 10
11 $.ajax({ 11 $.ajax({
12 type: "GET", 12 type: "GET",
13 url: "{{ route('shipping_companies') }}", 13 url: "{{ route('shipping_companies') }}",
14 data: "sort="+val_+"&block=1", 14 data: "sort="+val_+"&block=1",
15 success: function (data) { 15 success: function (data) {
16 console.log('Выбор сортировки'); 16 console.log('Выбор сортировки');
17 console.log(data); 17 console.log(data);
18 $('#block_1').html(data); 18 $('#block_1').html(data);
19 }, 19 },
20 headers: { 20 headers: {
21 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 21 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
22 }, 22 },
23 error: function (data) { 23 error: function (data) {
24 data = JSON.stringify(data); 24 data = JSON.stringify(data);
25 console.log('Error: ' + data); 25 console.log('Error: ' + data);
26 } 26 }
27 }); 27 });
28 28
29 $.ajax({ 29 $.ajax({
30 type: "GET", 30 type: "GET",
31 url: "{{ route('shipping_companies') }}", 31 url: "{{ route('shipping_companies') }}",
32 data: "sort="+val_+"&block=2", 32 data: "sort="+val_+"&block=2",
33 success: function (data) { 33 success: function (data) {
34 console.log('Выбор сортировки2'); 34 console.log('Выбор сортировки2');
35 console.log(data); 35 console.log(data);
36 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 36 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
37 $('#block_2').html(data); 37 $('#block_2').html(data);
38 }, 38 },
39 headers: { 39 headers: {
40 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 40 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
41 }, 41 },
42 error: function (data) { 42 error: function (data) {
43 data = JSON.stringify(data); 43 data = JSON.stringify(data);
44 console.log('Error: ' + data); 44 console.log('Error: ' + data);
45 } 45 }
46 }); 46 });
47 }); 47 });
48 </script> 48 </script>
49 @include('js.favorite-vacancy-45')
49 @endsection 50 @endsection
50 51
51 @section('content') 52 @section('content')
52 <section class="cabinet"> 53 <section class="cabinet">
53 <div class="container"> 54 <div class="container">
54 <ul class="breadcrumbs cabinet__breadcrumbs"> 55 <ul class="breadcrumbs cabinet__breadcrumbs">
55 <li><a href="{{ route('index') }}">Главная</a></li> 56 <li><a href="{{ route('index') }}">Главная</a></li>
56 <li><b>Личный кабинет</b></li> 57 <li><b>Личный кабинет</b></li>
57 </ul> 58 </ul>
58 <div class="cabinet__wrapper"> 59 <div class="cabinet__wrapper">
59 <div class="cabinet__side"> 60 <div class="cabinet__side">
60 <div class="cabinet__side-toper"> 61 <div class="cabinet__side-toper">
61 @include('employers.emblema') 62 @include('employers.emblema')
62 </div> 63 </div>
63 64
64 @include('employers.menu', ['item' => 6]) 65 @include('employers.menu', ['item' => 6])
65 66
66 </div> 67 </div>
67 68
68 <div class="cabinet__body"> 69 <div class="cabinet__body">
69 <div class="cabinet__body-item"> 70 <div class="cabinet__body-item">
70 <h2 class="title cabinet__title">Избранные кандидаты</h2> 71 <h2 class="title cabinet__title">Избранные кандидаты</h2>
71 </div> 72 </div>
72 <div class="cabinet__body-item"> 73 <div class="cabinet__body-item">
73 <div class="cabinet__filters"> 74 <div class="cabinet__filters">
74 <div class="cabinet__filters-item"> 75 <div class="cabinet__filters-item">
75 <form class="search" action="{{ route('employer.favorites') }}"> 76 <form class="search" action="{{ route('employer.favorites') }}">
76 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;" value="@if ((isset($_GET['search'])) && (!empty($_GET['search']))) {{ $_GET['search'] }} @endif"> 77 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;" value="@if ((isset($_GET['search'])) && (!empty($_GET['search']))) {{ $_GET['search'] }} @endif">
77 <button type="submit" class="button">Найти</button> 78 <button type="submit" class="button">Найти</button>
78 <span> 79 <span>
79 <svg> 80 <svg>
80 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 81 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
81 </svg> 82 </svg>
82 </span> 83 </span>
83 </form> 84 </form>
84 </div> 85 </div>
85 <div class="cabinet__filters-item"> 86 <!--<div class="cabinet__filters-item">
86 <div class="select"> 87 <div class="select">
87 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 88 <select class="js-select2" id="sort_ajax" name="sort_ajax">
88 <option value="default">Сортировка (по умолчанию)</option> 89 <option value="default">Сортировка (по умолчанию)</option>
89 <option value="name (asc)">По имени (возрастание)</option> 90 <option value="name (asc)">По имени (возрастание)</option>
90 <option value="name (desc)">По имени (убывание)</option> 91 <option value="name (desc)">По имени (убывание)</option>
91 <option value="created_at (asc)">По дате (возрастание)</option> 92 <option value="created_at (asc)">По дате (возрастание)</option>
92 <option value="created_at (desc)">По дате (убывание)</option> 93 <option value="created_at (desc)">По дате (убывание)</option>
93 </select> 94 </select>
94 </div> 95 </div>
95 </div> 96 </div>-->
96 </div> 97 </div>
97 <div class="cvs"> 98 <div class="cvs">
98 <!--<button type="button" class="cvs__button js-toggle js-parent-toggle button button_light button_more"> 99 <!--<button type="button" class="cvs__button js-toggle js-parent-toggle button button_light button_more">
99 <span>Показать ещё</span> 100 <span>Показать ещё</span>
100 <span>Скрыть</span> 101 <span>Скрыть</span>
101 </button>--> 102 </button>-->
102 @if ((isset($Workers) && ($Workers->count()))) 103 @if ((isset($Workers) && ($Workers->count())))
103 @foreach ($Workers as $it) 104 @foreach ($Workers as $it)
104 <div class="cvs__body"> 105 <div class="cvs__body">
105 <div class="cvs__item"> 106 <div class="cvs__item">
106 <button type="button" class="like cvs__item-like js-toggle active"> 107 <button type="button" data-val="{{ $it->id }}" class="like cvs__item-like js_vac_favorite js-toggle {{ \App\Classes\LikesClass::get_status_worker($it) }}">
107 <svg> 108 <svg>
108 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 109 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
109 </svg> 110 </svg>
110 </button> 111 </button>
111 <div class="cvs__item-photo"> 112 <div class="cvs__item-photo">
112 <svg> 113 <svg>
113 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 114 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
114 </svg> 115 </svg>
115 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 116 <img src="{{ asset('images/default_man.jpg') }}" alt="">
116 </div> 117 </div>
117 <div class="cvs__item-text"> 118 <div class="cvs__item-text">
118 <div> 119 <div>
119 Статус 120 Статус
120 <span>@if ($it->status_work == 0) Ищу работу 121 <span>@if ($it->status_work == 0) Ищу работу
121 @elseif ($it->status_work == 1) Не указано 122 @elseif ($it->status_work == 1) Не указано
122 @elseif ($it->status_work == 2) Не ищу 123 @elseif ($it->status_work == 2) Не ищу
123 @endif 124 @endif
124 </span> 125 </span>
125 </div> 126 </div>
126 <div> 127 <div>
127 Имя кандидата 128 Имя кандидата
128 <span>({{ $it->id }}) @if (isset($it->users)) {{ $it->users->surname." ".$it->users->name_man." ".$it->users->surname2." (".$it->users->id.")" }} @endif</span> 129 <span>({{ $it->id }}) @if (isset($it->users)) {{ $it->users->surname." ".$it->users->name_man." ".$it->users->surname2." (".$it->users->id.")" }} @endif</span>
129 </div> 130 </div>
130 131
131 @if (!empty($it->telephone)) 132 @if (!empty($it->telephone))
132 <div> 133 <div>
133 Номер телефона 134 Номер телефона
134 <a href="tel:{{ $it->telephone }}">{{ $it->telephone }}</a> 135 <a href="tel:{{ $it->telephone }}">{{ $it->telephone }}</a>
135 </div> 136 </div>
136 @endif 137 @endif
137 138
138 @if (!empty($it->telephone2)) 139 @if (!empty($it->telephone2))
139 <div> 140 <div>
140 Номер телефона2 141 Номер телефона2
141 <a href="tel:{{ $it->telephone2 }}">{{ $it->telephone2 }}</a> 142 <a href="tel:{{ $it->telephone2 }}">{{ $it->telephone2 }}</a>
142 </div> 143 </div>
143 @endif 144 @endif
144 @if (!empty($it->email)) 145 @if (!empty($it->email))
145 <div> 146 <div>
146 Электронный адрес 147 Электронный адрес
147 <a href="emailto: {{ $it->email }}">{{ $it->email }}</a> 148 <a href="emailto: {{ $it->email }}">{{ $it->email }}</a>
148 </div> 149 </div>
149 @endif 150 @endif
150 @if (!empty($it->city)) 151 @if (!empty($it->city))
151 <div> 152 <div>
152 Город проживания 153 Город проживания
153 <span>{{ $it->city }}, {{ $it->address }}</span> 154 <span>{{ $it->city }}, {{ $it->address }}</span>
154 </div> 155 </div>
155 @endif 156 @endif
156 157
157 <div> 158 <div>
158 Опыт работы на танкерах 159 Опыт работы на танкерах
159 <span>@if (!empty($it->experience)) {{ $it->experience }} @else 0 @endif годов (лет).</span> 160 <span>@if (!empty($it->experience)) {{ $it->experience }} @else 0 @endif годов (лет).</span>
160 </div> 161 </div>
161 </div> 162 </div>
162 <div class="cvs__item-button"> 163 <div class="cvs__item-button">
163 <a href="" class="button">Написать соискателю</a> 164 <a href="" class="button">Написать соискателю</a>
164 </div> 165 </div>
165 </div> 166 </div>
166 </div> 167 </div>
167 @endforeach 168 @endforeach
168 </div> 169 </div>
169 @else 170 @else
170 <div class="notify"> 171 <div class="notify">
171 <svg> 172 <svg>
172 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> 173 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use>
173 </svg> 174 </svg>
174 <span>Нет избранных кандидатов</span> 175 <span>Нет избранных кандидатов</span>
175 </div> 176 </div>
176 @endif 177 @endif
177 </div> 178 </div>
178 </div> 179 </div>
179 </div> 180 </div>
180 </div> 181 </div>
181 182
182 </section> 183 </section>
183 </div> 184 </div>
184 @endsection 185 @endsection
185 186
resources/views/js/favorite-vacancy-3.blade.php
File was created 1
2 <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
3 <script>
4 console.log('js выполняется...');
5 console.log(read_array());
6 $(document).ready(function() {
7 $(document).on('click', '.js_vac_favorite', function () {
8 var _this = $(this);
9 var id_vacancy = _this.attr('data-val');
10
11 console.log('Download... final');
12 $.ajax({
13 type: "GET",
14 url: "{{ route('like-vacancy') }}",
15 data: "code_record="+id_vacancy,
16 success: function (data) {
17 console.log('Выбор сортировки');
18 console.log(data);
19 $('#main_ockar').html(data);
20 },
21 headers: {
22 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
23 },
24 error: function (data) {
25 data = JSON.stringify(data);
26 console.log('Error: ' + data);
27 }
28 });
29 console.log("Вывод куков "+str);
30
31 });
32 });
33 </script>
34
resources/views/js/favorite-vacancy-45.blade.php
File was created 1 <script>
2 console.log('js выполняется...123');
3
4 $(document).ready(function() {
5 $(document).on('click', '.js_vac_favorite', function () {
6 var _this = $(this);
7 var id = _this.attr('id');
8 var id_vacancy = _this.attr('data-val');
9 console.log('active='+id);
10
11 if ($( "#"+id ).hasClass( "active" )) {
12 console.log('Download 41... final');
13 $.ajax({
14 type: "GET",
15 url: "{{ route('like-vacancy') }}",
16 data: "code_record=" + id_vacancy,
17 success: function (data) {
18 console.log('Выбор сортировки');
19 console.log(data);
20
21 },
22 headers: {
23 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
24 },
25 error: function (data) {
26 data = JSON.stringify(data);
27 console.log('Error: ' + data);
28 }
29 });
30 } else {
31 console.log('Не выполнить условие никогда');
32 $.ajax({
33 type: "GET",
34 url: "{{ route('like-vacancy') }}",
35 data: "code_record=" + id_vacancy + "&delete=1",
36 success: function (data) {
37 console.log('Выбор сортировки');
38 console.log(data);
39 },
40 headers: {
41 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
42 },
43 error: function (data) {
44 data = JSON.stringify(data);
45 console.log('Error: ' + data);
46 }
47 });
48 }
49 });
50 });
51 </script>
52
resources/views/js/favorite-worker.blade.php
File was created 1 <script>
2 console.log('js выполняется...123');
3
4 $(document).ready(function() {
5 $(document).on('click', '.js_box_favorit', function () {
6 var _this = $(this);
7 var id = _this.attr('id');
8 var id_worker = _this.attr('data-val');
9 console.log('active='+id);
10
11 if ($( "#"+id ).hasClass( "active" )) {
12 console.log('Download 41... final');
13 $.ajax({
14 type: "GET",
15 url: "{{ route('like_resume') }}",
16 data: "code_record=" + id_worker,
17 success: function (data) {
18 console.log('Выбор сортировки');
19 console.log(data);
20
21 },
22 headers: {
23 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
24 },
25 error: function (data) {
26 data = JSON.stringify(data);
27 console.log('Error: ' + data);
28 }
29 });
30 } else {
31 console.log('Не выполнить условие никогда');
32 $.ajax({
33 type: "GET",
34 url: "{{ route('like_resume') }}",
35 data: "code_record=" + id_worker + "&delete=1",
36 success: function (data) {
37 console.log('Выбор сортировки');
38 console.log(data);
39 },
40 headers: {
41 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
42 },
43 error: function (data) {
44 data = JSON.stringify(data);
45 console.log('Error: ' + data);
46 }
47 });
48 }
49 });
50 });
51 </script>
52
resources/views/layout/frontend.blade.php
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> 2 <html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
3 3
4 <head> 4 <head>
5 <meta charset="utf-8"> 5 <meta charset="utf-8">
6 <title>{{ $title }}</title> 6 <title>{{ $title }}</title>
7 <meta name="viewport" content="width=device-width,initial-scale=1"> 7 <meta name="viewport" content="width=device-width,initial-scale=1">
8 <meta name="theme-color" content="#377D87"> 8 <meta name="theme-color" content="#377D87">
9 <script src="{{ asset('js/jquery.js') }}"></script> 9 <script src="{{ asset('js/jquery.js') }}"></script>
10 <!--<script type="text/javascript" src=" asset('js/jquery.cookie.js') }}"></script>--> 10 <!--<script type="text/javascript" src=" asset('js/jquery.cookie.js') }}"></script>-->
11 11
12 <link rel="stylesheet" href="{{ asset('css/star-rating.min.css') }}"> 12 <link rel="stylesheet" href="{{ asset('css/star-rating.min.css') }}">
13 <link rel="stylesheet" href="{{ asset('css/style45.css') }}"> 13 <link rel="stylesheet" href="{{ asset('css/style45.css') }}">
14 <style> 14 <style>
15 .err_red { 15 .err_red {
16 border: red 2px solid; 16 border: red 2px solid;
17 } 17 }
18 </style> 18 </style>
19 </head> 19 </head>
20 20
21 <body id="body"> 21 <body id="body">
22 <a href="#body" class="to-top js-scroll-to"> 22 <a href="#body" class="to-top js-scroll-to">
23 <svg> 23 <svg>
24 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> 24 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use>
25 </svg> 25 </svg>
26 </a> 26 </a>
27 27
28 <div> <!-- BEGIN TOP WRAPPER --> 28 <div> <!-- BEGIN TOP WRAPPER -->
29 <header class="header"> 29 <header class="header">
30 <div class="container"> 30 <div class="container">
31 <div class="header__body"> 31 <div class="header__body">
32 <div class="header__left"> 32 <div class="header__left">
33 <a href="{{ route('index') }}" class="header__logo"> 33 <a href="{{ route('index') }}" class="header__logo">
34 <svg> 34 <svg>
35 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> 35 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use>
36 </svg> 36 </svg>
37 </a> 37 </a>
38 <nav class="header__menu"> 38 <nav class="header__menu">
39 <a href="{{ route('vacancies') }}" class="header__menu-item">Вакансии</a> 39 <a href="{{ route('vacancies') }}" class="header__menu-item">Вакансии</a>
40 <a href="{{ route('shipping_companies') }}" class="header__menu-item">Судоходные компании</a> 40 <a href="{{ route('shipping_companies') }}" class="header__menu-item">Судоходные компании</a>
41 <a href="{{ route('education') }}" class="header__menu-item">Образование</a> 41 <a href="{{ route('education') }}" class="header__menu-item">Образование</a>
42 </nav> 42 </nav>
43 </div> 43 </div>
44 <div class="header__right"> 44 <div class="header__right">
45 @guest 45 @guest
46 46
47 @else 47 @else
48 <a href="@if ($UserId->is_worker) {{ route('worker.cabinet') }} @else {{ route('employer.cabinet') }} @endif" class="header__notifs header__notifs_actived"> 48 <a href="@if ($UserId->is_worker) {{ route('worker.cabinet') }} @else {{ route('employer.cabinet') }} @endif" class="header__notifs header__notifs_actived">
49 <svg> 49 <svg>
50 <use xlink:href="{{ asset('images/sprite.svg#ring') }}"></use> 50 <use xlink:href="{{ asset('images/sprite.svg#ring') }}"></use>
51 </svg> 51 </svg>
52 <span>Уведомления</span> 52 <span>Уведомления</span>
53 </a> 53 </a>
54 54
55 @endguest 55 @endguest
56 <div class="header__right-line"></div> 56 <div class="header__right-line"></div>
57 <button class="header__burger"> 57 <button class="header__burger">
58 <svg> 58 <svg>
59 <use xlink:href="{{ asset('images/sprite.svg#burger') }}"></use> 59 <use xlink:href="{{ asset('images/sprite.svg#burger') }}"></use>
60 </svg> 60 </svg>
61 </button> 61 </button>
62 @guest 62 @guest
63 <a class="button header__sign" data-fancybox data-src="#sign" data-options='{"touch":false,"autoFocus":false}'>Войти</a> 63 <a class="button header__sign" data-fancybox data-src="#sign" data-options='{"touch":false,"autoFocus":false}'>Войти</a>
64 @else 64 @else
65 <a class="button header__sign" href="{{ route('logout') }}">Выйти</a> 65 <a class="button header__sign" href="{{ route('logout') }}">Выйти</a>
66 @endguest 66 @endguest
67 </div> 67 </div>
68 </div> 68 </div>
69 </div> 69 </div>
70 </header> 70 </header>
71 @yield('content') 71 @yield('content')
72 </div> <!-- END TOP WRAPPER --> 72 </div> <!-- END TOP WRAPPER -->
73 73
74 <div> <!-- BEGIN BOTTOM WRAPPER --> 74 <div> <!-- BEGIN BOTTOM WRAPPER -->
75 <footer class="footer"> 75 <footer class="footer">
76 <div class="container"> 76 <div class="container">
77 <div class="footer__mobile"> 77 <div class="footer__mobile">
78 78
79 <button class="footer__mobile-toper js-toggle active"> 79 <button class="footer__mobile-toper js-toggle active">
80 <a href="{{ route('index') }}"> 80 <a href="{{ route('index') }}">
81 <svg> 81 <svg>
82 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> 82 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use>
83 </svg> 83 </svg>
84 </a> 84 </a>
85 <span> 85 <span>
86 <svg> 86 <svg>
87 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> 87 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use>
88 </svg> 88 </svg>
89 </span> 89 </span>
90 </button> 90 </button>
91 <div class="footer__mobile-menu"> 91 <div class="footer__mobile-menu">
92 <div class="footer__mobile-menu-item"> 92 <div class="footer__mobile-menu-item">
93 <button class="js-toggle"> 93 <button class="js-toggle">
94 <b>Соискателям</b> 94 <b>Соискателям</b>
95 <span><svg> 95 <span><svg>
96 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> 96 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use>
97 </svg></span> 97 </svg></span>
98 </button> 98 </button>
99 <div> 99 <div>
100 <a href="{{ route('vacancies') }}">Вакансии</a> 100 <a href="{{ route('vacancies') }}">Вакансии</a>
101 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a> 101 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>
102 <a href="{{ route('education') }}">Образование</a> 102 <a href="{{ route('education') }}">Образование</a>
103 <a href="{{ route('news') }}">Новости</a> 103 <a href="{{ route('news') }}">Новости</a>
104 <a href="{{ route('contacts') }}">Контакты</a> 104 <a href="{{ route('contacts') }}">Контакты</a>
105 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a> 105 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a>
106 </div> 106 </div>
107 </div> 107 </div>
108 <div class="footer__mobile-menu-item"> 108 <div class="footer__mobile-menu-item">
109 <button class="js-toggle"> 109 <button class="js-toggle">
110 <b>Работодателям</b> 110 <b>Работодателям</b>
111 <span><svg> 111 <span><svg>
112 <use xlink:href="{{asset('images/sprite.svg#arrow-top') }}"></use> 112 <use xlink:href="{{asset('images/sprite.svg#arrow-top') }}"></use>
113 </svg></span> 113 </svg></span>
114 </button> 114 </button>
115 <div> 115 <div>
116 <a href="{{ route('register') }}">Регистрация</a> 116 <a href="{{ route('register') }}">Регистрация</a>
117 <a href="{{ route('bd_resume') }}">База резюме</a> 117 <a href="{{ route('bd_resume') }}">База резюме</a>
118 <a href="{{ route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a> 118 <a href="{{ route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a>
119 <a href="{{ route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a> 119 <a href="{{ route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a>
120 <a href="{{ route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a> 120 <a href="{{ route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a>
121 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a> 121 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a>
122 </div> 122 </div>
123 </div> 123 </div>
124 </div> 124 </div>
125 <div class="footer__mobile-contacts"> 125 <div class="footer__mobile-contacts">
126 <b>Контакты</b> 126 <b>Контакты</b>
127 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a> 127 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a>
128 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a> 128 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a>
129 </div> 129 </div>
130 <div class="footer__mobile-bottom"> 130 <div class="footer__mobile-bottom">
131 <div class="socials"> 131 <div class="socials">
132 <a href="{{ $companies[0]->vkontact }}" target="_blank"> 132 <a href="{{ $companies[0]->vkontact }}" target="_blank">
133 <svg> 133 <svg>
134 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> 134 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use>
135 </svg> 135 </svg>
136 </a> 136 </a>
137 <a href="{{ $companies[0]->telegram }}" target="_blank"> 137 <a href="{{ $companies[0]->telegram }}" target="_blank">
138 <svg> 138 <svg>
139 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> 139 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use>
140 </svg> 140 </svg>
141 </a> 141 </a>
142 </div> 142 </div>
143 <nav class="footer__mobile-links"> 143 <nav class="footer__mobile-links">
144 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a> 144 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a>
145 <span></span> 145 <span></span>
146 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a> 146 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a>
147 </nav> 147 </nav>
148 &copy; 2023 &mdash; RekaMore.su 148 &copy; 2023 &mdash; RekaMore.su
149 <a href="{{ route('index') }}" class="nls" target="_blank"> 149 <a href="{{ route('index') }}" class="nls" target="_blank">
150 <svg> 150 <svg>
151 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use> 151 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use>
152 </svg> 152 </svg>
153 <span> 153 <span>
154 Дизайн и разработка: 154 Дизайн и разработка:
155 <b>NoLogoStudio.ru</b> 155 <b>NoLogoStudio.ru</b>
156 </span> 156 </span>
157 </a> 157 </a>
158 </div> 158 </div>
159 </div> 159 </div>
160 <div class="footer__main"> 160 <div class="footer__main">
161 <div class="footer__main-body"> 161 <div class="footer__main-body">
162 162
163 <a href="" class="footer__main-logo"> 163 <a href="" class="footer__main-logo">
164 <svg> 164 <svg>
165 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> 165 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use>
166 </svg> 166 </svg>
167 </a> 167 </a>
168 <div class="footer__main-col"> 168 <div class="footer__main-col">
169 <div class="footer__main-title">Соискателям</div> 169 <div class="footer__main-title">Соискателям</div>
170 <nav> 170 <nav>
171 <a href="{{ route('vacancies') }}">Вакансии</a> 171 <a href="{{ route('vacancies') }}">Вакансии</a>
172 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a> 172 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>
173 <a href="{{ route('education') }}">Образование</a> 173 <a href="{{ route('education') }}">Образование</a>
174 <a href="{{ route('news') }}">Новости</a> 174 <a href="{{ route('news') }}">Новости</a>
175 <a href="{{ route('contacts') }}">Контакты</a> 175 <a href="{{ route('contacts') }}">Контакты</a>
176 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a> 176 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a>
177 </nav> 177 </nav>
178 </div> 178 </div>
179 <div class="footer__main-col"> 179 <div class="footer__main-col">
180 <div class="footer__main-title">Работодателям</div> 180 <div class="footer__main-title">Работодателям</div>
181 <nav> 181 <nav>
182 <a href="{{ route('register') }}">Регистрация</a> 182 <a href="{{ route('register') }}">Регистрация</a>
183 <a href="{{ route('bd_resume') }}">База резюме</a> 183 <a href="{{ route('bd_resume') }}">База резюме</a>
184 <a href="{{ route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a> 184 <a href="{{ route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a>
185 <a href="{{ route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a> 185 <a href="{{ route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a>
186 <a href="{{ route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a> 186 <a href="{{ route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a>
187 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a> 187 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a>
188 </nav> 188 </nav>
189 </div> 189 </div>
190 190
191 <div class="footer__main-col"> 191 <div class="footer__main-col">
192 <div class="footer__main-title">Контакты</div> 192 <div class="footer__main-title">Контакты</div>
193 <div class="footer__main-contacts"> 193 <div class="footer__main-contacts">
194 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a> 194 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a>
195 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a> 195 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a>
196 </div> 196 </div>
197 <div class="socials"> 197 <div class="socials">
198 <a href="{{ $companies[0]->vkontact }}" target="_blank"> 198 <a href="{{ $companies[0]->vkontact }}" target="_blank">
199 <svg> 199 <svg>
200 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> 200 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use>
201 </svg> 201 </svg>
202 </a> 202 </a>
203 <a href="{{ $companies[0]->telegram }}" target="_blank"> 203 <a href="{{ $companies[0]->telegram }}" target="_blank">
204 <svg> 204 <svg>
205 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> 205 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use>
206 </svg> 206 </svg>
207 </a> 207 </a>
208 </div> 208 </div>
209 </div> 209 </div>
210 </div> 210 </div>
211 211
212 <div class="footer__main-copy"> 212 <div class="footer__main-copy">
213 <div>&copy; 2023 &mdash; RekaMore.su</div> 213 <div>&copy; 2023 &mdash; RekaMore.su</div>
214 <nav> 214 <nav>
215 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a> 215 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a>
216 <span></span> 216 <span></span>
217 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a> 217 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a>
218 </nav> 218 </nav>
219 <div> @if (isset($_COOKIE['favorite_vacancy'])) Куки вакансий: {{ print_r($_COOKIE['favorite_vacancy']) }} @endif</div> 219 <div> @if (isset($_COOKIE['favorite_vacancy'])) Куки вакансий: {{ print_r($_COOKIE['favorite_vacancy']) }} @endif</div>
220 <a href="{{ route('index') }}" class="nls" target="_blank"> 220 <a href="{{ route('index') }}" class="nls" target="_blank">
221 <svg> 221 <svg>
222 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use> 222 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use>
223 </svg> 223 </svg>
224 <span> 224 <span>
225 Дизайн и разработка: 225 Дизайн и разработка:
226 <b>NoLogoStudio.ru</b> 226 <b>NoLogoStudio.ru</b>
227 </span> 227 </span>
228 </a> 228 </a>
229 </div> 229 </div>
230 </div> 230 </div>
231 </div> 231 </div>
232 </footer> 232 </footer>
233 </div> <!-- END BOTTOM WRAPPER --> 233 </div> <!-- END BOTTOM WRAPPER -->
234 234
235 <div hidden> <!-- BEGIN MODALS WRAPPER --> 235 <div hidden> <!-- BEGIN MODALS WRAPPER -->
236 <!-- Соискатель отправляет сообщение работодателю --> 236 <!-- Соискатель отправляет сообщение работодателю -->
237 @include('modals.send_worker_new') 237 @include('modals.send_worker_new')
238 238
239 <!-- Работодатель отправляет сообщение соискателю --> 239 <!-- Работодатель отправляет сообщение соискателю -->
240 @include('modals.send_employer') 240 @include('modals.send_employer')
241 241
242 <!-- Сообщение-предупреждение о том, что сообщения только можно отправить авторизованным пользователям --> 242 <!-- Сообщение-предупреждение о том, что сообщения только можно отправить авторизованным пользователям -->
243 @include('modals.send_message_noaut') 243 @include('modals.send_message_noaut')
244 244
245 @include('modals.send_message_noaut2') 245 @include('modals.send_message_noaut2')
246 246
247 <!-- Форма авторизации --> 247 <!-- Форма авторизации -->
248 @include('modals.send_login') 248 @include('modals.send_login')
249 249
250 <!-- Сбросить пароль --> 250 <!-- Сбросить пароль -->
251 @include('modals.reset_password') 251 @include('modals.reset_password')
252 252
253 <!-- Регистрация --> 253 <!-- Регистрация -->
254 @include('modals.register') 254 @include('modals.register')
255 255
256 <!-- Благодарность по отправке сообщения работодателю --> 256 <!-- Благодарность по отправке сообщения работодателю -->
257 @include('modals.thank_you_send_employer') 257 @include('modals.thank_you_send_employer')
258 258
259 <!-- Благодарность по отправке сообщения менеджеру --> 259 <!-- Благодарность по отправке сообщения менеджеру -->
260 @include('modals.thank_you_send_manager') 260 @include('modals.thank_you_send_manager')
261 261
262 <!-- Благодарность после регистрации --> 262 <!-- Благодарность после регистрации -->
263 @include('modals.thank_you_send_for_employer') 263 @include('modals.thank_you_send_for_employer')
264 264
265 <!-- Благодарность после регистрации для работника --> 265 <!-- Благодарность после регистрации для работника -->
266 @include('modals.thank_you_send_for_worker') 266 @include('modals.thank_you_send_for_worker')
267 267
268 <!-- Подтверждение удаления профиля --> 268 <!-- Подтверждение удаления профиля -->
269 @include('modals.delete_profile') 269 @include('modals.delete_profile')
270 270
271 <!-- Подверждение об удалении профиля --> 271 <!-- Подверждение об удалении профиля -->
272 @include('modals.success_delete_profile') 272 @include('modals.success_delete_profile')
273 273
274 </div> <!-- END MODALS WRAPPER --> 274 </div> <!-- END MODALS WRAPPER -->
275 275
276 276
277 <script src="{{ asset('js/jquery.maskedinput.js') }}"></script> 277 <script src="{{ asset('js/jquery.maskedinput.js') }}"></script>
278 <script src="{{ asset('js/jquery.fancybox.js') }}"></script> 278 <script src="{{ asset('js/jquery.fancybox.js') }}"></script>
279 <script src="{{ asset('js/jquery.select2.js') }}"></script> 279 <script src="{{ asset('js/jquery.select2.js') }}"></script>
280 <script src="{{ asset('js/swiper.js') }}"></script> 280 <script src="{{ asset('js/swiper.js') }}"></script>
281 <script src="{{ asset('js/script45.js') }}"></script> 281 <script src="{{ asset('js/script145.js') }}"></script>
282 <script src="{{ asset('js/star-rating.min.js') }}"></script> 282 <script src="{{ asset('js/star-rating.min.js') }}"></script>
283 <script> 283 <script>
284 var getUrlParameter = function getUrlParameter(sParam) { 284 var getUrlParameter = function getUrlParameter(sParam) {
285 var sPageURL = decodeURIComponent(window.location.search.substring(1)), 285 var sPageURL = decodeURIComponent(window.location.search.substring(1)),
286 sURLVariables = sPageURL.split('&'), 286 sURLVariables = sPageURL.split('&'),
287 sParameterName, 287 sParameterName,
288 i; 288 i;
289 for (i = 0; i < sURLVariables.length; i++) { 289 for (i = 0; i < sURLVariables.length; i++) {
290 sParameterName = sURLVariables[i].split('='); 290 sParameterName = sURLVariables[i].split('=');
291 if (sParameterName[0] === sParam) { 291 if (sParameterName[0] === sParam) {
292 return sParameterName[1] === undefined ? true : sParameterName[1]; 292 return sParameterName[1] === undefined ? true : sParameterName[1];
293 } 293 }
294 } 294 }
295 }; 295 };
296 </script> 296 </script>
297 @yield('scripts') 297 @yield('scripts')
298 298
299 @include('js.modals') 299 @include('js.modals')
300 @include('js.cookies') 300 @include('js.cookies')
301 301
302 </body> 302 </body>
303 </html> 303 </html>
304 304
resources/views/list_vacancies.blade.php
1 @php 1 @php
2 use App\Classes\StatusUser; 2 use App\Classes\StatusUser;
3 @endphp 3 @endphp
4 4
5 @extends('layout.frontend', ['title' => 'Вакансии РекаМоре']) 5 @extends('layout.frontend', ['title' => 'Вакансии РекаМоре'])
6 6
7 @section('scripts') 7 @section('scripts')
8 <script> 8 <script>
9 console.log('Test system'); 9 console.log('Test system');
10 $(document).on('change', '#jobs', function() { 10 $(document).on('change', '#jobs', function() {
11 var val = $(this).val(); 11 var val = $(this).val();
12 var main_oskar = $('#main_ockar'); 12 var main_oskar = $('#main_ockar');
13 var ti_head = $('#title_head'); 13 var ti_head = $('#title_head');
14 14
15 console.log('Code='+val); 15 console.log('Code='+val);
16 console.log('Click change...'); 16 console.log('Click change...');
17 $.ajax({ 17 $.ajax({
18 type: "GET", 18 type: "GET",
19 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", 19 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}",
20 data: "job="+val, 20 data: "job="+val,
21 success: function (data) { 21 success: function (data) {
22 console.log('Выбор сделан!'); 22 console.log('Выбор сделан!');
23 23
24 main_oskar.html(data); 24 main_oskar.html(data);
25 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?job="+val+"@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 25 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?job="+val+"@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
26 }, 26 },
27 headers: { 27 headers: {
28 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 28 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
29 }, 29 },
30 error: function (data) { 30 error: function (data) {
31 data = JSON.stringify(data); 31 data = JSON.stringify(data);
32 console.log('Error: ' + data); 32 console.log('Error: ' + data);
33 } 33 }
34 }); 34 });
35 35
36 if ((val == '') || (val == '0')) { 36 if ((val == '') || (val == '0')) {
37 title_head.html('Все категории'); 37 title_head.html('Все категории');
38 } else { 38 } else {
39 $.ajax({ 39 $.ajax({
40 type: "GET", 40 type: "GET",
41 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}?@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif", 41 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}?@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif",
42 data: "job=" + val +"&title=1", 42 data: "job=" + val +"&title=1",
43 success: function (data) { 43 success: function (data) {
44 44
45 console.log(data); 45 console.log(data);
46 }, 46 },
47 47
48 headers: { 48 headers: {
49 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 49 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
50 }, 50 },
51 51
52 error: function (data) { 52 error: function (data) {
53 data = JSON.stringify(data); 53 data = JSON.stringify(data);
54 console.log('Error: ' + data); 54 console.log('Error: ' + data);
55 } 55 }
56 }); 56 });
57 57
58 } 58 }
59 }); 59 });
60 60
61 $(document).on('click', '.js_send_it_button', function() { 61 $(document).on('click', '.js_send_it_button', function() {
62 var this_ = $(this); 62 var this_ = $(this);
63 var code_user_id = this_.attr('data-uid'); 63 var code_user_id = this_.attr('data-uid');
64 var code_to_user_id = this_.attr('data-tuid'); 64 var code_to_user_id = this_.attr('data-tuid');
65 var code_vacancy = this_.attr('data-vacancy'); 65 var code_vacancy = this_.attr('data-vacancy');
66 var user_id = $('#_user_id'); 66 var user_id = $('#_user_id');
67 var to_user_id = $('#_to_user_id'); 67 var to_user_id = $('#_to_user_id');
68 var vacancy = $('#_vacancy'); 68 var vacancy = $('#_vacancy');
69 69
70 console.log('Клик на кнопки...'); 70 console.log('Клик на кнопки...');
71 71
72 user_id.val(code_user_id); 72 user_id.val(code_user_id);
73 to_user_id.val(code_to_user_id); 73 to_user_id.val(code_to_user_id);
74 vacancy.val(code_vacancy); 74 vacancy.val(code_vacancy);
75 }); 75 });
76 76
77 $(document).on('change', '#sort_ajax', function() { 77 $(document).on('change', '#sort_ajax', function() {
78 var this_ = $(this); 78 var this_ = $(this);
79 var val_ = this_.val(); 79 var val_ = this_.val();
80 console.log('sort items '+val_); 80 console.log('sort items '+val_);
81 81
82 $.ajax({ 82 $.ajax({
83 type: "GET", 83 type: "GET",
84 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", 84 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}",
85 data: "sort="+val_+"&block=1", 85 data: "sort="+val_+"&block=1",
86 success: function (data) { 86 success: function (data) {
87 console.log('Выбор сортировки'); 87 console.log('Выбор сортировки');
88 console.log(data); 88 console.log(data);
89 $('#main_ockar').html(data); 89 $('#main_ockar').html(data);
90 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?sort="+val_+"@if (isset($_GET['job']))&job={{ $_GET['job'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 90 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?sort="+val_+"@if (isset($_GET['job']))&job={{ $_GET['job'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
91 }, 91 },
92 headers: { 92 headers: {
93 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 93 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
94 }, 94 },
95 error: function (data) { 95 error: function (data) {
96 data = JSON.stringify(data); 96 data = JSON.stringify(data);
97 console.log('Error: ' + data); 97 console.log('Error: ' + data);
98 } 98 }
99 }); 99 });
100 }); 100 });
101 101
102 102
103 103
104 $(document).ready(function(){ 104 $(document).ready(function(){
105 var sel = $('#select2-sort_ajax-container'); 105 var sel = $('#select2-sort_ajax-container');
106 var key = getUrlParameter('sort'); 106 var key = getUrlParameter('sort');
107 console.log(sel); 107 console.log(sel);
108 console.log(key); 108 console.log(key);
109 109
110 if (key !=='') { 110 if (key !=='') {
111 console.log(key); 111 console.log(key);
112 switch (key) { 112 switch (key) {
113 case "default": sel.html('Сортировка (по умолчанию)'); break; 113 case "default": sel.html('Сортировка (по умолчанию)'); break;
114 case "name_up": sel.html('По имени (возрастание)'); break; 114 case "name_up": sel.html('По имени (возрастание)'); break;
115 case "name_down": sel.html('По дате (убывание)'); break; 115 case "name_down": sel.html('По дате (убывание)'); break;
116 case "created_at_up": sel.html('По дате (возрастание)'); break; 116 case "created_at_up": sel.html('По дате (возрастание)'); break;
117 case "created_at_down": sel.html('По дате (убывание)'); break; 117 case "created_at_down": sel.html('По дате (убывание)'); break;
118 } 118 }
119 119
120 } 120 }
121 }); 121 });
122 </script> 122 </script>
123 @include('js.favorite-vacancy') 123 @include('js.favorite-vacancy-45')
124 @endsection 124 @endsection
125 @section('content') 125 @section('content')
126 <section class="thing"> 126 <section class="thing">
127 <div class="container"> 127 <div class="container">
128 <form class="thing__body" action="{{ route('list-vacancies', ['categories' => (!empty($Name_categori)) ? $Name_categori[0]->id : '0']) }}" method="POST"> 128 <form class="thing__body" action="{{ route('list-vacancies', ['categories' => (!empty($Name_categori)) ? $Name_categori[0]->id : '0']) }}" method="POST">
129 <ul class="breadcrumbs thing__breadcrumbs"> 129 <ul class="breadcrumbs thing__breadcrumbs">
130 <li><a href="{{ route('index') }}">Главная</a></li> 130 <li><a href="{{ route('index') }}">Главная</a></li>
131 <li><a href="{{ route('vacancies') }}">Вакансии</a></li> 131 <li><a href="{{ route('vacancies') }}">Вакансии</a></li>
132 <li><b>{{ isset($Name_categori[0]) ? $Name_categori[0]->name : 'Все категории' }}</b></li> 132 <li><b>{{ isset($Name_categori[0]) ? $Name_categori[0]->name : 'Все категории' }}</b></li>
133 </ul> 133 </ul>
134 <h1 class="thing__title">Вакансии</h1> 134 <h1 class="thing__title">Вакансии</h1>
135 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для 135 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для
136 существующих финансовых и административных условий.</p> 136 существующих финансовых и административных условий.</p>
137 <div class="select select_search thing__select"> 137 <div class="select select_search thing__select">
138 <div class="select__icon"> 138 <div class="select__icon">
139 <svg> 139 <svg>
140 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 140 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
141 </svg> 141 </svg>
142 </div> 142 </div>
143 <select class="js-select2" id="jobs" name="jobs"> 143 <select class="js-select2" id="jobs" name="jobs">
144 <option value="0" selected>Выберите должность</option> 144 <option value="0" selected>Выберите должность</option>
145 @if ($Job_title->count()) 145 @if ($Job_title->count())
146 @foreach($Job_title as $JT) 146 @foreach($Job_title as $JT)
147 <option value="{{ $JT->id }}">{{ $JT->name }}</option> 147 <option value="{{ $JT->id }}">{{ $JT->name }}</option>
148 @endforeach 148 @endforeach
149 @endif 149 @endif
150 </select> 150 </select>
151 </div> 151 </div>
152 </form> 152 </form>
153 </div> 153 </div>
154 </section> 154 </section>
155 <main class="main"> 155 <main class="main">
156 <div class="container"> 156 <div class="container">
157 <div class="main__vacancies" > 157 <div class="main__vacancies" >
158 @if (isset($Name_categori[0]->name)) 158 @if (isset($Name_categori[0]->name))
159 <h2 class="main__vacancies-title">Категория вакансий {{ $Name_categori[0]->name }}</h2> 159 <h2 class="main__vacancies-title">Категория вакансий {{ $Name_categori[0]->name }}</h2>
160 @else 160 @else
161 <h2 class="main__vacancies-title" id="title_head" name="title_head">Все категории</h2> 161 <h2 class="main__vacancies-title" id="title_head" name="title_head">Все категории</h2>
162 @endif 162 @endif
163 <div class="filters main__vacancies-filters"> 163 <div class="filters main__vacancies-filters">
164 <div class="filters__label" id="col-vo" name="col-vo">Показано @if ($Query_count < 3) {{$Query_count}} @else 3 @endif из @isset($Query_count) {{ $Query_count }} @else 0 @endisset результатов поиска</div> 164 <div class="filters__label" id="col-vo" name="col-vo">Показано @if ($Query_count < 3) {{$Query_count}} @else 3 @endif из @isset($Query_count) {{ $Query_count }} @else 0 @endisset результатов поиска</div>
165 <div class="filters__body"> 165 <div class="filters__body">
166 <div class="select filters__select"> 166 <div class="select filters__select">
167 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 167 <select class="js-select2" id="sort_ajax" name="sort_ajax">
168 <option value="default">Сортировка (по умолчанию)</option> 168 <option value="default">Сортировка (по умолчанию)</option>
169 <option value="name_up">По имени (возрастание)</option> 169 <option value="name_up">По имени (возрастание)</option>
170 <option value="name_down">По имени (убывание)</option> 170 <option value="name_down">По имени (убывание)</option>
171 <option value="created_at_up">По дате (возрастание)</option> 171 <option value="created_at_up">По дате (возрастание)</option>
172 <option value="created_at_down">По дате (убывание)</option> 172 <option value="created_at_down">По дате (убывание)</option>
173 </select> 173 </select>
174 </div> 174 </div>
175 </div> 175 </div>
176 </div> 176 </div>
177 177
178 <div class="main__vacancies" style="width:100%;" id="main_ockar" name="main_oskar"> 178 <div class="main__vacancies" style="width:100%;" id="main_ockar" name="main_oskar">
179 @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp 179 @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp
180 180
181 @foreach ($Query as $Q) 181 @foreach ($Query as $Q)
182 @foreach ($Reclama as $Rec) 182 @foreach ($Reclama as $Rec)
183 @if ($Rec->position == $i) 183 @if ($Rec->position == $i)
184 <div class="main__vacancies-thing"> 184 <div class="main__vacancies-thing">
185 @if (!empty($Rec->image)) 185 @if (!empty($Rec->image))
186 <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 186 <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
187 @else 187 @else
188 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 188 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
189 @endif 189 @endif
190 <div class="main__vacancies-thing-body"> 190 <div class="main__vacancies-thing-body">
191 <h2>{{ $Rec->title }}</h2> 191 <h2>{{ $Rec->title }}</h2>
192 <div class="main__vacancies-thing-scroll"> 192 <div class="main__vacancies-thing-scroll">
193 {!! $Rec->text !!} 193 {!! $Rec->text !!}
194 </div> 194 </div>
195 <a href="{{ $Rec->link }}" class="button">Узнать больше</a> 195 <a href="{{ $Rec->link }}" class="button">Узнать больше</a>
196 </div> 196 </div>
197 </div> 197 </div>
198 @endif 198 @endif
199 @endforeach 199 @endforeach
200 <div class="main__vacancies-item main__employer-page-two-item" data-id="{{ $Q->id }}"> 200 <div class="main__vacancies-item main__employer-page-two-item" data-id="{{ $Q->id }}">
201 201
202 <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" class="back main__employer-page-two-item-back"> 202 <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" class="back main__employer-page-two-item-back">
203 <svg> 203 <svg>
204 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 204 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
205 </svg> 205 </svg>
206 <span> 206 <span>
207 Вернуться к списку вакансий 123 207 Вернуться к списку вакансий 123
208 </span> 208 </span>
209 </a> 209 </a>
210 210
211 <div class="main__employer-page-two-item-toper"> 211 <div class="main__employer-page-two-item-toper">
212 @if (!empty($Q->employer->logo)) 212 @if (!empty($Q->employer->logo))
213 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}"> 213 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}">
214 @else 214 @else
215 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 215 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
216 @endif 216 @endif
217 <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span> 217 <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span>
218 </div> 218 </div>
219 219
220 <div class="main__employer-page-two-item-text"> 220 <div class="main__employer-page-two-item-text">
221 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор 221 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор
222 специалистов на следующие должности:</div> 222 специалистов на следующие должности:</div>
223 <div class="main__employer-page-two-item-text-links"> 223 <div class="main__employer-page-two-item-text-links">
224 @if (isset($Q->jobs)) 224 @if (isset($Q->jobs))
225 @foreach ($Q->jobs as $key => $j) 225 @foreach ($Q->jobs as $key => $j)
226 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a> 226 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a>
227 @endforeach 227 @endforeach
228 @endif 228 @endif
229 </div> 229 </div>
230 </div> 230 </div>
231 231
232 <div class="main__employer-page-two-item-text"> 232 <div class="main__employer-page-two-item-text">
233 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 233 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
234 <div class="main__employer-page-two-item-text-body"> 234 <div class="main__employer-page-two-item-text-body">
235 {!! $Q->text !!} 235 {!! $Q->text !!}
236 </div> 236 </div>
237 </div> 237 </div>
238 <div class="main__employer-page-two-item-text"> 238 <div class="main__employer-page-two-item-text">
239 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div> 239 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div>
240 <div class="main__employer-page-two-item-text-body"> 240 <div class="main__employer-page-two-item-text-body">
241 {!! $Q->description !!} 241 {!! $Q->description !!}
242 </div> 242 </div>
243 </div> 243 </div>
244 <div class="main__employer-page-two-item-text"> 244 <div class="main__employer-page-two-item-text">
245 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div> 245 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div>
246 <div class="main__employer-page-two-item-text-body"> 246 <div class="main__employer-page-two-item-text-body">
247 {!! $Q->contacts_emails !!} 247 {!! $Q->contacts_emails !!}
248 </div> 248 </div>
249 </div> 249 </div>
250 <div class="main__employer-page-two-item-text"> 250 <div class="main__employer-page-two-item-text">
251 <div class="main__employer-page-two-item-text-name">Или звоните:</div> 251 <div class="main__employer-page-two-item-text-name">Или звоните:</div>
252 <div class="main__employer-page-two-item-text-body"> 252 <div class="main__employer-page-two-item-text-body">
253 {!! $Q->contacts_telephones !!} 253 {!! $Q->contacts_telephones !!}
254 </div> 254 </div>
255 </div> 255 </div>
256 256
257 <div class="main__employer-page-two-item-tags"> 257 <div class="main__employer-page-two-item-tags">
258 @if (!empty($Q->jobs_code[0]->position_ship)) 258 @if (!empty($Q->jobs_code[0]->position_ship))
259 <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span> 259 <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span>
260 @else 260 @else
261 @if (isset($Q->jobs)) 261 @if (isset($Q->jobs))
262 @foreach ($Q->jobs as $key => $j) 262 @foreach ($Q->jobs as $key => $j)
263 <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span> 263 <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span>
264 @endforeach 264 @endforeach
265 @endif 265 @endif
266 @endif 266 @endif
267 </div> 267 </div>
268 <div class="main__employer-page-two-item-buttons"> 268 <div class="main__employer-page-two-item-buttons">
269 @guest 269 @guest
270 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' 270 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
271 class="button main__employer-page-two-item-button">Откликнуться</button> 271 class="button main__employer-page-two-item-button">Откликнуться</button>
272 @else 272 @else
273 @if (App\Classes\StatusUser::Status()==1) 273 @if (App\Classes\StatusUser::Status()==1)
274 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}' 274 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
275 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> 275 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
276 @else 276 @else
277 <button type="button" data-fancybox data-src="#send2" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}' 277 <button type="button" data-fancybox data-src="#send2" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
278 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> 278 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
279 @endif 279 @endif
280 @endguest 280 @endguest
281 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a> 281 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a>
282 </div> 282 </div>
283 <div class="main__employer-page-two-item-bottom"> 283 <div class="main__employer-page-two-item-bottom">
284 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div> 284 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div>
285 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vacancy_favorites <?=App\Classes\Cookies_vacancy::selected_vacancy($Q->id);?>"> 285 <button type="button" id="like{{ $Q->id }}" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}">
286 <svg> 286 <svg>
287 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 287 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
288 </svg> 288 </svg>
289 </button> 289 </button>
290 </div> 290 </div>
291 </div> 291 </div>
292 @php $i++ @endphp 292 @php $i++ @endphp
293 @endforeach 293 @endforeach
294 <div style="margin-top: 20px"> 294 <div style="margin-top: 20px">
295 {{ $Query->appends($_GET)->links('paginate') }} 295 {{ $Query->appends($_GET)->links('paginate') }}
296 </div><!-- конец --> 296 </div><!-- конец -->
297 297
298 </div> 298 </div>
299 </div> 299 </div>
300 </div> 300 </div>
301 </main> 301 </main>
302 @endsection 302 @endsection
303 303
resources/views/resume.blade.php
1 @extends('layout.frontend', ['title' => 'База резюме - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'База резюме - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script> 4 <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
5 <script> 5 <script>
6 console.log('Test system'); 6 console.log('Test system');
7 $(document).on('change', '#jobs', function() { 7 $(document).on('change', '#jobs', function() {
8 var val = $(this).val(); 8 var val = $(this).val();
9 var main_oskar = $('#main_ockar'); 9 var main_oskar = $('#main_ockar');
10 10
11 console.log('Code='+val); 11 console.log('Code='+val);
12 console.log('Click change...'); 12 console.log('Click change...');
13 $.ajax({ 13 $.ajax({
14 type: "GET", 14 type: "GET",
15 url: "", 15 url: "",
16 data: "job="+val, 16 data: "job="+val,
17 success: function (data) { 17 success: function (data) {
18 console.log('Выбор сделан!'); 18 console.log('Выбор сделан!');
19 console.log(data); 19 console.log(data);
20 main_oskar.html(data); 20 main_oskar.html(data);
21 }, 21 },
22 headers: { 22 headers: {
23 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 23 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
24 }, 24 },
25 error: function (data) { 25 error: function (data) {
26 data = JSON.stringify(data); 26 data = JSON.stringify(data);
27 console.log('Error: ' + data); 27 console.log('Error: ' + data);
28 } 28 }
29 }); 29 });
30 }); 30 });
31 </script> 31 </script>
32 32
33 <script> 33 <script>
34 $(document).ready(function() { 34 $(document).ready(function() {
35 $(document).on('click', '.js_box_favorites', function () { 35 $(document).on('click', '.js_box_favorites', function () {
36 var _this = $(this); 36 var _this = $(this);
37 var id_worker = _this.attr('data-val'); 37 var id_worker = _this.attr('data-val');
38 38
39 if (_this.hasClass('active')) { 39 if (_this.hasClass('active')) {
40 add_in_array(id_worker); 40 add_in_array(id_worker);
41 console.log('Добавлено в избранное id=' + id_worker); 41 console.log('Добавлено в избранное id=' + id_worker);
42 } else { 42 } else {
43 delete_in_array(id_worker); 43 delete_in_array(id_worker);
44 console.log('Удалено из избранных id='+id_worker) 44 console.log('Удалено из избранных id='+id_worker)
45 } 45 }
46 var str = $.cookie('favorite_worker'); 46 var str = $.cookie('favorite_worker');
47 console.log("Вывод куков "+str); 47 console.log("Вывод куков "+str);
48 48
49 }); 49 });
50 }); 50 });
51 51
52 //помеченный элемент 52 //помеченный элемент
53 function selected_item(obj) { 53 function selected_item(obj) {
54 var arr = read_array(); 54 var arr = read_array();
55 var index = arr.indexOf(obj); 55 var index = arr.indexOf(obj);
56 56
57 if (index > 0) 57 if (index > 0)
58 return "active"; 58 return "active";
59 else 59 else
60 return ""; 60 return "";
61 } 61 }
62 62
63 // запись элемента массива в cookie 63 // запись элемента массива в cookie
64 function add_in_array(obj){ 64 function add_in_array(obj){
65 var arr = read_array();//получаем текущее состояние массива 65 var arr = read_array();//получаем текущее состояние массива
66 arr[arr.length]=obj; //добавляем элемент в конец 66 arr[arr.length]=obj; //добавляем элемент в конец
67 //var str = JSON.stringify(arr);//конвертируем в строку 67 //var str = JSON.stringify(arr);//конвертируем в строку
68 //$.cookie('arr',str);//записываем массив в куки 68 //$.cookie('arr',str);//записываем массив в куки
69 $.cookie('favorite_worker', JSON.stringify(arr)); 69 $.cookie('favorite_worker', JSON.stringify(arr));
70 70
71 } 71 }
72 72
73 // удаление элемента из массива в cookie 73 // удаление элемента из массива в cookie
74 function delete_in_array(obj) { 74 function delete_in_array(obj) {
75 var arr = read_array(); 75 var arr = read_array();
76 var unique = [...new Set(arr)] 76 var unique = [...new Set(arr)]
77 var index = unique.indexOf(obj); 77 var index = unique.indexOf(obj);
78 78
79 unique.splice(index, 1); 79 unique.splice(index, 1);
80 80
81 //var str = JSON.stringify(arr);//конвертируем в строку 81 //var str = JSON.stringify(arr);//конвертируем в строку
82 //$.cookie('arr',str);//записываем массив в куки 82 //$.cookie('arr',str);//записываем массив в куки
83 $.cookie('favorite_worker', JSON.stringify(unique)); 83 $.cookie('favorite_worker', JSON.stringify(unique));
84 84
85 } 85 }
86 86
87 function read_array(){ 87 function read_array(){
88 var dataArr=$.cookie('favorite_worker');//считываем данные из куков 88 var dataArr=$.cookie('favorite_worker');//считываем данные из куков
89 89
90 //если массив не был обнаружен, иницилизируем его 90 //если массив не был обнаружен, иницилизируем его
91 if(dataArr===null){ 91 if(dataArr===null){
92 dataArr = init_array(); //возвращаем инициализированный пустой маасив 92 dataArr = init_array(); //возвращаем инициализированный пустой маасив
93 } 93 }
94 //возвращаем полученный массив 94 //возвращаем полученный массив
95 //return JSON.parse(dataArr); 95 //return JSON.parse(dataArr);
96 return JSON.parse(dataArr); 96 return JSON.parse(dataArr);
97 } 97 }
98 98
99 //другими словами создаем пустой массив 99 //другими словами создаем пустой массив
100 function init_array(){ 100 function init_array(){
101 //var str = JSON.stringify(new Array());//конвертируем в строку 101 //var str = JSON.stringify(new Array());//конвертируем в строку
102 var str = JSON.stringify(new Array()); 102 var str = JSON.stringify(new Array());
103 $.cookie('favorite_worker',str);//записываем массив в куки 103 $.cookie('favorite_worker',str);//записываем массив в куки
104 104
105 return str; 105 return str;
106 } 106 }
107 </script> 107 </script>
108 <script> 108 <script>
109 $(document).on('click', '.js_it_button', function() { 109 $(document).on('click', '.js_it_button', function() {
110 var this_ = $(this); 110 var this_ = $(this);
111 var code_user_id = this_.attr('data-uid'); 111 var code_user_id = this_.attr('data-uid');
112 var code_to_user_id = this_.attr('data-tuid'); 112 var code_to_user_id = this_.attr('data-tuid');
113 var code_vacancy = this_.attr('data-vacancy'); 113 var code_vacancy = this_.attr('data-vacancy');
114 var user_id = $('#_user_id'); 114 var user_id = $('#_user_id');
115 var to_user_id = $('#_to_user_id'); 115 var to_user_id = $('#_to_user_id');
116 var vacancy = $('#_vacancy'); 116 var vacancy = $('#_vacancy');
117 117
118 console.log('code_to_user_id='+code_to_user_id); 118 console.log('code_to_user_id='+code_to_user_id);
119 console.log('code_user_id='+code_user_id); 119 console.log('code_user_id='+code_user_id);
120 console.log('code_vacancy='+code_vacancy); 120 console.log('code_vacancy='+code_vacancy);
121 console.log('Клик на кнопке...'); 121 console.log('Клик на кнопке...');
122 122
123 user_id.val(code_user_id); 123 user_id.val(code_user_id);
124 to_user_id.val(code_to_user_id); 124 to_user_id.val(code_to_user_id);
125 vacancy.val(code_vacancy); 125 vacancy.val(code_vacancy);
126 }); 126 });
127 </script> 127 </script>
128 <script> 128 <script>
129 $(document).on('change', '#sort_ajax', function() { 129 $(document).on('change', '#sort_ajax', function() {
130 var this_ = $(this); 130 var this_ = $(this);
131 var val_ = this_.val(); 131 var val_ = this_.val();
132 console.log('sort items '+val_); 132 console.log('sort items '+val_);
133 133
134 $.ajax({ 134 $.ajax({
135 type: "GET", 135 type: "GET",
136 url: "{{ route('bd_resume') }}", 136 url: "{{ route('bd_resume') }}",
137 data: "sort="+val_+"&block=1", 137 data: "sort="+val_+"&block=1",
138 success: function (data) { 138 success: function (data) {
139 console.log('Выбор сортировки'); 139 console.log('Выбор сортировки');
140 console.log(data); 140 console.log(data);
141 $('#block1').html(data); 141 $('#block1').html(data);
142 history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 142 history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
143 }, 143 },
144 headers: { 144 headers: {
145 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 145 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
146 }, 146 },
147 error: function (data) { 147 error: function (data) {
148 data = JSON.stringify(data); 148 data = JSON.stringify(data);
149 console.log('Error: ' + data); 149 console.log('Error: ' + data);
150 } 150 }
151 }); 151 });
152 152
153 $.ajax({ 153 $.ajax({
154 type: "GET", 154 type: "GET",
155 url: "{{ route('bd_resume') }}", 155 url: "{{ route('bd_resume') }}",
156 data: "sort="+val_+"&block=2", 156 data: "sort="+val_+"&block=2",
157 success: function (data) { 157 success: function (data) {
158 console.log('Выбор сортировки'); 158 console.log('Выбор сортировки');
159 console.log(data); 159 console.log(data);
160 $('#block2').html(data); 160 $('#block2').html(data);
161 history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 161 history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
162 }, 162 },
163 headers: { 163 headers: {
164 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 164 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
165 }, 165 },
166 error: function (data) { 166 error: function (data) {
167 data = JSON.stringify(data); 167 data = JSON.stringify(data);
168 console.log('Error: ' + data); 168 console.log('Error: ' + data);
169 } 169 }
170 }); 170 });
171 171
172 }); 172 });
173 173
174 $(document).ready(function(){ 174 $(document).ready(function(){
175 var sel = $('#select2-sort_ajax-container'); 175 var sel = $('#select2-sort_ajax-container');
176 var key = getUrlParameter('sort'); 176 var key = getUrlParameter('sort');
177 console.log(sel); 177 console.log(sel);
178 console.log(key); 178 console.log(key);
179 179
180 if (key !=='') { 180 if (key !=='') {
181 console.log(key); 181 console.log(key);
182 switch (key) { 182 switch (key) {
183 case "default": sel.html('Сортировка (по умолчанию)'); break; 183 case "default": sel.html('Сортировка (по умолчанию)'); break;
184 case "name_up": sel.html('По имени (возрастание)'); break; 184 case "name_up": sel.html('По имени (возрастание)'); break;
185 case "name_down": sel.html('По дате (убывание)'); break; 185 case "name_down": sel.html('По дате (убывание)'); break;
186 case "created_at_up": sel.html('По дате (возрастание)'); break; 186 case "created_at_up": sel.html('По дате (возрастание)'); break;
187 case "created_at_down": sel.html('По дате (убывание)'); break; 187 case "created_at_down": sel.html('По дате (убывание)'); break;
188 } 188 }
189 189
190 } 190 }
191 }); 191 });
192 </script> 192 </script>
193 @include('js.favorite-worker')
193 @endsection 194 @endsection
194 195
195 196
196 @section('content') 197 @section('content')
197 <section class="thing"> 198 <section class="thing">
198 <div class="container"> 199 <div class="container">
199 <form class="thing__body" action="{{ url()->current() }}"> 200 <form class="thing__body" action="{{ url()->current() }}">
200 <ul class="breadcrumbs thing__breadcrumbs"> 201 <ul class="breadcrumbs thing__breadcrumbs">
201 <li><a href="{{ route('index') }}">Главная</a></li> 202 <li><a href="{{ route('index') }}">Главная</a></li>
202 <li><b>База резюме</b></li> 203 <li><b>База резюме</b></li>
203 </ul> 204 </ul>
204 <h1 class="thing__title">База резюме</h1> 205 <h1 class="thing__title">База резюме</h1>
205 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для 206 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для
206 существующих финансовых и административных условий.</p> 207 существующих финансовых и административных условий.</p>
207 <div class="search thing__search"> 208 <div class="search thing__search">
208 <input type="search" class="input" name="search" id="search" placeholder="Введите наименование должности" required> 209 <input type="search" class="input" name="search" id="search" placeholder="Введите наименование должности" required>
209 <button type="submit" class="button">Найти</button> 210 <button type="submit" class="button">Найти</button>
210 <span> 211 <span>
211 <svg> 212 <svg>
212 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 213 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
213 </svg> 214 </svg>
214 </span> 215 </span>
215 </div> 216 </div>
216 <label class="checkbox thing__checkbox"> 217 <label class="checkbox thing__checkbox">
217 <input type="checkbox" class="checkbox__input" name="experience" id="experience"> 218 <input type="checkbox" class="checkbox__input" name="experience" id="experience">
218 <span class="checkbox__icon"> 219 <span class="checkbox__icon">
219 <svg> 220 <svg>
220 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use> 221 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use>
221 </svg> 222 </svg>
222 </span> 223 </span>
223 <span class="checkbox__text"> 224 <span class="checkbox__text">
224 <span> 225 <span>
225 Опыт работы 226 Опыт работы
226 </span> 227 </span>
227 </span> 228 </span>
228 </label> 229 </label>
229 </form> 230 </form>
230 </div> 231 </div>
231 </section> 232 </section>
232 <main class="main"> 233 <main class="main">
233 <div class="container"> 234 <div class="container">
234 <div class="main__resume-base"> 235 <div class="main__resume-base">
235 <h2>Резюме работников</h2> 236 <h2>Резюме работников</h2>
236 <div class="filters"> 237 <div class="filters">
237 <div class="filters__label">Показано @if ($res_count > 0) 1 @else 0 @endif – @if($res_count < 5) {{ $res_count }} @else 5 @endif из {{ $res_count }} результатов поиска</div> 238 <div class="filters__label">Показано @if ($res_count > 0) 1 @else 0 @endif – @if($res_count < 5) {{ $res_count }} @else 5 @endif из {{ $res_count }} результатов поиска</div>
238 <div class="filters__body"> 239 <div class="filters__body">
239 <div class="select filters__select"> 240 <div class="select filters__select">
240 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 241 <select class="js-select2" id="sort_ajax" name="sort_ajax">
241 <option value="default">Сортировка (по умолчанию)</option> 242 <option value="default">Сортировка (по умолчанию)</option>
242 <option value="name_up">По имени (возрастание)</option> 243 <option value="name_up">По имени (возрастание)</option>
243 <option value="name_down">По имени (убывание)</option> 244 <option value="name_down">По имени (убывание)</option>
244 <option value="created_at_up">По дате (возрастание)</option> 245 <option value="created_at_up">По дате (возрастание)</option>
245 <option value="created_at_down">По дате (убывание)</option> 246 <option value="created_at_down">По дате (убывание)</option>
246 </select> 247 </select>
247 </div> 248 </div>
248 <button type="button" class="filters__item active" data-tab="1"> 249 <button type="button" class="filters__item active" data-tab="1">
249 <svg> 250 <svg>
250 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use> 251 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use>
251 </svg> 252 </svg>
252 </button> 253 </button>
253 <button type="button" class="filters__item" data-tab="2"> 254 <button type="button" class="filters__item" data-tab="2">
254 <svg> 255 <svg>
255 <use xlink:href="{{ asset('images/sprite.svg#grid-2') }}"></use> 256 <use xlink:href="{{ asset('images/sprite.svg#grid-2') }}"></use>
256 </svg> 257 </svg>
257 </button> 258 </button>
258 </div> 259 </div>
259 </div> 260 </div>
260 <div class="main__resume-base-body showed" data-body="1"> 261 <div class="main__resume-base-body showed" data-body="1">
261 <div class="main__resume-base-body-one" id="block1" name="block1"> 262 <div class="main__resume-base-body-one" id="block1" name="block1">
262 @if ($resumes->count()) 263 @if ($resumes->count())
263 @foreach ($resumes as $res) 264 @foreach ($resumes as $res)
264 <div class="main__resume-base-body-item"> 265 <div class="main__resume-base-body-item">
265 <div class="main__resume-base-body-item-buttons"> 266 <div class="main__resume-base-body-item-buttons">
266 <button type="button" class="like js-toggle js_box_favorites <?=\App\Classes\RusDate::selected_item($res->id);?>" data-val="{{ $res->id }}"> 267 <button type="button" data-id="{{ $res->id }}" id="elem{{ $res->id }}" class="like js-toggle js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($res) }}" data-val="{{ $res->id }}">
267 <svg> 268 <svg>
268 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 269 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
269 </svg> 270 </svg>
270 </button> 271 </button>
271 <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $res->id }}" data-options='{"touch":false,"autoFocus":false}'> 272 <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $res->id }}" data-options='{"touch":false,"autoFocus":false}'>
272 <svg> 273 <svg>
273 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> 274 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
274 </svg> 275 </svg>
275 </button> 276 </button>
276 </div> 277 </div>
277 <div class="main__resume-base-body-item-wrapper"> 278 <div class="main__resume-base-body-item-wrapper">
278 <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo"> 279 <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo">
279 <div class="main__resume-base-body-item-inner"> 280 <div class="main__resume-base-body-item-inner">
280 <div> 281 <div>
281 <b>Статус</b> 282 <b>Статус</b>
282 <span>{{ $status_work[$res->status_work] }}</span> 283 <span>{{ $status_work[$res->status_work] }}</span>
283 </div> 284 </div>
284 <div> 285 <div>
285 <b>Имя работника</b> 286 <b>Имя работника</b>
286 <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> 287 <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span>
287 </div> 288 </div>
288 <div> 289 <div>
289 <b>Номер телефона</b> 290 <b>Номер телефона</b>
290 <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span> 291 <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span>
291 </div> 292 </div>
292 <div> 293 <div>
293 <b>Электронный адрес</b> 294 <b>Электронный адрес</b>
294 <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> 295 <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span>
295 </div> 296 </div>
296 <div> 297 <div>
297 <b>Город проживания</b> 298 <b>Город проживания</b>
298 <span>{{ $res->city }}</span> 299 <span>{{ $res->city }}</span>
299 </div> 300 </div>
300 <div> 301 <div>
301 <b>Опыт работы</b> 302 <b>Опыт работы</b>
302 <span>{{ $res->experience }}</span> 303 <span>{{ $res->experience }}</span>
303 </div> 304 </div>
304 </div> 305 </div>
305 </div> 306 </div>
306 <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в резюме</a> 307 <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в резюме</a>
307 </div> 308 </div>
308 @endforeach 309 @endforeach
309 310
310 {{ $resumes->appends($_GET)->links('paginate') }} 311 {{ $resumes->appends($_GET)->links('paginate') }}
311 @endif 312 @endif
312 </div> 313 </div>
313 </div> 314 </div>
314 <div class="main__resume-base-body" data-body="2"> 315 <div class="main__resume-base-body" data-body="2">
315 <div class="main__resume-base-body-two" id="block2" name="block2"> 316 <div class="main__resume-base-body-two" id="block2" name="block2">
316 @if ($resumes->count()) 317 @if ($resumes->count())
317 @foreach ($resumes as $res) 318 @foreach ($resumes as $res)
318 <div class="main__resume-base-body-item"> 319 <div class="main__resume-base-body-item">
319 <div class="main__resume-base-body-item-buttons"> 320 <div class="main__resume-base-body-item-buttons">
320 <button type="button" class="like js-toggle js_box_favorites <?=\App\Classes\RusDate::selected_item($res->id);?>" data-val="{{ $res->id }}"> 321 <button type="button" id="elem_{{ $res->id }}" class="like js-toggle js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($res) }}" data-val="{{ $res->id }}">
321 <svg> 322 <svg>
322 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 323 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
323 </svg> 324 </svg>
324 </button> 325 </button>
325 <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $res->id }}" data-options='{"touch":false,"autoFocus":false}'> 326 <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $res->id }}" data-options='{"touch":false,"autoFocus":false}'>
326 <svg> 327 <svg>
327 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> 328 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
328 </svg> 329 </svg>
329 </button> 330 </button>
330 </div> 331 </div>
331 <div class="main__resume-base-body-item-wrapper"> 332 <div class="main__resume-base-body-item-wrapper">
332 <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo"> 333 <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo">
333 <div class="main__resume-base-body-item-inner"> 334 <div class="main__resume-base-body-item-inner">
334 <div> 335 <div>
335 <b>Статус</b> 336 <b>Статус</b>
336 <span>{{ $status_work[$res->status_work] }}</span> 337 <span>{{ $status_work[$res->status_work] }}</span>
337 </div> 338 </div>
338 <div> 339 <div>
339 <b>Имя работника</b> 340 <b>Имя работника</b>
340 <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> 341 <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span>
341 </div> 342 </div>
342 <div> 343 <div>
343 <b>Номер телефона</b> 344 <b>Номер телефона</b>
344 <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span> 345 <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span>
345 </div> 346 </div>
346 <div> 347 <div>
347 <b>Электронный адрес</b> 348 <b>Электронный адрес</b>
348 <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> 349 <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span>
349 </div> 350 </div>
350 <div> 351 <div>
351 <b>Город проживания</b> 352 <b>Город проживания</b>
352 <span>{{ $res->city }}</span> 353 <span>{{ $res->city }}</span>
353 </div> 354 </div>
354 <div> 355 <div>
355 <b>Опыт работы</b> 356 <b>Опыт работы</b>
356 <span>{{ $res->experience }}</span> 357 <span>{{ $res->experience }}</span>
357 </div> 358 </div>
358 </div> 359 </div>
359 </div> 360 </div>
360 <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в 361 <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в
361 резюме</a> 362 резюме</a>
362 </div> 363 </div>
363 @endforeach 364 @endforeach
364 365
365 {{ $resumes->appends($_GET)->links('paginate') }} 366 {{ $resumes->appends($_GET)->links('paginate') }}
366 @endif 367 @endif
367 </div> 368 </div>
368 </div> 369 </div>
369 </div> 370 </div>
370 </div> 371 </div>
371 </main> 372 </main>
372 </div> 373 </div>
373 </div> 374 </div>
374 @endsection 375 @endsection
375 376
resources/views/vacance-item.blade.php
1 @php 1 @php
2 use App\Classes\StatusUser; 2 use App\Classes\StatusUser;
3 @endphp 3 @endphp
4 4
5 @extends('layout.frontend', ['title' => $title]) 5 @extends('layout.frontend', ['title' => $title])
6 6
7 @section('scripts') 7 @section('scripts')
8 @include('js.favorite-vacancy') 8 @include('js.favorite-vacancy')
9 <script> 9 <script>
10 $(document).on('click', '.js_send_it_button', function() { 10 $(document).on('click', '.js_send_it_button', function() {
11 var this_ = $(this); 11 var this_ = $(this);
12 var code_user_id = this_.attr('data-uid'); 12 var code_user_id = this_.attr('data-uid');
13 var code_to_user_id = this_.attr('data-tuid'); 13 var code_to_user_id = this_.attr('data-tuid');
14 var code_vacancy = this_.attr('data-vacancy'); 14 var code_vacancy = this_.attr('data-vacancy');
15 var user_id = $('#_user_id'); 15 var user_id = $('#_user_id');
16 var to_user_id = $('#_to_user_id'); 16 var to_user_id = $('#_to_user_id');
17 var vacancy = $('#_vacancy'); 17 var vacancy = $('#_vacancy');
18 18
19 console.log('Клик на кнопки...'); 19 console.log('Клик на кнопки...');
20 20
21 user_id.val(code_user_id); 21 user_id.val(code_user_id);
22 to_user_id.val(code_to_user_id); 22 to_user_id.val(code_to_user_id);
23 vacancy.val(code_vacancy); 23 vacancy.val(code_vacancy);
24 }); 24 });
25 </script> 25 </script>
26 @include('js.favorite-vacancy-45')
26 @endsection 27 @endsection
27 28
28 @section('content') 29 @section('content')
29 <main class="main"> 30 <main class="main">
30 <div class="container"> 31 <div class="container">
31 <ul class="breadcrumbs main__breadcrumbs"> 32 <ul class="breadcrumbs main__breadcrumbs">
32 <li><a href="{{ route('index') }}">Главная</a></li> 33 <li><a href="{{ route('index') }}">Главная</a></li>
33 <li><a href="{{ route('vacancies') }}">Вакансии</a></li> 34 <li><a href="{{ route('vacancies') }}">Вакансии</a></li>
34 <li><b>{{ $title }}</b></li> 35 <li><b>{{ $title }}</b></li>
35 </ul> 36 </ul>
36 <div class="main__employer-page"> 37 <div class="main__employer-page">
37 38
38 @if (isset($Query[0]->employer)) 39 @if (isset($Query[0]->employer))
39 <h2 class="main__employer-page-title">О компании</h2> 40 <h2 class="main__employer-page-title">О компании</h2>
40 <div class="main__employer-page-two-item-toper"> 41 <div class="main__employer-page-two-item-toper">
41 @if (!empty($Query[0]->employer->logo)) 42 @if (!empty($Query[0]->employer->logo))
42 <img src="{{ asset(Storage::url($Query[0]->employer->logo)) }}" alt="{{ $Query[0]->employer->name }}"> 43 <img src="{{ asset(Storage::url($Query[0]->employer->logo)) }}" alt="{{ $Query[0]->employer->name }}">
43 @else 44 @else
44 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Query[0]->employer->name }}"> 45 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Query[0]->employer->name }}">
45 @endif 46 @endif
46 <span>{{ $Query[0]->employer->name_company }}</span> 47 <span>{{ $Query[0]->employer->name_company }}</span>
47 </div> 48 </div>
48 49
49 <div class="main__employer-page-info"> 50 <div class="main__employer-page-info">
50 <div class="main__employer-page-item"> 51 <div class="main__employer-page-item">
51 <b> Адрес компании</b> 52 <b> Адрес компании</b>
52 <span> 53 <span>
53 {{ $Query[0]->employer->address }} 54 {{ $Query[0]->employer->address }}
54 </span> 55 </span>
55 </div> 56 </div>
56 <div class="main__employer-page-item"> 57 <div class="main__employer-page-item">
57 <b>Сайт</b> 58 <b>Сайт</b>
58 <span> 59 <span>
59 <a href="{{ $Query[0]->employer->site }}">{{ $Query[0]->employer->site }}</a> 60 <a href="{{ $Query[0]->employer->site }}">{{ $Query[0]->employer->site }}</a>
60 </span> 61 </span>
61 </div> 62 </div>
62 <div class="main__employer-page-item"> 63 <div class="main__employer-page-item">
63 <b>Почта</b> 64 <b>Почта</b>
64 <span> 65 <span>
65 <a href="{{ $Query[0]->employer->email }}">{{ $Query[0]->employer->email }}</a> 66 <a href="{{ $Query[0]->employer->email }}">{{ $Query[0]->employer->email }}</a>
66 </span> 67 </span>
67 </div> 68 </div>
68 <div class="main__employer-page-item"> 69 <div class="main__employer-page-item">
69 <b>Телефон</b> 70 <b>Телефон</b>
70 <span> 71 <span>
71 <a href="tel:{{ $Query[0]->employer->telephone }}">{{ $Query[0]->employer->telephone }}</a> 72 <a href="tel:{{ $Query[0]->employer->telephone }}">{{ $Query[0]->employer->telephone }}</a>
72 </span> 73 </span>
73 </div> 74 </div>
74 </div> 75 </div>
75 @else 76 @else
76 <div class="main__employer-page-info"> 77 <div class="main__employer-page-info">
77 <div class="main__employer-page-item"> 78 <div class="main__employer-page-item">
78 <b>Ничего не найдено</b> 79 <b>Ничего не найдено</b>
79 <span> 80 <span>
80 Нет данных о компании 81 Нет данных о компании
81 </span> 82 </span>
82 </div> 83 </div>
83 </div> 84 </div>
84 @endif 85 @endif
85 <h2 class="main__employer-page-title">Описание вакансии</h2> 86 <h2 class="main__employer-page-title">Описание вакансии</h2>
86 87
87 </div> 88 </div>
88 89
89 @foreach ($Query as $Q) 90 @foreach ($Query as $Q)
90 <div class="main__vacancies-item-page main__employer-page-two-item"> 91 <div class="main__vacancies-item-page main__employer-page-two-item">
91 <div class="main__employer-page-two-item-text"> 92 <div class="main__employer-page-two-item-text">
92 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор 93 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор
93 специалистов на следующие должности:</div> 94 специалистов на следующие должности:</div>
94 <div class="main__employer-page-two-item-text-links"> 95 <div class="main__employer-page-two-item-text-links">
95 @if (isset($Q->jobs)) 96 @if (isset($Q->jobs))
96 @foreach ($Q->jobs as $key => $j) 97 @foreach ($Q->jobs as $key => $j)
97 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a> 98 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a>
98 @endforeach 99 @endforeach
99 @endif 100 @endif
100 </div> 101 </div>
101 </div> 102 </div>
102 <div class="main__employer-page-two-item-text"> 103 <div class="main__employer-page-two-item-text">
103 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 104 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
104 <div class="main__employer-page-two-item-text-body"> 105 <div class="main__employer-page-two-item-text-body">
105 {!! $Q->text !!} 106 {!! $Q->text !!}
106 </div> 107 </div>
107 </div> 108 </div>
108 <div class="main__employer-page-two-item-text"> 109 <div class="main__employer-page-two-item-text">
109 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div> 110 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div>
110 <div class="main__employer-page-two-item-text-body"> 111 <div class="main__employer-page-two-item-text-body">
111 {!! $Q->description !!} 112 {!! $Q->description !!}
112 </div> 113 </div>
113 </div> 114 </div>
114 <div class="main__employer-page-two-item-text"> 115 <div class="main__employer-page-two-item-text">
115 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div> 116 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div>
116 <div class="main__employer-page-two-item-text-body"> 117 <div class="main__employer-page-two-item-text-body">
117 {!! $Q->contacts_emails !!} 118 {!! $Q->contacts_emails !!}
118 </div> 119 </div>
119 <div class="main__employer-page-two-item-text"> 120 <div class="main__employer-page-two-item-text">
120 <div class="main__employer-page-two-item-text-name">Или звоните:</div> 121 <div class="main__employer-page-two-item-text-name">Или звоните:</div>
121 <div class="main__employer-page-two-item-text-body"> 122 <div class="main__employer-page-two-item-text-body">
122 {!! $Q->contacts_telephones !!} 123 {!! $Q->contacts_telephones !!}
123 </div> 124 </div>
124 </div> 125 </div>
125 126
126 <div class="main__employer-page-two-item-tags"> 127 <div class="main__employer-page-two-item-tags">
127 @if (!empty($Q->jobs_code[0]->position_ship)) 128 @if (!empty($Q->jobs_code[0]->position_ship))
128 <span class="main__employer-page-two-item-tag">#{{ $Q->jobs_code[0]->position_ship }}</span> 129 <span class="main__employer-page-two-item-tag">#{{ $Q->jobs_code[0]->position_ship }}</span>
129 @else 130 @else
130 @if (isset($Q->jobs)) 131 @if (isset($Q->jobs))
131 @foreach ($Q->jobs as $key => $j) 132 @foreach ($Q->jobs as $key => $j)
132 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span> 133 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span>
133 @endforeach 134 @endforeach
134 @endif 135 @endif
135 @endif 136 @endif
136 </div> 137 </div>
137 <br> 138 <br>
138 <div class="main__employer-page-two-item-buttons"> 139 <div class="main__employer-page-two-item-buttons">
139 @guest 140 @guest
140 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' 141 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
141 class="button main__employer-page-two-item-button">Откликнуться</button> 142 class="button main__employer-page-two-item-button">Откликнуться</button>
142 @else 143 @else
143 @if (App\Classes\StatusUser::Status()==1) 144 @if (App\Classes\StatusUser::Status()==1)
144 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}' 145 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
145 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> 146 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
146 @else 147 @else
147 <button type="button" data-fancybox data-src="#send2" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}' 148 <button type="button" data-fancybox data-src="#send2" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
148 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> 149 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
149 @endif 150 @endif
150 @endguest 151 @endguest
151 </div> 152 </div>
152 <div class="main__employer-page-two-item-bottom"> 153 <div class="main__employer-page-two-item-bottom">
153 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div> 154 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div>
154 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js_vacancy_favorites js-toggle <?=\App\Classes\RusDate::selected_vacancy($Q->id);?>"> 155 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js_vac_favorite js-toggle {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}">
155 <svg> 156 <svg>
156 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 157 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
157 </svg> 158 </svg>
158 </button> 159 </button>
159 </div> 160 </div>
160 161
161 </div> 162 </div>
162 163
163 @endforeach 164 @endforeach
164 165
165 </div> <a href="{{ redirect()->back()->getTargetUrl() }}" class="back"> 166 </div> <a href="{{ redirect()->back()->getTargetUrl() }}" class="back">
166 <svg> 167 <svg>
167 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 168 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
168 </svg> 169 </svg>
169 <span> 170 <span>
170 Вернуться к списку вакансий 171 Вернуться к списку вакансий
171 </span> 172 </span>
172 </a> 173 </a>
173 </main> 174 </main>
174 </div> 175 </div>
175 @endsection 176 @endsection
176 177
resources/views/workers/cabinet.blade.php
1 @extends('layout.frontend', ['title' => 'Моя анкета - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Моя анкета - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 console.log('Test system'); 5 console.log('Test system');
6 $(document).on('click', '#button_new_doc', function() { 6 $(document).on('click', '#button_new_doc', function() {
7 var this_ = $(this); 7 var this_ = $(this);
8 var val_ = this_.attr('data-val'); 8 var val_ = this_.attr('data-val');
9 var new_diplom = $('#new_diplom'); 9 var new_diplom = $('#new_diplom');
10 var new_diplom_val = new_diplom.val(); 10 var new_diplom_val = new_diplom.val();
11 var new_data_begin = $('#new_data_begin'); 11 var new_data_begin = $('#new_data_begin');
12 var new_data_begin_val = new_data_begin.val(); 12 var new_data_begin_val = new_data_begin.val();
13 var new_data_end = $('#new_data_end'); 13 var new_data_end = $('#new_data_end');
14 var new_data_end_val = new_data_end.val(); 14 var new_data_end_val = new_data_end.val();
15 var education = $('#education'); 15 var education = $('#education');
16 var education_val = education.val(); 16 var education_val = education.val();
17 var worker_id = $('#new_id'); 17 var worker_id = $('#new_id');
18 var worker_val = worker_id.val(); 18 var worker_val = worker_id.val();
19 19
20 console.log('sort items ' + val_); 20 console.log('sort items ' + val_);
21 21
22 if (new_diplom_val == '') { 22 if (new_diplom_val == '') {
23 new_diplom.addClass('err_red'); 23 new_diplom.addClass('err_red');
24 console.log('Border Up'); 24 console.log('Border Up');
25 } else { 25 } else {
26 $.ajax({ 26 $.ajax({
27 type: "GET", 27 type: "GET",
28 url: "{{ route('worker.add_serificate') }}", 28 url: "{{ route('worker.add_serificate') }}",
29 data: "worker_id="+worker_val+"&date_begin="+new_data_begin_val + "&end_begin=" + new_data_end_val + "&name=" + new_diplom_val + "&education="+education_val, 29 data: "worker_id="+worker_val+"&date_begin="+new_data_begin_val + "&end_begin=" + new_data_end_val + "&name=" + new_diplom_val + "&education="+education_val,
30 success: function (data) { 30 success: function (data) {
31 console.log('Блокировка...'); 31 console.log('Блокировка...');
32 console.log(data); 32 console.log(data);
33 $('#sertificate').html(data); 33 $('#sertificate').html(data);
34 if (new_diplom.hasClass('err_red')) new_diplom.removeClass('err_red'); 34 if (new_diplom.hasClass('err_red')) new_diplom.removeClass('err_red');
35 }, 35 },
36 headers: { 36 headers: {
37 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 37 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
38 }, 38 },
39 error: function (data) { 39 error: function (data) {
40 data = JSON.stringify(data); 40 data = JSON.stringify(data);
41 console.log('Error: ' + data); 41 console.log('Error: ' + data);
42 } 42 }
43 }); 43 });
44 } 44 }
45 }); 45 });
46 46
47 $(document).on('click', '#btn_new_diplom123', function() { 47 $(document).on('click', '#btn_new_diplom123', function() {
48 var this_ = $(this); 48 var this_ = $(this);
49 var val_ = this_.attr('data-val'); 49 var val_ = this_.attr('data-val');
50 var documents = $('#documents'); 50 var documents = $('#documents');
51 var doc_val = documents.val(); 51 var doc_val = documents.val();
52 var block = $('#ajax_dop_diplomi'); 52 var block = $('#ajax_dop_diplomi');
53 53
54 console.log('worker_id='+val_+'it_infoblock='+ doc_val); 54 console.log('worker_id='+val_+'it_infoblock='+ doc_val);
55 55
56 $.ajax({ 56 $.ajax({
57 type: "GET", 57 type: "GET",
58 url: "", 58 url: "",
59 data: "worker_id="+val_+"&infoblok_id="+doc_val, 59 data: "worker_id="+val_+"&infoblok_id="+doc_val,
60 success: function (data) { 60 success: function (data) {
61 location.url = data; 61 location.url = data;
62 console.log('Добавление документа-диплома'); 62 console.log('Добавление документа-диплома');
63 console.log(data); 63 console.log(data);
64 block.html(data); 64 block.html(data);
65 }, 65 },
66 headers: { 66 headers: {
67 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 67 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
68 }, 68 },
69 error: function (data) { 69 error: function (data) {
70 data = JSON.stringify(data); 70 data = JSON.stringify(data);
71 console.log('Error: ' + data); 71 console.log('Error: ' + data);
72 } 72 }
73 }); 73 });
74 }); 74 });
75 75
76 $(document).on('click', '#new_work', function() { 76 $(document).on('click', '#new_work', function() {
77 var this_ = $(this); 77 var this_ = $(this);
78 var val_ = this_.attr('data-val'); 78 var val_ = this_.attr('data-val');
79 var new_diplom = $('#new_diplom').val(); 79 var new_diplom = $('#new_diplom').val();
80 var new_data_begin = $('#new_data_begin').val(); 80 var new_data_begin = $('#new_data_begin').val();
81 var new_data_end = $('#new_data_end').val(); 81 var new_data_end = $('#new_data_end').val();
82 var new_job_title = $('#new_job_title').val(); 82 var new_job_title = $('#new_job_title').val();
83 var new_teplohod = $('#new_teplohod').val(); 83 var new_teplohod = $('#new_teplohod').val();
84 var new_GWT = $('#new_GWT').val(); 84 var new_GWT = $('#new_GWT').val();
85 var new_KBT = $('#new_KBT').val(); 85 var new_KBT = $('#new_KBT').val();
86 var new_Begin_work = $('#new_Begin_work').val(); 86 var new_Begin_work = $('#new_Begin_work').val();
87 var new_End_work = $('#new_End_work').val(); 87 var new_End_work = $('#new_End_work').val();
88 var new_name_company = $('#new_name_company').val(); 88 var new_name_company = $('#new_name_company').val();
89 89
90 console.log('worker_id='+val_+'it_infoblock='+ doc_val); 90 console.log('worker_id='+val_+'it_infoblock='+ doc_val);
91 91
92 $.ajax({ 92 $.ajax({
93 type: "GET", 93 type: "GET",
94 url: "", 94 url: "",
95 data: "worker_id="+val_+"&infoblok_id="+doc_val, 95 data: "worker_id="+val_+"&infoblok_id="+doc_val,
96 success: function (data) { 96 success: function (data) {
97 location.url = data; 97 location.url = data;
98 console.log('Добавление документа-диплома'); 98 console.log('Добавление документа-диплома');
99 console.log(data); 99 console.log(data);
100 block.html(data); 100 block.html(data);
101 }, 101 },
102 headers: { 102 headers: {
103 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 103 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
104 }, 104 },
105 error: function (data) { 105 error: function (data) {
106 data = JSON.stringify(data); 106 data = JSON.stringify(data);
107 console.log('Error: ' + data); 107 console.log('Error: ' + data);
108 } 108 }
109 }); 109 });
110 }); 110 });
111
112 $(document).on('click', '#old_year', function() {
113 var this_ = $(this);
114 var val = this_.val();
115
116 if (val < 0)
117 $('#old_year').val(0);
118
119 console.log('Возраст не может выполнить такую операцию');
120 });
121
111 </script> 122 </script>
112 @endsection 123 @endsection
113 124
114 @section('content') 125 @section('content')
115 <section class="cabinet"> 126 <section class="cabinet">
116 <div class="container"> 127 <div class="container">
117 <ul class="breadcrumbs cabinet__breadcrumbs"> 128 <ul class="breadcrumbs cabinet__breadcrumbs">
118 <li><a href="{{ route('index') }}">Главная</a></li> 129 <li><a href="{{ route('index') }}">Главная</a></li>
119 <li><b>Личный кабинет</b></li> 130 <li><b>Личный кабинет</b></li>
120 </ul> 131 </ul>
121 <div class="cabinet__wrapper"> 132 <div class="cabinet__wrapper">
122 <div class="cabinet__side"> 133 <div class="cabinet__side">
123 <div class="cabinet__side-toper"> 134 <div class="cabinet__side-toper">
124 @include('workers.emblema') 135 @include('workers.emblema')
125 136
126 </div> 137 </div>
127 138
128 @include('workers.menu', ['item' => 1]) 139 @include('workers.menu', ['item' => 1])
129 </div> 140 </div>
130 <form class="cabinet__body" action="{{ route('worker.cabinet_save', ['worker' => $Worker[0]->id]) }}" enctype="multipart/form-data" method="POST"> 141 <form class="cabinet__body" action="{{ route('worker.cabinet_save', ['worker' => $Worker[0]->id]) }}" enctype="multipart/form-data" method="POST">
131 @csrf 142 @csrf
132 @include('messages_error') 143 @include('messages_error')
133 <div class="cabinet__body-item"> 144 <div class="cabinet__body-item">
134 <div class="cabinet__anketa"> 145 <div class="cabinet__anketa">
135 <h2 class="title cabinet__title">Моя анкета</h2> 146 <h2 class="title cabinet__title">Моя анкета</h2>
136 <div class="cabinet__anketa-buttons"> 147 <div class="cabinet__anketa-buttons">
137 <a href="{{ route('worker.up', ['worker' => $Worker[0]->id]) }}" class="button">Поднять резюме</a> 148 <a href="{{ route('worker.up', ['worker' => $Worker[0]->id]) }}" class="button">Поднять резюме</a>
138 <a href="{{ route('resume_download', ['worker' => $Worker[0]->id]) }}" target="_blank" class="button"> 149 <a href="{{ route('resume_download', ['worker' => $Worker[0]->id]) }}" target="_blank" class="button">
139 <svg> 150 <svg>
140 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> 151 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
141 </svg> 152 </svg>
142 Скачать резюме 153 Скачать резюме
143 </a> 154 </a>
144 </div> 155 </div>
145 </div> 156 </div>
146 </div> 157 </div>
147 <div class="cabinet__body-item"> 158 <div class="cabinet__body-item">
148 <div class="cabinet__stats"> 159 <div class="cabinet__stats">
149 <h3 class="cabinet__subtitle cabinet__stats-title">Статистика</h3> 160 <h3 class="cabinet__subtitle cabinet__stats-title">Статистика</h3>
150 <div class="cabinet__stats-body"> 161 <div class="cabinet__stats-body">
151 <div class="cabinet__stats-item"> 162 <div class="cabinet__stats-item">
152 <svg> 163 <svg>
153 <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use> 164 <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use>
154 </svg> 165 </svg>
155 <span>Просмотров:</span> 166 <span>Просмотров:</span>
156 <b>@if (isset($stat[0]->lookin)) {{ $stat[0]->lookin }} @else 0 @endif</b> 167 <b>@if (isset($stat[0]->lookin)) {{ $stat[0]->lookin }} @else 0 @endif</b>
157 </div> 168 </div>
158 <div class="cabinet__stats-item"> 169 <div class="cabinet__stats-item">
159 <svg> 170 <svg>
160 <use xlink:href="{{ asset('images/sprite.svg#warning') }}"></use> 171 <use xlink:href="{{ asset('images/sprite.svg#warning') }}"></use>
161 </svg> 172 </svg>
162 <span>Отзывов:</span> 173 <span>Отзывов:</span>
163 <b>@if (isset($stat[0]->message)) {{ $stat[0]->message }} @else 0 @endif</b> 174 <b>@if (isset($stat[0]->message)) {{ $stat[0]->message }} @else 0 @endif</b>
164 </div> 175 </div>
165 </div> 176 </div>
166 <div class="cabinet__stats-subtitle">Анкета заполнена на {{ $persent }}%</div> 177 <div class="cabinet__stats-subtitle">Анкета заполнена на {{ $persent }}%</div>
167 <div class="cabinet__stats-line"> 178 <div class="cabinet__stats-line">
168 <span style="width:{{ $persent }}%"></span> 179 <span style="width:{{ $persent }}%"></span>
169 </div> 180 </div>
170 <div class="cabinet__stats-bottom">Заполните профиль, чтобы повысить процент анкеты на 80%</div> 181 <div class="cabinet__stats-bottom">Заполните профиль, чтобы повысить процент анкеты на 80%</div>
171 </div> 182 </div>
172 </div> 183 </div>
173 <div class="cabinet__body-item"> 184 <div class="cabinet__body-item">
174 <h3 class="cabinet__subtitle">Профиль</h3> 185 <h3 class="cabinet__subtitle">Профиль</h3>
175 <div class="cabinet__avatar"> 186 <div class="cabinet__avatar">
176 <div class="cabinet__avatar-pic"> 187 <div class="cabinet__avatar-pic">
177 188
178 @if (!empty($Worker[0]->photo)) 189 @if (!empty($Worker[0]->photo))
179 <img src="{{ asset(Storage::url($Worker[0]->photo)) }}"/> 190 <img src="{{ asset(Storage::url($Worker[0]->photo)) }}"/>
180 @else 191 @else
181 <svg> 192 <svg>
182 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 193 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
183 </svg> 194 </svg>
184 @endif 195 @endif
185 </div> 196 </div>
186 <div class="cabinet__avatar-form"> 197 <div class="cabinet__avatar-form">
187 <label class="file"> 198 <label class="file">
188 <span class="file__input"> 199 <span class="file__input">
189 <input type="file" name="photo" id="photo"> 200 <input type="file" name="photo" id="photo">
190 201
191 <span class="button"> 202 <span class="button">
192 <svg> 203 <svg>
193 <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use> 204 <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use>
194 </svg> 205 </svg>
195 Загрузить 206 Загрузить
196 </span> 207 </span>
197 </span> 208 </span>
198 </label> 209 </label>
199 <p class="cabinet__text">Загрузите фотографию в формате svg., jpg., jpeg., png.</p> 210 <p class="cabinet__text">Загрузите фотографию в формате svg., jpg., jpeg., png.</p>
200 </div> 211 </div>
201 </div> 212 </div>
202 </div> 213 </div>
203 <div class="cabinet__body-item"> 214 <div class="cabinet__body-item">
204 <div class="cabinet__inputs"> 215 <div class="cabinet__inputs">
205 <div class="cabinet__inputs-item form-group"> 216 <div class="cabinet__inputs-item form-group">
206 <label class="form-group__label">Электронная почта *</label> 217 <label class="form-group__label">Электронная почта *</label>
207 <div class="form-group__item"> 218 <div class="form-group__item">
208 <input type="email" name="email" id="email" value="{{ $Worker[0]->email }}" class="input" placeholder="info@rekamore.su" required> 219 <input type="email" name="email" id="email" value="{{ $Worker[0]->email }}" class="input" placeholder="info@rekamore.su" required>
209 </div> 220 </div>
210 </div> 221 </div>
211 <div class="cabinet__inputs-item form-group"> 222 <div class="cabinet__inputs-item form-group">
212 <label class="form-group__label">Статус</label> 223 <label class="form-group__label">Статус</label>
213 <div class="form-group__item"> 224 <div class="form-group__item">
214 <div class="select"> 225 <div class="select">
215 <select class="js-select2" name="status_work" id="status_work"> 226 <select class="js-select2" name="status_work" id="status_work">
216 <option value="1" @if ($Worker[0]->status_work == 1) selected @endif>Не указано</option> 227 <option value="1" @if ($Worker[0]->status_work == 1) selected @endif>Не указано</option>
217 <option value="2" @if ($Worker[0]->status_work == 2) selected @endif>Не ищу работу</option> 228 <option value="2" @if ($Worker[0]->status_work == 2) selected @endif>Не ищу работу</option>
218 <option value="0" @if ($Worker[0]->status_work == 0) selected @endif>Ищу работу</option> 229 <option value="0" @if ($Worker[0]->status_work == 0) selected @endif>Ищу работу</option>
219 </select> 230 </select>
220 </div> 231 </div>
221 </div> 232 </div>
222 </div> 233 </div>
223 <!--<div class="cabinet__inputs-item form-group"> 234 <!--<div class="cabinet__inputs-item form-group">
224 <label class="form-group__label">Статус *</label> 235 <label class="form-group__label">Статус *</label>
225 <div class="form-group__item"> 236 <div class="form-group__item">
226 <input type="text" class="input" required> 237 <input type="text" class="input" required>
227 </div> 238 </div>
228 </div>--> 239 </div>-->
229 @if (isset($Worker[0]->users)) 240 @if (isset($Worker[0]->users))
230 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 241 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
231 <label class="form-group__label">Фамилия *</label> 242 <label class="form-group__label">Фамилия *</label>
232 <div class="form-group__item"> 243 <div class="form-group__item">
233 <input type="text" name="surname" id="surmane" class="input" value="{{ $Worker[0]->users->surname }}" placeholder="Филиппов" required> 244 <input type="text" name="surname" id="surmane" class="input" value="{{ $Worker[0]->users->surname }}" placeholder="Филиппов" required>
234 </div> 245 </div>
235 </div> 246 </div>
236 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 247 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
237 <label class="form-group__label">Имя *</label> 248 <label class="form-group__label">Имя *</label>
238 <div class="form-group__item"> 249 <div class="form-group__item">
239 <input type="text" name="name_man" id="name_man" class="input" value="{{ $Worker[0]->users->name_man }}" placeholder="Егор" required> 250 <input type="text" name="name_man" id="name_man" class="input" value="{{ $Worker[0]->users->name_man }}" placeholder="Егор" required>
240 </div> 251 </div>
241 </div> 252 </div>
242 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 253 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
243 <label class="form-group__label">Отчество *</label> 254 <label class="form-group__label">Отчество *</label>
244 <div class="form-group__item"> 255 <div class="form-group__item">
245 <input type="text" class="input" name="surname2" id="surmane2" value="{{ $Worker[0]->users->surname2 }}" placeholder="Алексеевич"> 256 <input type="text" class="input" name="surname2" id="surmane2" value="{{ $Worker[0]->users->surname2 }}" placeholder="Алексеевич">
246 </div> 257 </div>
247 </div> 258 </div>
248 @endif 259 @endif
249 </div> 260 </div>
250 </div> 261 </div>
251 <div class="cabinet__body-item"> 262 <div class="cabinet__body-item">
252 <h3 class="cabinet__subtitle">Основная информация</h3> 263 <h3 class="cabinet__subtitle">Основная информация</h3>
253 <div class="cabinet__inputs"> 264 <div class="cabinet__inputs">
254 <div class="cabinet__inputs-item cabinet__inputs-item_min form-group"> 265 <div class="cabinet__inputs-item cabinet__inputs-item_min form-group">
255 <label class="form-group__label">Возраст</label> 266 <label class="form-group__label">Возраст</label>
256 <div class="form-group__item"> 267 <div class="form-group__item">
257 <input type="number" name="old_year" id="old_year" value="{{ $Worker[0]->old_year }}" class="input" placeholder="0" required> 268 <input type="number" name="old_year" id="old_year" value="{{ $Worker[0]->old_year }}" class="input" placeholder="0" required>
258 </div> 269 </div>
259 </div> 270 </div>
260 <div class="cabinet__inputs-item cabinet__inputs-item_max form-group"> 271 <div class="cabinet__inputs-item cabinet__inputs-item_max form-group">
261 <label class="form-group__label">Желаемые вакансии</label> 272 <label class="form-group__label">Желаемые вакансии</label>
262 <div class="form-group__item"> 273 <div class="form-group__item">
263 <div class="select"> 274 <div class="select">
264 <select class="js-select2" name="job_title_id[]" id="job_title_id[]" multiple="multiple"> 275 <select class="js-select2" name="job_title_id[]" id="job_title_id[]" multiple="multiple">
265 @if ($Job_titles->count()) 276 @if ($Job_titles->count())
266 @foreach($Job_titles as $it) 277 @foreach($Job_titles as $it)
267 @if (isset($Worker[0]->job_titles)) 278 @if (isset($Worker[0]->job_titles))
268 @if ($Worker[0]->job_titles->count()) 279 @if ($Worker[0]->job_titles->count())
269 @foreach($Worker[0]->job_titles as $select) 280 @foreach($Worker[0]->job_titles as $select)
270 <option value="{{ $it->id }}" @if ($it->id == $select->id) selected @endif>{{ $it->name }}</option> 281 <option value="{{ $it->id }}" @if ($it->id == $select->id) selected @endif>{{ $it->name }}</option>
271 @endforeach 282 @endforeach
272 @else 283 @else
273 <option value="{{ $it->id }}">{{ $it->name }} ({{ $it->id }})</option> 284 <option value="{{ $it->id }}">{{ $it->name }} ({{ $it->id }})</option>
274 @endif 285 @endif
275 @else 286 @else
276 <option value="{{ $it->id }}">{{ $it->name }} ({{ $it->id }})</option> 287 <option value="{{ $it->id }}">{{ $it->name }} ({{ $it->id }})</option>
277 @endif 288 @endif
278 @endforeach 289 @endforeach
279 @endif 290 @endif
280 </select> 291 </select>
281 </div> 292 </div>
282 </div> 293 </div>
283 </div> 294 </div>
284 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 295 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
285 <label class="form-group__label">Город</label> 296 <label class="form-group__label">Город</label>
286 <div class="form-group__item"> 297 <div class="form-group__item">
287 <input type="text" name="city" id="city" value="{{ $Worker[0]->city }}" class="input" placeholder="Челябинск" required> 298 <input type="text" name="city" id="city" value="{{ $Worker[0]->city }}" class="input" placeholder="Челябинск" required>
288 </div> 299 </div>
289 </div> 300 </div>
290 <div class="cabinet__inputs-item form-group"> 301 <div class="cabinet__inputs-item form-group">
291 <label class="form-group__label">Опыт работы</label> 302 <label class="form-group__label">Опыт работы</label>
292 <div class="form-group__item"> 303 <div class="form-group__item">
293 <div class="select"> 304 <div class="select">
294 <select class="js-select2" id="experience" name="experience"> 305 <select class="js-select2" id="experience" name="experience">
295 <option value="Не указано" @if (empty($Worker[0]->experience)) selected @endif>Не указано</option> 306 <option value="Не указано" @if (empty($Worker[0]->experience)) selected @endif>Не указано</option>
296 <option value="меньше 1 года" @if ($Worker[0]->experience == 'меньше 1 года') selected @endif>меньше 1 года</option> 307 <option value="меньше 1 года" @if ($Worker[0]->experience == 'меньше 1 года') selected @endif>меньше 1 года</option>
297 <option value="от 1 года до 3 лет" @if ($Worker[0]->experience == 'от 1 года до 3 лет') selected @endif>от 1 года до 3 лет</option> 308 <option value="от 1 года до 3 лет" @if ($Worker[0]->experience == 'от 1 года до 3 лет') selected @endif>от 1 года до 3 лет</option>
298 <option value="от 3 до 5 лет" @if ($Worker[0]->experience == 'от 3 до 5 лет') selected @endif>от 3 до 5 лет</option> 309 <option value="от 3 до 5 лет" @if ($Worker[0]->experience == 'от 3 до 5 лет') selected @endif>от 3 до 5 лет</option>
299 <option value="от 5 до 10 лет" @if ($Worker[0]->experience == 'от 5 до 10 лет') selected @endif>от 5 до 10 лет</option> 310 <option value="от 5 до 10 лет" @if ($Worker[0]->experience == 'от 5 до 10 лет') selected @endif>от 5 до 10 лет</option>
300 <option value="Больше 10 лет" @if ($Worker[0]->experience == 'Больше 10 лет') selected @endif>Больше 10 лет</option> 311 <option value="Больше 10 лет" @if ($Worker[0]->experience == 'Больше 10 лет') selected @endif>Больше 10 лет</option>
301 </select> 312 </select>
302 </div> 313 </div>
303 </div> 314 </div>
304 </div> 315 </div>
305 316
306 <div class="cabinet__inputs-item form-group"> 317 <div class="cabinet__inputs-item form-group">
307 <label class="form-group__label">Номер телефона 1</label> 318 <label class="form-group__label">Номер телефона 1</label>
308 <div class="form-group__item"> 319 <div class="form-group__item">
309 <input type="tel" name="telephone" id="telephone" value="{{ old('telephone') ?? $Worker[0]->telephone ?? '' }}" class="input" placeholder="+7 (___) ___-__-__" required> 320 <input type="tel" name="telephone" id="telephone" value="{{ old('telephone') ?? $Worker[0]->telephone ?? '' }}" class="input" placeholder="+7 (___) ___-__-__" required>
310 </div> 321 </div>
311 </div> 322 </div>
312 <div class="cabinet__inputs-item form-group"> 323 <div class="cabinet__inputs-item form-group">
313 <label class="form-group__label">Номер телефона 2</label> 324 <label class="form-group__label">Номер телефона 2</label>
314 <div class="form-group__item"> 325 <div class="form-group__item">
315 <input type="tel" name="telephone2" id="telephon2" value="{{ old('telephone2') ?? $Worker[0]->telephone2 ?? '' }}" class="input" placeholder="+7 (___) ___-__-__"> 326 <input type="tel" name="telephone2" id="telephon2" value="{{ old('telephone2') ?? $Worker[0]->telephone2 ?? '' }}" class="input" placeholder="+7 (___) ___-__-__">
316 </div> 327 </div>
317 </div> 328 </div>
318 </div> 329 </div>
319 </div> 330 </div>
320 331
321 <div id="sertificate" name="sertificate"> 332 <div id="sertificate" name="sertificate">
322 @if ((isset($Worker[0]->sertificate)) && ($Worker[0]->sertificate->count() > 0)) 333 @if ((isset($Worker[0]->sertificate)) && ($Worker[0]->sertificate->count() > 0))
323 @php $i = 0; @endphp 334 @php $i = 0; @endphp
324 @foreach($Worker[0]->sertificate as $it) 335 @foreach($Worker[0]->sertificate as $it)
325 <div style="margin-bottom: 20px" class="cabinet__body-item"> 336 <div style="margin-bottom: 20px" class="cabinet__body-item">
326 @if ($i == 0) 337 @if ($i == 0)
327 <h3 class="cabinet__subtitle">Сертификаты / документы</h3> 338 <h3 class="cabinet__subtitle">Сертификаты / документы</h3>
328 @endif 339 @endif
329 <h4 class="cabinet__h4">Сертификат {{ $i+1 }}</h4> 340 <h4 class="cabinet__h4">Сертификат {{ $i+1 }}</h4>
330 <div class="cabinet__inputs"> 341 <div class="cabinet__inputs">
331 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 342 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
332 <label class="form-group__label">Название сертификата</label> 343 <label class="form-group__label">Название сертификата</label>
333 <div class="form-group__item"> 344 <div class="form-group__item">
334 <input type="text" class="input" value="{{ $it->name }}" disabled> 345 <input type="text" class="input" value="{{ $it->name }}" disabled>
335 </div> 346 </div>
336 </div> 347 </div>
337 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 348 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
338 <label class="form-group__label">Название сертификата</label> 349 <label class="form-group__label">Название сертификата</label>
339 <div class="form-group__item"> 350 <div class="form-group__item">
340 <input type="text" class="input" value="{{ $it->date_begin }} - {{ $it->end_begin }}" disabled> 351 <input type="text" class="input" value="{{ $it->date_begin }} - {{ $it->end_begin }}" disabled>
341 </div> 352 </div>
342 </div> 353 </div>
343 <a href="{{ route('worker.delete_sertificate', ['doc' => $it->id]) }}" class="button button_light"> 354 <a href="{{ route('worker.delete_sertificate', ['doc' => $it->id]) }}" class="button button_light">
344 <svg> 355 <svg>
345 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> 356 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use>
346 </svg> 357 </svg>
347 Удалить 358 Удалить
348 </a> 359 </a>
349 </div> 360 </div>
350 </div> 361 </div>
351 @php $i++ @endphp 362 @php $i++ @endphp
352 @endforeach 363 @endforeach
353 @else 364 @else
354 <div style="margin-bottom: 20px" class="cabinet__body-item"> 365 <div style="margin-bottom: 20px" class="cabinet__body-item">
355 <h3 class="cabinet__subtitle">Сертификаты / документы</h3> 366 <h3 class="cabinet__subtitle">Сертификаты / документы</h3>
356 Нет сертификатов 367 Нет сертификатов
357 </div> 368 </div>
358 @endif 369 @endif
359 </div> 370 </div>
360 371
361 <div class="cabinet__body-item"> 372 <div class="cabinet__body-item">
362 <h4 class="cabinet__h4">Добавить сертификат</h4> 373 <h4 class="cabinet__h4">Добавить сертификат</h4>
363 <div class="cabinet__inputs"> 374 <div class="cabinet__inputs">
364 <input type="hidden" name="new_id" id="new_id" class="input" value="{{ $Worker[0]->id }}"> 375 <input type="hidden" name="new_id" id="new_id" class="input" value="{{ $Worker[0]->id }}">
365 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 376 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
366 <label class="form-group__label">Название сертификата</label> 377 <label class="form-group__label">Название сертификата</label>
367 <div class="form-group__item"> 378 <div class="form-group__item">
368 <input type="text" name="new_diplom" id="new_diplom" class="input" value="Диплом о дополнительном образовании"> 379 <input type="text" name="new_diplom" id="new_diplom" class="input" value="Диплом о дополнительном образовании">
369 </div> 380 </div>
370 </div> 381 </div>
371 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 382 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
372 <label class="form-group__label">Дата поступления</label> 383 <label class="form-group__label">Дата поступления</label>
373 <div class="form-group__item"> 384 <div class="form-group__item">
374 <input type="text" name="new_data_begin" id="new_data_begin" class="input" value="01.09.23"> 385 <input type="text" name="new_data_begin" id="new_data_begin" class="input" value="01.09.23">
375 </div> 386 </div>
376 </div> 387 </div>
377 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 388 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
378 <label class="form-group__label">Дата окончания</label> 389 <label class="form-group__label">Дата окончания</label>
379 <div class="form-group__item"> 390 <div class="form-group__item">
380 <input type="text" name="new_data_end" id="new_data_end" class="input" value="04.11.26"> 391 <input type="text" name="new_data_end" id="new_data_end" class="input" value="04.11.26">
381 </div> 392 </div>
382 </div> 393 </div>
383 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 394 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
384 <label class="form-group__label">Дата окончания</label> 395 <label class="form-group__label">Дата окончания</label>
385 <div class="form-group__item"> 396 <div class="form-group__item">
386 <input type="text" name="education" id="education" class="input" value="Учебное заведение"> 397 <input type="text" name="education" id="education" class="input" value="Учебное заведение">
387 </div> 398 </div>
388 </div> 399 </div>
389 <div class="button button_light" data-val="{{ $Worker[0]->id }}" id="button_new_doc" name="button_new_doc"> 400 <div class="button button_light" data-val="{{ $Worker[0]->id }}" id="button_new_doc" name="button_new_doc">
390 Добавить сертификат 401 Добавить сертификат
391 </div> 402 </div>
392 </div> 403 </div>
393 </div> 404 </div>
394 405
395 <div class="cabinet__body-item" name="ajax_dop_diplomi" id="ajax_dop_diplomi"> 406 <div class="cabinet__body-item" name="ajax_dop_diplomi" id="ajax_dop_diplomi">
396 <h4 class="cabinet__h4">Дополнительная информация</h4> 407 <h4 class="cabinet__h4">Дополнительная информация</h4>
397 <div class="cabinet__inputs" > 408 <div class="cabinet__inputs" >
398 @if (isset($Worker[0]->infobloks)) 409 @if (isset($Worker[0]->infobloks))
399 @if ($Worker[0]->infobloks->count()) 410 @if ($Worker[0]->infobloks->count())
400 @php $i = 1; @endphp 411 @php $i = 1; @endphp
401 @foreach ($Worker[0]->infobloks as $info) 412 @foreach ($Worker[0]->infobloks as $info)
402 <div class="cabinet__inputs-item form-group"> 413 <div class="cabinet__inputs-item form-group">
403 <label class="form-group__label">{{ $info->name }}</label> 414 <label class="form-group__label">{{ $info->name }}</label>
404 <div class="form-group__item"> 415 <div class="form-group__item">
405 <div class="select"> 416 <div class="select">
406 <select class="js-select2 sertificates_js"> 417 <select class="js-select2 sertificates_js">
407 <option value="0">Нет</option> 418 <option value="0">Нет</option>
408 <option value="1" selected>Да</option> 419 <option value="1" selected>Да</option>
409 </select> 420 </select>
410 </div> 421 </div>
411 </div> 422 </div>
412 </div> 423 </div>
413 @php $i++; @endphp 424 @php $i++; @endphp
414 @endforeach 425 @endforeach
415 @endif 426 @endif
416 @endif 427 @endif
417 428
418 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 429 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
419 <label class="form-group__label">Образцы дипломов и документов</label> 430 <label class="form-group__label">Образцы дипломов и документов</label>
420 <div class="form-group__item"> 431 <div class="form-group__item">
421 <div class="select"> 432 <div class="select">
422 <select class="js-select2" id="documents" name="documents"> 433 <select class="js-select2" id="documents" name="documents">
423 @if ($Infoblocks->count()) 434 @if ($Infoblocks->count())
424 @foreach ($Infoblocks as $it) 435 @foreach ($Infoblocks as $it)
425 <option value="{{ $it->id }}">{{ $it->name }}</option> 436 <option value="{{ $it->id }}">{{ $it->name }}</option>
426 @endforeach 437 @endforeach
427 @endif 438 @endif
428 </select> 439 </select>
429 </div> 440 </div>
430 </div> 441 </div>
431 </div> 442 </div>
432 <a href="{{ route('worker.add_diplom', ['worker' => $Worker[0]->id]) }}" name="btn_new_diplom" data-val="{{ $Worker[0]->id }}" id="btn_new_diplom" class="button button_light"> 443 <a href="{{ route('worker.add_diplom', ['worker' => $Worker[0]->id]) }}" name="btn_new_diplom" data-val="{{ $Worker[0]->id }}" id="btn_new_diplom" class="button button_light">
433 Добавить документ 444 Добавить документ
434 </a> 445 </a>
435 </div> 446 </div>
436 </div> 447 </div>
437 <div class="cabinet__body-item"> 448 <div class="cabinet__body-item">
438 <div class="cabinet__works"> 449 <div class="cabinet__works">
439 @if (isset($Worker[0]->place_worker)) 450 @if (isset($Worker[0]->place_worker))
440 @php $i = 1; @endphp 451 @php $i = 1; @endphp
441 @foreach($Worker[0]->place_worker as $company) 452 @foreach($Worker[0]->place_worker as $company)
442 <div class="cabinet__works-item"> 453 <div class="cabinet__works-item">
443 <div class="cabinet__works-spoiler active"> 454 <div class="cabinet__works-spoiler active">
444 <div class="cabinet__works-spoiler-left"> 455 <div class="cabinet__works-spoiler-left">
445 <div class="cabinet__works-spoiler-buttons"> 456 <div class="cabinet__works-spoiler-buttons">
446 <a href="{{ route('worker.delete_document', ['doc' => $company->id]) }}" class="button button_light js-works-remove"> 457 <a href="{{ route('worker.delete_document', ['doc' => $company->id]) }}" class="button button_light js-works-remove">
447 <svg> 458 <svg>
448 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> 459 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use>
449 </svg> 460 </svg>
450 </a> 461 </a>
451 <a href="{{ route('worker.edit_document', ['doc' => $company->id, 'worker' => $Worker[0]->id]) }}" type="button" class="button button_light js-works-edit"> 462 <a href="{{ route('worker.edit_document', ['doc' => $company->id, 'worker' => $Worker[0]->id]) }}" type="button" class="button button_light js-works-edit">
452 <svg> 463 <svg>
453 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> 464 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use>
454 </svg> 465 </svg>
455 </a> 466 </a>
456 </div> 467 </div>
457 <div class="cabinet__works-spoiler-text">Место работы {{ $i }}</div> 468 <div class="cabinet__works-spoiler-text">Место работы {{ $i }}</div>
458 </div> 469 </div>
459 <button type="button" class="cabinet__works-spoiler-right js-parent-toggle"> 470 <button type="button" class="cabinet__works-spoiler-right js-parent-toggle">
460 <svg> 471 <svg>
461 <use xlink:href="{{ asset('images/sprite.svg#arrow-bold') }}"></use> 472 <use xlink:href="{{ asset('images/sprite.svg#arrow-bold') }}"></use>
462 </svg> 473 </svg>
463 </button> 474 </button>
464 </div> 475 </div>
465 <div class="cabinet__works-body"> 476 <div class="cabinet__works-body">
466 <div class="cabinet__inputs"> 477 <div class="cabinet__inputs">
467 <div class="cabinet__inputs-item form-group"> 478 <div class="cabinet__inputs-item form-group">
468 <label class="form-group__label">Должность</label> 479 <label class="form-group__label">Должность</label>
469 <div class="form-group__item"> 480 <div class="form-group__item">
470 <input type="text" class="input" value="{{ $company->job_title }}"> 481 <input type="text" class="input" value="{{ $company->job_title }}">
471 </div> 482 </div>
472 </div> 483 </div>
473 <div class="cabinet__inputs-item form-group"> 484 <div class="cabinet__inputs-item form-group">
474 <label class="form-group__label">Опыт работы в танкерном флоте</label> 485 <label class="form-group__label">Опыт работы в танкерном флоте</label>
475 <div class="form-group__item"> 486 <div class="form-group__item">
476 <input type="text" class="input" value="@if ($company->tanker) Есть @else Нет @endif"> 487 <input type="text" class="input" value="@if ($company->tanker) Есть @else Нет @endif">
477 </div> 488 </div>
478 </div> 489 </div>
479 <div class="cabinet__inputs-item form-group"> 490 <div class="cabinet__inputs-item form-group">
480 <label class="form-group__label">Название теплохода</label> 491 <label class="form-group__label">Название теплохода</label>
481 <div class="form-group__item"> 492 <div class="form-group__item">
482 <input type="text" class="input" value="{{ $company->teplohod }}"> 493 <input type="text" class="input" value="{{ $company->teplohod }}">
483 </div> 494 </div>
484 </div> 495 </div>
485 <div class="cabinet__inputs-item form-group"> 496 <div class="cabinet__inputs-item form-group">
486 <label class="form-group__label">Тип (GWT)</label> 497 <label class="form-group__label">Тип (GWT)</label>
487 <div class="form-group__item"> 498 <div class="form-group__item">
488 <input type="text" class="input" value="{{ $company->GWT }}"> 499 <input type="text" class="input" value="{{ $company->GWT }}">
489 </div> 500 </div>
490 </div> 501 </div>
491 <div class="cabinet__inputs-item form-group"> 502 <div class="cabinet__inputs-item form-group">
492 <label class="form-group__label">ГД (кВТ)</label> 503 <label class="form-group__label">ГД (кВТ)</label>
493 <div class="form-group__item"> 504 <div class="form-group__item">
494 <input type="text" class="input" value="{{ $company->KBT }}"> 505 <input type="text" class="input" value="{{ $company->KBT }}">
495 </div> 506 </div>
496 </div> 507 </div>
497 <div class="cabinet__inputs-item form-group"> 508 <div class="cabinet__inputs-item form-group">
498 <label class="form-group__label">Начало контракта</label> 509 <label class="form-group__label">Начало контракта</label>
499 <div class="form-group__item"> 510 <div class="form-group__item">
500 <input type="text" class="input" value="{{ $company->begin_work }}"> 511 <input type="text" class="input" value="{{ $company->begin_work }}">
501 </div> 512 </div>
502 </div> 513 </div>
503 <div class="cabinet__inputs-item form-group"> 514 <div class="cabinet__inputs-item form-group">
504 <label class="form-group__label">Окончание контракта</label> 515 <label class="form-group__label">Окончание контракта</label>
505 <div class="form-group__item"> 516 <div class="form-group__item">
506 <input type="text" class="input" value="{{ $company->end_work }}"> 517 <input type="text" class="input" value="{{ $company->end_work }}">
507 </div> 518 </div>
508 </div> 519 </div>
509 <div class="cabinet__inputs-item form-group"> 520 <div class="cabinet__inputs-item form-group">
510 <label class="form-group__label">Название компании</label> 521 <label class="form-group__label">Название компании</label>
511 <div class="form-group__item"> 522 <div class="form-group__item">
512 <input type="text" class="input" value="{{ $company->name_company }}"> 523 <input type="text" class="input" value="{{ $company->name_company }}">
513 </div> 524 </div>
514 </div> 525 </div>
515 </div> 526 </div>
516 </div> 527 </div>
517 </div> 528 </div>
518 @php $i++ @endphp 529 @php $i++ @endphp
519 @endforeach 530 @endforeach
520 @endif 531 @endif
521 532
522 <!--<div class="cabinet__works-item"> 533 <!--<div class="cabinet__works-item">
523 <div class="cabinet__works-spoiler"> 534 <div class="cabinet__works-spoiler">
524 <div class="cabinet__works-spoiler-left"> 535 <div class="cabinet__works-spoiler-left">
525 <div class="cabinet__works-spoiler-text">Новая работа</div> 536 <div class="cabinet__works-spoiler-text">Новая работа</div>
526 </div> 537 </div>
527 <button type="button" class="cabinet__works-spoiler-right js-parent-toggle"> 538 <button type="button" class="cabinet__works-spoiler-right js-parent-toggle">
528 <svg> 539 <svg>
529 <use xlink:href="{{ asset('images/sprite.svg#arrow-bold') }}"></use> 540 <use xlink:href="{{ asset('images/sprite.svg#arrow-bold') }}"></use>
530 </svg> 541 </svg>
531 </button> 542 </button>
532 </div> 543 </div>
533 <div class="cabinet__works-body"> 544 <div class="cabinet__works-body">
534 <div class="cabinet__inputs"> 545 <div class="cabinet__inputs">
535 <div class="cabinet__inputs-item form-group"> 546 <div class="cabinet__inputs-item form-group">
536 <label class="form-group__label">Должность</label> 547 <label class="form-group__label">Должность</label>
537 <div class="form-group__item"> 548 <div class="form-group__item">
538 <input type="text" name="new_job_title" id="new_job_title" class="input" value="Не указано"> 549 <input type="text" name="new_job_title" id="new_job_title" class="input" value="Не указано">
539 </div> 550 </div>
540 </div> 551 </div>
541 <div class="cabinet__inputs-item form-group"> 552 <div class="cabinet__inputs-item form-group">
542 <label class="form-group__label">Опыт работы в танкерном флоте</label> 553 <label class="form-group__label">Опыт работы в танкерном флоте</label>
543 <div class="form-group__item"> 554 <div class="form-group__item">
544 <select class="js-select2" name="new_job_title" id="new_job_title"> 555 <select class="js-select2" name="new_job_title" id="new_job_title">
545 <option value="0">Нет</option> 556 <option value="0">Нет</option>
546 <option value="1">Да</option> 557 <option value="1">Да</option>
547 </select> 558 </select>
548 </div> 559 </div>
549 </div> 560 </div>
550 <div class="cabinet__inputs-item form-group"> 561 <div class="cabinet__inputs-item form-group">
551 <label class="form-group__label">Название теплохода</label> 562 <label class="form-group__label">Название теплохода</label>
552 <div class="form-group__item"> 563 <div class="form-group__item">
553 <input type="text" name="new_teplohod" id="new_teplohod" class="input" value="Не указано"> 564 <input type="text" name="new_teplohod" id="new_teplohod" class="input" value="Не указано">
554 </div> 565 </div>
555 </div> 566 </div>
556 <div class="cabinet__inputs-item form-group"> 567 <div class="cabinet__inputs-item form-group">
557 <label class="form-group__label">Тип (GWT)</label> 568 <label class="form-group__label">Тип (GWT)</label>
558 <div class="form-group__item"> 569 <div class="form-group__item">
559 <input type="text" name="new_GWT" id="new_GWT" class="input" value="Не указано"> 570 <input type="text" name="new_GWT" id="new_GWT" class="input" value="Не указано">
560 </div> 571 </div>
561 </div> 572 </div>
562 <div class="cabinet__inputs-item form-group"> 573 <div class="cabinet__inputs-item form-group">
563 <label class="form-group__label">ГД (кВТ)</label> 574 <label class="form-group__label">ГД (кВТ)</label>
564 <div class="form-group__item"> 575 <div class="form-group__item">
565 <input type="text" name="new_KBT" id="new_KBT" class="input" value="Не указано"> 576 <input type="text" name="new_KBT" id="new_KBT" class="input" value="Не указано">
566 </div> 577 </div>
567 </div> 578 </div>
568 <div class="cabinet__inputs-item form-group"> 579 <div class="cabinet__inputs-item form-group">
569 <label class="form-group__label">Начало контракта</label> 580 <label class="form-group__label">Начало контракта</label>
570 <div class="form-group__item"> 581 <div class="form-group__item">
571 <input type="text" name="new_Begin_work" id="new_Begin_work" class="input" value="Не указано"> 582 <input type="text" name="new_Begin_work" id="new_Begin_work" class="input" value="Не указано">
572 </div> 583 </div>
573 </div> 584 </div>
574 <div class="cabinet__inputs-item form-group"> 585 <div class="cabinet__inputs-item form-group">
575 <label class="form-group__label">Окончание контракта</label> 586 <label class="form-group__label">Окончание контракта</label>
576 <div class="form-group__item"> 587 <div class="form-group__item">
577 <input type="text" name="new_End_work" id="new_End_work" class="input" value="Не указано"> 588 <input type="text" name="new_End_work" id="new_End_work" class="input" value="Не указано">
578 </div> 589 </div>
579 </div> 590 </div>
580 <div class="cabinet__inputs-item form-group"> 591 <div class="cabinet__inputs-item form-group">
581 <label class="form-group__label">Название компании</label> 592 <label class="form-group__label">Название компании</label>
582 <div class="form-group__item"> 593 <div class="form-group__item">
583 <input type="text" name="new_name_company" id="new_name_company" class="input" value="Не указано"> 594 <input type="text" name="new_name_company" id="new_name_company" class="input" value="Не указано">
584 </div> 595 </div>
585 </div> 596 </div>
586 </div> 597 </div>
587 </div> 598 </div>
588 </div>--> 599 </div>-->
589 <a href="{{ route('worker.add_document', ['worker' => $Worker[0]->id]) }}" id="new_work" name="new_work" class="button button_light cabinet__works-add">Новое место работы</a> 600 <a href="{{ route('worker.add_document', ['worker' => $Worker[0]->id]) }}" id="new_work" name="new_work" class="button button_light cabinet__works-add">Новое место работы</a>
590 </div> 601 </div>
591 </div> 602 </div>
592 603
593 <div class="cabinet__body-item"> 604 <div class="cabinet__body-item">
594 <h4 class="cabinet__h4">О себе</h4> 605 <h4 class="cabinet__h4">О себе</h4>
595 <textarea class="textarea" name="text" id="text" placeholder="Не указано">{{ $Worker[0]->text }}</textarea> 606 <textarea class="textarea" name="text" id="text" placeholder="Не указано">{{ $Worker[0]->text }}</textarea>
596 <div class="cabinet__buttons"> 607 <div class="cabinet__buttons">
597 <button type="submit" class="button">Сохранить</button> 608 <button type="submit" class="button">Сохранить</button>
598 <label class="file"> 609 <label class="file">
599 <span class="file__input"> 610 <span class="file__input">
600 <input type="file" name="file" id="file"> 611 <input type="file" name="file" id="file">
601 <span class="button button_light">@if (empty($Worker[0]->file)) Прикрепить резюме @else {{ $Worker[0]->file }}@endif</span> 612 <span class="button button_light">@if (empty($Worker[0]->file)) Прикрепить резюме @else {{ $Worker[0]->file }}@endif</span>
602 </span> 613 </span>
603 </label> 614 </label>
604 </div> 615 </div>
605 </div> 616 </div>
606 </form> 617 </form>
607 </div> 618 </div>
608 </div> 619 </div>
609 </section> 620 </section>
610 </div> 621 </div>
611 <div> 622 <div>
612 @endsection 623 @endsection
613 624
resources/views/workers/favorite.blade.php
1 @extends('layout.frontend', ['title' => 'Избранные - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Избранные - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 @include('js.favorite-vacancy') 4 @include('js.favorite-vacancy-45')
5 @endsection 5 @endsection
6 6
7 @section('content') 7 @section('content')
8 <section class="cabinet"> 8 <section class="cabinet">
9 <div class="container"> 9 <div class="container">
10 <ul class="breadcrumbs cabinet__breadcrumbs"> 10 <ul class="breadcrumbs cabinet__breadcrumbs">
11 <li><a href="{{ route('index') }}">Главная</a></li> 11 <li><a href="{{ route('index') }}">Главная</a></li>
12 <li><b>Личный кабинет</b></li> 12 <li><b>Личный кабинет</b></li>
13 </ul> 13 </ul>
14 <div class="cabinet__wrapper"> 14 <div class="cabinet__wrapper">
15 <div class="cabinet__side"> 15 <div class="cabinet__side">
16 <div class="cabinet__side-toper"> 16 <div class="cabinet__side-toper">
17 @include('workers.emblema') 17 @include('workers.emblema')
18 18
19 </div> 19 </div>
20 @include('workers.menu', ['item' => 3]) 20 @include('workers.menu', ['item' => 3])
21 </div> 21 </div>
22 22
23 <div class="cabinet__body"> 23 <div class="cabinet__body">
24 <div class="cabinet__body-item"> 24 <div class="cabinet__body-item">
25 <h2 class="title cabinet__title">Избранные вакансии</h2> 25 <h2 class="title cabinet__title">Избранные вакансии</h2>
26 </div> 26 </div>
27 <div class="cabinet__body-item"> 27 <div class="cabinet__body-item">
28 <div class="cabinet__filters"> 28 <div class="cabinet__filters">
29 <div class="cabinet__filters-item"> 29 <div class="cabinet__filters-item">
30 <form class="search" action="{{ route('worker.colorado') }}" method="GET"> 30 <form class="search" action="{{ route('worker.colorado') }}" method="GET">
31 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;"> 31 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;">
32 <button type="submit" class="button">Найти</button> 32 <button type="submit" class="button">Найти</button>
33 <span> 33 <span>
34 <svg> 34 <svg>
35 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 35 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
36 </svg> 36 </svg>
37 </span> 37 </span>
38 </form> 38 </form>
39 </div> 39 </div>
40 <div class="cabinet__filters-item"> 40 <!--<div class="cabinet__filters-item">
41 <div class="select"> 41 <div class="select">
42 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 42 <select class="js-select2" id="sort_ajax" name="sort_ajax">
43 <option value="default">Сортировка (по умолчанию)</option> 43 <option value="default">Сортировка (по умолчанию)</option>
44 <option value="name (asc)">По имени (возрастание)</option> 44 <option value="name (asc)">По имени (возрастание)</option>
45 <option value="name (desc)">По имени (убывание)</option> 45 <option value="name (desc)">По имени (убывание)</option>
46 <option value="created_at (asc)">По дате (возрастание)</option> 46 <option value="created_at (asc)">По дате (возрастание)</option>
47 <option value="created_at (desc)">По дате (убывание)</option> 47 <option value="created_at (desc)">По дате (убывание)</option>
48 </select> 48 </select>
49 </div> 49 </div>
50 </div> 50 </div>-->
51 </div> 51 </div>
52 @if ($Query->count()) 52 @if ($Query->count())
53 <div class="cabinet__vacs"> 53 <div class="cabinet__vacs">
54 <div id="main_ockar" name="main_ockar" class="cabinet__vacs-body" style="width:100%;"> 54 <div id="main_ockar" name="main_ockar" class="cabinet__vacs-body" style="width:100%;">
55 @foreach ($Query as $Q) 55 @foreach ($Query as $Q)
56 <div class="main__vacancies-item main__employer-page-two-item"> 56 <div class="main__vacancies-item main__employer-page-two-item">
57 <a href="{{ route('list-vacancies') }}" class="back main__employer-page-two-item-back"> 57 <a href="{{ route('list-vacancies') }}" class="back main__employer-page-two-item-back">
58 <svg> 58 <svg>
59 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 59 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
60 </svg> 60 </svg>
61 <span> 61 <span>
62 Вернуться к списку вакансий 62 Вернуться к списку вакансий
63 </span> 63 </span>
64 </a> 64 </a>
65 <div class="main__employer-page-two-item-toper"> 65 <div class="main__employer-page-two-item-toper">
66 @if (!empty($Q->employer->logo)) 66 @if (!empty($Q->employer->logo))
67 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}"> 67 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}">
68 @else 68 @else
69 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Q->employer->name }}" class="main__vacancies-thing-pic"> 69 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Q->employer->name }}" class="main__vacancies-thing-pic">
70 @endif 70 @endif
71 <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span> 71 <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span>
72 </div> 72 </div>
73 <div class="main__employer-page-two-item-text"> 73 <div class="main__employer-page-two-item-text">
74 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор 74 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор
75 специалистов на следующие должности:</div> 75 специалистов на следующие должности:</div>
76 <div class="main__employer-page-two-item-text-links"> 76 <div class="main__employer-page-two-item-text-links">
77 @if (isset($Q->jobs)) 77 @if (isset($Q->jobs))
78 @foreach ($Q->jobs as $key => $j) 78 @foreach ($Q->jobs as $key => $j)
79 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a> 79 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a>
80 @endforeach 80 @endforeach
81 @endif 81 @endif
82 </div> 82 </div>
83 </div> 83 </div>
84 <div class="main__employer-page-two-item-text"> 84 <div class="main__employer-page-two-item-text">
85 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 85 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
86 <div class="main__employer-page-two-item-text-body"> 86 <div class="main__employer-page-two-item-text-body">
87 {!! $Q->text !!} 87 {!! $Q->text !!}
88 </div> 88 </div>
89 </div> 89 </div>
90 <div class="main__employer-page-two-item-text"> 90 <div class="main__employer-page-two-item-text">
91 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div> 91 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div>
92 <div class="main__employer-page-two-item-text-body"> 92 <div class="main__employer-page-two-item-text-body">
93 {!! $Q->description !!} 93 {!! $Q->description !!}
94 </div> 94 </div>
95 </div> 95 </div>
96 <div class="main__employer-page-two-item-text"> 96 <div class="main__employer-page-two-item-text">
97 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div> 97 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div>
98 <div class="main__employer-page-two-item-text-body"> 98 <div class="main__employer-page-two-item-text-body">
99 {!! $Q->contacts_emails !!} 99 {!! $Q->contacts_emails !!}
100 </div> 100 </div>
101 </div> 101 </div>
102 <div class="main__employer-page-two-item-text"> 102 <div class="main__employer-page-two-item-text">
103 <div class="main__employer-page-two-item-text-name">Или звоните:</div> 103 <div class="main__employer-page-two-item-text-name">Или звоните:</div>
104 <div class="main__employer-page-two-item-text-body"> 104 <div class="main__employer-page-two-item-text-body">
105 {!! $Q->contacts_telephones !!} 105 {!! $Q->contacts_telephones !!}
106 </div> 106 </div>
107 </div> 107 </div>
108 <div class="main__employer-page-two-item-tags"> 108 <div class="main__employer-page-two-item-tags">
109 @if (isset($Q->jobs)) 109 @if (isset($Q->jobs))
110 @foreach ($Q->jobs as $key => $j) 110 @foreach ($Q->jobs as $key => $j)
111 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span> 111 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span>
112 @endforeach 112 @endforeach
113 @endif 113 @endif
114 </div> 114 </div>
115 <div class="main__employer-page-two-item-buttons"> 115 <div class="main__employer-page-two-item-buttons">
116 <button type="button" 116 <button type="button"
117 class="button main__employer-page-two-item-button">Откликнуться</button> 117 class="button main__employer-page-two-item-button">Откликнуться</button>
118 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a> 118 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a>
119 </div> 119 </div>
120 <div class="main__employer-page-two-item-bottom"> 120 <div class="main__employer-page-two-item-bottom">
121 <div class="main__employer-page-two-item-bottom-date">{{ $Q->created_at }}</div> 121 <div class="main__employer-page-two-item-bottom-date">{{ $Q->created_at }}</div>
122 <button type="button" class="like main__employer-page-two-item-bottom-like js-toggle js_vacancy_favorites <?=App\Classes\Cookies_vacancy::selected_vacancy($Q->id);?>"> 122 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}?>">
123 <svg> 123 <svg>
124 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 124 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
125 </svg> 125 </svg>
126 </button> 126 </button>
127 </div> 127 </div>
128 </div> 128 </div>
129 @endforeach 129 @endforeach
130 <div style="margin-top: 20px"> 130 <div style="margin-top: 20px">
131 {{ $Query->appends($_GET)->links('paginate') }} 131 {{ $Query->appends($_GET)->links('paginate') }}
132 </div> 132 </div>
133 </div> 133 </div>
134 @else 134 @else
135 <div class="notify"> 135 <div class="notify">
136 <svg> 136 <svg>
137 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> 137 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use>
138 </svg> 138 </svg>
139 <span>Нет избранных работодателей</span> 139 <span>Нет избранных работодателей</span>
140 </div> 140 </div>
141 @endif 141 @endif
142 </div> 142 </div>
143 </div> 143 </div>
144 </div> 144 </div>
145 </div> 145 </div>
146 </section> 146 </section>
147 </div> 147 </div>
148 148
149 @endsection 149 @endsection
150 150
1 <?php 1 <?php
2 2
3 use App\Http\Controllers\AdEmployerController; 3 use App\Http\Controllers\AdEmployerController;
4 use App\Http\Controllers\Admin\AdminController; 4 use App\Http\Controllers\Admin\AdminController;
5 use App\Http\Controllers\Admin\CategoryController; 5 use App\Http\Controllers\Admin\CategoryController;
6 use App\Http\Controllers\Admin\CategoryEmpController; 6 use App\Http\Controllers\Admin\CategoryEmpController;
7 use App\Http\Controllers\Admin\EducationController; 7 use App\Http\Controllers\Admin\EducationController;
8 use App\Http\Controllers\Admin\EmployersController; 8 use App\Http\Controllers\Admin\EmployersController;
9 use App\Http\Controllers\EmployerController as FrontEmployersController; 9 use App\Http\Controllers\EmployerController as FrontEmployersController;
10 use App\Http\Controllers\Admin\InfoBloksController; 10 use App\Http\Controllers\Admin\InfoBloksController;
11 use App\Http\Controllers\Admin\JobTitlesController; 11 use App\Http\Controllers\Admin\JobTitlesController;
12 use App\Http\Controllers\Admin\UsersController; 12 use App\Http\Controllers\Admin\UsersController;
13 use App\Http\Controllers\Admin\WorkersController; 13 use App\Http\Controllers\Admin\WorkersController;
14 use App\Http\Controllers\Auth\ForgotPasswordController; 14 use App\Http\Controllers\Auth\ForgotPasswordController;
15 use App\Http\Controllers\Auth\LoginController; 15 use App\Http\Controllers\Auth\LoginController;
16 use App\Http\Controllers\Auth\RegisterController; 16 use App\Http\Controllers\Auth\RegisterController;
17 use App\Http\Controllers\CKEditorController; 17 use App\Http\Controllers\CKEditorController;
18 use App\Http\Controllers\MediaController; 18 use App\Http\Controllers\MediaController;
19 use App\Http\Controllers\WorkerController; 19 use App\Http\Controllers\WorkerController;
20 use App\Models\User; 20 use App\Models\User;
21 use App\Http\Controllers\MainController; 21 use App\Http\Controllers\MainController;
22 use App\Http\Controllers\HomeController; 22 use App\Http\Controllers\HomeController;
23 use Illuminate\Support\Facades\Route; 23 use Illuminate\Support\Facades\Route;
24 use App\Http\Controllers\Admin\CompanyController; 24 use App\Http\Controllers\Admin\CompanyController;
25 use App\Http\Controllers\Admin\Ad_EmployersController; 25 use App\Http\Controllers\Admin\Ad_EmployersController;
26 use App\Http\Controllers\Admin\MsgAnswersController; 26 use App\Http\Controllers\Admin\MsgAnswersController;
27 use App\Http\Controllers\Admin\GroupsController; 27 use App\Http\Controllers\Admin\GroupsController;
28 use App\Http\Controllers\PagesController; 28 use App\Http\Controllers\PagesController;
29 use Illuminate\Support\Facades\Storage; 29 use Illuminate\Support\Facades\Storage;
30 use App\Http\Controllers\EmployerController; 30 use App\Http\Controllers\EmployerController;
31 use App\Http\Controllers\CompanyController as FrontCompanyController; 31 use App\Http\Controllers\CompanyController as FrontCompanyController;
32 32
33 33
34 /* 34 /*
35 |-------------------------------------------------------------------------- 35 |--------------------------------------------------------------------------
36 | Web Routes 36 | Web Routes
37 |-------------------------------------------------------------------------- 37 |--------------------------------------------------------------------------
38 | 38 |
39 | Here is where you can register web routes for your application. These 39 | Here is where you can register web routes for your application. These
40 | routes are loaded by the RouteServiceProvider within a group which 40 | routes are loaded by the RouteServiceProvider within a group which
41 | contains the "web" middleware group. Now create something great! 41 | contains the "web" middleware group. Now create something great!
42 | 42 |
43 */ 43 */
44 /* 44 /*
45 Route::get('/', function () { 45 Route::get('/', function () {
46 return view('welcome'); 46 return view('welcome');
47 })->name('index'); 47 })->name('index');
48 */ 48 */
49 49
50 Route::get('/', [MainController::class, 'index'])->name('index'); 50 Route::get('/', [MainController::class, 'index'])->name('index');
51 51
52 //Роуты авторизации, регистрации, восстановления, аутентификации 52 //Роуты авторизации, регистрации, восстановления, аутентификации
53 Auth::routes(['verify' => true]); 53 Auth::routes(['verify' => true]);
54 54
55 // роуты регистрации, авторизации, восстановления пароля, верификации почты 55 // роуты регистрации, авторизации, восстановления пароля, верификации почты
56 /*Route::group([ 56 /*Route::group([
57 'as' => 'auth.', //имя маршрута, например auth.index 57 'as' => 'auth.', //имя маршрута, например auth.index
58 'prefix' => 'auth', // префикс маршрута, например, auth/index 58 'prefix' => 'auth', // префикс маршрута, например, auth/index
59 ], function () { 59 ], function () {
60 //форма регистрации 60 //форма регистрации
61 Route::get('register', [RegisterController::class, 'register'])->name('register'); 61 Route::get('register', [RegisterController::class, 'register'])->name('register');
62 62
63 //создание пользователя 63 //создание пользователя
64 Route::post('register', [RegisterController::class, 'create'])->name('create'); 64 Route::post('register', [RegisterController::class, 'create'])->name('create');
65 65
66 //форма входа авторизации 66 //форма входа авторизации
67 Route::get('login', [LoginController::class, 'login'])->name('login'); 67 Route::get('login', [LoginController::class, 'login'])->name('login');
68 68
69 //аутентификация 69 //аутентификация
70 Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); 70 Route::post('login', [LoginController::class, 'authenticate'])->name('auth');
71 71
72 //выход 72 //выход
73 Route::get('logout', [LoginController::class, 'logout'])->name('logout'); 73 Route::get('logout', [LoginController::class, 'logout'])->name('logout');
74 74
75 //форма ввода адреса почты 75 //форма ввода адреса почты
76 Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); 76 Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form');
77 77
78 //письмо на почту 78 //письмо на почту
79 Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); 79 Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail');
80 80
81 //форма восстановления пароля 81 //форма восстановления пароля
82 Route::get('reset-password/token/{token}/email/{email}', 82 Route::get('reset-password/token/{token}/email/{email}',
83 [ResetPasswordController::class, 'form'] 83 [ResetPasswordController::class, 'form']
84 )->name('reset-form'); 84 )->name('reset-form');
85 85
86 //восстановление пароля 86 //восстановление пароля
87 Route::post('reset-password', 87 Route::post('reset-password',
88 [ResetPasswordController::class, 'reset'] 88 [ResetPasswordController::class, 'reset']
89 )->name('reset-password'); 89 )->name('reset-password');
90 90
91 //сообщение о необходимости проверки адреса почты 91 //сообщение о необходимости проверки адреса почты
92 Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); 92 Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message');
93 93
94 //подтверждение адреса почты нового пользователя 94 //подтверждение адреса почты нового пользователя
95 Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) 95 Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify'])
96 ->where('token', '[a-f0-9]{32}') 96 ->where('token', '[a-f0-9]{32}')
97 ->where('id', '[0-9]+') 97 ->where('id', '[0-9]+')
98 ->name('verify-email'); 98 ->name('verify-email');
99 });*/ 99 });*/
100 100
101 //Личный кабинет пользователя 101 //Личный кабинет пользователя
102 Route::get('/home', [HomeController::class, 'index'])->name('home'); 102 Route::get('/home', [HomeController::class, 'index'])->name('home');
103 103
104 /* 104 /*
105 Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { 105 Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) {
106 $user = User::where('email',$request->input('email'))->first(); 106 $user = User::where('email',$request->input('email'))->first();
107 107
108 $user->sendEmailVerificationNotification(); 108 $user->sendEmailVerificationNotification();
109 109
110 return 'your response'; 110 return 'your response';
111 })->middleware('throttle:6,1')->name('verification.resend'); 111 })->middleware('throttle:6,1')->name('verification.resend');
112 */ 112 */
113 113
114 // Авторизация, регистрация в админку 114 // Авторизация, регистрация в админку
115 Route::group([ 115 Route::group([
116 'as' => 'admin.', // имя маршрута, например auth.index 116 'as' => 'admin.', // имя маршрута, например auth.index
117 'prefix' => 'admin', // префикс маршрута, например auth/index 117 'prefix' => 'admin', // префикс маршрута, например auth/index
118 'middleware' => ['guest'], 118 'middleware' => ['guest'],
119 ], function () { 119 ], function () {
120 // Форма регистрации 120 // Форма регистрации
121 Route::get('register', [AdminController::class, 'register'])->name('register'); 121 Route::get('register', [AdminController::class, 'register'])->name('register');
122 // Создание пользователя 122 // Создание пользователя
123 Route::post('register', [AdminController::class, 'create'])->name('create'); 123 Route::post('register', [AdminController::class, 'create'])->name('create');
124 124
125 //Форма входа 125 //Форма входа
126 Route::get('login', [AdminController::class, 'login'])->name('login'); 126 Route::get('login', [AdminController::class, 'login'])->name('login');
127 127
128 // аутентификация 128 // аутентификация
129 Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); 129 Route::post('login', [AdminController::class, 'autenticate'])->name('auth');
130 130
131 }); 131 });
132 132
133 // Личный кабинет админки 133 // Личный кабинет админки
134 Route::group([ 134 Route::group([
135 'as' => 'admin.', // имя маршрута, например auth.index 135 'as' => 'admin.', // имя маршрута, например auth.index
136 'prefix' => 'admin', // префикс маршрута, например auth/index 136 'prefix' => 'admin', // префикс маршрута, например auth/index
137 'middleware' => ['auth'], ['admin'], 137 'middleware' => ['auth'], ['admin'],
138 ], function() { 138 ], function() {
139 139
140 // выход 140 // выход
141 Route::get('logout', [AdminController::class, 'logout'])->name('logout'); 141 Route::get('logout', [AdminController::class, 'logout'])->name('logout');
142 142
143 // кабинет главная страница 143 // кабинет главная страница
144 Route::get('cabinet', [AdminController::class, 'index'])->name('index'); 144 Route::get('cabinet', [AdminController::class, 'index'])->name('index');
145 145
146 // кабинет профиль админа - форма 146 // кабинет профиль админа - форма
147 Route::get('profile', [AdminController::class, 'profile'])->name('profile'); 147 Route::get('profile', [AdminController::class, 'profile'])->name('profile');
148 // кабинет профиль админа - сохранение формы 148 // кабинет профиль админа - сохранение формы
149 Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); 149 Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile');
150 150
151 //кабинет сообщения админа 151 //кабинет сообщения админа
152 //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); 152 //Route::get('messages', [AdminController::class, 'profile'])->name('profile');
153 153
154 154
155 // кабинет профиль - форма пароли 155 // кабинет профиль - форма пароли
156 Route::get('password', [AdminController::class, 'profile_password'])->name('password'); 156 Route::get('password', [AdminController::class, 'profile_password'])->name('password');
157 // кабинет профиль - сохранение формы пароля 157 // кабинет профиль - сохранение формы пароля
158 Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); 158 Route::post('password', [AdminController::class, 'profile_password_new'])->name('password');
159 159
160 160
161 // кабинет профиль пользователя - форма 161 // кабинет профиль пользователя - форма
162 Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); 162 Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile');
163 // кабинет профиль пользователя - сохранение формы 163 // кабинет профиль пользователя - сохранение формы
164 Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); 164 Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile');
165 165
166 // кабинет профиль работодатель - форма 166 // кабинет профиль работодатель - форма
167 Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); 167 Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile');
168 // кабинет профиль работодатель - сохранение формы 168 // кабинет профиль работодатель - сохранение формы
169 Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); 169 Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile');
170 // кабинет удаление профиль работодателя и юзера 170 // кабинет удаление профиль работодателя и юзера
171 Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); 171 Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer');
172 172
173 // кабинет профиль работник - форма 173 // кабинет профиль работник - форма
174 Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); 174 Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add');
175 Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); 175 Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store');
176 Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); 176 Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit');
177 // кабинет профиль работник - сохранение формы 177 // кабинет профиль работник - сохранение формы
178 Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); 178 Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update');
179 179
180 // Медиа 180 // Медиа
181 Route::get('media', [MediaController::class, 'index'])->name('media'); 181 Route::get('media', [MediaController::class, 'index'])->name('media');
182 Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media'); 182 Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media');
183 183
184 // кабинет настройки сайта - форма 184 // кабинет настройки сайта - форма
185 Route::get('config', [AdminController::class, 'config_form'])->name('config'); 185 Route::get('config', [AdminController::class, 'config_form'])->name('config');
186 // кабинет настройки сайта сохранение формы 186 // кабинет настройки сайта сохранение формы
187 Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); 187 Route::post('config', [AdminController::class, 'store_config'])->name('store_config');
188 188
189 // кабинет - пользователи 189 // кабинет - пользователи
190 Route::get('users', [UsersController::class, 'index'])->name('users'); 190 Route::get('users', [UsersController::class, 'index'])->name('users');
191 191
192 // кабинет - пользователи 192 // кабинет - пользователи
193 Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); 193 Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users');
194 194
195 // кабинет - работодатели 195 // кабинет - работодатели
196 Route::get('employers', [EmployersController::class, 'index'])->name('employers'); 196 Route::get('employers', [EmployersController::class, 'index'])->name('employers');
197 197
198 Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); 198 Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer');
199 199
200 Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add'); 200 Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add');
201 Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save'); 201 Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save');
202 Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot'); 202 Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot');
203 Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit'); 203 Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit');
204 Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete'); 204 Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete');
205 205
206 // кабинет - соискатели 206 // кабинет - соискатели
207 Route::get('workers', [WorkersController::class, 'index'])->name('workers'); 207 Route::get('workers', [WorkersController::class, 'index'])->name('workers');
208 208
209 // кабинет - база данных 209 // кабинет - база данных
210 Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); 210 Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata');
211 Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); 211 Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata');
212 Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); 212 Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata');
213 Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); 213 Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata');
214 Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); 214 Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata');
215 Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); 215 Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata');
216 Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); 216 Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata');
217 217
218 // кабинет - вакансии 218 // кабинет - вакансии
219 Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); 219 Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers');
220 Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers'); 220 Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers');
221 Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers'); 221 Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers');
222 Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); 222 Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers');
223 Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); 223 Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers');
224 Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer'); 224 Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer');
225 225
226 // Редактирование должности в вакансии 226 // Редактирование должности в вакансии
227 Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs'); 227 Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs');
228 Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs'); 228 Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs');
229 229
230 230
231 // кабинет - категории 231 // кабинет - категории
232 //Route::get('categories', [AdminController::class, 'index'])->name('categories'); 232 //Route::get('categories', [AdminController::class, 'index'])->name('categories');
233 /* 233 /*
234 * CRUD-операции над Справочником Категории 234 * CRUD-операции над Справочником Категории
235 */ 235 */
236 Route::resource('categories', CategoryController::class, ['except' => ['show']]); 236 Route::resource('categories', CategoryController::class, ['except' => ['show']]);
237 237
238 // CRUD-операции над справочником Категории для работодателей 238 // CRUD-операции над справочником Категории для работодателей
239 Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); 239 Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]);
240 240
241 // CRUD-операции над справочником Образование 241 // CRUD-операции над справочником Образование
242 Route::resource('education', EducationController::class, ['except' => ['show']]); 242 Route::resource('education', EducationController::class, ['except' => ['show']]);
243 243
244 Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education'); 244 Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education');
245 Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); 245 Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education');
246 Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); 246 Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education');
247 247
248 Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); 248 Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education');
249 Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education'); 249 Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education');
250 250
251 Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); 251 Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education');
252 252
253 //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); 253 //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles');
254 /* 254 /*
255 * кабинет - CRUD-операции по справочнику должности 255 * кабинет - CRUD-операции по справочнику должности
256 * 256 *
257 */ 257 */
258 Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); 258 Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]);
259 259
260 // кабинет - сообщения (чтение чужих) 260 // кабинет - сообщения (чтение чужих)
261 Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); 261 Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages');
262 // кабинет - просмотр сообщения чужого (чтение) 262 // кабинет - просмотр сообщения чужого (чтение)
263 Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); 263 Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message');
264 264
265 // кабинет - сообщения (админские) 265 // кабинет - сообщения (админские)
266 Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); 266 Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages');
267 // кабинет - сообщения (админские) 267 // кабинет - сообщения (админские)
268 Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); 268 Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post');
269 // кабинет - sql - конструкция запросов 269 // кабинет - sql - конструкция запросов
270 Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); 270 Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql');
271 271
272 /* 272 /*
273 * Расписанный подход в описании каждой директорий групп пользователей. 273 * Расписанный подход в описании каждой директорий групп пользователей.
274 */ 274 */
275 // кабинет - группы пользователей 275 // кабинет - группы пользователей
276 Route::get('groups', [GroupsController::class, 'index'])->name('groups'); 276 Route::get('groups', [GroupsController::class, 'index'])->name('groups');
277 // кабинет - добавление форма группы пользователей 277 // кабинет - добавление форма группы пользователей
278 Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); 278 Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group');
279 // кабинет - сохранение формы группы пользователей 279 // кабинет - сохранение формы группы пользователей
280 Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); 280 Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store');
281 // кабинет - редактирование форма группы пользователей 281 // кабинет - редактирование форма группы пользователей
282 Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); 282 Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group');
283 // кабинет - сохранение редактированной формы группы пользователей 283 // кабинет - сохранение редактированной формы группы пользователей
284 Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); 284 Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group');
285 // кабинет - удаление группы пользователей 285 // кабинет - удаление группы пользователей
286 Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); 286 Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group');
287 287
288 288
289 // кабинет - список админов 289 // кабинет - список админов
290 Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); 290 Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin');
291 291
292 292
293 /////редактор////// кабинет - редактор сайта//////////////////////// 293 /////редактор////// кабинет - редактор сайта////////////////////////
294 Route::get('editor-site', function() { 294 Route::get('editor-site', function() {
295 return view('admin.editor.index'); 295 return view('admin.editor.index');
296 })->name('editor-site'); 296 })->name('editor-site');
297 297
298 298
299 // кабинет - редактор шапки-футера сайта 299 // кабинет - редактор шапки-футера сайта
300 Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); 300 Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks');
301 Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); 301 Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block');
302 Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); 302 Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store');
303 Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); 303 Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block');
304 Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); 304 Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block');
305 Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); 305 Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block');
306 Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); 306 Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block');
307 307
308 308
309 // кабинет - редактор должности на главной 309 // кабинет - редактор должности на главной
310 Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); 310 Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main');
311 311
312 // кабинет - редактор работодатели на главной 312 // кабинет - редактор работодатели на главной
313 Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); 313 Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main');
314 314
315 315
316 // кабинет - редактор seo-сайта 316 // кабинет - редактор seo-сайта
317 Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); 317 Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo');
318 Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); 318 Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo');
319 Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); 319 Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store');
320 Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); 320 Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo');
321 Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); 321 Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo');
322 Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); 322 Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo');
323 Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); 323 Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo');
324 324
325 325
326 // кабинет - редактор страниц 326 // кабинет - редактор страниц
327 Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); 327 Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages');
328 // кабинет - добавление страницы 328 // кабинет - добавление страницы
329 Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); 329 Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page');
330 // кабинет - сохранение формы страницы 330 // кабинет - сохранение формы страницы
331 Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); 331 Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store');
332 // кабинет - редактирование форма страницы 332 // кабинет - редактирование форма страницы
333 Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); 333 Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page');
334 // кабинет - сохранение редактированной формы страницы 334 // кабинет - сохранение редактированной формы страницы
335 Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); 335 Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page');
336 // кабинет - удаление страницы 336 // кабинет - удаление страницы
337 Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); 337 Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page');
338 338
339 339
340 // кабинет - реклама сайта 340 // кабинет - реклама сайта
341 Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); 341 Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames');
342 Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); 342 Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames');
343 Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); 343 Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store');
344 Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); 344 Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames');
345 Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); 345 Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames');
346 Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); 346 Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames');
347 //////////////////////////////////////////////////////////////////////// 347 ////////////////////////////////////////////////////////////////////////
348 348
349 349
350 // кабинет - отзывы о работодателе для модерации 350 // кабинет - отзывы о работодателе для модерации
351 Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); 351 Route::get('answers', [EmployersController::class, 'answers'])->name('answers');
352 352
353 // Общая страница статистики 353 // Общая страница статистики
354 Route::get('statics', function () { 354 Route::get('statics', function () {
355 return view('admin.static.index'); 355 return view('admin.static.index');
356 })->name('statics'); 356 })->name('statics');
357 357
358 // кабинет - статистика работников 358 // кабинет - статистика работников
359 Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); 359 Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers');
360 360
361 // кабинет - статистика вакансий работодателя 361 // кабинет - статистика вакансий работодателя
362 Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); 362 Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads');
363 363
364 // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника 364 // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника
365 /* 365 /*
366 * CRUD-операции над справочником дипломы и документы 366 * CRUD-операции над справочником дипломы и документы
367 */ 367 */
368 //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); 368 //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks');
369 Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); 369 Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]);
370 370
371 // кабинет - роли пользователя 371 // кабинет - роли пользователя
372 Route::get('roles', [UsersController::class, 'roles'])->name('roles'); 372 Route::get('roles', [UsersController::class, 'roles'])->name('roles');
373 373
374 Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles'); 374 Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles');
375 375
376 Route::get('logs', function() { 376 Route::get('logs', function() {
377 $files = Storage::files('logs/laravel.log'); 377 $files = Storage::files('logs/laravel.log');
378 })->name('logs'); 378 })->name('logs');
379 }); 379 });
380 380
381 // Инструментальные страницы 381 // Инструментальные страницы
382 Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); 382 Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload');
383 383
384 Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); 384 Route::get('redis/', [PagesController::class, 'redis'])->name('redis');
385 385
386 Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); 386 Route::get('excel/', [PagesController::class, 'excel'])->name('excel');
387 387
388 // Страницы с произвольным контентом 388 // Страницы с произвольным контентом
389 Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); 389 Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page');
390 390
391 // Публичные страницы соискателя 391 // Публичные страницы соискателя
392 Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); 392 Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page');
393 393
394 //Страница вакансии 394 //Страница вакансии
395 Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); 395 Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer');
396 396
397 //Вакансии 397 //Вакансии
398 Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies'); 398 Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies');
399 399
400 //Вакансии поиск на главной 400 //Вакансии поиск на главной
401 Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies'); 401 Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies');
402 402
403 //Вакансии категория детальная 403 //Вакансии категория детальная
404 Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies'); 404 Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies');
405 405
406 // Лайк вакансии
407 Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy');
408
406 //Детальная страница вакансии - работодателя 409 //Детальная страница вакансии - работодателя
407 Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie'); 410 Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie');
408 411
409 //Судоходные компании 412 //Судоходные компании
410 Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies'); 413 Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies');
411 414
412 //Детальная инфа о компании 415 //Детальная инфа о компании
413 Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company'); 416 Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company');
414 417
415 //Образование 418 //Образование
416 Route::get('education', [MainController::class, 'education'])->name('education'); 419 Route::get('education', [MainController::class, 'education'])->name('education');
417 420
418 //Новости 421 //Новости
419 Route::get('news', [MainController::class, 'news'])->name('news'); 422 Route::get('news', [MainController::class, 'news'])->name('news');
420 Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new'); 423 Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new');
421 424
422 //Контакты 425 //Контакты
423 Route::get('contacts', [MainController::class, 'contacts'])->name('contacts'); 426 Route::get('contacts', [MainController::class, 'contacts'])->name('contacts');
424 427
425 //База резюме 428 //База резюме
426 Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume'); 429 Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume');
427 430
431 Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume');
432
428 //Анкета соискателя 433 //Анкета соискателя
429 Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile'); 434 Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile');
430 435
431 //Скачать резюме 436 //Скачать резюме
432 Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download'); 437 Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download');
433 438
434 //Вход в кабинет 439 //Вход в кабинет
435 Route::get('login', [MainController::class, 'input_login'])->name('login'); 440 Route::get('login', [MainController::class, 'input_login'])->name('login');
436 441
437 // Выход из кабинета 442 // Выход из кабинета
438 Route::get('logout', [EmployerController::class, 'logout'])->name('logout'); 443 Route::get('logout', [EmployerController::class, 'logout'])->name('logout');
439 444
440 Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker'); 445 Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker');
441 Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer'); 446 Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer');
442 447
443 //восстановление пароля 448 //восстановление пароля
444 Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password'); 449 Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password');
445 // Звезда сообщения 450 // Звезда сообщения
446 Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer'); 451 Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer');
447 452
448 // Борьба 453 // Борьба
449 Route::get('clear_cookie', function() { 454 Route::get('clear_cookie', function() {
450 \App\Classes\Cookies_vacancy::clear_vacancy(); 455 \App\Classes\Cookies_vacancy::clear_vacancy();
451 return redirect()->route('index'); 456 return redirect()->route('index');
452 })->name('clear_cookie'); 457 })->name('clear_cookie');
453 458
454 Route::get('cookies', function() { 459 Route::get('cookies', function() {
455 return view('cookies'); 460 return view('cookies');
456 })->name('cookies'); 461 })->name('cookies');
457 462
458 463
459 464
460 465
461 // Личный кабинет работник 466 // Личный кабинет работник
462 Route::group([ 467 Route::group([
463 'as' => 'worker.', // имя маршрута, например auth.index 468 'as' => 'worker.', // имя маршрута, например auth.index
464 'prefix' => 'worker', // префикс маршрута, например auth/index 469 'prefix' => 'worker', // префикс маршрута, например auth/index
465 'middleware' => ['auth'], ['is_worker'], 470 'middleware' => ['auth'], ['is_worker'],
466 ], function() { 471 ], function() {
467 // 1 страница - Моя анкета 472 // 1 страница - Моя анкета
468 Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); 473 Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet');
469 Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); 474 Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save');
470 475
471 // 2 страница - Сообщения 476 // 2 страница - Сообщения
472 Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); 477 Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages');
473 Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog'); 478 Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog');
474 // 3 страница - Избранные вакансии 479 // 3 страница - Избранные вакансии
475 Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); 480 Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite');
476 // Продолжение борьбы против колорадов - избранные вакансии 481 // Продолжение борьбы против колорадов - избранные вакансии
477 Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); 482 Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado');
478 483
479 // 4 страница - Сменить пароль 484 // 4 страница - Сменить пароль
480 Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); 485 Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password');
481 Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password'); 486 Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password');
482 487
483 // 5 страница - Удалить профиль 488 // 5 страница - Удалить профиль
484 Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); 489 Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile');
485 Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); 490 Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result');
486 491
487 // Резюме -pdf 492 // Резюме -pdf
488 Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); 493 Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download');
489 494
490 // Поднятие анкеты 495 // Поднятие анкеты
491 Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); 496 Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up');
492 497
493 // Добавление сертификата 498 // Добавление сертификата
494 Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); 499 Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate');
495 Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); 500 Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate');
496 501
497 // Добавление документа-диплома 502 // Добавление документа-диплома
498 Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); 503 Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom');
499 Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); 504 Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save');
500 505
501 // Добавление стандартного диплома 506 // Добавление стандартного диплома
502 Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); 507 Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document');
503 Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); 508 Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save');
504 Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); 509 Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document');
505 Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); 510 Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save');
506 Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); 511 Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document');
507 512
508 // Отправка сообщения работодателю от соискателя 513 // Отправка сообщения работодателю от соискателя
509 Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message'); 514 Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message');
510 }); 515 });
511 516
512 // Личный кабинет работодателя 517 // Личный кабинет работодателя
513 Route::group([ 518 Route::group([
514 'as' => 'employer.', // имя маршрута, например auth.index 519 'as' => 'employer.', // имя маршрута, например auth.index
515 'prefix' => 'employer', // префикс маршрута, например auth/index 520 'prefix' => 'employer', // префикс маршрута, например auth/index
516 'middleware' => ['auth'], !['is_worker'], 521 'middleware' => ['auth'], !['is_worker'],
517 ], function() { 522 ], function() {
518 // 1 страница - Профиль 523 // 1 страница - Профиль
519 Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); 524 Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet');
520 Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); 525 Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save');
521 Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); 526 Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot');
522 Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); 527 Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot');
523 528
524 // 2 страница - Добавление вакансий 529 // 2 страница - Добавление вакансий
525 Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); 530 Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie');
526 Route::post('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancy_save'])->name('vacancy_save'); 531 Route::post('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancy_save'])->name('vacancy_save');
527 Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); 532 Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save');
528 533
529 // 3 страница - Мои вакансии 534 // 3 страница - Мои вакансии
530 Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); 535 Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list');
531 Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); 536 Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit');
532 Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); 537 Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete');
533 Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); 538 Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up');
534 Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); 539 Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye');
535 Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); 540 Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit');
536 Route::post('cabinet/vacancy-edit/{ad_employer}/', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); 541 Route::post('cabinet/vacancy-edit/{ad_employer}/', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me');
537 542
538 // 4 страница - Отклики на вакансии 543 // 4 страница - Отклики на вакансии
539 Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); 544 Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers');
540 Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); 545 Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple');
541 Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); 546 Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg');
542 547
543 // 5 страница - Сообщения 548 // 5 страница - Сообщения
544 Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); 549 Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages');
545 Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); 550 Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog');
546 Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); 551 Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message');
547 Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); 552 Route::post('test123', [EmployerController::class, 'test123'])->name('test123');
548 553
549 // 6 страница - Избранный 554 // 6 страница - Избранный
550 Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); 555 Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites');
551 556
552 //7 страница - База данных 557 //7 страница - База данных
553 Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); 558 Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd');
554 559
555 //8 страница - База резюме 560 //8 страница - База резюме
556 Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); 561 Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe');
557 562
558 // 9 рассылка сообщений 563 // 9 рассылка сообщений
559 Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); 564 Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages');
560 Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); 565 Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post');
561 566
562 // 10 страница FAQ вопросы 567 // 10 страница FAQ вопросы
563 Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq'); 568 Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq');
564 569
565 // 11 страница - Настройка уведомлений 570 // 11 страница - Настройка уведомлений
566 Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); 571 Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe');
567 Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); 572 Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe');
568 573
569 // 12 страница - Сменить пароль 574 // 12 страница - Сменить пароль
570 Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); 575 Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset');
571 Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); 576 Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password');
572 577
573 // 13 страница - Удаление профиля 578 // 13 страница - Удаление профиля
574 Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); 579 Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people');
575 Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); 580 Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user');
576 Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); 581 Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user');
577 582
578 // Отправил сообщение 583 // Отправил сообщение
579 Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); 584 Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message');
580 }); 585 });
581 586
582 587
583 588