Commit 5c0ae05193a76285dcb193b906eb725441c64041

Authored by Fedor
1 parent 3256f8927e
Exists in master

task-132687 minor changes

Showing 12 changed files with 120 additions and 467 deletions Inline Diff

app/Classes/Tools.php
1 <?php 1 <?php
2 2
3 3
4 namespace App\Classes; 4 namespace App\Classes;
5 5
6 6
7 use App\Models\Worker; 7 use App\Models\Worker;
8 8
9 class Tools 9 class Tools
10 { 10 {
11 static function generator_id($length = 6) 11 static function generator_id($length = 6)
12 { 12 {
13 $word = ''; 13 $word = '';
14 $arr = array( 14 $arr = array(
15 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 15 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
16 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 16 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
17 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 17 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
18 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 18 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
19 '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' 19 '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'
20 ); 20 );
21 21
22 for ($i = 0; $i < $length; $i++) { 22 for ($i = 0; $i < $length; $i++) {
23 $word .= $arr[random_int(0, count($arr) - 1)]; 23 $word .= $arr[random_int(0, count($arr) - 1)];
24 } 24 }
25 return $word; 25 return $word;
26 } 26 }
27 27
28 public static function getWorkerProfilePercent(Worker $Worker): int 28 public static function getWorkerProfilePercent(Worker $Worker): int
29 { 29 {
30 $persent = 0; 30 $persent = 0;
31 $workerFields = [ 31 $workerFields = [
32 'telephone', 32 'telephone',
33 'email', 33 'email',
34 'old_year', 34 'old_year',
35 'salary_expectations', 35 'salary_expectations',
36 'experience', 36 'experience',
37 'english_level', 37 'english_level',
38 'ready_boart_date', 38 'ready_boart_date',
39 'boart_type_preference', 39 'boart_type_preference',
40 'visa_available', 40 'visa_available',
41 'confirmation_work_for_vvp', 41 'confirmation_work_for_vvp',
42 'military_id_available', 42 'military_id_available',
43 'city', 43 'city',
44 'telephone2', 44 'telephone2',
45 ]; 45 ];
46 46
47 $workerUserFields = [ 47 $workerUserFields = [
48 'surname', 48 'surname',
49 'name_man', 49 'name_man',
50 'surname2', 50 'surname2',
51 ]; 51 ];
52 52
53 foreach ($workerFields as $fieldName) { 53 foreach ($workerFields as $fieldName) {
54 if (!empty($Worker->$fieldName)) { 54 if (!empty($Worker->$fieldName) && $Worker->$fieldName !== 'Не указано') {
55 $persent += 2.8; 55 $persent += 2.8;
56 } 56 }
57 } 57 }
58 58
59 foreach ($workerUserFields as $fieldName) { 59 foreach ($workerUserFields as $fieldName) {
60 if (!empty($Worker->user->$fieldName)) { 60 if (!empty($Worker->users->$fieldName)) {
61 $persent += 2.8; 61 $persent += 2.8;
62 } 62 }
63 } 63 }
64 64
65 if ($Worker->job_titles->count() > 0) { 65 if ($Worker->job_titles->count() > 0) {
66 $persent += 2.8; 66 $persent += 2.8;
67 } 67 }
68 68
69 if ($Worker->sertificate->count() > 0) { 69 if ($Worker->sertificate->count() > 0) {
70 $persent += 10; 70 $persent += 10;
71 } 71 }
72 72
73 if ($Worker->infobloks->where(fn($ib) => $ib->pivot->status === 1)->count() > 0) { 73 if ($Worker->infobloks->where(fn($ib) => $ib->pivot->status === 1)->count() > 0) {
74 $persent += 10; 74 $persent += 10;
75 } 75 }
76 76
77 if ($Worker->place_worker->count() > 0) { 77 if ($Worker->place_worker->count() > 0) {
78 $persent += 25; 78 $persent += 25;
79 } 79 }
80 80
81 if ($Worker->prev_company->count() > 0) { 81 if ($Worker->prev_company->count() > 0) {
82 $persent += 5; 82 $persent += 5;
83 } 83 }
84 84
85 return $persent; 85 return $persent;
86 } 86 }
87 } 87 }
88 88
app/Http/Controllers/EmployerController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Classes\RusDate; 5 use App\Classes\RusDate;
6 use App\Classes\Tools; 6 use App\Classes\Tools;
7 use App\Http\Requests\BaseUser_min_Request; 7 use App\Http\Requests\BaseUser_min_Request;
8 use App\Http\Requests\FlotRequest; 8 use App\Http\Requests\FlotRequest;
9 use App\Http\Requests\MessagesRequiest; 9 use App\Http\Requests\MessagesRequiest;
10 use App\Http\Requests\VacancyRequestEdit; 10 use App\Http\Requests\VacancyRequestEdit;
11 use App\Mail\MailCreateEmployer; 11 use App\Mail\MailCreateEmployer;
12 use App\Mail\MailSotrudnichestvo; 12 use App\Mail\MailSotrudnichestvo;
13 use App\Mail\MassSendingMessages; 13 use App\Mail\MassSendingMessages;
14 use App\Mail\SendAllMessages; 14 use App\Mail\SendAllMessages;
15 use App\Models\Ad_employer; 15 use App\Models\Ad_employer;
16 use App\Models\ad_response; 16 use App\Models\ad_response;
17 use App\Models\Category; 17 use App\Models\Category;
18 use App\Models\Chat; 18 use App\Models\Chat;
19 use App\Models\Employer; 19 use App\Models\Employer;
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_worker; 22 use App\Models\Like_worker;
23 use App\Models\Message; 23 use App\Models\Message;
24 use App\Models\Worker; 24 use App\Models\Worker;
25 use App\Models\MessagesRequests; 25 use App\Models\MessagesRequests;
26 use Carbon\Carbon; 26 use Carbon\Carbon;
27 use Illuminate\Auth\Events\Registered; 27 use Illuminate\Auth\Events\Registered;
28 use Illuminate\Database\Eloquent\Builder; 28 use Illuminate\Database\Eloquent\Builder;
29 use Illuminate\Http\Request; 29 use Illuminate\Http\Request;
30 use Illuminate\Support\Facades\Auth; 30 use Illuminate\Support\Facades\Auth;
31 use Illuminate\Support\Facades\Hash; 31 use Illuminate\Support\Facades\Hash;
32 use Illuminate\Support\Facades\Log; 32 use Illuminate\Support\Facades\Log;
33 use Illuminate\Support\Facades\Mail; 33 use Illuminate\Support\Facades\Mail;
34 use Illuminate\Support\Facades\Storage; 34 use Illuminate\Support\Facades\Storage;
35 use App\Models\User as User_Model; 35 use App\Models\User as User_Model;
36 use Illuminate\Support\Facades\Validator; 36 use Illuminate\Support\Facades\Validator;
37 use App\Enums\DbExportColumns; 37 use App\Enums\DbExportColumns;
38 use Throwable; 38 use Throwable;
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 employer_info() { 69 public function employer_info() {
70 // код юзера 70 // код юзера
71 $user_info = Auth()->user(); 71 $user_info = Auth()->user();
72 // вьюшка для вывода данных 72 // вьюшка для вывода данных
73 return view('employers.info', compact('user_info')); 73 return view('employers.info', compact('user_info'));
74 } 74 }
75 75
76 public function employer_info_save(User_Model $user, BaseUser_min_Request $request) { 76 public function employer_info_save(User_Model $user, BaseUser_min_Request $request) {
77 // Все данные через реквест 77 // Все данные через реквест
78 $all = $request->all(); 78 $all = $request->all();
79 unset($all['_token']); 79 unset($all['_token']);
80 // обновление 80 // обновление
81 $user->update($all); 81 $user->update($all);
82 return redirect()->route('employer.employer_info'); 82 return redirect()->route('employer.employer_info');
83 } 83 }
84 84
85 public function cabinet() { 85 public function cabinet() {
86 $id = Auth()->user()->id; 86 $id = Auth()->user()->id;
87 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 87 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
88 WhereHas('users', 88 WhereHas('users',
89 function (Builder $query) use ($id) {$query->Where('id', $id); 89 function (Builder $query) use ($id) {$query->Where('id', $id);
90 })->get(); 90 })->get();
91 return view('employers.cabinet45', compact('Employer')); 91 return view('employers.cabinet45', compact('Employer'));
92 } 92 }
93 93
94 public function slider_flot() { 94 public function slider_flot() {
95 $id = Auth()->user()->id; 95 $id = Auth()->user()->id;
96 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 96 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
97 WhereHas('users', 97 WhereHas('users',
98 function (Builder $query) use ($id) {$query->Where('id', $id); 98 function (Builder $query) use ($id) {$query->Where('id', $id);
99 })->get(); 99 })->get();
100 return view('employers.fly-flot', compact('Employer')); 100 return view('employers.fly-flot', compact('Employer'));
101 } 101 }
102 102
103 public function cabinet_save(Employer $Employer, Request $request) { 103 public function cabinet_save(Employer $Employer, Request $request) {
104 $params = $request->all(); 104 $params = $request->all();
105 $params['user_id'] = Auth()->user()->id; 105 $params['user_id'] = Auth()->user()->id;
106 $id = $Employer->id; 106 $id = $Employer->id;
107 107
108 if ($request->has('logo')) { 108 if ($request->has('logo')) {
109 if (!empty($Employer->logo)) { 109 if (!empty($Employer->logo)) {
110 Storage::delete($Employer->logo); 110 Storage::delete($Employer->logo);
111 } 111 }
112 $params['logo'] = $request->file('logo')->store("employer/$id", 'public'); 112 $params['logo'] = $request->file('logo')->store("employer/$id", 'public');
113 } 113 }
114 114
115 $Employer->update($params); 115 $Employer->update($params);
116 116
117 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены'); 117 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены');
118 } 118 }
119 119
120 public function save_add_flot(FlotRequest $request) { 120 public function save_add_flot(FlotRequest $request) {
121 // отмена 121 // отмена
122 $params = $request->all(); 122 $params = $request->all();
123 123
124 if ($request->has('image')) { 124 if ($request->has('image')) {
125 $params['image'] = $request->file('image')->store("flot", 'public'); 125 $params['image'] = $request->file('image')->store("flot", 'public');
126 } 126 }
127 Flot::create($params); 127 Flot::create($params);
128 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get(); 128 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get();
129 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); 129 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен');
130 } 130 }
131 131
132 public function edit_flot(Flot $Flot, Employer $Employer) { 132 public function edit_flot(Flot $Flot, Employer $Employer) {
133 return view('employers.edit-flot', compact('Flot', 'Employer')); 133 return view('employers.edit-flot', compact('Flot', 'Employer'));
134 } 134 }
135 135
136 public function update_flot(FlotRequest $request, Flot $Flot) { 136 public function update_flot(FlotRequest $request, Flot $Flot) {
137 $params = $request->all(); 137 $params = $request->all();
138 138
139 if ($request->has('image')) { 139 if ($request->has('image')) {
140 if (!empty($flot->image)) { 140 if (!empty($flot->image)) {
141 Storage::delete($flot->image); 141 Storage::delete($flot->image);
142 } 142 }
143 $params['image'] = $request->file('image')->store("flot", 'public'); 143 $params['image'] = $request->file('image')->store("flot", 'public');
144 } else { 144 } else {
145 if (!empty($flot->image)) $params['image'] = $flot->image; 145 if (!empty($flot->image)) $params['image'] = $flot->image;
146 } 146 }
147 147
148 $Flot->update($params); 148 $Flot->update($params);
149 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); 149 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен');
150 } 150 }
151 151
152 public function delete_flot(Flot $Flot) { 152 public function delete_flot(Flot $Flot) {
153 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get(); 153 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get();
154 154
155 if (isset($Flot->id)) $Flot->delete(); 155 if (isset($Flot->id)) $Flot->delete();
156 return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален'); 156 return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален');
157 } 157 }
158 158
159 // Форма добавления вакансий 159 // Форма добавления вакансий
160 public function cabinet_vacancie() { 160 public function cabinet_vacancie() {
161 /** @var User_Model $user */ 161 /** @var User_Model $user */
162 $user = Auth()->user(); 162 $user = Auth()->user();
163 163
164 if ($user->is_public) { 164 if ($user->is_public) {
165 $categories = Category::query()->active()->get(); 165 $categories = Category::query()->active()->get();
166 166
167 $jobs = Job_title::query() 167 $jobs = Job_title::query()
168 ->orderByDesc('sort') 168 ->orderByDesc('sort')
169 ->OrderBy('name') 169 ->OrderBy('name')
170 ->where('is_remove', '=', '0') 170 ->where('is_remove', '=', '0')
171 ->where('is_bd', '=', '0') 171 ->where('is_bd', '=', '0')
172 ->get(); 172 ->get();
173 173
174 $Employer = Employer::query() 174 $Employer = Employer::query()
175 ->with(['users', 'ads', 'flots']) 175 ->with(['users', 'ads', 'flots'])
176 ->whereHas('users', fn (Builder $query) => $query->where('id', $user->id)) 176 ->whereHas('users', fn (Builder $query) => $query->where('id', $user->id))
177 ->get(); 177 ->get();
178 178
179 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories')); 179 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories'));
180 } 180 }
181 181
182 return redirect()->route('employer.cabinet_vacancie_danger'); 182 return redirect()->route('employer.cabinet_vacancie_danger');
183 } 183 }
184 184
185 // Форма предупреждения об оплате 185 // Форма предупреждения об оплате
186 public function cabinet_vacancie_danger() { 186 public function cabinet_vacancie_danger() {
187 return view('employers.add_vacancy_danger'); 187 return view('employers.add_vacancy_danger');
188 } 188 }
189 189
190 // Сохранение вакансии 190 // Сохранение вакансии
191 public function cabinet_vacancy_save1(VacancyRequestEdit $request) { 191 public function cabinet_vacancy_save1(VacancyRequestEdit $request) {
192 $params_emp = $request->all(); 192 $params_emp = $request->all();
193 193
194 $params_job["job_title_id"] = $params_emp['job_title_id']; 194 $params_job["job_title_id"] = $params_emp['job_title_id'];
195 195
196 $ad_jobs = Ad_employer::create($params_emp); 196 $ad_jobs = Ad_employer::create($params_emp);
197 $ad_jobs->jobs()->sync($request->get('job_title_id')); 197 $ad_jobs->jobs()->sync($request->get('job_title_id'));
198 198
199 return redirect()->route('employer.vacancy_list'); 199 return redirect()->route('employer.vacancy_list');
200 } 200 }
201 201
202 // Список вакансий 202 // Список вакансий
203 public function vacancy_list(Request $request) { 203 public function vacancy_list(Request $request) {
204 $id = Auth()->user()->id; 204 $id = Auth()->user()->id;
205 205
206 $Employer = Employer::query()->where('user_id', $id)->first(); 206 $Employer = Employer::query()->where('user_id', $id)->first();
207 $vacancy_list = Ad_employer::query() 207 $vacancy_list = Ad_employer::query()
208 ->with('jobs') 208 ->with('jobs')
209 ->with('jobs_code') 209 ->with('jobs_code')
210 ->where('employer_id', $Employer->id) 210 ->where('employer_id', $Employer->id)
211 ->where('is_remove', 0) 211 ->where('is_remove', 0)
212 ->orderbyDesc('updated_at') 212 ->orderbyDesc('updated_at')
213 ; 213 ;
214 214
215 if (($request->has('search')) && (!empty($request->get('search')))) { 215 if (($request->has('search')) && (!empty($request->get('search')))) {
216 $search = $request->get('search'); 216 $search = $request->get('search');
217 $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%"); 217 $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%");
218 } 218 }
219 219
220 if ($request->get('sort')) { 220 if ($request->get('sort')) {
221 $sort = $request->get('sort'); 221 $sort = $request->get('sort');
222 switch ($sort) { 222 switch ($sort) {
223 case 'nopublic': $vacancy_list->orderByDesc('updated_at') 223 case 'nopublic': $vacancy_list->orderByDesc('updated_at')
224 ->where('active_is', 0); 224 ->where('active_is', 0);
225 break; 225 break;
226 case 'public': $vacancy_list->orderByDesc('updated_at') 226 case 'public': $vacancy_list->orderByDesc('updated_at')
227 ->where('active_is',1); 227 ->where('active_is',1);
228 break; 228 break;
229 default: $vacancy_list->orderByDesc('updated_at'); 229 default: $vacancy_list->orderByDesc('updated_at');
230 break; 230 break;
231 } 231 }
232 } else { 232 } else {
233 $vacancy_list = $vacancy_list->orderByDesc('updated_at')->orderBy('id'); 233 $vacancy_list = $vacancy_list->orderByDesc('updated_at')->orderBy('id');
234 } 234 }
235 235
236 $vacancy_list = $vacancy_list->paginate(10); 236 $vacancy_list = $vacancy_list->paginate(10);
237 237
238 if ($request->ajax()) { 238 if ($request->ajax()) {
239 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); 239 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer'));
240 } else { 240 } else {
241 return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); 241 return view('employers.list_vacancy', compact('vacancy_list', 'Employer'));
242 } 242 }
243 } 243 }
244 244
245 // Карточка вакансии 245 // Карточка вакансии
246 public function vacancy_edit(Ad_employer $ad_employer) { 246 public function vacancy_edit(Ad_employer $ad_employer) {
247 $id = Auth()->user()->id; 247 $id = Auth()->user()->id;
248 $Positions = Category::query()->where('is_remove', '=', '0')->get(); 248 $Positions = Category::query()->where('is_remove', '=', '0')->get();
249 249
250 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 250 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
251 where('is_remove', '=', '0')-> 251 where('is_remove', '=', '0')->
252 where('is_bd', '=', '0')->get(); 252 where('is_bd', '=', '0')->get();
253 253
254 $Employer = Employer::query()->with('users')->with('ads')-> 254 $Employer = Employer::query()->with('users')->with('ads')->
255 with('flots')->where('user_id', $id)->first(); 255 with('flots')->where('user_id', $id)->first();
256 256
257 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); 257 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs'));
258 } 258 }
259 259
260 // Сохранение-редактирование записи 260 // Сохранение-редактирование записи
261 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { 261 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) {
262 $params = $request->all(); 262 $params = $request->all();
263 $params_job["job_title_id"] = $params['job_title_id']; 263 $params_job["job_title_id"] = $params['job_title_id'];
264 264
265 $ad_employer->update($params); 265 $ad_employer->update($params);
266 $ad_employer->jobs()->sync($request->get('job_title_id')); 266 $ad_employer->jobs()->sync($request->get('job_title_id'));
267 267
268 $id = Auth()->user()->id; 268 $id = Auth()->user()->id;
269 $Positions = Category::query()->where('is_remove', '=', '0')->get(); 269 $Positions = Category::query()->where('is_remove', '=', '0')->get();
270 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name') 270 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')
271 ->where('is_remove', '=', '0') 271 ->where('is_remove', '=', '0')
272 ->where('is_bd', '=', '0') 272 ->where('is_bd', '=', '0')
273 ->get(); 273 ->get();
274 274
275 $Employer = Employer::query() 275 $Employer = Employer::query()
276 ->with('users')->with('ads')->with('flots')->where('user_id', $id)->first(); 276 ->with('users')->with('ads')->with('flots')->where('user_id', $id)->first();
277 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); 277 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs'));
278 } 278 }
279 279
280 // Сохранение карточки вакансии 280 // Сохранение карточки вакансии
281 public function vacancy_save(Request $request, Ad_employer $ad_employer) { 281 public function vacancy_save(Request $request, Ad_employer $ad_employer) {
282 $all = $request->all(); 282 $all = $request->all();
283 $ad_employer->update($all); 283 $ad_employer->update($all);
284 return redirect()->route('employer.cabinet_vacancie'); 284 return redirect()->route('employer.cabinet_vacancie');
285 } 285 }
286 286
287 // Удаление карточки вакансии 287 // Удаление карточки вакансии
288 public function vacancy_delete(Ad_employer $ad_employer) { 288 public function vacancy_delete(Ad_employer $ad_employer) {
289 $ad_employer->delete(); 289 $ad_employer->delete();
290 290
291 return redirect()->route('employer.vacancy_list') 291 return redirect()->route('employer.vacancy_list')
292 ->with('success', 'Данные были успешно сохранены'); 292 ->with('success', 'Данные были успешно сохранены');
293 } 293 }
294 294
295 // Обновление даты 295 // Обновление даты
296 public function vacancy_up(Ad_employer $ad_employer) { 296 public function vacancy_up(Ad_employer $ad_employer) {
297 $up = date('m/d/Y h:i:s', time()); 297 $up = date('m/d/Y h:i:s', time());
298 $ad_employer->updated_at = $up; 298 $ad_employer->updated_at = $up;
299 $ad_employer->save(); 299 $ad_employer->save();
300 300
301 return redirect()->back(); 301 return redirect()->back();
302 } 302 }
303 303
304 //Видимость вакансии 304 //Видимость вакансии
305 public function vacancy_eye(Ad_employer $ad_employer, $status) { 305 public function vacancy_eye(Ad_employer $ad_employer, $status) {
306 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 306 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
307 $vac_emp->active_is = $status; 307 $vac_emp->active_is = $status;
308 $vac_emp->save(); 308 $vac_emp->save();
309 309
310 return redirect()->route('employer.vacancy_list'); 310 return redirect()->route('employer.vacancy_list');
311 } 311 }
312 312
313 //Вакансия редактирования (шаблон) 313 //Вакансия редактирования (шаблон)
314 public function vacancy_update(Ad_employer $id) { 314 public function vacancy_update(Ad_employer $id) {
315 315
316 } 316 }
317 317
318 //Отклики на вакансию - лист 318 //Отклики на вакансию - лист
319 public function answers(Employer $employer, Request $request) { 319 public function answers(Employer $employer, Request $request) {
320 $user_id = Auth()->user()->id; 320 $user_id = Auth()->user()->id;
321 $answer = Ad_employer::query()->where('employer_id', $employer->id); 321 $answer = Ad_employer::query()->where('employer_id', $employer->id);
322 if ($request->has('search')) { 322 if ($request->has('search')) {
323 $search = trim($request->get('search')); 323 $search = trim($request->get('search'));
324 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); 324 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%");
325 } 325 }
326 326
327 $answer = $answer->with('response')->OrderByDESC('id')->get(); 327 $answer = $answer->with('response')->OrderByDESC('id')->get();
328 328
329 return view('employers.list_answer', compact('answer', 'user_id', 'employer')); 329 return view('employers.list_answer', compact('answer', 'user_id', 'employer'));
330 } 330 }
331 331
332 //Обновление статуса 332 //Обновление статуса
333 public function supple_status(employer $employer, ad_response $ad_response, $flag) { 333 public function supple_status(employer $employer, ad_response $ad_response, $flag) {
334 $ad_response->update(Array('flag' => $flag)); 334 $ad_response->update(Array('flag' => $flag));
335 return redirect()->route('employer.answers', ['employer' => $employer->id]); 335 return redirect()->route('employer.answers', ['employer' => $employer->id]);
336 } 336 }
337 337
338 //Страницы сообщений список 338 //Страницы сообщений список
339 public function messages($type_message) { 339 public function messages($type_message) {
340 $user_id = Auth()->user()->id; 340 $user_id = Auth()->user()->id;
341 341
342 $chats = Chat::get_user_chats($user_id); 342 $chats = Chat::get_user_chats($user_id);
343 $user_type = 'employer'; 343 $user_type = 'employer';
344 $admin_chat = false; 344 $admin_chat = false;
345 345
346 return view('employers.messages', compact('chats', 'admin_chat', 'user_id', 'user_type')); 346 return view('employers.messages', compact('chats', 'admin_chat', 'user_id', 'user_type'));
347 } 347 }
348 348
349 // Диалог между пользователями 349 // Диалог между пользователями
350 public function dialog(Chat $chat, Request $request) { 350 public function dialog(Chat $chat, Request $request) {
351 // Получение параметров. 351 // Получение параметров.
352 if ($request->has('ad_employer')){ 352 if ($request->has('ad_employer')){
353 $ad_employer = $request->get('ad_employer'); 353 $ad_employer = $request->get('ad_employer');
354 } else { 354 } else {
355 $ad_employer = 0; 355 $ad_employer = 0;
356 } 356 }
357 357
358 $sender = User_Model::query()->with('workers')->with('employers')->where('id', $chat->user_id)->first(); 358 $sender = User_Model::query()->with('workers')->with('employers')->where('id', $chat->user_id)->first();
359 $companion = User_Model::query()->with('workers')->with('employers')->where('id', $chat->to_user_id)->first(); 359 $companion = User_Model::query()->with('workers')->with('employers')->where('id', $chat->to_user_id)->first();
360 360
361 $Messages = Chat::get_chat_messages($chat); 361 $Messages = Chat::get_chat_messages($chat);
362 362
363 Message::where('user_id', '=', $chat->to_user_id)->where('to_user_id', '=', $chat->user_id)->update(['flag_new' => 0]); 363 Message::where('user_id', '=', $chat->to_user_id)->where('to_user_id', '=', $chat->user_id)->update(['flag_new' => 0]);
364 364
365 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages')); 365 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages'));
366 } 366 }
367 367
368 public function pin_chat(Request $request){ 368 public function pin_chat(Request $request){
369 $chat_id = $request->get('id'); 369 $chat_id = $request->get('id');
370 $is_fixed = $request->get('is_fixed'); 370 $is_fixed = $request->get('is_fixed');
371 371
372 Chat::pin_chat($chat_id, $is_fixed); 372 Chat::pin_chat($chat_id, $is_fixed);
373 } 373 }
374 374
375 public function remove_chat(Request $request){ 375 public function remove_chat(Request $request){
376 $chat_id = $request->get('id'); 376 $chat_id = $request->get('id');
377 Chat::remove_chat($chat_id); 377 Chat::remove_chat($chat_id);
378 } 378 }
379 379
380 // Регистрация работодателя 380 // Регистрация работодателя
381 public function register_employer(Request $request) { 381 public function register_employer(Request $request) {
382 $params = $request->all(); 382 $params = $request->all();
383 383
384 $rules = [ 384 $rules = [
385 //'surname' => ['required', 'string', 'max:255'], 385 //'surname' => ['required', 'string', 'max:255'],
386 //'name_man' => ['required', 'string', 'max:255'], 386 //'name_man' => ['required', 'string', 'max:255'],
387 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 387 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
388 'name_company' => ['required', 'string', 'max:255'], 388 'name_company' => ['required', 'string', 'max:255'],
389 'password' => ['required', 'string', 'min:6'], 389 'password' => ['required', 'string', 'min:6'],
390 ]; 390 ];
391 391
392 $messages = [ 392 $messages = [
393 'required' => 'Укажите обязательное поле', 393 'required' => 'Укажите обязательное поле',
394 'min' => [ 394 'min' => [
395 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 395 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
396 'integer' => 'Поле «:attribute» должно быть :min или больше', 396 'integer' => 'Поле «:attribute» должно быть :min или больше',
397 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 397 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
398 ], 398 ],
399 'max' => [ 399 'max' => [
400 'string' => 'Поле «:attribute» должно быть не больше :max символов', 400 'string' => 'Поле «:attribute» должно быть не больше :max символов',
401 'integer' => 'Поле «:attribute» должно быть :max или меньше', 401 'integer' => 'Поле «:attribute» должно быть :max или меньше',
402 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 402 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
403 ] 403 ]
404 ]; 404 ];
405 405
406 $email = $request->get('email'); 406 $email = $request->get('email');
407 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { 407 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) {
408 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); 408 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл"));
409 } 409 }
410 410
411 if ($request->get('password') !== $request->get('confirmed')){ 411 if ($request->get('password') !== $request->get('confirmed')){
412 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 412 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
413 } 413 }
414 414
415 if (strlen($request->get('password')) < 6) { 415 if (strlen($request->get('password')) < 6) {
416 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); 416 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
417 } 417 }
418 418
419 if (empty($request->get('surname'))) { 419 if (empty($request->get('surname'))) {
420 $params['surname'] = 'Неизвестно'; 420 $params['surname'] = 'Неизвестно';
421 } 421 }
422 if (empty($request->get('name_man'))) { 422 if (empty($request->get('name_man'))) {
423 $params['name_man'] = 'Неизвестно'; 423 $params['name_man'] = 'Неизвестно';
424 } 424 }
425 $validator = Validator::make($params, $rules, $messages); 425 $validator = Validator::make($params, $rules, $messages);
426 426
427 if ($validator->fails()) { 427 if ($validator->fails()) {
428 return json_encode(Array("ERROR" => "Error: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 428 return json_encode(Array("ERROR" => "Error: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
429 } else { 429 } else {
430 $user = $this->create($params); 430 $user = $this->create($params);
431 event(new Registered($user)); 431 event(new Registered($user));
432 432
433 try { 433 try {
434 Mail::to(env('EMAIL_ADMIN'))->send(new MailCreateEmployer($params)); 434 Mail::to(env('EMAIL_ADMIN'))->send(new MailCreateEmployer($params));
435 } catch (Throwable $e) { 435 } catch (Throwable $e) {
436 Log::error($e); 436 Log::error($e);
437 } 437 }
438 438
439 Auth::guard()->login($user); 439 Auth::guard()->login($user);
440 } 440 }
441 441
442 if ($user) { 442 if ($user) {
443 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; 443 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));;
444 } else { 444 } else {
445 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 445 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
446 } 446 }
447 } 447 }
448 448
449 // Создание пользователя 449 // Создание пользователя
450 protected function create(array $data) 450 protected function create(array $data)
451 { 451 {
452 $Use = new User_Model(); 452 $Use = new User_Model();
453 $Code_user = $Use->create([ 453 $Code_user = $Use->create([
454 'name' => $data['surname']." ".$data['name_man'], 454 'name' => $data['surname']." ".$data['name_man'],
455 'name_man' => $data['name_man'], 455 'name_man' => $data['name_man'],
456 'surname' => $data['surname'], 456 'surname' => $data['surname'],
457 'surname2' => $data['surname2'], 457 'surname2' => $data['surname2'],
458 'subscribe_email' => $data['email'], 458 'subscribe_email' => $data['email'],
459 'email' => $data['email'], 459 'email' => $data['email'],
460 'telephone' => $data['telephone'], 460 'telephone' => $data['telephone'],
461 'is_worker' => 0, 461 'is_worker' => 0,
462 'password' => Hash::make($data['password']), 462 'password' => Hash::make($data['password']),
463 'pubpassword' => base64_encode($data['password']), 463 'pubpassword' => base64_encode($data['password']),
464 'email_verified_at' => Carbon::now() 464 'email_verified_at' => Carbon::now()
465 ]); 465 ]);
466 466
467 if ($Code_user->id > 0) { 467 if ($Code_user->id > 0) {
468 $Employer = new Employer(); 468 $Employer = new Employer();
469 $Employer->user_id = $Code_user->id; 469 $Employer->user_id = $Code_user->id;
470 $Employer->name_company = $data['name_company']; 470 $Employer->name_company = $data['name_company'];
471 $Employer->email = $data['email']; 471 $Employer->email = $data['email'];
472 $Employer->telephone = $data['telephone']; 472 $Employer->telephone = $data['telephone'];
473 $Employer->code = Tools::generator_id(10); 473 $Employer->code = Tools::generator_id(10);
474 $Employer->save(); 474 $Employer->save();
475 475
476 return $Code_user; 476 return $Code_user;
477 } 477 }
478 } 478 }
479 479
480 // Отправка сообщения от работодателя 480 // Отправка сообщения от работодателя
481 public function send_message(MessagesRequiest $request) { 481 public function send_message(MessagesRequiest $request) {
482 $params = $request->all(); 482 $params = $request->all();
483 dd($params); 483 dd($params);
484 $user1 = $params['user_id']; 484 $user1 = $params['user_id'];
485 $user2 = $params['to_user_id']; 485 $user2 = $params['to_user_id'];
486 486
487 if ($request->has('file')) { 487 if ($request->has('file')) {
488 $params['file'] = $request->file('file')->store("messages", 'public'); 488 $params['file'] = $request->file('file')->store("messages", 'public');
489 } 489 }
490 Message::create($params); 490 Message::create($params);
491 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 491 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
492 } 492 }
493 493
494 public function test123(Request $request) { 494 public function test123(Request $request) {
495 $params = $request->all(); 495 $params = $request->all();
496 $user1 = $params['user_id']; 496 $user1 = $params['user_id'];
497 $user2 = $params['to_user_id']; 497 $user2 = $params['to_user_id'];
498 498
499 $rules = [ 499 $rules = [
500 'text' => 'nullable|required_without:file|min:1|max:150000', 500 'text' => 'nullable|required_without:file|min:1|max:150000',
501 'file' => 'nullable|file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' 501 'file' => 'nullable|file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000'
502 ]; 502 ];
503 $messages = [ 503 $messages = [
504 'required_without' => 'Поле «:attribute» обязательно, если файл не прикреплен', 504 'required_without' => 'Поле «:attribute» обязательно, если файл не прикреплен',
505 'min' => [ 505 'min' => [
506 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 506 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
507 'integer' => 'Поле «:attribute» должно быть :min или больше', 507 'integer' => 'Поле «:attribute» должно быть :min или больше',
508 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 508 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
509 ], 509 ],
510 'max' => [ 510 'max' => [
511 'string' => 'Поле «:attribute» должно быть не больше :max символов', 511 'string' => 'Поле «:attribute» должно быть не больше :max символов',
512 'integer' => 'Поле «:attribute» должно быть :max или меньше', 512 'integer' => 'Поле «:attribute» должно быть :max или меньше',
513 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 513 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
514 ] 514 ]
515 ]; 515 ];
516 516
517 $validator = Validator::make($request->all(), $rules, $messages); 517 $validator = Validator::make($request->all(), $rules, $messages);
518 518
519 if ($validator->fails()) { 519 if ($validator->fails()) {
520 return redirect()->route('cabinet.messages', ['type_message' => 'input'])->withErrors($validator); 520 return redirect()->route('cabinet.messages', ['type_message' => 'input'])->withErrors($validator);
521 } 521 }
522 522
523 $new_message = Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages'); 523 $new_message = Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages');
524 return redirect()->route('employer.dialog', ['chat' => $new_message->chat_id_from]); 524 return redirect()->route('employer.dialog', ['chat' => $new_message->chat_id_from]);
525 525
526 } 526 }
527 527
528 //Избранные люди 528 //Избранные люди
529 public function favorites(Request $request) 529 public function favorites(Request $request)
530 { 530 {
531 $likedWorkersIds = Like_worker::query() 531 $likedWorkersIds = Like_worker::query()
532 ->where('user_id', Auth::user()->id) 532 ->where('user_id', Auth::user()->id)
533 ->get() 533 ->get()
534 ->pluck('code_record') 534 ->pluck('code_record')
535 ->toArray(); 535 ->toArray();
536 536
537 $workerBuilder = Worker::query() 537 $workerBuilder = Worker::query()
538 ->whereIn('id', $likedWorkersIds); 538 ->whereIn('id', $likedWorkersIds);
539 539
540 if (($request->has('search')) && (!empty($request->get('search')))) { 540 if (($request->has('search')) && (!empty($request->get('search')))) {
541 $search = $request->get('search'); 541 $search = $request->get('search');
542 542
543 $workerBuilder->whereHas('users', function (Builder $query) use ($search) { 543 $workerBuilder->whereHas('users', function (Builder $query) use ($search) {
544 $query->where('surname', 'LIKE', "%$search%") 544 $query->where('surname', 'LIKE', "%$search%")
545 ->orWhere('name_man', 'LIKE', "%$search%") 545 ->orWhere('name_man', 'LIKE', "%$search%")
546 ->orWhere('surname2', 'LIKE', "%$search%"); 546 ->orWhere('surname2', 'LIKE', "%$search%");
547 }); 547 });
548 } 548 }
549 549
550 $Workers = $workerBuilder->get(); 550 $Workers = $workerBuilder->get();
551 551
552 return view('employers.favorite', compact('Workers')); 552 return view('employers.favorite', compact('Workers'));
553 } 553 }
554 554
555 // База данных 555 // База данных
556 public function bd(Request $request) { 556 public function bd(Request $request) {
557 $users = User_Model::query()->with('workers')->with('jobtitles'); 557 $users = User_Model::query()->with('workers')->with('jobtitles');
558 558
559 if ($request->has('search')) { 559 if ($request->has('search')) {
560 $find_key = $request->get('search'); 560 $find_key = $request->get('search');
561 $users = $users->where('name', 'LIKE', "%$find_key%") 561 $users = $users->where('name', 'LIKE', "%$find_key%")
562 ->orWhere('surname', 'LIKE', "%$find_key%") 562 ->orWhere('surname', 'LIKE', "%$find_key%")
563 ->orWhere('name_man', 'LIKE', "%$find_key%") 563 ->orWhere('name_man', 'LIKE', "%$find_key%")
564 ->orWhere('email', 'LIKE', "%$find_key%") 564 ->orWhere('email', 'LIKE', "%$find_key%")
565 ->orWhere('telephone', 'LIKE', "%$find_key%"); 565 ->orWhere('telephone', 'LIKE', "%$find_key%");
566 } 566 }
567 567
568 // Данные 568 // Данные
569 $users = $users->Baseuser()-> 569 $users = $users
570 orderByDesc(Worker::select('created_at')->whereColumn('workers.user_id', 'users.id')); 570 ->Baseuser()
571 ->orderByDesc(Worker::select('created_at')
572 ->whereColumn('workers.user_id', 'users.id'));
571 $count_users = $users->count(); 573 $count_users = $users->count();
572 $users = $users->paginate(10); 574 $users = $users->paginate(10);
573 575
574 $export_options = DbExportColumns::toArray(); 576 $export_options = DbExportColumns::toArray();
575 577
576 $jobs_titles = Job_title::select('id', 'name') 578 $jobs_titles = Job_title::select('id', 'name')
577 ->where('is_remove', '=', 0) 579 ->where('is_remove', '=', 0)
578 ->where('is_bd', '=', 2) 580 ->where('is_bd', '=', 2)
579 ->orderByDesc('sort') 581 ->orderByDesc('sort')
580 ->orderBy('name', 'asc') 582 ->orderBy('name', 'asc')
581 ->get() 583 ->get()
582 ->toArray() 584 ->toArray()
583 ; 585 ;
584 586
585 return view('employers.bd', compact('users', 'count_users', 'export_options', 'jobs_titles')); 587 return view('employers.bd', compact('users', 'count_users', 'export_options', 'jobs_titles'));
586 } 588 }
587 589
588 //Настройка уведомлений 590 //Настройка уведомлений
589 public function subscribe() { 591 public function subscribe() {
590 return view('employers.subcribe'); 592 return view('employers.subcribe');
591 } 593 }
592 594
593 //Установка уведомлений сохранение 595 //Установка уведомлений сохранение
594 public function save_subscribe(Request $request) { 596 public function save_subscribe(Request $request) {
595 dd($request->all()); 597 dd($request->all());
596 $msg = $request->validate([ 598 $msg = $request->validate([
597 'subscribe_email' => 'required|email|min:5|max:255', 599 'subscribe_email' => 'required|email|min:5|max:255',
598 ]); 600 ]);
599 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); 601 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку');
600 } 602 }
601 603
602 //Сбросить форму с паролем 604 //Сбросить форму с паролем
603 public function password_reset() { 605 public function password_reset() {
604 $email = Auth()->user()->email; 606 $email = Auth()->user()->email;
605 return view('employers.password-reset', compact('email')); 607 return view('employers.password-reset', compact('email'));
606 } 608 }
607 609
608 //Обновление пароля 610 //Обновление пароля
609 public function new_password(Request $request) { 611 public function new_password(Request $request) {
610 $use = Auth()->user(); 612 $use = Auth()->user();
611 $request->validate([ 613 $request->validate([
612 'password' => 'required|string', 614 'password' => 'required|string',
613 'new_password' => 'required|string', 615 'new_password' => 'required|string',
614 'new_password2' => 'required|string' 616 'new_password2' => 'required|string'
615 ]); 617 ]);
616 618
617 if ($request->get('new_password') == $request->get('new_password2')) 619 if ($request->get('new_password') == $request->get('new_password2'))
618 if ($request->get('password') !== $request->get('new_password')) { 620 if ($request->get('password') !== $request->get('new_password')) {
619 $credentials = $request->only('email', 'password'); 621 $credentials = $request->only('email', 'password');
620 if (Auth::attempt($credentials)) { 622 if (Auth::attempt($credentials)) {
621 623
622 if (!is_null($use->email_verified_at)){ 624 if (!is_null($use->email_verified_at)){
623 625
624 $user_data = User_Model::find($use->id); 626 $user_data = User_Model::find($use->id);
625 $user_data->update([ 627 $user_data->update([
626 'password' => Hash::make($request->get('new_password')), 628 'password' => Hash::make($request->get('new_password')),
627 'pubpassword' => base64_encode($request->get('new_password')), 629 'pubpassword' => base64_encode($request->get('new_password')),
628 ]); 630 ]);
629 return redirect() 631 return redirect()
630 ->route('employer.password_reset') 632 ->route('employer.password_reset')
631 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 633 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
632 } 634 }
633 635
634 return redirect() 636 return redirect()
635 ->route('employer.password_reset') 637 ->route('employer.password_reset')
636 ->withError('Данная учетная запись не было верифицированна!'); 638 ->withError('Данная учетная запись не было верифицированна!');
637 } 639 }
638 } 640 }
639 641
640 return redirect() 642 return redirect()
641 ->route('employer.password_reset') 643 ->route('employer.password_reset')
642 ->withErrors('Не совпадение данных, обновите пароли!'); 644 ->withErrors('Не совпадение данных, обновите пароли!');
643 } 645 }
644 646
645 647
646 648
647 // Форма Удаление пипла 649 // Форма Удаление пипла
648 public function delete_people() { 650 public function delete_people() {
649 $login = Auth()->user()->email; 651 $login = Auth()->user()->email;
650 return view('employers.delete_people', compact('login')); 652 return view('employers.delete_people', compact('login'));
651 } 653 }
652 654
653 // Удаление аккаунта 655 // Удаление аккаунта
654 public function action_delete_user(Request $request) { 656 public function action_delete_user(Request $request) {
655 $Answer = $request->all(); 657 $Answer = $request->all();
656 $user_id = Auth()->user()->id; 658 $user_id = Auth()->user()->id;
657 $request->validate([ 659 $request->validate([
658 'password' => 'required|string', 660 'password' => 'required|string',
659 ]); 661 ]);
660 662
661 $credentials = $request->only('email', 'password'); 663 $credentials = $request->only('email', 'password');
662 if (Auth::attempt($credentials)) { 664 if (Auth::attempt($credentials)) {
663 Auth::logout(); 665 Auth::logout();
664 $it = User_Model::find($user_id); 666 $it = User_Model::find($user_id);
665 $it->delete(); 667 $it->delete();
666 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 668 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
667 } else { 669 } else {
668 return redirect()->route('employer.delete_people') 670 return redirect()->route('employer.delete_people')
669 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 671 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
670 } 672 }
671 } 673 }
672 674
673 public function ajax_delete_user(Request $request) { 675 public function ajax_delete_user(Request $request) {
674 $Answer = $request->all(); 676 $Answer = $request->all();
675 $user_id = Auth()->user()->id; 677 $user_id = Auth()->user()->id;
676 $request->validate([ 678 $request->validate([
677 'password' => 'required|string', 679 'password' => 'required|string',
678 ]); 680 ]);
679 $credentials = $request->only('email', 'password'); 681 $credentials = $request->only('email', 'password');
680 if (Auth::attempt($credentials)) { 682 if (Auth::attempt($credentials)) {
681 683
682 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', 684 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт',
683 'email' => $request->get('email'), 685 'email' => $request->get('email'),
684 'password' => $request->get('password'))); 686 'password' => $request->get('password')));
685 } else { 687 } else {
686 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); 688 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль'));
687 } 689 }
688 } 690 }
689 691
690 // Рассылка сообщений 692 // Рассылка сообщений
691 public function send_all_messages() { 693 public function send_all_messages() {
692 $id = Auth()->user()->id; 694 $id = Auth()->user()->id;
693 $sending = Employer::query()->where('user_id', '=', "$id")->first(); 695 $sending = Employer::query()->where('user_id', '=', "$id")->first();
694 696
695 $job_titles = Job_title::query() 697 $job_titles = Job_title::query()
696 ->where('is_remove', '=', 0) 698 ->where('is_remove', '=', 0)
697 ->where('is_bd', '=', 1) 699 ->where('is_bd', '=', 1)
698 ->orderByDesc('sort') 700 ->orderByDesc('sort')
699 ->get(); 701 ->get();
700 702
701 if ($sending->sending_is) 703 if ($sending->sending_is)
702 return view('employers.send_all', compact('job_titles')); 704 return view('employers.send_all', compact('job_titles'));
703 else 705 else
704 return view('employers.send_all_danger'); 706 return view('employers.send_all_danger');
705 } 707 }
706 708
707 // Отправка сообщений для информации 709 // Отправка сообщений для информации
708 public function send_all_post(Request $request) { 710 public function send_all_post(Request $request) {
709 $data = $request->all(); 711 $data = $request->all();
710 $data['user'] = Auth()->user(); 712 $data['user'] = Auth()->user();
711 713
712 $id = MessagesRequests::create([ 714 $id = MessagesRequests::create([
713 'user_id' => $data['user']->id, 715 'user_id' => $data['user']->id,
714 'job_titles' => isset($data['job_title_ids']) ? json_encode($data['job_title_ids']) : null, 716 'job_titles' => isset($data['job_title_ids']) ? json_encode($data['job_title_ids']) : null,
715 'text' => $data['message_text'], 717 'text' => $data['message_text'],
716 ]); 718 ]);
717 719
718 try { 720 try {
719 if (!empty($id)) { 721 if (!empty($id)) {
720 Mail::to(env('EMAIL_ADMIN'))->send(new MassSendingMessages($data)); 722 Mail::to(env('EMAIL_ADMIN'))->send(new MassSendingMessages($data));
721 } 723 }
722 } catch (Throwable $e) { 724 } catch (Throwable $e) {
723 Log::error($e); 725 Log::error($e);
724 return redirect()->route('employer.send_all_messages')->with('error', 'Ошибка почтового сервера, пожалуйста, повторите рассылку позднее'); 726 return redirect()->route('employer.send_all_messages')->with('error', 'Ошибка почтового сервера, пожалуйста, повторите рассылку позднее');
725 } 727 }
726 728
727 return redirect()->route('employer.send_all_messages')->with('success', 'Запрос на рассылку был успешно отправлен.'); 729 return redirect()->route('employer.send_all_messages')->with('success', 'Запрос на рассылку был успешно отправлен.');
728 } 730 }
729 731
730 // База резюме 732 // База резюме
731 public function bd_tupe(Request $request) { 733 public function bd_tupe(Request $request) {
732 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); 734 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get();
733 735
734 return view('employers.bd_tupe', compact('Resume')); 736 return view('employers.bd_tupe', compact('Resume'));
735 } 737 }
736 738
737 ////////////////////////////////////////////////////////////////// 739 //////////////////////////////////////////////////////////////////
738 // Отправил сообщение 740 // Отправил сообщение
739 ////////////////////////////////////////////////////////////////// 741 //////////////////////////////////////////////////////////////////
740 public function new_message(Request $request) 742 public function new_message(Request $request)
741 { 743 {
742 $params = $request->all(); 744 $params = $request->all();
743 745
744 $id = $params['_user_id']; 746 $id = $params['_user_id'];
745 $message_params = [ 747 $message_params = [
746 'title' => $params['title'], 748 'title' => $params['title'],
747 'text' => $params['text'], 749 'text' => $params['text'],
748 'ad_employer_id' => $params['_vacancy'], 750 'ad_employer_id' => $params['_vacancy'],
749 'flag_new' => 1 751 'flag_new' => 1
750 ]; 752 ];
751 753
752 $message = Message::add_message( 754 $message = Message::add_message(
753 $request, 755 $request,
754 $params['_user_id'], 756 $params['_user_id'],
755 $params['_to_user_id'], 757 $params['_to_user_id'],
756 $message_params, 758 $message_params,
757 file_store_path: "worker/$id" 759 file_store_path: "worker/$id"
758 ); 760 );
759 761
760 return redirect()->route('employer.dialog', ['chat' => $message->chat_id_to]); 762 return redirect()->route('employer.dialog', ['chat' => $message->chat_id_to]);
761 } 763 }
762 764
763 // Восстановление пароля 765 // Восстановление пароля
764 public function repair_password(Request $request) { 766 public function repair_password(Request $request) {
765 $params = $request->get('email'); 767 $params = $request->get('email');
766 } 768 }
767 769
768 // Избранные люди на корабль 770 // Избранные люди на корабль
769 public function selected_people(Request $request) { 771 public function selected_people(Request $request) {
770 $id = $request->get('id'); 772 $id = $request->get('id');
771 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 773 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
772 where('is_remove', '=', '0')-> 774 where('is_remove', '=', '0')->
773 where('is_bd', '=', '0')-> 775 where('is_bd', '=', '0')->
774 where('position_id', $id)-> 776 where('position_id', $id)->
775 get(); 777 get();
776 return view('favorite_people', compact('favorite_people')); 778 return view('favorite_people', compact('favorite_people'));
777 } 779 }
778 } 780 }
779 781
app/Http/Controllers/WorkerController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Classes\RusDate; 5 use App\Classes\RusDate;
6 use App\Classes\Tools; 6 use App\Classes\Tools;
7 use App\Http\Requests\DocumentsRequest; 7 use App\Http\Requests\DocumentsRequest;
8 use App\Http\Requests\PrevCompanyRequest; 8 use App\Http\Requests\PrevCompanyRequest;
9 use App\Http\Requests\SertificationRequest; 9 use App\Http\Requests\SertificationRequest;
10 use App\Models\Ad_employer; 10 use App\Models\Ad_employer;
11 use App\Models\ad_response; 11 use App\Models\ad_response;
12 use App\Models\Chat; 12 use App\Models\Chat;
13 use App\Models\Dop_info; 13 use App\Models\Dop_info;
14 use App\Models\infobloks; 14 use App\Models\infobloks;
15 use App\Models\Job_title; 15 use App\Models\Job_title;
16 use App\Models\Like_vacancy; 16 use App\Models\Like_vacancy;
17 use App\Models\Message; 17 use App\Models\Message;
18 use App\Models\place_works; 18 use App\Models\place_works;
19 use App\Models\PrevCompany; 19 use App\Models\PrevCompany;
20 use App\Models\ResponseWork; 20 use App\Models\ResponseWork;
21 use App\Models\sertification; 21 use App\Models\sertification;
22 use App\Models\Static_worker; 22 use App\Models\Static_worker;
23 use App\Models\Title_worker; 23 use App\Models\Title_worker;
24 use App\Models\User; 24 use App\Models\User;
25 use App\Models\User as User_Model; 25 use App\Models\User as User_Model;
26 use App\Models\Worker; 26 use App\Models\Worker;
27 use Barryvdh\DomPDF\Facade\Pdf; 27 use Barryvdh\DomPDF\Facade\Pdf;
28 use Carbon\Carbon; 28 use Carbon\Carbon;
29 use Illuminate\Auth\Events\Registered; 29 use Illuminate\Auth\Events\Registered;
30 use Illuminate\Database\Eloquent\Builder; 30 use Illuminate\Database\Eloquent\Builder;
31 use Illuminate\Http\Request; 31 use Illuminate\Http\Request;
32 use Illuminate\Support\Facades\Auth; 32 use Illuminate\Support\Facades\Auth;
33 use Illuminate\Support\Facades\DB;
33 use Illuminate\Support\Facades\Hash; 34 use Illuminate\Support\Facades\Hash;
34 use Illuminate\Support\Facades\Storage; 35 use Illuminate\Support\Facades\Storage;
35 use Illuminate\Support\Facades\Validator; 36 use Illuminate\Support\Facades\Validator;
36 use PhpOffice\PhpSpreadsheet\Spreadsheet; 37 use PhpOffice\PhpSpreadsheet\Spreadsheet;
37 use PhpOffice\PhpSpreadsheet\Writer\Xlsx; 38 use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
38 use Symfony\Component\HttpFoundation\StreamedResponse; 39 use Symfony\Component\HttpFoundation\StreamedResponse;
39 use App\Enums\DbExportColumns; 40 use App\Enums\DbExportColumns;
40 use App\Enums\WorkerStatuses; 41 use App\Enums\WorkerStatuses;
41 use DateTime; 42 use DateTime;
42 43
43 class WorkerController extends Controller 44 class WorkerController extends Controller
44 { 45 {
45 //профиль 46 //профиль
46 public function profile(Worker $worker) 47 public function profile(Worker $worker)
47 { 48 {
48 $get_date = date('Y.m'); 49 $get_date = date('Y.m');
49 50
50 $c = Static_worker::query()->where('year_month', '=', $get_date) 51 $c = Static_worker::query()->where('year_month', '=', $get_date)
51 ->where('user_id', '=', $worker->users->id) 52 ->where('user_id', '=', $worker->users->id)
52 ->get(); 53 ->get();
53 54
54 if ($c->count() > 0) { 55 if ($c->count() > 0) {
55 $upd = Static_worker::find($c[0]->id); 56 $upd = Static_worker::find($c[0]->id);
56 $upd->lookin = $upd->lookin + 1; 57 $upd->lookin = $upd->lookin + 1;
57 $upd->save(); 58 $upd->save();
58 } else { 59 } else {
59 $crt = new Static_worker(); 60 $crt = new Static_worker();
60 $crt->lookin = 1; 61 $crt->lookin = 1;
61 $crt->year_month = $get_date; 62 $crt->year_month = $get_date;
62 $crt->user_id = $worker->user_id; 63 $crt->user_id = $worker->user_id;
63 $crt->save(); 64 $crt->save();
64 } 65 }
65 66
66 $stat = Static_worker::query()->where('year_month', '=', $get_date) 67 $stat = Static_worker::query()->where('year_month', '=', $get_date)
67 ->where('user_id', '=', $worker->users->id) 68 ->where('user_id', '=', $worker->users->id)
68 ->get(); 69 ->get();
69 70
70 return view('public.workers.profile', compact('worker', 'stat')); 71 return view('public.workers.profile', compact('worker', 'stat'));
71 } 72 }
72 73
73 // лист база резюме 74 // лист база резюме
74 public function bd_resume(Request $request) 75 public function bd_resume(Request $request)
75 { 76 {
76 if (isset(Auth()->user()->id)) { 77 if (isset(Auth()->user()->id)) {
77 if ((Auth()->user()->is_worker) || (!Auth()->user()->is_lookin)) 78 if ((Auth()->user()->is_worker) || (!Auth()->user()->is_lookin))
78 return redirect()->route('index')->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]); 79 return redirect()->route('index')->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]);
79 } 80 }
80 81
81 $status_work = WorkerStatuses::getWorkerStatuses(); 82 $status_work = WorkerStatuses::getWorkerStatuses();
82 83
83 $resumes = Worker::query()->with('users')->with('job_titles')->orderByDesc('updated_at'); 84 $resumes = Worker::query()->with('users')->with('job_titles')->orderByDesc('updated_at');
84 $resumes = $resumes->whereHas('users', function (Builder $query) { 85 $resumes = $resumes->whereHas('users', function (Builder $query) {
85 $query->Where('is_worker', '=', '1') 86 $query->Where('is_worker', '=', '1')
86 ->Where('is_bd', '=', '0'); 87 ->Where('is_bd', '=', '0');
87 }); 88 });
88 89
89 if (($request->has('job')) && ($request->get('job') > 0)) { 90 if (($request->has('job')) && ($request->get('job') > 0)) {
90 $resumes = $resumes->whereHas('job_titles', function (Builder $query) use ($request) { 91 $resumes = $resumes->whereHas('job_titles', function (Builder $query) use ($request) {
91 $query->Where('job_titles.id', $request->get('job')); 92 $query->Where('job_titles.id', $request->get('job'));
92 }); 93 });
93 } 94 }
94 95
95 $Job_title = Job_title::query() 96 $Job_title = Job_title::query()
96 ->where('is_remove', '=', '0') 97 ->where('is_remove', '=', '0')
97 ->where('is_bd', '=' , '1') 98 ->where('is_bd', '=' , '1')
98 ->orderByDesc('sort') 99 ->orderByDesc('sort')
99 ->get(); 100 ->get();
100 101
101 if ($request->get('sort')) { 102 if ($request->get('sort')) {
102 $sort = $request->get('sort'); 103 $sort = $request->get('sort');
103 switch ($sort) { 104 switch ($sort) {
104 case 'looking_for_work': 105 case 'looking_for_work':
105 $resumes->where('status_work', '=', WorkerStatuses::LookingForWork->value); 106 $resumes->where('status_work', '=', WorkerStatuses::LookingForWork->value);
106 break; 107 break;
107 case 'considering_offers': 108 case 'considering_offers':
108 $resumes->where('status_work', '=', WorkerStatuses::ConsideringOffers->value); 109 $resumes->where('status_work', '=', WorkerStatuses::ConsideringOffers->value);
109 break; 110 break;
110 case 'not_looking_for_work': 111 case 'not_looking_for_work':
111 $resumes->where('status_work', '=', WorkerStatuses::NotLookingForWork->value); 112 $resumes->where('status_work', '=', WorkerStatuses::NotLookingForWork->value);
112 break; 113 break;
113 } 114 }
114 } 115 }
115 116
116 $resumes->where(function (Builder $query) { 117 $resumes->where(function (Builder $query) {
117 $query->whereNotNull('telephone') 118 $query->whereNotNull('telephone')
118 ->whereNotNull('email') 119 ->whereNotNull('email')
119 ->whereNotNull('city') 120 ->whereNotNull('city')
120 ->whereNotNull('experience') 121 ->whereNotNull('experience')
121 ->whereNotNull('old_year'); 122 ->whereNotNull('old_year');
122 //fixme костыль, переделать 123 //fixme костыль, переделать
123 }); 124 });
124 125
125 $res_count = $resumes->count(); 126 $res_count = $resumes->count();
126 $resumes = $resumes->paginate(4); 127 $resumes = $resumes->paginate(4);
127 if ($request->ajax()) { 128 if ($request->ajax()) {
128 // Условия обставлены 129 // Условия обставлены
129 if ($request->has('block') && ($request->get('block') == 1)) { 130 if ($request->has('block') && ($request->get('block') == 1)) {
130 return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count')); 131 return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count'));
131 } 132 }
132 } else { 133 } else {
133 return view('resume', compact('resumes', 'status_work', 'res_count', 'Job_title')); 134 return view('resume', compact('resumes', 'status_work', 'res_count', 'Job_title'));
134 } 135 }
135 } 136 }
136 137
137 public function basic_information(){ 138 public function basic_information(){
138 if (!isset(Auth()->user()->id)) { 139 if (!isset(Auth()->user()->id)) {
139 abort(404); 140 abort(404);
140 } 141 }
141 142
142 $user_id = Auth()->user()->id; 143 $user_id = Auth()->user()->id;
143 144
144 $user = User::query() 145 $user = User::query()
145 ->with('workers') 146 ->with('workers')
146 ->with(['jobtitles' => function ($query) { 147 ->with(['jobtitles' => function ($query) {
147 $query->select('job_titles.id'); 148 $query->select('job_titles.id');
148 }]) 149 }])
149 ->where('id', '=', $user_id) 150 ->where('id', '=', $user_id)
150 ->first(); 151 ->first();
151 $user->workers[0]->job_titles = $user->workers[0]->job_titles->pluck('id')->toArray(); 152 $user->workers[0]->job_titles = $user->workers[0]->job_titles->pluck('id')->toArray();
152 153
153 $job_titles = Job_title::query() 154 $job_titles = Job_title::query()
154 ->where('is_remove', '=', 0) 155 ->where('is_remove', '=', 0)
155 ->where('is_bd', '=', 1) 156 ->where('is_bd', '=', 1)
156 ->orderByDesc('sort') 157 ->orderByDesc('sort')
157 ->get() 158 ->get()
158 ; 159 ;
159 160
160 return view('workers.form_basic_information', compact('user', 'job_titles')); 161 return view('workers.form_basic_information', compact('user', 'job_titles'));
161 } 162 }
162 163
163 public function additional_documents(){ 164 public function additional_documents(){
164 if (!isset(Auth()->user()->id)) { 165 if (!isset(Auth()->user()->id)) {
165 abort(404); 166 abort(404);
166 } 167 }
167 168
168 $user_id = Auth()->user()->id; 169 $user_id = Auth()->user()->id;
169 170
170 $info_blocks = infobloks::query()->OrderBy('name')->get(); 171 $info_blocks = infobloks::query()->OrderBy('name')->get();
171 $additional_document_statuses = [0 => 'Не указано', 1 => 'В наличии', 2 => 'Отсутствует']; 172 $additional_document_statuses = [0 => 'Не указано', 1 => 'В наличии', 2 => 'Отсутствует'];
172 173
173 $worker = Worker::query() 174 $worker = Worker::query()
174 ->with('users') 175 ->with('users')
175 ->with('infobloks') 176 ->with('infobloks')
176 ->WhereHas('users', function (Builder $query) use ($user_id) { 177 ->WhereHas('users', function (Builder $query) use ($user_id) {
177 $query->Where('id', $user_id); 178 $query->Where('id', $user_id);
178 }) 179 })
179 ->first(); 180 ->first();
180 if ($worker->dop_info->count()){ 181 if ($worker->dop_info->count()){
181 $worker->dop_info = $worker->dop_info->keyBy('infoblok_id')->toArray(); 182 $worker->dop_info = $worker->dop_info->keyBy('infoblok_id')->toArray();
182 } 183 }
183 184
184 return view('workers.form_additional_documents', compact('worker', 'info_blocks', 'additional_document_statuses')); 185 return view('workers.form_additional_documents', compact('worker', 'info_blocks', 'additional_document_statuses'));
185 } 186 }
186 187
187 //Лайк резюме 188 //Лайк резюме
188 public function like_controller() { 189 public function like_controller() {
189 190
190 } 191 }
191 192
192 // анкета соискателя 193 // анкета соискателя
193 public function resume_profile(Worker $worker) 194 public function resume_profile(Worker $worker)
194 { 195 {
195 if (isset(Auth()->user()->id)) { 196 if (isset(Auth()->user()->id)) {
196 $idiot = Auth()->user()->id; 197 $idiot = Auth()->user()->id;
197 } else { 198 } else {
198 $idiot = 0; 199 $idiot = 0;
199 } 200 }
200 201
201 $status_work = WorkerStatuses::getWorkerStatuses(); 202 $status_work = WorkerStatuses::getWorkerStatuses();
202 $Query = Worker::query()->with('users')->with('job_titles') 203 $Query = Worker::query()->with('users')->with('job_titles')
203 ->with('place_worker')->with('sertificate')->with('prev_company') 204 ->with('place_worker')->with('sertificate')->with('prev_company')
204 ->with('infobloks')->with('response'); 205 ->with('infobloks')->with('response');
205 $Query = $Query->where('id', '=', $worker->id); 206 $Query = $Query->where('id', '=', $worker->id);
206 $Query = $Query->get(); 207 $Query = $Query->get();
207 208
208 $get_date = date('Y.m'); 209 $get_date = date('Y.m');
209 210
210 $infoblocks = infobloks::query()->get(); 211 $infoblocks = infobloks::query()->get();
211 212
212 $c = Static_worker::query()->where('year_month', '=', $get_date) 213 $c = Static_worker::query()->where('year_month', '=', $get_date)
213 ->where('user_id', '=', $worker->user_id) 214 ->where('user_id', '=', $worker->user_id)
214 ->get(); 215 ->get();
215 216
216 if ($c->count() > 0) { 217 if ($c->count() > 0) {
217 $upd = Static_worker::find($c[0]->id); 218 $upd = Static_worker::find($c[0]->id);
218 $upd->lookin = $upd->lookin + 1; 219 $upd->lookin = $upd->lookin + 1;
219 $upd->save(); 220 $upd->save();
220 } else { 221 } else {
221 $crt = new Static_worker(); 222 $crt = new Static_worker();
222 $crt->lookin = 1; 223 $crt->lookin = 1;
223 $crt->year_month = $get_date; 224 $crt->year_month = $get_date;
224 $crt->user_id = $worker->user_id; 225 $crt->user_id = $worker->user_id;
225 $status = $crt->save(); 226 $status = $crt->save();
226 } 227 }
227 228
228 $stat = Static_worker::query()->where('year_month', '=', $get_date) 229 $stat = Static_worker::query()->where('year_month', '=', $get_date)
229 ->where('user_id', '=', $worker->user_id) 230 ->where('user_id', '=', $worker->user_id)
230 ->get(); 231 ->get();
231 232
232 return view('worker', compact('Query', 'infoblocks', 'status_work', 'idiot', 'stat')); 233 return view('worker', compact('Query', 'infoblocks', 'status_work', 'idiot', 'stat'));
233 } 234 }
234 235
235 // скачать анкету соискателя 236 // скачать анкету соискателя
236 public function resume_download(Worker $worker) 237 public function resume_download(Worker $worker)
237 { 238 {
238 $status_work = WorkerStatuses::getWorkerStatuses(); 239 $status_work = WorkerStatuses::getWorkerStatuses();
239 $Query = Worker::query()->with('users')->with('job_titles') 240 $Query = Worker::query()->with('users')->with('job_titles')
240 ->with('place_worker')->with('sertificate')->with('prev_company') 241 ->with('place_worker')->with('sertificate')->with('prev_company')
241 ->with('infobloks'); 242 ->with('infobloks');
242 $Query = $Query->where('id', '=', $worker->id); 243 $Query = $Query->where('id', '=', $worker->id);
243 $Query = $Query->get(); 244 $Query = $Query->get();
244 245
245 view()->share('Query',$Query); 246 view()->share('Query',$Query);
246 247
247 $status_work = WorkerStatuses::getWorkerStatuses(); 248 $status_work = WorkerStatuses::getWorkerStatuses();
248 $infoblocks = infobloks::query()->get(); 249 $infoblocks = infobloks::query()->get();
249 250
250 //dd($Query[0]); 251 //return view('layout.pdf', compact('Query', 'status_work', 'infoblocks'));
251 return view('layout.pdf', compact('Query', 'status_work', 'infoblocks'));
252 $pdf = PDF::loadView('layout.pdf', [ 252 $pdf = PDF::loadView('layout.pdf', [
253 'Query' => $Query, 253 'Query' => $Query,
254 'status_work' => $status_work, 254 'status_work' => $status_work,
255 'infoblocks' => $infoblocks 255 'infoblocks' => $infoblocks
256 ])->setPaper('a4', 'landscape'); 256 ])->setPaper('a4', 'landscape');
257 257
258 return $pdf->stream(); 258 return $pdf->download();
259 } 259 }
260 260
261 public function resume_download_all(Request $request) { 261 public function resume_download_all(Request $request) {
262 $spreadsheet = new Spreadsheet(); 262 $spreadsheet = new Spreadsheet();
263 $sheet = $spreadsheet->getActiveSheet(); 263 $sheet = $spreadsheet->getActiveSheet();
264 264
265 $columnMap = range('A', 'Z'); 265 $columnMap = range('A', 'Z');
266 $columns = []; 266 $columns = [];
267 267
268 foreach (DbExportColumns::toArray() as $key => $value){ 268 foreach (DbExportColumns::toArray() as $key => $value){
269 if ($request->input($key, 0)){ 269 if ($request->input($key, 0)){
270 $sheet->setCellValue("{$columnMap[count($columns)]}1", ucfirst($value)); 270 $sheet->setCellValue("{$columnMap[count($columns)]}1", ucfirst($value));
271 $columns[] = str_replace('__', '.', $key); 271 $columns[] = str_replace('__', '.', $key);
272 } 272 }
273 } 273 }
274 274
275 if (empty($columns)) { 275 if (empty($columns)) {
276 return redirect()->back()->with('error', 'Пожалуйста выберите хотя бы 1 колонку для экспорта.'); 276 return redirect()->back()->with('error', 'Пожалуйста выберите хотя бы 1 колонку для экспорта.');
277 } 277 }
278 278
279 $query = User::select($columns) 279 $jobIds = $request->input('job_title_list', []);
280 ->leftJoin('workers', 'users.id', '=', 'workers.user_id') 280
281 ->leftJoin('job_titles', 'workers.position_work', '=', 'job_titles.id') 281 $users = DB::select(
282 ->where('users.is_bd', '=', 1); 282 "select `job_titles`.`name`, `users`.`surname`, `users`.`name_man`, `users`.`surname2`, `users`.`email`, `users`.`telephone`
283 from users
284 join workers on `users`.`id` = `workers`.`user_id`
285 join `job_titles`
286 where `users`.`is_bd` = 1
287 and (`workers`.`position_work` = `job_titles`.`id`
288 or exists (select 1
289 from JSON_TABLE(
290 workers.positions_work,
291 '$[*]' COLUMNS (id INT PATH '$')) pw
292 where pw.id = job_titles.id)
293 )". ((!empty($jobIds)) ? 'and job_titles.id in ('. implode(',', $jobIds).')' : '')
294 );
283 295
284 $job_title_list = $request->input('job_title_list', []); 296 $users = collect($users);
285 if (!empty($job_title_list)){
286 $query->whereIn('job_titles.id', $job_title_list);
287 }
288 297
289 $users = $query->get(); 298 if ($users->count()) {
290 if ($users->count()){
291 $i = 2; 299 $i = 2;
292 foreach ($users->toArray() as $user){ 300 foreach ($users->toArray() as $user){
293 $j = 0; 301 $j = 0;
294 foreach ($user as $field){ 302 foreach ($user as $field){
295 $sheet->setCellValue("{$columnMap[$j++]}$i", $field); 303 $sheet->setCellValue("{$columnMap[$j++]}$i", $field);
296 } 304 }
297 $i++; 305 $i++;
298 } 306 }
299 } 307 }
300 $writer = new Xlsx($spreadsheet); 308 $writer = new Xlsx($spreadsheet);
301 $fileName = 'DB.xlsx'; 309 $fileName = 'DB.xlsx';
302 310
303 $response = new StreamedResponse(function() use ($writer) { 311 $response = new StreamedResponse(function() use ($writer) {
304 $writer->save('php://output'); 312 $writer->save('php://output');
305 }); 313 });
306 314
307 $response->headers->set('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); 315 $response->headers->set('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
308 $response->headers->set('Content-Disposition', 'attachment;filename="' . $fileName . '"'); 316 $response->headers->set('Content-Disposition', 'attachment;filename="' . $fileName . '"');
309 $response->headers->set('Cache-Control', 'max-age=0'); 317 $response->headers->set('Cache-Control', 'max-age=0');
310 318
311 return $response; 319 return $response;
312 } 320 }
313 321
314 // Кабинет работника 322 // Кабинет работника
315 public function cabinet(Request $request) 323 public function cabinet(Request $request)
316 { 324 {
317 // дата год и месяц 325 // дата год и месяц
318 $get_date = date('Y.m'); 326 $get_date = date('Y.m');
319 327
320 $id = Auth()->user()->id; 328 $id = Auth()->user()->id;
321 329
322 $Infobloks = infobloks::query()->get(); 330 $Infobloks = infobloks::query()->get();
323 331
324 $Worker = Worker::query() 332 $Worker = Worker::query()
325 ->with(['users', 'sertificate', 'prev_company', 'infobloks', 'place_worker']) 333 ->with(['users', 'sertificate', 'prev_company', 'infobloks', 'place_worker'])
326 ->WhereHas('users', function (Builder $query) use ($id) { 334 ->WhereHas('users', function (Builder $query) use ($id) {
327 $query->Where('id', $id); 335 $query->Where('id', $id);
328 })->first(); 336 })->first();
329 337
330 $Job_titles = Job_title::query()->where('is_remove', '=', '0') 338 $Job_titles = Job_title::query()->where('is_remove', '=', '0')
331 ->where('is_bd', '=' , '1') 339 ->where('is_bd', '=' , '1')
332 ->OrderByDesc('sort')->OrderBy('name') 340 ->OrderByDesc('sort')->OrderBy('name')
333 ->get(); 341 ->get();
334 342
335 $stat = Static_worker::query()->where('year_month', '=', $get_date) 343 $stat = Static_worker::query()->where('year_month', '=', $get_date)
336 ->where('user_id', '=', $id) 344 ->where('user_id', '=', $id)
337 ->get(); 345 ->get();
338 346
339 $persent = Tools::getWorkerProfilePercent($Worker); 347 $persent = Tools::getWorkerProfilePercent($Worker);
340 348
341 $status_work = WorkerStatuses::getWorkerStatuses(); 349 $status_work = WorkerStatuses::getWorkerStatuses();
342 $additional_document_statuses = [0 => 'Не указано', 1 => 'В наличии', 2 => 'Отсутствует']; 350 $additional_document_statuses = [0 => 'Не указано', 1 => 'В наличии', 2 => 'Отсутствует'];
343 $info_blocks = infobloks::query()->OrderBy('name')->get(); 351 $info_blocks = infobloks::query()->OrderBy('name')->get();
344 352
345 $worker = Worker::query() 353 $worker = Worker::query()
346 ->with('users') 354 ->with('users')
347 ->with('sertificate') 355 ->with('sertificate')
348 ->with('prev_company') 356 ->with('prev_company')
349 ->with('infobloks') 357 ->with('infobloks')
350 ->with('place_worker') 358 ->with('place_worker')
351 ->with('job_titles') 359 ->with('job_titles')
352 ->WhereHas('users', function (Builder $query) use ($id) { 360 ->WhereHas('users', function (Builder $query) use ($id) {
353 $query->Where('id', $id); 361 $query->Where('id', $id);
354 }) 362 })
355 ->first(); 363 ->first();
356 if ($worker->dop_info->count()){ 364 if ($worker->dop_info->count()){
357 $worker->dop_info = $worker->dop_info->keyBy('infoblok_id')->toArray(); 365 $worker->dop_info = $worker->dop_info->keyBy('infoblok_id')->toArray();
358 } 366 }
359 367
360 //dd($worker->dop_info); 368 //dd($worker->dop_info);
361 369
362 if ($request->has('print')) { 370 if ($request->has('print')) {
363 dd($Worker); 371 dd($Worker);
364 } else { 372 } else {
365 return view('workers.cabinet', compact( 'persent', 'Job_titles', 'stat', 373 return view('workers.cabinet', compact( 'persent', 'Job_titles', 'stat',
366 'worker', 'info_blocks', 'status_work', 'additional_document_statuses' 374 'worker', 'info_blocks', 'status_work', 'additional_document_statuses'
367 )); 375 ));
368 } 376 }
369 } 377 }
370 378
371 // Сохранение данных 379 // Сохранение данных
372 public function cabinet_save(Worker $worker, Request $request) 380 public function cabinet_save(Worker $worker, Request $request)
373 { 381 {
374 $id = $worker->id; 382 $id = $worker->id;
375 $params = $request->all(); 383 $params = $request->all();
376 $job_title_id = $request->get('job_title_id'); 384 $job_title_id = $request->get('job_title_id');
377 385
378 $rules = [ 386 $rules = [
379 'surname' => ['required', 'string', 'max:255'], 387 'surname' => ['required', 'string', 'max:255'],
380 'name_man' => ['required', 'string', 'max:255'], 388 'name_man' => ['required', 'string', 'max:255'],
381 'email' => ['required', 'string', 'email', 'max:255'], 389 'email' => ['required', 'string', 'email', 'max:255'],
382 390
383 ]; 391 ];
384 392
385 $messages = [ 393 $messages = [
386 'required' => 'Укажите обязательное поле', 394 'required' => 'Укажите обязательное поле',
387 'min' => [ 395 'min' => [
388 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 396 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
389 'integer' => 'Поле «:attribute» должно быть :min или больше', 397 'integer' => 'Поле «:attribute» должно быть :min или больше',
390 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 398 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
391 ], 399 ],
392 'max' => [ 400 'max' => [
393 'string' => 'Поле «:attribute» должно быть не больше :max символов', 401 'string' => 'Поле «:attribute» должно быть не больше :max символов',
394 'integer' => 'Поле «:attribute» должно быть :max или меньше', 402 'integer' => 'Поле «:attribute» должно быть :max или меньше',
395 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 403 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
396 ] 404 ]
397 ]; 405 ];
398 406
399 $validator = Validator::make($params, $rules, $messages); 407 $validator = Validator::make($params, $rules, $messages);
400 408
401 if ($validator->fails()) { 409 if ($validator->fails()) {
402 return redirect()->route('worker.cabinet')->withErrors($validator); 410 return redirect()->route('worker.cabinet')->withErrors($validator);
403 } else { 411 } else {
404 412
405 if ($request->has('photo')) { 413 if ($request->has('photo')) {
406 if (!empty($worker->photo)) { 414 if (!empty($worker->photo)) {
407 Storage::delete($worker->photo); 415 Storage::delete($worker->photo);
408 } 416 }
409 $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); 417 $params['photo'] = $request->file('photo')->store("worker/$id", 'public');
410 } 418 }
411 419
412 if ($request->has('file')) { 420 if ($request->has('file')) {
413 if (!empty($worker->file)) { 421 if (!empty($worker->file)) {
414 Storage::delete($worker->file); 422 Storage::delete($worker->file);
415 } 423 }
416 $params['file'] = $request->file('file')->store("worker/$id", 'public'); 424 $params['file'] = $request->file('file')->store("worker/$id", 'public');
417 } 425 }
418 426
419 $worker->update($params); 427 $worker->update($params);
420 $use = User::find($worker->user_id); 428 $use = User::find($worker->user_id);
421 $use->surname = $request->get('surname'); 429 $use->surname = $request->get('surname');
422 $use->name_man = $request->get('name_man'); 430 $use->name_man = $request->get('name_man');
423 $use->surname2 = $request->get('surname2'); 431 $use->surname2 = $request->get('surname2');
424 432
425 $use->save(); 433 $use->save();
426 $worker->job_titles()->sync($job_title_id); 434 $worker->job_titles()->sync($job_title_id);
427 435
428 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); 436 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены');
429 } 437 }
430 } 438 }
431 439
432 public function cabinet_save_foto(Worker $worker, Request $request){ 440 public function cabinet_save_foto(Worker $worker, Request $request){
433 $params = ['photo' => null]; 441 $params = ['photo' => null];
434 442
435 if ($request->has('photo')) { 443 if ($request->has('photo')) {
436 if (!empty($worker->photo)) { 444 if (!empty($worker->photo)) {
437 Storage::delete($worker->photo); 445 Storage::delete($worker->photo);
438 } 446 }
439 $params['photo'] = $request->file('photo')->store("worker/$worker->id", 'public'); 447 $params['photo'] = $request->file('photo')->store("worker/$worker->id", 'public');
440 } 448 }
441 449
442 if ($request->has('file')) { 450 if ($request->has('file')) {
443 if (!empty($worker->file)) { 451 if (!empty($worker->file)) {
444 Storage::delete($worker->file); 452 Storage::delete($worker->file);
445 } 453 }
446 $params['file'] = $request->file('file')->store("worker/$worker->id", 'public'); 454 $params['file'] = $request->file('file')->store("worker/$worker->id", 'public');
447 } 455 }
448 456
449 $worker->update($params); 457 $worker->update($params);
450 458
451 return redirect()->route('worker.cabinet'); 459 return redirect()->route('worker.cabinet');
452 } 460 }
453 461
454 // Сообщения данные 462 // Сообщения данные
455 public function messages($type_message) 463 public function messages($type_message)
456 { 464 {
457 $user_id = Auth()->user()->id; 465 $user_id = Auth()->user()->id;
458 466
459 $chats = Chat::get_user_chats($user_id); 467 $chats = Chat::get_user_chats($user_id);
460 $admin_chat = Chat::get_user_admin_chat($user_id); 468 $admin_chat = Chat::get_user_admin_chat($user_id);
461 $user_type = 'worker'; 469 $user_type = 'worker';
462 470
463 return view('workers.messages', compact('chats', 'admin_chat','user_id', 'user_type')); 471 return view('workers.messages', compact('chats', 'admin_chat','user_id', 'user_type'));
464 } 472 }
465 473
466 // Избранный 474 // Избранный
467 public function favorite() 475 public function favorite()
468 { 476 {
469 return view('workers.favorite'); 477 return view('workers.favorite');
470 } 478 }
471 479
472 // Сменить пароль 480 // Сменить пароль
473 public function new_password() 481 public function new_password()
474 { 482 {
475 $email = Auth()->user()->email; 483 $email = Auth()->user()->email;
476 return view('workers.new_password', compact('email')); 484 return view('workers.new_password', compact('email'));
477 } 485 }
478 486
479 // Обновление пароля 487 // Обновление пароля
480 public function save_new_password(Request $request) { 488 public function save_new_password(Request $request) {
481 $use = Auth()->user(); 489 $use = Auth()->user();
482 $request->validate([ 490 $request->validate([
483 'password' => 'required|string', 491 'password' => 'required|string',
484 'new_password' => 'required|string', 492 'new_password' => 'required|string',
485 'new_password2' => 'required|string' 493 'new_password2' => 'required|string'
486 ]); 494 ]);
487 495
488 if ($request->get('new_password') == $request->get('new_password2')) 496 if ($request->get('new_password') == $request->get('new_password2'))
489 if ($request->get('password') !== $request->get('new_password')) { 497 if ($request->get('password') !== $request->get('new_password')) {
490 $credentials = $request->only('email', 'password'); 498 $credentials = $request->only('email', 'password');
491 if (Auth::attempt($credentials, $request->has('save_me'))) { 499 if (Auth::attempt($credentials, $request->has('save_me'))) {
492 500
493 if (!is_null($use->email_verified_at)){ 501 if (!is_null($use->email_verified_at)){
494 502
495 $user_data = User_Model::find($use->id); 503 $user_data = User_Model::find($use->id);
496 $user_data->update([ 504 $user_data->update([
497 'password' => Hash::make($request->get('new_password')), 505 'password' => Hash::make($request->get('new_password')),
498 'pubpassword' => base64_encode($request->get('new_password')), 506 'pubpassword' => base64_encode($request->get('new_password')),
499 ]); 507 ]);
500 return redirect() 508 return redirect()
501 ->route('worker.new_password') 509 ->route('worker.new_password')
502 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 510 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
503 } 511 }
504 512
505 return redirect() 513 return redirect()
506 ->route('worker.new_password') 514 ->route('worker.new_password')
507 ->withError('Данная учетная запись не было верифицированна!'); 515 ->withError('Данная учетная запись не было верифицированна!');
508 } 516 }
509 } 517 }
510 518
511 return redirect() 519 return redirect()
512 ->route('worker.new_password') 520 ->route('worker.new_password')
513 ->withErrors('Не совпадение данных, обновите пароли!'); 521 ->withErrors('Не совпадение данных, обновите пароли!');
514 } 522 }
515 523
516 // Удаление профиля форма 524 // Удаление профиля форма
517 public function delete_profile() 525 public function delete_profile()
518 { 526 {
519 $login = Auth()->user()->email; 527 $login = Auth()->user()->email;
520 return view('workers.delete_profile', compact('login')); 528 return view('workers.delete_profile', compact('login'));
521 } 529 }
522 530
523 // Удаление профиля код 531 // Удаление профиля код
524 public function delete_profile_result(Request $request) { 532 public function delete_profile_result(Request $request) {
525 $Answer = $request->all(); 533 $Answer = $request->all();
526 $user_id = Auth()->user()->id; 534 $user_id = Auth()->user()->id;
527 $request->validate([ 535 $request->validate([
528 'password' => 'required|string', 536 'password' => 'required|string',
529 ]); 537 ]);
530 538
531 $credentials = $request->only('email', 'password'); 539 $credentials = $request->only('email', 'password');
532 if (Auth::attempt($credentials)) { 540 if (Auth::attempt($credentials)) {
533 Auth::logout(); 541 Auth::logout();
534 $it = User_Model::find($user_id); 542 $it = User_Model::find($user_id);
535 $it->delete(); 543 $it->delete();
536 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 544 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
537 } else { 545 } else {
538 return redirect()->route('worker.delete_profile') 546 return redirect()->route('worker.delete_profile')
539 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 547 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
540 } 548 }
541 } 549 }
542 550
543 // Регистрация соискателя 551 // Регистрация соискателя
544 public function register_worker(Request $request) 552 public function register_worker(Request $request)
545 { 553 {
546 $params = $request->all(); 554 $params = $request->all();
547 $params['is_worker'] = 1; 555 $params['is_worker'] = 1;
548 556
549 $rules = [ 557 $rules = [
550 'surname' => ['required', 'string', 'max:255'], 558 'surname' => ['required', 'string', 'max:255'],
551 'name_man' => ['required', 'string', 'max:255'], 559 'name_man' => ['required', 'string', 'max:255'],
552 'email' => ['required', 'email', 'max:255', 'unique:users'], 560 'email' => ['required', 'email', 'max:255', 'unique:users'],
553 'password' => ['required', 'string', 'min:6'] 561 'password' => ['required', 'string', 'min:6']
554 ]; 562 ];
555 563
556 $messages = [ 564 $messages = [
557 'required' => 'Укажите обязательное поле', 565 'required' => 'Укажите обязательное поле',
558 'min' => [ 566 'min' => [
559 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 567 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
560 'integer' => 'Поле «:attribute» должно быть :min или больше', 568 'integer' => 'Поле «:attribute» должно быть :min или больше',
561 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 569 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
562 ], 570 ],
563 'max' => [ 571 'max' => [
564 'string' => 'Поле «:attribute» должно быть не больше :max символов', 572 'string' => 'Поле «:attribute» должно быть не больше :max символов',
565 'integer' => 'Поле «:attribute» должно быть :max или меньше', 573 'integer' => 'Поле «:attribute» должно быть :max или меньше',
566 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 574 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
567 ] 575 ]
568 ]; 576 ];
569 577
570 $email = $request->get('email'); 578 $email = $request->get('email');
571 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { 579 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) {
572 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); 580 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл"));
573 } 581 }
574 582
575 if ($request->get('password') !== $request->get('confirmed')){ 583 if ($request->get('password') !== $request->get('confirmed')){
576 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 584 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
577 } 585 }
578 586
579 if (strlen($request->get('password')) < 6) { 587 if (strlen($request->get('password')) < 6) {
580 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); 588 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
581 } 589 }
582 590
583 /*$haystack = $request->get('password');
584
585 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?');
586 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z',
587 'X', 'C', 'V', 'B', 'N', 'M');
588 $lenpwd_bool = true;
589 $spec_bool = false;
590 $alpha_bool = false;
591
592 if (strlen($haystack) < 8) $lenpwd_bool = false;
593
594 foreach ($specsumbol as $it) {
595 if (strpos($haystack, $it) !== false) {
596 $spec_bool = true;
597 }
598 }
599
600 foreach ($alpha as $it) {
601 if (strpos($haystack, $it) !== false) {
602 $alpha_bool = true;
603 }
604 }
605
606 if ((!$spec_bool) || (!$alpha_bool)) {
607 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?"));
608 }*/
609
610 if (($request->has('politik')) && ($request->get('politik') == 1)) { 591 if (($request->has('politik')) && ($request->get('politik') == 1)) {
611 $validator = Validator::make($params, $rules, $messages); 592 $validator = Validator::make($params, $rules, $messages);
612 593
613 if ($validator->fails()) { 594 if ($validator->fails()) {
614 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 595 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
615 } else { 596 } else {
616 //dd($params);
617 $user = $this->create($params); 597 $user = $this->create($params);
618 event(new Registered($user)); 598 event(new Registered($user));
619 Auth::guard()->login($user); 599 Auth::guard()->login($user);
620 } 600 }
621 if ($user) { 601 if ($user) {
622 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; 602 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));;
623 } else { 603 } else {
624 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 604 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
625 } 605 }
626 606
627 } else { 607 } else {
628 return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!")); 608 return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!"));
629 } 609 }
630 } 610 }
631 611
632 // Звездная оценка и ответ 612 // Звездная оценка и ответ
633 public function stars_answer(Request $request) { 613 public function stars_answer(Request $request) {
634 $params = $request->all(); 614 $params = $request->all();
635 $rules = [ 615 $rules = [
636 'message' => ['required', 'string', 'max:255'], 616 'message' => ['required', 'string', 'max:255'],
637 ]; 617 ];
638 618
639 $messages = [ 619 $messages = [
640 'required' => 'Укажите обязательное поле', 620 'required' => 'Укажите обязательное поле',
641 'min' => [ 621 'min' => [
642 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 622 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
643 'integer' => 'Поле «:attribute» должно быть :min или больше', 623 'integer' => 'Поле «:attribute» должно быть :min или больше',
644 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 624 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
645 ], 625 ],
646 'max' => [ 626 'max' => [
647 'string' => 'Поле «:attribute» должно быть не больше :max символов', 627 'string' => 'Поле «:attribute» должно быть не больше :max символов',
648 'integer' => 'Поле «:attribute» должно быть :max или меньше', 628 'integer' => 'Поле «:attribute» должно быть :max или меньше',
649 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 629 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
650 ] 630 ]
651 ]; 631 ];
652 $response_worker = ResponseWork::create($params); 632 $response_worker = ResponseWork::create($params);
653 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); 633 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!');
654 } 634 }
655 635
656 public function TestWorker() 636 public function TestWorker()
657 { 637 {
658 $Use = new User(); 638 $Use = new User();
659 639
660 $Code_user = $Use->create([ 640 $Code_user = $Use->create([
661 'name' => 'surname name_man', 641 'name' => 'surname name_man',
662 'name_man' => 'name_man', 642 'name_man' => 'name_man',
663 'surname' => 'surname', 643 'surname' => 'surname',
664 'surname2' => 'surname2', 644 'surname2' => 'surname2',
665 'subscribe_email' => '1', 645 'subscribe_email' => '1',
666 'email' => 'email@mail.com', 646 'email' => 'email@mail.com',
667 'telephone' => '1234567890', 647 'telephone' => '1234567890',
668 'password' => Hash::make('password'), 648 'password' => Hash::make('password'),
669 'pubpassword' => base64_encode('password'), 649 'pubpassword' => base64_encode('password'),
670 'email_verified_at' => Carbon::now(), 650 'email_verified_at' => Carbon::now(),
671 'is_worker' => 1, 651 'is_worker' => 1,
672 ]); 652 ]);
673 653
674 if ($Code_user->id > 0) { 654 if ($Code_user->id > 0) {
675 $Worker = new Worker(); 655 $Worker = new Worker();
676 $Worker->user_id = $Code_user->id; 656 $Worker->user_id = $Code_user->id;
677 $Worker->position_work = 1; //'job_titles'; 657 $Worker->position_work = 1; //'job_titles';
678 $Worker->email = 'email@email.com'; 658 $Worker->email = 'email@email.com';
679 $Worker->telephone = '1234567890'; 659 $Worker->telephone = '1234567890';
680 $status = $Worker->save(); 660 $status = $Worker->save();
681 661
682 $Title_Worker = new Title_worker(); 662 $Title_Worker = new Title_worker();
683 $Title_Worker->worker_id = $Worker->id; 663 $Title_Worker->worker_id = $Worker->id;
684 $Title_Worker->job_title_id = 1; 664 $Title_Worker->job_title_id = 1;
685 $Title_Worker->save(); 665 $Title_Worker->save();
686 } 666 }
687 } 667 }
688 668
689 // Создание пользователя 669 // Создание пользователя
690 protected function create(array $data) 670 protected function create(array $data)
691 { 671 {
692 $Use = new User(); 672 $Use = new User();
693 673
694 $Code_user = $Use->create([ 674 $Code_user = $Use->create([
695 'name' => $data['surname']." ".$data['name_man'], 675 'name' => $data['surname']." ".$data['name_man'],
696 'name_man' => $data['name_man'], 676 'name_man' => $data['name_man'],
697 'surname' => $data['surname'], 677 'surname' => $data['surname'],
698 'surname2' => $data['surname2'], 678 'surname2' => $data['surname2'],
699 'subscribe_email' => $data['email'], 679 'subscribe_email' => $data['email'],
700 'email' => $data['email'], 680 'email' => $data['email'],
701 'telephone' => $data['telephone'], 681 'telephone' => $data['telephone'],
702 'password' => Hash::make($data['password']), 682 'password' => Hash::make($data['password']),
703 'pubpassword' => base64_encode($data['password']), 683 'pubpassword' => base64_encode($data['password']),
704 'email_verified_at' => Carbon::now(), 684 'email_verified_at' => Carbon::now(),
705 'is_worker' => $data['is_worker'], 685 'is_worker' => $data['is_worker'],
706 ]); 686 ]);
707 687
708 if ($Code_user->id > 0) { 688 if ($Code_user->id > 0) {
709 $Worker = new Worker(); 689 $Worker = new Worker();
710 $Worker->user_id = $Code_user->id; 690 $Worker->user_id = $Code_user->id;
711 $Worker->position_work = $data['job_titles']; 691 $Worker->position_work = $data['job_titles'];
712 $Worker->email = $data['email']; 692 $Worker->email = $data['email'];
713 $Worker->telephone = $data['telephone']; 693 $Worker->telephone = $data['telephone'];
714 $Worker->save(); 694 $Worker->save();
715 695
716 if (isset($Worker->id)) { 696 if (isset($Worker->id)) {
717 $Title_Worker = new Title_worker(); 697 $Title_Worker = new Title_worker();
718 $Title_Worker->worker_id = $Worker->id; 698 $Title_Worker->worker_id = $Worker->id;
719 $Title_Worker->job_title_id = $data['job_titles']; 699 $Title_Worker->job_title_id = $data['job_titles'];
720 $Title_Worker->save(); 700 $Title_Worker->save();
721 } 701 }
722 702
723 return $Code_user; 703 return $Code_user;
724 } 704 }
725 } 705 }
726 706
727 // Вакансии избранные 707 // Вакансии избранные
728 public function colorado(Request $request) { 708 public function colorado(Request $request) {
729 $Arr = Like_vacancy::Query() 709 $Arr = Like_vacancy::Query()
730 ->select('code_record') 710 ->select('code_record')
731 ->where('user_id', Auth::user()->id) 711 ->where('user_id', Auth::user()->id)
732 ->get(); 712 ->get();
733 713
734 if ($Arr->count()) { 714 if ($Arr->count()) {
735 $A = Array(); 715 $A = Array();
736 foreach ($Arr as $it) { 716 foreach ($Arr as $it) {
737 $A[] = $it->code_record; 717 $A[] = $it->code_record;
738 } 718 }
739 719
740 $Query = Ad_employer::query()->whereIn('id', $A); 720 $Query = Ad_employer::query()->whereIn('id', $A);
741 } else { 721 } else {
742 $Query = Ad_employer::query()->where('id', '=', '0'); 722 $Query = Ad_employer::query()->where('id', '=', '0');
743 } 723 }
744 724
745 $Query = $Query->with(['jobs', 'cat', 'employer']) 725 $Query = $Query->with(['jobs', 'cat', 'employer'])
746 ->whereHas('jobs_code', function ($query) use ($request) { 726 ->whereHas('jobs_code', function ($query) use ($request) {
747 if ($request->ajax()) { 727 if ($request->ajax()) {
748 if (null !== ($request->get('job'))) { 728 if (null !== ($request->get('job'))) {
749 $query->where('job_title_id', $request->get('job')); 729 $query->where('job_title_id', $request->get('job'));
750 } 730 }
751 } 731 }
752 }) 732 })
753 ->select('ad_employers.*'); 733 ->select('ad_employers.*');
754 734
755 if ($request->get('search') !== null) { 735 if ($request->get('search') !== null) {
756 $search = $request->get('search'); 736 $search = $request->get('search');
757 $Query->where('name', 'LIKE', "%$search%"); 737 $Query->where('name', 'LIKE', "%$search%");
758 } 738 }
759 739
760 //dd($Query->get()); 740 //dd($Query->get());
761 741
762 $Job_title = Job_title::query()->OrderBy('name')->get(); 742 $Job_title = Job_title::query()->OrderBy('name')->get();
763 743
764 $Query_count = $Query->count(); 744 $Query_count = $Query->count();
765 745
766 $Query = $Query->OrderBy('updated_at')->paginate(3); 746 $Query = $Query->OrderBy('updated_at')->paginate(3);
767 747
768 return view('workers.favorite', compact('Query', 748 return view('workers.favorite', compact('Query',
769 'Query_count', 749 'Query_count',
770 'Job_title')); 750 'Job_title'));
771 751
772 } 752 }
773 753
774 //Переписка 754 //Переписка
775 public function dialog(Chat $chat, Request $request) { 755 public function dialog(Chat $chat, Request $request) {
776 // Получение параметров. 756 // Получение параметров.
777 if ($request->has('ad_employer')){ 757 if ($request->has('ad_employer')){
778 $ad_employer = $request->get('ad_employer'); 758 $ad_employer = $request->get('ad_employer');
779 } else { 759 } else {
780 $ad_employer = 0; 760 $ad_employer = 0;
781 } 761 }
782 762
783 $sender = User_Model::query()->with('workers')->with('employers')->where('id', $chat->user_id)->first(); 763 $sender = User_Model::query()->with('workers')->with('employers')->where('id', $chat->user_id)->first();
784 $companion = User_Model::query()->with('workers')->with('employers')->where('id', $chat->to_user_id)->first(); 764 $companion = User_Model::query()->with('workers')->with('employers')->where('id', $chat->to_user_id)->first();
785 765
786 $Messages = Chat::get_chat_messages($chat); 766 $Messages = Chat::get_chat_messages($chat);
787 767
788 Message::where('chat_id_to', '=', $chat->id)->update(['flag_new' => 0]); 768 Message::where('chat_id_to', '=', $chat->id)->update(['flag_new' => 0]);
789 769
790 return view('workers.dialog', compact('companion', 'sender', 'chat', 'Messages', 'ad_employer')); 770 return view('workers.dialog', compact('companion', 'sender', 'chat', 'Messages', 'ad_employer'));
791 } 771 }
792 772
793 // Даунылоады 773 // Даунылоады
794 public function download(Worker $worker) { 774 public function download(Worker $worker) {
795 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; 775 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...'];
796 view()->share('house',$arr_house); 776 view()->share('house',$arr_house);
797 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); 777 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape');
798 return $pdf->stream(); 778 return $pdf->stream();
799 } 779 }
800 780
801 // Поднятие анкеты 781 // Поднятие анкеты
802 public function up(Worker $worker) { 782 public function up(Worker $worker) {
803 $worker->updated_at = Carbon::now(); 783 $worker->updated_at = Carbon::now();
804 $worker->save(); 784 $worker->save();
805 // 0 785 // 0
806 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); 786 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных');
807 } 787 }
808 788
809 // Форма сертификате 789 // Форма сертификате
810 public function new_sertificate(Worker $worker) { 790 public function new_sertificate(Worker $worker) {
811 return view('workers.sertificate_add', compact('worker')); 791 return view('workers.sertificate_add', compact('worker'));
812 } 792 }
813 793
814 // Добавление сертификата 794 // Добавление сертификата
815 public function add_serificate(SertificationRequest $request) { 795 public function add_serificate(SertificationRequest $request) {
816 $request->validate([ 796 $request->validate([
817 'name' => 'required|string|max:255', 797 'name' => 'required|string|max:255',
818 'end_begin' => 'required|date|date_format:d.m.Y' 798 'end_begin' => 'required|date|date_format:d.m.Y'
819 ], 799 ],
820 [ 800 [
821 'name' => 'Навание сертификата обязательно для заполнения.', 801 'name' => 'Навание сертификата обязательно для заполнения.',
822 'end_begin' => 'Формат даты должен соответствовать дд.мм.гггг' 802 'end_begin' => 'Формат даты должен соответствовать дд.мм.гггг'
823 ]); 803 ]);
824 804
825 $params = $request->all(); 805 $params = $request->all();
826 806
827 $end_begin = DateTime::createFromFormat('d.m.Y', $params['end_begin']); 807 $end_begin = DateTime::createFromFormat('d.m.Y', $params['end_begin']);
828 $params['end_begin'] = $end_begin->format('Y-m-d'); 808 $params['end_begin'] = $end_begin->format('Y-m-d');
829 809
830 $Sertificate = new sertification(); 810 $Sertificate = new sertification();
831 $Sertificate->create($params); 811 $Sertificate->create($params);
832 812
833 return response()->json([ 813 return response()->json([
834 'success' => true 814 'success' => true
835 ]); 815 ]);
836 } 816 }
837 817
838 // Удалить сертификат 818 // Удалить сертификат
839 public function delete_sertificate(sertification $doc) { 819 public function delete_sertificate(sertification $doc) {
840 $doc->delete(); 820 $doc->delete();
841 821
842 return redirect()->route('worker.cabinet'); 822 return redirect()->route('worker.cabinet');
843 } 823 }
844 824
845 // Редактирование сертификата 825 // Редактирование сертификата
846 public function edit_sertificate(Worker $worker, sertification $doc) { 826 public function edit_sertificate(Worker $worker, sertification $doc) {
847 return view('workers.sertificate_edit', compact('doc', 'worker')); 827 return view('workers.sertificate_edit', compact('doc', 'worker'));
848 } 828 }
849 829
850 // Редактирование обновление сертификата 830 // Редактирование обновление сертификата
851 public function update_serificate(SertificationRequest $request, sertification $doc) { 831 public function update_serificate(SertificationRequest $request, sertification $doc) {
852 $request->validate([ 832 $request->validate([
853 'name' => 'required|string|max:255', 833 'name' => 'required|string|max:255',
854 'end_begin' => 'required|date|date_format:d.m.Y' 834 'end_begin' => 'required|date|date_format:d.m.Y'
855 ], 835 ],
856 [ 836 [
857 'name' => 'Навание сертификата обязательно для заполнения.', 837 'name' => 'Навание сертификата обязательно для заполнения.',
858 'end_begin' => 'Формат даты должен соответствовать дд.мм.гггг' 838 'end_begin' => 'Формат даты должен соответствовать дд.мм.гггг'
859 ]); 839 ]);
860 840
861 $all = $request->all(); 841 $all = $request->all();
862 842
863 $end_begin = DateTime::createFromFormat('d.m.Y', $all['end_begin']); 843 $end_begin = DateTime::createFromFormat('d.m.Y', $all['end_begin']);
864 $all['end_begin'] = $end_begin->format('Y-m-d'); 844 $all['end_begin'] = $end_begin->format('Y-m-d');
865 845
866 $doc->worker_id = $all['worker_id']; 846 $doc->worker_id = $all['worker_id'];
867 $doc->name = $all['name']; 847 $doc->name = $all['name'];
868 $doc->end_begin = $all['end_begin']; 848 $doc->end_begin = $all['end_begin'];
869 $doc->save(); 849 $doc->save();
870 850
871 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); 851 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!');
872 } 852 }
873 853
874 public function edit_diploms(Request $request, Worker $worker) { 854 public function edit_diploms(Request $request, Worker $worker) {
875 $dop_info_data = $request->input('diploms'); 855 $dop_info_data = $request->input('diploms');
876 856
877 if (empty($dop_info_data)) { 857 if (empty($dop_info_data)) {
878 return redirect()->route('worker.additional_documents')->with('error', 'Данные не предоставлены!'); 858 return redirect()->route('worker.additional_documents')->with('error', 'Данные не предоставлены!');
879 } 859 }
880 860
881 foreach ($dop_info_data as $infoblok_id => $status) { 861 foreach ($dop_info_data as $infoblok_id => $status) {
882 Dop_info::updateOrCreate( 862 Dop_info::updateOrCreate(
883 ['worker_id' => $worker->id, 'infoblok_id' => $infoblok_id], 863 ['worker_id' => $worker->id, 'infoblok_id' => $infoblok_id],
884 ['status' => $status] 864 ['status' => $status]
885 ); 865 );
886 } 866 }
887 867
888 return redirect()->route('worker.additional_documents')->with('success', 'Успешно сохранено!'); 868 return redirect()->route('worker.additional_documents')->with('success', 'Успешно сохранено!');
889 } 869 }
890 870
891 public function delete_add_diplom(Request $request, Worker $worker) { 871 public function delete_add_diplom(Request $request, Worker $worker) {
892 $infoblok_id = $request->get('infoblok_id'); 872 $infoblok_id = $request->get('infoblok_id');
893 873
894 if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0) 874 if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0)
895 $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete(); 875 $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete();
896 else { 876 else {
897 $params['infoblok_id'] = $infoblok_id; 877 $params['infoblok_id'] = $infoblok_id;
898 $params['worker_id'] = $worker->id; 878 $params['worker_id'] = $worker->id;
899 $params['status'] = $request->get('val'); 879 $params['status'] = $request->get('val');
900 $id = Dop_info::create($params); 880 $id = Dop_info::create($params);
901 //$id = $worker->infobloks()->sync([$infoblok_id]); 881 //$id = $worker->infobloks()->sync([$infoblok_id]);
902 } 882 }
903 883
904 //$Infoblocks = infobloks::query()->get(); 884 //$Infoblocks = infobloks::query()->get();
905 return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks')); 885 return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks'));
906 } 886 }
907 887
908 888
909 889
910 // Добавление диплома 890 // Добавление диплома
911 public function add_diplom_ajax(Request $request) { 891 public function add_diplom_ajax(Request $request) {
912 // конец 892 // конец
913 $params = $request->all(); 893 $params = $request->all();
914 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 894 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
915 895
916 if ($count == 0) $dop_info = Dop_info::create($params); 896 if ($count == 0) $dop_info = Dop_info::create($params);
917 $Infoblocks = infobloks::query()->get(); 897 $Infoblocks = infobloks::query()->get();
918 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); 898 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get();
919 $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); 899 $data = Dop_info::query()->where('worker_id', $request->has('worker_id'));
920 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); 900 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker'));
921 } 901 }
922 902
923 // Добавление диплома без ajax 903 // Добавление диплома без ajax
924 public function add_diplom(Worker $worker) { 904 public function add_diplom(Worker $worker) {
925 $worker_id = $worker->id; 905 $worker_id = $worker->id;
926 $Infoblocks = infobloks::query()->get(); 906 $Infoblocks = infobloks::query()->get();
927 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); 907 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks'));
928 } 908 }
929 // Сохранить 909 // Сохранить
930 // Сохраняю диплом 910 // Сохраняю диплом
931 public function add_diplom_save(Request $request) { 911 public function add_diplom_save(Request $request) {
932 $params = $request->all(); 912 $params = $request->all();
933 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 913 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
934 if ($count == 0) $dop_info = Dop_info::create($params); 914 if ($count == 0) $dop_info = Dop_info::create($params);
935 return redirect()->route('worker.cabinet'); 915 return redirect()->route('worker.cabinet');
936 } 916 }
937 917
938 // Добавление стандартного документа 918 // Добавление стандартного документа
939 public function add_document(Worker $worker) { 919 public function add_document(Worker $worker) {
940 return view('workers.docs', compact('worker')); 920 return view('workers.docs', compact('worker'));
941 } 921 }
942 922
943 //Сохранение стандартого документа 923 //Сохранение стандартого документа
944 public function add_document_save(DocumentsRequest $request) { 924 public function add_document_save(DocumentsRequest $request) {
945 $params = $request->all(); 925 $params = $request->all();
946 place_works::create($params); 926 place_works::create($params);
947 return response()->json(['success' => true]); 927 return response()->json(['success' => true]);
948 } 928 }
949 929
950 // Редактирование документа 930 // Редактирование документа
951 public function edit_document(place_works $doc, Worker $worker) { 931 public function edit_document(place_works $doc, Worker $worker) {
952 return view('workers.docs-edit', compact('doc', 'worker')); 932 return view('workers.docs-edit', compact('doc', 'worker'));
953 } 933 }
954 934
955 //Сохранение отредактированного документа 935 //Сохранение отредактированного документа
956 public function edit_document_save(DocumentsRequest $request, place_works $doc) { 936 public function edit_document_save(DocumentsRequest $request, place_works $doc) {
957 $params = $request->all(); 937 $params = $request->all();
958 $doc->update($params); 938 $doc->update($params);
959 939
960 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); 940 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!');
961 } 941 }
962 942
963 // Удаление документа 943 // Удаление документа
964 public function delete_document(place_works $doc) { 944 public function delete_document(place_works $doc) {
965 $doc->delete(); 945 $doc->delete();
966 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); 946 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!');
967 } 947 }
968 948
969 //Отправка нового сообщения 949 //Отправка нового сообщения
970 public function new_message(Request $request) 950 public function new_message(Request $request)
971 { 951 {
972 $params = $request->all(); 952 $params = $request->all();
973 953
974 $id = $params['user_from']; 954 $id = $params['user_from'];
975 955
976 Message::add_message( 956 Message::add_message(
977 $request, 957 $request,
978 $params['user_from'], 958 $params['user_from'],
979 $params['user_to'], 959 $params['user_to'],
980 [ 960 [
981 'text' => $params['comment'] ?? null, 961 'text' => $params['comment'] ?? null,
982 'ad_employer_id' => $params['vacancy'], 962 'ad_employer_id' => $params['vacancy'],
983 'flag_new' => 1 963 'flag_new' => 1
984 ], 964 ],
985 file_store_path: "worker/$id" 965 file_store_path: "worker/$id"
986 ); 966 );
987 967
988 return response([]); 968 return response([]);
989 //return redirect(route('list-vacancies').'/#response_sent'); 969 //return redirect(route('list-vacancies').'/#response_sent');
990 } 970 }
991 971
992 972
993 public function test123(Request $request) { 973 public function test123(Request $request) {
994 $params = $request->all(); 974 $params = $request->all();
995 $user1 = $params['user_id']; 975 $user1 = $params['user_id'];
996 $user2 = $params['to_user_id']; 976 $user2 = $params['to_user_id'];
997 977
998 $rules = [ 978 $rules = [
999 'text' => 'nullable|required_without:file|min:1|max:150000', 979 'text' => 'nullable|required_without:file|min:1|max:150000',
1000 'file' => 'nullable|file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' 980 'file' => 'nullable|file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000'
1001 ]; 981 ];
1002 $messages = [ 982 $messages = [
1003 'required_without' => 'Поле «:attribute» обязательно, если файл не прикреплен', 983 'required_without' => 'Поле «:attribute» обязательно, если файл не прикреплен',
1004 'min' => [ 984 'min' => [
1005 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 985 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
1006 'integer' => 'Поле «:attribute» должно быть :min или больше', 986 'integer' => 'Поле «:attribute» должно быть :min или больше',
1007 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 987 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
1008 ], 988 ],
1009 'max' => [ 989 'max' => [
1010 'string' => 'Поле «:attribute» должно быть не больше :max символов', 990 'string' => 'Поле «:attribute» должно быть не больше :max символов',
1011 'integer' => 'Поле «:attribute» должно быть :max или меньше', 991 'integer' => 'Поле «:attribute» должно быть :max или меньше',
1012 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 992 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
1013 ] 993 ]
1014 ]; 994 ];
1015 995
1016 $validator = Validator::make($request->all(), $rules, $messages); 996 $validator = Validator::make($request->all(), $rules, $messages);
1017 997
1018 if ($validator->fails()) { 998 if ($validator->fails()) {
1019 $chat = Chat::where('user_id', $user1) 999 $chat = Chat::where('user_id', $user1)
1020 ->where('to_user_id', $user2) 1000 ->where('to_user_id', $user2)
1021 ->where('is_removed', 0) 1001 ->where('is_removed', 0)
1022 ->first() 1002 ->first()
1023 ; 1003 ;
1024 1004
1025 if ($chat->id){ 1005 if ($chat->id){
1026 return redirect()->route('worker.dialog', ['chat' => $chat->id])->withErrors($validator); 1006 return redirect()->route('worker.dialog', ['chat' => $chat->id])->withErrors($validator);
1027 } else { 1007 } else {
1028 return redirect()->route('cabinet.messages', ['type_message' => 'input'])->withErrors($validator); 1008 return redirect()->route('cabinet.messages', ['type_message' => 'input'])->withErrors($validator);
1029 } 1009 }
1030 } else { 1010 } else {
1031 $new_message = Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages'); 1011 $new_message = Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages');
1032 1012
1033 return redirect()->route('worker.dialog', ['chat' => $new_message->chat_id_from]); 1013 return redirect()->route('worker.dialog', ['chat' => $new_message->chat_id_from]);
1034 1014
1035 } 1015 }
1036 } 1016 }
1037 1017
1038 // Информация о предыдущих компаниях 1018 // Информация о предыдущих компаниях
1039 public function new_prev_company(Worker $worker) { 1019 public function new_prev_company(Worker $worker) {
1040 return view('workers.prev_company_form', compact('worker')); 1020 return view('workers.prev_company_form', compact('worker'));
1041 } 1021 }
1042 1022
1043 // Добавление контакта компании 1023 // Добавление контакта компании
1044 public function add_prev_company(PrevCompanyRequest $request) { 1024 public function add_prev_company(PrevCompanyRequest $request) {
1045 // Возвращение параметров 1025 // Возвращение параметров
1046 $all = $request->all(); 1026 $all = $request->all();
1047 PrevCompany::create($all); 1027 PrevCompany::create($all);
1048 1028
1049 return response()->json(['success' => true]); 1029 return response()->json(['success' => true]);
1050 } 1030 }
1051 1031
1052 // Редактирование контакта компании 1032 // Редактирование контакта компании
1053 public function edit_prev_company(PrevCompany $doc, Worker $worker) { 1033 public function edit_prev_company(PrevCompany $doc, Worker $worker) {
1054 return view('workers.prev_company_edit_form', compact('doc', 'worker')); 1034 return view('workers.prev_company_edit_form', compact('doc', 'worker'));
1055 } 1035 }
1056 1036
1057 //Сохранение редактирования контакта компании 1037 //Сохранение редактирования контакта компании
1058 public function update_prev_company(PrevCompany $doc, Request $request){ 1038 public function update_prev_company(PrevCompany $doc, Request $request){
1059 $all = $request->all(); 1039 $all = $request->all();
1 <?php 1 <?php
2 2
3 namespace App\Models; 3 namespace App\Models;
4 4
5 // use Illuminate\Contracts\Auth\MustVerifyEmail; 5 // use Illuminate\Contracts\Auth\MustVerifyEmail;
6 use Illuminate\Database\Eloquent\Factories\HasFactory; 6 use Illuminate\Database\Eloquent\Factories\HasFactory;
7 use Illuminate\Foundation\Auth\User as Authenticatable; 7 use Illuminate\Foundation\Auth\User as Authenticatable;
8 use Illuminate\Notifications\Notifiable; 8 use Illuminate\Notifications\Notifiable;
9 use JsonException;
9 use Laravel\Sanctum\HasApiTokens; 10 use Laravel\Sanctum\HasApiTokens;
10 11
11 class User extends Authenticatable 12 class User extends Authenticatable
12 { 13 {
13 use HasApiTokens, HasFactory, Notifiable; 14 use HasApiTokens, HasFactory, Notifiable;
14 15
15 /** 16 /**
16 * The attributes that are mass assignable. 17 * The attributes that are mass assignable.
17 * 18 *
18 * @var array<int, string> 19 * @var array<int, string>
19 */ 20 */
20 21
21 protected $fillable = [ 22 protected $fillable = [
22 'name', 23 'name',
23 'email', 24 'email',
24 'password', 25 'password',
25 'admin', 26 'admin',
26 'telephone', 27 'telephone',
27 'surname', 28 'surname',
28 'name_man', 29 'name_man',
29 'surname2', 30 'surname2',
30 'is_worker', 31 'is_worker',
31 'is_lookin', 32 'is_lookin',
32 'is_message', 33 'is_message',
33 'is_public', 34 'is_public',
34 'is_worker', 35 'is_worker',
35 'is_remove', 36 'is_remove',
36 'is_ban', 37 'is_ban',
37 'is_new', 38 'is_new',
38 'is_bd', 39 'is_bd',
39 'email_verified_at', 40 'email_verified_at',
40 'created_at', 41 'created_at',
41 'updated_at', 42 'updated_at',
42 'birthday', 43 'birthday',
43 'file', 44 'file',
44 'pubpassword', 45 'pubpassword',
45 'is_manager', 46 'is_manager',
46 'subscribe_email', 47 'subscribe_email',
47 'subscribe', 48 'subscribe',
48 ]; 49 ];
49 50
50 /** 51 /**
51 * The attributes that should be hidden for serialization. 52 * The attributes that should be hidden for serialization.
52 * 53 *
53 * @var array<int, string> 54 * @var array<int, string>
54 */ 55 */
55 protected $hidden = [ 56 protected $hidden = [
56 'password', 57 'password',
57 'remember_token', 58 'remember_token',
58 ]; 59 ];
59 60
60 /** 61 /**
61 * The attributes that should be cast. 62 * The attributes that should be cast.
62 * 63 *
63 * @var array<string, string> 64 * @var array<string, string>
64 */ 65 */
65 protected $casts = [ 66 protected $casts = [
66 'email_verified_at' => 'datetime', 67 'email_verified_at' => 'datetime',
67 ]; 68 ];
68 69
69 /* 70 /*
70 * Связь Пользователей системы с работодателями 71 * Связь Пользователей системы с работодателями
71 * users - employers 72 * users - employers
72 */ 73 */
73 public function employers() { 74 public function employers() {
74 return $this->hasMany(Employer::class, 'user_id'); 75 return $this->hasMany(Employer::class, 'user_id');
75 } 76 }
76 77
77 /* 78 /*
78 * Связь Пользователей системы с работниками 79 * Связь Пользователей системы с работниками
79 * users - workers 80 * users - workers
80 */ 81 */
81 public function workers() { 82 public function workers() {
82 return $this->hasMany(Worker::class, 'user_id'); 83 return $this->hasMany(Worker::class, 'user_id');
83 } 84 }
84 85
85 /* 86 /*
86 * Связь Пользователей системы с работниками 87 * Связь Пользователей системы с работниками
87 * users - workers 88 * users - workers
88 */ 89 */
89 public function work() { 90 public function work() {
90 return $this->hasMany(Worker::class, 'user_id')->select('telephone', 'email', 'position_work', 'persent_anketa'); 91 return $this->hasMany(Worker::class, 'user_id')
92 ->select('telephone', 'email', 'position_work', 'persent_anketa');
91 } 93 }
92 94
93 /* 95 /*
94 * Связь Модели Пользователей(Users) с Группами (Group_users) 96 * Связь Модели Пользователей(Users) с Группами (Group_users)
95 * users - group_users 97 * users - group_users
96 многие-ко-многим 98 многие-ко-многим
97 */ 99 */
98 public function ingroup() { 100 public function ingroup() {
99 return $this->belongsToMany(Group_user::class, 'group_works'); 101 return $this->belongsToMany(Group_user::class, 'group_works');
100 } 102 }
101 103
102 /* 104 /*
103 * Связь Пользователей системы с ссобщениями 105 * Связь Пользователей системы с ссобщениями
104 * users - messages 106 * users - messages
105 */ 107 */
106 public function messages() { 108 public function messages() {
107 return $this->hasMany(Message::class); 109 return $this->hasMany(Message::class);
108 } 110 }
109 111
110 /* 112 /*
111 * Связь Пользователей системы с статистика 113 * Связь Пользователей системы с статистика
112 * users - static_workers 114 * users - static_workers
113 */ 115 */
114 public function static_user() { 116 public function static_user() {
115 return $this->hasMany(Static_worker::class); 117 return $this->hasMany(Static_worker::class);
116 } 118 }
117 119
118 /* 120 /*
119 * Связь модели Юзеры (users) с моделью Группы пользователей (Group_works) 121 * Связь модели Юзеры (users) с моделью Группы пользователей (Group_works)
120 один-ко-многим 122 один-ко-многим
121 */ 123 */
122 public function peoples() { 124 public function peoples() {
123 return $this->hasMany(Group_works::class); 125 return $this->hasMany(Group_works::class);
124 } 126 }
125 127
126 /* 128 /*
127 * Связь Модели Пользователей(Users) с Группами (Group_users) 129 * Связь Модели Пользователей(Users) с Группами (Group_users)
128 * users - group_users 130 * users - group_users
129 многие-ко-многим 131 многие-ко-многим
130 */ 132 */
131 public function jobtitles() { 133 public function jobtitles() {
132 return $this->belongsToMany(Job_title::class, 'workers', 'user_id', 'position_work'); 134 return $this->belongsToMany(Job_title::class, 'workers', 'user_id', 'position_work');
133 } 135 }
134 136
135 public function scopeActive($query) { 137 public function scopeActive($query) {
136 return $query->where('is_remove', '=', '0'); 138 return $query->where('is_remove', '=', '0');
137 } 139 }
138 140
139 public function scopeWorker($query) { 141 public function scopeWorker($query) {
140 return $query->where('is_worker', '=', '1'); 142 return $query->where('is_worker', '=', '1');
141 } 143 }
142 144
143 public function scopeBaseuser($query) { 145 public function scopeBaseuser($query) {
144 return $query->where('is_bd', '=', '1'); 146 return $query->where('is_bd', '=', '1');
145 } 147 }
146 148
147 public function scopeRealuser($query) { 149 public function scopeRealuser($query) {
148 return $query->where('is_bd', '=', '0'); 150 return $query->where('is_bd', '=', '0');
149 } 151 }
150 152
151 public function scopeAdmin($query) { 153 public function scopeAdmin($query) {
152 return $query->where('admin', '=', '1'); 154 return $query->where('admin', '=', '1');
153 } 155 }
154 156
155 public function scopeNotadmin($query) { 157 public function scopeNotadmin($query) {
156 return $query->where('admin', '=', '0'); 158 return $query->where('admin', '=', '0');
157 } 159 }
158 160
161 /**
162 * @throws JsonException
163 */
164 public function getJobAttribute(): ?string
165 {
166 $positions = $this->workers[0]?->positions_work;
167 if (is_string($positions)) {
168 $jobIds = json_decode($positions, true, 512, JSON_THROW_ON_ERROR);
169 } else {
170 $jobIds = $positions;
171 }
172
173 if ($jobIds !== null && count($jobIds) > 0) {
174 return Job_title::whereIn('id', $jobIds)->first()->name;
175 }
176 return null;
177 }
178
159 } 179 }
160 180
resources/views/admin/worker/edit.blade.php
1 <?php 1 <?php
2 use Illuminate\Support\Facades\Storage; 2 use Illuminate\Support\Facades\Storage;
3 ?> 3 ?>
4 @extends('layout.admin', ['title' => 'Админка - Редактирование соискателя']) 4 @extends('layout.admin', ['title' => 'Админка - Редактирование соискателя'])
5 5
6 @section('content') 6 @section('content')
7 <h4 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"> 7 <h4 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300">
8 Соискатель-пользователь: <a style="text-decoration: underline;" href="{{ route('admin.user-profile', ['user' => $worker->user_id]) }}">"{{$worker->users->surname}} {{$worker->users->name_man}} {{$worker->users->surname2}} ({{$worker->user_id}})"</a> 8 Соискатель-пользователь: <a style="text-decoration: underline;" href="{{ route('admin.user-profile', ['user' => $worker->user_id]) }}">"{{$worker->users->surname}} {{$worker->users->name_man}} {{$worker->users->surname2}} ({{$worker->user_id}})"</a>
9 </h4> 9 </h4>
10 <form method="POST" action=""> 10 <form method="POST" action="">
11 @csrf 11 @csrf
12 <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> 12 <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800">
13 <div class="tabs"> 13 <div class="tabs">
14 <input type="radio" name="tab-btn" id="tab-btn-1" value="" checked> 14 <input type="radio" name="tab-btn" id="tab-btn-1" value="" checked>
15 <label for="tab-btn-1">Общие настройки</label> 15 <label for="tab-btn-1">Общие настройки</label>
16 <input type="radio" name="tab-btn" id="tab-btn-2" value=""> 16 <input type="radio" name="tab-btn" id="tab-btn-2" value="">
17 <label for="tab-btn-2">Анкета</label> 17 <label for="tab-btn-2">Анкета</label>
18 <!--<input type="radio" name="tab-btn" id="tab-btn-3" value="">
19 <label for="tab-btn-3">Вкладка 3</label>-->
20 <div id="content-1"> 18 <div id="content-1">
19
21 <label class="block text-sm"> 20 <label class="block text-sm">
22 <span class="text-gray-700 dark:text-gray-400">Должность соискателя</span> 21 <span class="text-gray-700 dark:text-gray-400">Должность</span>
23 <select name="position_work" id="position_work" class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-select focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"> 22 <select
24 @foreach($job_titles as $job) 23 name="positions_work[]"
25 <option value="{{ $job->id }}" 24 id="positions_work[]"
26 @if($worker->position_work == $job->id) 25 data-placeholder="Выберите должность"
27 selected 26 {{--multiple="multiple"--}}
28 @endif 27 class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-select focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
29 >{{ $job->name }} ({{ $job->id }})</option> 28 >
29 <option value="{{ null }}">
30 Не выбрано
31 </option>
32 @foreach($job_titles as $job_title)
33 <option value="{{ $job_title->id }}"
34 @if ($worker?->positions_work && in_array($job_title->id , $worker->positions_work))
35 selected
36 @endif
37 >
38 {{ $job_title->name }} ({{ $job_title->id }})
39 </option>
30 @endforeach 40 @endforeach
31 </select> 41 </select>
32 @error('position_work') 42 @error('positions_work')
33 <span class="text-xs text-red-600 dark:text-red-400"> 43 <span class="text-xs text-red-600 dark:text-red-400">
34 {{ $message }} 44 {{ $message }}
35 </span> 45 </span>
36 @enderror 46 @enderror
37 </label><br> 47 </label>
38 48 <br>
39 <label class="block text-sm"> 49 <label class="block text-sm">
40 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Избранный кандидат </p> 50 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Избранный кандидат </p>
41 <input type="hidden" name="favorite_user" value="0" /> 51 <input type="hidden" name="favorite_user" value="0" />
42 <input name="favorite_user" <? if ($worker->favorite_user) echo "checked";?> 52 <input name="favorite_user" <?= $worker->favorite_user ? "checked" : '';?>
43 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray " 53 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray "
44 placeholder="" type="checkbox" value="1" 54 placeholder="" type="checkbox" value="1"
45 /><br> 55 /><br>
46 56
47 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Срочный кандидат</p> 57 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Срочный кандидат</p>
48 <input type="hidden" name="sroch_user" value="0" /> 58 <input type="hidden" name="sroch_user" value="0" />
49 <input name="sroch_user" id="sroch_user" <? if ($worker->sroch_user) echo "checked";?> 59 <input name="sroch_user" id="sroch_user" <?= $worker->sroch_user ? "checked" : '';?>
50 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray " 60 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray "
51 placeholder="" type="checkbox" value="1" 61 placeholder="" type="checkbox" value="1"
52 /><br> 62 /><br>
53 63
54 </label> 64 </label>
55 65 <br>
56 <label class="block text-sm"> 66 <label class="block text-sm">
57 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Анкета действительна до <span style="color:#333">{{ $time_end_anketa }}</span></p> 67 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Анкета действительна до <span style="color:#333">{{ $time_end_anketa }}</span></p>
58 68
59 </label><br> 69 </label>
70 <br>
60 </div> 71 </div>
61 <div id="content-2"> 72 <div id="content-2">
62 <label class="block text-sm"> 73 <label class="block text-sm">
63 <span class="text-gray-700 dark:text-gray-400">Email</span> 74 <span class="text-gray-700 dark:text-gray-400">Email</span>
64 <input name="email" id="email" 75 <input name="email" id="email"
65 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 76 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
66 placeholder="Почта" value="{{ old('email') ?? $worker->email ?? '' }}" 77 placeholder="Почта" value="{{ old('email') ?? $worker->email ?? '' }}"
67 /> 78 />
68 @error('email') 79 @error('email')
69 <span class="text-xs text-red-600 dark:text-red-400"> 80 <span class="text-xs text-red-600 dark:text-red-400">
70 {{ $message }} 81 {{ $message }}
71 </span> 82 </span>
72 @enderror 83 @enderror
73 </label><br> 84 </label><br>
74 85
75 <label class="block text-sm"> 86 <label class="block text-sm">
76 <span class="text-gray-700 dark:text-gray-400">Телефон</span> 87 <span class="text-gray-700 dark:text-gray-400">Телефон</span>
77 <input name="telephone" id="telephone" 88 <input name="telephone" id="telephone"
78 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 89 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
79 placeholder="Телефон" value="{{ old('telephone') ?? $worker->telephone ?? '' }}" 90 placeholder="Телефон" value="{{ old('telephone') ?? $worker->telephone ?? '' }}"
80 /> 91 />
81 @error('telephone') 92 @error('telephone')
82 <span class="text-xs text-red-600 dark:text-red-400"> 93 <span class="text-xs text-red-600 dark:text-red-400">
83 {{ $message }} 94 {{ $message }}
84 </span> 95 </span>
85 @enderror 96 @enderror
86 </label><br> 97 </label><br>
87 98
88 <label class="block text-sm"> 99 <label class="block text-sm">
89 <span class="text-gray-700 dark:text-gray-400">Адрес</span> 100 <span class="text-gray-700 dark:text-gray-400">Адрес</span>
90 <input name="address" id="address" 101 <input name="address" id="address"
91 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 102 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
92 placeholder="Адрес" value="{{ old('address') ?? $worker->address ?? '' }}" 103 placeholder="Адрес" value="{{ old('address') ?? $worker->address ?? '' }}"
93 /> 104 />
94 @error('address') 105 @error('address')
95 <span class="text-xs text-red-600 dark:text-red-400"> 106 <span class="text-xs text-red-600 dark:text-red-400">
96 {{ $message }} 107 {{ $message }}
97 </span> 108 </span>
98 @enderror 109 @enderror
99 </label><br> 110 </label><br>
100 111
101 <label class="block text-sm"> 112 <label class="block text-sm">
102 <span class="text-gray-700 dark:text-gray-400">Город</span> 113 <span class="text-gray-700 dark:text-gray-400">Город</span>
103 <input name="city" id="city" 114 <input name="city" id="city"
104 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 115 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
105 placeholder="Город" value="{{ old('city') ?? $worker->city ?? '' }}" 116 placeholder="Город" value="{{ old('city') ?? $worker->city ?? '' }}"
106 /> 117 />
107 @error('city') 118 @error('city')
108 <span class="text-xs text-red-600 dark:text-red-400"> 119 <span class="text-xs text-red-600 dark:text-red-400">
109 {{ $message }} 120 {{ $message }}
110 </span> 121 </span>
111 @enderror 122 @enderror
112 </label><br> 123 </label><br>
113 124
114 <label class="block text-sm"> 125 <label class="block text-sm">
115 <span class="text-gray-700 dark:text-gray-400">Фото</span> 126 <span class="text-gray-700 dark:text-gray-400">Фото</span>
116 127
117 <input name="photo" id="photo" type="file" 128 <input name="photo" id="photo" type="file"
118 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 129 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
119 placeholder="Фото" value="" 130 placeholder="Фото" value=""
120 /> 131 />
121 @isset($worker->photo) 132 @isset($worker->photo)
122 <img src="<?=asset(Storage::url($worker->photo))?>" width="150"/> 133 <img src="<?=asset(Storage::url($worker->photo))?>" width="150"/>
123 @endisset 134 @endisset
124 @error('logo') 135 @error('logo')
125 <span class="text-xs text-red-600 dark:text-red-400"> 136 <span class="text-xs text-red-600 dark:text-red-400">
126 {{ $message }} 137 {{ $message }}
127 </span> 138 </span>
128 @enderror 139 @enderror
129 </label><br> 140 </label><br>
130 141
131 <label class="block text-sm"> 142 <label class="block text-sm">
132 <span class="text-gray-700 dark:text-gray-400">Согласие на рассылку</span> 143 <span class="text-gray-700 dark:text-gray-400">Согласие на рассылку</span>
133 <input type="hidden" name="email_data" value="0" /> 144 <input type="hidden" name="email_data" value="0" />
134 <input name="email_data" id="email_data" @php if ($worker->email_data) echo "checked"; @endphp 145 <input name="email_data" id="email_data" @php if ($worker->email_data) echo "checked"; @endphp
135 placeholder="" 146 placeholder=""
136 type="checkbox" 147 type="checkbox"
137 value="1" 148 value="1"
138 /> 149 />
139 </label> 150 </label>
140 151
141 <label class="block mt-4 text-sm"> 152 <label class="block mt-4 text-sm">
142 <span class="text-gray-700 dark:text-gray-400">Об соискателе</span> 153 <span class="text-gray-700 dark:text-gray-400">Об соискателе</span>
143 <textarea name="text" id="text" 154 <textarea name="text" id="text"
144 class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-textarea focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" 155 class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-textarea focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
145 rows="3" 156 rows="3"
146 placeholder="О соискателе" 157 placeholder="О соискателе"
147 >{{ old('text') ?? $worker->text ?? '' }}</textarea> 158 >{{ old('text') ?? $worker->text ?? '' }}</textarea>
148 </label> 159 </label>
149 </div> 160 </div>
150 <div id="content-3"> 161 </div>
151 162 <br>
152 </div>
153 </div><br>
154
155 <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> 163 <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4">
156 <div> 164 <div>
157 <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"> 165 <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
158 Сохранить 166 Сохранить
159 </button> 167 </button>
160 <a href="{{ route('admin.workers') }}" 168 <a href="{{ route('admin.workers') }}"
161 class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" 169 class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"
162 style="display: -webkit-inline-box; height: 30px!important;" 170 style="display: -webkit-inline-box; height: 30px!important;"
163 >Назад</a> 171 >Назад</a>
164 </div> 172 </div>
165 </div> 173 </div>
166 </div> 174 </div>
167 </form> 175 </form>
168 <!--
169 <label class="block mt-4 text-sm">
170 <span class="text-gray-700 dark:text-gray-400">
171 Requested Limit
172 </span>
173 <select
174 class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-select focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
175 >
176 <option>$1,000</option>
177 <option>$5,000</option>
178 <option>$10,000</option>
179 <option>$25,000</option>
180 </select>
181 </label>
182
183 <label class="block mt-4 text-sm">
184 <span class="text-gray-700 dark:text-gray-400">
185 Multiselect
186 </span>
187 <select
188 class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-multiselect focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
189 multiple
190 >
191 <option>Option 1</option>
192 <option>Option 2</option>
193 <option>Option 3</option>
194 <option>Option 4</option>
195 <option>Option 5</option>
196 </select>
197 </label>
198
199 <label class="block mt-4 text-sm">
200 <span class="text-gray-700 dark:text-gray-400">Message</span>
201 <textarea
202 class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-textarea focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
203 rows="3"
204 placeholder="Enter some long form content."
205 ></textarea>
206 </label>
207
208 <div class="flex mt-6 text-sm">
209 <label class="flex items-center dark:text-gray-400">
210 <input
211 type="checkbox"
212 class="text-purple-600 form-checkbox focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
213 />
214 <span class="ml-2">
215 I agree to the
216 <span class="underline">privacy policy</span>
217 </span>
218 </label>
219 </div>
220 </div>
221
222 <!-- Validation inputs -->
223 <!--<h4
224 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"
225 >
226 Validation
227 </h4>
228 <div
229 class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"
230 >
231 <!-- Invalid input -->
232 <!--<label class="block text-sm">
233 <span class="text-gray-700 dark:text-gray-400">
234 Invalid input
235 </span>
236 <input
237 class="block w-full mt-1 text-sm border-red-600 dark:text-gray-300 dark:bg-gray-700 focus:border-red-400 focus:outline-none focus:shadow-outline-red form-input"
238 placeholder="Jane Doe"
239 />
240 <span class="text-xs text-red-600 dark:text-red-400">
241 Your password is too short.
242 </span>
243 </label>
244
245 <!-- Valid input -->
246 <!--<label class="block mt-4 text-sm">
247 <span class="text-gray-700 dark:text-gray-400">
248 Valid input
249 </span>
250 <input
251 class="block w-full mt-1 text-sm border-green-600 dark:text-gray-300 dark:bg-gray-700 focus:border-green-400 focus:outline-none focus:shadow-outline-green form-input"
252 placeholder="Jane Doe"
253 />
254 <span class="text-xs text-green-600 dark:text-green-400">
255 Your password is strong.
256 </span>
257 </label>
258
259 <!-- Helper text -->
260 <!--<label class="block mt-4 text-sm">
261 <span class="text-gray-700 dark:text-gray-400">
262 Helper text
263 </span>
264 <input
265 class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input"
266 placeholder="Jane Doe"
267 />
268 <span class="text-xs text-gray-600 dark:text-gray-400">
269 Your password must be at least 6 characters long.
270 </span>
271 </label>
272 </div>
273
274 <!-- Inputs with icons -->
275 <!--<h4
276 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"
277 >
278 Icons
279 </h4>
280 <div
281 class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"
282 >
283 <label class="block text-sm">
284 <span class="text-gray-700 dark:text-gray-400">Icon left</span>
285 <!-- focus-within sets the color for the icon when input is focused -->
286 <!--<div
287 class="relative text-gray-500 focus-within:text-purple-600 dark:focus-within:text-purple-400"
288 >
289 <input
290 class="block w-full pl-10 mt-1 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input"
291 placeholder="Jane Doe"
292 />
293 <div
294 class="absolute inset-y-0 flex items-center ml-3 pointer-events-none"
295 >
296 <svg
297 class="w-5 h-5"
298 aria-hidden="true"
299 fill="none"
300 stroke-linecap="round"
301 stroke-linejoin="round"
302 stroke-width="2"
303 viewBox="0 0 24 24"
304 stroke="currentColor"
305 >
306 <path
307 d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
308 ></path>
309 </svg>
310 </div>
311 </div>
312 </label>
313
314 <label class="block mt-4 text-sm">
315 <span class="text-gray-700 dark:text-gray-400">Icon right</span>
316 <!-- focus-within sets the color for the icon when input is focused -->
317 <!--<div
318 class="relative text-gray-500 focus-within:text-purple-600 dark:focus-within:text-purple-400"
319 >
320 <input
321 class="block w-full pr-10 mt-1 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input"
322 placeholder="Jane Doe"
323 />
324 <div
325 class="absolute inset-y-0 right-0 flex items-center mr-3 pointer-events-none"
326 >
327 <svg
328 class="w-5 h-5"
329 aria-hidden="true"
330 fill="none"
331 stroke-linecap="round"
332 stroke-linejoin="round"
333 stroke-width="2"
334 viewBox="0 0 24 24"
335 stroke="currentColor"
336 >
337 <path
338 d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
339 ></path>
340 </svg>
341 </div>
342 </div>
343 </label>
344 </div>
345
346 <!-- Inputs with buttons -->
347 <!--<h4
348 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"
349 >
350 Buttons
351 </h4>
352 <div
353 class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"
354 >
355 <label class="block text-sm">
356 <span class="text-gray-700 dark:text-gray-400">
357 Button left
358 </span>
359 <div class="relative">
360 <input
361 class="block w-full pl-20 mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input"
362 placeholder="Jane Doe"
363 />
364 <button
365 class="absolute inset-y-0 px-4 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-l-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
366 >
367 Click
368 </button>
369 </div>
370 </label>
371
372 <label class="block mt-4 text-sm">
373 <span class="text-gray-700 dark:text-gray-400">
374 Button right
375 </span>
376 <div
377 class="relative text-gray-500 focus-within:text-purple-600"
378 >
379 <input
resources/views/admin/worker/index.blade.php
1 @extends('layout.admin', ['title' => 'Админка - Работники']) 1 @extends('layout.admin', ['title' => 'Админка - Работники'])
2 2
3 @section('script') 3 @section('script')
4 <script> 4 <script>
5 $(document).ready(function() { 5 $(document).ready(function() {
6 $(document).on('click', '.checkban', function () { 6 $(document).on('click', '.checkban', function () {
7 var this_ = $(this); 7 var this_ = $(this);
8 var value = this_.val(); 8 var value = this_.val();
9 var ajax_block = $('#ajax_block'); 9 var ajax_block = $('#ajax_block');
10 var bool = 0; 10 var bool = 0;
11 11
12 if(this.checked){ 12 if(this.checked){
13 bool = 1; 13 bool = 1;
14 } else { 14 } else {
15 bool = 0; 15 bool = 0;
16 } 16 }
17 17
18 $.ajax({ 18 $.ajax({
19 type: "GET", 19 type: "GET",
20 url: "{{ url()->full()}}", 20 url: "{{ url()->full()}}",
21 data: "id=" + value + "&is_ban=" + bool, 21 data: "id=" + value + "&is_ban=" + bool,
22 success: function (data) { 22 success: function (data) {
23 console.log('Обновление таблицы работников '); 23 console.log('Обновление таблицы работников ');
24 //data = JSON.parse(data); 24 //data = JSON.parse(data);
25 console.log(data); 25 console.log(data);
26 ajax_block.html(data); 26 ajax_block.html(data);
27 }, 27 },
28 headers: { 28 headers: {
29 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 29 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
30 }, 30 },
31 error: function (data) { 31 error: function (data) {
32 console.log('Error: ' + data); 32 console.log('Error: ' + data);
33 } 33 }
34 }); 34 });
35 }); 35 });
36 36
37 }); 37 });
38 </script> 38 </script>
39 @endsection 39 @endsection
40 40
41 @section('search') 41 @section('search')
42 @include('admin.find_worker', ['find_status_work' => $find_status_work]) 42 @include('admin.find_worker', ['find_status_work' => $find_status_work])
43 @endsection 43 @endsection
44 44
45 @section('content') 45 @section('content')
46 <div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-4"> 46 <div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-4">
47 47
48 <div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800"> 48 <div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
49 <div class="p-3 mr-4 text-orange-500 bg-orange-100 rounded-full dark:text-orange-100 dark:bg-orange-500"> 49 <div class="p-3 mr-4 text-orange-500 bg-orange-100 rounded-full dark:text-orange-100 dark:bg-orange-500">
50 <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> 50 <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
51 <path 51 <path
52 d="M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z"></path> 52 d="M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z"></path>
53 </svg> 53 </svg>
54 </div> 54 </div>
55 <div> 55 <div>
56 <p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400"> 56 <p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">
57 Всего соискателей 57 Всего соискателей
58 </p> 58 </p>
59 <p class="text-lg font-semibold text-gray-700 dark:text-gray-200"> 59 <p class="text-lg font-semibold text-gray-700 dark:text-gray-200">
60 {{ $all_worker }} 60 {{ $all_worker }}
61 </p> 61 </p>
62 </div> 62 </div>
63 </div> 63 </div>
64 </div> 64 </div>
65 65
66 <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> 66 <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block">
67 <div class="w-full overflow-x-auto"> 67 <div class="w-full overflow-x-auto">
68 <table class="w-full whitespace-no-wrap"> 68 <table class="w-full whitespace-no-wrap">
69 <thead> 69 <thead>
70 <tr 70 <tr
71 class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800" 71 class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800"
72 > 72 >
73 <th class="px-4 py-3">№</th> 73 <th class="px-4 py-3">№</th>
74 <th class="px-4 py-3">Лого</th> 74 <th class="px-4 py-3">Лого</th>
75 <th class="px-4 py-3">ФИО/Email/Телефон</th> 75 <th class="px-4 py-3">ФИО/Email/Телефон</th>
76 <th class="px-4 py-3">Статус</th> 76 <th class="px-4 py-3">Статус</th>
77 <th class="px-4 py-3">% анкеты</th> 77 <th class="px-4 py-3">% анкеты</th>
78 <th class="px-4 py-3">Должность</th> 78 <th class="px-4 py-3">Должность</th>
79 <th class="px-4 py-3">Дата регистрации</th> 79 <th class="px-4 py-3">Дата регистрации</th>
80 <th class="px-4 py-3">Изменить</th> 80 <th class="px-4 py-3">Изменить</th>
81 </tr> 81 </tr>
82 </thead> 82 </thead>
83 <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> 83 <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800">
84 @foreach($users as $user) 84 @foreach($users as $user)
85 @if (!isset($user->workers[0])) 85 @if (!isset($user->workers[0]))
86 @continue(1) 86 @continue(1)
87 @endif 87 @endif
88 <tr class="text-gray-700 dark:text-gray-400"> 88 <tr class="text-gray-700 dark:text-gray-400">
89 <td class="px-4 py-3 text-xs"> 89 <td class="px-4 py-3 text-xs">
90 {{$user->id}} 90 {{$user->id}}
91 </td> 91 </td>
92 <td class="px-4 py-3 text-xs"> 92 <td class="px-4 py-3 text-xs">
93 @if (isset($user->workers[0]->photo)) 93 @if (isset($user->workers[0]->photo))
94 <div class="flex items-center text-sm"> 94 <div class="flex items-center text-sm">
95 <div 95 <div
96 class="relative hidden w-8 h-8 mr-3 rounded-full md:block" 96 class="relative hidden w-8 h-8 mr-3 rounded-full md:block"
97 > 97 >
98 <img 98 <img
99 class="object-cover w-full h-full rounded-full" 99 class="object-cover w-full h-full rounded-full"
100 src="{{ asset(Storage::url($user->workers[0]->photo)) }}" 100 src="{{ asset(Storage::url($user->workers[0]->photo)) }}"
101 alt="" 101 alt=""
102 loading="lazy" 102 loading="lazy"
103 /> 103 />
104 <div 104 <div
105 class="absolute inset-0 rounded-full shadow-inner" 105 class="absolute inset-0 rounded-full shadow-inner"
106 aria-hidden="true" 106 aria-hidden="true"
107 ></div> 107 ></div>
108 </div> 108 </div>
109 </div> 109 </div>
110 @else 110 @else
111 - 111 -
112 @endif 112 @endif
113 </td> 113 </td>
114 114
115 <td class="px-4 py-3 text-xs"> 115 <td class="px-4 py-3 text-xs">
116 <div class="flex items-center text-sm"> 116 <div class="flex items-center text-sm">
117 <div> 117 <div>
118 <p class="font-semibold"> 118 <p class="font-semibold">
119 @if (isset($user->id)) 119 @if (isset($user->id))
120 <a style="text-decoration: underline;" href="{{ route('admin.user-profile', ['user' => $user->id]) }}}">{{ $user->surname }} {{ !empty($user->name_man) ? $user->name_man : $user->name }} {{ $user->surname2 }}</a> 120 <a style="text-decoration: underline;" href="{{ route('admin.user-profile', ['user' => $user->id]) }}}">{{ $user->surname }} {{ !empty($user->name_man) ? $user->name_man : $user->name }} {{ $user->surname2 }}</a>
121 @else 121 @else
122 {{ $user->surname }} {{ !empty($user->name_man) ? $user->name_man : $user->name }} {{ $user->surname2 }} 122 {{ $user->surname }} {{ !empty($user->name_man) ? $user->name_man : $user->name }} {{ $user->surname2 }}
123 @endif 123 @endif
124 </p> 124 </p>
125 <p class="font-semibold">{{ empty($user->workers->email) ? $user->email : $user->workers->email }}</p> 125 <p class="font-semibold">{{ empty($user->workers->email) ? $user->email : $user->workers->email }}</p>
126 <p class="text-xs text-gray-600 dark:text-gray-400"> 126 <p class="text-xs text-gray-600 dark:text-gray-400">
127 {{ empty($user->workers->telephone) ? $user->telephone : $user->workers->telephone }} 127 {{ empty($user->workers->telephone) ? $user->telephone : $user->workers->telephone }}
128 </p> 128 </p>
129 </div> 129 </div>
130 </div> 130 </div>
131 </td> 131 </td>
132 132
133 <td class="px-4 py-3 text-xs"> 133 <td class="px-4 py-3 text-xs">
134 @if (isset($user->workers[0]->status_work)) 134 @if (isset($user->workers[0]->status_work))
135 {{ $status_wor[$user->workers[0]->status_work] }} 135 {{ $status_wor[$user->workers[0]->status_work] }}
136 @else 136 @else
137 - 137 -
138 @endif 138 @endif
139 </td> 139 </td>
140 140
141 <td class="px-4 py-3 text-xs"> 141 <td class="px-4 py-3 text-xs">
142 <span class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full @if(($persent = \App\Classes\Tools::getWorkerProfilePercent($user->workers[0])) > 50) dark:bg-green-700 dark:text-green-100 @else dark:text-white dark:bg-orange-600 @endif"> 142 <span class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full @if(($persent = \App\Classes\Tools::getWorkerProfilePercent($user->workers[0])) > 50) dark:bg-green-700 dark:text-green-100 @else dark:text-white dark:bg-orange-600 @endif">
143 {{ $persent }}% 143 {{ $persent }}%
144 </span> 144 </span>
145 </td> 145 </td>
146 146
147 <td class="px-4 py-3 text-xs"> 147 <td class="px-4 py-3 text-xs">
148 @if (isset($user->jobtitles[0]->name)) 148 @if ($user->job !== null)
149 {{ $user->jobtitles[0]->name }} 149 {{ $user->job }}
150 @else 150 @else
151 Не задана 151 Не задана
152 @endif 152 @endif
153 </td> 153 </td>
154 <td class="px-4 py-3 text-xs"> 154 <td class="px-4 py-3 text-xs">
155 {{ date('d.m.Y h:i:s', strtotime($user->created_at)) }} 155 {{ date('d.m.Y h:i:s', strtotime($user->created_at)) }}
156 </td> 156 </td>
157 <td class="px-4 py-3 text-xs"> 157 <td class="px-4 py-3 text-xs">
158 @if (isset($user->workers[0]->id)) 158 @if (isset($user->workers[0]->id))
159 <a href="{{ route('admin.worker-profile-edit', ['worker' => $user->workers[0]->id]) }}">Изменить</a> 159 <a href="{{ route('admin.worker-profile-edit', ['worker' => $user->workers[0]->id]) }}">Изменить</a>
160 160
161 @endif 161 @endif
162 </td> 162 </td>
163 </tr> 163 </tr>
164 @endforeach 164 @endforeach
165 </tbody> 165 </tbody>
166 </table> 166 </table>
167 </div> 167 </div>
168 168
169 <div class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800"> 169 <div class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800">
170 <?=$users->appends($_GET)->links('admin.pagginate'); ?> 170 <?=$users->appends($_GET)->links('admin.pagginate'); ?>
171 </div> 171 </div>
172
173
174 <!--<div
175 class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800"
176 >
177 <span class="flex items-center col-span-3">
178 Showing 21-30 of 100
179 </span>
180 <span class="col-span-2"></span>
181
182 <span class="flex col-span-4 mt-2 sm:mt-auto sm:justify-end">
183 <nav aria-label="Table navigation">
184 <ul class="inline-flex items-center">
185 <li>
186 <button
187 class="px-3 py-1 rounded-md rounded-l-lg focus:outline-none focus:shadow-outline-purple"
188 aria-label="Previous"
189 >
190 <svg
191 aria-hidden="true"
192 class="w-4 h-4 fill-current"
193 viewBox="0 0 20 20"
194 >
195 <path
196 d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"
197 clip-rule="evenodd"
198 fill-rule="evenodd"
199 ></path>
200 </svg>
201 </button>
202 </li>
203 <li>
204 <button
205 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
206 >
207 1
208 </button>
209 </li>
210 <li>
211 <button
212 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
213 >
214 2
215 </button>
216 </li>
217 <li>
218 <button
219 class="px-3 py-1 text-white transition-colors duration-150 bg-purple-600 border border-r-0 border-purple-600 rounded-md focus:outline-none focus:shadow-outline-purple"
220 >
221 3
222 </button>
223 </li>
224 <li>
225 <button
226 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
227 >
228 4
229 </button>
230 </li>
231 <li>
232 <span class="px-3 py-1">...</span>
233 </li>
234 <li>
235 <button
236 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
237 >
238 8
239 </button>
240 </li>
241 <li>
242 <button
243 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
244 >
245 9
246 </button>
247 </li>
248 <li>
249 <button
250 class="px-3 py-1 rounded-md rounded-r-lg focus:outline-none focus:shadow-outline-purple"
251 aria-label="Next"
252 >
253 <svg
254 class="w-4 h-4 fill-current"
255 aria-hidden="true"
256 viewBox="0 0 20 20"
257 >
258 <path
259 d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
260 clip-rule="evenodd"
261 fill-rule="evenodd"
262 ></path>
263 </svg>
264 </button>
265 </li>
266 </ul>
267 </nav>
268 </span>
269 </div>-->
270 </div> 172 </div>
271
272 <?//=$users->appends($_GET)->links('catalogs.paginate'); ?>
273
274
275 @endsection 173 @endsection
276 174
resources/views/employers/bd.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 $(document).ready(function(){ 5 $(document).ready(function(){
6 $('[name="job_title_list[]"]').chosen({ 6 $('[name="job_title_list[]"]').chosen({
7 width: '100%' 7 width: '100%'
8 }) 8 })
9 $('[name="job_titles__name"]').change(function(){ 9 $('[name="job_titles__name"]').change(function(){
10 if ($(this).is(':checked')){ 10 if ($(this).is(':checked')){
11 $(".job-title-list-wrap").css("display", "block"); 11 $(".job-title-list-wrap").css("display", "block");
12 } else { 12 } else {
13 $(".job-title-list-wrap").css("display", "none"); 13 $(".job-title-list-wrap").css("display", "none");
14 } 14 }
15 }); 15 });
16 $('.cabinet__export-button-wrap button').click(function(){ 16 $('.cabinet__export-button-wrap button').click(function(){
17 $('.cabinet__export-error').parent().remove(); 17 $('.cabinet__export-error').parent().remove();
18 }); 18 });
19 19
20 $('.search-reset-button').click(function(){ 20 $('.search-reset-button').click(function(){
21 var wrap = $(this).closest('.cabinet__filters'); 21 var wrap = $(this).closest('.cabinet__filters');
22 wrap.find('[name="search"]').val(''); 22 wrap.find('[name="search"]').val('');
23 wrap.find('button').click(); 23 wrap.find('button').click();
24 }); 24 });
25 }); 25 });
26 26
27 27
28 $(document).on('click', '.die_black', function() { 28 $(document).on('click', '.die_black', function() {
29 var this_ = $(this); 29 var this_ = $(this);
30 var ajax_ = $('#ajax_flot_div'); 30 var ajax_ = $('#ajax_flot_div');
31 var id_ = this_.attr('data-test'); 31 var id_ = this_.attr('data-test');
32 var url_ = this_.attr('data-link'); 32 var url_ = this_.attr('data-link');
33 33
34 console.log(url_); 34 console.log(url_);
35 $.ajax({ 35 $.ajax({
36 type: "GET", 36 type: "GET",
37 url: url_, 37 url: url_,
38 success: function (data) { 38 success: function (data) {
39 console.log('Ответка'); 39 console.log('Ответка');
40 ajax_.html(data); 40 ajax_.html(data);
41 }, 41 },
42 headers: { 42 headers: {
43 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 43 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
44 }, 44 },
45 error: function (data) { 45 error: function (data) {
46 console.log('Error: ' + data); 46 console.log('Error: ' + data);
47 } 47 }
48 }); 48 });
49 49
50 }); 50 });
51 </script> 51 </script>
52 @endsection 52 @endsection
53 53
54 @section('content') 54 @section('content')
55 <section class="cabinet"> 55 <section class="cabinet">
56 <div class="container"> 56 <div class="container">
57 <ul class="breadcrumbs cabinet__breadcrumbs"> 57 <ul class="breadcrumbs cabinet__breadcrumbs">
58 <li><a href="{{ route('index') }}">Главная</a></li> 58 <li><a href="{{ route('index') }}">Главная</a></li>
59 <li><b>Личный кабинет</b></li> 59 <li><b>Личный кабинет</b></li>
60 </ul> 60 </ul>
61 <div class="cabinet__wrapper"> 61 <div class="cabinet__wrapper">
62 <div class="cabinet__side"> 62 <div class="cabinet__side">
63 <div class="cabinet__side-toper"> 63 <div class="cabinet__side-toper">
64 @include('employers.emblema') 64 @include('employers.emblema')
65 </div> 65 </div>
66 @include('employers.menu', ['item' => 7]) 66 @include('employers.menu', ['item' => 7])
67 </div> 67 </div>
68 68
69 <div class="cabinet__body"> 69 <div class="cabinet__body">
70 <div class="cabinet__body-item"> 70 <div class="cabinet__body-item">
71 <h2 class="title cabinet__title">База данных</h2> 71 <h2 class="title cabinet__title">База данных</h2>
72 </div> 72 </div>
73 <div class="cabinet__body-item"> 73 <div class="cabinet__body-item">
74 <div class="cabinet__filters" style="display: flex;flex-direction: unset;justify-content: left;align-items: center;"> 74 <div class="cabinet__filters" style="display: flex;flex-direction: unset;justify-content: left;align-items: center;">
75 <div class="cabinet__filters-item"> 75 <div class="cabinet__filters-item">
76 <form class="search" action="{{ route('employer.bd') }}"> 76 <form class="search" action="{{ route('employer.bd') }}">
77 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;" value="@if (isset($_GET['search'])) {{ $_GET['search'] }} @endif"> 77 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;" value="@if (isset($_GET['search'])) {{ $_GET['search'] }} @endif">
78 <button type="submit" class="button">Найти</button> 78 <button type="submit" class="button">Найти</button>
79 <span> 79 <span>
80 <svg> 80 <svg>
81 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 81 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
82 </svg> 82 </svg>
83 </span> 83 </span>
84 </form> 84 </form>
85 </div> 85 </div>
86 <a href="javascript:void(0)" class="search-reset-button bold font18" style="color: #377d87;">Сбросить поиск</a> 86 <a href="javascript:void(0)" class="search-reset-button bold font18" style="color: #377d87;">Сбросить поиск</a>
87 </div> 87 </div>
88 <div class="cabinet__filters"> 88 <div class="cabinet__filters">
89 <div class="cabinet__export-wrap"> 89 <div class="cabinet__export-wrap">
90 <form action="{{ route('resume_download_all') }}" method="GET" target="_blank"> 90 <form action="{{ route('resume_download_all') }}" method="GET" target="_blank">
91 <div class="cabinet__export-button-wrap"> 91 <div class="cabinet__export-button-wrap">
92 <button type="submit" class="button"> 92 <button type="submit" class="button">
93 <svg> 93 <svg>
94 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> 94 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
95 </svg> 95 </svg>
96 Экспорт 96 Экспорт
97 </button> 97 </button>
98 </div> 98 </div>
99 <div class="cabinet__export-options-wrap"> 99 <div class="cabinet__export-options-wrap">
100 @foreach ($export_options as $key => $value) 100 @foreach ($export_options as $key => $value)
101 <label class="checkbox"> 101 <label class="checkbox">
102 <input type="checkbox" value="1" name="{{$key}}" class="checkbox__input" checked=""> 102 <input type="checkbox" value="1" name="{{$key}}" class="checkbox__input" checked="">
103 <span class="checkbox__icon"> 103 <span class="checkbox__icon">
104 <svg> 104 <svg>
105 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use> 105 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use>
106 </svg> 106 </svg>
107 </span> 107 </span>
108 <span class="checkbox__text"> 108 <span class="checkbox__text">
109 <span>{{$value}}</span> 109 <span>{{$value}}</span>
110 </span> 110 </span>
111 </label> 111 </label>
112 @endforeach 112 @endforeach
113 </div> 113 </div>
114 <div class="job-title-list-wrap"> 114 <div class="job-title-list-wrap">
115 <select name="job_title_list[]" data-placeholder="Выберите должности" multiple > 115 <select name="job_title_list[]" data-placeholder="Выберите должности" multiple >
116 @foreach($jobs_titles as $job_title) 116 @foreach($jobs_titles as $job_title)
117 <option hover="background-color: #377d87;" value="{{$job_title['id']}}">{{$job_title['name']}}</option> 117 <option hover="background-color: #377d87;" value="{{$job_title['id']}}">{{$job_title['name']}}</option>
118 @endforeach 118 @endforeach
119 </select> 119 </select>
120 </div> 120 </div>
121 </form> 121 </form>
122 </div> 122 </div>
123 </div> 123 </div>
124 @if(session('error')) 124 @if(session('error'))
125 <div class="cabinet__filters"> 125 <div class="cabinet__filters">
126 <p class="cabinet__export-error">{{ session('error') }}</p> 126 <p class="cabinet__export-error">{{ session('error') }}</p>
127 </div> 127 </div>
128 @endif 128 @endif
129 129
130 </div> 130 </div>
131 131
132 <div class="cabinet__body-item"> 132 <div class="cabinet__body-item">
133 <div class="cabinet__table-header"> 133 <div class="cabinet__table-header">
134 <div> 134 <div>
135 Позиции работников 135 Позиции работников
136 </div> 136 </div>
137 <span> 137 <span>
138 Пользователей найдено: 138 Пользователей найдено:
139 <b>{{ $users->count() }}</b> 139 <b>{{ $count_users }}</b>
140 </span> 140 </span>
141 </div> 141 </div>
142 <div class="table table_spoiler"> 142 <div class="table table_spoiler">
143 143
144 <div class="table__scroll"> 144 <div class="table__scroll">
145 <div class="table__body table__body_min-width"> 145 <div class="table__body table__body_min-width">
146 <table> 146 <table>
147 <thead> 147 <thead>
148 <tr> 148 <tr>
149 <th style="max-width: 40px; min-width: 30px"></th> 149 <th style="max-width: 40px; min-width: 30px"></th>
150 <th>ФИО соискателя</th> 150 <th>ФИО соискателя</th>
151 <th>Должность</th> 151 <th>Должность</th>
152 <th>Наличие<br>анкеты</th> 152 <th>Наличие<br>анкеты</th>
153 </tr> 153 </tr>
154 </thead> 154 </thead>
155 <tbody> 155 <tbody>
156 @php 156 @php
157 $categories = 0; 157 $categories = 0;
158 158
159 @endphp 159 @endphp
160 160
161 @if ($users->count()) 161 @if ($users->count())
162 @foreach ($users as $key => $it) 162 @foreach ($users as $key => $it)
163 <tr> 163 <tr>
164 <td style="max-width: 40px; min-width: 30px; font-size: 1.5rem">{{ $it->workers[0]->comment }}</td> 164 <td style="max-width: 40px; min-width: 30px; font-size: 1.5rem">{{ $it->workers[0]->comment }}</td>
165 165
166 <td>{{ $it->surname." ".$it->name_man }}<br>{{ $it->surname2 }}</td> 166 <td>{{ $it->surname." ".$it->name_man }}<br>{{ $it->surname2 }}</td>
167 167
168 <td> 168 <td>
169 @if($it->workers[0]->positions_work) 169 @if($it->workers[0]->positions_work)
170 @foreach($it->workers[0]->jobs as $job) 170 {{ $it->workers[0]->jobs->first()->name }}
171 {{ $job->name }}
172 @if(!$loop->last)
173 <br>
174 @endif
175 @endforeach
176 @endif 171 @endif
177 </td> 172 </td>
178 173
179 <td> 174 <td>
180 @if ($it->file !== null) 175 @if ($it->file !== null)
181 <a href="{{ asset(Storage::url($it->file)) }}" class="table__link"> 176 <a href="{{ asset(Storage::url($it->file)) }}" class="table__link">
182 <svg> 177 <svg>
183 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> 178 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
184 </svg> 179 </svg>
185 Скачать 180 Скачать
186 </a> 181 </a>
187 @endif 182 @endif
188 </td> 183 </td>
189 </tr> 184 </tr>
190 @endforeach 185 @endforeach
191 @endif 186 @endif
192 </tbody> 187 </tbody>
193 </table> 188 </table>
194 </div> 189 </div>
195 190
196 </div> 191 </div>
197 </div> 192 </div>
198 {{ $users->onEachSide(0)->appends($_GET)->links('paginate') }} 193 {{ $users->onEachSide(0)->appends($_GET)->links('paginate') }}
199 </div> 194 </div>
200 </div> 195 </div>
201 </div> 196 </div>
202 </div> 197 </div>
203 </section> 198 </section>
204 </div> 199 </div>
205 @endsection 200 @endsection
206 201
resources/views/info_company_new.blade.php
1 @extends('layout.frontend', ['title' => 'Описание компании '.$title.'- РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Описание компании '.$title.'- РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 $(document).on('change', '#sort_ajax', function() { 5 $(document).on('change', '#sort_ajax', function() {
6 var this_ = $(this); 6 var this_ = $(this);
7 var val_ = this_.val(); 7 var val_ = this_.val();
8 console.log('sort items '+val_);
9 8
10 $.ajax({ 9 $.ajax({
11 type: "GET", 10 type: "GET",
12 url: "{{ route('shipping_companies') }}", 11 url: "{{ route('shipping_companies') }}",
13 data: "sort="+val_+"&block=1", 12 data: "sort="+val_+"&block=1",
14 success: function (data) { 13 success: function (data) {
15 console.log('Выбор сортировки'); 14 console.log('Выбор сортировки');
16 console.log(data); 15 console.log(data);
17 $('#block_1').html(data); 16 $('#block_1').html(data);
18 }, 17 },
19 headers: { 18 headers: {
20 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 19 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
21 }, 20 },
22 error: function (data) { 21 error: function (data) {
23 data = JSON.stringify(data); 22 data = JSON.stringify(data);
24 console.log('Error: ' + data); 23 console.log('Error: ' + data);
25 } 24 }
26 }); 25 });
27 26
28 $.ajax({ 27 $.ajax({
29 type: "GET", 28 type: "GET",
30 url: "{{ route('shipping_companies') }}", 29 url: "{{ route('shipping_companies') }}",
31 data: "sort="+val_+"&block=2", 30 data: "sort="+val_+"&block=2",
32 success: function (data) { 31 success: function (data) {
33 console.log('Выбор сортировки2');
34 console.log(data);
35 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 32 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
36 $('#block_2').html(data); 33 $('#block_2').html(data);
37 }, 34 },
38 headers: { 35 headers: {
39 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 36 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
40 }, 37 },
41 error: function (data) { 38 error: function (data) {
42 data = JSON.stringify(data); 39 data = JSON.stringify(data);
43 console.log('Error: ' + data); 40 console.log('Error: ' + data);
44 } 41 }
45 }); 42 });
46 }); 43 });
47 44
48 $(document).ready(function(){ 45 $(document).ready(function(){
49 var sel = $('#select2-sort_ajax-container'); 46 var sel = $('#select2-sort_ajax-container');
50 var key = getUrlParameter('sort'); 47 var key = getUrlParameter('sort');
51 if (key !=='') { 48 if (key !=='') {
52 console.log(key);
53 switch (key) { 49 switch (key) {
54 case "default": sel.html('Сортировка (по умолчанию)'); break; 50 case "default": sel.html('Сортировка (по умолчанию)'); break;
55 case "name_up": sel.html('По имени (возрастание)'); break; 51 case "name_up": sel.html('По имени (возрастание)'); break;
56 case "name_down": sel.html('По дате (убывание)'); break; 52 case "name_down": sel.html('По дате (убывание)'); break;
57 case "created_at_up": sel.html('По дате (возрастание)'); break; 53 case "created_at_up": sel.html('По дате (возрастание)'); break;
58 case "created_at_down": sel.html('По дате (убывание)'); break; 54 case "created_at_down": sel.html('По дате (убывание)'); break;
59 } 55 }
60 56
61 } 57 }
62 }); 58 });
63 59
64 //end
65 $(document).on('click', '.js_send_it_button', function() {
66 var this_ = $(this);
67 var code_user_id = this_.attr('data-uid');
68 var code_to_user_id = this_.attr('data-tuid');
69 var code_vacancy = this_.attr('data-vacancy');
70 var user_id = $('#send_user_id');
71 var to_user_id = $('#send_to_user_id');
72 var vacancy = $('#send_vacancy');
73
74 console.log('Клик на кнопки...');
75
76 user_id.val(code_user_id);
77 to_user_id.val(code_to_user_id);
78 vacancy.val(code_vacancy);
79 });
80
81 $("#list_button").on('click', function () { 60 $("#list_button").on('click', function () {
82 $('#flot').removeClass('active'); 61 $('#flot').removeClass('active');
83 $('#flot_list').removeClass('showed'); 62 $('#flot_list').removeClass('showed');
84 $('#vacancy').addClass('active'); 63 $('#vacancy').addClass('active');
85 $('#vacancy_list').addClass('showed'); 64 $('#vacancy_list').addClass('showed');
86 }) 65 })
87 </script> 66 </script>
88 @include('js.favorite-vacancy-45') 67 @include('js.favorite-vacancy-45')
68 @include('js.vacancy-response')
89 @endsection 69 @endsection
90 70
91 @section('content') 71 @section('content')
92 <section class="thing"> 72 <section class="thing">
93 <div class="container"> 73 <div class="container">
94 <div class="thing__body"> 74 <div class="thing__body">
95 <ul class="breadcrumbs thing__breadcrumbs"> 75 <ul class="breadcrumbs thing__breadcrumbs">
96 <li><a href="{{ route('index') }}">Главная</a></li> 76 <li><a href="{{ route('index') }}">Главная</a></li>
97 <li><a href="{{ route('shipping_companies') }}">Работодатели</a></li> 77 <li><a href="{{ route('shipping_companies') }}">Работодатели</a></li>
98 <li><b>@isset($title) {{ $title }} @else Не указано @endif</b></li> 78 <li><b>@isset($title) {{ $title }} @else Не указано @endif</b></li>
99 </ul> 79 </ul>
100 @if ($company[0]->oficial_status == 1) 80 @if ($company[0]->oficial_status == 1)
101 <div class="thing__badge"> 81 <div class="thing__badge">
102 <svg> 82 <svg>
103 <use xlink:href="{{ asset('images/sprite.svg#badge') }}"></use> 83 <use xlink:href="{{ asset('images/sprite.svg#badge') }}"></use>
104 </svg> 84 </svg>
105 Компания проверена 85 Компания проверена
106 </div> 86 </div>
107 @endif 87 @endif
108 88
109 @if (!empty($company[0]->logo)) 89 @if (!empty($company[0]->logo))
110 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $company[0]->name_company }}" class="thing__pic"> 90 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $company[0]->name_company }}" class="thing__pic">
111 @else 91 @else
112 <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $company[0]->name_company }}" class="thing__pic"> 92 <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $company[0]->name_company }}" class="thing__pic">
113 @endif 93 @endif
114 94
115 <h1 class="thing__title">{{ $company[0]->name_company }}</h1> 95 <h1 class="thing__title">{{ $company[0]->name_company }}</h1>
116 <!--<p class="thing__text"> $company[0]->text !!}</p>-->
117 <div class="thing__buttons"> 96 <div class="thing__buttons">
118 <a href="#vacancy" id="list_button"> 97 <a href="#vacancy" id="list_button">
119 <button type="button" class="button"> 98 <button type="button" class="button">
120 <svg> 99 <svg>
121 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use> 100 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use>
122 </svg> 101 </svg>
123 {{ $company[0]->ads->count() }} вакансии 102 {{ $company[0]->ads->count() }} вакансии
124 </button> 103 </button>
125 </a> 104 </a>
126 @if ($user_id == 0) 105 @guest
127 <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button"> 106 <a
107 data-fancybox
108 data-src="#question"
109 data-options='{"touch":false,"autoFocus":false}'
110 class="button">
128 Написать сообщение 111 Написать сообщение
129 </a> 112 </a>
130 @else 113 @else
131 <button type="button" data-fancybox data-src="#send" data-vacancy="0" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}' 114 @if (App\Classes\StatusUser::Status() == 1)
132 class="button js_send_it_button"> 115 <a
133 Написать сообщение 116 data-fancybox
134 </button> 117 data-src="#send3"
135 @endif 118 data-vacancy="0"
119 data-uid="{{ $user_id }}"
120 data-tuid="{{ $company[0]->users->id }}"
121 data-options='{"touch":false,"autoFocus":false}'
122 class="button">
123 Написать сообщение
124 </a>
125 @endif
126 @endguest
136 </div> 127 </div>
137 </div> 128 </div>
138 </div> 129 </div>
139 </section> 130 </section>
140 <main class="main"> 131 <main class="main">
141 <div class="container"> 132 <div class="container">
142 <div class="main__employer-page"> 133 <div class="main__employer-page">
143 <h2 class="main__employer-page-title">О компании</h2> 134 <h2 class="main__employer-page-title">О компании</h2>
144 <div class="main__employer-page-info"> 135 <div class="main__employer-page-info">
145 <div class="main__employer-page-item"> 136 <div class="main__employer-page-item">
146 <b>Адрес компании</b> 137 <b>Адрес компании</b>
147 <span> 138 <span>
148 {{ $company[0]->address }} 139 {{ $company[0]->address }}
149 </span> 140 </span>
150 </div> 141 </div>
151 <div class="main__employer-page-item"> 142 <div class="main__employer-page-item">
152 <b>Сайт</b> 143 <b>Сайт</b>
153 <span> 144 <span>
154 {{ $company[0]->site }} 145 {{ $company[0]->site }}
155 </span> 146 </span>
156 </div> 147 </div>
157 <div class="main__employer-page-item"> 148 <div class="main__employer-page-item">
158 <b>Почта</b> 149 <b>Почта</b>
159 <span> 150 <span>
160 {{ $company[0]->email }} 151 {{ $company[0]->email }}
161 </span> 152 </span>
162 </div> 153 </div>
163 <div class="main__employer-page-item"> 154 <div class="main__employer-page-item">
164 <b>Телефон</b> 155 <b>Телефон</b>
165 <span> 156 <span>
166 {{ $company[0]->telephone }} 157 {{ $company[0]->telephone }}
167 </span> 158 </span>
168 </div> 159 </div>
169 </div> 160 </div>
170 <div class="main__employer-page-info"> 161 <div class="main__employer-page-info">
171 <div class="main__employer-page-item"></div> 162 <div class="main__employer-page-item"></div>
172 <div class="main__employer-page-item"></div> 163 <div class="main__employer-page-item"></div>
173 <div class="main__employer-page-item"> 164 <div class="main__employer-page-item">
174 <b>Почта (alt)</b> 165 <b>Почта (alt)</b>
175 <span> 166 <span>
176 {{ $company[0]->email_2 }} 167 {{ $company[0]->email_2 }}
177 </span> 168 </span>
178 </div> 169 </div>
179 <div class="main__employer-page-item"> 170 <div class="main__employer-page-item">
180 <b>Телефон (alt)</b> 171 <b>Телефон (alt)</b>
181 <span> 172 <span>
182 {{ $company[0]->telephone_2 }} 173 {{ $company[0]->telephone_2 }}
183 </span> 174 </span>
184 </div> 175 </div>
185 </div> 176 </div>
186 177
187 <div class="main__employer-page-item main__employer-page-description"> 178 <div class="main__employer-page-item main__employer-page-description">
188 <b>Описание</b> 179 <b>Описание</b>
189 <span> 180 <span>
190 {!! $company[0]->text !!} 181 {!! $company[0]->text !!}
191 </span> 182 </span>
192 </div> 183 </div>
193 184
194 <div> 185 <div>
195 <div class="main__employer-page-tabs"> 186 <div class="main__employer-page-tabs">
196 <button id="flot" type="button" class="main__employer-page-tabs-item active" data-tab="1">Флот</button> 187 <button id="flot" type="button" class="main__employer-page-tabs-item active" data-tab="1">Флот</button>
197 <button id="vacancy" type="button" class="main__employer-page-tabs-item" data-tab="2">Вакансии</button> 188 <button id="vacancy" type="button" class="main__employer-page-tabs-item" data-tab="2">Вакансии</button>
198 </div> 189 </div>
199 190
200 <div class="main__employer-page-body"> 191 <div class="main__employer-page-body">
201 <div id="flot_list" class="main__employer-page-body-item showed" data-body="1"> 192 <div id="flot_list" class="main__employer-page-body-item showed" data-body="1">
202 <div class="main__employer-page-one"> 193 <div class="main__employer-page-one">
203 @if ($company[0]->flots->count()) 194 @if ($company[0]->flots->count())
204 @foreach ($company[0]->flots as $flot) 195 @foreach ($company[0]->flots as $flot)
205 <div class="main__employer-page-one-item flot-one-ship"> 196 <div class="main__employer-page-one-item flot-one-ship">
206 @if (!empty($flot->image)) 197 @if (!empty($flot->image))
207 <a href="{{ asset(Storage::url($flot->image)) }}" data-fancybox="gallery" class="review-image-modal"> 198 <a href="{{ asset(Storage::url($flot->image)) }}" data-fancybox="gallery" class="review-image-modal">
208 <img src="{{ asset(Storage::url($flot->image)) }}" alt="{{ $flot->name }}"> 199 <img src="{{ asset(Storage::url($flot->image)) }}" alt="{{ $flot->name }}">
209 </a> 200 </a>
210 @else 201 @else
211 <a href="{{ asset('images/default_ship.jpg') }}" data-fancybox="gallery" class="review-image-modal"> 202 <a href="{{ asset('images/default_ship.jpg') }}" data-fancybox="gallery" class="review-image-modal">
212 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $flot->name }}"> 203 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $flot->name }}">
213 </a> 204 </a>
214 @endif 205 @endif
215 206
216 <div class="flot-label"><div class="flot-label-name">Название:</div>{{ $flot->name }}</div> 207 <div class="flot-label"><div class="flot-label-name">Название:</div>{{ $flot->name }}</div>
217 <div class="flot-label"><div class="flot-label-name">DWT:</div> {{ $flot->DWT }}</div> 208 <div class="flot-label"><div class="flot-label-name">DWT:</div> {{ $flot->DWT }}</div>
218 <div class="flot-label"><div class="flot-label-name">Мощность:</div> {{ $flot->POWER_GD }}</div> 209 <div class="flot-label"><div class="flot-label-name">Мощность:</div> {{ $flot->POWER_GD }}</div>
219 <div class="flot-label"><div class="flot-label-name">IMO:</div> {{ $flot->IMO }}</div> 210 <div class="flot-label"><div class="flot-label-name">IMO:</div> {{ $flot->IMO }}</div>
220 </div> 211 </div>
221 @endforeach 212 @endforeach
222 @endif 213 @endif
223 </div> 214 </div>
224 </div> 215 </div>
225 216
226 <div id="vacancy_list" class="main__employer-page-body-item" data-body="2"> 217 <div id="vacancy_list" class="main__employer-page-body-item" data-body="2">
227 <div class="main__employer-page-two"> 218 <div class="main__employer-page-two">
228 @foreach ($ads as $job) 219 @foreach ($ads as $job)
229 <div class="main__employer-page-two-item"> 220 <div class="main__employer-page-two-item">
230 <div class="main__employer-page-two-item-toper"> 221 <div class="main__employer-page-two-item-toper">
231 @if (!empty($company[0]->logo)) 222 @if (!empty($company[0]->logo))
232 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $job->name }}"> 223 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $job->name }}">
233 @else 224 @else
234 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $job->name }}"> 225 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $job->name }}">
235 @endif 226 @endif
236 <span>{{ $company[0]->name_company }}</span> 227 <span>{{ $company[0]->name_company }}</span>
237 </div> 228 </div>
238 <div class="main__employer-page-two-item-text-body"> 229 <div class="main__employer-page-two-item-text-body">
239 <h3>{{ $job->name }}</h3> 230 <h3>{{ $job->name }}</h3>
240 <span>Описание: 231 <span>Описание:
241 {!! $job->text !!} 232 {!! $job->text !!}
242 </span> 233 </span>
243 </div> 234 </div>
244 235
245 @if ((isset($job->jobs)) && ($job->jobs->count())) 236 @if ((isset($job->jobs)) && ($job->jobs->count()))
246 <div class="main__employer-page-two-item-tags"> 237 <div class="main__employer-page-two-item-tags">
247 @foreach ($job->jobs as $item) 238 @foreach ($job->jobs as $item)
248 <span class="main__employer-page-two-item-tag">#{{ $item->name }}</span> 239 <span class="main__employer-page-two-item-tag">#{{ $item->name }}</span>
249 @endforeach 240 @endforeach
250 </div> 241 </div>
251 @endif 242 @endif
252 <div class="main__employer-page-two-item-buttons"> 243 <div class="main__employer-page-two-item-buttons">
253 244 <button type="button"
254 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $job->id }}" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}' 245 data-fancybox
255 class="button main__employer-page-two-item-button js_send_it_button">Оставить 246 data-src="#send3"
256 отклик...</button> 247 data-vacancy="{{ $job->id }}"
257 248 data-uid="{{ $user_id }}"
258 <!--<a href="#" 249 data-tuid="{{ $company[0]->users->id }}"
259 class="button button_light main__employer-page-two-item-button">Подробнее</a>--> 250 data-options='{"touch":false,"autoFocus":false}'
251 class="button main__employer-page-two-item-button js_send_it_button"
252 >
253 Оставить отклик
254 </button>
260 </div> 255 </div>
261 <div class="main__employer-page-two-item-bottom"> 256 <div class="main__employer-page-two-item-bottom">
262 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($job->updated_at)) }}</div> 257 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($job->updated_at)) }}</div>
263 <button type="button" id="like{{ $job->id }}" data-val="{{ $job->id }}" 258 <button type="button" id="like{{ $job->id }}" data-val="{{ $job->id }}"
264 class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($job) }}"> 259 class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($job) }}">
265 <svg> 260 <svg>
266 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 261 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
267 </svg> 262 </svg>
268 </button> 263 </button>
269 </div> 264 </div>
270 </div> 265 </div>
271 @endforeach 266 @endforeach
resources/views/modals/send_worker.blade.php
1 <script> 1 <script>
2 $("#form_worker" ).submit(function(event) { 2 $("#form_worker" ).submit(function(event) {
3 var val = $(this).val(); 3 var val = $(this).val();
4 var send_title = $('#send_title'); 4 var send_title = $('#send_title');
5 var send_title_val = send_title.val(); 5 var send_title_val = send_title.val();
6
7 console.log('Click form.');
8 }); 6 });
9 7
10 $(document).on('change', '#btn_send_file', function() { 8 $(document).on('change', '#btn_send_file', function() {
11 9
12 var send_name = $('#send_name'); 10 var send_name = $('#send_name');
13 var send_name_val = send_name.val(); 11 var send_name_val = send_name.val();
14 var send_name_file = $('#send_name_file'); 12 var send_name_file = $('#send_name_file');
15 13
16 console.log(send_name_val);
17 send_name_file.html(send_name_val); 14 send_name_file.html(send_name_val);
18 15
19 }); 16 });
20 </script> 17 </script>
21 <div id="send3" class="modal"> 18 <div id="send3" class="modal">
22 <div class="modal__body"> 19 <div class="modal__body">
23 <div class="modal__title">Отправить сообщение работодателю</div> 20 <div class="modal__title">Отправить сообщение работодателю</div>
24 <form class="modal__form" id="form_worker" name="form_worker" enctype="multipart/form-data" action="{{ route('worker.new_message') }}" method="POST"> 21 <form class="modal__form" id="form_worker" name="form_worker" enctype="multipart/form-data" action="{{ route('worker.new_message') }}" method="POST">
25 @csrf 22 @csrf
26 <div class="modal__form-item" style="display: none"> 23 <div class="modal__form-item" style="display: none">
27 Отправитель сообщения: 24 Отправитель сообщения:
28 <input type="text" id="send_user_id" name="send_user_id" class="input" placeholder="user_id" value=""> 25 <input type="text" id="send_user_id" name="send_user_id" class="input" placeholder="user_id" value="">
29 Получатель сообщения: 26 Получатель сообщения:
30 <input type="text" id="send_to_user_id" name="send_to_user_id" class="input" placeholder="to_user_id" value=""> 27 <input type="text" id="send_to_user_id" name="send_to_user_id" class="input" placeholder="to_user_id" value="">
31 Вакансия: 28 Вакансия:
32 <input type="text" id="send_vacancy" name="send_vacancy" class="input" placeholder="vacancy" value=""> 29 <input type="text" id="send_vacancy" name="send_vacancy" class="input" placeholder="vacancy" value="">
33 </div> 30 </div>
34 <div class="modal__form-item send_title_div error_">
35 <input id="send_title" name="send_title" type="text" class="input" placeholder="Тема" required>
36 <label for="title">Не заполнено поле</label>
37 </div>
38 <div class="modal__form-item send_title_div error_">
39 <select class="js-select2" name="send_job_title_id" id="send_job_title_id">
40 @if ($jobs->count())
41 @foreach($jobs as $j)
42 <option value="{{ $j->id }}">{{ $j->name }} ({{ $j->id }})</option>
43 @endforeach
44 @endif
45 </select>
46 <label for="title">Не заполнено поле</label>
47 </div>
48 <div class="modal__form-item send_text_div"> 31 <div class="modal__form-item send_text_div">
49 <textarea id="i2" class="textarea" id="send_text" name="send_text" placeholder="Укажите по какому поводу вы пишите работодателю, уточните название вакансии или прикрепите ссылку на вакансию, дайте как можно больше информации.&#10;&#10;ВАЖНО не стоит писать работодателю короткий текст цитирую «Какая зарплата?, работодатель не поймет о чем речь, опишите вопрос максимально подробно»." required></textarea> 32 <textarea id="i2" class="textarea" id="send_text" name="send_text" placeholder="Укажите по какому поводу вы пишите работодателю, уточните название вакансии или прикрепите ссылку на вакансию, дайте как можно больше информации.&#10;&#10;ВАЖНО не стоит писать работодателю короткий текст цитирую «Какая зарплата?, работодатель не поймет о чем речь, опишите вопрос максимально подробно»." required></textarea>
50 <label for="i2">Не заполнено поле</label> 33 <label for="i2">Не заполнено поле</label>
51 </div> 34 </div>
52 <div class="modal__form-item"> 35 <div class="modal__form-item">
53 <div class="file"> 36 <div class="file">
54 <label class="file__input" id="btn_send_file" name="btn_send_file"> 37 <label class="file__input" id="btn_send_file" name="btn_send_file">
55 <input type="file" name="send_file" id="send_name"> 38 <input type="file" name="send_file" id="send_name">
56 <span class="button button_light"> 39 <span class="button button_light">
57 <svg> 40 <svg>
58 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> 41 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
59 </svg> 42 </svg>
60 Прикрепить файл-документ 43 Прикрепить файл-документ
61 </span> 44 </span>
62 </label> 45 </label>
63 46
64 <div class="file__list" id="div_file" name="div_file"> 47 <div class="file__list" id="div_file" name="div_file">
65 <div class="file__list-item"> 48 <div class="file__list-item">
66 <div class="file__list-item-left"> 49 <div class="file__list-item-left">
67 <svg> 50 <svg>
68 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use> 51 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use>
69 </svg> 52 </svg>
70 <span id="send_name_file" name="send_name_file"></span> 53 <span id="send_name_file" name="send_name_file"></span>
71 </div> 54 </div>
72 <button type="button" class="file__list-item-right js-parent-remove"> 55 <button type="button" class="file__list-item-right js-parent-remove">
73 <svg> 56 <svg>
74 <use xlink:href="{{ asset('images/sprite.svg#cross-bold') }}"></use> 57 <use xlink:href="{{ asset('images/sprite.svg#cross-bold') }}"></use>
75 </svg> 58 </svg>
76 </button> 59 </button>
77 </div> 60 </div>
78 </div> 61 </div>
79 </div> 62 </div>
80 </div> 63 </div>
81 <div class="modal__form-item"> 64 <div class="modal__form-item">
82 <button type="submit" id="submit_form_worker" name="submit_form_worker" class="button">Отправить</button> 65 <button type="submit" id="submit_form_worker" name="submit_form_worker" class="button">Отправить</button>
83 </div> 66 </div>
84 </form> 67 </form>
85 </div> 68 </div>
86 </div> 69 </div>
87 70
resources/views/modals/vacancy/add_comment.blade.php
1 <script>
2 $('[data-fancybox]').fancybox({
3 autoFocus: false
4 });
5 </script>
1 <div id="add_comment" class="modal"> 6 <div id="add_comment" class="modal">
2 <div class="modal__body"> 7 <div class="modal__body">
3 <div class="modal__title">Комментарий для работодателя</div> 8 <div class="modal__title">Комментарий для работодателя</div>
4 <form class="modal__form comment_form"> 9 <form class="modal__form comment_form">
5 @csrf 10 @csrf
6 <div class="modal__form-item" style="display:none"> 11 <div class="modal__form-item" style="display:none">
7 <!-- Отправитель сообщения: --> 12 <!-- Отправитель сообщения: -->
8 <input type="hidden" id="response_user_id" name="_user_id" class="input" placeholder="user_id" value=""> 13 <input type="hidden" id="response_user_id" name="_user_id" class="input" placeholder="user_id" value="">
9 <!-- Получатель сообщения: --> 14 <!-- Получатель сообщения: -->
10 <input type="hidden" id="response_to_user_id" name="_to_user_id" class="input" placeholder="to_user_id" value=""> 15 <input type="hidden" id="response_to_user_id" name="_to_user_id" class="input" placeholder="to_user_id" value="">
11 <!-- Вакансия: --> 16 <!-- Вакансия: -->
12 <input type="hidden" id="response_vacancy" name="_vacancy" class="input" placeholder="vacancy" value=""> 17 <input type="hidden" id="response_vacancy" name="_vacancy" class="input" placeholder="vacancy" value="">
13 </div> 18 </div>
14 <div class="modal__form-item"> 19 <div class="modal__form-item">
15 <textarea 20 <textarea
16 id="comment_text" 21 id="comment_text"
17 class="textarea" 22 class="textarea"
18 name="text" 23 name="text"
19 placeholder="Пожалуйста напишите в комментарии вашу должность, номер телефона и дату готовности к посадке." 24 placeholder="Пожалуйста напишите в комментарии вашу должность, номер телефона и дату готовности к посадке."
20 required 25 required
21 value=""> 26 value=""></textarea>
22 </textarea>
23 <label for="comment_text">Не заполнено поле</label> 27 <label for="comment_text">Не заполнено поле</label>
24 </div> 28 </div>
25 <div class="modal__form-item"> 29 <div class="modal__form-item">
26 <button type="button" 30 <button type="button"
27 data-fancybox 31 data-fancybox
28 data-src="#response_sent" 32 data-src="#response_sent"
29 class="button main__employer-page-two-item-button send_resume">Отправить</button> 33 class="button main__employer-page-two-item-button send_resume">Отправить</button>
30 <button type="button" 34 <button type="button"
31 data-fancybox 35 data-fancybox
32 data-src="#response_sent_no_comment" 36 data-src="#response_sent_no_comment"
33 class="button main__employer-page-two-item-button send_resume">Пропустить</button> 37 class="button main__employer-page-two-item-button send_resume">Пропустить</button>
34 </div> 38 </div>
35 </form> 39 </form>
36 </div> 40 </div>
37 </div> 41 </div>
38 42
39 <script> 43 <script>
40 $(document).on('click', '.send_resume', function(){ 44 $(document).on('click', '.send_resume', function(){
41 var data = { 45 var data = {
42 user_from: $('#response_user_id').val(), 46 user_from: $('#response_user_id').val(),
43 user_to: $('#response_to_user_id').val(), 47 user_to: $('#response_to_user_id').val(),
44 vacancy: $('#response_vacancy').val(), 48 vacancy: $('#response_vacancy').val(),
45 _token: '{{csrf_token()}}' 49 _token: '{{csrf_token()}}'
46 } 50 }
47 51
48 var comment = $('.comment_form textarea').serializeArray()[0].value; 52 var comment = $('.comment_form textarea').serializeArray()[0].value;
49 53
50 if (comment !== '') { 54 if (comment !== '') {
51 data.comment = comment; 55 data.comment = comment;
52 } 56 }
53 57
54 $.ajax({ 58 $.ajax({
55 url: '{{ route('worker.new_message') }}', 59 url: '{{ route('worker.new_message') }}',
56 type: 'POST', 60 type: 'POST',
57 data: data, 61 data: data,
58 success: function (data) { 62 success: function (data) {
59 // 63 //
60 } 64 }
61 }) 65 })
62 }) 66 })
63 </script> 67 </script>
resources/views/modals/vacancy/ask_for_resume_comment.blade.php
1 <div id="ask_comment" class="modal modal_bg"> 1 <div id="ask_comment" class="modal modal_bg">
2 <div style="display:none"> 2 <div style="display:none">
3 <!-- Отправитель сообщения: --> 3 <!-- Отправитель сообщения: -->
4 <input type="hidden" id="modal_user_id" value=""> 4 <input type="hidden" id="modal_user_id" value="">
5 <!-- Получатель сообщения: --> 5 <!-- Получатель сообщения: -->
6 <input type="hidden" id="modal_to_user_id" value=""> 6 <input type="hidden" id="modal_to_user_id" value="">
7 <!-- Вакансия: --> 7 <!-- Вакансия: -->
8 <input type="hidden" id="modal_vacancy" value=""> 8 <input type="hidden" id="modal_vacancy" value="">
9 </div> 9 </div>
10 10
11 <div class="modal__body"> 11 <div class="modal__body">
12 <div class="modal__title">Вы откликнулись на вакансию <span id="vac_name"></span></div> 12 <div class="modal__title">Вы откликнулись на вакансию <span id="vac_name"></span></div>
13 <div class="modal__text">Вы хотите добавить комментарий к вашему резюме?</div> 13 <div class="modal__text">Вы хотите добавить комментарий к вашему резюме?</div>
14 <div class="modal__buttons"> 14 <div class="modal__buttons">
15 <button type="button" 15 <button type="button"
16 id="comment" 16 id="comment"
17 data-fancybox 17 data-fancybox
18 data-src="#add_comment" 18 data-src="#add_comment"
19 data-auto-focus="false"
19 class="button main__employer-page-two-item-button">Да</button> 20 class="button main__employer-page-two-item-button">Да</button>
20 <button type="button" 21 <button type="button"
21 data-fancybox 22 data-fancybox
22 id="send_resume_no_comment" 23 id="send_resume_no_comment"
23 data-src="#response_sent_no_comment" 24 data-src="#response_sent_no_comment"
24 class="button main__employer-page-two-item-button">Нет</button> 25 class="button main__employer-page-two-item-button">Нет</button>
25 </div> 26 </div>
26 </div> 27 </div>
27 </div> 28 </div>
28 29
29 <script> 30 <script>
30 $(document).on('change', '#modal_user_id', function () { 31 $(document).on('change', '#modal_user_id', function () {
31 $('.js_send_wp_button').data('uid', $('#modal_user_id').val()); 32 $('.js_send_wp_button').data('uid', $('#modal_user_id').val());
32 }) 33 })
33 $(document).on('change', '#modal_to_user_id', function () { 34 $(document).on('change', '#modal_to_user_id', function () {
34 $('.js_send_wp_button').data('tuid', $('#modal_to_user_id').val()); 35 $('.js_send_wp_button').data('tuid', $('#modal_to_user_id').val());
35 }) 36 })
36 $(document).on('change', '#modal_vacancy', function () { 37 $(document).on('change', '#modal_vacancy', function () {
37 $('.js_send_wp_button').data('vacancy', $('#modal_vacancy').val()); 38 $('.js_send_wp_button').data('vacancy', $('#modal_vacancy').val());
38 $.ajax({ 39 $.ajax({
39 url: 'vacancy/'+$('#modal_vacancy').val(), 40 url: 'vacancy/'+$('#modal_vacancy').val(),
40 type: 'GET', 41 type: 'GET',
41 dataType: "json", 42 dataType: "json",
42 success: function (data) { 43 success: function (data) {
43 $('#vac_name').html(data.name) 44 $('#vac_name').html(data.name)
44 } 45 }
45 }) 46 })
46 }) 47 })
47 $(document).on('click', '#comment', function() { 48 $(document).on('click', '#comment', function() {
48 $('#response_user_id').val($('#modal_user_id').val()); 49 $('#response_user_id').val($('#modal_user_id').val());
49 $('#response_to_user_id').val($('#modal_to_user_id').val()); 50 $('#response_to_user_id').val($('#modal_to_user_id').val());
50 $('#response_vacancy').val($('#modal_vacancy').val()); 51 $('#response_vacancy').val($('#modal_vacancy').val());
51 }); 52 });
52 53
53 $(document).on('click', '#send_resume_no_comment', function(){ 54 $(document).on('click', '#send_resume_no_comment', function(){
54 $.ajax({ 55 $.ajax({
55 url: '{{ route('worker.new_message') }}', 56 url: '{{ route('worker.new_message') }}',
56 type: 'POST', 57 type: 'POST',
57 data: { 58 data: {
58 user_from: $('#modal_user_id').val(), 59 user_from: $('#modal_user_id').val(),
59 user_to: $('#modal_to_user_id').val(), 60 user_to: $('#modal_to_user_id').val(),
60 vacancy: $('#modal_vacancy').val(), 61 vacancy: $('#modal_vacancy').val(),
61 _token: '{{csrf_token()}}' 62 _token: '{{csrf_token()}}'
62 }, 63 },
63 success: function (data) { 64 success: function (data) {
64 // 65 //
65 } 66 }
66 }) 67 })
67 }) 68 })
68 69
69 </script> 70 </script>
70 71
1 <?php 1 <?php
2 2
3 use App\Http\Controllers\Ad_jobsController; 3 use App\Http\Controllers\Ad_jobsController;
4 use App\Http\Controllers\AdEmployerController; 4 use App\Http\Controllers\AdEmployerController;
5 use App\Http\Controllers\Admin\AdminController; 5 use App\Http\Controllers\Admin\AdminController;
6 use App\Http\Controllers\Admin\CategoryController; 6 use App\Http\Controllers\Admin\CategoryController;
7 use App\Http\Controllers\Admin\CategoryEmpController; 7 use App\Http\Controllers\Admin\CategoryEmpController;
8 use App\Http\Controllers\Admin\EducationController; 8 use App\Http\Controllers\Admin\EducationController;
9 use App\Http\Controllers\EducationController as EducationFrontController; 9 use App\Http\Controllers\EducationController as EducationFrontController;
10 use App\Http\Controllers\Admin\EmployersController; 10 use App\Http\Controllers\Admin\EmployersController;
11 use App\Http\Controllers\EmployerController as FrontEmployersController; 11 use App\Http\Controllers\EmployerController as FrontEmployersController;
12 use App\Http\Controllers\Admin\InfoBloksController; 12 use App\Http\Controllers\Admin\InfoBloksController;
13 use App\Http\Controllers\Admin\JobTitlesController; 13 use App\Http\Controllers\Admin\JobTitlesController;
14 use App\Http\Controllers\Admin\UsersController; 14 use App\Http\Controllers\Admin\UsersController;
15 use App\Http\Controllers\Admin\WorkersController; 15 use App\Http\Controllers\Admin\WorkersController;
16 use App\Http\Controllers\Auth\ForgotPasswordController; 16 use App\Http\Controllers\Auth\ForgotPasswordController;
17 use App\Http\Controllers\Auth\LoginController; 17 use App\Http\Controllers\Auth\LoginController;
18 use App\Http\Controllers\Auth\RegisterController; 18 use App\Http\Controllers\Auth\RegisterController;
19 use App\Http\Controllers\CKEditorController; 19 use App\Http\Controllers\CKEditorController;
20 use App\Http\Controllers\FaqController; 20 use App\Http\Controllers\FaqController;
21 use App\Http\Controllers\MediaController; 21 use App\Http\Controllers\MediaController;
22 use App\Http\Controllers\WorkerController; 22 use App\Http\Controllers\WorkerController;
23 use App\Models\Ad_jobs; 23 use App\Models\Ad_jobs;
24 use App\Models\User; 24 use App\Models\User;
25 use App\Http\Controllers\MainController; 25 use App\Http\Controllers\MainController;
26 use App\Http\Controllers\HomeController; 26 use App\Http\Controllers\HomeController;
27 use Illuminate\Support\Facades\Route; 27 use Illuminate\Support\Facades\Route;
28 use App\Http\Controllers\Admin\CompanyController; 28 use App\Http\Controllers\Admin\CompanyController;
29 use App\Http\Controllers\Admin\Ad_EmployersController; 29 use App\Http\Controllers\Admin\Ad_EmployersController;
30 use App\Http\Controllers\Admin\MsgAnswersController; 30 use App\Http\Controllers\Admin\MsgAnswersController;
31 use App\Http\Controllers\Admin\GroupsController; 31 use App\Http\Controllers\Admin\GroupsController;
32 use App\Http\Controllers\PagesController; 32 use App\Http\Controllers\PagesController;
33 use Illuminate\Support\Facades\Storage; 33 use Illuminate\Support\Facades\Storage;
34 use App\Http\Controllers\EmployerController; 34 use App\Http\Controllers\EmployerController;
35 use App\Http\Controllers\CompanyController as FrontCompanyController; 35 use App\Http\Controllers\CompanyController as FrontCompanyController;
36 36
37 37
38 /* 38 /*
39 |-------------------------------------------------------------------------- 39 |--------------------------------------------------------------------------
40 | Web Routes 40 | Web Routes
41 |-------------------------------------------------------------------------- 41 |--------------------------------------------------------------------------
42 | 42 |
43 | Here is where you can register web routes for your application. These 43 | Here is where you can register web routes for your application. These
44 | routes are loaded by the RouteServiceProvider within a group which 44 | routes are loaded by the RouteServiceProvider within a group which
45 | contains the "web" middleware group. Now create something great! 45 | contains the "web" middleware group. Now create something great!
46 | 46 |
47 */ 47 */
48 /* 48 /*
49 Route::get('/', function () { 49 Route::get('/', function () {
50 return view('welcome'); 50 return view('welcome');
51 })->name('index'); 51 })->name('index');
52 */ 52 */
53 53
54 Route::get('/', [MainController::class, 'index'])->name('index'); 54 Route::get('/', [MainController::class, 'index'])->name('index');
55 55
56 //Роуты авторизации, регистрации, восстановления, аутентификации 56 //Роуты авторизации, регистрации, восстановления, аутентификации
57 Auth::routes(['verify' => true]); 57 Auth::routes(['verify' => true]);
58 58
59 // роуты регистрации, авторизации, восстановления пароля, верификации почты 59 // роуты регистрации, авторизации, восстановления пароля, верификации почты
60 /*Route::group([ 60 /*Route::group([
61 'as' => 'auth.', //имя маршрута, например auth.index 61 'as' => 'auth.', //имя маршрута, например auth.index
62 'prefix' => 'auth', // префикс маршрута, например, auth/index 62 'prefix' => 'auth', // префикс маршрута, например, auth/index
63 ], function () { 63 ], function () {
64 //форма регистрации 64 //форма регистрации
65 Route::get('register', [RegisterController::class, 'register'])->name('register'); 65 Route::get('register', [RegisterController::class, 'register'])->name('register');
66 66
67 //создание пользователя 67 //создание пользователя
68 Route::post('register', [RegisterController::class, 'create'])->name('create'); 68 Route::post('register', [RegisterController::class, 'create'])->name('create');
69 69
70 //форма входа авторизации 70 //форма входа авторизации
71 Route::get('login', [LoginController::class, 'login'])->name('login'); 71 Route::get('login', [LoginController::class, 'login'])->name('login');
72 72
73 //аутентификация 73 //аутентификация
74 Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); 74 Route::post('login', [LoginController::class, 'authenticate'])->name('auth');
75 75
76 //выход 76 //выход
77 Route::get('logout', [LoginController::class, 'logout'])->name('logout'); 77 Route::get('logout', [LoginController::class, 'logout'])->name('logout');
78 78
79 //форма ввода адреса почты 79 //форма ввода адреса почты
80 Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); 80 Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form');
81 81
82 //письмо на почту 82 //письмо на почту
83 Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); 83 Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail');
84 84
85 //форма восстановления пароля 85 //форма восстановления пароля
86 Route::get('reset-password/token/{token}/email/{email}', 86 Route::get('reset-password/token/{token}/email/{email}',
87 [ResetPasswordController::class, 'form'] 87 [ResetPasswordController::class, 'form']
88 )->name('reset-form'); 88 )->name('reset-form');
89 89
90 //восстановление пароля 90 //восстановление пароля
91 Route::post('reset-password', 91 Route::post('reset-password',
92 [ResetPasswordController::class, 'reset'] 92 [ResetPasswordController::class, 'reset']
93 )->name('reset-password'); 93 )->name('reset-password');
94 94
95 //сообщение о необходимости проверки адреса почты 95 //сообщение о необходимости проверки адреса почты
96 Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); 96 Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message');
97 97
98 //подтверждение адреса почты нового пользователя 98 //подтверждение адреса почты нового пользователя
99 Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) 99 Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify'])
100 ->where('token', '[a-f0-9]{32}') 100 ->where('token', '[a-f0-9]{32}')
101 ->where('id', '[0-9]+') 101 ->where('id', '[0-9]+')
102 ->name('verify-email'); 102 ->name('verify-email');
103 });*/ 103 });*/
104 104
105 //Личный кабинет пользователя 105 //Личный кабинет пользователя
106 Route::get('/home', [HomeController::class, 'index'])->name('home'); 106 Route::get('/home', [HomeController::class, 'index'])->name('home');
107 107
108 /*
109 Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) {
110 $user = User::where('email',$request->input('email'))->first();
111
112 $user->sendEmailVerificationNotification();
113
114 return 'your response';
115 })->middleware('throttle:6,1')->name('verification.resend');
116 */
117
118 // Авторизация, регистрация в админку 108 // Авторизация, регистрация в админку
119 Route::group([ 109 Route::group([
120 'as' => 'admin.', // имя маршрута, например auth.index 110 'as' => 'admin.', // имя маршрута, например auth.index
121 'prefix' => 'admin', // префикс маршрута, например auth/index 111 'prefix' => 'admin', // префикс маршрута, например auth/index
122 'middleware' => ['guest'], 112 'middleware' => ['guest'],
123 ], function () { 113 ], function () {
124 // Форма регистрации 114 // Форма регистрации
125 Route::get('register', [AdminController::class, 'register'])->name('register'); 115 Route::get('register', [AdminController::class, 'register'])->name('register');
126 // Создание пользователя 116 // Создание пользователя
127 Route::post('register', [AdminController::class, 'create'])->name('create'); 117 Route::post('register', [AdminController::class, 'create'])->name('create');
128 118
129 //Форма входа 119 //Форма входа
130 Route::get('login', [AdminController::class, 'login'])->name('login'); 120 Route::get('login', [AdminController::class, 'login'])->name('login');
131 121
132 // аутентификация 122 // аутентификация
133 Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); 123 Route::post('login', [AdminController::class, 'autenticate'])->name('auth');
134 124
135 }); 125 });
136 126
137 // Личный кабинет админки 127 // Личный кабинет админки
138 Route::group([ 128 Route::group([
139 'as' => 'admin.', // имя маршрута, например auth.index 129 'as' => 'admin.', // имя маршрута, например auth.index
140 'prefix' => 'admin', // префикс маршрута, например auth/index 130 'prefix' => 'admin', // префикс маршрута, например auth/index
141 'middleware' => ['auth', 'admin'], 131 'middleware' => ['auth', 'admin'],
142 ], function() { 132 ], function() {
143 133
144 // выход 134 // выход
145 Route::get('logout', [AdminController::class, 'logout'])->name('logout'); 135 Route::get('logout', [AdminController::class, 'logout'])->name('logout');
146 136
147 // кабинет главная страница 137 // кабинет главная страница
148 Route::get('cabinet', [AdminController::class, 'index'])->name('index'); 138 Route::get('cabinet', [AdminController::class, 'index'])->name('index');
149 Route::get('/', function () { 139 Route::get('/', function () {
150 return redirect()->route('admin.index'); 140 return redirect()->route('admin.index');
151 }); 141 });
152 142
153 // кабинет профиль админа - форма 143 // кабинет профиль админа - форма
154 Route::get('profile', [AdminController::class, 'profile'])->name('profile'); 144 Route::get('profile', [AdminController::class, 'profile'])->name('profile');
155 // кабинет профиль админа - сохранение формы 145 // кабинет профиль админа - сохранение формы
156 Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); 146 Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile');
157 147
158 //кабинет сообщения админа 148 //кабинет сообщения админа
159 //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); 149 //Route::get('messages', [AdminController::class, 'profile'])->name('profile');
160 150
161 151
162 // кабинет профиль - форма пароли 152 // кабинет профиль - форма пароли
163 Route::get('password', [AdminController::class, 'profile_password'])->name('password'); 153 Route::get('password', [AdminController::class, 'profile_password'])->name('password');
164 // кабинет профиль - сохранение формы пароля 154 // кабинет профиль - сохранение формы пароля
165 Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); 155 Route::post('password', [AdminController::class, 'profile_password_new'])->name('password');
166 156
167 157
168 // кабинет профиль пользователя - форма 158 // кабинет профиль пользователя - форма
169 Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); 159 Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile');
170 // кабинет профиль пользователя - сохранение формы 160 // кабинет профиль пользователя - сохранение формы
171 Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); 161 Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile');
172 162
173 // кабинет профиль работодатель - форма 163 // кабинет профиль работодатель - форма
174 Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); 164 Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile');
175 // кабинет профиль работодатель - сохранение формы 165 // кабинет профиль работодатель - сохранение формы
176 Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); 166 Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile');
177 // кабинет удаление профиль работодателя и юзера 167 // кабинет удаление профиль работодателя и юзера
178 Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); 168 Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer');
179 169
180 // кабинет профиль работник - форма 170 // кабинет профиль работник - форма
181 Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); 171 Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add');
182 Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); 172 Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store');
183 Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); 173 Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit');
184 // кабинет профиль работник - сохранение формы 174 // кабинет профиль работник - сохранение формы
185 Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); 175 Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update');
186 176
187 // Медиа 177 // Медиа
188 Route::get('media', [MediaController::class, 'index'])->name('media'); 178 Route::get('media', [MediaController::class, 'index'])->name('media');
189 Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media'); 179 Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media');
190 180
191 // кабинет настройки сайта - форма 181 // кабинет настройки сайта - форма
192 Route::get('config', [AdminController::class, 'config_form'])->name('config'); 182 Route::get('config', [AdminController::class, 'config_form'])->name('config');
193 // кабинет настройки сайта сохранение формы 183 // кабинет настройки сайта сохранение формы
194 Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); 184 Route::post('config', [AdminController::class, 'store_config'])->name('store_config');
195 185
196 // кабинет - новости 186 // кабинет - новости
197 Route::get('news-list', [AdminController::class, 'news_admin'])->name('news_admin'); 187 Route::get('news-list', [AdminController::class, 'news_admin'])->name('news_admin');
198 Route::get('news/add', [AdminController::class, 'new_admin_add'])->name('new_admin_add'); 188 Route::get('news/add', [AdminController::class, 'new_admin_add'])->name('new_admin_add');
199 Route::post('news/add', [AdminController::class, 'new_admin_add_save'])->name('new_admin_save_add'); 189 Route::post('news/add', [AdminController::class, 'new_admin_add_save'])->name('new_admin_save_add');
200 Route::get('news/edit/{new}', [AdminController::class, 'new_admin_edit'])->name('new_admin_edit'); 190 Route::get('news/edit/{new}', [AdminController::class, 'new_admin_edit'])->name('new_admin_edit');
201 Route::post('news/edit/{new}', [AdminController::class, 'new_admin_update_save'])->name('new_admin_update'); 191 Route::post('news/edit/{new}', [AdminController::class, 'new_admin_update_save'])->name('new_admin_update');
202 Route::get('news/delete/{new}', [AdminController::class, 'new_admin_delete'])->name('new_admin_delete'); 192 Route::get('news/delete/{new}', [AdminController::class, 'new_admin_delete'])->name('new_admin_delete');
203 193
204 // кабинет - пользователи 194 // кабинет - пользователи
205 Route::get('users', [UsersController::class, 'index'])->name('users'); 195 Route::get('users', [UsersController::class, 'index'])->name('users');
206 Route::get('user-delete/{user}', [UsersController::class, 'user_delete'])->name('user_delete'); 196 Route::get('user-delete/{user}', [UsersController::class, 'user_delete'])->name('user_delete');
207 197
208 // кабинет - пользователи 198 // кабинет - пользователи
209 Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); 199 Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users');
210 200
211 // кабинет - работодатели 201 // кабинет - работодатели
212 Route::get('employers', [EmployersController::class, 'index'])->name('employers'); 202 Route::get('employers', [EmployersController::class, 'index'])->name('employers');
213 203
214 Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); 204 Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer');
215 205
216 Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add'); 206 Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add');
217 Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save'); 207 Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save');
218 Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot'); 208 Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot');
219 Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit'); 209 Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit');
220 Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete'); 210 Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete');
221 211
222 // кабинет - соискатели 212 // кабинет - соискатели
223 Route::get('workers', [WorkersController::class, 'index'])->name('workers'); 213 Route::get('workers', [WorkersController::class, 'index'])->name('workers');
224 214
225 // кабинет - база данных 215 // кабинет - база данных
226 Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); 216 Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata');
227 Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); 217 Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata');
228 Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); 218 Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata');
229 Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); 219 Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata');
230 Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); 220 Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata');
231 Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); 221 Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata');
232 Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); 222 Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata');
233 223
234 // кабинет - вакансии 224 // кабинет - вакансии
235 Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); 225 Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers');
236 Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers'); 226 Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers');
237 Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers'); 227 Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers');
238 Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); 228 Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers');
239 Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); 229 Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers');
240 Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer'); 230 Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer');
241 231
242 // Редактирование должности в вакансии 232 // Редактирование должности в вакансии
243 Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs'); 233 Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs');
244 Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs'); 234 Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs');
245 235
246 236
247 // кабинет - категории 237 // кабинет - категории
248 //Route::get('categories', [AdminController::class, 'index'])->name('categories'); 238 //Route::get('categories', [AdminController::class, 'index'])->name('categories');
249 239
250 // СRUD-операции над Справочником Категории 240 // СRUD-операции над Справочником Категории
251 241
252 Route::resource('categories', CategoryController::class, ['except' => ['show']]); 242 Route::resource('categories', CategoryController::class, ['except' => ['show']]);
253 243
254 // CRUD-операции над справочником Категории для работодателей 244 // CRUD-операции над справочником Категории для работодателей
255 Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); 245 Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]);
256 246
257 // CRUD-операции над справочником Образование 247 // CRUD-операции над справочником Образование
258 Route::resource('education', EducationController::class, ['except' => ['show']]); 248 Route::resource('education', EducationController::class, ['except' => ['show']]);
259 249
260 Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education'); 250 Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education');
261 Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); 251 Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education');
262 Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); 252 Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education');
263 253
264 Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); 254 Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education');
265 Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education'); 255 Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education');
266 256
267 Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); 257 Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education');
268 258
269 /* 259 /*
270 * кабинет - CRUD-операции по справочнику должности 260 * кабинет - CRUD-операции по справочнику должности
271 * 261 *
272 */ 262 */
273 Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); 263 Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]);
274 264
275 // кабинет - сообщения (чтение чужих) 265 // кабинет - сообщения (чтение чужих)
276 Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); 266 Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages');
277 // кабинет - просмотр сообщения чужого (чтение) 267 // кабинет - просмотр сообщения чужого (чтение)
278 Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); 268 Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message');
279 269
280 // кабинет - сообщения (админские) 270 // кабинет - сообщения (админские)
281 Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); 271 Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages');
282 // кабинет - сообщения (админские) 272 // кабинет - сообщения (админские)
283 Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); 273 Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post');
284 // кабинет - sql - конструкция запросов 274 // кабинет - sql - конструкция запросов
285 Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); 275 Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql');
286 276
287 Route::post('admin-reject-message', [MsgAnswersController::class, 'reject_message'])->name('reject_message'); 277 Route::post('admin-reject-message', [MsgAnswersController::class, 'reject_message'])->name('reject_message');
288 Route::post('admin-send-message', [MsgAnswersController::class, 'send_message'])->name('send_message'); 278 Route::post('admin-send-message', [MsgAnswersController::class, 'send_message'])->name('send_message');
289 279
290 /* 280 /*
291 * Расписанный подход в описании каждой директорий групп пользователей. 281 * Расписанный подход в описании каждой директорий групп пользователей.
292 */ 282 */
293 // кабинет - группы пользователей 283 // кабинет - группы пользователей
294 Route::get('groups', [GroupsController::class, 'index'])->name('groups'); 284 Route::get('groups', [GroupsController::class, 'index'])->name('groups');
295 // кабинет - добавление форма группы пользователей 285 // кабинет - добавление форма группы пользователей
296 Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); 286 Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group');
297 // кабинет - сохранение формы группы пользователей 287 // кабинет - сохранение формы группы пользователей
298 Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); 288 Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store');
299 // кабинет - редактирование форма группы пользователей 289 // кабинет - редактирование форма группы пользователей
300 Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); 290 Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group');
301 // кабинет - сохранение редактированной формы группы пользователей 291 // кабинет - сохранение редактированной формы группы пользователей
302 Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); 292 Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group');
303 // кабинет - удаление группы пользователей 293 // кабинет - удаление группы пользователей
304 Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); 294 Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group');
305 295
306 296
307 // кабинет - список админов 297 // кабинет - список админов
308 Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); 298 Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin');
309 299
310 // справочник Позиции 300 // справочник Позиции
311 Route::get('positions', [AdminController::class, 'position'])->name('position'); 301 Route::get('positions', [AdminController::class, 'position'])->name('position');
312 Route::get('positions/add', [AdminController::class, 'position_add'])->name('add-position'); 302 Route::get('positions/add', [AdminController::class, 'position_add'])->name('add-position');
313 Route::post('positions/add', [AdminController::class, 'position_add_save'])->name('add-save-position'); 303 Route::post('positions/add', [AdminController::class, 'position_add_save'])->name('add-save-position');
314 Route::get('positions/edit/{position}', [AdminController::class, 'position_edit'])->name('edit-position'); 304 Route::get('positions/edit/{position}', [AdminController::class, 'position_edit'])->name('edit-position');
315 Route::post('position/edit/{position}', [AdminController::class, 'position_update'])->name('update-position'); 305 Route::post('position/edit/{position}', [AdminController::class, 'position_update'])->name('update-position');
316 Route::get('position/delete/{position}', [AdminController::class, 'position_delete'])->name('delete-position'); 306 Route::get('position/delete/{position}', [AdminController::class, 'position_delete'])->name('delete-position');
317 307
318 /////редактор////// кабинет - редактор сайта//////////////////////// 308 /////редактор////// кабинет - редактор сайта////////////////////////
319 Route::get('editor-site', function() { 309 Route::get('editor-site', function() {
320 return view('admin.editor.index'); 310 return view('admin.editor.index');
321 })->name('editor-site'); 311 })->name('editor-site');
322 312
323 313
324 // кабинет - редактор шапки-футера сайта 314 // кабинет - редактор шапки-футера сайта
325 Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); 315 Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks');
326 Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); 316 Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block');
327 Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); 317 Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store');
328 Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); 318 Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block');
329 Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); 319 Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block');
330 Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); 320 Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block');
331 Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); 321 Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block');
332 322
333 323
334 // кабинет - редактор должности на главной 324 // кабинет - редактор должности на главной
335 Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); 325 Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main');
336 326
337 // кабинет - счетчики на главной 327 // кабинет - счетчики на главной
338 Route::get('counters-main', [CompanyController::class, 'counters_main'])->name('counters-main'); 328 Route::get('counters-main', [CompanyController::class, 'counters_main'])->name('counters-main');
339 Route::post('counters-main/edit/{name}', [CompanyController::class, 'counters_main_update'])->name('counters-main-update'); 329 Route::post('counters-main/edit/{name}', [CompanyController::class, 'counters_main_update'])->name('counters-main-update');
340 330
341 // кабинет - редактор работодатели на главной 331 // кабинет - редактор работодатели на главной
342 Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); 332 Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main');
343 Route::post('employers-main-add', [CompanyController::class, 'employers_main_add'])->name('employers-main-add'); 333 Route::post('employers-main-add', [CompanyController::class, 'employers_main_add'])->name('employers-main-add');
344 Route::post('employers-main-remove', [CompanyController::class, 'employers_main_remove'])->name('employers-main-remove'); 334 Route::post('employers-main-remove', [CompanyController::class, 'employers_main_remove'])->name('employers-main-remove');
345 335
346 336
347 // кабинет - редактор seo-сайта 337 // кабинет - редактор seo-сайта
348 Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); 338 Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo');
349 Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); 339 Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo');
350 Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); 340 Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store');
351 Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); 341 Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo');
352 Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); 342 Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo');
353 Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); 343 Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo');
354 Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); 344 Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo');
355 345
356 346
357 // кабинет - редактор страниц 347 // кабинет - редактор страниц
358 Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); 348 Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages');
359 // кабинет - добавление страницы 349 // кабинет - добавление страницы
360 Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); 350 Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page');
361 // кабинет - сохранение формы страницы 351 // кабинет - сохранение формы страницы
362 Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); 352 Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store');
363 // кабинет - редактирование форма страницы 353 // кабинет - редактирование форма страницы
364 Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); 354 Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page');
365 // кабинет - сохранение редактированной формы страницы 355 // кабинет - сохранение редактированной формы страницы
366 Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); 356 Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page');
367 // кабинет - удаление страницы 357 // кабинет - удаление страницы
368 Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); 358 Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page');
369 359
370 360
371 // кабинет - реклама сайта 361 // кабинет - реклама сайта
372 Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); 362 Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames');
373 Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); 363 Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames');
374 Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); 364 Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store');
375 Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); 365 Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames');
376 Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); 366 Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames');
377 Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); 367 Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames');
378 //////////////////////////////////////////////////////////////////////// 368 ////////////////////////////////////////////////////////////////////////
379 369
380 370
381 // кабинет - отзывы о работодателе для модерации 371 // кабинет - отзывы о работодателе для модерации
382 Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); 372 Route::get('answers', [EmployersController::class, 'answers'])->name('answers');
383 373
384 // Общая страница статистики 374 // Общая страница статистики
385 Route::get('statics', function () { 375 Route::get('statics', function () {
386 return view('admin.static.index'); 376 return view('admin.static.index');
387 })->name('statics'); 377 })->name('statics');
388 378
389 // кабинет - статистика работников 379 // кабинет - статистика работников
390 Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); 380 Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers');
391 381
392 // кабинет - статистика вакансий работодателя 382 // кабинет - статистика вакансий работодателя
393 Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); 383 Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads');
394 384
395 // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника 385 // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника
396 /* 386 /*
397 * CRUD-операции над справочником дипломы и документы 387 * CRUD-операции над справочником дипломы и документы
398 */ 388 */
399 //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); 389 //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks');
400 Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); 390 Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]);
401 391
402 // кабинет - роли пользователя 392 // кабинет - роли пользователя
403 Route::get('roles', [UsersController::class, 'roles'])->name('roles'); 393 Route::get('roles', [UsersController::class, 'roles'])->name('roles');
404 394
405 Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles'); 395 Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles');
406 396
407 Route::get('logs', function() { 397 Route::get('logs', function() {
408 $files = Storage::files('logs/laravel.log'); 398 $files = Storage::files('logs/laravel.log');
409 })->name('logs'); 399 })->name('logs');
410 400
411 Route::prefix('faq')->as('faq.')->group(function () { 401 Route::prefix('faq')->as('faq.')->group(function () {
412 Route::middleware('admin')->group(function () { 402 Route::middleware('admin')->group(function () {
413 Route::get('/', [FaqController::class, 'showListForAdmin'])->name('list'); 403 Route::get('/', [FaqController::class, 'showListForAdmin'])->name('list');
414 Route::get('/create', [FaqController::class, 'create'])->name('create'); 404 Route::get('/create', [FaqController::class, 'create'])->name('create');
415 Route::post('/create', [FaqController::class, 'store'])->name('store'); 405 Route::post('/create', [FaqController::class, 'store'])->name('store');
416 Route::get('/edit/{id}', [FaqController::class, 'edit'])->name('edit'); 406 Route::get('/edit/{id}', [FaqController::class, 'edit'])->name('edit');
417 Route::put('/edit/{id}', [FaqController::class, 'update'])->name('update'); 407 Route::put('/edit/{id}', [FaqController::class, 'update'])->name('update');
418 Route::get('/destroy/{id}', [FaqController::class, 'destroy'])->name('destroy'); 408 Route::get('/destroy/{id}', [FaqController::class, 'destroy'])->name('destroy');
419 }); 409 });
420 }); 410 });
421 }); 411 });
422 412
423 // Инструментальные страницы 413 // Инструментальные страницы
424 Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); 414 Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload');
425 415
426 Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); 416 Route::get('redis/', [PagesController::class, 'redis'])->name('redis');
427 417
428 Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); 418 Route::get('excel/', [PagesController::class, 'excel'])->name('excel');
429 419
430 // Страницы с произвольным контентом 420 // Страницы с произвольным контентом
431 Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); 421 Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page');
432 422
433 // Форма обратной связи 423 // Форма обратной связи
434 Route::post('form_feedback', [PagesController::class, 'form_feedback'])->name('form_feedback'); 424 Route::post('form_feedback', [PagesController::class, 'form_feedback'])->name('form_feedback');
435 425
436 // Публичные страницы соискателя 426 // Публичные страницы соискателя
437 Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); 427 Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page');
438 428
439 //Страница вакансии 429 //Страница вакансии
440 Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); 430 Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer');
441 431
442 //Вакансии 432 //Вакансии
443 Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies'); 433 Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies');
444 434
445 //Вакансии поиск на главной 435 //Вакансии поиск на главной
446 Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies'); 436 Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies');
447 437
448 //Вакансии категория детальная 438 //Вакансии категория детальная
449 Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies'); 439 Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies');
450 440
451 // Лайк вакансии 441 // Лайк вакансии
452 Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy'); 442 Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy');
453 443
454 //Детальная страница вакансии - работодателя 444 //Детальная страница вакансии - работодателя
455 Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie'); 445 Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie');
456 446
457 Route::get('vacancy/{vacancy}', [AdEmployerController::class, 'getById'])->name('get-vacancy-by-id'); 447 Route::get('vacancy/{vacancy}', [AdEmployerController::class, 'getById'])->name('get-vacancy-by-id');
458 448
459 //Судоходные компании 449 //Судоходные компании
460 Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies'); 450 Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies');
461 451
462 //Детальная инфа о компании 452 //Детальная инфа о компании
463 Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company'); 453 Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company');
464 454
465 //Образование 455 //Образование
466 Route::get('education', [EducationFrontController::class, 'index'])->name('education'); 456 Route::get('education', [EducationFrontController::class, 'index'])->name('education');
467 Route::get('education/{education}', [EducationFrontController::class, 'show'])->name('show_education')->where('education', '[0-9]+');; 457 Route::get('education/{education}', [EducationFrontController::class, 'show'])->name('show_education')->where('education', '[0-9]+');;
468 458
469 //Новости 459 //Новости
470 Route::get('news', [MainController::class, 'news'])->name('news'); 460 Route::get('news', [MainController::class, 'news'])->name('news');
471 Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new'); 461 Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new');
472 462
473 //Контакты 463 //Контакты
474 Route::get('contacts', [MainController::class, 'contacts'])->name('contacts'); 464 Route::get('contacts', [MainController::class, 'contacts'])->name('contacts');
475 465
476 //База резюме 466 //База резюме
477 Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume'); 467 Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume');
478 Route::get('bd_resume_danger', function(){ 468 Route::get('bd_resume_danger', function(){
479 return view('employers.bd_resume_danger'); 469 return view('employers.bd_resume_danger');
480 })->name('bd_resume_danger'); 470 })->name('bd_resume_danger');
481 471
482 Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume'); 472 Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume');
483 473
484 //Анкета соискателя 474 //Анкета соискателя
485 Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile'); 475 Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile');
486 476
487 //Скачать резюме 477 //Скачать резюме
488 Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download'); 478 Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download');
489 Route::get('resume-download/all', [WorkerController::class, 'resume_download_all'])->name('resume_download_all2'); 479 Route::get('resume-download/all', [WorkerController::class, 'resume_download_all'])->name('resume_download_all2');
490 Route::get('resume-download', [WorkerController::class, 'resume_download_all'])->name('resume_download_all'); 480 Route::get('resume-download', [WorkerController::class, 'resume_download_all'])->name('resume_download_all');
491 481
492 482
493 //Вход в кабинет 483 //Вход в кабинет
494 Route::get('login', [MainController::class, 'input_login'])->name('login'); 484 Route::get('login', [MainController::class, 'input_login'])->name('login');
495 485
496 // Выход из кабинета 486 // Выход из кабинета
497 Route::get('logout', [EmployerController::class, 'logout'])->name('logout'); 487 Route::get('logout', [EmployerController::class, 'logout'])->name('logout');
498 488
499 Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker'); 489 Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker');
500 Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer'); 490 Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer');
501 491
502 //восстановление пароля 492 //восстановление пароля
503 Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password'); 493 Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password');
504 // Звезда сообщения 494 // Звезда сообщения
505 Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer'); 495 Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer');
506 496
507 // Борьба 497 // Борьба
508 Route::get('clear_cookie', function() { 498 Route::get('clear_cookie', function() {
509 \App\Classes\Cookies_vacancy::clear_vacancy(); 499 \App\Classes\Cookies_vacancy::clear_vacancy();
510 return redirect()->route('index'); 500 return redirect()->route('index');
511 })->name('clear_cookie'); 501 })->name('clear_cookie');
512 502
513 Route::get('cookies', function() { 503 Route::get('cookies', function() {
514 return view('cookies'); 504 return view('cookies');
515 })->name('cookies'); 505 })->name('cookies');
516 506
517 // Личный кабинет работник 507 // Личный кабинет работник
518 Route::group([ 508 Route::group([
519 'as' => 'worker.', // имя маршрута, например auth.index 509 'as' => 'worker.', // имя маршрута, например auth.index
520 'prefix' => 'worker', // префикс маршрута, например auth/index 510 'prefix' => 'worker', // префикс маршрута, например auth/index
521 'middleware' => ['auth', 'is_worker'], 511 'middleware' => ['auth', 'is_worker'],
522 ], function() { 512 ], function() {
523 // Формы редактирования 513 // Формы редактирования
524 Route::get('cabinet/basic_information', [WorkerController::class, 'basic_information'])->name('basic_information'); 514 Route::get('cabinet/basic_information', [WorkerController::class, 'basic_information'])->name('basic_information');
525 Route::get('cabinet/additional_documents', [WorkerController::class, 'additional_documents'])->name('additional_documents'); 515 Route::get('cabinet/additional_documents', [WorkerController::class, 'additional_documents'])->name('additional_documents');
526 516
527 // 1 страница - Моя анкета 517 // 1 страница - Моя анкета
528 Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); 518 Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet');
529 Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); 519 Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save');
530 Route::post('cabinet/cabinet_save_foto/{worker}', [WorkerController::class, 'cabinet_save_foto'])->name('cabinet_save_foto'); 520 Route::post('cabinet/cabinet_save_foto/{worker}', [WorkerController::class, 'cabinet_save_foto'])->name('cabinet_save_foto');
531 521
532 522
533 // 2 страница - Сообщения 523 // 2 страница - Сообщения
534 Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); 524 Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages');
535 Route::get('cabinet/dialog/{chat}', [WorkerController::class, 'dialog'])->name('dialog'); 525 Route::get('cabinet/dialog/{chat}', [WorkerController::class, 'dialog'])->name('dialog');
536 // 3 страница - Избранные вакансии 526 // 3 страница - Избранные вакансии
537 Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); 527 Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite');
538 // Продолжение борьбы против колорадов - избранные вакансии 528 // Продолжение борьбы против колорадов - избранные вакансии
539 Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); 529 Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado');
540 530
541 // 4 страница - Сменить пароль 531 // 4 страница - Сменить пароль
542 Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); 532 Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password');
543 Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password'); 533 Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password');
544 534
545 // 5 страница - Удалить профиль 535 // 5 страница - Удалить профиль
546 Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); 536 Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile');
547 Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); 537 Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result');
548 538
549 // Резюме -pdf 539 // Резюме -pdf
550 Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); 540 Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download');
551 541
552 // Поднятие анкеты 542 // Поднятие анкеты
553 Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); 543 Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up');
554 544
555 Route::post('test123', [WorkerController::class, 'test123'])->name('test123'); 545 Route::post('test123', [WorkerController::class, 'test123'])->name('test123');
556 546
557 // Добавление сертификата 547 // Добавление сертификата
558 Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate'); 548 Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate');
559 Route::post('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); 549 Route::post('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate');
560 Route::get('кабинет/edit_sertificate/{worker}/{doc}', [WorkerController::class, 'edit_sertificate'])->name('edit_sertificate'); 550 Route::get('кабинет/edit_sertificate/{worker}/{doc}', [WorkerController::class, 'edit_sertificate'])->name('edit_sertificate');
561 Route::get('кабинет/edit_sertificate/{doc}', [WorkerController::class, 'update_serificate'])->name('update_serificate'); 551 Route::get('кабинет/edit_sertificate/{doc}', [WorkerController::class, 'update_serificate'])->name('update_serificate');
562 Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); 552 Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate');
563 553
564 // Добавление предыдущих контактов компании 554 // Добавление предыдущих контактов компании
565 Route::get('кабинет/prev_company/{worker}', [WorkerController::class, 'new_prev_company'])->name('new_prev_company'); 555 Route::get('кабинет/prev_company/{worker}', [WorkerController::class, 'new_prev_company'])->name('new_prev_company');
566 Route::post('кабинет/add_prev_company', [WorkerController::class, 'add_prev_company'])->name('add_prev_company'); 556 Route::post('кабинет/add_prev_company', [WorkerController::class, 'add_prev_company'])->name('add_prev_company');
567 Route::get('кабинет/edit_prev_company/{doc}/{worker}', [WorkerController::class, 'edit_prev_company'])->name('edit_prev_company'); 557 Route::get('кабинет/edit_prev_company/{doc}/{worker}', [WorkerController::class, 'edit_prev_company'])->name('edit_prev_company');
568 Route::post('кабинет/update_prev_company/{doc}', [WorkerController::class, 'update_prev_company'])->name('update_prev_company'); 558 Route::post('кабинет/update_prev_company/{doc}', [WorkerController::class, 'update_prev_company'])->name('update_prev_company');
569 Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company'); 559 Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company');
570 560
571 // Добавление документа-диплома 561 // Добавление документа-диплома
572 Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); 562 Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom');
573 Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); 563 Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save');
574 Route::put('кабинет/edit_diploms/{worker}', [WorkerController::class, 'edit_diploms'])->name('edit_diploms'); 564 Route::put('кабинет/edit_diploms/{worker}', [WorkerController::class, 'edit_diploms'])->name('edit_diploms');
575 Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom'); 565 Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom');
576 566
577 // Добавление стандартного диплома 567 // Добавление стандартного диплома
578 Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); 568 Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document');
579 Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); 569 Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save');
580 Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); 570 Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document');
581 Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); 571 Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save');
582 Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); 572 Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document');
583 573
584 // Отправка сообщения работодателю от соискателя 574 // Отправка сообщения работодателю от соискателя
585 Route::post('сообщение/', [WorkerController::class, 'new_message']) 575 Route::post('сообщение/', [WorkerController::class, 'new_message'])
586 ->withoutMiddleware('is_worker') 576 ->withoutMiddleware('is_worker')
587 ->name('new_message'); 577 ->name('new_message');
588 }); 578 });
589 579
590 // Личный кабинет работодателя 580 // Личный кабинет работодателя
591 Route::group([ 581 Route::group([
592 'as' => 'employer.', // имя маршрута, например auth.index 582 'as' => 'employer.', // имя маршрута, например auth.index
593 'prefix' => 'employer', // префикс маршрута, например auth/index 583 'prefix' => 'employer', // префикс маршрута, например auth/index
594 'middleware' => ['auth', 'is_employer'], 584 'middleware' => ['auth', 'is_employer'],
595 ], function() { 585 ], function() {
596 // 0 страница - Личные данные работодателя 586 // 0 страница - Личные данные работодателя
597 Route::get('cabinet/employer_info', [EmployerController::class, 'employer_info'])->name('employer_info'); 587 Route::get('cabinet/employer_info', [EmployerController::class, 'employer_info'])->name('employer_info');
598 Route::post('cabinet/employer_info/{user}', [EmployerController::class, 'employer_info_save'])->name('employer_info_save'); 588 Route::post('cabinet/employer_info/{user}', [EmployerController::class, 'employer_info_save'])->name('employer_info_save');
599 589
600 // 1 страница - Профиль 590 // 1 страница - Профиль
601 Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); 591 Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet');
602 Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); 592 Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save');
603 Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); 593 Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot');
604 Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); 594 Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot');
605 Route::get('cabinet/flot_edit/{Flot}/{Employer}', [EmployerController::class, 'edit_flot'])->name('edit_flot'); 595 Route::get('cabinet/flot_edit/{Flot}/{Employer}', [EmployerController::class, 'edit_flot'])->name('edit_flot');
606 Route::post('cabinet/flot_edit/{Flot}', [EmployerController::class, 'update_flot'])->name('update_flot_save'); 596 Route::post('cabinet/flot_edit/{Flot}', [EmployerController::class, 'update_flot'])->name('update_flot_save');
607 Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot'); 597 Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot');
608 598
609 Route::get('social/{social}/{vacancy}', [Ad_jobsController::class, 'sendVacancyToSocial']) 599 Route::get('social/{social}/{vacancy}', [Ad_jobsController::class, 'sendVacancyToSocial'])
610 ->name('send-vacancy-to-social'); 600 ->name('send-vacancy-to-social');
611 601
612 // 2 страница - Добавление вакансий 602 // 2 страница - Добавление вакансий
613 Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); 603 Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie');
614 Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); 604 Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save');
615 //Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); 605 //Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people');
616 606
617 Route::get('cabinet/vacancie_danger', [EmployerController::class, 'cabinet_vacancie_danger'])->name('cabinet_vacancie_danger'); 607 Route::get('cabinet/vacancie_danger', [EmployerController::class, 'cabinet_vacancie_danger'])->name('cabinet_vacancie_danger');
618 608
619 609
620 610
621 Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); 611 Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people');
622 612
623 // 3 страница - Мои вакансии 613 // 3 страница - Мои вакансии
624 Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); 614 Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list');
625 Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); 615 Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit');
626 Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); 616 Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete');
627 Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); 617 Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up');
628 Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); 618 Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye');
629 Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); 619 Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit');
630 Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); 620 Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me');
631 621
632 // 4.1Ю. 622 // 4.1Ю.
633 Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac'); 623 Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac');
634 Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save'); 624 Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save');
635 Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac'); 625 Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac');
636 Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save'); 626 Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save');
637 Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac'); 627 Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac');
638 628
639 // 4 страница - Отклики на вакансии 629 // 4 страница - Отклики на вакансии
640 Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); 630 Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers');
641 Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); 631 Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple');
642 Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); 632 Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg');
643 633
644 // 5 страница - Сообщения 634 // 5 страница - Сообщения
645 Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); 635 Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages');
646 Route::get('cabinet/dialog/{chat}', [EmployerController::class, 'dialog'])->name('dialog'); 636 Route::get('cabinet/dialog/{chat}', [EmployerController::class, 'dialog'])->name('dialog');
647 Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); 637 Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message');
648 Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); 638 Route::post('test123', [EmployerController::class, 'test123'])->name('test123');
649 639
650 // 6 страница - Избранный 640 // 6 страница - Избранный
651 Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); 641 Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites');
652 642
653 //7 страница - База данных 643 //7 страница - База данных
654 Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); 644 Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd');
655 645
656 //8 страница - База резюме 646 //8 страница - База резюме
657 Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); 647 Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe');
658 648
659 // 9 рассылка сообщений 649 // 9 рассылка сообщений
660 Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); 650 Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages');
661 Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); 651 Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post');
662 652
663 // 10 страница FAQ вопрос 653 // 10 страница FAQ вопрос
664 Route::get('cabinet/faq', [FaqController::class, 'showListForUser'])->name('faq'); 654 Route::get('cabinet/faq', [FaqController::class, 'showListForUser'])->name('faq');
665 655
666 // 11 страница - Настройка уведомлений 656 // 11 страница - Настройка уведомлений
667 Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); 657 Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe');
668 Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); 658 Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe');
669 659
670 // 12 страница - Сменить пароль 660 // 12 страница - Сменить пароль
671 Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); 661 Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset');
672 Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); 662 Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password');
673 663
674 // 13 страница - Удаление профиля 664 // 13 страница - Удаление профиля
675 Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); 665 Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people');
676 Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); 666 Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user');
677 Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); 667 Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user');
678 668
679 // Отправил сообщение 669 // Отправил сообщение
680 Route::post('сообщение/', [EmployerController::class, 'new_message']) 670 Route::post('сообщение/', [EmployerController::class, 'new_message'])
681 ->withoutMiddleware('is_employer') 671 ->withoutMiddleware('is_employer')
682 ->name('new_message'); 672 ->name('new_message');
683 673
684 Route::post('pin_chat/', [EmployerController::class, 'pin_chat'])->name('pin_chat'); 674 Route::post('pin_chat/', [EmployerController::class, 'pin_chat'])->name('pin_chat');
685 Route::post('remove_chat/', [EmployerController::class, 'remove_chat'])->name('remove_chat'); 675 Route::post('remove_chat/', [EmployerController::class, 'remove_chat'])->name('remove_chat');
686 }); 676 });
687 677
688 Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker'); 678 Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker');
689 679
690 Route::post('send_message', [HomeController::class, 'send_message'])->name('send_message'); 680 Route::post('send_message', [HomeController::class, 'send_message'])->name('send_message');
691 681
692 682