Commit d7c3522a7f20932e534231cc6e79ab06b4f9c50d
1 parent
31fe4e458f
Exists in
master
and in
1 other branch
Коммит изменение структуры проекта
Showing 9 changed files with 681 additions and 386 deletions Side-by-side 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
... | ... | @@ -0,0 +1,98 @@ |
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 | +} |
app/Http/Controllers/EmployerController.php
... | ... | @@ -134,28 +134,8 @@ class EmployerController extends Controller |
134 | 134 | // Сохранение вакансии |
135 | 135 | public function cabinet_vacancy_save1(VacancyRequestEdit $request) { |
136 | 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 | 139 | return redirect()->route('employer.vacancy_list'); |
160 | 140 | } |
161 | 141 | |
... | ... | @@ -163,7 +143,8 @@ class EmployerController extends Controller |
163 | 143 | public function vacancy_list(Request $request) { |
164 | 144 | $id = Auth()->user()->id; |
165 | 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 | 149 | if ($request->get('sort')) { |
169 | 150 | $sort = $request->get('sort'); |
... | ... | @@ -178,7 +159,6 @@ class EmployerController extends Controller |
178 | 159 | } |
179 | 160 | $vacancy_list = $vacancy_list->paginate(4); |
180 | 161 | |
181 | - | |
182 | 162 | //ajax |
183 | 163 | if ($request->ajax()) { |
184 | 164 | return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); |
... | ... | @@ -197,7 +177,6 @@ class EmployerController extends Controller |
197 | 177 | } else { |
198 | 178 | $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get(); |
199 | 179 | } |
200 | - | |
201 | 180 | $categories = Category::query()->get(); |
202 | 181 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
203 | 182 | where('user_id', $id)->first(); |
... | ... | @@ -210,16 +189,16 @@ class EmployerController extends Controller |
210 | 189 | $params = $request->all(); |
211 | 190 | |
212 | 191 | //$jobs['flot'] = $params['flot']; |
213 | - $jobs['job_title_id'] = $params['job_title_id']; | |
192 | + //$jobs['job_title_id'] = $params['job_title_id']; | |
214 | 193 | //$titles['position_id'] = $params['position_id']; |
215 | - unset($params['job_title_id']); | |
194 | + //unset($params['job_title_id']); | |
216 | 195 | |
217 | 196 | $ad_employer->update($params); |
218 | 197 | |
219 | - $job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])-> | |
220 | - where('ad_employer_id', $ad_employer->id)->first(); | |
221 | - $data = Ad_jobs::find($job_->id); | |
222 | - $ad_jobs = $data->update($jobs); | |
198 | + //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])-> | |
199 | + // where('ad_employer_id', $ad_employer->id)->first(); | |
200 | + //$data = Ad_jobs::find($job_->id); | |
201 | + //$ad_jobs = $data->update($jobs); | |
223 | 202 | |
224 | 203 | return redirect()->route('employer.vacancy_list'); |
225 | 204 | } |
app/Http/Controllers/MainController.php
... | ... | @@ -74,6 +74,8 @@ class MainController extends Controller |
74 | 74 | groupby('job_title_id')-> |
75 | 75 | get(); |
76 | 76 | } |
77 | + dd($BigFlot); | |
78 | + | |
77 | 79 | |
78 | 80 | $employers = employers_main::query()->with('employer')->orderBy('id')->limit(8)->get(); |
79 | 81 | $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get(); |
resources/views/employers/add_ad_jobs.blade.php
... | ... | @@ -0,0 +1,241 @@ |
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 |
resources/views/employers/add_vacancy.blade.php
... | ... | @@ -59,7 +59,9 @@ |
59 | 59 | <p class="cabinet__text">Все поля обязательны для заполнения *</p> |
60 | 60 | </div> |
61 | 61 | </div> |
62 | + | |
62 | 63 | <div class="cabinet__body-item"> |
64 | + <h4>Поля для вакансии</h4> | |
63 | 65 | <div class="cabinet__inputs"> |
64 | 66 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
65 | 67 | <label class="form-group__label">Название вакансии</label> |
... | ... | @@ -74,74 +76,6 @@ |
74 | 76 | </div> |
75 | 77 | |
76 | 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 | 79 | <label class="form-group__label">Телефон</label> |
146 | 80 | <div class="form-group__item"> |
147 | 81 | <input type="text" class="input" name="telephone" id="telephone" value="{{ old('telephone') ?? $Employer[0]->telephone ?? '' }}" placeholder="Свой телефон"> |
... | ... | @@ -166,7 +100,7 @@ |
166 | 100 | </div> |
167 | 101 | |
168 | 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 | 104 | <div class="form-group__item"> |
171 | 105 | <input type="text" class="input" name="salary" id="salary" value="{{ old('salary') ?? '' }}" placeholder="Среднестатистическая зарплата"> |
172 | 106 | @error('salary') |
... | ... | @@ -178,31 +112,7 @@ |
178 | 112 | </div> |
179 | 113 | |
180 | 114 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
181 | - <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> | |
115 | + <label class="form-group__label">Город посадки</label> | |
206 | 116 | <div class="form-group__item"> |
207 | 117 | <input type="text" class="input" name="city" id="city" value="{{ old('city') ?? $Employer[0]->city ?? '' }}" placeholder="Севастополь"> |
208 | 118 | @error('city') |
... | ... | @@ -214,55 +124,23 @@ |
214 | 124 | </div> |
215 | 125 | |
216 | 126 | <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> |
217 | - <label class="form-group__label">Мощность</label> | |
218 | - <div class="form-group__item"> | |
219 | - <input type="text" class="input" name="power" id="power" value="{{ old('power') ?? '' }}" placeholder="POWER-45"> | |
220 | - @error('power') | |
221 | - <span class="text-xs text-red-600"> | |
222 | - {{ $message }} | |
223 | - </span> | |
224 | - @enderror | |
225 | - </div> | |
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> | |
127 | + <label class="form-group__label">Категория (локация)</label> | |
254 | 128 | <div class="form-group__item"> |
255 | 129 | <div class="select"> |
256 | - <select class="js-select2" name="flot" id="flot"> | |
257 | - <option value="" selected> Не указан корабль</option> | |
258 | - @if ($Employer[0]->flots->count()) | |
259 | - @foreach($Employer[0]->flots as $j) | |
260 | - <option value="{{ $j->name }}">{{ $j->name }} ({{ $j->id }})</option> | |
130 | + <select class="js-select2" name="category_id" id="category_id"> | |
131 | + @php $i = 1 @endphp | |
132 | + @if ($categories->count()) | |
133 | + @foreach($categories as $j) | |
134 | + @if ($i == 1) <option selected> Выберите категорию из списка</option> | |
135 | + @else | |
136 | + <option value="{{ $j->id }}">{{ $j->name }}</option> | |
137 | + @endif | |
138 | + @php $i++ @endphp | |
261 | 139 | @endforeach |
262 | 140 | @endif |
263 | 141 | </select> |
264 | - @error('flot') | |
265 | - <span class="text-xs text-red-600"> | |
142 | + @error('category_id') | |
143 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
266 | 144 | {{ $message }} |
267 | 145 | </span> |
268 | 146 | @enderror |
... | ... | @@ -281,18 +159,6 @@ |
281 | 159 | @enderror |
282 | 160 | </div> |
283 | 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 | 162 | </div> |
297 | 163 | <button type="submit" class="button cabinet__submit">Опубликовать</button> |
298 | 164 | </div> |
resources/views/employers/edit_ad_jobs.blade.php
... | ... | @@ -0,0 +1,216 @@ |
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 |
resources/views/employers/edit_vacancy.blade.php
... | ... | @@ -49,7 +49,7 @@ |
49 | 49 | |
50 | 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 | 53 | @csrf |
54 | 54 | <input type="hidden" name="employer_id" value="{{ $Employer->id }}"/> |
55 | 55 | <div class="cabinet__body-item"> |
... | ... | @@ -60,237 +60,107 @@ |
60 | 60 | </div> |
61 | 61 | </div> |
62 | 62 | <div class="cabinet__body-item"> |
63 | - <div class="cabinet__inputs"> | |
64 | - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
65 | - <label class="form-group__label">Название вакансии</label> | |
66 | - <div class="form-group__item"> | |
67 | - <input type="text" class="input" name="name" id="name" placeholder="Работа в море" value="{{ old('name') ?? $ad_employer->name ?? '' }}" required> | |
68 | - @error('name') | |
69 | - <span class="text-xs text-red-600"> | |
63 | + <h4>Поля для вакансии</h4> | |
64 | + <div class="cabinet__inputs"> | |
65 | + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
66 | + <label class="form-group__label">Название вакансии</label> | |
67 | + <div class="form-group__item"> | |
68 | + <input type="text" class="input" name="name" id="name" placeholder="Работа в море" value="{{ old('name') ?? $ad_employer->name ?? '' }}" required> | |
69 | + @error('name') | |
70 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
70 | 71 | {{ $message }} |
71 | 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 | 73 | @enderror |
90 | 74 | </div> |
91 | 75 | </div> |
92 | - </div> | |
93 | 76 | |
94 | - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
95 | - <label class="form-group__label">Должность соискателя</label> | |
96 | - <div class="form-group__item"> | |
97 | - <div class="select"> | |
98 | - <select class="js-select2" name="job_title_id" id="job_title_id"> | |
99 | - <option value="0"> Выберите должность из списка</option> | |
100 | - | |
101 | - @if ($jobs->count()) | |
102 | - @foreach($jobs as $j) | |
103 | - <option value="{{ $j->id }}" @if ($j->id == $ad_employer->id) selected @endif>{{ $j->name }}</option> | |
104 | - @endforeach | |
105 | - @endif | |
106 | - </select> | |
107 | - @error('job_title_id') | |
108 | - <span class="text-xs text-red-600"> | |
109 | - {{ $message }} | |
110 | - </span> | |
111 | - @enderror | |
112 | - </div> | |
113 | - </div> | |
114 | - </div> | |
115 | - | |
116 | - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
117 | - <label class="form-group__label">Категория (локация)</label> | |
118 | - <div class="form-group__item"> | |
119 | - <div class="select"> | |
120 | - <select class="js-select2" name="category_id" id="category_id"> | |
121 | - @php $i = 1 @endphp | |
122 | - @if ($categories->count()) | |
123 | - @foreach($categories as $j) | |
124 | - @if ($i == 1) <option selected> Выберите категорию из списка</option> | |
125 | - @else | |
126 | - <option value="{{ $j->id }}">{{ $j->name }}</option> | |
127 | - @endif | |
128 | - @php $i++ @endphp | |
129 | - @endforeach | |
130 | - @endif | |
131 | - </select> | |
132 | - @error('category_id') | |
77 | + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
78 | + <label class="form-group__label">Телефон</label> | |
79 | + <div class="form-group__item"> | |
80 | + <input type="text" class="input" name="telephone" id="telephone" value="{{ old('telephone') ?? $ad_employer->telephone ?? '' }}" placeholder="Свой телефон"> | |
81 | + @error('telephone') | |
133 | 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 | 83 | {{ $message }} |
160 | 84 | </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="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 | |
85 | + @enderror | |
86 | + </div> | |
210 | 87 | </div> |
211 | - </div> | |
212 | 88 | |
213 | - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
214 | - <label class="form-group__label">Мощность</label> | |
215 | - <div class="form-group__item"> | |
216 | - <input type="text" class="input" name="power" id="power" value=" old('power') ?? '' }}" placeholder="POWER-45"> | |
217 | - @error('power') | |
218 | - <span class="text-xs text-red-600"> | |
89 | + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
90 | + <label class="form-group__label">Емайл</label> | |
91 | + <div class="form-group__item"> | |
92 | + <input type="text" class="input" name="email" id="email" value="{{ old('email') ?? $ad_employer->email ?? '' }}" placeholder="Своя почту"> | |
93 | + @error('email') | |
94 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
219 | 95 | {{ $message }} |
220 | 96 | </span> |
221 | - @enderror | |
97 | + @enderror | |
98 | + </div> | |
222 | 99 | </div> |
223 | - </div> | |
224 | 100 | |
225 | - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
226 | - <label class="form-group__label">Суточные выплаты</label> | |
227 | - <div class="form-group__item"> | |
228 | - <input type="text" class="input" name="sytki" id="sytki" value=" old('sytki') ?? '' }}" placeholder="2000"> | |
229 | - @error('power') | |
230 | - <span class="text-xs text-red-600"> | |
101 | + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
102 | + <label class="form-group__label">Зарплата среднестатистическая для вакансии</label> | |
103 | + <div class="form-group__item"> | |
104 | + <input type="text" class="input" name="salary" id="salary" value="{{ old('salary') ?? $ad_employer->salary ??'' }}" placeholder="Среднестатистическая зарплата"> | |
105 | + @error('salary') | |
106 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
231 | 107 | {{ $message }} |
232 | 108 | </span> |
233 | - @enderror | |
109 | + @enderror | |
110 | + </div> | |
234 | 111 | </div> |
235 | - </div> | |
236 | 112 | |
237 | - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
238 | - <label class="form-group__label">Начало отплытия</label> | |
239 | - <div class="form-group__item"> | |
240 | - <input type="text" class="input" name="start" id="start" value=" old('start') ?? $Employer->ads->start ?? '' }}" placeholder="20 сентября 2024"> | |
241 | - @error('power') | |
242 | - <span class="text-xs text-red-600"> | |
113 | + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
114 | + <label class="form-group__label">Город посадки</label> | |
115 | + <div class="form-group__item"> | |
116 | + <input type="text" class="input" name="city" id="city" value="{{ old('city') ?? $ad_employer->city ?? '' }}" placeholder="Севастополь"> | |
117 | + @error('city') | |
118 | + <span class="text-xs text-red-600"> | |
243 | 119 | {{ $message }} |
244 | 120 | </span> |
245 | - @enderror | |
121 | + @enderror | |
122 | + </div> | |
246 | 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()) | |
256 | - @foreach($Employer->flots as $j) | |
257 | - <option value="{{ $j->name }}">{{ $j->name }} ({{ $j->id }})</option> | |
258 | - @endforeach | |
259 | - @endif | |
260 | - </select> | |
261 | - @error('flot') | |
262 | - <span class="text-xs text-red-600"> | |
125 | + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
126 | + <label class="form-group__label">Категория (локация)</label> | |
127 | + <div class="form-group__item"> | |
128 | + <div class="select"> | |
129 | + <select class="js-select2" name="category_id" id="category_id"> | |
130 | + @php $i = 1 @endphp | |
131 | + @if ($categories->count()) | |
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 | 143 | {{ $message }} |
264 | 144 | </span> |
265 | - @enderror | |
145 | + @enderror | |
146 | + </div> | |
266 | 147 | </div> |
267 | 148 | </div> |
268 | - </div> | |
269 | 149 | |
270 | - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
271 | - <label class="form-group__label">Описание вакансии</label> | |
272 | - <div class="form-group__item"> | |
273 | - <textarea class="textarea" name="text" id="text">{{ old('text') ?? $Employer[0]->text ?? '' }}</textarea> | |
274 | - @error('text') | |
275 | - <span class="text-xs text-red-600"> | |
150 | + | |
151 | + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> | |
152 | + <label class="form-group__label">Описание вакансии</label> | |
153 | + <div class="form-group__item"> | |
154 | + <textarea class="textarea" name="text" id="text">{{ old('text') ?? $ad_employer->text ?? '' }}</textarea> | |
155 | + @error('text') | |
156 | + <span class="text-xs text-red-600"> | |
276 | 157 | {{ $message }} |
277 | 158 | </span> |
278 | - @enderror | |
159 | + @enderror | |
160 | + </div> | |
279 | 161 | </div> |
280 | 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') | |
287 | - <span class="text-xs text-red-600"> | |
288 | - {{ $message }} | |
289 | - </span> | |
290 | - @enderror | |
291 | - </div> | |
292 | - </div>--> | |
293 | - </div> | |
294 | 164 | <a class="button cabinet__submit" href="{{ route('employer.vacancy_list') }}">Назад</a> |
295 | 165 | <button type="submit" class="button cabinet__submit">Опубликовать</button> |
296 | 166 | </div> |
resources/views/employers/list_vacancy.blade.php
... | ... | @@ -79,17 +79,15 @@ |
79 | 79 | |
80 | 80 | <div class="table table_spoiler" id="main_ockar" name="main_oskar"> |
81 | 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 | 82 | <div class="table__scroll"> |
87 | 83 | <div class="table__body table__body_min-width"> |
88 | 84 | <table> |
89 | 85 | <thead> |
90 | 86 | <tr> |
87 | + <th>№</th> | |
91 | 88 | <th>Название</th> |
92 | 89 | <th>Дата добавления<br>/ обновления</th> |
90 | + <th>Должности</th> | |
93 | 91 | <th>Статус</th> |
94 | 92 | <th>Действия</th> |
95 | 93 | </tr> |
... | ... | @@ -97,8 +95,23 @@ |
97 | 95 | <tbody> |
98 | 96 | @foreach($vacancy_list as $it) |
99 | 97 | <tr> |
98 | + <td>{{ $it->id }}</td> | |
100 | 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 | 115 | <td> |
103 | 116 | @if ($it->active_is) |
104 | 117 | <span class="table__status green"><i></i>Опубликовано</span> |
routes/web.php
1 | 1 | <?php |
2 | 2 | |
3 | +use App\Http\Controllers\Ad_jobsController; | |
3 | 4 | use App\Http\Controllers\AdEmployerController; |
4 | 5 | use App\Http\Controllers\Admin\AdminController; |
5 | 6 | use App\Http\Controllers\Admin\CategoryController; |
... | ... | @@ -17,6 +18,7 @@ use App\Http\Controllers\Auth\RegisterController; |
17 | 18 | use App\Http\Controllers\CKEditorController; |
18 | 19 | use App\Http\Controllers\MediaController; |
19 | 20 | use App\Http\Controllers\WorkerController; |
21 | +use App\Models\Ad_jobs; | |
20 | 22 | use App\Models\User; |
21 | 23 | use App\Http\Controllers\MainController; |
22 | 24 | use App\Http\Controllers\HomeController; |
... | ... | @@ -535,8 +537,9 @@ Route::group([ |
535 | 537 | |
536 | 538 | // 2 страница - Добавление вакансий |
537 | 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 | 540 | Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); |
541 | + | |
542 | + | |
540 | 543 | Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); |
541 | 544 | |
542 | 545 | |
... | ... | @@ -547,7 +550,14 @@ Route::group([ |
547 | 550 | Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); |
548 | 551 | Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); |
549 | 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 | 562 | // 4 страница - Отклики на вакансии |
553 | 563 | Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); |