Commit b67b944770e95eb4bd433dde26daedbcb4bc6ae9

Authored by Сергей П
1 parent fb45bb1863
Exists in master

Задачи 33,34,35 + фиксы

Showing 6 changed files with 28 additions and 43 deletions Inline Diff

app/Http/Controllers/EmployerController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Classes\RusDate; 5 use App\Classes\RusDate;
6 use App\Classes\Tools; 6 use App\Classes\Tools;
7 use App\Http\Requests\BaseUser_min_Request; 7 use App\Http\Requests\BaseUser_min_Request;
8 use App\Http\Requests\FlotRequest; 8 use App\Http\Requests\FlotRequest;
9 use App\Http\Requests\MessagesRequiest; 9 use App\Http\Requests\MessagesRequiest;
10 use App\Http\Requests\VacancyRequestEdit; 10 use App\Http\Requests\VacancyRequestEdit;
11 use App\Mail\MailCreateEmployer; 11 use App\Mail\MailCreateEmployer;
12 use App\Mail\MailSotrudnichestvo; 12 use App\Mail\MailSotrudnichestvo;
13 use App\Mail\SendAllMessages; 13 use App\Mail\SendAllMessages;
14 use App\Models\Ad_employer; 14 use App\Models\Ad_employer;
15 use App\Models\ad_response; 15 use App\Models\ad_response;
16 use App\Models\Category; 16 use App\Models\Category;
17 use App\Models\Employer; 17 use App\Models\Employer;
18 use App\Models\Flot; 18 use App\Models\Flot;
19 use App\Models\Job_title; 19 use App\Models\Job_title;
20 use App\Models\Like_worker; 20 use App\Models\Like_worker;
21 use App\Models\Message; 21 use App\Models\Message;
22 use App\Models\Worker; 22 use App\Models\Worker;
23 use Carbon\Carbon; 23 use Carbon\Carbon;
24 use Illuminate\Auth\Events\Registered; 24 use Illuminate\Auth\Events\Registered;
25 use Illuminate\Database\Eloquent\Builder; 25 use Illuminate\Database\Eloquent\Builder;
26 use Illuminate\Http\Request; 26 use Illuminate\Http\Request;
27 use Illuminate\Support\Facades\Auth; 27 use Illuminate\Support\Facades\Auth;
28 use Illuminate\Support\Facades\Hash; 28 use Illuminate\Support\Facades\Hash;
29 use Illuminate\Support\Facades\Mail; 29 use Illuminate\Support\Facades\Mail;
30 use Illuminate\Support\Facades\Storage; 30 use Illuminate\Support\Facades\Storage;
31 use App\Models\User as User_Model; 31 use App\Models\User as User_Model;
32 use Illuminate\Support\Facades\Validator; 32 use Illuminate\Support\Facades\Validator;
33 use App\Enums\DbExportColumns; 33 use App\Enums\DbExportColumns;
34 34
35 class EmployerController extends Controller 35 class EmployerController extends Controller
36 { 36 {
37 public function vacancie($vacancy, Request $request) { 37 public function vacancie($vacancy, Request $request) {
38 $title = 'Заголовок вакансии'; 38 $title = 'Заголовок вакансии';
39 $Query = Ad_employer::with('jobs')-> 39 $Query = Ad_employer::with('jobs')->
40 with('cat')-> 40 with('cat')->
41 with('employer')-> 41 with('employer')->
42 with('jobs_code')-> 42 with('jobs_code')->
43 select('ad_employers.*')-> 43 select('ad_employers.*')->
44 where('id', '=', $vacancy)->get(); 44 where('id', '=', $vacancy)->get();
45 45
46 if (isset(Auth()->user()->id)) 46 if (isset(Auth()->user()->id))
47 $uid = Auth()->user()->id; 47 $uid = Auth()->user()->id;
48 else 48 else
49 $uid = 0; 49 $uid = 0;
50 $title = $Query[0]->name; 50 $title = $Query[0]->name;
51 if ($request->ajax()) { 51 if ($request->ajax()) {
52 return view('ajax.vacance-item', compact('Query','uid')); 52 return view('ajax.vacance-item', compact('Query','uid'));
53 } else { 53 } else {
54 return view('vacance-item', compact('title', 'Query', 'uid')); 54 return view('vacance-item', compact('title', 'Query', 'uid'));
55 } 55 }
56 } 56 }
57 57
58 public function logout() { 58 public function logout() {
59 Auth::logout(); 59 Auth::logout();
60 return redirect()->route('index') 60 return redirect()->route('index')
61 ->with('success', 'Вы вышли из личного кабинета'); 61 ->with('success', 'Вы вышли из личного кабинета');
62 } 62 }
63 63
64 public function employer_info() { 64 public function employer_info() {
65 // код юзера 65 // код юзера
66 $user_info = Auth()->user(); 66 $user_info = Auth()->user();
67 // вьюшка для вывода данных 67 // вьюшка для вывода данных
68 return view('employers.info', compact('user_info')); 68 return view('employers.info', compact('user_info'));
69 } 69 }
70 70
71 public function employer_info_save(User_Model $user, BaseUser_min_Request $request) { 71 public function employer_info_save(User_Model $user, BaseUser_min_Request $request) {
72 // Все данные через реквест 72 // Все данные через реквест
73 $all = $request->all(); 73 $all = $request->all();
74 unset($all['_token']); 74 unset($all['_token']);
75 // обновление 75 // обновление
76 $user->update($all); 76 $user->update($all);
77 return redirect()->route('employer.employer_info'); 77 return redirect()->route('employer.employer_info');
78 } 78 }
79 79
80 public function cabinet() { 80 public function cabinet() {
81 $id = Auth()->user()->id; 81 $id = Auth()->user()->id;
82 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 82 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
83 WhereHas('users', 83 WhereHas('users',
84 function (Builder $query) use ($id) {$query->Where('id', $id); 84 function (Builder $query) use ($id) {$query->Where('id', $id);
85 })->get(); 85 })->get();
86 return view('employers.cabinet45', compact('Employer')); 86 return view('employers.cabinet45', compact('Employer'));
87 } 87 }
88 88
89 public function slider_flot() { 89 public function slider_flot() {
90 $id = Auth()->user()->id; 90 $id = Auth()->user()->id;
91 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 91 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
92 WhereHas('users', 92 WhereHas('users',
93 function (Builder $query) use ($id) {$query->Where('id', $id); 93 function (Builder $query) use ($id) {$query->Where('id', $id);
94 })->get(); 94 })->get();
95 return view('employers.fly-flot', compact('Employer')); 95 return view('employers.fly-flot', compact('Employer'));
96 } 96 }
97 97
98 public function cabinet_save(Employer $Employer, Request $request) { 98 public function cabinet_save(Employer $Employer, Request $request) {
99 $params = $request->all(); 99 $params = $request->all();
100 $params['user_id'] = Auth()->user()->id; 100 $params['user_id'] = Auth()->user()->id;
101 $id = $Employer->id; 101 $id = $Employer->id;
102 102
103 if ($request->has('logo')) { 103 if ($request->has('logo')) {
104 if (!empty($Employer->logo)) { 104 if (!empty($Employer->logo)) {
105 Storage::delete($Employer->logo); 105 Storage::delete($Employer->logo);
106 } 106 }
107 $params['logo'] = $request->file('logo')->store("employer/$id", 'public'); 107 $params['logo'] = $request->file('logo')->store("employer/$id", 'public');
108 } 108 }
109 109
110 $Employer->update($params); 110 $Employer->update($params);
111 111
112 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены'); 112 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены');
113 } 113 }
114 114
115 public function save_add_flot(FlotRequest $request) { 115 public function save_add_flot(FlotRequest $request) {
116 // отмена 116 // отмена
117 $params = $request->all(); 117 $params = $request->all();
118 118
119 if ($request->has('image')) { 119 if ($request->has('image')) {
120 $params['image'] = $request->file('image')->store("flot", 'public'); 120 $params['image'] = $request->file('image')->store("flot", 'public');
121 } 121 }
122 Flot::create($params); 122 Flot::create($params);
123 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get(); 123 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get();
124 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); 124 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен');
125 } 125 }
126 126
127 public function edit_flot(Flot $Flot, Employer $Employer) { 127 public function edit_flot(Flot $Flot, Employer $Employer) {
128 return view('employers.edit-flot', compact('Flot', 'Employer')); 128 return view('employers.edit-flot', compact('Flot', 'Employer'));
129 } 129 }
130 130
131 public function update_flot(FlotRequest $request, Flot $Flot) { 131 public function update_flot(FlotRequest $request, Flot $Flot) {
132 $params = $request->all(); 132 $params = $request->all();
133 133
134 if ($request->has('image')) { 134 if ($request->has('image')) {
135 if (!empty($flot->image)) { 135 if (!empty($flot->image)) {
136 Storage::delete($flot->image); 136 Storage::delete($flot->image);
137 } 137 }
138 $params['image'] = $request->file('image')->store("flot", 'public'); 138 $params['image'] = $request->file('image')->store("flot", 'public');
139 } else { 139 } else {
140 if (!empty($flot->image)) $params['image'] = $flot->image; 140 if (!empty($flot->image)) $params['image'] = $flot->image;
141 } 141 }
142 142
143 $Flot->update($params); 143 $Flot->update($params);
144 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); 144 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен');
145 } 145 }
146 146
147 public function delete_flot(Flot $Flot) { 147 public function delete_flot(Flot $Flot) {
148 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get(); 148 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get();
149 149
150 if (isset($Flot->id)) $Flot->delete(); 150 if (isset($Flot->id)) $Flot->delete();
151 return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален'); 151 return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален');
152 } 152 }
153 153
154 // Форма добавления вакансий 154 // Форма добавления вакансий
155 public function cabinet_vacancie() { 155 public function cabinet_vacancie() {
156 $id = Auth()->user()->id; 156 $id = Auth()->user()->id;
157 157
158 if (Auth()->user()->is_public) { 158 if (Auth()->user()->is_public) {
159 $categories = Category::query()->active()->get(); 159 $categories = Category::query()->active()->get();
160 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 160 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
161 where('is_remove', '=', '0')-> 161 where('is_remove', '=', '0')->
162 where('is_bd', '=', '0')-> 162 where('is_bd', '=', '0')->
163 get(); 163 get();
164 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 164 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
165 WhereHas('users', 165 WhereHas('users',
166 function (Builder $query) use ($id) { 166 function (Builder $query) use ($id) {
167 $query->Where('id', $id); 167 $query->Where('id', $id);
168 })->get(); 168 })->get();
169 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories')); 169 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories'));
170 } else { 170 } else {
171 return redirect()->route('employer.cabinet_vacancie_danger'); 171 return redirect()->route('employer.cabinet_vacancie_danger');
172 } 172 }
173 } 173 }
174 174
175 // Форма предупреждения об оплате 175 // Форма предупреждения об оплате
176 public function cabinet_vacancie_danger() { 176 public function cabinet_vacancie_danger() {
177 return view('employers.add_vacancy_danger'); 177 return view('employers.add_vacancy_danger');
178 } 178 }
179 179
180 // Сохранение вакансии 180 // Сохранение вакансии
181 public function cabinet_vacancy_save1(VacancyRequestEdit $request) { 181 public function cabinet_vacancy_save1(VacancyRequestEdit $request) {
182 $params_emp = $request->all(); 182 $params_emp = $request->all();
183 183
184 $params_job["job_title_id"] = $params_emp['job_title_id']; 184 $params_job["job_title_id"] = $params_emp['job_title_id'];
185 //$params_job["min_salary"] = $params_emp['min_salary']; 185 //$params_job["min_salary"] = $params_emp['min_salary'];
186 //$params_job["max_salary"] = $params_emp['max_salary']; 186 //$params_job["max_salary"] = $params_emp['max_salary'];
187 //$params_job["region"] = $params_emp['region']; 187 //$params_job["region"] = $params_emp['region'];
188 //$params_job["power"] = $params_emp['power']; 188 //$params_job["power"] = $params_emp['power'];
189 //$params_job["sytki"] = $params_emp['sytki']; 189 //$params_job["sytki"] = $params_emp['sytki'];
190 //$params_job["start"] = $params_emp['start']; 190 //$params_job["start"] = $params_emp['start'];
191 //$params_job["flot"] = $params_emp['flot']; 191 //$params_job["flot"] = $params_emp['flot'];
192 //$params_job["description"] = $params_emp['description']; 192 //$params_job["description"] = $params_emp['description'];
193 193
194 $ad_jobs = Ad_employer::create($params_emp); 194 $ad_jobs = Ad_employer::create($params_emp);
195 //$params_job['ad_employer_id'] = $ad_jobs->id; 195 //$params_job['ad_employer_id'] = $ad_jobs->id;
196 //Ad_jobs::create($params_job); 196 //Ad_jobs::create($params_job);
197 $ad_jobs->jobs()->sync($request->get('job_title_id')); 197 $ad_jobs->jobs()->sync($request->get('job_title_id'));
198 198
199 return redirect()->route('employer.vacancy_list'); 199 return redirect()->route('employer.vacancy_list');
200 } 200 }
201 201
202 // Список вакансий 202 // Список вакансий
203 public function vacancy_list(Request $request) { 203 public function vacancy_list(Request $request) {
204 $id = Auth()->user()->id; 204 $id = Auth()->user()->id;
205 205
206 //dd($request->all()); 206 //dd($request->all());
207 $Employer = Employer::query()->where('user_id', $id)->first(); 207 $Employer = Employer::query()->where('user_id', $id)->first();
208 $vacancy_list = Ad_employer::query()->with('jobs')-> 208 $vacancy_list = Ad_employer::query()->with('jobs')->
209 with('jobs_code')-> 209 with('jobs_code')->
210 where('employer_id', $Employer->id); 210 where('employer_id', $Employer->id);
211 211
212 if (($request->has('search')) && (!empty($request->get('search')))) { 212 if (($request->has('search')) && (!empty($request->get('search')))) {
213 $search = $request->get('search'); 213 $search = $request->get('search');
214 $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%"); 214 $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%");
215 } 215 }
216 216
217 if ($request->get('sort')) { 217 if ($request->get('sort')) {
218 $sort = $request->get('sort'); 218 $sort = $request->get('sort');
219 switch ($sort) { 219 switch ($sort) {
220 case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break; 220 case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break;
221 case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break; 221 case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break;
222 case 'nopublic': $vacancy_list = $vacancy_list->OrderBy('active_is')->orderBy('id'); break; 222 case 'nopublic': $vacancy_list = $vacancy_list->OrderBy('active_is')->orderBy('id'); break;
223 case 'public': $vacancy_list = $vacancy_list->OrderByDesc('active_is')->orderBy('id'); break; 223 case 'public': $vacancy_list = $vacancy_list->OrderByDesc('active_is')->orderBy('id'); break;
224 case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break; 224 case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break;
225 case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break; 225 case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break;
226 case 'default': $vacancy_list = $vacancy_list->orderbyDesc('updated_at')->orderBy('name'); break; 226 case 'default': $vacancy_list = $vacancy_list->orderbyDesc('updated_at')->orderBy('name'); break;
227 default: $vacancy_list = $vacancy_list->orderByDesc('id')->orderbyDesc('updated_at'); break; 227 default: $vacancy_list = $vacancy_list->orderByDesc('id')->orderbyDesc('updated_at'); break;
228 } 228 }
229 } else { 229 } else {
230 $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); 230 $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id');
231 } 231 }
232 232
233 $vacancy_list = $vacancy_list->paginate(10); 233 $vacancy_list = $vacancy_list->paginate(10);
234 234
235 //ajax 235 //ajax
236 if ($request->ajax()) { 236 if ($request->ajax()) {
237 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); 237 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer'));
238 } else { 238 } else {
239 return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); 239 return view('employers.list_vacancy', compact('vacancy_list', 'Employer'));
240 } 240 }
241 } 241 }
242 242
243 // Карточка вакансии 243 // Карточка вакансии
244 public function vacancy_edit(Ad_employer $ad_employer) { 244 public function vacancy_edit(Ad_employer $ad_employer) {
245 $id = Auth()->user()->id; 245 $id = Auth()->user()->id;
246 $Positions = Category::query()->where('is_remove', '=', '0')->get(); 246 $Positions = Category::query()->where('is_remove', '=', '0')->get();
247 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 247 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
248 where('is_remove', '=', '0')-> 248 where('is_remove', '=', '0')->
249 where('is_bd', '=', '0')->get(); 249 where('is_bd', '=', '0')->get();
250 250
251 $Employer = Employer::query()->with('users')->with('ads')-> 251 $Employer = Employer::query()->with('users')->with('ads')->
252 with('flots')->where('user_id', $id)->first(); 252 with('flots')->where('user_id', $id)->first();
253 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); 253 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs'));
254 } 254 }
255 255
256 // Сохранение-редактирование записи 256 // Сохранение-редактирование записи
257 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { 257 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) {
258 $params = $request->all(); 258 $params = $request->all();
259 $params_job["job_title_id"] = $params['job_title_id']; 259 $params_job["job_title_id"] = $params['job_title_id'];
260 260
261 $ad_employer->update($params); 261 $ad_employer->update($params);
262 $ad_employer->jobs()->sync($request->get('job_title_id')); 262 $ad_employer->jobs()->sync($request->get('job_title_id'));
263 263
264 $id = Auth()->user()->id; 264 $id = Auth()->user()->id;
265 $Positions = Category::query()->where('is_remove', '=', '0')->get(); 265 $Positions = Category::query()->where('is_remove', '=', '0')->get();
266 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name') 266 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')
267 ->where('is_remove', '=', '0') 267 ->where('is_remove', '=', '0')
268 ->where('is_bd', '=', '0') 268 ->where('is_bd', '=', '0')
269 ->get(); 269 ->get();
270 270
271 $Employer = Employer::query() 271 $Employer = Employer::query()
272 ->with('users')->with('ads')->with('flots')->where('user_id', $id)->first(); 272 ->with('users')->with('ads')->with('flots')->where('user_id', $id)->first();
273 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); 273 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs'));
274 } 274 }
275 275
276 // Сохранение карточки вакансии 276 // Сохранение карточки вакансии
277 public function vacancy_save(Request $request, Ad_employer $ad_employer) { 277 public function vacancy_save(Request $request, Ad_employer $ad_employer) {
278 $all = $request->all(); 278 $all = $request->all();
279 $ad_employer->update($all); 279 $ad_employer->update($all);
280 return redirect()->route('employer.cabinet_vacancie'); 280 return redirect()->route('employer.cabinet_vacancie');
281 } 281 }
282 282
283 // Удаление карточки вакансии 283 // Удаление карточки вакансии
284 public function vacancy_delete(Ad_employer $ad_employer) { 284 public function vacancy_delete(Ad_employer $ad_employer) {
285 $ad_employer->delete(); 285 $ad_employer->delete();
286 286
287 return redirect()->route('employer.vacancy_list') 287 return redirect()->route('employer.vacancy_list')
288 ->with('success', 'Данные были успешно сохранены'); 288 ->with('success', 'Данные были успешно сохранены');
289 } 289 }
290 290
291 // Обновление даты 291 // Обновление даты
292 public function vacancy_up(Ad_employer $ad_employer) { 292 public function vacancy_up(Ad_employer $ad_employer) {
293 $up = date('m/d/Y h:i:s', time());; 293 $up = date('m/d/Y h:i:s', time());;
294 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 294 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
295 $vac_emp->updated_at = $up; 295 $vac_emp->updated_at = $up;
296 $vac_emp->save(); 296 $vac_emp->save();
297 297
298 return redirect()->back(); //route('employer.vacancy_list'); 298 return redirect()->back(); //route('employer.vacancy_list');
299 // начало конца 299 // начало конца
300 } 300 }
301 301
302 //Видимость вакансии 302 //Видимость вакансии
303 public function vacancy_eye(Ad_employer $ad_employer, $status) { 303 public function vacancy_eye(Ad_employer $ad_employer, $status) {
304 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 304 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
305 $vac_emp->active_is = $status; 305 $vac_emp->active_is = $status;
306 $vac_emp->save(); 306 $vac_emp->save();
307 307
308 return redirect()->route('employer.vacancy_list'); 308 return redirect()->route('employer.vacancy_list');
309 } 309 }
310 310
311 //Вакансия редактирования (шаблон) 311 //Вакансия редактирования (шаблон)
312 public function vacancy_update(Ad_employer $id) { 312 public function vacancy_update(Ad_employer $id) {
313 313
314 } 314 }
315 315
316 //Отклики на вакансию - лист 316 //Отклики на вакансию - лист
317 public function answers(Employer $employer, Request $request) { 317 public function answers(Employer $employer, Request $request) {
318 $user_id = Auth()->user()->id; 318 $user_id = Auth()->user()->id;
319 $answer = Ad_employer::query()->where('employer_id', $employer->id); 319 $answer = Ad_employer::query()->where('employer_id', $employer->id);
320 if ($request->has('search')) { 320 if ($request->has('search')) {
321 $search = trim($request->get('search')); 321 $search = trim($request->get('search'));
322 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); 322 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%");
323 } 323 }
324 324
325 $answer = $answer->with('response')->OrderByDESC('id')->get(); 325 $answer = $answer->with('response')->OrderByDESC('id')->get();
326 326
327 return view('employers.list_answer', compact('answer', 'user_id', 'employer')); 327 return view('employers.list_answer', compact('answer', 'user_id', 'employer'));
328 } 328 }
329 329
330 //Обновление статуса 330 //Обновление статуса
331 public function supple_status(employer $employer, ad_response $ad_response, $flag) { 331 public function supple_status(employer $employer, ad_response $ad_response, $flag) {
332 $ad_response->update(Array('flag' => $flag)); 332 $ad_response->update(Array('flag' => $flag));
333 return redirect()->route('employer.answers', ['employer' => $employer->id]); 333 return redirect()->route('employer.answers', ['employer' => $employer->id]);
334 } 334 }
335 335
336 //Страницы сообщений список 336 //Страницы сообщений список
337 public function messages($type_message) { 337 public function messages($type_message) {
338 $user_id = Auth()->user()->id; 338 $user_id = Auth()->user()->id;
339 339
340 $messages_input = Message::query()->with('vacancies')->with('user_from')-> 340 $messages_input = Message::query()->with('vacancies')->with('user_from')->
341 Where('to_user_id', $user_id)->OrderByDesc('created_at'); 341 Where('to_user_id', $user_id)->OrderByDesc('created_at');
342 342
343 $messages_output = Message::query()->with('vacancies')-> 343 $messages_output = Message::query()->with('vacancies')->
344 with('user_to')->where('user_id', $user_id)-> 344 with('user_to')->where('user_id', $user_id)->
345 OrderByDesc('created_at'); 345 OrderByDesc('created_at');
346 346
347 $count_input = $messages_input->count(); 347 $count_input = $messages_input->count();
348 $count_output = $messages_output->count(); 348 $count_output = $messages_output->count();
349 349
350 if ($type_message == 'input') { 350 if ($type_message == 'input') {
351 $messages = $messages_input->paginate(5); 351 $messages = $messages_input->paginate(5);
352 } 352 }
353 353
354 if ($type_message == 'output') { 354 if ($type_message == 'output') {
355 $messages = $messages_output->paginate(5); 355 $messages = $messages_output->paginate(5);
356 } 356 }
357 357
358 //dd($user_id, $messages[2]->vacancies); 358 //dd($user_id, $messages[2]->vacancies);
359 //jobs); 359 //jobs);
360 360
361 return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); 361 return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id'));
362 } 362 }
363 363
364 // Диалог между пользователями 364 // Диалог между пользователями
365 public function dialog(Request $request, User_Model $user1, User_Model $user2) { 365 public function dialog(Request $request, User_Model $user1, User_Model $user2) {
366 // Получение параметров. 366 // Получение параметров.
367 if ($request->has('ad_employer')){ 367 if ($request->has('ad_employer')){
368 $ad_employer = $request->get('ad_employer'); 368 $ad_employer = $request->get('ad_employer');
369 } else { 369 } else {
370 $ad_employer = 0; 370 $ad_employer = 0;
371 } 371 }
372 372
373 if (isset($user2->id)) { 373 if (isset($user2->id)) {
374 $companion = User_Model::query()->with('workers')-> 374 $companion = User_Model::query()->with('workers')->
375 with('employers')-> 375 with('employers')->
376 where('id', $user2->id)->first(); 376 where('id', $user2->id)->first();
377 } 377 }
378 378
379 $Messages = Message::query()-> 379 $Messages = Message::query()->
380 where('ad_employer_id', '=', $ad_employer)-> 380 where('ad_employer_id', '=', $ad_employer)->
381 where(function($query) use ($user1, $user2) { 381 where(function($query) use ($user1, $user2) {
382 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); 382 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id);
383 })->orWhere(function($query) use ($user1, $user2) { 383 })->orWhere(function($query) use ($user1, $user2) {
384 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); 384 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id);
385 })->where('ad_employer_id', '=', $ad_employer)->OrderBy('created_at')->get(); 385 })->where('ad_employer_id', '=', $ad_employer)->OrderBy('created_at')->get();
386 386
387 $id_vac = $Messages[$Messages->count() - 1]->ad_employer_id; 387 $id_vac = $Messages[$Messages->count() - 1]->ad_employer_id;
388 388
389 //$ad_employer = null; 389 //$ad_employer = null;
390 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); 390 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first();
391 $sender = $user1; 391 $sender = $user1;
392 392
393 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages')); 393 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages'));
394 } 394 }
395 395
396 // Регистрация работодателя 396 // Регистрация работодателя
397 public function register_employer(Request $request) { 397 public function register_employer(Request $request) {
398 $params = $request->all(); 398 $params = $request->all();
399 399
400 $rules = [ 400 $rules = [
401 //'surname' => ['required', 'string', 'max:255'], 401 //'surname' => ['required', 'string', 'max:255'],
402 //'name_man' => ['required', 'string', 'max:255'], 402 //'name_man' => ['required', 'string', 'max:255'],
403 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 403 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
404 'name_company' => ['required', 'string', 'max:255'], 404 'name_company' => ['required', 'string', 'max:255'],
405 'password' => ['required', 'string', 'min:6'], 405 'password' => ['required', 'string', 'min:6'],
406 ]; 406 ];
407 407
408 408
409 $messages = [ 409 $messages = [
410 'required' => 'Укажите обязательное поле', 410 'required' => 'Укажите обязательное поле',
411 'min' => [ 411 'min' => [
412 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 412 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
413 'integer' => 'Поле «:attribute» должно быть :min или больше', 413 'integer' => 'Поле «:attribute» должно быть :min или больше',
414 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 414 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
415 ], 415 ],
416 'max' => [ 416 'max' => [
417 'string' => 'Поле «:attribute» должно быть не больше :max символов', 417 'string' => 'Поле «:attribute» должно быть не больше :max символов',
418 'integer' => 'Поле «:attribute» должно быть :max или меньше', 418 'integer' => 'Поле «:attribute» должно быть :max или меньше',
419 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 419 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
420 ] 420 ]
421 ]; 421 ];
422 422
423 $email = $request->get('email'); 423 $email = $request->get('email');
424 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { 424 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) {
425 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); 425 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл"));
426 } 426 }
427 427
428 if ($request->get('password') !== $request->get('confirmed')){ 428 if ($request->get('password') !== $request->get('confirmed')){
429 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 429 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
430 } 430 }
431 431
432 if (strlen($request->get('password')) < 6) { 432 if (strlen($request->get('password')) < 6) {
433 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); 433 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
434 } 434 }
435 435
436 if (empty($request->get('surname'))) { 436 if (empty($request->get('surname'))) {
437 $params['surname'] = 'Неизвестно'; 437 $params['surname'] = 'Неизвестно';
438 } 438 }
439 if (empty($request->get('name_man'))) { 439 if (empty($request->get('name_man'))) {
440 $params['name_man'] = 'Неизвестно'; 440 $params['name_man'] = 'Неизвестно';
441 } 441 }
442 $validator = Validator::make($params, $rules, $messages); 442 $validator = Validator::make($params, $rules, $messages);
443 443
444 if ($validator->fails()) { 444 if ($validator->fails()) {
445 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 445 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
446 } else { 446 } else {
447 $user = $this->create($params); 447 $user = $this->create($params);
448 event(new Registered($user)); 448 event(new Registered($user));
449 449
450 Mail::to(env('EMAIL_ADMIN'))->send(new MailCreateEmployer($params)); 450 Mail::to(env('EMAIL_ADMIN'))->send(new MailCreateEmployer($params));
451 451
452 Auth::guard()->login($user); 452 Auth::guard()->login($user);
453 } 453 }
454 454
455 if ($user) { 455 if ($user) {
456 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; 456 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));;
457 } else { 457 } else {
458 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 458 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
459 } 459 }
460 } 460 }
461 461
462 // Создание пользователя 462 // Создание пользователя
463 protected function create(array $data) 463 protected function create(array $data)
464 { 464 {
465 $Use = new User_Model(); 465 $Use = new User_Model();
466 $Code_user = $Use->create([ 466 $Code_user = $Use->create([
467 'name' => $data['surname']." ".$data['name_man'], 467 'name' => $data['surname']." ".$data['name_man'],
468 'name_man' => $data['name_man'], 468 'name_man' => $data['name_man'],
469 'surname' => $data['surname'], 469 'surname' => $data['surname'],
470 'surname2' => $data['surname2'], 470 'surname2' => $data['surname2'],
471 'subscribe_email' => $data['email'], 471 'subscribe_email' => $data['email'],
472 'email' => $data['email'], 472 'email' => $data['email'],
473 'telephone' => $data['telephone'], 473 'telephone' => $data['telephone'],
474 'is_worker' => 0, 474 'is_worker' => 0,
475 'password' => Hash::make($data['password']), 475 'password' => Hash::make($data['password']),
476 'pubpassword' => base64_encode($data['password']), 476 'pubpassword' => base64_encode($data['password']),
477 'email_verified_at' => Carbon::now() 477 'email_verified_at' => Carbon::now()
478 ]); 478 ]);
479 479
480 if ($Code_user->id > 0) { 480 if ($Code_user->id > 0) {
481 $Employer = new Employer(); 481 $Employer = new Employer();
482 $Employer->user_id = $Code_user->id; 482 $Employer->user_id = $Code_user->id;
483 $Employer->name_company = $data['name_company']; 483 $Employer->name_company = $data['name_company'];
484 $Employer->email = $data['email']; 484 $Employer->email = $data['email'];
485 $Employer->telephone = $data['telephone']; 485 $Employer->telephone = $data['telephone'];
486 $Employer->code = Tools::generator_id(10); 486 $Employer->code = Tools::generator_id(10);
487 $Employer->save(); 487 $Employer->save();
488 488
489 return $Code_user; 489 return $Code_user;
490 } 490 }
491 } 491 }
492 492
493 // Отправка сообщения от работодателя 493 // Отправка сообщения от работодателя
494 public function send_message(MessagesRequiest $request) { 494 public function send_message(MessagesRequiest $request) {
495 $params = $request->all(); 495 $params = $request->all();
496 dd($params); 496 dd($params);
497 $user1 = $params['user_id']; 497 $user1 = $params['user_id'];
498 $user2 = $params['to_user_id']; 498 $user2 = $params['to_user_id'];
499 499
500 if ($request->has('file')) { 500 if ($request->has('file')) {
501 $params['file'] = $request->file('file')->store("messages", 'public'); 501 $params['file'] = $request->file('file')->store("messages", 'public');
502 } 502 }
503 Message::create($params); 503 Message::create($params);
504 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 504 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
505 } 505 }
506 506
507 public function test123(Request $request) { 507 public function test123(Request $request) {
508 $params = $request->all(); 508 $params = $request->all();
509 $user1 = $params['user_id']; 509 $user1 = $params['user_id'];
510 $user2 = $params['to_user_id']; 510 $user2 = $params['to_user_id'];
511 $id_vacancy = $params['ad_employer_id']; 511 $id_vacancy = $params['ad_employer_id'];
512 $ad_name = $params['ad_name']; 512 $ad_name = $params['ad_name'];
513 513
514 $rules = [ 514 $rules = [
515 'text' => 'required|min:1|max:150000', 515 'text' => 'required|min:1|max:150000',
516 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' 516 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000'
517 ]; 517 ];
518 $messages = [ 518 $messages = [
519 'required' => 'Укажите обязательное поле', 519 'required' => 'Укажите обязательное поле',
520 'min' => [ 520 'min' => [
521 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 521 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
522 'integer' => 'Поле «:attribute» должно быть :min или больше', 522 'integer' => 'Поле «:attribute» должно быть :min или больше',
523 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 523 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
524 ], 524 ],
525 'max' => [ 525 'max' => [
526 'string' => 'Поле «:attribute» должно быть не больше :max символов', 526 'string' => 'Поле «:attribute» должно быть не больше :max символов',
527 'integer' => 'Поле «:attribute» должно быть :max или меньше', 527 'integer' => 'Поле «:attribute» должно быть :max или меньше',
528 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 528 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
529 ] 529 ]
530 ]; 530 ];
531 531
532 $validator = Validator::make($request->all(), $rules, $messages); 532 $validator = Validator::make($request->all(), $rules, $messages);
533 533
534 if ($validator->fails()) { 534 if ($validator->fails()) {
535 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) 535 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2])
536 ->withErrors($validator); 536 ->withErrors($validator);
537 } else { 537 } else {
538 if ($request->has('file')) { 538 if ($request->has('file')) {
539 $params['file'] = $request->file('file')->store("messages", 'public'); 539 $params['file'] = $request->file('file')->store("messages", 'public');
540 } 540 }
541 Message::create($params); 541 Message::create($params);
542 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 542 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
543 return redirect()->route('employer.dialog', 543 return redirect()->route('employer.dialog',
544 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]); 544 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]);
545 545
546 } 546 }
547 } 547 }
548 548
549 //Избранные люди 549 //Избранные люди
550 public function favorites(Request $request) { 550 public function favorites(Request $request) {
551 $IP_address = RusDate::ip_addr_client(); 551 $IP_address = RusDate::ip_addr_client();
552 $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); 552 $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get();
553 553
554 if ($Arr->count()) { 554 if ($Arr->count()) {
555 $A = Array(); 555 $A = Array();
556 foreach ($Arr as $it) { 556 foreach ($Arr as $it) {
557 $A[] = $it->code_record; 557 $A[] = $it->code_record;
558 } 558 }
559 559
560 $Workers = Worker::query()->whereIn('id', $A); 560 $Workers = Worker::query()->whereIn('id', $A);
561 } else { 561 } else {
562 $Workers = Worker::query()->where('id', '=', '0'); 562 $Workers = Worker::query()->where('id', '=', '0');
563 } 563 }
564 564
565 if (($request->has('search')) && (!empty($request->get('search')))) { 565 if (($request->has('search')) && (!empty($request->get('search')))) {
566 $search = $request->get('search'); 566 $search = $request->get('search');
567 567
568 $Workers = $Workers->WhereHas('users', 568 $Workers = $Workers->WhereHas('users',
569 function (Builder $query) use ($search) { 569 function (Builder $query) use ($search) {
570 $query->Where('surname', 'LIKE', "%$search%") 570 $query->Where('surname', 'LIKE', "%$search%")
571 ->orWhere('name_man', 'LIKE', "%$search%") 571 ->orWhere('name_man', 'LIKE', "%$search%")
572 ->orWhere('surname2', 'LIKE', "%$search%"); 572 ->orWhere('surname2', 'LIKE', "%$search%");
573 }); 573 });
574 } else { 574 } else {
575 $Workers = $Workers->with('users'); 575 $Workers = $Workers->with('users');
576 } 576 }
577 577
578 $Workers = $Workers->get(); 578 $Workers = $Workers->get();
579 579
580 580
581 return view('employers.favorite', compact('Workers')); 581 return view('employers.favorite', compact('Workers'));
582 } 582 }
583 583
584 // База данных 584 // База данных
585 public function bd(Request $request) { 585 public function bd(Request $request) {
586 $users = User_Model::query()->with('workers'); 586 for ($i = 0; $i < 5; $i++) {
587 echo "i = $i\n<br>";
588 for ($j = 0; $j < 5; $j++) {
589 echo " j = $j\n<br>";
590 for ($k = 0; $k < 5; $k++) {
591 if ($k == 2) {
592 continue;
593 }
594 echo " k = $k\n<br>";
595 }
596 }
597 }
598
599 dd('OK');
600 $users = User_Model::query()->with('workers')->with('jobtitles');
587 601
588 if ($request->has('search')) { 602 if ($request->has('search')) {
589 $find_key = $request->get('search'); 603 $find_key = $request->get('search');
590 $users = $users->where('name', 'LIKE', "%$find_key%") 604 $users = $users->where('name', 'LIKE', "%$find_key%")
591 ->orWhere('surname', 'LIKE', "%$find_key%") 605 ->orWhere('surname', 'LIKE', "%$find_key%")
592 ->orWhere('name_man', 'LIKE', "%$find_key%") 606 ->orWhere('name_man', 'LIKE', "%$find_key%")
593 ->orWhere('email', 'LIKE', "%$find_key%") 607 ->orWhere('email', 'LIKE', "%$find_key%")
594 ->orWhere('telephone', 'LIKE', "%$find_key%"); 608 ->orWhere('telephone', 'LIKE', "%$find_key%");
595 } 609 }
596 610
597 // Данные 611 // Данные
598 $users = $users->Baseuser()-> 612 $users = $users->Baseuser()->
599 orderBy(Worker::select('position_work')->whereColumn('workers.user_id', 'users.id')); 613 orderBy(Worker::select('position_work')->whereColumn('workers.user_id', 'users.id'));
600 $count_users = $users; 614 $count_users = $users;
601 $users = $users->paginate(5); 615 $users = $users->paginate(5);
602 616
603 $export_options = DbExportColumns::toArray(); 617 $export_options = DbExportColumns::toArray();
604 618
605 $jobs_titles = Job_title::select('id', 'name') 619 $jobs_titles = Job_title::select('id', 'name')
606 ->where('is_remove', '=', 0) 620 ->where('is_remove', '=', 0)
607 ->where('is_bd', '=', 2) 621 ->where('is_bd', '=', 2)
608 ->orderBy('name', 'asc') 622 ->orderBy('name', 'asc')
609 ->get() 623 ->get()
610 ->toArray() 624 ->toArray()
611 ; 625 ;
612 626
613 return view('employers.bd', compact('users', 'count_users', 'export_options', 'jobs_titles')); 627 return view('employers.bd', compact('users', 'count_users', 'export_options', 'jobs_titles'));
614 } 628 }
615 629
616 //Настройка уведомлений 630 //Настройка уведомлений
617 public function subscribe() { 631 public function subscribe() {
618 return view('employers.subcribe'); 632 return view('employers.subcribe');
619 } 633 }
620 634
621 //Установка уведомлений сохранение 635 //Установка уведомлений сохранение
622 public function save_subscribe(Request $request) { 636 public function save_subscribe(Request $request) {
623 dd($request->all()); 637 dd($request->all());
624 $msg = $request->validate([ 638 $msg = $request->validate([
625 'subscribe_email' => 'required|email|min:5|max:255', 639 'subscribe_email' => 'required|email|min:5|max:255',
626 ]); 640 ]);
627 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); 641 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку');
628 } 642 }
629 643
630 //Сбросить форму с паролем 644 //Сбросить форму с паролем
631 public function password_reset() { 645 public function password_reset() {
632 $email = Auth()->user()->email; 646 $email = Auth()->user()->email;
633 return view('employers.password-reset', compact('email')); 647 return view('employers.password-reset', compact('email'));
634 } 648 }
635 649
636 //Обновление пароля 650 //Обновление пароля
637 public function new_password(Request $request) { 651 public function new_password(Request $request) {
638 $use = Auth()->user(); 652 $use = Auth()->user();
639 $request->validate([ 653 $request->validate([
640 'password' => 'required|string', 654 'password' => 'required|string',
641 'new_password' => 'required|string', 655 'new_password' => 'required|string',
642 'new_password2' => 'required|string' 656 'new_password2' => 'required|string'
643 ]); 657 ]);
644 658
645 if ($request->get('new_password') == $request->get('new_password2')) 659 if ($request->get('new_password') == $request->get('new_password2'))
646 if ($request->get('password') !== $request->get('new_password')) { 660 if ($request->get('password') !== $request->get('new_password')) {
647 $credentials = $request->only('email', 'password'); 661 $credentials = $request->only('email', 'password');
648 if (Auth::attempt($credentials)) { 662 if (Auth::attempt($credentials)) {
649 663
650 if (!is_null($use->email_verified_at)){ 664 if (!is_null($use->email_verified_at)){
651 665
652 $user_data = User_Model::find($use->id); 666 $user_data = User_Model::find($use->id);
653 $user_data->update([ 667 $user_data->update([
654 'password' => Hash::make($request->get('new_password')), 668 'password' => Hash::make($request->get('new_password')),
655 'pubpassword' => base64_encode($request->get('new_password')), 669 'pubpassword' => base64_encode($request->get('new_password')),
656 ]); 670 ]);
657 return redirect() 671 return redirect()
658 ->route('employer.password_reset') 672 ->route('employer.password_reset')
659 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 673 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
660 } 674 }
661 675
662 return redirect() 676 return redirect()
663 ->route('employer.password_reset') 677 ->route('employer.password_reset')
664 ->withError('Данная учетная запись не было верифицированна!'); 678 ->withError('Данная учетная запись не было верифицированна!');
665 } 679 }
666 } 680 }
667 681
668 return redirect() 682 return redirect()
669 ->route('employer.password_reset') 683 ->route('employer.password_reset')
670 ->withErrors('Не совпадение данных, обновите пароли!'); 684 ->withErrors('Не совпадение данных, обновите пароли!');
671 } 685 }
672 686
673 687
674 688
675 // Форма Удаление пипла 689 // Форма Удаление пипла
676 public function delete_people() { 690 public function delete_people() {
677 $login = Auth()->user()->email; 691 $login = Auth()->user()->email;
678 return view('employers.delete_people', compact('login')); 692 return view('employers.delete_people', compact('login'));
679 } 693 }
680 694
681 // Удаление аккаунта 695 // Удаление аккаунта
682 public function action_delete_user(Request $request) { 696 public function action_delete_user(Request $request) {
683 $Answer = $request->all(); 697 $Answer = $request->all();
684 $user_id = Auth()->user()->id; 698 $user_id = Auth()->user()->id;
685 $request->validate([ 699 $request->validate([
686 'password' => 'required|string', 700 'password' => 'required|string',
687 ]); 701 ]);
688 702
689 $credentials = $request->only('email', 'password'); 703 $credentials = $request->only('email', 'password');
690 if (Auth::attempt($credentials)) { 704 if (Auth::attempt($credentials)) {
691 Auth::logout(); 705 Auth::logout();
692 $it = User_Model::find($user_id); 706 $it = User_Model::find($user_id);
693 $it->delete(); 707 $it->delete();
694 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 708 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
695 } else { 709 } else {
696 return redirect()->route('employer.delete_people') 710 return redirect()->route('employer.delete_people')
697 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 711 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
698 } 712 }
699 } 713 }
700 714
701 public function ajax_delete_user(Request $request) { 715 public function ajax_delete_user(Request $request) {
702 $Answer = $request->all(); 716 $Answer = $request->all();
703 $user_id = Auth()->user()->id; 717 $user_id = Auth()->user()->id;
704 $request->validate([ 718 $request->validate([
705 'password' => 'required|string', 719 'password' => 'required|string',
706 ]); 720 ]);
707 $credentials = $request->only('email', 'password'); 721 $credentials = $request->only('email', 'password');
708 if (Auth::attempt($credentials)) { 722 if (Auth::attempt($credentials)) {
709 723
710 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', 724 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт',
711 'email' => $request->get('email'), 725 'email' => $request->get('email'),
712 'password' => $request->get('password'))); 726 'password' => $request->get('password')));
713 } else { 727 } else {
714 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); 728 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль'));
715 } 729 }
716 } 730 }
717 731
718 // FAQ - Вопросы/ответы для работодателей и соискателей 732 // FAQ - Вопросы/ответы для работодателей и соискателей
719 public function faq() { 733 public function faq() {
720 return view('employers.faq'); 734 return view('employers.faq');
721 } 735 }
722 736
723 // Рассылка сообщений 737 // Рассылка сообщений
724 public function send_all_messages() { 738 public function send_all_messages() {
725 $id = Auth()->user()->id; 739 $id = Auth()->user()->id;
726 $sending = Employer::query()->where('user_id', '=', "$id")->first(); 740 $sending = Employer::query()->where('user_id', '=', "$id")->first();
727 if ($sending->sending_is) 741 if ($sending->sending_is)
728 return view('employers.send_all'); 742 return view('employers.send_all');
729 else 743 else
730 return view('employers.send_all_danger'); 744 return view('employers.send_all_danger');
731 } 745 }
732 746
733 // Отправка сообщений для информации 747 // Отправка сообщений для информации
734 public function send_all_post(Request $request) { 748 public function send_all_post(Request $request) {
735 $data = $request->all(); 749 $data = $request->all();
736 750
737 $emails = User_Model::query()->where('is_worker', '1')->get(); 751 $emails = User_Model::query()->where('is_worker', '1')->get();
738 752
739 foreach ($emails as $e) { 753 foreach ($emails as $e) {
740 Mail::to($e->email)->send(new SendAllMessages($data)); 754 Mail::to($e->email)->send(new SendAllMessages($data));
741 } 755 }
742 756
743 return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); 757 return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены');
744 } 758 }
745 759
746 // База резюме 760 // База резюме
747 public function bd_tupe(Request $request) { 761 public function bd_tupe(Request $request) {
748 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); 762 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get();
749 763
750 return view('employers.bd_tupe', compact('Resume')); 764 return view('employers.bd_tupe', compact('Resume'));
751 } 765 }
752 766
753 ////////////////////////////////////////////////////////////////// 767 //////////////////////////////////////////////////////////////////
754 // Отправил сообщение 768 // Отправил сообщение
755 ////////////////////////////////////////////////////////////////// 769 //////////////////////////////////////////////////////////////////
756 public function new_message(Request $request) { 770 public function new_message(Request $request) {
757 $params = $request->all(); 771 $params = $request->all();
758 $id = $params['_user_id']; 772 $id = $params['_user_id'];
759 $message = new Message(); 773 $message = new Message();
760 $message->user_id = $params['_user_id']; 774 $message->user_id = $params['_user_id'];
761 $message->to_user_id = $params['_to_user_id']; 775 $message->to_user_id = $params['_to_user_id'];
762 $message->title = $params['title']; 776 $message->title = $params['title'];
763 $message->text = $params['text']; 777 $message->text = $params['text'];
764 if ($request->has('_file')) { 778 if ($request->has('_file')) {
765 $message->file = $request->file('_file')->store("worker/$id", 'public'); 779 $message->file = $request->file('_file')->store("worker/$id", 'public');
766 } 780 }
767 $message->ad_employer_id = $params['_vacancy']; 781 $message->ad_employer_id = $params['_vacancy'];
768 $message->flag_new = 1; 782 $message->flag_new = 1;
769 $id_message = $message->save(); 783 $id_message = $message->save();
770 784
771 //$data['message_id'] = $id_message; 785 //$data['message_id'] = $id_message;
772 //$data['ad_employer_id'] = $params['_vacancy']; 786 //$data['ad_employer_id'] = $params['_vacancy'];
773 //$data['job_title_id'] = 0; 787 //$data['job_title_id'] = 0;
774 788
775 $data['flag'] = 1; 789 $data['flag'] = 1;
776 //$ad_responce = ad_response::create($data); 790 //$ad_responce = ad_response::create($data);
777 return redirect()->route('employer.messages', ['type_message' => 'output']); 791 return redirect()->route('employer.messages', ['type_message' => 'output']);
778 } 792 }
779 793
780 // Восстановление пароля 794 // Восстановление пароля
781 public function repair_password(Request $request) { 795 public function repair_password(Request $request) {
782 $params = $request->get('email'); 796 $params = $request->get('email');
783 } 797 }
784 798
785 // Избранные люди на корабль 799 // Избранные люди на корабль
786 public function selected_people(Request $request) { 800 public function selected_people(Request $request) {
787 $id = $request->get('id'); 801 $id = $request->get('id');
788 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 802 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
789 where('is_remove', '=', '0')-> 803 where('is_remove', '=', '0')->
790 where('is_bd', '=', '0')-> 804 where('is_bd', '=', '0')->
791 where('position_id', $id)-> 805 where('position_id', $id)->
792 get(); 806 get();
793 return view('favorite_people', compact('favorite_people')); 807 return view('favorite_people', compact('favorite_people'));
794 } 808 }
795 } 809 }
796 810
app/Http/Controllers/MainController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Classes\RusDate; 5 use App\Classes\RusDate;
6 use App\Classes\Tools; 6 use App\Classes\Tools;
7 use App\Mail\MailRegistration; 7 use App\Mail\MailRegistration;
8 use App\Mail\MailRepair; 8 use App\Mail\MailRepair;
9 use App\Models\Ad_employer; 9 use App\Models\Ad_employer;
10 use App\Models\Ad_jobs; 10 use App\Models\Ad_jobs;
11 use App\Models\Category; 11 use App\Models\Category;
12 use App\Models\Education; 12 use App\Models\Education;
13 use App\Models\employers_main; 13 use App\Models\employers_main;
14 use App\Models\Job_title; 14 use App\Models\Job_title;
15 use App\Models\Like_vacancy; 15 use App\Models\Like_vacancy;
16 use App\Models\Like_worker; 16 use App\Models\Like_worker;
17 use App\Models\News; 17 use App\Models\News;
18 use App\Models\Positions; 18 use App\Models\Positions;
19 use App\Models\reclame; 19 use App\Models\reclame;
20 use App\Models\User; 20 use App\Models\User;
21 use Illuminate\Http\Request; 21 use Illuminate\Http\Request;
22 use Illuminate\Support\Facades\Auth; 22 use Illuminate\Support\Facades\Auth;
23 use Illuminate\Support\Facades\DB; 23 use Illuminate\Support\Facades\DB;
24 use Illuminate\Support\Facades\Hash; 24 use Illuminate\Support\Facades\Hash;
25 use Illuminate\Support\Facades\Mail; 25 use Illuminate\Support\Facades\Mail;
26 use Illuminate\Support\Facades\Validator; 26 use Illuminate\Support\Facades\Validator;
27 use App\Models\PageContent; 27 use App\Models\PageContent;
28 use App\Enums\MainPageCounters; 28 use App\Enums\MainPageCounters;
29 29
30 class MainController extends Controller 30 class MainController extends Controller
31 { 31 {
32 // Главная страница публичной части 32 // Главная страница публичной части
33 public function index() { 33 public function index() {
34 $news = News::query()->orderByDesc('id')->limit(6)->get(); 34 $news = News::query()->orderByDesc('id')->limit(6)->get();
35 35
36 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') 36 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*')
37 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') 37 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id')
38 ->OrderByDesc('created_at') 38 ->OrderByDesc('created_at')
39 ->GroupBy('categories.id') 39 ->GroupBy('categories.id')
40 ->get(); 40 ->get();
41 41
42 $Job_title = Job_title::query()->where('is_remove', '=', '0')-> 42 $Job_title = Job_title::query()->where('is_remove', '=', '0')->
43 where('is_bd', '=', '0')->orderBy('name')->get(); 43 where('is_bd', '=', '0')->orderByDesc('sort')->get();
44 44
45 $Data = DB::table('job_titles')-> 45 $Data = DB::table('job_titles')->
46 selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')-> 46 selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')->
47 where('categories.is_remove', '=', '0')-> 47 where('categories.is_remove', '=', '0')->
48 where('job_titles.is_remove', '=', '0')-> 48 where('job_titles.is_remove', '=', '0')->
49 where('job_titles.is_bd', '=' , '0')-> 49 where('job_titles.is_bd', '=' , '0')->
50 leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')-> 50 leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')->
51 join('categories', 'categories.id', '=', 'job_titles.position_id')-> 51 join('categories', 'categories.id', '=', 'job_titles.position_id')->
52 groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')-> 52 groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')->
53 orderByDesc('job_titles.sort')->get()->toArray(); 53 orderByDesc('job_titles.sort')->get()->toArray();
54 54
55 $Main_Job = array(); 55 $Main_Job = array();
56 $name_cat = ''; 56 $name_cat = '';
57 foreach ($Data as $it) { 57 foreach ($Data as $it) {
58 $it_arr = (array)$it; 58 $it_arr = (array)$it;
59 if ($name_cat != $it_arr['catname']) $name_cat = $it_arr['catname']; 59 if ($name_cat != $it_arr['catname']) $name_cat = $it_arr['catname'];
60 $Main_Job[$name_cat][] = $it_arr; 60 $Main_Job[$name_cat][] = $it_arr;
61 } 61 }
62 62
63 $employers = employers_main::query()->with('employer')-> 63 $employers = employers_main::query()->with('employer')->
64 whereHas('employer', function ($query) { 64 whereHas('employer', function ($query) {
65 $query->where('status_hidden', '=', '0'); 65 $query->where('status_hidden', '=', '0');
66 })-> 66 })->
67 orderBy('sort')->get(); 67 orderBy('sort')->get();
68 $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get(); 68 $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get();
69 69
70 $block_names = MainPageCounters::values();; 70 $block_names = MainPageCounters::values();;
71 $blocks_counters = PageContent::select('name', 'title', 'description', 'extra') 71 $blocks_counters = PageContent::select('name', 'title', 'description', 'extra')
72 ->whereIn('name', $block_names) 72 ->whereIn('name', $block_names)
73 ->orderBy('name', 'asc') 73 ->orderBy('name', 'asc')
74 ->get() 74 ->get()
75 ->keyBy('name') 75 ->keyBy('name')
76 ->toArray(); 76 ->toArray();
77 77
78 return view('index', compact('news', 'Job_title', 'categories', 'employers', 'vacancy', 'Main_Job', 'blocks_counters')); 78 return view('index', compact('news', 'Job_title', 'categories', 'employers', 'vacancy', 'Main_Job', 'blocks_counters'));
79 } 79 }
80 80
81 public function search_vacancies(Request $request) { 81 public function search_vacancies(Request $request) {
82 if ($request->has('search')) { 82 if ($request->has('search')) {
83 $search = $request->get('search'); 83 $search = $request->get('search');
84 $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first(); 84 $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first();
85 if (isset($job_titles->id)) 85 if (isset($job_titles->id))
86 if ($job_titles->id > 0) 86 if ($job_titles->id > 0)
87 return redirect()->route('vacancies', ['job' => $job_titles->id]); 87 return redirect()->route('vacancies', ['job' => $job_titles->id]);
88 } 88 }
89 } 89 }
90 90
91 // Лайк вакансии 91 // Лайк вакансии
92 public function like_vacancy(Request $request) { 92 public function like_vacancy(Request $request) {
93 $IP_address = RusDate::ip_addr_client(); 93 $IP_address = RusDate::ip_addr_client();
94 94
95 if ($request->has('code_record')) { 95 if ($request->has('code_record')) {
96 if ($request->has('delete')) { 96 if ($request->has('delete')) {
97 $code = $request->get('code_record'); 97 $code = $request->get('code_record');
98 $atomic_era = Like_vacancy::select('id')-> 98 $atomic_era = Like_vacancy::select('id')->
99 where('code_record', '=', $code)->toSql(); 99 where('code_record', '=', $code)->toSql();
100 DB::table('like_vacancy')->where('code_record', $request->get('code_record'))->delete(); 100 DB::table('like_vacancy')->where('code_record', $request->get('code_record'))->delete();
101 101
102 } else { 102 } else {
103 $params = $request->all(); 103 $params = $request->all();
104 $params['ip_address'] = $IP_address; 104 $params['ip_address'] = $IP_address;
105 Like_vacancy::create($params); 105 Like_vacancy::create($params);
106 } 106 }
107 } 107 }
108 } 108 }
109 109
110 // Лайк соискателю. 110 // Лайк соискателю.
111 public function like_worker(Request $request) { 111 public function like_worker(Request $request) {
112 $IP_address = RusDate::ip_addr_client(); 112 $IP_address = RusDate::ip_addr_client();
113 113
114 if ($request->has('code_record')) { 114 if ($request->has('code_record')) {
115 if ($request->has('delete')) { 115 if ($request->has('delete')) {
116 $atomic_era = Like_worker::select('id')-> 116 $atomic_era = Like_worker::select('id')->
117 where('code_record', '=', $request-> 117 where('code_record', '=', $request->
118 get('code_record'))->first(); 118 get('code_record'))->first();
119 119
120 DB::table('like_worker')->where('code_record', $request->get('code_record'))->delete(); 120 DB::table('like_worker')->where('code_record', $request->get('code_record'))->delete();
121 121
122 return "Вот и результат удаления!"; 122 return "Вот и результат удаления!";
123 123
124 } else { 124 } else {
125 $params = $request->all(); 125 $params = $request->all();
126 $params['ip_address'] = $IP_address; 126 $params['ip_address'] = $IP_address;
127 Like_worker::create($params); 127 Like_worker::create($params);
128 } 128 }
129 } 129 }
130 } 130 }
131 131
132 public function vacancies(Request $request) { 132 public function vacancies(Request $request) {
133 //должности 133 //должности
134 $Job_title = Job_title::query()->where('is_remove', '=', '0')-> 134 $Job_title = Job_title::query()->where('is_remove', '=', '0')->
135 where('is_bd', '=', '0')->orderByDesc('sort')-> 135 where('is_bd', '=', '0')->orderByDesc('sort')->
136 orderBy('name')->get(); 136 orderBy('name')->get();
137 137
138 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') 138 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*')
139 ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary') 139 ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary')
140 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') 140 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id')
141 ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id'); 141 ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id');
142 142
143 //категории и вакансии 143 //категории и вакансии
144 if (($request->has('job')) && ($request->get('job') > 0)) { 144 if (($request->has('job')) && ($request->get('job') > 0)) {
145 $categories = $categories->Where('job_title_id', '=', $request->get('job')); 145 $categories = $categories->Where('job_title_id', '=', $request->get('job'));
146 } 146 }
147 147
148 $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get(); 148 $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get();
149 149
150 $Data = DB::table('job_titles')-> 150 $Data = DB::table('job_titles')->
151 selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')-> 151 selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')->
152 where('categories.is_remove', '=', '0')-> 152 where('categories.is_remove', '=', '0')->
153 where('job_titles.is_bd', '=' , '0')-> 153 where('job_titles.is_bd', '=' , '0')->
154 where('job_titles.is_remove', '=', '0'); 154 where('job_titles.is_remove', '=', '0');
155 if (($request->has('job')) && ($request->get('job') > 0)) { 155 if (($request->has('job')) && ($request->get('job') > 0)) {
156 $Data = $Data->where('job_title_id', $request->get('job')); 156 $Data = $Data->where('job_title_id', $request->get('job'));
157 } 157 }
158 $Data = $Data->leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')-> 158 $Data = $Data->leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')->
159 join('categories', 'categories.id', '=', 'job_titles.position_id')-> 159 join('categories', 'categories.id', '=', 'job_titles.position_id')->
160 groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')-> 160 groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')->
161 orderByDesc('job_titles.sort')->get()->toArray(); 161 orderByDesc('job_titles.sort')->get()->toArray();
162 162
163 $Main_Job = array(); 163 $Main_Job = array();
164 $name_cat = ''; 164 $name_cat = '';
165 foreach ($Data as $it) { 165 foreach ($Data as $it) {
166 $it_arr = (array)$it; 166 $it_arr = (array)$it;
167 if ($name_cat != $it_arr['catname']) 167 if ($name_cat != $it_arr['catname'])
168 $name_cat = $it_arr['catname']; 168 $name_cat = $it_arr['catname'];
169 $Main_Job[$name_cat][] = $it_arr; 169 $Main_Job[$name_cat][] = $it_arr;
170 } 170 }
171 171
172 if ($request->ajax()) { 172 if ($request->ajax()) {
173 return view('ajax.new_sky', compact('categories', 'Main_Job')); 173 return view('ajax.new_sky', compact('categories', 'Main_Job'));
174 } else { 174 } else {
175 return view('new_sky', compact('Job_title', 'categories', 'Main_Job')); 175 return view('new_sky', compact('Job_title', 'categories', 'Main_Job'));
176 } 176 }
177 } 177 }
178 178
179 //Вакансии категория детальная 179 //Вакансии категория детальная
180 public function list_vacancies(Category $categories, Request $request) { 180 public function list_vacancies(Category $categories, Request $request) {
181 if (isset(Auth()->user()->id)) 181 if (isset(Auth()->user()->id))
182 $uid = Auth()->user()->id; 182 $uid = Auth()->user()->id;
183 else 183 else
184 $uid = 0; 184 $uid = 0;
185 185
186 if ($request->get('job') == 0) 186 if ($request->get('job') == 0)
187 $job_search = ''; 187 $job_search = '';
188 else 188 else
189 $job_search = $request->get('job'); 189 $job_search = $request->get('job');
190 190
191 $Query = Ad_employer::with('jobs')-> 191 $Query = Ad_employer::with('jobs')->
192 with('cat')-> 192 with('cat')->
193 with('employer')-> 193 with('employer')->
194 whereHas('jobs_code', function ($query) use ($job_search) { 194 whereHas('jobs_code', function ($query) use ($job_search) {
195 if (!empty($job_search)) { 195 if (!empty($job_search)) {
196 $query->where('job_title_id', $job_search); 196 $query->where('job_title_id', $job_search);
197 } 197 }
198 })->select('ad_employers.*'); 198 })->select('ad_employers.*');
199 199
200 if (isset($categories->id) && ($categories->id > 0)) { 200 if (isset($categories->id) && ($categories->id > 0)) {
201 $Query = $Query->where('category_id', '=', $categories->id); 201 $Query = $Query->where('category_id', '=', $categories->id);
202 $Name_categori = Category::query()->where('id', '=', $categories->id)->get(); 202 $Name_categori = Category::query()->where('id', '=', $categories->id)->get();
203 } else { 203 } else {
204 $Name_categori = ''; 204 $Name_categori = '';
205 } 205 }
206 206
207 if ($request->get('sort')) { 207 if ($request->get('sort')) {
208 $sort = $request->get('sort'); 208 $sort = $request->get('sort');
209 switch ($sort) { 209 switch ($sort) {
210 case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break; 210 case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break;
211 case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break; 211 case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break;
212 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; 212 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
213 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; 213 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
214 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; 214 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
215 default: $Query = $Query->orderbyDesc('updated_at')->orderBy('id'); break; 215 default: $Query = $Query->orderbyDesc('updated_at')->orderBy('id'); break;
216 } 216 }
217 } 217 }
218 218
219 $Job_title = Job_title::query()->where('is_remove', '=', '0')-> 219 $Job_title = Job_title::query()->where('is_remove', '=', '0')->
220 where('is_bd', '=', '0')->orderByDesc('sort')-> 220 where('is_bd', '=', '0')->orderByDesc('sort')->
221 orderBy('name')->get(); 221 orderBy('name')->get();
222 222
223 $Query_count = $Query->count(); 223 $Query_count = $Query->count();
224 224
225 $Query = $Query->OrderByDesc('updated_at')->paginate(10); 225 $Query = $Query->OrderByDesc('updated_at')->paginate(10);
226 226
227 $Reclama = reclame::query()->get(); 227 $Reclama = reclame::query()->get();
228 228
229 if ($request->ajax()) { 229 if ($request->ajax()) {
230 if ($request->has('title')) { 230 if ($request->has('title')) {
231 return view('ajax.list_category', compact( 231 return view('ajax.list_category', compact(
232 'Name_categori' 232 'Name_categori'
233 )); 233 ));
234 } else { 234 } else {
235 return view('ajax.list_vacancies', compact('Query', 235 return view('ajax.list_vacancies', compact('Query',
236 'Query_count', 236 'Query_count',
237 'Name_categori', 237 'Name_categori',
238 'Reclama', 238 'Reclama',
239 'categories', 239 'categories',
240 'Job_title', 240 'Job_title',
241 'uid')); 241 'uid'));
242 } 242 }
243 } else { 243 } else {
244 //Вернуть все 244 //Вернуть все
245 return view('list_vacancies', compact('Query', 245 return view('list_vacancies', compact('Query',
246 'Query_count', 246 'Query_count',
247 'Reclama', 247 'Reclama',
248 'Name_categori', 248 'Name_categori',
249 'categories', 249 'categories',
250 'Job_title', 250 'Job_title',
251 'uid')); 251 'uid'));
252 } 252 }
253 } 253 }
254 254
255 // Контакты 255 // Контакты
256 public function contacts() { 256 public function contacts() {
257 return view('contacts'); 257 return view('contacts');
258 } 258 }
259 259
260 // Вход в личный кабинет 260 // Вход в личный кабинет
261 public function input_login(Request $request) 261 public function input_login(Request $request)
262 { 262 {
263 $params = $request->all(); 263 $params = $request->all();
264 264
265 265
266 $rules = [ 266 $rules = [
267 'email' => 'required|string|email', 267 'email' => 'required|string|email',
268 'password' => 'required|string|min:3|max:25', 268 'password' => 'required|string|min:3|max:25',
269 ]; 269 ];
270 270
271 $messages = [ 271 $messages = [
272 'required' => 'Укажите обязательное поле «:attribute»', 272 'required' => 'Укажите обязательное поле «:attribute»',
273 'email' => 'Введите корректный email', 273 'email' => 'Введите корректный email',
274 'min' => [ 274 'min' => [
275 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 275 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
276 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 276 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
277 ], 277 ],
278 'max' => [ 278 'max' => [
279 'string' => 'Поле «:attribute» должно быть не больше :max символов', 279 'string' => 'Поле «:attribute» должно быть не больше :max символов',
280 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 280 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
281 ], 281 ],
282 ]; 282 ];
283 $validator = Validator::make($request->all(), $rules, $messages); 283 $validator = Validator::make($request->all(), $rules, $messages);
284 if ($validator->fails()) { 284 if ($validator->fails()) {
285 if (Auth::check()) 285 if (Auth::check())
286 $user_id = $request->user()->id; 286 $user_id = $request->user()->id;
287 else 287 else
288 $user_id = 0; 288 $user_id = 0;
289 289
290 if ($user_id > 0) 290 if ($user_id > 0)
291 return json_encode(Array("ERROR" => "Email или пароль невалидный!")); 291 return json_encode(Array("ERROR" => "Email или пароль невалидный!"));
292 else 292 else
293 return redirect()->route('index')->with('Error', "Email или пароль невалидный"); 293 return redirect()->route('index')->with('Error', "Email или пароль невалидный");
294 } else { 294 } else {
295 $credentials = $request->only('email', 'password'); 295 $credentials = $request->only('email', 'password');
296 296
297 if (Auth::attempt($credentials, $request->has('remember'))) { 297 if (Auth::attempt($credentials, $request->has('remember'))) {
298 298
299 if (is_null(Auth::user()->email_verified_at)) { 299 if (is_null(Auth::user()->email_verified_at)) {
300 Auth::logout(); 300 Auth::logout();
301 return json_encode(Array("ERROR" => "Адрес почты не подтвержден")); 301 return json_encode(Array("ERROR" => "Адрес почты не подтвержден"));
302 } 302 }
303 303
304 if (Auth::user()->is_worker) { 304 if (Auth::user()->is_worker) {
305 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl())); 305 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));
306 } else { 306 } else {
307 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl())); 307 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));
308 } 308 }
309 309
310 return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет")); 310 return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет"));
311 //->route('index') 311 //->route('index')
312 //->with('success', 'Вы вошли в личный кабинет.'); 312 //->with('success', 'Вы вошли в личный кабинет.');
313 } else { 313 } else {
314 return json_encode(Array("ERROR" => "Неверный логин или пароль!")); 314 return json_encode(Array("ERROR" => "Неверный логин или пароль!"));
315 } 315 }
316 } 316 }
317 } 317 }
318 318
319 // Восстановление пароля 319 // Восстановление пароля
320 public function repair_password(Request $request) { 320 public function repair_password(Request $request) {
321 $rules = [ 321 $rules = [
322 'email' => 'required|string|email', 322 'email' => 'required|string|email',
323 ]; 323 ];
324 324
325 $messages = [ 325 $messages = [
326 'required' => 'Укажите обязательное поле «:attribute»', 326 'required' => 'Укажите обязательное поле «:attribute»',
327 'email' => 'Введите корректный email', 327 'email' => 'Введите корректный email',
328 'min' => [ 328 'min' => [
329 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 329 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
330 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 330 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
331 ], 331 ],
332 'max' => [ 332 'max' => [
333 'string' => 'Поле «:attribute» должно быть не больше :max символов', 333 'string' => 'Поле «:attribute» должно быть не больше :max символов',
334 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 334 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
335 ], 335 ],
336 ]; 336 ];
337 337
338 $validator = Validator::make($request->all(), $rules, $messages); 338 $validator = Validator::make($request->all(), $rules, $messages);
339 339
340 if ($validator->fails()) { 340 if ($validator->fails()) {
341 return redirect()->back()->with('Error', "Email невалидный"); 341 return redirect()->back()->with('Error', "Email невалидный");
342 } else { 342 } else {
343 $new_password = Tools::generator_id(10); 343 $new_password = Tools::generator_id(10);
344 $hash_password = Hash::make($new_password); 344 $hash_password = Hash::make($new_password);
345 $user = User::query()->where('email', $request->get('email'))->first(); 345 $user = User::query()->where('email', $request->get('email'))->first();
346 $EditRec = User::find($user->id); 346 $EditRec = User::find($user->id);
347 $EditRec->password = $hash_password; 347 $EditRec->password = $hash_password;
348 $EditRec->save(); 348 $EditRec->save();
349 349
350 foreach ([$request->get('email')] as $recipient) { 350 foreach ([$request->get('email')] as $recipient) {
351 Mail::to($recipient)->send(new MailRepair($new_password)); 351 Mail::to($recipient)->send(new MailRepair($new_password));
352 } 352 }
353 return redirect()->route('index'); 353 return redirect()->route('index');
354 354
355 } 355 }
356 356
357 } 357 }
358 358
359 // Вывод новостей 359 // Вывод новостей
360 public function news(Request $request) { 360 public function news(Request $request) {
361 $Query = News::query(); 361 $Query = News::query();
362 if ($request->has('search')) { 362 if ($request->has('search')) {
363 $search = $request->get('search'); 363 $search = $request->get('search');
364 $Query = $Query->where('title', 'LIKE', "%$search%")-> 364 $Query = $Query->where('title', 'LIKE', "%$search%")->
365 orWhere('text', 'LIKE', "%$search%"); 365 orWhere('text', 'LIKE', "%$search%");
366 } 366 }
367 367
368 if ($request->ajax()) { 368 if ($request->ajax()) {
369 if ($request->get('sort')) { 369 if ($request->get('sort')) {
370 $sort = $request->get('sort'); 370 $sort = $request->get('sort');
371 switch ($sort) { 371 switch ($sort) {
372 case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break; 372 case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break;
373 case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break; 373 case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break;
374 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; 374 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
375 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; 375 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
376 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; 376 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
377 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; 377 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break;
378 } 378 }
379 } 379 }
380 } 380 }
381 $Query_count = $Query->count(); 381 $Query_count = $Query->count();
382 $Query = $Query->paginate(6); 382 $Query = $Query->paginate(6);
383 383
384 if ($request->ajax()) { 384 if ($request->ajax()) {
385 return view('ajax.news-list', compact('Query', 'Query_count')); 385 return view('ajax.news-list', compact('Query', 'Query_count'));
386 } else { 386 } else {
387 return view('news-list', compact('Query', 'Query_count')); 387 return view('news-list', compact('Query', 'Query_count'));
388 } 388 }
389 } 389 }
390 390
391 //Детальная новость 391 //Детальная новость
392 public function detail_new(News $new) { 392 public function detail_new(News $new) {
393 // Наборка 393 // Наборка
394 $Query = News::query()->where('id', $new->id)->get(); 394 $Query = News::query()->where('id', $new->id)->get();
395 $title = $Query[0]->title; 395 $title = $Query[0]->title;
396 $All_Query = News::query()->paginate(8); 396 $All_Query = News::query()->paginate(8);
397 return view('detail_new', compact('Query', 'All_Query', 'title')); 397 return view('detail_new', compact('Query', 'All_Query', 'title'));
398 } 398 }
399 } 399 }
400 400
resources/views/education/show.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 $(function(){ 5 $(function(){
6 $( ".accordion").accordion(); 6 $( ".accordion").accordion();
7 7
8 $('ul.accordion-sub li.accordion-item').click(function(){ 8 $('ul.accordion-sub li.accordion-item').click(function(){
9 var this_li = $(this); 9 var this_li = $(this);
10 var thumb = this_li.find('.accordion-thumb'); 10 var thumb = this_li.find('.accordion-thumb');
11 var parent_ul = this_li.closest('ul'); 11 var parent_ul = this_li.closest('ul');
12 var panel = this_li.closest('.accordion-panel'); 12 var panel = this_li.closest('.accordion-panel');
13 var added_height = parseInt(panel.data('added-height')); 13 var added_height = parseInt(panel.data('added-height'));
14 14
15 if (isNaN(added_height)){ 15 if (isNaN(added_height)){
16 added_height = 0; 16 added_height = 0;
17 } 17 }
18 18
19 parent_ul.find('.accordion-panel').hide(500); 19 parent_ul.find('.accordion-panel').hide(500);
20 20
21 if (thumb.hasClass('ui-state-active')){ 21 if (thumb.hasClass('ui-state-active')){
22 thumb.removeClass('ui-state-active'); 22 thumb.removeClass('ui-state-active');
23 23
24 var panel_height = panel.height() - parseInt(added_height); 24 var panel_height = panel.height() - parseInt(added_height);
25 panel.animate({height: panel_height + "px"}, 500 ); 25 panel.animate({height: panel_height + "px"}, 500 );
26 panel.data('added-height', 0); 26 panel.data('added-height', 0);
27 } else { 27 } else {
28 parent_ul.find('.accordion-thumb').removeClass('ui-state-active'); 28 parent_ul.find('.accordion-thumb').removeClass('ui-state-active');
29 thumb.addClass('ui-state-active'); 29 thumb.addClass('ui-state-active');
30 30
31 var add_height = this_li.find('.accordion-panel').height(); 31 var add_height = this_li.find('.accordion-panel').height();
32 var panel_height = panel.height() + parseInt(add_height) - parseInt(added_height); 32 var panel_height = panel.height() + parseInt(add_height) - parseInt(added_height);
33 panel.animate({height: panel_height + "px"}, 500 ); 33 panel.animate({height: panel_height + "px"}, 500 );
34 this_li.find('.accordion-panel').show(500); 34 this_li.find('.accordion-panel').show(500);
35 panel.data('added-height', add_height); 35 panel.data('added-height', add_height);
36 } 36 }
37 }); 37 });
38 }); 38 });
39 </script> 39 </script>
40 @endsection 40 @endsection
41 41
42 @section('content') 42 @section('content')
43 <section class="thing"> 43 <section class="thing">
44 <div class="container"> 44 <div class="container">
45 <div class="flex-middle-sm row"> 45 <div class="flex-middle-sm row">
46 <div class="col-xs-12 col-sm-12"> 46 <div class="col-xs-12 col-sm-12">
47 <div class="candidate-top-wrapper"> 47 <div class="candidate-top-wrapper">
48 <div class="candidate-thumbnail"> 48 <div class="candidate-thumbnail">
49 @if($education->image) 49 @if($education->image)
50 <img width="150" height="150" src="asset(Storage::url($education->image)) }}" alt=""> 50 <img width="150" height="150" src="{{ asset(Storage::url($education->image)) }}" alt="">
51 @endif 51 @endif
52 </div> 52 </div>
53 <div class="candidate-information"> 53 <div class="candidate-information">
54 <h1 class="candidate-title">{{$education->name}}</h1> 54 <h1 class="candidate-title">{{$education->name}}</h1>
55 </div> 55 </div>
56 </div> 56 </div>
57 </div> 57 </div>
58 </div> 58 </div>
59 </div> 59 </div>
60 </section> 60 </section>
61 61
62 <main class="main"> 62 <main class="main">
63 <div class="container"> 63 <div class="container">
64 <div class="content-single-candidate"> 64 <div class="content-single-candidate">
65 <div class="list-content-candidate"> 65 <div class="list-content-candidate">
66 <div class="education-detail-description"> 66 <div class="education-detail-description">
67 <h3 class="title">Об учебном заведении</h3> 67 <h3 class="title">Об учебном заведении</h3>
68 <div class="inner"> 68 <div class="inner">
69 {!!$education->text!!} 69 {!!$education->text!!}
70 </div> 70 </div>
71 </div> 71 </div>
72 </div> 72 </div>
73 </div> 73 </div>
74 74
75 @if($levels_education_programs) 75 @if($levels_education_programs)
76 <div class="education-detail-programs"> 76 <div class="education-detail-programs">
77 <h3 class="title">Программы обучения</h3> 77 <h3 class="title">Программы обучения</h3>
78 78
79 <ul class="accordion"> 79 <ul class="accordion">
80 @foreach($levels_education_programs as $level_name => $education_programs) 80 @foreach($levels_education_programs as $level_name => $education_programs)
81 <li class="accordion-item"> 81 <li class="accordion-item">
82 <h3 class="accordion-thumb">{{$level_name}}</h3> 82 <h3 class="accordion-thumb">{{$level_name}}</h3>
83 <div class="accordion-panel"> 83 <div class="accordion-panel">
84 <div> 84 <div>
85 <ul class="accordion-sub"> 85 <ul class="accordion-sub">
86 @foreach($education_programs as $education_program) 86 @foreach($education_programs as $education_program)
87 <li class="accordion-item"> 87 <li class="accordion-item">
88 <h3 class="accordion-thumb">{{$education_program['name']}}</h3> 88 <h3 class="accordion-thumb">{{$education_program['name']}}</h3>
89 <div class="accordion-panel">{!!$education_program['text']!!}</div> 89 <div class="accordion-panel">{!!$education_program['text']!!}</div>
90 </li> 90 </li>
91 @endforeach 91 @endforeach
92 </ul> 92 </ul>
93 </div> 93 </div>
94 </div> 94 </div>
95 </li> 95 </li>
96 @endforeach 96 @endforeach
97 </ul> 97 </ul>
98 </div> 98 </div>
99 @endif 99 @endif
100 100
101 @if($education->address || $education->telephone || $education->email) 101 @if($education->address || $education->telephone || $education->email)
102 <div class="education-detail-contacts"> 102 <div class="education-detail-contacts">
103 <h3 class="title">Контактная информация</h3> 103 <h3 class="title">Контактная информация</h3>
104 <div class="inner"> 104 <div class="inner">
105 <div class="contacts address"> 105 <div class="contacts address">
106 <div class="icon"><svg width="14" height="19" viewBox="0 0 14 19" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6.84935 19C6.68849 18.8698 6.49925 18.7582 6.36678 18.6048C4.75349 16.759 3.26794 14.8156 2.03314 12.7002C1.31402 11.4728 0.68479 10.2036 0.296844 8.82738C-0.289805 6.76775 -0.0154048 4.82435 1.19574 3.04832C2.35012 1.36529 3.9776 0.351743 6.0356 0.0727861C8.0463 -0.201521 9.86302 0.300601 11.4337 1.56056C12.8199 2.67173 13.6431 4.11301 13.9223 5.85649C14.1399 7.21408 13.8797 8.50193 13.4018 9.76188C12.7632 11.4542 11.8501 13.0024 10.8376 14.4948C9.86302 15.9315 8.78907 17.2984 7.63943 18.6048C7.50223 18.7582 7.31772 18.8698 7.15686 19C7.05278 19 6.95343 19 6.84935 19ZM6.98181 10.343C8.88843 10.3756 10.4875 8.83203 10.5206 6.92117C10.5538 5.01497 8.99251 3.44351 7.03386 3.41097C5.11305 3.37842 3.51396 4.92198 3.48557 6.84214C3.45245 8.74834 5.0137 10.3058 6.98181 10.343Z" fill="#0E5C69"></path></svg></div> 106 <div class="icon"><svg width="14" height="19" viewBox="0 0 14 19" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6.84935 19C6.68849 18.8698 6.49925 18.7582 6.36678 18.6048C4.75349 16.759 3.26794 14.8156 2.03314 12.7002C1.31402 11.4728 0.68479 10.2036 0.296844 8.82738C-0.289805 6.76775 -0.0154048 4.82435 1.19574 3.04832C2.35012 1.36529 3.9776 0.351743 6.0356 0.0727861C8.0463 -0.201521 9.86302 0.300601 11.4337 1.56056C12.8199 2.67173 13.6431 4.11301 13.9223 5.85649C14.1399 7.21408 13.8797 8.50193 13.4018 9.76188C12.7632 11.4542 11.8501 13.0024 10.8376 14.4948C9.86302 15.9315 8.78907 17.2984 7.63943 18.6048C7.50223 18.7582 7.31772 18.8698 7.15686 19C7.05278 19 6.95343 19 6.84935 19ZM6.98181 10.343C8.88843 10.3756 10.4875 8.83203 10.5206 6.92117C10.5538 5.01497 8.99251 3.44351 7.03386 3.41097C5.11305 3.37842 3.51396 4.92198 3.48557 6.84214C3.45245 8.74834 5.0137 10.3058 6.98181 10.343Z" fill="#0E5C69"></path></svg></div>
107 <div>{{$education->address}}</div> 107 <div>{{$education->address}}</div>
108 </div> 108 </div>
109 <div class="contacts phone"> 109 <div class="contacts phone">
110 <div class="icon"><svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.80729 6.05208C3.97396 8.3125 5.6875 10.026 7.94792 11.1927L9.66146 9.47917C9.90451 9.23611 10.1719 9.17535 10.4635 9.29688C11.3385 9.58854 12.2622 9.73438 13.2344 9.73438C13.4531 9.73438 13.6354 9.80729 13.7812 9.95312C13.9271 10.099 14 10.2812 14 10.5V13.2344C14 13.4531 13.9271 13.6354 13.7812 13.7812C13.6354 13.9271 13.4531 14 13.2344 14C9.58854 14 6.46528 12.7118 3.86458 10.1354C1.28819 7.53472 0 4.41146 0 0.765625C0 0.546875 0.0729167 0.364583 0.21875 0.21875C0.364583 0.0729167 0.546875 0 0.765625 0H3.5C3.71875 0 3.90104 0.0729167 4.04688 0.21875C4.19271 0.364583 4.26562 0.546875 4.26562 0.765625C4.26562 1.73785 4.41146 2.66146 4.70312 3.53646C4.80035 3.85243 4.73958 4.11979 4.52083 4.33854L2.80729 6.05208Z" fill="#0E5C69"></path></svg></div> 110 <div class="icon"><svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.80729 6.05208C3.97396 8.3125 5.6875 10.026 7.94792 11.1927L9.66146 9.47917C9.90451 9.23611 10.1719 9.17535 10.4635 9.29688C11.3385 9.58854 12.2622 9.73438 13.2344 9.73438C13.4531 9.73438 13.6354 9.80729 13.7812 9.95312C13.9271 10.099 14 10.2812 14 10.5V13.2344C14 13.4531 13.9271 13.6354 13.7812 13.7812C13.6354 13.9271 13.4531 14 13.2344 14C9.58854 14 6.46528 12.7118 3.86458 10.1354C1.28819 7.53472 0 4.41146 0 0.765625C0 0.546875 0.0729167 0.364583 0.21875 0.21875C0.364583 0.0729167 0.546875 0 0.765625 0H3.5C3.71875 0 3.90104 0.0729167 4.04688 0.21875C4.19271 0.364583 4.26562 0.546875 4.26562 0.765625C4.26562 1.73785 4.41146 2.66146 4.70312 3.53646C4.80035 3.85243 4.73958 4.11979 4.52083 4.33854L2.80729 6.05208Z" fill="#0E5C69"></path></svg></div>
111 <div>{{$education->telephone}}</div> 111 <div>{{$education->telephone}}</div>
112 </div> 112 </div>
113 <div class="contacts email"> 113 <div class="contacts email">
114 <div class="icon"><svg width="15" height="12" viewBox="0 0 15 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.7451 0H0L7.37253 3.68627L14.7451 0Z" fill="#0E5C69"></path><path d="M4.95911e-05 11.0588L14.7451 11.0588L7.37258 5.52944L4.95911e-05 11.0588Z" fill="#0E5C69"></path><path d="M14.7451 11.0588L14.7451 0L7.37258 5.5294L14.7451 11.0588Z" fill="#0E5C69"></path><path d="M1.31875e-07 3.71933e-05L0 11.0588L7.37253 5.52944L1.31875e-07 3.71933e-05Z" fill="#0E5C69"></path></svg></div> 114 <div class="icon"><svg width="15" height="12" viewBox="0 0 15 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.7451 0H0L7.37253 3.68627L14.7451 0Z" fill="#0E5C69"></path><path d="M4.95911e-05 11.0588L14.7451 11.0588L7.37258 5.52944L4.95911e-05 11.0588Z" fill="#0E5C69"></path><path d="M14.7451 11.0588L14.7451 0L7.37258 5.5294L14.7451 11.0588Z" fill="#0E5C69"></path><path d="M1.31875e-07 3.71933e-05L0 11.0588L7.37253 5.52944L1.31875e-07 3.71933e-05Z" fill="#0E5C69"></path></svg></div>
115 <div>{{$education->email}}</div> 115 <div>{{$education->email}}</div>
116 </div> 116 </div>
117 </div> 117 </div>
118 </div> 118 </div>
119 @endif 119 @endif
120 120
121 </div> 121 </div>
122 </main> 122 </main>
123 @endsection 123 @endsection
124 124
resources/views/employers/bd.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 $(document).ready(function(){ 5 $(document).ready(function(){
6 $('[name="job_title_list[]"]').chosen({ 6 $('[name="job_title_list[]"]').chosen({
7 width: '100%' 7 width: '100%'
8 }) 8 })
9 $('[name="job_title"]').change(function(){ 9 $('[name="job_titles__name"]').change(function(){
10 if ($(this).is(':checked')){ 10 if ($(this).is(':checked')){
11 $(".job-title-list-wrap").css("display", "block"); 11 $(".job-title-list-wrap").css("display", "block");
12 } else { 12 } else {
13 $(".job-title-list-wrap").css("display", "none"); 13 $(".job-title-list-wrap").css("display", "none");
14 } 14 }
15 }); 15 });
16 $('.cabinet__export-button-wrap button').click(function(){ 16 $('.cabinet__export-button-wrap button').click(function(){
17 $('.cabinet__export-error').parent().remove(); 17 $('.cabinet__export-error').parent().remove();
18 }); 18 });
19 }); 19 });
20 20
21 21
22 $(document).on('click', '.die_black', function() { 22 $(document).on('click', '.die_black', function() {
23 var this_ = $(this); 23 var this_ = $(this);
24 var ajax_ = $('#ajax_flot_div'); 24 var ajax_ = $('#ajax_flot_div');
25 var id_ = this_.attr('data-test'); 25 var id_ = this_.attr('data-test');
26 var url_ = this_.attr('data-link'); 26 var url_ = this_.attr('data-link');
27 27
28 console.log(url_); 28 console.log(url_);
29 $.ajax({ 29 $.ajax({
30 type: "GET", 30 type: "GET",
31 url: url_, 31 url: url_,
32 success: function (data) { 32 success: function (data) {
33 console.log('Ответка'); 33 console.log('Ответка');
34 ajax_.html(data); 34 ajax_.html(data);
35 }, 35 },
36 headers: { 36 headers: {
37 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 37 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
38 }, 38 },
39 error: function (data) { 39 error: function (data) {
40 console.log('Error: ' + data); 40 console.log('Error: ' + data);
41 } 41 }
42 }); 42 });
43 43
44 }); 44 });
45 </script> 45 </script>
46 @endsection 46 @endsection
47 47
48 @section('content') 48 @section('content')
49 <section class="cabinet"> 49 <section class="cabinet">
50 <div class="container"> 50 <div class="container">
51 <ul class="breadcrumbs cabinet__breadcrumbs"> 51 <ul class="breadcrumbs cabinet__breadcrumbs">
52 <li><a href="{{ route('index') }}">Главная</a></li> 52 <li><a href="{{ route('index') }}">Главная</a></li>
53 <li><b>Личный кабинет</b></li> 53 <li><b>Личный кабинет</b></li>
54 </ul> 54 </ul>
55 <div class="cabinet__wrapper"> 55 <div class="cabinet__wrapper">
56 <div class="cabinet__side"> 56 <div class="cabinet__side">
57 <div class="cabinet__side-toper"> 57 <div class="cabinet__side-toper">
58 @include('employers.emblema') 58 @include('employers.emblema')
59 </div> 59 </div>
60 @include('employers.menu', ['item' => 7]) 60 @include('employers.menu', ['item' => 7])
61 </div> 61 </div>
62 62
63 <div class="cabinet__body"> 63 <div class="cabinet__body">
64 <div class="cabinet__body-item"> 64 <div class="cabinet__body-item">
65 <h2 class="title cabinet__title">База данных</h2> 65 <h2 class="title cabinet__title">База данных</h2>
66 </div> 66 </div>
67 <div class="cabinet__body-item"> 67 <div class="cabinet__body-item">
68 <div class="cabinet__filters"> 68 <div class="cabinet__filters">
69 <div class="cabinet__filters-item"> 69 <div class="cabinet__filters-item">
70 <form class="search" action="{{ route('employer.bd') }}"> 70 <form class="search" action="{{ route('employer.bd') }}">
71 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;" value="@if (isset($_GET['search'])) {{ $_GET['search'] }} @endif"> 71 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;" value="@if (isset($_GET['search'])) {{ $_GET['search'] }} @endif">
72 <button type="submit" class="button">Найти</button> 72 <button type="submit" class="button">Найти</button>
73 <span> 73 <span>
74 <svg> 74 <svg>
75 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 75 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
76 </svg> 76 </svg>
77 </span> 77 </span>
78 </form> 78 </form>
79 </div> 79 </div>
80 </div> 80 </div>
81 <div class="cabinet__filters"> 81 <div class="cabinet__filters">
82 <div class="cabinet__export-wrap"> 82 <div class="cabinet__export-wrap">
83 <form action="{{ route('resume_download_all') }}" method="GET" target="_blank"> 83 <form action="{{ route('resume_download_all') }}" method="GET" target="_blank">
84 <div class="cabinet__export-button-wrap"> 84 <div class="cabinet__export-button-wrap">
85 <button type="submit" class="button"> 85 <button type="submit" class="button">
86 <svg> 86 <svg>
87 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> 87 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
88 </svg> 88 </svg>
89 Экспорт 89 Экспорт
90 </button> 90 </button>
91 </div> 91 </div>
92 <div class="cabinet__export-options-wrap"> 92 <div class="cabinet__export-options-wrap">
93 @foreach ($export_options as $key => $value) 93 @foreach ($export_options as $key => $value)
94 <label class="checkbox"> 94 <label class="checkbox">
95 <input type="checkbox" value="1" name="{{$key}}" class="checkbox__input" checked=""> 95 <input type="checkbox" value="1" name="{{$key}}" class="checkbox__input" checked="">
96 <span class="checkbox__icon"> 96 <span class="checkbox__icon">
97 <svg> 97 <svg>
98 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use> 98 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use>
99 </svg> 99 </svg>
100 </span> 100 </span>
101 <span class="checkbox__text"> 101 <span class="checkbox__text">
102 <span>{{$value}}</span> 102 <span>{{$value}}</span>
103 </span> 103 </span>
104 </label> 104 </label>
105 @endforeach 105 @endforeach
106 </div> 106 </div>
107 <div class="job-title-list-wrap"> 107 <div class="job-title-list-wrap">
108 <select name="job_title_list[]" data-placeholder="Выберите должности" multiple > 108 <select name="job_title_list[]" data-placeholder="Выберите должности" multiple >
109 @foreach($jobs_titles as $job_title) 109 @foreach($jobs_titles as $job_title)
110 <option value="{{$job_title['id']}}">{{$job_title['name']}}</option> 110 <option value="{{$job_title['id']}}">{{$job_title['name']}}</option>
111 @endforeach 111 @endforeach
112 </select> 112 </select>
113 </div> 113 </div>
114 </form> 114 </form>
115 </div> 115 </div>
116 </div> 116 </div>
117 @if(session('error')) 117 @if(session('error'))
118 <div class="cabinet__filters"> 118 <div class="cabinet__filters">
119 <p class="cabinet__export-error">{{ session('error') }}</p> 119 <p class="cabinet__export-error">{{ session('error') }}</p>
120 </div> 120 </div>
121 @endif 121 @endif
122 122
123 </div> 123 </div>
124 124
125 <div class="cabinet__body-item"> 125 <div class="cabinet__body-item">
126 <div class="cabinet__table-header"> 126 <div class="cabinet__table-header">
127 <div><!--_if (isset($it->workers[0]->job_titles[0]->name)) _ $it->workers[0]->job_titles[0]->name }}_else Не указано _endif--> 127 <div>
128 Позиции работников 128 Позиции работников
129 </div> 129 </div>
130 <span> 130 <span>
131 Всего вакансий найдено: 131 Пользователей найдено:
132 <b>{{ $count_users->count() }}</b> 132 <b>{{ $count_users->count() }}</b>
133 </span> 133 </span>
134 </div> 134 </div>
135 <div class="table table_spoiler"> 135 <div class="table table_spoiler">
136 <!--<button type="button" class="table__button js-toggle js-parent-toggle button button_light button_more"> 136 <!--<button type="button" class="table__button js-toggle js-parent-toggle button button_light button_more">
137 <span>Показать ещё</span> 137 <span>Показать ещё</span>
138 <span>Свернуть</span> 138 <span>Свернуть</span>
139 </button>--> 139 </button>-->
140 140
141 <div class="table__scroll"> 141 <div class="table__scroll">
142 <div class="table__body table__body_min-width"> 142 <div class="table__body table__body_min-width">
143 <table> 143 <table>
144 <thead> 144 <thead>
145 <tr> 145 <tr>
146 <th>ФИО соискателя</th> 146 <th>ФИО соискателя</th>
147 <th>Номер телефона</th> 147 <th>Должность</th>
148 <th>Электронная<br>почта</th>
149 <th>Наличие<br>анкеты</th> 148 <th>Наличие<br>анкеты</th>
150 </tr> 149 </tr>
151 </thead> 150 </thead>
152 <tbody> 151 <tbody>
153 @php 152 @php
154 $categories = 0; 153 $categories = 0;
155 154
156 @endphp 155 @endphp
157 156
158 @if ($users->count()) 157 @if ($users->count())
159 @foreach ($users as $key => $it) 158 @foreach ($users as $key => $it)
160 <tr> 159 <tr>
161 <td>{{ $it->surname." ".$it->name_man }}<br>{{ $it->surname2 }}</td> 160 <td>{{ $it->surname." ".$it->name_man }}<br>{{ $it->surname2 }}</td>
162 161
163 <td> 162 <td>{{ $it->jobtitles[0]->name ?? '-' }}</td>
164
165 @if (!empty($it->workers[0]->telephone))
166 <a href="tel:{{ $it->workers[0]->telephone }}">
167 {{ $it->workers[0]->telephone }}
168 </a>
169 @else
170 -
171 @endif
172
173 @if (!empty($it->workers[0]->telephone2))
174 <br><a href="tel:{{ $it->workers[0]->telephone2 }}">
175 {{ $it->workers[0]->telephone2 }}
176 </a>
177 @endif
178 </td>
179
180 <td>
181 @if (!empty($it->workers[0]->email))
182 <a href="emailto:{{ $it->workers[0]->email }}">{{ $it->workers[0]->email }}</a>
183 @else
184 -
185 @endif
186 </td>
187 163
188 <td> 164 <td>
189 @if (isset($it->workers[0]->id)) 165 @if (isset($it->workers[0]->id))
190 <a href="{{ route('resume_download', ['worker' => $it->workers[0]->id]) }}" class="table__link"> 166 <a href="{{ route('resume_download', ['worker' => $it->workers[0]->id]) }}" class="table__link">
191 <svg> 167 <svg>
192 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> 168 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
193 </svg> 169 </svg>
194 Скачать 170 Скачать
195 </a> 171 </a>
196 @endif 172 @endif
197 </td> 173 </td>
198 </tr> 174 </tr>
199 @endforeach 175 @endforeach
200 @endif 176 @endif
201 </tbody> 177 </tbody>
202 </table> 178 </table>
203 </div> 179 </div>
204 180
205 </div> 181 </div>
206 </div> 182 </div>
207 {{ $users->onEachSide(0)->appends($_GET)->links('paginate') }} 183 {{ $users->onEachSide(0)->appends($_GET)->links('paginate') }}
208 </div> 184 </div>
209 </div> 185 </div>
210 </div> 186 </div>
211 </div> 187 </div>
212 </section> 188 </section>
213 </div> 189 </div>
214 @endsection 190 @endsection
215 191
resources/views/employers/bd_tupe.blade.php
1 @extends('layout.frontend', ['title' => 'База резюме - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'База резюме - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 console.log('Test system'); 5 console.log('Test system');
6 $(document).on('click', '.die_black', function() { 6 $(document).on('click', '.die_black', function() {
7 var this_ = $(this); 7 var this_ = $(this);
8 var ajax_ = $('#ajax_flot_div'); 8 var ajax_ = $('#ajax_flot_div');
9 var id_ = this_.attr('data-test'); 9 var id_ = this_.attr('data-test');
10 var url_ = this_.attr('data-link'); 10 var url_ = this_.attr('data-link');
11 11
12 console.log(url_); 12 console.log(url_);
13 $.ajax({ 13 $.ajax({
14 type: "GET", 14 type: "GET",
15 url: url_, 15 url: url_,
16 success: function (data) { 16 success: function (data) {
17 console.log('Ответка'); 17 console.log('Ответка');
18 ajax_.html(data); 18 ajax_.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 console.log('Error: ' + data); 24 console.log('Error: ' + data);
25 } 25 }
26 }); 26 });
27 27
28 }); 28 });
29 </script> 29 </script>
30 @endsection 30 @endsection
31 31
32 @section('content') 32 @section('content')
33 <section class="cabinet"> 33 <section class="cabinet">
34 <div class="container"> 34 <div class="container">
35 <ul class="breadcrumbs cabinet__breadcrumbs"> 35 <ul class="breadcrumbs cabinet__breadcrumbs">
36 <li><a href="{{ route('index') }}">Главная</a></li> 36 <li><a href="{{ route('index') }}">Главная</a></li>
37 <li><b>Личный кабинет</b></li> 37 <li><b>Личный кабинет</b></li>
38 </ul> 38 </ul>
39 <div class="cabinet__wrapper"> 39 <div class="cabinet__wrapper">
40 <div class="cabinet__side"> 40 <div class="cabinet__side">
41 @include('employers.emblema') 41 @include('employers.emblema')
42 42
43 @include('employers.menu', ['item' => 8]) 43 @include('employers.menu', ['item' => 8])
44 </div> 44 </div>
45 45
46 <div class="cabinet__body"> 46 <div class="cabinet__body">
47 <div class="cabinet__body-item"> 47 <div class="cabinet__body-item">
48 <h2 class="title cabinet__title">База резюме</h2> 48 <h2 class="title cabinet__title">База резюме</h2>
49 </div> 49 </div>
50 <div class="cabinet__body-item"> 50 <div class="cabinet__body-item">
51 <div class="cabinet__filters"> 51 <div class="cabinet__filters">
52 <div class="cabinet__filters-item"> 52 <div class="cabinet__filters-item">
53 <form class="search"> 53 <form class="search">
54 <input type="search" class="input" placeholder="Поиск&hellip;" required> 54 <input type="search" class="input" placeholder="Поиск&hellip;" required>
55 <button type="submit" class="button">Найти</button> 55 <button type="submit" class="button">Найти</button>
56 <span> 56 <span>
57 <svg> 57 <svg>
58 <use xlink:href="images/sprite.svg#search"></use> 58 <use xlink:href="images/sprite.svg#search"></use>
59 </svg> 59 </svg>
60 </span> 60 </span>
61 </form> 61 </form>
62 </div> 62 </div>
63 <div class="cabinet__filters-item"> 63 <div class="cabinet__filters-item">
64 <button type="button" class="button"> 64 <button type="button" class="button">
65 <svg> 65 <svg>
66 <use xlink:href="images/sprite.svg#share"></use> 66 <use xlink:href="images/sprite.svg#share"></use>
67 </svg> 67 </svg>
68 Экспорт 68 Экспорт
69 </button> 69 </button>
70 </div> 70 </div>
71 </div> 71 </div>
72 </div> 72 </div>
73 <div class="cabinet__body-item"> 73 <div class="cabinet__body-item">
74 <div class="cabinet__table-header"> 74 <div class="cabinet__table-header">
75 <div>Капитан</div> 75 <div>Капитан</div>
76 <span> 76 <span>
77 Всего вакансий найдено: 77 Пользователей найдено:
78 <b>18</b> 78 <b>18</b>
79 </span> 79 </span>
80 </div> 80 </div>
81 <div class="table table_spoiler"> 81 <div class="table table_spoiler">
82 <button type="button" class="table__button js-toggle js-parent-toggle button button_light button_more"> 82 <button type="button" class="table__button js-toggle js-parent-toggle button button_light button_more">
83 <span>Показать ещё</span> 83 <span>Показать ещё</span>
84 <span>Свернуть</span> 84 <span>Свернуть</span>
85 </button> 85 </button>
86 <div class="table__scroll"> 86 <div class="table__scroll">
87 <div class="table__body table__body_min-width"> 87 <div class="table__body table__body_min-width">
88 <table> 88 <table>
89 <thead> 89 <thead>
90 <tr> 90 <tr>
91 <th>ФИО соискателя</th> 91 <th>ФИО соискателя</th>
92 <th>Номер телефона</th> 92 <th>Номер телефона</th>
93 <th>Электронная<br>почта</th> 93 <th>Электронная<br>почта</th>
94 <th>Наличие<br>анкеты</th> 94 <th>Наличие<br>анкеты</th>
95 </tr> 95 </tr>
96 </thead> 96 </thead>
97 <tbody> 97 <tbody>
98 @if ($Resume->count()) 98 @if ($Resume->count())
99 @foreach($Resume as $it) 99 @foreach($Resume as $it)
100 <tr> 100 <tr>
101 <td>{{ $it->surname." ".$it->name_man }}<br>{{ $it->surname2 }}</td> 101 <td>{{ $it->surname." ".$it->name_man }}<br>{{ $it->surname2 }}</td>
102 <td> 102 <td>
103 @if (isset($it->worker->telephone)) 103 @if (isset($it->worker->telephone))
104 <a href="tel:{{ $it->worker->telephone }}">{{ $it->worker->telephone }}</a> 104 <a href="tel:{{ $it->worker->telephone }}">{{ $it->worker->telephone }}</a>
105 @endif 105 @endif
106 </td> 106 </td>
107 <td> 107 <td>
108 @if (isset($it->worker->email)) 108 @if (isset($it->worker->email))
109 <a href="emailto:{{ $it->worker->email }}">{{ $it->worker->email }}</a> 109 <a href="emailto:{{ $it->worker->email }}">{{ $it->worker->email }}</a>
110 @endif 110 @endif
111 </td> 111 </td>
112 <td> 112 <td>
113 <a href="" class="table__link"> 113 <a href="" class="table__link">
114 <svg> 114 <svg>
115 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> 115 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
116 </svg> 116 </svg>
117 Скачать 117 Скачать
118 </a> 118 </a>
119 </td> 119 </td>
120 </tr> 120 </tr>
121 @endforeach 121 @endforeach
122 @endif 122 @endif
123 </tbody> 123 </tbody>
124 </table> 124 </table>
125 </div> 125 </div>
126 </div> 126 </div>
127 </div> 127 </div>
128 </div> 128 </div>
129 </div> 129 </div>
130 </div> 130 </div>
131 </div> 131 </div>
132 </section> 132 </section>
133 </div> 133 </div>
134 <div> 134 <div>
135 @endsection 135 @endsection
136 136
resources/views/workers/cabinet.blade.php
1 @extends('layout.frontend', ['title' => 'Моя анкета - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Моя анкета - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 $(function() { 5 $(function() {
6 $('.cabinet__avatar-form [type="file"][name="photo"]').change(function (event) { 6 $('.cabinet__avatar-form [type="file"][name="photo"]').change(function (event) {
7 var form = $(this).closest('form'); 7 var form = $(this).closest('form');
8 const file = event.target.files[0]; 8 const file = event.target.files[0];
9 9
10 if (file) { 10 if (file) {
11 var img_wrap = $('.cabinet__avatar-pic'); 11 var img_wrap = $('.cabinet__avatar-pic');
12 var img = $('<img src="#"/>'); 12 var img = $('<img src="#"/>');
13 const reader = new FileReader(); 13 const reader = new FileReader();
14 14
15 reader.onload = function(e) { 15 reader.onload = function(e) {
16 img.attr('src', e.target.result); 16 img.attr('src', e.target.result);
17 img_wrap.find('svg, img').remove(); 17 img_wrap.find('svg, img').remove();
18 img_wrap.append(img); 18 img_wrap.append(img);
19 19
20 setTimeout(function () { 20 setTimeout(function () {
21 form.submit(); 21 form.submit();
22 }, 1000); 22 }, 1000);
23 }; 23 };
24 24
25 reader.readAsDataURL(file); 25 reader.readAsDataURL(file);
26 } 26 }
27 }); 27 });
28 }); 28 });
29 29
30 $(document).on('click', '#old_year', function() { 30 $(document).on('click', '#old_year', function() {
31 var this_ = $(this); 31 var this_ = $(this);
32 var val = this_.val(); 32 var val = this_.val();
33 33
34 if (val < 0) 34 if (val < 0)
35 $('#old_year').val(0); 35 $('#old_year').val(0);
36 }); 36 });
37 </script> 37 </script>
38 @endsection 38 @endsection
39 39
40 @section('content') 40 @section('content')
41 @php 41 @php
42 $user = $worker->users 42 $user = $worker->users
43 @endphp 43 @endphp
44 <section class="cabinet"> 44 <section class="cabinet">
45 <div class="container"> 45 <div class="container">
46 <ul class="breadcrumbs cabinet__breadcrumbs"> 46 <ul class="breadcrumbs cabinet__breadcrumbs">
47 <li><a href="{{ route('index') }}">Главная</a></li> 47 <li><a href="{{ route('index') }}">Главная</a></li>
48 <li><b>Личный кабинет</b></li> 48 <li><b>Личный кабинет</b></li>
49 </ul> 49 </ul>
50 <div class="cabinet__wrapper"> 50 <div class="cabinet__wrapper">
51 <div class="cabinet__side"> 51 <div class="cabinet__side">
52 <div class="cabinet__side-toper"> 52 <div class="cabinet__side-toper">
53 @include('workers.emblema') 53 @include('workers.emblema')
54 54
55 </div> 55 </div>
56 56
57 @include('workers.menu', ['item' => 1]) 57 @include('workers.menu', ['item' => 1])
58 </div> 58 </div>
59 <div class="cabinet__body"> 59 <div class="cabinet__body">
60 <div class="cabinet__body-item"> 60 <div class="cabinet__body-item">
61 <div class="cabinet__anketa"> 61 <div class="cabinet__anketa">
62 <h2 class="title cabinet__title">Моя анкета</h2> 62 <h2 class="title cabinet__title">Моя анкета</h2>
63 <div class="cabinet__anketa-buttons"> 63 <div class="cabinet__anketa-buttons">
64 <a href="{{ route('worker.up', ['worker' => $worker->id]) }}" class="button">Поднять резюме</a> 64 <a href="{{ route('worker.up', ['worker' => $worker->id]) }}" class="button">Поднять резюме</a>
65 <a href="{{ route('resume_download', ['worker' => $worker->id]) }}" target="_blank" class="button"> 65 <a href="{{ route('resume_download', ['worker' => $worker->id]) }}" target="_blank" class="button">
66 <svg> 66 <svg>
67 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> 67 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
68 </svg> 68 </svg>
69 Скачать резюме 69 Скачать резюме
70 </a> 70 </a>
71 </div> 71 </div>
72 </div> 72 </div>
73 </div> 73 </div>
74 74
75 <div class="cabinet__body-item"> 75 <div class="cabinet__body-item">
76 <div class="cabinet__stats"> 76 <div class="cabinet__stats">
77 <h3 class="cabinet__subtitle cabinet__stats-title">Статистика</h3> 77 <h3 class="cabinet__subtitle cabinet__stats-title">Статистика</h3>
78 <div class="cabinet__stats-body"> 78 <div class="cabinet__stats-body">
79 <div class="cabinet__stats-item"> 79 <div class="cabinet__stats-item">
80 <svg> 80 <svg>
81 <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use> 81 <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use>
82 </svg> 82 </svg>
83 <span>Просмотров:</span> 83 <span>Просмотров:</span>
84 <b>@if (isset($stat[0]->lookin)) {{ $stat[0]->lookin }} @else 0 @endif</b> 84 <b>@if (isset($stat[0]->lookin)) {{ $stat[0]->lookin }} @else 0 @endif</b>
85 </div> 85 </div>
86 <div class="cabinet__stats-item"> 86 <div class="cabinet__stats-item">
87 <svg> 87 <svg>
88 <use xlink:href="{{ asset('images/sprite.svg#warning') }}"></use> 88 <use xlink:href="{{ asset('images/sprite.svg#warning') }}"></use>
89 </svg> 89 </svg>
90 <span>Отзывов:</span> 90 <span>Отзывов:</span>
91 <b>@if(isset($worker->response)) {{ $worker->response->count() }} @else 0 @endif</b> 91 <b>@if(isset($worker->response)) {{ $worker->response->count() }} @else 0 @endif</b>
92 </div> 92 </div>
93 </div> 93 </div>
94 <div class="cabinet__stats-subtitle">Анкета заполнена на {{ $persent }}%</div> 94 <div class="cabinet__stats-subtitle">Анкета заполнена на {{ $persent }}%</div>
95 <div class="cabinet__stats-line"> 95 <div class="cabinet__stats-line">
96 <span style="width:{{ $persent }}%"></span> 96 <span style="width:{{ $persent }}%"></span>
97 </div> 97 </div>
98 <div class="cabinet__stats-bottom">Заполните профиль, чтобы повысить процент анкеты на 80%</div> 98 <div class="cabinet__stats-bottom">Заполните профиль, чтобы повысить процент анкеты на 80%</div>
99 </div> 99 </div>
100 </div> 100 </div>
101 101
102 <form class="" action="{{ route('worker.cabinet_save_foto', ['worker' => $worker->id]) }}" enctype="multipart/form-data" method="POST"> 102 <form class="" action="{{ route('worker.cabinet_save_foto', ['worker' => $worker->id]) }}" enctype="multipart/form-data" method="POST">
103 @csrf 103 @csrf
104 @include('messages_error') 104 @include('messages_error')
105 105
106 <div class="cabinet__body-item"> 106 <div class="cabinet__body-item">
107 <h3 class="cabinet__subtitle">Профиль</h3> 107 <h3 class="cabinet__subtitle">Профиль</h3>
108 <div class="cabinet__avatar"> 108 <div class="cabinet__avatar">
109 <div class="cabinet__avatar-pic"> 109 <div class="cabinet__avatar-pic">
110 110
111 @if (!empty($worker->photo)) 111 @if (!empty($worker->photo))
112 <img src="{{ asset(Storage::url($worker->photo)) }}"/> 112 <img src="{{ asset(Storage::url($worker->photo)) }}"/>
113 @else 113 @else
114 <svg> 114 <svg>
115 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 115 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
116 </svg> 116 </svg>
117 @endif 117 @endif
118 </div> 118 </div>
119 <div class="cabinet__avatar-form"> 119 <div class="cabinet__avatar-form">
120 <label class="file"> 120 <label class="file">
121 <span class="file__input"> 121 <span class="file__input">
122 <input type="file" name="photo" id="photo"> 122 <input type="file" name="photo" id="photo">
123 123
124 <span class="button"> 124 <span class="button">
125 <svg> 125 <svg>
126 <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use> 126 <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use>
127 </svg> 127 </svg>
128 Загрузить 128 Загрузить
129 </span> 129 </span>
130 </span> 130 </span>
131 </label> 131 </label>
132 <p class="cabinet__text">Загрузите фотографию в формате svg., jpg., jpeg., png.</p> 132 <p class="cabinet__text">Загрузите фотографию в формате svg., jpg., jpeg., png.</p>
133 </div> 133 </div>
134 </div> 134 </div>
135 </div> 135 </div>
136 </form> 136 </form>
137 137
138 <div class="cabinet__body-item mb-40"> 138 <div class="cabinet__body-item mb-40">
139 <h3 class="cabinet__subtitle font30">Основная информация</h3> 139 <h3 class="cabinet__subtitle font30">Основная информация</h3>
140 140
141 <div class="cabinet__inputs"> 141 <div class="cabinet__inputs">
142 <div class="cabinet__inputs_to_columns_wrap"> 142 <div class="cabinet__inputs_to_columns_wrap">
143 <div class="cabinet__inputs_to_column cabinet__inputs_to_columns_left"> 143 <div class="cabinet__inputs_to_column cabinet__inputs_to_columns_left">
144 <div class="cabinet__inputs-item form-group"> 144 <div class="cabinet__inputs-item form-group">
145 <label class="form-group__label">Фамилия:</label> 145 <label class="form-group__label">Фамилия:</label>
146 <div class="form-group__item"> 146 <div class="form-group__item">
147 {{ $user->surname }} 147 {{ $user->surname }}
148 </div> 148 </div>
149 </div> 149 </div>
150 <div class="cabinet__inputs-item form-group"> 150 <div class="cabinet__inputs-item form-group">
151 <label class="form-group__label">Имя:</label> 151 <label class="form-group__label">Имя:</label>
152 <div class="form-group__item"> 152 <div class="form-group__item">
153 {{ $user->name_man }} 153 {{ $user->name_man }}
154 </div> 154 </div>
155 </div> 155 </div>
156 <div class="cabinet__inputs-item form-group"> 156 <div class="cabinet__inputs-item form-group">
157 <label class="form-group__label">Отчество:</label> 157 <label class="form-group__label">Отчество:</label>
158 <div class="form-group__item"> 158 <div class="form-group__item">
159 {{ $user->surname2 }} 159 {{ $user->surname2 }}
160 </div> 160 </div>
161 </div> 161 </div>
162 <div class="cabinet__inputs-item form-group"> 162 <div class="cabinet__inputs-item form-group">
163 <label class="form-group__label">Возраст:</label> 163 <label class="form-group__label">Возраст:</label>
164 <div class="form-group__item"> 164 <div class="form-group__item">
165 {{ $worker->old_year ?? '-' }} 165 {{ $worker->old_year ?? '-' }}
166 </div> 166 </div>
167 </div> 167 </div>
168 <div class="cabinet__inputs-item form-group"> 168 <div class="cabinet__inputs-item form-group">
169 <label class="form-group__label">Статус:</label> 169 <label class="form-group__label">Статус:</label>
170 <div class="form-group__item"> 170 <div class="form-group__item">
171 {{ $status_work[$worker->status_work] ?? '-' }} 171 {{ $status_work[$worker->status_work] ?? '-' }}
172 </div> 172 </div>
173 </div> 173 </div>
174 <div class="cabinet__inputs-item form-group"> 174 <div class="cabinet__inputs-item form-group">
175 <label class="form-group__label">Желаемые вакансии:</label> 175 <label class="form-group__label">Желаемые вакансии:</label>
176 <div class="form-group__item"> 176 <div class="form-group__item">
177 @if ($worker->job_titles->count()) 177 @if ($worker->job_titles->count())
178 @foreach($worker->job_titles as $job_title) 178 @foreach($worker->job_titles as $job_title)
179 {{ $job_title->name }} 179 {{ $job_title->name }}
180 @if (!$loop->last) / @endif 180 @if (!$loop->last) / @endif
181 @endforeach 181 @endforeach
182 @endif 182 @endif
183 </div> 183 </div>
184 </div> 184 </div>
185 <div class="cabinet__inputs-item form-group"> 185 <div class="cabinet__inputs-item form-group">
186 <label class="form-group__label">Пожелания к З/П:</label> 186 <label class="form-group__label">Пожелания к З/П:</label>
187 <div class="form-group__item"> 187 <div class="form-group__item">
188 {{ $worker->salary_expectations ?? '-' }} 188 {{ $worker->salary_expectations ?? '-' }}
189 </div> 189 </div>
190 </div> 190 </div>
191 <div class="cabinet__inputs-item form-group"> 191 <div class="cabinet__inputs-item form-group">
192 <label class="form-group__label">Уровень английского:</label> 192 <label class="form-group__label">Уровень английского:</label>
193 <div class="form-group__item"> 193 <div class="form-group__item">
194 {{ $worker->english_level ?? '-' }} 194 {{ $worker->english_level ?? '-' }}
195 </div> 195 </div>
196 </div> 196 </div>
197 <div class="cabinet__inputs-item form-group"> 197 <div class="cabinet__inputs-item form-group">
198 <label class="form-group__label">Дата готовности к посадке:</label> 198 <label class="form-group__label">Дата готовности к посадке:</label>
199 <div class="form-group__item"> 199 <div class="form-group__item">
200 {{ $worker->ready_boart_date ?? '-' }} 200 {{ $worker->ready_boart_date ?? '-' }}
201 </div> 201 </div>
202 </div> 202 </div>
203 <div class="cabinet__inputs-item form-group"> 203 <div class="cabinet__inputs-item form-group">
204 <label class="form-group__label">Предпочтение по типу судна:</label> 204 <label class="form-group__label">Предпочтение по типу судна:</label>
205 <div class="form-group__item"> 205 <div class="form-group__item">
206 {{ $worker->boart_type_preference ?? '-' }} 206 {{ $worker->boart_type_preference ?? '-' }}
207 </div> 207 </div>
208 </div> 208 </div>
209 </div> 209 </div>
210 210
211 <div class="cabinet__inputs_to_column cabinet__inputs_to_columns_right"> 211 <div class="cabinet__inputs_to_column cabinet__inputs_to_columns_right">
212 <div class="cabinet__inputs-item form-group"> 212 <div class="cabinet__inputs-item form-group">
213 <label class="form-group__label">Наличие визы:</label> 213 <label class="form-group__label">Наличие визы:</label>
214 <div class="form-group__item"> 214 <div class="form-group__item">
215 {{ $worker->visa_available }} 215 {{ $worker->visa_available }}
216 </div> 216 </div>
217 </div> 217 </div>
218 218
219 219
220 <div class="cabinet__inputs-item form-group"> 220 <div class="cabinet__inputs-item form-group">
221 <label class="form-group__label">Наличие танкерных документов:</label> 221 <label class="form-group__label">Наличие танкерных документов:</label>
222 <div class="form-group__item"> 222 <div class="form-group__item">
223 {{ $worker->tanker_documents_available ?? '-' }} 223 {{ $worker->tanker_documents_available ?? '-' }}
224 </div> 224 </div>
225 </div> 225 </div>
226 226
227 227
228 <div class="cabinet__inputs-item form-group"> 228 <div class="cabinet__inputs-item form-group">
229 <label class="form-group__label">Наличие подтверждения для работы на ВВП:</label> 229 <label class="form-group__label">Наличие подтверждения для работы на ВВП:</label>
230 <div class="form-group__item"> 230 <div class="form-group__item">
231 {{ $worker->confirmation_work_for_vvp ?? '-' }} 231 {{ $worker->confirmation_work_for_vvp ?? '-' }}
232 </div> 232 </div>
233 </div> 233 </div>
234 234
235 235
236 <div class="cabinet__inputs-item form-group"> 236 <div class="cabinet__inputs-item form-group">
237 <label class="form-group__label">Наличие военного билета / приписного свидетельства:</label> 237 <label class="form-group__label">Наличие военного билета / приписного свидетельства:</label>
238 <div class="form-group__item"> 238 <div class="form-group__item">
239 {{ $worker->military_id_available ?? '-' }} 239 {{ $worker->military_id_available ?? '-' }}
240 </div> 240 </div>
241 </div> 241 </div>
242 242
243 243
244 <div class="cabinet__inputs-item form-group"> 244 <div class="cabinet__inputs-item form-group">
245 <label class="form-group__label">Город проживания:</label> 245 <label class="form-group__label">Город проживания:</label>
246 <div class="form-group__item"> 246 <div class="form-group__item">
247 {{ $worker->city ?? '-' }} 247 {{ $worker->city ?? '-' }}
248 </div> 248 </div>
249 </div> 249 </div>
250 250
251 251
252 <div class="cabinet__inputs-item form-group"> 252 <div class="cabinet__inputs-item form-group">
253 <label class="form-group__label">Телефон:</label> 253 <label class="form-group__label">Телефон:</label>
254 <div class="form-group__item"> 254 <div class="form-group__item">
255 {{ $worker->telephone ?? '-' }} 255 {{ $worker->telephone ?? '-' }}
256 </div> 256 </div>
257 </div> 257 </div>
258 258
259 259
260 <div class="cabinet__inputs-item form-group"> 260 <div class="cabinet__inputs-item form-group">
261 <label class="form-group__label">E-mail:</label> 261 <label class="form-group__label">E-mail:</label>
262 <div class="form-group__item"> 262 <div class="form-group__item">
263 {{ $worker->email ?? '-' }} 263 {{ $worker->email ?? '-' }}
264 </div> 264 </div>
265 </div> 265 </div>
266 266
267 267
268 <div class="cabinet__inputs-item form-group"> 268 <div class="cabinet__inputs-item form-group">
269 <label class="form-group__label">Контакты родственников:</label> 269 <label class="form-group__label">Контакты родственников:</label>
270 <div class="form-group__item"> 270 <div class="form-group__item">
271 {{ $worker->telephon2 ?? '-' }} 271 {{ $worker->telephone2 ?? '-' }}
272 </div> 272 </div>
273 </div> 273 </div>
274
275
276
277 <div class="width100">
278 <h4 class="cabinet__h4 mb-10">О себе</h4>
279 <div>{{ $worker->text }}</div>
280 </div>
281 </div> 274 </div>
282 </div> 275 </div>
283 276
284 277 <div class="width100">
285 278 <h4 class="cabinet__h4 mb-10">О себе</h4>
279 <div>{{ $worker->text }}</div>
280 </div>
286 281
287 <div class=""> 282 <div class="">
288 <a href="{{ route('worker.basic_information') }}" class="button active">Редактировать основную информацию</a> 283 <a href="{{ route('worker.basic_information') }}" class="button active">Редактировать основную информацию</a>
289 </div> 284 </div>
290 </div> 285 </div>
291 </div> 286 </div>
292 287
293 <div class="mb-40" id="sertificate" name="sertificate"> 288 <div class="mb-40" id="sertificate" name="sertificate">
294 <h3 class="cabinet__subtitle font30 mb-20">Сертификаты / документы</h3> 289 <h3 class="cabinet__subtitle font30 mb-20">Сертификаты / документы</h3>
295 290
296 @if($worker->sertificate->count()) 291 @if($worker->sertificate->count())
297 @foreach($worker->sertificate as $sertificate) 292 @foreach($worker->sertificate as $sertificate)
298 <div class="one-sertificate"> 293 <div class="one-sertificate">
299 <div class="sertificate-field sertificate-name"> 294 <div class="sertificate-field sertificate-name">
300 <label class="bold">Название сертификата:</label> 295 <label class="bold">Название сертификата:</label>
301 <div>{{ $sertificate->name }}</div> 296 <div>{{ $sertificate->name }}</div>
302 </div> 297 </div>
303 <div class="sertificate-field"> 298 <div class="sertificate-field">
304 <label class="bold">Действителен до:</label> 299 <label class="bold">Действителен до:</label>
305 <div>{{ date('d.m.Y', strtotime($sertificate->end_begin)) }}</div> 300 <div>{{ date('d.m.Y', strtotime($sertificate->end_begin)) }}</div>
306 </div> 301 </div>
307 <div class="sertificate-field sertificate-buttons"> 302 <div class="sertificate-field sertificate-buttons">
308 <a href="{{ route('worker.edit_sertificate', ['worker' => $worker->id, 'doc' => $sertificate->id ]) }}" class="button button_light mr-10"> 303 <a href="{{ route('worker.edit_sertificate', ['worker' => $worker->id, 'doc' => $sertificate->id ]) }}" class="button button_light mr-10">
309 <svg><use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use></svg> 304 <svg><use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use></svg>
310 </a> 305 </a>
311 <a href="{{ route('worker.delete_sertificate', ['doc' => $sertificate->id]) }}" class="button button_light"> 306 <a href="{{ route('worker.delete_sertificate', ['doc' => $sertificate->id]) }}" class="button button_light">
312 <svg><use xlink:href="{{ asset('images/sprite.svg#del') }}"></use></svg> 307 <svg><use xlink:href="{{ asset('images/sprite.svg#del') }}"></use></svg>
313 </a> 308 </a>
314 </div> 309 </div>
315 </div> 310 </div>
316 @endforeach 311 @endforeach
317 @endif 312 @endif
318 313
319 <a class="button fit-content" href="{{ route('worker.new_sertificate',['worker' => $worker->id]) }}" id="button_new_doc" name="button_new_doc"> 314 <a class="button fit-content" href="{{ route('worker.new_sertificate',['worker' => $worker->id]) }}" id="button_new_doc" name="button_new_doc">
320 Добавить сертификат / документ 315 Добавить сертификат / документ
321 </a> 316 </a>
322 </div> 317 </div>
323 318
324 <div class="cabinet__body-item mb-40" name="ajax_dop_diplomi" id="ajax_dop_diplomi"> 319 <div class="cabinet__body-item mb-40" name="ajax_dop_diplomi" id="ajax_dop_diplomi">
325 <h3 class="cabinet__subtitle font30">Дополнительные документы</h3> 320 <h3 class="cabinet__subtitle font30">Дополнительные документы</h3>
326 321
327 <div class="cabinet__inputs" id="block_sertificate"> 322 <div class="cabinet__inputs" id="block_sertificate">
328 @if ($info_blocks->count()) 323 @if ($info_blocks->count())
329 @foreach ($info_blocks as $info_block) 324 @foreach ($info_blocks as $info_block)
330 <div class="cabinet__inputs-item column-count-3 form-group"> 325 <div class="cabinet__inputs-item column-count-3 form-group">
331 <label class="form-group__label">{{ $info_block->name }}:</label> 326 <label class="form-group__label">{{ $info_block->name }}:</label>
332 327
333 <div class="form-group__item"> 328 <div class="form-group__item">
334 @php $status = 0; @endphp 329 @php $status = 0; @endphp
335 @if (!empty($worker->dop_info[$info_block->id]) && $worker->dop_info[$info_block->id]['status']) 330 @if (!empty($worker->dop_info[$info_block->id]) && $worker->dop_info[$info_block->id]['status'])
336 @php $status = $worker->dop_info[$info_block->id]['status']; @endphp 331 @php $status = $worker->dop_info[$info_block->id]['status']; @endphp
337 @endif 332 @endif
338 {{ $additional_document_statuses[$status] }} 333 {{ $additional_document_statuses[$status] }}
339 </div> 334 </div>
340 </div> 335 </div>
341 @endforeach 336 @endforeach
342 @endif 337 @endif
343 </div> 338 </div>
344 339
345 <a class="button fit-content" href="{{ route('worker.additional_documents') }}"> 340 <a class="button fit-content" href="{{ route('worker.additional_documents') }}">
346 Редактировать дополнительные документы 341 Редактировать дополнительные документы
347 </a> 342 </a>
348 </div> 343 </div>
349 344
350 <div class="cabinet__body-item mb-20"> 345 <div class="cabinet__body-item mb-20">
351 <div> 346 <div>
352 <h3 class="cabinet__subtitle font30">Опыт работы</h3> 347 <h3 class="cabinet__subtitle font30">Опыт работы</h3>
353 <div class="">Начните заполнение анкеты с указания последнего места работы</div> 348 <div class="">Начните заполнение анкеты с указания последнего места работы</div>
354 </div> 349 </div>
355 350
356 <div class="cabinet__works"> 351 <div class="cabinet__works">
357 @if (isset($worker->place_worker)) 352 @if (isset($worker->place_worker))
358 @foreach($worker->place_worker as $company) 353 @foreach($worker->place_worker as $company)
359 <div class="cabinet__works-item"> 354 <div class="cabinet__works-item">
360 <div class="cabinet__works-spoiler active"> 355 <div class="cabinet__works-spoiler active">
361 <div class="cabinet__works-spoiler-left"> 356 <div class="cabinet__works-spoiler-left">
362 <div class="cabinet__works-spoiler-text">Место работы {{ $loop->iteration }}</div> 357 <div class="cabinet__works-spoiler-text">Место работы {{ $loop->iteration }}</div>
363 </div> 358 </div>
364 <div class="cabinet__works-spoiler-buttons"> 359 <div class="cabinet__works-spoiler-buttons">
365 <a href="{{ route('worker.edit_document', ['doc' => $company->id, 'worker' => $worker->id]) }}" type="button" class="button button_light mr-10 js-works-edit"> 360 <a href="{{ route('worker.edit_document', ['doc' => $company->id, 'worker' => $worker->id]) }}" type="button" class="button button_light mr-10 js-works-edit">
366 <svg> 361 <svg>
367 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> 362 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use>
368 </svg> 363 </svg>
369 </a> 364 </a>
370 <a href="{{ route('worker.delete_document', ['doc' => $company->id]) }}" class="button button_light js-works-remove"> 365 <a href="{{ route('worker.delete_document', ['doc' => $company->id]) }}" class="button button_light js-works-remove">
371 <svg> 366 <svg>
372 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> 367 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use>
373 </svg> 368 </svg>
374 </a> 369 </a>
375 </div> 370 </div>
376 </div> 371 </div>
377 372
378 <div class="cabinet__works-body"> 373 <div class="cabinet__works-body">
379 <div class="cabinet__inputs"> 374 <div class="cabinet__inputs">
380 <div class="cabinet__inputs-item column-count-3 form-group"> 375 <div class="cabinet__inputs-item column-count-3 form-group">
381 <label class="form-group__label">Должность:</label> 376 <label class="form-group__label">Должность:</label>
382 <div class="form-group__item"> 377 <div class="form-group__item">
383 {{ $company->job_title ?? '-' }} 378 {{ $company->job_title ?? '-' }}
384 </div> 379 </div>
385 </div> 380 </div>
386 381
387 <div class="cabinet__inputs-item column-count-3 form-group"> 382 <div class="cabinet__inputs-item column-count-3 form-group">
388 <label class="form-group__label">Название т/х:</label> 383 <label class="form-group__label">Название т/х:</label>
389 <div class="form-group__item"> 384 <div class="form-group__item">
390 {{ $company->teplohod ?? '-' }} 385 {{ $company->teplohod ?? '-' }}
391 </div> 386 </div>
392 </div> 387 </div>
393 <div class="cabinet__inputs-item column-count-3 form-group"> 388 <div class="cabinet__inputs-item column-count-3 form-group">
394 <label class="form-group__label">Тип суда:</label> 389 <label class="form-group__label">Тип суда:</label>
395 <div class="form-group__item"> 390 <div class="form-group__item">
396 {{ $company->GWT ?? '-' }} 391 {{ $company->GWT ?? '-' }}
397 </div> 392 </div>
398 </div> 393 </div>
399 <div class="cabinet__inputs-item column-count-3 form-group"> 394 <div class="cabinet__inputs-item column-count-3 form-group">
400 <label class="form-group__label">Марка ГД:</label> 395 <label class="form-group__label">Марка ГД:</label>
401 <div class="form-group__item"> 396 <div class="form-group__item">
402 {{ $company->Marka_GD ?? '-' }} 397 {{ $company->Marka_GD ?? '-' }}
403 </div> 398 </div>
404 </div> 399 </div>
405 <div class="cabinet__inputs-item column-count-3 form-group"> 400 <div class="cabinet__inputs-item column-count-3 form-group">
406 <label class="form-group__label">Мощность ГД (кВТ):</label> 401 <label class="form-group__label">Мощность ГД (кВТ):</label>
407 <div class="form-group__item"> 402 <div class="form-group__item">
408 {{ $company->KBT ?? '-' }} 403 {{ $company->KBT ?? '-' }}
409 </div> 404 </div>
410 </div> 405 </div>
411 <div class="cabinet__inputs-item column-count-3 form-group"> 406 <div class="cabinet__inputs-item column-count-3 form-group">
412 <label class="form-group__label">Водоизмещение (DWT):</label> 407 <label class="form-group__label">Водоизмещение (DWT):</label>
413 <div class="form-group__item"> 408 <div class="form-group__item">
414 {{ $company->GRT ?? '-' }} 409 {{ $company->GRT ?? '-' }}
415 </div> 410 </div>
416 </div> 411 </div>
417 <div class="cabinet__inputs-item column-count-3 form-group"> 412 <div class="cabinet__inputs-item column-count-3 form-group">
418 <label class="form-group__label">Название компании:</label> 413 <label class="form-group__label">Название компании:</label>
419 <div class="form-group__item"> 414 <div class="form-group__item">
420 {{ $company->name_company ?? '-' }} 415 {{ $company->name_company ?? '-' }}
421 </div> 416 </div>
422 </div> 417 </div>
423 <div class="cabinet__inputs-item column-count-3 form-group"> 418 <div class="cabinet__inputs-item column-count-3 form-group">
424 <label class="form-group__label">Начало контракта:</label> 419 <label class="form-group__label">Начало контракта:</label>
425 <div class="form-group__item"> 420 <div class="form-group__item">
426 {{ $company->begin_work ?? '-' }} 421 {{ $company->begin_work ?? '-' }}
427 </div> 422 </div>
428 </div> 423 </div>
429 <div class="cabinet__inputs-item column-count-3 form-group"> 424 <div class="cabinet__inputs-item column-count-3 form-group">
430 <label class="form-group__label">Окончание контракта:</label> 425 <label class="form-group__label">Окончание контракта:</label>
431 <div class="form-group__item"> 426 <div class="form-group__item">
432 {{ $company->end_work ?? '-' }} 427 {{ $company->end_work ?? '-' }}
433 </div> 428 </div>
434 </div> 429 </div>
435 430
436 </div> 431 </div>
437 </div> 432 </div>
438 </div> 433 </div>
439 @endforeach 434 @endforeach
440 @endif 435 @endif
441 </div> 436 </div>
442 437
443 <a href="{{ route('worker.add_document', ['worker' => $worker->id]) }}" id="new_work" name="new_work" class="button fit-content"> 438 <a href="{{ route('worker.add_document', ['worker' => $worker->id]) }}" id="new_work" name="new_work" class="button fit-content">
444 Добавить место работы 439 Добавить место работы
445 </a> 440 </a>
446 </div> 441 </div>
447 442
448 <div id="prev_worker" name="prev_worker"> 443 <div id="prev_worker" name="prev_worker">
449 <div> 444 <div>
450 <h3 class="cabinet__subtitle font30">Рекомендации</h3> 445 <h3 class="cabinet__subtitle font30">Рекомендации</h3>
451 <div class="">Укажите контакты компаний, которые могут дать рекомендации</div> 446 <div class="">Укажите контакты компаний, которые могут дать рекомендации</div>
452 </div> 447 </div>
453 448
454 @if ((isset($worker->prev_company)) && ($worker->prev_company->count() > 0)) 449 @if ((isset($worker->prev_company)) && ($worker->prev_company->count() > 0))
455 @foreach($worker->prev_company as $it) 450 @foreach($worker->prev_company as $it)
456 <div class="cabinet__body-item"> 451 <div class="cabinet__body-item">
457 <div class="cabinet__inputs mt-30"> 452 <div class="cabinet__inputs mt-30">
458 <div class="cabinet__inputs-item column-count-3 form-group"> 453 <div class="cabinet__inputs-item column-count-3 form-group">
459 <label class="form-group__label">Название компании:</label> 454 <label class="form-group__label">Название компании:</label>
460 <div class="form-group__item"> 455 <div class="form-group__item">
461 {{ $it->name_company }} 456 {{ $it->name_company }}
462 </div> 457 </div>
463 </div> 458 </div>
464 <div class="cabinet__inputs-item column-count-3 form-group"> 459 <div class="cabinet__inputs-item column-count-3 form-group">
465 <label class="form-group__label">ФИО сотрудника:</label> 460 <label class="form-group__label">ФИО сотрудника:</label>
466 <div class="form-group__item"> 461 <div class="form-group__item">
467 {{ $it->direct }} 462 {{ $it->direct }}
468 </div> 463 </div>
469 </div> 464 </div>
470 <div class="cabinet__inputs-item column-count-3 form-group cabinet__inputs-item-buttons"> 465 <div class="cabinet__inputs-item column-count-3 form-group cabinet__inputs-item-buttons">
471 <div class="flex"> 466 <div class="flex">
472 <a href="{{ route('worker.edit_prev_company', ['worker' => $worker->id, 'doc' => $it->id ]) }}" class="button button_light mr-10"> 467 <a href="{{ route('worker.edit_prev_company', ['worker' => $worker->id, 'doc' => $it->id ]) }}" class="button button_light mr-10">
473 <svg> 468 <svg>
474 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> 469 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use>
475 </svg> 470 </svg>
476 </a> 471 </a>
477 <a href="{{ route('worker.delete_prev_company', ['doc' => $it->id]) }}" class="button button_light"> 472 <a href="{{ route('worker.delete_prev_company', ['doc' => $it->id]) }}" class="button button_light">
478 <svg> 473 <svg>
479 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> 474 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use>
480 </svg> 475 </svg>
481 </a> 476 </a>
482 </div> 477 </div>
483 </div> 478 </div>
484 <div class="cabinet__inputs-item column-count-3 form-group"> 479 <div class="cabinet__inputs-item column-count-3 form-group">
485 <label class="form-group__label">Должность сотрудника:</label> 480 <label class="form-group__label">Должность сотрудника:</label>
486 <div class="form-group__item"> 481 <div class="form-group__item">
487 {{ $it->telephone }} 482 {{ $it->telephone }}
488 </div> 483 </div>
489 </div> 484 </div>
490 <div class="cabinet__inputs-item column-count-3 form-group"> 485 <div class="cabinet__inputs-item column-count-3 form-group">
491 <label class="form-group__label">Телефон сотрудника:</label> 486 <label class="form-group__label">Телефон сотрудника:</label>
492 <div class="form-group__item"> 487 <div class="form-group__item">
493 {{ $it->telephone2 }} 488 {{ $it->telephone2 }}
494 </div> 489 </div>
495 </div> 490 </div>
496 <div class="cabinet__inputs-item column-count-3 form-group cabinet__inputs-item-buttons"></div> 491 <div class="cabinet__inputs-item column-count-3 form-group cabinet__inputs-item-buttons"></div>
497 </div> 492 </div>
498 </div> 493 </div>
499 @endforeach 494 @endforeach
500 @endif 495 @endif
501 </div> 496 </div>
502 497
503 <div class="cabinet__body-item"> 498 <div class="cabinet__body-item">
504 <a class="button fit-content" href="{{ route('worker.new_prev_company',['worker' => $worker->id]) }}"> 499 <a class="button fit-content" href="{{ route('worker.new_prev_company',['worker' => $worker->id]) }}">
505 Добавить контакт для рекомендации 500 Добавить контакт для рекомендации
506 </a> 501 </a>
507 </div> 502 </div>
508 </div> 503 </div>
509 </div> 504 </div>
510 </div> 505 </div>
511 </section> 506 </section>