Commit d7c3522a7f20932e534231cc6e79ab06b4f9c50d
1 parent
31fe4e458f
Exists in
master
and in
1 other branch
Коммит изменение структуры проекта
Showing 9 changed files with 681 additions and 386 deletions Inline Diff
- app/Http/Controllers/Ad_jobsController.php
- app/Http/Controllers/EmployerController.php
- app/Http/Controllers/MainController.php
- resources/views/employers/add_ad_jobs.blade.php
- resources/views/employers/add_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
- 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/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()) { | 120 | if ($Positions->count()) { |
121 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get(); | 121 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get(); |
122 | } else { | 122 | } else { |
123 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get(); | 123 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get(); |
124 | } | 124 | } |
125 | 125 | ||
126 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | 126 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
127 | WhereHas('users', | 127 | WhereHas('users', |
128 | function (Builder $query) use ($id) {$query->Where('id', $id); | 128 | function (Builder $query) use ($id) {$query->Where('id', $id); |
129 | })->get(); | 129 | })->get(); |
130 | 130 | ||
131 | return view('employers.add_vacancy', compact('Employer', 'jobs' , 'categories', 'Positions')); | 131 | return view('employers.add_vacancy', compact('Employer', 'jobs' , 'categories', 'Positions')); |
132 | } | 132 | } |
133 | 133 | ||
134 | // Сохранение вакансии | 134 | // Сохранение вакансии |
135 | public function cabinet_vacancy_save1(VacancyRequestEdit $request) { | 135 | public function cabinet_vacancy_save1(VacancyRequestEdit $request) { |
136 | $params = $request->all(); | 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']); | ||
153 | unset($params['description']); | ||
154 | |||
155 | $id = Ad_employer::create($params)->id; | ||
156 | $jobs['ad_employer_id'] = $id; | ||
157 | $ad_jobs = Ad_jobs::create($jobs); | ||
158 | 137 | ||
138 | $ad_jobs = Ad_employer::create($params); | ||
159 | return redirect()->route('employer.vacancy_list'); | 139 | return redirect()->route('employer.vacancy_list'); |
160 | } | 140 | } |
161 | 141 | ||
162 | // Список вакансий | 142 | // Список вакансий |
163 | public function vacancy_list(Request $request) { | 143 | public function vacancy_list(Request $request) { |
164 | $id = Auth()->user()->id; | 144 | $id = Auth()->user()->id; |
165 | $Employer = Employer::query()->where('user_id', $id)->first(); | 145 | $Employer = Employer::query()->where('user_id', $id)->first(); |
166 | $vacancy_list = Ad_employer::query()->where('employer_id', $Employer->id); | 146 | $vacancy_list = Ad_employer::query()->with('jobs')->with('jobs_code')->where('employer_id', $Employer->id); |
147 | |||
167 | 148 | ||
168 | if ($request->get('sort')) { | 149 | if ($request->get('sort')) { |
169 | $sort = $request->get('sort'); | 150 | $sort = $request->get('sort'); |
170 | switch ($sort) { | 151 | switch ($sort) { |
171 | case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break; | 152 | case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break; |
172 | case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break; | 153 | case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break; |
173 | case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break; | 154 | case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break; |
174 | case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break; | 155 | case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break; |
175 | case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; | 156 | case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; |
176 | default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; | 157 | default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; |
177 | } | 158 | } |
178 | } | 159 | } |
179 | $vacancy_list = $vacancy_list->paginate(4); | 160 | $vacancy_list = $vacancy_list->paginate(4); |
180 | 161 | ||
181 | |||
182 | //ajax | 162 | //ajax |
183 | if ($request->ajax()) { | 163 | if ($request->ajax()) { |
184 | return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); | 164 | return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); |
185 | } else { | 165 | } else { |
186 | return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); | 166 | return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); |
187 | } | 167 | } |
188 | } | 168 | } |
189 | 169 | ||
190 | // Карточка вакансии | 170 | // Карточка вакансии |
191 | public function vacancy_edit(Ad_employer $ad_employer) { | 171 | public function vacancy_edit(Ad_employer $ad_employer) { |
192 | $id = Auth()->user()->id; | 172 | $id = Auth()->user()->id; |
193 | 173 | ||
194 | $Positions = Positions::query()->get(); | 174 | $Positions = Positions::query()->get(); |
195 | if ($Positions->count()) { | 175 | if ($Positions->count()) { |
196 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get(); | 176 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get(); |
197 | } else { | 177 | } else { |
198 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get(); | 178 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get(); |
199 | } | 179 | } |
200 | |||
201 | $categories = Category::query()->get(); | 180 | $categories = Category::query()->get(); |
202 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | 181 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
203 | where('user_id', $id)->first(); | 182 | where('user_id', $id)->first(); |
204 | 183 | ||
205 | return view('employers.edit_vacancy', compact('ad_employer', 'Positions', 'categories','Employer', 'jobs')); | 184 | return view('employers.edit_vacancy', compact('ad_employer', 'Positions', 'categories','Employer', 'jobs')); |
206 | } | 185 | } |
207 | 186 | ||
208 | // Сохранение-редактирование записи | 187 | // Сохранение-редактирование записи |
209 | public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { | 188 | public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { |
210 | $params = $request->all(); | 189 | $params = $request->all(); |
211 | 190 | ||
212 | //$jobs['flot'] = $params['flot']; | 191 | //$jobs['flot'] = $params['flot']; |
213 | $jobs['job_title_id'] = $params['job_title_id']; | 192 | //$jobs['job_title_id'] = $params['job_title_id']; |
214 | //$titles['position_id'] = $params['position_id']; | 193 | //$titles['position_id'] = $params['position_id']; |
215 | unset($params['job_title_id']); | 194 | //unset($params['job_title_id']); |
216 | 195 | ||
217 | $ad_employer->update($params); | 196 | $ad_employer->update($params); |
218 | 197 | ||
219 | $job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])-> | 198 | //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])-> |
220 | where('ad_employer_id', $ad_employer->id)->first(); | 199 | // where('ad_employer_id', $ad_employer->id)->first(); |
221 | $data = Ad_jobs::find($job_->id); | 200 | //$data = Ad_jobs::find($job_->id); |
222 | $ad_jobs = $data->update($jobs); | 201 | //$ad_jobs = $data->update($jobs); |
223 | 202 | ||
224 | return redirect()->route('employer.vacancy_list'); | 203 | return redirect()->route('employer.vacancy_list'); |
225 | } | 204 | } |
226 | 205 | ||
227 | // Сохранение карточки вакансии | 206 | // Сохранение карточки вакансии |
228 | public function vacancy_save(Request $request, Ad_employer $ad_employer) { | 207 | public function vacancy_save(Request $request, Ad_employer $ad_employer) { |
229 | $all = $request->all(); | 208 | $all = $request->all(); |
230 | $ad_employer->update($all); | 209 | $ad_employer->update($all); |
231 | return redirect()->route('employer.cabinet_vacancie'); | 210 | return redirect()->route('employer.cabinet_vacancie'); |
232 | } | 211 | } |
233 | 212 | ||
234 | // Удаление карточки вакансии | 213 | // Удаление карточки вакансии |
235 | public function vacancy_delete(Ad_employer $ad_employer) { | 214 | public function vacancy_delete(Ad_employer $ad_employer) { |
236 | $ad_employer->delete(); | 215 | $ad_employer->delete(); |
237 | 216 | ||
238 | return redirect()->route('employer.vacancy_list') | 217 | return redirect()->route('employer.vacancy_list') |
239 | ->with('success', 'Данные были успешно сохранены'); | 218 | ->with('success', 'Данные были успешно сохранены'); |
240 | } | 219 | } |
241 | 220 | ||
242 | // Обновление даты | 221 | // Обновление даты |
243 | public function vacancy_up(Ad_employer $ad_employer) { | 222 | public function vacancy_up(Ad_employer $ad_employer) { |
244 | $up = date('m/d/Y h:i:s', time());; | 223 | $up = date('m/d/Y h:i:s', time());; |
245 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); | 224 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); |
246 | $vac_emp->updated_at = $up; | 225 | $vac_emp->updated_at = $up; |
247 | $vac_emp->save(); | 226 | $vac_emp->save(); |
248 | 227 | ||
249 | return redirect()->route('employer.vacancy_list'); | 228 | return redirect()->route('employer.vacancy_list'); |
250 | // начало конца | 229 | // начало конца |
251 | } | 230 | } |
252 | 231 | ||
253 | //Видимость вакансии | 232 | //Видимость вакансии |
254 | public function vacancy_eye(Ad_employer $ad_employer, $status) { | 233 | public function vacancy_eye(Ad_employer $ad_employer, $status) { |
255 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); | 234 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); |
256 | $vac_emp->active_is = $status; | 235 | $vac_emp->active_is = $status; |
257 | $vac_emp->save(); | 236 | $vac_emp->save(); |
258 | 237 | ||
259 | return redirect()->route('employer.vacancy_list'); | 238 | return redirect()->route('employer.vacancy_list'); |
260 | } | 239 | } |
261 | 240 | ||
262 | //Вакансия редактирования (шаблон) | 241 | //Вакансия редактирования (шаблон) |
263 | public function vacancy_update(Ad_employer $id) { | 242 | public function vacancy_update(Ad_employer $id) { |
264 | 243 | ||
265 | } | 244 | } |
266 | 245 | ||
267 | //Отклики на вакансию - лист | 246 | //Отклики на вакансию - лист |
268 | public function answers(Employer $employer, Request $request) { | 247 | public function answers(Employer $employer, Request $request) { |
269 | $user_id = Auth()->user()->id; | 248 | $user_id = Auth()->user()->id; |
270 | $answer = Ad_employer::query()->where('employer_id', $employer->id); | 249 | $answer = Ad_employer::query()->where('employer_id', $employer->id); |
271 | if ($request->has('search')) { | 250 | if ($request->has('search')) { |
272 | $search = trim($request->get('search')); | 251 | $search = trim($request->get('search')); |
273 | if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); | 252 | if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); |
274 | } | 253 | } |
275 | 254 | ||
276 | $answer = $answer->with('response')->get(); | 255 | $answer = $answer->with('response')->get(); |
277 | 256 | ||
278 | return view('employers.list_answer', compact('answer', 'user_id', 'employer')); | 257 | return view('employers.list_answer', compact('answer', 'user_id', 'employer')); |
279 | } | 258 | } |
280 | 259 | ||
281 | //Обновление статуса | 260 | //Обновление статуса |
282 | public function supple_status(employer $employer, ad_response $ad_response, $flag) { | 261 | public function supple_status(employer $employer, ad_response $ad_response, $flag) { |
283 | $ad_response->update(Array('flag' => $flag)); | 262 | $ad_response->update(Array('flag' => $flag)); |
284 | return redirect()->route('employer.answers', ['employer' => $employer->id]); | 263 | return redirect()->route('employer.answers', ['employer' => $employer->id]); |
285 | } | 264 | } |
286 | 265 | ||
287 | //Страницы сообщений список | 266 | //Страницы сообщений список |
288 | public function messages($type_message) { | 267 | public function messages($type_message) { |
289 | $user_id = Auth()->user()->id; | 268 | $user_id = Auth()->user()->id; |
290 | 269 | ||
291 | $messages_input = Message::query()->with('vacancies')->with('user_from')-> | 270 | $messages_input = Message::query()->with('vacancies')->with('user_from')-> |
292 | Where('to_user_id', $user_id)->OrderByDesc('created_at'); | 271 | Where('to_user_id', $user_id)->OrderByDesc('created_at'); |
293 | 272 | ||
294 | $messages_output = Message::query()->with('vacancies')-> | 273 | $messages_output = Message::query()->with('vacancies')-> |
295 | with('user_to')->where('user_id', $user_id)-> | 274 | with('user_to')->where('user_id', $user_id)-> |
296 | OrderByDesc('created_at'); | 275 | OrderByDesc('created_at'); |
297 | 276 | ||
298 | 277 | ||
299 | $count_input = $messages_input->count(); | 278 | $count_input = $messages_input->count(); |
300 | $count_output = $messages_output->count(); | 279 | $count_output = $messages_output->count(); |
301 | 280 | ||
302 | if ($type_message == 'input') { | 281 | if ($type_message == 'input') { |
303 | $messages = $messages_input->paginate(15); | 282 | $messages = $messages_input->paginate(15); |
304 | } | 283 | } |
305 | 284 | ||
306 | if ($type_message == 'output') { | 285 | if ($type_message == 'output') { |
307 | $messages = $messages_output->paginate(15); | 286 | $messages = $messages_output->paginate(15); |
308 | } | 287 | } |
309 | 288 | ||
310 | return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); | 289 | return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); |
311 | } | 290 | } |
312 | 291 | ||
313 | // Диалог между пользователями | 292 | // Диалог между пользователями |
314 | public function dialog(User_Model $user1, User_Model $user2) { | 293 | public function dialog(User_Model $user1, User_Model $user2) { |
315 | if (isset($user2->id)) { | 294 | if (isset($user2->id)) { |
316 | $companion = User_Model::query()->with('workers')-> | 295 | $companion = User_Model::query()->with('workers')-> |
317 | with('employers')-> | 296 | with('employers')-> |
318 | where('id', $user2->id)->first(); | 297 | where('id', $user2->id)->first(); |
319 | } | 298 | } |
320 | 299 | ||
321 | $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) { | 300 | $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) { |
322 | $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); | 301 | $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); |
323 | })->orWhere(function($query) use ($user1, $user2) { | 302 | })->orWhere(function($query) use ($user1, $user2) { |
324 | $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); | 303 | $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); |
325 | })->OrderBy('created_at')->get(); | 304 | })->OrderBy('created_at')->get(); |
326 | 305 | ||
327 | $id_vac = null; | 306 | $id_vac = null; |
328 | foreach ($Messages as $it) { | 307 | foreach ($Messages as $it) { |
329 | if (isset($it->response)) { | 308 | if (isset($it->response)) { |
330 | foreach ($it->response as $r) { | 309 | foreach ($it->response as $r) { |
331 | if (isset($r->ad_employer_id)) { | 310 | if (isset($r->ad_employer_id)) { |
332 | $id_vac = $r->ad_employer_id; | 311 | $id_vac = $r->ad_employer_id; |
333 | break; | 312 | break; |
334 | } | 313 | } |
335 | } | 314 | } |
336 | } | 315 | } |
337 | if (!is_null($id_vac)) break; | 316 | if (!is_null($id_vac)) break; |
338 | } | 317 | } |
339 | 318 | ||
340 | $ad_employer = null; | 319 | $ad_employer = null; |
341 | if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); | 320 | if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); |
342 | $sender = $user1; | 321 | $sender = $user1; |
343 | 322 | ||
344 | return view('employers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); | 323 | return view('employers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); |
345 | } | 324 | } |
346 | 325 | ||
347 | // Регистрация работодателя | 326 | // Регистрация работодателя |
348 | public function register_employer(Request $request) { | 327 | public function register_employer(Request $request) { |
349 | $params = $request->all(); | 328 | $params = $request->all(); |
350 | 329 | ||
351 | $rules = [ | 330 | $rules = [ |
352 | 'surname' => ['required', 'string', 'max:255'], | 331 | 'surname' => ['required', 'string', 'max:255'], |
353 | 'name_man' => ['required', 'string', 'max:255'], | 332 | 'name_man' => ['required', 'string', 'max:255'], |
354 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], | 333 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], |
355 | 'name_company' => ['required', 'string', 'max:255'], | 334 | 'name_company' => ['required', 'string', 'max:255'], |
356 | 'password' => ['required', 'string', 'min:8'], | 335 | 'password' => ['required', 'string', 'min:8'], |
357 | ]; | 336 | ]; |
358 | 337 | ||
359 | 338 | ||
360 | $messages = [ | 339 | $messages = [ |
361 | 'required' => 'Укажите обязательное поле', | 340 | 'required' => 'Укажите обязательное поле', |
362 | 'min' => [ | 341 | 'min' => [ |
363 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 342 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
364 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 343 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
365 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 344 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
366 | ], | 345 | ], |
367 | 'max' => [ | 346 | 'max' => [ |
368 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 347 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
369 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 348 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
370 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 349 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
371 | ] | 350 | ] |
372 | ]; | 351 | ]; |
373 | 352 | ||
374 | if ($request->get('password') !== $request->get('confirmed')){ | 353 | if ($request->get('password') !== $request->get('confirmed')){ |
375 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); | 354 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); |
376 | } | 355 | } |
377 | 356 | ||
378 | $validator = Validator::make($request->all(), $rules, $messages); | 357 | $validator = Validator::make($request->all(), $rules, $messages); |
379 | 358 | ||
380 | if ($validator->fails()) { | 359 | if ($validator->fails()) { |
381 | return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); | 360 | return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); |
382 | } else { | 361 | } else { |
383 | $user = $this->create($params); | 362 | $user = $this->create($params); |
384 | event(new Registered($user)); | 363 | event(new Registered($user)); |
385 | 364 | ||
386 | Auth::guard()->login($user); | 365 | Auth::guard()->login($user); |
387 | } | 366 | } |
388 | if ($user) { | 367 | if ($user) { |
389 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; | 368 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; |
390 | } else { | 369 | } else { |
391 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); | 370 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); |
392 | } | 371 | } |
393 | } | 372 | } |
394 | 373 | ||
395 | // Создание пользователя | 374 | // Создание пользователя |
396 | protected function create(array $data) | 375 | protected function create(array $data) |
397 | { | 376 | { |
398 | $Use = new User_Model(); | 377 | $Use = new User_Model(); |
399 | $Code_user = $Use->create([ | 378 | $Code_user = $Use->create([ |
400 | 'name' => $data['surname']." ".$data['name_man'], | 379 | 'name' => $data['surname']." ".$data['name_man'], |
401 | 'name_man' => $data['name_man'], | 380 | 'name_man' => $data['name_man'], |
402 | 'surname' => $data['surname'], | 381 | 'surname' => $data['surname'], |
403 | 'surname2' => $data['surname2'], | 382 | 'surname2' => $data['surname2'], |
404 | 'subscribe_email' => $data['email'], | 383 | 'subscribe_email' => $data['email'], |
405 | 'email' => $data['email'], | 384 | 'email' => $data['email'], |
406 | 'telephone' => $data['telephone'], | 385 | 'telephone' => $data['telephone'], |
407 | 'is_worker' => 0, | 386 | 'is_worker' => 0, |
408 | 'password' => Hash::make($data['password']), | 387 | 'password' => Hash::make($data['password']), |
409 | 'pubpassword' => base64_encode($data['password']), | 388 | 'pubpassword' => base64_encode($data['password']), |
410 | 'email_verified_at' => Carbon::now() | 389 | 'email_verified_at' => Carbon::now() |
411 | ]); | 390 | ]); |
412 | 391 | ||
413 | if ($Code_user->id > 0) { | 392 | if ($Code_user->id > 0) { |
414 | $Employer = new Employer(); | 393 | $Employer = new Employer(); |
415 | $Employer->user_id = $Code_user->id; | 394 | $Employer->user_id = $Code_user->id; |
416 | $Employer->name_company = $data['name_company']; | 395 | $Employer->name_company = $data['name_company']; |
417 | $Employer->email = $data['email']; | 396 | $Employer->email = $data['email']; |
418 | $Employer->telephone = $data['telephone']; | 397 | $Employer->telephone = $data['telephone']; |
419 | $Employer->code = Tools::generator_id(10); | 398 | $Employer->code = Tools::generator_id(10); |
420 | $Employer->save(); | 399 | $Employer->save(); |
421 | 400 | ||
422 | return $Code_user; | 401 | return $Code_user; |
423 | } | 402 | } |
424 | } | 403 | } |
425 | 404 | ||
426 | // Отправка сообщения от работодателя | 405 | // Отправка сообщения от работодателя |
427 | public function send_message(MessagesRequiest $request) { | 406 | public function send_message(MessagesRequiest $request) { |
428 | $params = $request->all(); | 407 | $params = $request->all(); |
429 | dd($params); | 408 | dd($params); |
430 | $user1 = $params['user_id']; | 409 | $user1 = $params['user_id']; |
431 | $user2 = $params['to_user_id']; | 410 | $user2 = $params['to_user_id']; |
432 | 411 | ||
433 | if ($request->has('file')) { | 412 | if ($request->has('file')) { |
434 | $params['file'] = $request->file('file')->store("messages", 'public'); | 413 | $params['file'] = $request->file('file')->store("messages", 'public'); |
435 | } | 414 | } |
436 | Message::create($params); | 415 | Message::create($params); |
437 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); | 416 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); |
438 | } | 417 | } |
439 | 418 | ||
440 | public function test123(Request $request) { | 419 | public function test123(Request $request) { |
441 | $params = $request->all(); | 420 | $params = $request->all(); |
442 | $user1 = $params['user_id']; | 421 | $user1 = $params['user_id']; |
443 | $user2 = $params['to_user_id']; | 422 | $user2 = $params['to_user_id']; |
444 | 423 | ||
445 | $rules = [ | 424 | $rules = [ |
446 | 'text' => 'required|min:1|max:150000', | 425 | 'text' => 'required|min:1|max:150000', |
447 | 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' | 426 | 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' |
448 | ]; | 427 | ]; |
449 | $messages = [ | 428 | $messages = [ |
450 | 'required' => 'Укажите обязательное поле', | 429 | 'required' => 'Укажите обязательное поле', |
451 | 'min' => [ | 430 | 'min' => [ |
452 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 431 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
453 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 432 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
454 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 433 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
455 | ], | 434 | ], |
456 | 'max' => [ | 435 | 'max' => [ |
457 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 436 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
458 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 437 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
459 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 438 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
460 | ] | 439 | ] |
461 | ]; | 440 | ]; |
462 | 441 | ||
463 | $validator = Validator::make($request->all(), $rules, $messages); | 442 | $validator = Validator::make($request->all(), $rules, $messages); |
464 | 443 | ||
465 | if ($validator->fails()) { | 444 | if ($validator->fails()) { |
466 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) | 445 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) |
467 | ->withErrors($validator); | 446 | ->withErrors($validator); |
468 | } else { | 447 | } else { |
469 | if ($request->has('file')) { | 448 | if ($request->has('file')) { |
470 | $params['file'] = $request->file('file')->store("messages", 'public'); | 449 | $params['file'] = $request->file('file')->store("messages", 'public'); |
471 | } | 450 | } |
472 | Message::create($params); | 451 | Message::create($params); |
473 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); | 452 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); |
474 | 453 | ||
475 | } | 454 | } |
476 | } | 455 | } |
477 | 456 | ||
478 | //Избранные люди | 457 | //Избранные люди |
479 | public function favorites(Request $request) { | 458 | public function favorites(Request $request) { |
480 | $IP_address = RusDate::ip_addr_client(); | 459 | $IP_address = RusDate::ip_addr_client(); |
481 | $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); | 460 | $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); |
482 | 461 | ||
483 | if ($Arr->count()) { | 462 | if ($Arr->count()) { |
484 | $A = Array(); | 463 | $A = Array(); |
485 | foreach ($Arr as $it) { | 464 | foreach ($Arr as $it) { |
486 | $A[] = $it->code_record; | 465 | $A[] = $it->code_record; |
487 | } | 466 | } |
488 | 467 | ||
489 | $Workers = Worker::query()->whereIn('id', $A); | 468 | $Workers = Worker::query()->whereIn('id', $A); |
490 | } else { | 469 | } else { |
491 | $Workers = Worker::query()->where('id', '=', '0'); | 470 | $Workers = Worker::query()->where('id', '=', '0'); |
492 | } | 471 | } |
493 | 472 | ||
494 | if (($request->has('search')) && (!empty($request->get('search')))) { | 473 | if (($request->has('search')) && (!empty($request->get('search')))) { |
495 | $search = $request->get('search'); | 474 | $search = $request->get('search'); |
496 | 475 | ||
497 | $Workers = $Workers->WhereHas('users', | 476 | $Workers = $Workers->WhereHas('users', |
498 | function (Builder $query) use ($search) { | 477 | function (Builder $query) use ($search) { |
499 | $query->Where('surname', 'LIKE', "%$search%") | 478 | $query->Where('surname', 'LIKE', "%$search%") |
500 | ->orWhere('name_man', 'LIKE', "%$search%") | 479 | ->orWhere('name_man', 'LIKE', "%$search%") |
501 | ->orWhere('surname2', 'LIKE', "%$search%"); | 480 | ->orWhere('surname2', 'LIKE', "%$search%"); |
502 | }); | 481 | }); |
503 | } else { | 482 | } else { |
504 | $Workers = $Workers->with('users'); | 483 | $Workers = $Workers->with('users'); |
505 | } | 484 | } |
506 | 485 | ||
507 | $Workers = $Workers->get(); | 486 | $Workers = $Workers->get(); |
508 | return view('employers.favorite', compact('Workers')); | 487 | return view('employers.favorite', compact('Workers')); |
509 | } | 488 | } |
510 | 489 | ||
511 | // База данных | 490 | // База данных |
512 | public function bd(Request $request) { | 491 | public function bd(Request $request) { |
513 | // для типа BelongsTo | 492 | // для типа BelongsTo |
514 | //$documents = Document::query()->orderBy(Location::select('name') | 493 | //$documents = Document::query()->orderBy(Location::select('name') |
515 | // ->whereColumn('locations.id', 'documents.location_id') | 494 | // ->whereColumn('locations.id', 'documents.location_id') |
516 | //); | 495 | //); |
517 | 496 | ||
518 | // для типа HasOne/Many | 497 | // для типа HasOne/Many |
519 | // $documents = Document::::query()->orderBy(Location::select('name') | 498 | // $documents = Document::::query()->orderBy(Location::select('name') |
520 | // ->whereColumn('locations.document_id', 'documents.id') | 499 | // ->whereColumn('locations.document_id', 'documents.id') |
521 | //); | 500 | //); |
522 | 501 | ||
523 | $users = User_Model::query()->with('workers'); | 502 | $users = User_Model::query()->with('workers'); |
524 | if (isset($request->find)) { | 503 | if (isset($request->find)) { |
525 | $find_key = $request->find; | 504 | $find_key = $request->find; |
526 | $users = $users->where('name', 'LIKE', "%$find_key%") | 505 | $users = $users->where('name', 'LIKE', "%$find_key%") |
527 | ->orWhere('email', 'LIKE', "%$find_key%") | 506 | ->orWhere('email', 'LIKE', "%$find_key%") |
528 | ->orWhere('telephone', 'LIKE', "%$find_key%"); | 507 | ->orWhere('telephone', 'LIKE', "%$find_key%"); |
529 | } | 508 | } |
530 | 509 | ||
531 | // Данные | 510 | // Данные |
532 | $users = $users->Baseuser()-> | 511 | $users = $users->Baseuser()-> |
533 | orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id'))-> | 512 | orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id'))-> |
534 | paginate(5); | 513 | paginate(5); |
535 | 514 | ||
536 | return view('employers.bd', compact('users')); | 515 | return view('employers.bd', compact('users')); |
537 | } | 516 | } |
538 | 517 | ||
539 | //Настройка уведомлений | 518 | //Настройка уведомлений |
540 | public function subscribe() { | 519 | public function subscribe() { |
541 | return view('employers.subcribe'); | 520 | return view('employers.subcribe'); |
542 | } | 521 | } |
543 | 522 | ||
544 | //Установка уведомлений сохранение | 523 | //Установка уведомлений сохранение |
545 | public function save_subscribe(Request $request) { | 524 | public function save_subscribe(Request $request) { |
546 | dd($request->all()); | 525 | dd($request->all()); |
547 | $msg = $request->validate([ | 526 | $msg = $request->validate([ |
548 | 'subscribe_email' => 'required|email|min:5|max:255', | 527 | 'subscribe_email' => 'required|email|min:5|max:255', |
549 | ]); | 528 | ]); |
550 | return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); | 529 | return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); |
551 | } | 530 | } |
552 | 531 | ||
553 | //Сбросить форму с паролем | 532 | //Сбросить форму с паролем |
554 | public function password_reset() { | 533 | public function password_reset() { |
555 | $email = Auth()->user()->email; | 534 | $email = Auth()->user()->email; |
556 | return view('employers.password-reset', compact('email')); | 535 | return view('employers.password-reset', compact('email')); |
557 | } | 536 | } |
558 | 537 | ||
559 | //Обновление пароля | 538 | //Обновление пароля |
560 | public function new_password(Request $request) { | 539 | public function new_password(Request $request) { |
561 | $use = Auth()->user(); | 540 | $use = Auth()->user(); |
562 | $request->validate([ | 541 | $request->validate([ |
563 | 'password' => 'required|string', | 542 | 'password' => 'required|string', |
564 | 'new_password' => 'required|string', | 543 | 'new_password' => 'required|string', |
565 | 'new_password2' => 'required|string' | 544 | 'new_password2' => 'required|string' |
566 | ]); | 545 | ]); |
567 | 546 | ||
568 | if ($request->get('new_password') == $request->get('new_password2')) | 547 | if ($request->get('new_password') == $request->get('new_password2')) |
569 | if ($request->get('password') !== $request->get('new_password')) { | 548 | if ($request->get('password') !== $request->get('new_password')) { |
570 | $credentials = $request->only('email', 'password'); | 549 | $credentials = $request->only('email', 'password'); |
571 | if (Auth::attempt($credentials)) { | 550 | if (Auth::attempt($credentials)) { |
572 | 551 | ||
573 | if (!is_null($use->email_verified_at)){ | 552 | if (!is_null($use->email_verified_at)){ |
574 | 553 | ||
575 | $user_data = User_Model::find($use->id); | 554 | $user_data = User_Model::find($use->id); |
576 | $user_data->update([ | 555 | $user_data->update([ |
577 | 'password' => Hash::make($request->get('new_password')), | 556 | 'password' => Hash::make($request->get('new_password')), |
578 | 'pubpassword' => base64_encode($request->get('new_password')), | 557 | 'pubpassword' => base64_encode($request->get('new_password')), |
579 | ]); | 558 | ]); |
580 | return redirect() | 559 | return redirect() |
581 | ->route('employer.password_reset') | 560 | ->route('employer.password_reset') |
582 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); | 561 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); |
583 | } | 562 | } |
584 | 563 | ||
585 | return redirect() | 564 | return redirect() |
586 | ->route('employer.password_reset') | 565 | ->route('employer.password_reset') |
587 | ->withError('Данная учетная запись не было верифицированна!'); | 566 | ->withError('Данная учетная запись не было верифицированна!'); |
588 | } | 567 | } |
589 | } | 568 | } |
590 | 569 | ||
591 | return redirect() | 570 | return redirect() |
592 | ->route('employer.password_reset') | 571 | ->route('employer.password_reset') |
593 | ->withErrors('Не совпадение данных, обновите пароли!'); | 572 | ->withErrors('Не совпадение данных, обновите пароли!'); |
594 | } | 573 | } |
595 | 574 | ||
596 | 575 | ||
597 | 576 | ||
598 | // Форма Удаление пипла | 577 | // Форма Удаление пипла |
599 | public function delete_people() { | 578 | public function delete_people() { |
600 | $login = Auth()->user()->email; | 579 | $login = Auth()->user()->email; |
601 | return view('employers.delete_people', compact('login')); | 580 | return view('employers.delete_people', compact('login')); |
602 | } | 581 | } |
603 | 582 | ||
604 | // Удаление аккаунта | 583 | // Удаление аккаунта |
605 | public function action_delete_user(Request $request) { | 584 | public function action_delete_user(Request $request) { |
606 | $Answer = $request->all(); | 585 | $Answer = $request->all(); |
607 | $user_id = Auth()->user()->id; | 586 | $user_id = Auth()->user()->id; |
608 | $request->validate([ | 587 | $request->validate([ |
609 | 'password' => 'required|string', | 588 | 'password' => 'required|string', |
610 | ]); | 589 | ]); |
611 | 590 | ||
612 | $credentials = $request->only('email', 'password'); | 591 | $credentials = $request->only('email', 'password'); |
613 | if (Auth::attempt($credentials)) { | 592 | if (Auth::attempt($credentials)) { |
614 | Auth::logout(); | 593 | Auth::logout(); |
615 | $it = User_Model::find($user_id); | 594 | $it = User_Model::find($user_id); |
616 | $it->delete(); | 595 | $it->delete(); |
617 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); | 596 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); |
618 | } else { | 597 | } else { |
619 | return redirect()->route('employer.delete_people') | 598 | return redirect()->route('employer.delete_people') |
620 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); | 599 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); |
621 | } | 600 | } |
622 | } | 601 | } |
623 | 602 | ||
624 | public function ajax_delete_user(Request $request) { | 603 | public function ajax_delete_user(Request $request) { |
625 | $Answer = $request->all(); | 604 | $Answer = $request->all(); |
626 | $user_id = Auth()->user()->id; | 605 | $user_id = Auth()->user()->id; |
627 | $request->validate([ | 606 | $request->validate([ |
628 | 'password' => 'required|string', | 607 | 'password' => 'required|string', |
629 | ]); | 608 | ]); |
630 | $credentials = $request->only('email', 'password'); | 609 | $credentials = $request->only('email', 'password'); |
631 | if (Auth::attempt($credentials)) { | 610 | if (Auth::attempt($credentials)) { |
632 | 611 | ||
633 | return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', | 612 | return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', |
634 | 'email' => $request->get('email'), | 613 | 'email' => $request->get('email'), |
635 | 'password' => $request->get('password'))); | 614 | 'password' => $request->get('password'))); |
636 | } else { | 615 | } else { |
637 | return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); | 616 | return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); |
638 | } | 617 | } |
639 | } | 618 | } |
640 | 619 | ||
641 | 620 | ||
642 | // FAQ - Вопросы/ответы для работодателей и соискателей | 621 | // FAQ - Вопросы/ответы для работодателей и соискателей |
643 | public function faq() { | 622 | public function faq() { |
644 | return view('employers.faq'); | 623 | return view('employers.faq'); |
645 | } | 624 | } |
646 | 625 | ||
647 | // Рассылка сообщений | 626 | // Рассылка сообщений |
648 | public function send_all_messages() { | 627 | public function send_all_messages() { |
649 | return view('employers.send_all'); | 628 | return view('employers.send_all'); |
650 | } | 629 | } |
651 | 630 | ||
652 | // Отправка сообщений для информации | 631 | // Отправка сообщений для информации |
653 | public function send_all_post(Request $request) { | 632 | public function send_all_post(Request $request) { |
654 | $data = $request->all(); | 633 | $data = $request->all(); |
655 | 634 | ||
656 | $emails = User_Model::query()->where('is_worker', '1')->get(); | 635 | $emails = User_Model::query()->where('is_worker', '1')->get(); |
657 | 636 | ||
658 | foreach ($emails as $e) { | 637 | foreach ($emails as $e) { |
659 | Mail::to($e->email)->send(new SendAllMessages($data)); | 638 | Mail::to($e->email)->send(new SendAllMessages($data)); |
660 | } | 639 | } |
661 | 640 | ||
662 | return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); | 641 | return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); |
663 | } | 642 | } |
664 | 643 | ||
665 | // База резюме | 644 | // База резюме |
666 | public function bd_tupe(Request $request) { | 645 | public function bd_tupe(Request $request) { |
667 | $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); | 646 | $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); |
668 | 647 | ||
669 | return view('employers.bd_tupe', compact('Resume')); | 648 | return view('employers.bd_tupe', compact('Resume')); |
670 | } | 649 | } |
671 | 650 | ||
672 | ////////////////////////////////////////////////////////////////// | 651 | ////////////////////////////////////////////////////////////////// |
673 | // | 652 | // |
674 | // | 653 | // |
675 | // Отправил сообщение | 654 | // Отправил сообщение |
676 | // | 655 | // |
677 | // | 656 | // |
678 | // | 657 | // |
679 | // | 658 | // |
680 | ////////////////////////////////////////////////////////////////// | 659 | ////////////////////////////////////////////////////////////////// |
681 | public function new_message(Request $request) { | 660 | public function new_message(Request $request) { |
682 | $params = $request->all(); | 661 | $params = $request->all(); |
683 | 662 | ||
684 | $id = $params['_user_id']; | 663 | $id = $params['_user_id']; |
685 | $message = new Message(); | 664 | $message = new Message(); |
686 | $message->user_id = $params['_user_id']; | 665 | $message->user_id = $params['_user_id']; |
687 | $message->to_user_id = $params['_to_user_id']; | 666 | $message->to_user_id = $params['_to_user_id']; |
688 | $message->title = $params['title']; | 667 | $message->title = $params['title']; |
689 | $message->text = $params['text']; | 668 | $message->text = $params['text']; |
690 | if ($request->has('_file')) { | 669 | if ($request->has('_file')) { |
691 | $message->file = $request->file('_file')->store("worker/$id", 'public'); | 670 | $message->file = $request->file('_file')->store("worker/$id", 'public'); |
692 | } | 671 | } |
693 | $message->flag_new = 1; | 672 | $message->flag_new = 1; |
694 | $id_message = $message->save(); | 673 | $id_message = $message->save(); |
695 | 674 | ||
696 | $data['message_id'] = $id_message; | 675 | $data['message_id'] = $id_message; |
697 | $data['ad_employer_id'] = $params['_vacancy']; | 676 | $data['ad_employer_id'] = $params['_vacancy']; |
698 | $data['job_title_id'] = 0; | 677 | $data['job_title_id'] = 0; |
699 | 678 | ||
700 | $data['flag'] = 1; | 679 | $data['flag'] = 1; |
701 | $ad_responce = ad_response::create($data); | 680 | $ad_responce = ad_response::create($data); |
702 | return redirect()->route('employer.messages', ['type_message' => 'output']); | 681 | return redirect()->route('employer.messages', ['type_message' => 'output']); |
703 | } | 682 | } |
704 | 683 | ||
705 | // Восстановление пароля | 684 | // Восстановление пароля |
706 | public function repair_password(Request $request) { | 685 | public function repair_password(Request $request) { |
707 | $params = $request->get('email'); | 686 | $params = $request->get('email'); |
708 | } | 687 | } |
709 | 688 | ||
710 | // Избранные люди на корабль | 689 | // Избранные люди на корабль |
711 | public function selected_people(Request $request) { | 690 | public function selected_people(Request $request) { |
712 | $id = $request->get('id'); | 691 | $id = $request->get('id'); |
713 | $favorite_people = Job_title::query()->where('position_id', $id)->get(); | 692 | $favorite_people = Job_title::query()->where('position_id', $id)->get(); |
714 | 693 | ||
715 | return view('favorite_people', compact('favorite_people')); | 694 | return view('favorite_people', compact('favorite_people')); |
716 | } | 695 | } |
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(); | 54 | $BigFlot = Array(); |
55 | 55 | ||
56 | foreach ($Position as $position) { | 56 | foreach ($Position as $position) { |
57 | 57 | ||
58 | $BigFlot[] = Ad_jobs::query()->with(['job_title' => function($query) { | 58 | $BigFlot[] = Ad_jobs::query()->with(['job_title' => function($query) { |
59 | $query->OrderBy('sort'); | 59 | $query->OrderBy('sort'); |
60 | }])->whereHas('job_title', function ($query) use ($position) { | 60 | }])->whereHas('job_title', function ($query) use ($position) { |
61 | $query->where('position_id', $position->id); | 61 | $query->where('position_id', $position->id); |
62 | })-> | 62 | })-> |
63 | distinct('job_title_id')-> | 63 | distinct('job_title_id')-> |
64 | get(); | 64 | get(); |
65 | }*/ | 65 | }*/ |
66 | 66 | ||
67 | $BigFlot = Array(); | 67 | $BigFlot = Array(); |
68 | foreach ($Position as $position) { | 68 | foreach ($Position as $position) { |
69 | $BigFlot[] = DB::table('ad_jobs')-> | 69 | $BigFlot[] = DB::table('ad_jobs')-> |
70 | selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')-> | 70 | selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')-> |
71 | orderByDesc('job_titles.sort')-> | 71 | orderByDesc('job_titles.sort')-> |
72 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> | 72 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> |
73 | where('job_titles.position_id', $position->id)-> | 73 | where('job_titles.position_id', $position->id)-> |
74 | groupby('job_title_id')-> | 74 | groupby('job_title_id')-> |
75 | get(); | 75 | get(); |
76 | } | 76 | } |
77 | dd($BigFlot); | ||
78 | |||
77 | 79 | ||
78 | $employers = employers_main::query()->with('employer')->orderBy('id')->limit(8)->get(); | 80 | $employers = employers_main::query()->with('employer')->orderBy('id')->limit(8)->get(); |
79 | $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get(); | 81 | $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get(); |
80 | return view('index', compact('news', 'categories', 'employers', 'vacancy', 'BigFlot', 'Position')); | 82 | return view('index', compact('news', 'categories', 'employers', 'vacancy', 'BigFlot', 'Position')); |
81 | } | 83 | } |
82 | 84 | ||
83 | public function search_vacancies(Request $request) { | 85 | public function search_vacancies(Request $request) { |
84 | if ($request->has('search')) { | 86 | if ($request->has('search')) { |
85 | $search = $request->get('search'); | 87 | $search = $request->get('search'); |
86 | $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first(); | 88 | $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first(); |
87 | if (isset($job_titles->id)) | 89 | if (isset($job_titles->id)) |
88 | if ($job_titles->id > 0) | 90 | if ($job_titles->id > 0) |
89 | return redirect()->route('vacancies', ['job' => $job_titles->id]); | 91 | return redirect()->route('vacancies', ['job' => $job_titles->id]); |
90 | } | 92 | } |
91 | } | 93 | } |
92 | 94 | ||
93 | // Лайк вакансии | 95 | // Лайк вакансии |
94 | public function like_vacancy(Request $request) { | 96 | public function like_vacancy(Request $request) { |
95 | $IP_address = RusDate::ip_addr_client(); | 97 | $IP_address = RusDate::ip_addr_client(); |
96 | 98 | ||
97 | if ($request->has('code_record')) { | 99 | if ($request->has('code_record')) { |
98 | if ($request->has('delete')) { | 100 | if ($request->has('delete')) { |
99 | $atomic_era = Like_vacancy::select('id')-> | 101 | $atomic_era = Like_vacancy::select('id')-> |
100 | where('code_record', '=', $request-> | 102 | where('code_record', '=', $request-> |
101 | get('code_record'))->first(); | 103 | get('code_record'))->first(); |
102 | 104 | ||
103 | DB::table('like_vacancy')->where('code_record', $request->get('code_record'))->delete(); | 105 | DB::table('like_vacancy')->where('code_record', $request->get('code_record'))->delete(); |
104 | 106 | ||
105 | } else { | 107 | } else { |
106 | $params = $request->all(); | 108 | $params = $request->all(); |
107 | $params['ip_address'] = $IP_address; | 109 | $params['ip_address'] = $IP_address; |
108 | Like_vacancy::create($params); | 110 | Like_vacancy::create($params); |
109 | } | 111 | } |
110 | } | 112 | } |
111 | } | 113 | } |
112 | 114 | ||
113 | // Лайк соискателю. | 115 | // Лайк соискателю. |
114 | public function like_worker(Request $request) { | 116 | public function like_worker(Request $request) { |
115 | $IP_address = RusDate::ip_addr_client(); | 117 | $IP_address = RusDate::ip_addr_client(); |
116 | 118 | ||
117 | if ($request->has('code_record')) { | 119 | if ($request->has('code_record')) { |
118 | if ($request->has('delete')) { | 120 | if ($request->has('delete')) { |
119 | $atomic_era = Like_worker::select('id')-> | 121 | $atomic_era = Like_worker::select('id')-> |
120 | where('code_record', '=', $request-> | 122 | where('code_record', '=', $request-> |
121 | get('code_record'))->first(); | 123 | get('code_record'))->first(); |
122 | 124 | ||
123 | DB::table('like_worker')->where('code_record', $request->get('code_record'))->delete(); | 125 | DB::table('like_worker')->where('code_record', $request->get('code_record'))->delete(); |
124 | 126 | ||
125 | return "Вот и результат удаления!"; | 127 | return "Вот и результат удаления!"; |
126 | 128 | ||
127 | } else { | 129 | } else { |
128 | $params = $request->all(); | 130 | $params = $request->all(); |
129 | $params['ip_address'] = $IP_address; | 131 | $params['ip_address'] = $IP_address; |
130 | Like_worker::create($params); | 132 | Like_worker::create($params); |
131 | } | 133 | } |
132 | } | 134 | } |
133 | } | 135 | } |
134 | 136 | ||
135 | 137 | ||
136 | public function vacancies(Request $request) { | 138 | public function vacancies(Request $request) { |
137 | //должности | 139 | //должности |
138 | $Job_title = Job_title::query()->orderBy('name')->get(); | 140 | $Job_title = Job_title::query()->orderBy('name')->get(); |
139 | 141 | ||
140 | $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') | 142 | $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') |
141 | ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary') | 143 | ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary') |
142 | ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') | 144 | ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') |
143 | ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id'); | 145 | ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id'); |
144 | 146 | ||
145 | //категории и вакансии | 147 | //категории и вакансии |
146 | if (($request->has('job')) && ($request->get('job') > 0)) { | 148 | if (($request->has('job')) && ($request->get('job') > 0)) { |
147 | $categories = $categories->Where('job_title_id', '=', $request->get('job')); | 149 | $categories = $categories->Where('job_title_id', '=', $request->get('job')); |
148 | } | 150 | } |
149 | 151 | ||
150 | $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get(); | 152 | $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get(); |
151 | 153 | ||
152 | $Position = Positions::query()->get(); | 154 | $Position = Positions::query()->get(); |
153 | 155 | ||
154 | /*$BigFlot = Array(); | 156 | /*$BigFlot = Array(); |
155 | foreach ($Position as $position) { | 157 | foreach ($Position as $position) { |
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')-> | 158 | $War_flot = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')-> |
157 | orderBy('job_titles.sort')-> | 159 | orderBy('job_titles.sort')-> |
158 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> | 160 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> |
159 | where('position_ship', "$position->name"); | 161 | where('position_ship', "$position->name"); |
160 | if (($request->has('job')) && ($request->get('job') > 0)) { | 162 | if (($request->has('job')) && ($request->get('job') > 0)) { |
161 | $War_flot = $War_flot->where('job_title_id', $request->get('job')); | 163 | $War_flot = $War_flot->where('job_title_id', $request->get('job')); |
162 | } | 164 | } |
163 | $War_flot = $War_flot->groupby('job_title_id','position_ship')->get(); | 165 | $War_flot = $War_flot->groupby('job_title_id','position_ship')->get(); |
164 | $BigFlot[] = $War_flot; | 166 | $BigFlot[] = $War_flot; |
165 | }*/ | 167 | }*/ |
166 | 168 | ||
167 | $BigFlot = Array(); | 169 | $BigFlot = Array(); |
168 | foreach ($Position as $position) { | 170 | foreach ($Position as $position) { |
169 | $WarFlot = DB::table('ad_jobs')-> | 171 | $WarFlot = DB::table('ad_jobs')-> |
170 | selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')-> | 172 | selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')-> |
171 | orderByDesc('job_titles.sort')-> | 173 | orderByDesc('job_titles.sort')-> |
172 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> | 174 | join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> |
173 | where('job_titles.position_id', $position->id); | 175 | where('job_titles.position_id', $position->id); |
174 | if (($request->has('job')) && ($request->get('job') > 0)) { | 176 | if (($request->has('job')) && ($request->get('job') > 0)) { |
175 | $WarFlot = $WarFlot->where('job_title_id', $request->get('job')); | 177 | $WarFlot = $WarFlot->where('job_title_id', $request->get('job')); |
176 | } | 178 | } |
177 | $WarFlot = $WarFlot->groupby('job_title_id')->get(); | 179 | $WarFlot = $WarFlot->groupby('job_title_id')->get(); |
178 | $BigFlot[] = $WarFlot; | 180 | $BigFlot[] = $WarFlot; |
179 | } | 181 | } |
180 | 182 | ||
181 | if ($request->ajax()) { | 183 | if ($request->ajax()) { |
182 | return view('ajax.new_sky', compact('categories', 'BigFlot', 'Position')); | 184 | return view('ajax.new_sky', compact('categories', 'BigFlot', 'Position')); |
183 | } else { | 185 | } else { |
184 | return view('new_sky', compact('Job_title', 'categories', 'BigFlot', 'Position')); | 186 | return view('new_sky', compact('Job_title', 'categories', 'BigFlot', 'Position')); |
185 | } | 187 | } |
186 | } | 188 | } |
187 | 189 | ||
188 | //Вакансии категория детальная | 190 | //Вакансии категория детальная |
189 | public function list_vacancies(Category $categories, Request $request) { | 191 | public function list_vacancies(Category $categories, Request $request) { |
190 | if (isset(Auth()->user()->id)) | 192 | if (isset(Auth()->user()->id)) |
191 | $uid = Auth()->user()->id; | 193 | $uid = Auth()->user()->id; |
192 | else | 194 | else |
193 | $uid = 0; | 195 | $uid = 0; |
194 | 196 | ||
195 | $Query = Ad_employer::with('jobs')-> | 197 | $Query = Ad_employer::with('jobs')-> |
196 | with('cat')-> | 198 | with('cat')-> |
197 | with('employer')-> | 199 | with('employer')-> |
198 | whereHas('jobs_code', function ($query) use ($request) { | 200 | whereHas('jobs_code', function ($query) use ($request) { |
199 | if (null !== ($request->get('job')) && ($request->get('job') !== 0)) { | 201 | if (null !== ($request->get('job')) && ($request->get('job') !== 0)) { |
200 | $query->where('job_title_id', $request->get('job')); | 202 | $query->where('job_title_id', $request->get('job')); |
201 | } | 203 | } |
202 | }) | 204 | }) |
203 | ->select('ad_employers.*'); | 205 | ->select('ad_employers.*'); |
204 | 206 | ||
205 | 207 | ||
206 | if (isset($categories->id) && ($categories->id > 0)) { | 208 | if (isset($categories->id) && ($categories->id > 0)) { |
207 | $Query = $Query->where('category_id', '=', $categories->id); | 209 | $Query = $Query->where('category_id', '=', $categories->id); |
208 | $Name_categori = Category::query()->where('id', '=', $categories->id)->get(); | 210 | $Name_categori = Category::query()->where('id', '=', $categories->id)->get(); |
209 | } else { | 211 | } else { |
210 | $Name_categori = ''; | 212 | $Name_categori = ''; |
211 | } | 213 | } |
212 | 214 | ||
213 | if ($request->get('sort')) { | 215 | if ($request->get('sort')) { |
214 | $sort = $request->get('sort'); | 216 | $sort = $request->get('sort'); |
215 | 217 | ||
216 | 218 | ||
217 | switch ($sort) { | 219 | switch ($sort) { |
218 | case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break; | 220 | case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break; |
219 | case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break; | 221 | case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break; |
220 | case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; | 222 | case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; |
221 | case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; | 223 | case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; |
222 | case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; | 224 | case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; |
223 | default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; | 225 | default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; |
224 | } | 226 | } |
225 | } | 227 | } |
226 | 228 | ||
227 | $Job_title = Job_title::query()->OrderBy('name')->get(); | 229 | $Job_title = Job_title::query()->OrderBy('name')->get(); |
228 | 230 | ||
229 | $Query_count = $Query->count(); | 231 | $Query_count = $Query->count(); |
230 | 232 | ||
231 | $Query = $Query->OrderBy('updated_at')->paginate(3); | 233 | $Query = $Query->OrderBy('updated_at')->paginate(3); |
232 | 234 | ||
233 | $Reclama = reclame::query()->get(); | 235 | $Reclama = reclame::query()->get(); |
234 | 236 | ||
235 | 237 | ||
236 | 238 | ||
237 | if ($request->ajax()) { | 239 | if ($request->ajax()) { |
238 | if ($request->has('title')) { | 240 | if ($request->has('title')) { |
239 | return view('ajax.list_category', compact( | 241 | return view('ajax.list_category', compact( |
240 | 'Name_categori' | 242 | 'Name_categori' |
241 | )); | 243 | )); |
242 | } else { | 244 | } else { |
243 | return view('ajax.list_vacancies', compact('Query', | 245 | return view('ajax.list_vacancies', compact('Query', |
244 | 'Query_count', | 246 | 'Query_count', |
245 | 'Name_categori', | 247 | 'Name_categori', |
246 | 'Reclama', | 248 | 'Reclama', |
247 | 'categories', | 249 | 'categories', |
248 | 'Job_title', | 250 | 'Job_title', |
249 | 'uid')); | 251 | 'uid')); |
250 | } | 252 | } |
251 | } else { | 253 | } else { |
252 | //Вернуть все | 254 | //Вернуть все |
253 | return view('list_vacancies', compact('Query', | 255 | return view('list_vacancies', compact('Query', |
254 | 'Query_count', | 256 | 'Query_count', |
255 | 'Reclama', | 257 | 'Reclama', |
256 | 'Name_categori', | 258 | 'Name_categori', |
257 | 'categories', | 259 | 'categories', |
258 | 'Job_title', | 260 | 'Job_title', |
259 | 'uid')); | 261 | 'uid')); |
260 | } | 262 | } |
261 | } | 263 | } |
262 | 264 | ||
263 | // Образование | 265 | // Образование |
264 | public function education(Request $request) { | 266 | public function education(Request $request) { |
265 | $educations = Education::query(); | 267 | $educations = Education::query(); |
266 | if (($request->has('search')) && (!empty($request->get('search')))) { | 268 | if (($request->has('search')) && (!empty($request->get('search')))) { |
267 | $search = trim($request->get('search')); | 269 | $search = trim($request->get('search')); |
268 | $educations = $educations->where('name', 'LIKE', "%$search%"); | 270 | $educations = $educations->where('name', 'LIKE', "%$search%"); |
269 | } | 271 | } |
270 | 272 | ||
271 | if ($request->get('sort')) { | 273 | if ($request->get('sort')) { |
272 | $sort = $request->get('sort'); | 274 | $sort = $request->get('sort'); |
273 | switch ($sort) { | 275 | switch ($sort) { |
274 | case 'name_up': $educations = $educations->orderBy('name')->orderBy('id'); break; | 276 | case 'name_up': $educations = $educations->orderBy('name')->orderBy('id'); break; |
275 | case 'name_down': $educations = $educations->orderByDesc('name')->orderby('id'); break; | 277 | case 'name_down': $educations = $educations->orderByDesc('name')->orderby('id'); break; |
276 | case 'created_at_up': $educations = $educations->OrderBy('created_at')->orderBy('id'); break; | 278 | case 'created_at_up': $educations = $educations->OrderBy('created_at')->orderBy('id'); break; |
277 | case 'created_at_down': $educations = $educations->orderByDesc('created_at')->orderBy('id'); break; | 279 | case 'created_at_down': $educations = $educations->orderByDesc('created_at')->orderBy('id'); break; |
278 | case 'default': $educations = $educations->orderBy('id')->orderby('updated_at'); break; | 280 | case 'default': $educations = $educations->orderBy('id')->orderby('updated_at'); break; |
279 | default: $educations = $educations->orderBy('id')->orderby('updated_at'); break; | 281 | default: $educations = $educations->orderBy('id')->orderby('updated_at'); break; |
280 | } | 282 | } |
281 | } | 283 | } |
282 | 284 | ||
283 | $count_edu = $educations->count(); | 285 | $count_edu = $educations->count(); |
284 | $educations = $educations->paginate(6); | 286 | $educations = $educations->paginate(6); |
285 | if ($request->ajax()) { | 287 | if ($request->ajax()) { |
286 | return view('ajax.education', compact('educations')); | 288 | return view('ajax.education', compact('educations')); |
287 | } else { | 289 | } else { |
288 | return view('education', compact('educations', 'count_edu')); | 290 | return view('education', compact('educations', 'count_edu')); |
289 | } | 291 | } |
290 | } | 292 | } |
291 | 293 | ||
292 | // Контакты | 294 | // Контакты |
293 | public function contacts() { | 295 | public function contacts() { |
294 | return view('contacts'); | 296 | return view('contacts'); |
295 | } | 297 | } |
296 | 298 | ||
297 | // Вход в личный кабинет | 299 | // Вход в личный кабинет |
298 | public function input_login(Request $request) | 300 | public function input_login(Request $request) |
299 | { | 301 | { |
300 | $params = $request->all(); | 302 | $params = $request->all(); |
301 | 303 | ||
302 | 304 | ||
303 | $rules = [ | 305 | $rules = [ |
304 | 'email' => 'required|string|email', | 306 | 'email' => 'required|string|email', |
305 | 'password' => 'required|string|min:3|max:25', | 307 | 'password' => 'required|string|min:3|max:25', |
306 | ]; | 308 | ]; |
307 | 309 | ||
308 | $messages = [ | 310 | $messages = [ |
309 | 'required' => 'Укажите обязательное поле «:attribute»', | 311 | 'required' => 'Укажите обязательное поле «:attribute»', |
310 | 'email' => 'Введите корректный email', | 312 | 'email' => 'Введите корректный email', |
311 | 'min' => [ | 313 | 'min' => [ |
312 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 314 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
313 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 315 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
314 | ], | 316 | ], |
315 | 'max' => [ | 317 | 'max' => [ |
316 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 318 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
317 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 319 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
318 | ], | 320 | ], |
319 | ]; | 321 | ]; |
320 | 322 | ||
321 | $validator = Validator::make($request->all(), $rules, $messages); | 323 | $validator = Validator::make($request->all(), $rules, $messages); |
322 | 324 | ||
323 | 325 | ||
324 | if ($validator->fails()) { | 326 | if ($validator->fails()) { |
325 | return redirect()->route('index')->with('Error', "Email или пароль невалидный"); | 327 | return redirect()->route('index')->with('Error', "Email или пароль невалидный"); |
326 | } else { | 328 | } else { |
327 | $credentials = $request->only('email', 'password'); | 329 | $credentials = $request->only('email', 'password'); |
328 | 330 | ||
329 | if (Auth::attempt($credentials, $request->has('remember'))) { | 331 | if (Auth::attempt($credentials, $request->has('remember'))) { |
330 | 332 | ||
331 | if (is_null(Auth::user()->email_verified_at)) { | 333 | if (is_null(Auth::user()->email_verified_at)) { |
332 | Auth::logout(); | 334 | Auth::logout(); |
333 | return json_encode(Array("ERROR" => "Адрес почты не подтвержден")); | 335 | return json_encode(Array("ERROR" => "Адрес почты не подтвержден")); |
334 | } | 336 | } |
335 | 337 | ||
336 | if (Auth::user()->is_worker) { | 338 | if (Auth::user()->is_worker) { |
337 | return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl())); | 339 | return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl())); |
338 | } else { | 340 | } else { |
339 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl())); | 341 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl())); |
340 | } | 342 | } |
341 | 343 | ||
342 | return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет")); | 344 | return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет")); |
343 | //->route('index') | 345 | //->route('index') |
344 | //->with('success', 'Вы вошли в личный кабинет.'); | 346 | //->with('success', 'Вы вошли в личный кабинет.'); |
345 | } else { | 347 | } else { |
346 | return json_encode(Array("ERROR" => "Неверный логин или пароль!")); | 348 | return json_encode(Array("ERROR" => "Неверный логин или пароль!")); |
347 | } | 349 | } |
348 | } | 350 | } |
349 | } | 351 | } |
350 | 352 | ||
351 | // Восстановление пароля | 353 | // Восстановление пароля |
352 | public function repair_password(Request $request) { | 354 | public function repair_password(Request $request) { |
353 | $rules = [ | 355 | $rules = [ |
354 | 'email' => 'required|string|email', | 356 | 'email' => 'required|string|email', |
355 | ]; | 357 | ]; |
356 | 358 | ||
357 | $messages = [ | 359 | $messages = [ |
358 | 'required' => 'Укажите обязательное поле «:attribute»', | 360 | 'required' => 'Укажите обязательное поле «:attribute»', |
359 | 'email' => 'Введите корректный email', | 361 | 'email' => 'Введите корректный email', |
360 | 'min' => [ | 362 | 'min' => [ |
361 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 363 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
362 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 364 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
363 | ], | 365 | ], |
364 | 'max' => [ | 366 | 'max' => [ |
365 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 367 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
366 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 368 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
367 | ], | 369 | ], |
368 | ]; | 370 | ]; |
369 | 371 | ||
370 | $validator = Validator::make($request->all(), $rules, $messages); | 372 | $validator = Validator::make($request->all(), $rules, $messages); |
371 | 373 | ||
372 | if ($validator->fails()) { | 374 | if ($validator->fails()) { |
373 | return redirect()->back()->with('Error', "Email невалидный"); | 375 | return redirect()->back()->with('Error', "Email невалидный"); |
374 | } else { | 376 | } else { |
375 | $new_password = Tools::generator_id(10); | 377 | $new_password = Tools::generator_id(10); |
376 | $hash_password = Hash::make($new_password); | 378 | $hash_password = Hash::make($new_password); |
377 | $user = User::query()->where('email', $request->get('email'))->first(); | 379 | $user = User::query()->where('email', $request->get('email'))->first(); |
378 | $EditRec = User::find($user->id); | 380 | $EditRec = User::find($user->id); |
379 | $EditRec->password = $hash_password; | 381 | $EditRec->password = $hash_password; |
380 | $EditRec->save(); | 382 | $EditRec->save(); |
381 | 383 | ||
382 | foreach ([$request->get('email')] as $recipient) { | 384 | foreach ([$request->get('email')] as $recipient) { |
383 | Mail::to($recipient)->send(new MailRepair($new_password)); | 385 | Mail::to($recipient)->send(new MailRepair($new_password)); |
384 | } | 386 | } |
385 | return redirect()->route('index'); | 387 | return redirect()->route('index'); |
386 | 388 | ||
387 | } | 389 | } |
388 | 390 | ||
389 | } | 391 | } |
390 | 392 | ||
391 | // Вывод новостей | 393 | // Вывод новостей |
392 | public function news(Request $request) { | 394 | public function news(Request $request) { |
393 | $Query = News::query(); | 395 | $Query = News::query(); |
394 | if ($request->has('search')) { | 396 | if ($request->has('search')) { |
395 | $search = $request->get('search'); | 397 | $search = $request->get('search'); |
396 | $Query = $Query->where('title', 'LIKE', "%$search%")-> | 398 | $Query = $Query->where('title', 'LIKE', "%$search%")-> |
397 | orWhere('text', 'LIKE', "%$search%"); | 399 | orWhere('text', 'LIKE', "%$search%"); |
398 | } | 400 | } |
399 | 401 | ||
400 | if ($request->ajax()) { | 402 | if ($request->ajax()) { |
401 | if ($request->get('sort')) { | 403 | if ($request->get('sort')) { |
402 | $sort = $request->get('sort'); | 404 | $sort = $request->get('sort'); |
403 | switch ($sort) { | 405 | switch ($sort) { |
404 | case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break; | 406 | case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break; |
405 | case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break; | 407 | case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break; |
406 | case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; | 408 | case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; |
407 | case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; | 409 | case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; |
408 | case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; | 410 | case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; |
409 | default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; | 411 | default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; |
410 | } | 412 | } |
411 | } | 413 | } |
412 | } | 414 | } |
413 | $Query_count = $Query->count(); | 415 | $Query_count = $Query->count(); |
414 | $Query = $Query->paginate(6); | 416 | $Query = $Query->paginate(6); |
415 | 417 | ||
416 | if ($request->ajax()) { | 418 | if ($request->ajax()) { |
417 | return view('ajax.news-list', compact('Query', 'Query_count')); | 419 | return view('ajax.news-list', compact('Query', 'Query_count')); |
418 | } else { | 420 | } else { |
419 | return view('news-list', compact('Query', 'Query_count')); | 421 | return view('news-list', compact('Query', 'Query_count')); |
420 | } | 422 | } |
421 | } | 423 | } |
422 | 424 | ||
423 | //Детальная новость | 425 | //Детальная новость |
424 | public function detail_new(News $new) { | 426 | public function detail_new(News $new) { |
425 | // Наборка | 427 | // Наборка |
426 | $Query = News::query()->where('id', $new->id)->get(); | 428 | $Query = News::query()->where('id', $new->id)->get(); |
427 | $title = $Query[0]->title; | 429 | $title = $Query[0]->title; |
428 | $All_Query = News::query()->paginate(8); | 430 | $All_Query = News::query()->paginate(8); |
429 | return view('detail_new', compact('Query', 'All_Query', 'title')); | 431 | return view('detail_new', compact('Query', 'All_Query', 'title')); |
430 | } | 432 | } |
431 | } | 433 | } |
432 | 434 |
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> | 4 | <script> |
5 | console.log('Приближаемся к системе, нас рой тут...'); | 5 | console.log('Приближаемся к системе, нас рой тут...'); |
6 | $(document).on('change', '#position_id', function() { | 6 | $(document).on('change', '#position_id', function() { |
7 | var this_ = $(this); | 7 | var this_ = $(this); |
8 | var val_ = this_.val(); | 8 | var val_ = this_.val(); |
9 | var ajax_ = $('#job_title_id'); | 9 | var ajax_ = $('#job_title_id'); |
10 | 10 | ||
11 | console.log('Создания списка людей, которые поднимутся на корабль...'); | 11 | console.log('Создания списка людей, которые поднимутся на корабль...'); |
12 | 12 | ||
13 | $.ajax({ | 13 | $.ajax({ |
14 | type: "GET", | 14 | type: "GET", |
15 | url: "{{ route('employer.selected_people') }}", | 15 | url: "{{ route('employer.selected_people') }}", |
16 | data: "id="+val_, | 16 | data: "id="+val_, |
17 | success: function (data) { | 17 | success: function (data) { |
18 | console.log('Ответка пришла'); | 18 | console.log('Ответка пришла'); |
19 | console.log('Список избранных людей создан'); | 19 | console.log('Список избранных людей создан'); |
20 | ajax_.html(data); | 20 | ajax_.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 | console.log('Обрыв связи'); | 26 | console.log('Обрыв связи'); |
27 | console.log('Error: ' + data); | 27 | console.log('Error: ' + data); |
28 | } | 28 | } |
29 | }); | 29 | }); |
30 | }); | 30 | }); |
31 | </script> | 31 | </script> |
32 | @endsection | 32 | @endsection |
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' => 2]) | 48 | @include('employers.menu', ['item' => 2]) |
49 | 49 | ||
50 | </div> | 50 | </div> |
51 | 51 | ||
52 | <form class="cabinet__body" action="{{ route('employer.vac_save') }}" method="POST"> | 52 | <form class="cabinet__body" action="{{ route('employer.vac_save') }}" method="POST"> |
53 | @csrf | 53 | @csrf |
54 | <input type="hidden" name="employer_id" value="{{ $Employer[0]->id }}"/> | 54 | <input type="hidden" name="employer_id" value="{{ $Employer[0]->id }}"/> |
55 | <div class="cabinet__body-item"> | 55 | <div class="cabinet__body-item"> |
56 | <div class="cabinet__descr"> | 56 | <div class="cabinet__descr"> |
57 | <h2 class="title cabinet__title">Разместить вакансию</h2> | 57 | <h2 class="title cabinet__title">Разместить вакансию</h2> |
58 | <p class="cabinet__text"><b>Данные по вакансии</b></p> | 58 | <p class="cabinet__text"><b>Данные по вакансии</b></p> |
59 | <p class="cabinet__text">Все поля обязательны для заполнения *</p> | 59 | <p class="cabinet__text">Все поля обязательны для заполнения *</p> |
60 | </div> | 60 | </div> |
61 | </div> | 61 | </div> |
62 | |||
62 | <div class="cabinet__body-item"> | 63 | <div class="cabinet__body-item"> |
64 | <h4>Поля для вакансии</h4> | ||
63 | <div class="cabinet__inputs"> | 65 | <div class="cabinet__inputs"> |
64 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 66 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
65 | <label class="form-group__label">Название вакансии</label> | 67 | <label class="form-group__label">Название вакансии</label> |
66 | <div class="form-group__item"> | 68 | <div class="form-group__item"> |
67 | <input type="text" class="input" name="name" id="name" placeholder="Работа в море" value="{{ old('name') ?? $Employer[0]->name ?? '' }}" required> | 69 | <input type="text" class="input" name="name" id="name" placeholder="Работа в море" value="{{ old('name') ?? $Employer[0]->name ?? '' }}" required> |
68 | @error('name') | 70 | @error('name') |
69 | <span class="text-xs text-red-600 dark:text-red-400"> | 71 | <span class="text-xs text-red-600 dark:text-red-400"> |
70 | {{ $message }} | 72 | {{ $message }} |
71 | </span> | 73 | </span> |
72 | @enderror | 74 | @enderror |
73 | </div> | 75 | </div> |
74 | </div> | 76 | </div> |
75 | 77 | ||
76 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 78 | <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 | ||
115 | </div> | ||
116 | </div> | ||
117 | </div> | ||
118 | |||
119 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
120 | <label class="form-group__label">Категория (локация)</label> | ||
121 | <div class="form-group__item"> | ||
122 | <div class="select"> | ||
123 | <select class="js-select2" name="category_id" id="category_id"> | ||
124 | @php $i = 1 @endphp | ||
125 | @if ($categories->count()) | ||
126 | @foreach($categories as $j) | ||
127 | @if ($i == 1) <option selected> Выберите категорию из списка</option> | ||
128 | @else | ||
129 | <option value="{{ $j->id }}">{{ $j->name }}</option> | ||
130 | @endif | ||
131 | @php $i++ @endphp | ||
132 | @endforeach | ||
133 | @endif | ||
134 | </select> | ||
135 | @error('category_id') | ||
136 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
137 | {{ $message }} | ||
138 | </span> | ||
139 | @enderror | ||
140 | </div> | ||
141 | </div> | ||
142 | </div> | ||
143 | |||
144 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
145 | <label class="form-group__label">Телефон</label> | 79 | <label class="form-group__label">Телефон</label> |
146 | <div class="form-group__item"> | 80 | <div class="form-group__item"> |
147 | <input type="text" class="input" name="telephone" id="telephone" value="{{ old('telephone') ?? $Employer[0]->telephone ?? '' }}" placeholder="Свой телефон"> | 81 | <input type="text" class="input" name="telephone" id="telephone" value="{{ old('telephone') ?? $Employer[0]->telephone ?? '' }}" placeholder="Свой телефон"> |
148 | @error('telephone') | 82 | @error('telephone') |
149 | <span class="text-xs text-red-600 dark:text-red-400"> | 83 | <span class="text-xs text-red-600 dark:text-red-400"> |
150 | {{ $message }} | 84 | {{ $message }} |
151 | </span> | 85 | </span> |
152 | @enderror | 86 | @enderror |
153 | </div> | 87 | </div> |
154 | </div> | 88 | </div> |
155 | 89 | ||
156 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 90 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
157 | <label class="form-group__label">Емайл</label> | 91 | <label class="form-group__label">Емайл</label> |
158 | <div class="form-group__item"> | 92 | <div class="form-group__item"> |
159 | <input type="text" class="input" name="email" id="email" value="{{ old('email') ?? $Employer[0]->email ?? '' }}" placeholder="Своя почту"> | 93 | <input type="text" class="input" name="email" id="email" value="{{ old('email') ?? $Employer[0]->email ?? '' }}" placeholder="Своя почту"> |
160 | @error('email') | 94 | @error('email') |
161 | <span class="text-xs text-red-600 dark:text-red-400"> | 95 | <span class="text-xs text-red-600 dark:text-red-400"> |
162 | {{ $message }} | 96 | {{ $message }} |
163 | </span> | 97 | </span> |
164 | @enderror | 98 | @enderror |
165 | </div> | 99 | </div> |
166 | </div> | 100 | </div> |
167 | 101 | ||
168 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 102 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
169 | <label class="form-group__label">Зарплата среднестатистическая</label> | 103 | <label class="form-group__label">Зарплата среднестатистическая для вакансии</label> |
170 | <div class="form-group__item"> | 104 | <div class="form-group__item"> |
171 | <input type="text" class="input" name="salary" id="salary" value="{{ old('salary') ?? '' }}" placeholder="Среднестатистическая зарплата"> | 105 | <input type="text" class="input" name="salary" id="salary" value="{{ old('salary') ?? '' }}" placeholder="Среднестатистическая зарплата"> |
172 | @error('salary') | 106 | @error('salary') |
173 | <span class="text-xs text-red-600 dark:text-red-400"> | 107 | <span class="text-xs text-red-600 dark:text-red-400"> |
174 | {{ $message }} | 108 | {{ $message }} |
175 | </span> | 109 | </span> |
176 | @enderror | 110 | @enderror |
177 | </div> | 111 | </div> |
178 | </div> | 112 | </div> |
179 | 113 | ||
180 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 114 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
181 | <label class="form-group__label">Минимальная зарплата</label> | 115 | <label class="form-group__label">Город посадки</label> |
182 | <div class="form-group__item"> | ||
183 | <input type="text" class="input" name="min_salary" id="min_salary" value="{{ old('min_salary') ?? '' }}" placeholder="Минимальная зарплата"> | ||
184 | @error('min_salary') | ||
185 | <span class="text-xs text-red-600"> | ||
186 | {{ $message }} | ||
187 | </span> | ||
188 | @enderror | ||
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"> | 116 | <div class="form-group__item"> |
207 | <input type="text" class="input" name="city" id="city" value="{{ old('city') ?? $Employer[0]->city ?? '' }}" placeholder="Севастополь"> | 117 | <input type="text" class="input" name="city" id="city" value="{{ old('city') ?? $Employer[0]->city ?? '' }}" placeholder="Севастополь"> |
208 | @error('city') | 118 | @error('city') |
209 | <span class="text-xs text-red-600"> | 119 | <span class="text-xs text-red-600"> |
210 | {{ $message }} | 120 | {{ $message }} |
211 | </span> | 121 | </span> |
212 | @enderror | 122 | @enderror |
213 | </div> | 123 | </div> |
214 | </div> | 124 | </div> |
215 | 125 | ||
216 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 126 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
217 | <label class="form-group__label">Мощность</label> | 127 | <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> | ||
226 | </div> | ||
227 | |||
228 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
229 | <label class="form-group__label">Суточные выплаты</label> | ||
230 | <div class="form-group__item"> | ||
231 | <input type="text" class="input" name="sytki" id="sytki" value="{{ old('sytki') ?? '' }}" placeholder="2000"> | ||
232 | @error('power') | ||
233 | <span class="text-xs text-red-600"> | ||
234 | {{ $message }} | ||
235 | </span> | ||
236 | @enderror | ||
237 | </div> | ||
238 | </div> | ||
239 | |||
240 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
241 | <label class="form-group__label">Начало отплытия</label> | ||
242 | <div class="form-group__item"> | ||
243 | <input type="text" class="input" name="start" id="start" value="{{ old('start') ?? '' }}" placeholder="20 сентября 2024"> | ||
244 | @error('power') | ||
245 | <span class="text-xs text-red-600"> | ||
246 | {{ $message }} | ||
247 | </span> | ||
248 | @enderror | ||
249 | </div> | ||
250 | </div> | ||
251 | |||
252 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
253 | <label class="form-group__label">Корабль для посадки</label> | ||
254 | <div class="form-group__item"> | 128 | <div class="form-group__item"> |
255 | <div class="select"> | 129 | <div class="select"> |
256 | <select class="js-select2" name="flot" id="flot"> | 130 | <select class="js-select2" name="category_id" id="category_id"> |
257 | <option value="" selected> Не указан корабль</option> | 131 | @php $i = 1 @endphp |
258 | @if ($Employer[0]->flots->count()) | 132 | @if ($categories->count()) |
259 | @foreach($Employer[0]->flots as $j) | 133 | @foreach($categories as $j) |
260 | <option value="{{ $j->name }}">{{ $j->name }} ({{ $j->id }})</option> | 134 | @if ($i == 1) <option selected> Выберите категорию из списка</option> |
135 | @else | ||
136 | <option value="{{ $j->id }}">{{ $j->name }}</option> | ||
137 | @endif | ||
138 | @php $i++ @endphp | ||
261 | @endforeach | 139 | @endforeach |
262 | @endif | 140 | @endif |
263 | </select> | 141 | </select> |
264 | @error('flot') | 142 | @error('category_id') |
265 | <span class="text-xs text-red-600"> | 143 | <span class="text-xs text-red-600 dark:text-red-400"> |
266 | {{ $message }} | 144 | {{ $message }} |
267 | </span> | 145 | </span> |
268 | @enderror | 146 | @enderror |
269 | </div> | 147 | </div> |
270 | </div> | 148 | </div> |
271 | </div> | 149 | </div> |
272 | 150 | ||
273 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 151 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
274 | <label class="form-group__label">Описание вакансии</label> | 152 | <label class="form-group__label">Описание вакансии</label> |
275 | <div class="form-group__item"> | 153 | <div class="form-group__item"> |
276 | <textarea class="textarea" name="text" id="text">{{ $Employer[0]->text ?? '' }}</textarea> | 154 | <textarea class="textarea" name="text" id="text">{{ $Employer[0]->text ?? '' }}</textarea> |
277 | @error('text') | 155 | @error('text') |
278 | <span class="text-xs text-red-600"> | 156 | <span class="text-xs text-red-600"> |
279 | {{ $message }} | 157 | {{ $message }} |
280 | </span> | 158 | </span> |
281 | @enderror | 159 | @enderror |
282 | </div> | 160 | </div> |
283 | </div> | 161 | </div> |
284 | |||
285 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
286 | <label class="form-group__label">Дополнительная информация</label> | ||
287 | <div class="form-group__item"> | ||
288 | <textarea class="textarea" name="description" id="description">{{ old('description') ?? '' }}</textarea> | ||
289 | @error('description') | ||
290 | <span class="text-xs text-red-600"> | ||
291 | {{ $message }} | ||
292 | </span> | ||
293 | @enderror | ||
294 | </div> | ||
295 | </div> | ||
296 | </div> | 162 | </div> |
297 | <button type="submit" class="button cabinet__submit">Опубликовать</button> | 163 | <button type="submit" class="button cabinet__submit">Опубликовать</button> |
298 | </div> | 164 | </div> |
299 | </form> | 165 | </form> |
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('Приближаемся к системе, нас рой тут...'); | 5 | console.log('Приближаемся к системе, нас рой тут...'); |
6 | $(document).on('change', '#position_id', function() { | 6 | $(document).on('change', '#position_id', function() { |
7 | var this_ = $(this); | 7 | var this_ = $(this); |
8 | var val_ = this_.val(); | 8 | var val_ = this_.val(); |
9 | var ajax_ = $('#job_title_id'); | 9 | var ajax_ = $('#job_title_id'); |
10 | 10 | ||
11 | console.log('Создания списка людей, которые поднимутся на корабль...'); | 11 | console.log('Создания списка людей, которые поднимутся на корабль...'); |
12 | 12 | ||
13 | $.ajax({ | 13 | $.ajax({ |
14 | type: "GET", | 14 | type: "GET", |
15 | url: "{{ route('employer.selected_people') }}", | 15 | url: "{{ route('employer.selected_people') }}", |
16 | data: "id="+val_, | 16 | data: "id="+val_, |
17 | success: function (data) { | 17 | success: function (data) { |
18 | console.log('Ответка пришла'); | 18 | console.log('Ответка пришла'); |
19 | console.log('Список избранных людей создан'); | 19 | console.log('Список избранных людей создан'); |
20 | ajax_.html(data); | 20 | ajax_.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 | console.log('Обрыв связи'); | 26 | console.log('Обрыв связи'); |
27 | console.log('Error: ' + data); | 27 | console.log('Error: ' + data); |
28 | } | 28 | } |
29 | }); | 29 | }); |
30 | }); | 30 | }); |
31 | </script> | 31 | </script> |
32 | @endsection | 32 | @endsection |
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' => 0]) | 48 | @include('employers.menu', ['item' => 0]) |
49 | 49 | ||
50 | </div> | 50 | </div> |
51 | 51 | ||
52 | <form class="cabinet__body" action="{{ route('employer.vacancy_save_me', ['ad_employer' => $ad_employer]) }}" method="POST"> | 52 | <form class="cabinet__body" action="{{ route('employer.vacancy_save_me', ['ad_employer' => $Employer->id]) }}" method="POST"> |
53 | @csrf | 53 | @csrf |
54 | <input type="hidden" name="employer_id" value="{{ $Employer->id }}"/> | 54 | <input type="hidden" name="employer_id" value="{{ $Employer->id }}"/> |
55 | <div class="cabinet__body-item"> | 55 | <div class="cabinet__body-item"> |
56 | <div class="cabinet__descr"> | 56 | <div class="cabinet__descr"> |
57 | <h2 class="title cabinet__title">Редактировать вакансию</h2> | 57 | <h2 class="title cabinet__title">Редактировать вакансию</h2> |
58 | <p class="cabinet__text"><b>Данные по вакансии</b></p> | 58 | <p class="cabinet__text"><b>Данные по вакансии</b></p> |
59 | <p class="cabinet__text">Все поля обязательны для заполнения *</p> | 59 | <p class="cabinet__text">Все поля обязательны для заполнения *</p> |
60 | </div> | 60 | </div> |
61 | </div> | 61 | </div> |
62 | <div class="cabinet__body-item"> | 62 | <div class="cabinet__body-item"> |
63 | <div class="cabinet__inputs"> | 63 | <h4>Поля для вакансии</h4> |
64 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 64 | <div class="cabinet__inputs"> |
65 | <label class="form-group__label">Название вакансии</label> | 65 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
66 | <div class="form-group__item"> | 66 | <label class="form-group__label">Название вакансии</label> |
67 | <input type="text" class="input" name="name" id="name" placeholder="Работа в море" value="{{ old('name') ?? $ad_employer->name ?? '' }}" required> | 67 | <div class="form-group__item"> |
68 | @error('name') | 68 | <input type="text" class="input" name="name" id="name" placeholder="Работа в море" value="{{ old('name') ?? $ad_employer->name ?? '' }}" required> |
69 | <span class="text-xs text-red-600"> | 69 | @error('name') |
70 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
70 | {{ $message }} | 71 | {{ $message }} |
71 | </span> | 72 | </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 | 73 | @enderror |
90 | </div> | 74 | </div> |
91 | </div> | 75 | </div> |
92 | </div> | ||
93 | 76 | ||
94 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 77 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
95 | <label class="form-group__label">Должность соискателя</label> | 78 | <label class="form-group__label">Телефон</label> |
96 | <div class="form-group__item"> | 79 | <div class="form-group__item"> |
97 | <div class="select"> | 80 | <input type="text" class="input" name="telephone" id="telephone" value="{{ old('telephone') ?? $ad_employer->telephone ?? '' }}" placeholder="Свой телефон"> |
98 | <select class="js-select2" name="job_title_id" id="job_title_id"> | 81 | @error('telephone') |
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"> | 82 | <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> | ||
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="email" id="email" value="{{ old('email') ?? $Employer->email ?? '' }}" placeholder="Своя почту"> | ||
157 | @error('email') | ||
158 | <span class="text-xs text-red-600"> | ||
159 | {{ $message }} | 83 | {{ $message }} |
160 | </span> | 84 | </span> |
161 | @enderror | 85 | @enderror |
162 | </div> | 86 | </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="salary" id="salary" value="old('salary') ?? '' }}" placeholder="Среднестатистическая зарплата"> | ||
169 | @error('salary') | ||
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 | <input type="text" class="input" name="min_salary" id="min_salary" value=" old('min_salary') ?? '' }}" placeholder="Минимальная зарплата"> | ||
181 | @error('min_salary') | ||
182 | <span class="text-xs text-red-600"> | ||
183 | {{ $message }} | ||
184 | </span> | ||
185 | @enderror | ||
186 | </div> | ||
187 | </div> | ||
188 | |||
189 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
190 | <label class="form-group__label">Максимальная зарплата</label> | ||
191 | <div class="form-group__item"> | ||
192 | <input type="text" class="input" name="max_salary" id="max_salary" value=" old('max_salary') ?? '' }}" placeholder="Максимальная зарплата"> | ||
193 | @error('salary') | ||
194 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
195 | {{ $message }} | ||
196 | </span> | ||
197 | @enderror | ||
198 | </div> | ||
199 | </div> | ||
200 | |||
201 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
202 | <label class="form-group__label">Город-регион</label> | ||
203 | <div class="form-group__item"> | ||
204 | <input type="text" class="input" name="city" id="city" value=" old('city') ?? $Employer[0]->city ?? '' }}" placeholder="Севастополь"> | ||
205 | @error('city') | ||
206 | <span class="text-xs text-red-600"> | ||
207 | {{ $message }} | ||
208 | </span> | ||
209 | @enderror | ||
210 | </div> | 87 | </div> |
211 | </div> | ||
212 | 88 | ||
213 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 89 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
214 | <label class="form-group__label">Мощность</label> | 90 | <label class="form-group__label">Емайл</label> |
215 | <div class="form-group__item"> | 91 | <div class="form-group__item"> |
216 | <input type="text" class="input" name="power" id="power" value=" old('power') ?? '' }}" placeholder="POWER-45"> | 92 | <input type="text" class="input" name="email" id="email" value="{{ old('email') ?? $ad_employer->email ?? '' }}" placeholder="Своя почту"> |
217 | @error('power') | 93 | @error('email') |
218 | <span class="text-xs text-red-600"> | 94 | <span class="text-xs text-red-600 dark:text-red-400"> |
219 | {{ $message }} | 95 | {{ $message }} |
220 | </span> | 96 | </span> |
221 | @enderror | 97 | @enderror |
98 | </div> | ||
222 | </div> | 99 | </div> |
223 | </div> | ||
224 | 100 | ||
225 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 101 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
226 | <label class="form-group__label">Суточные выплаты</label> | 102 | <label class="form-group__label">Зарплата среднестатистическая для вакансии</label> |
227 | <div class="form-group__item"> | 103 | <div class="form-group__item"> |
228 | <input type="text" class="input" name="sytki" id="sytki" value=" old('sytki') ?? '' }}" placeholder="2000"> | 104 | <input type="text" class="input" name="salary" id="salary" value="{{ old('salary') ?? $ad_employer->salary ??'' }}" placeholder="Среднестатистическая зарплата"> |
229 | @error('power') | 105 | @error('salary') |
230 | <span class="text-xs text-red-600"> | 106 | <span class="text-xs text-red-600 dark:text-red-400"> |
231 | {{ $message }} | 107 | {{ $message }} |
232 | </span> | 108 | </span> |
233 | @enderror | 109 | @enderror |
110 | </div> | ||
234 | </div> | 111 | </div> |
235 | </div> | ||
236 | 112 | ||
237 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 113 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
238 | <label class="form-group__label">Начало отплытия</label> | 114 | <label class="form-group__label">Город посадки</label> |
239 | <div class="form-group__item"> | 115 | <div class="form-group__item"> |
240 | <input type="text" class="input" name="start" id="start" value=" old('start') ?? $Employer->ads->start ?? '' }}" placeholder="20 сентября 2024"> | 116 | <input type="text" class="input" name="city" id="city" value="{{ old('city') ?? $ad_employer->city ?? '' }}" placeholder="Севастополь"> |
241 | @error('power') | 117 | @error('city') |
242 | <span class="text-xs text-red-600"> | 118 | <span class="text-xs text-red-600"> |
243 | {{ $message }} | 119 | {{ $message }} |
244 | </span> | 120 | </span> |
245 | @enderror | 121 | @enderror |
122 | </div> | ||
246 | </div> | 123 | </div> |
247 | </div>--> | ||
248 | |||
249 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
250 | <label class="form-group__label">Корабль для посадки</label> | ||
251 | <div class="form-group__item"> | ||
252 | <div class="select"> | ||
253 | <select class="js-select2" name="flot" id="flot"> | ||
254 | 124 | ||
255 | @if ($Employer->flots->count()) | 125 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
256 | @foreach($Employer->flots as $j) | 126 | <label class="form-group__label">Категория (локация)</label> |
257 | <option value="{{ $j->name }}">{{ $j->name }} ({{ $j->id }})</option> | 127 | <div class="form-group__item"> |
258 | @endforeach | 128 | <div class="select"> |
259 | @endif | 129 | <select class="js-select2" name="category_id" id="category_id"> |
260 | </select> | 130 | @php $i = 1 @endphp |
261 | @error('flot') | 131 | @if ($categories->count()) |
262 | <span class="text-xs text-red-600"> | 132 | @foreach($categories as $j) |
133 | @if ($i == 1) <option> Выберите категорию из списка</option> | ||
134 | @else | ||
135 | <option value="{{ $j->id }}" @if ($ad_employer->category_id == $j->id) selected @endif>{{ $j->name }}</option> | ||
136 | @endif | ||
137 | @php $i++ @endphp | ||
138 | @endforeach | ||
139 | @endif | ||
140 | </select> | ||
141 | @error('category_id') | ||
142 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
263 | {{ $message }} | 143 | {{ $message }} |
264 | </span> | 144 | </span> |
265 | @enderror | 145 | @enderror |
146 | </div> | ||
266 | </div> | 147 | </div> |
267 | </div> | 148 | </div> |
268 | </div> | ||
269 | 149 | ||
270 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | 150 | |
271 | <label class="form-group__label">Описание вакансии</label> | 151 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
272 | <div class="form-group__item"> | 152 | <label class="form-group__label">Описание вакансии</label> |
273 | <textarea class="textarea" name="text" id="text">{{ old('text') ?? $Employer[0]->text ?? '' }}</textarea> | 153 | <div class="form-group__item"> |
274 | @error('text') | 154 | <textarea class="textarea" name="text" id="text">{{ old('text') ?? $ad_employer->text ?? '' }}</textarea> |
275 | <span class="text-xs text-red-600"> | 155 | @error('text') |
156 | <span class="text-xs text-red-600"> | ||
276 | {{ $message }} | 157 | {{ $message }} |
277 | </span> | 158 | </span> |
278 | @enderror | 159 | @enderror |
160 | </div> | ||
279 | </div> | 161 | </div> |
280 | </div> | 162 | </div> |
281 | 163 | ||
282 | <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | ||
283 | <label class="form-group__label">Дополнительная информация</label> | ||
284 | <div class="form-group__item"> | ||
285 | <textarea class="textarea" name="description" id="description"> old('description') ?? '' }}</textarea> | ||
286 | @error('description') |
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> |
153 | {{ $vacancy_list->appends($_GET)->links('paginate') }} | 166 | {{ $vacancy_list->appends($_GET)->links('paginate') }} |
154 | </div> | 167 | </div> |
155 | 168 | ||
156 | 169 | ||
157 | @else | 170 | @else |
158 | 171 | ||
159 | <div class="notify"> | 172 | <div class="notify"> |
160 | <svg> | 173 | <svg> |
161 | <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> | 174 | <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> |
162 | </svg> | 175 | </svg> |
163 | <span>Вы ещё не разместили ни одной вакансии</span> | 176 | <span>Вы ещё не разместили ни одной вакансии</span> |
164 | </div> | 177 | </div> |
165 | @endif | 178 | @endif |
166 | </div> | 179 | </div> |
167 | </div> | 180 | </div> |
168 | </div> | 181 | </div> |
169 | </div> | 182 | </div> |
170 | </div> | 183 | </div> |
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'); |
541 | |||
542 | |||
540 | Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); | 543 | Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); |
541 | 544 | ||
542 | 545 | ||
543 | // 3 страница - Мои вакансии | 546 | // 3 страница - Мои вакансии |
544 | Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); | 547 | 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'); | 548 | 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'); | 549 | 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'); | 550 | 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'); | 551 | Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); |
549 | Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); | 552 | Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); |
550 | Route::post('cabinet/vacancy-edit/{ad_employer}/', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); | 553 | Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); |
554 | |||
555 | // 4.1Ю. | ||
556 | Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac'); | ||
557 | Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save'); | ||
558 | Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac'); | ||
559 | Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save'); | ||
560 | Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac'); | ||
551 | 561 | ||
552 | // 4 страница - Отклики на вакансии | 562 | // 4 страница - Отклики на вакансии |
553 | Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); | 563 | Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); |
554 | Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); | 564 | 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'); | 565 | Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); |
556 | 566 | ||
557 | // 5 страница - Сообщения | 567 | // 5 страница - Сообщения |
558 | Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); | 568 | Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); |
559 | Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); | 569 | Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); |
560 | Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); | 570 | Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); |
561 | Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); | 571 | Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); |
562 | 572 | ||
563 | // 6 страница - Избранный | 573 | // 6 страница - Избранный |
564 | Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); | 574 | Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); |
565 | 575 | ||
566 | //7 страница - База данных | 576 | //7 страница - База данных |
567 | Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); | 577 | Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); |
568 | 578 | ||
569 | //8 страница - База резюме | 579 | //8 страница - База резюме |
570 | Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); | 580 | Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); |
571 | 581 | ||
572 | // 9 рассылка сообщений | 582 | // 9 рассылка сообщений |
573 | Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); | 583 | 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'); | 584 | Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); |
575 | 585 | ||
576 | // 10 страница FAQ вопросы | 586 | // 10 страница FAQ вопросы |
577 | Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq'); | 587 | Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq'); |
578 | 588 | ||
579 | // 11 страница - Настройка уведомлений | 589 | // 11 страница - Настройка уведомлений |
580 | Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); | 590 | Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); |
581 | Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); | 591 | Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); |
582 | 592 | ||
583 | // 12 страница - Сменить пароль | 593 | // 12 страница - Сменить пароль |
584 | Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); | 594 | 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'); | 595 | Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); |
586 | 596 | ||
587 | // 13 страница - Удаление профиля | 597 | // 13 страница - Удаление профиля |
588 | Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); | 598 | 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'); | 599 | 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'); | 600 | Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); |
591 | 601 | ||
592 | // Отправил сообщение | 602 | // Отправил сообщение |
593 | Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); | 603 | Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); |
594 | }); | 604 | }); |
595 | 605 | ||
596 | 606 |