Commit 6ff65f10a76247e609957ace089f351b8fae67f0
Exists in
master
Обновление
Showing 31 changed files Inline Diff
- app/Http/Controllers/Ad_jobsController.php
- app/Http/Controllers/Admin/JobTitlesController.php
- app/Http/Controllers/CompanyController.php
- app/Http/Controllers/EmployerController.php
- app/Http/Controllers/MainController.php
- app/Http/Controllers/WorkerController.php
- app/Models/Ad_jobs.php
- app/Models/Job_title.php
- database/migrations/2023_09_08_084707_alter_job_titles3_table.php
- public/js/script-vc.js
- public/js/script.js
- public/js/script0.js
- resources/views/admin/job_titles/form.blade.php
- resources/views/admin/positions/position.blade.php
- resources/views/block_real.blade.php
- resources/views/companies.blade.php
- resources/views/education.blade.php
- resources/views/employers/add_ad_jobs.blade.php
- resources/views/employers/add_vacancy.blade.php
- resources/views/employers/ajax/list_vacancy.blade.php
- resources/views/employers/edit_ad_jobs.blade.php
- resources/views/employers/edit_vacancy.blade.php
- resources/views/employers/list_vacancy.blade.php
- resources/views/favorite_people.blade.php
- resources/views/index.blade.php
- resources/views/js/modals.blade.php
- resources/views/layout/frontend.blade.php
- resources/views/list_vacancies.blade.php
- resources/views/news-list.blade.php
- resources/views/resume.blade.php
- routes/web.php
app/Http/Controllers/Ad_jobsController.php
File was created | 1 | <?php | |
2 | |||
3 | namespace App\Http\Controllers; | ||
4 | |||
5 | use App\Classes\RusDate; | ||
6 | use App\Classes\Tools; | ||
7 | use App\Http\Requests\FlotRequest; | ||
8 | use App\Http\Requests\MessagesRequiest; | ||
9 | use App\Http\Requests\VacancyRequestEdit; | ||
10 | use App\Http\Requests\VacansiaRequiest; | ||
11 | use App\Mail\MailSotrudnichestvo; | ||
12 | use App\Mail\SendAllMessages; | ||
13 | use App\Models\Ad_employer; | ||
14 | use App\Models\Ad_jobs; | ||
15 | use App\Models\ad_response; | ||
16 | use App\Models\Category; | ||
17 | use App\Models\Education; | ||
18 | use App\Models\Employer; | ||
19 | use App\Models\employers_main; | ||
20 | use App\Models\Flot; | ||
21 | use App\Models\Job_title; | ||
22 | use App\Models\Like_vacancy; | ||
23 | use App\Models\Like_worker; | ||
24 | use App\Models\Message; | ||
25 | use App\Models\Positions; | ||
26 | use App\Models\Worker; | ||
27 | use Carbon\Carbon; | ||
28 | use Illuminate\Auth\Events\Registered; | ||
29 | use Illuminate\Database\Eloquent\Builder; | ||
30 | use Illuminate\Database\Eloquent\Model; | ||
31 | use Illuminate\Foundation\Auth\User; | ||
32 | use Illuminate\Http\Request; | ||
33 | use Illuminate\Support\Facades\Auth; | ||
34 | use Illuminate\Support\Facades\Hash; | ||
35 | use Illuminate\Support\Facades\Mail; | ||
36 | use Illuminate\Support\Facades\Storage; | ||
37 | use App\Models\User as User_Model; | ||
38 | use Illuminate\Support\Facades\Validator; | ||
39 | |||
40 | class Ad_jobsController extends Controller | ||
41 | { | ||
42 | |||
43 | public function add_job_in_vac(Request $request, Ad_employer $ad_employer) { | ||
44 | $id = Auth()->user()->id; | ||
45 | |||
46 | $Positions = Positions::query()->get(); | ||
47 | if ($Positions->count()) { | ||
48 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get(); | ||
49 | } else { | ||
50 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get(); | ||
51 | } | ||
52 | $categories = Category::query()->get(); | ||
53 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | ||
54 | where('user_id', $id)->first(); | ||
55 | |||
56 | return view('employers.add_ad_jobs', compact('ad_employer', | ||
57 | 'Positions', 'categories', 'jobs', | ||
58 | 'Employer')); | ||
59 | } | ||
60 | |||
61 | public function add_job_in_vac_save(Request $request) { | ||
62 | $params = $request->all(); | ||
63 | |||
64 | Ad_jobs::create($params); | ||
65 | return redirect()->route('employer.vacancy_list'); | ||
66 | } | ||
67 | |||
68 | public function edit_job_in_vac(Ad_jobs $ad_job, Ad_employer $ad_employer) { | ||
69 | $id = Auth()->user()->id; | ||
70 | |||
71 | $Positions = Positions::query()->get(); | ||
72 | if ($Positions->count()) { | ||
73 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get(); | ||
74 | } else { | ||
75 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get(); | ||
76 | } | ||
77 | $categories = Category::query()->get(); | ||
78 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | ||
79 | where('user_id', $id)->first(); | ||
80 | |||
81 | return view('employers.edit_ad_jobs', compact('ad_job', | ||
82 | 'Positions', 'categories', | ||
83 | 'Employer','jobs', 'ad_employer')); | ||
84 | } | ||
85 | |||
86 | public function edit_job_in_vac_save(Request $request, Ad_jobs $ad_job) { | ||
87 | $params = $request->all(); | ||
88 | |||
89 | $ad_job->update($params); | ||
90 | |||
91 | return redirect()->route('employer.vacancy_list'); | ||
92 | } | ||
93 | |||
94 | public function delete_job_in_vac(Ad_jobs $ad_job) { | ||
95 | $ad_job->delete(); | ||
96 | return redirect()->route('employer.vacancy_list'); | ||
97 | } | ||
98 | } | ||
99 |
app/Http/Controllers/Admin/JobTitlesController.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Http\Controllers\Admin; | 3 | namespace App\Http\Controllers\Admin; |
4 | 4 | ||
5 | use App\Http\Controllers\Controller; | 5 | use App\Http\Controllers\Controller; |
6 | use App\Http\Requests\JobTitlesRequest; | 6 | use App\Http\Requests\JobTitlesRequest; |
7 | use App\Models\Job_title; | 7 | use App\Models\Job_title; |
8 | use App\Models\Positions; | ||
8 | use App\Models\Positions; | 9 | use Illuminate\Http\Request; |
9 | use Illuminate\Http\Request; | 10 | |
10 | 11 | class JobTitlesController extends Controller | |
11 | class JobTitlesController extends Controller | 12 | { |
12 | { | 13 | /** |
13 | /** | 14 | * Display a listing of the resource. |
14 | * Display a listing of the resource. | 15 | * |
15 | * | 16 | * @return \Illuminate\Http\Response |
16 | * @return \Illuminate\Http\Response | 17 | */ |
17 | */ | 18 | public function index() |
18 | public function index() | 19 | { |
19 | { | 20 | $Jobs = Job_title::query()->orderBy('name')->active()->paginate(15); |
20 | $Jobs = Job_title::query()->orderBy('name')->active()->paginate(15); | 21 | return view('admin.job_titles.index', compact('Jobs')); |
21 | return view('admin.job_titles.index', compact('Jobs')); | 22 | } |
22 | } | 23 | |
23 | 24 | /** | |
24 | /** | 25 | * Show the form for creating a new resource. |
25 | * Show the form for creating a new resource. | 26 | * |
26 | * | 27 | * @return \Illuminate\Http\Response |
27 | * @return \Illuminate\Http\Response | 28 | */ |
28 | */ | 29 | public function create() |
29 | public function create() | 30 | { |
30 | { | 31 | /*$items = Job_title::query()-> |
31 | /*$items = Job_title::query()-> | 32 | orderByDesc('sort')-> |
32 | orderByDesc('sort')-> | 33 | orderBy('name')-> |
33 | orderBy('name')-> | 34 | active()-> |
34 | active()-> | 35 | get();*/ |
36 | $position = Positions::query()->get(); | ||
35 | get();*/ | 37 | |
36 | $position = Positions::query()->get(); | 38 | return view('admin.job_titles.add', compact('position')); |
37 | 39 | } | |
38 | return view('admin.job_titles.add', compact('position')); | 40 | |
39 | } | 41 | /** |
40 | 42 | * Store a newly created resource in storage. | |
41 | /** | 43 | * |
42 | * Store a newly created resource in storage. | 44 | * @param \Illuminate\Http\Request $request |
43 | * | 45 | * @return \Illuminate\Http\Response |
44 | * @param \Illuminate\Http\Request $request | 46 | */ |
45 | * @return \Illuminate\Http\Response | 47 | public function store(JobTitlesRequest $request) |
46 | */ | 48 | { |
47 | public function store(JobTitlesRequest $request) | 49 | Job_title::create($request->all()); |
48 | { | 50 | return redirect()->route('admin.job-titles.index'); |
49 | Job_title::create($request->all()); | 51 | } |
50 | return redirect()->route('admin.job-titles.index'); | 52 | |
51 | } | 53 | /** |
52 | 54 | * Display the specified resource. | |
53 | /** | 55 | * |
54 | * Display the specified resource. | 56 | * @param \App\Models\Job_title $job_title |
55 | * | 57 | * @return \Illuminate\Http\Response |
56 | * @param \App\Models\Job_title $job_title | 58 | */ |
57 | * @return \Illuminate\Http\Response | 59 | public function show(Job_title $job_title) |
58 | */ | 60 | { |
59 | public function show(Job_title $job_title) | 61 | // |
60 | { | 62 | } |
61 | // | 63 | |
62 | } | 64 | /** |
63 | 65 | * Show the form for editing the specified resource. | |
64 | /** | 66 | * |
65 | * Show the form for editing the specified resource. | 67 | * @param \App\Models\Job_title $job_title |
66 | * | 68 | * @return \Illuminate\Http\Response |
67 | * @param \App\Models\Job_title $job_title | 69 | */ |
68 | * @return \Illuminate\Http\Response | 70 | public function edit(Job_title $job_title) |
69 | */ | 71 | { |
70 | public function edit(Job_title $job_title) | 72 | $position = Positions::query()->get(); |
73 | return view('admin.job_titles.edit', compact('job_title', 'position')); | ||
71 | { | 74 | } |
72 | $position = Positions::query()->get(); | 75 | |
73 | return view('admin.job_titles.edit', compact('job_title', 'position')); | 76 | /** |
74 | } | 77 | * Update the specified resource in storage. |
75 | 78 | * | |
76 | /** | 79 | * @param \Illuminate\Http\Request $request |
77 | * Update the specified resource in storage. | 80 | * @param \App\Models\Job_title $job_title |
78 | * | 81 | * @return \Illuminate\Http\Response |
79 | * @param \Illuminate\Http\Request $request | 82 | */ |
80 | * @param \App\Models\Job_title $job_title | 83 | public function update(JobTitlesRequest $request, Job_title $job_title) |
81 | * @return \Illuminate\Http\Response | 84 | { |
82 | */ | 85 | $job_title->update($request->all()); |
83 | public function update(JobTitlesRequest $request, Job_title $job_title) | 86 | return redirect()->route('admin.job-titles.index'); |
84 | { | 87 | } |
85 | $job_title->update($request->all()); | 88 | |
86 | return redirect()->route('admin.job-titles.index'); | 89 | /** |
87 | } | 90 | * Remove the specified resource from storage. |
88 | 91 | * | |
89 | /** | 92 | * @param \App\Models\Job_title $job_title |
90 | * Remove the specified resource from storage. | 93 | * @return \Illuminate\Http\Response |
91 | * | 94 | */ |
92 | * @param \App\Models\Job_title $job_title | 95 | public function destroy(Job_title $job_title) |
93 | * @return \Illuminate\Http\Response | 96 | { |
94 | */ | 97 | $job_title->update(['is_remove' => 1]); |
95 | public function destroy(Job_title $job_title) | 98 | return redirect()->route('admin.job-titles.index'); |
96 | { | 99 | } |
97 | $job_title->update(['is_remove' => 1]); | 100 | } |
98 | return redirect()->route('admin.job-titles.index'); | 101 |
app/Http/Controllers/CompanyController.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Http\Controllers; | 3 | namespace App\Http\Controllers; |
4 | 4 | ||
5 | use App\Models\Employer; | 5 | use App\Models\Employer; |
6 | use Illuminate\Http\Request; | 6 | use Illuminate\Http\Request; |
7 | 7 | ||
8 | class CompanyController extends Controller | 8 | class CompanyController extends Controller |
9 | { | 9 | { |
10 | public function shipping_companies(Request $request) { | 10 | public function shipping_companies(Request $request) { |
11 | $emps = Employer::query()->with('ads'); | 11 | $emps = Employer::query()->with('ads'); |
12 | if (($request->has('search')) && (!empty($request->get('search')))) { | 12 | if (($request->has('search')) && (!empty($request->get('search')))) { |
13 | $search = $request->get('search'); | 13 | $search = $request->get('search'); |
14 | $emps = $emps->where('name_company', 'LIKE', "%$search%"); | 14 | $emps = $emps->where('name_company', 'LIKE', "%$search%"); |
15 | } | 15 | } |
16 | 16 | ||
17 | $count_emps = $emps->count(); | 17 | $count_emps = $emps->count(); |
18 | 18 | ||
19 | if ($request->get('sort')) { | 19 | if ($request->get('sort')) { |
20 | $sort = $request->get('sort'); | 20 | $sort = $request->get('sort'); |
21 | switch ($sort) { | 21 | switch ($sort) { |
22 | case 'name_up': $emps = $emps->orderBy('name_company')->orderBy('id'); break; | 22 | case 'name_up': $emps = $emps->orderBy('name_company')->orderBy('id'); break; |
23 | case 'name_down': $emps = $emps->orderByDesc('name_company')->orderby('id'); break; | 23 | case 'name_down': $emps = $emps->orderByDesc('name_company')->orderby('id'); break; |
24 | case 'created_at_up': $emps = $emps->OrderBy('created_at')->orderBy('id'); break; | 24 | case 'created_at_up': $emps = $emps->OrderBy('created_at')->orderBy('id'); break; |
25 | case 'created_at_down': $emps = $emps->orderByDesc('created_at')->orderBy('id'); break; | 25 | case 'created_at_down': $emps = $emps->orderByDesc('created_at')->orderBy('id'); break; |
26 | case 'default': $emps = $emps->orderBy('id')->orderby('updated_at'); break; | 26 | case 'default': $emps = $emps->orderBy('id')->orderby('updated_at'); break; |
27 | default: $emps = $emps->orderBy('id')->orderby('updated_at'); break; | 27 | default: $emps = $emps->orderBy('id')->orderby('updated_at'); break; |
28 | } | 28 | } |
29 | } | 29 | } |
30 | 30 | ||
31 | $emps = $emps->paginate(4); | 31 | $emps = $emps->paginate(4); |
32 | 32 | ||
33 | |||
33 | 34 | if ($request->ajax()) { | |
34 | if ($request->ajax()) { | 35 | if ($request->get('block') == '1') |
35 | if ($request->get('block') == '1') | 36 | return view('ajax.companies', compact('emps', 'count_emps')); |
36 | return view('ajax.companies', compact('emps', 'count_emps')); | 37 | else |
37 | else | 38 | return view('ajax.companies2', compact('emps', 'count_emps')); |
38 | return view('ajax.companies2', compact('emps', 'count_emps')); | 39 | } else { |
39 | } else { | 40 | return view('companies', compact('emps', 'count_emps')); |
40 | return view('companies', compact('emps', 'count_emps')); | 41 | } |
41 | } | 42 | } |
42 | } | 43 | |
43 | 44 | public function info_company(Employer $company) { | |
44 | public function info_company(Employer $company) { | 45 | if (isset(Auth()->user()->id)) { |
45 | if (isset(Auth()->user()->id)) { | 46 | $user_id = Auth()->user()->id; |
46 | $user_id = Auth()->user()->id; | 47 | } else { |
47 | } else { | 48 | $user_id = 0; |
48 | $user_id = 0; | 49 | } |
49 | } | 50 | $company = Employer::with('ads')->with('flots')->with('users') |
50 | $company = Employer::with('ads')->with('flots')->with('users') | 51 | ->where('id', '=', $company->id)->get(); |
51 | ->where('id', '=', $company->id)->get(); | 52 | |
52 | 53 | $title = $company[0]->name_company; | |
53 | $title = $company[0]->name_company; | 54 | |
54 | 55 | return view('info_company_new', compact('company', 'user_id', 'title')); | |
55 | return view('info_company_new', compact('company', 'user_id', 'title')); | 56 | } |
56 | } | 57 | } |
57 | } | 58 |
app/Http/Controllers/EmployerController.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Http\Controllers; | 3 | namespace App\Http\Controllers; |
4 | 4 | ||
5 | use App\Classes\RusDate; | 5 | use App\Classes\RusDate; |
6 | use App\Classes\Tools; | 6 | use App\Classes\Tools; |
7 | use App\Http\Requests\FlotRequest; | 7 | use App\Http\Requests\FlotRequest; |
8 | use App\Http\Requests\MessagesRequiest; | 8 | use App\Http\Requests\MessagesRequiest; |
9 | use App\Http\Requests\VacancyRequestEdit; | 9 | use App\Http\Requests\VacancyRequestEdit; |
10 | use App\Http\Requests\VacansiaRequiest; | 10 | use App\Http\Requests\VacansiaRequiest; |
11 | use App\Mail\MailSotrudnichestvo; | 11 | use App\Mail\MailSotrudnichestvo; |
12 | use App\Mail\SendAllMessages; | 12 | use App\Mail\SendAllMessages; |
13 | use App\Models\Ad_employer; | 13 | use App\Models\Ad_employer; |
14 | use App\Models\Ad_jobs; | 14 | use App\Models\Ad_jobs; |
15 | use App\Models\ad_response; | 15 | use App\Models\ad_response; |
16 | use App\Models\Category; | 16 | use App\Models\Category; |
17 | use App\Models\Education; | 17 | use App\Models\Education; |
18 | use App\Models\Employer; | 18 | use App\Models\Employer; |
19 | use App\Models\employers_main; | 19 | use App\Models\employers_main; |
20 | use App\Models\Flot; | 20 | use App\Models\Flot; |
21 | use App\Models\Job_title; | 21 | use App\Models\Job_title; |
22 | use App\Models\Like_vacancy; | 22 | use App\Models\Like_vacancy; |
23 | use App\Models\Like_worker; | 23 | use App\Models\Like_worker; |
24 | use App\Models\Message; | 24 | use App\Models\Message; |
25 | use App\Models\Positions; | 25 | use App\Models\Positions; |
26 | use App\Models\Worker; | 26 | use App\Models\Worker; |
27 | use Carbon\Carbon; | 27 | use Carbon\Carbon; |
28 | use Illuminate\Auth\Events\Registered; | 28 | use Illuminate\Auth\Events\Registered; |
29 | use Illuminate\Database\Eloquent\Builder; | 29 | use Illuminate\Database\Eloquent\Builder; |
30 | use Illuminate\Database\Eloquent\Model; | 30 | use Illuminate\Database\Eloquent\Model; |
31 | use Illuminate\Foundation\Auth\User; | 31 | use Illuminate\Foundation\Auth\User; |
32 | use Illuminate\Http\Request; | 32 | use Illuminate\Http\Request; |
33 | use Illuminate\Support\Facades\Auth; | 33 | use Illuminate\Support\Facades\Auth; |
34 | use Illuminate\Support\Facades\Hash; | 34 | use Illuminate\Support\Facades\Hash; |
35 | use Illuminate\Support\Facades\Mail; | 35 | use Illuminate\Support\Facades\Mail; |
36 | use Illuminate\Support\Facades\Storage; | 36 | use Illuminate\Support\Facades\Storage; |
37 | use App\Models\User as User_Model; | 37 | use App\Models\User as User_Model; |
38 | use Illuminate\Support\Facades\Validator; | 38 | use Illuminate\Support\Facades\Validator; |
39 | 39 | ||
40 | class EmployerController extends Controller | 40 | class EmployerController extends Controller |
41 | { | 41 | { |
42 | public function vacancie($vacancy, Request $request) { | 42 | public function vacancie($vacancy, Request $request) { |
43 | $title = 'Заголовок вакансии'; | 43 | $title = 'Заголовок вакансии'; |
44 | $Query = Ad_employer::with('jobs')-> | 44 | $Query = Ad_employer::with('jobs')-> |
45 | with('cat')-> | 45 | with('cat')-> |
46 | with('employer')-> | 46 | with('employer')-> |
47 | with('jobs_code')-> | 47 | with('jobs_code')-> |
48 | select('ad_employers.*')-> | 48 | select('ad_employers.*')-> |
49 | where('id', '=', $vacancy)->get(); | 49 | where('id', '=', $vacancy)->get(); |
50 | 50 | ||
51 | if (isset(Auth()->user()->id)) | 51 | if (isset(Auth()->user()->id)) |
52 | $uid = Auth()->user()->id; | 52 | $uid = Auth()->user()->id; |
53 | else | 53 | else |
54 | $uid = 0; | 54 | $uid = 0; |
55 | $title = $Query[0]->name; | 55 | $title = $Query[0]->name; |
56 | if ($request->ajax()) { | 56 | if ($request->ajax()) { |
57 | return view('ajax.vacance-item', compact('Query','uid')); | 57 | return view('ajax.vacance-item', compact('Query','uid')); |
58 | } else { | 58 | } else { |
59 | return view('vacance-item', compact('title', 'Query', 'uid')); | 59 | return view('vacance-item', compact('title', 'Query', 'uid')); |
60 | } | 60 | } |
61 | } | 61 | } |
62 | 62 | ||
63 | public function logout() { | 63 | public function logout() { |
64 | Auth::logout(); | 64 | Auth::logout(); |
65 | return redirect()->route('index') | 65 | return redirect()->route('index') |
66 | ->with('success', 'Вы вышли из личного кабинета'); | 66 | ->with('success', 'Вы вышли из личного кабинета'); |
67 | } | 67 | } |
68 | 68 | ||
69 | public function cabinet() { | 69 | public function cabinet() { |
70 | $id = Auth()->user()->id; | 70 | $id = Auth()->user()->id; |
71 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | 71 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
72 | WhereHas('users', | 72 | WhereHas('users', |
73 | function (Builder $query) use ($id) {$query->Where('id', $id); | 73 | function (Builder $query) use ($id) {$query->Where('id', $id); |
74 | })->get(); | 74 | })->get(); |
75 | return view('employers.cabinet45', compact('Employer')); | 75 | return view('employers.cabinet45', compact('Employer')); |
76 | } | 76 | } |
77 | 77 | ||
78 | public function cabinet_save(Employer $Employer, Request $request) { | 78 | public function cabinet_save(Employer $Employer, Request $request) { |
79 | $params = $request->all(); | 79 | $params = $request->all(); |
80 | $params['user_id'] = Auth()->user()->id; | 80 | $params['user_id'] = Auth()->user()->id; |
81 | $id = $Employer->id; | 81 | $id = $Employer->id; |
82 | 82 | ||
83 | if ($request->has('logo')) { | 83 | if ($request->has('logo')) { |
84 | if (!empty($Employer->logo)) { | 84 | if (!empty($Employer->logo)) { |
85 | Storage::delete($Employer->logo); | 85 | Storage::delete($Employer->logo); |
86 | } | 86 | } |
87 | $params['logo'] = $request->file('logo')->store("employer/$id", 'public'); | 87 | $params['logo'] = $request->file('logo')->store("employer/$id", 'public'); |
88 | } | 88 | } |
89 | 89 | ||
90 | $Employer->update($params); | 90 | $Employer->update($params); |
91 | 91 | ||
92 | return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены'); | 92 | return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены'); |
93 | } | 93 | } |
94 | 94 | ||
95 | public function save_add_flot(FlotRequest $request) { | 95 | public function save_add_flot(FlotRequest $request) { |
96 | // отмена | 96 | // отмена |
97 | $params = $request->all(); | 97 | $params = $request->all(); |
98 | 98 | ||
99 | if ($request->has('image')) { | 99 | if ($request->has('image')) { |
100 | $params['image'] = $request->file('image')->store("flot", 'public'); | 100 | $params['image'] = $request->file('image')->store("flot", 'public'); |
101 | } | 101 | } |
102 | Flot::create($params); | 102 | Flot::create($params); |
103 | $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get(); | 103 | $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get(); |
104 | return redirect()->route('employer.cabinet')->with('success', 'Новый корабль был добавлен'); | 104 | return redirect()->route('employer.cabinet')->with('success', 'Новый корабль был добавлен'); |
105 | } | 105 | } |
106 | 106 | ||
107 | public function delete_flot(Flot $Flot) { | 107 | public function delete_flot(Flot $Flot) { |
108 | $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get(); | 108 | $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get(); |
109 | 109 | ||
110 | if (isset($Flot->id)) $Flot->delete(); | 110 | if (isset($Flot->id)) $Flot->delete(); |
111 | return redirect()->route('employer.cabinet')->with('success', 'Корабль был удален'); | 111 | return redirect()->route('employer.cabinet')->with('success', 'Корабль был удален'); |
112 | } | 112 | } |
113 | 113 | ||
114 | // Форма добавления вакансий | 114 | // Форма добавления вакансий |
115 | public function cabinet_vacancie() { | 115 | public function cabinet_vacancie() { |
116 | $id = Auth()->user()->id; | 116 | $id = Auth()->user()->id; |
117 | 117 | ||
118 | $categories = Category::query()->get(); | 118 | $categories = Category::query()->get(); |
119 | $Positions = Positions::query()->get(); | 119 | $Positions = Positions::query()->get(); |
120 | if ($Positions->count()) { | ||
121 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get(); | ||
122 | } else { | ||
123 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get(); | ||
124 | } | ||
125 | |||
120 | if ($Positions->count()) { | 126 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
121 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get(); | 127 | WhereHas('users', |
122 | } else { | 128 | function (Builder $query) use ($id) {$query->Where('id', $id); |
123 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get(); | 129 | })->get(); |
124 | } | 130 | |
125 | 131 | return view('employers.add_vacancy', compact('Employer', 'jobs' , 'categories', 'Positions')); | |
126 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | 132 | } |
127 | WhereHas('users', | 133 | |
128 | function (Builder $query) use ($id) {$query->Where('id', $id); | 134 | // Сохранение вакансии |
129 | })->get(); | 135 | public function cabinet_vacancy_save1(VacancyRequestEdit $request) { |
130 | 136 | $params = $request->all(); | |
131 | return view('employers.add_vacancy', compact('Employer', 'jobs' , 'categories', 'Positions')); | 137 | $ad_jobs = Ad_employer::create($params); |
132 | } | 138 | return redirect()->route('employer.vacancy_list'); |
133 | |||
134 | // Сохранение вакансии | ||
135 | public function cabinet_vacancy_save1(VacancyRequestEdit $request) { | ||
136 | $params = $request->all(); | ||
137 | $jobs['min_salary'] = $params['min_salary']; | ||
138 | $jobs['max_salary'] = $params['max_salary']; | ||
139 | $jobs['flot'] = $params['flot']; | ||
140 | $jobs['power'] = $params['power']; | ||
141 | $jobs['sytki'] = $params['sytki']; | ||
142 | $jobs['start'] = $params['start']; | ||
143 | $jobs['job_title_id'] = $params['job_title_id']; | ||
144 | $jobs['description'] = $params['description']; | ||
145 | $jobs['region'] = $params['city']; | ||
146 | //$titles['position_id'] = $params['position_id']; | ||
147 | unset($params['min_salary']); | ||
148 | unset($params['max_salary']); | ||
149 | unset($params['flot']); | ||
150 | unset($params['sytki']); | ||
151 | unset($params['start']); | ||
152 | unset($params['job_title_id']); | 139 | } |
153 | unset($params['description']); | 140 | |
154 | 141 | // Список вакансий | |
155 | $id = Ad_employer::create($params)->id; | 142 | public function vacancy_list(Request $request) { |
156 | $jobs['ad_employer_id'] = $id; | 143 | $id = Auth()->user()->id; |
157 | $ad_jobs = Ad_jobs::create($jobs); | 144 | $Employer = Employer::query()->where('user_id', $id)->first(); |
158 | 145 | $vacancy_list = Ad_employer::query()->with('jobs')->with('jobs_code')->where('employer_id', $Employer->id); | |
159 | return redirect()->route('employer.vacancy_list'); | 146 | |
147 | |||
160 | } | 148 | if ($request->get('sort')) { |
161 | 149 | $sort = $request->get('sort'); | |
162 | // Список вакансий | 150 | switch ($sort) { |
163 | public function vacancy_list(Request $request) { | 151 | case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break; |
164 | $id = Auth()->user()->id; | 152 | case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break; |
165 | $Employer = Employer::query()->where('user_id', $id)->first(); | 153 | case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break; |
166 | $vacancy_list = Ad_employer::query()->where('employer_id', $Employer->id); | 154 | case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break; |
167 | 155 | case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; | |
168 | if ($request->get('sort')) { | 156 | default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; |
169 | $sort = $request->get('sort'); | 157 | } |
170 | switch ($sort) { | 158 | } |
171 | case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break; | 159 | $vacancy_list = $vacancy_list->paginate(4); |
172 | case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break; | 160 | |
173 | case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break; | 161 | //ajax |
174 | case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break; | 162 | if ($request->ajax()) { |
175 | case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; | 163 | return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); |
176 | default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; | 164 | } else { |
177 | } | 165 | return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); |
178 | } | 166 | } |
179 | $vacancy_list = $vacancy_list->paginate(4); | 167 | } |
180 | 168 | ||
181 | 169 | // Карточка вакансии | |
182 | //ajax | 170 | public function vacancy_edit(Ad_employer $ad_employer) { |
183 | if ($request->ajax()) { | 171 | $id = Auth()->user()->id; |
184 | return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); | 172 | |
185 | } else { | 173 | $Positions = Positions::query()->get(); |
174 | if ($Positions->count()) { | ||
175 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get(); | ||
176 | } else { | ||
177 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get(); | ||
178 | } | ||
179 | |||
186 | return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); | 180 | $categories = Category::query()->get(); |
187 | } | 181 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
188 | } | 182 | where('user_id', $id)->first(); |
189 | 183 | ||
190 | // Карточка вакансии | 184 | return view('employers.edit_vacancy', compact('ad_employer', 'Positions', 'categories','Employer', 'jobs')); |
191 | public function vacancy_edit(Ad_employer $ad_employer) { | 185 | } |
192 | $id = Auth()->user()->id; | 186 | |
193 | 187 | // Сохранение-редактирование записи | |
194 | $Positions = Positions::query()->get(); | 188 | public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { |
195 | if ($Positions->count()) { | 189 | $params = $request->all(); |
196 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get(); | 190 | |
197 | } else { | 191 | //$jobs['flot'] = $params['flot']; |
192 | //$jobs['job_title_id'] = $params['job_title_id']; | ||
193 | //$titles['position_id'] = $params['position_id']; | ||
194 | //unset($params['job_title_id']); | ||
195 | |||
196 | $ad_employer->update($params); | ||
197 | |||
198 | //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])-> | ||
199 | // where('ad_employer_id', $ad_employer->id)->first(); | ||
200 | //$data = Ad_jobs::find($job_->id); | ||
201 | //$ad_jobs = $data->update($jobs); | ||
198 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get(); | 202 | return redirect()->route('employer.vacancy_list'); |
199 | } | 203 | } |
200 | 204 | ||
201 | $categories = Category::query()->get(); | 205 | // Сохранение карточки вакансии |
202 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | 206 | public function vacancy_save(Request $request, Ad_employer $ad_employer) { |
203 | where('user_id', $id)->first(); | 207 | $all = $request->all(); |
204 | 208 | $ad_employer->update($all); | |
205 | return view('employers.edit_vacancy', compact('ad_employer', 'Positions', 'categories','Employer', 'jobs')); | 209 | return redirect()->route('employer.cabinet_vacancie'); |
206 | } | 210 | } |
207 | 211 | ||
208 | // Сохранение-редактирование записи | 212 | // Удаление карточки вакансии |
209 | public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { | 213 | public function vacancy_delete(Ad_employer $ad_employer) { |
210 | $params = $request->all(); | 214 | $ad_employer->delete(); |
211 | 215 | ||
212 | //$jobs['flot'] = $params['flot']; | 216 | return redirect()->route('employer.vacancy_list') |
213 | $jobs['job_title_id'] = $params['job_title_id']; | 217 | ->with('success', 'Данные были успешно сохранены'); |
214 | //$titles['position_id'] = $params['position_id']; | 218 | } |
215 | unset($params['job_title_id']); | 219 | |
216 | 220 | // Обновление даты | |
217 | $ad_employer->update($params); | 221 | public function vacancy_up(Ad_employer $ad_employer) { |
218 | 222 | $up = date('m/d/Y h:i:s', time());; | |
219 | $job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])-> | 223 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); |
220 | where('ad_employer_id', $ad_employer->id)->first(); | 224 | $vac_emp->updated_at = $up; |
221 | $data = Ad_jobs::find($job_->id); | 225 | $vac_emp->save(); |
222 | $ad_jobs = $data->update($jobs); | 226 | |
223 | 227 | return redirect()->route('employer.vacancy_list'); | |
224 | return redirect()->route('employer.vacancy_list'); | 228 | // начало конца |
225 | } | 229 | } |
226 | 230 | ||
227 | // Сохранение карточки вакансии | 231 | //Видимость вакансии |
228 | public function vacancy_save(Request $request, Ad_employer $ad_employer) { | 232 | public function vacancy_eye(Ad_employer $ad_employer, $status) { |
229 | $all = $request->all(); | 233 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); |
230 | $ad_employer->update($all); | 234 | $vac_emp->active_is = $status; |
231 | return redirect()->route('employer.cabinet_vacancie'); | 235 | $vac_emp->save(); |
232 | } | 236 | |
233 | 237 | return redirect()->route('employer.vacancy_list'); | |
234 | // Удаление карточки вакансии | 238 | } |
235 | public function vacancy_delete(Ad_employer $ad_employer) { | 239 | |
236 | $ad_employer->delete(); | 240 | //Вакансия редактирования (шаблон) |
237 | 241 | public function vacancy_update(Ad_employer $id) { | |
238 | return redirect()->route('employer.vacancy_list') | 242 | |
239 | ->with('success', 'Данные были успешно сохранены'); | 243 | } |
240 | } | 244 | |
241 | 245 | //Отклики на вакансию - лист | |
242 | // Обновление даты | 246 | public function answers(Employer $employer, Request $request) { |
243 | public function vacancy_up(Ad_employer $ad_employer) { | 247 | $user_id = Auth()->user()->id; |
244 | $up = date('m/d/Y h:i:s', time());; | 248 | $answer = Ad_employer::query()->where('employer_id', $employer->id); |
245 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); | 249 | if ($request->has('search')) { |
246 | $vac_emp->updated_at = $up; | 250 | $search = trim($request->get('search')); |
247 | $vac_emp->save(); | 251 | if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); |
248 | 252 | } | |
249 | return redirect()->route('employer.vacancy_list'); | 253 | |
250 | // начало конца | 254 | $answer = $answer->with('response')->get(); |
251 | } | 255 | |
252 | 256 | return view('employers.list_answer', compact('answer', 'user_id', 'employer')); | |
253 | //Видимость вакансии | 257 | } |
254 | public function vacancy_eye(Ad_employer $ad_employer, $status) { | 258 | |
255 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); | 259 | //Обновление статуса |
256 | $vac_emp->active_is = $status; | 260 | public function supple_status(employer $employer, ad_response $ad_response, $flag) { |
257 | $vac_emp->save(); | 261 | $ad_response->update(Array('flag' => $flag)); |
258 | 262 | return redirect()->route('employer.answers', ['employer' => $employer->id]); | |
259 | return redirect()->route('employer.vacancy_list'); | 263 | } |
260 | } | 264 | |
261 | 265 | //Страницы сообщений список | |
262 | //Вакансия редактирования (шаблон) | 266 | public function messages($type_message) { |
263 | public function vacancy_update(Ad_employer $id) { | 267 | $user_id = Auth()->user()->id; |
264 | 268 | ||
265 | } | 269 | $messages_input = Message::query()->with('vacancies')->with('user_from')-> |
266 | 270 | Where('to_user_id', $user_id)->OrderByDesc('created_at'); | |
267 | //Отклики на вакансию - лист | 271 | |
268 | public function answers(Employer $employer, Request $request) { | 272 | $messages_output = Message::query()->with('vacancies')-> |
269 | $user_id = Auth()->user()->id; | 273 | with('user_to')->where('user_id', $user_id)-> |
270 | $answer = Ad_employer::query()->where('employer_id', $employer->id); | 274 | OrderByDesc('created_at'); |
271 | if ($request->has('search')) { | 275 | |
272 | $search = trim($request->get('search')); | 276 | |
273 | if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); | 277 | $count_input = $messages_input->count(); |
274 | } | 278 | $count_output = $messages_output->count(); |
275 | 279 | ||
276 | $answer = $answer->with('response')->get(); | 280 | if ($type_message == 'input') { |
277 | 281 | $messages = $messages_input->paginate(15); | |
278 | return view('employers.list_answer', compact('answer', 'user_id', 'employer')); | 282 | } |
279 | } | 283 | |
280 | 284 | if ($type_message == 'output') { | |
281 | //Обновление статуса | 285 | $messages = $messages_output->paginate(15); |
282 | public function supple_status(employer $employer, ad_response $ad_response, $flag) { | 286 | } |
283 | $ad_response->update(Array('flag' => $flag)); | 287 | |
284 | return redirect()->route('employer.answers', ['employer' => $employer->id]); | 288 | return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); |
285 | } | 289 | } |
286 | 290 | ||
287 | //Страницы сообщений список | 291 | // Диалог между пользователями |
288 | public function messages($type_message) { | 292 | public function dialog(User_Model $user1, User_Model $user2) { |
289 | $user_id = Auth()->user()->id; | 293 | if (isset($user2->id)) { |
290 | 294 | $companion = User_Model::query()->with('workers')-> | |
291 | $messages_input = Message::query()->with('vacancies')->with('user_from')-> | 295 | with('employers')-> |
292 | Where('to_user_id', $user_id)->OrderByDesc('created_at'); | 296 | where('id', $user2->id)->first(); |
293 | 297 | } | |
294 | $messages_output = Message::query()->with('vacancies')-> | 298 | |
295 | with('user_to')->where('user_id', $user_id)-> | 299 | $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) { |
296 | OrderByDesc('created_at'); | 300 | $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); |
297 | 301 | })->orWhere(function($query) use ($user1, $user2) { | |
298 | 302 | $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); | |
299 | $count_input = $messages_input->count(); | 303 | })->OrderBy('created_at')->get(); |
300 | $count_output = $messages_output->count(); | 304 | |
301 | 305 | $id_vac = null; | |
302 | if ($type_message == 'input') { | 306 | foreach ($Messages as $it) { |
303 | $messages = $messages_input->paginate(15); | 307 | if (isset($it->response)) { |
304 | } | 308 | foreach ($it->response as $r) { |
305 | 309 | if (isset($r->ad_employer_id)) { | |
306 | if ($type_message == 'output') { | 310 | $id_vac = $r->ad_employer_id; |
307 | $messages = $messages_output->paginate(15); | 311 | break; |
308 | } | 312 | } |
309 | 313 | } | |
310 | return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); | 314 | } |
311 | } | 315 | if (!is_null($id_vac)) break; |
312 | 316 | } | |
313 | // Диалог между пользователями | 317 | |
314 | public function dialog(User_Model $user1, User_Model $user2) { | 318 | $ad_employer = null; |
315 | if (isset($user2->id)) { | 319 | if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); |
316 | $companion = User_Model::query()->with('workers')-> | 320 | $sender = $user1; |
317 | with('employers')-> | 321 | |
318 | where('id', $user2->id)->first(); | 322 | return view('employers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); |
319 | } | 323 | } |
320 | 324 | ||
321 | $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) { | 325 | // Регистрация работодателя |
322 | $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); | 326 | public function register_employer(Request $request) { |
323 | })->orWhere(function($query) use ($user1, $user2) { | 327 | $params = $request->all(); |
324 | $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); | 328 | |
325 | })->OrderBy('created_at')->get(); | 329 | $rules = [ |
326 | 330 | 'surname' => ['required', 'string', 'max:255'], | |
327 | $id_vac = null; | 331 | 'name_man' => ['required', 'string', 'max:255'], |
328 | foreach ($Messages as $it) { | 332 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], |
329 | if (isset($it->response)) { | 333 | 'name_company' => ['required', 'string', 'max:255'], |
330 | foreach ($it->response as $r) { | 334 | 'password' => ['required', 'string', 'min:8'], |
331 | if (isset($r->ad_employer_id)) { | 335 | ]; |
332 | $id_vac = $r->ad_employer_id; | 336 | |
333 | break; | 337 | |
334 | } | 338 | $messages = [ |
335 | } | 339 | 'required' => 'Укажите обязательное поле', |
336 | } | 340 | 'min' => [ |
337 | if (!is_null($id_vac)) break; | 341 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
338 | } | 342 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
339 | 343 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | |
340 | $ad_employer = null; | 344 | ], |
341 | if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); | 345 | 'max' => [ |
342 | $sender = $user1; | 346 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
343 | 347 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | |
344 | return view('employers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); | 348 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
345 | } | 349 | ] |
346 | 350 | ]; | |
347 | // Регистрация работодателя | 351 | |
348 | public function register_employer(Request $request) { | 352 | if ($request->get('password') !== $request->get('confirmed')){ |
349 | $params = $request->all(); | 353 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); |
350 | 354 | } | |
351 | $rules = [ | 355 | |
352 | 'surname' => ['required', 'string', 'max:255'], | 356 | $validator = Validator::make($request->all(), $rules, $messages); |
353 | 'name_man' => ['required', 'string', 'max:255'], | 357 | |
354 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], | 358 | if ($validator->fails()) { |
355 | 'name_company' => ['required', 'string', 'max:255'], | 359 | return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); |
356 | 'password' => ['required', 'string', 'min:8'], | 360 | } else { |
357 | ]; | 361 | $user = $this->create($params); |
358 | 362 | event(new Registered($user)); | |
359 | 363 | ||
360 | $messages = [ | 364 | Auth::guard()->login($user); |
361 | 'required' => 'Укажите обязательное поле', | 365 | } |
362 | 'min' => [ | 366 | if ($user) { |
363 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 367 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; |
364 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 368 | } else { |
365 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 369 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); |
366 | ], | 370 | } |
367 | 'max' => [ | 371 | } |
368 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 372 | |
369 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 373 | // Создание пользователя |
370 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 374 | protected function create(array $data) |
371 | ] | 375 | { |
372 | ]; | 376 | $Use = new User_Model(); |
373 | 377 | $Code_user = $Use->create([ | |
374 | if ($request->get('password') !== $request->get('confirmed')){ | 378 | 'name' => $data['surname']." ".$data['name_man'], |
375 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); | 379 | 'name_man' => $data['name_man'], |
376 | } | 380 | 'surname' => $data['surname'], |
377 | 381 | 'surname2' => $data['surname2'], | |
378 | $validator = Validator::make($request->all(), $rules, $messages); | 382 | 'subscribe_email' => $data['email'], |
379 | 383 | 'email' => $data['email'], | |
380 | if ($validator->fails()) { | 384 | 'telephone' => $data['telephone'], |
381 | return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); | 385 | 'is_worker' => 0, |
382 | } else { | 386 | 'password' => Hash::make($data['password']), |
383 | $user = $this->create($params); | 387 | 'pubpassword' => base64_encode($data['password']), |
384 | event(new Registered($user)); | 388 | 'email_verified_at' => Carbon::now() |
385 | 389 | ]); | |
386 | Auth::guard()->login($user); | 390 | |
387 | } | 391 | if ($Code_user->id > 0) { |
388 | if ($user) { | 392 | $Employer = new Employer(); |
389 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; | 393 | $Employer->user_id = $Code_user->id; |
390 | } else { | 394 | $Employer->name_company = $data['name_company']; |
391 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); | 395 | $Employer->email = $data['email']; |
392 | } | 396 | $Employer->telephone = $data['telephone']; |
393 | } | 397 | $Employer->code = Tools::generator_id(10); |
394 | 398 | $Employer->save(); | |
395 | // Создание пользователя | 399 | |
396 | protected function create(array $data) | 400 | return $Code_user; |
397 | { | 401 | } |
398 | $Use = new User_Model(); | 402 | } |
399 | $Code_user = $Use->create([ | 403 | |
400 | 'name' => $data['surname']." ".$data['name_man'], | 404 | // Отправка сообщения от работодателя |
401 | 'name_man' => $data['name_man'], | 405 | public function send_message(MessagesRequiest $request) { |
402 | 'surname' => $data['surname'], | 406 | $params = $request->all(); |
403 | 'surname2' => $data['surname2'], | 407 | dd($params); |
404 | 'subscribe_email' => $data['email'], | 408 | $user1 = $params['user_id']; |
405 | 'email' => $data['email'], | 409 | $user2 = $params['to_user_id']; |
406 | 'telephone' => $data['telephone'], | 410 | |
407 | 'is_worker' => 0, | 411 | if ($request->has('file')) { |
408 | 'password' => Hash::make($data['password']), | 412 | $params['file'] = $request->file('file')->store("messages", 'public'); |
409 | 'pubpassword' => base64_encode($data['password']), | 413 | } |
410 | 'email_verified_at' => Carbon::now() | 414 | Message::create($params); |
411 | ]); | 415 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); |
412 | 416 | } | |
413 | if ($Code_user->id > 0) { | 417 | |
414 | $Employer = new Employer(); | 418 | public function test123(Request $request) { |
415 | $Employer->user_id = $Code_user->id; | 419 | $params = $request->all(); |
416 | $Employer->name_company = $data['name_company']; | 420 | $user1 = $params['user_id']; |
417 | $Employer->email = $data['email']; | 421 | $user2 = $params['to_user_id']; |
418 | $Employer->telephone = $data['telephone']; | 422 | |
419 | $Employer->code = Tools::generator_id(10); | 423 | $rules = [ |
420 | $Employer->save(); | 424 | 'text' => 'required|min:1|max:150000', |
421 | 425 | 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' | |
422 | return $Code_user; | 426 | ]; |
423 | } | 427 | $messages = [ |
424 | } | 428 | 'required' => 'Укажите обязательное поле', |
425 | 429 | 'min' => [ | |
426 | // Отправка сообщения от работодателя | 430 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
427 | public function send_message(MessagesRequiest $request) { | 431 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
428 | $params = $request->all(); | 432 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
429 | dd($params); | 433 | ], |
430 | $user1 = $params['user_id']; | 434 | 'max' => [ |
431 | $user2 = $params['to_user_id']; | 435 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
432 | 436 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | |
433 | if ($request->has('file')) { | 437 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
434 | $params['file'] = $request->file('file')->store("messages", 'public'); | 438 | ] |
435 | } | 439 | ]; |
436 | Message::create($params); | 440 | |
437 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); | 441 | $validator = Validator::make($request->all(), $rules, $messages); |
438 | } | 442 | |
439 | 443 | if ($validator->fails()) { | |
440 | public function test123(Request $request) { | 444 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) |
441 | $params = $request->all(); | 445 | ->withErrors($validator); |
442 | $user1 = $params['user_id']; | 446 | } else { |
443 | $user2 = $params['to_user_id']; | 447 | if ($request->has('file')) { |
444 | 448 | $params['file'] = $request->file('file')->store("messages", 'public'); | |
445 | $rules = [ | 449 | } |
446 | 'text' => 'required|min:1|max:150000', | 450 | Message::create($params); |
447 | 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' | 451 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); |
448 | ]; | 452 | |
449 | $messages = [ | 453 | } |
450 | 'required' => 'Укажите обязательное поле', | 454 | } |
451 | 'min' => [ | 455 | |
452 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 456 | //Избранные люди |
453 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 457 | public function favorites(Request $request) { |
454 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 458 | $IP_address = RusDate::ip_addr_client(); |
455 | ], | 459 | $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); |
456 | 'max' => [ | 460 | |
457 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 461 | if ($Arr->count()) { |
458 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 462 | $A = Array(); |
459 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 463 | foreach ($Arr as $it) { |
460 | ] | 464 | $A[] = $it->code_record; |
461 | ]; | 465 | } |
462 | 466 | ||
463 | $validator = Validator::make($request->all(), $rules, $messages); | 467 | $Workers = Worker::query()->whereIn('id', $A); |
464 | 468 | } else { | |
465 | if ($validator->fails()) { | 469 | $Workers = Worker::query()->where('id', '=', '0'); |
466 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) | 470 | } |
467 | ->withErrors($validator); | 471 | |
468 | } else { | 472 | if (($request->has('search')) && (!empty($request->get('search')))) { |
469 | if ($request->has('file')) { | 473 | $search = $request->get('search'); |
470 | $params['file'] = $request->file('file')->store("messages", 'public'); | 474 | |
471 | } | 475 | $Workers = $Workers->WhereHas('users', |
472 | Message::create($params); | 476 | function (Builder $query) use ($search) { |
473 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); | 477 | $query->Where('surname', 'LIKE', "%$search%") |
474 | 478 | ->orWhere('name_man', 'LIKE', "%$search%") | |
475 | } | 479 | ->orWhere('surname2', 'LIKE', "%$search%"); |
476 | } | 480 | }); |
477 | 481 | } else { | |
478 | //Избранные люди | 482 | $Workers = $Workers->with('users'); |
479 | public function favorites(Request $request) { | 483 | } |
480 | $IP_address = RusDate::ip_addr_client(); | 484 | |
481 | $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); | 485 | $Workers = $Workers->get(); |
482 | 486 | return view('employers.favorite', compact('Workers')); | |
483 | if ($Arr->count()) { | 487 | } |
484 | $A = Array(); | 488 | |
485 | foreach ($Arr as $it) { | 489 | // База данных |
486 | $A[] = $it->code_record; | 490 | public function bd(Request $request) { |
487 | } | 491 | // для типа BelongsTo |
488 | 492 | //$documents = Document::query()->orderBy(Location::select('name') | |
489 | $Workers = Worker::query()->whereIn('id', $A); | 493 | // ->whereColumn('locations.id', 'documents.location_id') |
490 | } else { | 494 | //); |
491 | $Workers = Worker::query()->where('id', '=', '0'); | 495 | |
492 | } | 496 | // для типа HasOne/Many |
493 | 497 | // $documents = Document::::query()->orderBy(Location::select('name') | |
494 | if (($request->has('search')) && (!empty($request->get('search')))) { | 498 | // ->whereColumn('locations.document_id', 'documents.id') |
495 | $search = $request->get('search'); | 499 | //); |
496 | 500 | ||
497 | $Workers = $Workers->WhereHas('users', | 501 | $users = User_Model::query()->with('workers'); |
498 | function (Builder $query) use ($search) { | 502 | if (isset($request->find)) { |
499 | $query->Where('surname', 'LIKE', "%$search%") | 503 | $find_key = $request->find; |
500 | ->orWhere('name_man', 'LIKE', "%$search%") | 504 | $users = $users->where('name', 'LIKE', "%$find_key%") |
501 | ->orWhere('surname2', 'LIKE', "%$search%"); | 505 | ->orWhere('email', 'LIKE', "%$find_key%") |
502 | }); | 506 | ->orWhere('telephone', 'LIKE', "%$find_key%"); |
503 | } else { | 507 | } |
504 | $Workers = $Workers->with('users'); | 508 | |
505 | } | 509 | // Данные |
506 | 510 | $users = $users->Baseuser()-> | |
507 | $Workers = $Workers->get(); | 511 | orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id'))-> |
508 | return view('employers.favorite', compact('Workers')); | 512 | paginate(5); |
509 | } | 513 | |
510 | 514 | return view('employers.bd', compact('users')); | |
511 | // База данных | 515 | } |
512 | public function bd(Request $request) { | 516 | |
513 | // для типа BelongsTo | 517 | //Настройка уведомлений |
514 | //$documents = Document::query()->orderBy(Location::select('name') | 518 | public function subscribe() { |
515 | // ->whereColumn('locations.id', 'documents.location_id') | 519 | return view('employers.subcribe'); |
516 | //); | 520 | } |
517 | 521 | ||
518 | // для типа HasOne/Many | 522 | //Установка уведомлений сохранение |
519 | // $documents = Document::::query()->orderBy(Location::select('name') | 523 | public function save_subscribe(Request $request) { |
520 | // ->whereColumn('locations.document_id', 'documents.id') | 524 | dd($request->all()); |
521 | //); | 525 | $msg = $request->validate([ |
522 | 526 | 'subscribe_email' => 'required|email|min:5|max:255', | |
523 | $users = User_Model::query()->with('workers'); | 527 | ]); |
524 | if (isset($request->find)) { | 528 | return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); |
525 | $find_key = $request->find; | 529 | } |
526 | $users = $users->where('name', 'LIKE', "%$find_key%") | 530 | |
527 | ->orWhere('email', 'LIKE', "%$find_key%") | 531 | //Сбросить форму с паролем |
528 | ->orWhere('telephone', 'LIKE', "%$find_key%"); | 532 | public function password_reset() { |
529 | } | 533 | $email = Auth()->user()->email; |
530 | 534 | return view('employers.password-reset', compact('email')); | |
531 | // Данные | 535 | } |
532 | $users = $users->Baseuser()-> | 536 | |
533 | orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id'))-> | 537 | //Обновление пароля |
534 | paginate(5); | 538 | public function new_password(Request $request) { |
535 | 539 | $use = Auth()->user(); | |
536 | return view('employers.bd', compact('users')); | 540 | $request->validate([ |
537 | } | 541 | 'password' => 'required|string', |
538 | 542 | 'new_password' => 'required|string', | |
539 | //Настройка уведомлений | 543 | 'new_password2' => 'required|string' |
540 | public function subscribe() { | 544 | ]); |
541 | return view('employers.subcribe'); | 545 | |
542 | } | 546 | if ($request->get('new_password') == $request->get('new_password2')) |
543 | 547 | if ($request->get('password') !== $request->get('new_password')) { | |
544 | //Установка уведомлений сохранение | 548 | $credentials = $request->only('email', 'password'); |
545 | public function save_subscribe(Request $request) { | 549 | if (Auth::attempt($credentials)) { |
546 | dd($request->all()); | 550 | |
547 | $msg = $request->validate([ | 551 | if (!is_null($use->email_verified_at)){ |
548 | 'subscribe_email' => 'required|email|min:5|max:255', | 552 | |
549 | ]); | 553 | $user_data = User_Model::find($use->id); |
550 | return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); | 554 | $user_data->update([ |
551 | } | 555 | 'password' => Hash::make($request->get('new_password')), |
552 | 556 | 'pubpassword' => base64_encode($request->get('new_password')), | |
553 | //Сбросить форму с паролем | 557 | ]); |
554 | public function password_reset() { | 558 | return redirect() |
555 | $email = Auth()->user()->email; | 559 | ->route('employer.password_reset') |
556 | return view('employers.password-reset', compact('email')); | 560 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); |
557 | } | 561 | } |
558 | 562 | ||
559 | //Обновление пароля | 563 | return redirect() |
560 | public function new_password(Request $request) { | 564 | ->route('employer.password_reset') |
561 | $use = Auth()->user(); | 565 | ->withError('Данная учетная запись не было верифицированна!'); |
562 | $request->validate([ | 566 | } |
563 | 'password' => 'required|string', | 567 | } |
564 | 'new_password' => 'required|string', | 568 | |
565 | 'new_password2' => 'required|string' | 569 | return redirect() |
566 | ]); | 570 | ->route('employer.password_reset') |
567 | 571 | ->withErrors('Не совпадение данных, обновите пароли!'); | |
568 | if ($request->get('new_password') == $request->get('new_password2')) | 572 | } |
569 | if ($request->get('password') !== $request->get('new_password')) { | 573 | |
570 | $credentials = $request->only('email', 'password'); | 574 | |
571 | if (Auth::attempt($credentials)) { | 575 | |
572 | 576 | // Форма Удаление пипла | |
573 | if (!is_null($use->email_verified_at)){ | 577 | public function delete_people() { |
574 | 578 | $login = Auth()->user()->email; | |
575 | $user_data = User_Model::find($use->id); | 579 | return view('employers.delete_people', compact('login')); |
576 | $user_data->update([ | 580 | } |
577 | 'password' => Hash::make($request->get('new_password')), | 581 | |
578 | 'pubpassword' => base64_encode($request->get('new_password')), | 582 | // Удаление аккаунта |
579 | ]); | 583 | public function action_delete_user(Request $request) { |
580 | return redirect() | 584 | $Answer = $request->all(); |
581 | ->route('employer.password_reset') | 585 | $user_id = Auth()->user()->id; |
582 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); | 586 | $request->validate([ |
583 | } | 587 | 'password' => 'required|string', |
584 | 588 | ]); | |
585 | return redirect() | 589 | |
586 | ->route('employer.password_reset') | 590 | $credentials = $request->only('email', 'password'); |
587 | ->withError('Данная учетная запись не было верифицированна!'); | 591 | if (Auth::attempt($credentials)) { |
588 | } | 592 | Auth::logout(); |
589 | } | 593 | $it = User_Model::find($user_id); |
590 | 594 | $it->delete(); | |
591 | return redirect() | 595 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); |
592 | ->route('employer.password_reset') | 596 | } else { |
593 | ->withErrors('Не совпадение данных, обновите пароли!'); | 597 | return redirect()->route('employer.delete_people') |
594 | } | 598 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); |
595 | 599 | } | |
596 | 600 | } | |
597 | 601 | ||
598 | // Форма Удаление пипла | 602 | public function ajax_delete_user(Request $request) { |
599 | public function delete_people() { | 603 | $Answer = $request->all(); |
600 | $login = Auth()->user()->email; | 604 | $user_id = Auth()->user()->id; |
601 | return view('employers.delete_people', compact('login')); | 605 | $request->validate([ |
602 | } | 606 | 'password' => 'required|string', |
603 | 607 | ]); | |
604 | // Удаление аккаунта | 608 | $credentials = $request->only('email', 'password'); |
605 | public function action_delete_user(Request $request) { | 609 | if (Auth::attempt($credentials)) { |
606 | $Answer = $request->all(); | 610 | |
607 | $user_id = Auth()->user()->id; | 611 | return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', |
608 | $request->validate([ | 612 | 'email' => $request->get('email'), |
609 | 'password' => 'required|string', | 613 | 'password' => $request->get('password'))); |
610 | ]); | 614 | } else { |
611 | 615 | return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); | |
612 | $credentials = $request->only('email', 'password'); | 616 | } |
613 | if (Auth::attempt($credentials)) { | 617 | } |
614 | Auth::logout(); | 618 | |
615 | $it = User_Model::find($user_id); | 619 | |
616 | $it->delete(); | 620 | // FAQ - Вопросы/ответы для работодателей и соискателей |
617 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); | 621 | public function faq() { |
618 | } else { | 622 | return view('employers.faq'); |
619 | return redirect()->route('employer.delete_people') | 623 | } |
620 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); | 624 | |
621 | } | 625 | // Рассылка сообщений |
622 | } | 626 | public function send_all_messages() { |
623 | 627 | return view('employers.send_all'); | |
624 | public function ajax_delete_user(Request $request) { | 628 | } |
625 | $Answer = $request->all(); | 629 | |
626 | $user_id = Auth()->user()->id; | 630 | // Отправка сообщений для информации |
627 | $request->validate([ | 631 | public function send_all_post(Request $request) { |
628 | 'password' => 'required|string', | 632 | $data = $request->all(); |
629 | ]); | 633 | |
630 | $credentials = $request->only('email', 'password'); | 634 | $emails = User_Model::query()->where('is_worker', '1')->get(); |
631 | if (Auth::attempt($credentials)) { | 635 | |
632 | 636 | foreach ($emails as $e) { | |
633 | return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', | 637 | Mail::to($e->email)->send(new SendAllMessages($data)); |
634 | 'email' => $request->get('email'), | 638 | } |
635 | 'password' => $request->get('password'))); | 639 | |
636 | } else { | 640 | return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); |
637 | return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); | 641 | } |
638 | } | 642 | |
639 | } | 643 | // База резюме |
640 | 644 | public function bd_tupe(Request $request) { | |
641 | 645 | $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); | |
642 | // FAQ - Вопросы/ответы для работодателей и соискателей | 646 | |
643 | public function faq() { | 647 | return view('employers.bd_tupe', compact('Resume')); |
644 | return view('employers.faq'); | 648 | } |
645 | } | 649 | |
646 | 650 | ////////////////////////////////////////////////////////////////// | |
647 | // Рассылка сообщений | 651 | // |
648 | public function send_all_messages() { | 652 | // |
649 | return view('employers.send_all'); | 653 | // Отправил сообщение |
650 | } | 654 | // |
651 | 655 | // | |
652 | // Отправка сообщений для информации | 656 | // |
653 | public function send_all_post(Request $request) { | 657 | // |
654 | $data = $request->all(); | 658 | ////////////////////////////////////////////////////////////////// |
655 | 659 | public function new_message(Request $request) { | |
656 | $emails = User_Model::query()->where('is_worker', '1')->get(); | 660 | $params = $request->all(); |
657 | 661 | ||
658 | foreach ($emails as $e) { | 662 | $id = $params['_user_id']; |
659 | Mail::to($e->email)->send(new SendAllMessages($data)); | 663 | $message = new Message(); |
660 | } | 664 | $message->user_id = $params['_user_id']; |
661 | 665 | $message->to_user_id = $params['_to_user_id']; | |
662 | return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); | 666 | $message->title = $params['title']; |
663 | } | 667 | $message->text = $params['text']; |
664 | 668 | if ($request->has('_file')) { | |
665 | // База резюме | 669 | $message->file = $request->file('_file')->store("worker/$id", 'public'); |
666 | public function bd_tupe(Request $request) { | 670 | } |
667 | $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); | 671 | $message->flag_new = 1; |
668 | 672 | $id_message = $message->save(); | |
669 | return view('employers.bd_tupe', compact('Resume')); | 673 | |
670 | } | 674 | $data['message_id'] = $id_message; |
671 | 675 | $data['ad_employer_id'] = $params['_vacancy']; | |
672 | ////////////////////////////////////////////////////////////////// | 676 | $data['job_title_id'] = 0; |
673 | // | 677 | |
674 | // | 678 | $data['flag'] = 1; |
675 | // Отправил сообщение | 679 | $ad_responce = ad_response::create($data); |
676 | // | 680 | return redirect()->route('employer.messages', ['type_message' => 'output']); |
677 | // | 681 | } |
678 | // | 682 | |
679 | // | 683 | // Восстановление пароля |
680 | ////////////////////////////////////////////////////////////////// | 684 | public function repair_password(Request $request) { |
681 | public function new_message(Request $request) { | 685 | $params = $request->get('email'); |
682 | $params = $request->all(); | 686 | } |
687 | |||
683 | 688 | // Избранные люди на корабль | |
689 | public function selected_people(Request $request) { | ||
690 | $id = $request->get('id'); | ||
691 | $favorite_people = Job_title::query()->where('position_id', $id)->get(); | ||
692 | |||
684 | $id = $params['_user_id']; | 693 | return view('favorite_people', compact('favorite_people')); |
694 | } | ||
685 | $message = new Message(); | 695 | } |
686 | $message->user_id = $params['_user_id']; | 696 | |
687 | $message->to_user_id = $params['_to_user_id']; | ||
688 | $message->title = $params['title']; | ||
689 | $message->text = $params['text']; |
app/Http/Controllers/MainController.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Http\Controllers; | 3 | namespace App\Http\Controllers; |
4 | 4 | ||
5 | use App\Classes\RusDate; | 5 | use App\Classes\RusDate; |
6 | use App\Classes\Tools; | 6 | use App\Classes\Tools; |
7 | use App\Mail\MailRegistration; | 7 | use App\Mail\MailRegistration; |
8 | use App\Mail\MailRepair; | 8 | use App\Mail\MailRepair; |
9 | use App\Models\Ad_employer; | 9 | use App\Models\Ad_employer; |
10 | use App\Models\Ad_jobs; | 10 | use App\Models\Ad_jobs; |
11 | use App\Models\Category; | 11 | use App\Models\Category; |
12 | use App\Models\Education; | 12 | use App\Models\Education; |
13 | use App\Models\Employer; | 13 | use App\Models\Employer; |
14 | use App\Models\employers_main; | 14 | use App\Models\employers_main; |
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\News; | 18 | use App\Models\News; |
19 | use App\Models\Positions; | 19 | use App\Models\Positions; |
20 | use App\Models\reclame; | 20 | use App\Models\reclame; |
21 | use App\Models\User; | 21 | use App\Models\User; |
22 | use Illuminate\Http\Request; | 22 | use Illuminate\Http\Request; |
23 | use Illuminate\Support\Facades\Auth; | 23 | use Illuminate\Support\Facades\Auth; |
24 | use Illuminate\Support\Facades\DB; | 24 | use Illuminate\Support\Facades\DB; |
25 | use Illuminate\Support\Facades\Hash; | 25 | use Illuminate\Support\Facades\Hash; |
26 | use Illuminate\Support\Facades\Mail; | 26 | use Illuminate\Support\Facades\Mail; |
27 | use Illuminate\Support\Facades\Validator; | 27 | use Illuminate\Support\Facades\Validator; |
28 | use App\Classes\StatusUser; | 28 | use App\Classes\StatusUser; |
29 | 29 | ||
30 | class MainController extends Controller | 30 | class MainController extends Controller |
31 | { | 31 | { |
32 | // Главная страница публичной части | 32 | // Главная страница публичной части |
33 | public function index() { | 33 | public function index() { |
34 | $news = News::query()->orderBy('id')->limit(6)->get(); | 34 | $news = News::query()->orderBy('id')->limit(6)->get(); |
35 | 35 | ||
36 | $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') | 36 | $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') |
37 | ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') | 37 | ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') |
38 | ->OrderByDesc('created_at') | 38 | ->OrderByDesc('created_at') |
39 | ->GroupBy('categories.id') | 39 | ->GroupBy('categories.id') |
40 | ->get(); | 40 | ->get(); |
41 | 41 | ||
42 | $Position = Positions::query()->get(); | 42 | $Position = Positions::query()->get(); |
43 | 43 | ||
44 | /*$BigFlot = Array(); | 44 | /*$BigFlot = Array(); |
45 | foreach ($Position as $position) { | 45 | foreach ($Position as $position) { |
46 | $BigFlot[] = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')-> | 46 | $BigFlot[] = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')-> |
47 | orderBy('job_titles.sort')-> | 47 | orderBy('job_titles.sort')-> |
48 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> | 48 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> |
49 | where('position_ship', "$position->name")-> | 49 | where('position_ship', "$position->name")-> |
50 | groupby('job_title_id','position_ship')-> | 50 | groupby('job_title_id','position_ship')-> |
51 | get(); | 51 | get(); |
52 | } | 52 | } |
53 | 53 | ||
54 | $BigFlot = Array(); | ||
55 | |||
56 | foreach ($Position as $position) { | ||
57 | |||
58 | $BigFlot[] = Ad_jobs::query()->with(['job_title' => function($query) { | ||
59 | $query->OrderBy('sort'); | ||
60 | }])->whereHas('job_title', function ($query) use ($position) { | ||
61 | $query->where('position_id', $position->id); | ||
62 | })-> | ||
63 | distinct('job_title_id')-> | ||
64 | get(); | ||
65 | }*/ | ||
66 | |||
67 | $BigFlot = Array(); | ||
68 | foreach ($Position as $position) { | ||
69 | $BigFlot[] = DB::table('ad_jobs')-> | ||
70 | selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')-> | ||
71 | orderByDesc('job_titles.sort')-> | ||
72 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> | ||
73 | where('job_titles.position_id', $position->id)-> | ||
74 | groupby('job_title_id')-> | ||
75 | get(); | ||
76 | } | ||
77 | |||
54 | $BigFlot = Array(); | 78 | $employers = employers_main::query()->with('employer')->orderBy('id')->limit(8)->get(); |
55 | 79 | $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get(); | |
56 | foreach ($Position as $position) { | 80 | return view('index', compact('news', 'categories', 'employers', 'vacancy', 'BigFlot', 'Position')); |
57 | 81 | } | |
58 | $BigFlot[] = Ad_jobs::query()->with(['job_title' => function($query) { | 82 | |
59 | $query->OrderBy('sort'); | 83 | public function search_vacancies(Request $request) { |
60 | }])->whereHas('job_title', function ($query) use ($position) { | 84 | if ($request->has('search')) { |
61 | $query->where('position_id', $position->id); | 85 | $search = $request->get('search'); |
62 | })-> | 86 | $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first(); |
63 | distinct('job_title_id')-> | 87 | if (isset($job_titles->id)) |
64 | get(); | 88 | if ($job_titles->id > 0) |
65 | }*/ | 89 | return redirect()->route('vacancies', ['job' => $job_titles->id]); |
66 | 90 | } | |
67 | $BigFlot = Array(); | 91 | } |
68 | foreach ($Position as $position) { | 92 | |
69 | $BigFlot[] = DB::table('ad_jobs')-> | 93 | // Лайк вакансии |
70 | selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')-> | 94 | public function like_vacancy(Request $request) { |
71 | orderByDesc('job_titles.sort')-> | 95 | $IP_address = RusDate::ip_addr_client(); |
72 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> | 96 | |
73 | where('job_titles.position_id', $position->id)-> | 97 | if ($request->has('code_record')) { |
74 | groupby('job_title_id')-> | 98 | if ($request->has('delete')) { |
75 | get(); | 99 | $atomic_era = Like_vacancy::select('id')-> |
76 | } | 100 | where('code_record', '=', $request-> |
77 | 101 | get('code_record'))->first(); | |
78 | $employers = employers_main::query()->with('employer')->orderBy('id')->limit(8)->get(); | 102 | |
79 | $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get(); | 103 | DB::table('like_vacancy')->where('code_record', $request->get('code_record'))->delete(); |
80 | return view('index', compact('news', 'categories', 'employers', 'vacancy', 'BigFlot', 'Position')); | 104 | |
81 | } | 105 | } else { |
82 | 106 | $params = $request->all(); | |
83 | public function search_vacancies(Request $request) { | 107 | $params['ip_address'] = $IP_address; |
84 | if ($request->has('search')) { | 108 | Like_vacancy::create($params); |
85 | $search = $request->get('search'); | 109 | } |
86 | $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first(); | 110 | } |
87 | if (isset($job_titles->id)) | 111 | } |
88 | if ($job_titles->id > 0) | 112 | |
89 | return redirect()->route('vacancies', ['job' => $job_titles->id]); | 113 | // Лайк соискателю. |
90 | } | 114 | public function like_worker(Request $request) { |
91 | } | 115 | $IP_address = RusDate::ip_addr_client(); |
92 | 116 | ||
93 | // Лайк вакансии | 117 | if ($request->has('code_record')) { |
94 | public function like_vacancy(Request $request) { | 118 | if ($request->has('delete')) { |
95 | $IP_address = RusDate::ip_addr_client(); | 119 | $atomic_era = Like_worker::select('id')-> |
96 | 120 | where('code_record', '=', $request-> | |
97 | if ($request->has('code_record')) { | 121 | get('code_record'))->first(); |
98 | if ($request->has('delete')) { | 122 | |
99 | $atomic_era = Like_vacancy::select('id')-> | 123 | DB::table('like_worker')->where('code_record', $request->get('code_record'))->delete(); |
100 | where('code_record', '=', $request-> | 124 | |
101 | get('code_record'))->first(); | 125 | return "Вот и результат удаления!"; |
102 | 126 | ||
103 | DB::table('like_vacancy')->where('code_record', $request->get('code_record'))->delete(); | 127 | } else { |
104 | 128 | $params = $request->all(); | |
105 | } else { | 129 | $params['ip_address'] = $IP_address; |
106 | $params = $request->all(); | 130 | Like_worker::create($params); |
107 | $params['ip_address'] = $IP_address; | 131 | } |
108 | Like_vacancy::create($params); | 132 | } |
109 | } | 133 | } |
110 | } | 134 | |
111 | } | 135 | |
112 | 136 | public function vacancies(Request $request) { | |
113 | // Лайк соискателю. | 137 | //должности |
114 | public function like_worker(Request $request) { | 138 | $Job_title = Job_title::query()->orderBy('name')->get(); |
115 | $IP_address = RusDate::ip_addr_client(); | 139 | |
116 | 140 | $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') | |
117 | if ($request->has('code_record')) { | 141 | ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary') |
118 | if ($request->has('delete')) { | 142 | ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') |
119 | $atomic_era = Like_worker::select('id')-> | 143 | ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id'); |
120 | where('code_record', '=', $request-> | 144 | |
121 | get('code_record'))->first(); | 145 | //категории и вакансии |
122 | 146 | if (($request->has('job')) && ($request->get('job') > 0)) { | |
123 | DB::table('like_worker')->where('code_record', $request->get('code_record'))->delete(); | 147 | $categories = $categories->Where('job_title_id', '=', $request->get('job')); |
124 | 148 | } | |
125 | return "Вот и результат удаления!"; | 149 | |
126 | 150 | $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get(); | |
127 | } else { | 151 | |
128 | $params = $request->all(); | 152 | $Position = Positions::query()->get(); |
129 | $params['ip_address'] = $IP_address; | 153 | |
130 | Like_worker::create($params); | 154 | /*$BigFlot = Array(); |
131 | } | 155 | foreach ($Position as $position) { |
132 | } | 156 | $War_flot = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')-> |
133 | } | 157 | orderBy('job_titles.sort')-> |
134 | 158 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> | |
135 | 159 | where('position_ship', "$position->name"); | |
136 | public function vacancies(Request $request) { | 160 | if (($request->has('job')) && ($request->get('job') > 0)) { |
137 | //должности | 161 | $War_flot = $War_flot->where('job_title_id', $request->get('job')); |
138 | $Job_title = Job_title::query()->orderBy('name')->get(); | 162 | } |
139 | 163 | $War_flot = $War_flot->groupby('job_title_id','position_ship')->get(); | |
140 | $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') | 164 | $BigFlot[] = $War_flot; |
165 | }*/ | ||
166 | |||
167 | $BigFlot = Array(); | ||
168 | foreach ($Position as $position) { | ||
169 | $WarFlot = DB::table('ad_jobs')-> | ||
170 | selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')-> | ||
171 | orderByDesc('job_titles.sort')-> | ||
172 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> | ||
173 | where('job_titles.position_id', $position->id); | ||
174 | if (($request->has('job')) && ($request->get('job') > 0)) { | ||
175 | $WarFlot = $WarFlot->where('job_title_id', $request->get('job')); | ||
176 | } | ||
177 | $WarFlot = $WarFlot->groupby('job_title_id')->get(); | ||
178 | $BigFlot[] = $WarFlot; | ||
141 | ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary') | 179 | } |
142 | ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') | 180 | |
143 | ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id'); | 181 | if ($request->ajax()) { |
144 | 182 | return view('ajax.new_sky', compact('categories', 'BigFlot', 'Position')); | |
145 | //категории и вакансии | 183 | } else { |
146 | if (($request->has('job')) && ($request->get('job') > 0)) { | 184 | return view('new_sky', compact('Job_title', 'categories', 'BigFlot', 'Position')); |
147 | $categories = $categories->Where('job_title_id', '=', $request->get('job')); | 185 | } |
148 | } | 186 | } |
149 | 187 | ||
150 | $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get(); | 188 | //Вакансии категория детальная |
151 | 189 | public function list_vacancies(Category $categories, Request $request) { | |
152 | $Position = Positions::query()->get(); | 190 | if (isset(Auth()->user()->id)) |
153 | 191 | $uid = Auth()->user()->id; | |
154 | /*$BigFlot = Array(); | 192 | else |
155 | foreach ($Position as $position) { | 193 | $uid = 0; |
156 | $War_flot = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')-> | 194 | |
157 | orderBy('job_titles.sort')-> | 195 | $Query = Ad_employer::with('jobs')-> |
158 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> | 196 | with('cat')-> |
159 | where('position_ship', "$position->name"); | 197 | with('employer')-> |
160 | if (($request->has('job')) && ($request->get('job') > 0)) { | 198 | whereHas('jobs_code', function ($query) use ($request) { |
161 | $War_flot = $War_flot->where('job_title_id', $request->get('job')); | 199 | if (null !== ($request->get('job')) && ($request->get('job') !== 0)) { |
162 | } | 200 | $query->where('job_title_id', $request->get('job')); |
163 | $War_flot = $War_flot->groupby('job_title_id','position_ship')->get(); | 201 | } |
164 | $BigFlot[] = $War_flot; | 202 | }) |
165 | }*/ | 203 | ->select('ad_employers.*'); |
166 | 204 | ||
167 | $BigFlot = Array(); | 205 | |
168 | foreach ($Position as $position) { | 206 | if (isset($categories->id) && ($categories->id > 0)) { |
169 | $WarFlot = DB::table('ad_jobs')-> | 207 | $Query = $Query->where('category_id', '=', $categories->id); |
170 | selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')-> | 208 | $Name_categori = Category::query()->where('id', '=', $categories->id)->get(); |
171 | orderByDesc('job_titles.sort')-> | 209 | } else { |
172 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> | 210 | $Name_categori = ''; |
173 | where('job_titles.position_id', $position->id); | 211 | } |
174 | if (($request->has('job')) && ($request->get('job') > 0)) { | 212 | |
175 | $WarFlot = $WarFlot->where('job_title_id', $request->get('job')); | 213 | if ($request->get('sort')) { |
176 | } | 214 | $sort = $request->get('sort'); |
177 | $WarFlot = $WarFlot->groupby('job_title_id')->get(); | 215 | |
178 | $BigFlot[] = $WarFlot; | 216 | |
179 | } | 217 | switch ($sort) { |
180 | 218 | case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break; | |
181 | if ($request->ajax()) { | 219 | case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break; |
182 | return view('ajax.new_sky', compact('categories', 'BigFlot', 'Position')); | 220 | case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; |
183 | } else { | 221 | case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; |
184 | return view('new_sky', compact('Job_title', 'categories', 'BigFlot', 'Position')); | 222 | case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; |
185 | } | 223 | default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; |
186 | } | 224 | } |
187 | 225 | } | |
188 | //Вакансии категория детальная | 226 | |
189 | public function list_vacancies(Category $categories, Request $request) { | 227 | $Job_title = Job_title::query()->OrderBy('name')->get(); |
190 | if (isset(Auth()->user()->id)) | 228 | |
191 | $uid = Auth()->user()->id; | 229 | $Query_count = $Query->count(); |
192 | else | 230 | |
193 | $uid = 0; | 231 | $Query = $Query->OrderBy('updated_at')->paginate(3); |
194 | 232 | ||
195 | $Query = Ad_employer::with('jobs')-> | 233 | $Reclama = reclame::query()->get(); |
196 | with('cat')-> | 234 | |
197 | with('employer')-> | 235 | |
198 | whereHas('jobs_code', function ($query) use ($request) { | 236 | |
199 | if (null !== ($request->get('job')) && ($request->get('job') !== 0)) { | 237 | if ($request->ajax()) { |
200 | $query->where('job_title_id', $request->get('job')); | 238 | if ($request->has('title')) { |
201 | } | 239 | return view('ajax.list_category', compact( |
202 | }) | 240 | 'Name_categori' |
203 | ->select('ad_employers.*'); | 241 | )); |
204 | 242 | } else { | |
205 | 243 | return view('ajax.list_vacancies', compact('Query', | |
206 | if (isset($categories->id) && ($categories->id > 0)) { | 244 | 'Query_count', |
207 | $Query = $Query->where('category_id', '=', $categories->id); | 245 | 'Name_categori', |
208 | $Name_categori = Category::query()->where('id', '=', $categories->id)->get(); | 246 | 'Reclama', |
209 | } else { | 247 | 'categories', |
210 | $Name_categori = ''; | 248 | 'Job_title', |
211 | } | 249 | 'uid')); |
212 | 250 | } | |
213 | if ($request->get('sort')) { | 251 | } else { |
214 | $sort = $request->get('sort'); | 252 | //Вернуть все |
215 | 253 | return view('list_vacancies', compact('Query', | |
216 | 254 | 'Query_count', | |
217 | switch ($sort) { | 255 | 'Reclama', |
218 | case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break; | 256 | 'Name_categori', |
219 | case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break; | 257 | 'categories', |
220 | case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; | 258 | 'Job_title', |
221 | case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; | 259 | 'uid')); |
222 | case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; | 260 | } |
223 | default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; | 261 | } |
224 | } | 262 | |
225 | } | 263 | // Образование |
226 | 264 | public function education(Request $request) { | |
227 | $Job_title = Job_title::query()->OrderBy('name')->get(); | 265 | $educations = Education::query(); |
228 | 266 | if (($request->has('search')) && (!empty($request->get('search')))) { | |
229 | $Query_count = $Query->count(); | 267 | $search = trim($request->get('search')); |
230 | 268 | $educations = $educations->where('name', 'LIKE', "%$search%"); | |
231 | $Query = $Query->OrderBy('updated_at')->paginate(3); | 269 | } |
232 | 270 | ||
233 | $Reclama = reclame::query()->get(); | 271 | if ($request->get('sort')) { |
234 | 272 | $sort = $request->get('sort'); | |
235 | 273 | switch ($sort) { | |
236 | 274 | case 'name_up': $educations = $educations->orderBy('name')->orderBy('id'); break; | |
237 | if ($request->ajax()) { | 275 | case 'name_down': $educations = $educations->orderByDesc('name')->orderby('id'); break; |
238 | if ($request->has('title')) { | 276 | case 'created_at_up': $educations = $educations->OrderBy('created_at')->orderBy('id'); break; |
239 | return view('ajax.list_category', compact( | 277 | case 'created_at_down': $educations = $educations->orderByDesc('created_at')->orderBy('id'); break; |
240 | 'Name_categori' | 278 | case 'default': $educations = $educations->orderBy('id')->orderby('updated_at'); break; |
241 | )); | 279 | default: $educations = $educations->orderBy('id')->orderby('updated_at'); break; |
242 | } else { | 280 | } |
243 | return view('ajax.list_vacancies', compact('Query', | 281 | } |
244 | 'Query_count', | 282 | |
245 | 'Name_categori', | 283 | $count_edu = $educations->count(); |
246 | 'Reclama', | 284 | $educations = $educations->paginate(6); |
247 | 'categories', | 285 | if ($request->ajax()) { |
248 | 'Job_title', | 286 | return view('ajax.education', compact('educations')); |
249 | 'uid')); | 287 | } else { |
250 | } | 288 | return view('education', compact('educations', 'count_edu')); |
251 | } else { | 289 | } |
252 | //Вернуть все | 290 | } |
253 | return view('list_vacancies', compact('Query', | 291 | |
254 | 'Query_count', | 292 | // Контакты |
255 | 'Reclama', | 293 | public function contacts() { |
256 | 'Name_categori', | 294 | return view('contacts'); |
257 | 'categories', | 295 | } |
258 | 'Job_title', | 296 | |
259 | 'uid')); | 297 | // Вход в личный кабинет |
260 | } | 298 | public function input_login(Request $request) |
261 | } | 299 | { |
262 | 300 | $params = $request->all(); | |
263 | // Образование | 301 | |
264 | public function education(Request $request) { | 302 | |
265 | $educations = Education::query(); | 303 | $rules = [ |
266 | if (($request->has('search')) && (!empty($request->get('search')))) { | 304 | 'email' => 'required|string|email', |
267 | $search = trim($request->get('search')); | 305 | 'password' => 'required|string|min:3|max:25', |
268 | $educations = $educations->where('name', 'LIKE', "%$search%"); | 306 | ]; |
269 | } | 307 | |
270 | 308 | $messages = [ | |
271 | if ($request->get('sort')) { | 309 | 'required' => 'Укажите обязательное поле «:attribute»', |
272 | $sort = $request->get('sort'); | 310 | 'email' => 'Введите корректный email', |
273 | switch ($sort) { | 311 | 'min' => [ |
274 | case 'name_up': $educations = $educations->orderBy('name')->orderBy('id'); break; | 312 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
275 | case 'name_down': $educations = $educations->orderByDesc('name')->orderby('id'); break; | 313 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
276 | case 'created_at_up': $educations = $educations->OrderBy('created_at')->orderBy('id'); break; | 314 | ], |
277 | case 'created_at_down': $educations = $educations->orderByDesc('created_at')->orderBy('id'); break; | 315 | 'max' => [ |
278 | case 'default': $educations = $educations->orderBy('id')->orderby('updated_at'); break; | 316 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
279 | default: $educations = $educations->orderBy('id')->orderby('updated_at'); break; | 317 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
280 | } | 318 | ], |
281 | } | 319 | ]; |
282 | 320 | ||
283 | $count_edu = $educations->count(); | 321 | $validator = Validator::make($request->all(), $rules, $messages); |
284 | $educations = $educations->paginate(6); | 322 | |
285 | if ($request->ajax()) { | 323 | |
286 | return view('ajax.education', compact('educations')); | 324 | if ($validator->fails()) { |
287 | } else { | 325 | return redirect()->route('index')->with('Error', "Email или пароль невалидный"); |
288 | return view('education', compact('educations', 'count_edu')); | 326 | } else { |
289 | } | 327 | $credentials = $request->only('email', 'password'); |
290 | } | 328 | |
291 | 329 | if (Auth::attempt($credentials, $request->has('remember'))) { | |
292 | // Контакты | 330 | |
293 | public function contacts() { | 331 | if (is_null(Auth::user()->email_verified_at)) { |
294 | return view('contacts'); | 332 | Auth::logout(); |
295 | } | 333 | return json_encode(Array("ERROR" => "Адрес почты не подтвержден")); |
296 | 334 | } | |
297 | // Вход в личный кабинет | 335 | |
298 | public function input_login(Request $request) | 336 | if (Auth::user()->is_worker) { |
299 | { | 337 | return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl())); |
300 | $params = $request->all(); | 338 | } else { |
301 | 339 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl())); | |
302 | 340 | } | |
303 | $rules = [ | 341 | |
304 | 'email' => 'required|string|email', | 342 | return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет")); |
305 | 'password' => 'required|string|min:3|max:25', | 343 | //->route('index') |
306 | ]; | 344 | //->with('success', 'Вы вошли в личный кабинет.'); |
307 | 345 | } else { | |
308 | $messages = [ | 346 | return json_encode(Array("ERROR" => "Неверный логин или пароль!")); |
309 | 'required' => 'Укажите обязательное поле «:attribute»', | 347 | } |
310 | 'email' => 'Введите корректный email', | 348 | } |
311 | 'min' => [ | 349 | } |
312 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 350 | |
313 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 351 | // Восстановление пароля |
314 | ], | 352 | public function repair_password(Request $request) { |
315 | 'max' => [ | 353 | $rules = [ |
316 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 354 | 'email' => 'required|string|email', |
317 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 355 | ]; |
318 | ], | 356 | |
319 | ]; | 357 | $messages = [ |
320 | 358 | 'required' => 'Укажите обязательное поле «:attribute»', | |
321 | $validator = Validator::make($request->all(), $rules, $messages); | 359 | 'email' => 'Введите корректный email', |
322 | 360 | 'min' => [ | |
323 | 361 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | |
324 | if ($validator->fails()) { | 362 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
325 | return redirect()->route('index')->with('Error', "Email или пароль невалидный"); | 363 | ], |
326 | } else { | 364 | 'max' => [ |
327 | $credentials = $request->only('email', 'password'); | 365 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
328 | 366 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | |
329 | if (Auth::attempt($credentials, $request->has('remember'))) { | 367 | ], |
330 | 368 | ]; | |
331 | if (is_null(Auth::user()->email_verified_at)) { | 369 | |
332 | Auth::logout(); | 370 | $validator = Validator::make($request->all(), $rules, $messages); |
333 | return json_encode(Array("ERROR" => "Адрес почты не подтвержден")); | 371 | |
334 | } | 372 | if ($validator->fails()) { |
335 | 373 | return redirect()->back()->with('Error', "Email невалидный"); | |
336 | if (Auth::user()->is_worker) { | 374 | } else { |
337 | return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl())); | 375 | $new_password = Tools::generator_id(10); |
338 | } else { | 376 | $hash_password = Hash::make($new_password); |
339 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl())); | 377 | $user = User::query()->where('email', $request->get('email'))->first(); |
340 | } | 378 | $EditRec = User::find($user->id); |
341 | 379 | $EditRec->password = $hash_password; | |
342 | return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет")); | 380 | $EditRec->save(); |
343 | //->route('index') | 381 | |
344 | //->with('success', 'Вы вошли в личный кабинет.'); | 382 | foreach ([$request->get('email')] as $recipient) { |
345 | } else { | 383 | Mail::to($recipient)->send(new MailRepair($new_password)); |
346 | return json_encode(Array("ERROR" => "Неверный логин или пароль!")); | 384 | } |
347 | } | 385 | return redirect()->route('index'); |
348 | } | 386 | |
349 | } | 387 | } |
350 | 388 | ||
351 | // Восстановление пароля | 389 | } |
352 | public function repair_password(Request $request) { | 390 | |
353 | $rules = [ | 391 | // Вывод новостей |
354 | 'email' => 'required|string|email', | 392 | public function news(Request $request) { |
355 | ]; | 393 | $Query = News::query(); |
356 | 394 | if ($request->has('search')) { | |
357 | $messages = [ | 395 | $search = $request->get('search'); |
358 | 'required' => 'Укажите обязательное поле «:attribute»', | 396 | $Query = $Query->where('title', 'LIKE', "%$search%")-> |
359 | 'email' => 'Введите корректный email', | 397 | orWhere('text', 'LIKE', "%$search%"); |
360 | 'min' => [ | 398 | } |
361 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 399 | |
362 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 400 | if ($request->ajax()) { |
363 | ], | 401 | if ($request->get('sort')) { |
364 | 'max' => [ | 402 | $sort = $request->get('sort'); |
365 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 403 | switch ($sort) { |
366 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 404 | case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break; |
367 | ], | 405 | case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break; |
368 | ]; | 406 | case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; |
369 | 407 | case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; | |
370 | $validator = Validator::make($request->all(), $rules, $messages); | 408 | case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; |
371 | 409 | default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; | |
372 | if ($validator->fails()) { | 410 | } |
373 | return redirect()->back()->with('Error', "Email невалидный"); | 411 | } |
374 | } else { | 412 | } |
375 | $new_password = Tools::generator_id(10); | 413 | $Query_count = $Query->count(); |
376 | $hash_password = Hash::make($new_password); | 414 | $Query = $Query->paginate(6); |
377 | $user = User::query()->where('email', $request->get('email'))->first(); | 415 | |
378 | $EditRec = User::find($user->id); | 416 | if ($request->ajax()) { |
379 | $EditRec->password = $hash_password; | 417 | return view('ajax.news-list', compact('Query', 'Query_count')); |
380 | $EditRec->save(); | 418 | } else { |
381 | 419 | return view('news-list', compact('Query', 'Query_count')); | |
382 | foreach ([$request->get('email')] as $recipient) { | 420 | } |
383 | Mail::to($recipient)->send(new MailRepair($new_password)); | 421 | } |
384 | } | 422 | |
385 | return redirect()->route('index'); | 423 | //Детальная новость |
386 | 424 | public function detail_new(News $new) { | |
387 | } | 425 | // Наборка |
388 | 426 | $Query = News::query()->where('id', $new->id)->get(); | |
389 | } | 427 | $title = $Query[0]->title; |
390 | 428 | $All_Query = News::query()->paginate(8); | |
391 | // Вывод новостей | 429 | return view('detail_new', compact('Query', 'All_Query', 'title')); |
392 | public function news(Request $request) { | 430 | } |
393 | $Query = News::query(); | 431 | } |
394 | if ($request->has('search')) { | 432 |
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\Models\Ad_employer; | 7 | use App\Models\Ad_employer; |
8 | use App\Models\ad_response; | 8 | use App\Models\ad_response; |
9 | use App\Models\Category; | 9 | use App\Models\Category; |
10 | use App\Models\Dop_info; | 10 | use App\Models\Dop_info; |
11 | use App\Models\Employer; | 11 | use App\Models\Employer; |
12 | use App\Models\infobloks; | 12 | use App\Models\infobloks; |
13 | use App\Models\Job_title; | 13 | use App\Models\Job_title; |
14 | use App\Models\Like_vacancy; | 14 | use App\Models\Like_vacancy; |
15 | use App\Models\Like_worker; | 15 | use App\Models\Like_worker; |
16 | use App\Models\Message; | 16 | use App\Models\Message; |
17 | use App\Models\place_works; | 17 | use App\Models\place_works; |
18 | use App\Models\reclame; | 18 | use App\Models\reclame; |
19 | use App\Models\ResponseWork; | 19 | use App\Models\ResponseWork; |
20 | use App\Models\sertification; | 20 | use App\Models\sertification; |
21 | use App\Models\Static_worker; | 21 | use App\Models\Static_worker; |
22 | use App\Models\User; | 22 | use App\Models\User; |
23 | use App\Models\User as User_Model; | 23 | use App\Models\User as User_Model; |
24 | use App\Models\Worker; | 24 | use App\Models\Worker; |
25 | use Barryvdh\DomPDF\Facade\Pdf; | 25 | use Barryvdh\DomPDF\Facade\Pdf; |
26 | use Carbon\Carbon; | 26 | use Carbon\Carbon; |
27 | use Illuminate\Auth\Events\Registered; | 27 | use Illuminate\Auth\Events\Registered; |
28 | use Illuminate\Database\Eloquent\Builder; | 28 | use Illuminate\Database\Eloquent\Builder; |
29 | use Illuminate\Database\Eloquent\Model; | 29 | use Illuminate\Database\Eloquent\Model; |
30 | use Illuminate\Http\JsonResponse; | 30 | use Illuminate\Http\JsonResponse; |
31 | use Illuminate\Http\Request; | 31 | use Illuminate\Http\Request; |
32 | use Illuminate\Support\Facades\Auth; | 32 | use Illuminate\Support\Facades\Auth; |
33 | use Illuminate\Support\Facades\Hash; | 33 | use Illuminate\Support\Facades\Hash; |
34 | use Illuminate\Support\Facades\Storage; | 34 | use Illuminate\Support\Facades\Storage; |
35 | use Illuminate\Support\Facades\Validator; | 35 | use Illuminate\Support\Facades\Validator; |
36 | 36 | ||
37 | class WorkerController extends Controller | 37 | class WorkerController extends Controller |
38 | { | 38 | { |
39 | public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу'); | 39 | public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу'); |
40 | 40 | ||
41 | //профиль | 41 | //профиль |
42 | public function profile(Worker $worker) | 42 | public function profile(Worker $worker) |
43 | { | 43 | { |
44 | $get_date = date('Y.m'); | 44 | $get_date = date('Y.m'); |
45 | 45 | ||
46 | $c = Static_worker::query()->where('year_month', '=', $get_date) | 46 | $c = Static_worker::query()->where('year_month', '=', $get_date) |
47 | ->where('user_id', '=', $worker->users->id) | 47 | ->where('user_id', '=', $worker->users->id) |
48 | ->get(); | 48 | ->get(); |
49 | 49 | ||
50 | if ($c->count() > 0) { | 50 | if ($c->count() > 0) { |
51 | $upd = Static_worker::find($c[0]->id); | 51 | $upd = Static_worker::find($c[0]->id); |
52 | $upd->lookin = $upd->lookin + 1; | 52 | $upd->lookin = $upd->lookin + 1; |
53 | $upd->save(); | 53 | $upd->save(); |
54 | } else { | 54 | } else { |
55 | $crt = new Static_worker(); | 55 | $crt = new Static_worker(); |
56 | $crt->lookin = 1; | 56 | $crt->lookin = 1; |
57 | $crt->year_month = $get_date; | 57 | $crt->year_month = $get_date; |
58 | $crt->user_id = $worker->user_id; | 58 | $crt->user_id = $worker->user_id; |
59 | $crt->save(); | 59 | $crt->save(); |
60 | } | 60 | } |
61 | 61 | ||
62 | $stat = Static_worker::query()->where('year_month', '=', $get_date) | 62 | $stat = Static_worker::query()->where('year_month', '=', $get_date) |
63 | ->where('user_id', '=', $worker->users->id) | 63 | ->where('user_id', '=', $worker->users->id) |
64 | ->get(); | 64 | ->get(); |
65 | 65 | ||
66 | return view('public.workers.profile', compact('worker', 'stat')); | 66 | return view('public.workers.profile', compact('worker', 'stat')); |
67 | } | 67 | } |
68 | 68 | ||
69 | // лист база резюме | 69 | // лист база резюме |
70 | public function bd_resume(Request $request) | 70 | public function bd_resume(Request $request) |
71 | { | 71 | { |
72 | if (isset(Auth()->user()->id)) { | 72 | if (isset(Auth()->user()->id)) { |
73 | $idiot = Auth()->user()->id; | 73 | $idiot = Auth()->user()->id; |
74 | } else { | 74 | } else { |
75 | $idiot = 0; | 75 | $idiot = 0; |
76 | } | 76 | } |
77 | 77 | ||
78 | $status_work = $this->status_work; | 78 | $status_work = $this->status_work; |
79 | $resumes = Worker::query()->with('users')->with('job_titles'); | 79 | $resumes = Worker::query()->with('users')->with('job_titles'); |
80 | $resumes = $resumes->whereHas('users', function (Builder $query) { | 80 | $resumes = $resumes->whereHas('users', function (Builder $query) { |
81 | $query->Where('is_worker', '=', '1') | 81 | $query->Where('is_worker', '=', '1') |
82 | ->Where('is_bd', '=', '0'); | 82 | ->Where('is_bd', '=', '0'); |
83 | }); | 83 | }); |
84 | 84 | ||
85 | if ($request->get('sort')) { | 85 | if ($request->get('sort')) { |
86 | $sort = $request->get('sort'); | 86 | $sort = $request->get('sort'); |
87 | switch ($sort) { | 87 | switch ($sort) { |
88 | case 'name_up': | 88 | case 'name_up': |
89 | $resumes = $resumes->orderBy(User::select('surname') | 89 | $resumes = $resumes->orderBy(User::select('surname') |
90 | ->whereColumn('Workers.user_id', 'users.id') | 90 | ->whereColumn('Workers.user_id', 'users.id') |
91 | ); | 91 | ); |
92 | break; | 92 | break; |
93 | case 'name_down': | 93 | case 'name_down': |
94 | $resumes = $resumes->orderByDesc(User::select('surname') | 94 | $resumes = $resumes->orderByDesc(User::select('surname') |
95 | ->whereColumn('Workers.user_id', 'users.id') | 95 | ->whereColumn('Workers.user_id', 'users.id') |
96 | ); | 96 | ); |
97 | break; | 97 | break; |
98 | case 'created_at_up': $resumes = $resumes->OrderBy('created_at')->orderBy('id'); break; | 98 | case 'created_at_up': $resumes = $resumes->OrderBy('created_at')->orderBy('id'); break; |
99 | case 'created_at_down': $resumes = $resumes->orderByDesc('created_at')->orderBy('id'); break; | 99 | case 'created_at_down': $resumes = $resumes->orderByDesc('created_at')->orderBy('id'); break; |
100 | case 'default': $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; | 100 | case 'default': $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; |
101 | default: $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; | 101 | default: $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; |
102 | } | 102 | } |
103 | } | 103 | } |
104 | 104 | ||
105 | $res_count = $resumes->count(); | 105 | $res_count = $resumes->count(); |
106 | $resumes = $resumes->paginate(4); | 106 | $resumes = $resumes->paginate(4); |
107 | if ($request->ajax()) { | 107 | if ($request->ajax()) { |
108 | // Условия обставлены | 108 | // Условия обставлены |
109 | if ($request->has('block') && ($request->get('block') == 1)) { | 109 | if ($request->has('block') && ($request->get('block') == 1)) { |
110 | return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot')); | 110 | return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot')); |
111 | } | 111 | } |
112 | 112 | ||
113 | if ($request->has('block') && ($request->get('block') == 2)) { | 113 | if ($request->has('block') && ($request->get('block') == 2)) { |
114 | return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot')); | 114 | return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot')); |
115 | } | 115 | } |
116 | } else { | 116 | } else { |
117 | return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot')); | 117 | return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot')); |
118 | } | 118 | } |
119 | } | 119 | } |
120 | 120 | ||
121 | //Лайк резюме | 121 | //Лайк резюме |
122 | public function like_controller() { | 122 | public function like_controller() { |
123 | 123 | ||
124 | } | 124 | } |
125 | 125 | ||
126 | // анкета соискателя | 126 | // анкета соискателя |
127 | public function resume_profile(Worker $worker) | 127 | public function resume_profile(Worker $worker) |
128 | { | 128 | { |
129 | if (isset(Auth()->user()->id)) { | 129 | if (isset(Auth()->user()->id)) { |
130 | $idiot = Auth()->user()->id; | 130 | $idiot = Auth()->user()->id; |
131 | } else { | 131 | } else { |
132 | $idiot = 0; | 132 | $idiot = 0; |
133 | } | 133 | } |
134 | 134 | ||
135 | $status_work = $this->status_work; | 135 | $status_work = $this->status_work; |
136 | $Query = Worker::query()->with('users')->with('job_titles') | 136 | $Query = Worker::query()->with('users')->with('job_titles') |
137 | ->with('place_worker')->with('sertificate')->with('prev_company') | 137 | ->with('place_worker')->with('sertificate')->with('prev_company') |
138 | ->with('infobloks'); | 138 | ->with('infobloks'); |
139 | $Query = $Query->where('id', '=', $worker->id); | 139 | $Query = $Query->where('id', '=', $worker->id); |
140 | $Query = $Query->get(); | 140 | $Query = $Query->get(); |
141 | 141 | ||
142 | $get_date = date('Y.m'); | 142 | $get_date = date('Y.m'); |
143 | $c = Static_worker::query()->where('year_month', '=', $get_date) | 143 | $c = Static_worker::query()->where('year_month', '=', $get_date) |
144 | ->where('user_id', '=', $worker->id) | 144 | ->where('user_id', '=', $worker->id) |
145 | ->get(); | 145 | ->get(); |
146 | 146 | ||
147 | if ($c->count() > 0) { | 147 | if ($c->count() > 0) { |
148 | $upd = Static_worker::find($c[0]->id); | 148 | $upd = Static_worker::find($c[0]->id); |
149 | $upd->lookin = $upd->lookin + 1; | 149 | $upd->lookin = $upd->lookin + 1; |
150 | $upd->save(); | 150 | $upd->save(); |
151 | } else { | 151 | } else { |
152 | $crt = new Static_worker(); | 152 | $crt = new Static_worker(); |
153 | $crt->lookin = 1; | 153 | $crt->lookin = 1; |
154 | $crt->year_month = $get_date; | 154 | $crt->year_month = $get_date; |
155 | $crt->user_id = $worker->user_id; | 155 | $crt->user_id = $worker->user_id; |
156 | $crt->save(); | 156 | $crt->save(); |
157 | } | 157 | } |
158 | 158 | ||
159 | $stat = Static_worker::query()->where('year_month', '=', $get_date) | 159 | $stat = Static_worker::query()->where('year_month', '=', $get_date) |
160 | ->where('user_id', '=', $worker->id) | 160 | ->where('user_id', '=', $worker->id) |
161 | ->get(); | 161 | ->get(); |
162 | 162 | ||
163 | return view('worker', compact('Query', 'status_work', 'idiot')); | 163 | return view('worker', compact('Query', 'status_work', 'idiot')); |
164 | } | 164 | } |
165 | 165 | ||
166 | // скачать анкету соискателя | 166 | // скачать анкету соискателя |
167 | public function resume_download(Worker $worker) | 167 | public function resume_download(Worker $worker) |
168 | { | 168 | { |
169 | $status_work = $this->status_work; | 169 | $status_work = $this->status_work; |
170 | $Query = Worker::query()->with('users')->with('job_titles') | 170 | $Query = Worker::query()->with('users')->with('job_titles') |
171 | ->with('place_worker')->with('sertificate')->with('prev_company') | 171 | ->with('place_worker')->with('sertificate')->with('prev_company') |
172 | ->with('infobloks'); | 172 | ->with('infobloks'); |
173 | $Query = $Query->where('id', '=', $worker->id); | 173 | $Query = $Query->where('id', '=', $worker->id); |
174 | $Query = $Query->get()->toArray(); | 174 | $Query = $Query->get()->toArray(); |
175 | 175 | ||
176 | view()->share('Query',$Query); | 176 | view()->share('Query',$Query); |
177 | 177 | ||
178 | $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape'); | 178 | $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape'); |
179 | 179 | ||
180 | return $pdf->stream(); | 180 | return $pdf->stream(); |
181 | } | 181 | } |
182 | 182 | ||
183 | // Кабинет работника | 183 | // Кабинет работника |
184 | public function cabinet(Request $request) | 184 | public function cabinet(Request $request) |
185 | { | 185 | { |
186 | $get_date = date('Y.m'); | 186 | $get_date = date('Y.m'); |
187 | 187 | ||
188 | $id = Auth()->user()->id; | 188 | $id = Auth()->user()->id; |
189 | $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')-> | 189 | $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')-> |
190 | with('infobloks')->with('place_worker')-> | 190 | with('infobloks')->with('place_worker')-> |
191 | WhereHas('users', | 191 | WhereHas('users', |
192 | function (Builder $query) use ($id) {$query->Where('id', $id); | 192 | function (Builder $query) use ($id) {$query->Where('id', $id); |
193 | })->get(); | 193 | })->get(); |
194 | 194 | ||
195 | $Job_titles = Job_title::query()->OrderBy('name')->get(); | 195 | $Job_titles = Job_title::query()->OrderBy('name')->get(); |
196 | $Infoblocks = infobloks::query()->OrderBy('name')->get(); | 196 | $Infoblocks = infobloks::query()->OrderBy('name')->get(); |
197 | 197 | ||
198 | $stat = Static_worker::query()->where('year_month', '=', $get_date) | 198 | $stat = Static_worker::query()->where('year_month', '=', $get_date) |
199 | ->where('user_id', '=', $Worker[0]->id) | 199 | ->where('user_id', '=', $Worker[0]->id) |
200 | ->get(); | 200 | ->get(); |
201 | 201 | ||
202 | $persent = 10; | 202 | $persent = 10; |
203 | if ((!empty($Worker[0]->status_work)) && (!empty($Worker[0]->telephone)) && | 203 | if ((!empty($Worker[0]->status_work)) && (!empty($Worker[0]->telephone)) && |
204 | (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) && | 204 | (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) && |
205 | (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) { | 205 | (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) { |
206 | $persent = $persent + 40; | 206 | $persent = $persent + 40; |
207 | } | 207 | } |
208 | 208 | ||
209 | if ($Worker[0]->sertificate->count() > 0) { | 209 | if ($Worker[0]->sertificate->count() > 0) { |
210 | $persent = $persent + 15; | 210 | $persent = $persent + 15; |
211 | } | 211 | } |
212 | 212 | ||
213 | if ($Worker[0]->infobloks->count() > 0) { | 213 | if ($Worker[0]->infobloks->count() > 0) { |
214 | $persent = $persent + 20; | 214 | $persent = $persent + 20; |
215 | } | 215 | } |
216 | 216 | ||
217 | if ($Worker[0]->prev_company->count() > 0) { | 217 | if ($Worker[0]->prev_company->count() > 0) { |
218 | $persent = $persent + 10; | 218 | $persent = $persent + 10; |
219 | } | 219 | } |
220 | 220 | ||
221 | if (!empty($Worker[0]->photo)) { | 221 | if (!empty($Worker[0]->photo)) { |
222 | // 5% | 222 | // 5% |
223 | $persent = $persent + 5; | 223 | $persent = $persent + 5; |
224 | } | 224 | } |
225 | 225 | ||
226 | if ($request->has('print')) { | 226 | if ($request->has('print')) { |
227 | dd($Worker); | 227 | dd($Worker); |
228 | } else { | 228 | } else { |
229 | return view('workers.cabinet', compact('Worker', 'persent', 'Job_titles', 'Infoblocks', 'stat')); | 229 | return view('workers.cabinet', compact('Worker', 'persent', 'Job_titles', 'Infoblocks', 'stat')); |
230 | } | 230 | } |
231 | } | 231 | } |
232 | 232 | ||
233 | // Сохранение данных | 233 | // Сохранение данных |
234 | public function cabinet_save(Worker $worker, Request $request) | 234 | public function cabinet_save(Worker $worker, Request $request) |
235 | { | 235 | { |
236 | $id = $worker->id; | 236 | $id = $worker->id; |
237 | $params = $request->all(); | 237 | $params = $request->all(); |
238 | 238 | ||
239 | $job_title_id = $request->get('job_title_id'); | 239 | $job_title_id = $request->get('job_title_id'); |
240 | 240 | ||
241 | unset($params['new_diplom']); | 241 | unset($params['new_diplom']); |
242 | unset($params['new_data_begin']); | 242 | unset($params['new_data_begin']); |
243 | unset($params['new_data_end']); | 243 | unset($params['new_data_end']); |
244 | unset($params['new_job_title']); | 244 | unset($params['new_job_title']); |
245 | unset($params['new_teplohod']); | 245 | unset($params['new_teplohod']); |
246 | unset($params['new_GWT']); | 246 | unset($params['new_GWT']); |
247 | unset($params['new_KBT']); | 247 | unset($params['new_KBT']); |
248 | unset($params['new_Begin_work']); | 248 | unset($params['new_Begin_work']); |
249 | unset($params['new_End_work']); | 249 | unset($params['new_End_work']); |
250 | unset($params['new_name_company']); | 250 | unset($params['new_name_company']); |
251 | 251 | ||
252 | $rules = [ | 252 | $rules = [ |
253 | 'surname' => ['required', 'string', 'max:255'], | 253 | 'surname' => ['required', 'string', 'max:255'], |
254 | 'name_man' => ['required', 'string', 'max:255'], | 254 | 'name_man' => ['required', 'string', 'max:255'], |
255 | 'email' => ['required', 'string', 'email', 'max:255'], | 255 | 'email' => ['required', 'string', 'email', 'max:255'], |
256 | 256 | ||
257 | ]; | 257 | ]; |
258 | 258 | ||
259 | $messages = [ | 259 | $messages = [ |
260 | 'required' => 'Укажите обязательное поле', | 260 | 'required' => 'Укажите обязательное поле', |
261 | 'min' => [ | 261 | 'min' => [ |
262 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 262 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
263 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 263 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
264 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 264 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
265 | ], | 265 | ], |
266 | 'max' => [ | 266 | 'max' => [ |
267 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 267 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
268 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 268 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
269 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 269 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
270 | ] | 270 | ] |
271 | ]; | 271 | ]; |
272 | 272 | ||
273 | $validator = Validator::make($params, $rules, $messages); | 273 | $validator = Validator::make($params, $rules, $messages); |
274 | 274 | ||
275 | if ($validator->fails()) { | 275 | if ($validator->fails()) { |
276 | return redirect()->route('worker.cabinet')->withErrors($validator); | 276 | return redirect()->route('worker.cabinet')->withErrors($validator); |
277 | } else { | 277 | } else { |
278 | 278 | ||
279 | if ($request->has('photo')) { | 279 | if ($request->has('photo')) { |
280 | if (!empty($Worker->photo)) { | 280 | if (!empty($Worker->photo)) { |
281 | Storage::delete($Worker->photo); | 281 | Storage::delete($Worker->photo); |
282 | } | 282 | } |
283 | $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); | 283 | $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); |
284 | } | 284 | } |
285 | 285 | ||
286 | if ($request->has('file')) { | 286 | if ($request->has('file')) { |
287 | if (!empty($Worker->file)) { | 287 | if (!empty($Worker->file)) { |
288 | Storage::delete($Worker->file); | 288 | Storage::delete($Worker->file); |
289 | } | 289 | } |
290 | $params['file'] = $request->file('file')->store("worker/$id", 'public'); | 290 | $params['file'] = $request->file('file')->store("worker/$id", 'public'); |
291 | } | 291 | } |
292 | 292 | ||
293 | $id_wor = $worker->update($params); | 293 | $id_wor = $worker->update($params); |
294 | 294 | ||
295 | $use = User_Model::find($id_wor); | 295 | $use = User_Model::find($id_wor); |
296 | $use->surname = $request->get('surname'); | 296 | $use->surname = $request->get('surname'); |
297 | $use->name_man = $request->get('name_man'); | 297 | $use->name_man = $request->get('name_man'); |
298 | $use->surname2 = $request->get('surname2'); | 298 | $use->surname2 = $request->get('surname2'); |
299 | 299 | ||
300 | $use->save(); | 300 | $use->save(); |
301 | $worker->job_titles()->sync($job_title_id); | 301 | $worker->job_titles()->sync($job_title_id); |
302 | 302 | ||
303 | return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); | 303 | return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); |
304 | } | 304 | } |
305 | } | 305 | } |
306 | 306 | ||
307 | // Сообщения данные | 307 | // Сообщения данные |
308 | public function messages($type_message) | 308 | public function messages($type_message) |
309 | { | 309 | { |
310 | $user_id = Auth()->user()->id; | 310 | $user_id = Auth()->user()->id; |
311 | 311 | ||
312 | $messages_input = Message::query()->with('vacancies')->with('user_from')-> | 312 | $messages_input = Message::query()->with('vacancies')->with('user_from')-> |
313 | Where('to_user_id', $user_id)->OrderByDesc('created_at'); | 313 | Where('to_user_id', $user_id)->OrderByDesc('created_at'); |
314 | 314 | ||
315 | $messages_output = Message::query()->with('vacancies')-> | 315 | $messages_output = Message::query()->with('vacancies')-> |
316 | with('user_to')->where('user_id', $user_id)-> | 316 | with('user_to')->where('user_id', $user_id)-> |
317 | OrderByDesc('created_at'); | 317 | OrderByDesc('created_at'); |
318 | 318 | ||
319 | 319 | ||
320 | $count_input = $messages_input->count(); | 320 | $count_input = $messages_input->count(); |
321 | $count_output = $messages_output->count(); | 321 | $count_output = $messages_output->count(); |
322 | 322 | ||
323 | if ($type_message == 'input') { | 323 | if ($type_message == 'input') { |
324 | $messages = $messages_input->paginate(15); | 324 | $messages = $messages_input->paginate(15); |
325 | } | 325 | } |
326 | 326 | ||
327 | if ($type_message == 'output') { | 327 | if ($type_message == 'output') { |
328 | $messages = $messages_output->paginate(15); | 328 | $messages = $messages_output->paginate(15); |
329 | } | 329 | } |
330 | // Вернуть все 100% | 330 | // Вернуть все 100% |
331 | return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); | 331 | return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); |
332 | } | 332 | } |
333 | 333 | ||
334 | // Избранный | 334 | // Избранный |
335 | public function favorite() | 335 | public function favorite() |
336 | { | 336 | { |
337 | return view('workers.favorite'); | 337 | return view('workers.favorite'); |
338 | } | 338 | } |
339 | 339 | ||
340 | // Сменить пароль | 340 | // Сменить пароль |
341 | public function new_password() | 341 | public function new_password() |
342 | { | 342 | { |
343 | $email = Auth()->user()->email; | 343 | $email = Auth()->user()->email; |
344 | return view('workers.new_password', compact('email')); | 344 | return view('workers.new_password', compact('email')); |
345 | } | 345 | } |
346 | 346 | ||
347 | // Обновление пароля | 347 | // Обновление пароля |
348 | public function save_new_password(Request $request) { | 348 | public function save_new_password(Request $request) { |
349 | $use = Auth()->user(); | 349 | $use = Auth()->user(); |
350 | $request->validate([ | 350 | $request->validate([ |
351 | 'password' => 'required|string', | 351 | 'password' => 'required|string', |
352 | 'new_password' => 'required|string', | 352 | 'new_password' => 'required|string', |
353 | 'new_password2' => 'required|string' | 353 | 'new_password2' => 'required|string' |
354 | ]); | 354 | ]); |
355 | 355 | ||
356 | if ($request->get('new_password') == $request->get('new_password2')) | 356 | if ($request->get('new_password') == $request->get('new_password2')) |
357 | if ($request->get('password') !== $request->get('new_password')) { | 357 | if ($request->get('password') !== $request->get('new_password')) { |
358 | $credentials = $request->only('email', 'password'); | 358 | $credentials = $request->only('email', 'password'); |
359 | if (Auth::attempt($credentials, $request->has('save_me'))) { | 359 | if (Auth::attempt($credentials, $request->has('save_me'))) { |
360 | 360 | ||
361 | if (!is_null($use->email_verified_at)){ | 361 | if (!is_null($use->email_verified_at)){ |
362 | 362 | ||
363 | $user_data = User_Model::find($use->id); | 363 | $user_data = User_Model::find($use->id); |
364 | $user_data->update([ | 364 | $user_data->update([ |
365 | 'password' => Hash::make($request->get('new_password')), | 365 | 'password' => Hash::make($request->get('new_password')), |
366 | 'pubpassword' => base64_encode($request->get('new_password')), | 366 | 'pubpassword' => base64_encode($request->get('new_password')), |
367 | ]); | 367 | ]); |
368 | return redirect() | 368 | return redirect() |
369 | ->route('worker.new_password') | 369 | ->route('worker.new_password') |
370 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); | 370 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); |
371 | } | 371 | } |
372 | 372 | ||
373 | return redirect() | 373 | return redirect() |
374 | ->route('worker.new_password') | 374 | ->route('worker.new_password') |
375 | ->withError('Данная учетная запись не было верифицированна!'); | 375 | ->withError('Данная учетная запись не было верифицированна!'); |
376 | } | 376 | } |
377 | } | 377 | } |
378 | 378 | ||
379 | return redirect() | 379 | return redirect() |
380 | ->route('worker.new_password') | 380 | ->route('worker.new_password') |
381 | ->withErrors('Не совпадение данных, обновите пароли!'); | 381 | ->withErrors('Не совпадение данных, обновите пароли!'); |
382 | } | 382 | } |
383 | 383 | ||
384 | // Удаление профиля форма | 384 | // Удаление профиля форма |
385 | public function delete_profile() | 385 | public function delete_profile() |
386 | { | 386 | { |
387 | $login = Auth()->user()->email; | 387 | $login = Auth()->user()->email; |
388 | return view('workers.delete_profile', compact('login')); | 388 | return view('workers.delete_profile', compact('login')); |
389 | } | 389 | } |
390 | 390 | ||
391 | // Удаление профиля код | 391 | // Удаление профиля код |
392 | public function delete_profile_result(Request $request) { | 392 | public function delete_profile_result(Request $request) { |
393 | $Answer = $request->all(); | 393 | $Answer = $request->all(); |
394 | $user_id = Auth()->user()->id; | 394 | $user_id = Auth()->user()->id; |
395 | $request->validate([ | 395 | $request->validate([ |
396 | 'password' => 'required|string', | 396 | 'password' => 'required|string', |
397 | ]); | 397 | ]); |
398 | 398 | ||
399 | $credentials = $request->only('email', 'password'); | 399 | $credentials = $request->only('email', 'password'); |
400 | if (Auth::attempt($credentials)) { | 400 | if (Auth::attempt($credentials)) { |
401 | Auth::logout(); | 401 | Auth::logout(); |
402 | $it = User_Model::find($user_id); | 402 | $it = User_Model::find($user_id); |
403 | $it->delete(); | 403 | $it->delete(); |
404 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); | 404 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); |
405 | } else { | 405 | } else { |
406 | return redirect()->route('worker.delete_profile') | 406 | return redirect()->route('worker.delete_profile') |
407 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); | 407 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); |
408 | } | 408 | } |
409 | } | 409 | } |
410 | 410 | ||
411 | // Регистрация соискателя | 411 | // Регистрация соискателя |
412 | public function register_worker(Request $request) | 412 | public function register_worker(Request $request) |
413 | { | 413 | { |
414 | $params = $request->all(); | 414 | $params = $request->all(); |
415 | $params['is_worker'] = 1; | 415 | $params['is_worker'] = 1; |
416 | |||
417 | $rules = [ | ||
418 | 'surname' => ['required', 'string', 'max:255'], | 416 | |
419 | 'name_man' => ['required', 'string', 'max:255'], | 417 | $rules = [ |
420 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], | 418 | 'surname' => ['required', 'string', 'max:255'], |
421 | 'password' => ['required', 'string', 'min:8'] | 419 | 'name_man' => ['required', 'string', 'max:255'], |
422 | ]; | 420 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], |
423 | 421 | 'password' => ['required', 'string', 'min:8'] | |
424 | $messages = [ | 422 | ]; |
425 | 'required' => 'Укажите обязательное поле', | 423 | |
426 | 'min' => [ | 424 | $messages = [ |
427 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 425 | 'required' => 'Укажите обязательное поле', |
428 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 426 | 'min' => [ |
429 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 427 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
430 | ], | 428 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
431 | 'max' => [ | 429 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
432 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 430 | ], |
433 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 431 | 'max' => [ |
434 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 432 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
435 | ] | 433 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
436 | ]; | 434 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
437 | 435 | ] | |
438 | if ($request->get('password') !== $request->get('confirmed')){ | 436 | ]; |
439 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); | 437 | |
440 | } | 438 | if ($request->get('password') !== $request->get('confirmed')){ |
441 | 439 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); | |
442 | $haystack = $request->get('password'); | 440 | } |
443 | 441 | ||
442 | $haystack = $request->get('password'); | ||
443 | |||
444 | $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); | ||
445 | $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', | ||
446 | 'X', 'C', 'V', 'B', 'N', 'M'); | ||
447 | $spec_bool = false; | ||
448 | $alpha_bool = false; | ||
449 | |||
450 | foreach ($specsumbol as $it) { | ||
451 | if (strpos($haystack, $it) !== false) { | ||
452 | $spec_bool = true; | ||
453 | } | ||
454 | } | ||
455 | |||
456 | foreach ($alpha as $it) { | ||
457 | if (strpos($haystack, $it) !== false) { | ||
458 | $alpha_bool = true; | ||
459 | } | ||
460 | } | ||
461 | |||
462 | if ((!$spec_bool) || (!$alpha_bool)) { | ||
463 | return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); | ||
464 | } | ||
465 | |||
444 | $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); | 466 | if (($request->has('politik')) && ($request->get('politik') == 1)) { |
445 | $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', | 467 | $validator = Validator::make($request->all(), $rules, $messages); |
446 | 'X', 'C', 'V', 'B', 'N', 'M'); | 468 | |
447 | $spec_bool = false; | 469 | if ($validator->fails()) { |
448 | $alpha_bool = false; | 470 | return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); |
449 | 471 | } else { | |
450 | foreach ($specsumbol as $it) { | 472 | $user = $this->create($params); |
451 | if (strpos($haystack, $it) !== false) { | 473 | event(new Registered($user)); |
452 | $spec_bool = true; | ||
453 | } | 474 | Auth::guard()->login($user); |
454 | } | 475 | } |
455 | |||
456 | foreach ($alpha as $it) { | 476 | if ($user) { |
457 | if (strpos($haystack, $it) !== false) { | 477 | return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; |
458 | $alpha_bool = true; | 478 | } else { |
459 | } | 479 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); |
460 | } | 480 | } |
461 | 481 | ||
462 | if ((!$spec_bool) || (!$alpha_bool)) { | 482 | } else { |
463 | return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); | 483 | return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!")); |
464 | } | 484 | } |
465 | |||
466 | if (($request->has('politik')) && ($request->get('politik') == 1)) { | ||
467 | $validator = Validator::make($request->all(), $rules, $messages); | 485 | } |
468 | 486 | ||
469 | if ($validator->fails()) { | ||
470 | return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); | 487 | // Звездная оценка и ответ |
471 | } else { | 488 | public function stars_answer(Request $request) { |
472 | $user = $this->create($params); | 489 | $params = $request->all(); |
473 | event(new Registered($user)); | 490 | $rules = [ |
474 | Auth::guard()->login($user); | 491 | 'message' => ['required', 'string', 'max:255'], |
475 | } | 492 | ]; |
476 | if ($user) { | 493 | |
477 | return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; | 494 | $messages = [ |
478 | } else { | 495 | 'required' => 'Укажите обязательное поле', |
479 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); | 496 | 'min' => [ |
480 | } | 497 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
481 | 498 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | |
482 | } else { | 499 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
483 | return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!")); | 500 | ], |
484 | } | 501 | 'max' => [ |
485 | } | 502 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
486 | 503 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | |
487 | // Звездная оценка и ответ | 504 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
488 | public function stars_answer(Request $request) { | 505 | ] |
489 | $params = $request->all(); | 506 | ]; |
490 | $rules = [ | 507 | $response_worker = ResponseWork::create($params); |
491 | 'message' => ['required', 'string', 'max:255'], | 508 | return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); |
492 | ]; | 509 | } |
493 | 510 | ||
494 | $messages = [ | 511 | // Создание пользователя |
495 | 'required' => 'Укажите обязательное поле', | 512 | protected function create(array $data) |
496 | 'min' => [ | 513 | { |
497 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 514 | $Use = new User(); |
498 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 515 | $Code_user = $Use->create([ |
499 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 516 | 'name' => $data['surname']." ".$data['name_man'], |
500 | ], | 517 | 'name_man' => $data['name_man'], |
501 | 'max' => [ | 518 | 'surname' => $data['surname'], |
502 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 519 | 'surname2' => $data['surname2'], |
503 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 520 | 'subscribe_email' => $data['email'], |
504 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 521 | 'email' => $data['email'], |
505 | ] | 522 | 'telephone' => $data['telephone'], |
506 | ]; | 523 | 'password' => Hash::make($data['password']), |
507 | $response_worker = ResponseWork::create($params); | 524 | 'pubpassword' => base64_encode($data['password']), |
508 | return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); | 525 | 'email_verified_at' => Carbon::now() |
509 | } | 526 | ]); |
510 | 527 | if ($Code_user->id > 0) { | |
511 | // Создание пользователя | 528 | $Worker = new Worker(); |
512 | protected function create(array $data) | 529 | $Worker->user_id = $Code_user->id; |
513 | { | 530 | $Worker->position_work = $data['job_titles']; |
514 | $Use = new User(); | 531 | $Worker->email = $data['email']; |
515 | $Code_user = $Use->create([ | 532 | $Worker->telephone = $data['telephone']; |
516 | 'name' => $data['surname']." ".$data['name_man'], | 533 | $Worker->save(); |
517 | 'name_man' => $data['name_man'], | 534 | |
518 | 'surname' => $data['surname'], | 535 | return $Code_user; |
519 | 'surname2' => $data['surname2'], | 536 | } |
520 | 'subscribe_email' => $data['email'], | 537 | } |
521 | 'email' => $data['email'], | 538 | |
522 | 'telephone' => $data['telephone'], | 539 | // Вакансии избранные |
523 | 'password' => Hash::make($data['password']), | 540 | public function colorado(Request $request) { |
524 | 'pubpassword' => base64_encode($data['password']), | 541 | $IP_address = RusDate::ip_addr_client(); |
525 | 'email_verified_at' => Carbon::now() | 542 | $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); |
526 | ]); | 543 | |
527 | if ($Code_user->id > 0) { | 544 | if ($Arr->count()) { |
528 | $Worker = new Worker(); | 545 | $A = Array(); |
529 | $Worker->user_id = $Code_user->id; | 546 | foreach ($Arr as $it) { |
530 | $Worker->position_work = $data['job_titles']; | 547 | $A[] = $it->code_record; |
531 | $Worker->email = $data['email']; | 548 | } |
532 | $Worker->telephone = $data['telephone']; | 549 | |
533 | $Worker->save(); | 550 | $Query = Ad_employer::query()->whereIn('id', $A); |
534 | 551 | } else { | |
535 | return $Code_user; | 552 | $Query = Ad_employer::query()->where('id', '=', '0'); |
536 | } | 553 | } |
537 | } | 554 | |
538 | 555 | $Query = $Query->with('jobs')-> | |
539 | // Вакансии избранные | 556 | with('cat')-> |
540 | public function colorado(Request $request) { | 557 | with('employer')-> |
541 | $IP_address = RusDate::ip_addr_client(); | 558 | whereHas('jobs_code', function ($query) use ($request) { |
542 | $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); | 559 | if ($request->ajax()) { |
543 | 560 | if (null !== ($request->get('job'))) { | |
544 | if ($Arr->count()) { | 561 | $query->where('job_title_id', $request->get('job')); |
545 | $A = Array(); | 562 | } |
546 | foreach ($Arr as $it) { | 563 | } |
547 | $A[] = $it->code_record; | 564 | })->select('ad_employers.*'); |
548 | } | 565 | |
549 | 566 | $Job_title = Job_title::query()->OrderBy('name')->get(); | |
550 | $Query = Ad_employer::query()->whereIn('id', $A); | 567 | |
551 | } else { | 568 | $Query_count = $Query->count(); |
552 | $Query = Ad_employer::query()->where('id', '=', '0'); | 569 | |
553 | } | 570 | $Query = $Query->OrderBy('updated_at')->paginate(3); |
554 | 571 | ||
555 | $Query = $Query->with('jobs')-> | 572 | |
556 | with('cat')-> | 573 | return view('workers.favorite', compact('Query', |
557 | with('employer')-> | 574 | 'Query_count', |
558 | whereHas('jobs_code', function ($query) use ($request) { | 575 | 'Job_title')); |
559 | if ($request->ajax()) { | 576 | |
560 | if (null !== ($request->get('job'))) { | 577 | } |
561 | $query->where('job_title_id', $request->get('job')); | 578 | |
562 | } | 579 | //Переписка |
563 | } | 580 | public function dialog(User_Model $user1, User_Model $user2) { |
564 | })->select('ad_employers.*'); | 581 | if (isset($user2->id)) { |
565 | 582 | $companion = User_Model::query()->with('workers')-> | |
566 | $Job_title = Job_title::query()->OrderBy('name')->get(); | 583 | with('employers')-> |
567 | 584 | where('id', $user2->id)->first(); | |
568 | $Query_count = $Query->count(); | 585 | } |
569 | 586 | ||
570 | $Query = $Query->OrderBy('updated_at')->paginate(3); | 587 | $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) { |
571 | 588 | $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); | |
572 | 589 | })->orWhere(function($query) use ($user1, $user2) { | |
573 | return view('workers.favorite', compact('Query', | 590 | $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); |
574 | 'Query_count', | 591 | })->OrderBy('created_at')->get(); |
575 | 'Job_title')); | 592 | |
576 | 593 | $id_vac = null; | |
577 | } | 594 | foreach ($Messages as $it) { |
578 | 595 | if (isset($it->response)) { | |
579 | //Переписка | 596 | foreach ($it->response as $r) { |
580 | public function dialog(User_Model $user1, User_Model $user2) { | 597 | if (isset($r->ad_employer_id)) { |
581 | if (isset($user2->id)) { | 598 | $id_vac = $r->ad_employer_id; |
582 | $companion = User_Model::query()->with('workers')-> | 599 | break; |
583 | with('employers')-> | 600 | } |
584 | where('id', $user2->id)->first(); | 601 | } |
585 | } | 602 | } |
586 | 603 | if (!is_null($id_vac)) break; | |
587 | $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) { | 604 | } |
588 | $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); | 605 | |
589 | })->orWhere(function($query) use ($user1, $user2) { | 606 | $ad_employer = null; |
590 | $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); | 607 | if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); |
591 | })->OrderBy('created_at')->get(); | 608 | $sender = $user1; |
592 | 609 | ||
593 | $id_vac = null; | 610 | return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); |
594 | foreach ($Messages as $it) { | 611 | } |
595 | if (isset($it->response)) { | 612 | |
596 | foreach ($it->response as $r) { | 613 | // Даунылоады |
597 | if (isset($r->ad_employer_id)) { | 614 | public function download(Worker $worker) { |
598 | $id_vac = $r->ad_employer_id; | 615 | $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; |
599 | break; | 616 | view()->share('house',$arr_house); |
600 | } | 617 | $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); |
601 | } | 618 | return $pdf->stream(); |
602 | } | 619 | } |
603 | if (!is_null($id_vac)) break; | 620 | |
604 | } | 621 | // Поднятие анкеты |
605 | 622 | public function up(Worker $worker) { | |
606 | $ad_employer = null; | 623 | $worker->updated_at = Carbon::now(); |
624 | $worker->save(); | ||
607 | if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); | 625 | // 0 |
608 | $sender = $user1; | 626 | return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); |
609 | 627 | } | |
610 | return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); | 628 | |
611 | } | 629 | // Добавление сертификата |
612 | 630 | public function add_serificate(Request $request) { | |
613 | // Даунылоады | 631 | $params = $request->all(); |
614 | public function download(Worker $worker) { | 632 | $params['date_begin'] = date('d.m.Y', strtotime($params['date_begin'])); |
615 | $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; | 633 | $params['end_begin'] = date('d.m.Y', strtotime($params['end_begin'])); |
616 | view()->share('house',$arr_house); | 634 | $Sertificate = new sertification(); |
617 | $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); | 635 | $Sertificate->create($params); |
618 | return $pdf->stream(); | 636 | $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get(); |
619 | } | 637 | return view('ajax.documents', compact('Docs')); |
620 | 638 | } | |
621 | // Поднятие анкеты | 639 | |
622 | public function up(Worker $worker) { | 640 | |
623 | $worker->updated_at = Carbon::now(); | 641 | // Удалить сертификат |
624 | $worker->save(); | 642 | public function delete_sertificate(sertification $doc) { |
625 | // 0 | 643 | $doc->delete(); |
626 | return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); | 644 | |
627 | } | 645 | return redirect()->route('worker.cabinet'); |
628 | 646 | } | |
629 | // Добавление сертификата | 647 | |
630 | public function add_serificate(Request $request) { | 648 | // Добавление диплома |
631 | $params = $request->all(); | 649 | public function add_diplom_ajax(Request $request) { |
632 | $params['date_begin'] = date('d.m.Y', strtotime($params['date_begin'])); | 650 | // конец |
633 | $params['end_begin'] = date('d.m.Y', strtotime($params['end_begin'])); | 651 | $params = $request->all(); |
634 | $Sertificate = new sertification(); | 652 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); |
635 | $Sertificate->create($params); | 653 | |
636 | $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get(); | 654 | if ($count == 0) $dop_info = Dop_info::create($params); |
637 | return view('ajax.documents', compact('Docs')); | 655 | $Infoblocks = infobloks::query()->get(); |
638 | } | 656 | $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); |
639 | 657 | $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); | |
640 | 658 | return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); | |
641 | // Удалить сертификат | 659 | } |
642 | public function delete_sertificate(sertification $doc) { | 660 | |
643 | $doc->delete(); | 661 | // Добавление диплома без ajax |
644 | 662 | public function add_diplom(Worker $worker) { | |
645 | return redirect()->route('worker.cabinet'); | 663 | $worker_id = $worker->id; |
646 | } | 664 | $Infoblocks = infobloks::query()->get(); |
647 | 665 | return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); | |
648 | // Добавление диплома | 666 | } |
649 | public function add_diplom_ajax(Request $request) { | 667 | // Сохранить |
650 | // конец | 668 | // Сохраняю диплом |
651 | $params = $request->all(); | 669 | public function add_diplom_save(Request $request) { |
652 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); | 670 | $params = $request->all(); |
653 | 671 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); | |
654 | if ($count == 0) $dop_info = Dop_info::create($params); | 672 | if ($count == 0) $dop_info = Dop_info::create($params); |
655 | $Infoblocks = infobloks::query()->get(); | 673 | return redirect()->route('worker.cabinet'); |
656 | $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); | 674 | } |
657 | $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); | 675 | |
658 | return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); | 676 | // Добавление стандартного документа |
659 | } | 677 | public function add_document(Worker $worker) { |
660 | 678 | return view('workers.docs', compact('worker')); | |
661 | // Добавление диплома без ajax | 679 | } |
662 | public function add_diplom(Worker $worker) { | 680 | |
663 | $worker_id = $worker->id; | 681 | //Сохранение стандартого документа |
664 | $Infoblocks = infobloks::query()->get(); | 682 | public function add_document_save(DocumentsRequest $request) { |
665 | return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); | 683 | $params = $request->all(); |
666 | } | 684 | $place_work = place_works::create($params); |
667 | // Сохранить | 685 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!'); |
668 | // Сохраняю диплом | 686 | } |
669 | public function add_diplom_save(Request $request) { | 687 | |
670 | $params = $request->all(); | 688 | // Редактирование документа |
671 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); | 689 | public function edit_document(place_works $doc, Worker $worker) { |
672 | if ($count == 0) $dop_info = Dop_info::create($params); | 690 | return view('workers.docs-edit', compact('doc', 'worker')); |
673 | return redirect()->route('worker.cabinet'); | 691 | } |
674 | } | 692 | |
675 | 693 | //Сохранение отредактированного документа | |
676 | // Добавление стандартного документа | 694 | public function edit_document_save(DocumentsRequest $request, place_works $doc) { |
677 | public function add_document(Worker $worker) { | 695 | $params = $request->all(); |
678 | return view('workers.docs', compact('worker')); | 696 | $doc->update($params); |
679 | } | 697 | |
680 | 698 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); | |
681 | //Сохранение стандартого документа | 699 | } |
682 | public function add_document_save(DocumentsRequest $request) { | 700 | |
683 | $params = $request->all(); | 701 | // Удаление документа |
684 | $place_work = place_works::create($params); | 702 | public function delete_document(place_works $doc) { |
685 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!'); | 703 | $doc->delete(); |
686 | } | 704 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); |
687 | 705 | } | |
688 | // Редактирование документа | 706 | |
689 | public function edit_document(place_works $doc, Worker $worker) { | 707 | //Отправка нового сообщения |
690 | return view('workers.docs-edit', compact('doc', 'worker')); | 708 | public function new_message(Request $request) { |
691 | } | 709 | $params = $request->all(); |
692 | 710 | ||
693 | //Сохранение отредактированного документа | 711 | $id = $params['send_user_id']; |
694 | public function edit_document_save(DocumentsRequest $request, place_works $doc) { | 712 | $message = new Message(); |
695 | $params = $request->all(); | 713 | $message->user_id = $params['send_user_id']; |
696 | $doc->update($params); | 714 | $message->to_user_id = $params['send_to_user_id']; |
697 | 715 | $message->title = $params['send_title']; | |
698 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); | 716 | $message->text = $params['send_text']; |
699 | } | 717 | if ($request->has('send_file')) { |
700 | 718 | $message->file = $request->file('send_file')->store("worker/$id", 'public'); | |
701 | // Удаление документа | 719 | } |
702 | public function delete_document(place_works $doc) { | 720 | $message->flag_new = 1; |
703 | $doc->delete(); | 721 | $id_message = $message->save(); |
704 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); | 722 | |
705 | } | 723 | $data['message_id'] = $id_message; |
706 | 724 | $data['ad_employer_id'] = $params['send_vacancy']; | |
707 | //Отправка нового сообщения | 725 | $data['job_title_id'] = $params['send_job_title_id']; |
708 | public function new_message(Request $request) { | 726 | $data['flag'] = 1; |
app/Models/Ad_jobs.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Models; | 3 | namespace App\Models; |
4 | 4 | ||
5 | use Filament\Tables\Actions\Position; | ||
5 | use Filament\Tables\Actions\Position; | 6 | use Illuminate\Database\Eloquent\Factories\HasFactory; |
6 | use Illuminate\Database\Eloquent\Factories\HasFactory; | 7 | use Illuminate\Database\Eloquent\Model; |
7 | use Illuminate\Database\Eloquent\Model; | 8 | |
8 | 9 | class Ad_jobs extends Model | |
9 | class Ad_jobs extends Model | 10 | { |
10 | { | 11 | use HasFactory; |
11 | use HasFactory; | 12 | |
12 | 13 | protected $table = 'ad_jobs'; | |
13 | protected $table = 'ad_jobs'; | 14 | |
14 | 15 | public $fillable = [ | |
15 | public $fillable = [ | 16 | 'ad_employer_id', |
16 | 'ad_employer_id', | 17 | 'job_title_id', |
17 | 'job_title_id', | 18 | 'flot', |
18 | 'flot', | 19 | 'min_salary', |
19 | 'min_salary', | 20 | 'max_salary', |
20 | 'max_salary', | 21 | 'region', |
21 | 'region', | 22 | 'sytki', |
22 | 'sytki', | 23 | 'start', |
23 | 'start', | 24 | 'description', |
24 | 'description', | 25 | 'position_ship' |
25 | 'position_ship' | 26 | ]; |
26 | ]; | 27 | |
27 | 28 | public function job_title() { | |
28 | public function job_title() { | 29 | return $this->belongsTo(Job_title::class, 'job_title_id'); |
29 | return $this->belongsTo(Job_title::class, 'job_title_id'); | 30 | } |
31 | |||
32 | public function positions() { | ||
33 | return $this->belongsToMany(Positions::class, 'job_titles'); | ||
34 | } | ||
30 | } | 35 | } |
31 | 36 |
app/Models/Job_title.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Models; | 3 | namespace App\Models; |
4 | 4 | ||
5 | use Illuminate\Database\Eloquent\Factories\HasFactory; | 5 | use Illuminate\Database\Eloquent\Factories\HasFactory; |
6 | use Illuminate\Database\Eloquent\Model; | 6 | use Illuminate\Database\Eloquent\Model; |
7 | 7 | ||
8 | class Job_title extends Model | 8 | class Job_title extends Model |
9 | { | 9 | { |
10 | use HasFactory; | 10 | use HasFactory; |
11 | 11 | ||
12 | protected $fillable = [ | 12 | protected $fillable = [ |
13 | 'name', | 13 | 'name', |
14 | 'is_remove', | 14 | 'is_remove', |
15 | 'parent_id', | 15 | 'parent_id', |
16 | 'sort', | 16 | 'sort', |
17 | 'position_id' | ||
17 | 'position_id' | 18 | ]; |
18 | ]; | 19 | /* |
19 | /* | 20 | * Связь модели Вакансии (Ad_employer) с моделью Должности (Job_title) |
20 | * Связь модели Вакансии (Ad_employer) с моделью Должности (Job_title) | 21 | */ |
21 | */ | 22 | public function Ads() { |
22 | public function Ads() { | 23 | return $this->belongsToMany(Ad_employer::class, 'ad_jobs'); |
23 | return $this->belongsToMany(Ad_employer::class, 'ad_jobs'); | 24 | } |
24 | } | 25 | |
25 | 26 | /* | |
26 | /* | 27 | * Связь таблицы job_titles с таблицей job_titles через ключ parent_id |
27 | * Связь таблицы job_titles с таблицей job_titles через ключ parent_id | 28 | многие-к-одному |
28 | многие-к-одному | 29 | */ |
29 | */ | 30 | public function parent() { |
30 | public function parent() { | 31 | return $this->belongsTo(Job_title::class, 'parent_id'); |
31 | return $this->belongsTo(Job_title::class, 'parent_id'); | 32 | } |
32 | } | 33 | |
33 | 34 | public function scopeActive($query) { | |
34 | public function scopeActive($query) { | 35 | return $query->where('is_remove', '=', '0'); |
35 | return $query->where('is_remove', '=', '0'); | 36 | } |
36 | } | 37 | } |
37 | } | 38 |
database/migrations/2023_09_08_084707_alter_job_titles3_table.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | use Illuminate\Database\Migrations\Migration; | 3 | use Illuminate\Database\Migrations\Migration; |
4 | use Illuminate\Database\Schema\Blueprint; | 4 | use Illuminate\Database\Schema\Blueprint; |
5 | use Illuminate\Support\Facades\Schema; | 5 | use Illuminate\Support\Facades\Schema; |
6 | 6 | ||
7 | return new class extends Migration | 7 | return new class extends Migration |
8 | { | 8 | { |
9 | /** | 9 | /** |
10 | * Run the migrations. | 10 | * Run the migrations. |
11 | * | 11 | * |
12 | * @return void | 12 | * @return void |
13 | */ | 13 | */ |
14 | public function up() | 14 | public function up() |
15 | { | 15 | { |
16 | Schema::table('job_titles', function (Blueprint $table) { | 16 | Schema::table('job_titles', function (Blueprint $table) { |
17 | $table->integer('sort')->default(100); | 17 | $table->integer('sort')->default(100); |
18 | $table->integer('position_id')->nullable(false); | ||
18 | $table->integer('position_id')->nullable(false); | 19 | }); |
19 | }); | 20 | } |
20 | } | 21 | |
21 | 22 | /** | |
22 | /** | 23 | * Reverse the migrations. |
23 | * Reverse the migrations. | 24 | * |
24 | * | 25 | * @return void |
25 | * @return void | 26 | */ |
26 | */ | 27 | public function down() |
27 | public function down() | 28 | { |
28 | { | 29 | Schema::table('job_titles', function (Blueprint $table) { |
29 | Schema::table('job_titles', function (Blueprint $table) { | 30 | $table->dropColumn('sort'); |
31 | $table->dropColumn('position_id'); | ||
30 | $table->dropColumn('sort'); | 32 | }); |
31 | $table->dropColumn('position_id'); | 33 | } |
32 | }); | 34 | }; |
33 | } | 35 |
public/js/script-vc.js
File was created | 1 | let scripts = function () { | |
2 | |||
3 | $('.js-toggle').on('click', function () { | ||
4 | $(this).toggleClass('active'); | ||
5 | }); | ||
6 | $('.js-parent-toggle').on('click', function () { | ||
7 | $(this).parent().toggleClass('active'); | ||
8 | }); | ||
9 | $('.js-parent-remove').on('click', function () { | ||
10 | $(this).parent().remove(); | ||
11 | }); | ||
12 | $('.js-menu-toggle').on('click', function () { | ||
13 | window.scrollTo(0, 0); | ||
14 | $('#body').toggleClass('menu-is-actived'); | ||
15 | }); | ||
16 | $('.js-cookies-close').on('click', function () { | ||
17 | $('#body').removeClass('cookies-is-actived'); | ||
18 | }); | ||
19 | $('.js-works-edit').on('click', function () { | ||
20 | $(this).parent().parent().parent().addClass('active'); | ||
21 | }); | ||
22 | $('.js-works-remove').on('click', function () { | ||
23 | $(this).parent().parent().parent().parent().remove(); | ||
24 | }); | ||
25 | |||
26 | $('[data-tab]').on('click', function () { | ||
27 | $('[data-tab]').removeClass('active'); | ||
28 | $('[data-body]').removeClass('showed'); | ||
29 | $(this).addClass('active'); | ||
30 | var id = $(this).data('tab'); | ||
31 | $('[data-body=' + id + ']').addClass('showed'); | ||
32 | }); | ||
33 | |||
34 | $('.js-password-show').on('click', function () { | ||
35 | $(this).parent().addClass('active'); | ||
36 | $(this).parent().parent().find('input').attr('type', 'text'); | ||
37 | }); | ||
38 | |||
39 | $('.js-password-hide').on('click', function () { | ||
40 | $(this).parent().removeClass('active'); | ||
41 | $(this).parent().parent().find('input').attr('type', 'password'); | ||
42 | }); | ||
43 | |||
44 | let checkScrollTop = function () { | ||
45 | if ($(document).scrollTop() == 0) { | ||
46 | $('#body').removeClass('begin'); | ||
47 | } else { | ||
48 | $('#body').addClass('begin'); | ||
49 | } | ||
50 | } | ||
51 | checkScrollTop(); | ||
52 | $(document).on('scroll', function () { | ||
53 | checkScrollTop(); | ||
54 | }); | ||
55 | |||
56 | let closeAll = function () { | ||
57 | $('.js-toggle').removeClass('active'); | ||
58 | $('.js-parent-toggle').parent().removeClass('active'); | ||
59 | $('#body').removeClass('menu-is-actived'); | ||
60 | $('#body').removeClass('cookies-is-actived'); | ||
61 | } | ||
62 | |||
63 | $(document).keyup(function (e) { | ||
64 | if (e.key === "Escape") { | ||
65 | closeAll(); | ||
66 | } | ||
67 | }); | ||
68 | |||
69 | $('.js-scroll-to').bind('click', function (e) { | ||
70 | let anchor = $(this); | ||
71 | $('html,body').stop().animate({ | ||
72 | scrollTop: $(anchor.attr('href')).offset().top | ||
73 | }, 300); | ||
74 | e.preventDefault(); | ||
75 | }); | ||
76 | |||
77 | if ($('[type=tel]').is('[type=tel]')) { | ||
78 | $('[type=tel]').mask('+7 (999) 999-99-99'); | ||
79 | } | ||
80 | |||
81 | if ($('.js-select2').is('.js-select2')) { | ||
82 | $('.js-select2').select2(); | ||
83 | } | ||
84 | |||
85 | const starRating = document.querySelectorAll(".js-stars"); | ||
86 | if (starRating.length) { | ||
87 | starRating.forEach(item => { | ||
88 | new StarRating(item); | ||
89 | }); | ||
90 | } | ||
91 | |||
92 | const checkboxes = document.querySelectorAll(".checkbox"); | ||
93 | if (checkboxes.length) { | ||
94 | checkboxes.forEach(checkbox => { | ||
95 | const input = checkbox.querySelector("input"); | ||
96 | checkbox.addEventListener("input", () => { | ||
97 | if (input.checked) { | ||
98 | input.setAttribute("checked", ""); | ||
99 | } else { | ||
100 | input.removeAttribute("checked"); | ||
101 | } | ||
102 | }); | ||
103 | }); | ||
104 | } | ||
105 | |||
106 | }; | ||
107 | |||
108 | let swipers = function () { | ||
109 | |||
110 | if ($('.js-employer-swiper').is('.js-employer-swiper')) { | ||
111 | let slider = new Swiper('.js-employer-swiper', { | ||
112 | autoplay: { | ||
113 | delay: 5000, | ||
114 | }, | ||
115 | pagination: { | ||
116 | el: '.swiper-pagination', | ||
117 | clickable: true | ||
118 | }, | ||
119 | breakpoints: { | ||
120 | 768: { | ||
121 | slidesPerView: 2, | ||
122 | }, | ||
123 | 992: { | ||
124 | slidesPerView: 3, | ||
125 | }, | ||
126 | 1280: { | ||
127 | slidesPerView: 4, | ||
128 | }, | ||
129 | } | ||
130 | }); | ||
131 | } | ||
132 | |||
133 | if ($('.js-news-swiper').is('.js-news-swiper')) { | ||
134 | let slider = new Swiper('.js-news-swiper', { | ||
135 | spaceBetween: 20, | ||
136 | pagination: { | ||
137 | el: '.swiper-pagination', | ||
138 | clickable: true | ||
139 | }, | ||
140 | navigation: { | ||
141 | prevEl: '.js-news-swiper-button-prev', | ||
142 | nextEl: '.js-news-swiper-button-next', | ||
143 | }, | ||
144 | breakpoints: { | ||
145 | 768: { | ||
146 | slidesPerView: 2, | ||
147 | }, | ||
148 | 992: { | ||
149 | slidesPerView: 3, | ||
150 | }, | ||
151 | } | ||
152 | }); | ||
153 | } | ||
154 | |||
155 | }; | ||
156 | |||
157 | document.addEventListener("DOMContentLoaded", () => { | ||
158 | scripts(); | ||
159 | swipers(); | ||
160 | }); | ||
161 | |||
162 | $(window).resize(function () { | ||
163 | swipers(); | ||
164 | }); | ||
1 | let scripts = function () { | 165 |
public/js/script0.js
File was created | 1 | let scripts = function () { | |
2 | |||
3 | $('.js-toggle').on('click', function () { | ||
4 | $(this).toggleClass('active'); | ||
5 | }); | ||
6 | $('.js-parent-toggle').on('click', function () { | ||
7 | $(this).parent().toggleClass('active'); | ||
8 | }); | ||
9 | $('.js-parent-remove').on('click', function () { | ||
10 | $(this).parent().remove(); | ||
11 | }); | ||
12 | $('.js-menu-toggle').on('click', function () { | ||
13 | window.scrollTo(0, 0); | ||
14 | $('#body').toggleClass('menu-is-actived'); | ||
15 | }); | ||
16 | $('.js-cookies-close').on('click', function () { | ||
17 | $('#body').removeClass('cookies-is-actived'); | ||
18 | }); | ||
19 | $('.js-works-edit').on('click', function () { | ||
20 | $(this).parent().parent().parent().addClass('active'); | ||
21 | }); | ||
22 | $('.js-works-remove').on('click', function () { | ||
23 | $(this).parent().parent().parent().parent().remove(); | ||
24 | }); | ||
25 | |||
26 | $('[data-tab]').on('click', function () { | ||
27 | $('[data-tab]').removeClass('active'); | ||
28 | $('[data-body]').removeClass('showed'); | ||
29 | $(this).addClass('active'); | ||
30 | var id = $(this).data('tab'); | ||
31 | $('[data-body=' + id + ']').addClass('showed'); | ||
32 | }); | ||
33 | |||
34 | $('.js-password-show').on('click', function () { | ||
35 | $(this).parent().addClass('active'); | ||
36 | $(this).parent().parent().find('input').attr('type', 'text'); | ||
37 | }); | ||
38 | |||
39 | $('.js-password-hide').on('click', function () { | ||
40 | $(this).parent().removeClass('active'); | ||
41 | $(this).parent().parent().find('input').attr('type', 'password'); | ||
42 | }); | ||
43 | |||
44 | let checkScrollTop = function () { | ||
45 | if ($(document).scrollTop() == 0) { | ||
46 | $('#body').removeClass('begin'); | ||
47 | } else { | ||
48 | $('#body').addClass('begin'); | ||
49 | } | ||
50 | } | ||
51 | checkScrollTop(); | ||
52 | $(document).on('scroll', function () { | ||
53 | checkScrollTop(); | ||
54 | }); | ||
55 | |||
56 | let closeAll = function () { | ||
57 | $('.js-toggle').removeClass('active'); | ||
58 | $('.js-parent-toggle').parent().removeClass('active'); | ||
59 | $('#body').removeClass('menu-is-actived'); | ||
60 | $('#body').removeClass('cookies-is-actived'); | ||
61 | } | ||
62 | |||
63 | $(document).keyup(function (e) { | ||
64 | if (e.key === "Escape") { | ||
65 | closeAll(); | ||
66 | } | ||
67 | }); | ||
68 | |||
69 | $('.js-scroll-to').bind('click', function (e) { | ||
70 | let anchor = $(this); | ||
71 | $('html,body').stop().animate({ | ||
72 | scrollTop: $(anchor.attr('href')).offset().top | ||
73 | }, 300); | ||
74 | e.preventDefault(); | ||
75 | }); | ||
76 | |||
77 | if ($('[type=tel]').is('[type=tel]')) { | ||
78 | $('[type=tel]').mask('+7 (999) 999-99-99'); | ||
79 | } | ||
80 | |||
81 | if ($('.js-select2').is('.js-select2')) { | ||
82 | $('.js-select2').select2(); | ||
83 | } | ||
84 | |||
85 | const starRating = document.querySelectorAll(".js-stars"); | ||
86 | if (starRating.length) { | ||
87 | starRating.forEach(item => { | ||
88 | new StarRating(item); | ||
89 | }); | ||
90 | } | ||
91 | |||
92 | // cookies | ||
93 | const cookieItems = document.querySelectorAll(".js-ck"); | ||
94 | if (cookieItems.length) { | ||
95 | cookieItems.forEach(item => { | ||
96 | const id = item.dataset.id; | ||
97 | const like = item.querySelector(".like"); | ||
98 | const checkLike = function () { | ||
99 | if (like.classList.contains("active")) { | ||
100 | Cookies.set('favor_vacan-'+id, id); | ||
101 | } else { | ||
102 | Cookies.remove(id); | ||
103 | } | ||
104 | } | ||
105 | like.addEventListener("click", () => { | ||
106 | checkLike(); | ||
107 | }); | ||
108 | if (Cookies.get('favor_vacan-'+id) == id) { | ||
109 | like.classList.add("active"); | ||
110 | } | ||
111 | }); | ||
112 | } | ||
113 | console.log(Cookies.get()); | ||
114 | |||
115 | }; | ||
116 | |||
117 | let swipers = function () { | ||
118 | |||
119 | if ($('.js-employer-swiper').is('.js-employer-swiper')) { | ||
120 | let slider = new Swiper('.js-employer-swiper', { | ||
121 | autoplay: { | ||
122 | delay: 5000, | ||
123 | }, | ||
124 | pagination: { | ||
125 | el: '.swiper-pagination', | ||
126 | clickable: true | ||
127 | }, | ||
128 | breakpoints: { | ||
129 | 768: { | ||
130 | slidesPerView: 2, | ||
131 | }, | ||
132 | 992: { | ||
133 | slidesPerView: 3, | ||
134 | }, | ||
135 | 1280: { | ||
136 | slidesPerView: 4, | ||
137 | }, | ||
138 | } | ||
139 | }); | ||
140 | } | ||
141 | |||
142 | if ($('.js-news-swiper').is('.js-news-swiper')) { | ||
143 | let slider = new Swiper('.js-news-swiper', { | ||
144 | spaceBetween: 20, | ||
145 | pagination: { | ||
146 | el: '.swiper-pagination', | ||
147 | clickable: true | ||
148 | }, | ||
149 | navigation: { | ||
150 | prevEl: '.js-news-swiper-button-prev', | ||
151 | nextEl: '.js-news-swiper-button-next', | ||
152 | }, | ||
153 | breakpoints: { | ||
154 | 768: { | ||
155 | slidesPerView: 2, | ||
156 | }, | ||
157 | 992: { | ||
158 | slidesPerView: 3, | ||
159 | }, | ||
160 | } | ||
161 | }); | ||
162 | } | ||
163 | |||
164 | }; | ||
165 | |||
166 | document.addEventListener("DOMContentLoaded", () => { | ||
167 | scripts(); | ||
168 | swipers(); | ||
169 | }); | ||
170 | |||
171 | $(window).resize(function () { | ||
172 | swipers(); | ||
173 | }); | ||
1 | let scripts = function () { | 174 |
resources/views/admin/job_titles/form.blade.php
1 | <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> | 1 | <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> |
2 | <label class="block text-sm"> | 2 | <label class="block text-sm"> |
3 | <span class="text-gray-700 dark:text-gray-400">Название должности</span> | 3 | <span class="text-gray-700 dark:text-gray-400">Название должности</span> |
4 | <input name="name" id="name" | 4 | <input name="name" id="name" |
5 | class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" | 5 | class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" |
6 | placeholder="Название должности" value="{{ old('name') ?? $job_title->name ?? '' }}" | 6 | placeholder="Название должности" value="{{ old('name') ?? $job_title->name ?? '' }}" |
7 | /> | 7 | /> |
8 | @error('name') | 8 | @error('name') |
9 | <span class="text-xs text-red-600 dark:text-red-400"> | 9 | <span class="text-xs text-red-600 dark:text-red-400"> |
10 | {{ $message }} | 10 | {{ $message }} |
11 | </span> | 11 | </span> |
12 | @enderror | 12 | @enderror |
13 | </label><br> | 13 | </label><br> |
14 | 14 | ||
15 | <label class="block text-sm"> | 15 | <label class="block text-sm"> |
16 | <span class="text-gray-700 dark:text-gray-400">Родитель</span> | 16 | <span class="text-gray-700 dark:text-gray-400">Родитель</span> |
17 | 17 | ||
18 | @php | 18 | @php |
19 | $parent_id = old('parent_id') ?? $job_title->parent_id ?? 0; | 19 | $parent_id = old('parent_id') ?? $job_title->parent_id ?? 0; |
20 | @endphp | 20 | @endphp |
21 | <select name="parent_id" class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-select focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" | 21 | <select name="parent_id" class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-select focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" |
22 | title="Родитель"> | 22 | title="Родитель"> |
23 | <option value="0">Без родителя</option> | 23 | <option value="0">Без родителя</option> |
24 | @include('admin.job_titles.parent_id', ['level' => -1, 'parent' => 0]) | 24 | @include('admin.job_titles.parent_id', ['level' => -1, 'parent' => 0]) |
25 | </select> | 25 | </select> |
26 | </label><br> | 26 | </label><br> |
27 | 27 | ||
28 | <label class="block text-sm"> | 28 | <label class="block text-sm"> |
29 | <span class="text-gray-700 dark:text-gray-400">Папка</span> | ||
30 | |||
31 | @php | ||
32 | $position_id = old('position_id') ?? $job_title->position_id ?? 0; | ||
33 | @endphp | ||
34 | <select name="position_id" class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-select focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" | ||
35 | title="Родитель"> | ||
36 | <option value="">Без родителя</option> | ||
37 | @foreach ($position as $it) | ||
38 | <option value="{{ $it->id }}" @if ($it->id == $position_id) selected @endif>{{ $it->name }}</option> | ||
39 | @endforeach | ||
40 | </select> | ||
41 | </label><br> | ||
42 | |||
43 | <label class="block text-sm"> | ||
29 | <span class="text-gray-700 dark:text-gray-400">Папка</span> | 44 | <span class="text-gray-700 dark:text-gray-400">Сортировка</span> |
30 | 45 | @php | |
31 | @php | 46 | $sort_num = 100; |
32 | $position_id = old('position_id') ?? $job_title->position_id ?? 0; | 47 | @endphp |
33 | @endphp | 48 | <select name="sort" class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-select focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" |
34 | <select name="position_id" class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-select focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" | 49 | title="Сортировка"> |
35 | title="Родитель"> | 50 | @for($i = 1; $i <= 10; $i++) |
36 | <option value="">Без родителя</option> | 51 | <option value="{{ $sort_num }}" @if (isset($job_title)) @if ($sort_num == $job_title->sort) selected @else @endif @endif>{{ $sort_num }}</option> |
37 | @foreach ($position as $it) | 52 | @php $sort_num = $sort_num + 10; @endphp |
38 | <option value="{{ $it->id }}" @if ($it->id == $position_id) selected @endif>{{ $it->name }}</option> | 53 | @endfor |
39 | @endforeach | 54 | </select> |
40 | </select> | 55 | </label><br> |
41 | </label><br> | 56 | |
42 | 57 | <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> | |
43 | <label class="block text-sm"> | 58 | <div> |
44 | <span class="text-gray-700 dark:text-gray-400">Сортировка</span> | 59 | <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"> |
45 | @php | 60 | Сохранить |
46 | $sort_num = 100; | 61 | </button> |
47 | @endphp | 62 | |
48 | <select name="sort" class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-select focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" | 63 | <a href="{{ route('admin.job-titles.index') }}" |
49 | title="Сортировка"> | 64 | class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" |
50 | @for($i = 1; $i <= 10; $i++) | 65 | style="display: -webkit-inline-box; height: 30px!important;" |
51 | <option value="{{ $sort_num }}" @if (isset($job_title)) @if ($sort_num == $job_title->sort) selected @else @endif @endif>{{ $sort_num }}</option> | 66 | >Назад</a> |
52 | @php $sort_num = $sort_num + 10; @endphp | 67 | </div> |
53 | @endfor | 68 | </div> |
54 | </select> | 69 | </div> |
55 | </label><br> | 70 |
resources/views/admin/positions/position.blade.php
1 | @extends('layout.admin', ['title' => 'Админка - Позиции']) | 1 | @extends('layout.admin', ['title' => 'Админка - Позиции']) |
2 | @section('script') | 2 | @section('script') |
3 | <script> | 3 | <script> |
4 | $(document).ready(function() { | 4 | $(document).ready(function() { |
5 | $(document).on('click', '.checkban', function () { | 5 | $(document).on('click', '.checkban', function () { |
6 | var this_ = $(this); | 6 | var this_ = $(this); |
7 | var value = this_.val(); | 7 | var value = this_.val(); |
8 | var ajax_block = $('#ajax_block'); | 8 | var ajax_block = $('#ajax_block'); |
9 | var bool = 0; | 9 | var bool = 0; |
10 | 10 | ||
11 | if(this.checked){ | 11 | if(this.checked){ |
12 | bool = 1; | 12 | bool = 1; |
13 | } else { | 13 | } else { |
14 | bool = 0; | 14 | bool = 0; |
15 | } | 15 | } |
16 | 16 | ||
17 | $.ajax({ | 17 | $.ajax({ |
18 | type: "GET", | 18 | type: "GET", |
19 | url: "{{ url()->full()}}", | 19 | url: "{{ url()->full()}}", |
20 | data: "id=" + value + "&is_ban=" + bool, | 20 | data: "id=" + value + "&is_ban=" + bool, |
21 | success: function (data) { | 21 | success: function (data) { |
22 | console.log('Обновление таблицы работников '); | 22 | console.log('Обновление таблицы работников '); |
23 | //data = JSON.parse(data); | 23 | //data = JSON.parse(data); |
24 | console.log(data); | 24 | console.log(data); |
25 | ajax_block.html(data); | 25 | ajax_block.html(data); |
26 | }, | 26 | }, |
27 | headers: { | 27 | headers: { |
28 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 28 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
29 | }, | 29 | }, |
30 | error: function (data) { | 30 | error: function (data) { |
31 | console.log('Error: ' + data); | 31 | console.log('Error: ' + data); |
32 | } | 32 | } |
33 | }); | 33 | }); |
34 | }); | 34 | }); |
35 | }); | 35 | }); |
36 | </script> | 36 | </script> |
37 | @endsection | 37 | @endsection |
38 | 38 | ||
39 | @section('search') | 39 | @section('search') |
40 | @endsection | 40 | @endsection |
41 | 41 | ||
42 | @section('content') | 42 | @section('content') |
43 | 43 | ||
44 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> | 44 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> |
45 | <div class="w-full overflow-x-auto"> | 45 | <div class="w-full overflow-x-auto"> |
46 | <a class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" href="{{ route('admin.add-position') }}">Создать позицию</a><br><br> | 46 | <a class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" href="{{ route('admin.add-position') }}">Создать позицию</a><br><br> |
47 | <table class="w-full whitespace-no-wrap"> | 47 | <table class="w-full whitespace-no-wrap"> |
48 | <thead> | 48 | <thead> |
49 | <tr | 49 | <tr |
50 | class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800" | 50 | class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800" |
51 | > | 51 | > |
52 | <th class="px-4 py-3">№</th> | 52 | <th class="px-4 py-3">№</th> |
53 | <th class="px-4 py-3">Позиция</th> | 53 | <th class="px-4 py-3">Позиция</th> |
54 | <th class="px-4 py-3">Дата создания</th> | 54 | <th class="px-4 py-3">Дата создания</th> |
55 | <th class="px-4 py-3">Изменить</th> | 55 | <th class="px-4 py-3">Изменить</th> |
56 | </tr> | 56 | </tr> |
57 | </thead> | 57 | </thead> |
58 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> | 58 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> |
59 | @foreach($Positions as $Pos) | 59 | @foreach($Positions as $Pos) |
60 | <tr class="text-gray-700 dark:text-gray-400"> | 60 | <tr class="text-gray-700 dark:text-gray-400"> |
61 | <td class="px-4 py-3 text-xs"> | 61 | <td class="px-4 py-3 text-xs"> |
62 | {{$Pos->id}} | 62 | {{$Pos->id}} |
63 | </td> | 63 | </td> |
64 | <td class="px-4 py-3 text-xs"> | 64 | <td class="px-4 py-3 text-xs"> |
65 | {{ $Pos->name }} | 65 | {{ $Pos->name }} |
66 | </td> | 66 | </td> |
67 | <td class="px-4 py-3 text-xs"> | 67 | <td class="px-4 py-3 text-xs"> |
68 | {{ date('d.m.Y h:i:s', strtotime($Pos->created_at)) }} | 68 | {{ date('d.m.Y h:i:s', strtotime($Pos->created_at)) }} |
69 | </td> | 69 | </td> |
70 | <td class="px-4 py-3 text-xs"> | 70 | <td class="px-4 py-3 text-xs"> |
71 | <a href="{{ route('admin.edit-position', ['position' => $Pos->id]) }}">Изменить</a> | | 71 | <a href="{{ route('admin.edit-position', ['position' => $Pos->id]) }}">Изменить</a> | |
72 | <a href="{{ route('admin.delete-position', ['position' => $Pos->id]) }}">Удалить</a> | 72 | <a href="{{ route('admin.delete-position', ['position' => $Pos->id]) }}">Удалить</a> |
73 | </td> | 73 | </td> |
74 | </tr> | 74 | </tr> |
75 | @endforeach | 75 | @endforeach |
76 | </tbody> | 76 | </tbody> |
77 | </table> | 77 | </table> |
78 | </div> | 78 | </div> |
79 | </div> | 79 | </div> |
80 | @endsection | 80 | @endsection |
81 | 81 |
resources/views/block_real.blade.php
1 | @php $colors = Array('#F4C4C2', '#FBF1C8', '#ECFDEF', '#F3ECF6', '#ECFDEF'); | 1 | @php $colors = Array('#F4C4C2', '#FBF1C8', '#ECFDEF', '#F3ECF6', '#ECFDEF'); |
2 | $i = 0; | 2 | $i = 0; |
3 | $k = 0; | 3 | $k = 0; |
4 | @endphp | 4 | @endphp |
5 | @if ($flot->count()) | 5 | @if ($flot->count()) |
6 | @foreach ($flot as $key => $cat) | 6 | @foreach ($flot as $key => $cat) |
7 | @if ($k == 0) | 7 | @if ($k == 0) |
8 | <div class="vacancies__list-label">{{ $position->name }}</div> | 8 | <div class="vacancies__list-label">{{ $position->name }}</div> |
9 | @endif | 9 | @endif |
10 | 10 | ||
11 | <a href="{{ route('list-vacancies', ['job' => $cat->job_title_id]) }}" class="vacancies__item"> | 11 | <a href="{{ route('list-vacancies', ['job' => $cat->job_title_id]) }}" class="vacancies__item"> |
12 | <span style="border-color:{{$colors[$i]}}"> | 12 | <span style="border-color:{{$colors[$i]}}"> |
13 | <b>{{ $cat->name }}</b> | 13 | <b>{{ $cat->name }}</b> |
14 | <i>Вакансий: <span>{{ $cat->cnt }}</span></i> | 14 | <i>Вакансий: <span>{{ $cat->cnt }}</span></i> |
15 | </span> | 15 | </span> |
16 | </a> | ||
16 | </a> | 17 | |
17 | 18 | @php | |
18 | @php | 19 | $i++; |
19 | $i++; | 20 | $k++; |
20 | $k++; | 21 | if ($i > 4) {$i = 0;} |
21 | if ($i > 4) {$i = 0;} | 22 | @endphp |
22 | @endphp | 23 | @endforeach |
23 | @endforeach | 24 | @else |
24 | @else | 25 | <div class="vacancies__list-label">{{ $position->name }}</div> |
25 | <div class="vacancies__list-label">{{ $position->name }}</div> | 26 | <a class="vacancies__item"> |
26 | <a class="vacancies__item"> | 27 | <span style="border-color:{{$colors[1]}}"> |
27 | <span style="border-color:{{$colors[1]}}"> | 28 | <b>Тут нет информации</b> |
28 | <b>Тут нет информации</b> | 29 | </span> |
29 | </span> | 30 | </a> |
30 | </a> | 31 | @endif |
31 | @endif | 32 |
resources/views/companies.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', '#sort_ajax', function() { | 6 | $(document).on('change', '#sort_ajax', function() { |
7 | var this_ = $(this); | 7 | var this_ = $(this); |
8 | var val_ = this_.val(); | 8 | var val_ = this_.val(); |
9 | console.log('sort items '+val_); | 9 | console.log('sort items '+val_); |
10 | 10 | ||
11 | $.ajax({ | 11 | $.ajax({ |
12 | type: "GET", | 12 | type: "GET", |
13 | url: "{{ route('shipping_companies') }}", | 13 | url: "{{ route('shipping_companies') }}", |
14 | data: "sort="+val_+"&block=1", | 14 | data: "sort="+val_+"&block=1", |
15 | success: function (data) { | 15 | success: function (data) { |
16 | console.log('Выбор сортировки'); | 16 | console.log('Выбор сортировки'); |
17 | console.log(data); | 17 | console.log(data); |
18 | $('#block_1').html(data); | 18 | $('#block_1').html(data); |
19 | }, | 19 | }, |
20 | headers: { | 20 | headers: { |
21 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 21 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
22 | }, | 22 | }, |
23 | error: function (data) { | 23 | error: function (data) { |
24 | data = JSON.stringify(data); | 24 | data = JSON.stringify(data); |
25 | console.log('Error: ' + data); | 25 | console.log('Error: ' + data); |
26 | } | 26 | } |
27 | }); | 27 | }); |
28 | 28 | ||
29 | $.ajax({ | 29 | $.ajax({ |
30 | type: "GET", | 30 | type: "GET", |
31 | url: "{{ route('shipping_companies') }}", | 31 | url: "{{ route('shipping_companies') }}", |
32 | data: "sort="+val_+"&block=2", | 32 | data: "sort="+val_+"&block=2", |
33 | success: function (data) { | 33 | success: function (data) { |
34 | console.log('Выбор сортировки2'); | 34 | console.log('Выбор сортировки2'); |
35 | console.log(data); | 35 | console.log(data); |
36 | history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); | 36 | history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); |
37 | $('#block_2').html(data); | 37 | $('#block_2').html(data); |
38 | }, | 38 | }, |
39 | headers: { | 39 | headers: { |
40 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 40 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
41 | }, | 41 | }, |
42 | error: function (data) { | 42 | error: function (data) { |
43 | data = JSON.stringify(data); | 43 | data = JSON.stringify(data); |
44 | console.log('Error: ' + data); | 44 | console.log('Error: ' + data); |
45 | } | 45 | } |
46 | }); | 46 | }); |
47 | }); | 47 | }); |
48 | 48 | ||
49 | $(document).ready(function(){ | 49 | $(document).ready(function(){ |
50 | var sel = $('#select2-sort_ajax-container'); | 50 | var sel = $('#select2-sort_ajax-container'); |
51 | var key = getUrlParameter('sort'); | 51 | var key = getUrlParameter('sort'); |
52 | 52 | ||
53 | if (key !=='') { | 53 | if (key !=='') { |
54 | console.log(key); | 54 | console.log(key); |
55 | switch (key) { | 55 | switch (key) { |
56 | case "default": sel.html('Сортировка (по умолчанию)'); break; | 56 | case "default": sel.html('Сортировка (по умолчанию)'); break; |
57 | case "name_up": sel.html('По имени (возрастание)'); break; | 57 | case "name_up": sel.html('По имени (возрастание)'); break; |
58 | case "name_down": sel.html('По дате (убывание)'); break; | 58 | case "name_down": sel.html('По дате (убывание)'); break; |
59 | case "created_at_up": sel.html('По дате (возрастание)'); break; | 59 | case "created_at_up": sel.html('По дате (возрастание)'); break; |
60 | case "created_at_down": sel.html('По дате (убывание)'); break; | 60 | case "created_at_down": sel.html('По дате (убывание)'); break; |
61 | } | 61 | } |
62 | 62 | ||
63 | } | 63 | } |
64 | }); | 64 | }); |
65 | </script> | 65 | </script> |
66 | @endsection | 66 | @endsection |
67 | 67 | ||
68 | @section('content') | 68 | @section('content') |
69 | <section class="thing"> | 69 | <section class="thing"> |
70 | <div class="container"> | 70 | <div class="container"> |
71 | <form class="thing__body"> | 71 | <form class="thing__body"> |
72 | @csrf | 72 | @csrf |
73 | <ul class="breadcrumbs thing__breadcrumbs"> | 73 | <ul class="breadcrumbs thing__breadcrumbs"> |
74 | <li><a href="{{ route('index') }}">Главная</a></li> | 74 | <li><a href="{{ route('index') }}">Главная</a></li> |
75 | <li><b>Работодатели</b></li> | 75 | <li><b>Работодатели</b></li> |
76 | </ul> | 76 | </ul> |
77 | <h1 class="thing__title">Работодатели</h1> | 77 | <h1 class="thing__title">Работодатели</h1> |
78 | <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для | 78 | <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для |
79 | существующих финансовых и административных условий.</p> | 79 | существующих финансовых и административных условий.</p> |
80 | <div class="search thing__search"> | 80 | <div class="search thing__search"> |
81 | <input type="search" id="search" name="search" class="input" value="{{ (isset($_GET['search'])) ? $_GET['search'] : '' }}" placeholder="Введите наименование работодателя"> | 81 | <input type="search" id="search" name="search" class="input" value="{{ (isset($_GET['search'])) ? $_GET['search'] : '' }}" placeholder="Введите наименование работодателя"> |
82 | <button type="submit" class="button">Найти</button> | 82 | <button type="submit" class="button">Найти</button> |
83 | <span> | 83 | <span> |
84 | <svg> | 84 | <svg> |
85 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> | 85 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> |
86 | </svg> | 86 | </svg> |
87 | </span> | 87 | </span> |
88 | </div> | 88 | </div> |
89 | </form> | 89 | </form> |
90 | </div> | 90 | </div> |
91 | </section> | 91 | </section> |
92 | <main class="main"> | 92 | <main class="main"> |
93 | <div class="container"> | 93 | <div class="container"> |
94 | <div class="main__employers"> | 94 | <div class="main__employers"> |
95 | <div class="filters"> | 95 | <div class="filters"> |
96 | <div class="filters__label">Показано {{ $emps->firstItem() }} – {{ $emps->lastItem() }} из {{ $count_emps }} результатов поиска</div> | 96 | <div class="filters__label">Показано {{ $emps->firstItem() }} – {{ $emps->lastItem() }} из {{ $count_emps }} результатов поиска</div> |
97 | <div class="filters__body"> | 97 | <div class="filters__body"> |
98 | <div class="select filters__select"> | 98 | <div class="select filters__select"> |
99 | <select class="js-select2" id="sort_ajax" name="sort_ajax"> | 99 | <select class="js-select2" id="sort_ajax" name="sort_ajax"> |
100 | <option value="default">Сортировка (по умолчанию)</option> | 100 | <option value="default">Сортировка (по умолчанию)</option> |
101 | <option value="name_up">По имени (возрастание)</option> | 101 | <option value="name_up">По имени (возрастание)</option> |
102 | <option value="name_down">По имени (убывание)</option> | 102 | <option value="name_down">По имени (убывание)</option> |
103 | <option value="created_at_up">По дате (возрастание)</option> | 103 | <option value="created_at_up">По дате (возрастание)</option> |
104 | <option value="created_at_down">По дате (убывание)</option> | 104 | <option value="created_at_down">По дате (убывание)</option> |
105 | </select> | 105 | </select> |
106 | </div> | 106 | </div> |
107 | <button type="button" class="filters__item active" data-tab="1"> | 107 | <button type="button" class="filters__item active" data-tab="1"> |
108 | <svg> | 108 | <svg> |
109 | <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use> | 109 | <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use> |
110 | </svg> | 110 | </svg> |
111 | </button> | 111 | </button> |
112 | <button type="button" class="filters__item" data-tab="2"> | 112 | <button type="button" class="filters__item" data-tab="2"> |
113 | <svg> | 113 | <svg> |
114 | <use xlink:href="{{ asset('images/sprite.svg#grid-2') }}"></use> | 114 | <use xlink:href="{{ asset('images/sprite.svg#grid-2') }}"></use> |
115 | </svg> | 115 | </svg> |
116 | </button> | 116 | </button> |
117 | </div> | 117 | </div> |
118 | </div> | 118 | </div> |
119 | <div class="main__employers-body showed" data-body="1" id="block_1" name="block_1"> | 119 | <div class="main__employers-body showed" data-body="1" id="block_1" name="block_1"> |
120 | <div class="main__employers-one"> | 120 | <div class="main__employers-one"> |
121 | @if ($emps->count()) | 121 | @if ($emps->count()) |
122 | @foreach($emps as $emp) | 122 | @foreach($emps as $emp) |
123 | <div class="main__employers-item"> | 123 | <div class="main__employers-item"> |
124 | <span class="main__employers-item-inner"> | 124 | <span class="main__employers-item-inner"> |
125 | @if (!empty($emp->logo)) | 125 | @if (!empty($emp->logo)) |
126 | <a href="{{ route('info_company', ['company' => $emp->id]) }}"> | 126 | <a href="{{ route('info_company', ['company' => $emp->id]) }}"> |
127 | <img src="{{ asset(Storage::url($emp->logo)) }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic"> | 127 | <img src="{{ asset(Storage::url($emp->logo)) }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic"> |
128 | </a> | 128 | </a> |
129 | @else | 129 | @else |
130 | <a href="{{ route('info_company', ['company' => $emp->id]) }}"> | 130 | <a href="{{ route('info_company', ['company' => $emp->id]) }}"> |
131 | <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic"> | 131 | <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic"> |
132 | </a> | 132 | </a> |
133 | @endif | 133 | @endif |
134 | <span class="main__employers-item-body"> | 134 | <span class="main__employers-item-body"> |
135 | <b>{{ $emp->name_company }}</b> | 135 | <b>{{ $emp->name_company }}</b> |
136 | <i>{{ $emp->ads->count() }} вакансия(ий)</i> | 136 | <i>{{ $emp->ads->count() }} вакансия(ий)</i> |
137 | </span> | 137 | </span> |
138 | </span> | 138 | </span> |
139 | <a href="{{ route('info_company', ['company' => $emp->id]) }}" class="button button_light main__employers-item-more">Подробнее</a> | 139 | <a href="{{ route('info_company', ['company' => $emp->id]) }}" class="button button_light main__employers-item-more">Подробнее</a> |
140 | 140 | ||
141 | @if ($emp->oficial_status == 1) | 141 | @if ($emp->oficial_status == 1) |
142 | <span class="main__employers-item-label"> | 142 | <span class="main__employers-item-label"> |
143 | <svg> | 143 | <svg> |
144 | <use xlink:href="images/sprite.svg#v"></use> | 144 | <use xlink:href="images/sprite.svg#v"></use> |
145 | </svg> | 145 | </svg> |
146 | <span>Компания одобрена сервисом rekamore.su</span> | 146 | <span>Компания одобрена сервисом rekamore.su</span> |
147 | </span> | 147 | </span> |
148 | @endif | 148 | @endif |
149 | </div> | 149 | </div> |
150 | @endforeach | 150 | @endforeach |
151 | </div> | 151 | </div> |
152 | 152 | ||
153 | {{ $emps->appends($_GET)->links('paginate') }} | 153 | {{ $emps->appends($_GET)->links('paginate') }} |
154 | |||
154 | 155 | @else | |
155 | @else | 156 | <H2>Нет данных</H2> |
156 | <H2>Нет данных</H2> | 157 | @endif |
158 | |||
157 | @endif | 159 | </div> |
158 | 160 | <div class="main__employers-body" data-body="2" id="block_2" name="block_2"> | |
159 | </div> | 161 | @if ($emps->count()) |
160 | <div class="main__employers-body" data-body="2" id="block_2" name="block_2"> | 162 | <div class="main__employers-two"> |
161 | @if ($emps->count()) | 163 | @foreach($emps as $emp) |
162 | <div class="main__employers-two"> | 164 | <div class="main__employers-item"> |
163 | @foreach($emps as $emp) | 165 | <span class="main__employers-item-inner"> |
164 | <div class="main__employers-item"> | 166 | @if (!empty($emp->logo)) |
165 | <span class="main__employers-item-inner"> | 167 | <img src="{{ asset(Storage::url($emp->logo)) }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic"> |
166 | @if (!empty($emp->logo)) | 168 | @else |
167 | <img src="{{ asset(Storage::url($emp->logo)) }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic"> | 169 | <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic"> |
168 | @else | 170 | @endif |
169 | <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic"> | 171 | <span class="main__employers-item-body"> |
170 | @endif | 172 | <b>{{ $emp->name_company }}</b> |
171 | <span class="main__employers-item-body"> | 173 | <i>{{ $emp->ads->count() }} вакансия(ий)</i> |
172 | <b>{{ $emp->name_company }}</b> | 174 | </span> |
173 | <i>{{ $emp->ads->count() }} вакансия(ий)</i> | 175 | </span> |
174 | </span> | 176 | <a href="{{ route('info_company', ['company' => $emp->id]) }}" class="button button_light main__employers-item-more">Подробнее</a> |
175 | </span> | 177 | @if ($emp->oficial_status == 1) |
176 | <a href="{{ route('info_company', ['company' => $emp->id]) }}" class="button button_light main__employers-item-more">Подробнее</a> | 178 | <span class="main__employers-item-label"> |
177 | @if ($emp->oficial_status == 1) | 179 | <svg> |
178 | <span class="main__employers-item-label"> | 180 | <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use> |
179 | <svg> | 181 | </svg> |
180 | <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use> | 182 | <span>Компания одобрена сервисом rekamore.su</span> |
181 | </svg> | 183 | </span> |
182 | <span>Компания одобрена сервисом rekamore.su</span> | 184 | @endif |
183 | </span> | 185 | </div> |
184 | @endif | 186 | @endforeach |
185 | </div> | 187 | </div> |
186 | @endforeach | 188 | {{ $emps->appends($_GET)->links('paginate') }} |
187 | </div> | 189 | @else |
188 | {{ $emps->appends($_GET)->links('paginate') }} | 190 | <H2>Нет данных</H2> |
189 | @else | 191 | @endif |
190 | <H2>Нет данных</H2> | 192 | </div> |
191 | @endif | 193 | </div> |
192 | </div> | 194 | </div> |
193 | </div> | 195 | </main> |
194 | </div> | 196 | @endsection |
195 | </main> | 197 |
resources/views/education.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', '#sort_ajax', function() { | 6 | $(document).on('change', '#sort_ajax', function() { |
7 | var this_ = $(this); | 7 | var this_ = $(this); |
8 | var val_ = this_.val(); | 8 | var val_ = this_.val(); |
9 | console.log('sort items '+val_); | 9 | console.log('sort items '+val_); |
10 | 10 | ||
11 | $.ajax({ | 11 | $.ajax({ |
12 | type: "GET", | 12 | type: "GET", |
13 | url: "{{ route('education') }}", | 13 | url: "{{ route('education') }}", |
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').html(data); | 18 | $('#block').html(data); |
19 | history.pushState({}, '', "{{ route('education') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); | 19 | history.pushState({}, '', "{{ route('education') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); |
20 | }, | 20 | }, |
21 | headers: { | 21 | headers: { |
22 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 22 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
23 | }, | 23 | }, |
24 | error: function (data) { | 24 | error: function (data) { |
25 | data = JSON.stringify(data); | 25 | data = JSON.stringify(data); |
26 | console.log('Error: ' + data); | 26 | console.log('Error: ' + data); |
27 | } | 27 | } |
28 | }); | 28 | }); |
29 | }); | 29 | }); |
30 | 30 | ||
31 | $(document).ready(function(){ | 31 | $(document).ready(function(){ |
32 | var sel = $('#select2-sort_ajax-container'); | 32 | var sel = $('#select2-sort_ajax-container'); |
33 | var key = getUrlParameter('sort'); | 33 | var key = getUrlParameter('sort'); |
34 | console.log(sel); | 34 | console.log(sel); |
35 | console.log(key); | 35 | console.log(key); |
36 | 36 | ||
37 | if (key !=='') { | 37 | if (key !=='') { |
38 | console.log(key); | 38 | console.log(key); |
39 | switch (key) { | 39 | switch (key) { |
40 | case "default": sel.html('Сортировка (по умолчанию)'); break; | 40 | case "default": sel.html('Сортировка (по умолчанию)'); break; |
41 | case "name_up": sel.html('По имени (возрастание)'); break; | 41 | case "name_up": sel.html('По имени (возрастание)'); break; |
42 | case "name_down": sel.html('По дате (убывание)'); break; | 42 | case "name_down": sel.html('По дате (убывание)'); break; |
43 | case "created_at_up": sel.html('По дате (возрастание)'); break; | 43 | case "created_at_up": sel.html('По дате (возрастание)'); break; |
44 | case "created_at_down": sel.html('По дате (убывание)'); break; | 44 | case "created_at_down": sel.html('По дате (убывание)'); break; |
45 | } | 45 | } |
46 | 46 | ||
47 | } | 47 | } |
48 | }); | 48 | }); |
49 | </script> | 49 | </script> |
50 | @endsection | 50 | @endsection |
51 | 51 | ||
52 | @section('content') | 52 | @section('content') |
53 | <section class="thing"> | 53 | <section class="thing"> |
54 | <div class="container"> | 54 | <div class="container"> |
55 | <form class="thing__body" active="{{ route('education') }}"> | 55 | <form class="thing__body" active="{{ route('education') }}"> |
56 | <ul class="breadcrumbs thing__breadcrumbs"> | 56 | <ul class="breadcrumbs thing__breadcrumbs"> |
57 | <li><a href="{{ route('index') }}">Главная</a></li> | 57 | <li><a href="{{ route('index') }}">Главная</a></li> |
58 | <li><b>Образование</b></li> | 58 | <li><b>Образование</b></li> |
59 | </ul> | 59 | </ul> |
60 | <h1 class="thing__title">Образование</h1> | 60 | <h1 class="thing__title">Образование</h1> |
61 | <p class="thing__text">Прежде всего, современная методология разработки представляет собой интересный эксперимент проверки направлений прогрессивного развития.</p> | 61 | <p class="thing__text">Прежде всего, современная методология разработки представляет собой интересный эксперимент проверки направлений прогрессивного развития.</p> |
62 | <div class="search thing__search"> | 62 | <div class="search thing__search"> |
63 | <input type="search" class="input" id="search" name="search" placeholder="Введите наименование работодателя" value="@if (!empty($_GET['search'])) {{ $_GET['search'] }} @endif"> | 63 | <input type="search" class="input" id="search" name="search" placeholder="Введите наименование работодателя" value="@if (!empty($_GET['search'])) {{ $_GET['search'] }} @endif"> |
64 | <button type="submit" class="button">Найти</button> | 64 | <button type="submit" class="button">Найти</button> |
65 | <span> | 65 | <span> |
66 | <svg> | 66 | <svg> |
67 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> | 67 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> |
68 | </svg> | 68 | </svg> |
69 | </span> | 69 | </span> |
70 | </div> | 70 | </div> |
71 | </form> | 71 | </form> |
72 | </div> | 72 | </div> |
73 | </section> | 73 | </section> |
74 | <main class="main"> | 74 | <main class="main"> |
75 | <div class="container"> | 75 | <div class="container"> |
76 | <div class="filters"> | 76 | <div class="filters"> |
77 | <div class="filters__label">Показано {{ $educations->firstItem() }} – {{ $educations->lastItem() }} из {{ $count_edu }} результатов поиска</div> | 77 | <div class="filters__label">Показано {{ $educations->firstItem() }} – {{ $educations->lastItem() }} из {{ $count_edu }} результатов поиска</div> |
78 | <div class="filters__body"> | 78 | <div class="filters__body"> |
79 | <div class="select filters__select"> | 79 | <div class="select filters__select"> |
80 | <select class="js-select2" id="sort_ajax" name="sort_ajax"> | 80 | <select class="js-select2" id="sort_ajax" name="sort_ajax"> |
81 | <option value="default">Сортировка (по умолчанию)</option> | 81 | <option value="default">Сортировка (по умолчанию)</option> |
82 | <option value="name_up">По имени (возрастание)</option> | 82 | <option value="name_up">По имени (возрастание)</option> |
83 | <option value="name_down">По имени (убывание)</option> | 83 | <option value="name_down">По имени (убывание)</option> |
84 | <option value="created_at_up">По дате (возрастание)</option> | 84 | <option value="created_at_up">По дате (возрастание)</option> |
85 | <option value="created_at_down">По дате (убывание)</option> | 85 | <option value="created_at_down">По дате (убывание)</option> |
86 | </select> | 86 | </select> |
87 | </div> | 87 | </div> |
88 | </div> | 88 | </div> |
89 | </div> | 89 | </div> |
90 | 90 | ||
91 | <div class="main__ads" id="block" name="block"> | ||
92 | @if ($educations->count()) | 91 | <div class="main__ads" id="block" name="block"> |
93 | @foreach($educations as $edu) | 92 | @if ($educations->count()) |
94 | <div class="main__ads-item"> | 93 | @foreach($educations as $edu) |
95 | <div class="main__ads-item-pic"> | 94 | <div class="main__ads-item"> |
96 | <img src="@if (!empty($edu->image)) {{ asset(Storage::url($edu->image)) }} @else {{ asset('images/education.jpg') }} @endif" alt="{{ $edu->name }}"> | 95 | <div class="main__ads-item-pic"> |
97 | <span> | 96 | <img src="@if (!empty($edu->image)) {{ asset(Storage::url($edu->image)) }} @else {{ asset('images/education.jpg') }} @endif" alt="{{ $edu->name }}"> |
98 | <svg> | 97 | <span> |
99 | <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use> | 98 | <svg> |
100 | </svg> | 99 | <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use> |
101 | </span> | 100 | </svg> |
102 | </div> | 101 | </span> |
103 | <div class="main__ads-item-body"> | 102 | </div> |
104 | <b>{{ $edu->name }}</b> | 103 | <div class="main__ads-item-body"> |
105 | <span>{{ $edu->program_education->count() }} учебных направлений</span> | 104 | <b>{{ $edu->name }}</b> |
106 | <a href="" class="button button_light">Читать далее</a> | 105 | <span>{{ $edu->program_education->count() }} учебных направлений</span> |
107 | </div> | 106 | <a href="" class="button button_light">Читать далее</a> |
108 | </div> | 107 | </div> |
109 | @endforeach | 108 | </div> |
110 | 109 | @endforeach | |
111 | {{ $educations->appends($_GET)->links('paginate') }} | 110 | |
112 | @else | 111 | {{ $educations->appends($_GET)->links('paginate') }} |
113 | <H2>Нет данных</H2> | 112 | @else |
114 | @endif | 113 | <H2>Нет данных</H2> |
115 | </div> | 114 | @endif |
116 | 115 | </div> | |
117 | <!--<div class="pagination"> | 116 | |
118 | <a href="#" class="pagination__nav pagination__nav_prev"> | 117 | <!--<div class="pagination"> |
119 | <svg> | 118 | <a href="#" class="pagination__nav pagination__nav_prev"> |
120 | <use xlink:href="images/sprite.svg#arrow-bold"></use> | 119 | <svg> |
121 | </svg> | 120 | <use xlink:href="images/sprite.svg#arrow-bold"></use> |
122 | </a> | 121 | </svg> |
123 | <span class="pagination__item active">1</span> | 122 | </a> |
124 | <a href="#" class="pagination__item">2</a> | 123 | <span class="pagination__item active">1</span> |
125 | <a href="#" class="pagination__item">3</a> | 124 | <a href="#" class="pagination__item">2</a> |
126 | <a href="#" class="pagination__item">4</a> | 125 | <a href="#" class="pagination__item">3</a> |
127 | <a href="#" class="pagination__item">5</a> | 126 | <a href="#" class="pagination__item">4</a> |
128 | <span class="pagination__dots"> | 127 | <a href="#" class="pagination__item">5</a> |
129 | <svg> | 128 | <span class="pagination__dots"> |
130 | <use xlink:href="images/sprite.svg#dots"></use> | 129 | <svg> |
131 | </svg> | 130 | <use xlink:href="images/sprite.svg#dots"></use> |
132 | </span> | 131 | </svg> |
133 | <a href="#" class="pagination__item">25</a> | 132 | </span> |
134 | <a href="#" class="pagination__nav pagination__nav_next"> | 133 | <a href="#" class="pagination__item">25</a> |
135 | <svg> | 134 | <a href="#" class="pagination__nav pagination__nav_next"> |
136 | <use xlink:href="images/sprite.svg#arrow-bold"></use> | 135 | <svg> |
137 | </svg> | 136 | <use xlink:href="images/sprite.svg#arrow-bold"></use> |
138 | </a> | 137 | </svg> |
139 | </div>--> | 138 | </a> |
140 | </div> | 139 | </div>--> |
141 | </main> | 140 | </div> |
142 | </div> | 141 | </main> |
143 | @endsection | 142 | </div> |
144 | 143 | @endsection |
resources/views/employers/add_ad_jobs.blade.php
File was created | 1 | @extends('layout.frontend', ['title' => 'Добавление вакансии РекаМоре']) | |
2 | |||
3 | @section('scripts') | ||
4 | <script> | ||
5 | console.log('Приближаемся к системе, нас рой тут...'); | ||
6 | $(document).on('change', '#position_id', function() { | ||
7 | var this_ = $(this); | ||
8 | var val_ = this_.val(); | ||
9 | var ajax_ = $('#job_title_id'); | ||
10 | |||
11 | console.log('Создания списка людей, которые поднимутся на корабль...'); | ||
12 | |||
13 | $.ajax({ | ||
14 | type: "GET", | ||
15 | url: "{{ route('employer.selected_people') }}", | ||
16 | data: "id="+val_, | ||
17 | success: function (data) { | ||
18 | console.log('Ответка пришла'); | ||
19 | console.log('Список избранных людей создан'); | ||
20 | ajax_.html(data); | ||
21 | }, | ||
22 | headers: { | ||
23 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | ||
24 | }, | ||
25 | error: function (data) { | ||
26 | console.log('Обрыв связи'); | ||
27 | console.log('Error: ' + data); | ||
28 | } | ||
29 | }); | ||
30 | }); | ||
31 | </script> | ||
32 | @endsection | ||
33 | @section('content') | ||
34 | <section class="cabinet"> | ||
35 | <div class="container"> | ||
36 | <ul class="breadcrumbs cabinet__breadcrumbs"> | ||
37 | <li><a href="{{ route('index') }}">Главная</a></li> | ||
38 | <li><b>Личный кабинет</b></li> | ||
39 | </ul> | ||
40 | <div class="cabinet__wrapper"> | ||
41 | <div class="cabinet__side"> | ||
42 | <div class="cabinet__side-toper"> | ||
43 | |||
44 | @include('employers.emblema') | ||
45 | |||
46 | </div> | ||
47 | |||
48 | @include('employers.menu', ['item' => 2]) | ||
49 | |||
50 | </div> | ||
51 | |||
52 | <form class="cabinet__body" action="{{ route('employer.add_job_in_vac_save') }}" method="POST"> | ||
53 | @csrf | ||
54 | <input type="hidden" name="ad_employer_id" value="{{ $ad_employer->id }}"/> | ||
55 | <div class="cabinet__body-item"> | ||
56 | <div class="cabinet__descr"> | ||
57 | <h2 class="title cabinet__title">Разместить должность в вакансии</h2> | ||
58 | <p class="cabinet__text"><b>Вакансия {{ $ad_employer->name }}</b></p> | ||
59 | </div> | ||
60 | </div> | ||
61 | |||
62 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
63 | <label class="form-group__label">Позиция на корабле</label> | ||
64 | <div class="form-group__item"> | ||
65 | <div class="select"> | ||
66 | <select class="js-select2" name="position_id" id="position_id"> | ||
67 | @foreach ($Positions as $it) | ||
68 | <option value="{{ $it->id }}">{{ $it->name }}</option> | ||
69 | @endforeach | ||
70 | </select> | ||
71 | @error('postion_id') | ||
72 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
73 | {{ $message }} | ||
74 | </span> | ||
75 | @enderror | ||
76 | </div> | ||
77 | </div> | ||
78 | </div> | ||
79 | |||
80 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
81 | <label class="form-group__label">Должность соискателя</label> | ||
82 | <div class="form-group__item"> | ||
83 | <div class="select"> | ||
84 | <select class="js-select2" name="job_title_id" id="job_title_id"> | ||
85 | @php $i = 1 @endphp | ||
86 | @if ($jobs->count()) | ||
87 | @foreach($jobs as $j) | ||
88 | @if ($i == 1) <option selected> Выберите должность из списка</option> | ||
89 | @else | ||
90 | <option value="{{ $j->id }}">{{ $j->name }}</option> | ||
91 | @endif | ||
92 | @php $i++ @endphp | ||
93 | @endforeach | ||
94 | @endif | ||
95 | </select> | ||
96 | @error('job_title_id') | ||
97 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
98 | {{ $message }} | ||
99 | </span> | ||
100 | @enderror | ||
101 | </div> | ||
102 | </div> | ||
103 | </div> | ||
104 | |||
105 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
106 | <label class="form-group__label">Категория (локация)</label> | ||
107 | <div class="form-group__item"> | ||
108 | <div class="select"> | ||
109 | <select class="js-select2" name="category_id" id="category_id"> | ||
110 | @php $i = 1 @endphp | ||
111 | @if ($categories->count()) | ||
112 | @foreach($categories as $j) | ||
113 | @if ($i == 1) <option selected> Выберите категорию из списка</option> | ||
114 | @else | ||
115 | <option value="{{ $j->id }}">{{ $j->name }}</option> | ||
116 | @endif | ||
117 | @php $i++ @endphp | ||
118 | @endforeach | ||
119 | @endif | ||
120 | </select> | ||
121 | @error('category_id') | ||
122 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
123 | {{ $message }} | ||
124 | </span> | ||
125 | @enderror | ||
126 | </div> | ||
127 | </div> | ||
128 | </div> | ||
129 | |||
130 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
131 | <label class="form-group__label">Минимальная зарплата</label> | ||
132 | <div class="form-group__item"> | ||
133 | <input type="text" class="input" name="min_salary" id="min_salary" value="{{ old('min_salary') ?? '' }}" placeholder="Минимальная зарплата"> | ||
134 | @error('min_salary') | ||
135 | <span class="text-xs text-red-600"> | ||
136 | {{ $message }} | ||
137 | </span> | ||
138 | @enderror | ||
139 | </div> | ||
140 | </div> | ||
141 | |||
142 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
143 | <label class="form-group__label">Максимальная зарплата</label> | ||
144 | <div class="form-group__item"> | ||
145 | <input type="text" class="input" name="max_salary" id="max_salary" value="{{ old('max_salary') ?? '' }}" placeholder="Максимальная зарплата"> | ||
146 | @error('salary') | ||
147 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
148 | {{ $message }} | ||
149 | </span> | ||
150 | @enderror | ||
151 | </div> | ||
152 | </div> | ||
153 | |||
154 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
155 | <label class="form-group__label">Регион отплытия</label> | ||
156 | <div class="form-group__item"> | ||
157 | <input type="text" class="input" name="region" id="region" value="{{ old('region') ?? $Employer->city ?? '' }}" placeholder="Севастополь"> | ||
158 | @error('region') | ||
159 | <span class="text-xs text-red-600"> | ||
160 | {{ $message }} | ||
161 | </span> | ||
162 | @enderror | ||
163 | </div> | ||
164 | </div> | ||
165 | |||
166 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
167 | <label class="form-group__label">Мощность</label> | ||
168 | <div class="form-group__item"> | ||
169 | <input type="text" class="input" name="power" id="power" value="{{ old('power') ?? '' }}" placeholder="POWER-45"> | ||
170 | @error('power') | ||
171 | <span class="text-xs text-red-600"> | ||
172 | {{ $message }} | ||
173 | </span> | ||
174 | @enderror | ||
175 | </div> | ||
176 | </div> | ||
177 | |||
178 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
179 | <label class="form-group__label">Суточные выплаты</label> | ||
180 | <div class="form-group__item"> | ||
181 | <input type="text" class="input" name="sytki" id="sytki" value="{{ old('sytki') ?? '' }}" placeholder="2000"> | ||
182 | @error('power') | ||
183 | <span class="text-xs text-red-600"> | ||
184 | {{ $message }} | ||
185 | </span> | ||
186 | @enderror | ||
187 | </div> | ||
188 | </div> | ||
189 | |||
190 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
191 | <label class="form-group__label">Начало отплытия</label> | ||
192 | <div class="form-group__item"> | ||
193 | <input type="text" class="input" name="start" id="start" value="{{ old('start') ?? '' }}" placeholder="20 сентября 2024"> | ||
194 | @error('power') | ||
195 | <span class="text-xs text-red-600"> | ||
196 | {{ $message }} | ||
197 | </span> | ||
198 | @enderror | ||
199 | </div> | ||
200 | </div> | ||
201 | |||
202 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
203 | <label class="form-group__label">Корабль для посадки</label> | ||
204 | <div class="form-group__item"> | ||
205 | <div class="select"> | ||
206 | <select class="js-select2" name="flot" id="flot"> | ||
207 | <option value="" selected> Не указан корабль</option> | ||
208 | @if ($Employer->flots->count()) | ||
209 | @foreach($Employer->flots as $j) | ||
210 | <option value="{{ $j->name }}">{{ $j->name }} ({{ $j->id }})</option> | ||
211 | @endforeach | ||
212 | @endif | ||
213 | </select> | ||
214 | @error('flot') | ||
215 | <span class="text-xs text-red-600"> | ||
216 | {{ $message }} | ||
217 | </span> | ||
218 | @enderror | ||
219 | </div> | ||
220 | </div> | ||
221 | </div> | ||
222 | |||
223 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
224 | <label class="form-group__label">Дополнительная информация</label> | ||
225 | <div class="form-group__item"> | ||
226 | <textarea class="textarea" name="description" id="description">{{ old('description') ?? '' }}</textarea> | ||
227 | @error('description') | ||
228 | <span class="text-xs text-red-600"> | ||
229 | {{ $message }} | ||
230 | </span> | ||
231 | @enderror | ||
232 | </div> | ||
233 | </div> | ||
234 | |||
235 | <button type="submit" class="button cabinet__submit">Опубликовать</button> | ||
236 | </form> | ||
237 | </div> | ||
238 | </div> | ||
239 | </section> | ||
240 | </div> | ||
241 | @endsection | ||
242 |
resources/views/employers/add_vacancy.blade.php
1 | @extends('layout.frontend', ['title' => 'Добавление вакансии РекаМоре']) | 1 | @extends('layout.frontend', ['title' => 'Добавление вакансии РекаМоре']) |
2 | 2 | ||
3 | @section('scripts') | 3 | @section('scripts') |
4 | <script> | ||
5 | console.log('Приближаемся к системе, нас рой тут...'); | ||
6 | $(document).on('change', '#position_id', function() { | ||
7 | var this_ = $(this); | ||
8 | var val_ = this_.val(); | ||
9 | var ajax_ = $('#job_title_id'); | ||
10 | |||
11 | console.log('Создания списка людей, которые поднимутся на корабль...'); | ||
12 | |||
13 | $.ajax({ | ||
14 | type: "GET", | ||
15 | url: "{{ route('employer.selected_people') }}", | ||
16 | data: "id="+val_, | ||
17 | success: function (data) { | ||
18 | console.log('Ответка пришла'); | ||
19 | console.log('Список избранных людей создан'); | ||
20 | ajax_.html(data); | ||
21 | }, | ||
22 | headers: { | ||
23 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | ||
24 | }, | ||
25 | error: function (data) { | ||
26 | console.log('Обрыв связи'); | ||
27 | console.log('Error: ' + data); | ||
28 | } | ||
29 | }); | ||
30 | }); | ||
31 | </script> | ||
4 | <script> | 32 | @endsection |
5 | console.log('Приближаемся к системе, нас рой тут...'); | 33 | @section('content') |
6 | $(document).on('change', '#position_id', function() { | 34 | <section class="cabinet"> |
7 | var this_ = $(this); | 35 | <div class="container"> |
8 | var val_ = this_.val(); | 36 | <ul class="breadcrumbs cabinet__breadcrumbs"> |
9 | var ajax_ = $('#job_title_id'); | 37 | <li><a href="{{ route('index') }}">Главная</a></li> |
10 | 38 | <li><b>Личный кабинет</b></li> | |
11 | console.log('Создания списка людей, которые поднимутся на корабль...'); | 39 | </ul> |
12 | 40 | <div class="cabinet__wrapper"> | |
13 | $.ajax({ | 41 | <div class="cabinet__side"> |
14 | type: "GET", | 42 | <div class="cabinet__side-toper"> |
15 | url: "{{ route('employer.selected_people') }}", | 43 | |
16 | data: "id="+val_, | 44 | @include('employers.emblema') |
17 | success: function (data) { | 45 | |
18 | console.log('Ответка пришла'); | 46 | </div> |
19 | console.log('Список избранных людей создан'); | 47 | |
20 | ajax_.html(data); | 48 | @include('employers.menu', ['item' => 2]) |
21 | }, | 49 | |
22 | headers: { | 50 | </div> |
23 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 51 | |
24 | }, | 52 | <form class="cabinet__body" action="{{ route('employer.vac_save') }}" method="POST"> |
25 | error: function (data) { | 53 | @csrf |
26 | console.log('Обрыв связи'); | 54 | <input type="hidden" name="employer_id" value="{{ $Employer[0]->id }}"/> |
27 | console.log('Error: ' + data); | 55 | <div class="cabinet__body-item"> |
28 | } | 56 | <div class="cabinet__descr"> |
29 | }); | 57 | <h2 class="title cabinet__title">Разместить вакансию</h2> |
30 | }); | 58 | <p class="cabinet__text"><b>Данные по вакансии</b></p> |
31 | </script> | 59 | <p class="cabinet__text">Все поля обязательны для заполнения *</p> |
32 | @endsection | 60 | </div> |
33 | @section('content') | 61 | </div> |
62 | |||
34 | <section class="cabinet"> | 63 | <div class="cabinet__body-item"> |
64 | <h4>Поля для вакансии</h4> | ||
35 | <div class="container"> | 65 | <div class="cabinet__inputs"> |
36 | <ul class="breadcrumbs cabinet__breadcrumbs"> | 66 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
37 | <li><a href="{{ route('index') }}">Главная</a></li> | 67 | <label class="form-group__label">Название вакансии</label> |
38 | <li><b>Личный кабинет</b></li> | 68 | <div class="form-group__item"> |
39 | </ul> | 69 | <input type="text" class="input" name="name" id="name" placeholder="Работа в море" value="{{ old('name') ?? $Employer[0]->name ?? '' }}" required> |
40 | <div class="cabinet__wrapper"> | 70 | @error('name') |
41 | <div class="cabinet__side"> | 71 | <span class="text-xs text-red-600 dark:text-red-400"> |
42 | <div class="cabinet__side-toper"> | 72 | {{ $message }} |
43 | 73 | </span> | |
44 | @include('employers.emblema') | 74 | @enderror |
45 | 75 | </div> | |
46 | </div> | 76 | </div> |
47 | |||
48 | @include('employers.menu', ['item' => 2]) | ||
49 | |||
50 | </div> | ||
51 | |||
52 | <form class="cabinet__body" action="{{ route('employer.vac_save') }}" method="POST"> | ||
53 | @csrf | ||
54 | <input type="hidden" name="employer_id" value="{{ $Employer[0]->id }}"/> | ||
55 | <div class="cabinet__body-item"> | ||
56 | <div class="cabinet__descr"> | ||
57 | <h2 class="title cabinet__title">Разместить вакансию</h2> | ||
58 | <p class="cabinet__text"><b>Данные по вакансии</b></p> | ||
59 | <p class="cabinet__text">Все поля обязательны для заполнения *</p> | ||
60 | </div> | ||
61 | </div> | ||
62 | <div class="cabinet__body-item"> | ||
63 | <div class="cabinet__inputs"> | ||
64 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
65 | <label class="form-group__label">Название вакансии</label> | ||
66 | <div class="form-group__item"> | ||
67 | <input type="text" class="input" name="name" id="name" placeholder="Работа в море" value="{{ old('name') ?? $Employer[0]->name ?? '' }}" required> | ||
68 | @error('name') | ||
69 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
70 | {{ $message }} | ||
71 | </span> | ||
72 | @enderror | ||
73 | </div> | ||
74 | </div> | ||
75 | |||
76 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
77 | <label class="form-group__label">Позиция на корабле</label> | ||
78 | <div class="form-group__item"> | ||
79 | <div class="select"> | ||
80 | <select class="js-select2" name="position_id" id="position_id"> | ||
81 | @foreach ($Positions as $it) | ||
82 | <option value="{{ $it->id }}">{{ $it->name }}</option> | ||
83 | @endforeach | ||
84 | </select> | ||
85 | @error('postion_id') | ||
86 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
87 | {{ $message }} | ||
88 | </span> | ||
89 | @enderror | ||
90 | </div> | ||
91 | </div> | ||
92 | </div> | ||
93 | |||
94 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
95 | <label class="form-group__label">Должность соискателя</label> | ||
96 | <div class="form-group__item"> | ||
97 | <div class="select"> | ||
98 | <select class="js-select2" name="job_title_id" id="job_title_id"> | ||
99 | @php $i = 1 @endphp | ||
100 | @if ($jobs->count()) | ||
101 | @foreach($jobs as $j) | ||
102 | @if ($i == 1) <option selected> Выберите должность из списка</option> | ||
103 | @else | ||
104 | <option value="{{ $j->id }}">{{ $j->name }}</option> | ||
105 | @endif | ||
106 | @php $i++ @endphp | ||
107 | @endforeach | ||
108 | @endif | ||
109 | </select> | ||
110 | @error('job_title_id') | ||
111 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
112 | {{ $message }} | ||
113 | </span> | ||
114 | @enderror | 77 | |
115 | </div> | 78 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
116 | </div> | 79 | <label class="form-group__label">Телефон</label> |
117 | </div> | 80 | <div class="form-group__item"> |
118 | 81 | <input type="text" class="input" name="telephone" id="telephone" value="{{ old('telephone') ?? $Employer[0]->telephone ?? '' }}" placeholder="Свой телефон"> | |
119 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 82 | @error('telephone') |
120 | <label class="form-group__label">Категория (локация)</label> | 83 | <span class="text-xs text-red-600 dark:text-red-400"> |
121 | <div class="form-group__item"> | 84 | {{ $message }} |
122 | <div class="select"> | 85 | </span> |
123 | <select class="js-select2" name="category_id" id="category_id"> | 86 | @enderror |
124 | @php $i = 1 @endphp | 87 | </div> |
125 | @if ($categories->count()) | 88 | </div> |
126 | @foreach($categories as $j) | 89 | |
127 | @if ($i == 1) <option selected> Выберите категорию из списка</option> | 90 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
128 | @else | 91 | <label class="form-group__label">Емайл</label> |
129 | <option value="{{ $j->id }}">{{ $j->name }}</option> | 92 | <div class="form-group__item"> |
130 | @endif | 93 | <input type="text" class="input" name="email" id="email" value="{{ old('email') ?? $Employer[0]->email ?? '' }}" placeholder="Своя почту"> |
131 | @php $i++ @endphp | 94 | @error('email') |
132 | @endforeach | 95 | <span class="text-xs text-red-600 dark:text-red-400"> |
133 | @endif | 96 | {{ $message }} |
134 | </select> | 97 | </span> |
135 | @error('category_id') | 98 | @enderror |
136 | <span class="text-xs text-red-600 dark:text-red-400"> | 99 | </div> |
137 | {{ $message }} | 100 | </div> |
138 | </span> | 101 | |
139 | @enderror | 102 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
140 | </div> | 103 | <label class="form-group__label">Зарплата среднестатистическая для вакансии</label> |
141 | </div> | 104 | <div class="form-group__item"> |
142 | </div> | 105 | <input type="text" class="input" name="salary" id="salary" value="{{ old('salary') ?? '' }}" placeholder="Среднестатистическая зарплата"> |
143 | 106 | @error('salary') | |
144 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 107 | <span class="text-xs text-red-600 dark:text-red-400"> |
145 | <label class="form-group__label">Телефон</label> | 108 | {{ $message }} |
146 | <div class="form-group__item"> | 109 | </span> |
147 | <input type="text" class="input" name="telephone" id="telephone" value="{{ old('telephone') ?? $Employer[0]->telephone ?? '' }}" placeholder="Свой телефон"> | 110 | @enderror |
148 | @error('telephone') | 111 | </div> |
149 | <span class="text-xs text-red-600 dark:text-red-400"> | 112 | </div> |
150 | {{ $message }} | 113 | |
151 | </span> | 114 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
152 | @enderror | 115 | <label class="form-group__label">Город посадки</label> |
153 | </div> | ||
154 | </div> | ||
155 | |||
156 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
157 | <label class="form-group__label">Емайл</label> | ||
158 | <div class="form-group__item"> | ||
159 | <input type="text" class="input" name="email" id="email" value="{{ old('email') ?? $Employer[0]->email ?? '' }}" placeholder="Своя почту"> | ||
160 | @error('email') | ||
161 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
162 | {{ $message }} | ||
163 | </span> | ||
164 | @enderror | ||
165 | </div> | ||
166 | </div> | ||
167 | |||
168 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
169 | <label class="form-group__label">Зарплата среднестатистическая</label> | ||
170 | <div class="form-group__item"> | ||
171 | <input type="text" class="input" name="salary" id="salary" value="{{ old('salary') ?? '' }}" placeholder="Среднестатистическая зарплата"> | ||
172 | @error('salary') | ||
173 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
174 | {{ $message }} | ||
175 | </span> | ||
176 | @enderror | ||
177 | </div> | 116 | <div class="form-group__item"> |
178 | </div> | 117 | <input type="text" class="input" name="city" id="city" value="{{ old('city') ?? $Employer[0]->city ?? '' }}" placeholder="Севастополь"> |
179 | 118 | @error('city') | |
180 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 119 | <span class="text-xs text-red-600"> |
181 | <label class="form-group__label">Минимальная зарплата</label> | 120 | {{ $message }} |
182 | <div class="form-group__item"> | 121 | </span> |
183 | <input type="text" class="input" name="min_salary" id="min_salary" value="{{ old('min_salary') ?? '' }}" placeholder="Минимальная зарплата"> | 122 | @enderror |
184 | @error('min_salary') | 123 | </div> |
185 | <span class="text-xs text-red-600"> | 124 | </div> |
186 | {{ $message }} | 125 | |
187 | </span> | 126 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
188 | @enderror | 127 | <label class="form-group__label">Категория (локация)</label> |
189 | </div> | ||
190 | </div> | ||
191 | |||
192 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
193 | <label class="form-group__label">Максимальная зарплата</label> | ||
194 | <div class="form-group__item"> | ||
195 | <input type="text" class="input" name="max_salary" id="max_salary" value="{{ old('max_salary') ?? '' }}" placeholder="Максимальная зарплата"> | ||
196 | @error('salary') | ||
197 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
198 | {{ $message }} | ||
199 | </span> | ||
200 | @enderror | ||
201 | </div> | ||
202 | </div> | ||
203 | |||
204 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
205 | <label class="form-group__label">Город-регион</label> | ||
206 | <div class="form-group__item"> | ||
207 | <input type="text" class="input" name="city" id="city" value="{{ old('city') ?? $Employer[0]->city ?? '' }}" placeholder="Севастополь"> | ||
208 | @error('city') | ||
209 | <span class="text-xs text-red-600"> | ||
210 | {{ $message }} | ||
211 | </span> | ||
212 | @enderror | ||
213 | </div> | ||
214 | </div> | ||
215 | |||
216 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
217 | <label class="form-group__label">Мощность</label> | ||
218 | <div class="form-group__item"> | ||
219 | <input type="text" class="input" name="power" id="power" value="{{ old('power') ?? '' }}" placeholder="POWER-45"> | ||
220 | @error('power') | ||
221 | <span class="text-xs text-red-600"> | ||
222 | {{ $message }} | ||
223 | </span> | ||
224 | @enderror | ||
225 | </div> | 128 | <div class="form-group__item"> |
226 | </div> | 129 | <div class="select"> |
227 | 130 | <select class="js-select2" name="category_id" id="category_id"> | |
228 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 131 | @php $i = 1 @endphp |
229 | <label class="form-group__label">Суточные выплаты</label> | 132 | @if ($categories->count()) |
230 | <div class="form-group__item"> | 133 | @foreach($categories as $j) |
231 | <input type="text" class="input" name="sytki" id="sytki" value="{{ old('sytki') ?? '' }}" placeholder="2000"> | 134 | @if ($i == 1) <option selected> Выберите категорию из списка</option> |
135 | @else | ||
136 | <option value="{{ $j->id }}">{{ $j->name }}</option> | ||
137 | @endif | ||
138 | @php $i++ @endphp | ||
232 | @error('power') | 139 | @endforeach |
233 | <span class="text-xs text-red-600"> | 140 | @endif |
234 | {{ $message }} | 141 | </select> |
235 | </span> | 142 | @error('category_id') |
236 | @enderror | 143 | <span class="text-xs text-red-600 dark:text-red-400"> |
237 | </div> | 144 | {{ $message }} |
238 | </div> | 145 | </span> |
239 | 146 | @enderror | |
240 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 147 | </div> |
241 | <label class="form-group__label">Начало отплытия</label> | 148 | </div> |
242 | <div class="form-group__item"> | 149 | </div> |
243 | <input type="text" class="input" name="start" id="start" value="{{ old('start') ?? '' }}" placeholder="20 сентября 2024"> | 150 | |
244 | @error('power') | 151 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
245 | <span class="text-xs text-red-600"> | 152 | <label class="form-group__label">Описание вакансии</label> |
246 | {{ $message }} | 153 | <div class="form-group__item"> |
247 | </span> | 154 | <textarea class="textarea" name="text" id="text">{{ $Employer[0]->text ?? '' }}</textarea> |
248 | @enderror | 155 | @error('text') |
249 | </div> | 156 | <span class="text-xs text-red-600"> |
250 | </div> | 157 | {{ $message }} |
251 | 158 | </span> | |
252 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 159 | @enderror |
253 | <label class="form-group__label">Корабль для посадки</label> | 160 | </div> |
254 | <div class="form-group__item"> | 161 | </div> |
255 | <div class="select"> | ||
256 | <select class="js-select2" name="flot" id="flot"> | ||
257 | <option value="" selected> Не указан корабль</option> | ||
258 | @if ($Employer[0]->flots->count()) | ||
259 | @foreach($Employer[0]->flots as $j) | ||
260 | <option value="{{ $j->name }}">{{ $j->name }} ({{ $j->id }})</option> | ||
261 | @endforeach | ||
262 | @endif | ||
263 | </select> | ||
264 | @error('flot') | ||
265 | <span class="text-xs text-red-600"> | ||
266 | {{ $message }} | ||
267 | </span> | 162 | </div> |
268 | @enderror | 163 | <button type="submit" class="button cabinet__submit">Опубликовать</button> |
269 | </div> | 164 | </div> |
270 | </div> | 165 | </form> |
271 | </div> | 166 | </div> |
resources/views/employers/ajax/list_vacancy.blade.php
1 | @if ($vacancy_list->count()) | 1 | @if ($vacancy_list->count()) |
2 | <!--<button type="button" class="table__button js-toggle js-parent-toggle button button_light button_more"> | 2 | <!--<button type="button" class="table__button js-toggle js-parent-toggle button button_light button_more"> |
3 | <span>Показать ещё</span> | 3 | <span>Показать ещё</span> |
4 | <span>Свернуть</span> | 4 | <span>Свернуть</span> |
5 | </button>--> | 5 | </button>--> |
6 | <div class="table__scroll"> | 6 | <div class="table__scroll"> |
7 | <div class="table__body table__body_min-width"> | 7 | <div class="table__body table__body_min-width"> |
8 | <table> | 8 | <table> |
9 | <thead> | 9 | <thead> |
10 | <tr> | 10 | <tr> |
11 | <th>Название</th> | 11 | <th>Название</th> |
12 | <th>Дата добавления<br>/ обновления</th> | 12 | <th>Дата добавления<br>/ обновления</th> |
13 | <th>Статус</th> | 13 | <th>Статус</th> |
14 | <th>Действия</th> | 14 | <th>Действия</th> |
15 | </tr> | 15 | </tr> |
16 | </thead> | 16 | </thead> |
17 | <tbody> | 17 | <tbody> |
18 | @foreach($vacancy_list as $it) | 18 | @foreach($vacancy_list as $it) |
19 | <tr> | 19 | <tr> |
20 | <td>{{ $it->name }}</td> | 20 | <td>{{ $it->name }}</td> |
21 | <td>{{ date('d.m.Y H:i:s', strtotime($it->created_at)) }} / {{ date('d.m.Y H:i:s', strtotime($it->updated_at)) }}</td> | 21 | <td>{{ date('d.m.Y H:i:s', strtotime($it->created_at)) }} / {{ date('d.m.Y H:i:s', strtotime($it->updated_at)) }}</td> |
22 | <td> | 22 | <td> |
23 | @if ($it->active_is) | 23 | @if ($it->active_is) |
24 | <span class="table__status green"><i></i>Опубликовано</span> | 24 | <span class="table__status green"><i></i>Опубликовано</span> |
25 | @else | 25 | @else |
26 | <span class="table__status"><i></i>Не опубликовано</span> | 26 | <span class="table__status"><i></i>Не опубликовано</span> |
27 | @endif | 27 | @endif |
28 | </td> | 28 | </td> |
29 | <td> | 29 | <td> |
30 | <span class="table__controls"> | 30 | <span class="table__controls"> |
31 | <a class="table__controls-item up-it" href="{{ route('employer.vacancy_up', ['ad_employer' => $it->id]) }}"> | 31 | <a class="table__controls-item up-it" href="{{ route('employer.vacancy_up', ['ad_employer' => $it->id]) }}"> |
32 | <svg> | 32 | <svg> |
33 | <use xlink:href="{{ asset('images/sprite.svg#arrow-radius') }}"></use> | 33 | <use xlink:href="{{ asset('images/sprite.svg#arrow-radius') }}"></use> |
34 | </svg> | 34 | </svg> |
35 | </a> | 35 | </a> |
36 | <a href="{{ route('employer.vacancy_edit', ['ad_employer' => $it->id]) }}" class="table__controls-item"> | 36 | <a href="{{ route('employer.vacancy_edit', ['ad_employer' => $it->id]) }}" class="table__controls-item"> |
37 | <svg> | 37 | <svg> |
38 | <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> | 38 | <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> |
39 | </svg> | 39 | </svg> |
40 | </a> | 40 | </a> |
41 | <a class="table__controls-item" href="{{ route('employer.vacancy_delete', ['ad_employer' => $it->id]) }}"> | 41 | <a class="table__controls-item" href="{{ route('employer.vacancy_delete', ['ad_employer' => $it->id]) }}"> |
42 | <svg> | 42 | <svg> |
43 | <use xlink:href="{{ asset('images/sprite.svg#cross') }}"></use> | 43 | <use xlink:href="{{ asset('images/sprite.svg#cross') }}"></use> |
44 | </svg> | 44 | </svg> |
45 | </a> | 45 | </a> |
46 | @if ($it->active_is) | 46 | @if ($it->active_is) |
47 | <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 0]) }}" class="table__controls-item"> | 47 | <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 0]) }}" class="table__controls-item"> |
48 | <svg> | 48 | <svg> |
49 | <use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use> | 49 | <use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use> |
50 | </svg> | 50 | </svg> |
51 | </a> | 51 | </a> |
52 | @else | 52 | @else |
53 | <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 1]) }}" class="table__controls-item"> | 53 | <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 1]) }}" class="table__controls-item"> |
54 | <svg> | 54 | <svg> |
55 | <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use> | 55 | <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use> |
56 | </svg> | 56 | </svg> |
57 | </a> | 57 | </a> |
58 | @endif | 58 | @endif |
59 | 59 | ||
60 | </span> | 60 | </span> |
61 | </td> | 61 | </td> |
62 | </tr> | 62 | </tr> |
63 | @endforeach | 63 | @endforeach |
64 | </tbody> | 64 | </tbody> |
65 | </table> | 65 | </table> |
66 | </div><br> | 66 | </div><br> |
67 | {{ $vacancy_list->appends($_GET)->links('paginate') }} | ||
67 | {{ $vacancy_list->appends($_GET)->links('paginate') }} | 68 | </div> |
68 | </div> | 69 | @else |
69 | @else | 70 | |
70 | 71 | <div class="notify"> | |
71 | <div class="notify"> | 72 | <svg> |
72 | <svg> | 73 | <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> |
73 | <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> | 74 | </svg> |
74 | </svg> | 75 | <span>Вы ещё не разместили ни одной вакансии</span> |
75 | <span>Вы ещё не разместили ни одной вакансии</span> | 76 | </div> |
76 | </div> | 77 | @endif |
77 | @endif | 78 |
resources/views/employers/edit_ad_jobs.blade.php
File was created | 1 | @extends('layout.frontend', ['title' => 'Добавление вакансии РекаМоре']) | |
2 | |||
3 | @section('scripts') | ||
4 | <script> | ||
5 | console.log('Приближаемся к системе, нас рой тут...'); | ||
6 | $(document).on('change', '#position_id', function() { | ||
7 | var this_ = $(this); | ||
8 | var val_ = this_.val(); | ||
9 | var ajax_ = $('#job_title_id'); | ||
10 | |||
11 | console.log('Создания списка людей, которые поднимутся на корабль...'); | ||
12 | |||
13 | $.ajax({ | ||
14 | type: "GET", | ||
15 | url: "{{ route('employer.selected_people') }}", | ||
16 | data: "id="+val_, | ||
17 | success: function (data) { | ||
18 | console.log('Ответка пришла'); | ||
19 | console.log('Список избранных людей создан'); | ||
20 | ajax_.html(data); | ||
21 | }, | ||
22 | headers: { | ||
23 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | ||
24 | }, | ||
25 | error: function (data) { | ||
26 | console.log('Обрыв связи'); | ||
27 | console.log('Error: ' + data); | ||
28 | } | ||
29 | }); | ||
30 | }); | ||
31 | </script> | ||
32 | @endsection | ||
33 | @section('content') | ||
34 | <section class="cabinet"> | ||
35 | <div class="container"> | ||
36 | <ul class="breadcrumbs cabinet__breadcrumbs"> | ||
37 | <li><a href="{{ route('index') }}">Главная</a></li> | ||
38 | <li><b>Личный кабинет</b></li> | ||
39 | </ul> | ||
40 | <div class="cabinet__wrapper"> | ||
41 | <div class="cabinet__side"> | ||
42 | <div class="cabinet__side-toper"> | ||
43 | |||
44 | @include('employers.emblema') | ||
45 | |||
46 | </div> | ||
47 | |||
48 | @include('employers.menu', ['item' => 2]) | ||
49 | |||
50 | </div> | ||
51 | |||
52 | <form class="cabinet__body" action="{{ route('employer.edit_job_in_vac_save', ['ad_job' => $ad_job->id]) }}" method="POST"> | ||
53 | @csrf | ||
54 | <input type="hidden" name="ad_employer_id" value="{{ $ad_employer->id }}"/> | ||
55 | <div class="cabinet__body-item"> | ||
56 | <div class="cabinet__descr"> | ||
57 | <h2 class="title cabinet__title">Редактировать должность в вакансии</h2> | ||
58 | <p class="cabinet__text"><b>Вакансия {{ $ad_employer->name }}</b></p> | ||
59 | </div> | ||
60 | </div> | ||
61 | |||
62 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
63 | <label class="form-group__label">Позиция на корабле</label> | ||
64 | <div class="form-group__item"> | ||
65 | <div class="select"> | ||
66 | <select class="js-select2" name="position_id" id="position_id"> | ||
67 | @foreach ($Positions as $it) | ||
68 | <option value="{{ $it->id }}">{{ $it->name }}</option> | ||
69 | @endforeach | ||
70 | </select> | ||
71 | @error('postion_id') | ||
72 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
73 | {{ $message }} | ||
74 | </span> | ||
75 | @enderror | ||
76 | </div> | ||
77 | </div> | ||
78 | </div> | ||
79 | |||
80 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
81 | <label class="form-group__label">Должность соискателя</label> | ||
82 | <div class="form-group__item"> | ||
83 | <div class="select"> | ||
84 | <select class="js-select2" name="job_title_id" id="job_title_id"> | ||
85 | @php $i = 1 @endphp | ||
86 | @if ($jobs->count()) | ||
87 | @foreach($jobs as $j) | ||
88 | @if ($i == 1) <option selected> Выберите должность из списка</option> | ||
89 | @else | ||
90 | <option value="{{ $j->id }}">{{ $j->name }}</option> | ||
91 | @endif | ||
92 | @php $i++ @endphp | ||
93 | @endforeach | ||
94 | @endif | ||
95 | </select> | ||
96 | @error('job_title_id') | ||
97 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
98 | {{ $message }} | ||
99 | </span> | ||
100 | @enderror | ||
101 | </div> | ||
102 | </div> | ||
103 | </div> | ||
104 | |||
105 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
106 | <label class="form-group__label">Минимальная зарплата</label> | ||
107 | <div class="form-group__item"> | ||
108 | <input type="text" class="input" name="min_salary" id="min_salary" value="{{ old('min_salary') ?? $ad_job->min_salary ?? '' }}" placeholder="Минимальная зарплата"> | ||
109 | @error('min_salary') | ||
110 | <span class="text-xs text-red-600"> | ||
111 | {{ $message }} | ||
112 | </span> | ||
113 | @enderror | ||
114 | </div> | ||
115 | </div> | ||
116 | |||
117 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
118 | <label class="form-group__label">Максимальная зарплата</label> | ||
119 | <div class="form-group__item"> | ||
120 | <input type="text" class="input" name="max_salary" id="max_salary" value="{{ old('max_salary') ?? $ad_job->max_salary ?? '' }}" placeholder="Максимальная зарплата"> | ||
121 | @error('salary') | ||
122 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
123 | {{ $message }} | ||
124 | </span> | ||
125 | @enderror | ||
126 | </div> | ||
127 | </div> | ||
128 | |||
129 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
130 | <label class="form-group__label">Регион отплытия</label> | ||
131 | <div class="form-group__item"> | ||
132 | <input type="text" class="input" name="region" id="region" value="{{ old('region') ?? $ad_job->region ?? '' }}" placeholder="Севастополь"> | ||
133 | @error('region') | ||
134 | <span class="text-xs text-red-600"> | ||
135 | {{ $message }} | ||
136 | </span> | ||
137 | @enderror | ||
138 | </div> | ||
139 | </div> | ||
140 | |||
141 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
142 | <label class="form-group__label">Мощность</label> | ||
143 | <div class="form-group__item"> | ||
144 | <input type="text" class="input" name="power" id="power" value="{{ old('power') ?? $ad_job->power ?? '' }}" placeholder="POWER-45"> | ||
145 | @error('power') | ||
146 | <span class="text-xs text-red-600"> | ||
147 | {{ $message }} | ||
148 | </span> | ||
149 | @enderror | ||
150 | </div> | ||
151 | </div> | ||
152 | |||
153 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
154 | <label class="form-group__label">Суточные выплаты</label> | ||
155 | <div class="form-group__item"> | ||
156 | <input type="text" class="input" name="sytki" id="sytki" value="{{ old('sytki') ?? $ad_job->sytki ??'' }}" placeholder="2000"> | ||
157 | @error('power') | ||
158 | <span class="text-xs text-red-600"> | ||
159 | {{ $message }} | ||
160 | </span> | ||
161 | @enderror | ||
162 | </div> | ||
163 | </div> | ||
164 | |||
165 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
166 | <label class="form-group__label">Начало отплытия</label> | ||
167 | <div class="form-group__item"> | ||
168 | <input type="text" class="input" name="start" id="start" value="{{ old('start') ?? $ad_job->start ??'' }}" placeholder="20 сентября 2024"> | ||
169 | @error('power') | ||
170 | <span class="text-xs text-red-600"> | ||
171 | {{ $message }} | ||
172 | </span> | ||
173 | @enderror | ||
174 | </div> | ||
175 | </div> | ||
176 | |||
177 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
178 | <label class="form-group__label">Корабль для посадки</label> | ||
179 | <div class="form-group__item"> | ||
180 | <div class="select"> | ||
181 | <select class="js-select2" name="flot" id="flot"> | ||
182 | <option value=""> Не указан корабль</option> | ||
183 | @if ($Employer->flots->count()) | ||
184 | @foreach($Employer->flots as $j) | ||
185 | <option value="{{ $j->name }}" @if ($ad_job->flot == $j->name) selected @endif>{{ $j->name }} ({{ $j->id }})</option> | ||
186 | @endforeach | ||
187 | @endif | ||
188 | </select> | ||
189 | @error('flot') | ||
190 | <span class="text-xs text-red-600"> | ||
191 | {{ $message }} | ||
192 | </span> | ||
193 | @enderror | ||
194 | </div> | ||
195 | </div> | ||
196 | </div> | ||
197 | |||
198 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
199 | <label class="form-group__label">Дополнительная информация</label> | ||
200 | <div class="form-group__item"> | ||
201 | <textarea class="textarea" name="description" id="description">{{ old('description') ??$ad_job->description ?? '' }}</textarea> | ||
202 | @error('description') | ||
203 | <span class="text-xs text-red-600"> | ||
204 | {{ $message }} | ||
205 | </span> | ||
206 | @enderror | ||
207 | </div> | ||
208 | </div> | ||
209 | |||
210 | <button type="submit" class="button cabinet__submit">Опубликовать</button> | ||
211 | </form> | ||
212 | </div> | ||
213 | </div> | ||
214 | </section> | ||
215 | </div> | ||
216 | @endsection | ||
217 |
resources/views/employers/edit_vacancy.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('Приближаемся к системе, нас рой тут...'); | ||
6 | $(document).on('change', '#position_id', function() { | ||
7 | var this_ = $(this); | ||
8 | var val_ = this_.val(); | ||
9 | var ajax_ = $('#job_title_id'); | ||
10 | |||
11 | console.log('Создания списка людей, которые поднимутся на корабль...'); | ||
12 | |||
13 | $.ajax({ | ||
14 | type: "GET", | ||
15 | url: "{{ route('employer.selected_people') }}", | ||
16 | data: "id="+val_, | ||
17 | success: function (data) { | ||
18 | console.log('Ответка пришла'); | ||
19 | console.log('Список избранных людей создан'); | ||
20 | ajax_.html(data); | ||
21 | }, | ||
22 | headers: { | ||
23 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | ||
24 | }, | ||
25 | error: function (data) { | ||
26 | console.log('Обрыв связи'); | ||
27 | console.log('Error: ' + data); | ||
28 | } | ||
29 | }); | ||
30 | }); | ||
31 | </script> | ||
5 | console.log('Приближаемся к системе, нас рой тут...'); | 32 | @endsection |
6 | $(document).on('change', '#position_id', function() { | 33 | @section('content') |
7 | var this_ = $(this); | 34 | <section class="cabinet"> |
8 | var val_ = this_.val(); | 35 | <div class="container"> |
9 | var ajax_ = $('#job_title_id'); | 36 | <ul class="breadcrumbs cabinet__breadcrumbs"> |
10 | 37 | <li><a href="{{ route('index') }}">Главная</a></li> | |
11 | console.log('Создания списка людей, которые поднимутся на корабль...'); | 38 | <li><b>Личный кабинет</b></li> |
12 | 39 | </ul> | |
13 | $.ajax({ | 40 | <div class="cabinet__wrapper"> |
14 | type: "GET", | 41 | <div class="cabinet__side"> |
15 | url: "{{ route('employer.selected_people') }}", | 42 | <div class="cabinet__side-toper"> |
16 | data: "id="+val_, | 43 | |
17 | success: function (data) { | 44 | @include('employers.emblema') |
18 | console.log('Ответка пришла'); | 45 | |
19 | console.log('Список избранных людей создан'); | 46 | </div> |
20 | ajax_.html(data); | 47 | |
21 | }, | 48 | @include('employers.menu', ['item' => 0]) |
22 | headers: { | 49 | |
23 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 50 | </div> |
24 | }, | 51 | |
25 | error: function (data) { | 52 | <form class="cabinet__body" action="{{ route('employer.vacancy_save_me', ['ad_employer' => $Employer->id]) }}" method="POST"> |
26 | console.log('Обрыв связи'); | 53 | @csrf |
27 | console.log('Error: ' + data); | 54 | <input type="hidden" name="employer_id" value="{{ $Employer->id }}"/> |
28 | } | 55 | <div class="cabinet__body-item"> |
29 | }); | 56 | <div class="cabinet__descr"> |
30 | }); | 57 | <h2 class="title cabinet__title">Редактировать вакансию</h2> |
31 | </script> | 58 | <p class="cabinet__text"><b>Данные по вакансии</b></p> |
32 | @endsection | 59 | <p class="cabinet__text">Все поля обязательны для заполнения *</p> |
33 | @section('content') | 60 | </div> |
34 | <section class="cabinet"> | 61 | </div> |
35 | <div class="container"> | 62 | <div class="cabinet__body-item"> |
36 | <ul class="breadcrumbs cabinet__breadcrumbs"> | 63 | <h4>Поля для вакансии</h4> |
37 | <li><a href="{{ route('index') }}">Главная</a></li> | 64 | <div class="cabinet__inputs"> |
38 | <li><b>Личный кабинет</b></li> | 65 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
39 | </ul> | 66 | <label class="form-group__label">Название вакансии</label> |
40 | <div class="cabinet__wrapper"> | 67 | <div class="form-group__item"> |
41 | <div class="cabinet__side"> | 68 | <input type="text" class="input" name="name" id="name" placeholder="Работа в море" value="{{ old('name') ?? $ad_employer->name ?? '' }}" required> |
42 | <div class="cabinet__side-toper"> | 69 | @error('name') |
70 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
43 | 71 | {{ $message }} | |
44 | @include('employers.emblema') | 72 | </span> |
45 | |||
46 | </div> | ||
47 | |||
48 | @include('employers.menu', ['item' => 0]) | ||
49 | |||
50 | </div> | ||
51 | |||
52 | <form class="cabinet__body" action="{{ route('employer.vacancy_save_me', ['ad_employer' => $ad_employer]) }}" method="POST"> | ||
53 | @csrf | ||
54 | <input type="hidden" name="employer_id" value="{{ $Employer->id }}"/> | ||
55 | <div class="cabinet__body-item"> | ||
56 | <div class="cabinet__descr"> | ||
57 | <h2 class="title cabinet__title">Редактировать вакансию</h2> | ||
58 | <p class="cabinet__text"><b>Данные по вакансии</b></p> | ||
59 | <p class="cabinet__text">Все поля обязательны для заполнения *</p> | ||
60 | </div> | ||
61 | </div> | ||
62 | <div class="cabinet__body-item"> | ||
63 | <div class="cabinet__inputs"> | ||
64 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
65 | <label class="form-group__label">Название вакансии</label> | ||
66 | <div class="form-group__item"> | 73 | <<<<<<< HEAD |
67 | <input type="text" class="input" name="name" id="name" placeholder="Работа в море" value="{{ old('name') ?? $ad_employer->name ?? '' }}" required> | 74 | @enderror |
68 | @error('name') | 75 | </div> |
69 | <span class="text-xs text-red-600"> | ||
70 | {{ $message }} | 76 | </div> |
71 | </span> | 77 | |
72 | @enderror | 78 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
73 | </div> | 79 | <label class="form-group__label">Позиция на корабле</label> |
74 | </div> | 80 | <div class="form-group__item"> |
75 | 81 | <div class="select"> | |
76 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
77 | <label class="form-group__label">Позиция на корабле</label> | ||
78 | <div class="form-group__item"> | ||
79 | <div class="select"> | ||
80 | <select class="js-select2" name="position_id" id="position_id"> | ||
81 | @foreach ($Positions as $it) | ||
82 | <option value="{{ $it->id }}">{{ $it->name }}</option> | ||
83 | @endforeach | ||
84 | </select> | ||
85 | @error('postion_id') | ||
86 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
87 | {{ $message }} | ||
88 | </span> | 82 | <select class="js-select2" name="position_id" id="position_id"> |
89 | @enderror | ||
90 | </div> | ||
91 | </div> | ||
92 | </div> | ||
93 | |||
94 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
95 | <label class="form-group__label">Должность соискателя</label> | ||
96 | <div class="form-group__item"> | ||
97 | <div class="select"> | ||
98 | <select class="js-select2" name="job_title_id" id="job_title_id"> | ||
99 | <option value="0"> Выберите должность из списка</option> | ||
100 | |||
101 | @if ($jobs->count()) | ||
102 | @foreach($jobs as $j) | ||
103 | <option value="{{ $j->id }}" @if ($j->id == $ad_employer->id) selected @endif>{{ $j->name }}</option> | ||
104 | @endforeach | ||
105 | @endif | ||
106 | </select> | ||
107 | @error('job_title_id') | ||
108 | <span class="text-xs text-red-600"> | ||
109 | {{ $message }} | ||
110 | </span> | ||
111 | @enderror | ||
112 | </div> | ||
113 | </div> | ||
114 | </div> | ||
115 | |||
116 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
117 | <label class="form-group__label">Категория (локация)</label> | ||
118 | <div class="form-group__item"> | ||
119 | <div class="select"> | ||
120 | <select class="js-select2" name="category_id" id="category_id"> | ||
121 | @php $i = 1 @endphp | ||
122 | @if ($categories->count()) | ||
123 | @foreach($categories as $j) | ||
124 | @if ($i == 1) <option selected> Выберите категорию из списка</option> | ||
125 | @else | ||
126 | <option value="{{ $j->id }}">{{ $j->name }}</option> | ||
127 | @endif | ||
128 | @php $i++ @endphp | ||
129 | @endforeach | ||
130 | @endif | ||
131 | </select> | ||
132 | @error('category_id') | ||
133 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
134 | {{ $message }} | ||
135 | </span> | ||
136 | @enderror | ||
137 | </div> | ||
138 | </div> | ||
139 | </div> | ||
140 | |||
141 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
142 | <label class="form-group__label">Телефон</label> | ||
143 | <div class="form-group__item"> | ||
144 | <input type="text" class="input" name="telephone" id="telephone" value="{{ old('telephone') ?? $Employer->telephone ?? '' }}" placeholder="Свой телефон"> | ||
145 | @error('telephone') | ||
146 | <span class="text-xs text-red-600"> | ||
147 | {{ $message }} | ||
148 | </span> | ||
149 | @enderror | ||
150 | </div> | 83 | @foreach ($Positions as $it) |
151 | </div> | 84 | <option value="{{ $it->id }}">{{ $it->name }}</option> |
152 | 85 | @endforeach | |
153 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 86 | </select> |
154 | <label class="form-group__label">Емайл</label> | ||
155 | <div class="form-group__item"> | ||
156 | <input type="text" class="input" name="email" id="email" value="{{ old('email') ?? $Employer->email ?? '' }}" placeholder="Своя почту"> | ||
157 | @error('email') | ||
158 | <span class="text-xs text-red-600"> | ||
159 | {{ $message }} | ||
160 | </span> | ||
161 | @enderror | ||
162 | </div> | ||
163 | </div> | ||
164 | |||
165 | <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 87 | @error('postion_id') |
166 | <label class="form-group__label">Зарплата среднестатистическая</label> | ||
167 | <div class="form-group__item"> | 88 | <span class="text-xs text-red-600 dark:text-red-400"> |
168 | <input type="text" class="input" name="salary" id="salary" value="old('salary') ?? '' }}" placeholder="Среднестатистическая зарплата"> | 89 | {{ $message }} |
169 | @error('salary') | 90 | </span> |
170 | <span class="text-xs text-red-600"> | 91 | @enderror |
171 | {{ $message }} | 92 | </div> |
172 | </span> | 93 | </div> |
173 | @enderror | 94 | </div> |
174 | </div> | 95 | |
175 | </div> | 96 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
176 | 97 | <label class="form-group__label">Должность соискателя</label> | |
98 | <div class="form-group__item"> | ||
177 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 99 | <div class="select"> |
178 | <label class="form-group__label">Минимальная зарплата</label> | ||
179 | <div class="form-group__item"> | 100 | <select class="js-select2" name="job_title_id" id="job_title_id"> |
180 | <input type="text" class="input" name="min_salary" id="min_salary" value=" old('min_salary') ?? '' }}" placeholder="Минимальная зарплата"> | 101 | <option value="0"> Выберите должность из списка</option> |
181 | @error('min_salary') | 102 | |
182 | <span class="text-xs text-red-600"> | 103 | @if ($jobs->count()) |
183 | {{ $message }} | 104 | @foreach($jobs as $j) |
184 | </span> | 105 | <option value="{{ $j->id }}" @if ($j->id == $ad_employer->id) selected @endif>{{ $j->name }}</option> |
185 | @enderror | 106 | @endforeach |
186 | </div> | 107 | @endif |
187 | </div> | 108 | </select> |
188 | 109 | @error('job_title_id') | |
110 | <span class="text-xs text-red-600"> | ||
189 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 111 | {{ $message }} |
190 | <label class="form-group__label">Максимальная зарплата</label> | ||
191 | <div class="form-group__item"> | 112 | </span> |
192 | <input type="text" class="input" name="max_salary" id="max_salary" value=" old('max_salary') ?? '' }}" placeholder="Максимальная зарплата"> | 113 | ======= |
193 | @error('salary') | 114 | >>>>>>> 9f5b1d0112e53e85197df30673ccf1f2f4923df1 |
194 | <span class="text-xs text-red-600 dark:text-red-400"> | 115 | @enderror |
195 | {{ $message }} | 116 | </div> |
196 | </span> | 117 | </div> |
197 | @enderror | 118 | |
198 | </div> | 119 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
199 | </div> | 120 | <label class="form-group__label">Телефон</label> |
200 | 121 | <div class="form-group__item"> | |
122 | <input type="text" class="input" name="telephone" id="telephone" value="{{ old('telephone') ?? $ad_employer->telephone ?? '' }}" placeholder="Свой телефон"> | ||
201 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 123 | @error('telephone') |
202 | <label class="form-group__label">Город-регион</label> | ||
203 | <div class="form-group__item"> | 124 | <span class="text-xs text-red-600 dark:text-red-400"> |
204 | <input type="text" class="input" name="city" id="city" value=" old('city') ?? $Employer[0]->city ?? '' }}" placeholder="Севастополь"> | 125 | {{ $message }} |
205 | @error('city') | 126 | </span> |
206 | <span class="text-xs text-red-600"> | 127 | @enderror |
207 | {{ $message }} | 128 | </div> |
208 | </span> | 129 | </div> |
209 | @enderror | 130 | |
210 | </div> | 131 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
211 | </div> | 132 | <label class="form-group__label">Емайл</label> |
212 | 133 | <div class="form-group__item"> | |
213 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 134 | <input type="text" class="input" name="email" id="email" value="{{ old('email') ?? $ad_employer->email ?? '' }}" placeholder="Своя почту"> |
214 | <label class="form-group__label">Мощность</label> | 135 | @error('email') |
215 | <div class="form-group__item"> | 136 | <span class="text-xs text-red-600 dark:text-red-400"> |
216 | <input type="text" class="input" name="power" id="power" value=" old('power') ?? '' }}" placeholder="POWER-45"> | 137 | {{ $message }} |
217 | @error('power') | 138 | </span> |
139 | @enderror | ||
140 | </div> | ||
141 | </div> | ||
142 | |||
218 | <span class="text-xs text-red-600"> | 143 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
219 | {{ $message }} | 144 | <label class="form-group__label">Зарплата среднестатистическая для вакансии</label> |
220 | </span> | 145 | <div class="form-group__item"> |
146 | <input type="text" class="input" name="salary" id="salary" value="{{ old('salary') ?? $ad_employer->salary ??'' }}" placeholder="Среднестатистическая зарплата"> | ||
221 | @enderror | 147 | @error('salary') |
222 | </div> | 148 | <span class="text-xs text-red-600 dark:text-red-400"> |
223 | </div> | ||
224 | 149 | {{ $message }} | |
225 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 150 | </span> |
226 | <label class="form-group__label">Суточные выплаты</label> | 151 | @enderror |
227 | <div class="form-group__item"> | 152 | </div> |
228 | <input type="text" class="input" name="sytki" id="sytki" value=" old('sytki') ?? '' }}" placeholder="2000"> | 153 | </div> |
229 | @error('power') | 154 | |
230 | <span class="text-xs text-red-600"> | 155 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
156 | <label class="form-group__label">Город посадки</label> | ||
231 | {{ $message }} | 157 | <div class="form-group__item"> |
232 | </span> | 158 | <input type="text" class="input" name="city" id="city" value="{{ old('city') ?? $ad_employer->city ?? '' }}" placeholder="Севастополь"> |
233 | @enderror | 159 | @error('city') |
160 | <span class="text-xs text-red-600"> | ||
234 | </div> | 161 | {{ $message }} |
235 | </div> | 162 | </span> |
236 | 163 | @enderror | |
237 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
238 | <label class="form-group__label">Начало отплытия</label> | ||
239 | <div class="form-group__item"> | ||
240 | <input type="text" class="input" name="start" id="start" value=" old('start') ?? $Employer->ads->start ?? '' }}" placeholder="20 сентября 2024"> | ||
241 | @error('power') | ||
242 | <span class="text-xs text-red-600"> | ||
243 | {{ $message }} | ||
244 | </span> | ||
245 | @enderror | ||
246 | </div> | ||
247 | </div>--> | ||
248 | |||
249 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 164 | </div> |
250 | <label class="form-group__label">Корабль для посадки</label> | 165 | </div> |
251 | <div class="form-group__item"> | 166 | |
252 | <div class="select"> | 167 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
253 | <select class="js-select2" name="flot" id="flot"> | 168 | <label class="form-group__label">Категория (локация)</label> |
254 | 169 | <div class="form-group__item"> | |
255 | @if ($Employer->flots->count()) | 170 | <div class="select"> |
256 | @foreach($Employer->flots as $j) | 171 | <select class="js-select2" name="category_id" id="category_id"> |
257 | <option value="{{ $j->name }}">{{ $j->name }} ({{ $j->id }})</option> | 172 | @php $i = 1 @endphp |
258 | @endforeach | 173 | @if ($categories->count()) |
259 | @endif | 174 | @foreach($categories as $j) |
260 | </select> | 175 | @if ($i == 1) <option> Выберите категорию из списка</option> |
261 | @error('flot') | 176 | @else |
262 | <span class="text-xs text-red-600"> | 177 | <option value="{{ $j->id }}" @if ($ad_employer->category_id == $j->id) selected @endif>{{ $j->name }}</option> |
263 | {{ $message }} | 178 | @endif |
264 | </span> | 179 | @php $i++ @endphp |
265 | @enderror | 180 | @endforeach |
resources/views/employers/list_vacancy.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', '#sort_ajax', function() { | 6 | $(document).on('change', '#sort_ajax', function() { |
7 | var this_ = $(this); | 7 | var this_ = $(this); |
8 | var val_ = this_.val(); | 8 | var val_ = this_.val(); |
9 | console.log('sort items '+val_); | 9 | console.log('sort items '+val_); |
10 | 10 | ||
11 | $.ajax({ | 11 | $.ajax({ |
12 | type: "GET", | 12 | type: "GET", |
13 | url: "{{ route('employer.vacancy_list') }}", | 13 | url: "{{ route('employer.vacancy_list') }}", |
14 | data: "sort="+val_, | 14 | data: "sort="+val_, |
15 | success: function (data) { | 15 | success: function (data) { |
16 | console.log('Выбор сортировки'); | 16 | console.log('Выбор сортировки'); |
17 | console.log(data); | 17 | console.log(data); |
18 | history.pushState({}, '', "{{ route('employer.vacancy_list') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); | 18 | history.pushState({}, '', "{{ route('employer.vacancy_list') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); |
19 | $('#main_ockar').html(data); | 19 | $('#main_ockar').html(data); |
20 | }, | 20 | }, |
21 | headers: { | 21 | headers: { |
22 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 22 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
23 | }, | 23 | }, |
24 | error: function (data) { | 24 | error: function (data) { |
25 | data = JSON.stringify(data); | 25 | data = JSON.stringify(data); |
26 | console.log('Error: ' + data); | 26 | console.log('Error: ' + data); |
27 | } | 27 | } |
28 | }); | 28 | }); |
29 | }); | 29 | }); |
30 | </script> | 30 | </script> |
31 | @endsection | 31 | @endsection |
32 | 32 | ||
33 | @section('content') | 33 | @section('content') |
34 | <section class="cabinet"> | 34 | <section class="cabinet"> |
35 | <div class="container"> | 35 | <div class="container"> |
36 | <ul class="breadcrumbs cabinet__breadcrumbs"> | 36 | <ul class="breadcrumbs cabinet__breadcrumbs"> |
37 | <li><a href="{{ route('index') }}">Главная</a></li> | 37 | <li><a href="{{ route('index') }}">Главная</a></li> |
38 | <li><b>Личный кабинет</b></li> | 38 | <li><b>Личный кабинет</b></li> |
39 | </ul> | 39 | </ul> |
40 | <div class="cabinet__wrapper"> | 40 | <div class="cabinet__wrapper"> |
41 | <div class="cabinet__side"> | 41 | <div class="cabinet__side"> |
42 | <div class="cabinet__side-toper"> | 42 | <div class="cabinet__side-toper"> |
43 | 43 | ||
44 | @include('employers.emblema') | 44 | @include('employers.emblema') |
45 | 45 | ||
46 | </div> | 46 | </div> |
47 | 47 | ||
48 | @include('employers.menu', ['item' => 3]) | 48 | @include('employers.menu', ['item' => 3]) |
49 | </div> | 49 | </div> |
50 | <div class="cabinet__body"> | 50 | <div class="cabinet__body"> |
51 | <div class="cabinet__body-item"> | 51 | <div class="cabinet__body-item"> |
52 | <h2 class="title cabinet__title">Мои вакансии</h2> | 52 | <h2 class="title cabinet__title">Мои вакансии</h2> |
53 | </div> | 53 | </div> |
54 | <div class="cabinet__body-item"> | 54 | <div class="cabinet__body-item"> |
55 | <div class="cabinet__filters"> | 55 | <div class="cabinet__filters"> |
56 | <div class="cabinet__filters-item"> | 56 | <div class="cabinet__filters-item"> |
57 | <form class="search"> | 57 | <form class="search"> |
58 | <input type="search" class="input" placeholder="Поиск…" required> | 58 | <input type="search" class="input" placeholder="Поиск…" required> |
59 | <button type="submit" class="button">Найти</button> | 59 | <button type="submit" class="button">Найти</button> |
60 | <span> | 60 | <span> |
61 | <svg> | 61 | <svg> |
62 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> | 62 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> |
63 | </svg> | 63 | </svg> |
64 | </span> | 64 | </span> |
65 | </form> | 65 | </form> |
66 | </div> | 66 | </div> |
67 | <div class="cabinet__filters-item"> | 67 | <div class="cabinet__filters-item"> |
68 | <div class="select"> | 68 | <div class="select"> |
69 | <select class="js-select2" id="sort_ajax" name="sort_ajax"> | 69 | <select class="js-select2" id="sort_ajax" name="sort_ajax"> |
70 | <option value="default">Сортировка (по умолчанию)</option> | 70 | <option value="default">Сортировка (по умолчанию)</option> |
71 | <option value="name_up">По имени (возрастание)</option> | 71 | <option value="name_up">По имени (возрастание)</option> |
72 | <option value="name_down">По имени (убывание)</option> | 72 | <option value="name_down">По имени (убывание)</option> |
73 | <option value="created_at_up">По дате (возрастание)</option> | 73 | <option value="created_at_up">По дате (возрастание)</option> |
74 | <option value="created_at_down">По дате (убывание)</option> | 74 | <option value="created_at_down">По дате (убывание)</option> |
75 | </select> | 75 | </select> |
76 | </div> | 76 | </div> |
77 | </div> | 77 | </div> |
78 | </div> | 78 | </div> |
79 | 79 | ||
80 | <div class="table table_spoiler" id="main_ockar" name="main_oskar"> | 80 | <div class="table table_spoiler" id="main_ockar" name="main_oskar"> |
81 | @if ($vacancy_list->count()) | 81 | @if ($vacancy_list->count()) |
82 | <!--<button type="button" class="table__button js-toggle js-parent-toggle button button_light button_more"> | ||
83 | <span>Показать ещё</span> | ||
84 | <span>Свернуть</span> | ||
85 | </button>--> | ||
86 | <div class="table__scroll"> | 82 | <div class="table__scroll"> |
87 | <div class="table__body table__body_min-width"> | 83 | <div class="table__body table__body_min-width"> |
88 | <table> | 84 | <table> |
89 | <thead> | 85 | <thead> |
90 | <tr> | 86 | <tr> |
87 | <th>№</th> | ||
91 | <th>Название</th> | 88 | <th>Название</th> |
92 | <th>Дата добавления<br>/ обновления</th> | 89 | <th>Дата добавления<br>/ обновления</th> |
90 | <th>Должности</th> | ||
93 | <th>Статус</th> | 91 | <th>Статус</th> |
94 | <th>Действия</th> | 92 | <th>Действия</th> |
95 | </tr> | 93 | </tr> |
96 | </thead> | 94 | </thead> |
97 | <tbody> | 95 | <tbody> |
98 | @foreach($vacancy_list as $it) | 96 | @foreach($vacancy_list as $it) |
99 | <tr> | 97 | <tr> |
98 | <td>{{ $it->id }}</td> | ||
100 | <td>{{ $it->name }}</td> | 99 | <td>{{ $it->name }}</td> |
101 | <td>{{ date('d.m.Y H:i:s', strtotime($it->created_at)) }} / {{ date('d.m.Y H:i:s', strtotime($it->updated_at)) }}</td> | 100 | <td>{{ date('d.m.Y H:i:s', strtotime($it->created_at)) }} <br>/ {{ date('d.m.Y H:i:s', strtotime($it->updated_at)) }}</td> |
101 | <td> <a href="{{ route('employer.add_job_in_vac', ['ad_employer' => $it->id]) }}" class="button">Добавить</a> | ||
102 | @if ($it->jobs->count()) | ||
103 | |||
104 | @foreach ($it->jobs as $key => $it_um) | ||
105 | <p><a href="{{ route('employer.edit_job_in_vac', ['ad_job' => $it_um->id, 'ad_employer' => $it->id]) }}" style="text-decoration: underline">{{$it_um->name}}</a> | ||
106 | @if (isset($it->jobs_code[$key])) | ||
107 | <a href="{{ route('employer.delete_job_in_vac', ['ad_job' => $it->jobs_code[$key]->id]) }}" style="text-decoration: underline">(Del)</a> | ||
108 | @endif | ||
109 | </p> | ||
110 | @endforeach | ||
111 | @else | ||
112 | Нет связанных <br> с вакансией должностей | ||
113 | @endif | ||
114 | </td> | ||
102 | <td> | 115 | <td> |
103 | @if ($it->active_is) | 116 | @if ($it->active_is) |
104 | <span class="table__status green"><i></i>Опубликовано</span> | 117 | <span class="table__status green"><i></i>Опубликовано</span> |
105 | @else | 118 | @else |
106 | <span class="table__status"><i></i>Не опубликовано</span> | 119 | <span class="table__status"><i></i>Не опубликовано</span> |
107 | @endif | 120 | @endif |
108 | </td> | 121 | </td> |
109 | <td> | 122 | <td> |
110 | <span class="table__controls"> | 123 | <span class="table__controls"> |
111 | <a class="table__controls-item up-it" href="{{ route('employer.vacancy_up', ['ad_employer' => $it->id]) }}"> | 124 | <a class="table__controls-item up-it" href="{{ route('employer.vacancy_up', ['ad_employer' => $it->id]) }}"> |
112 | <svg> | 125 | <svg> |
113 | <use xlink:href="{{ asset('images/sprite.svg#arrow-radius') }}"></use> | 126 | <use xlink:href="{{ asset('images/sprite.svg#arrow-radius') }}"></use> |
114 | </svg> | 127 | </svg> |
115 | </a> | 128 | </a> |
116 | <a href="{{ route('employer.vacancy_edit', ['ad_employer' => $it->id]) }}" class="table__controls-item"> | 129 | <a href="{{ route('employer.vacancy_edit', ['ad_employer' => $it->id]) }}" class="table__controls-item"> |
117 | <svg> | 130 | <svg> |
118 | <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> | 131 | <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> |
119 | </svg> | 132 | </svg> |
120 | </a> | 133 | </a> |
121 | <a class="table__controls-item" href="{{ route('employer.vacancy_delete', ['ad_employer' => $it->id]) }}"> | 134 | <a class="table__controls-item" href="{{ route('employer.vacancy_delete', ['ad_employer' => $it->id]) }}"> |
122 | <svg> | 135 | <svg> |
123 | <use xlink:href="{{ asset('images/sprite.svg#cross') }}"></use> | 136 | <use xlink:href="{{ asset('images/sprite.svg#cross') }}"></use> |
124 | </svg> | 137 | </svg> |
125 | </a> | 138 | </a> |
126 | @if ($it->active_is) | 139 | @if ($it->active_is) |
127 | <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 0]) }}" class="table__controls-item"> | 140 | <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 0]) }}" class="table__controls-item"> |
128 | <svg> | 141 | <svg> |
129 | <use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use> | 142 | <use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use> |
130 | </svg> | 143 | </svg> |
131 | </a> | 144 | </a> |
132 | @else | 145 | @else |
133 | <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 1]) }}" class="table__controls-item"> | 146 | <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 1]) }}" class="table__controls-item"> |
134 | <svg> | 147 | <svg> |
135 | <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use> | 148 | <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use> |
136 | </svg> | 149 | </svg> |
137 | </a> | 150 | </a> |
138 | @endif | 151 | @endif |
139 | 152 | ||
140 | <!--<button type="button" class="table__controls-item"> | 153 | <!--<button type="button" class="table__controls-item"> |
141 | <svg> | 154 | <svg> |
142 | <use xlink:href=" asset('images/sprite.svg#tg') }}"></use> | 155 | <use xlink:href=" asset('images/sprite.svg#tg') }}"></use> |
143 | </svg> | 156 | </svg> |
144 | </button> | 157 | </button> |
145 | --> | 158 | --> |
146 | </span> | 159 | </span> |
147 | </td> | 160 | </td> |
148 | </tr> | 161 | </tr> |
149 | @endforeach | 162 | @endforeach |
150 | </tbody> | 163 | </tbody> |
151 | </table> | 164 | </table> |
152 | </div><br> | 165 | </div><br> |
166 | {{ $vacancy_list->appends($_GET)->links('paginate') }} | ||
153 | {{ $vacancy_list->appends($_GET)->links('paginate') }} | 167 | </div> |
168 | |||
169 | |||
154 | </div> | 170 | @else |
155 | 171 | ||
156 | 172 | <div class="notify"> | |
157 | @else | 173 | <svg> |
158 | 174 | <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> | |
159 | <div class="notify"> | 175 | </svg> |
160 | <svg> | 176 | <span>Вы ещё не разместили ни одной вакансии</span> |
161 | <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> | 177 | </div> |
162 | </svg> | 178 | @endif |
163 | <span>Вы ещё не разместили ни одной вакансии</span> | 179 | </div> |
164 | </div> | 180 | </div> |
165 | @endif | 181 | </div> |
166 | </div> | 182 | </div> |
167 | </div> | 183 | </div> |
resources/views/favorite_people.blade.php
File was created | 1 | @foreach ($favorite_people as $it) | |
2 | <option value="{{ $it->id }}">{{ $it->name }}</option> | ||
3 | @endforeach | ||
1 | @foreach ($favorite_people as $it) | 4 |
resources/views/index.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="work"> | 8 | <section class="work"> |
9 | <div class="container"> | 9 | <div class="container"> |
10 | <img src="{{ asset('images/1.png') }}" alt="" class="work__pic"> | 10 | <img src="{{ asset('images/1.png') }}" alt="" class="work__pic"> |
11 | <div class="work__body"> | 11 | <div class="work__body"> |
12 | <div class="work__title"> | 12 | <div class="work__title"> |
13 | <h4>Работа в море / | 13 | <h4>Работа в море / |
14 | <span class="br">Работа на реке</span></h4> | 14 | <span class="br">Работа на реке</span></h4> |
15 | </div> | 15 | </div> |
16 | <div class="work__text">Профессиональная сеть морского сообщества «RekaMore.su» приветствует вас — | 16 | <div class="work__text">Профессиональная сеть морского сообщества «RekaMore.su» приветствует вас — |
17 | тех, кто не представляет себе жизнь без моря, тех, кто готов связать свою жизнь с работой в | 17 | тех, кто не представляет себе жизнь без моря, тех, кто готов связать свою жизнь с работой в |
18 | сложных, но очень интересных условиях. </div> | 18 | сложных, но очень интересных условиях. </div> |
19 | <div class="work__list"> | 19 | <div class="work__list"> |
20 | <div>Тысячи соискателей увидят Ваше объявление</div> | 20 | <div>Тысячи соискателей увидят Ваше объявление</div> |
21 | <div>Десятки компаний выкладывают объявления каждый день</div> | 21 | <div>Десятки компаний выкладывают объявления каждый день</div> |
22 | </div> | 22 | </div> |
23 | <form class="search work__form" action="{{ route('search_vacancies') }}" method="GET"> | 23 | <form class="search work__form" action="{{ route('search_vacancies') }}" method="GET"> |
24 | <input type="search" id="search" name="search" class="input" placeholder="Желаемая должность" required> | 24 | <input type="search" id="search" name="search" class="input" placeholder="Желаемая должность" required> |
25 | <button type="submit" class="button button_light">Посмотреть вакансии</button> | 25 | <button type="submit" class="button button_light">Посмотреть вакансии</button> |
26 | <span> | 26 | <span> |
27 | <svg> | 27 | <svg> |
28 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> | 28 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> |
29 | </svg> | 29 | </svg> |
30 | </span> | 30 | </span> |
31 | </form> | 31 | </form> |
32 | @guest | 32 | @guest |
33 | <a data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' class="button work__search">Я ищу сотрудника</a> | 33 | <a data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' class="button work__search">Я ищу сотрудника</a> |
34 | @else | 34 | @else |
35 | <a href="{{ route('bd_resume') }}" class="button work__search">Я ищу сотрудника</a> | 35 | <a href="{{ route('bd_resume') }}" class="button work__search">Я ищу сотрудника</a> |
36 | @endguest | 36 | @endguest |
37 | <div class="work__get"> | 37 | <div class="work__get"> |
38 | <b>Скачать приложение</b> | 38 | <b>Скачать приложение</b> |
39 | <a href=""> | 39 | <a href=""> |
40 | <img src="{{ asset('images/google.svg') }}" alt=""> | 40 | <img src="{{ asset('images/google.svg') }}" alt=""> |
41 | </a> | 41 | </a> |
42 | <a href=""> | 42 | <a href=""> |
43 | <img src="{{ asset('images/apple.svg') }}" alt=""> | 43 | <img src="{{ asset('images/apple.svg') }}" alt=""> |
44 | </a> | 44 | </a> |
45 | </div> | 45 | </div> |
46 | </div> | 46 | </div> |
47 | </div> | 47 | </div> |
48 | </section> | 48 | </section> |
49 | <section class="numbers"> | 49 | <section class="numbers"> |
50 | <div class="container"> | 50 | <div class="container"> |
51 | <div class="numbers__body"> | 51 | <div class="numbers__body"> |
52 | <div class="numbers__item"> | 52 | <div class="numbers__item"> |
53 | <b>500+</b> | 53 | <b>500+</b> |
54 | <span>Резюме</span> | 54 | <span>Резюме</span> |
55 | Банальные, но неопровержимые выводы, а также элементы политического процесса лишь добавляют | 55 | Банальные, но неопровержимые выводы, а также элементы политического процесса лишь добавляют |
56 | фракционных разногласий и призваны к ответу. | 56 | фракционных разногласий и призваны к ответу. |
57 | </div> | 57 | </div> |
58 | <div class="numbers__item"> | 58 | <div class="numbers__item"> |
59 | <b>1 000+</b> | 59 | <b>1 000+</b> |
60 | <span>Вакансий</span> | 60 | <span>Вакансий</span> |
61 | В рамках спецификации современных стандартов, диаграммы связей заблокированы в рамках своих | 61 | В рамках спецификации современных стандартов, диаграммы связей заблокированы в рамках своих |
62 | собственных рациональных ограничений. | 62 | собственных рациональных ограничений. |
63 | </div> | 63 | </div> |
64 | <div class="numbers__item"> | 64 | <div class="numbers__item"> |
65 | <b>265</b> | 65 | <b>265</b> |
66 | <span>Компаний</span> | 66 | <span>Компаний</span> |
67 | Но сторонники тоталитаризма в науке заблокированы в рамках своих собственных рациональных | 67 | Но сторонники тоталитаризма в науке заблокированы в рамках своих собственных рациональных |
68 | ограничений. | 68 | ограничений. |
69 | </div> | 69 | </div> |
70 | </div> | 70 | </div> |
71 | </div> | 71 | </div> |
72 | </section> | 72 | </section> |
73 | <!--<section class="vacancies"> | 73 | <!--<section class="vacancies"> |
74 | <div class="container"> | 74 | <div class="container"> |
75 | <div class="title"><h4>Новые вакансии</h4></div> | 75 | <div class="title"><h4>Новые вакансии</h4></div> |
76 | <div class="vacancies__body"> | 76 | <div class="vacancies__body"> |
77 | <a class="vacancies__more button button_light js-parent-toggle" href="{{ route('vacancies') }}">Все должности</a> | 77 | <a class="vacancies__more button button_light js-parent-toggle" href="{{ route('vacancies') }}">Все должности</a> |
78 | <div class="vacancies__list"> | 78 | <div class="vacancies__list"> |
79 | _if ($categories->count()) | 79 | _if ($categories->count()) |
80 | _foreach ($categories as $cat) | 80 | _foreach ($categories as $cat) |
81 | <a href=" route('list-vacancies', ['categories' => $cat->id]) }}" class="vacancies__item"> | 81 | <a href=" route('list-vacancies', ['categories' => $cat->id]) }}" class="vacancies__item"> |
82 | <span style="border-color:#F4C4C2"> | 82 | <span style="border-color:#F4C4C2"> |
83 | <b> $cat->name }}</b> | 83 | <b> $cat->name }}</b> |
84 | <i>Вакансий: <span> $cat->cnt }}</span></i> | 84 | <i>Вакансий: <span> $cat->cnt }}</span></i> |
85 | </span> | 85 | </span> |
86 | </a> | 86 | </a> |
87 | _endforeach | 87 | _endforeach |
88 | _else | 88 | _else |
89 | Тут пока нет никаких вакансий | 89 | Тут пока нет никаких вакансий |
90 | _endif | 90 | _endif |
91 | </div> | 91 | </div> |
92 | </div> | 92 | </div> |
93 | </div> | 93 | </div> |
94 | </section>--> | 94 | </section>--> |
95 | 95 | ||
96 | <main class="main"> | 96 | <main class="main"> |
97 | <div class="container"> | 97 | <div class="container"> |
98 | <div class="main__vacancies"> | 98 | <div class="main__vacancies"> |
99 | <h2 class="main__vacancies-title">Категории вакансий</h2> | 99 | <h2 class="main__vacancies-title">Категории вакансий</h2> |
100 | <div class="vacancies__body"> | 100 | <div class="vacancies__body"> |
101 | <!--<button class="vacancies__more button button_more button_light js-toggle js-parent-toggle"> | 101 | <!--<button class="vacancies__more button button_more button_light js-toggle js-parent-toggle"> |
102 | <span>Показать ещё</span> | 102 | <span>Показать ещё</span> |
103 | <span>Скрыть</span> | 103 | <span>Скрыть</span> |
104 | </button>--> | 104 | </button>--> |
105 | <div class="vacancies__list" id="block_ajax" name="block_ajax"> | 105 | <div class="vacancies__list" id="block_ajax" name="block_ajax"> |
106 | @foreach ($BigFlot as $key => $flot) | ||
107 | <div class="vacancies__list-col"> | 106 | @foreach ($BigFlot as $key => $flot) |
108 | @include('block_real', ['flot' => $flot, 'position' => $Position[$key]]) | 107 | <div class="vacancies__list-col"> |
109 | </div> | ||
110 | @endforeach | 108 | @include('block_real', ['flot' => $flot, 'position' => $Position[$key]]) |
111 | </div> | 109 | </div> |
112 | </div> | 110 | @endforeach |
113 | </div> | 111 | </div> |
114 | </div> | 112 | </div> |
115 | </main> | 113 | </div> |
116 | 114 | </div> | |
117 | <section class="employer"> | 115 | </main> |
118 | <div class="container"> | 116 | |
119 | <div class="title"><h4>Работодатели</h4></div> | 117 | <section class="employer"> |
120 | <div class="swiper js-employer-swiper"> | 118 | <div class="container"> |
121 | <div class="swiper-wrapper"> | 119 | <div class="title"><h4>Работодатели</h4></div> |
122 | 120 | <div class="swiper js-employer-swiper"> | |
123 | @if ($employers->count()) | 121 | <div class="swiper-wrapper"> |
124 | @php | 122 | |
125 | $rec = 0; | 123 | @if ($employers->count()) |
126 | $count = $employers->count(); | 124 | @php |
127 | 125 | $rec = 0; | |
128 | @endphp | 126 | $count = $employers->count(); |
129 | 127 | ||
130 | @foreach($employers as $emp) | 128 | @endphp |
131 | @php $rec++ @endphp | 129 | |
132 | @if (($rec==1) || ($rec==5) || ($rec==9) || ($rec==13) || ($rec==17)) | 130 | @foreach($employers as $emp) |
133 | <div class="swiper-slide"> | 131 | @php $rec++ @endphp |
134 | <div class="employer__item"> | 132 | @if (($rec==1) || ($rec==5) || ($rec==9) || ($rec==13) || ($rec==17)) |
135 | @endif | 133 | <div class="swiper-slide"> |
136 | @if (!empty($emp->employer->logo)) | 134 | <div class="employer__item"> |
137 | <a href="{{ route('ad-employer', ['ad_employer' => $emp->employer->id]) }}"> | 135 | @endif |
138 | <img src="{{ asset(Storage::url($emp->employer->logo)) }}" alt="{{ $emp->employer->name_company }}"> | 136 | @if (!empty($emp->employer->logo)) |
139 | </a> | 137 | <a href="{{ route('ad-employer', ['ad_employer' => $emp->employer->id]) }}"> |
140 | @else | 138 | <img src="{{ asset(Storage::url($emp->employer->logo)) }}" alt="{{ $emp->employer->name_company }}"> |
141 | <a href="{{ route('ad-employer', ['ad_employer' => $emp->employer->id]) }}"> | 139 | </a> |
142 | <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $emp->employer->name_company }}"> | 140 | @else |
143 | </a> | 141 | <a href="{{ route('ad-employer', ['ad_employer' => $emp->employer->id]) }}"> |
144 | @endif | 142 | <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $emp->employer->name_company }}"> |
145 | @if (($rec==4) || ($rec==8) || ($rec==12) || ($rec==16) || ($rec==20) || ($rec == $count)) | 143 | </a> |
146 | </div> | 144 | @endif |
147 | </div> | 145 | @if (($rec==4) || ($rec==8) || ($rec==12) || ($rec==16) || ($rec==20) || ($rec == $count)) |
148 | @endif | 146 | </div> |
149 | @endforeach | 147 | </div> |
150 | @else | 148 | @endif |
151 | <h5>Тут нет никаких записей</h5> | 149 | @endforeach |
152 | @endif | 150 | @else |
153 | </div> | 151 | <h5>Тут нет никаких записей</h5> |
154 | <div class="swiper-pagination"></div> | 152 | @endif |
155 | </div> | 153 | </div> |
156 | <a href="{{ route('shipping_companies') }}" class="employer__more button button_light">Все работодатели</a> | 154 | <div class="swiper-pagination"></div> |
157 | </div> | 155 | </div> |
158 | </section> | 156 | <a href="{{ route('shipping_companies') }}" class="employer__more button button_light">Все работодатели</a> |
159 | <section class="about"> | 157 | </div> |
160 | <div class="container"> | 158 | </section> |
161 | <div class="about__wrapper"> | 159 | <section class="about"> |
162 | <div class="title about__title"><h4>О нас</h4></div> | 160 | <div class="container"> |
163 | <div class="about__body"> | 161 | <div class="about__wrapper"> |
164 | <div class="about__line"></div> | 162 | <div class="title about__title"><h4>О нас</h4></div> |
165 | <div class="about__item"> | 163 | <div class="about__body"> |
166 | <b>Для работодателей</b> | 164 | <div class="about__line"></div> |
167 | <span>Наш ресурс позволит Вам за демократичную цену найти нужных специалистов в кратчайшие | 165 | <div class="about__item"> |
168 | сроки, подробнее об условиях можно узнать <a href="{{ route('page', ['pages' => 'Stoimost-razmescheniya']) }}">здесь</a>.</span> | 166 | <b>Для работодателей</b> |
169 | <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('bd_resume') }}">Поиск сотрудников</a> | 167 | <span>Наш ресурс позволит Вам за демократичную цену найти нужных специалистов в кратчайшие |
170 | </div> | 168 | сроки, подробнее об условиях можно узнать <a href="{{ route('page', ['pages' => 'Stoimost-razmescheniya']) }}">здесь</a>.</span> |
171 | <div class="about__item"> | 169 | <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('bd_resume') }}">Поиск сотрудников</a> |
172 | <b>Для сотрудников</b> | 170 | </div> |
173 | <span>Наше преимущество — это большой объем вакансий, более 70 судоходных компаний России и | 171 | <div class="about__item"> |
174 | СНГ ищут сотрудников через наши ресурсы</span> | 172 | <b>Для сотрудников</b> |
175 | <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('vacancies') }}">Ищу работу</a> | 173 | <span>Наше преимущество — это большой объем вакансий, более 70 судоходных компаний России и |
176 | </div> | 174 | СНГ ищут сотрудников через наши ресурсы</span> |
177 | </div> | 175 | <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('vacancies') }}">Ищу работу</a> |
178 | </div> | 176 | </div> |
179 | </div> | 177 | </div> |
180 | </section> | 178 | </div> |
181 | 179 | </div> | |
182 | @if ($news->count()) | 180 | </section> |
183 | <section class="news"> | 181 | |
184 | <div class="container"> | 182 | @if ($news->count()) |
185 | <div class="news__toper"> | 183 | <section class="news"> |
186 | <div class="title"><h4>Новости и статьи</h4></div> | 184 | <div class="container"> |
187 | <div class="navs"> | 185 | <div class="news__toper"> |
188 | <button class="js-news-swiper-button-prev"> | 186 | <div class="title"><h4>Новости и статьи</h4></div> |
189 | <svg class="rotate180"> | 187 | <div class="navs"> |
190 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> | 188 | <button class="js-news-swiper-button-prev"> |
191 | </svg> | 189 | <svg class="rotate180"> |
192 | </button> | 190 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> |
193 | <button class="js-news-swiper-button-next"> | 191 | </svg> |
194 | <svg> | 192 | </button> |
195 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> | 193 | <button class="js-news-swiper-button-next"> |
196 | </svg> | 194 | <svg> |
197 | </button> | 195 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> |
198 | </div> | 196 | </svg> |
199 | </div> | 197 | </button> |
200 | 198 | </div> | |
201 | <div class="swiper js-news-swiper"> | 199 | </div> |
202 | <div class="swiper-wrapper"> | 200 | |
203 | 201 | <div class="swiper js-news-swiper"> | |
204 | @foreach ($news as $new) | 202 | <div class="swiper-wrapper"> |
205 | <div class="swiper-slide"> | 203 | |
206 | <div class="news__item"> | 204 | @foreach ($news as $new) |
207 | <img src="{{ asset(Storage::url($new->image)) }}" alt="" class="news__item-pic"> | 205 | <div class="swiper-slide"> |
208 | <div class="news__item-body"> | 206 | <div class="news__item"> |
209 | <time datetime="{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}" class="news__item-date">{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}</time> | 207 | <img src="{{ asset(Storage::url($new->image)) }}" alt="" class="news__item-pic"> |
210 | <span class="news__item-title">{{ $new->title }}</span> | 208 | <div class="news__item-body"> |
211 | <span class="news__item-text">{{ mb_strimwidth($new->text, 0, 100) }}</span> | 209 | <time datetime="{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}" class="news__item-date">{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}</time> |
212 | <a href="{{ route('detail_new', ['new' => $new->id]) }}" class="news__item-more button button_light">Читать далее</a> | 210 | <span class="news__item-title">{{ $new->title }}</span> |
213 | </div> | 211 | <span class="news__item-text">{{ mb_strimwidth($new->text, 0, 100) }}</span> |
214 | </div> | 212 | <a href="{{ route('detail_new', ['new' => $new->id]) }}" class="news__item-more button button_light">Читать далее</a> |
215 | </div> | 213 | </div> |
216 | @endforeach | 214 | </div> |
217 | 215 | </div> | |
218 | </div> | 216 | @endforeach |
219 | <div class="swiper-pagination"></div> | 217 | |
220 | </div> | 218 | </div> |
221 | <a href="{{ route('news') }}" class="news__all button button_light">Все новости</a> | 219 | <div class="swiper-pagination"></div> |
222 | 220 | </div> | |
223 | </div> | 221 | <a href="{{ route('news') }}" class="news__all button button_light">Все новости</a> |
224 | </section> | 222 | |
225 | @endif | 223 | </div> |
226 | 224 | </section> | |
227 | <section class="info"> | 225 | @endif |
228 | <div class="container"> | 226 | |
229 | <img src="images/5.png" alt="" class="info__pic"> | 227 | <section class="info"> |
230 | <div class="info__body"> | 228 | <div class="container"> |
231 | <div class="title info__title"><h4>Мы в социальных сетях</h4></div> | 229 | <img src="images/5.png" alt="" class="info__pic"> |
232 | <div class="info__item"> | 230 | <div class="info__body"> |
233 | <div class="info__text">Телеграм — Подпишитесь на наш телеграм канал и получайте уведомления о | 231 | <div class="title info__title"><h4>Мы в социальных сетях</h4></div> |
234 | новых вакансиях прямо на свой смартфон</div> | 232 | <div class="info__item"> |
235 | <a href="{{ $companies[0]->telegram }}" class="info__link" style="background:#20A0E1"> | 233 | <div class="info__text">Телеграм — Подпишитесь на наш телеграм канал и получайте уведомления о |
236 | <svg> | 234 | новых вакансиях прямо на свой смартфон</div> |
237 | <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> | 235 | <a href="{{ $companies[0]->telegram }}" class="info__link" style="background:#20A0E1"> |
238 | </svg> | 236 | <svg> |
239 | Телеграм | 237 | <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> |
240 | </a> | 238 | </svg> |
241 | </div> | 239 | Телеграм |
242 | <div class="info__item"> | 240 | </a> |
243 | <div class="info__text">ВКонтакте — Лучшие вакансии за неделю выкладываем именно тут, информация | 241 | </div> |
244 | о судоходных компаниях, инструкции по работе с сайтом, конкурсы и многое другое</div> | 242 | <div class="info__item"> |
245 | <a href="{{ $companies[0]->vkontact }}" class="info__link" style="background:#2787F5"> | 243 | <div class="info__text">ВКонтакте — Лучшие вакансии за неделю выкладываем именно тут, информация |
246 | <svg> | 244 | о судоходных компаниях, инструкции по работе с сайтом, конкурсы и многое другое</div> |
247 | <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> | 245 | <a href="{{ $companies[0]->vkontact }}" class="info__link" style="background:#2787F5"> |
248 | </svg> | 246 | <svg> |
249 | ВКонтакте | 247 | <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> |
250 | </a> | 248 | </svg> |
251 | </div> | 249 | ВКонтакте |
252 | </div> | 250 | </a> |
253 | </div> | 251 | </div> |
254 | </section> | 252 | </div> |
255 | @endsection | 253 | </div> |
256 | 254 | </section> |
resources/views/js/modals.blade.php
1 | <script> | 1 | <script> |
2 | console.log('Test system'); | 2 | console.log('Test system'); |
3 | $(document).on('click', '#button_send', function() { | 3 | $(document).on('click', '#button_send', function() { |
4 | var field_login = $('#email_input'); | 4 | var field_login = $('#email_input'); |
5 | var field_pwd = $('#password'); | 5 | var field_pwd = $('#password'); |
6 | var login_val = field_login.val(); | 6 | var login_val = field_login.val(); |
7 | var pwd_val = field_pwd.val(); | 7 | var pwd_val = field_pwd.val(); |
8 | 8 | ||
9 | console.log('login: '+login_val+' password: '+pwd_val); | 9 | console.log('login: '+login_val+' password: '+pwd_val); |
10 | 10 | ||
11 | $.ajax({ | 11 | $.ajax({ |
12 | type: "GET", | 12 | type: "GET", |
13 | url: "{{ route('login') }}", | 13 | url: "{{ route('login') }}", |
14 | data: "email="+login_val+"&password="+pwd_val, | 14 | data: "email="+login_val+"&password="+pwd_val, |
15 | success: function (data) { | 15 | success: function (data) { |
16 | console.log('Вход в систему'); | 16 | console.log('Вход в систему'); |
17 | console.log(data); | 17 | console.log(data); |
18 | let d = JSON.parse(data); | 18 | let d = JSON.parse(data); |
19 | if(typeof d['REDIRECT'] !== "undefined") { | 19 | if(typeof d['REDIRECT'] !== "undefined") { |
20 | location.href = d['REDIRECT']; | 20 | location.href = d['REDIRECT']; |
21 | console.log(d['REDIRECT']); | 21 | console.log(d['REDIRECT']); |
22 | } | 22 | } |
23 | if (typeof d['ERROR'] !== "undefined") { | 23 | if (typeof d['ERROR'] !== "undefined") { |
24 | console.log(d['ERROR']); | 24 | console.log(d['ERROR']); |
25 | $('#message_error').html(d['ERROR']); | 25 | $('#message_error').html(d['ERROR']); |
26 | } | 26 | } |
27 | //console.log(d['REDIRECT']); | 27 | //console.log(d['REDIRECT']); |
28 | //$('#block_1').html(data); | 28 | //$('#block_1').html(data); |
29 | }, | 29 | }, |
30 | headers: { | 30 | headers: { |
31 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 31 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
32 | }, | 32 | }, |
33 | error: function (data) { | 33 | error: function (data) { |
34 | data = JSON.stringify(data); | 34 | data = JSON.stringify(data); |
35 | console.log('Error: ' + data); | 35 | console.log('Error: ' + data); |
36 | } | 36 | } |
37 | }); | 37 | }); |
38 | }); | 38 | }); |
39 | 39 | ||
40 | $(document).on('click', '#button_reg_worker', function() { | 40 | $(document).on('click', '#button_reg_worker', function() { |
41 | var field_login = $('#email_worker'); | 41 | var field_login = $('#email_worker'); |
42 | var field_pwd = $('#password_worker'); | 42 | var field_pwd = $('#password_worker'); |
43 | var field_confirm_pwd = $('#password_confirmation_worker'); | 43 | var field_confirm_pwd = $('#password_confirmation_worker'); |
44 | var field_politik_worker = $('#politik'); | 44 | var field_politik_worker = $('#politik'); |
45 | var field_telephone_worker = $('#telephone_worker'); | 45 | var field_telephone_worker = $('#telephone_worker'); |
46 | var field_job_titles_worker = $('#job_titles_worker'); | 46 | var field_job_titles_worker = $('#job_titles_worker'); |
47 | var field_surname_worker = $('#surname_worker'); | 47 | var field_surname_worker = $('#surname_worker'); |
48 | var field_name_man = $('#name_man_worker'); | 48 | var field_name_man = $('#name_man_worker'); |
49 | var field_surname2_worker = $('#surname2_worker'); | 49 | var field_surname2_worker = $('#surname2_worker'); |
50 | 50 | ||
51 | var login = field_login.val(); | 51 | var login = field_login.val(); |
52 | var pwd = field_pwd.val(); | 52 | var pwd = field_pwd.val(); |
53 | var confirm_pwd = field_confirm_pwd.val(); | 53 | var confirm_pwd = field_confirm_pwd.val(); |
54 | var politik = field_politik_worker.val(); | 54 | var politik = field_politik_worker.val(); |
55 | var telephone = field_telephone_worker.val(); | 55 | var telephone = field_telephone_worker.val(); |
56 | var job_titles = field_job_titles_worker.val(); | 56 | var job_titles = field_job_titles_worker.val(); |
57 | var surname = field_surname_worker.val(); | 57 | var surname = field_surname_worker.val(); |
58 | var name_man = field_name_man.val(); | 58 | var name_man = field_name_man.val(); |
59 | var surname2 = field_surname2_worker.val(); | 59 | var surname2 = field_surname2_worker.val(); |
60 | 60 | ||
61 | 61 | ||
62 | if (field_politik_worker.attr('checked')) { | ||
63 | console.log('politik=1'); | ||
64 | politik = 1; | ||
65 | } else { | ||
66 | politik = 0; | ||
67 | console.log('politik=0'); | ||
68 | } | ||
69 | |||
62 | if (field_politik_worker.attr('checked')) { | 70 | console.log('login: '+login+' password: '+pwd); |
63 | console.log('politik=1'); | 71 | |
64 | politik = 1; | 72 | $.ajax({ |
65 | } else { | 73 | type: "GET", |
66 | politik = 0; | 74 | url: "{{ route('register_worker') }}", |
67 | console.log('politik=0'); | 75 | data: "email="+login+"&password="+pwd+"&confirmed="+confirm_pwd+"&politik="+politik+ |
68 | } | 76 | "&telephone="+telephone+"&job_titles="+job_titles+"&surname="+surname+"&name_man="+name_man+ |
69 | 77 | "&surname2="+surname2+"&subscribe_email="+login, | |
70 | console.log('login: '+login+' password: '+pwd); | 78 | success: function (data) { |
71 | 79 | console.log('Вход в систему'); | |
72 | $.ajax({ | 80 | let d = JSON.parse(data); |
73 | type: "GET", | 81 | if(typeof d['REDIRECT'] !== "undefined") { |
74 | url: "{{ route('register_worker') }}", | 82 | console.log(d['REDIRECT']); |
75 | data: "email="+login+"&password="+pwd+"&confirmed="+confirm_pwd+"&politik="+politik+ | 83 | location.href = d['REDIRECT']; |
76 | "&telephone="+telephone+"&job_titles="+job_titles+"&surname="+surname+"&name_man="+name_man+ | 84 | } |
77 | "&surname2="+surname2+"&subscribe_email="+login, | 85 | if (typeof d['ERROR'] !== "undefined") { |
78 | success: function (data) { | 86 | console.log(d['ERROR']); |
79 | console.log('Вход в систему'); | 87 | $('#block-info').css({'display': 'block'}); |
80 | let d = JSON.parse(data); | 88 | $('#messages_error_reg').html(d['ERROR']); |
81 | if(typeof d['REDIRECT'] !== "undefined") { | 89 | } |
82 | console.log(d['REDIRECT']); | 90 | console.log(d['REDIRECT']); |
83 | location.href = d['REDIRECT']; | 91 | |
84 | } | 92 | }, |
85 | if (typeof d['ERROR'] !== "undefined") { | 93 | headers: { |
86 | console.log(d['ERROR']); | 94 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
87 | $('#block-info').css({'display': 'block'}); | 95 | }, |
88 | $('#messages_error_reg').html(d['ERROR']); | 96 | error: function (data) { |
89 | } | 97 | data = JSON.stringify(data); |
90 | console.log(d['REDIRECT']); | 98 | console.log('Error: ' + data); |
91 | 99 | } | |
92 | }, | 100 | }); |
93 | headers: { | 101 | |
94 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 102 | return false; |
95 | }, | 103 | }); |
96 | error: function (data) { | 104 | |
97 | data = JSON.stringify(data); | 105 | $(document).on('click', '#button_reg_employer', function() { |
98 | console.log('Error: ' + data); | 106 | var field_login = $('#email_employer'); |
99 | } | 107 | var field_pwd = $('#password_employer'); |
100 | }); | 108 | var field_confirm_pwd = $('#password_confirmation_employer'); |
101 | 109 | var field_politik_employer = $('#politik_employer'); | |
102 | return false; | 110 | var field_telephone_employer = $('#telephone_employer'); |
103 | }); | 111 | var field_company_employer = $('#company_employer'); |
104 | 112 | var field_surname_employer = $('#surname_employer'); | |
105 | $(document).on('click', '#button_reg_employer', function() { | 113 | var field_name_man_employer = $('#name_man_employer'); |
106 | var field_login = $('#email_employer'); | 114 | var field_surname2_employer = $('#surname2_employer'); |
107 | var field_pwd = $('#password_employer'); | 115 | |
108 | var field_confirm_pwd = $('#password_confirmation_employer'); | 116 | var login = field_login.val(); |
109 | var field_politik_employer = $('#politik_employer'); | 117 | var pwd = field_pwd.val(); |
110 | var field_telephone_employer = $('#telephone_employer'); | 118 | var confirm_pwd = field_confirm_pwd.val(); |
111 | var field_company_employer = $('#company_employer'); | 119 | var politik = field_politik_employer.val(); |
112 | var field_surname_employer = $('#surname_employer'); | 120 | var telephone = field_telephone_employer.val(); |
113 | var field_name_man_employer = $('#name_man_employer'); | 121 | var company_employer = field_company_employer.val(); |
114 | var field_surname2_employer = $('#surname2_employer'); | 122 | var surname = field_surname_employer.val(); |
115 | 123 | var name_man = field_name_man_employer.val(); | |
116 | var login = field_login.val(); | 124 | var surname2 = field_surname2_employer.val(); |
117 | var pwd = field_pwd.val(); | 125 | |
118 | var confirm_pwd = field_confirm_pwd.val(); | 126 | |
119 | var politik = field_politik_employer.val(); | 127 | console.log('login: '+login+' password: '+pwd); |
120 | var telephone = field_telephone_employer.val(); | 128 | |
121 | var company_employer = field_company_employer.val(); | 129 | if (field_politik_employer.attr('checked')) { |
130 | console.log('politik=1'); | ||
131 | politik = 1; | ||
132 | } else { | ||
133 | politik = 0; | ||
134 | console.log('politik=0'); | ||
135 | } | ||
122 | var surname = field_surname_employer.val(); | 136 | $.ajax({ |
123 | var name_man = field_name_man_employer.val(); | 137 | type: "GET", |
124 | var surname2 = field_surname2_employer.val(); | 138 | url: "{{ route('register_employer') }}", |
125 | 139 | data: "email="+login+"&password="+pwd+"&confirmed="+confirm_pwd+"&politik="+politik+ | |
126 | 140 | "&telephone="+telephone+"&name_company="+company_employer+"&surname="+surname+"&name_man="+name_man+ | |
127 | console.log('login: '+login+' password: '+pwd); | 141 | "&surname2="+surname2+"&subscribe_email="+login, |
128 | 142 | success: function (data) { | |
129 | if (field_politik_employer.attr('checked')) { | 143 | console.log('Вход в систему'); |
130 | console.log('politik=1'); | 144 | let d = JSON.parse(data); |
131 | politik = 1; | 145 | if(typeof d['REDIRECT'] !== "undefined") { |
132 | } else { | 146 | console.log(d['REDIRECT']); |
133 | politik = 0; | 147 | location.href = d['REDIRECT']; |
134 | console.log('politik=0'); | 148 | } |
135 | } | 149 | if (typeof d['ERROR'] !== "undefined") { |
136 | $.ajax({ | 150 | console.log(d['ERROR']); |
137 | type: "GET", | 151 | $('#block-info').css({'display': 'block'}); |
138 | url: "{{ route('register_employer') }}", | 152 | $('#messages_error_reg').html(d['ERROR']); |
139 | data: "email="+login+"&password="+pwd+"&confirmed="+confirm_pwd+"&politik="+politik+ | 153 | } |
140 | "&telephone="+telephone+"&name_company="+company_employer+"&surname="+surname+"&name_man="+name_man+ | 154 | console.log(d['REDIRECT']); |
141 | "&surname2="+surname2+"&subscribe_email="+login, | ||
142 | success: function (data) { | 155 | }, |
143 | console.log('Вход в систему'); | 156 | headers: { |
144 | let d = JSON.parse(data); | 157 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
145 | if(typeof d['REDIRECT'] !== "undefined") { | 158 | }, |
146 | console.log(d['REDIRECT']); | 159 | error: function (data) { |
147 | location.href = d['REDIRECT']; | 160 | data = JSON.stringify(data); |
148 | } | 161 | console.log('Error: ' + data); |
149 | if (typeof d['ERROR'] !== "undefined") { | 162 | } |
150 | console.log(d['ERROR']); | 163 | }); |
151 | $('#block-info').css({'display': 'block'}); | 164 | |
152 | $('#messages_error_reg').html(d['ERROR']); | 165 | return false; |
153 | } | 166 | }); |
154 | console.log(d['REDIRECT']); | 167 | |
155 | }, | 168 | </script> |
resources/views/layout/frontend.blade.php
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> | 2 | <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> |
3 | 3 | ||
4 | <head> | 4 | <head> |
5 | <meta charset="utf-8"> | 5 | <meta charset="utf-8"> |
6 | <title>{{ $title }}</title> | 6 | <title>{{ $title }}</title> |
7 | <meta name="viewport" content="width=device-width,initial-scale=1"> | 7 | <meta name="viewport" content="width=device-width,initial-scale=1"> |
8 | <meta name="theme-color" content="#377D87"> | 8 | <meta name="theme-color" content="#377D87"> |
9 | <script src="{{ asset('js/jquery.js') }}"></script> | 9 | <script src="{{ asset('js/jquery.js') }}"></script> |
10 | <!--<script type="text/javascript" src=" asset('js/jquery.cookie.js') }}"></script>--> | 10 | <!--<script type="text/javascript" src=" asset('js/jquery.cookie.js') }}"></script>--> |
11 | 11 | ||
12 | <link rel="stylesheet" href="{{ asset('css/star-rating.min.css') }}"> | 12 | <link rel="stylesheet" href="{{ asset('css/star-rating.min.css') }}"> |
13 | <link rel="stylesheet" href="{{ asset('css/style45.css') }}"> | 13 | <link rel="stylesheet" href="{{ asset('css/style45.css') }}"> |
14 | <style> | 14 | <style> |
15 | .err_red { | 15 | .err_red { |
16 | border: red 2px solid; | 16 | border: red 2px solid; |
17 | } | 17 | } |
18 | </style> | 18 | </style> |
19 | </head> | 19 | </head> |
20 | 20 | ||
21 | <body id="body"> | 21 | <body id="body"> |
22 | <a href="#body" class="to-top js-scroll-to"> | 22 | <a href="#body" class="to-top js-scroll-to"> |
23 | <svg> | 23 | <svg> |
24 | <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> | 24 | <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> |
25 | </svg> | 25 | </svg> |
26 | </a> | 26 | </a> |
27 | 27 | ||
28 | <div> <!-- BEGIN TOP WRAPPER --> | 28 | <div> <!-- BEGIN TOP WRAPPER --> |
29 | <header class="header"> | 29 | <header class="header"> |
30 | <div class="container"> | 30 | <div class="container"> |
31 | <div class="header__body"> | 31 | <div class="header__body"> |
32 | <div class="header__left"> | 32 | <div class="header__left"> |
33 | <a href="{{ route('index') }}" class="header__logo"> | 33 | <a href="{{ route('index') }}" class="header__logo"> |
34 | <svg> | 34 | <svg> |
35 | <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> | 35 | <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> |
36 | </svg> | 36 | </svg> |
37 | </a> | 37 | </a> |
38 | <nav class="header__menu"> | 38 | <nav class="header__menu"> |
39 | <a href="{{ route('vacancies') }}" class="header__menu-item">Вакансии</a> | 39 | <a href="{{ route('vacancies') }}" class="header__menu-item">Вакансии</a> |
40 | <a href="{{ route('shipping_companies') }}" class="header__menu-item">Судоходные компании</a> | 40 | <a href="{{ route('shipping_companies') }}" class="header__menu-item">Судоходные компании</a> |
41 | <a href="{{ route('education') }}" class="header__menu-item">Образование</a> | 41 | <a href="{{ route('education') }}" class="header__menu-item">Образование</a> |
42 | </nav> | 42 | </nav> |
43 | </div> | 43 | </div> |
44 | <div class="header__right"> | 44 | <div class="header__right"> |
45 | @guest | 45 | @guest |
46 | 46 | ||
47 | @else | 47 | @else |
48 | <a href="@if ($UserId->is_worker) {{ route('worker.cabinet') }} @else {{ route('employer.cabinet') }} @endif" class="header__notifs header__notifs_actived"> | 48 | <a href="@if ($UserId->is_worker) {{ route('worker.cabinet') }} @else {{ route('employer.cabinet') }} @endif" class="header__notifs header__notifs_actived"> |
49 | <svg> | 49 | <svg> |
50 | <use xlink:href="{{ asset('images/sprite.svg#ring') }}"></use> | 50 | <use xlink:href="{{ asset('images/sprite.svg#ring') }}"></use> |
51 | </svg> | 51 | </svg> |
52 | <span>Уведомления</span> | 52 | <span>Уведомления</span> |
53 | </a> | 53 | </a> |
54 | 54 | ||
55 | @endguest | 55 | @endguest |
56 | <div class="header__right-line"></div> | 56 | <div class="header__right-line"></div> |
57 | <button class="header__burger"> | 57 | <button class="header__burger"> |
58 | <svg> | 58 | <svg> |
59 | <use xlink:href="{{ asset('images/sprite.svg#burger') }}"></use> | 59 | <use xlink:href="{{ asset('images/sprite.svg#burger') }}"></use> |
60 | </svg> | 60 | </svg> |
61 | </button> | 61 | </button> |
62 | @guest | 62 | @guest |
63 | <a class="button header__sign" data-fancybox data-src="#sign" data-options='{"touch":false,"autoFocus":false}'>Войти</a> | 63 | <a class="button header__sign" data-fancybox data-src="#sign" data-options='{"touch":false,"autoFocus":false}'>Войти</a> |
64 | @else | 64 | @else |
65 | <a class="button header__sign" href="{{ route('logout') }}">Выйти</a> | 65 | <a class="button header__sign" href="{{ route('logout') }}">Выйти</a> |
66 | @endguest | 66 | @endguest |
67 | </div> | 67 | </div> |
68 | </div> | 68 | </div> |
69 | </div> | 69 | </div> |
70 | </header> | 70 | </header> |
71 | @yield('content') | 71 | @yield('content') |
72 | </div> <!-- END TOP WRAPPER --> | 72 | </div> <!-- END TOP WRAPPER --> |
73 | 73 | ||
74 | <div> <!-- BEGIN BOTTOM WRAPPER --> | 74 | <div> <!-- BEGIN BOTTOM WRAPPER --> |
75 | <footer class="footer"> | 75 | <footer class="footer"> |
76 | <div class="container"> | 76 | <div class="container"> |
77 | <div class="footer__mobile"> | 77 | <div class="footer__mobile"> |
78 | 78 | ||
79 | <button class="footer__mobile-toper js-toggle active"> | 79 | <button class="footer__mobile-toper js-toggle active"> |
80 | <a href="{{ route('index') }}"> | 80 | <a href="{{ route('index') }}"> |
81 | <svg> | 81 | <svg> |
82 | <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> | 82 | <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> |
83 | </svg> | 83 | </svg> |
84 | </a> | 84 | </a> |
85 | <span> | 85 | <span> |
86 | <svg> | 86 | <svg> |
87 | <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> | 87 | <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> |
88 | </svg> | 88 | </svg> |
89 | </span> | 89 | </span> |
90 | </button> | 90 | </button> |
91 | <div class="footer__mobile-menu"> | 91 | <div class="footer__mobile-menu"> |
92 | <div class="footer__mobile-menu-item"> | 92 | <div class="footer__mobile-menu-item"> |
93 | <button class="js-toggle"> | 93 | <button class="js-toggle"> |
94 | <b>Соискателям</b> | 94 | <b>Соискателям</b> |
95 | <span><svg> | 95 | <span><svg> |
96 | <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> | 96 | <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> |
97 | </svg></span> | 97 | </svg></span> |
98 | </button> | 98 | </button> |
99 | <div> | 99 | <div> |
100 | <a href="{{ route('vacancies') }}">Вакансии</a> | 100 | <a href="{{ route('vacancies') }}">Вакансии</a> |
101 | <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a> | 101 | <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a> |
102 | <a href="{{ route('education') }}">Образование</a> | 102 | <a href="{{ route('education') }}">Образование</a> |
103 | <a href="{{ route('news') }}">Новости</a> | 103 | <a href="{{ route('news') }}">Новости</a> |
104 | <a href="{{ route('contacts') }}">Контакты</a> | 104 | <a href="{{ route('contacts') }}">Контакты</a> |
105 | <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a> | 105 | <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a> |
106 | </div> | 106 | </div> |
107 | </div> | 107 | </div> |
108 | <div class="footer__mobile-menu-item"> | 108 | <div class="footer__mobile-menu-item"> |
109 | <button class="js-toggle"> | 109 | <button class="js-toggle"> |
110 | <b>Работодателям</b> | 110 | <b>Работодателям</b> |
111 | <span><svg> | 111 | <span><svg> |
112 | <use xlink:href="{{asset('images/sprite.svg#arrow-top') }}"></use> | 112 | <use xlink:href="{{asset('images/sprite.svg#arrow-top') }}"></use> |
113 | </svg></span> | 113 | </svg></span> |
114 | </button> | 114 | </button> |
115 | <div> | 115 | <div> |
116 | <a href="{{ route('register') }}">Регистрация</a> | 116 | <a href="{{ route('register') }}">Регистрация</a> |
117 | <a href="{{ route('bd_resume') }}">База резюме</a> | 117 | <a href="{{ route('bd_resume') }}">База резюме</a> |
118 | <a href="{{ route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a> | 118 | <a href="{{ route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a> |
119 | <a href="{{ route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a> | 119 | <a href="{{ route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a> |
120 | <a href="{{ route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a> | 120 | <a href="{{ route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a> |
121 | <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a> | 121 | <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a> |
122 | </div> | 122 | </div> |
123 | </div> | 123 | </div> |
124 | </div> | 124 | </div> |
125 | <div class="footer__mobile-contacts"> | 125 | <div class="footer__mobile-contacts"> |
126 | <b>Контакты</b> | 126 | <b>Контакты</b> |
127 | <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a> | 127 | <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a> |
128 | <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a> | 128 | <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a> |
129 | </div> | 129 | </div> |
130 | <div class="footer__mobile-bottom"> | 130 | <div class="footer__mobile-bottom"> |
131 | <div class="socials"> | 131 | <div class="socials"> |
132 | <a href="{{ $companies[0]->vkontact }}" target="_blank"> | 132 | <a href="{{ $companies[0]->vkontact }}" target="_blank"> |
133 | <svg> | 133 | <svg> |
134 | <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> | 134 | <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> |
135 | </svg> | 135 | </svg> |
136 | </a> | 136 | </a> |
137 | <a href="{{ $companies[0]->telegram }}" target="_blank"> | 137 | <a href="{{ $companies[0]->telegram }}" target="_blank"> |
138 | <svg> | 138 | <svg> |
139 | <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> | 139 | <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> |
140 | </svg> | 140 | </svg> |
141 | </a> | 141 | </a> |
142 | </div> | 142 | </div> |
143 | <nav class="footer__mobile-links"> | 143 | <nav class="footer__mobile-links"> |
144 | <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a> | 144 | <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a> |
145 | <span></span> | 145 | <span></span> |
146 | <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a> | 146 | <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a> |
147 | </nav> | 147 | </nav> |
148 | © 2023 — RekaMore.su | 148 | © 2023 — RekaMore.su |
149 | <a href="{{ route('index') }}" class="nls" target="_blank"> | 149 | <a href="{{ route('index') }}" class="nls" target="_blank"> |
150 | <svg> | 150 | <svg> |
151 | <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use> | 151 | <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use> |
152 | </svg> | 152 | </svg> |
153 | <span> | 153 | <span> |
154 | Дизайн и разработка: | 154 | Дизайн и разработка: |
155 | <b>NoLogoStudio.ru</b> | 155 | <b>NoLogoStudio.ru</b> |
156 | </span> | 156 | </span> |
157 | </a> | 157 | </a> |
158 | </div> | 158 | </div> |
159 | </div> | 159 | </div> |
160 | <div class="footer__main"> | 160 | <div class="footer__main"> |
161 | <div class="footer__main-body"> | 161 | <div class="footer__main-body"> |
162 | 162 | ||
163 | <a href="" class="footer__main-logo"> | 163 | <a href="" class="footer__main-logo"> |
164 | <svg> | 164 | <svg> |
165 | <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> | 165 | <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> |
166 | </svg> | 166 | </svg> |
167 | </a> | 167 | </a> |
168 | <div class="footer__main-col"> | 168 | <div class="footer__main-col"> |
169 | <div class="footer__main-title">Соискателям</div> | 169 | <div class="footer__main-title">Соискателям</div> |
170 | <nav> | 170 | <nav> |
171 | <a href="{{ route('vacancies') }}">Вакансии</a> | 171 | <a href="{{ route('vacancies') }}">Вакансии</a> |
172 | <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a> | 172 | <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a> |
173 | <a href="{{ route('education') }}">Образование</a> | 173 | <a href="{{ route('education') }}">Образование</a> |
174 | <a href="{{ route('news') }}">Новости</a> | 174 | <a href="{{ route('news') }}">Новости</a> |
175 | <a href="{{ route('contacts') }}">Контакты</a> | 175 | <a href="{{ route('contacts') }}">Контакты</a> |
176 | <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a> | 176 | <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a> |
177 | </nav> | 177 | </nav> |
178 | </div> | 178 | </div> |
179 | <div class="footer__main-col"> | 179 | <div class="footer__main-col"> |
180 | <div class="footer__main-title">Работодателям</div> | 180 | <div class="footer__main-title">Работодателям</div> |
181 | <nav> | 181 | <nav> |
182 | <a href="{{ route('register') }}">Регистрация</a> | 182 | <a href="{{ route('register') }}">Регистрация</a> |
183 | <a href="{{ route('bd_resume') }}">База резюме</a> | 183 | <a href="{{ route('bd_resume') }}">База резюме</a> |
184 | <a href="{{ route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a> | 184 | <a href="{{ route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a> |
185 | <a href="{{ route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a> | 185 | <a href="{{ route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a> |
186 | <a href="{{ route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a> | 186 | <a href="{{ route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a> |
187 | <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a> | 187 | <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a> |
188 | </nav> | 188 | </nav> |
189 | </div> | 189 | </div> |
190 | 190 | ||
191 | <div class="footer__main-col"> | 191 | <div class="footer__main-col"> |
192 | <div class="footer__main-title">Контакты</div> | 192 | <div class="footer__main-title">Контакты</div> |
193 | <div class="footer__main-contacts"> | 193 | <div class="footer__main-contacts"> |
194 | <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a> | 194 | <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a> |
195 | <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a> | 195 | <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a> |
196 | </div> | 196 | </div> |
197 | <div class="socials"> | 197 | <div class="socials"> |
198 | <a href="{{ $companies[0]->vkontact }}" target="_blank"> | 198 | <a href="{{ $companies[0]->vkontact }}" target="_blank"> |
199 | <svg> | 199 | <svg> |
200 | <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> | 200 | <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> |
201 | </svg> | 201 | </svg> |
202 | </a> | 202 | </a> |
203 | <a href="{{ $companies[0]->telegram }}" target="_blank"> | 203 | <a href="{{ $companies[0]->telegram }}" target="_blank"> |
204 | <svg> | 204 | <svg> |
205 | <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> | 205 | <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> |
206 | </svg> | 206 | </svg> |
207 | </a> | 207 | </a> |
208 | </div> | 208 | </div> |
209 | </div> | 209 | </div> |
210 | </div> | 210 | </div> |
211 | 211 | ||
212 | <div class="footer__main-copy"> | 212 | <div class="footer__main-copy"> |
213 | <div>© 2023 — RekaMore.su</div> | 213 | <div>© 2023 — RekaMore.su</div> |
214 | <nav> | 214 | <nav> |
215 | <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a> | 215 | <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a> |
216 | <span></span> | 216 | <span></span> |
217 | <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a> | 217 | <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a> |
218 | </nav> | 218 | </nav> |
219 | <div> @if (isset($_COOKIE['favorite_vacancy'])) Куки вакансий: {{ print_r($_COOKIE['favorite_vacancy']) }} @endif</div> | 219 | <div> @if (isset($_COOKIE['favorite_vacancy'])) Куки вакансий: {{ print_r($_COOKIE['favorite_vacancy']) }} @endif</div> |
220 | <a href="{{ route('index') }}" class="nls" target="_blank"> | 220 | <a href="{{ route('index') }}" class="nls" target="_blank"> |
221 | <svg> | 221 | <svg> |
222 | <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use> | 222 | <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use> |
223 | </svg> | 223 | </svg> |
224 | <span> | 224 | <span> |
225 | Дизайн и разработка: | 225 | Дизайн и разработка: |
226 | <b>NoLogoStudio.ru</b> | 226 | <b>NoLogoStudio.ru</b> |
227 | </span> | 227 | </span> |
228 | </a> | 228 | </a> |
229 | </div> | 229 | </div> |
230 | </div> | 230 | </div> |
231 | </div> | 231 | </div> |
232 | </footer> | 232 | </footer> |
233 | </div> <!-- END BOTTOM WRAPPER --> | 233 | </div> <!-- END BOTTOM WRAPPER --> |
234 | 234 | ||
235 | <div hidden> <!-- BEGIN MODALS WRAPPER --> | 235 | <div hidden> <!-- BEGIN MODALS WRAPPER --> |
236 | <!-- Соискатель отправляет сообщение работодателю --> | 236 | <!-- Соискатель отправляет сообщение работодателю --> |
237 | @include('modals.send_worker_new') | 237 | @include('modals.send_worker_new') |
238 | 238 | ||
239 | <!-- Работодатель отправляет сообщение соискателю --> | 239 | <!-- Работодатель отправляет сообщение соискателю --> |
240 | @include('modals.send_employer') | 240 | @include('modals.send_employer') |
241 | 241 | ||
242 | <!-- Сообщение-предупреждение о том, что сообщения только можно отправить авторизованным пользователям --> | 242 | <!-- Сообщение-предупреждение о том, что сообщения только можно отправить авторизованным пользователям --> |
243 | @include('modals.send_message_noaut') | 243 | @include('modals.send_message_noaut') |
244 | 244 | ||
245 | @include('modals.send_message_noaut2') | 245 | @include('modals.send_message_noaut2') |
246 | 246 | ||
247 | <!-- Форма авторизации --> | 247 | <!-- Форма авторизации --> |
248 | @include('modals.send_login') | 248 | @include('modals.send_login') |
249 | 249 | ||
250 | <!-- Сбросить пароль --> | 250 | <!-- Сбросить пароль --> |
251 | @include('modals.reset_password') | 251 | @include('modals.reset_password') |
252 | 252 | ||
253 | <!-- Регистрация --> | 253 | <!-- Регистрация --> |
254 | @include('modals.register') | 254 | @include('modals.register') |
255 | 255 | ||
256 | <!-- Благодарность по отправке сообщения работодателю --> | 256 | <!-- Благодарность по отправке сообщения работодателю --> |
257 | @include('modals.thank_you_send_employer') | 257 | @include('modals.thank_you_send_employer') |
258 | 258 | ||
259 | <!-- Благодарность по отправке сообщения менеджеру --> | 259 | <!-- Благодарность по отправке сообщения менеджеру --> |
260 | @include('modals.thank_you_send_manager') | 260 | @include('modals.thank_you_send_manager') |
261 | 261 | ||
262 | <!-- Благодарность после регистрации --> | 262 | <!-- Благодарность после регистрации --> |
263 | @include('modals.thank_you_send_for_employer') | 263 | @include('modals.thank_you_send_for_employer') |
264 | 264 | ||
265 | <!-- Благодарность после регистрации для работника --> | 265 | <!-- Благодарность после регистрации для работника --> |
266 | @include('modals.thank_you_send_for_worker') | 266 | @include('modals.thank_you_send_for_worker') |
267 | 267 | ||
268 | <!-- Подтверждение удаления профиля --> | 268 | <!-- Подтверждение удаления профиля --> |
269 | @include('modals.delete_profile') | 269 | @include('modals.delete_profile') |
270 | 270 | ||
271 | <!-- Подверждение об удалении профиля --> | 271 | <!-- Подверждение об удалении профиля --> |
272 | @include('modals.success_delete_profile') | 272 | @include('modals.success_delete_profile') |
273 | 273 | ||
274 | </div> <!-- END MODALS WRAPPER --> | 274 | </div> <!-- END MODALS WRAPPER --> |
275 | 275 | ||
276 | 276 | ||
277 | <script src="{{ asset('js/jquery.maskedinput.js') }}"></script> | 277 | <script src="{{ asset('js/jquery.maskedinput.js') }}"></script> |
278 | <script src="{{ asset('js/jquery.fancybox.js') }}"></script> | 278 | <script src="{{ asset('js/jquery.fancybox.js') }}"></script> |
279 | <script src="{{ asset('js/jquery.select2.js') }}"></script> | 279 | <script src="{{ asset('js/jquery.select2.js') }}"></script> |
280 | <script src="{{ asset('js/swiper.js') }}"></script> | 280 | <script src="{{ asset('js/swiper.js') }}"></script> |
281 | <script src="{{ asset('js/script-vc.js') }}"></script> | 281 | <script src="{{ asset('js/script-vc.js') }}"></script> |
282 | <script src="{{ asset('js/star-rating.min.js') }}"></script> | 282 | <script src="{{ asset('js/star-rating.min.js') }}"></script> |
283 | <script> | 283 | <script> |
284 | var getUrlParameter = function getUrlParameter(sParam) { | 284 | var getUrlParameter = function getUrlParameter(sParam) { |
285 | var sPageURL = decodeURIComponent(window.location.search.substring(1)), | 285 | var sPageURL = decodeURIComponent(window.location.search.substring(1)), |
286 | sURLVariables = sPageURL.split('&'), | 286 | sURLVariables = sPageURL.split('&'), |
287 | sParameterName, | 287 | sParameterName, |
288 | i; | 288 | i; |
289 | for (i = 0; i < sURLVariables.length; i++) { | 289 | for (i = 0; i < sURLVariables.length; i++) { |
290 | sParameterName = sURLVariables[i].split('='); | 290 | sParameterName = sURLVariables[i].split('='); |
291 | if (sParameterName[0] === sParam) { | 291 | if (sParameterName[0] === sParam) { |
292 | return sParameterName[1] === undefined ? true : sParameterName[1]; | 292 | return sParameterName[1] === undefined ? true : sParameterName[1]; |
293 | } | 293 | } |
294 | } | 294 | } |
295 | }; | 295 | }; |
296 | </script> | 296 | </script> |
297 | @yield('scripts') | 297 | @yield('scripts') |
298 | 298 | ||
299 | @include('js.modals') | 299 | @include('js.modals') |
300 | @include('js.cookies') | 300 | @include('js.cookies') |
301 | 301 | ||
302 | </body> | 302 | </body> |
303 | </html> | 303 | </html> |
304 | 304 |
resources/views/list_vacancies.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' => 'Вакансии РекаМоре']) | 5 | @extends('layout.frontend', ['title' => 'Вакансии РекаМоре']) |
6 | 6 | ||
7 | @section('scripts') | 7 | @section('scripts') |
8 | <script> | 8 | <script> |
9 | console.log('Test system'); | 9 | console.log('Test system'); |
10 | $(document).on('change', '#jobs', function() { | 10 | $(document).on('change', '#jobs', function() { |
11 | var val = $(this).val(); | 11 | var val = $(this).val(); |
12 | var main_oskar = $('#main_ockar'); | 12 | var main_oskar = $('#main_ockar'); |
13 | var ti_head = $('#title_head'); | 13 | var ti_head = $('#title_head'); |
14 | 14 | ||
15 | console.log('Code='+val); | 15 | console.log('Code='+val); |
16 | console.log('Click change...'); | 16 | console.log('Click change...'); |
17 | $.ajax({ | 17 | $.ajax({ |
18 | type: "GET", | 18 | type: "GET", |
19 | url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", | 19 | url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", |
20 | data: "job="+val, | 20 | data: "job="+val, |
21 | success: function (data) { | 21 | success: function (data) { |
22 | console.log('Выбор сделан!'); | 22 | console.log('Выбор сделан!'); |
23 | 23 | ||
24 | main_oskar.html(data); | 24 | main_oskar.html(data); |
25 | history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?job="+val+"@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); | 25 | history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?job="+val+"@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); |
26 | }, | 26 | }, |
27 | headers: { | 27 | headers: { |
28 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 28 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
29 | }, | 29 | }, |
30 | error: function (data) { | 30 | error: function (data) { |
31 | data = JSON.stringify(data); | 31 | data = JSON.stringify(data); |
32 | console.log('Error: ' + data); | 32 | console.log('Error: ' + data); |
33 | } | 33 | } |
34 | }); | 34 | }); |
35 | 35 | ||
36 | if ((val == '') || (val == '0')) { | 36 | if ((val == '') || (val == '0')) { |
37 | title_head.html('Все категории'); | 37 | title_head.html('Все категории'); |
38 | } else { | 38 | } else { |
39 | $.ajax({ | 39 | $.ajax({ |
40 | type: "GET", | 40 | type: "GET", |
41 | url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}?@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif", | 41 | url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}?@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif", |
42 | data: "job=" + val +"&title=1", | 42 | data: "job=" + val +"&title=1", |
43 | success: function (data) { | 43 | success: function (data) { |
44 | 44 | ||
45 | console.log(data); | 45 | console.log(data); |
46 | }, | 46 | }, |
47 | 47 | ||
48 | headers: { | 48 | headers: { |
49 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 49 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
50 | }, | 50 | }, |
51 | 51 | ||
52 | error: function (data) { | 52 | error: function (data) { |
53 | data = JSON.stringify(data); | 53 | data = JSON.stringify(data); |
54 | console.log('Error: ' + data); | 54 | console.log('Error: ' + data); |
55 | } | 55 | } |
56 | }); | 56 | }); |
57 | 57 | ||
58 | } | 58 | } |
59 | }); | 59 | }); |
60 | 60 | ||
61 | $(document).on('click', '.js_send_it_button', function() { | 61 | $(document).on('click', '.js_send_it_button', function() { |
62 | var this_ = $(this); | 62 | var this_ = $(this); |
63 | var code_user_id = this_.attr('data-uid'); | 63 | var code_user_id = this_.attr('data-uid'); |
64 | var code_to_user_id = this_.attr('data-tuid'); | 64 | var code_to_user_id = this_.attr('data-tuid'); |
65 | var code_vacancy = this_.attr('data-vacancy'); | 65 | var code_vacancy = this_.attr('data-vacancy'); |
66 | var user_id = $('#_user_id'); | 66 | var user_id = $('#_user_id'); |
67 | var to_user_id = $('#_to_user_id'); | 67 | var to_user_id = $('#_to_user_id'); |
68 | var vacancy = $('#_vacancy'); | 68 | var vacancy = $('#_vacancy'); |
69 | 69 | ||
70 | console.log('Клик на кнопки...'); | 70 | console.log('Клик на кнопки...'); |
71 | 71 | ||
72 | user_id.val(code_user_id); | 72 | user_id.val(code_user_id); |
73 | to_user_id.val(code_to_user_id); | 73 | to_user_id.val(code_to_user_id); |
74 | vacancy.val(code_vacancy); | 74 | vacancy.val(code_vacancy); |
75 | }); | 75 | }); |
76 | 76 | ||
77 | $(document).on('change', '#sort_ajax', function() { | 77 | $(document).on('change', '#sort_ajax', function() { |
78 | var this_ = $(this); | 78 | var this_ = $(this); |
79 | var val_ = this_.val(); | 79 | var val_ = this_.val(); |
80 | console.log('sort items '+val_); | 80 | console.log('sort items '+val_); |
81 | 81 | ||
82 | $.ajax({ | 82 | $.ajax({ |
83 | type: "GET", | 83 | type: "GET", |
84 | url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", | 84 | url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", |
85 | data: "sort="+val_+"&block=1", | 85 | data: "sort="+val_+"&block=1", |
86 | success: function (data) { | 86 | success: function (data) { |
87 | console.log('Выбор сортировки'); | 87 | console.log('Выбор сортировки'); |
88 | console.log(data); | 88 | console.log(data); |
89 | $('#main_ockar').html(data); | 89 | $('#main_ockar').html(data); |
90 | history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?sort="+val_+"@if (isset($_GET['job']))&job={{ $_GET['job'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); | 90 | history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?sort="+val_+"@if (isset($_GET['job']))&job={{ $_GET['job'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); |
91 | }, | 91 | }, |
92 | headers: { | 92 | headers: { |
93 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 93 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
94 | }, | 94 | }, |
95 | error: function (data) { | 95 | error: function (data) { |
96 | data = JSON.stringify(data); | 96 | data = JSON.stringify(data); |
97 | console.log('Error: ' + data); | 97 | console.log('Error: ' + data); |
98 | } | 98 | } |
99 | }); | 99 | }); |
100 | }); | 100 | }); |
101 | 101 | ||
102 | 102 | ||
103 | 103 | ||
104 | $(document).ready(function(){ | 104 | $(document).ready(function(){ |
105 | var sel = $('#select2-sort_ajax-container'); | 105 | var sel = $('#select2-sort_ajax-container'); |
106 | var key = getUrlParameter('sort'); | 106 | var key = getUrlParameter('sort'); |
107 | console.log(sel); | 107 | console.log(sel); |
108 | console.log(key); | 108 | console.log(key); |
109 | 109 | ||
110 | if (key !=='') { | 110 | if (key !=='') { |
111 | console.log(key); | 111 | console.log(key); |
112 | switch (key) { | 112 | switch (key) { |
113 | case "default": sel.html('Сортировка (по умолчанию)'); break; | 113 | case "default": sel.html('Сортировка (по умолчанию)'); break; |
114 | case "name_up": sel.html('По имени (возрастание)'); break; | 114 | case "name_up": sel.html('По имени (возрастание)'); break; |
115 | case "name_down": sel.html('По дате (убывание)'); break; | 115 | case "name_down": sel.html('По дате (убывание)'); break; |
116 | case "created_at_up": sel.html('По дате (возрастание)'); break; | 116 | case "created_at_up": sel.html('По дате (возрастание)'); break; |
117 | case "created_at_down": sel.html('По дате (убывание)'); break; | 117 | case "created_at_down": sel.html('По дате (убывание)'); break; |
118 | } | 118 | } |
119 | 119 | ||
120 | } | 120 | } |
121 | }); | 121 | }); |
122 | </script> | 122 | </script> |
123 | @include('js.favorite-vacancy-45') | 123 | @include('js.favorite-vacancy-45') |
124 | @endsection | 124 | @endsection |
125 | @section('content') | 125 | @section('content') |
126 | <section class="thing"> | 126 | <section class="thing"> |
127 | <div class="container"> | 127 | <div class="container"> |
128 | <form class="thing__body" action="{{ route('list-vacancies', ['categories' => (!empty($Name_categori)) ? $Name_categori[0]->id : '0']) }}" method="POST"> | 128 | <form class="thing__body" action="{{ route('list-vacancies', ['categories' => (!empty($Name_categori)) ? $Name_categori[0]->id : '0']) }}" method="POST"> |
129 | <ul class="breadcrumbs thing__breadcrumbs"> | 129 | <ul class="breadcrumbs thing__breadcrumbs"> |
130 | <li><a href="{{ route('index') }}">Главная</a></li> | 130 | <li><a href="{{ route('index') }}">Главная</a></li> |
131 | <li><a href="{{ route('vacancies') }}">Вакансии</a></li> | 131 | <li><a href="{{ route('vacancies') }}">Вакансии</a></li> |
132 | <li><b>{{ isset($Name_categori[0]) ? $Name_categori[0]->name : 'Все категории' }}</b></li> | 132 | <li><b>{{ isset($Name_categori[0]) ? $Name_categori[0]->name : 'Все категории' }}</b></li> |
133 | </ul> | 133 | </ul> |
134 | <h1 class="thing__title">Вакансии</h1> | 134 | <h1 class="thing__title">Вакансии</h1> |
135 | <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для | 135 | <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для |
136 | существующих финансовых и административных условий.</p> | 136 | существующих финансовых и административных условий.</p> |
137 | <div class="select select_search thing__select"> | 137 | <div class="select select_search thing__select"> |
138 | <div class="select__icon"> | 138 | <div class="select__icon"> |
139 | <svg> | 139 | <svg> |
140 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> | 140 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> |
141 | </svg> | 141 | </svg> |
142 | </div> | 142 | </div> |
143 | <select class="js-select2" id="jobs" name="jobs"> | 143 | <select class="js-select2" id="jobs" name="jobs"> |
144 | <option value="0" selected>Выберите должность</option> | 144 | <option value="0" selected>Выберите должность</option> |
145 | @if ($Job_title->count()) | 145 | @if ($Job_title->count()) |
146 | @foreach($Job_title as $JT) | 146 | @foreach($Job_title as $JT) |
147 | <option value="{{ $JT->id }}">{{ $JT->name }}</option> | 147 | <option value="{{ $JT->id }}">{{ $JT->name }}</option> |
148 | @endforeach | 148 | @endforeach |
149 | @endif | 149 | @endif |
150 | </select> | 150 | </select> |
151 | </div> | 151 | </div> |
152 | </form> | 152 | </form> |
153 | </div> | 153 | </div> |
154 | </section> | 154 | </section> |
155 | <main class="main"> | 155 | <main class="main"> |
156 | <div class="container"> | 156 | <div class="container"> |
157 | <div class="main__vacancies" > | 157 | <div class="main__vacancies" > |
158 | @if (isset($Name_categori[0]->name)) | 158 | @if (isset($Name_categori[0]->name)) |
159 | <h2 class="main__vacancies-title">Категория вакансий {{ $Name_categori[0]->name }}</h2> | 159 | <h2 class="main__vacancies-title">Категория вакансий {{ $Name_categori[0]->name }}</h2> |
160 | @else | 160 | @else |
161 | <h2 class="main__vacancies-title" id="title_head" name="title_head">Все категории</h2> | 161 | <h2 class="main__vacancies-title" id="title_head" name="title_head">Все категории</h2> |
162 | @endif | 162 | @endif |
163 | <div class="filters main__vacancies-filters"> | 163 | <div class="filters main__vacancies-filters"> |
164 | <div class="filters__label" id="col-vo" name="col-vo">Показано {{ $Query->firstItem() }} – {{ $Query->lastItem() }} из @isset($Query_count) {{ $Query_count }} @else 0 @endisset результатов поиска</div> | 164 | <div class="filters__label" id="col-vo" name="col-vo">Показано {{ $Query->firstItem() }} – {{ $Query->lastItem() }} из @isset($Query_count) {{ $Query_count }} @else 0 @endisset результатов поиска</div> |
165 | <div class="filters__body"> | 165 | <div class="filters__body"> |
166 | <div class="select filters__select"> | 166 | <div class="select filters__select"> |
167 | <select class="js-select2" id="sort_ajax" name="sort_ajax"> | 167 | <select class="js-select2" id="sort_ajax" name="sort_ajax"> |
168 | <option value="default">Сортировка (по умолчанию)</option> | 168 | <option value="default">Сортировка (по умолчанию)</option> |
169 | <option value="name_up">По имени (возрастание)</option> | 169 | <option value="name_up">По имени (возрастание)</option> |
170 | <option value="name_down">По имени (убывание)</option> | 170 | <option value="name_down">По имени (убывание)</option> |
171 | <option value="created_at_up">По дате (возрастание)</option> | 171 | <option value="created_at_up">По дате (возрастание)</option> |
172 | <option value="created_at_down">По дате (убывание)</option> | 172 | <option value="created_at_down">По дате (убывание)</option> |
173 | </select> | 173 | </select> |
174 | </div> | 174 | </div> |
175 | </div> | 175 | </div> |
176 | </div> | 176 | </div> |
177 | 177 | ||
178 | <div class="main__vacancies" style="width:100%;" id="main_ockar" name="main_oskar"> | 178 | <div class="main__vacancies" style="width:100%;" id="main_ockar" name="main_oskar"> |
179 | @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp | 179 | @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp |
180 | 180 | ||
181 | @foreach ($Query as $Q) | 181 | @foreach ($Query as $Q) |
182 | @foreach ($Reclama as $Rec) | 182 | @foreach ($Reclama as $Rec) |
183 | @if ($Rec->position == $i) | 183 | @if ($Rec->position == $i) |
184 | <div class="main__vacancies-thing"> | 184 | <div class="main__vacancies-thing"> |
185 | @if (!empty($Rec->image)) | 185 | @if (!empty($Rec->image)) |
186 | <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> | 186 | <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> |
187 | @else | 187 | @else |
188 | <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> | 188 | <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> |
189 | @endif | 189 | @endif |
190 | <div class="main__vacancies-thing-body"> | 190 | <div class="main__vacancies-thing-body"> |
191 | <h2>{{ $Rec->title }}</h2> | 191 | <h2>{{ $Rec->title }}</h2> |
192 | <div class="main__vacancies-thing-scroll"> | 192 | <div class="main__vacancies-thing-scroll"> |
193 | {!! $Rec->text !!} | 193 | {!! $Rec->text !!} |
194 | </div> | 194 | </div> |
195 | <a href="{{ $Rec->link }}" class="button">Узнать больше</a> | 195 | <a href="{{ $Rec->link }}" class="button">Узнать больше</a> |
196 | </div> | 196 | </div> |
197 | </div> | 197 | </div> |
198 | @endif | 198 | @endif |
199 | @endforeach | 199 | @endforeach |
200 | <div class="main__vacancies-item main__employer-page-two-item" data-id="{{ $Q->id }}"> | 200 | <div class="main__vacancies-item main__employer-page-two-item" data-id="{{ $Q->id }}"> |
201 | 201 | ||
202 | <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" class="back main__employer-page-two-item-back"> | 202 | <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" class="back main__employer-page-two-item-back"> |
203 | <svg> | 203 | <svg> |
204 | <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> | 204 | <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> |
205 | </svg> | 205 | </svg> |
206 | <span> | 206 | <span> |
207 | Вернуться к списку вакансий 123 | 207 | Вернуться к списку вакансий 123 |
208 | </span> | 208 | </span> |
209 | </a> | 209 | </a> |
210 | 210 | ||
211 | <div class="main__employer-page-two-item-toper"> | 211 | <div class="main__employer-page-two-item-toper"> |
212 | @if (!empty($Q->employer->logo)) | 212 | @if (!empty($Q->employer->logo)) |
213 | <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}"> | 213 | <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}"> |
214 | @else | 214 | @else |
215 | <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> | 215 | <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> |
216 | @endif | 216 | @endif |
217 | <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span> | 217 | <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span> |
218 | </div> | 218 | </div> |
219 | 219 | ||
220 | <div class="main__employer-page-two-item-text"> | 220 | <div class="main__employer-page-two-item-text"> |
221 | <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор | 221 | <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор |
222 | специалистов на следующие должности:</div> | 222 | специалистов на следующие должности:</div> |
223 | <div class="main__employer-page-two-item-text-links"> | 223 | <div class="main__employer-page-two-item-text-links"> |
224 | @if (isset($Q->jobs)) | 224 | @if (isset($Q->jobs)) |
225 | @foreach ($Q->jobs as $key => $j) | 225 | @foreach ($Q->jobs as $key => $j) |
226 | <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> | 226 | <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> |
227 | @endforeach | 227 | @endforeach |
228 | @endif | 228 | @endif |
229 | </div> | 229 | </div> |
230 | </div> | 230 | </div> |
231 | 231 | ||
232 | <div class="main__employer-page-two-item-text"> | 232 | <div class="main__employer-page-two-item-text"> |
233 | <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> | 233 | <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> |
234 | <div class="main__employer-page-two-item-text-body"> | 234 | <div class="main__employer-page-two-item-text-body"> |
235 | {!! $Q->text !!} | 235 | {!! $Q->text !!} |
236 | </div> | 236 | </div> |
237 | </div> | 237 | </div> |
238 | <div class="main__employer-page-two-item-text"> | 238 | <div class="main__employer-page-two-item-text"> |
239 | <div class="main__employer-page-two-item-text-name">Наши ожидания:</div> | 239 | <div class="main__employer-page-two-item-text-name">Наши ожидания:</div> |
240 | <div class="main__employer-page-two-item-text-body"> | 240 | <div class="main__employer-page-two-item-text-body"> |
241 | {!! $Q->description !!} | 241 | {!! $Q->description !!} |
242 | </div> | 242 | </div> |
243 | </div> | 243 | </div> |
244 | <div class="main__employer-page-two-item-text"> | 244 | <div class="main__employer-page-two-item-text"> |
245 | <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div> | 245 | <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div> |
246 | <div class="main__employer-page-two-item-text-body"> | 246 | <div class="main__employer-page-two-item-text-body"> |
247 | {!! $Q->contacts_emails !!} | 247 | {!! $Q->contacts_emails !!} |
248 | </div> | 248 | </div> |
249 | </div> | 249 | </div> |
250 | <div class="main__employer-page-two-item-text"> | 250 | <div class="main__employer-page-two-item-text"> |
251 | <div class="main__employer-page-two-item-text-name">Или звоните:</div> | 251 | <div class="main__employer-page-two-item-text-name">Или звоните:</div> |
252 | <div class="main__employer-page-two-item-text-body"> | 252 | <div class="main__employer-page-two-item-text-body"> |
253 | {!! $Q->contacts_telephones !!} | 253 | {!! $Q->contacts_telephones !!} |
254 | </div> | 254 | </div> |
255 | </div> | 255 | </div> |
256 | 256 | ||
257 | <div class="main__employer-page-two-item-tags"> | 257 | <div class="main__employer-page-two-item-tags"> |
258 | @if (!empty($Q->jobs_code[0]->position_ship)) | 258 | @if (!empty($Q->jobs_code[0]->position_ship)) |
259 | <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span> | 259 | <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span> |
260 | @else | 260 | @else |
261 | @if (isset($Q->jobs)) | 261 | @if (isset($Q->jobs)) |
262 | @foreach ($Q->jobs as $key => $j) | 262 | @foreach ($Q->jobs as $key => $j) |
263 | <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span> | 263 | <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span> |
264 | @endforeach | 264 | @endforeach |
265 | @endif | 265 | @endif |
266 | @endif | 266 | @endif |
267 | </div> | 267 | </div> |
268 | <div class="main__employer-page-two-item-buttons"> | 268 | <div class="main__employer-page-two-item-buttons"> |
269 | @guest | 269 | @guest |
270 | <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' | 270 | <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' |
271 | class="button main__employer-page-two-item-button">Откликнуться</button> | 271 | class="button main__employer-page-two-item-button">Откликнуться</button> |
272 | @else | 272 | @else |
273 | @if (App\Classes\StatusUser::Status()==1) | 273 | @if (App\Classes\StatusUser::Status()==1) |
274 | <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}' | 274 | <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}' |
275 | class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> | 275 | class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> |
276 | @else | 276 | @else |
277 | <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}' | 277 | <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}' |
278 | class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> | 278 | class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> |
279 | @endif | 279 | @endif |
280 | @endguest | 280 | @endguest |
281 | <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a> | 281 | <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a> |
282 | </div> | 282 | </div> |
283 | <div class="main__employer-page-two-item-bottom"> | 283 | <div class="main__employer-page-two-item-bottom"> |
284 | <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div> | 284 | <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div> |
285 | <button type="button" id="like{{ $Q->id }}" 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) }}"> | 285 | <button type="button" id="like{{ $Q->id }}" 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) }}"> |
286 | <svg> | 286 | <svg> |
287 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> | 287 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> |
288 | </svg> | 288 | </svg> |
289 | </button> | 289 | </button> |
290 | </div> | 290 | </div> |
291 | </div> | 291 | </div> |
292 | @php $i++ @endphp | 292 | @php $i++ @endphp |
293 | @endforeach | 293 | @endforeach |
294 | <div style="margin-top: 20px"> | 294 | <div style="margin-top: 20px"> |
295 | {{ $Query->appends($_GET)->links('paginate') }} | 295 | {{ $Query->appends($_GET)->links('paginate') }} |
296 | </div><!-- конец --> | 296 | </div><!-- конец --> |
297 | 297 | ||
298 | </div> | 298 | </div> |
299 | </div> | 299 | </div> |
300 | </div> | 300 | </div> |
301 | </main> | 301 | </main> |
302 | @endsection | 302 | @endsection |
303 | 303 |
resources/views/news-list.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', '#jobs', function() { | 6 | $(document).on('change', '#jobs', function() { |
7 | var val = $(this).val(); | 7 | var val = $(this).val(); |
8 | var main_oskar = $('#Main_Ajax'); | 8 | var main_oskar = $('#Main_Ajax'); |
9 | 9 | ||
10 | console.log('Code='+val); | 10 | console.log('Code='+val); |
11 | console.log('Click change...'); | 11 | console.log('Click change...'); |
12 | $.ajax({ | 12 | $.ajax({ |
13 | type: "GET", | 13 | type: "GET", |
14 | url: "{{ route('news') }}", | 14 | url: "{{ route('news') }}", |
15 | data: "job="+val, | 15 | data: "job="+val, |
16 | success: function (data) { | 16 | success: function (data) { |
17 | console.log('Выбор сделан!'); | 17 | console.log('Выбор сделан!'); |
18 | console.log(data); | 18 | console.log(data); |
19 | main_oskar.html(data); | 19 | main_oskar.html(data); |
20 | history.pushState({}, '', "{{ route('news') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); | 20 | history.pushState({}, '', "{{ route('news') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); |
21 | }, | 21 | }, |
22 | headers: { | 22 | headers: { |
23 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 23 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
24 | }, | 24 | }, |
25 | error: function (data) { | 25 | error: function (data) { |
26 | data = JSON.stringify(data); | 26 | data = JSON.stringify(data); |
27 | console.log('Error: ' + data); | 27 | console.log('Error: ' + data); |
28 | } | 28 | } |
29 | }); | 29 | }); |
30 | }); | 30 | }); |
31 | 31 | ||
32 | $(document).on('click', '.js_send_it_button', function() { | 32 | $(document).on('click', '.js_send_it_button', function() { |
33 | var this_ = $(this); | 33 | var this_ = $(this); |
34 | var code_user_id = this_.attr('data-uid'); | 34 | var code_user_id = this_.attr('data-uid'); |
35 | var code_to_user_id = this_.attr('data-tuid'); | 35 | var code_to_user_id = this_.attr('data-tuid'); |
36 | var code_vacancy = this_.attr('data-vacancy'); | 36 | var code_vacancy = this_.attr('data-vacancy'); |
37 | var user_id = $('#_user_id'); | 37 | var user_id = $('#_user_id'); |
38 | var to_user_id = $('#_to_user_id'); | 38 | var to_user_id = $('#_to_user_id'); |
39 | var vacancy = $('#_vacancy'); | 39 | var vacancy = $('#_vacancy'); |
40 | 40 | ||
41 | console.log('Клик на кнопки...'); | 41 | console.log('Клик на кнопки...'); |
42 | 42 | ||
43 | user_id.val(code_user_id); | 43 | user_id.val(code_user_id); |
44 | to_user_id.val(code_to_user_id); | 44 | to_user_id.val(code_to_user_id); |
45 | vacancy.val(code_vacancy); | 45 | vacancy.val(code_vacancy); |
46 | }); | 46 | }); |
47 | 47 | ||
48 | $(document).on('change', '#sort_ajax', function() { | 48 | $(document).on('change', '#sort_ajax', function() { |
49 | var this_ = $(this); | 49 | var this_ = $(this); |
50 | var val_ = this_.val(); | 50 | var val_ = this_.val(); |
51 | console.log('sort items '+val_); | 51 | console.log('sort items '+val_); |
52 | 52 | ||
53 | $.ajax({ | 53 | $.ajax({ |
54 | type: "GET", | 54 | type: "GET", |
55 | url: "{{ route('news') }}", | 55 | url: "{{ route('news') }}", |
56 | data: "sort="+val_+"&block=1", | 56 | data: "sort="+val_+"&block=1", |
57 | success: function (data) { | 57 | success: function (data) { |
58 | console.log('Выбор сортировки'); | 58 | console.log('Выбор сортировки'); |
59 | console.log(data); | 59 | console.log(data); |
60 | $('#main_ockar').html(data); | 60 | $('#main_ockar').html(data); |
61 | history.pushState({}, '', "{{ route('news') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); | 61 | history.pushState({}, '', "{{ route('news') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); |
62 | }, | 62 | }, |
63 | headers: { | 63 | headers: { |
64 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 64 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
65 | }, | 65 | }, |
66 | error: function (data) { | 66 | error: function (data) { |
67 | data = JSON.stringify(data); | 67 | data = JSON.stringify(data); |
68 | console.log('Error: ' + data); | 68 | console.log('Error: ' + data); |
69 | } | 69 | } |
70 | }); | 70 | }); |
71 | }); | 71 | }); |
72 | 72 | ||
73 | $(document).ready(function(){ | 73 | $(document).ready(function(){ |
74 | var sel = $('#select2-sort_ajax-container'); | 74 | var sel = $('#select2-sort_ajax-container'); |
75 | var key = getUrlParameter('sort'); | 75 | var key = getUrlParameter('sort'); |
76 | console.log(sel); | 76 | console.log(sel); |
77 | console.log(key); | 77 | console.log(key); |
78 | 78 | ||
79 | if (key !=='') { | 79 | if (key !=='') { |
80 | console.log(key); | 80 | console.log(key); |
81 | switch (key) { | 81 | switch (key) { |
82 | case "default": sel.html('Сортировка (по умолчанию)'); break; | 82 | case "default": sel.html('Сортировка (по умолчанию)'); break; |
83 | case "name_up": sel.html('По имени (возрастание)'); break; | 83 | case "name_up": sel.html('По имени (возрастание)'); break; |
84 | case "name_down": sel.html('По дате (убывание)'); break; | 84 | case "name_down": sel.html('По дате (убывание)'); break; |
85 | case "created_at_up": sel.html('По дате (возрастание)'); break; | 85 | case "created_at_up": sel.html('По дате (возрастание)'); break; |
86 | case "created_at_down": sel.html('По дате (убывание)'); break; | 86 | case "created_at_down": sel.html('По дате (убывание)'); break; |
87 | } | 87 | } |
88 | 88 | ||
89 | } | 89 | } |
90 | }); | 90 | }); |
91 | </script> | 91 | </script> |
92 | @include('js.favorite-vacancy') | 92 | @include('js.favorite-vacancy') |
93 | @endsection | 93 | @endsection |
94 | @section('content') | 94 | @section('content') |
95 | <section class="thing"> | 95 | <section class="thing"> |
96 | <div class="container"> | 96 | <div class="container"> |
97 | <form class="thing__body" action="{{ route('news') }}" method="GET"> | 97 | <form class="thing__body" action="{{ route('news') }}" method="GET"> |
98 | <ul class="breadcrumbs thing__breadcrumbs"> | 98 | <ul class="breadcrumbs thing__breadcrumbs"> |
99 | <li><a href="{{ route('index') }}">Главная</a></li> | 99 | <li><a href="{{ route('index') }}">Главная</a></li> |
100 | <li><b>Новости</b></li> | 100 | <li><b>Новости</b></li> |
101 | </ul> | ||
102 | <h1 class="thing__title">Новости</h1> | 101 | </ul> |
103 | <p class="thing__text">Информационные блоки и новости о компании и событиях в мире</p> | 102 | <h1 class="thing__title">Новости</h1> |
104 | <div class="search thing__search"> | 103 | <p class="thing__text">Информационные блоки и новости о компании и событиях в мире</p> |
105 | <input type="search" id="search" name="search" class="input" placeholder="Введите наименование статьи" value="@if (!empty($_GET['search'])) {{ $_GET['search'] }} @endif"> | ||
106 | <button type="submit" class="button">Найти</button> | 104 | <div class="search thing__search"> |
107 | <span> | 105 | <input type="search" id="search" name="search" class="input" placeholder="Введите наименование статьи" value="@if (!empty($_GET['search'])) {{ $_GET['search'] }} @endif"> |
108 | <svg> | 106 | <button type="submit" class="button">Найти</button> |
109 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> | 107 | <span> |
110 | </svg> | 108 | <svg> |
111 | </span> | 109 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> |
112 | </div> | 110 | </svg> |
113 | </form> | 111 | </span> |
114 | </div> | 112 | </div> |
115 | </section> | 113 | </form> |
116 | <main class="main rus"> | 114 | </div> |
117 | <div class="container"> | 115 | </section> |
118 | <div class="main__employers"> | 116 | <main class="main rus"> |
119 | <div class="filters"> | 117 | <div class="container"> |
120 | <div class="filters__label" id="col-vo" name="col-vo">Показано {{ $Query->firstItem() }} – {{ $Query->lastItem() }} из @isset($Query_count) {{ $Query_count }} @else 0 @endisset результатов поиска</div> | 118 | <div class="main__employers"> |
121 | <div class="filters__body"> | 119 | <div class="filters"> |
122 | <div class="select filters__select"> | 120 | <div class="filters__label" id="col-vo" name="col-vo">Показано {{ $Query->firstItem() }} – {{ $Query->lastItem() }} из @isset($Query_count) {{ $Query_count }} @else 0 @endisset результатов поиска</div> |
123 | <select class="js-select2" id="sort_ajax" name="sort_ajax"> | 121 | <div class="filters__body"> |
124 | <option value="default">Сортировка (по умолчанию)</option> | 122 | <div class="select filters__select"> |
125 | <option value="name_up">По имени (возрастание)</option> | 123 | <select class="js-select2" id="sort_ajax" name="sort_ajax"> |
126 | <option value="name_down">По имени (убывание)</option> | 124 | <option value="default">Сортировка (по умолчанию)</option> |
127 | <option value="created_at_up">По дате (возрастание)</option> | 125 | <option value="name_up">По имени (возрастание)</option> |
128 | <option value="created_at_down">По дате (убывание)</option> | 126 | <option value="name_down">По имени (убывание)</option> |
129 | </select> | 127 | <option value="created_at_up">По дате (возрастание)</option> |
130 | </div> | 128 | <option value="created_at_down">По дате (убывание)</option> |
131 | </div> | 129 | </select> |
132 | </div> | 130 | </div> |
133 | <div id="Main_Ajax" name="Main_Ajax"> | 131 | </div> |
134 | 132 | </div> | |
135 | @if ($Query->count()) | 133 | <div id="Main_Ajax" name="Main_Ajax"> |
136 | <div class="news__items"> | 134 | |
137 | @foreach ($Query as $Q) | 135 | @if ($Query->count()) |
138 | <div class="news__item"> | 136 | <div class="news__items"> |
139 | @if (!empty(asset(Storage::url($Q->image)))) | 137 | @foreach ($Query as $Q) |
140 | <img src="{{ asset(Storage::url($Q->image)) }}" alt="{{ $Q->title }}" class="news__item-pic"> | 138 | <div class="news__item"> |
141 | @else | 139 | @if (!empty(asset(Storage::url($Q->image)))) |
142 | <img src="{{ asset('images/8.jpg') }}" alt="{{ $Q->title }}" class="news__item-pic"> | 140 | <img src="{{ asset(Storage::url($Q->image)) }}" alt="{{ $Q->title }}" class="news__item-pic"> |
143 | @endif | 141 | @else |
144 | <div class="news__item-body"> | 142 | <img src="{{ asset('images/8.jpg') }}" alt="{{ $Q->title }}" class="news__item-pic"> |
145 | <time datetime="{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}" class="news__item-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</time> | 143 | @endif |
146 | <span class="news__item-title">{{ $Q->title }}</span> | 144 | <div class="news__item-body"> |
147 | <span class="news__item-text">{!! $Q->text !!}</span> | 145 | <time datetime="{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}" class="news__item-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</time> |
148 | <a href="{{ route('detail_new', ['new' => $Q->id]) }}" class="news__item-more button button_light">Читать далее</a> | 146 | <span class="news__item-title">{{ $Q->title }}</span> |
149 | </div> | 147 | <span class="news__item-text">{!! $Q->text !!}</span> |
150 | </div> | 148 | <a href="{{ route('detail_new', ['new' => $Q->id]) }}" class="news__item-more button button_light">Читать далее</a> |
151 | @endforeach | 149 | </div> |
152 | </div> | 150 | </div> |
153 | {{ $Query->appends($_GET)->links('paginate') }} | 151 | @endforeach |
154 | @else | 152 | </div> |
155 | <div class="news__items"> | 153 | {{ $Query->appends($_GET)->links('paginate') }} |
156 | Нет никакой информации | 154 | @else |
157 | </div> | 155 | <div class="news__items"> |
158 | @endif | 156 | Нет никакой информации |
159 | </div> | 157 | </div> |
160 | 158 | @endif | |
161 | </div> | 159 | </div> |
162 | </div> | 160 | |
163 | </main> | 161 | </div> |
164 | </div> | 162 | </div> |
165 | 163 | </main> | |
166 | @endsection | 164 | </div> |
165 |
resources/views/resume.blade.php
1 | @extends('layout.frontend', ['title' => 'База резюме - РекаМоре']) | 1 | @extends('layout.frontend', ['title' => 'База резюме - РекаМоре']) |
2 | 2 | ||
3 | @section('scripts') | 3 | @section('scripts') |
4 | <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script> | 4 | <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script> |
5 | <script> | 5 | <script> |
6 | console.log('Test system'); | 6 | console.log('Test system'); |
7 | $(document).on('change', '#jobs', function() { | 7 | $(document).on('change', '#jobs', function() { |
8 | var val = $(this).val(); | 8 | var val = $(this).val(); |
9 | var main_oskar = $('#main_ockar'); | 9 | var main_oskar = $('#main_ockar'); |
10 | 10 | ||
11 | console.log('Code='+val); | 11 | console.log('Code='+val); |
12 | console.log('Click change...'); | 12 | console.log('Click change...'); |
13 | $.ajax({ | 13 | $.ajax({ |
14 | type: "GET", | 14 | type: "GET", |
15 | url: "", | 15 | url: "", |
16 | data: "job="+val, | 16 | data: "job="+val, |
17 | success: function (data) { | 17 | success: function (data) { |
18 | console.log('Выбор сделан!'); | 18 | console.log('Выбор сделан!'); |
19 | console.log(data); | 19 | console.log(data); |
20 | main_oskar.html(data); | 20 | main_oskar.html(data); |
21 | }, | 21 | }, |
22 | headers: { | 22 | headers: { |
23 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 23 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
24 | }, | 24 | }, |
25 | error: function (data) { | 25 | error: function (data) { |
26 | data = JSON.stringify(data); | 26 | data = JSON.stringify(data); |
27 | console.log('Error: ' + data); | 27 | console.log('Error: ' + data); |
28 | } | 28 | } |
29 | }); | 29 | }); |
30 | }); | 30 | }); |
31 | </script> | 31 | </script> |
32 | 32 | ||
33 | <script> | 33 | <script> |
34 | $(document).ready(function() { | 34 | $(document).ready(function() { |
35 | $(document).on('click', '.js_box_favorites', function () { | 35 | $(document).on('click', '.js_box_favorites', function () { |
36 | var _this = $(this); | 36 | var _this = $(this); |
37 | var id_worker = _this.attr('data-val'); | 37 | var id_worker = _this.attr('data-val'); |
38 | 38 | ||
39 | if (_this.hasClass('active')) { | 39 | if (_this.hasClass('active')) { |
40 | add_in_array(id_worker); | 40 | add_in_array(id_worker); |
41 | console.log('Добавлено в избранное id=' + id_worker); | 41 | console.log('Добавлено в избранное id=' + id_worker); |
42 | } else { | 42 | } else { |
43 | delete_in_array(id_worker); | 43 | delete_in_array(id_worker); |
44 | console.log('Удалено из избранных id='+id_worker) | 44 | console.log('Удалено из избранных id='+id_worker) |
45 | } | 45 | } |
46 | var str = $.cookie('favorite_worker'); | 46 | var str = $.cookie('favorite_worker'); |
47 | console.log("Вывод куков "+str); | 47 | console.log("Вывод куков "+str); |
48 | 48 | ||
49 | }); | 49 | }); |
50 | }); | 50 | }); |
51 | 51 | ||
52 | //помеченный элемент | 52 | //помеченный элемент |
53 | function selected_item(obj) { | 53 | function selected_item(obj) { |
54 | var arr = read_array(); | 54 | var arr = read_array(); |
55 | var index = arr.indexOf(obj); | 55 | var index = arr.indexOf(obj); |
56 | 56 | ||
57 | if (index > 0) | 57 | if (index > 0) |
58 | return "active"; | 58 | return "active"; |
59 | else | 59 | else |
60 | return ""; | 60 | return ""; |
61 | } | 61 | } |
62 | 62 | ||
63 | // запись элемента массива в cookie | 63 | // запись элемента массива в cookie |
64 | function add_in_array(obj){ | 64 | function add_in_array(obj){ |
65 | var arr = read_array();//получаем текущее состояние массива | 65 | var arr = read_array();//получаем текущее состояние массива |
66 | arr[arr.length]=obj; //добавляем элемент в конец | 66 | arr[arr.length]=obj; //добавляем элемент в конец |
67 | //var str = JSON.stringify(arr);//конвертируем в строку | 67 | //var str = JSON.stringify(arr);//конвертируем в строку |
68 | //$.cookie('arr',str);//записываем массив в куки | 68 | //$.cookie('arr',str);//записываем массив в куки |
69 | $.cookie('favorite_worker', JSON.stringify(arr)); | 69 | $.cookie('favorite_worker', JSON.stringify(arr)); |
70 | 70 | ||
71 | } | 71 | } |
72 | 72 | ||
73 | // удаление элемента из массива в cookie | 73 | // удаление элемента из массива в cookie |
74 | function delete_in_array(obj) { | 74 | function delete_in_array(obj) { |
75 | var arr = read_array(); | 75 | var arr = read_array(); |
76 | var unique = [...new Set(arr)] | 76 | var unique = [...new Set(arr)] |
77 | var index = unique.indexOf(obj); | 77 | var index = unique.indexOf(obj); |
78 | 78 | ||
79 | unique.splice(index, 1); | 79 | unique.splice(index, 1); |
80 | 80 | ||
81 | //var str = JSON.stringify(arr);//конвертируем в строку | 81 | //var str = JSON.stringify(arr);//конвертируем в строку |
82 | //$.cookie('arr',str);//записываем массив в куки | 82 | //$.cookie('arr',str);//записываем массив в куки |
83 | $.cookie('favorite_worker', JSON.stringify(unique)); | 83 | $.cookie('favorite_worker', JSON.stringify(unique)); |
84 | 84 | ||
85 | } | 85 | } |
86 | 86 | ||
87 | function read_array(){ | 87 | function read_array(){ |
88 | var dataArr=$.cookie('favorite_worker');//считываем данные из куков | 88 | var dataArr=$.cookie('favorite_worker');//считываем данные из куков |
89 | 89 | ||
90 | //если массив не был обнаружен, иницилизируем его | 90 | //если массив не был обнаружен, иницилизируем его |
91 | if(dataArr===null){ | 91 | if(dataArr===null){ |
92 | dataArr = init_array(); //возвращаем инициализированный пустой маасив | 92 | dataArr = init_array(); //возвращаем инициализированный пустой маасив |
93 | } | 93 | } |
94 | //возвращаем полученный массив | 94 | //возвращаем полученный массив |
95 | //return JSON.parse(dataArr); | 95 | //return JSON.parse(dataArr); |
96 | return JSON.parse(dataArr); | 96 | return JSON.parse(dataArr); |
97 | } | 97 | } |
98 | 98 | ||
99 | //другими словами создаем пустой массив | 99 | //другими словами создаем пустой массив |
100 | function init_array(){ | 100 | function init_array(){ |
101 | //var str = JSON.stringify(new Array());//конвертируем в строку | 101 | //var str = JSON.stringify(new Array());//конвертируем в строку |
102 | var str = JSON.stringify(new Array()); | 102 | var str = JSON.stringify(new Array()); |
103 | $.cookie('favorite_worker',str);//записываем массив в куки | 103 | $.cookie('favorite_worker',str);//записываем массив в куки |
104 | 104 | ||
105 | return str; | 105 | return str; |
106 | } | 106 | } |
107 | </script> | 107 | </script> |
108 | <script> | 108 | <script> |
109 | $(document).on('click', '.js_it_button', function() { | 109 | $(document).on('click', '.js_it_button', function() { |
110 | var this_ = $(this); | 110 | var this_ = $(this); |
111 | var code_user_id = this_.attr('data-uid'); | 111 | var code_user_id = this_.attr('data-uid'); |
112 | var code_to_user_id = this_.attr('data-tuid'); | 112 | var code_to_user_id = this_.attr('data-tuid'); |
113 | var code_vacancy = this_.attr('data-vacancy'); | 113 | var code_vacancy = this_.attr('data-vacancy'); |
114 | var user_id = $('#_user_id'); | 114 | var user_id = $('#_user_id'); |
115 | var to_user_id = $('#_to_user_id'); | 115 | var to_user_id = $('#_to_user_id'); |
116 | var vacancy = $('#_vacancy'); | 116 | var vacancy = $('#_vacancy'); |
117 | 117 | ||
118 | console.log('code_to_user_id='+code_to_user_id); | 118 | console.log('code_to_user_id='+code_to_user_id); |
119 | console.log('code_user_id='+code_user_id); | 119 | console.log('code_user_id='+code_user_id); |
120 | console.log('code_vacancy='+code_vacancy); | 120 | console.log('code_vacancy='+code_vacancy); |
121 | console.log('Клик на кнопке...'); | 121 | console.log('Клик на кнопке...'); |
122 | 122 | ||
123 | user_id.val(code_user_id); | 123 | user_id.val(code_user_id); |
124 | to_user_id.val(code_to_user_id); | 124 | to_user_id.val(code_to_user_id); |
125 | vacancy.val(code_vacancy); | 125 | vacancy.val(code_vacancy); |
126 | }); | 126 | }); |
127 | </script> | 127 | </script> |
128 | <script> | 128 | <script> |
129 | $(document).on('change', '#sort_ajax', function() { | 129 | $(document).on('change', '#sort_ajax', function() { |
130 | var this_ = $(this); | 130 | var this_ = $(this); |
131 | var val_ = this_.val(); | 131 | var val_ = this_.val(); |
132 | console.log('sort items '+val_); | 132 | console.log('sort items '+val_); |
133 | 133 | ||
134 | $.ajax({ | 134 | $.ajax({ |
135 | type: "GET", | 135 | type: "GET", |
136 | url: "{{ route('bd_resume') }}", | 136 | url: "{{ route('bd_resume') }}", |
137 | data: "sort="+val_+"&block=1", | 137 | data: "sort="+val_+"&block=1", |
138 | success: function (data) { | 138 | success: function (data) { |
139 | console.log('Выбор сортировки'); | 139 | console.log('Выбор сортировки'); |
140 | console.log(data); | 140 | console.log(data); |
141 | $('#block1').html(data); | 141 | $('#block1').html(data); |
142 | history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); | 142 | history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); |
143 | }, | 143 | }, |
144 | headers: { | 144 | headers: { |
145 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 145 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
146 | }, | 146 | }, |
147 | error: function (data) { | 147 | error: function (data) { |
148 | data = JSON.stringify(data); | 148 | data = JSON.stringify(data); |
149 | console.log('Error: ' + data); | 149 | console.log('Error: ' + data); |
150 | } | 150 | } |
151 | }); | 151 | }); |
152 | 152 | ||
153 | $.ajax({ | 153 | $.ajax({ |
154 | type: "GET", | 154 | type: "GET", |
155 | url: "{{ route('bd_resume') }}", | 155 | url: "{{ route('bd_resume') }}", |
156 | data: "sort="+val_+"&block=2", | 156 | data: "sort="+val_+"&block=2", |
157 | success: function (data) { | 157 | success: function (data) { |
158 | console.log('Выбор сортировки'); | 158 | console.log('Выбор сортировки'); |
159 | console.log(data); | 159 | console.log(data); |
160 | $('#block2').html(data); | 160 | $('#block2').html(data); |
161 | history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); | 161 | history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); |
162 | }, | 162 | }, |
163 | headers: { | 163 | headers: { |
164 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 164 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
165 | }, | 165 | }, |
166 | error: function (data) { | 166 | error: function (data) { |
167 | data = JSON.stringify(data); | 167 | data = JSON.stringify(data); |
168 | console.log('Error: ' + data); | 168 | console.log('Error: ' + data); |
169 | } | 169 | } |
170 | }); | 170 | }); |
171 | 171 | ||
172 | }); | 172 | }); |
173 | 173 | ||
174 | $(document).ready(function(){ | 174 | $(document).ready(function(){ |
175 | var sel = $('#select2-sort_ajax-container'); | 175 | var sel = $('#select2-sort_ajax-container'); |
176 | var key = getUrlParameter('sort'); | 176 | var key = getUrlParameter('sort'); |
177 | console.log(sel); | 177 | console.log(sel); |
178 | console.log(key); | 178 | console.log(key); |
179 | 179 | ||
180 | if (key !=='') { | 180 | if (key !=='') { |
181 | console.log(key); | 181 | console.log(key); |
182 | switch (key) { | 182 | switch (key) { |
183 | case "default": sel.html('Сортировка (по умолчанию)'); break; | 183 | case "default": sel.html('Сортировка (по умолчанию)'); break; |
184 | case "name_up": sel.html('По имени (возрастание)'); break; | 184 | case "name_up": sel.html('По имени (возрастание)'); break; |
185 | case "name_down": sel.html('По дате (убывание)'); break; | 185 | case "name_down": sel.html('По дате (убывание)'); break; |
186 | case "created_at_up": sel.html('По дате (возрастание)'); break; | 186 | case "created_at_up": sel.html('По дате (возрастание)'); break; |
187 | case "created_at_down": sel.html('По дате (убывание)'); break; | 187 | case "created_at_down": sel.html('По дате (убывание)'); break; |
188 | } | 188 | } |
189 | 189 | ||
190 | } | 190 | } |
191 | }); | 191 | }); |
192 | </script> | 192 | </script> |
193 | @include('js.favorite-worker') | 193 | @include('js.favorite-worker') |
194 | @endsection | 194 | @endsection |
195 | 195 | ||
196 | 196 | ||
197 | @section('content') | 197 | @section('content') |
198 | <section class="thing"> | 198 | <section class="thing"> |
199 | <div class="container"> | 199 | <div class="container"> |
200 | <form class="thing__body" action="{{ url()->current() }}"> | 200 | <form class="thing__body" action="{{ url()->current() }}"> |
201 | <ul class="breadcrumbs thing__breadcrumbs"> | 201 | <ul class="breadcrumbs thing__breadcrumbs"> |
202 | <li><a href="{{ route('index') }}">Главная</a></li> | 202 | <li><a href="{{ route('index') }}">Главная</a></li> |
203 | <li><b>База резюме</b></li> | 203 | <li><b>База резюме</b></li> |
204 | </ul> | 204 | </ul> |
205 | <h1 class="thing__title">База резюме</h1> | 205 | <h1 class="thing__title">База резюме</h1> |
206 | <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для | 206 | <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для |
207 | существующих финансовых и административных условий.</p> | 207 | существующих финансовых и административных условий.</p> |
208 | <div class="search thing__search"> | 208 | <div class="search thing__search"> |
209 | <input type="search" class="input" name="search" id="search" placeholder="Введите наименование должности" required> | 209 | <input type="search" class="input" name="search" id="search" placeholder="Введите наименование должности" required> |
210 | <button type="submit" class="button">Найти</button> | 210 | <button type="submit" class="button">Найти</button> |
211 | <span> | 211 | <span> |
212 | <svg> | 212 | <svg> |
213 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> | 213 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> |
214 | </svg> | 214 | </svg> |
215 | </span> | 215 | </span> |
216 | </div> | 216 | </div> |
217 | <label class="checkbox thing__checkbox"> | 217 | <label class="checkbox thing__checkbox"> |
218 | <input type="checkbox" class="checkbox__input" name="experience" id="experience"> | 218 | <input type="checkbox" class="checkbox__input" name="experience" id="experience"> |
219 | <span class="checkbox__icon"> | 219 | <span class="checkbox__icon"> |
220 | <svg> | 220 | <svg> |
221 | <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use> | 221 | <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use> |
222 | </svg> | 222 | </svg> |
223 | </span> | 223 | </span> |
224 | <span class="checkbox__text"> | 224 | <span class="checkbox__text"> |
225 | <span> | 225 | <span> |
226 | Опыт работы | 226 | Опыт работы |
227 | </span> | 227 | </span> |
228 | </span> | 228 | </span> |
229 | </label> | 229 | </label> |
230 | </form> | 230 | </form> |
231 | </div> | 231 | </div> |
232 | </section> | 232 | </section> |
233 | <main class="main"> | 233 | <main class="main"> |
234 | <div class="container"> | 234 | <div class="container"> |
235 | <div class="main__resume-base"> | 235 | <div class="main__resume-base"> |
236 | <h2>Резюме работников</h2> | 236 | <h2>Резюме работников</h2> |
237 | <div class="filters"> | 237 | <div class="filters"> |
238 | <div class="filters__label">Показано {{ $resumes->firstItem() }} – {{ $resumes->lastItem() }} из {{ $res_count }} результатов поиска</div> | 238 | <div class="filters__label">Показано {{ $resumes->firstItem() }} – {{ $resumes->lastItem() }} из {{ $res_count }} результатов поиска</div> |
239 | <div class="filters__body"> | 239 | <div class="filters__body"> |
240 | <div class="select filters__select"> | 240 | <div class="select filters__select"> |
241 | <select class="js-select2" id="sort_ajax" name="sort_ajax"> | 241 | <select class="js-select2" id="sort_ajax" name="sort_ajax"> |
242 | <option value="default">Сортировка (по умолчанию)</option> | 242 | <option value="default">Сортировка (по умолчанию)</option> |
243 | <option value="name_up">По имени (возрастание)</option> | 243 | <option value="name_up">По имени (возрастание)</option> |
244 | <option value="name_down">По имени (убывание)</option> | 244 | <option value="name_down">По имени (убывание)</option> |
245 | <option value="created_at_up">По дате (возрастание)</option> | 245 | <option value="created_at_up">По дате (возрастание)</option> |
246 | <option value="created_at_down">По дате (убывание)</option> | 246 | <option value="created_at_down">По дате (убывание)</option> |
247 | </select> | 247 | </select> |
248 | </div> | 248 | </div> |
249 | <button type="button" class="filters__item active" data-tab="1"> | 249 | <button type="button" class="filters__item active" data-tab="1"> |
250 | <svg> | 250 | <svg> |
251 | <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use> | 251 | <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use> |
252 | </svg> | 252 | </svg> |
253 | </button> | 253 | </button> |
254 | <button type="button" class="filters__item" data-tab="2"> | 254 | <button type="button" class="filters__item" data-tab="2"> |
255 | <svg> | 255 | <svg> |
256 | <use xlink:href="{{ asset('images/sprite.svg#grid-2') }}"></use> | 256 | <use xlink:href="{{ asset('images/sprite.svg#grid-2') }}"></use> |
257 | </svg> | 257 | </svg> |
258 | </button> | 258 | </button> |
259 | </div> | 259 | </div> |
260 | </div> | 260 | </div> |
261 | <div class="main__resume-base-body showed" data-body="1"> | 261 | <div class="main__resume-base-body showed" data-body="1"> |
262 | <div class="main__resume-base-body-one" id="block1" name="block1"> | 262 | <div class="main__resume-base-body-one" id="block1" name="block1"> |
263 | @if ($resumes->count()) | 263 | @if ($resumes->count()) |
264 | @foreach ($resumes as $res) | 264 | @foreach ($resumes as $res) |
265 | <div class="main__resume-base-body-item"> | 265 | <div class="main__resume-base-body-item"> |
266 | <div class="main__resume-base-body-item-buttons"> | 266 | <div class="main__resume-base-body-item-buttons"> |
267 | <button type="button" data-id="{{ $res->id }}" id="elem{{ $res->id }}" class="like js-toggle js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($res) }}" data-val="{{ $res->id }}"> | 267 | <button type="button" data-id="{{ $res->id }}" id="elem{{ $res->id }}" class="like js-toggle js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($res) }}" data-val="{{ $res->id }}"> |
268 | <svg> | 268 | <svg> |
269 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> | 269 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> |
270 | </svg> | 270 | </svg> |
271 | </button> | 271 | </button> |
272 | <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $res->id }}" data-options='{"touch":false,"autoFocus":false}'> | 272 | <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $res->id }}" data-options='{"touch":false,"autoFocus":false}'> |
273 | <svg> | 273 | <svg> |
274 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> | 274 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> |
275 | </svg> | 275 | </svg> |
276 | </button> | 276 | </button> |
277 | </div> | 277 | </div> |
278 | <div class="main__resume-base-body-item-wrapper"> | 278 | <div class="main__resume-base-body-item-wrapper"> |
279 | <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo"> | 279 | <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo"> |
280 | <div class="main__resume-base-body-item-inner"> | 280 | <div class="main__resume-base-body-item-inner"> |
281 | <div> | 281 | <div> |
282 | <b>Статус</b> | 282 | <b>Статус</b> |
283 | <span>{{ $status_work[$res->status_work] }}</span> | 283 | <span>{{ $status_work[$res->status_work] }}</span> |
284 | </div> | 284 | </div> |
285 | <div> | 285 | <div> |
286 | <b>Имя работника</b> | 286 | <b>Имя работника</b> |
287 | <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> | 287 | <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> |
288 | </div> | 288 | </div> |
289 | <div> | 289 | <div> |
290 | <b>Номер телефона</b> | 290 | <b>Номер телефона</b> |
291 | <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span> | 291 | <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span> |
292 | </div> | 292 | </div> |
293 | <div> | 293 | <div> |
294 | <b>Электронный адрес</b> | 294 | <b>Электронный адрес</b> |
295 | <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> | 295 | <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> |
296 | </div> | 296 | </div> |
297 | <div> | 297 | <div> |
298 | <b>Город проживания</b> | 298 | <b>Город проживания</b> |
299 | <span>{{ $res->city }}</span> | 299 | <span>{{ $res->city }}</span> |
300 | </div> | 300 | </div> |
301 | <div> | 301 | <div> |
302 | <b>Опыт работы</b> | 302 | <b>Опыт работы</b> |
303 | <span>{{ $res->experience }}</span> | 303 | <span>{{ $res->experience }}</span> |
304 | </div> | 304 | </div> |
305 | </div> | 305 | </div> |
306 | </div> | 306 | </div> |
307 | <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в резюме</a> | 307 | <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в резюме</a> |
308 | </div> | 308 | </div> |
309 | @endforeach | 309 | @endforeach |
310 | 310 | ||
311 | {{ $resumes->appends($_GET)->links('paginate') }} | 311 | {{ $resumes->appends($_GET)->links('paginate') }} |
312 | @endif | 312 | @endif |
313 | </div> | 313 | </div> |
314 | </div> | 314 | </div> |
315 | <div class="main__resume-base-body" data-body="2"> | 315 | <div class="main__resume-base-body" data-body="2"> |
316 | <div class="main__resume-base-body-two" id="block2" name="block2"> | 316 | <div class="main__resume-base-body-two" id="block2" name="block2"> |
317 | @if ($resumes->count()) | 317 | @if ($resumes->count()) |
318 | @foreach ($resumes as $res) | 318 | @foreach ($resumes as $res) |
319 | <div class="main__resume-base-body-item"> | 319 | <div class="main__resume-base-body-item"> |
320 | <div class="main__resume-base-body-item-buttons"> | 320 | <div class="main__resume-base-body-item-buttons"> |
321 | <button type="button" id="elem_{{ $res->id }}" class="like js-toggle js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($res) }}" data-val="{{ $res->id }}"> | 321 | <button type="button" id="elem_{{ $res->id }}" class="like js-toggle js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($res) }}" data-val="{{ $res->id }}"> |
322 | <svg> | 322 | <svg> |
323 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> | 323 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> |
324 | </svg> | 324 | </svg> |
325 | </button> | 325 | </button> |
326 | <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $res->id }}" data-options='{"touch":false,"autoFocus":false}'> | 326 | <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $res->id }}" data-options='{"touch":false,"autoFocus":false}'> |
327 | <svg> | 327 | <svg> |
328 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> | 328 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> |
329 | </svg> | 329 | </svg> |
330 | </button> | 330 | </button> |
331 | </div> | 331 | </div> |
332 | <div class="main__resume-base-body-item-wrapper"> | 332 | <div class="main__resume-base-body-item-wrapper"> |
333 | <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo"> | 333 | <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo"> |
334 | <div class="main__resume-base-body-item-inner"> | 334 | <div class="main__resume-base-body-item-inner"> |
335 | <div> | 335 | <div> |
336 | <b>Статус</b> | 336 | <b>Статус</b> |
337 | <span>{{ $status_work[$res->status_work] }}</span> | 337 | <span>{{ $status_work[$res->status_work] }}</span> |
338 | </div> | 338 | </div> |
339 | <div> | 339 | <div> |
340 | <b>Имя работника</b> | 340 | <b>Имя работника</b> |
341 | <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> | 341 | <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> |
342 | </div> | 342 | </div> |
343 | <div> | 343 | <div> |
344 | <b>Номер телефона</b> | 344 | <b>Номер телефона</b> |
345 | <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span> | 345 | <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span> |
346 | </div> | 346 | </div> |
347 | <div> | 347 | <div> |
348 | <b>Электронный адрес</b> | 348 | <b>Электронный адрес</b> |
349 | <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> | 349 | <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> |
350 | </div> | 350 | </div> |
351 | <div> | 351 | <div> |
352 | <b>Город проживания</b> | 352 | <b>Город проживания</b> |
353 | <span>{{ $res->city }}</span> | 353 | <span>{{ $res->city }}</span> |
354 | </div> | 354 | </div> |
355 | <div> | 355 | <div> |
356 | <b>Опыт работы</b> | 356 | <b>Опыт работы</b> |
357 | <span>{{ $res->experience }}</span> | 357 | <span>{{ $res->experience }}</span> |
358 | </div> | 358 | </div> |
359 | </div> | 359 | </div> |
360 | </div> | 360 | </div> |
361 | <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в | 361 | <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в |
362 | резюме</a> | 362 | резюме</a> |
363 | </div> | 363 | </div> |
364 | @endforeach | 364 | @endforeach |
365 | 365 | ||
366 | {{ $resumes->appends($_GET)->links('paginate') }} | 366 | {{ $resumes->appends($_GET)->links('paginate') }} |
367 | @endif | 367 | @endif |
368 | </div> | 368 | </div> |
369 | </div> | 369 | </div> |
370 | </div> | 370 | </div> |
371 | </div> | 371 | </div> |
372 | </main> | 372 | </main> |
373 | </div> | 373 | </div> |
374 | </div> | 374 | </div> |
375 | @endsection | 375 | @endsection |
376 | 376 |
routes/web.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | use App\Http\Controllers\Ad_jobsController; | ||
3 | use App\Http\Controllers\AdEmployerController; | 4 | use App\Http\Controllers\AdEmployerController; |
4 | use App\Http\Controllers\Admin\AdminController; | 5 | use App\Http\Controllers\Admin\AdminController; |
5 | use App\Http\Controllers\Admin\CategoryController; | 6 | use App\Http\Controllers\Admin\CategoryController; |
6 | use App\Http\Controllers\Admin\CategoryEmpController; | 7 | use App\Http\Controllers\Admin\CategoryEmpController; |
7 | use App\Http\Controllers\Admin\EducationController; | 8 | use App\Http\Controllers\Admin\EducationController; |
8 | use App\Http\Controllers\Admin\EmployersController; | 9 | use App\Http\Controllers\Admin\EmployersController; |
9 | use App\Http\Controllers\EmployerController as FrontEmployersController; | 10 | use App\Http\Controllers\EmployerController as FrontEmployersController; |
10 | use App\Http\Controllers\Admin\InfoBloksController; | 11 | use App\Http\Controllers\Admin\InfoBloksController; |
11 | use App\Http\Controllers\Admin\JobTitlesController; | 12 | use App\Http\Controllers\Admin\JobTitlesController; |
12 | use App\Http\Controllers\Admin\UsersController; | 13 | use App\Http\Controllers\Admin\UsersController; |
13 | use App\Http\Controllers\Admin\WorkersController; | 14 | use App\Http\Controllers\Admin\WorkersController; |
14 | use App\Http\Controllers\Auth\ForgotPasswordController; | 15 | use App\Http\Controllers\Auth\ForgotPasswordController; |
15 | use App\Http\Controllers\Auth\LoginController; | 16 | use App\Http\Controllers\Auth\LoginController; |
16 | use App\Http\Controllers\Auth\RegisterController; | 17 | use App\Http\Controllers\Auth\RegisterController; |
17 | use App\Http\Controllers\CKEditorController; | 18 | use App\Http\Controllers\CKEditorController; |
18 | use App\Http\Controllers\MediaController; | 19 | use App\Http\Controllers\MediaController; |
19 | use App\Http\Controllers\WorkerController; | 20 | use App\Http\Controllers\WorkerController; |
21 | use App\Models\Ad_jobs; | ||
20 | use App\Models\User; | 22 | use App\Models\User; |
21 | use App\Http\Controllers\MainController; | 23 | use App\Http\Controllers\MainController; |
22 | use App\Http\Controllers\HomeController; | 24 | use App\Http\Controllers\HomeController; |
23 | use Illuminate\Support\Facades\Route; | 25 | use Illuminate\Support\Facades\Route; |
24 | use App\Http\Controllers\Admin\CompanyController; | 26 | use App\Http\Controllers\Admin\CompanyController; |
25 | use App\Http\Controllers\Admin\Ad_EmployersController; | 27 | use App\Http\Controllers\Admin\Ad_EmployersController; |
26 | use App\Http\Controllers\Admin\MsgAnswersController; | 28 | use App\Http\Controllers\Admin\MsgAnswersController; |
27 | use App\Http\Controllers\Admin\GroupsController; | 29 | use App\Http\Controllers\Admin\GroupsController; |
28 | use App\Http\Controllers\PagesController; | 30 | use App\Http\Controllers\PagesController; |
29 | use Illuminate\Support\Facades\Storage; | 31 | use Illuminate\Support\Facades\Storage; |
30 | use App\Http\Controllers\EmployerController; | 32 | use App\Http\Controllers\EmployerController; |
31 | use App\Http\Controllers\CompanyController as FrontCompanyController; | 33 | use App\Http\Controllers\CompanyController as FrontCompanyController; |
32 | 34 | ||
33 | 35 | ||
34 | /* | 36 | /* |
35 | |-------------------------------------------------------------------------- | 37 | |-------------------------------------------------------------------------- |
36 | | Web Routes | 38 | | Web Routes |
37 | |-------------------------------------------------------------------------- | 39 | |-------------------------------------------------------------------------- |
38 | | | 40 | | |
39 | | 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 |
40 | | routes are loaded by the RouteServiceProvider within a group which | 42 | | routes are loaded by the RouteServiceProvider within a group which |
41 | | contains the "web" middleware group. Now create something great! | 43 | | contains the "web" middleware group. Now create something great! |
42 | | | 44 | | |
43 | */ | 45 | */ |
44 | /* | 46 | /* |
45 | Route::get('/', function () { | 47 | Route::get('/', function () { |
46 | return view('welcome'); | 48 | return view('welcome'); |
47 | })->name('index'); | 49 | })->name('index'); |
48 | */ | 50 | */ |
49 | 51 | ||
50 | Route::get('/', [MainController::class, 'index'])->name('index'); | 52 | Route::get('/', [MainController::class, 'index'])->name('index'); |
51 | 53 | ||
52 | //Роуты авторизации, регистрации, восстановления, аутентификации | 54 | //Роуты авторизации, регистрации, восстановления, аутентификации |
53 | Auth::routes(['verify' => true]); | 55 | Auth::routes(['verify' => true]); |
54 | 56 | ||
55 | // роуты регистрации, авторизации, восстановления пароля, верификации почты | 57 | // роуты регистрации, авторизации, восстановления пароля, верификации почты |
56 | /*Route::group([ | 58 | /*Route::group([ |
57 | 'as' => 'auth.', //имя маршрута, например auth.index | 59 | 'as' => 'auth.', //имя маршрута, например auth.index |
58 | 'prefix' => 'auth', // префикс маршрута, например, auth/index | 60 | 'prefix' => 'auth', // префикс маршрута, например, auth/index |
59 | ], function () { | 61 | ], function () { |
60 | //форма регистрации | 62 | //форма регистрации |
61 | Route::get('register', [RegisterController::class, 'register'])->name('register'); | 63 | Route::get('register', [RegisterController::class, 'register'])->name('register'); |
62 | 64 | ||
63 | //создание пользователя | 65 | //создание пользователя |
64 | Route::post('register', [RegisterController::class, 'create'])->name('create'); | 66 | Route::post('register', [RegisterController::class, 'create'])->name('create'); |
65 | 67 | ||
66 | //форма входа авторизации | 68 | //форма входа авторизации |
67 | Route::get('login', [LoginController::class, 'login'])->name('login'); | 69 | Route::get('login', [LoginController::class, 'login'])->name('login'); |
68 | 70 | ||
69 | //аутентификация | 71 | //аутентификация |
70 | Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); | 72 | Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); |
71 | 73 | ||
72 | //выход | 74 | //выход |
73 | Route::get('logout', [LoginController::class, 'logout'])->name('logout'); | 75 | Route::get('logout', [LoginController::class, 'logout'])->name('logout'); |
74 | 76 | ||
75 | //форма ввода адреса почты | 77 | //форма ввода адреса почты |
76 | Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); | 78 | Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); |
77 | 79 | ||
78 | //письмо на почту | 80 | //письмо на почту |
79 | Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); | 81 | Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); |
80 | 82 | ||
81 | //форма восстановления пароля | 83 | //форма восстановления пароля |
82 | Route::get('reset-password/token/{token}/email/{email}', | 84 | Route::get('reset-password/token/{token}/email/{email}', |
83 | [ResetPasswordController::class, 'form'] | 85 | [ResetPasswordController::class, 'form'] |
84 | )->name('reset-form'); | 86 | )->name('reset-form'); |
85 | 87 | ||
86 | //восстановление пароля | 88 | //восстановление пароля |
87 | Route::post('reset-password', | 89 | Route::post('reset-password', |
88 | [ResetPasswordController::class, 'reset'] | 90 | [ResetPasswordController::class, 'reset'] |
89 | )->name('reset-password'); | 91 | )->name('reset-password'); |
90 | 92 | ||
91 | //сообщение о необходимости проверки адреса почты | 93 | //сообщение о необходимости проверки адреса почты |
92 | Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); | 94 | Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); |
93 | 95 | ||
94 | //подтверждение адреса почты нового пользователя | 96 | //подтверждение адреса почты нового пользователя |
95 | Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) | 97 | Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) |
96 | ->where('token', '[a-f0-9]{32}') | 98 | ->where('token', '[a-f0-9]{32}') |
97 | ->where('id', '[0-9]+') | 99 | ->where('id', '[0-9]+') |
98 | ->name('verify-email'); | 100 | ->name('verify-email'); |
99 | });*/ | 101 | });*/ |
100 | 102 | ||
101 | //Личный кабинет пользователя | 103 | //Личный кабинет пользователя |
102 | Route::get('/home', [HomeController::class, 'index'])->name('home'); | 104 | Route::get('/home', [HomeController::class, 'index'])->name('home'); |
103 | 105 | ||
104 | /* | 106 | /* |
105 | Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { | 107 | Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { |
106 | $user = User::where('email',$request->input('email'))->first(); | 108 | $user = User::where('email',$request->input('email'))->first(); |
107 | 109 | ||
108 | $user->sendEmailVerificationNotification(); | 110 | $user->sendEmailVerificationNotification(); |
109 | 111 | ||
110 | return 'your response'; | 112 | return 'your response'; |
111 | })->middleware('throttle:6,1')->name('verification.resend'); | 113 | })->middleware('throttle:6,1')->name('verification.resend'); |
112 | */ | 114 | */ |
113 | 115 | ||
114 | // Авторизация, регистрация в админку | 116 | // Авторизация, регистрация в админку |
115 | Route::group([ | 117 | Route::group([ |
116 | 'as' => 'admin.', // имя маршрута, например auth.index | 118 | 'as' => 'admin.', // имя маршрута, например auth.index |
117 | 'prefix' => 'admin', // префикс маршрута, например auth/index | 119 | 'prefix' => 'admin', // префикс маршрута, например auth/index |
118 | 'middleware' => ['guest'], | 120 | 'middleware' => ['guest'], |
119 | ], function () { | 121 | ], function () { |
120 | // Форма регистрации | 122 | // Форма регистрации |
121 | Route::get('register', [AdminController::class, 'register'])->name('register'); | 123 | Route::get('register', [AdminController::class, 'register'])->name('register'); |
122 | // Создание пользователя | 124 | // Создание пользователя |
123 | Route::post('register', [AdminController::class, 'create'])->name('create'); | 125 | Route::post('register', [AdminController::class, 'create'])->name('create'); |
124 | 126 | ||
125 | //Форма входа | 127 | //Форма входа |
126 | Route::get('login', [AdminController::class, 'login'])->name('login'); | 128 | Route::get('login', [AdminController::class, 'login'])->name('login'); |
127 | 129 | ||
128 | // аутентификация | 130 | // аутентификация |
129 | Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); | 131 | Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); |
130 | 132 | ||
131 | }); | 133 | }); |
132 | 134 | ||
133 | // Личный кабинет админки | 135 | // Личный кабинет админки |
134 | Route::group([ | 136 | Route::group([ |
135 | 'as' => 'admin.', // имя маршрута, например auth.index | 137 | 'as' => 'admin.', // имя маршрута, например auth.index |
136 | 'prefix' => 'admin', // префикс маршрута, например auth/index | 138 | 'prefix' => 'admin', // префикс маршрута, например auth/index |
137 | 'middleware' => ['auth'], ['admin'], | 139 | 'middleware' => ['auth'], ['admin'], |
138 | ], function() { | 140 | ], function() { |
139 | 141 | ||
140 | // выход | 142 | // выход |
141 | Route::get('logout', [AdminController::class, 'logout'])->name('logout'); | 143 | Route::get('logout', [AdminController::class, 'logout'])->name('logout'); |
142 | 144 | ||
143 | // кабинет главная страница | 145 | // кабинет главная страница |
144 | Route::get('cabinet', [AdminController::class, 'index'])->name('index'); | 146 | Route::get('cabinet', [AdminController::class, 'index'])->name('index'); |
145 | 147 | ||
146 | // кабинет профиль админа - форма | 148 | // кабинет профиль админа - форма |
147 | Route::get('profile', [AdminController::class, 'profile'])->name('profile'); | 149 | Route::get('profile', [AdminController::class, 'profile'])->name('profile'); |
148 | // кабинет профиль админа - сохранение формы | 150 | // кабинет профиль админа - сохранение формы |
149 | Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); | 151 | Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); |
150 | 152 | ||
151 | //кабинет сообщения админа | 153 | //кабинет сообщения админа |
152 | //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); | 154 | //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); |
153 | 155 | ||
154 | 156 | ||
155 | // кабинет профиль - форма пароли | 157 | // кабинет профиль - форма пароли |
156 | Route::get('password', [AdminController::class, 'profile_password'])->name('password'); | 158 | Route::get('password', [AdminController::class, 'profile_password'])->name('password'); |
157 | // кабинет профиль - сохранение формы пароля | 159 | // кабинет профиль - сохранение формы пароля |
158 | Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); | 160 | Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); |
159 | 161 | ||
160 | 162 | ||
161 | // кабинет профиль пользователя - форма | 163 | // кабинет профиль пользователя - форма |
162 | 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'); |
163 | // кабинет профиль пользователя - сохранение формы | 165 | // кабинет профиль пользователя - сохранение формы |
164 | 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'); |
165 | 167 | ||
166 | // кабинет профиль работодатель - форма | 168 | // кабинет профиль работодатель - форма |
167 | 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'); |
168 | // кабинет профиль работодатель - сохранение формы | 170 | // кабинет профиль работодатель - сохранение формы |
169 | 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'); |
170 | // кабинет удаление профиль работодателя и юзера | 172 | // кабинет удаление профиль работодателя и юзера |
171 | 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'); |
172 | 174 | ||
173 | // кабинет профиль работник - форма | 175 | // кабинет профиль работник - форма |
174 | 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'); |
175 | 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'); |
176 | 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'); |
177 | // кабинет профиль работник - сохранение формы | 179 | // кабинет профиль работник - сохранение формы |
178 | 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'); |
179 | 181 | ||
180 | // Медиа | 182 | // Медиа |
181 | Route::get('media', [MediaController::class, 'index'])->name('media'); | 183 | Route::get('media', [MediaController::class, 'index'])->name('media'); |
182 | Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media'); | 184 | Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media'); |
183 | 185 | ||
184 | // кабинет настройки сайта - форма | 186 | // кабинет настройки сайта - форма |
185 | Route::get('config', [AdminController::class, 'config_form'])->name('config'); | 187 | Route::get('config', [AdminController::class, 'config_form'])->name('config'); |
186 | // кабинет настройки сайта сохранение формы | 188 | // кабинет настройки сайта сохранение формы |
187 | Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); | 189 | Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); |
188 | 190 | ||
189 | // кабинет - пользователи | 191 | // кабинет - пользователи |
190 | Route::get('users', [UsersController::class, 'index'])->name('users'); | 192 | Route::get('users', [UsersController::class, 'index'])->name('users'); |
191 | 193 | ||
192 | // кабинет - пользователи | 194 | // кабинет - пользователи |
193 | Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); | 195 | Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); |
194 | 196 | ||
195 | // кабинет - работодатели | 197 | // кабинет - работодатели |
196 | Route::get('employers', [EmployersController::class, 'index'])->name('employers'); | 198 | Route::get('employers', [EmployersController::class, 'index'])->name('employers'); |
197 | 199 | ||
198 | Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); | 200 | Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); |
199 | 201 | ||
200 | Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add'); | 202 | Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add'); |
201 | Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save'); | 203 | Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save'); |
202 | Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot'); | 204 | Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot'); |
203 | Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit'); | 205 | Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit'); |
204 | Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete'); | 206 | Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete'); |
205 | 207 | ||
206 | // кабинет - соискатели | 208 | // кабинет - соискатели |
207 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); | 209 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); |
208 | 210 | ||
209 | // кабинет - база данных | 211 | // кабинет - база данных |
210 | Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); | 212 | Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); |
211 | Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); | 213 | Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); |
212 | Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); | 214 | Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); |
213 | Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); | 215 | Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); |
214 | Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); | 216 | Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); |
215 | Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); | 217 | Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); |
216 | Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); | 218 | Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); |
217 | 219 | ||
218 | // кабинет - вакансии | 220 | // кабинет - вакансии |
219 | Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); | 221 | Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); |
220 | Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers'); | 222 | Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers'); |
221 | Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers'); | 223 | Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers'); |
222 | Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); | 224 | Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); |
223 | Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); | 225 | Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); |
224 | Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer'); | 226 | Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer'); |
225 | 227 | ||
226 | // Редактирование должности в вакансии | 228 | // Редактирование должности в вакансии |
227 | Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs'); | 229 | Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs'); |
228 | Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs'); | 230 | Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs'); |
229 | 231 | ||
230 | 232 | ||
231 | // кабинет - категории | 233 | // кабинет - категории |
232 | //Route::get('categories', [AdminController::class, 'index'])->name('categories'); | 234 | //Route::get('categories', [AdminController::class, 'index'])->name('categories'); |
233 | /* | 235 | /* |
234 | * CRUD-операции над Справочником Категории | 236 | * CRUD-операции над Справочником Категории |
235 | */ | 237 | */ |
236 | Route::resource('categories', CategoryController::class, ['except' => ['show']]); | 238 | Route::resource('categories', CategoryController::class, ['except' => ['show']]); |
237 | 239 | ||
238 | // CRUD-операции над справочником Категории для работодателей | 240 | // CRUD-операции над справочником Категории для работодателей |
239 | Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); | 241 | Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); |
240 | 242 | ||
241 | // CRUD-операции над справочником Образование | 243 | // CRUD-операции над справочником Образование |
242 | Route::resource('education', EducationController::class, ['except' => ['show']]); | 244 | Route::resource('education', EducationController::class, ['except' => ['show']]); |
243 | 245 | ||
244 | Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education'); | 246 | Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education'); |
245 | Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); | 247 | Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); |
246 | Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); | 248 | Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); |
247 | 249 | ||
248 | Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); | 250 | Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); |
249 | Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education'); | 251 | Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education'); |
250 | 252 | ||
251 | Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); | 253 | Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); |
252 | 254 | ||
253 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); | 255 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); |
254 | /* | 256 | /* |
255 | * кабинет - CRUD-операции по справочнику должности | 257 | * кабинет - CRUD-операции по справочнику должности |
256 | * | 258 | * |
257 | */ | 259 | */ |
258 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); | 260 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); |
259 | 261 | ||
260 | // кабинет - сообщения (чтение чужих) | 262 | // кабинет - сообщения (чтение чужих) |
261 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); | 263 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); |
262 | // кабинет - просмотр сообщения чужого (чтение) | 264 | // кабинет - просмотр сообщения чужого (чтение) |
263 | Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); | 265 | Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); |
264 | 266 | ||
265 | // кабинет - сообщения (админские) | 267 | // кабинет - сообщения (админские) |
266 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); | 268 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); |
267 | // кабинет - сообщения (админские) | 269 | // кабинет - сообщения (админские) |
268 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); | 270 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); |
269 | // кабинет - sql - конструкция запросов | 271 | // кабинет - sql - конструкция запросов |
270 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); | 272 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); |
271 | 273 | ||
272 | /* | 274 | /* |
273 | * Расписанный подход в описании каждой директорий групп пользователей. | 275 | * Расписанный подход в описании каждой директорий групп пользователей. |
274 | */ | 276 | */ |
275 | // кабинет - группы пользователей | 277 | // кабинет - группы пользователей |
276 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); | 278 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); |
277 | // кабинет - добавление форма группы пользователей | 279 | // кабинет - добавление форма группы пользователей |
278 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); | 280 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); |
279 | // кабинет - сохранение формы группы пользователей | 281 | // кабинет - сохранение формы группы пользователей |
280 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); | 282 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); |
281 | // кабинет - редактирование форма группы пользователей | 283 | // кабинет - редактирование форма группы пользователей |
282 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); | 284 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); |
283 | // кабинет - сохранение редактированной формы группы пользователей | 285 | // кабинет - сохранение редактированной формы группы пользователей |
284 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); | 286 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); |
285 | // кабинет - удаление группы пользователей | 287 | // кабинет - удаление группы пользователей |
286 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); | 288 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); |
287 | 289 | ||
288 | 290 | ||
289 | // кабинет - список админов | 291 | // кабинет - список админов |
290 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); | 292 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); |
291 | 293 | ||
292 | // справочник Позиции | 294 | // справочник Позиции |
293 | Route::get('positions', [AdminController::class, 'position'])->name('position'); | 295 | Route::get('positions', [AdminController::class, 'position'])->name('position'); |
294 | Route::get('positions/add', [AdminController::class, 'position_add'])->name('add-position'); | 296 | Route::get('positions/add', [AdminController::class, 'position_add'])->name('add-position'); |
295 | Route::post('positions/add', [AdminController::class, 'position_add_save'])->name('add-save-position'); | 297 | Route::post('positions/add', [AdminController::class, 'position_add_save'])->name('add-save-position'); |
296 | Route::get('positions/edit/{position}', [AdminController::class, 'position_edit'])->name('edit-position'); | 298 | Route::get('positions/edit/{position}', [AdminController::class, 'position_edit'])->name('edit-position'); |
297 | Route::post('position/edit/{position}', [AdminController::class, 'position_update'])->name('update-position'); | 299 | Route::post('position/edit/{position}', [AdminController::class, 'position_update'])->name('update-position'); |
298 | Route::get('position/delete/{position}', [AdminController::class, 'position_delete'])->name('delete-position'); | 300 | Route::get('position/delete/{position}', [AdminController::class, 'position_delete'])->name('delete-position'); |
299 | 301 | ||
300 | /////редактор////// кабинет - редактор сайта//////////////////////// | 302 | /////редактор////// кабинет - редактор сайта//////////////////////// |
301 | Route::get('editor-site', function() { | 303 | Route::get('editor-site', function() { |
302 | return view('admin.editor.index'); | 304 | return view('admin.editor.index'); |
303 | })->name('editor-site'); | 305 | })->name('editor-site'); |
304 | 306 | ||
305 | 307 | ||
306 | // кабинет - редактор шапки-футера сайта | 308 | // кабинет - редактор шапки-футера сайта |
307 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); | 309 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); |
308 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); | 310 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); |
309 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); | 311 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); |
310 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); | 312 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); |
311 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); | 313 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); |
312 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); | 314 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); |
313 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); | 315 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); |
314 | 316 | ||
315 | 317 | ||
316 | // кабинет - редактор должности на главной | 318 | // кабинет - редактор должности на главной |
317 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); | 319 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); |
318 | 320 | ||
319 | // кабинет - редактор работодатели на главной | 321 | // кабинет - редактор работодатели на главной |
320 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); | 322 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); |
321 | 323 | ||
322 | 324 | ||
323 | // кабинет - редактор seo-сайта | 325 | // кабинет - редактор seo-сайта |
324 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); | 326 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); |
325 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); | 327 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); |
326 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); | 328 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); |
327 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); | 329 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); |
328 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); | 330 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); |
329 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); | 331 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); |
330 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); | 332 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); |
331 | 333 | ||
332 | 334 | ||
333 | // кабинет - редактор страниц | 335 | // кабинет - редактор страниц |
334 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); | 336 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); |
335 | // кабинет - добавление страницы | 337 | // кабинет - добавление страницы |
336 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); | 338 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); |
337 | // кабинет - сохранение формы страницы | 339 | // кабинет - сохранение формы страницы |
338 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); | 340 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); |
339 | // кабинет - редактирование форма страницы | 341 | // кабинет - редактирование форма страницы |
340 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); | 342 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); |
341 | // кабинет - сохранение редактированной формы страницы | 343 | // кабинет - сохранение редактированной формы страницы |
342 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); | 344 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); |
343 | // кабинет - удаление страницы | 345 | // кабинет - удаление страницы |
344 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); | 346 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); |
345 | 347 | ||
346 | 348 | ||
347 | // кабинет - реклама сайта | 349 | // кабинет - реклама сайта |
348 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); | 350 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); |
349 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); | 351 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); |
350 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); | 352 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); |
351 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); | 353 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); |
352 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); | 354 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); |
353 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); | 355 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); |
354 | //////////////////////////////////////////////////////////////////////// | 356 | //////////////////////////////////////////////////////////////////////// |
355 | 357 | ||
356 | 358 | ||
357 | // кабинет - отзывы о работодателе для модерации | 359 | // кабинет - отзывы о работодателе для модерации |
358 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); | 360 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); |
359 | 361 | ||
360 | // Общая страница статистики | 362 | // Общая страница статистики |
361 | Route::get('statics', function () { | 363 | Route::get('statics', function () { |
362 | return view('admin.static.index'); | 364 | return view('admin.static.index'); |
363 | })->name('statics'); | 365 | })->name('statics'); |
364 | 366 | ||
365 | // кабинет - статистика работников | 367 | // кабинет - статистика работников |
366 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); | 368 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); |
367 | 369 | ||
368 | // кабинет - статистика вакансий работодателя | 370 | // кабинет - статистика вакансий работодателя |
369 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); | 371 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); |
370 | 372 | ||
371 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника | 373 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника |
372 | /* | 374 | /* |
373 | * CRUD-операции над справочником дипломы и документы | 375 | * CRUD-операции над справочником дипломы и документы |
374 | */ | 376 | */ |
375 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); | 377 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); |
376 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); | 378 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); |
377 | 379 | ||
378 | // кабинет - роли пользователя | 380 | // кабинет - роли пользователя |
379 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); | 381 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); |
380 | 382 | ||
381 | Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles'); | 383 | Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles'); |
382 | 384 | ||
383 | Route::get('logs', function() { | 385 | Route::get('logs', function() { |
384 | $files = Storage::files('logs/laravel.log'); | 386 | $files = Storage::files('logs/laravel.log'); |
385 | })->name('logs'); | 387 | })->name('logs'); |
386 | }); | 388 | }); |
387 | 389 | ||
388 | // Инструментальные страницы | 390 | // Инструментальные страницы |
389 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); | 391 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); |
390 | 392 | ||
391 | Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); | 393 | Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); |
392 | 394 | ||
393 | Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); | 395 | Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); |
394 | 396 | ||
395 | // Страницы с произвольным контентом | 397 | // Страницы с произвольным контентом |
396 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); | 398 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); |
397 | 399 | ||
398 | // Публичные страницы соискателя | 400 | // Публичные страницы соискателя |
399 | Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); | 401 | Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); |
400 | 402 | ||
401 | //Страница вакансии | 403 | //Страница вакансии |
402 | Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); | 404 | Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); |
403 | 405 | ||
404 | //Вакансии | 406 | //Вакансии |
405 | Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies'); | 407 | Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies'); |
406 | 408 | ||
407 | //Вакансии поиск на главной | 409 | //Вакансии поиск на главной |
408 | Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies'); | 410 | Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies'); |
409 | 411 | ||
410 | //Вакансии категория детальная | 412 | //Вакансии категория детальная |
411 | Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies'); | 413 | Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies'); |
412 | 414 | ||
413 | // Лайк вакансии | 415 | // Лайк вакансии |
414 | Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy'); | 416 | Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy'); |
415 | 417 | ||
416 | //Детальная страница вакансии - работодателя | 418 | //Детальная страница вакансии - работодателя |
417 | Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie'); | 419 | Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie'); |
418 | 420 | ||
419 | //Судоходные компании | 421 | //Судоходные компании |
420 | Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies'); | 422 | Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies'); |
421 | 423 | ||
422 | //Детальная инфа о компании | 424 | //Детальная инфа о компании |
423 | Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company'); | 425 | Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company'); |
424 | 426 | ||
425 | //Образование | 427 | //Образование |
426 | Route::get('education', [MainController::class, 'education'])->name('education'); | 428 | Route::get('education', [MainController::class, 'education'])->name('education'); |
427 | 429 | ||
428 | //Новости | 430 | //Новости |
429 | Route::get('news', [MainController::class, 'news'])->name('news'); | 431 | Route::get('news', [MainController::class, 'news'])->name('news'); |
430 | Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new'); | 432 | Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new'); |
431 | 433 | ||
432 | //Контакты | 434 | //Контакты |
433 | Route::get('contacts', [MainController::class, 'contacts'])->name('contacts'); | 435 | Route::get('contacts', [MainController::class, 'contacts'])->name('contacts'); |
434 | 436 | ||
435 | //База резюме | 437 | //База резюме |
436 | Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume'); | 438 | Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume'); |
437 | 439 | ||
438 | Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume'); | 440 | Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume'); |
439 | 441 | ||
440 | //Анкета соискателя | 442 | //Анкета соискателя |
441 | Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile'); | 443 | Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile'); |
442 | 444 | ||
443 | //Скачать резюме | 445 | //Скачать резюме |
444 | Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download'); | 446 | Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download'); |
445 | 447 | ||
446 | //Вход в кабинет | 448 | //Вход в кабинет |
447 | Route::get('login', [MainController::class, 'input_login'])->name('login'); | 449 | Route::get('login', [MainController::class, 'input_login'])->name('login'); |
448 | 450 | ||
449 | // Выход из кабинета | 451 | // Выход из кабинета |
450 | Route::get('logout', [EmployerController::class, 'logout'])->name('logout'); | 452 | Route::get('logout', [EmployerController::class, 'logout'])->name('logout'); |
451 | 453 | ||
452 | Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker'); | 454 | Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker'); |
453 | Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer'); | 455 | Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer'); |
454 | 456 | ||
455 | //восстановление пароля | 457 | //восстановление пароля |
456 | Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password'); | 458 | Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password'); |
457 | // Звезда сообщения | 459 | // Звезда сообщения |
458 | Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer'); | 460 | Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer'); |
459 | 461 | ||
460 | // Борьба | 462 | // Борьба |
461 | Route::get('clear_cookie', function() { | 463 | Route::get('clear_cookie', function() { |
462 | \App\Classes\Cookies_vacancy::clear_vacancy(); | 464 | \App\Classes\Cookies_vacancy::clear_vacancy(); |
463 | return redirect()->route('index'); | 465 | return redirect()->route('index'); |
464 | })->name('clear_cookie'); | 466 | })->name('clear_cookie'); |
465 | 467 | ||
466 | Route::get('cookies', function() { | 468 | Route::get('cookies', function() { |
467 | return view('cookies'); | 469 | return view('cookies'); |
468 | })->name('cookies'); | 470 | })->name('cookies'); |
469 | 471 | ||
470 | 472 | ||
471 | 473 | ||
472 | 474 | ||
473 | // Личный кабинет работник | 475 | // Личный кабинет работник |
474 | Route::group([ | 476 | Route::group([ |
475 | 'as' => 'worker.', // имя маршрута, например auth.index | 477 | 'as' => 'worker.', // имя маршрута, например auth.index |
476 | 'prefix' => 'worker', // префикс маршрута, например auth/index | 478 | 'prefix' => 'worker', // префикс маршрута, например auth/index |
477 | 'middleware' => ['auth'], ['is_worker'], | 479 | 'middleware' => ['auth'], ['is_worker'], |
478 | ], function() { | 480 | ], function() { |
479 | // 1 страница - Моя анкета | 481 | // 1 страница - Моя анкета |
480 | Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); | 482 | Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); |
481 | Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); | 483 | Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); |
482 | 484 | ||
483 | // 2 страница - Сообщения | 485 | // 2 страница - Сообщения |
484 | Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); | 486 | Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); |
485 | Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog'); | 487 | Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog'); |
486 | // 3 страница - Избранные вакансии | 488 | // 3 страница - Избранные вакансии |
487 | Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); | 489 | Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); |
488 | // Продолжение борьбы против колорадов - избранные вакансии | 490 | // Продолжение борьбы против колорадов - избранные вакансии |
489 | Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); | 491 | Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); |
490 | 492 | ||
491 | // 4 страница - Сменить пароль | 493 | // 4 страница - Сменить пароль |
492 | Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); | 494 | Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); |
493 | Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password'); | 495 | Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password'); |
494 | 496 | ||
495 | // 5 страница - Удалить профиль | 497 | // 5 страница - Удалить профиль |
496 | Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); | 498 | Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); |
497 | Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); | 499 | Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); |
498 | 500 | ||
499 | // Резюме -pdf | 501 | // Резюме -pdf |
500 | Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); | 502 | Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); |
501 | 503 | ||
502 | // Поднятие анкеты | 504 | // Поднятие анкеты |
503 | Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); | 505 | Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); |
504 | 506 | ||
505 | // Добавление сертификата | 507 | // Добавление сертификата |
506 | Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); | 508 | Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); |
507 | Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); | 509 | Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); |
508 | 510 | ||
509 | // Добавление документа-диплома | 511 | // Добавление документа-диплома |
510 | Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); | 512 | Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); |
511 | Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); | 513 | Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); |
512 | 514 | ||
513 | // Добавление стандартного диплома | 515 | // Добавление стандартного диплома |
514 | Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); | 516 | Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); |
515 | Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); | 517 | Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); |
516 | Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); | 518 | Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); |
517 | Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); | 519 | Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); |
518 | Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); | 520 | Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); |
519 | 521 | ||
520 | // Отправка сообщения работодателю от соискателя | 522 | // Отправка сообщения работодателю от соискателя |
521 | Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message'); | 523 | Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message'); |
522 | }); | 524 | }); |
523 | 525 | ||
524 | // Личный кабинет работодателя | 526 | // Личный кабинет работодателя |
525 | Route::group([ | 527 | Route::group([ |
526 | 'as' => 'employer.', // имя маршрута, например auth.index | 528 | 'as' => 'employer.', // имя маршрута, например auth.index |
527 | 'prefix' => 'employer', // префикс маршрута, например auth/index | 529 | 'prefix' => 'employer', // префикс маршрута, например auth/index |
528 | 'middleware' => ['auth'], !['is_worker'], | 530 | 'middleware' => ['auth'], !['is_worker'], |
529 | ], function() { | 531 | ], function() { |
530 | // 1 страница - Профиль | 532 | // 1 страница - Профиль |
531 | Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); | 533 | Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); |
532 | Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); | 534 | Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); |
533 | Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); | 535 | Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); |
534 | Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); | 536 | Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); |
535 | 537 | ||
536 | // 2 страница - Добавление вакансий | 538 | // 2 страница - Добавление вакансий |
537 | Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); | 539 | Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); |
538 | Route::post('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancy_save'])->name('vacancy_save'); | ||
539 | Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); | 540 | Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); |
540 | Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); | 541 | Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); |
542 | |||
543 | |||
544 | |||
545 | Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); | ||
541 | 546 | ||
542 | 547 | ||
543 | // 3 страница - Мои вакансии | 548 | // 3 страница - Мои вакансии |
544 | Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); | 549 | Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); |
545 | Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); | 550 | Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); |
546 | Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); | 551 | Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); |
547 | Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); | 552 | Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); |
548 | Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); | 553 | Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); |
554 | Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); | ||
555 | Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); | ||
556 | |||
557 | // 4.1Ю. | ||
558 | Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac'); | ||
559 | Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save'); | ||
560 | Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac'); | ||
549 | Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); | 561 | Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save'); |
550 | Route::post('cabinet/vacancy-edit/{ad_employer}/', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); | 562 | Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac'); |
551 | 563 | ||
552 | // 4 страница - Отклики на вакансии | 564 | // 4 страница - Отклики на вакансии |
553 | Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); | 565 | Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); |
554 | Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); | 566 | Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); |
555 | Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); | 567 | Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); |
556 | 568 | ||
557 | // 5 страница - Сообщения | 569 | // 5 страница - Сообщения |
558 | Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); | 570 | Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); |
559 | Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); | 571 | Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); |
560 | Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); | 572 | Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); |
561 | Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); | 573 | Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); |
562 | 574 | ||
563 | // 6 страница - Избранный | 575 | // 6 страница - Избранный |
564 | Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); | 576 | Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); |
565 | 577 | ||
566 | //7 страница - База данных | 578 | //7 страница - База данных |
567 | Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); | 579 | Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); |
568 | 580 | ||
569 | //8 страница - База резюме | 581 | //8 страница - База резюме |
570 | Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); | 582 | Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); |
571 | 583 | ||
572 | // 9 рассылка сообщений | 584 | // 9 рассылка сообщений |
573 | Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); | 585 | Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); |
574 | Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); | 586 | Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); |
575 | 587 | ||
576 | // 10 страница FAQ вопросы | 588 | // 10 страница FAQ вопросы |
577 | Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq'); | 589 | Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq'); |
578 | 590 | ||
579 | // 11 страница - Настройка уведомлений | 591 | // 11 страница - Настройка уведомлений |
580 | Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); | 592 | Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); |
581 | Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); | 593 | Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); |
582 | 594 | ||
583 | // 12 страница - Сменить пароль | 595 | // 12 страница - Сменить пароль |
584 | Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); | 596 | Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); |
585 | Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); | 597 | Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); |
586 | 598 | ||
587 | // 13 страница - Удаление профиля | 599 | // 13 страница - Удаление профиля |
588 | Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); | 600 | Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); |
589 | Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); | 601 | Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); |
590 | Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); | 602 | Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); |
591 | 603 | ||
592 | // Отправил сообщение | 604 | // Отправил сообщение |
593 | Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); | 605 | Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); |
594 | }); | 606 | }); |
595 | 607 | ||
596 | 608 |