Commit d0ed7b0171ffcbe5e2052865e634910fc9561cd8

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

uncommited files

Showing 6 changed files 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 247
248 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 248 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
249 where('is_remove', '=', '0')-> 249 where('is_remove', '=', '0')->
250 where('is_bd', '=', '0')->get(); 250 where('is_bd', '=', '0')->get();
251 251
252 $Employer = Employer::query()->with('users')->with('ads')-> 252 $Employer = Employer::query()->with('users')->with('ads')->
253 with('flots')->where('user_id', $id)->first(); 253 with('flots')->where('user_id', $id)->first();
254 254
255 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); 255 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs'));
256 } 256 }
257 257
258 // Сохранение-редактирование записи 258 // Сохранение-редактирование записи
259 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { 259 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) {
260 $params = $request->all(); 260 $params = $request->all();
261 $params_job["job_title_id"] = $params['job_title_id']; 261 $params_job["job_title_id"] = $params['job_title_id'];
262 262
263 $ad_employer->update($params); 263 $ad_employer->update($params);
264 $ad_employer->jobs()->sync($request->get('job_title_id')); 264 $ad_employer->jobs()->sync($request->get('job_title_id'));
265 265
266 $id = Auth()->user()->id; 266 $id = Auth()->user()->id;
267 $Positions = Category::query()->where('is_remove', '=', '0')->get(); 267 $Positions = Category::query()->where('is_remove', '=', '0')->get();
268 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name') 268 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')
269 ->where('is_remove', '=', '0') 269 ->where('is_remove', '=', '0')
270 ->where('is_bd', '=', '0') 270 ->where('is_bd', '=', '0')
271 ->get(); 271 ->get();
272 272
273 $Employer = Employer::query() 273 $Employer = Employer::query()
274 ->with('users')->with('ads')->with('flots')->where('user_id', $id)->first(); 274 ->with('users')->with('ads')->with('flots')->where('user_id', $id)->first();
275 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); 275 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs'));
276 } 276 }
277 277
278 // Сохранение карточки вакансии 278 // Сохранение карточки вакансии
279 public function vacancy_save(Request $request, Ad_employer $ad_employer) { 279 public function vacancy_save(Request $request, Ad_employer $ad_employer) {
280 $all = $request->all(); 280 $all = $request->all();
281 $ad_employer->update($all); 281 $ad_employer->update($all);
282 return redirect()->route('employer.cabinet_vacancie'); 282 return redirect()->route('employer.cabinet_vacancie');
283 } 283 }
284 284
285 // Удаление карточки вакансии 285 // Удаление карточки вакансии
286 public function vacancy_delete(Ad_employer $ad_employer) { 286 public function vacancy_delete(Ad_employer $ad_employer) {
287 $ad_employer->delete(); 287 $ad_employer->delete();
288 288
289 return redirect()->route('employer.vacancy_list') 289 return redirect()->route('employer.vacancy_list')
290 ->with('success', 'Данные были успешно сохранены'); 290 ->with('success', 'Данные были успешно сохранены');
291 } 291 }
292 292
293 // Обновление даты 293 // Обновление даты
294 public function vacancy_up(Ad_employer $ad_employer) { 294 public function vacancy_up(Ad_employer $ad_employer) {
295 $up = date('m/d/Y h:i:s', time());; 295 $up = date('m/d/Y h:i:s', time());;
296 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 296 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
297 $vac_emp->updated_at = $up; 297 $vac_emp->updated_at = $up;
298 $vac_emp->save(); 298 $vac_emp->save();
299 299
300 return redirect()->back(); //route('employer.vacancy_list'); 300 return redirect()->back(); //route('employer.vacancy_list');
301 // начало конца 301 // начало конца
302 } 302 }
303 303
304 //Видимость вакансии 304 //Видимость вакансии
305 public function vacancy_eye(Ad_employer $ad_employer, $status) { 305 public function vacancy_eye(Ad_employer $ad_employer, $status) {
306 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 306 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
307 $vac_emp->active_is = $status; 307 $vac_emp->active_is = $status;
308 $vac_emp->save(); 308 $vac_emp->save();
309 309
310 return redirect()->route('employer.vacancy_list'); 310 return redirect()->route('employer.vacancy_list');
311 } 311 }
312 312
313 //Вакансия редактирования (шаблон) 313 //Вакансия редактирования (шаблон)
314 public function vacancy_update(Ad_employer $id) { 314 public function vacancy_update(Ad_employer $id) {
315 315
316 } 316 }
317 317
318 //Отклики на вакансию - лист 318 //Отклики на вакансию - лист
319 public function answers(Employer $employer, Request $request) { 319 public function answers(Employer $employer, Request $request) {
320 $user_id = Auth()->user()->id; 320 $user_id = Auth()->user()->id;
321 $answer = Ad_employer::query()->where('employer_id', $employer->id); 321 $answer = Ad_employer::query()->where('employer_id', $employer->id);
322 if ($request->has('search')) { 322 if ($request->has('search')) {
323 $search = trim($request->get('search')); 323 $search = trim($request->get('search'));
324 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); 324 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%");
325 } 325 }
326 326
327 $answer = $answer->with('response')->OrderByDESC('id')->get(); 327 $answer = $answer->with('response')->OrderByDESC('id')->get();
328 328
329 return view('employers.list_answer', compact('answer', 'user_id', 'employer')); 329 return view('employers.list_answer', compact('answer', 'user_id', 'employer'));
330 } 330 }
331 331
332 //Обновление статуса 332 //Обновление статуса
333 public function supple_status(employer $employer, ad_response $ad_response, $flag) { 333 public function supple_status(employer $employer, ad_response $ad_response, $flag) {
334 $ad_response->update(Array('flag' => $flag)); 334 $ad_response->update(Array('flag' => $flag));
335 return redirect()->route('employer.answers', ['employer' => $employer->id]); 335 return redirect()->route('employer.answers', ['employer' => $employer->id]);
336 } 336 }
337 337
338 //Страницы сообщений список 338 //Страницы сообщений список
339 public function messages($type_message) { 339 public function messages($type_message) {
340 $user_id = Auth()->user()->id; 340 $user_id = Auth()->user()->id;
341 341
342 $messages_input = Message::query()->with('vacancies')->with('user_from')-> 342 $messages_input = Message::query()->with('vacancies')->with('user_from')->
343 Where('to_user_id', $user_id)->OrderByDesc('created_at'); 343 Where('to_user_id', $user_id)->OrderByDesc('created_at');
344 344
345 $messages_output = Message::query()->with('vacancies')-> 345 $messages_output = Message::query()->with('vacancies')->
346 with('user_to')->where('user_id', $user_id)-> 346 with('user_to')->where('user_id', $user_id)->
347 OrderByDesc('created_at'); 347 OrderByDesc('created_at');
348 348
349 $count_input = $messages_input->count(); 349 $count_input = $messages_input->count();
350 $count_output = $messages_output->count(); 350 $count_output = $messages_output->count();
351 351
352 if ($type_message == 'input') { 352 if ($type_message == 'input') {
353 $messages = $messages_input->paginate(5); 353 $messages = $messages_input->paginate(5);
354 } 354 }
355 355
356 if ($type_message == 'output') { 356 if ($type_message == 'output') {
357 $messages = $messages_output->paginate(5); 357 $messages = $messages_output->paginate(5);
358 } 358 }
359 359
360 //dd($user_id, $messages[2]->vacancies); 360 //dd($user_id, $messages[2]->vacancies);
361 //jobs); 361 //jobs);
362 362
363 return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); 363 return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id'));
364 } 364 }
365 365
366 // Диалог между пользователями 366 // Диалог между пользователями
367 public function dialog(Request $request, User_Model $user1, User_Model $user2) { 367 public function dialog(Request $request, User_Model $user1, User_Model $user2) {
368 // Получение параметров. 368 // Получение параметров.
369 if ($request->has('ad_employer')){ 369 if ($request->has('ad_employer')){
370 $ad_employer = $request->get('ad_employer'); 370 $ad_employer = $request->get('ad_employer');
371 } else { 371 } else {
372 $ad_employer = 0; 372 $ad_employer = 0;
373 } 373 }
374 374
375 if (isset($user2->id)) { 375 if (isset($user2->id)) {
376 $companion = User_Model::query()->with('workers')-> 376 $companion = User_Model::query()->with('workers')->
377 with('employers')-> 377 with('employers')->
378 where('id', $user2->id)->first(); 378 where('id', $user2->id)->first();
379 } 379 }
380 380
381 $Messages = Message::query()-> 381 $Messages = Message::query()->
382 where('ad_employer_id', '=', $ad_employer)-> 382 where('ad_employer_id', '=', $ad_employer)->
383 where(function($query) use ($user1, $user2) { 383 where(function($query) use ($user1, $user2) {
384 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); 384 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id);
385 })->orWhere(function($query) use ($user1, $user2) { 385 })->orWhere(function($query) use ($user1, $user2) {
386 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); 386 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id);
387 })->where('ad_employer_id', '=', $ad_employer)->OrderBy('created_at')->get(); 387 })->where('ad_employer_id', '=', $ad_employer)->OrderBy('created_at')->get();
388 388
389 $id_vac = $Messages[$Messages->count() - 1]->ad_employer_id; 389 $id_vac = $Messages[$Messages->count() - 1]->ad_employer_id;
390 390
391 //$ad_employer = null; 391 //$ad_employer = null;
392 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); 392 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first();
393 $sender = $user1; 393 $sender = $user1;
394 394
395 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages')); 395 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages'));
396 } 396 }
397 397
398 // Регистрация работодателя 398 // Регистрация работодателя
399 public function register_employer(Request $request) { 399 public function register_employer(Request $request) {
400 $params = $request->all(); 400 $params = $request->all();
401 401
402 $rules = [ 402 $rules = [
403 //'surname' => ['required', 'string', 'max:255'], 403 //'surname' => ['required', 'string', 'max:255'],
404 //'name_man' => ['required', 'string', 'max:255'], 404 //'name_man' => ['required', 'string', 'max:255'],
405 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 405 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
406 'name_company' => ['required', 'string', 'max:255'], 406 'name_company' => ['required', 'string', 'max:255'],
407 'password' => ['required', 'string', 'min:6'], 407 'password' => ['required', 'string', 'min:6'],
408 ]; 408 ];
409 409
410 410
411 $messages = [ 411 $messages = [
412 'required' => 'Укажите обязательное поле', 412 'required' => 'Укажите обязательное поле',
413 'min' => [ 413 'min' => [
414 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 414 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
415 'integer' => 'Поле «:attribute» должно быть :min или больше', 415 'integer' => 'Поле «:attribute» должно быть :min или больше',
416 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 416 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
417 ], 417 ],
418 'max' => [ 418 'max' => [
419 'string' => 'Поле «:attribute» должно быть не больше :max символов', 419 'string' => 'Поле «:attribute» должно быть не больше :max символов',
420 'integer' => 'Поле «:attribute» должно быть :max или меньше', 420 'integer' => 'Поле «:attribute» должно быть :max или меньше',
421 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 421 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
422 ] 422 ]
423 ]; 423 ];
424 424
425 $email = $request->get('email'); 425 $email = $request->get('email');
426 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { 426 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) {
427 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); 427 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл"));
428 } 428 }
429 429
430 if ($request->get('password') !== $request->get('confirmed')){ 430 if ($request->get('password') !== $request->get('confirmed')){
431 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 431 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
432 } 432 }
433 433
434 if (strlen($request->get('password')) < 6) { 434 if (strlen($request->get('password')) < 6) {
435 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); 435 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
436 } 436 }
437 437
438 if (empty($request->get('surname'))) { 438 if (empty($request->get('surname'))) {
439 $params['surname'] = 'Неизвестно'; 439 $params['surname'] = 'Неизвестно';
440 } 440 }
441 if (empty($request->get('name_man'))) { 441 if (empty($request->get('name_man'))) {
442 $params['name_man'] = 'Неизвестно'; 442 $params['name_man'] = 'Неизвестно';
443 } 443 }
444 $validator = Validator::make($params, $rules, $messages); 444 $validator = Validator::make($params, $rules, $messages);
445 445
446 if ($validator->fails()) { 446 if ($validator->fails()) {
447 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 447 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
448 } else { 448 } else {
449 $user = $this->create($params); 449 $user = $this->create($params);
450 event(new Registered($user)); 450 event(new Registered($user));
451 451
452 Mail::to(env('EMAIL_ADMIN'))->send(new MailCreateEmployer($params)); 452 Mail::to(env('EMAIL_ADMIN'))->send(new MailCreateEmployer($params));
453 453
454 Auth::guard()->login($user); 454 Auth::guard()->login($user);
455 } 455 }
456 456
457 if ($user) { 457 if ($user) {
458 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; 458 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));;
459 } else { 459 } else {
460 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 460 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
461 } 461 }
462 } 462 }
463 463
464 // Создание пользователя 464 // Создание пользователя
465 protected function create(array $data) 465 protected function create(array $data)
466 { 466 {
467 $Use = new User_Model(); 467 $Use = new User_Model();
468 $Code_user = $Use->create([ 468 $Code_user = $Use->create([
469 'name' => $data['surname']." ".$data['name_man'], 469 'name' => $data['surname']." ".$data['name_man'],
470 'name_man' => $data['name_man'], 470 'name_man' => $data['name_man'],
471 'surname' => $data['surname'], 471 'surname' => $data['surname'],
472 'surname2' => $data['surname2'], 472 'surname2' => $data['surname2'],
473 'subscribe_email' => $data['email'], 473 'subscribe_email' => $data['email'],
474 'email' => $data['email'], 474 'email' => $data['email'],
475 'telephone' => $data['telephone'], 475 'telephone' => $data['telephone'],
476 'is_worker' => 0, 476 'is_worker' => 0,
477 'password' => Hash::make($data['password']), 477 'password' => Hash::make($data['password']),
478 'pubpassword' => base64_encode($data['password']), 478 'pubpassword' => base64_encode($data['password']),
479 'email_verified_at' => Carbon::now() 479 'email_verified_at' => Carbon::now()
480 ]); 480 ]);
481 481
482 if ($Code_user->id > 0) { 482 if ($Code_user->id > 0) {
483 $Employer = new Employer(); 483 $Employer = new Employer();
484 $Employer->user_id = $Code_user->id; 484 $Employer->user_id = $Code_user->id;
485 $Employer->name_company = $data['name_company']; 485 $Employer->name_company = $data['name_company'];
486 $Employer->email = $data['email']; 486 $Employer->email = $data['email'];
487 $Employer->telephone = $data['telephone']; 487 $Employer->telephone = $data['telephone'];
488 $Employer->code = Tools::generator_id(10); 488 $Employer->code = Tools::generator_id(10);
489 $Employer->save(); 489 $Employer->save();
490 490
491 return $Code_user; 491 return $Code_user;
492 } 492 }
493 } 493 }
494 494
495 // Отправка сообщения от работодателя 495 // Отправка сообщения от работодателя
496 public function send_message(MessagesRequiest $request) { 496 public function send_message(MessagesRequiest $request) {
497 $params = $request->all(); 497 $params = $request->all();
498 dd($params); 498 dd($params);
499 $user1 = $params['user_id']; 499 $user1 = $params['user_id'];
500 $user2 = $params['to_user_id']; 500 $user2 = $params['to_user_id'];
501 501
502 if ($request->has('file')) { 502 if ($request->has('file')) {
503 $params['file'] = $request->file('file')->store("messages", 'public'); 503 $params['file'] = $request->file('file')->store("messages", 'public');
504 } 504 }
505 Message::create($params); 505 Message::create($params);
506 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 506 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
507 } 507 }
508 508
509 public function test123(Request $request) { 509 public function test123(Request $request) {
510 $params = $request->all(); 510 $params = $request->all();
511 $user1 = $params['user_id']; 511 $user1 = $params['user_id'];
512 $user2 = $params['to_user_id']; 512 $user2 = $params['to_user_id'];
513 $id_vacancy = $params['ad_employer_id']; 513 $id_vacancy = $params['ad_employer_id'];
514 $ad_name = $params['ad_name']; 514 $ad_name = $params['ad_name'];
515 515
516 $rules = [ 516 $rules = [
517 'text' => 'required|min:1|max:150000', 517 'text' => 'required|min:1|max:150000',
518 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' 518 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000'
519 ]; 519 ];
520 $messages = [ 520 $messages = [
521 'required' => 'Укажите обязательное поле', 521 'required' => 'Укажите обязательное поле',
522 'min' => [ 522 'min' => [
523 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 523 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
524 'integer' => 'Поле «:attribute» должно быть :min или больше', 524 'integer' => 'Поле «:attribute» должно быть :min или больше',
525 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 525 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
526 ], 526 ],
527 'max' => [ 527 'max' => [
528 'string' => 'Поле «:attribute» должно быть не больше :max символов', 528 'string' => 'Поле «:attribute» должно быть не больше :max символов',
529 'integer' => 'Поле «:attribute» должно быть :max или меньше', 529 'integer' => 'Поле «:attribute» должно быть :max или меньше',
530 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 530 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
531 ] 531 ]
532 ]; 532 ];
533 533
534 $validator = Validator::make($request->all(), $rules, $messages); 534 $validator = Validator::make($request->all(), $rules, $messages);
535 535
536 if ($validator->fails()) { 536 if ($validator->fails()) {
537 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) 537 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2])
538 ->withErrors($validator); 538 ->withErrors($validator);
539 } else { 539 } else {
540 if ($request->has('file')) { 540 if ($request->has('file')) {
541 $params['file'] = $request->file('file')->store("messages", 'public'); 541 $params['file'] = $request->file('file')->store("messages", 'public');
542 } 542 }
543 Message::create($params); 543 Message::create($params);
544 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 544 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
545 return redirect()->route('employer.dialog', 545 return redirect()->route('employer.dialog',
546 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]); 546 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]);
547 547
548 } 548 }
549 } 549 }
550 550
551 //Избранные люди 551 //Избранные люди
552 public function favorites(Request $request) { 552 public function favorites(Request $request) {
553 $IP_address = RusDate::ip_addr_client(); 553 $IP_address = RusDate::ip_addr_client();
554 $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); 554 $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get();
555 555
556 if ($Arr->count()) { 556 if ($Arr->count()) {
557 $A = Array(); 557 $A = Array();
558 foreach ($Arr as $it) { 558 foreach ($Arr as $it) {
559 $A[] = $it->code_record; 559 $A[] = $it->code_record;
560 } 560 }
561 561
562 $Workers = Worker::query()->whereIn('id', $A); 562 $Workers = Worker::query()->whereIn('id', $A);
563 } else { 563 } else {
564 $Workers = Worker::query()->where('id', '=', '0'); 564 $Workers = Worker::query()->where('id', '=', '0');
565 } 565 }
566 566
567 if (($request->has('search')) && (!empty($request->get('search')))) { 567 if (($request->has('search')) && (!empty($request->get('search')))) {
568 $search = $request->get('search'); 568 $search = $request->get('search');
569 569
570 $Workers = $Workers->WhereHas('users', 570 $Workers = $Workers->WhereHas('users',
571 function (Builder $query) use ($search) { 571 function (Builder $query) use ($search) {
572 $query->Where('surname', 'LIKE', "%$search%") 572 $query->Where('surname', 'LIKE', "%$search%")
573 ->orWhere('name_man', 'LIKE', "%$search%") 573 ->orWhere('name_man', 'LIKE', "%$search%")
574 ->orWhere('surname2', 'LIKE', "%$search%"); 574 ->orWhere('surname2', 'LIKE', "%$search%");
575 }); 575 });
576 } else { 576 } else {
577 $Workers = $Workers->with('users'); 577 $Workers = $Workers->with('users');
578 } 578 }
579 579
580 $Workers = $Workers->get(); 580 $Workers = $Workers->get();
581 581
582 582
583 return view('employers.favorite', compact('Workers')); 583 return view('employers.favorite', compact('Workers'));
584 } 584 }
585 585
586 // База данных 586 // База данных
587 public function bd(Request $request) {
588 for ($i = 0; $i < 5; $i++) {
589 echo "i = $i\n<br>";
590 for ($j = 0; $j < 5; $j++) {
591 echo " j = $j\n<br>";
592 for ($k = 0; $k < 5; $k++) {
593 if ($k == 2) {
594 continue;
595 }
596 echo " k = $k\n<br>";
597 }
598 }
599 }
600
587 public function bd(Request $request) { 601 dd('OK');
588 $users = User_Model::query()->with('workers'); 602 $users = User_Model::query()->with('workers')->with('jobtitles');
589 603
590 if ($request->has('search')) { 604 if ($request->has('search')) {
591 $find_key = $request->get('search'); 605 $find_key = $request->get('search');
592 $users = $users->where('name', 'LIKE', "%$find_key%") 606 $users = $users->where('name', 'LIKE', "%$find_key%")
593 ->orWhere('surname', 'LIKE', "%$find_key%") 607 ->orWhere('surname', 'LIKE', "%$find_key%")
594 ->orWhere('name_man', 'LIKE', "%$find_key%") 608 ->orWhere('name_man', 'LIKE', "%$find_key%")
595 ->orWhere('email', 'LIKE', "%$find_key%") 609 ->orWhere('email', 'LIKE', "%$find_key%")
596 ->orWhere('telephone', 'LIKE', "%$find_key%"); 610 ->orWhere('telephone', 'LIKE', "%$find_key%");
597 } 611 }
598 612
599 // Данные 613 // Данные
600 $users = $users->Baseuser()-> 614 $users = $users->Baseuser()->
601 orderBy(Worker::select('position_work')->whereColumn('workers.user_id', 'users.id')); 615 orderBy(Worker::select('position_work')->whereColumn('workers.user_id', 'users.id'));
602 $count_users = $users; 616 $count_users = $users;
603 $users = $users->paginate(5); 617 $users = $users->paginate(5);
604 618
605 $export_options = DbExportColumns::toArray(); 619 $export_options = DbExportColumns::toArray();
606 620
607 $jobs_titles = Job_title::select('id', 'name') 621 $jobs_titles = Job_title::select('id', 'name')
608 ->where('is_remove', '=', 0) 622 ->where('is_remove', '=', 0)
609 ->where('is_bd', '=', 2) 623 ->where('is_bd', '=', 2)
610 ->orderBy('name', 'asc') 624 ->orderBy('name', 'asc')
611 ->get() 625 ->get()
612 ->toArray() 626 ->toArray()
613 ; 627 ;
614 628
615 return view('employers.bd', compact('users', 'count_users', 'export_options', 'jobs_titles')); 629 return view('employers.bd', compact('users', 'count_users', 'export_options', 'jobs_titles'));
616 } 630 }
617 631
618 //Настройка уведомлений 632 //Настройка уведомлений
619 public function subscribe() { 633 public function subscribe() {
620 return view('employers.subcribe'); 634 return view('employers.subcribe');
621 } 635 }
622 636
623 //Установка уведомлений сохранение 637 //Установка уведомлений сохранение
624 public function save_subscribe(Request $request) { 638 public function save_subscribe(Request $request) {
625 dd($request->all()); 639 dd($request->all());
626 $msg = $request->validate([ 640 $msg = $request->validate([
627 'subscribe_email' => 'required|email|min:5|max:255', 641 'subscribe_email' => 'required|email|min:5|max:255',
628 ]); 642 ]);
629 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); 643 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку');
630 } 644 }
631 645
632 //Сбросить форму с паролем 646 //Сбросить форму с паролем
633 public function password_reset() { 647 public function password_reset() {
634 $email = Auth()->user()->email; 648 $email = Auth()->user()->email;
635 return view('employers.password-reset', compact('email')); 649 return view('employers.password-reset', compact('email'));
636 } 650 }
637 651
638 //Обновление пароля 652 //Обновление пароля
639 public function new_password(Request $request) { 653 public function new_password(Request $request) {
640 $use = Auth()->user(); 654 $use = Auth()->user();
641 $request->validate([ 655 $request->validate([
642 'password' => 'required|string', 656 'password' => 'required|string',
643 'new_password' => 'required|string', 657 'new_password' => 'required|string',
644 'new_password2' => 'required|string' 658 'new_password2' => 'required|string'
645 ]); 659 ]);
646 660
647 if ($request->get('new_password') == $request->get('new_password2')) 661 if ($request->get('new_password') == $request->get('new_password2'))
648 if ($request->get('password') !== $request->get('new_password')) { 662 if ($request->get('password') !== $request->get('new_password')) {
649 $credentials = $request->only('email', 'password'); 663 $credentials = $request->only('email', 'password');
650 if (Auth::attempt($credentials)) { 664 if (Auth::attempt($credentials)) {
651 665
652 if (!is_null($use->email_verified_at)){ 666 if (!is_null($use->email_verified_at)){
653 667
654 $user_data = User_Model::find($use->id); 668 $user_data = User_Model::find($use->id);
655 $user_data->update([ 669 $user_data->update([
656 'password' => Hash::make($request->get('new_password')), 670 'password' => Hash::make($request->get('new_password')),
657 'pubpassword' => base64_encode($request->get('new_password')), 671 'pubpassword' => base64_encode($request->get('new_password')),
658 ]); 672 ]);
659 return redirect() 673 return redirect()
660 ->route('employer.password_reset') 674 ->route('employer.password_reset')
661 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 675 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
662 } 676 }
663 677
664 return redirect() 678 return redirect()
665 ->route('employer.password_reset') 679 ->route('employer.password_reset')
666 ->withError('Данная учетная запись не было верифицированна!'); 680 ->withError('Данная учетная запись не было верифицированна!');
667 } 681 }
668 } 682 }
669 683
670 return redirect() 684 return redirect()
671 ->route('employer.password_reset') 685 ->route('employer.password_reset')
672 ->withErrors('Не совпадение данных, обновите пароли!'); 686 ->withErrors('Не совпадение данных, обновите пароли!');
673 } 687 }
674 688
675 689
676 690
677 // Форма Удаление пипла 691 // Форма Удаление пипла
678 public function delete_people() { 692 public function delete_people() {
679 $login = Auth()->user()->email; 693 $login = Auth()->user()->email;
680 return view('employers.delete_people', compact('login')); 694 return view('employers.delete_people', compact('login'));
681 } 695 }
682 696
683 // Удаление аккаунта 697 // Удаление аккаунта
684 public function action_delete_user(Request $request) { 698 public function action_delete_user(Request $request) {
685 $Answer = $request->all(); 699 $Answer = $request->all();
686 $user_id = Auth()->user()->id; 700 $user_id = Auth()->user()->id;
687 $request->validate([ 701 $request->validate([
688 'password' => 'required|string', 702 'password' => 'required|string',
689 ]); 703 ]);
690 704
691 $credentials = $request->only('email', 'password'); 705 $credentials = $request->only('email', 'password');
692 if (Auth::attempt($credentials)) { 706 if (Auth::attempt($credentials)) {
693 Auth::logout(); 707 Auth::logout();
694 $it = User_Model::find($user_id); 708 $it = User_Model::find($user_id);
695 $it->delete(); 709 $it->delete();
696 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 710 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
697 } else { 711 } else {
698 return redirect()->route('employer.delete_people') 712 return redirect()->route('employer.delete_people')
699 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 713 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
700 } 714 }
701 } 715 }
702 716
703 public function ajax_delete_user(Request $request) { 717 public function ajax_delete_user(Request $request) {
704 $Answer = $request->all(); 718 $Answer = $request->all();
705 $user_id = Auth()->user()->id; 719 $user_id = Auth()->user()->id;
706 $request->validate([ 720 $request->validate([
707 'password' => 'required|string', 721 'password' => 'required|string',
708 ]); 722 ]);
709 $credentials = $request->only('email', 'password'); 723 $credentials = $request->only('email', 'password');
710 if (Auth::attempt($credentials)) { 724 if (Auth::attempt($credentials)) {
711 725
712 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', 726 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт',
713 'email' => $request->get('email'), 727 'email' => $request->get('email'),
714 'password' => $request->get('password'))); 728 'password' => $request->get('password')));
715 } else { 729 } else {
716 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); 730 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль'));
717 } 731 }
718 } 732 }
719 733
720 // FAQ - Вопросы/ответы для работодателей и соискателей 734 // FAQ - Вопросы/ответы для работодателей и соискателей
721 public function faq() { 735 public function faq() {
722 return view('employers.faq'); 736 return view('employers.faq');
723 } 737 }
724 738
725 // Рассылка сообщений 739 // Рассылка сообщений
726 public function send_all_messages() { 740 public function send_all_messages() {
727 $id = Auth()->user()->id; 741 $id = Auth()->user()->id;
728 $sending = Employer::query()->where('user_id', '=', "$id")->first(); 742 $sending = Employer::query()->where('user_id', '=', "$id")->first();
729 743
730 if ($sending->sending_is) 744 if ($sending->sending_is)
731 return view('employers.send_all'); 745 return view('employers.send_all');
732 else 746 else
733 return view('employers.send_all_danger'); 747 return view('employers.send_all_danger');
734 } 748 }
735 749
736 // Отправка сообщений для информации 750 // Отправка сообщений для информации
737 public function send_all_post(Request $request) { 751 public function send_all_post(Request $request) {
738 $data = $request->all(); 752 $data = $request->all();
739 753
740 $emails = User_Model::query()->where('is_worker', '1')->get(); 754 $emails = User_Model::query()->where('is_worker', '1')->get();
741 755
742 foreach ($emails as $e) { 756 foreach ($emails as $e) {
743 Mail::to($e->email)->send(new SendAllMessages($data)); 757 Mail::to($e->email)->send(new SendAllMessages($data));
744 } 758 }
745 759
746 return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); 760 return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены');
747 } 761 }
748 762
749 // База резюме 763 // База резюме
750 public function bd_tupe(Request $request) { 764 public function bd_tupe(Request $request) {
751 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); 765 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get();
752 766
753 return view('employers.bd_tupe', compact('Resume')); 767 return view('employers.bd_tupe', compact('Resume'));
754 } 768 }
755 769
756 ////////////////////////////////////////////////////////////////// 770 //////////////////////////////////////////////////////////////////
757 // Отправил сообщение 771 // Отправил сообщение
758 ////////////////////////////////////////////////////////////////// 772 //////////////////////////////////////////////////////////////////
759 public function new_message(Request $request) { 773 public function new_message(Request $request) {
760 $params = $request->all(); 774 $params = $request->all();
761 $id = $params['_user_id']; 775 $id = $params['_user_id'];
762 $message = new Message(); 776 $message = new Message();
763 $message->user_id = $params['_user_id']; 777 $message->user_id = $params['_user_id'];
764 $message->to_user_id = $params['_to_user_id']; 778 $message->to_user_id = $params['_to_user_id'];
765 $message->title = $params['title']; 779 $message->title = $params['title'];
766 $message->text = $params['text']; 780 $message->text = $params['text'];
767 if ($request->has('_file')) { 781 if ($request->has('_file')) {
768 $message->file = $request->file('_file')->store("worker/$id", 'public'); 782 $message->file = $request->file('_file')->store("worker/$id", 'public');
769 } 783 }
770 $message->ad_employer_id = $params['_vacancy']; 784 $message->ad_employer_id = $params['_vacancy'];
771 $message->flag_new = 1; 785 $message->flag_new = 1;
772 $id_message = $message->save(); 786 $id_message = $message->save();
773 787
774 //$data['message_id'] = $id_message; 788 //$data['message_id'] = $id_message;
775 //$data['ad_employer_id'] = $params['_vacancy']; 789 //$data['ad_employer_id'] = $params['_vacancy'];
776 //$data['job_title_id'] = 0; 790 //$data['job_title_id'] = 0;
777 791
778 $data['flag'] = 1; 792 $data['flag'] = 1;
779 //$ad_responce = ad_response::create($data); 793 //$ad_responce = ad_response::create($data);
780 return redirect()->route('employer.messages', ['type_message' => 'output']); 794 return redirect()->route('employer.messages', ['type_message' => 'output']);
781 } 795 }
782 796
783 // Восстановление пароля 797 // Восстановление пароля
784 public function repair_password(Request $request) { 798 public function repair_password(Request $request) {
785 $params = $request->get('email'); 799 $params = $request->get('email');
786 } 800 }
787 801
788 // Избранные люди на корабль 802 // Избранные люди на корабль
789 public function selected_people(Request $request) { 803 public function selected_people(Request $request) {
790 $id = $request->get('id'); 804 $id = $request->get('id');
791 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 805 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
792 where('is_remove', '=', '0')-> 806 where('is_remove', '=', '0')->
793 where('is_bd', '=', '0')-> 807 where('is_bd', '=', '0')->
794 where('position_id', $id)-> 808 where('position_id', $id)->
795 get(); 809 get();
796 return view('favorite_people', compact('favorite_people')); 810 return view('favorite_people', compact('favorite_people'));
797 } 811 }
798 } 812 }
799 813
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 <<<<<<< HEAD
269 <label class="form-group__label">Контакты родственников:</label> 269 <div class="cabinet__inputs-item form-group">
270 <div class="form-group__item"> 270 <label class="form-group__label">Контакты родственников:</label>
271 {{ $worker->telephon2 ?? '-' }} 271 <div class="form-group__item">
272 </div> 272 {{ $worker->telephon2 ?? '-' }}
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
283 276
284 277
285 278 <div class="width100">
279 <h4 class="cabinet__h4 mb-10">О себе</h4>
280 <div>{{ $worker->text }}</div>
286 281 =======
287 <div class=""> 282 <div class="cabinet__inputs-item form-group">
288 <a href="{{ route('worker.basic_information') }}" class="button active">Редактировать основную информацию</a> 283 <label class="form-group__label">Контакты родственников:</label>
289 </div> 284 <div class="form-group__item">
290 </div> 285 {{ $worker->telephone2 ?? '-' }}
291 </div> 286 </div>
292 287 </div>
293 <div class="mb-40" id="sertificate" name="sertificate"> 288 >>>>>>> b67b944770e95eb4bd433dde26daedbcb4bc6ae9
294 <h3 class="cabinet__subtitle font30 mb-20">Сертификаты / документы</h3> 289 </div>
295 290 </div>
296 @if($worker->sertificate->count()) 291 </div>
297 @foreach($worker->sertificate as $sertificate) 292
298 <div class="one-sertificate"> 293 <div class="width100">
299 <div class="sertificate-field sertificate-name"> 294 <h4 class="cabinet__h4 mb-10">О себе</h4>
300 <label class="bold">Название сертификата:</label> 295 <div>{{ $worker->text }}</div>
301 <div>{{ $sertificate->name }}</div> 296 </div>
302 </div> 297
303 <div class="sertificate-field"> 298 <div class="">
304 <label class="bold">Действителен до:</label> 299 <a href="{{ route('worker.basic_information') }}" class="button active">Редактировать основную информацию</a>
305 <div>{{ date('d.m.Y', strtotime($sertificate->end_begin)) }}</div> 300 </div>
306 </div> 301 </div>
307 <div class="sertificate-field sertificate-buttons"> 302 </div>
308 <a href="{{ route('worker.edit_sertificate', ['worker' => $worker->id, 'doc' => $sertificate->id ]) }}" class="button button_light mr-10"> 303
309 <svg><use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use></svg> 304 <div class="mb-40" id="sertificate" name="sertificate">
310 </a> 305 <h3 class="cabinet__subtitle font30 mb-20">Сертификаты / документы</h3>
311 <a href="{{ route('worker.delete_sertificate', ['doc' => $sertificate->id]) }}" class="button button_light"> 306
312 <svg><use xlink:href="{{ asset('images/sprite.svg#del') }}"></use></svg> 307 @if($worker->sertificate->count())
313 </a> 308 @foreach($worker->sertificate as $sertificate)
314 </div> 309 <div class="one-sertificate">
315 </div> 310 <div class="sertificate-field sertificate-name">
316 @endforeach 311 <label class="bold">Название сертификата:</label>
317 @endif 312 <div>{{ $sertificate->name }}</div>
318 313 </div>
319 <a class="button fit-content" href="{{ route('worker.new_sertificate',['worker' => $worker->id]) }}" id="button_new_doc" name="button_new_doc"> 314 <div class="sertificate-field">
320 Добавить сертификат / документ 315 <label class="bold">Действителен до:</label>
321 </a> 316 <div>{{ date('d.m.Y', strtotime($sertificate->end_begin)) }}</div>
322 </div> 317 </div>
323 318 <div class="sertificate-field sertificate-buttons">
324 <div class="cabinet__body-item mb-40" name="ajax_dop_diplomi" id="ajax_dop_diplomi"> 319 <a href="{{ route('worker.edit_sertificate', ['worker' => $worker->id, 'doc' => $sertificate->id ]) }}" class="button button_light mr-10">
325 <h3 class="cabinet__subtitle font30">Дополнительные документы</h3> 320 <svg><use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use></svg>
326 321 </a>
327 <div class="cabinet__inputs" id="block_sertificate"> 322 <a href="{{ route('worker.delete_sertificate', ['doc' => $sertificate->id]) }}" class="button button_light">
328 @if ($info_blocks->count()) 323 <svg><use xlink:href="{{ asset('images/sprite.svg#del') }}"></use></svg>
329 @foreach ($info_blocks as $info_block) 324 </a>
330 <div class="cabinet__inputs-item column-count-3 form-group"> 325 </div>
331 <label class="form-group__label">{{ $info_block->name }}:</label> 326 </div>
332 327 @endforeach
333 <div class="form-group__item"> 328 @endif
334 @php $status = 0; @endphp 329
335 @if (!empty($worker->dop_info[$info_block->id]) && $worker->dop_info[$info_block->id]['status']) 330 <a class="button fit-content" href="{{ route('worker.new_sertificate',['worker' => $worker->id]) }}" id="button_new_doc" name="button_new_doc">
336 @php $status = $worker->dop_info[$info_block->id]['status']; @endphp 331 Добавить сертификат / документ
337 @endif 332 </a>
338 {{ $additional_document_statuses[$status] }} 333 </div>
339 </div> 334
340 </div> 335 <div class="cabinet__body-item mb-40" name="ajax_dop_diplomi" id="ajax_dop_diplomi">
341 @endforeach 336 <h3 class="cabinet__subtitle font30">Дополнительные документы</h3>
342 @endif 337
343 </div> 338 <div class="cabinet__inputs" id="block_sertificate">
344 339 @if ($info_blocks->count())
345 <a class="button fit-content" href="{{ route('worker.additional_documents') }}"> 340 @foreach ($info_blocks as $info_block)
346 Редактировать дополнительные документы 341 <div class="cabinet__inputs-item column-count-3 form-group">
347 </a> 342 <label class="form-group__label">{{ $info_block->name }}:</label>
348 </div> 343
349 344 <div class="form-group__item">
350 <div class="cabinet__body-item mb-20"> 345 @php $status = 0; @endphp
351 <div> 346 @if (!empty($worker->dop_info[$info_block->id]) && $worker->dop_info[$info_block->id]['status'])
352 <h3 class="cabinet__subtitle font30">Опыт работы</h3> 347 @php $status = $worker->dop_info[$info_block->id]['status']; @endphp
353 <div class="">Начните заполнение анкеты с указания последнего места работы</div> 348 @endif
354 </div> 349 {{ $additional_document_statuses[$status] }}
355 350 </div>
356 <div class="cabinet__works"> 351 </div>
357 @if (isset($worker->place_worker)) 352 @endforeach
358 @foreach($worker->place_worker as $company) 353 @endif
359 <div class="cabinet__works-item"> 354 </div>
360 <div class="cabinet__works-spoiler active"> 355
361 <div class="cabinet__works-spoiler-left"> 356 <a class="button fit-content" href="{{ route('worker.additional_documents') }}">
362 <div class="cabinet__works-spoiler-text">Место работы {{ $loop->iteration }}</div> 357 Редактировать дополнительные документы
363 </div> 358 </a>
364 <div class="cabinet__works-spoiler-buttons"> 359 </div>
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
366 <svg> 361 <div class="cabinet__body-item mb-20">
367 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> 362 <div>
368 </svg> 363 <h3 class="cabinet__subtitle font30">Опыт работы</h3>
369 </a> 364 <div class="">Начните заполнение анкеты с указания последнего места работы</div>
370 <a href="{{ route('worker.delete_document', ['doc' => $company->id]) }}" class="button button_light js-works-remove"> 365 </div>
371 <svg> 366
372 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> 367 <div class="cabinet__works">
373 </svg> 368 @if (isset($worker->place_worker))
374 </a> 369 @foreach($worker->place_worker as $company)
375 </div> 370 <div class="cabinet__works-item">
376 </div> 371 <div class="cabinet__works-spoiler active">
377 372 <div class="cabinet__works-spoiler-left">
378 <div class="cabinet__works-body"> 373 <div class="cabinet__works-spoiler-text">Место работы {{ $loop->iteration }}</div>
379 <div class="cabinet__inputs"> 374 </div>
380 <div class="cabinet__inputs-item column-count-3 form-group"> 375 <div class="cabinet__works-spoiler-buttons">
381 <label class="form-group__label">Должность:</label> 376 <a href="{{ route('worker.edit_document', ['doc' => $company->id, 'worker' => $worker->id]) }}" type="button" class="button button_light mr-10 js-works-edit">
382 <div class="form-group__item"> 377 <svg>
383 {{ $company->job_title ?? '-' }} 378 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use>
384 </div> 379 </svg>
385 </div> 380 </a>
386 381 <a href="{{ route('worker.delete_document', ['doc' => $company->id]) }}" class="button button_light js-works-remove">
387 <div class="cabinet__inputs-item column-count-3 form-group"> 382 <svg>
388 <label class="form-group__label">Название т/х:</label> 383 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use>
389 <div class="form-group__item"> 384 </svg>
390 {{ $company->teplohod ?? '-' }} 385 </a>
391 </div> 386 </div>
392 </div> 387 </div>
393 <div class="cabinet__inputs-item column-count-3 form-group"> 388
394 <label class="form-group__label">Тип суда:</label> 389 <div class="cabinet__works-body">
395 <div class="form-group__item"> 390 <div class="cabinet__inputs">
396 {{ $company->GWT ?? '-' }} 391 <div class="cabinet__inputs-item column-count-3 form-group">
397 </div> 392 <label class="form-group__label">Должность:</label>
398 </div> 393 <div class="form-group__item">
399 <div class="cabinet__inputs-item column-count-3 form-group"> 394 {{ $company->job_title ?? '-' }}
400 <label class="form-group__label">Марка ГД:</label> 395 </div>
401 <div class="form-group__item"> 396 </div>
402 {{ $company->Marka_GD ?? '-' }} 397
403 </div> 398 <div class="cabinet__inputs-item column-count-3 form-group">
404 </div> 399 <label class="form-group__label">Название т/х:</label>
405 <div class="cabinet__inputs-item column-count-3 form-group"> 400 <div class="form-group__item">
406 <label class="form-group__label">Мощность ГД (кВТ):</label> 401 {{ $company->teplohod ?? '-' }}
407 <div class="form-group__item"> 402 </div>
408 {{ $company->KBT ?? '-' }} 403 </div>
409 </div> 404 <div class="cabinet__inputs-item column-count-3 form-group">
410 </div> 405 <label class="form-group__label">Тип суда:</label>
411 <div class="cabinet__inputs-item column-count-3 form-group"> 406 <div class="form-group__item">
412 <label class="form-group__label">Водоизмещение (DWT):</label> 407 {{ $company->GWT ?? '-' }}
413 <div class="form-group__item"> 408 </div>
414 {{ $company->GRT ?? '-' }} 409 </div>
415 </div> 410 <div class="cabinet__inputs-item column-count-3 form-group">
416 </div> 411 <label class="form-group__label">Марка ГД:</label>
417 <div class="cabinet__inputs-item column-count-3 form-group"> 412 <div class="form-group__item">
418 <label class="form-group__label">Название компании:</label> 413 {{ $company->Marka_GD ?? '-' }}
419 <div class="form-group__item"> 414 </div>
420 {{ $company->name_company ?? '-' }} 415 </div>
421 </div> 416 <div class="cabinet__inputs-item column-count-3 form-group">
422 </div> 417 <label class="form-group__label">Мощность ГД (кВТ):</label>
423 <div class="cabinet__inputs-item column-count-3 form-group"> 418 <div class="form-group__item">
424 <label class="form-group__label">Начало контракта:</label> 419 {{ $company->KBT ?? '-' }}
425 <div class="form-group__item"> 420 </div>
426 {{ $company->begin_work ?? '-' }} 421 </div>
427 </div> 422 <div class="cabinet__inputs-item column-count-3 form-group">
428 </div> 423 <label class="form-group__label">Водоизмещение (DWT):</label>
429 <div class="cabinet__inputs-item column-count-3 form-group"> 424 <div class="form-group__item">
430 <label class="form-group__label">Окончание контракта:</label> 425 {{ $company->GRT ?? '-' }}
431 <div class="form-group__item"> 426 </div>
432 {{ $company->end_work ?? '-' }} 427 </div>
433 </div> 428 <div class="cabinet__inputs-item column-count-3 form-group">
434 </div> 429 <label class="form-group__label">Название компании:</label>
435 430 <div class="form-group__item">
436 </div> 431 {{ $company->name_company ?? '-' }}
437 </div> 432 </div>
438 </div> 433 </div>
439 @endforeach 434 <div class="cabinet__inputs-item column-count-3 form-group">
440 @endif 435 <label class="form-group__label">Начало контракта:</label>
441 </div> 436 <div class="form-group__item">
442 437 {{ $company->begin_work ?? '-' }}
443 <a href="{{ route('worker.add_document', ['worker' => $worker->id]) }}" id="new_work" name="new_work" class="button fit-content"> 438 </div>
444 Добавить место работы 439 </div>
445 </a> 440 <div class="cabinet__inputs-item column-count-3 form-group">
446 </div> 441 <label class="form-group__label">Окончание контракта:</label>
447 442 <div class="form-group__item">
448 <div id="prev_worker" name="prev_worker"> 443 {{ $company->end_work ?? '-' }}
449 <div> 444 </div>
450 <h3 class="cabinet__subtitle font30">Рекомендации</h3> 445 </div>
451 <div class="">Укажите контакты компаний, которые могут дать рекомендации</div> 446
452 </div> 447 </div>
453 448 </div>
454 @if ((isset($worker->prev_company)) && ($worker->prev_company->count() > 0)) 449 </div>
455 @foreach($worker->prev_company as $it) 450 @endforeach
456 <div class="cabinet__body-item"> 451 @endif
457 <div class="cabinet__inputs mt-30"> 452 </div>
458 <div class="cabinet__inputs-item column-count-3 form-group"> 453
459 <label class="form-group__label">Название компании:</label> 454 <a href="{{ route('worker.add_document', ['worker' => $worker->id]) }}" id="new_work" name="new_work" class="button fit-content">
460 <div class="form-group__item"> 455 Добавить место работы
461 {{ $it->name_company }} 456 </a>
462 </div> 457 </div>
463 </div> 458
464 <div class="cabinet__inputs-item column-count-3 form-group"> 459 <div id="prev_worker" name="prev_worker">
465 <label class="form-group__label">ФИО сотрудника:</label> 460 <div>
466 <div class="form-group__item"> 461 <h3 class="cabinet__subtitle font30">Рекомендации</h3>
467 {{ $it->direct }} 462 <div class="">Укажите контакты компаний, которые могут дать рекомендации</div>
468 </div> 463 </div>
469 </div> 464
470 <div class="cabinet__inputs-item column-count-3 form-group cabinet__inputs-item-buttons"> 465 @if ((isset($worker->prev_company)) && ($worker->prev_company->count() > 0))
471 <div class="flex"> 466 @foreach($worker->prev_company as $it)
472 <a href="{{ route('worker.edit_prev_company', ['worker' => $worker->id, 'doc' => $it->id ]) }}" class="button button_light mr-10"> 467 <div class="cabinet__body-item">
473 <svg> 468 <div class="cabinet__inputs mt-30">
474 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> 469 <div class="cabinet__inputs-item column-count-3 form-group">
475 </svg> 470 <label class="form-group__label">Название компании:</label>
476 </a> 471 <div class="form-group__item">
477 <a href="{{ route('worker.delete_prev_company', ['doc' => $it->id]) }}" class="button button_light"> 472 {{ $it->name_company }}
478 <svg> 473 </div>
479 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> 474 </div>
480 </svg> 475 <div class="cabinet__inputs-item column-count-3 form-group">
481 </a> 476 <label class="form-group__label">ФИО сотрудника:</label>
482 </div> 477 <div class="form-group__item">
483 </div> 478 {{ $it->direct }}
484 <div class="cabinet__inputs-item column-count-3 form-group"> 479 </div>
485 <label class="form-group__label">Должность сотрудника:</label> 480 </div>
486 <div class="form-group__item"> 481 <div class="cabinet__inputs-item column-count-3 form-group cabinet__inputs-item-buttons">
487 {{ $it->telephone }} 482 <div class="flex">
488 </div> 483 <a href="{{ route('worker.edit_prev_company', ['worker' => $worker->id, 'doc' => $it->id ]) }}" class="button button_light mr-10">
489 </div> 484 <svg>
490 <div class="cabinet__inputs-item column-count-3 form-group"> 485 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use>
491 <label class="form-group__label">Телефон сотрудника:</label> 486 </svg>
492 <div class="form-group__item"> 487 </a>
493 {{ $it->telephone2 }} 488 <a href="{{ route('worker.delete_prev_company', ['doc' => $it->id]) }}" class="button button_light">
494 </div> 489 <svg>
495 </div> 490 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use>
496 <div class="cabinet__inputs-item column-count-3 form-group cabinet__inputs-item-buttons"></div> 491 </svg>
497 </div> 492 </a>
498 </div> 493 </div>
499 @endforeach 494 </div>
500 @endif 495 <div class="cabinet__inputs-item column-count-3 form-group">
501 </div> 496 <label class="form-group__label">Должность сотрудника:</label>
502 497 <div class="form-group__item">
503 <div class="cabinet__body-item"> 498 {{ $it->telephone }}
504 <a class="button fit-content" href="{{ route('worker.new_prev_company',['worker' => $worker->id]) }}"> 499 </div>
505 Добавить контакт для рекомендации 500 </div>
506 </a> 501 <div class="cabinet__inputs-item column-count-3 form-group">
507 </div> 502 <label class="form-group__label">Телефон сотрудника:</label>
508 </div> 503 <div class="form-group__item">
509 </div> 504 {{ $it->telephone2 }}
510 </div> 505 </div>
511 </section> 506 </div>
512 @endsection 507 <div class="cabinet__inputs-item column-count-3 form-group cabinet__inputs-item-buttons"></div>
513 508 </div>
509 </div>
510 @endforeach
511 @endif
512 </div>
513
514 <div class="cabinet__body-item">
515 <a class="button fit-content" href="{{ route('worker.new_prev_company',['worker' => $worker->id]) }}">
516 Добавить контакт для рекомендации
517 </a>