Commit a67c9d7ef4a8e42af8fdcd3778dffb18791677a0

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

Массовая рассылка сообщений + правки от Марины

Showing 11 changed files with 171 additions and 122 deletions Inline Diff

app/Http/Controllers/EmployerController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Classes\RusDate; 5 use App\Classes\RusDate;
6 use App\Classes\Tools; 6 use App\Classes\Tools;
7 use App\Http\Requests\BaseUser_min_Request; 7 use App\Http\Requests\BaseUser_min_Request;
8 use App\Http\Requests\FlotRequest; 8 use App\Http\Requests\FlotRequest;
9 use App\Http\Requests\MessagesRequiest; 9 use App\Http\Requests\MessagesRequiest;
10 use App\Http\Requests\VacancyRequestEdit; 10 use App\Http\Requests\VacancyRequestEdit;
11 use App\Mail\MailCreateEmployer; 11 use App\Mail\MailCreateEmployer;
12 use App\Mail\MailSotrudnichestvo; 12 use App\Mail\MailSotrudnichestvo;
13 use App\Mail\MassSendingMessages;
13 use App\Mail\SendAllMessages; 14 use App\Mail\SendAllMessages;
14 use App\Models\Ad_employer; 15 use App\Models\Ad_employer;
15 use App\Models\ad_response; 16 use App\Models\ad_response;
16 use App\Models\Category; 17 use App\Models\Category;
17 use App\Models\Chat; 18 use App\Models\Chat;
18 use App\Models\Employer; 19 use App\Models\Employer;
19 use App\Models\Flot; 20 use App\Models\Flot;
20 use App\Models\Job_title; 21 use App\Models\Job_title;
21 use App\Models\Like_worker; 22 use App\Models\Like_worker;
22 use App\Models\Message; 23 use App\Models\Message;
23 use App\Models\Worker; 24 use App\Models\Worker;
25 use App\Models\MessagesRequests;
24 use Carbon\Carbon; 26 use Carbon\Carbon;
25 use Illuminate\Auth\Events\Registered; 27 use Illuminate\Auth\Events\Registered;
26 use Illuminate\Database\Eloquent\Builder; 28 use Illuminate\Database\Eloquent\Builder;
27 use Illuminate\Http\Request; 29 use Illuminate\Http\Request;
28 use Illuminate\Support\Facades\Auth; 30 use Illuminate\Support\Facades\Auth;
29 use Illuminate\Support\Facades\Hash; 31 use Illuminate\Support\Facades\Hash;
30 use Illuminate\Support\Facades\Mail; 32 use Illuminate\Support\Facades\Mail;
31 use Illuminate\Support\Facades\Storage; 33 use Illuminate\Support\Facades\Storage;
32 use App\Models\User as User_Model; 34 use App\Models\User as User_Model;
33 use Illuminate\Support\Facades\Validator; 35 use Illuminate\Support\Facades\Validator;
34 use App\Enums\DbExportColumns; 36 use App\Enums\DbExportColumns;
35 37
36 class EmployerController extends Controller 38 class EmployerController extends Controller
37 { 39 {
38 public function vacancie($vacancy, Request $request) { 40 public function vacancie($vacancy, Request $request) {
39 $title = 'Заголовок вакансии'; 41 $title = 'Заголовок вакансии';
40 $Query = Ad_employer::with('jobs')-> 42 $Query = Ad_employer::with('jobs')->
41 with('cat')-> 43 with('cat')->
42 with('employer')-> 44 with('employer')->
43 with('jobs_code')-> 45 with('jobs_code')->
44 select('ad_employers.*')-> 46 select('ad_employers.*')->
45 where('id', '=', $vacancy)->get(); 47 where('id', '=', $vacancy)->get();
46 48
47 if (isset(Auth()->user()->id)) 49 if (isset(Auth()->user()->id))
48 $uid = Auth()->user()->id; 50 $uid = Auth()->user()->id;
49 else 51 else
50 $uid = 0; 52 $uid = 0;
51 $title = $Query[0]->name; 53 $title = $Query[0]->name;
52 if ($request->ajax()) { 54 if ($request->ajax()) {
53 return view('ajax.vacance-item', compact('Query','uid')); 55 return view('ajax.vacance-item', compact('Query','uid'));
54 } else { 56 } else {
55 return view('vacance-item', compact('title', 'Query', 'uid')); 57 return view('vacance-item', compact('title', 'Query', 'uid'));
56 } 58 }
57 } 59 }
58 60
59 public function logout() { 61 public function logout() {
60 Auth::logout(); 62 Auth::logout();
61 return redirect()->route('index') 63 return redirect()->route('index')
62 ->with('success', 'Вы вышли из личного кабинета'); 64 ->with('success', 'Вы вышли из личного кабинета');
63 } 65 }
64 66
65 public function employer_info() { 67 public function employer_info() {
66 // код юзера 68 // код юзера
67 $user_info = Auth()->user(); 69 $user_info = Auth()->user();
68 // вьюшка для вывода данных 70 // вьюшка для вывода данных
69 return view('employers.info', compact('user_info')); 71 return view('employers.info', compact('user_info'));
70 } 72 }
71 73
72 public function employer_info_save(User_Model $user, BaseUser_min_Request $request) { 74 public function employer_info_save(User_Model $user, BaseUser_min_Request $request) {
73 // Все данные через реквест 75 // Все данные через реквест
74 $all = $request->all(); 76 $all = $request->all();
75 unset($all['_token']); 77 unset($all['_token']);
76 // обновление 78 // обновление
77 $user->update($all); 79 $user->update($all);
78 return redirect()->route('employer.employer_info'); 80 return redirect()->route('employer.employer_info');
79 } 81 }
80 82
81 public function cabinet() { 83 public function cabinet() {
82 $id = Auth()->user()->id; 84 $id = Auth()->user()->id;
83 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 85 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
84 WhereHas('users', 86 WhereHas('users',
85 function (Builder $query) use ($id) {$query->Where('id', $id); 87 function (Builder $query) use ($id) {$query->Where('id', $id);
86 })->get(); 88 })->get();
87 return view('employers.cabinet45', compact('Employer')); 89 return view('employers.cabinet45', compact('Employer'));
88 } 90 }
89 91
90 public function slider_flot() { 92 public function slider_flot() {
91 $id = Auth()->user()->id; 93 $id = Auth()->user()->id;
92 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 94 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
93 WhereHas('users', 95 WhereHas('users',
94 function (Builder $query) use ($id) {$query->Where('id', $id); 96 function (Builder $query) use ($id) {$query->Where('id', $id);
95 })->get(); 97 })->get();
96 return view('employers.fly-flot', compact('Employer')); 98 return view('employers.fly-flot', compact('Employer'));
97 } 99 }
98 100
99 public function cabinet_save(Employer $Employer, Request $request) { 101 public function cabinet_save(Employer $Employer, Request $request) {
100 $params = $request->all(); 102 $params = $request->all();
101 $params['user_id'] = Auth()->user()->id; 103 $params['user_id'] = Auth()->user()->id;
102 $id = $Employer->id; 104 $id = $Employer->id;
103 105
104 if ($request->has('logo')) { 106 if ($request->has('logo')) {
105 if (!empty($Employer->logo)) { 107 if (!empty($Employer->logo)) {
106 Storage::delete($Employer->logo); 108 Storage::delete($Employer->logo);
107 } 109 }
108 $params['logo'] = $request->file('logo')->store("employer/$id", 'public'); 110 $params['logo'] = $request->file('logo')->store("employer/$id", 'public');
109 } 111 }
110 112
111 $Employer->update($params); 113 $Employer->update($params);
112 114
113 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены'); 115 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены');
114 } 116 }
115 117
116 public function save_add_flot(FlotRequest $request) { 118 public function save_add_flot(FlotRequest $request) {
117 // отмена 119 // отмена
118 $params = $request->all(); 120 $params = $request->all();
119 121
120 if ($request->has('image')) { 122 if ($request->has('image')) {
121 $params['image'] = $request->file('image')->store("flot", 'public'); 123 $params['image'] = $request->file('image')->store("flot", 'public');
122 } 124 }
123 Flot::create($params); 125 Flot::create($params);
124 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get(); 126 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get();
125 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); 127 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен');
126 } 128 }
127 129
128 public function edit_flot(Flot $Flot, Employer $Employer) { 130 public function edit_flot(Flot $Flot, Employer $Employer) {
129 return view('employers.edit-flot', compact('Flot', 'Employer')); 131 return view('employers.edit-flot', compact('Flot', 'Employer'));
130 } 132 }
131 133
132 public function update_flot(FlotRequest $request, Flot $Flot) { 134 public function update_flot(FlotRequest $request, Flot $Flot) {
133 $params = $request->all(); 135 $params = $request->all();
134 136
135 if ($request->has('image')) { 137 if ($request->has('image')) {
136 if (!empty($flot->image)) { 138 if (!empty($flot->image)) {
137 Storage::delete($flot->image); 139 Storage::delete($flot->image);
138 } 140 }
139 $params['image'] = $request->file('image')->store("flot", 'public'); 141 $params['image'] = $request->file('image')->store("flot", 'public');
140 } else { 142 } else {
141 if (!empty($flot->image)) $params['image'] = $flot->image; 143 if (!empty($flot->image)) $params['image'] = $flot->image;
142 } 144 }
143 145
144 $Flot->update($params); 146 $Flot->update($params);
145 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); 147 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен');
146 } 148 }
147 149
148 public function delete_flot(Flot $Flot) { 150 public function delete_flot(Flot $Flot) {
149 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get(); 151 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get();
150 152
151 if (isset($Flot->id)) $Flot->delete(); 153 if (isset($Flot->id)) $Flot->delete();
152 return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален'); 154 return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален');
153 } 155 }
154 156
155 // Форма добавления вакансий 157 // Форма добавления вакансий
156 public function cabinet_vacancie() { 158 public function cabinet_vacancie() {
157 $id = Auth()->user()->id; 159 $id = Auth()->user()->id;
158 160
159 if (Auth()->user()->is_public) { 161 if (Auth()->user()->is_public) {
160 $categories = Category::query()->active()->get(); 162 $categories = Category::query()->active()->get();
161 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 163 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
162 where('is_remove', '=', '0')-> 164 where('is_remove', '=', '0')->
163 where('is_bd', '=', '0')-> 165 where('is_bd', '=', '0')->
164 get(); 166 get();
165 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 167 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
166 WhereHas('users', 168 WhereHas('users',
167 function (Builder $query) use ($id) { 169 function (Builder $query) use ($id) {
168 $query->Where('id', $id); 170 $query->Where('id', $id);
169 })->get(); 171 })->get();
170 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories')); 172 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories'));
171 } else { 173 } else {
172 return redirect()->route('employer.cabinet_vacancie_danger'); 174 return redirect()->route('employer.cabinet_vacancie_danger');
173 } 175 }
174 } 176 }
175 177
176 // Форма предупреждения об оплате 178 // Форма предупреждения об оплате
177 public function cabinet_vacancie_danger() { 179 public function cabinet_vacancie_danger() {
178 return view('employers.add_vacancy_danger'); 180 return view('employers.add_vacancy_danger');
179 } 181 }
180 182
181 // Сохранение вакансии 183 // Сохранение вакансии
182 public function cabinet_vacancy_save1(VacancyRequestEdit $request) { 184 public function cabinet_vacancy_save1(VacancyRequestEdit $request) {
183 $params_emp = $request->all(); 185 $params_emp = $request->all();
184 186
185 $params_job["job_title_id"] = $params_emp['job_title_id']; 187 $params_job["job_title_id"] = $params_emp['job_title_id'];
186 //$params_job["min_salary"] = $params_emp['min_salary']; 188 //$params_job["min_salary"] = $params_emp['min_salary'];
187 //$params_job["max_salary"] = $params_emp['max_salary']; 189 //$params_job["max_salary"] = $params_emp['max_salary'];
188 //$params_job["region"] = $params_emp['region']; 190 //$params_job["region"] = $params_emp['region'];
189 //$params_job["power"] = $params_emp['power']; 191 //$params_job["power"] = $params_emp['power'];
190 //$params_job["sytki"] = $params_emp['sytki']; 192 //$params_job["sytki"] = $params_emp['sytki'];
191 //$params_job["start"] = $params_emp['start']; 193 //$params_job["start"] = $params_emp['start'];
192 //$params_job["flot"] = $params_emp['flot']; 194 //$params_job["flot"] = $params_emp['flot'];
193 //$params_job["description"] = $params_emp['description']; 195 //$params_job["description"] = $params_emp['description'];
194 196
195 $ad_jobs = Ad_employer::create($params_emp); 197 $ad_jobs = Ad_employer::create($params_emp);
196 //$params_job['ad_employer_id'] = $ad_jobs->id; 198 //$params_job['ad_employer_id'] = $ad_jobs->id;
197 //Ad_jobs::create($params_job); 199 //Ad_jobs::create($params_job);
198 $ad_jobs->jobs()->sync($request->get('job_title_id')); 200 $ad_jobs->jobs()->sync($request->get('job_title_id'));
199 201
200 return redirect()->route('employer.vacancy_list'); 202 return redirect()->route('employer.vacancy_list');
201 } 203 }
202 204
203 // Список вакансий 205 // Список вакансий
204 public function vacancy_list(Request $request) { 206 public function vacancy_list(Request $request) {
205 $id = Auth()->user()->id; 207 $id = Auth()->user()->id;
206 208
207 //dd($request->all()); 209 //dd($request->all());
208 $Employer = Employer::query()->where('user_id', $id)->first(); 210 $Employer = Employer::query()->where('user_id', $id)->first();
209 $vacancy_list = Ad_employer::query()->with('jobs')-> 211 $vacancy_list = Ad_employer::query()->with('jobs')->
210 with('jobs_code')-> 212 with('jobs_code')->
211 where('employer_id', $Employer->id); 213 where('employer_id', $Employer->id);
212 214
213 if (($request->has('search')) && (!empty($request->get('search')))) { 215 if (($request->has('search')) && (!empty($request->get('search')))) {
214 $search = $request->get('search'); 216 $search = $request->get('search');
215 $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%"); 217 $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%");
216 } 218 }
217 219
218 if ($request->get('sort')) { 220 if ($request->get('sort')) {
219 $sort = $request->get('sort'); 221 $sort = $request->get('sort');
220 switch ($sort) { 222 switch ($sort) {
221 case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break; 223 case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break;
222 case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break; 224 case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break;
223 case 'nopublic': $vacancy_list->where('active_is', '=', 0)->orderBy('id');break; 225 case 'nopublic': $vacancy_list->where('active_is', '=', 0)->orderBy('id');break;
224 case 'public':$vacancy_list->where('active_is', '=', 1)->orderBy('id');break; 226 case 'public':$vacancy_list->where('active_is', '=', 1)->orderBy('id');break;
225 case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break; 227 case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break;
226 case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break; 228 case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break;
227 case 'default': $vacancy_list = $vacancy_list->orderbyDesc('updated_at')->orderBy('name'); break; 229 case 'default': $vacancy_list = $vacancy_list->orderbyDesc('updated_at')->orderBy('name'); break;
228 default: $vacancy_list = $vacancy_list->orderByDesc('id')->orderbyDesc('updated_at'); break; 230 default: $vacancy_list = $vacancy_list->orderByDesc('id')->orderbyDesc('updated_at'); break;
229 } 231 }
230 } else { 232 } else {
231 $vacancy_list = $vacancy_list->orderByDesc('updated_at')->orderBy('id'); 233 $vacancy_list = $vacancy_list->orderByDesc('updated_at')->orderBy('id');
232 } 234 }
233 235
234 $vacancy_list = $vacancy_list->paginate(10); 236 $vacancy_list = $vacancy_list->paginate(10);
235 237
236 //ajax 238 //ajax
237 if ($request->ajax()) { 239 if ($request->ajax()) {
238 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); 240 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer'));
239 } else { 241 } else {
240 return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); 242 return view('employers.list_vacancy', compact('vacancy_list', 'Employer'));
241 } 243 }
242 } 244 }
243 245
244 // Карточка вакансии 246 // Карточка вакансии
245 public function vacancy_edit(Ad_employer $ad_employer) { 247 public function vacancy_edit(Ad_employer $ad_employer) {
246 $id = Auth()->user()->id; 248 $id = Auth()->user()->id;
247 $Positions = Category::query()->where('is_remove', '=', '0')->get(); 249 $Positions = Category::query()->where('is_remove', '=', '0')->get();
248 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 250 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
249 where('is_remove', '=', '0')-> 251 where('is_remove', '=', '0')->
250 where('is_bd', '=', '0')->get(); 252 where('is_bd', '=', '0')->get();
251 253
252 $Employer = Employer::query()->with('users')->with('ads')-> 254 $Employer = Employer::query()->with('users')->with('ads')->
253 with('flots')->where('user_id', $id)->first(); 255 with('flots')->where('user_id', $id)->first();
254 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); 256 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs'));
255 } 257 }
256 258
257 // Сохранение-редактирование записи 259 // Сохранение-редактирование записи
258 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { 260 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) {
259 $params = $request->all(); 261 $params = $request->all();
260 $params_job["job_title_id"] = $params['job_title_id']; 262 $params_job["job_title_id"] = $params['job_title_id'];
261 263
262 $ad_employer->update($params); 264 $ad_employer->update($params);
263 $ad_employer->jobs()->sync($request->get('job_title_id')); 265 $ad_employer->jobs()->sync($request->get('job_title_id'));
264 266
265 $id = Auth()->user()->id; 267 $id = Auth()->user()->id;
266 $Positions = Category::query()->where('is_remove', '=', '0')->get(); 268 $Positions = Category::query()->where('is_remove', '=', '0')->get();
267 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name') 269 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')
268 ->where('is_remove', '=', '0') 270 ->where('is_remove', '=', '0')
269 ->where('is_bd', '=', '0') 271 ->where('is_bd', '=', '0')
270 ->get(); 272 ->get();
271 273
272 $Employer = Employer::query() 274 $Employer = Employer::query()
273 ->with('users')->with('ads')->with('flots')->where('user_id', $id)->first(); 275 ->with('users')->with('ads')->with('flots')->where('user_id', $id)->first();
274 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); 276 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs'));
275 } 277 }
276 278
277 // Сохранение карточки вакансии 279 // Сохранение карточки вакансии
278 public function vacancy_save(Request $request, Ad_employer $ad_employer) { 280 public function vacancy_save(Request $request, Ad_employer $ad_employer) {
279 $all = $request->all(); 281 $all = $request->all();
280 $ad_employer->update($all); 282 $ad_employer->update($all);
281 return redirect()->route('employer.cabinet_vacancie'); 283 return redirect()->route('employer.cabinet_vacancie');
282 } 284 }
283 285
284 // Удаление карточки вакансии 286 // Удаление карточки вакансии
285 public function vacancy_delete(Ad_employer $ad_employer) { 287 public function vacancy_delete(Ad_employer $ad_employer) {
286 $ad_employer->delete(); 288 $ad_employer->delete();
287 289
288 return redirect()->route('employer.vacancy_list') 290 return redirect()->route('employer.vacancy_list')
289 ->with('success', 'Данные были успешно сохранены'); 291 ->with('success', 'Данные были успешно сохранены');
290 } 292 }
291 293
292 // Обновление даты 294 // Обновление даты
293 public function vacancy_up(Ad_employer $ad_employer) { 295 public function vacancy_up(Ad_employer $ad_employer) {
294 $up = date('m/d/Y h:i:s', time());; 296 $up = date('m/d/Y h:i:s', time());;
295 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 297 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
296 $vac_emp->updated_at = $up; 298 $vac_emp->updated_at = $up;
297 $vac_emp->save(); 299 $vac_emp->save();
298 300
299 return redirect()->back(); //route('employer.vacancy_list'); 301 return redirect()->back(); //route('employer.vacancy_list');
300 // начало конца 302 // начало конца
301 } 303 }
302 304
303 //Видимость вакансии 305 //Видимость вакансии
304 public function vacancy_eye(Ad_employer $ad_employer, $status) { 306 public function vacancy_eye(Ad_employer $ad_employer, $status) {
305 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 307 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
306 $vac_emp->active_is = $status; 308 $vac_emp->active_is = $status;
307 $vac_emp->save(); 309 $vac_emp->save();
308 310
309 return redirect()->route('employer.vacancy_list'); 311 return redirect()->route('employer.vacancy_list');
310 } 312 }
311 313
312 //Вакансия редактирования (шаблон) 314 //Вакансия редактирования (шаблон)
313 public function vacancy_update(Ad_employer $id) { 315 public function vacancy_update(Ad_employer $id) {
314 316
315 } 317 }
316 318
317 //Отклики на вакансию - лист 319 //Отклики на вакансию - лист
318 public function answers(Employer $employer, Request $request) { 320 public function answers(Employer $employer, Request $request) {
319 $user_id = Auth()->user()->id; 321 $user_id = Auth()->user()->id;
320 $answer = Ad_employer::query()->where('employer_id', $employer->id); 322 $answer = Ad_employer::query()->where('employer_id', $employer->id);
321 if ($request->has('search')) { 323 if ($request->has('search')) {
322 $search = trim($request->get('search')); 324 $search = trim($request->get('search'));
323 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); 325 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%");
324 } 326 }
325 327
326 $answer = $answer->with('response')->OrderByDESC('id')->get(); 328 $answer = $answer->with('response')->OrderByDESC('id')->get();
327 329
328 return view('employers.list_answer', compact('answer', 'user_id', 'employer')); 330 return view('employers.list_answer', compact('answer', 'user_id', 'employer'));
329 } 331 }
330 332
331 //Обновление статуса 333 //Обновление статуса
332 public function supple_status(employer $employer, ad_response $ad_response, $flag) { 334 public function supple_status(employer $employer, ad_response $ad_response, $flag) {
333 $ad_response->update(Array('flag' => $flag)); 335 $ad_response->update(Array('flag' => $flag));
334 return redirect()->route('employer.answers', ['employer' => $employer->id]); 336 return redirect()->route('employer.answers', ['employer' => $employer->id]);
335 } 337 }
336 338
337 //Страницы сообщений список 339 //Страницы сообщений список
338 public function messages($type_message) { 340 public function messages($type_message) {
339 $user_id = Auth()->user()->id; 341 $user_id = Auth()->user()->id;
340 342
341 $chats = Chat::get_user_chats($user_id); 343 $chats = Chat::get_user_chats($user_id);
342 $user_type = 'employer'; 344 $user_type = 'employer';
343 345
344 return view('employers.messages', compact('chats','user_id', 'user_type')); 346 return view('employers.messages', compact('chats','user_id', 'user_type'));
345 } 347 }
346 348
347 // Диалог между пользователями 349 // Диалог между пользователями
348 public function dialog(Request $request, User_Model $user1, User_Model $user2) { 350 public function dialog(Request $request, User_Model $user1, User_Model $user2) {
349 // Получение параметров. 351 // Получение параметров.
350 if ($request->has('ad_employer')){ 352 if ($request->has('ad_employer')){
351 $ad_employer = $request->get('ad_employer'); 353 $ad_employer = $request->get('ad_employer');
352 } else { 354 } else {
353 $ad_employer = 0; 355 $ad_employer = 0;
354 } 356 }
355 357
356 if (isset($user2->id)) { 358 if (isset($user2->id)) {
357 $companion = User_Model::query()->with('workers')-> 359 $companion = User_Model::query()->with('workers')->
358 with('employers')-> 360 with('employers')->
359 where('id', $user2->id)->first(); 361 where('id', $user2->id)->first();
360 } 362 }
361 363
362 $Messages = Message::query() 364 $Messages = Message::query()
363 ->where(function($query) use ($user1, $user2) { 365 ->where(function($query) use ($user1, $user2) {
364 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); 366 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id);
365 }) 367 })
366 ->orWhere(function($query) use ($user1, $user2) { 368 ->orWhere(function($query) use ($user1, $user2) {
367 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); 369 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id);
368 }) 370 })
369 ->orderBy('created_at') 371 ->orderBy('created_at')
370 ->get() 372 ->get()
371 ; 373 ;
372 374
373 $sender = $user1; 375 $sender = $user1;
374 376
375 Message::where('user_id', '=', $user2->id) 377 Message::where('user_id', '=', $user2->id)
376 ->where('to_user_id', '=', $user1->id) 378 ->where('to_user_id', '=', $user1->id)
377 ->update(['flag_new' => 0]) 379 ->update(['flag_new' => 0])
378 ; 380 ;
379 381
380 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages')); 382 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages'));
381 } 383 }
382 384
383 public function pin_chat(Request $request){ 385 public function pin_chat(Request $request){
384 $chat_id = $request->get('id'); 386 $chat_id = $request->get('id');
385 $is_fixed = $request->get('is_fixed'); 387 $is_fixed = $request->get('is_fixed');
386 388
387 Chat::pin_chat($chat_id, $is_fixed); 389 Chat::pin_chat($chat_id, $is_fixed);
388 } 390 }
389 391
390 public function remove_chat(Request $request){ 392 public function remove_chat(Request $request){
391 $chat_id = $request->get('id'); 393 $chat_id = $request->get('id');
392 Chat::remove_chat($chat_id); 394 Chat::remove_chat($chat_id);
393 } 395 }
394 396
395 // Регистрация работодателя 397 // Регистрация работодателя
396 public function register_employer(Request $request) { 398 public function register_employer(Request $request) {
397 $params = $request->all(); 399 $params = $request->all();
398 400
399 $rules = [ 401 $rules = [
400 //'surname' => ['required', 'string', 'max:255'], 402 //'surname' => ['required', 'string', 'max:255'],
401 //'name_man' => ['required', 'string', 'max:255'], 403 //'name_man' => ['required', 'string', 'max:255'],
402 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 404 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
403 'name_company' => ['required', 'string', 'max:255'], 405 'name_company' => ['required', 'string', 'max:255'],
404 'password' => ['required', 'string', 'min:6'], 406 'password' => ['required', 'string', 'min:6'],
405 ]; 407 ];
406 408
407 409
408 $messages = [ 410 $messages = [
409 'required' => 'Укажите обязательное поле', 411 'required' => 'Укажите обязательное поле',
410 'min' => [ 412 'min' => [
411 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 413 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
412 'integer' => 'Поле «:attribute» должно быть :min или больше', 414 'integer' => 'Поле «:attribute» должно быть :min или больше',
413 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 415 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
414 ], 416 ],
415 'max' => [ 417 'max' => [
416 'string' => 'Поле «:attribute» должно быть не больше :max символов', 418 'string' => 'Поле «:attribute» должно быть не больше :max символов',
417 'integer' => 'Поле «:attribute» должно быть :max или меньше', 419 'integer' => 'Поле «:attribute» должно быть :max или меньше',
418 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 420 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
419 ] 421 ]
420 ]; 422 ];
421 423
422 $email = $request->get('email'); 424 $email = $request->get('email');
423 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { 425 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) {
424 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); 426 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл"));
425 } 427 }
426 428
427 if ($request->get('password') !== $request->get('confirmed')){ 429 if ($request->get('password') !== $request->get('confirmed')){
428 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 430 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
429 } 431 }
430 432
431 if (strlen($request->get('password')) < 6) { 433 if (strlen($request->get('password')) < 6) {
432 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); 434 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
433 } 435 }
434 436
435 if (empty($request->get('surname'))) { 437 if (empty($request->get('surname'))) {
436 $params['surname'] = 'Неизвестно'; 438 $params['surname'] = 'Неизвестно';
437 } 439 }
438 if (empty($request->get('name_man'))) { 440 if (empty($request->get('name_man'))) {
439 $params['name_man'] = 'Неизвестно'; 441 $params['name_man'] = 'Неизвестно';
440 } 442 }
441 $validator = Validator::make($params, $rules, $messages); 443 $validator = Validator::make($params, $rules, $messages);
442 444
443 if ($validator->fails()) { 445 if ($validator->fails()) {
444 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 446 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
445 } else { 447 } else {
446 $user = $this->create($params); 448 $user = $this->create($params);
447 event(new Registered($user)); 449 event(new Registered($user));
448 450
449 Mail::to(env('EMAIL_ADMIN'))->send(new MailCreateEmployer($params)); 451 Mail::to(env('EMAIL_ADMIN'))->send(new MailCreateEmployer($params));
450 452
451 Auth::guard()->login($user); 453 Auth::guard()->login($user);
452 } 454 }
453 455
454 if ($user) { 456 if ($user) {
455 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; 457 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));;
456 } else { 458 } else {
457 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 459 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
458 } 460 }
459 } 461 }
460 462
461 // Создание пользователя 463 // Создание пользователя
462 protected function create(array $data) 464 protected function create(array $data)
463 { 465 {
464 $Use = new User_Model(); 466 $Use = new User_Model();
465 $Code_user = $Use->create([ 467 $Code_user = $Use->create([
466 'name' => $data['surname']." ".$data['name_man'], 468 'name' => $data['surname']." ".$data['name_man'],
467 'name_man' => $data['name_man'], 469 'name_man' => $data['name_man'],
468 'surname' => $data['surname'], 470 'surname' => $data['surname'],
469 'surname2' => $data['surname2'], 471 'surname2' => $data['surname2'],
470 'subscribe_email' => $data['email'], 472 'subscribe_email' => $data['email'],
471 'email' => $data['email'], 473 'email' => $data['email'],
472 'telephone' => $data['telephone'], 474 'telephone' => $data['telephone'],
473 'is_worker' => 0, 475 'is_worker' => 0,
474 'password' => Hash::make($data['password']), 476 'password' => Hash::make($data['password']),
475 'pubpassword' => base64_encode($data['password']), 477 'pubpassword' => base64_encode($data['password']),
476 'email_verified_at' => Carbon::now() 478 'email_verified_at' => Carbon::now()
477 ]); 479 ]);
478 480
479 if ($Code_user->id > 0) { 481 if ($Code_user->id > 0) {
480 $Employer = new Employer(); 482 $Employer = new Employer();
481 $Employer->user_id = $Code_user->id; 483 $Employer->user_id = $Code_user->id;
482 $Employer->name_company = $data['name_company']; 484 $Employer->name_company = $data['name_company'];
483 $Employer->email = $data['email']; 485 $Employer->email = $data['email'];
484 $Employer->telephone = $data['telephone']; 486 $Employer->telephone = $data['telephone'];
485 $Employer->code = Tools::generator_id(10); 487 $Employer->code = Tools::generator_id(10);
486 $Employer->save(); 488 $Employer->save();
487 489
488 return $Code_user; 490 return $Code_user;
489 } 491 }
490 } 492 }
491 493
492 // Отправка сообщения от работодателя 494 // Отправка сообщения от работодателя
493 public function send_message(MessagesRequiest $request) { 495 public function send_message(MessagesRequiest $request) {
494 $params = $request->all(); 496 $params = $request->all();
495 dd($params); 497 dd($params);
496 $user1 = $params['user_id']; 498 $user1 = $params['user_id'];
497 $user2 = $params['to_user_id']; 499 $user2 = $params['to_user_id'];
498 500
499 if ($request->has('file')) { 501 if ($request->has('file')) {
500 $params['file'] = $request->file('file')->store("messages", 'public'); 502 $params['file'] = $request->file('file')->store("messages", 'public');
501 } 503 }
502 Message::create($params); 504 Message::create($params);
503 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 505 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
504 } 506 }
505 507
506 public function test123(Request $request) { 508 public function test123(Request $request) {
507 $params = $request->all(); 509 $params = $request->all();
508 $user1 = $params['user_id']; 510 $user1 = $params['user_id'];
509 $user2 = $params['to_user_id']; 511 $user2 = $params['to_user_id'];
510 $id_vacancy = $params['ad_employer_id']; 512 $id_vacancy = $params['ad_employer_id'];
511 $ad_name = $params['ad_name']; 513 $ad_name = $params['ad_name'];
512 514
513 $rules = [ 515 $rules = [
514 'text' => 'required|min:1|max:150000', 516 'text' => 'required|min:1|max:150000',
515 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' 517 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000'
516 ]; 518 ];
517 $messages = [ 519 $messages = [
518 'required' => 'Укажите обязательное поле', 520 'required' => 'Укажите обязательное поле',
519 'min' => [ 521 'min' => [
520 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 522 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
521 'integer' => 'Поле «:attribute» должно быть :min или больше', 523 'integer' => 'Поле «:attribute» должно быть :min или больше',
522 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 524 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
523 ], 525 ],
524 'max' => [ 526 'max' => [
525 'string' => 'Поле «:attribute» должно быть не больше :max символов', 527 'string' => 'Поле «:attribute» должно быть не больше :max символов',
526 'integer' => 'Поле «:attribute» должно быть :max или меньше', 528 'integer' => 'Поле «:attribute» должно быть :max или меньше',
527 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 529 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
528 ] 530 ]
529 ]; 531 ];
530 532
531 $validator = Validator::make($request->all(), $rules, $messages); 533 $validator = Validator::make($request->all(), $rules, $messages);
532 534
533 /*if ($validator->fails()) { 535 /*if ($validator->fails()) {
534 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) 536 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2])
535 ->withErrors($validator); 537 ->withErrors($validator);
536 } else { 538 } else {
537 if ($request->has('file')) { 539 if ($request->has('file')) {
538 $params['file'] = $request->file('file')->store("messages", 'public'); 540 $params['file'] = $request->file('file')->store("messages", 'public');
539 } 541 }
540 Message::create($params); 542 Message::create($params);
541 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 543 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
542 return redirect()->route('employer.dialog', 544 return redirect()->route('employer.dialog',
543 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]); 545 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]);
544 546
545 }*/ 547 }*/
546 548
547 if ($validator->fails()) { 549 if ($validator->fails()) {
548 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) 550 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2])
549 ->withErrors($validator); 551 ->withErrors($validator);
550 } else { 552 } else {
551 Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages'); 553 Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages');
552 554
553 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 555 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
554 return redirect()->route('employer.dialog', 556 return redirect()->route('employer.dialog',
555 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]); 557 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]);
556 558
557 } 559 }
558 } 560 }
559 561
560 //Избранные люди 562 //Избранные люди
561 public function favorites(Request $request) { 563 public function favorites(Request $request) {
562 $IP_address = RusDate::ip_addr_client(); 564 $IP_address = RusDate::ip_addr_client();
563 $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); 565 $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get();
564 566
565 if ($Arr->count()) { 567 if ($Arr->count()) {
566 $A = Array(); 568 $A = Array();
567 foreach ($Arr as $it) { 569 foreach ($Arr as $it) {
568 $A[] = $it->code_record; 570 $A[] = $it->code_record;
569 } 571 }
570 572
571 $Workers = Worker::query()->whereIn('id', $A); 573 $Workers = Worker::query()->whereIn('id', $A);
572 } else { 574 } else {
573 $Workers = Worker::query()->where('id', '=', '0'); 575 $Workers = Worker::query()->where('id', '=', '0');
574 } 576 }
575 577
576 if (($request->has('search')) && (!empty($request->get('search')))) { 578 if (($request->has('search')) && (!empty($request->get('search')))) {
577 $search = $request->get('search'); 579 $search = $request->get('search');
578 580
579 $Workers = $Workers->WhereHas('users', 581 $Workers = $Workers->WhereHas('users',
580 function (Builder $query) use ($search) { 582 function (Builder $query) use ($search) {
581 $query->Where('surname', 'LIKE', "%$search%") 583 $query->Where('surname', 'LIKE', "%$search%")
582 ->orWhere('name_man', 'LIKE', "%$search%") 584 ->orWhere('name_man', 'LIKE', "%$search%")
583 ->orWhere('surname2', 'LIKE', "%$search%"); 585 ->orWhere('surname2', 'LIKE', "%$search%");
584 }); 586 });
585 } else { 587 } else {
586 $Workers = $Workers->with('users'); 588 $Workers = $Workers->with('users');
587 } 589 }
588 590
589 $Workers = $Workers->get(); 591 $Workers = $Workers->get();
590 592
591 593
592 return view('employers.favorite', compact('Workers')); 594 return view('employers.favorite', compact('Workers'));
593 } 595 }
594 596
595 // База данных 597 // База данных
596 public function bd(Request $request) { 598 public function bd(Request $request) {
597 $users = User_Model::query()->with('workers')->with('jobtitles'); 599 $users = User_Model::query()->with('workers')->with('jobtitles');
598 600
599 if ($request->has('search')) { 601 if ($request->has('search')) {
600 $find_key = $request->get('search'); 602 $find_key = $request->get('search');
601 $users = $users->where('name', 'LIKE', "%$find_key%") 603 $users = $users->where('name', 'LIKE', "%$find_key%")
602 ->orWhere('surname', 'LIKE', "%$find_key%") 604 ->orWhere('surname', 'LIKE', "%$find_key%")
603 ->orWhere('name_man', 'LIKE', "%$find_key%") 605 ->orWhere('name_man', 'LIKE', "%$find_key%")
604 ->orWhere('email', 'LIKE', "%$find_key%") 606 ->orWhere('email', 'LIKE', "%$find_key%")
605 ->orWhere('telephone', 'LIKE', "%$find_key%"); 607 ->orWhere('telephone', 'LIKE', "%$find_key%");
606 } 608 }
607 609
608 // Данные 610 // Данные
609 $users = $users->Baseuser()-> 611 $users = $users->Baseuser()->
610 orderByDesc(Worker::select('created_at')->whereColumn('workers.user_id', 'users.id')); 612 orderByDesc(Worker::select('created_at')->whereColumn('workers.user_id', 'users.id'));
611 $count_users = $users; 613 $count_users = $users;
612 $users = $users->paginate(5); 614 $users = $users->paginate(5);
613 615
614 $export_options = DbExportColumns::toArray(); 616 $export_options = DbExportColumns::toArray();
615 617
616 $jobs_titles = Job_title::select('id', 'name') 618 $jobs_titles = Job_title::select('id', 'name')
617 ->where('is_remove', '=', 0) 619 ->where('is_remove', '=', 0)
618 ->where('is_bd', '=', 2) 620 ->where('is_bd', '=', 2)
619 ->orderByDesc('sort') 621 ->orderByDesc('sort')
620 ->orderBy('name', 'asc') 622 ->orderBy('name', 'asc')
621 ->get() 623 ->get()
622 ->toArray() 624 ->toArray()
623 ; 625 ;
624 626
625 return view('employers.bd', compact('users', 'count_users', 'export_options', 'jobs_titles')); 627 return view('employers.bd', compact('users', 'count_users', 'export_options', 'jobs_titles'));
626 } 628 }
627 629
628 //Настройка уведомлений 630 //Настройка уведомлений
629 public function subscribe() { 631 public function subscribe() {
630 return view('employers.subcribe'); 632 return view('employers.subcribe');
631 } 633 }
632 634
633 //Установка уведомлений сохранение 635 //Установка уведомлений сохранение
634 public function save_subscribe(Request $request) { 636 public function save_subscribe(Request $request) {
635 dd($request->all()); 637 dd($request->all());
636 $msg = $request->validate([ 638 $msg = $request->validate([
637 'subscribe_email' => 'required|email|min:5|max:255', 639 'subscribe_email' => 'required|email|min:5|max:255',
638 ]); 640 ]);
639 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); 641 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку');
640 } 642 }
641 643
642 //Сбросить форму с паролем 644 //Сбросить форму с паролем
643 public function password_reset() { 645 public function password_reset() {
644 $email = Auth()->user()->email; 646 $email = Auth()->user()->email;
645 return view('employers.password-reset', compact('email')); 647 return view('employers.password-reset', compact('email'));
646 } 648 }
647 649
648 //Обновление пароля 650 //Обновление пароля
649 public function new_password(Request $request) { 651 public function new_password(Request $request) {
650 $use = Auth()->user(); 652 $use = Auth()->user();
651 $request->validate([ 653 $request->validate([
652 'password' => 'required|string', 654 'password' => 'required|string',
653 'new_password' => 'required|string', 655 'new_password' => 'required|string',
654 'new_password2' => 'required|string' 656 'new_password2' => 'required|string'
655 ]); 657 ]);
656 658
657 if ($request->get('new_password') == $request->get('new_password2')) 659 if ($request->get('new_password') == $request->get('new_password2'))
658 if ($request->get('password') !== $request->get('new_password')) { 660 if ($request->get('password') !== $request->get('new_password')) {
659 $credentials = $request->only('email', 'password'); 661 $credentials = $request->only('email', 'password');
660 if (Auth::attempt($credentials)) { 662 if (Auth::attempt($credentials)) {
661 663
662 if (!is_null($use->email_verified_at)){ 664 if (!is_null($use->email_verified_at)){
663 665
664 $user_data = User_Model::find($use->id); 666 $user_data = User_Model::find($use->id);
665 $user_data->update([ 667 $user_data->update([
666 'password' => Hash::make($request->get('new_password')), 668 'password' => Hash::make($request->get('new_password')),
667 'pubpassword' => base64_encode($request->get('new_password')), 669 'pubpassword' => base64_encode($request->get('new_password')),
668 ]); 670 ]);
669 return redirect() 671 return redirect()
670 ->route('employer.password_reset') 672 ->route('employer.password_reset')
671 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 673 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
672 } 674 }
673 675
674 return redirect() 676 return redirect()
675 ->route('employer.password_reset') 677 ->route('employer.password_reset')
676 ->withError('Данная учетная запись не было верифицированна!'); 678 ->withError('Данная учетная запись не было верифицированна!');
677 } 679 }
678 } 680 }
679 681
680 return redirect() 682 return redirect()
681 ->route('employer.password_reset') 683 ->route('employer.password_reset')
682 ->withErrors('Не совпадение данных, обновите пароли!'); 684 ->withErrors('Не совпадение данных, обновите пароли!');
683 } 685 }
684 686
685 687
686 688
687 // Форма Удаление пипла 689 // Форма Удаление пипла
688 public function delete_people() { 690 public function delete_people() {
689 $login = Auth()->user()->email; 691 $login = Auth()->user()->email;
690 return view('employers.delete_people', compact('login')); 692 return view('employers.delete_people', compact('login'));
691 } 693 }
692 694
693 // Удаление аккаунта 695 // Удаление аккаунта
694 public function action_delete_user(Request $request) { 696 public function action_delete_user(Request $request) {
695 $Answer = $request->all(); 697 $Answer = $request->all();
696 $user_id = Auth()->user()->id; 698 $user_id = Auth()->user()->id;
697 $request->validate([ 699 $request->validate([
698 'password' => 'required|string', 700 'password' => 'required|string',
699 ]); 701 ]);
700 702
701 $credentials = $request->only('email', 'password'); 703 $credentials = $request->only('email', 'password');
702 if (Auth::attempt($credentials)) { 704 if (Auth::attempt($credentials)) {
703 Auth::logout(); 705 Auth::logout();
704 $it = User_Model::find($user_id); 706 $it = User_Model::find($user_id);
705 $it->delete(); 707 $it->delete();
706 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 708 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
707 } else { 709 } else {
708 return redirect()->route('employer.delete_people') 710 return redirect()->route('employer.delete_people')
709 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 711 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
710 } 712 }
711 } 713 }
712 714
713 public function ajax_delete_user(Request $request) { 715 public function ajax_delete_user(Request $request) {
714 $Answer = $request->all(); 716 $Answer = $request->all();
715 $user_id = Auth()->user()->id; 717 $user_id = Auth()->user()->id;
716 $request->validate([ 718 $request->validate([
717 'password' => 'required|string', 719 'password' => 'required|string',
718 ]); 720 ]);
719 $credentials = $request->only('email', 'password'); 721 $credentials = $request->only('email', 'password');
720 if (Auth::attempt($credentials)) { 722 if (Auth::attempt($credentials)) {
721 723
722 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', 724 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт',
723 'email' => $request->get('email'), 725 'email' => $request->get('email'),
724 'password' => $request->get('password'))); 726 'password' => $request->get('password')));
725 } else { 727 } else {
726 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); 728 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль'));
727 } 729 }
728 } 730 }
729 731
730 // FAQ - Вопросы/ответы для работодателей и соискателей 732 // FAQ - Вопросы/ответы для работодателей и соискателей
731 public function faq() { 733 public function faq() {
732 return view('employers.faq'); 734 return view('employers.faq');
733 } 735 }
734 736
735 // Рассылка сообщений 737 // Рассылка сообщений
736 public function send_all_messages() { 738 public function send_all_messages() {
737 $id = Auth()->user()->id; 739 $id = Auth()->user()->id;
738 $sending = Employer::query()->where('user_id', '=', "$id")->first(); 740 $sending = Employer::query()->where('user_id', '=', "$id")->first();
741
742 $job_titles = Job_title::query()
743 ->where('is_remove', '=', 0)
744 ->where('is_bd', '=', 1)
745 ->orderByDesc('sort')
746 ->get()
747 ;
748
739 if ($sending->sending_is) 749 if ($sending->sending_is)
740 return view('employers.send_all'); 750 return view('employers.send_all', compact('job_titles'));
741 else 751 else
742 return view('employers.send_all_danger'); 752 return view('employers.send_all_danger');
743 } 753 }
744 754
745 // Отправка сообщений для информации 755 // Отправка сообщений для информации
746 public function send_all_post(Request $request) { 756 public function send_all_post(Request $request) {
747 $data = $request->all(); 757 $data = $request->all();
758 $data['user'] = Auth()->user();
748 759
749 $emails = User_Model::query()->where('is_worker', '1')->get(); 760 $id = MessagesRequests::create([
761 'user_id' => Auth()->user()->id,
762 'job_titles' => json_encode($data['job_title_ids']),
763 'text' => $data['message_text'],
764 ]);
765
766 if (!empty($id)){
767 Mail::to(env('EMAIL_ADMIN'))->send(new MassSendingMessages($data));
768 }
769
770 /*$emails = User_Model::query()->where('is_worker', '1')->get();
750 771
751 foreach ($emails as $e) { 772 foreach ($emails as $e) {
752 Mail::to($e->email)->send(new SendAllMessages($data)); 773 Mail::to($e->email)->send(new SendAllMessages($data));
753 } 774 }*/
754 775
755 return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); 776 return redirect()->route('employer.send_all_messages')->with('success', 'Запрос на рассылку был успешно отправлен.');
756 } 777 }
757 778
758 // База резюме 779 // База резюме
759 public function bd_tupe(Request $request) { 780 public function bd_tupe(Request $request) {
760 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); 781 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get();
761 782
762 return view('employers.bd_tupe', compact('Resume')); 783 return view('employers.bd_tupe', compact('Resume'));
763 } 784 }
764 785
765 ////////////////////////////////////////////////////////////////// 786 //////////////////////////////////////////////////////////////////
766 // Отправил сообщение 787 // Отправил сообщение
767 ////////////////////////////////////////////////////////////////// 788 //////////////////////////////////////////////////////////////////
768 public function new_message(Request $request) { 789 public function new_message(Request $request) {
769 $params = $request->all(); 790 $params = $request->all();
770 791
771 $id = $params['_user_id']; 792 $id = $params['_user_id'];
772 $message_params = [ 793 $message_params = [
773 'title' => $params['title'], 794 'title' => $params['title'],
774 'text' => $params['text'], 795 'text' => $params['text'],
775 'ad_employer_id' => $params['_vacancy'], 796 'ad_employer_id' => $params['_vacancy'],
776 'flag_new' => 1 797 'flag_new' => 1
777 ]; 798 ];
778 799
779 Message::add_message( 800 Message::add_message(
780 $request, 801 $request,
781 $params['_user_id'], 802 $params['_user_id'],
782 $params['_to_user_id'], 803 $params['_to_user_id'],
783 $message_params, 804 $message_params,
784 file_store_path: "worker/$id" 805 file_store_path: "worker/$id"
785 ); 806 );
786 807
787 return redirect()->route('employer.messages', ['type_message' => 'output']); 808 return redirect()->route('employer.messages', ['type_message' => 'output']);
788 } 809 }
789 810
790 // Восстановление пароля 811 // Восстановление пароля
791 public function repair_password(Request $request) { 812 public function repair_password(Request $request) {
792 $params = $request->get('email'); 813 $params = $request->get('email');
793 } 814 }
794 815
795 // Избранные люди на корабль 816 // Избранные люди на корабль
796 public function selected_people(Request $request) { 817 public function selected_people(Request $request) {
797 $id = $request->get('id'); 818 $id = $request->get('id');
798 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 819 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
799 where('is_remove', '=', '0')-> 820 where('is_remove', '=', '0')->
800 where('is_bd', '=', '0')-> 821 where('is_bd', '=', '0')->
801 where('position_id', $id)-> 822 where('position_id', $id)->
802 get(); 823 get();
803 return view('favorite_people', compact('favorite_people')); 824 return view('favorite_people', compact('favorite_people'));
804 } 825 }
805 } 826 }
806 827
app/Mail/MassSendingMessages.php
File was created 1 <?php
2
3 namespace App\Mail;
4
5 use App\Models\User;
6 use Illuminate\Bus\Queueable;
7 use Illuminate\Contracts\Queue\ShouldQueue;
8 use Illuminate\Mail\Mailable;
9 use Illuminate\Mail\Mailables\Address;
10 use Illuminate\Mail\Mailables\Content;
11 use Illuminate\Mail\Mailables\Envelope;
12 use Illuminate\Queue\SerializesModels;
13
14 class MassSendingMessages extends Mailable
15 {
16 use Queueable, SerializesModels;
17
18 protected $data;
19
20 public function __construct($data)
21 {
22 $this->data = $data;
23 }
24
25 public function envelope(): Envelope
26 {
27 return new Envelope(
28 subject: 'Запрос на рассылку сообщений',
29 );
30 }
31
32 public function build()
33 {
34
35 // Вернуть все данные
36 return $this->view('emails.added_mass_sending_messages', ['data' => $this->data]);
37 }
38
39
40 public function attachments(): array
41 {
42 return [];
43 }
44 }
45
app/Models/MessagesRequests.php
File was created 1 <?php
2
3 namespace App\Models;
4
5 use Illuminate\Database\Eloquent\Factories\HasFactory;
6 use Illuminate\Database\Eloquent\Model;
7
8 class MessagesRequests extends Model
9 {
10 use HasFactory;
11
12 protected $fillable = [
13 'user_id',
14 'job_titles',
15 'text',
16 'is_rejected',
17 'is_sent'
18 ];
19 }
20
database/migrations/2024_08_05_094303_create_message_requests_table.php
File was created 1 <?php
2
3 use Illuminate\Database\Migrations\Migration;
4 use Illuminate\Database\Schema\Blueprint;
5 use Illuminate\Support\Facades\Schema;
6
7 return new class extends Migration
8 {
9 /**
10 * Run the migrations.
11 *
12 * @return void
13 */
14 public function up()
15 {
16 Schema::create('messages_requests', function (Blueprint $table) {
17 $table->id();
18 $table->bigInteger('user_id')->nullable(false);
19 $table->text('job_titles')->nullable(false);
20 $table->text('text')->nullable();
21 $table->dateTime('is_rejected')->nullable(true);
22 $table->dateTime('is_sent')->nullable(true);
23 $table->timestamps();
24 });
25 }
26
27 /**
28 * Reverse the migrations.
29 *
30 * @return void
31 */
32 public function down()
33 {
34 Schema::dropIfExists('messages_requests');
35 }
36 };
37
resources/views/emails/added_mass_sending_messages.blade.php
File was created 1 <div>
2 Добавлен новый запрос на рассылку от "{{ $data['user']->name }}".
3 </div>
4
resources/views/employers/send_all.blade.php
1 @extends('layout.frontend', ['title' => 'Рассылка сообщений - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Рассылка сообщений - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 4
5 @endsection 5 @endsection
6 6
7 @section('content') 7 @section('content')
8 <section class="cabinet"> 8 <section class="cabinet">
9 <div class="container"> 9 <div class="container">
10 <ul class="breadcrumbs cabinet__breadcrumbs"> 10 <ul class="breadcrumbs cabinet__breadcrumbs">
11 <li><a href="{{ route('index') }}">Главная</a></li> 11 <li><a href="{{ route('index') }}">Главная</a></li>
12 <li><b>Личный кабинет</b></li> 12 <li><b>Личный кабинет</b></li>
13 </ul> 13 </ul>
14 <div class="cabinet__wrapper"> 14 <div class="cabinet__wrapper">
15 <div class="cabinet__side"> 15 <div class="cabinet__side">
16 <div class="cabinet__side-toper"> 16 <div class="cabinet__side-toper">
17 @include('employers.emblema') 17 @include('employers.emblema')
18 </div> 18 </div>
19 19
20 @include('employers.menu', ['item' => 9]) 20 @include('employers.menu', ['item' => 9])
21 </div> 21 </div>
22 22
23 <form class="cabinet__body" action="{{ route('employer.send_all_post') }}" method="POST"> 23 <form class="cabinet__body" action="{{ route('employer.send_all_post') }}" method="POST">
24 @csrf 24 @csrf
25 <div class="cabinet__body-item"> 25 <div class="cabinet__body-item">
26 <div class="cabinet__descr"> 26 <div class="cabinet__descr">
27 <h2 class="title cabinet__title">Рассылка сообщений</h2> 27 <h2 class="title cabinet__title">Рассылка сообщений</h2>
28 @include('messages_error') 28 @include('messages_error')
29 <p class="cabinet__text"><b>Контактные данные</b></p>
30 <p class="cabinet__text">Все поля обязательны для заполнения *</p>
31 </div>
32 <div class="cabinet__inputs">
33 <div class="cabinet__inputs-item form-group">
34 <label class="form-group__label">Название судоходной компании</label>
35 <div class="form-group__item">
36 <input type="text" class="input" name="name_company" placeholder="ООО Река Море" value="{{ old('name_company') ?? $Employer[0]->name_company }}" required>
37 </div>
38 </div>
39
40 <div class="cabinet__inputs-item form-group">
41 <label class="form-group__label">Электронная почта</label>
42 <div class="form-group__item">
43 <input type="email" class="input" name="email" placeholder="info@rekamore.su" value="{{ old('email') ?? $Employer[0]->email }}" required>
44 </div>
45 </div>
46
47 <div class="cabinet__inputs-item form-group">
48 <label class="form-group__label">Номер телефона</label>
49 <div class="form-group__item">
50 <input type="tel" class="input" name="telephone" placeholder="+7 (___) ___-__-__" value="{{ old('telephone') ?? $Employer[0]->telephone }}" required>
51 </div>
52 </div>
53
54 <div class="cabinet__inputs-item form-group">
55 <label class="form-group__label">Адрес (Город)</label>
56 <div class="form-group__item">
57 <input type="text" class="input" name="city" placeholder="Мурманск" value="{{ old('city') ?? $Employer[0]->city }}" required>
58 </div>
59 </div>
60
61 <!--<div class="cabinet__inputs-item form-group">
62 <label class="form-group__label">Адрес компании</label>
63 <div class="form-group__item">
64 <div class="select">
65 <select class="js-select2">
66 <option selected disabled>Выберите должность из списка</option>
67 <option>Вариант 1</option>
68 <option>Вариант 2</option>
69 <option>Вариант 3</option>
70 <option>Вариант 4</option>
71 <option>Вариант 5</option>
72 <option>Вариант 6</option>
73 </select>
74 </div>
75 </div>
76 </div>-->
77 </div> 29 </div>
78 </div> 30 </div>
79 31
80 <div class="cabinet__body-item"> 32 <div class="cabinet__body-item">
81 <div class="cabinet__descr">
82 <p class="cabinet__text"><b>Ваше сообщение</b></p>
83 </div>
84 <div class="cabinet__inputs"> 33 <div class="cabinet__inputs">
85 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 34 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
86 <label class="form-group__label">Тема сообщения</label> 35 <label class="form-group__label">Выберите должность</label>
87 <div class="form-group__item"> 36 <div class="form-group__item">
88 <input type="text" name="text_sms" class="input" value="{{ old('text_sms') ?? '' }}" required> 37 <div class="select">
38 <select class="js-select2" name="job_title_ids[]" id="job_title_ids[]" multiple="multiple">
39 @if ($job_titles->count())
40 @foreach($job_titles as $job_title)
41 <option value="{{ $job_title->id }}">{{ $job_title->name }}</option>
42 @endforeach
43 @endif
44 </select>
45 </div>
89 </div> 46 </div>
90 </div> 47 </div>
91 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 48 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
92 <label class="form-group__label">О компании (Приглашение)</label> 49 <label class="form-group__label">Введите текст сообщения</label>
93 <div class="form-group__item"> 50 <div class="form-group__item">
94 <textarea class="textarea" name="message_text" required>{{ old('message_text') ?? '' }}</textarea> 51 <textarea class="textarea" name="message_text" required>{{ old('message_text') ?? '' }}</textarea>
95 </div> 52 </div>
96 </div> 53 </div>
97 </div> 54 </div>
98 <button type="submit" class="button cabinet__submit">Отправить</button> 55 <button type="submit" class="button cabinet__submit">Отправить</button>
99 </div> 56 </div>
100 </form> 57 </form>
resources/views/info_company_new.blade.php
1 @extends('layout.frontend', ['title' => 'Описание компании '.$title.'- РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Описание компании '.$title.'- РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 console.log('Test system'); 5 console.log('Test system');
6 $(document).on('change', '#sort_ajax', function() { 6 $(document).on('change', '#sort_ajax', function() {
7 var this_ = $(this); 7 var this_ = $(this);
8 var val_ = this_.val(); 8 var val_ = this_.val();
9 console.log('sort items '+val_); 9 console.log('sort items '+val_);
10 10
11 $.ajax({ 11 $.ajax({
12 type: "GET", 12 type: "GET",
13 url: "{{ route('shipping_companies') }}", 13 url: "{{ route('shipping_companies') }}",
14 data: "sort="+val_+"&block=1", 14 data: "sort="+val_+"&block=1",
15 success: function (data) { 15 success: function (data) {
16 console.log('Выбор сортировки'); 16 console.log('Выбор сортировки');
17 console.log(data); 17 console.log(data);
18 $('#block_1').html(data); 18 $('#block_1').html(data);
19 }, 19 },
20 headers: { 20 headers: {
21 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 21 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
22 }, 22 },
23 error: function (data) { 23 error: function (data) {
24 data = JSON.stringify(data); 24 data = JSON.stringify(data);
25 console.log('Error: ' + data); 25 console.log('Error: ' + data);
26 } 26 }
27 }); 27 });
28 28
29 $.ajax({ 29 $.ajax({
30 type: "GET", 30 type: "GET",
31 url: "{{ route('shipping_companies') }}", 31 url: "{{ route('shipping_companies') }}",
32 data: "sort="+val_+"&block=2", 32 data: "sort="+val_+"&block=2",
33 success: function (data) { 33 success: function (data) {
34 console.log('Выбор сортировки2'); 34 console.log('Выбор сортировки2');
35 console.log(data); 35 console.log(data);
36 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 36 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
37 $('#block_2').html(data); 37 $('#block_2').html(data);
38 }, 38 },
39 headers: { 39 headers: {
40 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 40 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
41 }, 41 },
42 error: function (data) { 42 error: function (data) {
43 data = JSON.stringify(data); 43 data = JSON.stringify(data);
44 console.log('Error: ' + data); 44 console.log('Error: ' + data);
45 } 45 }
46 }); 46 });
47 }); 47 });
48 48
49 $(document).ready(function(){ 49 $(document).ready(function(){
50 var sel = $('#select2-sort_ajax-container'); 50 var sel = $('#select2-sort_ajax-container');
51 var key = getUrlParameter('sort'); 51 var key = getUrlParameter('sort');
52 if (key !=='') { 52 if (key !=='') {
53 console.log(key); 53 console.log(key);
54 switch (key) { 54 switch (key) {
55 case "default": sel.html('Сортировка (по умолчанию)'); break; 55 case "default": sel.html('Сортировка (по умолчанию)'); break;
56 case "name_up": sel.html('По имени (возрастание)'); break; 56 case "name_up": sel.html('По имени (возрастание)'); break;
57 case "name_down": sel.html('По дате (убывание)'); break; 57 case "name_down": sel.html('По дате (убывание)'); break;
58 case "created_at_up": sel.html('По дате (возрастание)'); break; 58 case "created_at_up": sel.html('По дате (возрастание)'); break;
59 case "created_at_down": sel.html('По дате (убывание)'); break; 59 case "created_at_down": sel.html('По дате (убывание)'); break;
60 } 60 }
61 61
62 } 62 }
63 }); 63 });
64 64
65 //end 65 //end
66 $(document).on('click', '.js_send_it_button', function() { 66 $(document).on('click', '.js_send_it_button', function() {
67 var this_ = $(this); 67 var this_ = $(this);
68 var code_user_id = this_.attr('data-uid'); 68 var code_user_id = this_.attr('data-uid');
69 var code_to_user_id = this_.attr('data-tuid'); 69 var code_to_user_id = this_.attr('data-tuid');
70 var code_vacancy = this_.attr('data-vacancy'); 70 var code_vacancy = this_.attr('data-vacancy');
71 var user_id = $('#send_user_id'); 71 var user_id = $('#send_user_id');
72 var to_user_id = $('#send_to_user_id'); 72 var to_user_id = $('#send_to_user_id');
73 var vacancy = $('#send_vacancy'); 73 var vacancy = $('#send_vacancy');
74 74
75 console.log('Клик на кнопки...'); 75 console.log('Клик на кнопки...');
76 76
77 user_id.val(code_user_id); 77 user_id.val(code_user_id);
78 to_user_id.val(code_to_user_id); 78 to_user_id.val(code_to_user_id);
79 vacancy.val(code_vacancy); 79 vacancy.val(code_vacancy);
80 }); 80 });
81 </script> 81 </script>
82 @include('js.favorite-vacancy-45') 82 @include('js.favorite-vacancy-45')
83 @endsection 83 @endsection
84 84
85 @section('content') 85 @section('content')
86 <section class="thing"> 86 <section class="thing">
87 <div class="container"> 87 <div class="container">
88 <div class="thing__body"> 88 <div class="thing__body">
89 <ul class="breadcrumbs thing__breadcrumbs"> 89 <ul class="breadcrumbs thing__breadcrumbs">
90 <li><a href="{{ route('index') }}">Главная</a></li> 90 <li><a href="{{ route('index') }}">Главная</a></li>
91 <li><a href="{{ route('shipping_companies') }}">Работодатели</a></li> 91 <li><a href="{{ route('shipping_companies') }}">Работодатели</a></li>
92 <li><b>@isset($title) {{ $title }} @else Не указано @endif</b></li> 92 <li><b>@isset($title) {{ $title }} @else Не указано @endif</b></li>
93 </ul> 93 </ul>
94 @if ($company[0]->oficial_status == 1) 94 @if ($company[0]->oficial_status == 1)
95 <div class="thing__badge"> 95 <div class="thing__badge">
96 <svg> 96 <svg>
97 <use xlink:href="{{ asset('images/sprite.svg#badge') }}"></use> 97 <use xlink:href="{{ asset('images/sprite.svg#badge') }}"></use>
98 </svg> 98 </svg>
99 Компания проверена 99 Компания проверена
100 </div> 100 </div>
101 @endif 101 @endif
102 102
103 @if (!empty($company[0]->logo)) 103 @if (!empty($company[0]->logo))
104 <a href="{{ asset(Storage::url($company[0]->logo)) }}" data-fancybox="gallery" class="review-image-modal"> 104 <a href="{{ asset(Storage::url($company[0]->logo)) }}" data-fancybox="gallery" class="review-image-modal">
105 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $company[0]->name_company }}" class="thing__pic"> 105 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $company[0]->name_company }}" class="thing__pic">
106 </a> 106 </a>
107 @else 107 @else
108 <a href="{{ asset('images/logo_emp.png') }}" data-fancybox="gallery" class="review-image-modal"> 108 <a href="{{ asset('images/logo_emp.png') }}" data-fancybox="gallery" class="review-image-modal">
109 <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $company[0]->name_company }}" class="thing__pic"> 109 <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $company[0]->name_company }}" class="thing__pic">
110 </a> 110 </a>
111 @endif 111 @endif
112 112
113 <h1 class="thing__title">{{ $company[0]->name_company }}</h1> 113 <h1 class="thing__title">{{ $company[0]->name_company }}</h1>
114 <!--<p class="thing__text"> $company[0]->text !!}</p>--> 114 <!--<p class="thing__text"> $company[0]->text !!}</p>-->
115 <div class="thing__buttons"> 115 <div class="thing__buttons">
116 <button type="button" class="button"> 116 <button type="button" class="button">
117 <svg> 117 <svg>
118 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use> 118 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use>
119 </svg> 119 </svg>
120 {{ $company[0]->ads->count() }} вакансии 120 {{ $company[0]->ads->count() }} вакансии
121 </button> 121 </button>
122 @if ($user_id == 0) 122 @if ($user_id == 0)
123 <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button"> 123 <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button">
124 Написать сообщение 124 Написать сообщение
125 </a> 125 </a>
126 @else 126 @else
127 <button type="button" data-fancybox data-src="#send" data-vacancy="0" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}' 127 <button type="button" data-fancybox data-src="#send" data-vacancy="0" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}'
128 class="button js_send_it_button"> 128 class="button js_send_it_button">
129 Написать сообщение 129 Написать сообщение
130 </button> 130 </button>
131 @endif 131 @endif
132 </div> 132 </div>
133 </div> 133 </div>
134 </div> 134 </div>
135 </section> 135 </section>
136 <main class="main"> 136 <main class="main">
137 <div class="container"> 137 <div class="container">
138 <div class="main__employer-page"> 138 <div class="main__employer-page">
139 <h2 class="main__employer-page-title">О компании</h2> 139 <h2 class="main__employer-page-title">О компании</h2>
140 <div class="main__employer-page-info"> 140 <div class="main__employer-page-info">
141 <div class="main__employer-page-item"> 141 <div class="main__employer-page-item">
142 <b>Адрес компании</b> 142 <b>Адрес компании</b>
143 <span> 143 <span>
144 {{ $company[0]->address }} 144 {{ $company[0]->address }}
145 </span> 145 </span>
146 </div> 146 </div>
147 <div class="main__employer-page-item"> 147 <div class="main__employer-page-item">
148 <b>Сайт</b> 148 <b>Сайт</b>
149 <span> 149 <span>
150 <a href="{{ $company[0]->site }}">{{ $company[0]->site }}</a> 150 <a href="{{ $company[0]->site }}">{{ $company[0]->site }}</a>
151 </span> 151 </span>
152 </div> 152 </div>
153 <div class="main__employer-page-item"> 153 <div class="main__employer-page-item">
154 <b>Почта</b> 154 <b>Почта</b>
155 <span> 155 <span>
156 <a href="mailto:">{{ $company[0]->email }}</a> 156 <a href="mailto:">{{ $company[0]->email }}</a>
157 </span> 157 </span>
158 </div> 158 </div>
159 <div class="main__employer-page-item"> 159 <div class="main__employer-page-item">
160 <b>Телефон</b> 160 <b>Телефон</b>
161 <span> 161 <span>
162 <a href="tel:{{ $company[0]->telephone }}">{{ $company[0]->telephone }}</a> 162 <a href="tel:{{ $company[0]->telephone }}">{{ $company[0]->telephone }}</a>
163 </span> 163 </span>
164 </div> 164 </div>
165 </div> 165 </div>
166 <div class="main__employer-page-info"> 166 <div class="main__employer-page-info">
167 <div class="main__employer-page-item"></div> 167 <div class="main__employer-page-item"></div>
168 <div class="main__employer-page-item"></div> 168 <div class="main__employer-page-item"></div>
169 <div class="main__employer-page-item"> 169 <div class="main__employer-page-item">
170 <b>Почта (alt)</b> 170 <b>Почта (alt)</b>
171 <span> 171 <span>
172 {{ $company[0]->email_2 }} 172 {{ $company[0]->email_2 }}
173 </span> 173 </span>
174 </div> 174 </div>
175 <div class="main__employer-page-item"> 175 <div class="main__employer-page-item">
176 <b>Телефон (alt)</b> 176 <b>Телефон (alt)</b>
177 <span> 177 <span>
178 <a href="{{ $company[0]->site }}">{{ $company[0]->telephone_2 }}</a> 178 <a href="{{ $company[0]->site }}">{{ $company[0]->telephone_2 }}</a>
179 </span> 179 </span>
180 </div> 180 </div>
181 </div> 181 </div>
182 182
183 <div class="main__employer-page-item main__employer-page-description"> 183 <div class="main__employer-page-item main__employer-page-description">
184 <b>Описание</b> 184 <b>Описание</b>
185 <span> 185 <span>
186 {!! $company[0]->text !!} 186 {!! $company[0]->text !!}
187 </span> 187 </span>
188 </div> 188 </div>
189 189
190 <div> 190 <div>
191 191
192 <div class="main__employer-page-tabs"> 192 <div class="main__employer-page-tabs">
193 <button type="button" class="main__employer-page-tabs-item active" 193 <button type="button" class="main__employer-page-tabs-item active"
194 data-tab="1">Флот</button> 194 data-tab="1">Флот</button>
195 <button type="button" class="main__employer-page-tabs-item" data-tab="2">Вакансии</button> 195 <button type="button" class="main__employer-page-tabs-item" data-tab="2">Вакансии</button>
196 </div> 196 </div>
197 197
198 <div class="main__employer-page-body"> 198 <div class="main__employer-page-body">
199 <div class="main__employer-page-body-item showed" data-body="1"> 199 <div class="main__employer-page-body-item showed" data-body="1">
200 <div class="main__employer-page-one"> 200 <div class="main__employer-page-one">
201 @if ($company[0]->flots->count()) 201 @if ($company[0]->flots->count())
202 @foreach ($company[0]->flots as $flot) 202 @foreach ($company[0]->flots as $flot)
203 <div class="main__employer-page-one-item flot-one-ship"> 203 <div class="main__employer-page-one-item flot-one-ship">
204 @if (!empty($flot->image)) 204 @if (!empty($flot->image))
205 <a href="{{ asset(Storage::url($flot->image)) }}" data-fancybox="gallery" class="review-image-modal"> 205 <a href="{{ asset(Storage::url($flot->image)) }}" data-fancybox="gallery" class="review-image-modal">
206 <img src="{{ asset(Storage::url($flot->image)) }}" alt="{{ $flot->name }}"> 206 <img src="{{ asset(Storage::url($flot->image)) }}" alt="{{ $flot->name }}">
207 </a> 207 </a>
208 @else 208 @else
209 <a href="{{ asset('images/default_ship.jpg') }}" data-fancybox="gallery" class="review-image-modal"> 209 <a href="{{ asset('images/default_ship.jpg') }}" data-fancybox="gallery" class="review-image-modal">
210 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $flot->name }}"> 210 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $flot->name }}">
211 </a> 211 </a>
212 @endif 212 @endif
213 213
214 <div class="bold font20">{{ $flot->name }}</div> 214 <div class="flot-label"><div class="flot-label-name">Название:</div>{{ $flot->name }}</div>
215 <div class="flot-label"><div class="flot-label-name">DWT</div> {{ $flot->DWT }}</div> 215 <div class="flot-label"><div class="flot-label-name">DWT:</div> {{ $flot->DWT }}</div>
216 <div class="flot-label"><div class="flot-label-name">Мощность</div> {{ $flot->POWER_GD }}</div> 216 <div class="flot-label"><div class="flot-label-name">Мощность:</div> {{ $flot->POWER_GD }}</div>
217 <div class="flot-label"><div class="flot-label-name">IMO</div> {{ $flot->IMO }}</div> 217 <div class="flot-label"><div class="flot-label-name">IMO:</div> {{ $flot->IMO }}</div>
218 </div> 218 </div>
219 @endforeach 219 @endforeach
220 @endif 220 @endif
221 </div> 221 </div>
222 </div> 222 </div>
223 223
224 <div class="main__employer-page-body-item" data-body="2"> 224 <div class="main__employer-page-body-item" data-body="2">
225 <div class="main__employer-page-two"> 225 <div class="main__employer-page-two">
226 @foreach ($ads as $job) 226 @foreach ($ads as $job)
227 <div class="main__employer-page-two-item"> 227 <div class="main__employer-page-two-item">
228 <div class="main__employer-page-two-item-toper"> 228 <div class="main__employer-page-two-item-toper">
229 @if (!empty($company[0]->logo)) 229 @if (!empty($company[0]->logo))
230 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $job->name }}"> 230 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $job->name }}">
231 @else 231 @else
232 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $job->name }}"> 232 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $job->name }}">
233 @endif 233 @endif
234 <span>{{ $company[0]->name_company }}</span> 234 <span>{{ $company[0]->name_company }}</span>
235 </div> 235 </div>
236 <div class="main__employer-page-two-item-text-body"> 236 <div class="main__employer-page-two-item-text-body">
237 <h3>{{ $job->name }}</h3> 237 <h3>{{ $job->name }}</h3>
238 <span>Описание: 238 <span>Описание:
239 {!! $job->text !!} 239 {!! $job->text !!}
240 </span> 240 </span>
241 </div> 241 </div>
242 242
243 @if ((isset($job->jobs)) && ($job->jobs->count())) 243 @if ((isset($job->jobs)) && ($job->jobs->count()))
244 <div class="main__employer-page-two-item-tags"> 244 <div class="main__employer-page-two-item-tags">
245 @foreach ($job->jobs as $item) 245 @foreach ($job->jobs as $item)
246 <span class="main__employer-page-two-item-tag">#{{ $item->name }}</span> 246 <span class="main__employer-page-two-item-tag">#{{ $item->name }}</span>
247 @endforeach 247 @endforeach
248 </div> 248 </div>
249 @endif 249 @endif
250 <div class="main__employer-page-two-item-buttons"> 250 <div class="main__employer-page-two-item-buttons">
251 251
252 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $job->id }}" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}' 252 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $job->id }}" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}'
253 class="button main__employer-page-two-item-button js_send_it_button">Оставить 253 class="button main__employer-page-two-item-button js_send_it_button">Оставить
254 отклик...</button> 254 отклик...</button>
255 255
256 <!--<a href="#" 256 <!--<a href="#"
257 class="button button_light main__employer-page-two-item-button">Подробнее</a>--> 257 class="button button_light main__employer-page-two-item-button">Подробнее</a>-->
258 </div> 258 </div>
259 <div class="main__employer-page-two-item-bottom"> 259 <div class="main__employer-page-two-item-bottom">
260 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($job->updated_at)) }}</div> 260 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($job->updated_at)) }}</div>
261 <button type="button" id="like{{ $job->id }}" data-val="{{ $job->id }}" 261 <button type="button" id="like{{ $job->id }}" data-val="{{ $job->id }}"
262 class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($job) }}"> 262 class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($job) }}">
263 <svg> 263 <svg>
264 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 264 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
265 </svg> 265 </svg>
266 </button> 266 </button>
267 </div> 267 </div>
268 </div> 268 </div>
269 @endforeach 269 @endforeach
270 270
271 <div style="margin-top: 20px"> 271 <div style="margin-top: 20px">
272 {{ $ads->onEachSide(0)->appends($_GET)->links('paginate') }} 272 {{ $ads->onEachSide(0)->appends($_GET)->links('paginate') }}
273 </div> 273 </div>
274 <!--<button type="button" class="button button_light button_more main__employer-page-two-more js-toggle js-parent-toggle"> 274 <!--<button type="button" class="button button_light button_more main__employer-page-two-more js-toggle js-parent-toggle">
275 <span>Показать ещё</span> 275 <span>Показать ещё</span>
276 <span>Скрыть</span> 276 <span>Скрыть</span>
277 </button>--> 277 </button>-->
278 </div> 278 </div>
279 </div> 279 </div>
280 </div> 280 </div>
281 </div> 281 </div>
282 </div> 282 </div>
283 </div> 283 </div>
284 </main> 284 </main>
285 @endsection 285 @endsection
286 286
resources/views/js/favorite-worker.blade.php
1 <script> 1 <script>
2 console.log('js выполняется...123');
3
4 $(document).ready(function() { 2 $(document).ready(function() {
5 $(document).on('click', '.js_box_favorit', function () { 3 $(document).on('click', '.js_box_favorit', function () {
6 var _this = $(this); 4 var this_btn = $(this);
7 var id = _this.attr('id'); 5 var id_worker = this_btn.attr('data-val');
8 var id_worker = _this.attr('data-val'); 6 var data = {code_record: id_worker};
9 console.log('active='+id);
10 console.log('is_worker='+id_worker);
11 7
12 if ($( "#"+id ).hasClass( "active" )) { 8 if (this_btn.hasClass('active')){
13 console.log('Download 41... final'); 9 data.delete = 1;
14 $.ajax({ 10 }
15 type: "GET",
16 url: "{{ route('like_resume') }}",
17 data: "code_record=" + id_worker,
18 success: function (data) {
19 console.log('Выбор сортировки');
20 console.log(data);
21 11
22 }, 12 if (this_btn.hasClass('active')){
23 headers: { 13 this_btn.removeClass('active');
24 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 14 } else{
25 }, 15 this_btn.addClass('active');
26 error: function (data) {
27 data = JSON.stringify(data);
28 console.log('Error: ' + data);
29 }
30 });
31 } else {
32 console.log('Не выполнить условие никогда');
33 $.ajax({
34 type: "GET",
35 url: "{{ route('like_resume') }}",
36 data: "code_record=" + id_worker + "&delete=1",
37 success: function (data) {
38 console.log('Выбор сортировки');
39 console.log(data);
40 },
41 headers: {
42 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
43 },
44 error: function (data) {
45 data = JSON.stringify(data);
46 console.log('Error: ' + data);
47 }
48 });
49 } 16 }
17
18 $.ajax({
19 type: "GET",
20 url: "{{ route('like_resume') }}",
resources/views/resume.blade.php
1 @extends('layout.frontend', ['title' => 'База резюме - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'База резюме - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script> 4 <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
5 <script> 5 <script>
6 console.log('Test system'); 6 console.log('Test system');
7 $(document).on('change', '#jobs', function() { 7 $(document).on('change', '#jobs', function() {
8 var val = $(this).val(); 8 var val = $(this).val();
9 var main_oskar = $('#main_ockar'); 9 var main_oskar = $('#main_ockar');
10 10
11 console.log('Code='+val); 11 console.log('Code='+val);
12 console.log('Click change...'); 12 console.log('Click change...');
13 $.ajax({ 13 $.ajax({
14 type: "GET", 14 type: "GET",
15 url: "", 15 url: "",
16 data: "job="+val, 16 data: "job="+val,
17 success: function (data) { 17 success: function (data) {
18 console.log('Выбор сделан!'); 18 console.log('Выбор сделан!');
19 console.log(data); 19 console.log(data);
20 main_oskar.html(data); 20 main_oskar.html(data);
21 }, 21 },
22 headers: { 22 headers: {
23 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 23 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
24 }, 24 },
25 error: function (data) { 25 error: function (data) {
26 data = JSON.stringify(data); 26 data = JSON.stringify(data);
27 console.log('Error: ' + data); 27 console.log('Error: ' + data);
28 } 28 }
29 }); 29 });
30 }); 30 });
31 </script> 31 </script>
32 32
33 <script> 33 <script>
34 $(document).ready(function() { 34 $(document).ready(function() {
35 $(document).on('click', '.js_box_favorites', function () {
36 var _this = $(this);
37 var id_worker = _this.attr('data-val');
38 35
39 if (_this.hasClass('active')) {
40 add_in_array(id_worker);
41 console.log('Добавлено в избранное id=' + id_worker);
42 } else {
43 delete_in_array(id_worker);
44 console.log('Удалено из избранных id='+id_worker)
45 }
46 var str = $.cookie('favorite_worker');
47 console.log("Вывод куков "+str);
48
49 });
50 }); 36 });
51 37
52 //помеченный элемент 38 //помеченный элемент
53 function selected_item(obj) { 39 function selected_item(obj) {
54 var arr = read_array(); 40 var arr = read_array();
55 var index = arr.indexOf(obj); 41 var index = arr.indexOf(obj);
56 42
57 if (index > 0) 43 if (index > 0)
58 return "active"; 44 return "active";
59 else 45 else
60 return ""; 46 return "";
61 } 47 }
62 48
63 // запись элемента массива в cookie 49 // запись элемента массива в cookie
64 function add_in_array(obj){ 50 function add_in_array(obj){
65 var arr = read_array();//получаем текущее состояние массива 51 var arr = read_array();//получаем текущее состояние массива
66 arr[arr.length]=obj; //добавляем элемент в конец 52 arr[arr.length]=obj; //добавляем элемент в конец
67 //var str = JSON.stringify(arr);//конвертируем в строку 53 //var str = JSON.stringify(arr);//конвертируем в строку
68 //$.cookie('arr',str);//записываем массив в куки 54 //$.cookie('arr',str);//записываем массив в куки
69 $.cookie('favorite_worker', JSON.stringify(arr)); 55 $.cookie('favorite_worker', JSON.stringify(arr));
70 56
71 } 57 }
72 58
73 // удаление элемента из массива в cookie 59 // удаление элемента из массива в cookie
74 function delete_in_array(obj) { 60 function delete_in_array(obj) {
75 var arr = read_array(); 61 var arr = read_array();
76 var unique = [...new Set(arr)] 62 var unique = [...new Set(arr)]
77 var index = unique.indexOf(obj); 63 var index = unique.indexOf(obj);
78 64
79 unique.splice(index, 1); 65 unique.splice(index, 1);
80 66
81 //var str = JSON.stringify(arr);//конвертируем в строку 67 //var str = JSON.stringify(arr);//конвертируем в строку
82 //$.cookie('arr',str);//записываем массив в куки 68 //$.cookie('arr',str);//записываем массив в куки
83 $.cookie('favorite_worker', JSON.stringify(unique)); 69 $.cookie('favorite_worker', JSON.stringify(unique));
84 70
85 } 71 }
86 72
87 function read_array(){ 73 function read_array(){
88 var dataArr=$.cookie('favorite_worker');//считываем данные из куков 74 var dataArr=$.cookie('favorite_worker');//считываем данные из куков
89 75
90 //если массив не был обнаружен, иницилизируем его 76 //если массив не был обнаружен, иницилизируем его
91 if(dataArr===null){ 77 if(dataArr===null){
92 dataArr = init_array(); //возвращаем инициализированный пустой маасив 78 dataArr = init_array(); //возвращаем инициализированный пустой маасив
93 } 79 }
94 //возвращаем полученный массив 80 //возвращаем полученный массив
95 //return JSON.parse(dataArr); 81 //return JSON.parse(dataArr);
96 return JSON.parse(dataArr); 82 return JSON.parse(dataArr);
97 } 83 }
98 84
99 //другими словами создаем пустой массив 85 //другими словами создаем пустой массив
100 function init_array(){ 86 function init_array(){
101 //var str = JSON.stringify(new Array());//конвертируем в строку 87 //var str = JSON.stringify(new Array());//конвертируем в строку
102 var str = JSON.stringify(new Array()); 88 var str = JSON.stringify(new Array());
103 $.cookie('favorite_worker',str);//записываем массив в куки 89 $.cookie('favorite_worker',str);//записываем массив в куки
104 90
105 return str; 91 return str;
106 } 92 }
107 </script> 93 </script>
108 <script> 94 <script>
109 $(document).on('click', '.js_it_button', function() { 95 $(document).on('click', '.js_it_button', function() {
110 var this_ = $(this); 96 var this_ = $(this);
111 var code_user_id = this_.attr('data-uid'); 97 var code_user_id = this_.attr('data-uid');
112 var code_to_user_id = this_.attr('data-tuid'); 98 var code_to_user_id = this_.attr('data-tuid');
113 var code_vacancy = this_.attr('data-vacancy'); 99 var code_vacancy = this_.attr('data-vacancy');
114 var user_id = $('#_user_id'); 100 var user_id = $('#_user_id');
115 var to_user_id = $('#_to_user_id'); 101 var to_user_id = $('#_to_user_id');
116 var vacancy = $('#_vacancy'); 102 var vacancy = $('#_vacancy');
117 103
118 console.log('code_to_user_id='+code_to_user_id); 104 console.log('code_to_user_id='+code_to_user_id);
119 console.log('code_user_id='+code_user_id); 105 console.log('code_user_id='+code_user_id);
120 console.log('code_vacancy='+code_vacancy); 106 console.log('code_vacancy='+code_vacancy);
121 console.log('Клик на кнопке...'); 107 console.log('Клик на кнопке...');
122 108
123 user_id.val(code_user_id); 109 user_id.val(code_user_id);
124 to_user_id.val(code_to_user_id); 110 to_user_id.val(code_to_user_id);
125 vacancy.val(code_vacancy); 111 vacancy.val(code_vacancy);
126 }); 112 });
127 </script> 113 </script>
128 <script> 114 <script>
129 $(document).on('change', '#sort_ajax', function() { 115 $(document).on('change', '#sort_ajax', function() {
130 var this_ = $(this); 116 var this_ = $(this);
131 var val_ = this_.val(); 117 var val_ = this_.val();
132 console.log('sort items '+val_); 118 console.log('sort items '+val_);
133 119
134 $.ajax({ 120 $.ajax({
135 type: "GET", 121 type: "GET",
136 url: "{{ route('bd_resume') }}", 122 url: "{{ route('bd_resume') }}",
137 data: "sort="+val_+"&block=1", 123 data: "sort="+val_+"&block=1",
138 success: function (data) { 124 success: function (data) {
139 console.log('Выбор сортировки'); 125 console.log('Выбор сортировки');
140 console.log(data); 126 console.log(data);
141 $('#block1').html(data); 127 $('#block1').html(data);
142 history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 128 history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
143 }, 129 },
144 headers: { 130 headers: {
145 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 131 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
146 }, 132 },
147 error: function (data) { 133 error: function (data) {
148 data = JSON.stringify(data); 134 data = JSON.stringify(data);
149 console.log('Error: ' + data); 135 console.log('Error: ' + data);
150 } 136 }
151 }); 137 });
152 }); 138 });
153 139
154 $(document).ready(function(){ 140 $(document).ready(function(){
155 var sel = $('#select2-sort_ajax-container'); 141 var sel = $('#select2-sort_ajax-container');
156 var key = getUrlParameter('sort'); 142 var key = getUrlParameter('sort');
157 console.log(sel); 143 console.log(sel);
158 console.log(key); 144 console.log(key);
159 145
160 if (key !=='') { 146 if (key !=='') {
161 console.log(key); 147 console.log(key);
162 switch (key) { 148 switch (key) {
163 case "default": sel.html('Сортировка (по умолчанию)'); break; 149 case "default": sel.html('Сортировка (по умолчанию)'); break;
164 case "name_up": sel.html('По имени (возрастание)'); break; 150 case "name_up": sel.html('По имени (возрастание)'); break;
165 case "name_down": sel.html('По дате (убывание)'); break; 151 case "name_down": sel.html('По дате (убывание)'); break;
166 case "created_at_up": sel.html('По дате (возрастание)'); break; 152 case "created_at_up": sel.html('По дате (возрастание)'); break;
167 case "created_at_down": sel.html('По дате (убывание)'); break; 153 case "created_at_down": sel.html('По дате (убывание)'); break;
168 } 154 }
169 155
170 } 156 }
171 }); 157 });
172 </script> 158 </script>
173 159
174 <script> 160 <script>
175 console.log('Test system'); 161 console.log('Test system');
176 $(document).on('change', '.jobs', function() { 162 $(document).on('change', '.jobs', function() {
177 var val = $(this).val(); 163 var val = $(this).val();
178 164
179 console.log('Click filter вакансии...'); 165 console.log('Click filter вакансии...');
180 $.ajax({ 166 $.ajax({
181 type: "GET", 167 type: "GET",
182 url: "{{ route('bd_resume') }}", 168 url: "{{ route('bd_resume') }}",
183 data: "job="+val+'&block=1', 169 data: "job="+val+'&block=1',
184 success: function (data) { 170 success: function (data) {
185 console.log('Выбор должности'); 171 console.log('Выбор должности');
186 console.log(data); 172 console.log(data);
187 $('#block1').html(data); 173 $('#block1').html(data);
188 history.pushState({}, '', "{{ route('bd_resume') }}?job="+val+"@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 174 history.pushState({}, '', "{{ route('bd_resume') }}?job="+val+"@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
189 }, 175 },
190 headers: { 176 headers: {
191 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 177 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
192 }, 178 },
193 error: function (data) { 179 error: function (data) {
194 data = JSON.stringify(data); 180 data = JSON.stringify(data);
195 console.log('Error: ' + data); 181 console.log('Error: ' + data);
196 } 182 }
197 }); 183 });
198 }); 184 });
199 </script> 185 </script>
200 @include('js.favorite-worker') 186 @include('js.favorite-worker')
201 @endsection 187 @endsection
202 188
203 189
204 @section('content') 190 @section('content')
205 <section class="thing"> 191 <section class="thing">
206 <div class="container"> 192 <div class="container">
207 <form class="thing__body" action="{{ url()->current() }}"> 193 <form class="thing__body" action="{{ url()->current() }}">
208 <ul class="breadcrumbs thing__breadcrumbs"> 194 <ul class="breadcrumbs thing__breadcrumbs">
209 <li><a href="{{ route('index') }}">Главная</a></li> 195 <li><a href="{{ route('index') }}">Главная</a></li>
210 <li><b>База резюме</b></li> 196 <li><b>База резюме</b></li>
211 </ul> 197 </ul>
212 <h1 class="thing__title">База резюме</h1> 198 <h1 class="thing__title">База резюме</h1>
213 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для 199 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для
214 существующих финансовых и административных условий.</p> 200 существующих финансовых и административных условий.</p>
215 201
216 <div class="select select_search thing__select"> 202 <div class="select select_search thing__select">
217 <div class="select__icon"> 203 <div class="select__icon">
218 <svg> 204 <svg>
219 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 205 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
220 </svg> 206 </svg>
221 </div> 207 </div>
222 <select class="js-select2 jobs" name="search" id="search"> 208 <select class="js-select2 jobs" name="search" id="search">
223 <option value="0">Выберите должность</option> 209 <option value="0">Выберите должность</option>
224 @if($Job_title->count()) 210 @if($Job_title->count())
225 @foreach($Job_title as $JT) 211 @foreach($Job_title as $JT)
226 <option value="{{ $JT->id }}" @if (isset($_GET['job'])) @if($_GET['job'] == $JT->id) selected @endif @endif>{{ $JT->name }}</option> 212 <option value="{{ $JT->id }}" @if (isset($_GET['job'])) @if($_GET['job'] == $JT->id) selected @endif @endif>{{ $JT->name }}</option>
227 @endforeach 213 @endforeach
228 @endif 214 @endif
229 </select> 215 </select>
230 </div> 216 </div>
231 </form> 217 </form>
232 </div> 218 </div>
233 </section> 219 </section>
234 <main class="main"> 220 <main class="main">
235 <div class="container"> 221 <div class="container">
236 <div class="main__resume-base"> 222 <div class="main__resume-base">
237 <h2>Резюме работников</h2> 223 <h2>Резюме работников</h2>
238 <div class="filters"> 224 <div class="filters">
239 <div class="filters__label">Показано {{ $resumes->firstItem() }} – {{ $resumes->lastItem() }} из {{ $res_count }} результатов поиска</div> 225 <div class="filters__label">Показано {{ $resumes->firstItem() }} – {{ $resumes->lastItem() }} из {{ $res_count }} результатов поиска</div>
240 <div class="filters__body"> 226 <div class="filters__body">
241 <div class="select filters__select"> 227 <div class="select filters__select">
242 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 228 <select class="js-select2" id="sort_ajax" name="sort_ajax">
243 <option value="all_workers">Все кандидаты</option> 229 <option value="all_workers">Все кандидаты</option>
244 <option value="looking_for_work">Ищу работу</option> 230 <option value="looking_for_work">Ищу работу</option>
245 <option value="considering_offers">Рассматриваю предложения</option> 231 <option value="considering_offers">Рассматриваю предложения</option>
246 <option value="not_looking_for_work">Не ищу работу</option> 232 <option value="not_looking_for_work">Не ищу работу</option>
247 </select> 233 </select>
248 </div> 234 </div>
249 </div> 235 </div>
250 </div> 236 </div>
251 <div class="main__resume-base-body showed" data-body="1"> 237 <div class="main__resume-base-body showed" data-body="1">
252 <div class="main__resume-base-body-one" id="block1" name="block1"> 238 <div class="main__resume-base-body-one" id="block1" name="block1">
253 @include('resume.resume_blocks') 239 @include('resume.resume_blocks')
254 </div> 240 </div>
255 </div> 241 </div>
256 </div> 242 </div>
257 </div> 243 </div>
258 </main> 244 </main>
259 </div> 245 </div>
260 </div> 246 </div>
261 @endsection 247 @endsection
262 248
resources/views/resume/resume_blocks.blade.php
1 @if ($resumes->count()) 1 @if ($resumes->count())
2 @foreach ($resumes as $res) 2 @foreach ($resumes as $res)
3 <div class="main__resume-base-body-item"> 3 <div class="main__resume-base-body-item">
4 <div class="main__resume-base-body-item-wrapper"> 4 <div class="main__resume-base-body-item-wrapper">
5 <div> 5 <div>
6 <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo"> 6 <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo">
7 <div> 7 <div>
8 <div class="main__resume-base-body-item-buttons"> 8 <div class="main__resume-base-body-item-buttons">
9 <button type="button" data-id="{{ $res->id }}" id="elem{{ $res->id }}" class="like js-toggle js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($res) }}" data-val="{{ $res->id }}"> 9 <button type="button" data-id="{{ $res->id }}" id="elem{{ $res->id }}" class="like js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($res) }}" data-val="{{ $res->id }}">
10 <svg> 10 <svg>
11 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 11 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
12 </svg> 12 </svg>
13 <span class="to-favorites">В избранное</span> 13 <span class="to-favorites">В избранное</span>
14 <span class="in-favorites">В избранном</span> 14 <span class="in-favorites">В избранном</span>
15 </button> 15 </button>
16 16
17 @guest 17 @guest
18 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' 18 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
19 class="chat js-toggle js_it_button"> 19 class="chat js-toggle js_it_button">
20 <svg> 20 <svg>
21 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> 21 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
22 </svg> 22 </svg>
23 <span>Написать</span> 23 <span>Написать</span>
24 </button> 24 </button>
25 @else 25 @else
26 @if (App\Classes\StatusUser::Status()==0) 26 @if (App\Classes\StatusUser::Status()==0)
27 @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message)) 27 @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message))
28 <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $res->users->id }}" data-options='{"touch":false,"autoFocus":false}'> 28 <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $res->users->id }}" data-options='{"touch":false,"autoFocus":false}'>
29 <svg> 29 <svg>
30 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> 30 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
31 </svg> 31 </svg>
32 <span>Написать</span> 32 <span>Написать</span>
33 </button> 33 </button>
34 @endif 34 @endif
35 @else 35 @else
36 <button type="button" data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' 36 <button type="button" data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}'
37 class="chat js-toggle js_it_button"> 37 class="chat js-toggle js_it_button">
38 <svg> 38 <svg>
39 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> 39 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
40 </svg> 40 </svg>
41 <span>Написать</span> 41 <span>Написать</span>
42 </button> 42 </button>
43 @endif 43 @endif
44 @endif 44 @endif
45 45
46 <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Подробнее</a> 46 <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Подробнее</a>
47 </div> 47 </div>
48 </div> 48 </div>
49 </div> 49 </div>
50 <div class="main__resume-base-body-item-inner"> 50 <div class="main__resume-base-body-item-inner">
51 <div class="horizontal"> 51 <div class="horizontal">
52 <div class="main__resume-base-item-status @if ($res->status_work == 0) looking-for-job @endif"> 52 <div class="main__resume-base-item-status @if ($res->status_work == 0) looking-for-job @endif">
53 {{ $status_work[$res->status_work] }} 53 {{ $status_work[$res->status_work] }}
54 </div> 54 </div>
55 <div class="main__resume-base-item-updated-at"> 55 <div class="main__resume-base-item-updated-at">
56 Обновлено: {{ date('d.m.Y', strtotime($res->updated_at)) }} 56 Обновлено: {{ date('d.m.Y', strtotime($res->updated_at)) }}
57 </div> 57 </div>
58 </div> 58 </div>
59 <div> 59 <div>
60 <b>Предпочтение по типу судна:</b> 60 <b>Предпочтение по типу судна:</b>
61 <span>{{ $res->boart_type_preference ?? '-' }}</span> 61 <span>{{ $res->boart_type_preference ?? '-' }}</span>
62 </div> 62 </div>
63 <div> 63 <div>
64 <b>ФИО:</b> 64 <b>ФИО:</b>
65 <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> 65 <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span>
66 </div> 66 </div>
67 <div> 67 <div>
68 <b>Наличие визы:</b> 68 <b>Наличие визы:</b>
69 <span>{{ $res->visa_available ?? '-' }}</span> 69 <span>{{ $res->visa_available ?? '-' }}</span>
70 </div> 70 </div>
71 <div> 71 <div>
72 <b>Возраст:</b> 72 <b>Возраст:</b>
73 <span>{{ $res->old_year ?? '-' }}</span> 73 <span>{{ $res->old_year ?? '-' }}</span>
74 </div> 74 </div>
75 <div> 75 <div>
76 <b>Наличие танкерных документов:</b> 76 <b>Наличие танкерных документов:</b>
77 <span>{{ $res->tanker_documents_available ?? '-' }}</span> 77 <span>{{ $res->tanker_documents_available ?? '-' }}</span>
78 </div> 78 </div>
79 <div> 79 <div>
80 <b>Желаемые вакансии:</b> 80 <b>Желаемые вакансии:</b>
81 <span> 81 <span>
82 @if ($res->job_titles->count()) 82 @if ($res->job_titles->count())
83 @foreach ($res->job_titles as $job_title) 83 @foreach ($res->job_titles as $job_title)
84 {{ $job_title->name }} 84 {{ $job_title->name }}
85 @if (!$loop->last) / @endif 85 @if (!$loop->last) / @endif
86 @endforeach 86 @endforeach
87 @else 87 @else
88 - 88 -
89 @endif 89 @endif
90 </span> 90 </span>
91 </div> 91 </div>
92 <div> 92 <div>
93 <b>Наличие подтверждения для работы на ВВП:</b> 93 <b>Наличие подтверждения для работы на ВВП:</b>
94 <span>{{ $res->confirmation_work_for_vvp ?? '-' }}</span> 94 <span>{{ $res->confirmation_work_for_vvp ?? '-' }}</span>
95 </div> 95 </div>
96 <div> 96 <div>
97 <b>Пожелание к З/П:</b> 97 <b>Пожелание к З/П:</b>
98 <span>{{ $res->salary_expectations ?? '-' }}</span> 98 <span>{{ $res->salary_expectations ?? '-' }}</span>
99 </div> 99 </div>
100 <div> 100 <div>
101 <b>Город проживания</b> 101 <b>Город проживания</b>
102 <span>{{ $res->city ?? "-" }}</span> 102 <span>{{ $res->city ?? "-" }}</span>
103 </div> 103 </div>
104 <div> 104 <div>
105 <b>Уровень английского:</b> 105 <b>Уровень английского:</b>
106 <span>{{ $res->english_level ?? '-' }}</span> 106 <span>{{ $res->english_level ?? '-' }}</span>
107 </div> 107 </div>
108 <div> 108 <div>
109 <b>Номер телефона:</b> 109 <b>Номер телефона:</b>
110 <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone ?? '-' }}</a></span> 110 <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone ?? '-' }}</a></span>
111 </div> 111 </div>
112 <div> 112 <div>
113 <b>Дата готовности к посадке:</b> 113 <b>Дата готовности к посадке:</b>
114 <span>{{ $res->ready_boart_date ?? '-' }}</span> 114 <span>{{ $res->ready_boart_date ?? '-' }}</span>
115 </div> 115 </div>
116 <div> 116 <div>
117 <b>E-mail:</b> 117 <b>E-mail:</b>
118 <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> 118 <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span>
119 </div> 119 </div>
120 </div> 120 </div>
121 </div> 121 </div>
122 </div> 122 </div>
123 @endforeach 123 @endforeach
124 124
125 {{ $resumes->appends($_GET)->links('paginate') }} 125 {{ $resumes->appends($_GET)->links('paginate') }}
126 @else 126 @else
127 <p>По данному запросу ничего не найдено</p> 127 <p>По данному запросу ничего не найдено</p>
128 @endif 128 @endif
129 129
resources/views/worker.blade.php
1 @extends('layout.frontend', ['title' => 'Карточка соискателя - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Карточка соискателя - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 $(function(){ 5 $(function(){
6 $('[name="footer-like-button"]').click(function(){ 6 $('[name="footer-like-button"]').click(function(){
7 $('[name="header-like-button"]').click(); 7 $('[name="header-like-button"]').click();
8 $(this).toggleClass('active'); 8 $(this).toggleClass('active');
9 }); 9 });
10 $('[name="header-like-button"]').click(function(){ 10 $('[name="header-like-button"]').click(function(){
11 $('[name="footer-like-button"]').toggleClass('active'); 11 $('[name="footer-like-button"]').toggleClass('active');
12 }); 12 });
13 }); 13 });
14 14
15 console.log('Test system'); 15 console.log('Test system');
16 $(document).on('change', '#jobs', function() { 16 $(document).on('change', '#jobs', function() {
17 var val = $(this).val(); 17 var val = $(this).val();
18 var main_oskar = $('#main_ockar'); 18 var main_oskar = $('#main_ockar');
19 19
20 console.log('Code='+val); 20 console.log('Code='+val);
21 console.log('Click change...'); 21 console.log('Click change...');
22 $.ajax({ 22 $.ajax({
23 type: "GET", 23 type: "GET",
24 url: "", 24 url: "",
25 data: "job="+val, 25 data: "job="+val,
26 success: function (data) { 26 success: function (data) {
27 console.log('Выбор сделан!'); 27 console.log('Выбор сделан!');
28 console.log(data); 28 console.log(data);
29 main_oskar.html(data); 29 main_oskar.html(data);
30 }, 30 },
31 headers: { 31 headers: {
32 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 32 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
33 }, 33 },
34 error: function (data) { 34 error: function (data) {
35 data = JSON.stringify(data); 35 data = JSON.stringify(data);
36 console.log('Error: ' + data); 36 console.log('Error: ' + data);
37 } 37 }
38 }); 38 });
39 }); 39 });
40 </script> 40 </script>
41 41
42 <script> 42 <script>
43 $(document).on('click', '.js_it_button', function() { 43 $(document).on('click', '.js_it_button', function() {
44 var this_ = $(this); 44 var this_ = $(this);
45 var code_user_id = this_.attr('data-uid'); 45 var code_user_id = this_.attr('data-uid');
46 var code_to_user_id = this_.attr('data-tuid'); 46 var code_to_user_id = this_.attr('data-tuid');
47 var code_vacancy = this_.attr('data-vacancy'); 47 var code_vacancy = this_.attr('data-vacancy');
48 var user_id = $('#_user_id'); 48 var user_id = $('#_user_id');
49 var to_user_id = $('#_to_user_id'); 49 var to_user_id = $('#_to_user_id');
50 var vacancy = $('#_vacancy'); 50 var vacancy = $('#_vacancy');
51 51
52 console.log('code_to_user_id='+code_to_user_id); 52 console.log('code_to_user_id='+code_to_user_id);
53 console.log('code_user_id='+code_user_id); 53 console.log('code_user_id='+code_user_id);
54 console.log('code_vacancy='+code_vacancy); 54 console.log('code_vacancy='+code_vacancy);
55 console.log('Клик на кнопке...'); 55 console.log('Клик на кнопке...');
56 56
57 user_id.val(code_user_id); 57 user_id.val(code_user_id);
58 to_user_id.val(code_to_user_id); 58 to_user_id.val(code_to_user_id);
59 vacancy.val(code_vacancy); 59 vacancy.val(code_vacancy);
60 }); 60 });
61 </script> 61 </script>
62 @include('js.favorite-worker') 62 @include('js.favorite-worker')
63 @endsection 63 @endsection
64 64
65 @section('content') 65 @section('content')
66 @php 66 @php
67 $worker = $Query[0]; 67 $worker = $Query[0];
68 @endphp 68 @endphp
69 <section class="thing"> 69 <section class="thing">
70 <div class="container"> 70 <div class="container">
71 <ul class="breadcrumbs thing__breadcrumbs"> 71 <ul class="breadcrumbs thing__breadcrumbs">
72 <li><a href="{{ route('index') }}">Главная</a></li> 72 <li><a href="{{ route('index') }}">Главная</a></li>
73 <li><a href="{{ route('bd_resume') }}">База резюме</a></li> 73 <li><a href="{{ route('bd_resume') }}">База резюме</a></li>
74 <li><b>@if (isset($Query[0]->users)) {{ $Query[0]->users->surname." ".$Query[0]->users->name_man." ".$Query[0]->users->surname2 }} @else Неизвестно @endif</b></li> 74 <li><b>@if (isset($Query[0]->users)) {{ $Query[0]->users->surname." ".$Query[0]->users->name_man." ".$Query[0]->users->surname2 }} @else Неизвестно @endif</b></li>
75 </ul> 75 </ul>
76 <div class="thing__profile"> 76 <div class="thing__profile">
77 <img src="@if (isset($Query[0]->photo)) {{ asset(Storage::url($Query[0]->photo)) }} @else {{ asset('images/default_man.jpg') }} @endif" alt="" class="main__resume-base-body-item-photo"> 77 <img src="@if (isset($Query[0]->photo)) {{ asset(Storage::url($Query[0]->photo)) }} @else {{ asset('images/default_man.jpg') }} @endif" alt="" class="main__resume-base-body-item-photo">
78 <div class="thing__profile-body"> 78 <div class="thing__profile-body">
79 <h1 class="thing__title">@if (isset($Query[0]->users)) {{ $Query[0]->users->surname." ".$Query[0]->users->name_man." ".$Query[0]->users->surname2 }} @else Неизвестно @endif</h1> 79 <h1 class="thing__title">@if (isset($Query[0]->users)) {{ $Query[0]->users->surname." ".$Query[0]->users->name_man." ".$Query[0]->users->surname2 }} @else Неизвестно @endif</h1>
80 <p class="thing__text">Сложно сказать, почему ключевые особенности структуры проекта рассмотрены 80 <p class="thing__text">Сложно сказать, почему ключевые особенности структуры проекта рассмотрены
81 исключительно в разрезе маркетинговых и финансовых предпосылок.</p> 81 исключительно в разрезе маркетинговых и финансовых предпосылок.</p>
82 <div class="main__resume-profile-about-buttons thing__bottom"> 82 <div class="main__resume-profile-about-buttons thing__bottom">
83 <button type="button" class="like js-toggle js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($Query[0]) }}" data-val="{{ $Query[0]->id }}" id="elem{{ $Query[0]->id }}" 83 <button type="button" class="like js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($Query[0]) }}" data-val="{{ $Query[0]->id }}" id="elem{{ $Query[0]->id }}"
84 name="header-like-button" 84 name="header-like-button"
85 > 85 >
86 <svg class="mr-10"> 86 <svg class="mr-10">
87 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 87 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
88 </svg> 88 </svg>
89 <span class="to-favorites">В избранное</span> 89 <span class="to-favorites">В избранное</span>
90 <span class="in-favorites">В избранном</span> 90 <span class="in-favorites">В избранном</span>
91 </button> 91 </button>
92 <div class="button button_light mr-10 main__resume-profile-about-button js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot }}" data-tuid="{{ $Query[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}'> 92 <div class="button button_light mr-10 main__resume-profile-about-button js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot }}" data-tuid="{{ $Query[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}'>
93 <svg> 93 <svg>
94 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> 94 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
95 </svg> 95 </svg>
96 Написать 96 Написать
97 </div> 97 </div>
98 <a class="button" href="{{ route('resume_download', ['worker' => $Query[0]->id]) }}" target="_blank"> 98 <a class="button" href="{{ route('resume_download', ['worker' => $Query[0]->id]) }}" target="_blank">
99 Скачать резюме 99 Скачать резюме
100 <svg> 100 <svg>
101 <use xlink:href="{{ asset('images/sprite.svg#download') }}"></use> 101 <use xlink:href="{{ asset('images/sprite.svg#download') }}"></use>
102 </svg> 102 </svg>
103 </a> 103 </a>
104 </div> 104 </div>
105 </div> 105 </div>
106 </div> 106 </div>
107 </div> 107 </div>
108 </section> 108 </section>
109 <main class="main"> 109 <main class="main">
110 <div class="container"> 110 <div class="container">
111 <div class="main__resume-profile"> 111 <div class="main__resume-profile">
112 <div class="main__content"> 112 <div class="main__content">
113 <div class="main__spoiler"> 113 <div class="main__spoiler">
114 <button type="button" class="main__spoiler-toper js-toggle active"> 114 <button type="button" class="main__spoiler-toper js-toggle active">
115 Основная информация</button> 115 Основная информация</button>
116 116
117 <div class="main__spoiler-body"> 117 <div class="main__spoiler-body">
118 <table class="main__table"> 118 <table class="main__table">
119 <tbody> 119 <tbody>
120 <tr> 120 <tr>
121 <td><b>Статус:</b></td> 121 <td><b>Статус:</b></td>
122 <td>{{ $status_work[$worker->status_work] }}</td> 122 <td>{{ $status_work[$worker->status_work] }}</td>
123 </tr> 123 </tr>
124 <tr> 124 <tr>
125 <td><b>ФИО:</b></td> 125 <td><b>ФИО:</b></td>
126 <td>{{ $worker->users->surname." ".$worker->users->name_man." ".$worker->users->surname2 }}</td> 126 <td>{{ $worker->users->surname." ".$worker->users->name_man." ".$worker->users->surname2 }}</td>
127 </tr> 127 </tr>
128 <tr> 128 <tr>
129 <td><b>Возраст:</b></td> 129 <td><b>Возраст:</b></td>
130 <td>{{ $worker->old_year ?? '-' }}</td> 130 <td>{{ $worker->old_year ?? '-' }}</td>
131 </tr> 131 </tr>
132 <tr> 132 <tr>
133 <td><b>Желаемые вакансии:</b></td> 133 <td><b>Желаемые вакансии:</b></td>
134 <td> 134 <td>
135 @if ($Query[0]->job_titles->count()) 135 @if ($Query[0]->job_titles->count())
136 @foreach ($Query[0]->job_titles as $it) 136 @foreach ($Query[0]->job_titles as $it)
137 @if ($it->is_remove == 0) 137 @if ($it->is_remove == 0)
138 {{ $it->name }} / 138 {{ $it->name }} /
139 @endif 139 @endif
140 @endforeach 140 @endforeach
141 @else 141 @else
142 - 142 -
143 @endif 143 @endif
144 </td> 144 </td>
145 </tr> 145 </tr>
146 <tr> 146 <tr>
147 <td><b>Пожелания по З/П:</b></td> 147 <td><b>Пожелания по З/П:</b></td>
148 <td>{{ $worker->salary_expectations ?? '-' }}</td> 148 <td>{{ $worker->salary_expectations ?? '-' }}</td>
149 </tr> 149 </tr>
150 <tr> 150 <tr>
151 <td><b>Опыт работы:</b></td> 151 <td><b>Опыт работы:</b></td>
152 <td>{{ $worker->experience ?? '-' }}</td> 152 <td>{{ $worker->experience ?? '-' }}</td>
153 </tr> 153 </tr>
154 <tr> 154 <tr>
155 <td><b>Уровень английского:</b></td> 155 <td><b>Уровень английского:</b></td>
156 <td>{{ $worker->english_level ?? '-' }}</td> 156 <td>{{ $worker->english_level ?? '-' }}</td>
157 </tr> 157 </tr>
158 <tr> 158 <tr>
159 <td><b>Дата готовности к посадке:</b></td> 159 <td><b>Дата готовности к посадке:</b></td>
160 <td>{{ $worker->ready_boart_date ?? '-' }}</td> 160 <td>{{ $worker->ready_boart_date ?? '-' }}</td>
161 </tr> 161 </tr>
162 <tr> 162 <tr>
163 <td><b>Предпочтение по типу судна:</b></td> 163 <td><b>Предпочтение по типу судна:</b></td>
164 <td>{{ $worker->boart_type_preference ?? '-' }}</td> 164 <td>{{ $worker->boart_type_preference ?? '-' }}</td>
165 </tr> 165 </tr>
166 <tr> 166 <tr>
167 <td><b>Наличие визы:</b></td> 167 <td><b>Наличие визы:</b></td>
168 <td>{{ $worker->visa_available ?? '-' }}</td> 168 <td>{{ $worker->visa_available ?? '-' }}</td>
169 </tr> 169 </tr>
170 <tr> 170 <tr>
171 <td><b>Наличие танкерных документов:</b></td> 171 <td><b>Наличие танкерных документов:</b></td>
172 <td>{{ $worker->tanker_documents_available ?? '-' }}</td> 172 <td>{{ $worker->tanker_documents_available ?? '-' }}</td>
173 </tr> 173 </tr>
174 <tr> 174 <tr>
175 <td><b>Наличие подтверждения для работы на ВВП:</b></td> 175 <td><b>Наличие подтверждения для работы на ВВП:</b></td>
176 <td>{{ $worker->confirmation_work_for_vvp ?? '-' }}</td> 176 <td>{{ $worker->confirmation_work_for_vvp ?? '-' }}</td>
177 </tr> 177 </tr>
178 <tr> 178 <tr>
179 <td><b>Наличие военного билета / приписного свидетельства:</b></td> 179 <td><b>Наличие военного билета / приписного свидетельства:</b></td>
180 <td>{{ $worker->military_id_available ?? '-' }}</td> 180 <td>{{ $worker->military_id_available ?? '-' }}</td>
181 </tr> 181 </tr>
182 <tr> 182 <tr>
183 <td><b>Город проживания:</b></td> 183 <td><b>Город проживания:</b></td>
184 <td>{{ $worker->city ?? '-' }}</td> 184 <td>{{ $worker->city ?? '-' }}</td>
185 </tr> 185 </tr>
186 <tr> 186 <tr>
187 <td><b>Телефон:</b></td> 187 <td><b>Телефон:</b></td>
188 <td>{{ $worker->telephone ?? '-' }}</td> 188 <td>{{ $worker->telephone ?? '-' }}</td>
189 </tr> 189 </tr>
190 <tr> 190 <tr>
191 <td><b>E-mail:</b></td> 191 <td><b>E-mail:</b></td>
192 <td>{{ $worker->email ?? '-' }}</td> 192 <td>{{ $worker->email ?? '-' }}</td>
193 </tr> 193 </tr>
194 <tr> 194 <tr>
195 <td><b>Контакты родственников:</b></td> 195 <td><b>Контакты родственников:</b></td>
196 <td>{{ $worker->telephone2 ?? '-' }}</td> 196 <td>{{ $worker->telephone2 ?? '-' }}</td>
197 </tr> 197 </tr>
198 </tbody> 198 </tbody>
199 </table> 199 </table>
200 </div> 200 </div>
201 </div> 201 </div>
202 202
203 <div class="main__spoiler"> 203 <div class="main__spoiler">
204 <button type="button" class="main__spoiler-toper js-toggle active">Сертификаты / документы</button> 204 <button type="button" class="main__spoiler-toper js-toggle active">Сертификаты / документы</button>
205 <div class="main__spoiler-body"> 205 <div class="main__spoiler-body">
206 206
207 @if (isset($Query[0]->sertificate)) 207 @if (isset($Query[0]->sertificate))
208 @if ($Query[0]->sertificate->count()) 208 @if ($Query[0]->sertificate->count())
209 <table class="main__table"> 209 <table class="main__table">
210 <tbody> 210 <tbody>
211 <tr> 211 <tr>
212 <td><b>Название сертификата:</b></td> 212 <td><b>Название сертификата:</b></td>
213 <td><b>Действителен до:</b></td> 213 <td><b>Действителен до:</b></td>
214 </tr> 214 </tr>
215 @foreach($Query[0]->sertificate as $it) 215 @foreach($Query[0]->sertificate as $it)
216 <tr> 216 <tr>
217 <td>{{ $it->name }}</td> 217 <td>{{ $it->name }}</td>
218 <td>{{ date('d.m.Y', strtotime($it->end_begin)) }}</td> 218 <td>{{ date('d.m.Y', strtotime($it->end_begin)) }}</td>
219 </tr> 219 </tr>
220 @endforeach 220 @endforeach
221 </tbody> 221 </tbody>
222 </table> 222 </table>
223 @endif 223 @endif
224 @endif 224 @endif
225 </div> 225 </div>
226 </div> 226 </div>
227 227
228 <div class="main__spoiler"> 228 <div class="main__spoiler">
229 <button type="button" class="main__spoiler-toper js-toggle active">Дополнительные документы</button> 229 <button type="button" class="main__spoiler-toper js-toggle active">Дополнительные документы</button>
230 <div class="main__spoiler-body"> 230 <div class="main__spoiler-body">
231 @if ($infoblocks->count()) 231 @if ($infoblocks->count())
232 <table class="main__table"> 232 <table class="main__table">
233 <tbody> 233 <tbody>
234 @foreach ($infoblocks as $info) 234 @foreach ($infoblocks as $info)
235 @php $finder = false; @endphp 235 @php $finder = false; @endphp
236 @if (isset($Query[0]->infobloks)) 236 @if (isset($Query[0]->infobloks))
237 @if ($Query[0]->infobloks->count()) 237 @if ($Query[0]->infobloks->count())
238 238
239 @foreach($Query[0]->infobloks as $it) 239 @foreach($Query[0]->infobloks as $it)
240 @if ($info->id == $it->id) 240 @if ($info->id == $it->id)
241 <tr> 241 <tr>
242 <td><b>{{ $it->name }}</b></td> 242 <td><b>{{ $it->name }}</b></td>
243 <td> 243 <td>
244 @if ($it->model_dop_info[0]->status == 0) Не указано 244 @if ($it->model_dop_info[0]->status == 0) Не указано
245 @elseif($it->model_dop_info[0]->status==1) В наличии 245 @elseif($it->model_dop_info[0]->status==1) В наличии
246 @else Отсутствует 246 @else Отсутствует
247 @endif 247 @endif
248 </td> 248 </td>
249 </tr> 249 </tr>
250 @php $finder = true; @endphp 250 @php $finder = true; @endphp
251 @endif 251 @endif
252 @endforeach 252 @endforeach
253 @endif 253 @endif
254 @endif 254 @endif
255 @if (!$finder) 255 @if (!$finder)
256 <tr> 256 <tr>
257 <td><b>{{ $info->name }}</b></td> 257 <td><b>{{ $info->name }}</b></td>
258 <td> 258 <td>
259 Не указано 259 Не указано
260 </td> 260 </td>
261 </tr> 261 </tr>
262 @endif 262 @endif
263 @endforeach 263 @endforeach
264 </tbody> 264 </tbody>
265 </table> 265 </table>
266 @endif 266 @endif
267 </div> 267 </div>
268 </div> 268 </div>
269 269
270 <div class="main__spoiler"> 270 <div class="main__spoiler">
271 <button type="button" class="main__spoiler-toper js-toggle active">Опыт работы</button> 271 <button type="button" class="main__spoiler-toper js-toggle active">Опыт работы</button>
272 <div class="main__spoiler-body"> 272 <div class="main__spoiler-body">
273 273
274 @if (isset($Query[0]->place_worker)) 274 @if (isset($Query[0]->place_worker))
275 @if ($Query[0]->place_worker->count()) 275 @if ($Query[0]->place_worker->count())
276 <table class="main__table"> 276 <table class="main__table">
277 <tbody> 277 <tbody>
278 <tr> 278 <tr>
279 <td><b>Должность:</b></td> 279 <td><b>Должность:</b></td>
280 <td><b>Название т/х:</b></td> 280 <td><b>Название т/х:</b></td>
281 <td><b>Тип судна:</b></td> 281 <td><b>Тип судна:</b></td>
282 <td><b>Марка ГД:</b></td> 282 <td><b>Марка ГД:</b></td>
283 <td><b>Мощность ГД (кВТ):</b></td> 283 <td><b>Мощность ГД (кВТ):</b></td>
284 <td><b>Водоизмещение (DWT):</b></td> 284 <td><b>Водоизмещение (DWT):</b></td>
285 <td><b>Название компании:</b></td> 285 <td><b>Название компании:</b></td>
286 <td><b>Начало контракта:</b></td> 286 <td><b>Начало контракта:</b></td>
287 <td><b>Окончание контракта:</b></td> 287 <td><b>Окончание контракта:</b></td>
288 </tr> 288 </tr>
289 @foreach($Query[0]->place_worker as $it) 289 @foreach($Query[0]->place_worker as $it)
290 <tr> 290 <tr>
291 <td>{{ $it->job_title }}</td> 291 <td>{{ $it->job_title }}</td>
292 <td>{{ $it->teplohod }}</td> 292 <td>{{ $it->teplohod }}</td>
293 <td>{{ $it->GWT }}</td> 293 <td>{{ $it->GWT }}</td>
294 <td>{{ $it->Marka_GD }}</td> 294 <td>{{ $it->Marka_GD }}</td>
295 <td>{{ $it->KBT }}</td> 295 <td>{{ $it->KBT }}</td>
296 <td>{{ $it->GRT }}</td> 296 <td>{{ $it->GRT }}</td>
297 <td>{{ $it->name_company }}</td> 297 <td>{{ $it->name_company }}</td>
298 <td>{{ date('d.m.Y', strtotime($it->begin_work)) }}</td> 298 <td>{{ date('d.m.Y', strtotime($it->begin_work)) }}</td>
299 <td>{{ date('d.m.Y', strtotime($it->end_work)) }}</td> 299 <td>{{ date('d.m.Y', strtotime($it->end_work)) }}</td>
300 </tr> 300 </tr>
301 @endforeach 301 @endforeach
302 </tbody> 302 </tbody>
303 </table> 303 </table>
304 @endif 304 @endif
305 @endif 305 @endif
306 </div> 306 </div>
307 </div> 307 </div>
308 308
309 <div class="main__spoiler"> 309 <div class="main__spoiler">
310 <button type="button" class="main__spoiler-toper js-toggle active">Данные о прошлых компаниях</button> 310 <button type="button" class="main__spoiler-toper js-toggle active">Данные о прошлых компаниях</button>
311 <div class="main__spoiler-body"> 311 <div class="main__spoiler-body">
312 @if ((isset($worker->prev_company)) && ($worker->prev_company->count())) 312 @if ((isset($worker->prev_company)) && ($worker->prev_company->count()))
313 <table class="main__table"> 313 <table class="main__table">
314 <tbody> 314 <tbody>
315 <tr> 315 <tr>
316 <td><b>Название компании:</b></td> 316 <td><b>Название компании:</b></td>
317 <td><b>ФИО сотрудника:</b></td> 317 <td><b>ФИО сотрудника:</b></td>
318 <td><b>Должность сотрудника:</b></td> 318 <td><b>Должность сотрудника:</b></td>
319 <td><b>Телефон сотрудника:</b></td> 319 <td><b>Телефон сотрудника:</b></td>
320 </tr> 320 </tr>
321 @foreach ($worker->prev_company as $prev_company) 321 @foreach ($worker->prev_company as $prev_company)
322 <tr> 322 <tr>
323 <td>{{ $prev_company->name_company }}</td> 323 <td>{{ $prev_company->name_company }}</td>
324 <td>{{ $prev_company->direct }}</td> 324 <td>{{ $prev_company->direct }}</td>
325 <td>{{ $prev_company->telephone }}</td> 325 <td>{{ $prev_company->telephone }}</td>
326 <td>{{ $prev_company->telephone2 }}</td> 326 <td>{{ $prev_company->telephone2 }}</td>
327 </tr> 327 </tr>
328 @endforeach 328 @endforeach
329 </tbody> 329 </tbody>
330 </table> 330 </table>
331 @endif 331 @endif
332 </div> 332 </div>
333 </div> 333 </div>
334 </div> 334 </div>
335 335
336 <div class="main__resume-profile-about"> 336 <div class="main__resume-profile-about">
337 <h2 class="main__resume-profile-about-title">О себе</h2> 337 <h2 class="main__resume-profile-about-title">О себе</h2>
338 <p class="main__resume-profile-about-text">{{ $Query[0]->text }}</p> 338 <p class="main__resume-profile-about-text">{{ $Query[0]->text }}</p>
339 @if (App\Classes\StatusUser::Status()==0) 339 @if (App\Classes\StatusUser::Status()==0)
340 @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message)) 340 @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message))
341 <div class="main__resume-profile-about-buttons flex width100"> 341 <div class="main__resume-profile-about-buttons flex width100">
342 <button type="button" class="like js-toggle active mr-10 js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($Query[0]) }}" 342 <button type="button" class="like mr-10 js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($Query[0]) }}"
343 name="footer-like-button" 343 name="footer-like-button"
344 > 344 >
345 <svg class="mr-10"> 345 <svg class="mr-10">
346 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 346 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
347 </svg> 347 </svg>
348 <span class="to-favorites">В избранное</span> 348 <span class="to-favorites">В избранное</span>
349 <span class="in-favorites">В избранном</span> 349 <span class="in-favorites">В избранном</span>
350 </button> 350 </button>
351 <div class="button button_light mr-10 main__resume-profile-about-button js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot }}" data-tuid="{{ $Query[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}'> 351 <div class="button button_light mr-10 main__resume-profile-about-button js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot }}" data-tuid="{{ $Query[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}'>
352 <svg> 352 <svg>
353 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> 353 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
354 </svg> 354 </svg>
355 Написать 355 Написать
356 </div> 356 </div>
357 <a class="button mr-10" href="{{ route('resume_download', ['worker' => $Query[0]->id]) }}"> 357 <a class="button mr-10" href="{{ route('resume_download', ['worker' => $Query[0]->id]) }}">
358 <svg> 358 <svg>
359 <use xlink:href="{{ asset('images/sprite.svg#download') }}"></use> 359 <use xlink:href="{{ asset('images/sprite.svg#download') }}"></use>
360 </svg> 360 </svg>
361 Скачать резюме 361 Скачать резюме
362 </a> 362 </a>
363 </div> 363 </div>
364 @endif 364 @endif
365 @endif 365 @endif
366 </div> 366 </div>
367 367
368 <div class="main__resume-profile-info"> 368 <div class="main__resume-profile-info">
369 <h2 class="main__resume-profile-info-title">Количество просмотров страницы: ({{ $stat[0]->lookin }})</h2> 369 <h2 class="main__resume-profile-info-title">Количество просмотров страницы: ({{ $stat[0]->lookin }})</h2>
370 </div> 370 </div>
371 371
372 <div class="main__resume-profile-info"> 372 <div class="main__resume-profile-info">
373 <h2 class="main__resume-profile-info-title">Отзывы о работнике ({{ $Query[0]->response->count() }})</h2> 373 <h2 class="main__resume-profile-info-title">Отзывы о работнике ({{ $Query[0]->response->count() }})</h2>
374 <div class="main__resume-profile-info-body"> 374 <div class="main__resume-profile-info-body">
375 @if ((isset($Query[0]->response)) && ($Query[0]->response->count())) 375 @if ((isset($Query[0]->response)) && ($Query[0]->response->count()))
376 <div class="main__resume-profile-info-body-item"> 376 <div class="main__resume-profile-info-body-item">
377 <ul class="main__resume-profile-info-body-inner"> 377 <ul class="main__resume-profile-info-body-inner">
378 @php $i = 1; @endphp 378 @php $i = 1; @endphp
379 @foreach($Query[0]->response as $it) 379 @foreach($Query[0]->response as $it)
380 <li> 380 <li>
381 <span><h3>Комментарий №{{$i}}</h3></span> 381 <span><h3>Комментарий №{{$i}}</h3></span>
382 <span><b>Оценка человека: {{ $it->stars }}</b></span> 382 <span><b>Оценка человека: {{ $it->stars }}</b></span>
383 <span><b>Сообщение: </b>{{ $it->message }}</span> 383 <span><b>Сообщение: </b>{{ $it->message }}</span>
384 </li> 384 </li>
385 @php $i++; @endphp 385 @php $i++; @endphp
386 @endforeach 386 @endforeach
387 </ul> 387 </ul>
388 </div> 388 </div>
389 @else 389 @else
390 <div class="main__resume-profile-info-body-item"> 390 <div class="main__resume-profile-info-body-item">
391 <h3 class="main__resume-profile-info-body-subtitle">Нету комментариев</h3> 391 <h3 class="main__resume-profile-info-body-subtitle">Нету комментариев</h3>
392 </div> 392 </div>
393 @endif 393 @endif
394 </div> 394 </div>
395 </div> 395 </div>
396 396
397 <div class="main__resume-profile-review"> 397 <div class="main__resume-profile-review">
398 <form action="{{ route('stars_answer') }}" method="POST"> 398 <form action="{{ route('stars_answer') }}" method="POST">
399 @csrf 399 @csrf
400 <h2 class="main__resume-profile-review-title">Оставить отзыв о работнике</h2> 400 <h2 class="main__resume-profile-review-title">Оставить отзыв о работнике</h2>
401 <div class="rate"> 401 <div class="rate">
402 <div class="rate__label">Ваша оценка:</div> 402 <div class="rate__label">Ваша оценка:</div>
403 <div class="rate__stars"> 403 <div class="rate__stars">
404 <select name="stars" id="stars" class="star-rating js-stars"> 404 <select name="stars" id="stars" class="star-rating js-stars">
405 <option value="5">5</option> 405 <option value="5">5</option>
406 <option value="4">4</option> 406 <option value="4">4</option>
407 <option value="3">3</option> 407 <option value="3">3</option>
408 <option value="2">2</option> 408 <option value="2">2</option>
409 <option value="1" selected>1</option> 409 <option value="1" selected>1</option>
410 </select> 410 </select>
411 </div> 411 </div>
412 </div> 412 </div>
413 <input type="hidden" name="worker_id" id="worker_id" value="{{ $Query[0]->id }}"/> 413 <input type="hidden" name="worker_id" id="worker_id" value="{{ $Query[0]->id }}"/>
414 <div class="main__resume-profile-review-body"> 414 <div class="main__resume-profile-review-body">
415 <h3>Ваш отзыв</h3> 415 <h3>Ваш отзыв</h3>
416 <textarea class="textarea" name="message" id="message" placeholder="Текст отзыва&hellip;" required></textarea> 416 <textarea class="textarea" name="message" id="message" placeholder="Текст отзыва&hellip;" required></textarea>
417 <button type="submit" class="button">Оставить отзыв</button> 417 <button type="submit" class="button">Оставить отзыв</button>
418 </div> 418 </div>
419 </form> 419 </form>
420 </div> 420 </div>
421 </div> 421 </div>
422 </div> 422 </div>
423 </main> 423 </main>
424 </div> 424 </div>
425 @endsection 425 @endsection
426 426