Commit bfc7d8856d91b02193ac943a17de1e63b4c57c8e

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

Финальные изменения

Showing 4 changed files with 12 additions and 5 deletions Inline Diff

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; 14 use App\Models\Like_vacancy;
15 use App\Models\Like_worker; 15 use App\Models\Like_worker;
16 use App\Models\Message; 16 use App\Models\Message;
17 use App\Models\place_works; 17 use App\Models\place_works;
18 use App\Models\reclame; 18 use App\Models\reclame;
19 use App\Models\ResponseWork; 19 use App\Models\ResponseWork;
20 use App\Models\sertification; 20 use App\Models\sertification;
21 use App\Models\Static_worker; 21 use App\Models\Static_worker;
22 use App\Models\User; 22 use App\Models\User;
23 use App\Models\User as User_Model; 23 use App\Models\User as User_Model;
24 use App\Models\Worker; 24 use App\Models\Worker;
25 use Barryvdh\DomPDF\Facade\Pdf; 25 use Barryvdh\DomPDF\Facade\Pdf;
26 use Carbon\Carbon; 26 use Carbon\Carbon;
27 use Illuminate\Auth\Events\Registered; 27 use Illuminate\Auth\Events\Registered;
28 use Illuminate\Database\Eloquent\Builder; 28 use Illuminate\Database\Eloquent\Builder;
29 use Illuminate\Database\Eloquent\Model; 29 use Illuminate\Database\Eloquent\Model;
30 use Illuminate\Http\JsonResponse; 30 use Illuminate\Http\JsonResponse;
31 use Illuminate\Http\Request; 31 use Illuminate\Http\Request;
32 use Illuminate\Support\Facades\Auth; 32 use Illuminate\Support\Facades\Auth;
33 use Illuminate\Support\Facades\Hash; 33 use Illuminate\Support\Facades\Hash;
34 use Illuminate\Support\Facades\Storage; 34 use Illuminate\Support\Facades\Storage;
35 use Illuminate\Support\Facades\Validator; 35 use Illuminate\Support\Facades\Validator;
36 36
37 class WorkerController extends Controller 37 class WorkerController extends Controller
38 { 38 {
39 public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу'); 39 public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу');
40 40
41 //профиль 41 //профиль
42 public function profile(Worker $worker) 42 public function profile(Worker $worker)
43 { 43 {
44 $get_date = date('Y.m'); 44 $get_date = date('Y.m');
45 45
46 $c = Static_worker::query()->where('year_month', '=', $get_date) 46 $c = Static_worker::query()->where('year_month', '=', $get_date)
47 ->where('user_id', '=', $worker->users->id) 47 ->where('user_id', '=', $worker->users->id)
48 ->get(); 48 ->get();
49 49
50 if ($c->count() > 0) { 50 if ($c->count() > 0) {
51 $upd = Static_worker::find($c[0]->id); 51 $upd = Static_worker::find($c[0]->id);
52 $upd->lookin = $upd->lookin + 1; 52 $upd->lookin = $upd->lookin + 1;
53 $upd->save(); 53 $upd->save();
54 } else { 54 } else {
55 $crt = new Static_worker(); 55 $crt = new Static_worker();
56 $crt->lookin = 1; 56 $crt->lookin = 1;
57 $crt->year_month = $get_date; 57 $crt->year_month = $get_date;
58 $crt->user_id = $worker->user_id; 58 $crt->user_id = $worker->user_id;
59 $crt->save(); 59 $crt->save();
60 } 60 }
61 61
62 $stat = Static_worker::query()->where('year_month', '=', $get_date) 62 $stat = Static_worker::query()->where('year_month', '=', $get_date)
63 ->where('user_id', '=', $worker->users->id) 63 ->where('user_id', '=', $worker->users->id)
64 ->get(); 64 ->get();
65 65
66 return view('public.workers.profile', compact('worker', 'stat')); 66 return view('public.workers.profile', compact('worker', 'stat'));
67 } 67 }
68 68
69 // лист база резюме 69 // лист база резюме
70 public function bd_resume(Request $request) 70 public function bd_resume(Request $request)
71 { 71 {
72 if (isset(Auth()->user()->id)) { 72 if (isset(Auth()->user()->id)) {
73 $idiot = Auth()->user()->id; 73 $idiot = Auth()->user()->id;
74 } else { 74 } else {
75 $idiot = 0; 75 $idiot = 0;
76 } 76 }
77 77
78 $status_work = $this->status_work; 78 $status_work = $this->status_work;
79 $resumes = Worker::query()->with('users')->with('job_titles'); 79 $resumes = Worker::query()->with('users')->with('job_titles');
80 $resumes = $resumes->whereHas('users', function (Builder $query) { 80 $resumes = $resumes->whereHas('users', function (Builder $query) {
81 $query->Where('is_worker', '=', '1') 81 $query->Where('is_worker', '=', '1')
82 ->Where('is_bd', '=', '0'); 82 ->Where('is_bd', '=', '0');
83 }); 83 });
84 84
85 if ($request->get('sort')) { 85 if ($request->get('sort')) {
86 $sort = $request->get('sort'); 86 $sort = $request->get('sort');
87 switch ($sort) { 87 switch ($sort) {
88 case 'name_up': 88 case 'name_up':
89 $resumes = $resumes->orderBy(User::select('surname') 89 $resumes = $resumes->orderBy(User::select('surname')
90 ->whereColumn('Workers.user_id', 'users.id') 90 ->whereColumn('Workers.user_id', 'users.id')
91 ); 91 );
92 break; 92 break;
93 case 'name_down': 93 case 'name_down':
94 $resumes = $resumes->orderByDesc(User::select('surname') 94 $resumes = $resumes->orderByDesc(User::select('surname')
95 ->whereColumn('Workers.user_id', 'users.id') 95 ->whereColumn('Workers.user_id', 'users.id')
96 ); 96 );
97 break; 97 break;
98 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;
99 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;
100 case 'default': $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; 100 case 'default': $resumes = $resumes->orderBy('id')->orderby('updated_at'); break;
101 default: $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; 101 default: $resumes = $resumes->orderBy('id')->orderby('updated_at'); break;
102 } 102 }
103 } 103 }
104 104
105 $res_count = $resumes->count(); 105 $res_count = $resumes->count();
106 $resumes = $resumes->paginate(6); 106 $resumes = $resumes->paginate(6);
107 if ($request->ajax()) { 107 if ($request->ajax()) {
108 // Условия обставлены 108 // Условия обставлены
109 if ($request->has('block') && ($request->get('block') == 1)) { 109 if ($request->has('block') && ($request->get('block') == 1)) {
110 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'));
111 } 111 }
112 112
113 if ($request->has('block') && ($request->get('block') == 2)) { 113 if ($request->has('block') && ($request->get('block') == 2)) {
114 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'));
115 } 115 }
116 } else { 116 } else {
117 return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot')); 117 return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot'));
118 } 118 }
119 } 119 }
120 120
121 //Лайк резюме 121 //Лайк резюме
122 public function like_controller() { 122 public function like_controller() {
123 123
124 } 124 }
125 125
126 // анкета соискателя 126 // анкета соискателя
127 public function resume_profile(Worker $worker) 127 public function resume_profile(Worker $worker)
128 { 128 {
129 if (isset(Auth()->user()->id)) {
130 $idiot = Auth()->user()->id;
131 } else {
132 $idiot = 0;
133 }
134
129 $status_work = $this->status_work; 135 $status_work = $this->status_work;
130 $Query = Worker::query()->with('users')->with('job_titles') 136 $Query = Worker::query()->with('users')->with('job_titles')
131 ->with('place_worker')->with('sertificate')->with('prev_company') 137 ->with('place_worker')->with('sertificate')->with('prev_company')
132 ->with('infobloks'); 138 ->with('infobloks');
133 $Query = $Query->where('id', '=', $worker->id); 139 $Query = $Query->where('id', '=', $worker->id);
134 $Query = $Query->get(); 140 $Query = $Query->get();
135 141
136 $get_date = date('Y.m'); 142 $get_date = date('Y.m');
137 $c = Static_worker::query()->where('year_month', '=', $get_date) 143 $c = Static_worker::query()->where('year_month', '=', $get_date)
138 ->where('user_id', '=', $worker->id) 144 ->where('user_id', '=', $worker->id)
139 ->get(); 145 ->get();
140 146
141 if ($c->count() > 0) { 147 if ($c->count() > 0) {
142 $upd = Static_worker::find($c[0]->id); 148 $upd = Static_worker::find($c[0]->id);
143 $upd->lookin = $upd->lookin + 1; 149 $upd->lookin = $upd->lookin + 1;
144 $upd->save(); 150 $upd->save();
145 } else { 151 } else {
146 $crt = new Static_worker(); 152 $crt = new Static_worker();
147 $crt->lookin = 1; 153 $crt->lookin = 1;
148 $crt->year_month = $get_date; 154 $crt->year_month = $get_date;
149 $crt->user_id = $worker->user_id; 155 $crt->user_id = $worker->user_id;
150 $crt->save(); 156 $crt->save();
151 } 157 }
152 158
153 $stat = Static_worker::query()->where('year_month', '=', $get_date) 159 $stat = Static_worker::query()->where('year_month', '=', $get_date)
154 ->where('user_id', '=', $worker->id) 160 ->where('user_id', '=', $worker->id)
155 ->get(); 161 ->get();
156 162
157 return view('worker', compact('Query', 'status_work')); 163 return view('worker', compact('Query', 'status_work', 'idiot'));
158 } 164 }
159 165
160 // скачать анкету соискателя 166 // скачать анкету соискателя
161 public function resume_download(Worker $worker) 167 public function resume_download(Worker $worker)
162 { 168 {
163 $status_work = $this->status_work; 169 $status_work = $this->status_work;
164 $Query = Worker::query()->with('users')->with('job_titles') 170 $Query = Worker::query()->with('users')->with('job_titles')
165 ->with('place_worker')->with('sertificate')->with('prev_company') 171 ->with('place_worker')->with('sertificate')->with('prev_company')
166 ->with('infobloks'); 172 ->with('infobloks');
167 $Query = $Query->where('id', '=', $worker->id); 173 $Query = $Query->where('id', '=', $worker->id);
168 $Query = $Query->get()->toArray(); 174 $Query = $Query->get()->toArray();
169 175
170 view()->share('Query',$Query); 176 view()->share('Query',$Query);
171 177
172 $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape'); 178 $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape');
173 179
174 return $pdf->stream(); 180 return $pdf->stream();
175 } 181 }
176 182
177 // Кабинет работника 183 // Кабинет работника
178 public function cabinet(Request $request) 184 public function cabinet(Request $request)
179 { 185 {
180 $get_date = date('Y.m'); 186 $get_date = date('Y.m');
181 187
182 $id = Auth()->user()->id; 188 $id = Auth()->user()->id;
183 $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')-> 189 $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')->
184 with('infobloks')->with('place_worker')-> 190 with('infobloks')->with('place_worker')->
185 WhereHas('users', 191 WhereHas('users',
186 function (Builder $query) use ($id) {$query->Where('id', $id); 192 function (Builder $query) use ($id) {$query->Where('id', $id);
187 })->get(); 193 })->get();
188 194
189 $Job_titles = Job_title::query()->OrderBy('name')->get(); 195 $Job_titles = Job_title::query()->OrderBy('name')->get();
190 $Infoblocks = infobloks::query()->OrderBy('name')->get(); 196 $Infoblocks = infobloks::query()->OrderBy('name')->get();
191 197
192 $stat = Static_worker::query()->where('year_month', '=', $get_date) 198 $stat = Static_worker::query()->where('year_month', '=', $get_date)
193 ->where('user_id', '=', $Worker[0]->id) 199 ->where('user_id', '=', $Worker[0]->id)
194 ->get(); 200 ->get();
195 201
196 $persent = 10; 202 $persent = 10;
197 if ((!empty($Worker[0]->status_work)) && (!empty($Worker[0]->telephone)) && 203 if ((!empty($Worker[0]->status_work)) && (!empty($Worker[0]->telephone)) &&
198 (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) && 204 (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) &&
199 (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) { 205 (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) {
200 $persent = $persent + 40; 206 $persent = $persent + 40;
201 } 207 }
202 208
203 if ($Worker[0]->sertificate->count() > 0) { 209 if ($Worker[0]->sertificate->count() > 0) {
204 $persent = $persent + 15; 210 $persent = $persent + 15;
205 } 211 }
206 212
207 if ($Worker[0]->infobloks->count() > 0) { 213 if ($Worker[0]->infobloks->count() > 0) {
208 $persent = $persent + 20; 214 $persent = $persent + 20;
209 } 215 }
210 216
211 if ($Worker[0]->prev_company->count() > 0) { 217 if ($Worker[0]->prev_company->count() > 0) {
212 $persent = $persent + 10; 218 $persent = $persent + 10;
213 } 219 }
214 220
215 if (!empty($Worker[0]->photo)) { 221 if (!empty($Worker[0]->photo)) {
216 // 5% 222 // 5%
217 $persent = $persent + 5; 223 $persent = $persent + 5;
218 } 224 }
219 225
220 if ($request->has('print')) { 226 if ($request->has('print')) {
221 dd($Worker); 227 dd($Worker);
222 } else { 228 } else {
223 return view('workers.cabinet', compact('Worker', 'persent', 'Job_titles', 'Infoblocks', 'stat')); 229 return view('workers.cabinet', compact('Worker', 'persent', 'Job_titles', 'Infoblocks', 'stat'));
224 } 230 }
225 } 231 }
226 232
227 // Сохранение данных 233 // Сохранение данных
228 public function cabinet_save(Worker $worker, Request $request) 234 public function cabinet_save(Worker $worker, Request $request)
229 { 235 {
230 $id = $worker->id; 236 $id = $worker->id;
231 $params = $request->all(); 237 $params = $request->all();
232 238
233 $job_title_id = $request->get('job_title_id'); 239 $job_title_id = $request->get('job_title_id');
234 240
235 unset($params['new_diplom']); 241 unset($params['new_diplom']);
236 unset($params['new_data_begin']); 242 unset($params['new_data_begin']);
237 unset($params['new_data_end']); 243 unset($params['new_data_end']);
238 unset($params['new_job_title']); 244 unset($params['new_job_title']);
239 unset($params['new_teplohod']); 245 unset($params['new_teplohod']);
240 unset($params['new_GWT']); 246 unset($params['new_GWT']);
241 unset($params['new_KBT']); 247 unset($params['new_KBT']);
242 unset($params['new_Begin_work']); 248 unset($params['new_Begin_work']);
243 unset($params['new_End_work']); 249 unset($params['new_End_work']);
244 unset($params['new_name_company']); 250 unset($params['new_name_company']);
245 251
246 $rules = [ 252 $rules = [
247 'surname' => ['required', 'string', 'max:255'], 253 'surname' => ['required', 'string', 'max:255'],
248 'name_man' => ['required', 'string', 'max:255'], 254 'name_man' => ['required', 'string', 'max:255'],
249 'email' => ['required', 'string', 'email', 'max:255'], 255 'email' => ['required', 'string', 'email', 'max:255'],
250 256
251 ]; 257 ];
252 258
253 $messages = [ 259 $messages = [
254 'required' => 'Укажите обязательное поле', 260 'required' => 'Укажите обязательное поле',
255 'min' => [ 261 'min' => [
256 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 262 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
257 'integer' => 'Поле «:attribute» должно быть :min или больше', 263 'integer' => 'Поле «:attribute» должно быть :min или больше',
258 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 264 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
259 ], 265 ],
260 'max' => [ 266 'max' => [
261 'string' => 'Поле «:attribute» должно быть не больше :max символов', 267 'string' => 'Поле «:attribute» должно быть не больше :max символов',
262 'integer' => 'Поле «:attribute» должно быть :max или меньше', 268 'integer' => 'Поле «:attribute» должно быть :max или меньше',
263 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 269 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
264 ] 270 ]
265 ]; 271 ];
266 272
267 $validator = Validator::make($params, $rules, $messages); 273 $validator = Validator::make($params, $rules, $messages);
268 274
269 if ($validator->fails()) { 275 if ($validator->fails()) {
270 return redirect()->route('worker.cabinet')->withErrors($validator); 276 return redirect()->route('worker.cabinet')->withErrors($validator);
271 } else { 277 } else {
272 278
273 if ($request->has('photo')) { 279 if ($request->has('photo')) {
274 if (!empty($Worker->photo)) { 280 if (!empty($Worker->photo)) {
275 Storage::delete($Worker->photo); 281 Storage::delete($Worker->photo);
276 } 282 }
277 $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); 283 $params['photo'] = $request->file('photo')->store("worker/$id", 'public');
278 } 284 }
279 285
280 if ($request->has('file')) { 286 if ($request->has('file')) {
281 if (!empty($Worker->file)) { 287 if (!empty($Worker->file)) {
282 Storage::delete($Worker->file); 288 Storage::delete($Worker->file);
283 } 289 }
284 $params['file'] = $request->file('file')->store("worker/$id", 'public'); 290 $params['file'] = $request->file('file')->store("worker/$id", 'public');
285 } 291 }
286 292
287 $id_wor = $worker->update($params); 293 $id_wor = $worker->update($params);
288 294
289 $use = User_Model::find($id_wor); 295 $use = User_Model::find($id_wor);
290 $use->surname = $request->get('surname'); 296 $use->surname = $request->get('surname');
291 $use->name_man = $request->get('name_man'); 297 $use->name_man = $request->get('name_man');
292 $use->surname2 = $request->get('surname2'); 298 $use->surname2 = $request->get('surname2');
293 299
294 $use->save(); 300 $use->save();
295 $worker->job_titles()->sync($job_title_id); 301 $worker->job_titles()->sync($job_title_id);
296 302
297 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); 303 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены');
298 } 304 }
299 } 305 }
300 306
301 // Сообщения данные 307 // Сообщения данные
302 public function messages($type_message) 308 public function messages($type_message)
303 { 309 {
304 $user_id = Auth()->user()->id; 310 $user_id = Auth()->user()->id;
305 311
306 $messages_input = Message::query()->with('vacancies')->with('user_from')-> 312 $messages_input = Message::query()->with('vacancies')->with('user_from')->
307 Where('to_user_id', $user_id)->OrderByDesc('created_at'); 313 Where('to_user_id', $user_id)->OrderByDesc('created_at');
308 314
309 $messages_output = Message::query()->with('vacancies')-> 315 $messages_output = Message::query()->with('vacancies')->
310 with('user_to')->where('user_id', $user_id)-> 316 with('user_to')->where('user_id', $user_id)->
311 OrderByDesc('created_at'); 317 OrderByDesc('created_at');
312 318
313 319
314 $count_input = $messages_input->count(); 320 $count_input = $messages_input->count();
315 $count_output = $messages_output->count(); 321 $count_output = $messages_output->count();
316 322
317 if ($type_message == 'input') { 323 if ($type_message == 'input') {
318 $messages = $messages_input->paginate(15); 324 $messages = $messages_input->paginate(15);
319 } 325 }
320 326
321 if ($type_message == 'output') { 327 if ($type_message == 'output') {
322 $messages = $messages_output->paginate(15); 328 $messages = $messages_output->paginate(15);
323 } 329 }
324 // Вернуть все 100% 330 // Вернуть все 100%
325 return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); 331 return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id'));
326 } 332 }
327 333
328 // Избранный 334 // Избранный
329 public function favorite() 335 public function favorite()
330 { 336 {
331 return view('workers.favorite'); 337 return view('workers.favorite');
332 } 338 }
333 339
334 // Сменить пароль 340 // Сменить пароль
335 public function new_password() 341 public function new_password()
336 { 342 {
337 $email = Auth()->user()->email; 343 $email = Auth()->user()->email;
338 return view('workers.new_password', compact('email')); 344 return view('workers.new_password', compact('email'));
339 } 345 }
340 346
341 // Обновление пароля 347 // Обновление пароля
342 public function save_new_password(Request $request) { 348 public function save_new_password(Request $request) {
343 $use = Auth()->user(); 349 $use = Auth()->user();
344 $request->validate([ 350 $request->validate([
345 'password' => 'required|string', 351 'password' => 'required|string',
346 'new_password' => 'required|string', 352 'new_password' => 'required|string',
347 'new_password2' => 'required|string' 353 'new_password2' => 'required|string'
348 ]); 354 ]);
349 355
350 if ($request->get('new_password') == $request->get('new_password2')) 356 if ($request->get('new_password') == $request->get('new_password2'))
351 if ($request->get('password') !== $request->get('new_password')) { 357 if ($request->get('password') !== $request->get('new_password')) {
352 $credentials = $request->only('email', 'password'); 358 $credentials = $request->only('email', 'password');
353 if (Auth::attempt($credentials, $request->has('save_me'))) { 359 if (Auth::attempt($credentials, $request->has('save_me'))) {
354 360
355 if (!is_null($use->email_verified_at)){ 361 if (!is_null($use->email_verified_at)){
356 362
357 $user_data = User_Model::find($use->id); 363 $user_data = User_Model::find($use->id);
358 $user_data->update([ 364 $user_data->update([
359 'password' => Hash::make($request->get('new_password')), 365 'password' => Hash::make($request->get('new_password')),
360 'pubpassword' => base64_encode($request->get('new_password')), 366 'pubpassword' => base64_encode($request->get('new_password')),
361 ]); 367 ]);
362 return redirect() 368 return redirect()
363 ->route('worker.new_password') 369 ->route('worker.new_password')
364 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 370 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
365 } 371 }
366 372
367 return redirect() 373 return redirect()
368 ->route('worker.new_password') 374 ->route('worker.new_password')
369 ->withError('Данная учетная запись не было верифицированна!'); 375 ->withError('Данная учетная запись не было верифицированна!');
370 } 376 }
371 } 377 }
372 378
373 return redirect() 379 return redirect()
374 ->route('worker.new_password') 380 ->route('worker.new_password')
375 ->withErrors('Не совпадение данных, обновите пароли!'); 381 ->withErrors('Не совпадение данных, обновите пароли!');
376 } 382 }
377 383
378 // Удаление профиля форма 384 // Удаление профиля форма
379 public function delete_profile() 385 public function delete_profile()
380 { 386 {
381 $login = Auth()->user()->email; 387 $login = Auth()->user()->email;
382 return view('workers.delete_profile', compact('login')); 388 return view('workers.delete_profile', compact('login'));
383 } 389 }
384 390
385 // Удаление профиля код 391 // Удаление профиля код
386 public function delete_profile_result(Request $request) { 392 public function delete_profile_result(Request $request) {
387 $Answer = $request->all(); 393 $Answer = $request->all();
388 $user_id = Auth()->user()->id; 394 $user_id = Auth()->user()->id;
389 $request->validate([ 395 $request->validate([
390 'password' => 'required|string', 396 'password' => 'required|string',
391 ]); 397 ]);
392 398
393 $credentials = $request->only('email', 'password'); 399 $credentials = $request->only('email', 'password');
394 if (Auth::attempt($credentials)) { 400 if (Auth::attempt($credentials)) {
395 Auth::logout(); 401 Auth::logout();
396 $it = User_Model::find($user_id); 402 $it = User_Model::find($user_id);
397 $it->delete(); 403 $it->delete();
398 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 404 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
399 } else { 405 } else {
400 return redirect()->route('worker.delete_profile') 406 return redirect()->route('worker.delete_profile')
401 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 407 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
402 } 408 }
403 } 409 }
404 410
405 // Регистрация соискателя 411 // Регистрация соискателя
406 public function register_worker(Request $request) 412 public function register_worker(Request $request)
407 { 413 {
408 $params = $request->all(); 414 $params = $request->all();
409 415
410 416
411 dd($params); 417 dd($params);
412 418
413 $rules = [ 419 $rules = [
414 'surname' => ['required', 'string', 'max:255'], 420 'surname' => ['required', 'string', 'max:255'],
415 'name_man' => ['required', 'string', 'max:255'], 421 'name_man' => ['required', 'string', 'max:255'],
416 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 422 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
417 'password' => ['required', 'string', 'min:8'] 423 'password' => ['required', 'string', 'min:8']
418 ]; 424 ];
419 425
420 $messages = [ 426 $messages = [
421 'required' => 'Укажите обязательное поле', 427 'required' => 'Укажите обязательное поле',
422 'min' => [ 428 'min' => [
423 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 429 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
424 'integer' => 'Поле «:attribute» должно быть :min или больше', 430 'integer' => 'Поле «:attribute» должно быть :min или больше',
425 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 431 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
426 ], 432 ],
427 'max' => [ 433 'max' => [
428 'string' => 'Поле «:attribute» должно быть не больше :max символов', 434 'string' => 'Поле «:attribute» должно быть не больше :max символов',
429 'integer' => 'Поле «:attribute» должно быть :max или меньше', 435 'integer' => 'Поле «:attribute» должно быть :max или меньше',
430 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 436 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
431 ] 437 ]
432 ]; 438 ];
433 439
434 if ($request->get('password') !== $request->get('confirmed')){ 440 if ($request->get('password') !== $request->get('confirmed')){
435 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 441 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
436 } 442 }
437 443
438 if (($request->has('politik')) && ($request->get('politik') == 1)) { 444 if (($request->has('politik')) && ($request->get('politik') == 1)) {
439 $validator = Validator::make($request->all(), $rules, $messages); 445 $validator = Validator::make($request->all(), $rules, $messages);
440 446
441 if ($validator->fails()) { 447 if ($validator->fails()) {
442 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 448 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
443 } else { 449 } else {
444 $user = $this->create($params); 450 $user = $this->create($params);
445 event(new Registered($user)); 451 event(new Registered($user));
446 452
447 Auth::guard()->login($user); 453 Auth::guard()->login($user);
448 } 454 }
449 455
450 if ($user) { 456 if ($user) {
451 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; 457 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));;
452 } else { 458 } else {
453 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 459 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
454 } 460 }
455 461
456 } else { 462 } else {
457 return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!")); 463 return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!"));
458 } 464 }
459 465
460 466
461 } 467 }
462 468
463 469
464 // Звездная оценка и ответ 470 // Звездная оценка и ответ
465 public function stars_answer(Request $request) { 471 public function stars_answer(Request $request) {
466 $params = $request->all(); 472 $params = $request->all();
467 $rules = [ 473 $rules = [
468 'message' => ['required', 'string', 'max:255'], 474 'message' => ['required', 'string', 'max:255'],
469 ]; 475 ];
470 476
471 $messages = [ 477 $messages = [
472 'required' => 'Укажите обязательное поле', 478 'required' => 'Укажите обязательное поле',
473 'min' => [ 479 'min' => [
474 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 480 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
475 'integer' => 'Поле «:attribute» должно быть :min или больше', 481 'integer' => 'Поле «:attribute» должно быть :min или больше',
476 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 482 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
477 ], 483 ],
478 'max' => [ 484 'max' => [
479 'string' => 'Поле «:attribute» должно быть не больше :max символов', 485 'string' => 'Поле «:attribute» должно быть не больше :max символов',
480 'integer' => 'Поле «:attribute» должно быть :max или меньше', 486 'integer' => 'Поле «:attribute» должно быть :max или меньше',
481 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 487 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
482 ] 488 ]
483 ]; 489 ];
484 $response_worker = ResponseWork::create($params); 490 $response_worker = ResponseWork::create($params);
485 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); 491 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!');
486 } 492 }
487 493
488 // Создание пользователя 494 // Создание пользователя
489 protected function create(array $data) 495 protected function create(array $data)
490 { 496 {
491 $Use = new User(); 497 $Use = new User();
492 $Code_user = $Use->create([ 498 $Code_user = $Use->create([
493 'name' => $data['surname']." ".$data['name_man'], 499 'name' => $data['surname']." ".$data['name_man'],
494 'name_man' => $data['name_man'], 500 'name_man' => $data['name_man'],
495 'surname' => $data['surname'], 501 'surname' => $data['surname'],
496 'surname2' => $data['surname2'], 502 'surname2' => $data['surname2'],
497 'subscribe_email' => $data['email'], 503 'subscribe_email' => $data['email'],
498 'email' => $data['email'], 504 'email' => $data['email'],
499 'telephone' => $data['telephone'], 505 'telephone' => $data['telephone'],
500 'password' => Hash::make($data['password']), 506 'password' => Hash::make($data['password']),
501 'pubpassword' => base64_encode($data['password']), 507 'pubpassword' => base64_encode($data['password']),
502 'email_verified_at' => Carbon::now() 508 'email_verified_at' => Carbon::now()
503 ]); 509 ]);
504 if ($Code_user->id > 0) { 510 if ($Code_user->id > 0) {
505 $Worker = new Worker(); 511 $Worker = new Worker();
506 $Worker->user_id = $Code_user->id; 512 $Worker->user_id = $Code_user->id;
507 $Worker->position_work = $data['job_titles']; 513 $Worker->position_work = $data['job_titles'];
508 $Worker->email = $data['email']; 514 $Worker->email = $data['email'];
509 $Worker->telephone = $data['telephone']; 515 $Worker->telephone = $data['telephone'];
510 $Worker->save(); 516 $Worker->save();
511 517
512 return $Code_user; 518 return $Code_user;
513 } 519 }
514 } 520 }
515 521
516 // Вакансии избранные 522 // Вакансии избранные
517 public function colorado(Request $request) { 523 public function colorado(Request $request) {
518 $IP_address = RusDate::ip_addr_client(); 524 $IP_address = RusDate::ip_addr_client();
519 $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); 525 $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get();
520 526
521 if ($Arr->count()) { 527 if ($Arr->count()) {
522 $A = Array(); 528 $A = Array();
523 foreach ($Arr as $it) { 529 foreach ($Arr as $it) {
524 $A[] = $it->code_record; 530 $A[] = $it->code_record;
525 } 531 }
526 532
527 $Query = Ad_employer::query()->whereIn('id', $A); 533 $Query = Ad_employer::query()->whereIn('id', $A);
528 } else { 534 } else {
529 $Query = Ad_employer::query()->where('id', '=', '0'); 535 $Query = Ad_employer::query()->where('id', '=', '0');
530 } 536 }
531 537
532 $Query = $Query->with('jobs')-> 538 $Query = $Query->with('jobs')->
533 with('cat')-> 539 with('cat')->
534 with('employer')-> 540 with('employer')->
535 whereHas('jobs_code', function ($query) use ($request) { 541 whereHas('jobs_code', function ($query) use ($request) {
536 if ($request->ajax()) { 542 if ($request->ajax()) {
537 if (null !== ($request->get('job'))) { 543 if (null !== ($request->get('job'))) {
538 $query->where('job_title_id', $request->get('job')); 544 $query->where('job_title_id', $request->get('job'));
539 } 545 }
540 } 546 }
541 })->select('ad_employers.*'); 547 })->select('ad_employers.*');
542 548
543 $Job_title = Job_title::query()->OrderBy('name')->get(); 549 $Job_title = Job_title::query()->OrderBy('name')->get();
544 550
545 $Query_count = $Query->count(); 551 $Query_count = $Query->count();
546 552
547 $Query = $Query->OrderBy('updated_at')->paginate(3); 553 $Query = $Query->OrderBy('updated_at')->paginate(3);
548 554
549 return view('workers.favorite', compact('Query', 555 return view('workers.favorite', compact('Query',
550 'Query_count', 556 'Query_count',
551 'Job_title')); 557 'Job_title'));
552 558
553 } 559 }
554 560
555 //Переписка 561 //Переписка
556 public function dialog(User_Model $user1, User_Model $user2) { 562 public function dialog(User_Model $user1, User_Model $user2) {
557 if (isset($user2->id)) { 563 if (isset($user2->id)) {
558 $companion = User_Model::query()->with('workers')-> 564 $companion = User_Model::query()->with('workers')->
559 with('employers')-> 565 with('employers')->
560 where('id', $user2->id)->first(); 566 where('id', $user2->id)->first();
561 } 567 }
562 568
563 $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) { 569 $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) {
564 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); 570 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id);
565 })->orWhere(function($query) use ($user1, $user2) { 571 })->orWhere(function($query) use ($user1, $user2) {
566 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); 572 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id);
567 })->OrderBy('created_at')->get(); 573 })->OrderBy('created_at')->get();
568 574
569 $id_vac = null; 575 $id_vac = null;
570 foreach ($Messages as $it) { 576 foreach ($Messages as $it) {
571 if (isset($it->response)) { 577 if (isset($it->response)) {
572 foreach ($it->response as $r) { 578 foreach ($it->response as $r) {
573 if (isset($r->ad_employer_id)) { 579 if (isset($r->ad_employer_id)) {
574 $id_vac = $r->ad_employer_id; 580 $id_vac = $r->ad_employer_id;
575 break; 581 break;
576 } 582 }
577 } 583 }
578 } 584 }
579 if (!is_null($id_vac)) break; 585 if (!is_null($id_vac)) break;
580 } 586 }
581 587
582 $ad_employer = null; 588 $ad_employer = null;
583 if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); 589 if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first();
584 $sender = $user1; 590 $sender = $user1;
585 591
586 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); 592 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer'));
587 } 593 }
588 594
589 // Даунылоады 595 // Даунылоады
590 public function download(Worker $worker) { 596 public function download(Worker $worker) {
591 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; 597 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...'];
592 view()->share('house',$arr_house); 598 view()->share('house',$arr_house);
593 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); 599 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape');
594 return $pdf->stream(); 600 return $pdf->stream();
595 } 601 }
596 602
597 // Поднятие анкеты 603 // Поднятие анкеты
598 public function up(Worker $worker) { 604 public function up(Worker $worker) {
599 $worker->updated_at = Carbon::now(); 605 $worker->updated_at = Carbon::now();
600 $worker->save(); 606 $worker->save();
601 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); 607 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных');
602 } 608 }
603 609
604 // Добавление сертификата 610 // Добавление сертификата
605 public function add_serificate(Request $request) { 611 public function add_serificate(Request $request) {
606 $params = $request->all(); 612 $params = $request->all();
607 $params['date_begin'] = date('d.m.Y', strtotime($params['date_begin'])); 613 $params['date_begin'] = date('d.m.Y', strtotime($params['date_begin']));
608 $params['end_begin'] = date('d.m.Y', strtotime($params['end_begin'])); 614 $params['end_begin'] = date('d.m.Y', strtotime($params['end_begin']));
609 $Sertificate = new sertification(); 615 $Sertificate = new sertification();
610 $Sertificate->create($params); 616 $Sertificate->create($params);
611 $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get(); 617 $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get();
612 return view('ajax.documents', compact('Docs')); 618 return view('ajax.documents', compact('Docs'));
613 } 619 }
614 620
615 621
616 // Удалить сертификат 622 // Удалить сертификат
617 public function delete_sertificate(sertification $doc) { 623 public function delete_sertificate(sertification $doc) {
618 $doc->delete(); 624 $doc->delete();
619 625
620 return redirect()->route('worker.cabinet'); 626 return redirect()->route('worker.cabinet');
621 } 627 }
622 628
623 // Добавление диплома 629 // Добавление диплома
624 public function add_diplom_ajax(Request $request) { 630 public function add_diplom_ajax(Request $request) {
625 // конец 631 // конец
626 $params = $request->all(); 632 $params = $request->all();
627 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 633 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
628 634
629 if ($count == 0) $dop_info = Dop_info::create($params); 635 if ($count == 0) $dop_info = Dop_info::create($params);
630 $Infoblocks = infobloks::query()->get(); 636 $Infoblocks = infobloks::query()->get();
631 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); 637 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get();
632 $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); 638 $data = Dop_info::query()->where('worker_id', $request->has('worker_id'));
633 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); 639 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker'));
634 } 640 }
635 641
636 // Добавление диплома без ajax 642 // Добавление диплома без ajax
637 public function add_diplom(Worker $worker) { 643 public function add_diplom(Worker $worker) {
638 $worker_id = $worker->id; 644 $worker_id = $worker->id;
639 $Infoblocks = infobloks::query()->get(); 645 $Infoblocks = infobloks::query()->get();
640 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); 646 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks'));
641 } 647 }
642 // Сохранить 648 // Сохранить
643 // Сохраняю диплом 649 // Сохраняю диплом
644 public function add_diplom_save(Request $request) { 650 public function add_diplom_save(Request $request) {
645 $params = $request->all(); 651 $params = $request->all();
646 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 652 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
647 if ($count == 0) $dop_info = Dop_info::create($params); 653 if ($count == 0) $dop_info = Dop_info::create($params);
648 return redirect()->route('worker.cabinet'); 654 return redirect()->route('worker.cabinet');
649 } 655 }
650 656
651 // Добавление стандартного документа 657 // Добавление стандартного документа
652 public function add_document(Worker $worker) { 658 public function add_document(Worker $worker) {
653 return view('workers.docs', compact('worker')); 659 return view('workers.docs', compact('worker'));
654 } 660 }
655 661
656 //Сохранение стандартого документа 662 //Сохранение стандартого документа
657 public function add_document_save(DocumentsRequest $request) { 663 public function add_document_save(DocumentsRequest $request) {
658 $params = $request->all(); 664 $params = $request->all();
659 $place_work = place_works::create($params); 665 $place_work = place_works::create($params);
660 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!'); 666 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!');
661 } 667 }
662 668
663 // Редактирование документа 669 // Редактирование документа
664 public function edit_document(place_works $doc, Worker $worker) { 670 public function edit_document(place_works $doc, Worker $worker) {
665 return view('workers.docs-edit', compact('doc', 'worker')); 671 return view('workers.docs-edit', compact('doc', 'worker'));
666 } 672 }
667 673
668 //Сохранение отредактированного документа 674 //Сохранение отредактированного документа
669 public function edit_document_save(DocumentsRequest $request, place_works $doc) { 675 public function edit_document_save(DocumentsRequest $request, place_works $doc) {
670 $params = $request->all(); 676 $params = $request->all();
671 $doc->update($params); 677 $doc->update($params);
672 678
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 delete_document(place_works $doc) { 683 public function delete_document(place_works $doc) {
678 $doc->delete(); 684 $doc->delete();
679 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); 685 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!');
680 } 686 }
681 687
682 //Отправка нового сообщения 688 //Отправка нового сообщения
683 public function new_message(Request $request) { 689 public function new_message(Request $request) {
684 $params = $request->all(); 690 $params = $request->all();
685 691
686 $id = $params['send_user_id']; 692 $id = $params['send_user_id'];
687 $message = new Message(); 693 $message = new Message();
688 $message->user_id = $params['send_user_id']; 694 $message->user_id = $params['send_user_id'];
689 $message->to_user_id = $params['send_to_user_id']; 695 $message->to_user_id = $params['send_to_user_id'];
690 $message->title = $params['send_title']; 696 $message->title = $params['send_title'];
691 $message->text = $params['send_text']; 697 $message->text = $params['send_text'];
692 if ($request->has('send_file')) { 698 if ($request->has('send_file')) {
693 $message->file = $request->file('send_file')->store("worker/$id", 'public'); 699 $message->file = $request->file('send_file')->store("worker/$id", 'public');
694 } 700 }
695 $message->flag_new = 1; 701 $message->flag_new = 1;
696 $id_message = $message->save(); 702 $id_message = $message->save();
697 703
698 $data['message_id'] = $id_message; 704 $data['message_id'] = $id_message;
699 $data['ad_employer_id'] = $params['send_vacancy']; 705 $data['ad_employer_id'] = $params['send_vacancy'];
700 $data['job_title_id'] = $params['send_job_title_id']; 706 $data['job_title_id'] = $params['send_job_title_id'];
701 $data['flag'] = 1; 707 $data['flag'] = 1;
702 $ad_responce = ad_response::create($data); 708 $ad_responce = ad_response::create($data);
703 return redirect()->route('worker.messages', ['type_message' => 'output']); 709 return redirect()->route('worker.messages', ['type_message' => 'output']);
704 } 710 }
705 711
706 } 712 }
707 713
708 714
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 @include('js.favorite-vacancy-45')
50 @endsection 50 @endsection
51 51
52 @section('content') 52 @section('content')
53 <section class="cabinet"> 53 <section class="cabinet">
54 <div class="container"> 54 <div class="container">
55 <ul class="breadcrumbs cabinet__breadcrumbs"> 55 <ul class="breadcrumbs cabinet__breadcrumbs">
56 <li><a href="{{ route('index') }}">Главная</a></li> 56 <li><a href="{{ route('index') }}">Главная</a></li>
57 <li><b>Личный кабинет</b></li> 57 <li><b>Личный кабинет</b></li>
58 </ul> 58 </ul>
59 <div class="cabinet__wrapper"> 59 <div class="cabinet__wrapper">
60 <div class="cabinet__side"> 60 <div class="cabinet__side">
61 <div class="cabinet__side-toper"> 61 <div class="cabinet__side-toper">
62 @include('employers.emblema') 62 @include('employers.emblema')
63 </div> 63 </div>
64 64
65 @include('employers.menu', ['item' => 6]) 65 @include('employers.menu', ['item' => 6])
66 66
67 </div> 67 </div>
68 68
69 <div class="cabinet__body"> 69 <div class="cabinet__body">
70 <div class="cabinet__body-item"> 70 <div class="cabinet__body-item">
71 <h2 class="title cabinet__title">Избранные кандидаты</h2> 71 <h2 class="title cabinet__title">Избранные кандидаты</h2>
72 </div> 72 </div>
73 <div class="cabinet__body-item"> 73 <div class="cabinet__body-item">
74 <div class="cabinet__filters"> 74 <div class="cabinet__filters">
75 <div class="cabinet__filters-item"> 75 <div class="cabinet__filters-item">
76 <form class="search" action="{{ route('employer.favorites') }}"> 76 <form class="search" action="{{ route('employer.favorites') }}">
77 <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">
78 <button type="submit" class="button">Найти</button> 78 <button type="submit" class="button">Найти</button>
79 <span> 79 <span>
80 <svg> 80 <svg>
81 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 81 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
82 </svg> 82 </svg>
83 </span> 83 </span>
84 </form> 84 </form>
85 </div> 85 </div>
86 <!--<div class="cabinet__filters-item"> 86 <!--<div class="cabinet__filters-item">
87 <div class="select"> 87 <div class="select">
88 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 88 <select class="js-select2" id="sort_ajax" name="sort_ajax">
89 <option value="default">Сортировка (по умолчанию)</option> 89 <option value="default">Сортировка (по умолчанию)</option>
90 <option value="name (asc)">По имени (возрастание)</option> 90 <option value="name (asc)">По имени (возрастание)</option>
91 <option value="name (desc)">По имени (убывание)</option> 91 <option value="name (desc)">По имени (убывание)</option>
92 <option value="created_at (asc)">По дате (возрастание)</option> 92 <option value="created_at (asc)">По дате (возрастание)</option>
93 <option value="created_at (desc)">По дате (убывание)</option> 93 <option value="created_at (desc)">По дате (убывание)</option>
94 </select> 94 </select>
95 </div> 95 </div>
96 </div>--> 96 </div>-->
97 </div> 97 </div>
98 <div class="cvs"> 98 <div class="cvs">
99 <!--<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">
100 <span>Показать ещё</span> 100 <span>Показать ещё</span>
101 <span>Скрыть</span> 101 <span>Скрыть</span>
102 </button>--> 102 </button>-->
103 @if ((isset($Workers) && ($Workers->count()))) 103 @if ((isset($Workers) && ($Workers->count())))
104 @foreach ($Workers as $it) 104 @foreach ($Workers as $it)
105 <div class="cvs__body"> 105 <div class="cvs__body">
106 <div class="cvs__item"> 106 <div class="cvs__item">
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 <button type="button" data-val="{{ $it->id }}" class="like cvs__item-like js_vac_favorite js-toggle {{ \App\Classes\LikesClass::get_status_worker($it) }}">
108 <svg> 108 <svg>
109 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 109 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
110 </svg> 110 </svg>
111 </button> 111 </button>
112 <div class="cvs__item-photo"> 112 <div class="cvs__item-photo">
113 <svg> 113 <svg>
114 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 114 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
115 </svg> 115 </svg>
116 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 116 <img src="{{ asset('images/default_man.jpg') }}" alt="">
117 </div> 117 </div>
118 <div class="cvs__item-text"> 118 <div class="cvs__item-text">
119 <div> 119 <div>
120 Статус 120 Статус
121 <span>@if ($it->status_work == 0) Ищу работу 121 <span>@if ($it->status_work == 0) Ищу работу
122 @elseif ($it->status_work == 1) Не указано 122 @elseif ($it->status_work == 1) Не указано
123 @elseif ($it->status_work == 2) Не ищу 123 @elseif ($it->status_work == 2) Не ищу
124 @endif 124 @endif
125 </span> 125 </span>
126 </div> 126 </div>
127 <div> 127 <div>
128 Имя кандидата 128 Имя кандидата
129 <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>
130 </div> 130 </div>
131 131
132 @if (!empty($it->telephone)) 132 @if (!empty($it->telephone))
133 <div> 133 <div>
134 Номер телефона 134 Номер телефона
135 <a href="tel:{{ $it->telephone }}">{{ $it->telephone }}</a> 135 <a href="tel:{{ $it->telephone }}">{{ $it->telephone }}</a>
136 </div> 136 </div>
137 @endif 137 @endif
138 138
139 @if (!empty($it->telephone2)) 139 @if (!empty($it->telephone2))
140 <div> 140 <div>
141 Номер телефона2 141 Номер телефона2
142 <a href="tel:{{ $it->telephone2 }}">{{ $it->telephone2 }}</a> 142 <a href="tel:{{ $it->telephone2 }}">{{ $it->telephone2 }}</a>
143 </div> 143 </div>
144 @endif 144 @endif
145 @if (!empty($it->email)) 145 @if (!empty($it->email))
146 <div> 146 <div>
147 Электронный адрес 147 Электронный адрес
148 <a href="emailto: {{ $it->email }}">{{ $it->email }}</a> 148 <a href="emailto: {{ $it->email }}">{{ $it->email }}</a>
149 </div> 149 </div>
150 @endif 150 @endif
151 @if (!empty($it->city)) 151 @if (!empty($it->city))
152 <div> 152 <div>
153 Город проживания 153 Город проживания
154 <span>{{ $it->city }}, {{ $it->address }}</span> 154 <span>{{ $it->city }}, {{ $it->address }}</span>
155 </div> 155 </div>
156 @endif 156 @endif
157 157
158 <div> 158 <div>
159 Опыт работы на танкерах 159 Опыт работы на танкерах
160 <span>@if (!empty($it->experience)) {{ $it->experience }} @else 0 @endif годов (лет).</span> 160 <span>@if (!empty($it->experience)) {{ $it->experience }} @else 0 @endif годов (лет).</span>
161 </div> 161 </div>
162 </div> 162 </div>
163 <div class="cvs__item-button"> 163 <div class="cvs__item-button">
164 <a href="" class="button">Написать соискателю</a> 164 <a href="{{ route('resume_profile', ['worker' => $it->id]) }}" class="button">Написать соискателю</a>
165 </div> 165 </div>
166 </div> 166 </div>
167 </div> 167 </div>
168 @endforeach 168 @endforeach
169 </div> 169 </div>
170 @else 170 @else
171 <div class="notify"> 171 <div class="notify">
172 <svg> 172 <svg>
173 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> 173 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use>
174 </svg> 174 </svg>
175 <span>Нет избранных кандидатов</span> 175 <span>Нет избранных кандидатов</span>
176 </div> 176 </div>
177 @endif 177 @endif
178 </div> 178 </div>
179 </div> 179 </div>
180 </div> 180 </div>
181 </div> 181 </div>
182 182
183 </section> 183 </section>
184 </div> 184 </div>
185 @endsection 185 @endsection
186 186
resources/views/worker.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', '#jobs', function() { 6 $(document).on('change', '#jobs', function() {
7 var val = $(this).val(); 7 var val = $(this).val();
8 var main_oskar = $('#main_ockar'); 8 var main_oskar = $('#main_ockar');
9 9
10 console.log('Code='+val); 10 console.log('Code='+val);
11 console.log('Click change...'); 11 console.log('Click change...');
12 $.ajax({ 12 $.ajax({
13 type: "GET", 13 type: "GET",
14 url: "", 14 url: "",
15 data: "job="+val, 15 data: "job="+val,
16 success: function (data) { 16 success: function (data) {
17 console.log('Выбор сделан!'); 17 console.log('Выбор сделан!');
18 console.log(data); 18 console.log(data);
19 main_oskar.html(data); 19 main_oskar.html(data);
20 }, 20 },
21 headers: { 21 headers: {
22 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 22 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
23 }, 23 },
24 error: function (data) { 24 error: function (data) {
25 data = JSON.stringify(data); 25 data = JSON.stringify(data);
26 console.log('Error: ' + data); 26 console.log('Error: ' + data);
27 } 27 }
28 }); 28 });
29 }); 29 });
30 </script> 30 </script>
31 @include('js.favorite-worker')
31 @endsection 32 @endsection
32 33
33 @section('content') 34 @section('content')
34 <section class="thing"> 35 <section class="thing">
35 <div class="container"> 36 <div class="container">
36 <ul class="breadcrumbs thing__breadcrumbs"> 37 <ul class="breadcrumbs thing__breadcrumbs">
37 <li><a href="{{ route('index') }}">Главная</a></li> 38 <li><a href="{{ route('index') }}">Главная</a></li>
38 <li><a href="{{ route('bd_resume') }}">База резюме</a></li> 39 <li><a href="{{ route('bd_resume') }}">База резюме</a></li>
39 <li><b>@if (isset($Query[0]->users)) {{ $Query[0]->users->surname." ".$Query[0]->users->name_man." ".$Query[0]->users->surname2 }} @else Неизвестно @endif</b></li> 40 <li><b>@if (isset($Query[0]->users)) {{ $Query[0]->users->surname." ".$Query[0]->users->name_man." ".$Query[0]->users->surname2 }} @else Неизвестно @endif</b></li>
40 </ul> 41 </ul>
41 <div class="thing__profile"> 42 <div class="thing__profile">
42 <img src="@isset($Query->photo) {{ asset(Storage::url($Query->photo)) }} @else {{ asset('images/default_man.jpg') }} @endif" alt="" class="thing__profile-photo"> 43 <img src="@isset($Query->photo) {{ asset(Storage::url($Query->photo)) }} @else {{ asset('images/default_man.jpg') }} @endif" alt="" class="thing__profile-photo">
43 <div class="thing__profile-body"> 44 <div class="thing__profile-body">
44 <h1 class="thing__title">@if (isset($Query[0]->users)) {{ $Query[0]->users->surname." ".$Query[0]->users->name_man." ".$Query[0]->users->surname2 }} @else Неизвестно @endif</h1> 45 <h1 class="thing__title">@if (isset($Query[0]->users)) {{ $Query[0]->users->surname." ".$Query[0]->users->name_man." ".$Query[0]->users->surname2 }} @else Неизвестно @endif</h1>
45 <p class="thing__text">Сложно сказать, почему ключевые особенности структуры проекта рассмотрены 46 <p class="thing__text">Сложно сказать, почему ключевые особенности структуры проекта рассмотрены
46 исключительно в разрезе маркетинговых и финансовых предпосылок.</p> 47 исключительно в разрезе маркетинговых и финансовых предпосылок.</p>
47 <div class="thing__bottom"> 48 <div class="thing__bottom">
48 <a class="button" href="{{ route('resume_download', ['worker' => $Query[0]->id]) }}"> 49 <a class="button" href="{{ route('resume_download', ['worker' => $Query[0]->id]) }}">
49 Скачать резюме 50 Скачать резюме
50 <svg> 51 <svg>
51 <use xlink:href="{{ asset('images/sprite.svg#download') }}"></use> 52 <use xlink:href="{{ asset('images/sprite.svg#download') }}"></use>
52 </svg> 53 </svg>
53 </a> 54 </a>
54 <button type="button" class="like js-toggle"> 55 <button type="button" class="like js-toggle">
55 <svg> 56 <svg>
56 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 57 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
57 </svg> 58 </svg>
58 </button> 59 </button>
59 </div> 60 </div>
60 </div> 61 </div>
61 </div> 62 </div>
62 </div> 63 </div>
63 </section> 64 </section>
64 <main class="main"> 65 <main class="main">
65 <div class="container"> 66 <div class="container">
66 <div class="main__resume-profile"> 67 <div class="main__resume-profile">
67 <div class="main__content"> 68 <div class="main__content">
68 <div class="main__spoiler"> 69 <div class="main__spoiler">
69 <button type="button" class="main__spoiler-toper js-toggle active"> 70 <button type="button" class="main__spoiler-toper js-toggle active">
70 Основная информация</button> 71 Основная информация</button>
71 72
72 <div class="main__spoiler-body"> 73 <div class="main__spoiler-body">
73 <table class="main__table"> 74 <table class="main__table">
74 <tbody> 75 <tbody>
75 <tr> 76 <tr>
76 <td>Имя:</td> 77 <td>Имя:</td>
77 <td><b>{{ $Query[0]->users->name_man }}</b></td> 78 <td><b>{{ $Query[0]->users->name_man }}</b></td>
78 </tr> 79 </tr>
79 <tr> 80 <tr>
80 <td>Должность:</td> 81 <td>Должность:</td>
81 <td><b>@if (isset($Query[0]->job_titles[0]->name)) {{ $Query[0]->job_titles[0]->name }} @else Не указано @endif</b></td> 82 <td><b>@if (isset($Query[0]->job_titles[0]->name)) {{ $Query[0]->job_titles[0]->name }} @else Не указано @endif</b></td>
82 </tr> 83 </tr>
83 <tr> 84 <tr>
84 <td>Телефон:</td> 85 <td>Телефон:</td>
85 <td><b><a href="tel:{{ $Query[0]->telephone }}">{{ $Query[0]->telephone }}</a></b></td> 86 <td><b><a href="tel:{{ $Query[0]->telephone }}">{{ $Query[0]->telephone }}</a></b></td>
86 </tr> 87 </tr>
87 <tr> 88 <tr>
88 <td>E-mail:</td> 89 <td>E-mail:</td>
89 <td><b><a href="emailto:{{ $Query[0]->email }}">{{ $Query[0]->email }}</a></b></td> 90 <td><b><a href="emailto:{{ $Query[0]->email }}">{{ $Query[0]->email }}</a></b></td>
90 </tr> 91 </tr>
91 <tr> 92 <tr>
92 <td>Возраст:</td> 93 <td>Возраст:</td>
93 <td><b>{{ $Query[0]->old_year }}</b></td> 94 <td><b>{{ $Query[0]->old_year }}</b></td>
94 </tr> 95 </tr>
95 <tr> 96 <tr>
96 <td>Статус:</td> 97 <td>Статус:</td>
97 <td><b>{{ $status_work[$Query[0]->status_work] }}</b></td> 98 <td><b>{{ $status_work[$Query[0]->status_work] }}</b></td>
98 </tr> 99 </tr>
99 <tr> 100 <tr>
100 <td>Город проживания:</td> 101 <td>Город проживания:</td>
101 <td><b>{{ $Query[0]->city }}</b></td> 102 <td><b>{{ $Query[0]->city }}</b></td>
102 </tr> 103 </tr>
103 <tr> 104 <tr>
104 <td>Уровень английского:</td> 105 <td>Уровень английского:</td>
105 <td><b>{{ $Query[0]->en_is }}</b></td> 106 <td><b>{{ $Query[0]->en_is }}</b></td>
106 </tr> 107 </tr>
107 <tr> 108 <tr>
108 <td>Опыт работы:</td> 109 <td>Опыт работы:</td>
109 <td><b>{{ $Query[0]->experience }}</b></td> 110 <td><b>{{ $Query[0]->experience }}</b></td>
110 </tr> 111 </tr>
111 </tbody> 112 </tbody>
112 </table> 113 </table>
113 </div> 114 </div>
114 </div> 115 </div>
115 <div class="main__spoiler"> 116 <div class="main__spoiler">
116 <button type="button" class="main__spoiler-toper js-toggle">Сертификаты / документы</button> 117 <button type="button" class="main__spoiler-toper js-toggle">Сертификаты / документы</button>
117 <div class="main__spoiler-body"> 118 <div class="main__spoiler-body">
118 119
119 @if (isset($Query[0]->sertificate)) 120 @if (isset($Query[0]->sertificate))
120 @if ($Query[0]->sertificate->count()) 121 @if ($Query[0]->sertificate->count())
121 @foreach($Query[0]->sertificate as $it) 122 @foreach($Query[0]->sertificate as $it)
122 <table class="main__table"> 123 <table class="main__table">
123 <tbody> 124 <tbody>
124 <tr> 125 <tr>
125 <td>Название сертификата:</td> 126 <td>Название сертификата:</td>
126 <td><b>{{ $it->name }}</b></td> 127 <td><b>{{ $it->name }}</b></td>
127 </tr> 128 </tr>
128 <tr> 129 <tr>
129 <td>Организация выдавшая документ:</td> 130 <td>Организация выдавшая документ:</td>
130 <td><b>{{ $it->education }}</b></td> 131 <td><b>{{ $it->education }}</b></td>
131 </tr> 132 </tr>
132 <tr> 133 <tr>
133 <td>Дата начала обучения:</td> 134 <td>Дата начала обучения:</td>
134 <td><b>{{ $it->date_begin }}</b></td> 135 <td><b>{{ $it->date_begin }}</b></td>
135 </tr> 136 </tr>
136 <tr> 137 <tr>
137 <td>Дата конца обучения:</td> 138 <td>Дата конца обучения:</td>
138 <td><b>{{ $it->end_begin }}</b></td> 139 <td><b>{{ $it->end_begin }}</b></td>
139 </tr> 140 </tr>
140 </tbody> 141 </tbody>
141 </table> 142 </table>
142 <br> 143 <br>
143 @endforeach 144 @endforeach
144 @endif 145 @endif
145 @endif 146 @endif
146 </div> 147 </div>
147 </div> 148 </div>
148 149
149 <div class="main__spoiler"> 150 <div class="main__spoiler">
150 <button type="button" class="main__spoiler-toper js-toggle">Опыт работы</button> 151 <button type="button" class="main__spoiler-toper js-toggle">Опыт работы</button>
151 <div class="main__spoiler-body"> 152 <div class="main__spoiler-body">
152 153
153 @if (isset($Query[0]->place_worker)) 154 @if (isset($Query[0]->place_worker))
154 @if ($Query[0]->place_worker->count()) 155 @if ($Query[0]->place_worker->count())
155 @foreach($Query[0]->place_worker as $it) 156 @foreach($Query[0]->place_worker as $it)
156 157
157 <table class="main__table"> 158 <table class="main__table">
158 <tbody> 159 <tbody>
159 <tr> 160 <tr>
160 <td>Должность:</td> 161 <td>Должность:</td>
161 <td><b>{{ $it->job_title }}</b></td> 162 <td><b>{{ $it->job_title }}</b></td>
162 </tr> 163 </tr>
163 <tr> 164 <tr>
164 <td>Опыт работы в танкерном флоте:</td> 165 <td>Опыт работы в танкерном флоте:</td>
165 <td><b>@if($it->tanker==1) Есть @else Нет @endif</b></td> 166 <td><b>@if($it->tanker==1) Есть @else Нет @endif</b></td>
166 </tr> 167 </tr>
167 <tr> 168 <tr>
168 <td>Дата начала работы:</td> 169 <td>Дата начала работы:</td>
169 <td><b>{{ $it->begin_work }}</b></td> 170 <td><b>{{ $it->begin_work }}</b></td>
170 </tr> 171 </tr>
171 <tr> 172 <tr>
172 <td>Дата конца работы:</td> 173 <td>Дата конца работы:</td>
173 <td><b>{{ $it->end_work }}</b></td> 174 <td><b>{{ $it->end_work }}</b></td>
174 </tr> 175 </tr>
175 <tr> 176 <tr>
176 <td>Название компании:</td> 177 <td>Название компании:</td>
177 <td><b>{{ $it->name_company }}</b></td> 178 <td><b>{{ $it->name_company }}</b></td>
178 </tr> 179 </tr>
179 <tr> 180 <tr>
180 <td>GWT тип</td> 181 <td>GWT тип</td>
181 <td><b>{{ $it->GWT }}</b></td> 182 <td><b>{{ $it->GWT }}</b></td>
182 </tr> 183 </tr>
183 <tr> 184 <tr>
184 <td>ГД:</td> 185 <td>ГД:</td>
185 <td><b>{{ $it->KBT }}</b></td> 186 <td><b>{{ $it->KBT }}</b></td>
186 </tr> 187 </tr>
187 </tbody> 188 </tbody>
188 </table> 189 </table>
189 <br> 190 <br>
190 @endforeach 191 @endforeach
191 @endif 192 @endif
192 @endif 193 @endif
193 </div> 194 </div>
194 </div> 195 </div>
195 196
196 <div class="main__spoiler"> 197 <div class="main__spoiler">
197 <button type="button" class="main__spoiler-toper js-toggle">Дополнительные документы</button> 198 <button type="button" class="main__spoiler-toper js-toggle">Дополнительные документы</button>
198 <div class="main__spoiler-body"> 199 <div class="main__spoiler-body">
199 200
200 @if (isset($Query[0]->infobloks)) 201 @if (isset($Query[0]->infobloks))
201 @if ($Query[0]->infobloks->count()) 202 @if ($Query[0]->infobloks->count())
202 <table class="main__table"> 203 <table class="main__table">
203 <tbody> 204 <tbody>
204 @foreach($Query[0]->infobloks as $it) 205 @foreach($Query[0]->infobloks as $it)
205 <tr> 206 <tr>
206 <td>Документ:</td> 207 <td>Документ:</td>
207 <td><b>{{ $it->name }}</b></td> 208 <td><b>{{ $it->name }}</b></td>
208 </tr> 209 </tr>
209 @endforeach 210 @endforeach
210 </tbody> 211 </tbody>
211 </table> 212 </table>
212 @endif 213 @endif
213 @endif 214 @endif
214 </div> 215 </div>
215 </div> 216 </div>
216 </div> 217 </div>
217 <div class="main__resume-profile-about"> 218 <div class="main__resume-profile-about">
218 <h2 class="main__resume-profile-about-title">О себе</h2> 219 <h2 class="main__resume-profile-about-title">О себе</h2>
219 <p class="main__resume-profile-about-text">{{ $Query[0]->text }}</p> 220 <p class="main__resume-profile-about-text">{{ $Query[0]->text }}</p>
220 <div class="button main__resume-profile-about-button" data-fancybox data-src="#send" data-options='{"touch":false,"autoFocus":false}'>Написать сообщение</div> 221 <!--<div class="button main__resume-profile-about-button js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $Query[0]->id }}" data-options='{"touch":false,"autoFocus":false}'>Написать сообщение</div>-->
221 </div> 222 </div>
222 <div class="main__resume-profile-info"> 223 <div class="main__resume-profile-info">
223 <h2 class="main__resume-profile-info-title">Данные о прошлых компаниях</h2> 224 <h2 class="main__resume-profile-info-title">Данные о прошлых компаниях</h2>
224 <div class="main__resume-profile-info-body"> 225 <div class="main__resume-profile-info-body">
225 @if ((isset($Query[0]->prev_company)) && ($Query[0]->prev_company->count())) 226 @if ((isset($Query[0]->prev_company)) && ($Query[0]->prev_company->count()))
226 @foreach ($Query[0]->prev_company as $it) 227 @foreach ($Query[0]->prev_company as $it)
227 <div class="main__resume-profile-info-body-item"> 228 <div class="main__resume-profile-info-body-item">
228 <h3 class="main__resume-profile-info-body-subtitle">{{ $it->name_company }}</h3> 229 <h3 class="main__resume-profile-info-body-subtitle">{{ $it->name_company }}</h3>
229 <ul class="main__resume-profile-info-body-inner"> 230 <ul class="main__resume-profile-info-body-inner">
230 <li> 231 <li>
231 <b>Руководитель</b> 232 <b>Руководитель</b>
232 <span>{{ $it->direct }}</span> 233 <span>{{ $it->direct }}</span>
233 </li> 234 </li>
234 <li> 235 <li>
235 <b>Телефон того, кто может дать рекомендацию</b> 236 <b>Телефон того, кто может дать рекомендацию</b>
236 <span> 237 <span>
237 @if (!empty($it->telephone)) 238 @if (!empty($it->telephone))
238 <a href="tel:{{$it->telephone }}">{{ $it->telephone }}</a> 239 <a href="tel:{{$it->telephone }}">{{ $it->telephone }}</a>
239 @endif 240 @endif
240 @if (!empty($it->telephone2)) 241 @if (!empty($it->telephone2))
241 <a href="tel:{{$it->telephone2 }}">{{ $it->telephone2 }}</a> 242 <a href="tel:{{$it->telephone2 }}">{{ $it->telephone2 }}</a>
242 @endif 243 @endif
243 </span> 244 </span>
244 </li> 245 </li>
245 </ul> 246 </ul>
246 </div> 247 </div>
247 @endforeach 248 @endforeach
248 @else 249 @else
249 <div class="main__resume-profile-info-body-item"> 250 <div class="main__resume-profile-info-body-item">
250 <h3 class="main__resume-profile-info-body-subtitle">Нету данных о компании</h3> 251 <h3 class="main__resume-profile-info-body-subtitle">Нету данных о компании</h3>
251 </div> 252 </div>
252 @endif 253 @endif
253 </div> 254 </div>
254 </div> 255 </div>
255 256
256 <div class="main__resume-profile-review"> 257 <div class="main__resume-profile-review">
257 <form action="{{ route('stars_answer') }}" method="POST"> 258 <form action="{{ route('stars_answer') }}" method="POST">
258 @csrf 259 @csrf
259 <h2 class="main__resume-profile-review-title">Оставить отзыв о работнике</h2> 260 <h2 class="main__resume-profile-review-title">Оставить отзыв о работнике</h2>
260 <div class="rate"> 261 <div class="rate">
261 <div class="rate__label">Ваша оценка:</div> 262 <div class="rate__label">Ваша оценка:</div>
262 <div class="rate__stars"> 263 <div class="rate__stars">
263 <select name="stars" id="stars" class="star-rating js-stars"> 264 <select name="stars" id="stars" class="star-rating js-stars">
264 <option value="5">5</option> 265 <option value="5">5</option>
265 <option value="4">4</option> 266 <option value="4">4</option>
266 <option value="3">3</option> 267 <option value="3">3</option>
267 <option value="2">2</option> 268 <option value="2">2</option>
268 <option value="1" selected>1</option> 269 <option value="1" selected>1</option>
269 </select> 270 </select>
270 </div> 271 </div>
271 </div> 272 </div>
272 <input type="hidden" name="worker_id" id="worker_id" value="{{ $Query[0]->id }}"/> 273 <input type="hidden" name="worker_id" id="worker_id" value="{{ $Query[0]->id }}"/>
273 <div class="main__resume-profile-review-body"> 274 <div class="main__resume-profile-review-body">
274 <h3>Ваш отзыв</h3> 275 <h3>Ваш отзыв</h3>
275 <textarea class="textarea" name="message" id="message" placeholder="Текст отзыва&hellip;" required></textarea> 276 <textarea class="textarea" name="message" id="message" placeholder="Текст отзыва&hellip;" required></textarea>
276 <button type="submit" class="button">Оставить отзыв</button> 277 <button type="submit" class="button">Оставить отзыв</button>
277 </div> 278 </div>
278 </form> 279 </form>
279 </div> 280 </div>
280 </div> 281 </div>
281 </div> 282 </div>
282 </main> 283 </main>
283 </div> 284 </div>
284 @endsection 285 @endsection
285 286
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-45') 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" 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) }}?>"> 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