Commit 35796e00c66978af42f49c0058efd016fe9839af

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

Работа с блейдами работника

Showing 6 changed files with 67 additions and 11 deletions Inline Diff

app/Http/Controllers/WorkerController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Classes\RusDate; 5 use App\Classes\RusDate;
6 use App\Http\Requests\DocumentsRequest; 6 use App\Http\Requests\DocumentsRequest;
7 use App\Http\Requests\PrevCompanyRequest; 7 use App\Http\Requests\PrevCompanyRequest;
8 use App\Http\Requests\SertificationRequest; 8 use App\Http\Requests\SertificationRequest;
9 use App\Models\Ad_employer; 9 use App\Models\Ad_employer;
10 use App\Models\ad_response; 10 use App\Models\ad_response;
11 use App\Models\Category; 11 use App\Models\Category;
12 use App\Models\Dop_info; 12 use App\Models\Dop_info;
13 use App\Models\Employer; 13 use App\Models\Employer;
14 use App\Models\infobloks; 14 use App\Models\infobloks;
15 use App\Models\Job_title; 15 use App\Models\Job_title;
16 use App\Models\Like_vacancy; 16 use App\Models\Like_vacancy;
17 use App\Models\Like_worker; 17 use App\Models\Like_worker;
18 use App\Models\Message; 18 use App\Models\Message;
19 use App\Models\place_works; 19 use App\Models\place_works;
20 use App\Models\PrevCompany; 20 use App\Models\PrevCompany;
21 use App\Models\reclame; 21 use App\Models\reclame;
22 use App\Models\ResponseWork; 22 use App\Models\ResponseWork;
23 use App\Models\sertification; 23 use App\Models\sertification;
24 use App\Models\Static_worker; 24 use App\Models\Static_worker;
25 use App\Models\Title_worker; 25 use App\Models\Title_worker;
26 use App\Models\User; 26 use App\Models\User;
27 use App\Models\User as User_Model; 27 use App\Models\User as User_Model;
28 use App\Models\Worker; 28 use App\Models\Worker;
29 use Barryvdh\DomPDF\Facade\Pdf; 29 use Barryvdh\DomPDF\Facade\Pdf;
30 use Carbon\Carbon; 30 use Carbon\Carbon;
31 use Illuminate\Auth\Events\Registered; 31 use Illuminate\Auth\Events\Registered;
32 use Illuminate\Database\Eloquent\Builder; 32 use Illuminate\Database\Eloquent\Builder;
33 use Illuminate\Database\Eloquent\Model; 33 use Illuminate\Database\Eloquent\Model;
34 use Illuminate\Http\JsonResponse; 34 use Illuminate\Http\JsonResponse;
35 use Illuminate\Http\Request; 35 use Illuminate\Http\Request;
36 use Illuminate\Support\Facades\Auth; 36 use Illuminate\Support\Facades\Auth;
37 use Illuminate\Support\Facades\Hash; 37 use Illuminate\Support\Facades\Hash;
38 use Illuminate\Support\Facades\Storage; 38 use Illuminate\Support\Facades\Storage;
39 use Illuminate\Support\Facades\Validator; 39 use Illuminate\Support\Facades\Validator;
40 40
41 class WorkerController extends Controller 41 class WorkerController extends Controller
42 { 42 {
43 public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу'); 43 public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу');
44 44
45 //профиль 45 //профиль
46 public function profile(Worker $worker) 46 public function profile(Worker $worker)
47 { 47 {
48 $get_date = date('Y.m'); 48 $get_date = date('Y.m');
49 49
50 $c = Static_worker::query()->where('year_month', '=', $get_date) 50 $c = Static_worker::query()->where('year_month', '=', $get_date)
51 ->where('user_id', '=', $worker->users->id) 51 ->where('user_id', '=', $worker->users->id)
52 ->get(); 52 ->get();
53 53
54 if ($c->count() > 0) { 54 if ($c->count() > 0) {
55 $upd = Static_worker::find($c[0]->id); 55 $upd = Static_worker::find($c[0]->id);
56 $upd->lookin = $upd->lookin + 1; 56 $upd->lookin = $upd->lookin + 1;
57 $upd->save(); 57 $upd->save();
58 } else { 58 } else {
59 $crt = new Static_worker(); 59 $crt = new Static_worker();
60 $crt->lookin = 1; 60 $crt->lookin = 1;
61 $crt->year_month = $get_date; 61 $crt->year_month = $get_date;
62 $crt->user_id = $worker->user_id; 62 $crt->user_id = $worker->user_id;
63 $crt->save(); 63 $crt->save();
64 } 64 }
65 65
66 $stat = Static_worker::query()->where('year_month', '=', $get_date) 66 $stat = Static_worker::query()->where('year_month', '=', $get_date)
67 ->where('user_id', '=', $worker->users->id) 67 ->where('user_id', '=', $worker->users->id)
68 ->get(); 68 ->get();
69 69
70 return view('public.workers.profile', compact('worker', 'stat')); 70 return view('public.workers.profile', compact('worker', 'stat'));
71 } 71 }
72 72
73 // лист база резюме 73 // лист база резюме
74 public function bd_resume(Request $request) 74 public function bd_resume(Request $request)
75 { 75 {
76 $look = false; 76 $look = false;
77 $idiot = 0; 77 $idiot = 0;
78 if (isset(Auth()->user()->id)) { 78 if (isset(Auth()->user()->id)) {
79 $idiot = Auth()->user()->id; 79 $idiot = Auth()->user()->id;
80 if ((!Auth()->user()->is_worker) && (Auth()->user()->is_lookin)) 80 if ((!Auth()->user()->is_worker) && (Auth()->user()->is_lookin))
81 $look = true; 81 $look = true;
82 } 82 }
83 83
84 if ($look) { 84 if ($look) {
85 $status_work = $this->status_work; 85 $status_work = $this->status_work;
86 $resumes = Worker::query()->with('users')->with('job_titles'); 86 $resumes = Worker::query()->with('users')->with('job_titles');
87 $resumes = $resumes->whereHas('users', function (Builder $query) { 87 $resumes = $resumes->whereHas('users', function (Builder $query) {
88 $query->Where('is_worker', '=', '1') 88 $query->Where('is_worker', '=', '1')
89 ->Where('is_bd', '=', '0'); 89 ->Where('is_bd', '=', '0');
90 }); 90 });
91 91
92 //dd($request->get('job')); 92 //dd($request->get('job'));
93 if (($request->has('job')) && ($request->get('job') > 0)) { 93 if (($request->has('job')) && ($request->get('job') > 0)) {
94 $resumes = $resumes->whereHas('job_titles', function (Builder $query) use ($request) { 94 $resumes = $resumes->whereHas('job_titles', function (Builder $query) use ($request) {
95 $query->Where('job_titles.id', $request->get('job')); 95 $query->Where('job_titles.id', $request->get('job'));
96 }); 96 });
97 } 97 }
98 98
99 $Job_title = Job_title::query()-> 99 $Job_title = Job_title::query()->
100 where('is_remove', '=', '0')-> 100 where('is_remove', '=', '0')->
101 where('is_bd', '=' , '1')-> 101 where('is_bd', '=' , '1')->
102 get(); 102 get();
103 103
104 if ($request->get('sort')) { 104 if ($request->get('sort')) {
105 $sort = $request->get('sort'); 105 $sort = $request->get('sort');
106 switch ($sort) { 106 switch ($sort) {
107 case 'name_up': 107 case 'name_up':
108 $resumes = $resumes->orderBy(User::select('surname') 108 $resumes = $resumes->orderBy(User::select('surname')
109 ->whereColumn('Workers.user_id', 'users.id') 109 ->whereColumn('Workers.user_id', 'users.id')
110 ); 110 );
111 break; 111 break;
112 case 'name_down': 112 case 'name_down':
113 $resumes = $resumes->orderByDesc(User::select('surname') 113 $resumes = $resumes->orderByDesc(User::select('surname')
114 ->whereColumn('Workers.user_id', 'users.id') 114 ->whereColumn('Workers.user_id', 'users.id')
115 ); 115 );
116 break; 116 break;
117 case 'created_at_up': 117 case 'created_at_up':
118 $resumes = $resumes->OrderBy('created_at')->orderBy('id'); 118 $resumes = $resumes->OrderBy('created_at')->orderBy('id');
119 break; 119 break;
120 case 'created_at_down': 120 case 'created_at_down':
121 $resumes = $resumes->orderByDesc('created_at')->orderBy('id'); 121 $resumes = $resumes->orderByDesc('created_at')->orderBy('id');
122 break; 122 break;
123 case 'default': 123 case 'default':
124 $resumes = $resumes->orderBy('id')->orderby('updated_at'); 124 $resumes = $resumes->orderBy('id')->orderby('updated_at');
125 break; 125 break;
126 default: 126 default:
127 $resumes = $resumes->orderBy('id')->orderby('updated_at'); 127 $resumes = $resumes->orderBy('id')->orderby('updated_at');
128 break; 128 break;
129 } 129 }
130 } 130 }
131 131
132 $res_count = $resumes->count(); 132 $res_count = $resumes->count();
133 //$resumes = $resumes->get(); 133 //$resumes = $resumes->get();
134 $resumes = $resumes->paginate(4); 134 $resumes = $resumes->paginate(4);
135 if ($request->ajax()) { 135 if ($request->ajax()) {
136 // Условия обставлены 136 // Условия обставлены
137 if ($request->has('block') && ($request->get('block') == 1)) { 137 if ($request->has('block') && ($request->get('block') == 1)) {
138 return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot')); 138 return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot'));
139 } 139 }
140 140
141 if ($request->has('block') && ($request->get('block') == 2)) { 141 if ($request->has('block') && ($request->get('block') == 2)) {
142 return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot')); 142 return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot'));
143 } 143 }
144 } else { 144 } else {
145 return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot', 'Job_title')); 145 return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot', 'Job_title'));
146 } 146 }
147 } else { 147 } else {
148 return redirect()->route('index')->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]); 148 return redirect()->route('index')->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]);
149 } 149 }
150 } 150 }
151 151
152 //Лайк резюме 152 //Лайк резюме
153 public function like_controller() { 153 public function like_controller() {
154 154
155 } 155 }
156 156
157 // анкета соискателя 157 // анкета соискателя
158 public function resume_profile(Worker $worker) 158 public function resume_profile(Worker $worker)
159 { 159 {
160 if (isset(Auth()->user()->id)) { 160 if (isset(Auth()->user()->id)) {
161 $idiot = Auth()->user()->id; 161 $idiot = Auth()->user()->id;
162 } else { 162 } else {
163 $idiot = 0; 163 $idiot = 0;
164 } 164 }
165 165
166 $status_work = $this->status_work; 166 $status_work = $this->status_work;
167 $Query = Worker::query()->with('users')->with('job_titles') 167 $Query = Worker::query()->with('users')->with('job_titles')
168 ->with('place_worker')->with('sertificate')->with('prev_company') 168 ->with('place_worker')->with('sertificate')->with('prev_company')
169 ->with('infobloks')->with('response'); 169 ->with('infobloks')->with('response');
170 $Query = $Query->where('id', '=', $worker->id); 170 $Query = $Query->where('id', '=', $worker->id);
171 $Query = $Query->get(); 171 $Query = $Query->get();
172 172
173 $get_date = date('Y.m'); 173 $get_date = date('Y.m');
174 $c = Static_worker::query()->where('year_month', '=', $get_date) 174 $c = Static_worker::query()->where('year_month', '=', $get_date)
175 ->where('user_id', '=', $worker->user_id) 175 ->where('user_id', '=', $worker->user_id)
176 ->get(); 176 ->get();
177 177
178 if ($c->count() > 0) { 178 if ($c->count() > 0) {
179 $upd = Static_worker::find($c[0]->id); 179 $upd = Static_worker::find($c[0]->id);
180 $upd->lookin = $upd->lookin + 1; 180 $upd->lookin = $upd->lookin + 1;
181 $upd->save(); 181 $upd->save();
182 } else { 182 } else {
183 $crt = new Static_worker(); 183 $crt = new Static_worker();
184 $crt->lookin = 1; 184 $crt->lookin = 1;
185 $crt->year_month = $get_date; 185 $crt->year_month = $get_date;
186 $crt->user_id = $worker->user_id; 186 $crt->user_id = $worker->user_id;
187 $status = $crt->save(); 187 $status = $crt->save();
188 } 188 }
189 $stat = Static_worker::query()->where('year_month', '=', $get_date) 189 $stat = Static_worker::query()->where('year_month', '=', $get_date)
190 ->where('user_id', '=', $worker->user_id) 190 ->where('user_id', '=', $worker->user_id)
191 ->get(); 191 ->get();
192 192
193 return view('worker', compact('Query', 'status_work', 'idiot', 'stat')); 193 return view('worker', compact('Query', 'status_work', 'idiot', 'stat'));
194 } 194 }
195 195
196 // скачать анкету соискателя 196 // скачать анкету соискателя
197 public function resume_download(Worker $worker) 197 public function resume_download(Worker $worker)
198 { 198 {
199 $status_work = $this->status_work; 199 $status_work = $this->status_work;
200 $Query = Worker::query()->with('users')->with('job_titles') 200 $Query = Worker::query()->with('users')->with('job_titles')
201 ->with('place_worker')->with('sertificate')->with('prev_company') 201 ->with('place_worker')->with('sertificate')->with('prev_company')
202 ->with('infobloks'); 202 ->with('infobloks');
203 $Query = $Query->where('id', '=', $worker->id); 203 $Query = $Query->where('id', '=', $worker->id);
204 $Query = $Query->get()->toArray(); 204 $Query = $Query->get()->toArray();
205 205
206 view()->share('Query',$Query); 206 view()->share('Query',$Query);
207 207
208 208
209 $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape'); 209 $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape');
210 210
211 return $pdf->stream(); 211 return $pdf->stream();
212 } 212 }
213 213
214 public function resume_download_all() { 214 public function resume_download_all() {
215 $status_work = $this->status_work; 215 $status_work = $this->status_work;
216 $Query = Worker::query()->with('users')->with('job_titles') 216 $Query = Worker::query()->with('users')->with('job_titles')
217 ->with('place_worker')->with('sertificate')->with('prev_company') 217 ->with('place_worker')->with('sertificate')->with('prev_company')
218 ->with('infobloks')-> 218 ->with('infobloks')->
219 whereHas('users', function (Builder $query) { 219 whereHas('users', function (Builder $query) {
220 $query->Where('is_worker', '=', '1') 220 $query->Where('is_worker', '=', '1')
221 ->Where('is_bd', '=', '1'); 221 ->Where('is_bd', '=', '1');
222 }); 222 });
223 //$Query = $Query->where('id', '=', $worker->id); 223 //$Query = $Query->where('id', '=', $worker->id);
224 $Query = $Query->get()->toArray(); 224 $Query = $Query->get()->toArray();
225 225
226 view()->share('Query',$Query); 226 view()->share('Query',$Query);
227 227
228 $pdf = PDF::loadView('layout.pdf-list-people', $Query); //->setPaper('a4', 'landscape'); 228 $pdf = PDF::loadView('layout.pdf-list-people', $Query); //->setPaper('a4', 'landscape');
229 229
230 return $pdf->stream(); 230 return $pdf->stream();
231 } 231 }
232 232
233 // Кабинет работника 233 // Кабинет работника
234 public function cabinet(Request $request) 234 public function cabinet(Request $request)
235 { 235 {
236 // дата год и месяц 236 // дата год и месяц
237 $get_date = date('Y.m'); 237 $get_date = date('Y.m');
238 238
239 $id = Auth()->user()->id; 239 $id = Auth()->user()->id;
240 240
241 $Infobloks = infobloks::query()->get(); 241 $Infobloks = infobloks::query()->get();
242 242
243 $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')-> 243 $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')->
244 with('infobloks')->with('place_worker')-> 244 with('infobloks')->with('place_worker')->
245 WhereHas('users', 245 WhereHas('users',
246 function (Builder $query) use ($id) {$query->Where('id', $id); 246 function (Builder $query) use ($id) {$query->Where('id', $id);
247 })->get(); 247 })->get();
248 248
249 $Job_titles = Job_title::query()->where('is_remove', '=', '0')-> 249 $Job_titles = Job_title::query()->where('is_remove', '=', '0')->
250 where('is_bd', '=' , '1')-> 250 where('is_bd', '=' , '1')->
251 OrderByDesc('sort')->OrderBy('name')->get(); 251 OrderByDesc('sort')->OrderBy('name')->get();
252 $Infoblocks = infobloks::query()->OrderBy('name')->get(); 252 $Infoblocks = infobloks::query()->OrderBy('name')->get();
253 253
254 $stat = Static_worker::query()->where('year_month', '=', $get_date) 254 $stat = Static_worker::query()->where('year_month', '=', $get_date)
255 ->where('user_id', '=', $Worker[0]->id) 255 ->where('user_id', '=', $Worker[0]->id)
256 ->get(); 256 ->get();
257 257
258 // 10% 258 // 10%
259 259
260 $persent = 10; 260 $persent = 10;
261 $persent1 = 0; 261 $persent1 = 0;
262 $persent2 = 0; 262 $persent2 = 0;
263 $persent3 = 0; 263 $persent3 = 0;
264 $persent4 = 0; 264 $persent4 = 0;
265 $persent5 = 0; 265 $persent5 = 0;
266 266
267 if ((!empty($Worker[0]->telephone)) && 267 if ((!empty($Worker[0]->telephone)) &&
268 (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) && 268 (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) &&
269 (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) { 269 (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) {
270 // 40% 270 // 40%
271 $persent = $persent + 40; 271 $persent = $persent + 40;
272 $persent1 = 40; 272 $persent1 = 40;
273 } 273 }
274 274
275 //dd($Worker[0]->status_work, $Worker[0]->telephone, $Worker[0]->email, $Worker[0]->experience, $Worker[0]->city, $Worker[0]->old_year); 275 //dd($Worker[0]->status_work, $Worker[0]->telephone, $Worker[0]->email, $Worker[0]->experience, $Worker[0]->city, $Worker[0]->old_year);
276 276
277 if ($Worker[0]->sertificate->count() > 0) { 277 if ($Worker[0]->sertificate->count() > 0) {
278 // 15% 278 // 15%
279 $persent = $persent + 15; 279 $persent = $persent + 15;
280 $persent2 = 15; 280 $persent2 = 15;
281 } 281 }
282 282
283 if ($Worker[0]->infobloks->count() > 0) { 283 if ($Worker[0]->infobloks->count() > 0) {
284 // 20% 284 // 20%
285 $persent = $persent + 20; 285 $persent = $persent + 20;
286 $persent3 = 20; 286 $persent3 = 20;
287 } 287 }
288 288
289 if ($Worker[0]->prev_company->count() > 0) { 289 if ($Worker[0]->prev_company->count() > 0) {
290 // 10% 290 // 10%
291 $persent = $persent + 10; 291 $persent = $persent + 10;
292 $persent4 = 10; 292 $persent4 = 10;
293 } 293 }
294 294
295 if (!empty($Worker[0]->photo)) { 295 if (!empty($Worker[0]->photo)) {
296 // 5% 296 // 5%
297 $persent = $persent + 5; 297 $persent = $persent + 5;
298 $persent5 = 5; 298 $persent5 = 5;
299 } 299 }
300 if ($request->has('print')) { 300 if ($request->has('print')) {
301 dd($Worker); 301 dd($Worker);
302 } else { 302 } else {
303 return view('workers.cabinet', compact('Worker', 'Infobloks', 'persent', 'Job_titles', 'Infoblocks', 'stat')); 303 return view('workers.cabinet', compact('Worker', 'Infobloks', 'persent', 'Job_titles', 'Infoblocks', 'stat'));
304 } 304 }
305 } 305 }
306 306
307 // Сохранение данных 307 // Сохранение данных
308 public function cabinet_save(Worker $worker, Request $request) 308 public function cabinet_save(Worker $worker, Request $request)
309 { 309 {
310 $id = $worker->id; 310 $id = $worker->id;
311 $params = $request->all(); 311 $params = $request->all();
312 312
313 $job_title_id = $request->get('job_title_id'); 313 $job_title_id = $request->get('job_title_id');
314 314
315 unset($params['new_diplom']); 315 unset($params['new_diplom']);
316 unset($params['new_data_begin']); 316 unset($params['new_data_begin']);
317 unset($params['new_data_end']); 317 unset($params['new_data_end']);
318 unset($params['new_job_title']); 318 unset($params['new_job_title']);
319 unset($params['new_teplohod']); 319 unset($params['new_teplohod']);
320 unset($params['new_GWT']); 320 unset($params['new_GWT']);
321 unset($params['new_KBT']); 321 unset($params['new_KBT']);
322 unset($params['new_Begin_work']); 322 unset($params['new_Begin_work']);
323 unset($params['new_End_work']); 323 unset($params['new_End_work']);
324 unset($params['new_name_company']); 324 unset($params['new_name_company']);
325 325
326 $rules = [ 326 $rules = [
327 'surname' => ['required', 'string', 'max:255'], 327 'surname' => ['required', 'string', 'max:255'],
328 'name_man' => ['required', 'string', 'max:255'], 328 'name_man' => ['required', 'string', 'max:255'],
329 'email' => ['required', 'string', 'email', 'max:255'], 329 'email' => ['required', 'string', 'email', 'max:255'],
330 330
331 ]; 331 ];
332 332
333 $messages = [ 333 $messages = [
334 'required' => 'Укажите обязательное поле', 334 'required' => 'Укажите обязательное поле',
335 'min' => [ 335 'min' => [
336 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 336 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
337 'integer' => 'Поле «:attribute» должно быть :min или больше', 337 'integer' => 'Поле «:attribute» должно быть :min или больше',
338 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 338 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
339 ], 339 ],
340 'max' => [ 340 'max' => [
341 'string' => 'Поле «:attribute» должно быть не больше :max символов', 341 'string' => 'Поле «:attribute» должно быть не больше :max символов',
342 'integer' => 'Поле «:attribute» должно быть :max или меньше', 342 'integer' => 'Поле «:attribute» должно быть :max или меньше',
343 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 343 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
344 ] 344 ]
345 ]; 345 ];
346 346
347 $validator = Validator::make($params, $rules, $messages); 347 $validator = Validator::make($params, $rules, $messages);
348 348
349 if ($validator->fails()) { 349 if ($validator->fails()) {
350 return redirect()->route('worker.cabinet')->withErrors($validator); 350 return redirect()->route('worker.cabinet')->withErrors($validator);
351 } else { 351 } else {
352 352
353 if ($request->has('photo')) { 353 if ($request->has('photo')) {
354 if (!empty($Worker->photo)) { 354 if (!empty($Worker->photo)) {
355 Storage::delete($Worker->photo); 355 Storage::delete($Worker->photo);
356 } 356 }
357 $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); 357 $params['photo'] = $request->file('photo')->store("worker/$id", 'public');
358 } 358 }
359 359
360 if ($request->has('file')) { 360 if ($request->has('file')) {
361 if (!empty($Worker->file)) { 361 if (!empty($Worker->file)) {
362 Storage::delete($Worker->file); 362 Storage::delete($Worker->file);
363 } 363 }
364 $params['file'] = $request->file('file')->store("worker/$id", 'public'); 364 $params['file'] = $request->file('file')->store("worker/$id", 'public');
365 } 365 }
366 366
367 $id_wor = $worker->update($params); 367 $id_wor = $worker->update($params);
368 $use = User::find($worker->user_id); 368 $use = User::find($worker->user_id);
369 $use->surname = $request->get('surname'); 369 $use->surname = $request->get('surname');
370 $use->name_man = $request->get('name_man'); 370 $use->name_man = $request->get('name_man');
371 $use->surname2 = $request->get('surname2'); 371 $use->surname2 = $request->get('surname2');
372 372
373 $use->save(); 373 $use->save();
374 $worker->job_titles()->sync($job_title_id); 374 $worker->job_titles()->sync($job_title_id);
375 375
376 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); 376 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены');
377 } 377 }
378 } 378 }
379 379
380 // Сообщения данные 380 // Сообщения данные
381 public function messages($type_message) 381 public function messages($type_message)
382 { 382 {
383 $user_id = Auth()->user()->id; 383 $user_id = Auth()->user()->id;
384 384
385 $messages_input = Message::query()->with('vacancies')->with('user_from')-> 385 $messages_input = Message::query()->with('vacancies')->with('user_from')->
386 Where('to_user_id', $user_id)->OrderByDesc('created_at'); 386 Where('to_user_id', $user_id)->OrderByDesc('created_at');
387 387
388 $messages_output = Message::query()->with('vacancies')-> 388 $messages_output = Message::query()->with('vacancies')->
389 with('user_to')->where('user_id', $user_id)-> 389 with('user_to')->where('user_id', $user_id)->
390 OrderByDesc('created_at'); 390 OrderByDesc('created_at');
391 391
392
393 $count_input = $messages_input->count(); 392 $count_input = $messages_input->count();
394 $count_output = $messages_output->count(); 393 $count_output = $messages_output->count();
395 394
396 if ($type_message == 'input') { 395 if ($type_message == 'input') {
397 $messages = $messages_input->paginate(5); 396 $messages = $messages_input->paginate(5);
398 } 397 }
399 398
400 if ($type_message == 'output') { 399 if ($type_message == 'output') {
401 $messages = $messages_output->paginate(5); 400 $messages = $messages_output->paginate(5);
402 } 401 }
403 402
403 //dd($messages);
404 // Вернуть все 100% 404 // Вернуть все 100%
405 return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); 405 return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id'));
406 } 406 }
407 407
408 // Избранный 408 // Избранный
409 public function favorite() 409 public function favorite()
410 { 410 {
411 return view('workers.favorite'); 411 return view('workers.favorite');
412 } 412 }
413 413
414 // Сменить пароль 414 // Сменить пароль
415 public function new_password() 415 public function new_password()
416 { 416 {
417 $email = Auth()->user()->email; 417 $email = Auth()->user()->email;
418 return view('workers.new_password', compact('email')); 418 return view('workers.new_password', compact('email'));
419 } 419 }
420 420
421 // Обновление пароля 421 // Обновление пароля
422 public function save_new_password(Request $request) { 422 public function save_new_password(Request $request) {
423 $use = Auth()->user(); 423 $use = Auth()->user();
424 $request->validate([ 424 $request->validate([
425 'password' => 'required|string', 425 'password' => 'required|string',
426 'new_password' => 'required|string', 426 'new_password' => 'required|string',
427 'new_password2' => 'required|string' 427 'new_password2' => 'required|string'
428 ]); 428 ]);
429 429
430 if ($request->get('new_password') == $request->get('new_password2')) 430 if ($request->get('new_password') == $request->get('new_password2'))
431 if ($request->get('password') !== $request->get('new_password')) { 431 if ($request->get('password') !== $request->get('new_password')) {
432 $credentials = $request->only('email', 'password'); 432 $credentials = $request->only('email', 'password');
433 if (Auth::attempt($credentials, $request->has('save_me'))) { 433 if (Auth::attempt($credentials, $request->has('save_me'))) {
434 434
435 if (!is_null($use->email_verified_at)){ 435 if (!is_null($use->email_verified_at)){
436 436
437 $user_data = User_Model::find($use->id); 437 $user_data = User_Model::find($use->id);
438 $user_data->update([ 438 $user_data->update([
439 'password' => Hash::make($request->get('new_password')), 439 'password' => Hash::make($request->get('new_password')),
440 'pubpassword' => base64_encode($request->get('new_password')), 440 'pubpassword' => base64_encode($request->get('new_password')),
441 ]); 441 ]);
442 return redirect() 442 return redirect()
443 ->route('worker.new_password') 443 ->route('worker.new_password')
444 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 444 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
445 } 445 }
446 446
447 return redirect() 447 return redirect()
448 ->route('worker.new_password') 448 ->route('worker.new_password')
449 ->withError('Данная учетная запись не было верифицированна!'); 449 ->withError('Данная учетная запись не было верифицированна!');
450 } 450 }
451 } 451 }
452 452
453 return redirect() 453 return redirect()
454 ->route('worker.new_password') 454 ->route('worker.new_password')
455 ->withErrors('Не совпадение данных, обновите пароли!'); 455 ->withErrors('Не совпадение данных, обновите пароли!');
456 } 456 }
457 457
458 // Удаление профиля форма 458 // Удаление профиля форма
459 public function delete_profile() 459 public function delete_profile()
460 { 460 {
461 $login = Auth()->user()->email; 461 $login = Auth()->user()->email;
462 return view('workers.delete_profile', compact('login')); 462 return view('workers.delete_profile', compact('login'));
463 } 463 }
464 464
465 // Удаление профиля код 465 // Удаление профиля код
466 public function delete_profile_result(Request $request) { 466 public function delete_profile_result(Request $request) {
467 $Answer = $request->all(); 467 $Answer = $request->all();
468 $user_id = Auth()->user()->id; 468 $user_id = Auth()->user()->id;
469 $request->validate([ 469 $request->validate([
470 'password' => 'required|string', 470 'password' => 'required|string',
471 ]); 471 ]);
472 472
473 $credentials = $request->only('email', 'password'); 473 $credentials = $request->only('email', 'password');
474 if (Auth::attempt($credentials)) { 474 if (Auth::attempt($credentials)) {
475 Auth::logout(); 475 Auth::logout();
476 $it = User_Model::find($user_id); 476 $it = User_Model::find($user_id);
477 $it->delete(); 477 $it->delete();
478 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 478 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
479 } else { 479 } else {
480 return redirect()->route('worker.delete_profile') 480 return redirect()->route('worker.delete_profile')
481 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 481 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
482 } 482 }
483 } 483 }
484 484
485 // Регистрация соискателя 485 // Регистрация соискателя
486 public function register_worker(Request $request) 486 public function register_worker(Request $request)
487 { 487 {
488 $params = $request->all(); 488 $params = $request->all();
489 $params['is_worker'] = 1; 489 $params['is_worker'] = 1;
490 490
491 $rules = [ 491 $rules = [
492 'surname' => ['required', 'string', 'max:255'], 492 'surname' => ['required', 'string', 'max:255'],
493 'name_man' => ['required', 'string', 'max:255'], 493 'name_man' => ['required', 'string', 'max:255'],
494 'email' => ['required', 'email', 'max:255', 'unique:users'], 494 'email' => ['required', 'email', 'max:255', 'unique:users'],
495 'password' => ['required', 'string', 'min:6'] 495 'password' => ['required', 'string', 'min:6']
496 ]; 496 ];
497 497
498 $messages = [ 498 $messages = [
499 'required' => 'Укажите обязательное поле', 499 'required' => 'Укажите обязательное поле',
500 'min' => [ 500 'min' => [
501 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 501 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
502 'integer' => 'Поле «:attribute» должно быть :min или больше', 502 'integer' => 'Поле «:attribute» должно быть :min или больше',
503 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 503 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
504 ], 504 ],
505 'max' => [ 505 'max' => [
506 'string' => 'Поле «:attribute» должно быть не больше :max символов', 506 'string' => 'Поле «:attribute» должно быть не больше :max символов',
507 'integer' => 'Поле «:attribute» должно быть :max или меньше', 507 'integer' => 'Поле «:attribute» должно быть :max или меньше',
508 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 508 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
509 ] 509 ]
510 ]; 510 ];
511 511
512 $email = $request->get('email'); 512 $email = $request->get('email');
513 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { 513 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) {
514 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); 514 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл"));
515 } 515 }
516 516
517 if ($request->get('password') !== $request->get('confirmed')){ 517 if ($request->get('password') !== $request->get('confirmed')){
518 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 518 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
519 } 519 }
520 520
521 if (strlen($request->get('password')) < 6) { 521 if (strlen($request->get('password')) < 6) {
522 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); 522 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
523 } 523 }
524 524
525 /*$haystack = $request->get('password'); 525 /*$haystack = $request->get('password');
526 526
527 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); 527 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?');
528 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 528 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z',
529 'X', 'C', 'V', 'B', 'N', 'M'); 529 'X', 'C', 'V', 'B', 'N', 'M');
530 $lenpwd_bool = true; 530 $lenpwd_bool = true;
531 $spec_bool = false; 531 $spec_bool = false;
532 $alpha_bool = false; 532 $alpha_bool = false;
533 533
534 if (strlen($haystack) < 8) $lenpwd_bool = false; 534 if (strlen($haystack) < 8) $lenpwd_bool = false;
535 535
536 foreach ($specsumbol as $it) { 536 foreach ($specsumbol as $it) {
537 if (strpos($haystack, $it) !== false) { 537 if (strpos($haystack, $it) !== false) {
538 $spec_bool = true; 538 $spec_bool = true;
539 } 539 }
540 } 540 }
541 541
542 foreach ($alpha as $it) { 542 foreach ($alpha as $it) {
543 if (strpos($haystack, $it) !== false) { 543 if (strpos($haystack, $it) !== false) {
544 $alpha_bool = true; 544 $alpha_bool = true;
545 } 545 }
546 } 546 }
547 547
548 if ((!$spec_bool) || (!$alpha_bool)) { 548 if ((!$spec_bool) || (!$alpha_bool)) {
549 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); 549 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?"));
550 }*/ 550 }*/
551 551
552 if (($request->has('politik')) && ($request->get('politik') == 1)) { 552 if (($request->has('politik')) && ($request->get('politik') == 1)) {
553 $validator = Validator::make($params, $rules, $messages); 553 $validator = Validator::make($params, $rules, $messages);
554 554
555 if ($validator->fails()) { 555 if ($validator->fails()) {
556 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 556 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
557 } else { 557 } else {
558 //dd($params); 558 //dd($params);
559 $user = $this->create($params); 559 $user = $this->create($params);
560 event(new Registered($user)); 560 event(new Registered($user));
561 Auth::guard()->login($user); 561 Auth::guard()->login($user);
562 } 562 }
563 if ($user) { 563 if ($user) {
564 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; 564 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));;
565 } else { 565 } else {
566 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 566 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
567 } 567 }
568 568
569 } else { 569 } else {
570 return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!")); 570 return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!"));
571 } 571 }
572 } 572 }
573 573
574 // Звездная оценка и ответ 574 // Звездная оценка и ответ
575 public function stars_answer(Request $request) { 575 public function stars_answer(Request $request) {
576 $params = $request->all(); 576 $params = $request->all();
577 $rules = [ 577 $rules = [
578 'message' => ['required', 'string', 'max:255'], 578 'message' => ['required', 'string', 'max:255'],
579 ]; 579 ];
580 580
581 $messages = [ 581 $messages = [
582 'required' => 'Укажите обязательное поле', 582 'required' => 'Укажите обязательное поле',
583 'min' => [ 583 'min' => [
584 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 584 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
585 'integer' => 'Поле «:attribute» должно быть :min или больше', 585 'integer' => 'Поле «:attribute» должно быть :min или больше',
586 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 586 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
587 ], 587 ],
588 'max' => [ 588 'max' => [
589 'string' => 'Поле «:attribute» должно быть не больше :max символов', 589 'string' => 'Поле «:attribute» должно быть не больше :max символов',
590 'integer' => 'Поле «:attribute» должно быть :max или меньше', 590 'integer' => 'Поле «:attribute» должно быть :max или меньше',
591 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 591 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
592 ] 592 ]
593 ]; 593 ];
594 $response_worker = ResponseWork::create($params); 594 $response_worker = ResponseWork::create($params);
595 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); 595 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!');
596 } 596 }
597 597
598 public function TestWorker() 598 public function TestWorker()
599 { 599 {
600 $Use = new User(); 600 $Use = new User();
601 601
602 $Code_user = $Use->create([ 602 $Code_user = $Use->create([
603 'name' => 'surname name_man', 603 'name' => 'surname name_man',
604 'name_man' => 'name_man', 604 'name_man' => 'name_man',
605 'surname' => 'surname', 605 'surname' => 'surname',
606 'surname2' => 'surname2', 606 'surname2' => 'surname2',
607 'subscribe_email' => '1', 607 'subscribe_email' => '1',
608 'email' => 'email@mail.com', 608 'email' => 'email@mail.com',
609 'telephone' => '1234567890', 609 'telephone' => '1234567890',
610 'password' => Hash::make('password'), 610 'password' => Hash::make('password'),
611 'pubpassword' => base64_encode('password'), 611 'pubpassword' => base64_encode('password'),
612 'email_verified_at' => Carbon::now(), 612 'email_verified_at' => Carbon::now(),
613 'is_worker' => 1, 613 'is_worker' => 1,
614 ]); 614 ]);
615 615
616 if ($Code_user->id > 0) { 616 if ($Code_user->id > 0) {
617 $Worker = new Worker(); 617 $Worker = new Worker();
618 $Worker->user_id = $Code_user->id; 618 $Worker->user_id = $Code_user->id;
619 $Worker->position_work = 1; //'job_titles'; 619 $Worker->position_work = 1; //'job_titles';
620 $Worker->email = 'email@email.com'; 620 $Worker->email = 'email@email.com';
621 $Worker->telephone = '1234567890'; 621 $Worker->telephone = '1234567890';
622 $status = $Worker->save(); 622 $status = $Worker->save();
623 623
624 $Title_Worker = new Title_worker(); 624 $Title_Worker = new Title_worker();
625 $Title_Worker->worker_id = $Worker->id; 625 $Title_Worker->worker_id = $Worker->id;
626 $Title_Worker->job_title_id = 1; 626 $Title_Worker->job_title_id = 1;
627 $Title_Worker->save(); 627 $Title_Worker->save();
628 } 628 }
629 } 629 }
630 630
631 // Создание пользователя 631 // Создание пользователя
632 protected function create(array $data) 632 protected function create(array $data)
633 { 633 {
634 $Use = new User(); 634 $Use = new User();
635 635
636 $Code_user = $Use->create([ 636 $Code_user = $Use->create([
637 'name' => $data['surname']." ".$data['name_man'], 637 'name' => $data['surname']." ".$data['name_man'],
638 'name_man' => $data['name_man'], 638 'name_man' => $data['name_man'],
639 'surname' => $data['surname'], 639 'surname' => $data['surname'],
640 'surname2' => $data['surname2'], 640 'surname2' => $data['surname2'],
641 'subscribe_email' => $data['email'], 641 'subscribe_email' => $data['email'],
642 'email' => $data['email'], 642 'email' => $data['email'],
643 'telephone' => $data['telephone'], 643 'telephone' => $data['telephone'],
644 'password' => Hash::make($data['password']), 644 'password' => Hash::make($data['password']),
645 'pubpassword' => base64_encode($data['password']), 645 'pubpassword' => base64_encode($data['password']),
646 'email_verified_at' => Carbon::now(), 646 'email_verified_at' => Carbon::now(),
647 'is_worker' => $data['is_worker'], 647 'is_worker' => $data['is_worker'],
648 ]); 648 ]);
649 649
650 if ($Code_user->id > 0) { 650 if ($Code_user->id > 0) {
651 $Worker = new Worker(); 651 $Worker = new Worker();
652 $Worker->user_id = $Code_user->id; 652 $Worker->user_id = $Code_user->id;
653 $Worker->position_work = $data['job_titles']; 653 $Worker->position_work = $data['job_titles'];
654 $Worker->email = $data['email']; 654 $Worker->email = $data['email'];
655 $Worker->telephone = $data['telephone']; 655 $Worker->telephone = $data['telephone'];
656 $Worker->save(); 656 $Worker->save();
657 657
658 if (isset($Worker->id)) { 658 if (isset($Worker->id)) {
659 $Title_Worker = new Title_worker(); 659 $Title_Worker = new Title_worker();
660 $Title_Worker->worker_id = $Worker->id; 660 $Title_Worker->worker_id = $Worker->id;
661 $Title_Worker->job_title_id = $data['job_titles']; 661 $Title_Worker->job_title_id = $data['job_titles'];
662 $Title_Worker->save(); 662 $Title_Worker->save();
663 } 663 }
664 664
665 return $Code_user; 665 return $Code_user;
666 } 666 }
667 } 667 }
668 668
669 // Вакансии избранные 669 // Вакансии избранные
670 public function colorado(Request $request) { 670 public function colorado(Request $request) {
671 $IP_address = RusDate::ip_addr_client(); 671 $IP_address = RusDate::ip_addr_client();
672 $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); 672 $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get();
673 673
674 if ($Arr->count()) { 674 if ($Arr->count()) {
675 $A = Array(); 675 $A = Array();
676 foreach ($Arr as $it) { 676 foreach ($Arr as $it) {
677 $A[] = $it->code_record; 677 $A[] = $it->code_record;
678 } 678 }
679 679
680 $Query = Ad_employer::query()->whereIn('id', $A); 680 $Query = Ad_employer::query()->whereIn('id', $A);
681 } else { 681 } else {
682 $Query = Ad_employer::query()->where('id', '=', '0'); 682 $Query = Ad_employer::query()->where('id', '=', '0');
683 } 683 }
684 684
685 $Query = $Query->with('jobs')-> 685 $Query = $Query->with('jobs')->
686 with('cat')-> 686 with('cat')->
687 with('employer')-> 687 with('employer')->
688 whereHas('jobs_code', function ($query) use ($request) { 688 whereHas('jobs_code', function ($query) use ($request) {
689 if ($request->ajax()) { 689 if ($request->ajax()) {
690 if (null !== ($request->get('job'))) { 690 if (null !== ($request->get('job'))) {
691 $query->where('job_title_id', $request->get('job')); 691 $query->where('job_title_id', $request->get('job'));
692 } 692 }
693 } 693 }
694 })->select('ad_employers.*'); 694 })->select('ad_employers.*');
695 695
696 $Job_title = Job_title::query()->OrderBy('name')->get(); 696 $Job_title = Job_title::query()->OrderBy('name')->get();
697 697
698 $Query_count = $Query->count(); 698 $Query_count = $Query->count();
699 699
700 $Query = $Query->OrderBy('updated_at')->paginate(3); 700 $Query = $Query->OrderBy('updated_at')->paginate(3);
701 701
702 702
703 return view('workers.favorite', compact('Query', 703 return view('workers.favorite', compact('Query',
704 'Query_count', 704 'Query_count',
705 'Job_title')); 705 'Job_title'));
706 706
707 } 707 }
708 708
709 //Переписка 709 //Переписка
710 public function dialog(User_Model $user1, User_Model $user2) { 710 public function dialog(User_Model $user1, User_Model $user2, Request $request) {
711 // Получение параметров.
712 if ($request->has('ad_employer')){
713 $ad_employer = $request->get('ad_employer');
714 } else {
715 $ad_employer = 0;
716 }
717
711 if (isset($user2->id)) { 718 if (isset($user2->id)) {
712 $companion = User_Model::query()->with('workers')-> 719 $companion = User_Model::query()->with('workers')->
713 with('employers')-> 720 with('employers')->
714 where('id', $user2->id)->first(); 721 where('id', $user2->id)->first();
715 } 722 }
716 723
717 $Messages = Message::query()-> 724 $Messages = Message::query()->
718 //with('response')-> 725 //with('response')->
719 where(function($query) use ($user1, $user2) { 726 where(function($query) use ($user1, $user2) {
720 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); 727 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id);
721 })->orWhere(function($query) use ($user1, $user2) { 728 })->orWhere(function($query) use ($user1, $user2) {
722 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); 729 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id);
723 })->OrderBy('created_at')->get(); 730 })->OrderBy('created_at')->get();
724 731
725 $id_vac = null; 732 $id_vac = null;
726 /*foreach ($Messages as $it) { 733 /*foreach ($Messages as $it) {
727 if (isset($it->response)) { 734 if (isset($it->response)) {
728 foreach ($it->response as $r) { 735 foreach ($it->response as $r) {
729 if (isset($r->ad_employer_id)) { 736 if (isset($r->ad_employer_id)) {
730 $id_vac = $r->ad_employer_id; 737 $id_vac = $r->ad_employer_id;
731 break; 738 break;
732 } 739 }
733 } 740 }
734 } 741 }
735 if (!is_null($id_vac)) break; 742 if (!is_null($id_vac)) break;
736 }*/ 743 }*/
737 744
738 $ad_employer = null; 745 //$ad_employer = null;
739 if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); 746 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first();
740 $sender = $user1; 747 $sender = $user1;
741 748
749
742 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); 750 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer'));
743 } 751 }
744 752
745 // Даунылоады 753 // Даунылоады
746 public function download(Worker $worker) { 754 public function download(Worker $worker) {
747 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; 755 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...'];
748 view()->share('house',$arr_house); 756 view()->share('house',$arr_house);
749 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); 757 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape');
750 return $pdf->stream(); 758 return $pdf->stream();
751 } 759 }
752 760
753 // Поднятие анкеты 761 // Поднятие анкеты
754 public function up(Worker $worker) { 762 public function up(Worker $worker) {
755 $worker->updated_at = Carbon::now(); 763 $worker->updated_at = Carbon::now();
756 $worker->save(); 764 $worker->save();
757 // 0 765 // 0
758 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); 766 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных');
759 } 767 }
760 768
761 // Форма сертификате 769 // Форма сертификате
762 public function new_sertificate(Worker $worker) { 770 public function new_sertificate(Worker $worker) {
763 return view('workers.sertificate_add', compact('worker')); 771 return view('workers.sertificate_add', compact('worker'));
764 } 772 }
765 773
766 // Добавление сертификата 774 // Добавление сертификата
767 public function add_serificate(SertificationRequest $request) { 775 public function add_serificate(SertificationRequest $request) {
768 $params = $request->all(); 776 $params = $request->all();
769 777
770 $Sertificate = new sertification(); 778 $Sertificate = new sertification();
771 $Sertificate->create($params); 779 $Sertificate->create($params);
772 $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get(); 780 $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get();
773 return redirect()->route('worker.cabinet'); 781 return redirect()->route('worker.cabinet');
774 //return view('ajax.documents', compact('Docs')); 782 //return view('ajax.documents', compact('Docs'));
775 } 783 }
776 784
777 // Удалить сертификат 785 // Удалить сертификат
778 public function delete_sertificate(sertification $doc) { 786 public function delete_sertificate(sertification $doc) {
779 $doc->delete(); 787 $doc->delete();
780 788
781 return redirect()->route('worker.cabinet'); 789 return redirect()->route('worker.cabinet');
782 } 790 }
783 791
784 // Редактирование сертификата 792 // Редактирование сертификата
785 public function edit_sertificate(Worker $worker, sertification $doc) { 793 public function edit_sertificate(Worker $worker, sertification $doc) {
786 return view('workers.sertificate_edit', compact('doc', 'worker')); 794 return view('workers.sertificate_edit', compact('doc', 'worker'));
787 } 795 }
788 796
789 // Редактирование обновление сертификата 797 // Редактирование обновление сертификата
790 public function update_serificate(SertificationRequest $request, sertification $doc) { 798 public function update_serificate(SertificationRequest $request, sertification $doc) {
791 $all = $request->all(); 799 $all = $request->all();
792 $doc->worker_id = $all['worker_id']; 800 $doc->worker_id = $all['worker_id'];
793 $doc->name = $all['name']; 801 $doc->name = $all['name'];
794 $doc->end_begin = $all['end_begin']; 802 $doc->end_begin = $all['end_begin'];
795 $doc->save(); 803 $doc->save();
796 804
797 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); 805 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!');
798 } 806 }
799 807
800 public function delete_add_diplom(Request $request, Worker $worker) { 808 public function delete_add_diplom(Request $request, Worker $worker) {
801 $infoblok_id = $request->get('infoblok_id'); 809 $infoblok_id = $request->get('infoblok_id');
802 810
803 if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0) 811 if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0)
804 $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete(); 812 $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete();
805 else { 813 else {
806 $params['infoblok_id'] = $infoblok_id; 814 $params['infoblok_id'] = $infoblok_id;
807 $params['worker_id'] = $worker->id; 815 $params['worker_id'] = $worker->id;
808 $params['status'] = $request->get('val'); 816 $params['status'] = $request->get('val');
809 $id = Dop_info::create($params); 817 $id = Dop_info::create($params);
810 //$id = $worker->infobloks()->sync([$infoblok_id]); 818 //$id = $worker->infobloks()->sync([$infoblok_id]);
811 } 819 }
812 820
813 //$Infoblocks = infobloks::query()->get(); 821 //$Infoblocks = infobloks::query()->get();
814 return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks')); 822 return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks'));
815 } 823 }
816 824
817 825
818 826
819 // Добавление диплома 827 // Добавление диплома
820 public function add_diplom_ajax(Request $request) { 828 public function add_diplom_ajax(Request $request) {
821 // конец 829 // конец
822 $params = $request->all(); 830 $params = $request->all();
823 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 831 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
824 832
825 if ($count == 0) $dop_info = Dop_info::create($params); 833 if ($count == 0) $dop_info = Dop_info::create($params);
826 $Infoblocks = infobloks::query()->get(); 834 $Infoblocks = infobloks::query()->get();
827 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); 835 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get();
828 $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); 836 $data = Dop_info::query()->where('worker_id', $request->has('worker_id'));
829 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); 837 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker'));
830 } 838 }
831 839
832 // Добавление диплома без ajax 840 // Добавление диплома без ajax
833 public function add_diplom(Worker $worker) { 841 public function add_diplom(Worker $worker) {
834 $worker_id = $worker->id; 842 $worker_id = $worker->id;
835 $Infoblocks = infobloks::query()->get(); 843 $Infoblocks = infobloks::query()->get();
836 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); 844 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks'));
837 } 845 }
838 // Сохранить 846 // Сохранить
839 // Сохраняю диплом 847 // Сохраняю диплом
840 public function add_diplom_save(Request $request) { 848 public function add_diplom_save(Request $request) {
841 $params = $request->all(); 849 $params = $request->all();
842 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 850 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
843 if ($count == 0) $dop_info = Dop_info::create($params); 851 if ($count == 0) $dop_info = Dop_info::create($params);
844 return redirect()->route('worker.cabinet'); 852 return redirect()->route('worker.cabinet');
845 } 853 }
846 854
847 // Добавление стандартного документа 855 // Добавление стандартного документа
848 public function add_document(Worker $worker) { 856 public function add_document(Worker $worker) {
849 return view('workers.docs', compact('worker')); 857 return view('workers.docs', compact('worker'));
850 } 858 }
851 859
852 //Сохранение стандартого документа 860 //Сохранение стандартого документа
853 public function add_document_save(DocumentsRequest $request) { 861 public function add_document_save(DocumentsRequest $request) {
854 $params = $request->all(); 862 $params = $request->all();
855 $place_work = place_works::create($params); 863 $place_work = place_works::create($params);
856 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!'); 864 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!');
857 } 865 }
858 866
859 // Редактирование документа 867 // Редактирование документа
860 public function edit_document(place_works $doc, Worker $worker) { 868 public function edit_document(place_works $doc, Worker $worker) {
861 return view('workers.docs-edit', compact('doc', 'worker')); 869 return view('workers.docs-edit', compact('doc', 'worker'));
862 } 870 }
863 871
864 //Сохранение отредактированного документа 872 //Сохранение отредактированного документа
865 public function edit_document_save(DocumentsRequest $request, place_works $doc) { 873 public function edit_document_save(DocumentsRequest $request, place_works $doc) {
866 $params = $request->all(); 874 $params = $request->all();
867 $doc->update($params); 875 $doc->update($params);
868 876
869 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); 877 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!');
870 } 878 }
871 879
872 // Удаление документа 880 // Удаление документа
873 public function delete_document(place_works $doc) { 881 public function delete_document(place_works $doc) {
874 $doc->delete(); 882 $doc->delete();
875 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); 883 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!');
876 } 884 }
877 885
878 //Отправка нового сообщения 886 //Отправка нового сообщения
879 public function new_message(Request $request) { 887 public function new_message(Request $request) {
880 $params = $request->all(); 888 $params = $request->all();
881 889
882 $id = $params['send_user_id']; 890 $id = $params['send_user_id'];
883 $message = new Message(); 891 $message = new Message();
884 $message->user_id = $params['send_user_id']; 892 $message->user_id = $params['send_user_id'];
885 $message->to_user_id = $params['send_to_user_id']; 893 $message->to_user_id = $params['send_to_user_id'];
886 $message->title = $params['send_title']; 894 $message->title = $params['send_title'];
887 $message->text = $params['send_text']; 895 $message->text = $params['send_text'];
888 $message->ad_employer_id = $params['send_vacancy']; 896 $message->ad_employer_id = $params['send_vacancy'];
889 if ($request->has('send_file')) { 897 if ($request->has('send_file')) {
890 $message->file = $request->file('send_file')->store("worker/$id", 'public'); 898 $message->file = $request->file('send_file')->store("worker/$id", 'public');
891 } 899 }
892 $message->flag_new = 1; 900 $message->flag_new = 1;
893 $id_message = $message->save(); 901 $id_message = $message->save();
894 902
895 $data['message_id'] = $id_message; 903 $data['message_id'] = $id_message;
896 $data['ad_employer_id'] = $params['send_vacancy']; 904 $data['ad_employer_id'] = $params['send_vacancy'];
897 $data['job_title_id'] = $params['send_job_title_id']; 905 $data['job_title_id'] = $params['send_job_title_id'];
898 $data['flag'] = 1; 906 $data['flag'] = 1;
899 $ad_responce = ad_response::create($data); 907 $ad_responce = ad_response::create($data);
900 return redirect()->route('worker.messages', ['type_message' => 'output']); 908 return redirect()->route('worker.messages', ['type_message' => 'output']);
901 } 909 }
902 910
911
912 public function test123(Request $request) {
913 $params = $request->all();
914 $user1 = $params['user_id'];
915 $user2 = $params['to_user_id'];
916 $id_vacancy = $params['ad_employer_id'];
917 $ad_name = $params['ad_name'];
918
919 $rules = [
920 'text' => 'required|min:1|max:150000',
921 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000'
922 ];
923 $messages = [
924 'required' => 'Укажите обязательное поле',
925 'min' => [
926 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
927 'integer' => 'Поле «:attribute» должно быть :min или больше',
928 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
929 ],
930 'max' => [
931 'string' => 'Поле «:attribute» должно быть не больше :max символов',
932 'integer' => 'Поле «:attribute» должно быть :max или меньше',
933 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
934 ]
935 ];
936
937 $validator = Validator::make($request->all(), $rules, $messages);
938
939 if ($validator->fails()) {
940 return redirect()->route('worker.dialog', ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name])
941 ->withErrors($validator);
942 } else {
943 if ($request->has('file')) {
944 $params['file'] = $request->file('file')->store("messages", 'public');
945 }
946 Message::create($params);
947 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
948 return redirect()->route('worker.dialog',
949 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]);
950
951 }
952 }
953
903 // Информация о предыдущих компаниях 954 // Информация о предыдущих компаниях
904 public function new_prev_company(Worker $worker) { 955 public function new_prev_company(Worker $worker) {
905 return view('workers.prev_company_form', compact('worker')); 956 return view('workers.prev_company_form', compact('worker'));
906 } 957 }
907 958
908 // Добавление контакта компании 959 // Добавление контакта компании
909 public function add_prev_company(PrevCompanyRequest $request) { 960 public function add_prev_company(PrevCompanyRequest $request) {
910 // Возвращение параметров 961 // Возвращение параметров
911 $all = $request->all(); 962 $all = $request->all();
912 $PrevCompany = PrevCompany::create($all); 963 $PrevCompany = PrevCompany::create($all);
913 964
914 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись'); 965 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись');
915 } 966 }
916 967
917 // Редактирование контакта компании 968 // Редактирование контакта компании
918 public function edit_prev_company(PrevCompany $doc, Worker $worker) { 969 public function edit_prev_company(PrevCompany $doc, Worker $worker) {
919 return view('workers.prev_company_edit_form', compact('doc', 'worker')); 970 return view('workers.prev_company_edit_form', compact('doc', 'worker'));
920 } 971 }
921 972
922 //Сохранение редактирования контакта компании 973 //Сохранение редактирования контакта компании
923 public function update_prev_company(PrevCompany $doc, Request $request){ 974 public function update_prev_company(PrevCompany $doc, Request $request){
924 $all = $request->all(); 975 $all = $request->all();
925 $doc->update($all); 976 $doc->update($all);
926 977
927 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись'); 978 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись');
928 } 979 }
929 980
930 // Удаление контакта предыдущей компании 981 // Удаление контакта предыдущей компании
931 public function delete_prev_company(PrevCompany $doc) { 982 public function delete_prev_company(PrevCompany $doc) {
932 $doc->delete(); 983 $doc->delete();
933 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); 984 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!');
934 } 985 }
935 } 986 }
936 987
resources/views/vacance-item.blade.php
1 @php 1 @php
2 use App\Classes\StatusUser; 2 use App\Classes\StatusUser;
3 @endphp 3 @endphp
4 4
5 @extends('layout.frontend', ['title' => $title]) 5 @extends('layout.frontend', ['title' => $title])
6 6
7 @section('scripts') 7 @section('scripts')
8 @include('js.favorite-vacancy') 8 <!--include('js.favorite-vacancy')-->
9 <script> 9 <script>
10 $(document).on('click', '.js_send_it_button', function() { 10 $(document).on('click', '.js_send_it_button', function() {
11 var this_ = $(this); 11 var this_ = $(this);
12 var code_user_id = this_.attr('data-uid'); 12 var code_user_id = this_.attr('data-uid');
13 var code_to_user_id = this_.attr('data-tuid'); 13 var code_to_user_id = this_.attr('data-tuid');
14 var code_vacancy = this_.attr('data-vacancy'); 14 var code_vacancy = this_.attr('data-vacancy');
15 var user_id = $('#_user_id'); 15 var user_id = $('#_user_id');
16 var to_user_id = $('#_to_user_id'); 16 var to_user_id = $('#_to_user_id');
17 var vacancy = $('#_vacancy'); 17 var vacancy = $('#_vacancy');
18 18
19 console.log('Клик на кнопки...'); 19 console.log('Клик на кнопки...');
20 20
21 user_id.val(code_user_id); 21 user_id.val(code_user_id);
22 to_user_id.val(code_to_user_id); 22 to_user_id.val(code_to_user_id);
23 vacancy.val(code_vacancy); 23 vacancy.val(code_vacancy);
24 }); 24 });
25 </script> 25 </script>
26 <script> 26 <script>
27 $(document).on('click', '.js_send_for_emp', function() { 27 $(document).on('click', '.js_send_for_emp', function() {
28 var this_ = $(this); 28 var this_ = $(this);
29 var code_user_id = this_.attr('data-uid'); 29 var code_user_id = this_.attr('data-uid');
30 var code_to_user_id = this_.attr('data-tuid'); 30 var code_to_user_id = this_.attr('data-tuid');
31 var code_vacancy = this_.attr('data-vacancy'); 31 var code_vacancy = this_.attr('data-vacancy');
32 var user_id = $('#send_user_id'); 32 var user_id = $('#send_user_id');
33 var to_user_id = $('#send_to_user_id'); 33 var to_user_id = $('#send_to_user_id');
34 var vacancy = $('#send_vacancy'); 34 var vacancy = $('#send_vacancy');
35 35
36 console.log('code_to_user_id='+code_to_user_id); 36 console.log('code_to_user_id='+code_to_user_id);
37 console.log('code_user_id='+code_user_id); 37 console.log('code_user_id='+code_user_id);
38 console.log('code_vacancy='+code_vacancy); 38 console.log('code_vacancy='+code_vacancy);
39 console.log('Клик на кнопке...'); 39 console.log('Клик на кнопке...');
40 40
41 user_id.val(code_user_id); 41 user_id.val(code_user_id);
42 to_user_id.val(code_to_user_id); 42 to_user_id.val(code_to_user_id);
43 vacancy.val(code_vacancy); 43 vacancy.val(code_vacancy);
44 }); 44 });
45 </script> 45 </script>
46 @include('js.favorite-vacancy-45') 46 @include('js.favorite-vacancy-45')
47 @endsection 47 @endsection
48 48
49 @section('content') 49 @section('content')
50 <main class="main"> 50 <main class="main">
51 <div class="container"> 51 <div class="container">
52 <ul class="breadcrumbs main__breadcrumbs"> 52 <ul class="breadcrumbs main__breadcrumbs">
53 <li><a href="{{ route('index') }}">Главная</a></li> 53 <li><a href="{{ route('index') }}">Главная</a></li>
54 <li><a href="{{ route('vacancies') }}">Вакансии</a></li> 54 <li><a href="{{ route('vacancies') }}">Вакансии</a></li>
55 <li><b>{{ $title }}</b></li> 55 <li><b>{{ $title }}</b></li>
56 </ul> 56 </ul>
57 <div class="main__employer-page"> 57 <div class="main__employer-page">
58 58
59 @if (isset($Query[0]->employer)) 59 @if (isset($Query[0]->employer))
60 <h2 class="main__employer-page-title">О компании</h2> 60 <h2 class="main__employer-page-title">О компании</h2>
61 <div class="main__employer-page-two-item-toper"> 61 <div class="main__employer-page-two-item-toper">
62 @if (!empty($Query[0]->employer->logo)) 62 @if (!empty($Query[0]->employer->logo))
63 <img src="{{ asset(Storage::url($Query[0]->employer->logo)) }}" alt="{{ $Query[0]->employer->name }}"> 63 <img src="{{ asset(Storage::url($Query[0]->employer->logo)) }}" alt="{{ $Query[0]->employer->name }}">
64 @else 64 @else
65 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Query[0]->employer->name }}"> 65 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Query[0]->employer->name }}">
66 @endif 66 @endif
67 <span>{{ $Query[0]->employer->name_company }}</span> 67 <span>{{ $Query[0]->employer->name_company }}</span>
68 </div> 68 </div>
69 69
70 <div class="main__employer-page-info"> 70 <div class="main__employer-page-info">
71 <div class="main__employer-page-item"> 71 <div class="main__employer-page-item">
72 <b> Адрес компании</b> 72 <b> Адрес компании</b>
73 <span> 73 <span>
74 {{ $Query[0]->employer->address }} 74 {{ $Query[0]->employer->address }}
75 </span> 75 </span>
76 </div> 76 </div>
77 <div class="main__employer-page-item"> 77 <div class="main__employer-page-item">
78 <b>Сайт</b> 78 <b>Сайт</b>
79 <span> 79 <span>
80 <a href="{{ $Query[0]->employer->site }}">{{ $Query[0]->employer->site }}</a> 80 <a href="{{ $Query[0]->employer->site }}">{{ $Query[0]->employer->site }}</a>
81 </span> 81 </span>
82 </div> 82 </div>
83 <div class="main__employer-page-item"> 83 <div class="main__employer-page-item">
84 <b>Почта</b> 84 <b>Почта</b>
85 <span> 85 <span>
86 <a href="{{ $Query[0]->employer->email }}">{{ $Query[0]->employer->email }}</a> 86 <a href="{{ $Query[0]->employer->email }}">{{ $Query[0]->employer->email }}</a>
87 </span> 87 </span>
88 </div> 88 </div>
89 <div class="main__employer-page-item"> 89 <div class="main__employer-page-item">
90 <b>Телефон</b> 90 <b>Телефон</b>
91 <span> 91 <span>
92 <a href="tel:{{ $Query[0]->employer->telephone }}">{{ $Query[0]->employer->telephone }}</a> 92 <a href="tel:{{ $Query[0]->employer->telephone }}">{{ $Query[0]->employer->telephone }}</a>
93 </span> 93 </span>
94 </div> 94 </div>
95 </div> 95 </div>
96 @else 96 @else
97 <div class="main__employer-page-info"> 97 <div class="main__employer-page-info">
98 <div class="main__employer-page-item"> 98 <div class="main__employer-page-item">
99 <b>Ничего не найдено</b> 99 <b>Ничего не найдено</b>
100 <span> 100 <span>
101 Нет данных о компании 101 Нет данных о компании
102 </span> 102 </span>
103 </div> 103 </div>
104 </div> 104 </div>
105 @endif 105 @endif
106 <h2 class="main__employer-page-title">{{ $Query[0]->name }}</h2> 106 <h2 class="main__employer-page-title">{{ $Query[0]->name }}</h2>
107 <h3 class="main__employer-page-title_">Описание вакансии</h3> 107 <h3 class="main__employer-page-title_">Описание вакансии</h3>
108 108
109 </div> 109 </div>
110 110
111 @foreach ($Query as $Q) 111 @foreach ($Query as $Q)
112 <div class="main__vacancies-item-page main__employer-page-two-item"> 112 <div class="main__vacancies-item-page main__employer-page-two-item">
113 <div class="main__employer-page-two-item-text"> 113 <div class="main__employer-page-two-item-text">
114 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор 114 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор
115 специалистов на следующие должности:</div> 115 специалистов на следующие должности:</div>
116 <div class="main__employer-page-two-item-text-links"> 116 <div class="main__employer-page-two-item-text-links">
117 @if (isset($Q->jobs)) 117 @if (isset($Q->jobs))
118 @foreach ($Q->jobs as $key => $j) 118 @foreach ($Q->jobs as $key => $j)
119 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a> 119 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a>
120 @endforeach 120 @endforeach
121 @endif 121 @endif
122 </div> 122 </div>
123 </div> 123 </div>
124 <div class="main__employer-page-two-item-text"> 124 <div class="main__employer-page-two-item-text">
125 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 125 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
126 <div class="main__employer-page-two-item-text-body"> 126 <div class="main__employer-page-two-item-text-body">
127 {!! $Q->text !!} 127 {!! $Q->text !!}
128 </div> 128 </div>
129 </div> 129 </div>
130 <div class="main__employer-page-two-item-text"> 130 <div class="main__employer-page-two-item-text">
131 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div> 131 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div>
132 <div class="main__employer-page-two-item-text-body"> 132 <div class="main__employer-page-two-item-text-body">
133 {!! $Q->description !!} 133 {!! $Q->description !!}
134 </div> 134 </div>
135 </div> 135 </div>
136 <div class="main__employer-page-two-item-text"> 136 <div class="main__employer-page-two-item-text">
137 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div> 137 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div>
138 <div class="main__employer-page-two-item-text-body"> 138 <div class="main__employer-page-two-item-text-body">
139 {!! $Q->contacts_emails !!} 139 {!! $Q->contacts_emails !!}
140 </div> 140 </div>
141 <div class="main__employer-page-two-item-text"> 141 <div class="main__employer-page-two-item-text">
142 <div class="main__employer-page-two-item-text-name">Или звоните:</div> 142 <div class="main__employer-page-two-item-text-name">Или звоните:</div>
143 <div class="main__employer-page-two-item-text-body"> 143 <div class="main__employer-page-two-item-text-body">
144 {!! $Q->contacts_telephones !!} 144 {!! $Q->contacts_telephones !!}
145 </div> 145 </div>
146 </div> 146 </div>
147 147
148 <div class="main__employer-page-two-item-tags"> 148 <div class="main__employer-page-two-item-tags">
149 @if (!empty($Q->jobs_code[0]->position_ship)) 149 @if (!empty($Q->jobs_code[0]->position_ship))
150 <span class="main__employer-page-two-item-tag">#{{ $Q->jobs_code[0]->position_ship }}</span> 150 <span class="main__employer-page-two-item-tag">#{{ $Q->jobs_code[0]->position_ship }}</span>
151 @else 151 @else
152 @if (isset($Q->jobs)) 152 @if (isset($Q->jobs))
153 @foreach ($Q->jobs as $key => $j) 153 @foreach ($Q->jobs as $key => $j)
154 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span> 154 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span>
155 @endforeach 155 @endforeach
156 @endif 156 @endif
157 @endif 157 @endif
158 </div> 158 </div>
159 <br> 159 <br>
160 <div class="main__employer-page-two-item-buttons"> 160 <div class="main__employer-page-two-item-buttons">
161 @guest 161 @guest
162 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' 162 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
163 class="button main__employer-page-two-item-button">Откликнуться</button> 163 class="button main__employer-page-two-item-button">Откликнуться</button>
164 @else 164 @else
165 @if (App\Classes\StatusUser::Status()==1) 165 @if (App\Classes\StatusUser::Status()==1)
166 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}' 166 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
167 class="button main__employer-page-two-item-button js_send_for_emp">Откликнуться</button> 167 class="button main__employer-page-two-item-button js_send_for_emp">Откликнуться</button>
168 @else 168 @else
169 <button type="button" data-fancybox data-src="#send2" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}' 169 <button type="button" data-fancybox data-src="#send2" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
170 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> 170 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
171 @endif 171 @endif
172 @endguest 172 @endguest
173 </div> 173 </div>
174 <div class="main__employer-page-two-item-bottom"> 174 <div class="main__employer-page-two-item-bottom">
175 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div> 175 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div>
176 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js_vac_favorite js-toggle {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}"> 176 <button type="button" id="like{{ $Q->id }}" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js_vac_favorite js-toggle {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}">
177 <svg> 177 <svg>
178 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 178 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
179 </svg> 179 </svg>
180 </button> 180 </button>
181 </div> 181 </div>
182 182
183 </div> 183 </div>
184 184
185 @endforeach 185 @endforeach
186 186
187 </div> <a href="{{ redirect()->back()->getTargetUrl() }}" class="back"> 187 </div> <a href="{{ redirect()->back()->getTargetUrl() }}" class="back">
188 <svg> 188 <svg>
189 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 189 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
190 </svg> 190 </svg>
191 <span> 191 <span>
192 Вернуться к списку вакансий 192 Вернуться к списку вакансий
193 </span> 193 </span>
194 </a> 194 </a>
195 </main> 195 </main>
196 </div> 196 </div>
197 @endsection 197 @endsection
198 198
resources/views/workers/dialog.blade.php
1 @extends('layout.frontend', ['title' => 'Диалог-переписка - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Диалог-переписка - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 console.log('Test system'); 5 console.log('Test system');
6 $(document).on('change', '#send_btn', function() { 6 $(document).on('change', '#send_btn', function() {
7 var this_ = $(this); 7 var this_ = $(this);
8 var val_ = this_.val(); 8 var val_ = this_.val();
9 console.log('sort items '+val_); 9 console.log('sort items '+val_);
10 10
11 $.ajax({ 11 $.ajax({
12 type: "GET", 12 type: "GET",
13 url: "{{ route('shipping_companies') }}", 13 url: "{{ route('shipping_companies') }}",
14 data: "sort="+val_+"&block=1", 14 data: "sort="+val_+"&block=1",
15 success: function (data) { 15 success: function (data) {
16 console.log('Выбор сортировки'); 16 console.log('Выбор сортировки');
17 console.log(data); 17 console.log(data);
18 $('#block_1').html(data); 18 $('#block_1').html(data);
19 }, 19 },
20 headers: { 20 headers: {
21 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 21 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
22 }, 22 },
23 error: function (data) { 23 error: function (data) {
24 data = JSON.stringify(data); 24 data = JSON.stringify(data);
25 console.log('Error: ' + data); 25 console.log('Error: ' + data);
26 } 26 }
27 }); 27 });
28 28
29 $.ajax({ 29 $.ajax({
30 type: "GET", 30 type: "GET",
31 url: "{{ route('shipping_companies') }}", 31 url: "{{ route('shipping_companies') }}",
32 data: "sort="+val_+"&block=2", 32 data: "sort="+val_+"&block=2",
33 success: function (data) { 33 success: function (data) {
34 console.log('Выбор сортировки2'); 34 console.log('Выбор сортировки2');
35 console.log(data); 35 console.log(data);
36 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 36 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
37 $('#block_2').html(data); 37 $('#block_2').html(data);
38 }, 38 },
39 headers: { 39 headers: {
40 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 40 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
41 }, 41 },
42 error: function (data) { 42 error: function (data) {
43 data = JSON.stringify(data); 43 data = JSON.stringify(data);
44 console.log('Error: ' + data); 44 console.log('Error: ' + data);
45 } 45 }
46 }); 46 });
47 }); 47 });
48 </script> 48 </script>
49 @endsection 49 @endsection
50 50
51 @section('content') 51 @section('content')
52 <section class="cabinet"> 52 <section class="cabinet">
53 <div class="container"> 53 <div class="container">
54 <ul class="breadcrumbs cabinet__breadcrumbs"> 54 <ul class="breadcrumbs cabinet__breadcrumbs">
55 <li><a href="{{ route('index') }}">Главная</a></li> 55 <li><a href="{{ route('index') }}">Главная</a></li>
56 <li><b>Личный кабинет</b></li> 56 <li><b>Личный кабинет</b></li>
57 </ul> 57 </ul>
58 <div class="cabinet__wrapper"> 58 <div class="cabinet__wrapper">
59 <div class="cabinet__side"> 59 <div class="cabinet__side">
60 <div class="cabinet__side-toper"> 60 <div class="cabinet__side-toper">
61 @include('workers.emblema') 61 @include('workers.emblema')
62 </div> 62 </div>
63 @include('workers.menu', ['item' => 2]) 63 @include('workers.menu', ['item' => 2])
64 </div> 64 </div>
65 <div class="cabinet__body"> 65 <div class="cabinet__body">
66 <div class="cabinet__body-item"> 66 <div class="cabinet__body-item">
67 <h2 class="title cabinet__title">Сообщения</h2> 67 <h2 class="title cabinet__title">Сообщения</h2>
68 </div> 68 </div>
69 <div class="cabinet__body-item"> 69 <div class="cabinet__body-item">
70 <a href="{{ route('worker.messages', ['type_message' => 'input']) }}" class="back"> 70 <a href="{{ route('worker.messages', ['type_message' => 'input']) }}" class="back">
71 <svg> 71 <svg>
72 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 72 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
73 </svg> 73 </svg>
74 <span> 74 <span>
75 К списку чатов 75 К списку чатов
76 </span> 76 </span>
77 </a> 77 </a>
78 <div class="chatbox"> 78 <div class="chatbox">
79 <div class="chatbox__toper"> 79 <div class="chatbox__toper">
80 @if ($companion->is_worker) 80 @if ($companion->is_worker)
81 <div class="chatbox__toper-info messages__item-info"> 81 <div class="chatbox__toper-info messages__item-info">
82 <div class="messages__item-photo"> 82 <div class="messages__item-photo">
83 <svg> 83 <svg>
84 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 84 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
85 </svg> 85 </svg>
86 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 86 <img src="{{ asset('images/default_man.jpg') }}" alt="">
87 </div> 87 </div>
88 <div class="messages__item-text"> 88 <div class="messages__item-text">
89 <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div> 89 <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div>
90 <div><span>Вакансия:</span> @if (!is_null($ad_employer)) <a href="{{ route('vacancie', ['vacancy' => $ad_employer->id]) }}">{{ $ad_employer->name}}</a> @else Не указано @endif</div> 90 <div><span>Вакансия:</span> @if (!is_null($ad_employer)) <a href="{{ route('vacancie', ['vacancy' => $ad_employer->id]) }}">{{ $ad_employer->name}}</a> @else Не указано @endif</div>
91 </div> 91 </div>
92 </div> 92 </div>
93 @if (isset($companion->worker->id)) 93 @if (isset($companion->worker->id))
94 <a href="{{ route('resume_profile', ['worker' => $companion->worker->id]) }}" class="button chatbox__toper-button"> 94 <a href="{{ route('resume_profile', ['worker' => $companion->worker->id]) }}" class="button chatbox__toper-button">
95 <svg> 95 <svg>
96 <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use> 96 <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use>
97 </svg> 97 </svg>
98 Перейти в резюме 98 Перейти в резюме
99 </a> 99 </a>
100 @endif 100 @endif
101 @else 101 @else
102 <div class="chatbox__toper-info messages__item-info"> 102 <div class="chatbox__toper-info messages__item-info">
103 <div class="messages__item-photo"> 103 <div class="messages__item-photo">
104 <svg> 104 <svg>
105 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 105 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
106 </svg> 106 </svg>
107 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 107 <img src="{{ asset('images/default_man.jpg') }}" alt="">
108 </div> 108 </div>
109 <div class="messages__item-text"> 109 <div class="messages__item-text">
110 <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div> 110 <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div>
111 <div><span>Статус:</span> Работодатель или Администратор</div> 111 <div><span>Статус:</span> Работодатель или Администратор</div>
112 </div> 112 </div>
113 </div> 113 </div>
114 @if (isset($companion->employer->id)) 114 @if (isset($companion->employer->id))
115 <a href="" class="button chatbox__toper-button"> 115 <a href="" class="button chatbox__toper-button">
116 <svg> 116 <svg>
117 <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use> 117 <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use>
118 </svg> 118 </svg>
119 Перейти в резюме 119 Перейти в резюме
120 </a> 120 </a>
121 @endif 121 @endif
122 @endif 122 @endif
123 </div> 123 </div>
124 124
125 <div class="chatbox__list" id="dialogs" name="dialogs"> 125 <div class="chatbox__list" id="dialogs" name="dialogs">
126 @if ($Messages->count()) 126 @if ($Messages->count())
127 @foreach ($Messages as $it) 127 @foreach ($Messages as $it)
128 @if ($it->user_id == $companion->id) 128 @if ($it->user_id == $companion->id)
129 <div class="chatbox__item"> 129 <div class="chatbox__item">
130 <div class="chatbox__item-photo"> 130 <div class="chatbox__item-photo">
131 <svg> 131 <svg>
132 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 132 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
133 </svg> 133 </svg>
134 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 134 <img src="{{ asset('images/default_man.jpg') }}" alt="">
135 </div> 135 </div>
136 <div class="chatbox__item-body"> 136 <div class="chatbox__item-body">
137 <div class="chatbox__item-text">{{ $it->text }}</div> 137 <div class="chatbox__item-text">{{ $it->text }}</div>
138 </div> 138 </div>
139 <div class="chatbox__item-time">{{ $it->created_at }}</div> 139 <div class="chatbox__item-time">{{ $it->created_at }}</div>
140 </div> 140 </div>
141 @else 141 @else
142 <div class="chatbox__item chatbox__item_reverse"> 142 <div class="chatbox__item chatbox__item_reverse">
143 <div class="chatbox__item-photo"> 143 <div class="chatbox__item-photo">
144 <svg> 144 <svg>
145 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 145 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
146 </svg> 146 </svg>
147 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 147 <img src="{{ asset('images/default_man.jpg') }}" alt="">
148 </div> 148 </div>
149 <div class="chatbox__item-body"> 149 <div class="chatbox__item-body">
150 <div class="chatbox__item-text">{{ $it->text }}</div> 150 <div class="chatbox__item-text">{{ $it->text }}</div>
151 @if ((isset($it->file)) && (!empty($it->file))) 151 @if ((isset($it->file)) && (!empty($it->file)))
152 <a href="{{ asset(Storage::url($it->file)) }}" class="chatbox__item-text"> 152 <a href="{{ asset(Storage::url($it->file)) }}" class="chatbox__item-text">
153 <svg> 153 <svg>
154 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use> 154 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use>
155 </svg> 155 </svg>
156 </a> 156 </a>
157 @endif 157 @endif
158 </div> 158 </div>
159 <div class="chatbox__item-time">{{ $it->created_at }}</div> 159 <div class="chatbox__item-time">{{ $it->created_at }}</div>
160 </div> 160 </div>
161 @endif 161 @endif
162 162
163 @endforeach 163 @endforeach
164 @endif 164 @endif
165 </div> 165 </div>
166 <form action="{{ route('employer.test123') }}" class="chatbox__bottom" enctype="multipart/form-data" method="POST" > 166 <form action="{{ route('worker.test123') }}" class="chatbox__bottom" enctype="multipart/form-data" method="POST" >
167 @csrf 167 @csrf
168 <label class="chatbox__bottom-file"> 168 <label class="chatbox__bottom-file">
169 <input id="file" name="file" type="file"> 169 <input id="file" name="file" type="file">
170 <svg> 170 <svg>
171 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use> 171 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use>
172 </svg> 172 </svg>
173 </label> 173 </label>
174 <input type="hidden" name="_token" value="{{ csrf_token() }}"/> 174 <input type="hidden" name="_token" value="{{ csrf_token() }}"/>
175 <input type="hidden" id="user_id" name="user_id" value="{{ $sender->id }}"/> 175 <input type="hidden" id="user_id" name="user_id" value="{{ $sender->id }}"/>
176 <input type="hidden" id="to_user_id" name="to_user_id" value="{{ $companion->id }}"/> 176 <input type="hidden" id="to_user_id" name="to_user_id" value="{{ $companion->id }}"/>
177 <input type="hidden" id="ad_employer_id" name="ad_employer_id" value="{{ $ad_employer }}"/>
178 <input type="hidden" id="ad_name" name="ad_name" value="@if (isset($_GET['ad_name'])){{ $_GET['ad_name'] }} @endif"/>
177 <input id="text" name="text" type="text" class="input chatbox__bottom-text" placeholder="Ответить"> 179 <input id="text" name="text" type="text" class="input chatbox__bottom-text" placeholder="Ответить">
178 <button type="submit" id="send_btn" name="send_btn" class="chatbox__bottom-send"> 180 <button type="submit" id="send_btn" name="send_btn" class="chatbox__bottom-send">
179 <svg> 181 <svg>
180 <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> 182 <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use>
181 </svg> 183 </svg>
182 </button> 184 </button>
183 </form> 185 </form>
184 </div> 186 </div>
185 </div> 187 </div>
186 </div> 188 </div>
187 </div> 189 </div>
188 </div> 190 </div>
189 </section> 191 </section>
190 </div> 192 </div>
191 @endsection 193 @endsection
192 194
resources/views/workers/favorite.blade.php
1 @extends('layout.frontend', ['title' => 'Избранные - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Избранные - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 @include('js.favorite-vacancy-45') 4 @include('js.favorite-vacancy-45')
5 @endsection 5 @endsection
6 6
7 @section('content') 7 @section('content')
8 <section class="cabinet"> 8 <section class="cabinet">
9 <div class="container"> 9 <div class="container">
10 <ul class="breadcrumbs cabinet__breadcrumbs"> 10 <ul class="breadcrumbs cabinet__breadcrumbs">
11 <li><a href="{{ route('index') }}">Главная</a></li> 11 <li><a href="{{ route('index') }}">Главная</a></li>
12 <li><b>Личный кабинет</b></li> 12 <li><b>Личный кабинет</b></li>
13 </ul> 13 </ul>
14 <div class="cabinet__wrapper"> 14 <div class="cabinet__wrapper">
15 <div class="cabinet__side"> 15 <div class="cabinet__side">
16 <div class="cabinet__side-toper"> 16 <div class="cabinet__side-toper">
17 @include('workers.emblema') 17 @include('workers.emblema')
18 18
19 </div> 19 </div>
20 @include('workers.menu', ['item' => 3]) 20 @include('workers.menu', ['item' => 3])
21 </div> 21 </div>
22 22
23 <div class="cabinet__body"> 23 <div class="cabinet__body">
24 <div class="cabinet__body-item"> 24 <div class="cabinet__body-item">
25 <h2 class="title cabinet__title">Избранные вакансии</h2> 25 <h2 class="title cabinet__title">Избранные вакансии</h2>
26 </div> 26 </div>
27 <div class="cabinet__body-item"> 27 <div class="cabinet__body-item">
28 <div class="cabinet__filters"> 28 <div class="cabinet__filters">
29 <div class="cabinet__filters-item"> 29 <div class="cabinet__filters-item">
30 <form class="search" action="{{ route('worker.colorado') }}" method="GET"> 30 <form class="search" action="{{ route('worker.colorado') }}" method="GET">
31 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;"> 31 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;">
32 <button type="submit" class="button">Найти</button> 32 <button type="submit" class="button">Найти</button>
33 <span> 33 <span>
34 <svg> 34 <svg>
35 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 35 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
36 </svg> 36 </svg>
37 </span> 37 </span>
38 </form> 38 </form>
39 </div> 39 </div>
40 <!--<div class="cabinet__filters-item"> 40 <!--<div class="cabinet__filters-item">
41 <div class="select"> 41 <div class="select">
42 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 42 <select class="js-select2" id="sort_ajax" name="sort_ajax">
43 <option value="default">Сортировка (по умолчанию)</option> 43 <option value="default">Сортировка (по умолчанию)</option>
44 <option value="name (asc)">По имени (возрастание)</option> 44 <option value="name (asc)">По имени (возрастание)</option>
45 <option value="name (desc)">По имени (убывание)</option> 45 <option value="name (desc)">По имени (убывание)</option>
46 <option value="created_at (asc)">По дате (возрастание)</option> 46 <option value="created_at (asc)">По дате (возрастание)</option>
47 <option value="created_at (desc)">По дате (убывание)</option> 47 <option value="created_at (desc)">По дате (убывание)</option>
48 </select> 48 </select>
49 </div> 49 </div>
50 </div>--> 50 </div>-->
51 </div> 51 </div>
52 @if ($Query->count()) 52 @if ($Query->count())
53 <div class="cabinet__vacs"> 53 <div class="cabinet__vacs">
54 <div id="main_ockar" name="main_ockar" class="cabinet__vacs-body" style="width:100%;"> 54 <div id="main_ockar" name="main_ockar" class="cabinet__vacs-body" style="width:100%;">
55 @foreach ($Query as $Q) 55 @foreach ($Query as $Q)
56 <div class="main__vacancies-item main__employer-page-two-item"> 56 <div class="main__vacancies-item main__employer-page-two-item">
57 <a href="{{ route('list-vacancies') }}" class="back main__employer-page-two-item-back"> 57 <a href="{{ route('list-vacancies') }}" class="back main__employer-page-two-item-back">
58 <svg> 58 <svg>
59 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 59 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
60 </svg> 60 </svg>
61 <span> 61 <span>
62 Вернуться к списку вакансий 62 Вернуться к списку вакансий
63 </span> 63 </span>
64 </a> 64 </a>
65 <div class="main__employer-page-two-item-toper"> 65 <div class="main__employer-page-two-item-toper">
66 @if (!empty($Q->employer->logo)) 66 @if (!empty($Q->employer->logo))
67 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}"> 67 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}">
68 @else 68 @else
69 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Q->employer->name }}" class="main__vacancies-thing-pic"> 69 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Q->employer->name }}" class="main__vacancies-thing-pic">
70 @endif 70 @endif
71 <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span> 71 <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span>
72 </div> 72 </div>
73 <div class="main__employer-page-two-item-text"> 73 <div class="main__employer-page-two-item-text">
74 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор 74 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор
75 специалистов на следующие должности:</div> 75 специалистов на следующие должности:</div>
76 <div class="main__employer-page-two-item-text-links"> 76 <div class="main__employer-page-two-item-text-links">
77 @if (isset($Q->jobs)) 77 @if (isset($Q->jobs))
78 @foreach ($Q->jobs as $key => $j) 78 @foreach ($Q->jobs as $key => $j)
79 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a> 79 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a>
80 @endforeach 80 @endforeach
81 @endif 81 @endif
82 </div> 82 </div>
83 </div> 83 </div>
84 <div class="main__employer-page-two-item-text"> 84 <div class="main__employer-page-two-item-text">
85 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 85 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
86 <div class="main__employer-page-two-item-text-body"> 86 <div class="main__employer-page-two-item-text-body">
87 {!! $Q->text !!} 87 {!! $Q->text !!}
88 </div> 88 </div>
89 </div> 89 </div>
90 <div class="main__employer-page-two-item-text"> 90 <div class="main__employer-page-two-item-text">
91 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div> 91 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div>
92 <div class="main__employer-page-two-item-text-body"> 92 <div class="main__employer-page-two-item-text-body">
93 {!! $Q->description !!} 93 {!! $Q->description !!}
94 </div> 94 </div>
95 </div> 95 </div>
96 <div class="main__employer-page-two-item-text"> 96 <div class="main__employer-page-two-item-text">
97 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div> 97 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div>
98 <div class="main__employer-page-two-item-text-body"> 98 <div class="main__employer-page-two-item-text-body">
99 {!! $Q->contacts_emails !!} 99 {!! $Q->contacts_emails !!}
100 </div> 100 </div>
101 </div> 101 </div>
102 <div class="main__employer-page-two-item-text"> 102 <div class="main__employer-page-two-item-text">
103 <div class="main__employer-page-two-item-text-name">Или звоните:</div> 103 <div class="main__employer-page-two-item-text-name">Или звоните:</div>
104 <div class="main__employer-page-two-item-text-body"> 104 <div class="main__employer-page-two-item-text-body">
105 {!! $Q->contacts_telephones !!} 105 {!! $Q->contacts_telephones !!}
106 </div> 106 </div>
107 </div> 107 </div>
108 <div class="main__employer-page-two-item-tags"> 108 <div class="main__employer-page-two-item-tags">
109 @if (isset($Q->jobs)) 109 @if (isset($Q->jobs))
110 @foreach ($Q->jobs as $key => $j) 110 @foreach ($Q->jobs as $key => $j)
111 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span> 111 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span>
112 @endforeach 112 @endforeach
113 @endif 113 @endif
114 </div> 114 </div>
115 <div class="main__employer-page-two-item-buttons"> 115 <div class="main__employer-page-two-item-buttons">
116 <!--<button type="button" 116 <!--<button type="button"
117 class="button main__employer-page-two-item-button">Откликнуться</button>--> 117 class="button main__employer-page-two-item-button">Откликнуться</button>-->
118 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a> 118 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a>
119 </div> 119 </div>
120 <div class="main__employer-page-two-item-bottom"> 120 <div class="main__employer-page-two-item-bottom">
121 <div class="main__employer-page-two-item-bottom-date">{{ $Q->created_at }}</div> 121 <div class="main__employer-page-two-item-bottom-date">{{ $Q->created_at }}</div>
122 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}?>"> 122 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}?>">
123 <svg> 123 <svg>
124 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 124 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
125 </svg> 125 </svg>
126 </button> 126 </button>
127 </div> 127 </div>
128 </div> 128 </div>
129 @endforeach 129 @endforeach
130 <div style="margin-top: 20px"> 130 <div style="margin-top: 20px">
131 {{ $Query->appends($_GET)->links('paginate') }} 131 {{ $Query->appends($_GET)->links('paginate') }}
132 </div> 132 </div>
133 </div> 133 </div>
134 @else 134 @else
135 <div class="notify"> 135 <div class="notify">
136 <svg> 136 <svg>
137 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> 137 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use>
138 </svg> 138 </svg>
139 <span>Нет избранных работодателей</span> 139 <span>Нет избранных должностей</span>
140 </div> 140 </div>
141 @endif 141 @endif
142 </div> 142 </div>
143 </div> 143 </div>
144 </div> 144 </div>
145 </div> 145 </div>
146 </section> 146 </section>
147 </div> 147 </div>
148 148
149 @endsection 149 @endsection
150 150
resources/views/workers/messages.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('workers.emblema') 17 @include('workers.emblema')
18 18
19 </div> 19 </div>
20 20
21 @include('workers.menu', ['item' => 2]) 21 @include('workers.menu', ['item' => 2])
22 </div> 22 </div>
23 <div class="cabinet__body"> 23 <div class="cabinet__body">
24 <div class="cabinet__body-item"> 24 <div class="cabinet__body-item">
25 <h2 class="title cabinet__title">Сообщения</h2> 25 <h2 class="title cabinet__title">Сообщения</h2>
26 </div> 26 </div>
27 <div class="cabinet__body-item"> 27 <div class="cabinet__body-item">
28 <div class="cabinet__filters"> 28 <div class="cabinet__filters">
29 <div class="cabinet__filters-item"> 29 <div class="cabinet__filters-item">
30 <div class="cabinet__filters-buttons"> 30 <div class="cabinet__filters-buttons">
31 <a href="{{ route('worker.messages', ['type_message' => 'input']) }}" class="button button_light @if ($type_message == 'input') active @endif">Входящие ({{ $count_input }})</a> 31 <a href="{{ route('worker.messages', ['type_message' => 'input']) }}" class="button button_light @if ($type_message == 'input') active @endif">Входящие ({{ $count_input }})</a>
32 <a href="{{ route('worker.messages', ['type_message' => 'output']) }}" class="button button_light @if ($type_message == 'output') active @endif">Исходящие ({{ $count_output }})</a> 32 <a href="{{ route('worker.messages', ['type_message' => 'output']) }}" class="button button_light @if ($type_message == 'output') active @endif">Исходящие ({{ $count_output }})</a>
33 </div> 33 </div>
34 </div> 34 </div>
35 <!--<div class="cabinet__filters-item"> 35 <!--<div class="cabinet__filters-item">
36 <div class="select"> 36 <div class="select">
37 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 37 <select class="js-select2" id="sort_ajax" name="sort_ajax">
38 <option value="default">Сортировка (по умолчанию)</option> 38 <option value="default">Сортировка (по умолчанию)</option>
39 <option value="name (asc)">По имени (возрастание)</option> 39 <option value="name (asc)">По имени (возрастание)</option>
40 <option value="name (desc)">По имени (убывание)</option> 40 <option value="name (desc)">По имени (убывание)</option>
41 <option value="created_at (asc)">По дате (возрастание)</option> 41 <option value="created_at (asc)">По дате (возрастание)</option>
42 <option value="created_at (desc)">По дате (убывание)</option> 42 <option value="created_at (desc)">По дате (убывание)</option>
43 </select> 43 </select>
44 </div> 44 </div>
45 </div>--> 45 </div>-->
46 </div> 46 </div>
47 @if ($messages->count()) 47 @if ($messages->count())
48 @foreach($messages as $it) 48 @foreach($messages as $it)
49 <div class="messages__item"> 49 <div class="messages__item">
50 <div class="messages__item-info"> 50 <div class="messages__item-info">
51 <!--<pre> print_r(asset(Storage::url($it->user_from->employers[0]->logo))) }}</pre>--> 51 <!--<pre> print_r(asset(Storage::url($it->user_from->employers[0]->logo))) }}</pre>-->
52 <div class="messages__item-photo"> 52 <div class="messages__item-photo">
53 <svg> 53 <svg>
54 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 54 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
55 </svg> 55 </svg>
56 <!-- Комментарий: обновление структуры вывода картинок, все корректное --> 56 <!-- Комментарий: обновление структуры вывода картинок, все корректное -->
57 @if ($type_message == 'input') 57 @if ($type_message == 'input')
58 @if (isset($it->user_from->is_worker)) 58 @if (isset($it->user_from->is_worker))
59 @if ($it->user_from->is_worker) 59 @if ($it->user_from->is_worker)
60 @if (isset($it->user_from->workers[0]->photo)) 60 @if (isset($it->user_from->workers[0]->photo))
61 <img src="{{ asset(Storage::url($it->user_to->workers[0]->photo)) }}" alt=""> 61 <img src="{{ asset(Storage::url($it->user_to->workers[0]->photo)) }}" alt="">
62 @else 62 @else
63 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 63 <img src="{{ asset('images/default_man.jpg') }}" alt="">
64 @endif 64 @endif
65 @else 65 @else
66 @if (isset($it->user_from->employers[0]->logo)) 66 @if (isset($it->user_from->employers[0]->logo))
67 <img src="{{ asset(Storage::url($it->user_from->employers[0]->logo)) }}" alt=""> 67 <img src="{{ asset(Storage::url($it->user_from->employers[0]->logo)) }}" alt="">
68 @else 68 @else
69 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 69 <img src="{{ asset('images/default_man.jpg') }}" alt="">
70 @endif 70 @endif
71 @endif 71 @endif
72 @else 72 @else
73 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 73 <img src="{{ asset('images/default_man.jpg') }}" alt="">
74 @endif 74 @endif
75 @endif 75 @endif
76 76
77 <!-- Обновление исходящих сообщений - фотографии компании и работника --> 77 <!-- Обновление исходящих сообщений - фотографии компании и работника -->
78 <!-- коммит 2 --> 78 <!-- коммит 2 -->
79 @if ($type_message == 'output') 79 @if ($type_message == 'output')
80 @if (isset($it->user_from->is_worker)) 80 @if (isset($it->user_from->is_worker))
81 @if ($it->user_from->is_worker) 81 @if ($it->user_from->is_worker)
82 @if (isset($it->user_from->workers[0]->photo)) 82 @if (isset($it->user_from->workers[0]->photo))
83 <img src="{{ asset(Storage::url($it->user_from->workers[0]->photo)) }}" alt=""> 83 <img src="{{ asset(Storage::url($it->user_from->workers[0]->photo)) }}" alt="">
84 @else 84 @else
85 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 85 <img src="{{ asset('images/default_man.jpg') }}" alt="">
86 @endif 86 @endif
87 @else 87 @else
88 @if (isset($it->user_from->employers->logo)) 88 @if (isset($it->user_from->employers->logo))
89 <img src="{{ asset(Storage::url($it->user_from->employers->logo)) }}" alt=""> 89 <img src="{{ asset(Storage::url($it->user_from->employers->logo)) }}" alt="">
90 @else 90 @else
91 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 91 <img src="{{ asset('images/default_man.jpg') }}" alt="">
92 @endif 92 @endif
93 @endif 93 @endif
94 @else 94 @else
95 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 95 <img src="{{ asset('images/default_man.jpg') }}" alt="">
96 @endif 96 @endif
97 @endif 97 @endif
98 </div> 98 </div>
99 <div class="messages__item-text"> 99 <div class="messages__item-text">
100 <div> 100 <div>@if (isset($it->vacancies)) @php $ad_name = $it->vacancies->name; @endphp @else @php $ad_name = 'Вакансия удалена'; @endphp @endif
101 От: @if (isset($it->user_from)) 101 От: @if (isset($it->user_from))
102 @if ($it->user_from->id !== $user_id) 102 @if ($it->user_from->id !== $user_id)
103 <a href="{{ route('worker.dialog', ['user1' => $user_id, 'user2' => $it->user_from->id]) }}" style="text-decoration: underline"> 103 <a href="{{ route('worker.dialog', ['user1' => $user_id, 'user2' => $it->user_from->id, 'ad_employer' => $it->ad_employer_id, 'ad_name' => $ad_name]) }}" style="text-decoration: underline">
104 {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }} 104 {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }}
105 </a> 105 </a>
106 @else 106 @else
107 {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }} 107 {{ $it->user_from->surname." ".$it->user_from->name_man." ".$it->user_from->surname2." (".$it->user_from->id.")" }}
108 @endif 108 @endif
109 @else 109 @else
110 Удаленный пользователь 110 Удаленный пользователь
111 @endif 111 @endif
112 <br> 112 <br>
113 К: @if (isset($it->user_to)) 113 К: @if (isset($it->user_to))
114 @if ($it->user_to->id !== $user_id) 114 @if ($it->user_to->id !== $user_id)
115 <a href="{{ route('worker.dialog', ['user1' => $user_id, 'user2' => $it->user_to->id]) }}" style="text-decoration: underline"> 115
116 <a href="{{ route('worker.dialog', ['user1' => $user_id, 'user2' => $it->user_to->id, 'ad_employer' => $it->ad_employer_id, 'ad_name' => $ad_name]) }}" style="text-decoration: underline">
116 {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }} 117 {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }}
117 </a> 118 </a>
118 @else 119 @else
119 {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }} 120 {{ $it->user_to->surname." ".$it->user_to->name_man." ".$it->user_to->surname2." (".$it->user_to->id.")" }}
120 @endif 121 @endif
121 @else 122 @else
122 Удаленный пользователь 123 Удаленный пользователь
123 @endif 124 @endif
124 </div> 125 </div>
125 <div><span>Вакансия:</span>@if (isset($it->vacancies)) {{ $it->vacancies->name." (".($it->vacancies->id).")" }} @else Удалена @endif</div> 126 <div><span>Вакансия:</span>@if (isset($it->vacancies)) {{ $it->vacancies->name." (".($it->vacancies->id).")" }} @else Удалена @endif</div>
126 <div><span>Текст:</span>{{ $it->text }}</div> 127 <div><span>Текст:</span>{{ $it->text }}</div>
127 </div> 128 </div>
128 </div> 129 </div>
129 <div class="messages__item-date">{{ $it->created_at }}</div> 130 <div class="messages__item-date">{{ $it->created_at }}</div>
130 </div> 131 </div>
131 @endforeach 132 @endforeach
132 133
133 <div style="margin-top: 20px"> 134 <div style="margin-top: 20px">
134 {{ $messages->onEachSide(0)->appends($_GET)->links('paginate') }} 135 {{ $messages->onEachSide(0)->appends($_GET)->links('paginate') }}
135 </div><!-- конец --> 136 </div><!-- конец -->
136 137
137 @else 138 @else
138 <div class="notify"> 139 <div class="notify">
139 <svg> 140 <svg>
140 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> 141 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use>
141 </svg> 142 </svg>
142 <span>Сообщений не найдено</span> 143 <span>Сообщений не найдено</span>
143 </div> 144 </div>
144 @endif 145 @endif
145 </div> 146 </div>
146 </div> 147 </div>
147 </div> 148 </div>
148 </div> 149 </div>
149 </section> 150 </section>
150 </div> 151 </div>
151 <div> 152 <div>
152 @endsection 153 @endsection
153 154
1 <?php 1 <?php
2 2
3 use App\Http\Controllers\Ad_jobsController; 3 use App\Http\Controllers\Ad_jobsController;
4 use App\Http\Controllers\AdEmployerController; 4 use App\Http\Controllers\AdEmployerController;
5 use App\Http\Controllers\Admin\AdminController; 5 use App\Http\Controllers\Admin\AdminController;
6 use App\Http\Controllers\Admin\CategoryController; 6 use App\Http\Controllers\Admin\CategoryController;
7 use App\Http\Controllers\Admin\CategoryEmpController; 7 use App\Http\Controllers\Admin\CategoryEmpController;
8 use App\Http\Controllers\Admin\EducationController; 8 use App\Http\Controllers\Admin\EducationController;
9 use App\Http\Controllers\Admin\EmployersController; 9 use App\Http\Controllers\Admin\EmployersController;
10 use App\Http\Controllers\EmployerController as FrontEmployersController; 10 use App\Http\Controllers\EmployerController as FrontEmployersController;
11 use App\Http\Controllers\Admin\InfoBloksController; 11 use App\Http\Controllers\Admin\InfoBloksController;
12 use App\Http\Controllers\Admin\JobTitlesController; 12 use App\Http\Controllers\Admin\JobTitlesController;
13 use App\Http\Controllers\Admin\UsersController; 13 use App\Http\Controllers\Admin\UsersController;
14 use App\Http\Controllers\Admin\WorkersController; 14 use App\Http\Controllers\Admin\WorkersController;
15 use App\Http\Controllers\Auth\ForgotPasswordController; 15 use App\Http\Controllers\Auth\ForgotPasswordController;
16 use App\Http\Controllers\Auth\LoginController; 16 use App\Http\Controllers\Auth\LoginController;
17 use App\Http\Controllers\Auth\RegisterController; 17 use App\Http\Controllers\Auth\RegisterController;
18 use App\Http\Controllers\CKEditorController; 18 use App\Http\Controllers\CKEditorController;
19 use App\Http\Controllers\MediaController; 19 use App\Http\Controllers\MediaController;
20 use App\Http\Controllers\WorkerController; 20 use App\Http\Controllers\WorkerController;
21 use App\Models\Ad_jobs; 21 use App\Models\Ad_jobs;
22 use App\Models\User; 22 use App\Models\User;
23 use App\Http\Controllers\MainController; 23 use App\Http\Controllers\MainController;
24 use App\Http\Controllers\HomeController; 24 use App\Http\Controllers\HomeController;
25 use Illuminate\Support\Facades\Route; 25 use Illuminate\Support\Facades\Route;
26 use App\Http\Controllers\Admin\CompanyController; 26 use App\Http\Controllers\Admin\CompanyController;
27 use App\Http\Controllers\Admin\Ad_EmployersController; 27 use App\Http\Controllers\Admin\Ad_EmployersController;
28 use App\Http\Controllers\Admin\MsgAnswersController; 28 use App\Http\Controllers\Admin\MsgAnswersController;
29 use App\Http\Controllers\Admin\GroupsController; 29 use App\Http\Controllers\Admin\GroupsController;
30 use App\Http\Controllers\PagesController; 30 use App\Http\Controllers\PagesController;
31 use Illuminate\Support\Facades\Storage; 31 use Illuminate\Support\Facades\Storage;
32 use App\Http\Controllers\EmployerController; 32 use App\Http\Controllers\EmployerController;
33 use App\Http\Controllers\CompanyController as FrontCompanyController; 33 use App\Http\Controllers\CompanyController as FrontCompanyController;
34 34
35 35
36 /* 36 /*
37 |-------------------------------------------------------------------------- 37 |--------------------------------------------------------------------------
38 | Web Routes 38 | Web Routes
39 |-------------------------------------------------------------------------- 39 |--------------------------------------------------------------------------
40 | 40 |
41 | Here is where you can register web routes for your application. These 41 | Here is where you can register web routes for your application. These
42 | routes are loaded by the RouteServiceProvider within a group which 42 | routes are loaded by the RouteServiceProvider within a group which
43 | contains the "web" middleware group. Now create something great! 43 | contains the "web" middleware group. Now create something great!
44 | 44 |
45 */ 45 */
46 /* 46 /*
47 Route::get('/', function () { 47 Route::get('/', function () {
48 return view('welcome'); 48 return view('welcome');
49 })->name('index'); 49 })->name('index');
50 */ 50 */
51 51
52 Route::get('/', [MainController::class, 'index'])->name('index'); 52 Route::get('/', [MainController::class, 'index'])->name('index');
53 53
54 //Роуты авторизации, регистрации, восстановления, аутентификации 54 //Роуты авторизации, регистрации, восстановления, аутентификации
55 Auth::routes(['verify' => true]); 55 Auth::routes(['verify' => true]);
56 56
57 // роуты регистрации, авторизации, восстановления пароля, верификации почты 57 // роуты регистрации, авторизации, восстановления пароля, верификации почты
58 /*Route::group([ 58 /*Route::group([
59 'as' => 'auth.', //имя маршрута, например auth.index 59 'as' => 'auth.', //имя маршрута, например auth.index
60 'prefix' => 'auth', // префикс маршрута, например, auth/index 60 'prefix' => 'auth', // префикс маршрута, например, auth/index
61 ], function () { 61 ], function () {
62 //форма регистрации 62 //форма регистрации
63 Route::get('register', [RegisterController::class, 'register'])->name('register'); 63 Route::get('register', [RegisterController::class, 'register'])->name('register');
64 64
65 //создание пользователя 65 //создание пользователя
66 Route::post('register', [RegisterController::class, 'create'])->name('create'); 66 Route::post('register', [RegisterController::class, 'create'])->name('create');
67 67
68 //форма входа авторизации 68 //форма входа авторизации
69 Route::get('login', [LoginController::class, 'login'])->name('login'); 69 Route::get('login', [LoginController::class, 'login'])->name('login');
70 70
71 //аутентификация 71 //аутентификация
72 Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); 72 Route::post('login', [LoginController::class, 'authenticate'])->name('auth');
73 73
74 //выход 74 //выход
75 Route::get('logout', [LoginController::class, 'logout'])->name('logout'); 75 Route::get('logout', [LoginController::class, 'logout'])->name('logout');
76 76
77 //форма ввода адреса почты 77 //форма ввода адреса почты
78 Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); 78 Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form');
79 79
80 //письмо на почту 80 //письмо на почту
81 Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); 81 Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail');
82 82
83 //форма восстановления пароля 83 //форма восстановления пароля
84 Route::get('reset-password/token/{token}/email/{email}', 84 Route::get('reset-password/token/{token}/email/{email}',
85 [ResetPasswordController::class, 'form'] 85 [ResetPasswordController::class, 'form']
86 )->name('reset-form'); 86 )->name('reset-form');
87 87
88 //восстановление пароля 88 //восстановление пароля
89 Route::post('reset-password', 89 Route::post('reset-password',
90 [ResetPasswordController::class, 'reset'] 90 [ResetPasswordController::class, 'reset']
91 )->name('reset-password'); 91 )->name('reset-password');
92 92
93 //сообщение о необходимости проверки адреса почты 93 //сообщение о необходимости проверки адреса почты
94 Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); 94 Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message');
95 95
96 //подтверждение адреса почты нового пользователя 96 //подтверждение адреса почты нового пользователя
97 Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) 97 Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify'])
98 ->where('token', '[a-f0-9]{32}') 98 ->where('token', '[a-f0-9]{32}')
99 ->where('id', '[0-9]+') 99 ->where('id', '[0-9]+')
100 ->name('verify-email'); 100 ->name('verify-email');
101 });*/ 101 });*/
102 102
103 //Личный кабинет пользователя 103 //Личный кабинет пользователя
104 Route::get('/home', [HomeController::class, 'index'])->name('home'); 104 Route::get('/home', [HomeController::class, 'index'])->name('home');
105 105
106 /* 106 /*
107 Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { 107 Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) {
108 $user = User::where('email',$request->input('email'))->first(); 108 $user = User::where('email',$request->input('email'))->first();
109 109
110 $user->sendEmailVerificationNotification(); 110 $user->sendEmailVerificationNotification();
111 111
112 return 'your response'; 112 return 'your response';
113 })->middleware('throttle:6,1')->name('verification.resend'); 113 })->middleware('throttle:6,1')->name('verification.resend');
114 */ 114 */
115 115
116 // Авторизация, регистрация в админку 116 // Авторизация, регистрация в админку
117 Route::group([ 117 Route::group([
118 'as' => 'admin.', // имя маршрута, например auth.index 118 'as' => 'admin.', // имя маршрута, например auth.index
119 'prefix' => 'admin', // префикс маршрута, например auth/index 119 'prefix' => 'admin', // префикс маршрута, например auth/index
120 'middleware' => ['guest'], 120 'middleware' => ['guest'],
121 ], function () { 121 ], function () {
122 // Форма регистрации 122 // Форма регистрации
123 Route::get('register', [AdminController::class, 'register'])->name('register'); 123 Route::get('register', [AdminController::class, 'register'])->name('register');
124 // Создание пользователя 124 // Создание пользователя
125 Route::post('register', [AdminController::class, 'create'])->name('create'); 125 Route::post('register', [AdminController::class, 'create'])->name('create');
126 126
127 //Форма входа 127 //Форма входа
128 Route::get('login', [AdminController::class, 'login'])->name('login'); 128 Route::get('login', [AdminController::class, 'login'])->name('login');
129 129
130 // аутентификация 130 // аутентификация
131 Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); 131 Route::post('login', [AdminController::class, 'autenticate'])->name('auth');
132 132
133 }); 133 });
134 134
135 // Личный кабинет админки 135 // Личный кабинет админки
136 Route::group([ 136 Route::group([
137 'as' => 'admin.', // имя маршрута, например auth.index 137 'as' => 'admin.', // имя маршрута, например auth.index
138 'prefix' => 'admin', // префикс маршрута, например auth/index 138 'prefix' => 'admin', // префикс маршрута, например auth/index
139 'middleware' => ['auth'], ['admin'], 139 'middleware' => ['auth'], ['admin'],
140 ], function() { 140 ], function() {
141 141
142 // выход 142 // выход
143 Route::get('logout', [AdminController::class, 'logout'])->name('logout'); 143 Route::get('logout', [AdminController::class, 'logout'])->name('logout');
144 144
145 // кабинет главная страница 145 // кабинет главная страница
146 Route::get('cabinet', [AdminController::class, 'index'])->name('index'); 146 Route::get('cabinet', [AdminController::class, 'index'])->name('index');
147 147
148 // кабинет профиль админа - форма 148 // кабинет профиль админа - форма
149 Route::get('profile', [AdminController::class, 'profile'])->name('profile'); 149 Route::get('profile', [AdminController::class, 'profile'])->name('profile');
150 // кабинет профиль админа - сохранение формы 150 // кабинет профиль админа - сохранение формы
151 Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); 151 Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile');
152 152
153 //кабинет сообщения админа 153 //кабинет сообщения админа
154 //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); 154 //Route::get('messages', [AdminController::class, 'profile'])->name('profile');
155 155
156 156
157 // кабинет профиль - форма пароли 157 // кабинет профиль - форма пароли
158 Route::get('password', [AdminController::class, 'profile_password'])->name('password'); 158 Route::get('password', [AdminController::class, 'profile_password'])->name('password');
159 // кабинет профиль - сохранение формы пароля 159 // кабинет профиль - сохранение формы пароля
160 Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); 160 Route::post('password', [AdminController::class, 'profile_password_new'])->name('password');
161 161
162 162
163 // кабинет профиль пользователя - форма 163 // кабинет профиль пользователя - форма
164 Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); 164 Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile');
165 // кабинет профиль пользователя - сохранение формы 165 // кабинет профиль пользователя - сохранение формы
166 Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); 166 Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile');
167 167
168 // кабинет профиль работодатель - форма 168 // кабинет профиль работодатель - форма
169 Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); 169 Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile');
170 // кабинет профиль работодатель - сохранение формы 170 // кабинет профиль работодатель - сохранение формы
171 Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); 171 Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile');
172 // кабинет удаление профиль работодателя и юзера 172 // кабинет удаление профиль работодателя и юзера
173 Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); 173 Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer');
174 174
175 // кабинет профиль работник - форма 175 // кабинет профиль работник - форма
176 Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); 176 Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add');
177 Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); 177 Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store');
178 Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); 178 Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit');
179 // кабинет профиль работник - сохранение формы 179 // кабинет профиль работник - сохранение формы
180 Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); 180 Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update');
181 181
182 // Медиа 182 // Медиа
183 Route::get('media', [MediaController::class, 'index'])->name('media'); 183 Route::get('media', [MediaController::class, 'index'])->name('media');
184 Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media'); 184 Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media');
185 185
186 // кабинет настройки сайта - форма 186 // кабинет настройки сайта - форма
187 Route::get('config', [AdminController::class, 'config_form'])->name('config'); 187 Route::get('config', [AdminController::class, 'config_form'])->name('config');
188 // кабинет настройки сайта сохранение формы 188 // кабинет настройки сайта сохранение формы
189 Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); 189 Route::post('config', [AdminController::class, 'store_config'])->name('store_config');
190 190
191 // кабинет - новости 191 // кабинет - новости
192 Route::get('news-list', [AdminController::class, 'news_admin'])->name('news_admin'); 192 Route::get('news-list', [AdminController::class, 'news_admin'])->name('news_admin');
193 Route::get('news/add', [AdminController::class, 'new_admin_add'])->name('new_admin_add'); 193 Route::get('news/add', [AdminController::class, 'new_admin_add'])->name('new_admin_add');
194 Route::post('news/add', [AdminController::class, 'new_admin_add_save'])->name('new_admin_save_add'); 194 Route::post('news/add', [AdminController::class, 'new_admin_add_save'])->name('new_admin_save_add');
195 Route::get('news/edit/{new}', [AdminController::class, 'new_admin_edit'])->name('new_admin_edit'); 195 Route::get('news/edit/{new}', [AdminController::class, 'new_admin_edit'])->name('new_admin_edit');
196 Route::post('news/edit/{new}', [AdminController::class, 'new_admin_update_save'])->name('new_admin_update'); 196 Route::post('news/edit/{new}', [AdminController::class, 'new_admin_update_save'])->name('new_admin_update');
197 Route::get('news/delete/{new}', [AdminController::class, 'new_admin_delete'])->name('new_admin_delete'); 197 Route::get('news/delete/{new}', [AdminController::class, 'new_admin_delete'])->name('new_admin_delete');
198 198
199 // кабинет - пользователи 199 // кабинет - пользователи
200 Route::get('users', [UsersController::class, 'index'])->name('users'); 200 Route::get('users', [UsersController::class, 'index'])->name('users');
201 201
202 // кабинет - пользователи 202 // кабинет - пользователи
203 Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); 203 Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users');
204 204
205 // кабинет - работодатели 205 // кабинет - работодатели
206 Route::get('employers', [EmployersController::class, 'index'])->name('employers'); 206 Route::get('employers', [EmployersController::class, 'index'])->name('employers');
207 207
208 Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); 208 Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer');
209 209
210 Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add'); 210 Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add');
211 Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save'); 211 Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save');
212 Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot'); 212 Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot');
213 Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit'); 213 Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit');
214 Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete'); 214 Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete');
215 215
216 // кабинет - соискатели 216 // кабинет - соискатели
217 Route::get('workers', [WorkersController::class, 'index'])->name('workers'); 217 Route::get('workers', [WorkersController::class, 'index'])->name('workers');
218 218
219 // кабинет - база данных 219 // кабинет - база данных
220 Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); 220 Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata');
221 Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); 221 Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata');
222 Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); 222 Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata');
223 Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); 223 Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata');
224 Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); 224 Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata');
225 Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); 225 Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata');
226 Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); 226 Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata');
227 227
228 // кабинет - вакансии 228 // кабинет - вакансии
229 Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); 229 Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers');
230 Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers'); 230 Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers');
231 Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers'); 231 Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers');
232 Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); 232 Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers');
233 Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); 233 Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers');
234 Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer'); 234 Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer');
235 235
236 // Редактирование должности в вакансии 236 // Редактирование должности в вакансии
237 Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs'); 237 Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs');
238 Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs'); 238 Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs');
239 239
240 240
241 // кабинет - категории 241 // кабинет - категории
242 //Route::get('categories', [AdminController::class, 'index'])->name('categories'); 242 //Route::get('categories', [AdminController::class, 'index'])->name('categories');
243 243
244 // СRUD-операции над Справочником Категории 244 // СRUD-операции над Справочником Категории
245 245
246 Route::resource('categories', CategoryController::class, ['except' => ['show']]); 246 Route::resource('categories', CategoryController::class, ['except' => ['show']]);
247 247
248 // CRUD-операции над справочником Категории для работодателей 248 // CRUD-операции над справочником Категории для работодателей
249 Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); 249 Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]);
250 250
251 // CRUD-операции над справочником Образование 251 // CRUD-операции над справочником Образование
252 Route::resource('education', EducationController::class, ['except' => ['show']]); 252 Route::resource('education', EducationController::class, ['except' => ['show']]);
253 253
254 Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education'); 254 Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education');
255 Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); 255 Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education');
256 Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); 256 Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education');
257 257
258 Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); 258 Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education');
259 Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education'); 259 Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education');
260 260
261 Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); 261 Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education');
262 262
263 //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); 263 //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles');
264 /* 264 /*
265 * кабинет - CRUD-операции по справочнику должности 265 * кабинет - CRUD-операции по справочнику должности
266 * 266 *
267 */ 267 */
268 Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); 268 Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]);
269 269
270 // кабинет - сообщения (чтение чужих) 270 // кабинет - сообщения (чтение чужих)
271 Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); 271 Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages');
272 // кабинет - просмотр сообщения чужого (чтение) 272 // кабинет - просмотр сообщения чужого (чтение)
273 Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); 273 Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message');
274 274
275 // кабинет - сообщения (админские) 275 // кабинет - сообщения (админские)
276 Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); 276 Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages');
277 // кабинет - сообщения (админские) 277 // кабинет - сообщения (админские)
278 Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); 278 Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post');
279 // кабинет - sql - конструкция запросов 279 // кабинет - sql - конструкция запросов
280 Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); 280 Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql');
281 281
282 /* 282 /*
283 * Расписанный подход в описании каждой директорий групп пользователей. 283 * Расписанный подход в описании каждой директорий групп пользователей.
284 */ 284 */
285 // кабинет - группы пользователей 285 // кабинет - группы пользователей
286 Route::get('groups', [GroupsController::class, 'index'])->name('groups'); 286 Route::get('groups', [GroupsController::class, 'index'])->name('groups');
287 // кабинет - добавление форма группы пользователей 287 // кабинет - добавление форма группы пользователей
288 Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); 288 Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group');
289 // кабинет - сохранение формы группы пользователей 289 // кабинет - сохранение формы группы пользователей
290 Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); 290 Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store');
291 // кабинет - редактирование форма группы пользователей 291 // кабинет - редактирование форма группы пользователей
292 Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); 292 Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group');
293 // кабинет - сохранение редактированной формы группы пользователей 293 // кабинет - сохранение редактированной формы группы пользователей
294 Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); 294 Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group');
295 // кабинет - удаление группы пользователей 295 // кабинет - удаление группы пользователей
296 Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); 296 Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group');
297 297
298 298
299 // кабинет - список админов 299 // кабинет - список админов
300 Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); 300 Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin');
301 301
302 // справочник Позиции 302 // справочник Позиции
303 Route::get('positions', [AdminController::class, 'position'])->name('position'); 303 Route::get('positions', [AdminController::class, 'position'])->name('position');
304 Route::get('positions/add', [AdminController::class, 'position_add'])->name('add-position'); 304 Route::get('positions/add', [AdminController::class, 'position_add'])->name('add-position');
305 Route::post('positions/add', [AdminController::class, 'position_add_save'])->name('add-save-position'); 305 Route::post('positions/add', [AdminController::class, 'position_add_save'])->name('add-save-position');
306 Route::get('positions/edit/{position}', [AdminController::class, 'position_edit'])->name('edit-position'); 306 Route::get('positions/edit/{position}', [AdminController::class, 'position_edit'])->name('edit-position');
307 Route::post('position/edit/{position}', [AdminController::class, 'position_update'])->name('update-position'); 307 Route::post('position/edit/{position}', [AdminController::class, 'position_update'])->name('update-position');
308 Route::get('position/delete/{position}', [AdminController::class, 'position_delete'])->name('delete-position'); 308 Route::get('position/delete/{position}', [AdminController::class, 'position_delete'])->name('delete-position');
309 309
310 /////редактор////// кабинет - редактор сайта//////////////////////// 310 /////редактор////// кабинет - редактор сайта////////////////////////
311 Route::get('editor-site', function() { 311 Route::get('editor-site', function() {
312 return view('admin.editor.index'); 312 return view('admin.editor.index');
313 })->name('editor-site'); 313 })->name('editor-site');
314 314
315 315
316 // кабинет - редактор шапки-футера сайта 316 // кабинет - редактор шапки-футера сайта
317 Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); 317 Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks');
318 Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); 318 Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block');
319 Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); 319 Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store');
320 Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); 320 Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block');
321 Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); 321 Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block');
322 Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); 322 Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block');
323 Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); 323 Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block');
324 324
325 325
326 // кабинет - редактор должности на главной 326 // кабинет - редактор должности на главной
327 Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); 327 Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main');
328 328
329 // кабинет - редактор работодатели на главной 329 // кабинет - редактор работодатели на главной
330 Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); 330 Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main');
331 331
332 332
333 // кабинет - редактор seo-сайта 333 // кабинет - редактор seo-сайта
334 Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); 334 Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo');
335 Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); 335 Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo');
336 Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); 336 Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store');
337 Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); 337 Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo');
338 Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); 338 Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo');
339 Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); 339 Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo');
340 Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); 340 Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo');
341 341
342 342
343 // кабинет - редактор страниц 343 // кабинет - редактор страниц
344 Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); 344 Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages');
345 // кабинет - добавление страницы 345 // кабинет - добавление страницы
346 Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); 346 Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page');
347 // кабинет - сохранение формы страницы 347 // кабинет - сохранение формы страницы
348 Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); 348 Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store');
349 // кабинет - редактирование форма страницы 349 // кабинет - редактирование форма страницы
350 Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); 350 Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page');
351 // кабинет - сохранение редактированной формы страницы 351 // кабинет - сохранение редактированной формы страницы
352 Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); 352 Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page');
353 // кабинет - удаление страницы 353 // кабинет - удаление страницы
354 Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); 354 Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page');
355 355
356 356
357 // кабинет - реклама сайта 357 // кабинет - реклама сайта
358 Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); 358 Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames');
359 Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); 359 Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames');
360 Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); 360 Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store');
361 Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); 361 Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames');
362 Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); 362 Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames');
363 Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); 363 Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames');
364 //////////////////////////////////////////////////////////////////////// 364 ////////////////////////////////////////////////////////////////////////
365 365
366 366
367 // кабинет - отзывы о работодателе для модерации 367 // кабинет - отзывы о работодателе для модерации
368 Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); 368 Route::get('answers', [EmployersController::class, 'answers'])->name('answers');
369 369
370 // Общая страница статистики 370 // Общая страница статистики
371 Route::get('statics', function () { 371 Route::get('statics', function () {
372 return view('admin.static.index'); 372 return view('admin.static.index');
373 })->name('statics'); 373 })->name('statics');
374 374
375 // кабинет - статистика работников 375 // кабинет - статистика работников
376 Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); 376 Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers');
377 377
378 // кабинет - статистика вакансий работодателя 378 // кабинет - статистика вакансий работодателя
379 Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); 379 Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads');
380 380
381 // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника 381 // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника
382 /* 382 /*
383 * CRUD-операции над справочником дипломы и документы 383 * CRUD-операции над справочником дипломы и документы
384 */ 384 */
385 //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); 385 //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks');
386 Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); 386 Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]);
387 387
388 // кабинет - роли пользователя 388 // кабинет - роли пользователя
389 Route::get('roles', [UsersController::class, 'roles'])->name('roles'); 389 Route::get('roles', [UsersController::class, 'roles'])->name('roles');
390 390
391 Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles'); 391 Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles');
392 392
393 Route::get('logs', function() { 393 Route::get('logs', function() {
394 $files = Storage::files('logs/laravel.log'); 394 $files = Storage::files('logs/laravel.log');
395 })->name('logs'); 395 })->name('logs');
396 }); 396 });
397 397
398 // Инструментальные страницы 398 // Инструментальные страницы
399 Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); 399 Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload');
400 400
401 Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); 401 Route::get('redis/', [PagesController::class, 'redis'])->name('redis');
402 402
403 Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); 403 Route::get('excel/', [PagesController::class, 'excel'])->name('excel');
404 404
405 // Страницы с произвольным контентом 405 // Страницы с произвольным контентом
406 Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); 406 Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page');
407 407
408 // Форма обратной связи 408 // Форма обратной связи
409 Route::post('form_feedback', [PagesController::class, 'form_feedback'])->name('form_feedback'); 409 Route::post('form_feedback', [PagesController::class, 'form_feedback'])->name('form_feedback');
410 410
411 // Публичные страницы соискателя 411 // Публичные страницы соискателя
412 Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); 412 Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page');
413 413
414 //Страница вакансии 414 //Страница вакансии
415 Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); 415 Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer');
416 416
417 //Вакансии 417 //Вакансии
418 Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies'); 418 Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies');
419 419
420 //Вакансии поиск на главной 420 //Вакансии поиск на главной
421 Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies'); 421 Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies');
422 422
423 //Вакансии категория детальная 423 //Вакансии категория детальная
424 Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies'); 424 Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies');
425 425
426 // Лайк вакансии 426 // Лайк вакансии
427 Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy'); 427 Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy');
428 428
429 //Детальная страница вакансии - работодателя 429 //Детальная страница вакансии - работодателя
430 Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie'); 430 Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie');
431 431
432 //Судоходные компании 432 //Судоходные компании
433 Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies'); 433 Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies');
434 434
435 //Детальная инфа о компании 435 //Детальная инфа о компании
436 Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company'); 436 Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company');
437 437
438 //Образование 438 //Образование
439 Route::get('education', [MainController::class, 'education'])->name('education'); 439 Route::get('education', [MainController::class, 'education'])->name('education');
440 440
441 //Новости 441 //Новости
442 Route::get('news', [MainController::class, 'news'])->name('news'); 442 Route::get('news', [MainController::class, 'news'])->name('news');
443 Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new'); 443 Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new');
444 444
445 //Контакты 445 //Контакты
446 Route::get('contacts', [MainController::class, 'contacts'])->name('contacts'); 446 Route::get('contacts', [MainController::class, 'contacts'])->name('contacts');
447 447
448 //База резюме 448 //База резюме
449 Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume'); 449 Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume');
450 Route::get('bd_resume_danger', function(){ 450 Route::get('bd_resume_danger', function(){
451 return view('employers.bd_resume_danger'); 451 return view('employers.bd_resume_danger');
452 })->name('bd_resume_danger'); 452 })->name('bd_resume_danger');
453 453
454 Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume'); 454 Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume');
455 455
456 //Анкета соискателя 456 //Анкета соискателя
457 Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile'); 457 Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile');
458 458
459 //Скачать резюме 459 //Скачать резюме
460 Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download'); 460 Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download');
461 Route::get('resume-download/all', [WorkerController::class, 'resume_download_all'])->name('resume_download_all2'); 461 Route::get('resume-download/all', [WorkerController::class, 'resume_download_all'])->name('resume_download_all2');
462 Route::get('resume-download', [WorkerController::class, 'resume_download_all'])->name('resume_download_all'); 462 Route::get('resume-download', [WorkerController::class, 'resume_download_all'])->name('resume_download_all');
463 463
464 464
465 //Вход в кабинет 465 //Вход в кабинет
466 Route::get('login', [MainController::class, 'input_login'])->name('login'); 466 Route::get('login', [MainController::class, 'input_login'])->name('login');
467 467
468 // Выход из кабинета 468 // Выход из кабинета
469 Route::get('logout', [EmployerController::class, 'logout'])->name('logout'); 469 Route::get('logout', [EmployerController::class, 'logout'])->name('logout');
470 470
471 Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker'); 471 Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker');
472 Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer'); 472 Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer');
473 473
474 //восстановление пароля 474 //восстановление пароля
475 Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password'); 475 Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password');
476 // Звезда сообщения 476 // Звезда сообщения
477 Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer'); 477 Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer');
478 478
479 // Борьба 479 // Борьба
480 Route::get('clear_cookie', function() { 480 Route::get('clear_cookie', function() {
481 \App\Classes\Cookies_vacancy::clear_vacancy(); 481 \App\Classes\Cookies_vacancy::clear_vacancy();
482 return redirect()->route('index'); 482 return redirect()->route('index');
483 })->name('clear_cookie'); 483 })->name('clear_cookie');
484 484
485 Route::get('cookies', function() { 485 Route::get('cookies', function() {
486 return view('cookies'); 486 return view('cookies');
487 })->name('cookies'); 487 })->name('cookies');
488 488
489 // Личный кабинет работник 489 // Личный кабинет работник
490 Route::group([ 490 Route::group([
491 'as' => 'worker.', // имя маршрута, например auth.index 491 'as' => 'worker.', // имя маршрута, например auth.index
492 'prefix' => 'worker', // префикс маршрута, например auth/index 492 'prefix' => 'worker', // префикс маршрута, например auth/index
493 'middleware' => ['auth'], ['is_worker'], 493 'middleware' => ['auth'], ['is_worker'],
494 ], function() { 494 ], function() {
495 // 1 страница - Моя анкета 495 // 1 страница - Моя анкета
496 Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); 496 Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet');
497 Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); 497 Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save');
498 498
499 // 2 страница - Сообщения 499 // 2 страница - Сообщения
500 Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); 500 Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages');
501 Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog'); 501 Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog');
502 // 3 страница - Избранные вакансии 502 // 3 страница - Избранные вакансии
503 Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); 503 Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite');
504 // Продолжение борьбы против колорадов - избранные вакансии 504 // Продолжение борьбы против колорадов - избранные вакансии
505 Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); 505 Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado');
506 506
507 // 4 страница - Сменить пароль 507 // 4 страница - Сменить пароль
508 Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); 508 Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password');
509 Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password'); 509 Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password');
510 510
511 // 5 страница - Удалить профиль 511 // 5 страница - Удалить профиль
512 Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); 512 Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile');
513 Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); 513 Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result');
514 514
515 // Резюме -pdf 515 // Резюме -pdf
516 Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); 516 Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download');
517 517
518 // Поднятие анкеты 518 // Поднятие анкеты
519 Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); 519 Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up');
520 520
521 Route::post('test123', [WorkerController::class, 'test123'])->name('test123');
522
521 // Добавление сертификата 523 // Добавление сертификата
522 Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate'); 524 Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate');
523 Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); 525 Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate');
524 Route::get('кабинет/edit_sertificate/{worker}/{doc}', [WorkerController::class, 'edit_sertificate'])->name('edit_sertificate'); 526 Route::get('кабинет/edit_sertificate/{worker}/{doc}', [WorkerController::class, 'edit_sertificate'])->name('edit_sertificate');
525 Route::get('кабинет/edit_sertificate/{doc}', [WorkerController::class, 'update_serificate'])->name('update_serificate'); 527 Route::get('кабинет/edit_sertificate/{doc}', [WorkerController::class, 'update_serificate'])->name('update_serificate');
526 Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); 528 Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate');
527 529
528 // Добавление предыдущих контактов компании 530 // Добавление предыдущих контактов компании
529 Route::get('кабинет/prev_company/{worker}', [WorkerController::class, 'new_prev_company'])->name('new_prev_company'); 531 Route::get('кабинет/prev_company/{worker}', [WorkerController::class, 'new_prev_company'])->name('new_prev_company');
530 Route::get('кабинет/add_prev_company', [WorkerController::class, 'add_prev_company'])->name('add_prev_company'); 532 Route::get('кабинет/add_prev_company', [WorkerController::class, 'add_prev_company'])->name('add_prev_company');
531 Route::get('кабинет/edit_prev_company/{doc}/{worker}', [WorkerController::class, 'edit_prev_company'])->name('edit_prev_company'); 533 Route::get('кабинет/edit_prev_company/{doc}/{worker}', [WorkerController::class, 'edit_prev_company'])->name('edit_prev_company');
532 Route::post('кабинет/update_prev_company/{doc}', [WorkerController::class, 'update_prev_company'])->name('update_prev_company'); 534 Route::post('кабинет/update_prev_company/{doc}', [WorkerController::class, 'update_prev_company'])->name('update_prev_company');
533 Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company'); 535 Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company');
534 536
535 // Добавление документа-диплома 537 // Добавление документа-диплома
536 Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); 538 Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom');
537 Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); 539 Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save');
538 Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom'); 540 Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom');
539 541
540 // Добавление стандартного диплома 542 // Добавление стандартного диплома
541 Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); 543 Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document');
542 Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); 544 Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save');
543 Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); 545 Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document');
544 Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); 546 Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save');
545 Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); 547 Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document');
546 548
547 // Отправка сообщения работодателю от соискателя 549 // Отправка сообщения работодателю от соискателя
548 Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message'); 550 Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message');
549 }); 551 });
550 552
551 // Личный кабинет работодателя 553 // Личный кабинет работодателя
552 Route::group([ 554 Route::group([
553 'as' => 'employer.', // имя маршрута, например auth.index 555 'as' => 'employer.', // имя маршрута, например auth.index
554 'prefix' => 'employer', // префикс маршрута, например auth/index 556 'prefix' => 'employer', // префикс маршрута, например auth/index
555 'middleware' => ['auth'], !['is_worker'], 557 'middleware' => ['auth'], !['is_worker'],
556 ], function() { 558 ], function() {
557 // 0 страница - Личные данные работодателя 559 // 0 страница - Личные данные работодателя
558 Route::get('cabinet/employer_info', [EmployerController::class, 'employer_info'])->name('employer_info'); 560 Route::get('cabinet/employer_info', [EmployerController::class, 'employer_info'])->name('employer_info');
559 Route::post('cabinet/employer_info/{user}', [EmployerController::class, 'employer_info_save'])->name('employer_info_save'); 561 Route::post('cabinet/employer_info/{user}', [EmployerController::class, 'employer_info_save'])->name('employer_info_save');
560 562
561 // 1 страница - Профиль 563 // 1 страница - Профиль
562 Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); 564 Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet');
563 Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); 565 Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save');
564 Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); 566 Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot');
565 Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); 567 Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot');
566 Route::get('cabinet/flot_edit/{Flot}/{Employer}', [EmployerController::class, 'edit_flot'])->name('edit_flot'); 568 Route::get('cabinet/flot_edit/{Flot}/{Employer}', [EmployerController::class, 'edit_flot'])->name('edit_flot');
567 Route::post('cabinet/flot_edit/{Flot}', [EmployerController::class, 'update_flot'])->name('update_flot_save'); 569 Route::post('cabinet/flot_edit/{Flot}', [EmployerController::class, 'update_flot'])->name('update_flot_save');
568 Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot'); 570 Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot');
569 571
570 // 2 страница - Добавление вакансий 572 // 2 страница - Добавление вакансий
571 Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); 573 Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie');
572 Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); 574 Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save');
573 //Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); 575 //Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people');
574 576
575 Route::get('cabinet/vacancie_danger', [EmployerController::class, 'cabinet_vacancie_danger'])->name('cabinet_vacancie_danger'); 577 Route::get('cabinet/vacancie_danger', [EmployerController::class, 'cabinet_vacancie_danger'])->name('cabinet_vacancie_danger');
576 578
577 579
578 580
579 Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); 581 Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people');
580 582
581 // 3 страница - Мои вакансии 583 // 3 страница - Мои вакансии
582 Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); 584 Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list');
583 Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); 585 Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit');
584 Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); 586 Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete');
585 Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); 587 Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up');
586 Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); 588 Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye');
587 Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); 589 Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit');
588 Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); 590 Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me');
589 591
590 // 4.1Ю. 592 // 4.1Ю.
591 Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac'); 593 Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac');
592 Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save'); 594 Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save');
593 Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac'); 595 Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac');
594 Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save'); 596 Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save');
595 Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac'); 597 Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac');
596 598
597 // 4 страница - Отклики на вакансии 599 // 4 страница - Отклики на вакансии
598 Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); 600 Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers');
599 Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); 601 Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple');
600 Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); 602 Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg');
601 603
602 // 5 страница - Сообщения 604 // 5 страница - Сообщения
603 Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); 605 Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages');
604 Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); 606 Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog');
605 Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); 607 Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message');
606 Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); 608 Route::post('test123', [EmployerController::class, 'test123'])->name('test123');
607 609
608 // 6 страница - Избранный 610 // 6 страница - Избранный
609 Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); 611 Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites');
610 612
611 //7 страница - База данных 613 //7 страница - База данных
612 Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); 614 Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd');
613 615
614 //8 страница - База резюме 616 //8 страница - База резюме
615 Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); 617 Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe');
616 618
617 // 9 рассылка сообщений 619 // 9 рассылка сообщений
618 Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); 620 Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages');
619 Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); 621 Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post');
620 622
621 // 10 страница FAQ вопросы 623 // 10 страница FAQ вопросы
622 Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq'); 624 Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq');
623 625
624 // 11 страница - Настройка уведомлений 626 // 11 страница - Настройка уведомлений
625 Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); 627 Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe');
626 Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); 628 Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe');
627 629
628 // 12 страница - Сменить пароль 630 // 12 страница - Сменить пароль
629 Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); 631 Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset');
630 Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); 632 Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password');
631 633
632 // 13 страница - Удаление профиля 634 // 13 страница - Удаление профиля
633 Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); 635 Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people');
634 Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); 636 Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user');
635 Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); 637 Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user');
636 638
637 // Отправил сообщение 639 // Отправил сообщение
638 Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); 640 Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message');
639 }); 641 });
640 642
641 Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker'); 643 Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker');
642 644
643 645