Commit 99a41e7618f5ca8521f2d2fa8285be4e0f5bdac2
1 parent
f3766c7c1b
Exists in
master
and in
1 other branch
Личный кабинет пользователя, ajax-обработки
Showing 15 changed files with 707 additions and 290 deletions Side-by-side Diff
- app/Http/Controllers/WorkerController.php
- app/Http/Requests/VacansiaRequiest.php
- app/Models/Dop_info.php
- app/Models/Title_worker.php
- app/Models/Worker.php
- app/Models/sertification.php
- database/migrations/2024_03_05_100903_create_title_workers_table.php
- resources/views/ajax/documents.blade.php
- resources/views/ajax/dop_info.blade.php
- resources/views/employers/messages.blade.php
- resources/views/index.blade.php
- resources/views/layout/frontend.blade.php
- resources/views/workers/cabinet.blade.php
- resources/views/workers/dop_info.blade.php
- routes/web.php
app/Http/Controllers/WorkerController.php
... | ... | @@ -5,10 +5,13 @@ namespace App\Http\Controllers; |
5 | 5 | use App\Classes\RusDate; |
6 | 6 | use App\Models\Ad_employer; |
7 | 7 | use App\Models\Category; |
8 | +use App\Models\Dop_info; | |
8 | 9 | use App\Models\Employer; |
10 | +use App\Models\infobloks; | |
9 | 11 | use App\Models\Job_title; |
10 | 12 | use App\Models\Message; |
11 | 13 | use App\Models\reclame; |
14 | +use App\Models\sertification; | |
12 | 15 | use App\Models\Static_worker; |
13 | 16 | use App\Models\User; |
14 | 17 | use App\Models\User as User_Model; |
... | ... | @@ -20,6 +23,7 @@ use Illuminate\Http\JsonResponse; |
20 | 23 | use Illuminate\Http\Request; |
21 | 24 | use Illuminate\Support\Facades\Auth; |
22 | 25 | use Illuminate\Support\Facades\Hash; |
26 | +use Illuminate\Support\Facades\Storage; | |
23 | 27 | use Illuminate\Support\Facades\Validator; |
24 | 28 | |
25 | 29 | class WorkerController extends Controller |
... | ... | @@ -88,19 +92,90 @@ class WorkerController extends Controller |
88 | 92 | public function cabinet() |
89 | 93 | { |
90 | 94 | $id = Auth()->user()->id; |
91 | - $Worker = Worker::query()->with('sertificate')-> | |
95 | + $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')-> | |
92 | 96 | with('infobloks')->with('place_worker')-> |
93 | 97 | WhereHas('users', |
94 | 98 | function (Builder $query) use ($id) {$query->Where('id', $id); |
95 | 99 | })->get(); |
96 | - dd($Worker); | |
97 | - return view('workers.cabinet', compact('Worker')); | |
100 | + | |
101 | + $Job_titles = Job_title::query()->OrderBy('name')->get(); | |
102 | + $Infoblocks = infobloks::query()->OrderBy('name')->get(); | |
103 | + | |
104 | + return view('workers.cabinet', compact('Worker', 'Job_titles', 'Infoblocks')); | |
98 | 105 | } |
99 | 106 | |
100 | 107 | // Сохранение данных |
101 | 108 | public function cabinet_save(Worker $worker, Request $request) |
102 | 109 | { |
110 | + $id = $worker->id; | |
111 | + $params = $request->all(); | |
112 | + | |
113 | + $job_title_id = $request->get('job_title_id'); | |
114 | + | |
115 | + unset($params['new_diplom']); | |
116 | + unset($params['new_data_begin']); | |
117 | + unset($params['new_data_end']); | |
118 | + unset($params['new_job_title']); | |
119 | + unset($params['new_teplohod']); | |
120 | + unset($params['new_GWT']); | |
121 | + unset($params['new_KBT']); | |
122 | + unset($params['new_Begin_work']); | |
123 | + unset($params['new_End_work']); | |
124 | + unset($params['new_name_company']); | |
125 | + | |
126 | + $rules = [ | |
127 | + 'surname' => ['required', 'string', 'max:255'], | |
128 | + 'name_man' => ['required', 'string', 'max:255'], | |
129 | + 'email' => ['required', 'string', 'email', 'max:255'], | |
130 | + | |
131 | + ]; | |
132 | + | |
133 | + $messages = [ | |
134 | + 'required' => 'Укажите обязательное поле', | |
135 | + 'min' => [ | |
136 | + 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | |
137 | + 'integer' => 'Поле «:attribute» должно быть :min или больше', | |
138 | + 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | |
139 | + ], | |
140 | + 'max' => [ | |
141 | + 'string' => 'Поле «:attribute» должно быть не больше :max символов', | |
142 | + 'integer' => 'Поле «:attribute» должно быть :max или меньше', | |
143 | + 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | |
144 | + ] | |
145 | + ]; | |
146 | + | |
147 | + $validator = Validator::make($params, $rules, $messages); | |
148 | + | |
149 | + if ($validator->fails()) { | |
150 | + return redirect()->route('worker.cabinet')->withErrors($validator); | |
151 | + } else { | |
152 | + | |
153 | + if ($request->has('photo')) { | |
154 | + if (!empty($Worker->photo)) { | |
155 | + Storage::delete($Worker->photo); | |
156 | + } | |
157 | + $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); | |
158 | + } | |
159 | + | |
160 | + if ($request->has('file')) { | |
161 | + if (!empty($Worker->file)) { | |
162 | + Storage::delete($Worker->file); | |
163 | + } | |
164 | + $params['file'] = $request->file('file')->store("worker/$id", 'public'); | |
165 | + } | |
166 | + | |
167 | + $id_wor = $worker->update($params); | |
168 | + | |
169 | + $use = User_Model::find($id_wor); | |
170 | + $use->surname = $request->get('surname'); | |
171 | + $use->name_man = $request->get('name_man'); | |
172 | + $use->surname2 = $request->get('surname2'); | |
173 | + | |
174 | + $use->save(); | |
175 | + $worker->job_titles()->sync($job_title_id); | |
103 | 176 | |
177 | + return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); | |
178 | + } | |
104 | 179 | } |
105 | 180 | |
106 | 181 | // Сообщения данные |
... | ... | @@ -133,11 +208,9 @@ class WorkerController extends Controller |
133 | 208 | // Избранный |
134 | 209 | public function favorite() |
135 | 210 | { |
136 | - dd('dgfghfghfgh'); | |
137 | 211 | return view('workers.favorite'); |
138 | 212 | } |
139 | 213 | |
140 | - | |
141 | 214 | // Сменить пароль |
142 | 215 | public function new_password() |
143 | 216 | { |
... | ... | @@ -360,5 +433,64 @@ class WorkerController extends Controller |
360 | 433 | |
361 | 434 | return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); |
362 | 435 | } |
436 | + | |
437 | + // Даунлоады | |
438 | + public function download(Worker $worker) { | |
439 | + | |
440 | + } | |
441 | + | |
442 | + // Поднятие анкеты | |
443 | + public function up(Worker $worker) { | |
444 | + $worker->updated_at = Carbon::now(); | |
445 | + $worker->save(); | |
446 | + return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); | |
447 | + } | |
448 | + | |
449 | + // Добавление сертификата | |
450 | + public function add_serificate(Request $request) { | |
451 | + $params = $request->all(); | |
452 | + $params['date_begin'] = date('d.m.Y', strtotime($params['date_begin'])); | |
453 | + $params['end_begin'] = date('d.m.Y', strtotime($params['end_begin'])); | |
454 | + $Sertificate = new sertification(); | |
455 | + $Sertificate->create($params); | |
456 | + $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get(); | |
457 | + return view('ajax.documents', compact('Docs')); | |
458 | + } | |
459 | + | |
460 | + | |
461 | + // Удалить сертификат | |
462 | + public function delete_sertificate(sertification $doc) { | |
463 | + $doc->delete(); | |
464 | + | |
465 | + return redirect()->route('worker.cabinet'); | |
466 | + } | |
467 | + | |
468 | + // Добавление диплома | |
469 | + public function add_diplom_ajax(Request $request) { | |
470 | + // конец | |
471 | + $params = $request->all(); | |
472 | + $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); | |
473 | + | |
474 | + if ($count == 0) $dop_info = Dop_info::create($params); | |
475 | + $Infoblocks = infobloks::query()->get(); | |
476 | + $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); | |
477 | + $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); | |
478 | + return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); | |
479 | + } | |
480 | + | |
481 | + // Добавление диплома без ajax | |
482 | + public function add_diplom(Worker $worker) { | |
483 | + $worker_id = $worker->id; | |
484 | + $Infoblocks = infobloks::query()->get(); | |
485 | + return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); | |
486 | + } | |
487 | + // Сохранить | |
488 | + // Сохраняю диплом | |
489 | + public function add_diplom_save(Request $request) { | |
490 | + $params = $request->all(); | |
491 | + $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); | |
492 | + if ($count == 0) $dop_info = Dop_info::create($params); | |
493 | + return redirect()->route('worker.cabinet'); | |
494 | + } | |
363 | 495 | } |
364 | 496 |
app/Http/Requests/VacansiaRequiest.php
... | ... | @@ -48,14 +48,33 @@ class VacansiaRequiest extends FormRequest |
48 | 48 | ], |
49 | 49 | |
50 | 50 | 'salary' => [ |
51 | + 'numeric', | |
51 | 52 | 'min:3', |
52 | 53 | 'max:255', |
53 | 54 | ], |
54 | 55 | |
56 | + 'min_salary' => [ | |
57 | + 'numeric', | |
58 | + 'min:0', | |
59 | + 'max:9999999', | |
60 | + ], | |
61 | + | |
62 | + 'max_salary' => [ | |
63 | + 'numeric', | |
64 | + 'min:0', | |
65 | + 'max:9999999', | |
66 | + ], | |
67 | + | |
55 | 68 | 'city' => [ |
56 | 69 | 'min:3', |
57 | 70 | 'max:255', |
58 | 71 | ], |
72 | + | |
73 | + 'job_title_id' => [ | |
74 | + 'numeric', | |
75 | + 'min:1', | |
76 | + 'max:9999999' | |
77 | + ] | |
59 | 78 | ]; |
60 | 79 | } |
61 | 80 |
app/Models/Dop_info.php
... | ... | @@ -0,0 +1,19 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace App\Models; | |
4 | + | |
5 | +use Illuminate\Database\Eloquent\Factories\HasFactory; | |
6 | +use Illuminate\Database\Eloquent\Model; | |
7 | + | |
8 | +class Dop_info extends Model | |
9 | +{ | |
10 | + use HasFactory; | |
11 | + | |
12 | + public $table = 'dop_info'; | |
13 | + | |
14 | + public $fillable = [ | |
15 | + 'worker_id', | |
16 | + 'infoblok_id', | |
17 | + 'text' | |
18 | + ]; | |
19 | +} |
app/Models/Title_worker.php
app/Models/Worker.php
... | ... | @@ -62,7 +62,7 @@ class Worker extends Model |
62 | 62 | |
63 | 63 | // Связь Работника с должностями (0-0 - 1) |
64 | 64 | public function job_titles() { |
65 | - return $this->hasMany(Job_title::class, 'id'); | |
65 | + return $this->belongsToMany(Job_title::class, 'title_workers'); | |
66 | 66 | } |
67 | 67 | |
68 | 68 | //Связь Работника с опытом работы (1 - 0-0) |
app/Models/sertification.php
database/migrations/2024_03_05_100903_create_title_workers_table.php
... | ... | @@ -0,0 +1,33 @@ |
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('title_workers', function (Blueprint $table) { | |
17 | + $table->id(); | |
18 | + $table->bigInteger('worker_id')->nullable(false); | |
19 | + $table->bigInteger('jib_title_id')->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('title_workers'); | |
32 | + } | |
33 | +}; |
resources/views/ajax/documents.blade.php
... | ... | @@ -0,0 +1,37 @@ |
1 | +@if ($Docs->count()) | |
2 | + @php $i = 0; @endphp | |
3 | + @foreach($Docs as $it) | |
4 | + <div style="margin-bottom: 20px" class="cabinet__body-item"> | |
5 | + @if ($i == 0) | |
6 | + <h3 class="cabinet__subtitle">Сертификаты / документы</h3> | |
7 | + @endif | |
8 | + <h4 class="cabinet__h4">Сертификат {{ $i+1 }}</h4> | |
9 | + <div class="cabinet__inputs"> | |
10 | + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
11 | + <label class="form-group__label">Название сертификата</label> | |
12 | + <div class="form-group__item"> | |
13 | + <input type="text" class="input" value="{{ $it->name }}" disabled> | |
14 | + </div> | |
15 | + </div> | |
16 | + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
17 | + <label class="form-group__label">Название сертификата</label> | |
18 | + <div class="form-group__item"> | |
19 | + <input type="text" class="input" value="{{ $it->date_begin }} - {{ $it->end_begin }}" disabled> | |
20 | + </div> | |
21 | + </div> | |
22 | + <button type="button" class="button button_light"> | |
23 | + <svg> | |
24 | + <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> | |
25 | + </svg> | |
26 | + Удалить | |
27 | + </button> | |
28 | + </div> | |
29 | + </div> | |
30 | + @php $i++ @endphp | |
31 | + @endforeach | |
32 | +@else | |
33 | + <div style="margin-bottom: 20px" class="cabinet__body-item"> | |
34 | + <h3 class="cabinet__subtitle">Сертификаты / документы</h3> | |
35 | + Нет сертификатов | |
36 | + </div> | |
37 | +@endif |
resources/views/ajax/dop_info.blade.php
... | ... | @@ -0,0 +1,51 @@ |
1 | +<h4 class="cabinet__h4">Дополнительная информация</h4> | |
2 | +<div class="cabinet__inputs"> | |
3 | + <div class="cabinet__inputs-item form-group"> | |
4 | + <label class="form-group__label">Верю</label> | |
5 | + <div class="form-group__item"> | |
6 | + <div class="select"> | |
7 | + <select class="js-select2 sertificates_js"> | |
8 | + <option value="0">Нет</option> | |
9 | + <option value="1" selected>Да</option> | |
10 | + </select> | |
11 | + </div> | |
12 | + </div> | |
13 | + </div> | |
14 | + @if (isset($Worker[0]->infobloks)) | |
15 | + @if ($Worker[0]->infobloks->count()) | |
16 | + @php $i = 1; @endphp | |
17 | + @foreach ($Worker[0]->infobloks as $info) | |
18 | + <div class="cabinet__inputs-item form-group"> | |
19 | + <label class="form-group__label">{{ $info->name }}</label> | |
20 | + <div class="form-group__item"> | |
21 | + <div class="select"> | |
22 | + <select class="js-select2 sertificates_js"> | |
23 | + <option value="0">Нет</option> | |
24 | + <option value="1" selected>Да</option> | |
25 | + </select> | |
26 | + </div> | |
27 | + </div> | |
28 | + </div> | |
29 | + @php $i++; @endphp | |
30 | + @endforeach | |
31 | + @endif | |
32 | + @endif | |
33 | + | |
34 | + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
35 | + <label class="form-group__label">Образцы дипломов и документов</label> | |
36 | + <div class="form-group__item"> | |
37 | + <div class="select"> | |
38 | + <select class="js-select2" id="documents" name="documents"> | |
39 | + @if ($Infoblocks->count()) | |
40 | + @foreach ($Infoblocks as $it) | |
41 | + <option value="{{ $it->id }}">{{ $it->name }}</option> | |
42 | + @endforeach | |
43 | + @endif | |
44 | + </select> | |
45 | + </div> | |
46 | + </div> | |
47 | + </div> | |
48 | + <div name="btn_new_diplom" data-val="{{ $Worker[0]->id }}" id="btn_new_diplom" class="button button_light"> | |
49 | + Добавить документ | |
50 | + </div> | |
51 | +</div> |
resources/views/employers/messages.blade.php
... | ... | @@ -67,7 +67,7 @@ |
67 | 67 | |
68 | 68 | <div class="cabinet__body"> |
69 | 69 | <div class="cabinet__body-item"> |
70 | - <h2 class="title cabinet__title">Сообщения123</h2> | |
70 | + <h2 class="title cabinet__title">Сообщения</h2> | |
71 | 71 | </div> |
72 | 72 | <div class="cabinet__body-item"> |
73 | 73 | <div class="cabinet__filters"> |
resources/views/index.blade.php
... | ... | @@ -20,8 +20,10 @@ |
20 | 20 | let d = JSON.parse(data); |
21 | 21 | if(typeof d['REDIRECT'] !== "undefined") { |
22 | 22 | location.href = d['REDIRECT']; |
23 | + console.log(d['REDIRECT']); | |
23 | 24 | } |
24 | 25 | if (typeof d['ERROR'] !== "undefined") { |
26 | + console.log(d['ERROR']); | |
25 | 27 | $('#message_error').html(d['ERROR']); |
26 | 28 | } |
27 | 29 | console.log(d['REDIRECT']); |
resources/views/layout/frontend.blade.php
... | ... | @@ -9,6 +9,11 @@ |
9 | 9 | <script src="{{ asset('js/jquery.js') }}"></script> |
10 | 10 | <script type="text/javascript" src="{{ asset('js/jquery.cookie.js') }}"></script> |
11 | 11 | <link rel="stylesheet" href="{{ asset('css/style.css') }}"> |
12 | + <style> | |
13 | + .err_red { | |
14 | + border: red 2px solid; | |
15 | + } | |
16 | + </style> | |
12 | 17 | </head> |
13 | 18 | |
14 | 19 | <body id="body"> |
resources/views/workers/cabinet.blade.php
1 | 1 | @extends('layout.frontend', ['title' => 'Моя анкета - РекаМоре']) |
2 | 2 | |
3 | 3 | @section('scripts') |
4 | + <script> | |
5 | + console.log('Test system'); | |
6 | + $(document).on('click', '#button_new_doc', function() { | |
7 | + var this_ = $(this); | |
8 | + var val_ = this_.attr('data-val'); | |
9 | + var new_diplom = $('#new_diplom'); | |
10 | + var new_diplom_val = new_diplom.val(); | |
11 | + var new_data_begin = $('#new_data_begin'); | |
12 | + var new_data_begin_val = new_data_begin.val(); | |
13 | + var new_data_end = $('#new_data_end'); | |
14 | + var new_data_end_val = new_data_end.val(); | |
15 | + var education = $('#education'); | |
16 | + var education_val = education.val(); | |
17 | + var worker_id = $('#new_id'); | |
18 | + var worker_val = worker_id.val(); | |
4 | 19 | |
20 | + console.log('sort items ' + val_); | |
21 | + | |
22 | + if (new_diplom_val == '') { | |
23 | + new_diplom.addClass('err_red'); | |
24 | + console.log('Border Up'); | |
25 | + } else { | |
26 | + $.ajax({ | |
27 | + type: "GET", | |
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, | |
30 | + success: function (data) { | |
31 | + console.log('Блокировка...'); | |
32 | + console.log(data); | |
33 | + $('#sertificate').html(data); | |
34 | + if (new_diplom.hasClass('err_red')) new_diplom.removeClass('err_red'); | |
35 | + }, | |
36 | + headers: { | |
37 | + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | |
38 | + }, | |
39 | + error: function (data) { | |
40 | + data = JSON.stringify(data); | |
41 | + console.log('Error: ' + data); | |
42 | + } | |
43 | + }); | |
44 | + } | |
45 | + }); | |
46 | + | |
47 | + $(document).on('click', '#btn_new_diplom123', function() { | |
48 | + var this_ = $(this); | |
49 | + var val_ = this_.attr('data-val'); | |
50 | + var documents = $('#documents'); | |
51 | + var doc_val = documents.val(); | |
52 | + var block = $('#ajax_dop_diplomi'); | |
53 | + | |
54 | + console.log('worker_id='+val_+'it_infoblock='+ doc_val); | |
55 | + | |
56 | + $.ajax({ | |
57 | + type: "GET", | |
58 | + url: "", | |
59 | + data: "worker_id="+val_+"&infoblok_id="+doc_val, | |
60 | + success: function (data) { | |
61 | + location.url = data; | |
62 | + console.log('Добавление документа-диплома'); | |
63 | + console.log(data); | |
64 | + block.html(data); | |
65 | + }, | |
66 | + headers: { | |
67 | + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | |
68 | + }, | |
69 | + error: function (data) { | |
70 | + data = JSON.stringify(data); | |
71 | + console.log('Error: ' + data); | |
72 | + } | |
73 | + }); | |
74 | + }); | |
75 | + | |
76 | + $(document).on('click', '#new_work', function() { | |
77 | + var this_ = $(this); | |
78 | + var val_ = this_.attr('data-val'); | |
79 | + var new_diplom = $('#new_diplom').val(); | |
80 | + var new_data_begin = $('#new_data_begin').val(); | |
81 | + var new_data_end = $('#new_data_end').val(); | |
82 | + var new_job_title = $('#new_job_title').val(); | |
83 | + var new_teplohod = $('#new_teplohod').val(); | |
84 | + var new_GWT = $('#new_GWT').val(); | |
85 | + var new_KBT = $('#new_KBT').val(); | |
86 | + var new_Begin_work = $('#new_Begin_work').val(); | |
87 | + var new_End_work = $('#new_End_work').val(); | |
88 | + var new_name_company = $('#new_name_company').val(); | |
89 | + | |
90 | + console.log('worker_id='+val_+'it_infoblock='+ doc_val); | |
91 | + | |
92 | + $.ajax({ | |
93 | + type: "GET", | |
94 | + url: "", | |
95 | + data: "worker_id="+val_+"&infoblok_id="+doc_val, | |
96 | + success: function (data) { | |
97 | + location.url = data; | |
98 | + console.log('Добавление документа-диплома'); | |
99 | + console.log(data); | |
100 | + block.html(data); | |
101 | + }, | |
102 | + headers: { | |
103 | + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | |
104 | + }, | |
105 | + error: function (data) { | |
106 | + data = JSON.stringify(data); | |
107 | + console.log('Error: ' + data); | |
108 | + } | |
109 | + }); | |
110 | + }); | |
111 | + </script> | |
5 | 112 | @endsection |
6 | 113 | |
7 | 114 | @section('content') |
... | ... | @@ -20,15 +127,17 @@ |
20 | 127 | |
21 | 128 | @include('workers.menu', ['item' => 1]) |
22 | 129 | </div> |
23 | - <form class="cabinet__body"> | |
130 | + <form class="cabinet__body" action="{{ route('worker.cabinet_save', ['worker' => $Worker[0]->id]) }}" enctype="multipart/form-data" method="POST"> | |
131 | + @csrf | |
132 | + @include('messages_error') | |
24 | 133 | <div class="cabinet__body-item"> |
25 | 134 | <div class="cabinet__anketa"> |
26 | 135 | <h2 class="title cabinet__title">Моя анкета</h2> |
27 | 136 | <div class="cabinet__anketa-buttons"> |
28 | - <button type="button" class="button">Поднять резюме</button> | |
29 | - <a href="#" class="button"> | |
137 | + <a href="{{ route('worker.up', ['worker' => $Worker[0]->id]) }}" class="button">Поднять резюме</a> | |
138 | + <a href="{{ route('worker.download', ['worker' => $Worker[0]->id]) }}" class="button"> | |
30 | 139 | <svg> |
31 | - <use xlink:href="images/sprite.svg#share"></use> | |
140 | + <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> | |
32 | 141 | </svg> |
33 | 142 | Скачать резюме |
34 | 143 | </a> |
... | ... | @@ -41,22 +150,22 @@ |
41 | 150 | <div class="cabinet__stats-body"> |
42 | 151 | <div class="cabinet__stats-item"> |
43 | 152 | <svg> |
44 | - <use xlink:href="images/sprite.svg#eye-3"></use> | |
153 | + <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use> | |
45 | 154 | </svg> |
46 | 155 | <span>Просмотров:</span> |
47 | - <b>23</b> | |
156 | + <b>@if (isset($Worker[0]->users->static_user)) 1 @else 0 @endif</b> | |
48 | 157 | </div> |
49 | 158 | <div class="cabinet__stats-item"> |
50 | 159 | <svg> |
51 | - <use xlink:href="images/sprite.svg#warning"></use> | |
160 | + <use xlink:href="{{ asset('images/sprite.svg#warning') }}"></use> | |
52 | 161 | </svg> |
53 | 162 | <span>Отзывов:</span> |
54 | - <b>12</b> | |
163 | + <b>@if (isset($Worker[0]->users->static_user)) 1 @else 0 @endif</b> | |
55 | 164 | </div> |
56 | 165 | </div> |
57 | - <div class="cabinet__stats-subtitle">Анкета заполнена на 20%</div> | |
166 | + <div class="cabinet__stats-subtitle">Анкета заполнена на @if (!empty($Worker[0]->persent_anketa)) {{ $Worker[0]->persent_anketa }}% @else 0% @endif</div> | |
58 | 167 | <div class="cabinet__stats-line"> |
59 | - <span style="width:20%"></span> | |
168 | + <span style="width:@if (!empty($Worker[0]->persent_anketa)) {{ $Worker[0]->persent_anketa }}% @else 0% @endif"></span> | |
60 | 169 | </div> |
61 | 170 | <div class="cabinet__stats-bottom">Заполните профиль, чтобы повысить процент анкеты на 80%</div> |
62 | 171 | </div> |
... | ... | @@ -65,23 +174,29 @@ |
65 | 174 | <h3 class="cabinet__subtitle">Профиль</h3> |
66 | 175 | <div class="cabinet__avatar"> |
67 | 176 | <div class="cabinet__avatar-pic"> |
177 | + | |
178 | + @if (!empty($Worker[0]->photo)) | |
179 | + <img src="{{ asset(Storage::url($Worker[0]->photo)) }}"/> | |
180 | + @else | |
68 | 181 | <svg> |
69 | - <use xlink:href="images/sprite.svg#pic"></use> | |
182 | + <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> | |
70 | 183 | </svg> |
184 | + @endif | |
71 | 185 | </div> |
72 | 186 | <div class="cabinet__avatar-form"> |
73 | 187 | <label class="file"> |
74 | 188 | <span class="file__input"> |
75 | - <input type="file"> | |
189 | + <input type="file" name="photo" id="photo"> | |
190 | + | |
76 | 191 | <span class="button"> |
77 | 192 | <svg> |
78 | - <use xlink:href="images/sprite.svg#plus"></use> | |
193 | + <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use> | |
79 | 194 | </svg> |
80 | 195 | Загрузить |
81 | 196 | </span> |
82 | 197 | </span> |
83 | 198 | </label> |
84 | - <p class="cabinet__text">Загрузите фотографию в формате svg.</p> | |
199 | + <p class="cabinet__text">Загрузите фотографию в формате svg., jpg., jpeg., png.</p> | |
85 | 200 | </div> |
86 | 201 | </div> |
87 | 202 | </div> |
... | ... | @@ -90,21 +205,47 @@ |
90 | 205 | <div class="cabinet__inputs-item form-group"> |
91 | 206 | <label class="form-group__label">Электронная почта *</label> |
92 | 207 | <div class="form-group__item"> |
93 | - <input type="email" class="input" placeholder="info@rekamore.su" required> | |
208 | + <input type="email" name="email" id="email" value="{{ $Worker[0]->email }}" class="input" placeholder="info@rekamore.su" required> | |
94 | 209 | </div> |
95 | 210 | </div> |
96 | 211 | <div class="cabinet__inputs-item form-group"> |
212 | + <label class="form-group__label">Статус</label> | |
213 | + <div class="form-group__item"> | |
214 | + <div class="select"> | |
215 | + <select class="js-select2" name="status_work" id="status_work"> | |
216 | + <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> | |
218 | + <option value="0" @if ($Worker[0]->status_work == 0) selected @endif>Ищу работу</option> | |
219 | + </select> | |
220 | + </div> | |
221 | + </div> | |
222 | + </div> | |
223 | + <!--<div class="cabinet__inputs-item form-group"> | |
97 | 224 | <label class="form-group__label">Статус *</label> |
98 | 225 | <div class="form-group__item"> |
99 | 226 | <input type="text" class="input" required> |
100 | 227 | </div> |
228 | + </div>--> | |
229 | + @if (isset($Worker[0]->users)) | |
230 | + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
231 | + <label class="form-group__label">Фамилия *</label> | |
232 | + <div class="form-group__item"> | |
233 | + <input type="text" name="surname" id="surmane" class="input" value="{{ $Worker[0]->users->surname }}" placeholder="Филиппов" required> | |
234 | + </div> | |
101 | 235 | </div> |
102 | 236 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
103 | - <label class="form-group__label">ФИО *</label> | |
237 | + <label class="form-group__label">Имя *</label> | |
104 | 238 | <div class="form-group__item"> |
105 | - <input type="text" class="input" placeholder="Филиппов Егор Алексеевич" required> | |
239 | + <input type="text" name="name_man" id="name_man" class="input" value="{{ $Worker[0]->users->name_man }}" placeholder="Егор" required> | |
106 | 240 | </div> |
107 | 241 | </div> |
242 | + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
243 | + <label class="form-group__label">Отчество *</label> | |
244 | + <div class="form-group__item"> | |
245 | + <input type="text" class="input" name="surname2" id="surmane2" value="{{ $Worker[0]->users->surname2 }}" placeholder="Алексеевич"> | |
246 | + </div> | |
247 | + </div> | |
248 | + @endif | |
108 | 249 | </div> |
109 | 250 | </div> |
110 | 251 | <div class="cabinet__body-item"> |
... | ... | @@ -113,319 +254,211 @@ |
113 | 254 | <div class="cabinet__inputs-item cabinet__inputs-item_min form-group"> |
114 | 255 | <label class="form-group__label">Возраст</label> |
115 | 256 | <div class="form-group__item"> |
116 | - <input type="number" class="input" placeholder="0" required> | |
257 | + <input type="number" name="old_year" id="old_year" value="{{ $Worker[0]->old_year }}" class="input" placeholder="0" required> | |
117 | 258 | </div> |
118 | 259 | </div> |
119 | 260 | <div class="cabinet__inputs-item cabinet__inputs-item_max form-group"> |
120 | - <label class="form-group__label">Возраст</label> | |
261 | + <label class="form-group__label">Желаемые вакансии</label> | |
121 | 262 | <div class="form-group__item"> |
122 | 263 | <div class="select"> |
123 | - <select class="js-select2" multiple="multiple"> | |
124 | - <option selected>Капитан</option> | |
125 | - <option selected>Старший помощник капитана</option> | |
126 | - <option>Сортировка 1</option> | |
127 | - <option>Сортировка 2</option> | |
128 | - <option>Сортировка 3</option> | |
129 | - <option>Сортировка 4</option> | |
130 | - <option>Сортировка 5</option> | |
131 | - <option>Сортировка 6</option> | |
264 | + <select class="js-select2" name="job_title_id[]" id="job_title_id[]" multiple="multiple"> | |
265 | + @if ($Job_titles->count()) | |
266 | + @foreach($Job_titles as $it) | |
267 | + @if (isset($Worker[0]->job_titles)) | |
268 | + @if ($Worker[0]->job_titles->count()) | |
269 | + @foreach($Worker[0]->job_titles as $select) | |
270 | + <option value="{{ $it->id }}" @if ($it->id == $select->id) selected @endif>{{ $it->name }}</option> | |
271 | + @endforeach | |
272 | + @else | |
273 | + <option value="{{ $it->id }}">{{ $it->name }} ({{ $it->id }})</option> | |
274 | + @endif | |
275 | + @else | |
276 | + <option value="{{ $it->id }}">{{ $it->name }} ({{ $it->id }})</option> | |
277 | + @endif | |
278 | + @endforeach | |
279 | + @endif | |
132 | 280 | </select> |
133 | 281 | </div> |
134 | 282 | </div> |
135 | 283 | </div> |
136 | 284 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
137 | - <label class="form-group__label">ФИО *</label> | |
285 | + <label class="form-group__label">Город</label> | |
138 | 286 | <div class="form-group__item"> |
139 | - <input type="text" class="input" placeholder="Челябинск" required> | |
287 | + <input type="text" name="city" id="city" value="{{ $Worker[0]->city }}" class="input" placeholder="Челябинск" required> | |
140 | 288 | </div> |
141 | 289 | </div> |
142 | 290 | <div class="cabinet__inputs-item form-group"> |
143 | 291 | <label class="form-group__label">Опыт работы</label> |
144 | 292 | <div class="form-group__item"> |
145 | 293 | <div class="select"> |
146 | - <select class="js-select2"> | |
147 | - <option>1 год</option> | |
148 | - <option>Сортировка 1</option> | |
149 | - <option>Сортировка 2</option> | |
150 | - <option>Сортировка 3</option> | |
151 | - <option>Сортировка 4</option> | |
152 | - <option>Сортировка 5</option> | |
153 | - <option>Сортировка 6</option> | |
154 | - </select> | |
155 | - </div> | |
156 | - </div> | |
157 | - </div> | |
158 | - <div class="cabinet__inputs-item form-group"> | |
159 | - <label class="form-group__label">Кому хотите отправить сообщение</label> | |
160 | - <div class="form-group__item"> | |
161 | - <div class="select"> | |
162 | - <select class="js-select2"> | |
163 | - <option>Не указано</option> | |
164 | - <option>Сортировка 1</option> | |
165 | - <option>Сортировка 2</option> | |
166 | - <option>Сортировка 3</option> | |
167 | - <option>Сортировка 4</option> | |
168 | - <option>Сортировка 5</option> | |
169 | - <option>Сортировка 6</option> | |
294 | + <select class="js-select2" id="experience" name="experience"> | |
295 | + <option value="Не указано" @if (empty($Worker[0]->experience)) selected @endif>Не указано</option> | |
296 | + <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> | |
298 | + <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> | |
300 | + <option value="Больше 10 лет" @if ($Worker[0]->experience == 'Больше 10 лет') selected @endif>Больше 10 лет</option> | |
170 | 301 | </select> |
171 | 302 | </div> |
172 | 303 | </div> |
173 | 304 | </div> |
305 | + | |
174 | 306 | <div class="cabinet__inputs-item form-group"> |
175 | - <label class="form-group__label">Электронная почта</label> | |
307 | + <label class="form-group__label">Номер телефона 1</label> | |
176 | 308 | <div class="form-group__item"> |
177 | - <input type="email" class="input" placeholder="info@rekamore.su" required> | |
309 | + <input type="tel" name="telephone" id="telephone" value="{{ old('telephone') ?? $Worker[0]->telephone ?? '' }}" class="input" placeholder="+7 (___) ___-__-__" required> | |
178 | 310 | </div> |
179 | 311 | </div> |
180 | 312 | <div class="cabinet__inputs-item form-group"> |
181 | - <label class="form-group__label">Номер телефона</label> | |
313 | + <label class="form-group__label">Номер телефона 2</label> | |
182 | 314 | <div class="form-group__item"> |
183 | - <input type="tel" class="input" placeholder="+7 (___) ___-__-__" required> | |
315 | + <input type="tel" name="telephone2" id="telephon2" value="{{ old('telephone2') ?? $Worker[0]->telephone2 ?? '' }}" class="input" placeholder="+7 (___) ___-__-__"> | |
184 | 316 | </div> |
185 | 317 | </div> |
186 | 318 | </div> |
187 | 319 | </div> |
188 | - <div class="cabinet__body-item"> | |
189 | - <h3 class="cabinet__subtitle">Сертификаты / документы</h3> | |
190 | - <h4 class="cabinet__h4">Сертификат 1</h4> | |
191 | - <div class="cabinet__inputs"> | |
192 | - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
193 | - <label class="form-group__label">Название сертификата</label> | |
194 | - <div class="form-group__item"> | |
195 | - <input type="text" class="input" value="Сертификат 1 - Филиппов Егор Алексеевич" disabled> | |
320 | + | |
321 | + <div id="sertificate" name="sertificate"> | |
322 | + @if ((isset($Worker[0]->sertificate)) && ($Worker[0]->sertificate->count() > 0)) | |
323 | + @php $i = 0; @endphp | |
324 | + @foreach($Worker[0]->sertificate as $it) | |
325 | + <div style="margin-bottom: 20px" class="cabinet__body-item"> | |
326 | + @if ($i == 0) | |
327 | + <h3 class="cabinet__subtitle">Сертификаты / документы</h3> | |
328 | + @endif | |
329 | + <h4 class="cabinet__h4">Сертификат {{ $i+1 }}</h4> | |
330 | + <div class="cabinet__inputs"> | |
331 | + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
332 | + <label class="form-group__label">Название сертификата</label> | |
333 | + <div class="form-group__item"> | |
334 | + <input type="text" class="input" value="{{ $it->name }}" disabled> | |
335 | + </div> | |
336 | + </div> | |
337 | + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
338 | + <label class="form-group__label">Название сертификата</label> | |
339 | + <div class="form-group__item"> | |
340 | + <input type="text" class="input" value="{{ $it->date_begin }} - {{ $it->end_begin }}" disabled> | |
341 | + </div> | |
342 | + </div> | |
343 | + <a href="{{ route('worker.delete_sertificate', ['doc' => $it->id]) }}" class="button button_light"> | |
344 | + <svg> | |
345 | + <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> | |
346 | + </svg> | |
347 | + Удалить | |
348 | + </a> | |
196 | 349 | </div> |
197 | 350 | </div> |
198 | - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
199 | - <label class="form-group__label">Название сертификата</label> | |
200 | - <div class="form-group__item"> | |
201 | - <input type="text" class="input" value="04.11.26" disabled> | |
202 | - </div> | |
351 | + @php $i++ @endphp | |
352 | + @endforeach | |
353 | + @else | |
354 | + <div style="margin-bottom: 20px" class="cabinet__body-item"> | |
355 | + <h3 class="cabinet__subtitle">Сертификаты / документы</h3> | |
356 | + Нет сертификатов | |
203 | 357 | </div> |
204 | - <button type="button" class="button button_light"> | |
205 | - <svg> | |
206 | - <use xlink:href="images/sprite.svg#del"></use> | |
207 | - </svg> | |
208 | - Удалить | |
209 | - </button> | |
210 | - </div> | |
358 | + @endif | |
211 | 359 | </div> |
360 | + | |
212 | 361 | <div class="cabinet__body-item"> |
213 | - <h4 class="cabinet__h4">Сертификат 2</h4> | |
362 | + <h4 class="cabinet__h4">Добавить сертификат</h4> | |
214 | 363 | <div class="cabinet__inputs"> |
215 | - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
364 | + <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"> | |
216 | 366 | <label class="form-group__label">Название сертификата</label> |
217 | 367 | <div class="form-group__item"> |
218 | - <input type="text" class="input" value="Сертификат 1 - Филиппов Егор Алексеевич" disabled> | |
368 | + <input type="text" name="new_diplom" id="new_diplom" class="input" value="Диплом о дополнительном образовании"> | |
219 | 369 | </div> |
220 | 370 | </div> |
221 | 371 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
222 | - <label class="form-group__label">Название сертификата</label> | |
372 | + <label class="form-group__label">Дата поступления</label> | |
223 | 373 | <div class="form-group__item"> |
224 | - <input type="text" class="input" value="04.11.26" disabled> | |
374 | + <input type="text" name="new_data_begin" id="new_data_begin" class="input" value="01.09.23"> | |
225 | 375 | </div> |
226 | 376 | </div> |
227 | - <button type="button" class="button button_light"> | |
228 | - <svg> | |
229 | - <use xlink:href="images/sprite.svg#del"></use> | |
230 | - </svg> | |
231 | - Удалить | |
232 | - </button> | |
233 | - </div> | |
234 | - </div> | |
235 | - <div class="cabinet__body-item"> | |
236 | - <h4 class="cabinet__h4">Добавить сертификат</h4> | |
237 | - <div class="cabinet__inputs"> | |
238 | 377 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
239 | - <label class="form-group__label">Название сертификата</label> | |
378 | + <label class="form-group__label">Дата окончания</label> | |
240 | 379 | <div class="form-group__item"> |
241 | - <input type="text" class="input" value="Сертификат 1 - Филиппов Егор Алексеевич"> | |
380 | + <input type="text" name="new_data_end" id="new_data_end" class="input" value="04.11.26"> | |
242 | 381 | </div> |
243 | 382 | </div> |
244 | 383 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
245 | - <label class="form-group__label">Название сертификата</label> | |
384 | + <label class="form-group__label">Дата окончания</label> | |
246 | 385 | <div class="form-group__item"> |
247 | - <input type="text" class="input" value="04.11.26"> | |
386 | + <input type="text" name="education" id="education" class="input" value="Учебное заведение"> | |
248 | 387 | </div> |
249 | 388 | </div> |
250 | - <button type="button" class="button button_light"> | |
389 | + <div class="button button_light" data-val="{{ $Worker[0]->id }}" id="button_new_doc" name="button_new_doc"> | |
251 | 390 | Добавить сертификат |
252 | - </button> | |
391 | + </div> | |
253 | 392 | </div> |
254 | 393 | </div> |
255 | - <div class="cabinet__body-item"> | |
394 | + | |
395 | + <div class="cabinet__body-item" name="ajax_dop_diplomi" id="ajax_dop_diplomi"> | |
256 | 396 | <h4 class="cabinet__h4">Дополнительная информация</h4> |
257 | - <div class="cabinet__inputs"> | |
258 | - <div class="cabinet__inputs-item form-group"> | |
259 | - <label class="form-group__label">Загран паспорт</label> | |
260 | - <div class="form-group__item"> | |
261 | - <div class="select"> | |
262 | - <select class="js-select2"> | |
263 | - <option>Не указано</option> | |
264 | - <option>Сортировка 1</option> | |
265 | - <option>Сортировка 2</option> | |
266 | - <option>Сортировка 3</option> | |
267 | - <option>Сортировка 4</option> | |
268 | - <option>Сортировка 5</option> | |
269 | - <option>Сортировка 6</option> | |
270 | - </select> | |
271 | - </div> | |
272 | - </div> | |
273 | - </div> | |
274 | - <div class="cabinet__inputs-item form-group"> | |
275 | - <label class="form-group__label">МК</label> | |
276 | - <div class="form-group__item"> | |
277 | - <div class="select"> | |
278 | - <select class="js-select2"> | |
279 | - <option>Не указано</option> | |
280 | - <option>Сортировка 1</option> | |
281 | - <option>Сортировка 2</option> | |
282 | - <option>Сортировка 3</option> | |
283 | - <option>Сортировка 4</option> | |
284 | - <option>Сортировка 5</option> | |
285 | - <option>Сортировка 6</option> | |
286 | - </select> | |
287 | - </div> | |
288 | - </div> | |
289 | - </div> | |
290 | - <div class="cabinet__inputs-item form-group"> | |
291 | - <label class="form-group__label">ВВП</label> | |
292 | - <div class="form-group__item"> | |
293 | - <div class="select"> | |
294 | - <select class="js-select2"> | |
295 | - <option>Не указано</option> | |
296 | - <option>Сортировка 1</option> | |
297 | - <option>Сортировка 2</option> | |
298 | - <option>Сортировка 3</option> | |
299 | - <option>Сортировка 4</option> | |
300 | - <option>Сортировка 5</option> | |
301 | - <option>Сортировка 6</option> | |
302 | - </select> | |
303 | - </div> | |
304 | - </div> | |
305 | - </div> | |
306 | - <div class="cabinet__inputs-item form-group"> | |
307 | - <label class="form-group__label">УЛМ</label> | |
308 | - <div class="form-group__item"> | |
309 | - <div class="select"> | |
310 | - <select class="js-select2"> | |
311 | - <option>Не указано</option> | |
312 | - <option>Сортировка 1</option> | |
313 | - <option>Сортировка 2</option> | |
314 | - <option>Сортировка 3</option> | |
315 | - <option>Сортировка 4</option> | |
316 | - <option>Сортировка 5</option> | |
317 | - <option>Сортировка 6</option> | |
318 | - </select> | |
319 | - </div> | |
320 | - </div> | |
321 | - </div> | |
322 | - <div class="cabinet__inputs-item form-group"> | |
323 | - <label class="form-group__label">Речной диплом</label> | |
324 | - <div class="form-group__item"> | |
325 | - <div class="select"> | |
326 | - <select class="js-select2"> | |
327 | - <option>Не указано</option> | |
328 | - <option>Сортировка 1</option> | |
329 | - <option>Сортировка 2</option> | |
330 | - <option>Сортировка 3</option> | |
331 | - <option>Сортировка 4</option> | |
332 | - <option>Сортировка 5</option> | |
333 | - <option>Сортировка 6</option> | |
334 | - </select> | |
335 | - </div> | |
336 | - </div> | |
337 | - </div> | |
338 | - <div class="cabinet__inputs-item form-group"> | |
339 | - <label class="form-group__label">Морской диплом</label> | |
340 | - <div class="form-group__item"> | |
341 | - <div class="select"> | |
342 | - <select class="js-select2"> | |
343 | - <option>Не указано</option> | |
344 | - <option>Сортировка 1</option> | |
345 | - <option>Сортировка 2</option> | |
346 | - <option>Сортировка 3</option> | |
347 | - <option>Сортировка 4</option> | |
348 | - <option>Сортировка 5</option> | |
349 | - <option>Сортировка 6</option> | |
350 | - </select> | |
351 | - </div> | |
352 | - </div> | |
353 | - </div> | |
354 | - <div class="cabinet__inputs-item form-group"> | |
355 | - <label class="form-group__label">МПСС 72</label> | |
356 | - <div class="form-group__item"> | |
357 | - <div class="select"> | |
358 | - <select class="js-select2"> | |
359 | - <option>Не указано</option> | |
360 | - <option>Сортировка 1</option> | |
361 | - <option>Сортировка 2</option> | |
362 | - <option>Сортировка 3</option> | |
363 | - <option>Сортировка 4</option> | |
364 | - <option>Сортировка 5</option> | |
365 | - <option>Сортировка 6</option> | |
366 | - </select> | |
367 | - </div> | |
368 | - </div> | |
369 | - </div> | |
370 | - <div class="cabinet__inputs-item form-group"> | |
371 | - <label class="form-group__label">ГМССБ</label> | |
372 | - <div class="form-group__item"> | |
373 | - <div class="select"> | |
374 | - <select class="js-select2"> | |
375 | - <option>Не указано</option> | |
376 | - <option>Сортировка 1</option> | |
377 | - <option>Сортировка 2</option> | |
378 | - <option>Сортировка 3</option> | |
379 | - <option>Сортировка 4</option> | |
380 | - <option>Сортировка 5</option> | |
381 | - <option>Сортировка 6</option> | |
382 | - </select> | |
397 | + <div class="cabinet__inputs" > | |
398 | + @if (isset($Worker[0]->infobloks)) | |
399 | + @if ($Worker[0]->infobloks->count()) | |
400 | + @php $i = 1; @endphp | |
401 | + @foreach ($Worker[0]->infobloks as $info) | |
402 | + <div class="cabinet__inputs-item form-group"> | |
403 | + <label class="form-group__label">{{ $info->name }}</label> | |
404 | + <div class="form-group__item"> | |
405 | + <div class="select"> | |
406 | + <select class="js-select2 sertificates_js"> | |
407 | + <option value="0">Нет</option> | |
408 | + <option value="1" selected>Да</option> | |
409 | + </select> | |
410 | + </div> | |
411 | + </div> | |
383 | 412 | </div> |
384 | - </div> | |
385 | - </div> | |
386 | - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
387 | - <label class="form-group__label">Образование</label> | |
413 | + @php $i++; @endphp | |
414 | + @endforeach | |
415 | + @endif | |
416 | + @endif | |
417 | + | |
418 | + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
419 | + <label class="form-group__label">Образцы дипломов и документов</label> | |
388 | 420 | <div class="form-group__item"> |
389 | 421 | <div class="select"> |
390 | - <select class="js-select2"> | |
391 | - <option>Не указано</option> | |
392 | - <option>Сортировка 1</option> | |
393 | - <option>Сортировка 2</option> | |
394 | - <option>Сортировка 3</option> | |
395 | - <option>Сортировка 4</option> | |
396 | - <option>Сортировка 5</option> | |
397 | - <option>Сортировка 6</option> | |
422 | + <select class="js-select2" id="documents" name="documents"> | |
423 | + @if ($Infoblocks->count()) | |
424 | + @foreach ($Infoblocks as $it) | |
425 | + <option value="{{ $it->id }}">{{ $it->name }}</option> | |
426 | + @endforeach | |
427 | + @endif | |
398 | 428 | </select> |
399 | 429 | </div> |
400 | 430 | </div> |
401 | 431 | </div> |
402 | - <button type="button" class="button button_light"> | |
403 | - Добавить сертификат | |
404 | - </button> | |
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"> | |
433 | + Добавить документ | |
434 | + </a> | |
405 | 435 | </div> |
406 | 436 | </div> |
407 | 437 | <div class="cabinet__body-item"> |
408 | 438 | <div class="cabinet__works"> |
439 | + @if (isset($Worker[0]->place_worker)) | |
440 | + @php $i = 1; @endphp | |
441 | + @foreach($Worker[0]->place_worker as $company) | |
409 | 442 | <div class="cabinet__works-item"> |
410 | 443 | <div class="cabinet__works-spoiler active"> |
411 | 444 | <div class="cabinet__works-spoiler-left"> |
412 | 445 | <div class="cabinet__works-spoiler-buttons"> |
413 | 446 | <button type="button" class="button button_light js-works-remove"> |
414 | 447 | <svg> |
415 | - <use xlink:href="images/sprite.svg#del"></use> | |
448 | + <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> | |
416 | 449 | </svg> |
417 | 450 | </button> |
418 | 451 | <button type="button" class="button button_light js-works-edit"> |
419 | 452 | <svg> |
420 | - <use xlink:href="images/sprite.svg#pencil"></use> | |
453 | + <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> | |
421 | 454 | </svg> |
422 | 455 | </button> |
423 | 456 | </div> |
424 | - <div class="cabinet__works-spoiler-text">Место работы 1</div> | |
457 | + <div class="cabinet__works-spoiler-text">Место работы {{ $i }}</div> | |
425 | 458 | </div> |
426 | 459 | <button type="button" class="cabinet__works-spoiler-right js-parent-toggle"> |
427 | 460 | <svg> |
428 | - <use xlink:href="images/sprite.svg#arrow-bold"></use> | |
461 | + <use xlink:href="{{ asset('images/sprite.svg#arrow-bold') }}"></use> | |
429 | 462 | </svg> |
430 | 463 | </button> |
431 | 464 | </div> |
... | ... | @@ -434,74 +467,66 @@ |
434 | 467 | <div class="cabinet__inputs-item form-group"> |
435 | 468 | <label class="form-group__label">Должность</label> |
436 | 469 | <div class="form-group__item"> |
437 | - <input type="text" class="input" value="Не указано"> | |
470 | + <input type="text" class="input" value="{{ $company->job_title }}"> | |
438 | 471 | </div> |
439 | 472 | </div> |
440 | 473 | <div class="cabinet__inputs-item form-group"> |
441 | 474 | <label class="form-group__label">Опыт работы в танкерном флоте</label> |
442 | 475 | <div class="form-group__item"> |
443 | - <input type="text" class="input" value="Не указано"> | |
476 | + <input type="text" class="input" value="@if ($company->tanker) Есть @else Нет @endif"> | |
444 | 477 | </div> |
445 | 478 | </div> |
446 | 479 | <div class="cabinet__inputs-item form-group"> |
447 | 480 | <label class="form-group__label">Название теплохода</label> |
448 | 481 | <div class="form-group__item"> |
449 | - <input type="text" class="input" value="Не указано"> | |
482 | + <input type="text" class="input" value="{{ $company->teplohod }}"> | |
450 | 483 | </div> |
451 | 484 | </div> |
452 | 485 | <div class="cabinet__inputs-item form-group"> |
453 | 486 | <label class="form-group__label">Тип (GWT)</label> |
454 | 487 | <div class="form-group__item"> |
455 | - <input type="text" class="input" value="Не указано"> | |
488 | + <input type="text" class="input" value="{{ $company->GWT }}"> | |
456 | 489 | </div> |
457 | 490 | </div> |
458 | 491 | <div class="cabinet__inputs-item form-group"> |
459 | 492 | <label class="form-group__label">ГД (кВТ)</label> |
460 | 493 | <div class="form-group__item"> |
461 | - <input type="text" class="input" value="Не указано"> | |
494 | + <input type="text" class="input" value="{{ $company->KBT }}"> | |
462 | 495 | </div> |
463 | 496 | </div> |
464 | 497 | <div class="cabinet__inputs-item form-group"> |
465 | 498 | <label class="form-group__label">Начало контракта</label> |
466 | 499 | <div class="form-group__item"> |
467 | - <input type="text" class="input" value="Не указано"> | |
500 | + <input type="text" class="input" value="{{ $company->begin_work }}"> | |
468 | 501 | </div> |
469 | 502 | </div> |
470 | 503 | <div class="cabinet__inputs-item form-group"> |
471 | 504 | <label class="form-group__label">Окончание контракта</label> |
472 | 505 | <div class="form-group__item"> |
473 | - <input type="text" class="input" value="Не указано"> | |
506 | + <input type="text" class="input" value="{{ $company->end_work }}"> | |
474 | 507 | </div> |
475 | 508 | </div> |
476 | 509 | <div class="cabinet__inputs-item form-group"> |
477 | 510 | <label class="form-group__label">Название компании</label> |
478 | 511 | <div class="form-group__item"> |
479 | - <input type="text" class="input" value="Не указано"> | |
512 | + <input type="text" class="input" value="{{ $company->name_company }}"> | |
480 | 513 | </div> |
481 | 514 | </div> |
482 | 515 | </div> |
483 | 516 | </div> |
484 | 517 | </div> |
485 | - <div class="cabinet__works-item"> | |
518 | + @php $i++ @endphp | |
519 | + @endforeach | |
520 | + @endif | |
521 | + | |
522 | + <div class="cabinet__works-item"> | |
486 | 523 | <div class="cabinet__works-spoiler"> |
487 | 524 | <div class="cabinet__works-spoiler-left"> |
488 | - <div class="cabinet__works-spoiler-buttons"> | |
489 | - <button type="button" class="button button_light js-works-remove"> | |
490 | - <svg> | |
491 | - <use xlink:href="images/sprite.svg#del"></use> | |
492 | - </svg> | |
493 | - </button> | |
494 | - <button type="button" class="button button_light js-works-edit"> | |
495 | - <svg> | |
496 | - <use xlink:href="images/sprite.svg#pencil"></use> | |
497 | - </svg> | |
498 | - </button> | |
499 | - </div> | |
500 | - <div class="cabinet__works-spoiler-text">Место работы 2</div> | |
525 | + <div class="cabinet__works-spoiler-text">Новая работа</div> | |
501 | 526 | </div> |
502 | 527 | <button type="button" class="cabinet__works-spoiler-right js-parent-toggle"> |
503 | 528 | <svg> |
504 | - <use xlink:href="images/sprite.svg#arrow-bold"></use> | |
529 | + <use xlink:href="{{ asset('images/sprite.svg#arrow-bold') }}"></use> | |
505 | 530 | </svg> |
506 | 531 | </button> |
507 | 532 | </div> |
... | ... | @@ -510,66 +535,70 @@ |
510 | 535 | <div class="cabinet__inputs-item form-group"> |
511 | 536 | <label class="form-group__label">Должность</label> |
512 | 537 | <div class="form-group__item"> |
513 | - <input type="text" class="input" value="Не указано"> | |
538 | + <input type="text" name="new_job_title" id="new_job_title" class="input" value="Не указано"> | |
514 | 539 | </div> |
515 | 540 | </div> |
516 | 541 | <div class="cabinet__inputs-item form-group"> |
517 | 542 | <label class="form-group__label">Опыт работы в танкерном флоте</label> |
518 | 543 | <div class="form-group__item"> |
519 | - <input type="text" class="input" value="Не указано"> | |
544 | + <select class="js-select2" name="new_job_title" id="new_job_title"> | |
545 | + <option value="0">Нет</option> | |
546 | + <option value="1">Да</option> | |
547 | + </select> | |
520 | 548 | </div> |
521 | 549 | </div> |
522 | 550 | <div class="cabinet__inputs-item form-group"> |
523 | 551 | <label class="form-group__label">Название теплохода</label> |
524 | 552 | <div class="form-group__item"> |
525 | - <input type="text" class="input" value="Не указано"> | |
553 | + <input type="text" name="new_teplohod" id="new_teplohod" class="input" value="Не указано"> | |
526 | 554 | </div> |
527 | 555 | </div> |
528 | 556 | <div class="cabinet__inputs-item form-group"> |
529 | 557 | <label class="form-group__label">Тип (GWT)</label> |
530 | 558 | <div class="form-group__item"> |
531 | - <input type="text" class="input" value="Не указано"> | |
559 | + <input type="text" name="new_GWT" id="new_GWT" class="input" value="Не указано"> | |
532 | 560 | </div> |
533 | 561 | </div> |
534 | 562 | <div class="cabinet__inputs-item form-group"> |
535 | 563 | <label class="form-group__label">ГД (кВТ)</label> |
536 | 564 | <div class="form-group__item"> |
537 | - <input type="text" class="input" value="Не указано"> | |
565 | + <input type="text" name="new_KBT" id="new_KBT" class="input" value="Не указано"> | |
538 | 566 | </div> |
539 | 567 | </div> |
540 | 568 | <div class="cabinet__inputs-item form-group"> |
541 | 569 | <label class="form-group__label">Начало контракта</label> |
542 | 570 | <div class="form-group__item"> |
543 | - <input type="text" class="input" value="Не указано"> | |
571 | + <input type="text" name="new_Begin_work" id="new_Begin_work" class="input" value="Не указано"> | |
544 | 572 | </div> |
545 | 573 | </div> |
546 | 574 | <div class="cabinet__inputs-item form-group"> |
547 | 575 | <label class="form-group__label">Окончание контракта</label> |
548 | 576 | <div class="form-group__item"> |
549 | - <input type="text" class="input" value="Не указано"> | |
577 | + <input type="text" name="new_End_work" id="new_End_work" class="input" value="Не указано"> | |
550 | 578 | </div> |
551 | 579 | </div> |
552 | 580 | <div class="cabinet__inputs-item form-group"> |
553 | 581 | <label class="form-group__label">Название компании</label> |
554 | 582 | <div class="form-group__item"> |
555 | - <input type="text" class="input" value="Не указано"> | |
583 | + <input type="text" name="new_name_company" id="new_name_company" class="input" value="Не указано"> | |
556 | 584 | </div> |
557 | 585 | </div> |
558 | 586 | </div> |
559 | 587 | </div> |
560 | 588 | </div> |
561 | - <button type="button" class="button button_light cabinet__works-add">Добавить место работы</button> | |
589 | + <button type="button" id="new_work" name="new_work" class="button button_light cabinet__works-add">Новое место работы</button> | |
562 | 590 | </div> |
563 | 591 | </div> |
592 | + | |
564 | 593 | <div class="cabinet__body-item"> |
565 | 594 | <h4 class="cabinet__h4">О себе</h4> |
566 | - <textarea class="textarea" placeholder="Не указано"></textarea> | |
595 | + <textarea class="textarea" name="text" id="text" placeholder="Не указано">{{ $Worker[0]->text }}</textarea> | |
567 | 596 | <div class="cabinet__buttons"> |
568 | 597 | <button type="submit" class="button">Сохранить</button> |
569 | 598 | <label class="file"> |
570 | 599 | <span class="file__input"> |
571 | - <input type="file"> | |
572 | - <span class="button button_light">Прикрепить резюме</span> | |
600 | + <input type="file" name="file" id="file"> | |
601 | + <span class="button button_light">@if (empty($Worker[0]->file)) Прикрепить резюме @else {{ $Worker[0]->file }}@endif</span> | |
573 | 602 | </span> |
574 | 603 | </label> |
575 | 604 | </div> |
resources/views/workers/dop_info.blade.php
... | ... | @@ -0,0 +1,60 @@ |
1 | +@extends('layout.frontend', ['title' => 'Моя анкета - РекаМоре']) | |
2 | + | |
3 | +@section('scripts') | |
4 | + | |
5 | +@endsection | |
6 | + | |
7 | +@section('content') | |
8 | +<section class="cabinet"> | |
9 | + <div class="container"> | |
10 | + <ul class="breadcrumbs cabinet__breadcrumbs"> | |
11 | + <li><a href="{{ route('index') }}">Главная</a></li> | |
12 | + <li><b>Личный кабинет</b></li> | |
13 | + </ul> | |
14 | + <div class="cabinet__wrapper"> | |
15 | + <div class="cabinet__side"> | |
16 | + <div class="cabinet__side-toper"> | |
17 | + @include('workers.emblema') | |
18 | + | |
19 | + </div> | |
20 | + | |
21 | + @include('workers.menu', ['item' => 1]) | |
22 | + </div> | |
23 | + <form class="cabinet__body" action="{{ route('worker.dop_info_save') }}" method="POST"> | |
24 | + @csrf | |
25 | + @include('messages_error') | |
26 | + <input type="hidden" id="worker_id" name="worker_id" value="{{ $worker_id }}"/> | |
27 | + <div class="cabinet__body-item"> | |
28 | + <div class="cabinet__anketa"> | |
29 | + <h2 class="title cabinet__title">Добавление диплома</h2> | |
30 | + </div> | |
31 | + </div> | |
32 | + <div class="form-group__item"> | |
33 | + <div class="select"> | |
34 | + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
35 | + <label class="form-group__label">Образцы дипломов и документов</label> | |
36 | + </div> | |
37 | + <select class="js-select2" id="infoblok_id" name="infoblok_id"> | |
38 | + @if ($Infoblocks->count()) | |
39 | + @foreach ($Infoblocks as $it) | |
40 | + <option value="{{ $it->id }}">{{ $it->name }}</option> | |
41 | + @endforeach | |
42 | + @endif | |
43 | + </select> | |
44 | + </div> | |
45 | + </div> | |
46 | + <div class="cabinet__body-item"> | |
47 | + <h4 class="cabinet__h4">Описание-комментарий</h4> | |
48 | + <textarea class="textarea" name="text" id="text" placeholder="Не указано"></textarea> | |
49 | + <div class="cabinet__buttons"> | |
50 | + <button type="submit" class="button">Сохранить</button> | |
51 | + </div> | |
52 | + </div> | |
53 | + </div> | |
54 | + </form> | |
55 | + </div> | |
56 | + </div> | |
57 | +</section> | |
58 | +</div> | |
59 | + | |
60 | +@endsection |
routes/web.php
... | ... | @@ -452,7 +452,7 @@ Route::group([ |
452 | 452 | ], function() { |
453 | 453 | // 1 страница - Моя анкета |
454 | 454 | Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); |
455 | - Route::get('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); | |
455 | + Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); | |
456 | 456 | |
457 | 457 | // 2 страница - Сообщения |
458 | 458 | Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); |
... | ... | @@ -470,8 +470,19 @@ Route::group([ |
470 | 470 | Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); |
471 | 471 | Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); |
472 | 472 | |
473 | - // 6 страница - Выход | |
473 | + // Резюме -pdf | |
474 | + Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); | |
474 | 475 | |
476 | + // Поднятие анкеты | |
477 | + Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); | |
478 | + | |
479 | + // Добавление сертификата | |
480 | + Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); | |
481 | + Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); | |
482 | + | |
483 | + // Добавление документа-диплома | |
484 | + Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); | |
485 | + Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); | |
475 | 486 | }); |
476 | 487 | |
477 | 488 | // Личный кабинет работодателя |