Commit 0e7702a323ab760fcad0cb1c23f9003fee2b7918
1 parent
6bad752f0b
Exists in
master
task-132687 minor changes
Showing 14 changed files with 114 additions and 52 deletions Inline Diff
- app/Classes/LikesClass.php
- app/Http/Controllers/Admin/UsersController.php
- app/Http/Controllers/EmployerController.php
- app/Http/Controllers/WorkerController.php
- app/Models/Worker.php
- database/migrations/2024_10_07_073601_add_comment_to_workers_table.php
- resources/views/admin/users/form.blade.php
- resources/views/employers/bd.blade.php
- resources/views/employers/dialog.blade.php
- resources/views/employers/list_vacancy.blade.php
- resources/views/index.blade.php
- resources/views/layout/frontend.blade.php
- resources/views/layout/pdf.blade.php
- resources/views/list_vacancies.blade.php
app/Classes/LikesClass.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\Ad_employer; | 7 | use App\Models\Ad_employer; |
8 | use App\Models\Like_vacancy; | 8 | use App\Models\Like_vacancy; |
9 | use App\Models\Like_worker; | 9 | use App\Models\Like_worker; |
10 | use App\Models\Worker; | 10 | use App\Models\Worker; |
11 | use Illuminate\Support\Facades\Auth; | 11 | use Illuminate\Support\Facades\Auth; |
12 | 12 | ||
13 | class LikesClass | 13 | class LikesClass |
14 | { | 14 | { |
15 | public static function ListVacancy(Ad_employer $ad_employer) { | 15 | public static function ListVacancy(Ad_employer $ad_employer) { |
16 | $ListVacancy = Like_vacancy::query() | 16 | $ListVacancy = Like_vacancy::query() |
17 | ->where('code_record', '=', $ad_employer->id) | 17 | ->where('code_record', '=', $ad_employer->id) |
18 | ->where('user_id', Auth::user()?->id) | 18 | ->where('user_id', Auth::user()?->id) |
19 | ->get(); | 19 | ->get(); |
20 | 20 | ||
21 | return $ListVacancy; | 21 | return $ListVacancy; |
22 | } | 22 | } |
23 | 23 | ||
24 | public static function ListWorkers(Worker $worker) { | 24 | public static function ListWorkers(Worker $worker) { |
25 | $ListWorker = Like_worker::query() | 25 | $ListWorker = Like_worker::query() |
26 | ->where('code_record', '=', $worker->id) | 26 | ->where('code_record', '=', $worker->id) |
27 | ->where('user_id', Auth::user()?->id) | 27 | ->where('user_id', Auth::user()?->id) |
28 | ->get(); | 28 | ->get(); |
29 | 29 | ||
30 | return $ListWorker; | 30 | return $ListWorker; |
31 | } | 31 | } |
32 | 32 | ||
33 | public static function get_status_vacancy(Ad_employer $ad_employer) { | 33 | public static function get_status_vacancy(Ad_employer $ad_employer) { |
34 | $isVacancyLiked = Like_worker::query() | 34 | $isVacancyLiked = Like_vacancy::query() |
35 | ->where('code_record', $ad_employer->id) | 35 | ->where('code_record', $ad_employer->id) |
36 | ->where('user_id', Auth::user()?->id) | 36 | ->where('user_id', Auth::user()?->id) |
37 | ->exists(); | 37 | ->exists(); |
38 | 38 | ||
39 | if ($isVacancyLiked) { | 39 | if ($isVacancyLiked) { |
40 | return 'active'; | 40 | return 'active'; |
41 | } | 41 | } |
42 | 42 | ||
43 | return ''; | 43 | return ''; |
44 | } | 44 | } |
45 | 45 | ||
46 | public static function get_status_worker(Worker $worker) { | 46 | public static function get_status_worker(Worker $worker) { |
47 | $isWorkerLiked = Like_worker::query() | 47 | $isWorkerLiked = Like_worker::query() |
48 | ->where('code_record', $worker->id) | 48 | ->where('code_record', $worker->id) |
49 | ->where('user_id', Auth::user()?->id) | 49 | ->where('user_id', Auth::user()?->id) |
50 | ->exists(); | 50 | ->exists(); |
51 | 51 | ||
52 | if ($isWorkerLiked) { | 52 | if ($isWorkerLiked) { |
53 | return 'active'; | 53 | return 'active'; |
54 | } | 54 | } |
55 | 55 | ||
56 | return ''; | 56 | return ''; |
57 | } | 57 | } |
58 | } | 58 | } |
59 | 59 |
app/Http/Controllers/Admin/UsersController.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Http\Controllers\Admin; | 3 | namespace App\Http\Controllers\Admin; |
4 | 4 | ||
5 | use App\Http\Controllers\Controller; | 5 | use App\Http\Controllers\Controller; |
6 | use App\Http\Requests\BaseUserRequest; | 6 | use App\Http\Requests\BaseUserRequest; |
7 | use App\Models\ContentRoles; | 7 | use App\Models\ContentRoles; |
8 | use App\Models\Job_title; | 8 | use App\Models\Job_title; |
9 | use App\Models\User; | 9 | use App\Models\User; |
10 | use App\Models\Worker; | 10 | use App\Models\Worker; |
11 | use Illuminate\Http\Request; | 11 | use Illuminate\Http\Request; |
12 | use Illuminate\Support\Facades\Auth; | 12 | use Illuminate\Support\Facades\Auth; |
13 | use Illuminate\Support\Facades\Storage; | 13 | use Illuminate\Support\Facades\Storage; |
14 | use PhpOffice\PhpSpreadsheet\Spreadsheet; | 14 | use PhpOffice\PhpSpreadsheet\Spreadsheet; |
15 | use PhpOffice\PhpSpreadsheet\Style\Alignment; | 15 | use PhpOffice\PhpSpreadsheet\Style\Alignment; |
16 | use PhpOffice\PhpSpreadsheet\Style\Border; | 16 | use PhpOffice\PhpSpreadsheet\Style\Border; |
17 | use PhpOffice\PhpSpreadsheet\Style\Font; | 17 | use PhpOffice\PhpSpreadsheet\Style\Font; |
18 | use PhpOffice\PhpSpreadsheet\Writer\Xlsx; | 18 | use PhpOffice\PhpSpreadsheet\Writer\Xlsx; |
19 | 19 | ||
20 | class UsersController extends Controller | 20 | class UsersController extends Controller |
21 | { | 21 | { |
22 | public function index(Request $request) { | 22 | public function index(Request $request) { |
23 | $title = 'Админка - Пользователи системы'; | 23 | $title = 'Админка - Пользователи системы'; |
24 | $id_admin = Auth::user()->id; | 24 | $id_admin = Auth::user()->id; |
25 | if ($request->ajax()) { | 25 | if ($request->ajax()) { |
26 | $user = User::find($request->id); | 26 | $user = User::find($request->id); |
27 | $request->offsetUnset('id'); | 27 | $request->offsetUnset('id'); |
28 | $user->update($request->all()); | 28 | $user->update($request->all()); |
29 | } | 29 | } |
30 | 30 | ||
31 | $find_key = ""; | 31 | $find_key = ""; |
32 | $users = User::query(); | 32 | $users = User::query(); |
33 | if (isset($request->find)) { | 33 | if (isset($request->find)) { |
34 | $find_key = $request->find; | 34 | $find_key = $request->find; |
35 | $users = $users->where('name', 'LIKE', "%$find_key%") | 35 | $users = $users->where('name', 'LIKE', "%$find_key%") |
36 | ->orWhere('email', 'LIKE', "%$find_key%"); | 36 | ->orWhere('email', 'LIKE', "%$find_key%"); |
37 | } | 37 | } |
38 | 38 | ||
39 | $users = $users->paginate(15); | 39 | $users = $users->paginate(15); |
40 | 40 | ||
41 | if ($request->ajax()) { | 41 | if ($request->ajax()) { |
42 | return view('admin.users.index_ajax', compact('users', 'id_admin')); | 42 | return view('admin.users.index_ajax', compact('users', 'id_admin')); |
43 | } else { | 43 | } else { |
44 | return view('admin.users.index', compact('users', 'title', 'id_admin', 'find_key')); | 44 | return view('admin.users.index', compact('users', 'title', 'id_admin', 'find_key')); |
45 | } | 45 | } |
46 | } | 46 | } |
47 | 47 | ||
48 | public function user_delete(User $user) { | 48 | public function user_delete(User $user) { |
49 | $id = $user->delete(); | 49 | $id = $user->delete(); |
50 | 50 | ||
51 | return redirect()->route('admin.users')->with('Пользователь был удален из системы'); | 51 | return redirect()->route('admin.users')->with('Пользователь был удален из системы'); |
52 | } | 52 | } |
53 | 53 | ||
54 | public function index_bd(Request $request) { | 54 | public function index_bd(Request $request) { |
55 | $title = 'Админка - Пользователи базы данных'; | 55 | $title = 'Админка - Пользователи базы данных'; |
56 | 56 | ||
57 | $find_key = ""; | 57 | $find_key = ""; |
58 | $users = User::query(); | 58 | $users = User::query(); |
59 | if (isset($request->find)) { | 59 | if (isset($request->find)) { |
60 | $find_key = $request->find; | 60 | $find_key = $request->find; |
61 | $users = $users->where('name', 'LIKE', "%$find_key%") | 61 | $users = $users->where('name', 'LIKE', "%$find_key%") |
62 | ->orWhere('email', 'LIKE', "%$find_key%") | 62 | ->orWhere('email', 'LIKE', "%$find_key%") |
63 | ->orWhere('telephone', 'LIKE', "%$find_key%"); | 63 | ->orWhere('telephone', 'LIKE', "%$find_key%"); |
64 | } | 64 | } |
65 | 65 | ||
66 | $users = $users->Baseuser() | 66 | $users = $users->Baseuser() |
67 | ->orderByDesc(Worker::select('created_at')->whereColumn('workers.user_id', 'users.id')) | 67 | ->orderByDesc(Worker::select('created_at')->whereColumn('workers.user_id', 'users.id')) |
68 | ->paginate(15); | 68 | ->paginate(15); |
69 | 69 | ||
70 | if ($request->ajax()) { | 70 | if ($request->ajax()) { |
71 | return view('admin.users.index_bd_ajax', compact('users')); | 71 | return view('admin.users.index_bd_ajax', compact('users')); |
72 | } else { | 72 | } else { |
73 | return view('admin.users.index_bd', compact('users', 'title', 'find_key')); | 73 | return view('admin.users.index_bd', compact('users', 'title', 'find_key')); |
74 | } | 74 | } |
75 | } | 75 | } |
76 | 76 | ||
77 | public function add_bd() { | 77 | public function add_bd() { |
78 | $list_job_titles = Job_title::query()->active()->where('is_bd', '=' , '2')->orderBy('name', 'asc')->get(); | 78 | $list_job_titles = Job_title::query()->active()->where('is_bd', '=' , '2')->orderBy('name', 'asc')->get(); |
79 | return view('admin.users.add', compact('list_job_titles')); | 79 | return view('admin.users.add', compact('list_job_titles')); |
80 | } | 80 | } |
81 | 81 | ||
82 | public function add_store_bd(BaseUserRequest $request) { | 82 | public function add_store_bd(BaseUserRequest $request) { |
83 | $params = $request->all(); | 83 | $params = $request->all(); |
84 | $positions_work = json_encode($request->input('positions_work', [])); | ||
85 | 84 | ||
86 | if ($request->has('file')) { | 85 | if ($request->has('file')) { |
87 | $params['file'] = $request->file('file')->store('basedata', 'public'); | 86 | $params['file'] = $request->file('file')->store('basedata', 'public'); |
88 | } | 87 | } |
89 | 88 | ||
90 | if (isset($request->name)) { | 89 | if (isset($request->name)) { |
91 | $params['name'] = $request->surname." ".$request->name_man." ".$request->surname2; | 90 | $params['name'] = $request->surname." ".$request->name_man." ".$request->surname2; |
92 | } | 91 | } |
93 | 92 | ||
94 | $user = User::create($params); | 93 | $user = User::create($params); |
95 | $user_id = $user->id; | ||
96 | $worker = new Worker(); | 94 | $worker = new Worker(); |
97 | $worker->positions_work = $positions_work; | 95 | $worker->positions_work = isset($params['positions_work']) ? json_encode($params['positions_work']) : []; |
98 | $worker->user_id = $user_id; | 96 | $worker->user_id = $user->id; |
97 | $worker->comment = isset($params['comment']) ? $params['comment'] : null; | ||
99 | $worker->save(); | 98 | $worker->save(); |
100 | 99 | ||
101 | return redirect()->route('admin.basedata'); | 100 | return redirect()->route('admin.basedata'); |
102 | } | 101 | } |
103 | 102 | ||
104 | public function edit_bd(User $user) { | 103 | public function edit_bd(User $user) { |
105 | $list_job_titles = Job_title::query()->active()->where('is_bd', '=' , '2')-> | 104 | $list_job_titles = Job_title::query()->active()->where('is_bd', '=' , '2')-> |
106 | orderByDesc('sort')->orderBy('name', 'asc')->get(); | 105 | orderByDesc('sort')->orderBy('name', 'asc')->get(); |
107 | return view('admin.users.edit', compact('user', 'list_job_titles')); | 106 | return view('admin.users.edit', compact('user', 'list_job_titles')); |
108 | } | 107 | } |
109 | 108 | ||
110 | public function update_bd(BaseUserRequest $request, User $user) { | 109 | public function update_bd(BaseUserRequest $request, User $user) { |
111 | $params = $request->all(); | 110 | $params = $request->all(); |
112 | $positions_work = $request->input('positions_work', []); | 111 | $positions_work = $request->input('positions_work', []); |
113 | 112 | ||
114 | if ($request->has('file')) { | 113 | if ($request->has('file')) { |
115 | if (!empty($user->file)) Storage::delete($user->file); | 114 | if (!empty($user->file)) Storage::delete($user->file); |
116 | $params['file'] = $request->file('file')->store('basedata', 'public'); | 115 | $params['file'] = $request->file('file')->store('basedata', 'public'); |
117 | } else { | 116 | } else { |
118 | if (!empty($user->image)) $params['file'] = $user->file; | 117 | if (!empty($user->image)) $params['file'] = $user->file; |
119 | } | 118 | } |
120 | 119 | ||
121 | if (isset($request->name)) { | 120 | if (isset($request->name)) { |
122 | $params['name'] = $request->surname." ".$request->name_man." ".$request->surname2; | 121 | $params['name'] = $request->surname." ".$request->name_man." ".$request->surname2; |
123 | } | 122 | } |
124 | 123 | ||
125 | $user->update($params); | 124 | $user->update($params); |
126 | if (isset($user->workers[0]->id)) { | 125 | if (isset($user->workers[0]->id)) { |
127 | $worker = Worker::find($user->workers[0]->id); | 126 | $worker = Worker::find($user->workers[0]->id); |
128 | $worker->positions_work = $positions_work; | 127 | $worker->positions_work = $positions_work; |
128 | $worker->comment = isset($params['comment']) ? $params['comment'] : null; | ||
129 | $worker->save(); | 129 | $worker->save(); |
130 | } else { | 130 | } else { |
131 | $worker = new Worker(); | 131 | $worker = new Worker(); |
132 | $worker->user_id = $user->id; | 132 | $worker->user_id = $user->id; |
133 | $worker->positions_work = $positions_work; | 133 | $worker->positions_work = $positions_work; |
134 | $worker->comment = isset($params['comment']) ? $params['comment'] : null; | ||
134 | $worker->save(); | 135 | $worker->save(); |
135 | } | 136 | } |
136 | 137 | ||
137 | return redirect()->route('admin.basedata'); | 138 | return redirect()->route('admin.basedata'); |
138 | } | 139 | } |
139 | 140 | ||
140 | public function destroy_bd(User $user) { | 141 | public function destroy_bd(User $user) { |
141 | $user->delete(); | 142 | $user->delete(); |
142 | return redirect()->route('admin.basedata'); | 143 | return redirect()->route('admin.basedata'); |
143 | } | 144 | } |
144 | 145 | ||
145 | public function roles(Request $request) { | 146 | public function roles(Request $request) { |
146 | if ($request->ajax()) { | 147 | if ($request->ajax()) { |
147 | $user = User::find($request->id); | 148 | $user = User::find($request->id); |
148 | $request->offsetUnset('id'); | 149 | $request->offsetUnset('id'); |
149 | $user->update($request->all()); | 150 | $user->update($request->all()); |
150 | } | 151 | } |
151 | 152 | ||
152 | $users = User::query()->Realuser()->paginate(15); | 153 | $users = User::query()->Realuser()->paginate(15); |
153 | 154 | ||
154 | if ($request->ajax()) { | 155 | if ($request->ajax()) { |
155 | return view('admin.users.roles.index_ajax', compact('users')); | 156 | return view('admin.users.roles.index_ajax', compact('users')); |
156 | } else { | 157 | } else { |
157 | return view('admin.users.roles.index', compact('users')); | 158 | return view('admin.users.roles.index', compact('users')); |
158 | } | 159 | } |
159 | } | 160 | } |
160 | 161 | ||
161 | public function admin_roles(Request $request) { | 162 | public function admin_roles(Request $request) { |
162 | 163 | ||
163 | if ($request->ajax()) { | 164 | if ($request->ajax()) { |
164 | $id = $request->id; | 165 | $id = $request->id; |
165 | $request->offsetUnset('id'); | 166 | $request->offsetUnset('id'); |
166 | ContentRoles::where('id', '=', $id)->update($request->all()); | 167 | ContentRoles::where('id', '=', $id)->update($request->all()); |
167 | } | 168 | } |
168 | $roles = ContentRoles::query()->OrderBy('id')->paginate(25); | 169 | $roles = ContentRoles::query()->OrderBy('id')->paginate(25); |
169 | 170 | ||
170 | 171 | ||
171 | if ($request->ajax()) { | 172 | if ($request->ajax()) { |
172 | return view('admin.content.roles_index_ajax', compact('roles')); | 173 | return view('admin.content.roles_index_ajax', compact('roles')); |
173 | } else { | 174 | } else { |
174 | return view('admin.content.roles_index', compact('roles')); | 175 | return view('admin.content.roles_index', compact('roles')); |
175 | } | 176 | } |
176 | } | 177 | } |
177 | 178 | ||
178 | public function doc_bd(User $user) { | 179 | public function doc_bd(User $user) { |
179 | $id = $user->id; | 180 | $id = $user->id; |
180 | $spreadsheet = new Spreadsheet(); | 181 | $spreadsheet = new Spreadsheet(); |
181 | $activeWorksheet = $spreadsheet->getActiveSheet(); | 182 | $activeWorksheet = $spreadsheet->getActiveSheet(); |
182 | $activeWorksheet->setCellValue('A1', 'Отчет по соискателю'); | 183 | $activeWorksheet->setCellValue('A1', 'Отчет по соискателю'); |
183 | $activeWorksheet->getStyle('A1')->applyFromArray([ | 184 | $activeWorksheet->getStyle('A1')->applyFromArray([ |
184 | 'font' => [ | 185 | 'font' => [ |
185 | 'name' => 'Arial', | 186 | 'name' => 'Arial', |
186 | 'bold' => true, | 187 | 'bold' => true, |
187 | 'italic' => false, | 188 | 'italic' => false, |
188 | 'underline' => Font::UNDERLINE_DOUBLE, | 189 | 'underline' => Font::UNDERLINE_DOUBLE, |
189 | 'strikethrough' => false, | 190 | 'strikethrough' => false, |
190 | 'color' => [ | 191 | 'color' => [ |
191 | 'rgb' => '808080' | 192 | 'rgb' => '808080' |
192 | ] | 193 | ] |
193 | ], | 194 | ], |
194 | 'borders' => [ | 195 | 'borders' => [ |
195 | 'allBorders' => [ | 196 | 'allBorders' => [ |
196 | 'borderStyle' => Border::BORDER_THIN, | 197 | 'borderStyle' => Border::BORDER_THIN, |
197 | 'color' => [ | 198 | 'color' => [ |
198 | 'rgb' => '808080' | 199 | 'rgb' => '808080' |
199 | ] | 200 | ] |
200 | ], | 201 | ], |
201 | 'outline' => array( | 202 | 'outline' => array( |
202 | 'style' => Border::BORDER_THIN, | 203 | 'style' => Border::BORDER_THIN, |
203 | 'color' => array('rgb' => '000000') | 204 | 'color' => array('rgb' => '000000') |
204 | ), | 205 | ), |
205 | ], | 206 | ], |
206 | 207 | ||
207 | 'alignment' => [ | 208 | 'alignment' => [ |
208 | 'horizontal' => Alignment::HORIZONTAL_CENTER, | 209 | 'horizontal' => Alignment::HORIZONTAL_CENTER, |
209 | 'vertical' => Alignment::VERTICAL_CENTER, | 210 | 'vertical' => Alignment::VERTICAL_CENTER, |
210 | 'wrapText' => true, | 211 | 'wrapText' => true, |
211 | ] | 212 | ] |
212 | ]); | 213 | ]); |
213 | 214 | ||
214 | $activeWorksheet->setCellValue('A2', "Псевдоним/имя: ".$user->name); | 215 | $activeWorksheet->setCellValue('A2', "Псевдоним/имя: ".$user->name); |
215 | $activeWorksheet->setCellValue('A3', "Фамилия: ".$user->surname); | 216 | $activeWorksheet->setCellValue('A3', "Фамилия: ".$user->surname); |
216 | $activeWorksheet->setCellValue('A4', "Имя: ".$user->name_man); | 217 | $activeWorksheet->setCellValue('A4', "Имя: ".$user->name_man); |
217 | $activeWorksheet->setCellValue('A5', "Отчество: ".$user->surname2); | 218 | $activeWorksheet->setCellValue('A5', "Отчество: ".$user->surname2); |
218 | $activeWorksheet->setCellValue('A6', "Телефон: ".$user->telephone); | 219 | $activeWorksheet->setCellValue('A6', "Телефон: ".$user->telephone); |
219 | $activeWorksheet->setCellValue('A7', "Емайл: ".$user->email); | 220 | $activeWorksheet->setCellValue('A7', "Емайл: ".$user->email); |
220 | 221 | ||
221 | if (isset($user->workers[0]->id)) { | 222 | if (isset($user->workers[0]->id)) { |
222 | $activeWorksheet->setCellValue('A9', "Анкета: "); | 223 | $activeWorksheet->setCellValue('A9', "Анкета: "); |
223 | $activeWorksheet->setCellValue('A10', "Телефон: " . $user->workers[0]->telephone); | 224 | $activeWorksheet->setCellValue('A10', "Телефон: " . $user->workers[0]->telephone); |
224 | $activeWorksheet->setCellValue('A11', "Емайл: " . $user->workers[0]->email); | 225 | $activeWorksheet->setCellValue('A11', "Емайл: " . $user->workers[0]->email); |
225 | } | 226 | } |
226 | 227 | ||
227 | if (isset($user->jobtitles[0]->id)) { | 228 | if (isset($user->jobtitles[0]->id)) { |
228 | $activeWorksheet->setCellValue('A12', "Должность: " . $user->jobtitles[0]->name); | 229 | $activeWorksheet->setCellValue('A12', "Должность: " . $user->jobtitles[0]->name); |
229 | } | 230 | } |
230 | $activeWorksheet->getColumnDimension("A")->setWidth(100); | 231 | $activeWorksheet->getColumnDimension("A")->setWidth(100); |
231 | $writer = new Xlsx($spreadsheet); | 232 | $writer = new Xlsx($spreadsheet); |
232 | 233 | ||
233 | header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); | 234 | header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); |
234 | header('Content-Disposition: attachment; filename="user'.$id.'.xlsx"'); | 235 | header('Content-Disposition: attachment; filename="user'.$id.'.xlsx"'); |
235 | header('Cache-Control: no-cache'); | 236 | header('Cache-Control: no-cache'); |
236 | 237 | ||
237 | $writer->save('php://output'); | 238 | $writer->save('php://output'); |
238 | $writer->save(storage_path("app/public/export/user$id.xlsx")); | 239 | $writer->save(storage_path("app/public/export/user$id.xlsx")); |
239 | 240 | ||
240 | //$spreadsheet->disconnectWorksheets(); | 241 | //$spreadsheet->disconnectWorksheets(); |
241 | return redirect()->route('admin.basedata'); | 242 | return redirect()->route('admin.basedata'); |
242 | 243 | ||
243 | } | 244 | } |
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 | $id = Auth()->user()->id; | 161 | $id = Auth()->user()->id; |
162 | 162 | ||
163 | if (Auth()->user()->is_public) { | 163 | if (Auth()->user()->is_public) { |
164 | $categories = Category::query()->active()->get(); | 164 | $categories = Category::query()->active()->get(); |
165 | $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> | 165 | $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> |
166 | where('is_remove', '=', '0')-> | 166 | where('is_remove', '=', '0')-> |
167 | where('is_bd', '=', '0')-> | 167 | where('is_bd', '=', '0')-> |
168 | get(); | 168 | get(); |
169 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | 169 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
170 | WhereHas('users', | 170 | WhereHas('users', |
171 | function (Builder $query) use ($id) { | 171 | function (Builder $query) use ($id) { |
172 | $query->Where('id', $id); | 172 | $query->Where('id', $id); |
173 | })->get(); | 173 | })->get(); |
174 | return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories')); | 174 | return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories')); |
175 | } else { | 175 | } else { |
176 | return redirect()->route('employer.cabinet_vacancie_danger'); | 176 | return redirect()->route('employer.cabinet_vacancie_danger'); |
177 | } | 177 | } |
178 | } | 178 | } |
179 | 179 | ||
180 | // Форма предупреждения об оплате | 180 | // Форма предупреждения об оплате |
181 | public function cabinet_vacancie_danger() { | 181 | public function cabinet_vacancie_danger() { |
182 | return view('employers.add_vacancy_danger'); | 182 | return view('employers.add_vacancy_danger'); |
183 | } | 183 | } |
184 | 184 | ||
185 | // Сохранение вакансии | 185 | // Сохранение вакансии |
186 | public function cabinet_vacancy_save1(VacancyRequestEdit $request) { | 186 | public function cabinet_vacancy_save1(VacancyRequestEdit $request) { |
187 | $params_emp = $request->all(); | 187 | $params_emp = $request->all(); |
188 | 188 | ||
189 | $params_job["job_title_id"] = $params_emp['job_title_id']; | 189 | $params_job["job_title_id"] = $params_emp['job_title_id']; |
190 | //$params_job["min_salary"] = $params_emp['min_salary']; | 190 | //$params_job["min_salary"] = $params_emp['min_salary']; |
191 | //$params_job["max_salary"] = $params_emp['max_salary']; | 191 | //$params_job["max_salary"] = $params_emp['max_salary']; |
192 | //$params_job["region"] = $params_emp['region']; | 192 | //$params_job["region"] = $params_emp['region']; |
193 | //$params_job["power"] = $params_emp['power']; | 193 | //$params_job["power"] = $params_emp['power']; |
194 | //$params_job["sytki"] = $params_emp['sytki']; | 194 | //$params_job["sytki"] = $params_emp['sytki']; |
195 | //$params_job["start"] = $params_emp['start']; | 195 | //$params_job["start"] = $params_emp['start']; |
196 | //$params_job["flot"] = $params_emp['flot']; | 196 | //$params_job["flot"] = $params_emp['flot']; |
197 | //$params_job["description"] = $params_emp['description']; | 197 | //$params_job["description"] = $params_emp['description']; |
198 | 198 | ||
199 | $ad_jobs = Ad_employer::create($params_emp); | 199 | $ad_jobs = Ad_employer::create($params_emp); |
200 | //$params_job['ad_employer_id'] = $ad_jobs->id; | 200 | //$params_job['ad_employer_id'] = $ad_jobs->id; |
201 | //Ad_jobs::create($params_job); | 201 | //Ad_jobs::create($params_job); |
202 | $ad_jobs->jobs()->sync($request->get('job_title_id')); | 202 | $ad_jobs->jobs()->sync($request->get('job_title_id')); |
203 | 203 | ||
204 | return redirect()->route('employer.vacancy_list'); | 204 | return redirect()->route('employer.vacancy_list'); |
205 | } | 205 | } |
206 | 206 | ||
207 | // Список вакансий | 207 | // Список вакансий |
208 | public function vacancy_list(Request $request) { | 208 | public function vacancy_list(Request $request) { |
209 | $id = Auth()->user()->id; | 209 | $id = Auth()->user()->id; |
210 | 210 | ||
211 | //dd($request->all()); | 211 | //dd($request->all()); |
212 | $Employer = Employer::query()->where('user_id', $id)->first(); | 212 | $Employer = Employer::query()->where('user_id', $id)->first(); |
213 | $vacancy_list = Ad_employer::query() | 213 | $vacancy_list = Ad_employer::query() |
214 | ->with('jobs') | 214 | ->with('jobs') |
215 | ->with('jobs_code') | 215 | ->with('jobs_code') |
216 | ->where('employer_id', $Employer->id) | 216 | ->where('employer_id', $Employer->id) |
217 | ->where('is_remove', 0) | 217 | ->where('is_remove', 0) |
218 | ->orderbyDesc('updated_at') | 218 | ->orderbyDesc('updated_at') |
219 | ; | 219 | ; |
220 | 220 | ||
221 | if (($request->has('search')) && (!empty($request->get('search')))) { | 221 | if (($request->has('search')) && (!empty($request->get('search')))) { |
222 | $search = $request->get('search'); | 222 | $search = $request->get('search'); |
223 | $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%"); | 223 | $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%"); |
224 | } | 224 | } |
225 | 225 | ||
226 | if ($request->get('sort')) { | 226 | if ($request->get('sort')) { |
227 | $sort = $request->get('sort'); | 227 | $sort = $request->get('sort'); |
228 | switch ($sort) { | 228 | switch ($sort) { |
229 | case 'nopublic': $vacancy_list->where('active_is', '=', 0);break; | 229 | case 'nopublic': $vacancy_list->where('active_is', '=', 0);break; |
230 | case 'public':$vacancy_list->where('active_is', '=', 1);break; | 230 | case 'public':$vacancy_list->where('active_is', '=', 1);break; |
231 | default: $vacancy_list = $vacancy_list->orderByDesc('id'); break; | 231 | default: $vacancy_list = $vacancy_list->orderByDesc('id'); break; |
232 | } | 232 | } |
233 | } else { | 233 | } else { |
234 | $vacancy_list = $vacancy_list->orderByDesc('updated_at')->orderBy('id'); | 234 | $vacancy_list = $vacancy_list->orderByDesc('updated_at')->orderBy('id'); |
235 | } | 235 | } |
236 | 236 | ||
237 | $vacancy_list = $vacancy_list->paginate(10); | 237 | $vacancy_list = $vacancy_list->paginate(10); |
238 | 238 | ||
239 | //ajax | 239 | //ajax |
240 | if ($request->ajax()) { | 240 | if ($request->ajax()) { |
241 | return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); | 241 | return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); |
242 | } else { | 242 | } else { |
243 | return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); | 243 | return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); |
244 | } | 244 | } |
245 | } | 245 | } |
246 | 246 | ||
247 | // Карточка вакансии | 247 | // Карточка вакансии |
248 | public function vacancy_edit(Ad_employer $ad_employer) { | 248 | public function vacancy_edit(Ad_employer $ad_employer) { |
249 | $id = Auth()->user()->id; | 249 | $id = Auth()->user()->id; |
250 | $Positions = Category::query()->where('is_remove', '=', '0')->get(); | 250 | $Positions = Category::query()->where('is_remove', '=', '0')->get(); |
251 | 251 | ||
252 | $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> | 252 | $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> |
253 | where('is_remove', '=', '0')-> | 253 | where('is_remove', '=', '0')-> |
254 | where('is_bd', '=', '0')->get(); | 254 | where('is_bd', '=', '0')->get(); |
255 | 255 | ||
256 | $Employer = Employer::query()->with('users')->with('ads')-> | 256 | $Employer = Employer::query()->with('users')->with('ads')-> |
257 | with('flots')->where('user_id', $id)->first(); | 257 | with('flots')->where('user_id', $id)->first(); |
258 | 258 | ||
259 | return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); | 259 | return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); |
260 | } | 260 | } |
261 | 261 | ||
262 | // Сохранение-редактирование записи | 262 | // Сохранение-редактирование записи |
263 | public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { | 263 | public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { |
264 | $params = $request->all(); | 264 | $params = $request->all(); |
265 | $params_job["job_title_id"] = $params['job_title_id']; | 265 | $params_job["job_title_id"] = $params['job_title_id']; |
266 | 266 | ||
267 | $ad_employer->update($params); | 267 | $ad_employer->update($params); |
268 | $ad_employer->jobs()->sync($request->get('job_title_id')); | 268 | $ad_employer->jobs()->sync($request->get('job_title_id')); |
269 | 269 | ||
270 | $id = Auth()->user()->id; | 270 | $id = Auth()->user()->id; |
271 | $Positions = Category::query()->where('is_remove', '=', '0')->get(); | 271 | $Positions = Category::query()->where('is_remove', '=', '0')->get(); |
272 | $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name') | 272 | $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name') |
273 | ->where('is_remove', '=', '0') | 273 | ->where('is_remove', '=', '0') |
274 | ->where('is_bd', '=', '0') | 274 | ->where('is_bd', '=', '0') |
275 | ->get(); | 275 | ->get(); |
276 | 276 | ||
277 | $Employer = Employer::query() | 277 | $Employer = Employer::query() |
278 | ->with('users')->with('ads')->with('flots')->where('user_id', $id)->first(); | 278 | ->with('users')->with('ads')->with('flots')->where('user_id', $id)->first(); |
279 | return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); | 279 | return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); |
280 | } | 280 | } |
281 | 281 | ||
282 | // Сохранение карточки вакансии | 282 | // Сохранение карточки вакансии |
283 | public function vacancy_save(Request $request, Ad_employer $ad_employer) { | 283 | public function vacancy_save(Request $request, Ad_employer $ad_employer) { |
284 | $all = $request->all(); | 284 | $all = $request->all(); |
285 | $ad_employer->update($all); | 285 | $ad_employer->update($all); |
286 | return redirect()->route('employer.cabinet_vacancie'); | 286 | return redirect()->route('employer.cabinet_vacancie'); |
287 | } | 287 | } |
288 | 288 | ||
289 | // Удаление карточки вакансии | 289 | // Удаление карточки вакансии |
290 | public function vacancy_delete(Ad_employer $ad_employer) { | 290 | public function vacancy_delete(Ad_employer $ad_employer) { |
291 | $ad_employer->delete(); | 291 | $ad_employer->delete(); |
292 | 292 | ||
293 | return redirect()->route('employer.vacancy_list') | 293 | return redirect()->route('employer.vacancy_list') |
294 | ->with('success', 'Данные были успешно сохранены'); | 294 | ->with('success', 'Данные были успешно сохранены'); |
295 | } | 295 | } |
296 | 296 | ||
297 | // Обновление даты | 297 | // Обновление даты |
298 | public function vacancy_up(Ad_employer $ad_employer) { | 298 | public function vacancy_up(Ad_employer $ad_employer) { |
299 | $up = date('m/d/Y h:i:s', time()); | 299 | $up = date('m/d/Y h:i:s', time()); |
300 | $ad_employer->updated_at = $up; | 300 | $ad_employer->updated_at = $up; |
301 | $ad_employer->save(); | 301 | $ad_employer->save(); |
302 | 302 | ||
303 | return redirect()->back(); | 303 | return redirect()->back(); |
304 | } | 304 | } |
305 | 305 | ||
306 | //Видимость вакансии | 306 | //Видимость вакансии |
307 | public function vacancy_eye(Ad_employer $ad_employer, $status) { | 307 | public function vacancy_eye(Ad_employer $ad_employer, $status) { |
308 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); | 308 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); |
309 | $vac_emp->active_is = $status; | 309 | $vac_emp->active_is = $status; |
310 | $vac_emp->save(); | 310 | $vac_emp->save(); |
311 | 311 | ||
312 | return redirect()->route('employer.vacancy_list'); | 312 | return redirect()->route('employer.vacancy_list'); |
313 | } | 313 | } |
314 | 314 | ||
315 | //Вакансия редактирования (шаблон) | 315 | //Вакансия редактирования (шаблон) |
316 | public function vacancy_update(Ad_employer $id) { | 316 | public function vacancy_update(Ad_employer $id) { |
317 | 317 | ||
318 | } | 318 | } |
319 | 319 | ||
320 | //Отклики на вакансию - лист | 320 | //Отклики на вакансию - лист |
321 | public function answers(Employer $employer, Request $request) { | 321 | public function answers(Employer $employer, Request $request) { |
322 | $user_id = Auth()->user()->id; | 322 | $user_id = Auth()->user()->id; |
323 | $answer = Ad_employer::query()->where('employer_id', $employer->id); | 323 | $answer = Ad_employer::query()->where('employer_id', $employer->id); |
324 | if ($request->has('search')) { | 324 | if ($request->has('search')) { |
325 | $search = trim($request->get('search')); | 325 | $search = trim($request->get('search')); |
326 | if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); | 326 | if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); |
327 | } | 327 | } |
328 | 328 | ||
329 | $answer = $answer->with('response')->OrderByDESC('id')->get(); | 329 | $answer = $answer->with('response')->OrderByDESC('id')->get(); |
330 | 330 | ||
331 | return view('employers.list_answer', compact('answer', 'user_id', 'employer')); | 331 | return view('employers.list_answer', compact('answer', 'user_id', 'employer')); |
332 | } | 332 | } |
333 | 333 | ||
334 | //Обновление статуса | 334 | //Обновление статуса |
335 | public function supple_status(employer $employer, ad_response $ad_response, $flag) { | 335 | public function supple_status(employer $employer, ad_response $ad_response, $flag) { |
336 | $ad_response->update(Array('flag' => $flag)); | 336 | $ad_response->update(Array('flag' => $flag)); |
337 | return redirect()->route('employer.answers', ['employer' => $employer->id]); | 337 | return redirect()->route('employer.answers', ['employer' => $employer->id]); |
338 | } | 338 | } |
339 | 339 | ||
340 | //Страницы сообщений список | 340 | //Страницы сообщений список |
341 | public function messages($type_message) { | 341 | public function messages($type_message) { |
342 | $user_id = Auth()->user()->id; | 342 | $user_id = Auth()->user()->id; |
343 | 343 | ||
344 | $chats = Chat::get_user_chats($user_id); | 344 | $chats = Chat::get_user_chats($user_id); |
345 | $user_type = 'employer'; | 345 | $user_type = 'employer'; |
346 | $admin_chat = false; | 346 | $admin_chat = false; |
347 | 347 | ||
348 | return view('employers.messages', compact('chats', 'admin_chat', 'user_id', 'user_type')); | 348 | return view('employers.messages', compact('chats', 'admin_chat', 'user_id', 'user_type')); |
349 | } | 349 | } |
350 | 350 | ||
351 | // Диалог между пользователями | 351 | // Диалог между пользователями |
352 | public function dialog(Chat $chat, Request $request) { | 352 | public function dialog(Chat $chat, Request $request) { |
353 | // Получение параметров. | 353 | // Получение параметров. |
354 | if ($request->has('ad_employer')){ | 354 | if ($request->has('ad_employer')){ |
355 | $ad_employer = $request->get('ad_employer'); | 355 | $ad_employer = $request->get('ad_employer'); |
356 | } else { | 356 | } else { |
357 | $ad_employer = 0; | 357 | $ad_employer = 0; |
358 | } | 358 | } |
359 | 359 | ||
360 | $sender = User_Model::query()->with('workers')->with('employers')->where('id', $chat->user_id)->first(); | 360 | $sender = User_Model::query()->with('workers')->with('employers')->where('id', $chat->user_id)->first(); |
361 | $companion = User_Model::query()->with('workers')->with('employers')->where('id', $chat->to_user_id)->first(); | 361 | $companion = User_Model::query()->with('workers')->with('employers')->where('id', $chat->to_user_id)->first(); |
362 | 362 | ||
363 | $Messages = Chat::get_chat_messages($chat); | 363 | $Messages = Chat::get_chat_messages($chat); |
364 | 364 | ||
365 | Message::where('user_id', '=', $chat->to_user_id)->where('to_user_id', '=', $chat->user_id)->update(['flag_new' => 0]); | 365 | Message::where('user_id', '=', $chat->to_user_id)->where('to_user_id', '=', $chat->user_id)->update(['flag_new' => 0]); |
366 | 366 | ||
367 | return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages')); | 367 | return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages')); |
368 | } | 368 | } |
369 | 369 | ||
370 | public function pin_chat(Request $request){ | 370 | public function pin_chat(Request $request){ |
371 | $chat_id = $request->get('id'); | 371 | $chat_id = $request->get('id'); |
372 | $is_fixed = $request->get('is_fixed'); | 372 | $is_fixed = $request->get('is_fixed'); |
373 | 373 | ||
374 | Chat::pin_chat($chat_id, $is_fixed); | 374 | Chat::pin_chat($chat_id, $is_fixed); |
375 | } | 375 | } |
376 | 376 | ||
377 | public function remove_chat(Request $request){ | 377 | public function remove_chat(Request $request){ |
378 | $chat_id = $request->get('id'); | 378 | $chat_id = $request->get('id'); |
379 | Chat::remove_chat($chat_id); | 379 | Chat::remove_chat($chat_id); |
380 | } | 380 | } |
381 | 381 | ||
382 | // Регистрация работодателя | 382 | // Регистрация работодателя |
383 | public function register_employer(Request $request) { | 383 | public function register_employer(Request $request) { |
384 | $params = $request->all(); | 384 | $params = $request->all(); |
385 | 385 | ||
386 | $rules = [ | 386 | $rules = [ |
387 | //'surname' => ['required', 'string', 'max:255'], | 387 | //'surname' => ['required', 'string', 'max:255'], |
388 | //'name_man' => ['required', 'string', 'max:255'], | 388 | //'name_man' => ['required', 'string', 'max:255'], |
389 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], | 389 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], |
390 | 'name_company' => ['required', 'string', 'max:255'], | 390 | 'name_company' => ['required', 'string', 'max:255'], |
391 | 'password' => ['required', 'string', 'min:6'], | 391 | 'password' => ['required', 'string', 'min:6'], |
392 | ]; | 392 | ]; |
393 | 393 | ||
394 | $messages = [ | 394 | $messages = [ |
395 | 'required' => 'Укажите обязательное поле', | 395 | 'required' => 'Укажите обязательное поле', |
396 | 'min' => [ | 396 | 'min' => [ |
397 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 397 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
398 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 398 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
399 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 399 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
400 | ], | 400 | ], |
401 | 'max' => [ | 401 | 'max' => [ |
402 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 402 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
403 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 403 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
404 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 404 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
405 | ] | 405 | ] |
406 | ]; | 406 | ]; |
407 | 407 | ||
408 | $email = $request->get('email'); | 408 | $email = $request->get('email'); |
409 | if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { | 409 | if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { |
410 | return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); | 410 | return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); |
411 | } | 411 | } |
412 | 412 | ||
413 | if ($request->get('password') !== $request->get('confirmed')){ | 413 | if ($request->get('password') !== $request->get('confirmed')){ |
414 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); | 414 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); |
415 | } | 415 | } |
416 | 416 | ||
417 | if (strlen($request->get('password')) < 6) { | 417 | if (strlen($request->get('password')) < 6) { |
418 | return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); | 418 | return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); |
419 | } | 419 | } |
420 | 420 | ||
421 | if (empty($request->get('surname'))) { | 421 | if (empty($request->get('surname'))) { |
422 | $params['surname'] = 'Неизвестно'; | 422 | $params['surname'] = 'Неизвестно'; |
423 | } | 423 | } |
424 | if (empty($request->get('name_man'))) { | 424 | if (empty($request->get('name_man'))) { |
425 | $params['name_man'] = 'Неизвестно'; | 425 | $params['name_man'] = 'Неизвестно'; |
426 | } | 426 | } |
427 | $validator = Validator::make($params, $rules, $messages); | 427 | $validator = Validator::make($params, $rules, $messages); |
428 | 428 | ||
429 | if ($validator->fails()) { | 429 | if ($validator->fails()) { |
430 | return json_encode(Array("ERROR" => "Error: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); | 430 | return json_encode(Array("ERROR" => "Error: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); |
431 | } else { | 431 | } else { |
432 | $user = $this->create($params); | 432 | $user = $this->create($params); |
433 | event(new Registered($user)); | 433 | event(new Registered($user)); |
434 | 434 | ||
435 | try { | 435 | try { |
436 | Mail::to(env('EMAIL_ADMIN'))->send(new MailCreateEmployer($params)); | 436 | Mail::to(env('EMAIL_ADMIN'))->send(new MailCreateEmployer($params)); |
437 | } catch (Throwable $e) { | 437 | } catch (Throwable $e) { |
438 | Log::error($e); | 438 | Log::error($e); |
439 | } | 439 | } |
440 | 440 | ||
441 | Auth::guard()->login($user); | 441 | Auth::guard()->login($user); |
442 | } | 442 | } |
443 | 443 | ||
444 | if ($user) { | 444 | if ($user) { |
445 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; | 445 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; |
446 | } else { | 446 | } else { |
447 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); | 447 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); |
448 | } | 448 | } |
449 | } | 449 | } |
450 | 450 | ||
451 | // Создание пользователя | 451 | // Создание пользователя |
452 | protected function create(array $data) | 452 | protected function create(array $data) |
453 | { | 453 | { |
454 | $Use = new User_Model(); | 454 | $Use = new User_Model(); |
455 | $Code_user = $Use->create([ | 455 | $Code_user = $Use->create([ |
456 | 'name' => $data['surname']." ".$data['name_man'], | 456 | 'name' => $data['surname']." ".$data['name_man'], |
457 | 'name_man' => $data['name_man'], | 457 | 'name_man' => $data['name_man'], |
458 | 'surname' => $data['surname'], | 458 | 'surname' => $data['surname'], |
459 | 'surname2' => $data['surname2'], | 459 | 'surname2' => $data['surname2'], |
460 | 'subscribe_email' => $data['email'], | 460 | 'subscribe_email' => $data['email'], |
461 | 'email' => $data['email'], | 461 | 'email' => $data['email'], |
462 | 'telephone' => $data['telephone'], | 462 | 'telephone' => $data['telephone'], |
463 | 'is_worker' => 0, | 463 | 'is_worker' => 0, |
464 | 'password' => Hash::make($data['password']), | 464 | 'password' => Hash::make($data['password']), |
465 | 'pubpassword' => base64_encode($data['password']), | 465 | 'pubpassword' => base64_encode($data['password']), |
466 | 'email_verified_at' => Carbon::now() | 466 | 'email_verified_at' => Carbon::now() |
467 | ]); | 467 | ]); |
468 | 468 | ||
469 | if ($Code_user->id > 0) { | 469 | if ($Code_user->id > 0) { |
470 | $Employer = new Employer(); | 470 | $Employer = new Employer(); |
471 | $Employer->user_id = $Code_user->id; | 471 | $Employer->user_id = $Code_user->id; |
472 | $Employer->name_company = $data['name_company']; | 472 | $Employer->name_company = $data['name_company']; |
473 | $Employer->email = $data['email']; | 473 | $Employer->email = $data['email']; |
474 | $Employer->telephone = $data['telephone']; | 474 | $Employer->telephone = $data['telephone']; |
475 | $Employer->code = Tools::generator_id(10); | 475 | $Employer->code = Tools::generator_id(10); |
476 | $Employer->save(); | 476 | $Employer->save(); |
477 | 477 | ||
478 | return $Code_user; | 478 | return $Code_user; |
479 | } | 479 | } |
480 | } | 480 | } |
481 | 481 | ||
482 | // Отправка сообщения от работодателя | 482 | // Отправка сообщения от работодателя |
483 | public function send_message(MessagesRequiest $request) { | 483 | public function send_message(MessagesRequiest $request) { |
484 | $params = $request->all(); | 484 | $params = $request->all(); |
485 | dd($params); | 485 | dd($params); |
486 | $user1 = $params['user_id']; | 486 | $user1 = $params['user_id']; |
487 | $user2 = $params['to_user_id']; | 487 | $user2 = $params['to_user_id']; |
488 | 488 | ||
489 | if ($request->has('file')) { | 489 | if ($request->has('file')) { |
490 | $params['file'] = $request->file('file')->store("messages", 'public'); | 490 | $params['file'] = $request->file('file')->store("messages", 'public'); |
491 | } | 491 | } |
492 | Message::create($params); | 492 | Message::create($params); |
493 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); | 493 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); |
494 | } | 494 | } |
495 | 495 | ||
496 | public function test123(Request $request) { | 496 | public function test123(Request $request) { |
497 | $params = $request->all(); | 497 | $params = $request->all(); |
498 | $user1 = $params['user_id']; | 498 | $user1 = $params['user_id']; |
499 | $user2 = $params['to_user_id']; | 499 | $user2 = $params['to_user_id']; |
500 | 500 | ||
501 | $rules = [ | 501 | $rules = [ |
502 | 'text' => 'nullable|required_without:file|min:1|max:150000', | 502 | 'text' => 'nullable|required_without:file|min:1|max:150000', |
503 | 'file' => 'nullable|file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' | 503 | 'file' => 'nullable|file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' |
504 | ]; | 504 | ]; |
505 | $messages = [ | 505 | $messages = [ |
506 | 'required_without' => 'Поле «:attribute» обязательно, если файл не прикреплен', | 506 | 'required_without' => 'Поле «:attribute» обязательно, если файл не прикреплен', |
507 | 'min' => [ | 507 | 'min' => [ |
508 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 508 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
509 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 509 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
510 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 510 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
511 | ], | 511 | ], |
512 | 'max' => [ | 512 | 'max' => [ |
513 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 513 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
514 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 514 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
515 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 515 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
516 | ] | 516 | ] |
517 | ]; | 517 | ]; |
518 | 518 | ||
519 | $validator = Validator::make($request->all(), $rules, $messages); | 519 | $validator = Validator::make($request->all(), $rules, $messages); |
520 | 520 | ||
521 | if ($validator->fails()) { | 521 | if ($validator->fails()) { |
522 | return redirect()->route('cabinet.messages', ['type_message' => 'input'])->withErrors($validator); | 522 | return redirect()->route('cabinet.messages', ['type_message' => 'input'])->withErrors($validator); |
523 | } | 523 | } |
524 | 524 | ||
525 | $new_message = Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages'); | 525 | $new_message = Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages'); |
526 | return redirect()->route('employer.dialog', ['chat' => $new_message->chat_id_from]); | 526 | return redirect()->route('employer.dialog', ['chat' => $new_message->chat_id_from]); |
527 | 527 | ||
528 | } | 528 | } |
529 | 529 | ||
530 | //Избранные люди | 530 | //Избранные люди |
531 | public function favorites(Request $request) | 531 | public function favorites(Request $request) |
532 | { | 532 | { |
533 | $likedWorkersIds = Like_worker::query() | 533 | $likedWorkersIds = Like_worker::query() |
534 | ->where('user_id', Auth::user()->id) | 534 | ->where('user_id', Auth::user()->id) |
535 | ->get() | 535 | ->get() |
536 | ->pluck('code_record') | 536 | ->pluck('code_record') |
537 | ->toArray(); | 537 | ->toArray(); |
538 | 538 | ||
539 | $workerBuilder = Worker::query() | 539 | $workerBuilder = Worker::query() |
540 | ->whereIn('id', $likedWorkersIds); | 540 | ->whereIn('id', $likedWorkersIds); |
541 | 541 | ||
542 | if (($request->has('search')) && (!empty($request->get('search')))) { | 542 | if (($request->has('search')) && (!empty($request->get('search')))) { |
543 | $search = $request->get('search'); | 543 | $search = $request->get('search'); |
544 | 544 | ||
545 | $workerBuilder->whereHas('users', function (Builder $query) use ($search) { | 545 | $workerBuilder->whereHas('users', function (Builder $query) use ($search) { |
546 | $query->where('surname', 'LIKE', "%$search%") | 546 | $query->where('surname', 'LIKE', "%$search%") |
547 | ->orWhere('name_man', 'LIKE', "%$search%") | 547 | ->orWhere('name_man', 'LIKE', "%$search%") |
548 | ->orWhere('surname2', 'LIKE', "%$search%"); | 548 | ->orWhere('surname2', 'LIKE', "%$search%"); |
549 | }); | 549 | }); |
550 | } | 550 | } |
551 | 551 | ||
552 | $Workers = $workerBuilder->get(); | 552 | $Workers = $workerBuilder->get(); |
553 | 553 | ||
554 | return view('employers.favorite', compact('Workers')); | 554 | return view('employers.favorite', compact('Workers')); |
555 | } | 555 | } |
556 | 556 | ||
557 | // База данных | 557 | // База данных |
558 | public function bd(Request $request) { | 558 | public function bd(Request $request) { |
559 | $users = User_Model::query()->with('workers')->with('jobtitles'); | 559 | $users = User_Model::query()->with('workers')->with('jobtitles'); |
560 | 560 | ||
561 | if ($request->has('search')) { | 561 | if ($request->has('search')) { |
562 | $find_key = $request->get('search'); | 562 | $find_key = $request->get('search'); |
563 | $users = $users->where('name', 'LIKE', "%$find_key%") | 563 | $users = $users->where('name', 'LIKE', "%$find_key%") |
564 | ->orWhere('surname', 'LIKE', "%$find_key%") | 564 | ->orWhere('surname', 'LIKE', "%$find_key%") |
565 | ->orWhere('name_man', 'LIKE', "%$find_key%") | 565 | ->orWhere('name_man', 'LIKE', "%$find_key%") |
566 | ->orWhere('email', 'LIKE', "%$find_key%") | 566 | ->orWhere('email', 'LIKE', "%$find_key%") |
567 | ->orWhere('telephone', 'LIKE', "%$find_key%"); | 567 | ->orWhere('telephone', 'LIKE', "%$find_key%"); |
568 | } | 568 | } |
569 | 569 | ||
570 | // Данные | 570 | // Данные |
571 | $users = $users->Baseuser()-> | 571 | $users = $users->Baseuser()-> |
572 | orderByDesc(Worker::select('created_at')->whereColumn('workers.user_id', 'users.id')); | 572 | orderByDesc(Worker::select('created_at')->whereColumn('workers.user_id', 'users.id')); |
573 | $count_users = $users; | 573 | $count_users = $users; |
574 | $users = $users->paginate(5); | 574 | $users = $users->paginate(10); |
575 | 575 | ||
576 | $export_options = DbExportColumns::toArray(); | 576 | $export_options = DbExportColumns::toArray(); |
577 | 577 | ||
578 | $jobs_titles = Job_title::select('id', 'name') | 578 | $jobs_titles = Job_title::select('id', 'name') |
579 | ->where('is_remove', '=', 0) | 579 | ->where('is_remove', '=', 0) |
580 | ->where('is_bd', '=', 2) | 580 | ->where('is_bd', '=', 2) |
581 | ->orderByDesc('sort') | 581 | ->orderByDesc('sort') |
582 | ->orderBy('name', 'asc') | 582 | ->orderBy('name', 'asc') |
583 | ->get() | 583 | ->get() |
584 | ->toArray() | 584 | ->toArray() |
585 | ; | 585 | ; |
586 | 586 | ||
587 | 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')); |
588 | } | 588 | } |
589 | 589 | ||
590 | //Настройка уведомлений | 590 | //Настройка уведомлений |
591 | public function subscribe() { | 591 | public function subscribe() { |
592 | return view('employers.subcribe'); | 592 | return view('employers.subcribe'); |
593 | } | 593 | } |
594 | 594 | ||
595 | //Установка уведомлений сохранение | 595 | //Установка уведомлений сохранение |
596 | public function save_subscribe(Request $request) { | 596 | public function save_subscribe(Request $request) { |
597 | dd($request->all()); | 597 | dd($request->all()); |
598 | $msg = $request->validate([ | 598 | $msg = $request->validate([ |
599 | 'subscribe_email' => 'required|email|min:5|max:255', | 599 | 'subscribe_email' => 'required|email|min:5|max:255', |
600 | ]); | 600 | ]); |
601 | return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); | 601 | return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); |
602 | } | 602 | } |
603 | 603 | ||
604 | //Сбросить форму с паролем | 604 | //Сбросить форму с паролем |
605 | public function password_reset() { | 605 | public function password_reset() { |
606 | $email = Auth()->user()->email; | 606 | $email = Auth()->user()->email; |
607 | return view('employers.password-reset', compact('email')); | 607 | return view('employers.password-reset', compact('email')); |
608 | } | 608 | } |
609 | 609 | ||
610 | //Обновление пароля | 610 | //Обновление пароля |
611 | public function new_password(Request $request) { | 611 | public function new_password(Request $request) { |
612 | $use = Auth()->user(); | 612 | $use = Auth()->user(); |
613 | $request->validate([ | 613 | $request->validate([ |
614 | 'password' => 'required|string', | 614 | 'password' => 'required|string', |
615 | 'new_password' => 'required|string', | 615 | 'new_password' => 'required|string', |
616 | 'new_password2' => 'required|string' | 616 | 'new_password2' => 'required|string' |
617 | ]); | 617 | ]); |
618 | 618 | ||
619 | if ($request->get('new_password') == $request->get('new_password2')) | 619 | if ($request->get('new_password') == $request->get('new_password2')) |
620 | if ($request->get('password') !== $request->get('new_password')) { | 620 | if ($request->get('password') !== $request->get('new_password')) { |
621 | $credentials = $request->only('email', 'password'); | 621 | $credentials = $request->only('email', 'password'); |
622 | if (Auth::attempt($credentials)) { | 622 | if (Auth::attempt($credentials)) { |
623 | 623 | ||
624 | if (!is_null($use->email_verified_at)){ | 624 | if (!is_null($use->email_verified_at)){ |
625 | 625 | ||
626 | $user_data = User_Model::find($use->id); | 626 | $user_data = User_Model::find($use->id); |
627 | $user_data->update([ | 627 | $user_data->update([ |
628 | 'password' => Hash::make($request->get('new_password')), | 628 | 'password' => Hash::make($request->get('new_password')), |
629 | 'pubpassword' => base64_encode($request->get('new_password')), | 629 | 'pubpassword' => base64_encode($request->get('new_password')), |
630 | ]); | 630 | ]); |
631 | return redirect() | 631 | return redirect() |
632 | ->route('employer.password_reset') | 632 | ->route('employer.password_reset') |
633 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); | 633 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); |
634 | } | 634 | } |
635 | 635 | ||
636 | return redirect() | 636 | return redirect() |
637 | ->route('employer.password_reset') | 637 | ->route('employer.password_reset') |
638 | ->withError('Данная учетная запись не было верифицированна!'); | 638 | ->withError('Данная учетная запись не было верифицированна!'); |
639 | } | 639 | } |
640 | } | 640 | } |
641 | 641 | ||
642 | return redirect() | 642 | return redirect() |
643 | ->route('employer.password_reset') | 643 | ->route('employer.password_reset') |
644 | ->withErrors('Не совпадение данных, обновите пароли!'); | 644 | ->withErrors('Не совпадение данных, обновите пароли!'); |
645 | } | 645 | } |
646 | 646 | ||
647 | 647 | ||
648 | 648 | ||
649 | // Форма Удаление пипла | 649 | // Форма Удаление пипла |
650 | public function delete_people() { | 650 | public function delete_people() { |
651 | $login = Auth()->user()->email; | 651 | $login = Auth()->user()->email; |
652 | return view('employers.delete_people', compact('login')); | 652 | return view('employers.delete_people', compact('login')); |
653 | } | 653 | } |
654 | 654 | ||
655 | // Удаление аккаунта | 655 | // Удаление аккаунта |
656 | public function action_delete_user(Request $request) { | 656 | public function action_delete_user(Request $request) { |
657 | $Answer = $request->all(); | 657 | $Answer = $request->all(); |
658 | $user_id = Auth()->user()->id; | 658 | $user_id = Auth()->user()->id; |
659 | $request->validate([ | 659 | $request->validate([ |
660 | 'password' => 'required|string', | 660 | 'password' => 'required|string', |
661 | ]); | 661 | ]); |
662 | 662 | ||
663 | $credentials = $request->only('email', 'password'); | 663 | $credentials = $request->only('email', 'password'); |
664 | if (Auth::attempt($credentials)) { | 664 | if (Auth::attempt($credentials)) { |
665 | Auth::logout(); | 665 | Auth::logout(); |
666 | $it = User_Model::find($user_id); | 666 | $it = User_Model::find($user_id); |
667 | $it->delete(); | 667 | $it->delete(); |
668 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); | 668 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); |
669 | } else { | 669 | } else { |
670 | return redirect()->route('employer.delete_people') | 670 | return redirect()->route('employer.delete_people') |
671 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); | 671 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); |
672 | } | 672 | } |
673 | } | 673 | } |
674 | 674 | ||
675 | public function ajax_delete_user(Request $request) { | 675 | public function ajax_delete_user(Request $request) { |
676 | $Answer = $request->all(); | 676 | $Answer = $request->all(); |
677 | $user_id = Auth()->user()->id; | 677 | $user_id = Auth()->user()->id; |
678 | $request->validate([ | 678 | $request->validate([ |
679 | 'password' => 'required|string', | 679 | 'password' => 'required|string', |
680 | ]); | 680 | ]); |
681 | $credentials = $request->only('email', 'password'); | 681 | $credentials = $request->only('email', 'password'); |
682 | if (Auth::attempt($credentials)) { | 682 | if (Auth::attempt($credentials)) { |
683 | 683 | ||
684 | return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', | 684 | return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', |
685 | 'email' => $request->get('email'), | 685 | 'email' => $request->get('email'), |
686 | 'password' => $request->get('password'))); | 686 | 'password' => $request->get('password'))); |
687 | } else { | 687 | } else { |
688 | return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); | 688 | return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); |
689 | } | 689 | } |
690 | } | 690 | } |
691 | 691 | ||
692 | // Рассылка сообщений | 692 | // Рассылка сообщений |
693 | public function send_all_messages() { | 693 | public function send_all_messages() { |
694 | $id = Auth()->user()->id; | 694 | $id = Auth()->user()->id; |
695 | $sending = Employer::query()->where('user_id', '=', "$id")->first(); | 695 | $sending = Employer::query()->where('user_id', '=', "$id")->first(); |
696 | 696 | ||
697 | $job_titles = Job_title::query() | 697 | $job_titles = Job_title::query() |
698 | ->where('is_remove', '=', 0) | 698 | ->where('is_remove', '=', 0) |
699 | ->where('is_bd', '=', 1) | 699 | ->where('is_bd', '=', 1) |
700 | ->orderByDesc('sort') | 700 | ->orderByDesc('sort') |
701 | ->get(); | 701 | ->get(); |
702 | 702 | ||
703 | if ($sending->sending_is) | 703 | if ($sending->sending_is) |
704 | return view('employers.send_all', compact('job_titles')); | 704 | return view('employers.send_all', compact('job_titles')); |
705 | else | 705 | else |
706 | return view('employers.send_all_danger'); | 706 | return view('employers.send_all_danger'); |
707 | } | 707 | } |
708 | 708 | ||
709 | // Отправка сообщений для информации | 709 | // Отправка сообщений для информации |
710 | public function send_all_post(Request $request) { | 710 | public function send_all_post(Request $request) { |
711 | $data = $request->all(); | 711 | $data = $request->all(); |
712 | $data['user'] = Auth()->user(); | 712 | $data['user'] = Auth()->user(); |
713 | 713 | ||
714 | $id = MessagesRequests::create([ | 714 | $id = MessagesRequests::create([ |
715 | 'user_id' => $data['user']->id, | 715 | 'user_id' => $data['user']->id, |
716 | '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, |
717 | 'text' => $data['message_text'], | 717 | 'text' => $data['message_text'], |
718 | ]); | 718 | ]); |
719 | 719 | ||
720 | try { | 720 | try { |
721 | if (!empty($id)) { | 721 | if (!empty($id)) { |
722 | Mail::to(env('EMAIL_ADMIN'))->send(new MassSendingMessages($data)); | 722 | Mail::to(env('EMAIL_ADMIN'))->send(new MassSendingMessages($data)); |
723 | } | 723 | } |
724 | } catch (Throwable $e) { | 724 | } catch (Throwable $e) { |
725 | Log::error($e); | 725 | Log::error($e); |
726 | return redirect()->route('employer.send_all_messages')->with('error', 'Ошибка почтового сервера, пожалуйста, повторите рассылку позднее'); | 726 | return redirect()->route('employer.send_all_messages')->with('error', 'Ошибка почтового сервера, пожалуйста, повторите рассылку позднее'); |
727 | } | 727 | } |
728 | 728 | ||
729 | return redirect()->route('employer.send_all_messages')->with('success', 'Запрос на рассылку был успешно отправлен.'); | 729 | return redirect()->route('employer.send_all_messages')->with('success', 'Запрос на рассылку был успешно отправлен.'); |
730 | } | 730 | } |
731 | 731 | ||
732 | // База резюме | 732 | // База резюме |
733 | public function bd_tupe(Request $request) { | 733 | public function bd_tupe(Request $request) { |
734 | $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); | 734 | $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); |
735 | 735 | ||
736 | return view('employers.bd_tupe', compact('Resume')); | 736 | return view('employers.bd_tupe', compact('Resume')); |
737 | } | 737 | } |
738 | 738 | ||
739 | ////////////////////////////////////////////////////////////////// | 739 | ////////////////////////////////////////////////////////////////// |
740 | // Отправил сообщение | 740 | // Отправил сообщение |
741 | ////////////////////////////////////////////////////////////////// | 741 | ////////////////////////////////////////////////////////////////// |
742 | public function new_message(Request $request) | 742 | public function new_message(Request $request) |
743 | { | 743 | { |
744 | $params = $request->all(); | 744 | $params = $request->all(); |
745 | 745 | ||
746 | $id = $params['_user_id']; | 746 | $id = $params['_user_id']; |
747 | $message_params = [ | 747 | $message_params = [ |
748 | 'title' => $params['title'], | 748 | 'title' => $params['title'], |
749 | 'text' => $params['text'], | 749 | 'text' => $params['text'], |
750 | 'ad_employer_id' => $params['_vacancy'], | 750 | 'ad_employer_id' => $params['_vacancy'], |
751 | 'flag_new' => 1 | 751 | 'flag_new' => 1 |
752 | ]; | 752 | ]; |
753 | 753 | ||
754 | $message = Message::add_message( | 754 | $message = Message::add_message( |
755 | $request, | 755 | $request, |
756 | $params['_user_id'], | 756 | $params['_user_id'], |
757 | $params['_to_user_id'], | 757 | $params['_to_user_id'], |
758 | $message_params, | 758 | $message_params, |
759 | file_store_path: "worker/$id" | 759 | file_store_path: "worker/$id" |
760 | ); | 760 | ); |
761 | 761 | ||
762 | return redirect()->route('worker.dialog', ['chat' => $message->chat_id_to]); | 762 | return redirect()->route('worker.dialog', ['chat' => $message->chat_id_to]); |
763 | } | 763 | } |
764 | 764 | ||
765 | // Восстановление пароля | 765 | // Восстановление пароля |
766 | public function repair_password(Request $request) { | 766 | public function repair_password(Request $request) { |
767 | $params = $request->get('email'); | 767 | $params = $request->get('email'); |
768 | } | 768 | } |
769 | 769 | ||
770 | // Избранные люди на корабль | 770 | // Избранные люди на корабль |
771 | public function selected_people(Request $request) { | 771 | public function selected_people(Request $request) { |
772 | $id = $request->get('id'); | 772 | $id = $request->get('id'); |
773 | $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> | 773 | $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> |
774 | where('is_remove', '=', '0')-> | 774 | where('is_remove', '=', '0')-> |
775 | where('is_bd', '=', '0')-> | 775 | where('is_bd', '=', '0')-> |
776 | where('position_id', $id)-> | 776 | where('position_id', $id)-> |
777 | get(); | 777 | get(); |
778 | return view('favorite_people', compact('favorite_people')); | 778 | return view('favorite_people', compact('favorite_people')); |
779 | } | 779 | } |
780 | } | 780 | } |
781 | 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\Hash; | 33 | use Illuminate\Support\Facades\Hash; |
34 | use Illuminate\Support\Facades\Storage; | 34 | use Illuminate\Support\Facades\Storage; |
35 | use Illuminate\Support\Facades\Validator; | 35 | use Illuminate\Support\Facades\Validator; |
36 | use PhpOffice\PhpSpreadsheet\Spreadsheet; | 36 | use PhpOffice\PhpSpreadsheet\Spreadsheet; |
37 | use PhpOffice\PhpSpreadsheet\Writer\Xlsx; | 37 | use PhpOffice\PhpSpreadsheet\Writer\Xlsx; |
38 | use Symfony\Component\HttpFoundation\StreamedResponse; | 38 | use Symfony\Component\HttpFoundation\StreamedResponse; |
39 | use App\Enums\DbExportColumns; | 39 | use App\Enums\DbExportColumns; |
40 | use App\Enums\WorkerStatuses; | 40 | use App\Enums\WorkerStatuses; |
41 | use DateTime; | 41 | use DateTime; |
42 | 42 | ||
43 | class WorkerController extends Controller | 43 | class WorkerController extends Controller |
44 | { | 44 | { |
45 | //профиль | 45 | //профиль |
46 | public function profile(Worker $worker) | 46 | public function profile(Worker $worker) |
47 | { | 47 | { |
48 | $get_date = date('Y.m'); | 48 | $get_date = date('Y.m'); |
49 | 49 | ||
50 | $c = Static_worker::query()->where('year_month', '=', $get_date) | 50 | $c = Static_worker::query()->where('year_month', '=', $get_date) |
51 | ->where('user_id', '=', $worker->users->id) | 51 | ->where('user_id', '=', $worker->users->id) |
52 | ->get(); | 52 | ->get(); |
53 | 53 | ||
54 | if ($c->count() > 0) { | 54 | if ($c->count() > 0) { |
55 | $upd = Static_worker::find($c[0]->id); | 55 | $upd = Static_worker::find($c[0]->id); |
56 | $upd->lookin = $upd->lookin + 1; | 56 | $upd->lookin = $upd->lookin + 1; |
57 | $upd->save(); | 57 | $upd->save(); |
58 | } else { | 58 | } else { |
59 | $crt = new Static_worker(); | 59 | $crt = new Static_worker(); |
60 | $crt->lookin = 1; | 60 | $crt->lookin = 1; |
61 | $crt->year_month = $get_date; | 61 | $crt->year_month = $get_date; |
62 | $crt->user_id = $worker->user_id; | 62 | $crt->user_id = $worker->user_id; |
63 | $crt->save(); | 63 | $crt->save(); |
64 | } | 64 | } |
65 | 65 | ||
66 | $stat = Static_worker::query()->where('year_month', '=', $get_date) | 66 | $stat = Static_worker::query()->where('year_month', '=', $get_date) |
67 | ->where('user_id', '=', $worker->users->id) | 67 | ->where('user_id', '=', $worker->users->id) |
68 | ->get(); | 68 | ->get(); |
69 | 69 | ||
70 | return view('public.workers.profile', compact('worker', 'stat')); | 70 | return view('public.workers.profile', compact('worker', 'stat')); |
71 | } | 71 | } |
72 | 72 | ||
73 | // лист база резюме | 73 | // лист база резюме |
74 | public function bd_resume(Request $request) | 74 | public function bd_resume(Request $request) |
75 | { | 75 | { |
76 | if (isset(Auth()->user()->id)) { | 76 | if (isset(Auth()->user()->id)) { |
77 | if ((Auth()->user()->is_worker) || (!Auth()->user()->is_lookin)) | 77 | if ((Auth()->user()->is_worker) || (!Auth()->user()->is_lookin)) |
78 | return redirect()->route('index')->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]); | 78 | return redirect()->route('index')->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]); |
79 | } | 79 | } |
80 | 80 | ||
81 | $status_work = WorkerStatuses::getWorkerStatuses(); | 81 | $status_work = WorkerStatuses::getWorkerStatuses(); |
82 | 82 | ||
83 | $resumes = Worker::query()->with('users')->with('job_titles')->orderByDesc('updated_at'); | 83 | $resumes = Worker::query()->with('users')->with('job_titles')->orderByDesc('updated_at'); |
84 | $resumes = $resumes->whereHas('users', function (Builder $query) { | 84 | $resumes = $resumes->whereHas('users', function (Builder $query) { |
85 | $query->Where('is_worker', '=', '1') | 85 | $query->Where('is_worker', '=', '1') |
86 | ->Where('is_bd', '=', '0'); | 86 | ->Where('is_bd', '=', '0'); |
87 | }); | 87 | }); |
88 | 88 | ||
89 | if (($request->has('job')) && ($request->get('job') > 0)) { | 89 | if (($request->has('job')) && ($request->get('job') > 0)) { |
90 | $resumes = $resumes->whereHas('job_titles', function (Builder $query) use ($request) { | 90 | $resumes = $resumes->whereHas('job_titles', function (Builder $query) use ($request) { |
91 | $query->Where('job_titles.id', $request->get('job')); | 91 | $query->Where('job_titles.id', $request->get('job')); |
92 | }); | 92 | }); |
93 | } | 93 | } |
94 | 94 | ||
95 | $Job_title = Job_title::query() | 95 | $Job_title = Job_title::query() |
96 | ->where('is_remove', '=', '0') | 96 | ->where('is_remove', '=', '0') |
97 | ->where('is_bd', '=' , '1') | 97 | ->where('is_bd', '=' , '1') |
98 | ->orderByDesc('sort') | 98 | ->orderByDesc('sort') |
99 | ->get(); | 99 | ->get(); |
100 | 100 | ||
101 | if ($request->get('sort')) { | 101 | if ($request->get('sort')) { |
102 | $sort = $request->get('sort'); | 102 | $sort = $request->get('sort'); |
103 | switch ($sort) { | 103 | switch ($sort) { |
104 | case 'looking_for_work': | 104 | case 'looking_for_work': |
105 | $resumes->where('status_work', '=', WorkerStatuses::LookingForWork->value); | 105 | $resumes->where('status_work', '=', WorkerStatuses::LookingForWork->value); |
106 | break; | 106 | break; |
107 | case 'considering_offers': | 107 | case 'considering_offers': |
108 | $resumes->where('status_work', '=', WorkerStatuses::ConsideringOffers->value); | 108 | $resumes->where('status_work', '=', WorkerStatuses::ConsideringOffers->value); |
109 | break; | 109 | break; |
110 | case 'not_looking_for_work': | 110 | case 'not_looking_for_work': |
111 | $resumes->where('status_work', '=', WorkerStatuses::NotLookingForWork->value); | 111 | $resumes->where('status_work', '=', WorkerStatuses::NotLookingForWork->value); |
112 | break; | 112 | break; |
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
116 | $resumes->where(function (Builder $query) { | 116 | $resumes->where(function (Builder $query) { |
117 | $query->whereNotNull('telephone') | 117 | $query->whereNotNull('telephone') |
118 | ->whereNotNull('email') | 118 | ->whereNotNull('email') |
119 | ->whereNotNull('city') | 119 | ->whereNotNull('city') |
120 | ->whereNotNull('experience') | 120 | ->whereNotNull('experience') |
121 | ->whereNotNull('old_year'); | 121 | ->whereNotNull('old_year'); |
122 | //fixme костыль, переделать | 122 | //fixme костыль, переделать |
123 | }); | 123 | }); |
124 | 124 | ||
125 | $res_count = $resumes->count(); | 125 | $res_count = $resumes->count(); |
126 | $resumes = $resumes->paginate(4); | 126 | $resumes = $resumes->paginate(4); |
127 | if ($request->ajax()) { | 127 | if ($request->ajax()) { |
128 | // Условия обставлены | 128 | // Условия обставлены |
129 | if ($request->has('block') && ($request->get('block') == 1)) { | 129 | if ($request->has('block') && ($request->get('block') == 1)) { |
130 | return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count')); | 130 | return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count')); |
131 | } | 131 | } |
132 | } else { | 132 | } else { |
133 | return view('resume', compact('resumes', 'status_work', 'res_count', 'Job_title')); | 133 | return view('resume', compact('resumes', 'status_work', 'res_count', 'Job_title')); |
134 | } | 134 | } |
135 | } | 135 | } |
136 | 136 | ||
137 | public function basic_information(){ | 137 | public function basic_information(){ |
138 | if (!isset(Auth()->user()->id)) { | 138 | if (!isset(Auth()->user()->id)) { |
139 | abort(404); | 139 | abort(404); |
140 | } | 140 | } |
141 | 141 | ||
142 | $user_id = Auth()->user()->id; | 142 | $user_id = Auth()->user()->id; |
143 | 143 | ||
144 | $user = User::query() | 144 | $user = User::query() |
145 | ->with('workers') | 145 | ->with('workers') |
146 | ->with(['jobtitles' => function ($query) { | 146 | ->with(['jobtitles' => function ($query) { |
147 | $query->select('job_titles.id'); | 147 | $query->select('job_titles.id'); |
148 | }]) | 148 | }]) |
149 | ->where('id', '=', $user_id) | 149 | ->where('id', '=', $user_id) |
150 | ->first(); | 150 | ->first(); |
151 | $user->workers[0]->job_titles = $user->workers[0]->job_titles->pluck('id')->toArray(); | 151 | $user->workers[0]->job_titles = $user->workers[0]->job_titles->pluck('id')->toArray(); |
152 | 152 | ||
153 | $job_titles = Job_title::query() | 153 | $job_titles = Job_title::query() |
154 | ->where('is_remove', '=', 0) | 154 | ->where('is_remove', '=', 0) |
155 | ->where('is_bd', '=', 1) | 155 | ->where('is_bd', '=', 1) |
156 | ->orderByDesc('sort') | 156 | ->orderByDesc('sort') |
157 | ->get() | 157 | ->get() |
158 | ; | 158 | ; |
159 | 159 | ||
160 | return view('workers.form_basic_information', compact('user', 'job_titles')); | 160 | return view('workers.form_basic_information', compact('user', 'job_titles')); |
161 | } | 161 | } |
162 | 162 | ||
163 | public function additional_documents(){ | 163 | public function additional_documents(){ |
164 | if (!isset(Auth()->user()->id)) { | 164 | if (!isset(Auth()->user()->id)) { |
165 | abort(404); | 165 | abort(404); |
166 | } | 166 | } |
167 | 167 | ||
168 | $user_id = Auth()->user()->id; | 168 | $user_id = Auth()->user()->id; |
169 | 169 | ||
170 | $info_blocks = infobloks::query()->OrderBy('name')->get(); | 170 | $info_blocks = infobloks::query()->OrderBy('name')->get(); |
171 | $additional_document_statuses = [0 => 'Не указано', 1 => 'В наличии', 2 => 'Отсутствует']; | 171 | $additional_document_statuses = [0 => 'Не указано', 1 => 'В наличии', 2 => 'Отсутствует']; |
172 | 172 | ||
173 | $worker = Worker::query() | 173 | $worker = Worker::query() |
174 | ->with('users') | 174 | ->with('users') |
175 | ->with('infobloks') | 175 | ->with('infobloks') |
176 | ->WhereHas('users', function (Builder $query) use ($user_id) { | 176 | ->WhereHas('users', function (Builder $query) use ($user_id) { |
177 | $query->Where('id', $user_id); | 177 | $query->Where('id', $user_id); |
178 | }) | 178 | }) |
179 | ->first(); | 179 | ->first(); |
180 | if ($worker->dop_info->count()){ | 180 | if ($worker->dop_info->count()){ |
181 | $worker->dop_info = $worker->dop_info->keyBy('infoblok_id')->toArray(); | 181 | $worker->dop_info = $worker->dop_info->keyBy('infoblok_id')->toArray(); |
182 | } | 182 | } |
183 | 183 | ||
184 | return view('workers.form_additional_documents', compact('worker', 'info_blocks', 'additional_document_statuses')); | 184 | return view('workers.form_additional_documents', compact('worker', 'info_blocks', 'additional_document_statuses')); |
185 | } | 185 | } |
186 | 186 | ||
187 | //Лайк резюме | 187 | //Лайк резюме |
188 | public function like_controller() { | 188 | public function like_controller() { |
189 | 189 | ||
190 | } | 190 | } |
191 | 191 | ||
192 | // анкета соискателя | 192 | // анкета соискателя |
193 | public function resume_profile(Worker $worker) | 193 | public function resume_profile(Worker $worker) |
194 | { | 194 | { |
195 | if (isset(Auth()->user()->id)) { | 195 | if (isset(Auth()->user()->id)) { |
196 | $idiot = Auth()->user()->id; | 196 | $idiot = Auth()->user()->id; |
197 | } else { | 197 | } else { |
198 | $idiot = 0; | 198 | $idiot = 0; |
199 | } | 199 | } |
200 | 200 | ||
201 | $status_work = WorkerStatuses::getWorkerStatuses(); | 201 | $status_work = WorkerStatuses::getWorkerStatuses(); |
202 | $Query = Worker::query()->with('users')->with('job_titles') | 202 | $Query = Worker::query()->with('users')->with('job_titles') |
203 | ->with('place_worker')->with('sertificate')->with('prev_company') | 203 | ->with('place_worker')->with('sertificate')->with('prev_company') |
204 | ->with('infobloks')->with('response'); | 204 | ->with('infobloks')->with('response'); |
205 | $Query = $Query->where('id', '=', $worker->id); | 205 | $Query = $Query->where('id', '=', $worker->id); |
206 | $Query = $Query->get(); | 206 | $Query = $Query->get(); |
207 | 207 | ||
208 | $get_date = date('Y.m'); | 208 | $get_date = date('Y.m'); |
209 | 209 | ||
210 | $infoblocks = infobloks::query()->get(); | 210 | $infoblocks = infobloks::query()->get(); |
211 | 211 | ||
212 | $c = Static_worker::query()->where('year_month', '=', $get_date) | 212 | $c = Static_worker::query()->where('year_month', '=', $get_date) |
213 | ->where('user_id', '=', $worker->user_id) | 213 | ->where('user_id', '=', $worker->user_id) |
214 | ->get(); | 214 | ->get(); |
215 | 215 | ||
216 | if ($c->count() > 0) { | 216 | if ($c->count() > 0) { |
217 | $upd = Static_worker::find($c[0]->id); | 217 | $upd = Static_worker::find($c[0]->id); |
218 | $upd->lookin = $upd->lookin + 1; | 218 | $upd->lookin = $upd->lookin + 1; |
219 | $upd->save(); | 219 | $upd->save(); |
220 | } else { | 220 | } else { |
221 | $crt = new Static_worker(); | 221 | $crt = new Static_worker(); |
222 | $crt->lookin = 1; | 222 | $crt->lookin = 1; |
223 | $crt->year_month = $get_date; | 223 | $crt->year_month = $get_date; |
224 | $crt->user_id = $worker->user_id; | 224 | $crt->user_id = $worker->user_id; |
225 | $status = $crt->save(); | 225 | $status = $crt->save(); |
226 | } | 226 | } |
227 | 227 | ||
228 | $stat = Static_worker::query()->where('year_month', '=', $get_date) | 228 | $stat = Static_worker::query()->where('year_month', '=', $get_date) |
229 | ->where('user_id', '=', $worker->user_id) | 229 | ->where('user_id', '=', $worker->user_id) |
230 | ->get(); | 230 | ->get(); |
231 | 231 | ||
232 | return view('worker', compact('Query', 'infoblocks', 'status_work', 'idiot', 'stat')); | 232 | return view('worker', compact('Query', 'infoblocks', 'status_work', 'idiot', 'stat')); |
233 | } | 233 | } |
234 | 234 | ||
235 | // скачать анкету соискателя | 235 | // скачать анкету соискателя |
236 | public function resume_download(Worker $worker) | 236 | public function resume_download(Worker $worker) |
237 | { | 237 | { |
238 | $status_work = WorkerStatuses::getWorkerStatuses(); | 238 | $status_work = WorkerStatuses::getWorkerStatuses(); |
239 | $Query = Worker::query()->with('users')->with('job_titles') | 239 | $Query = Worker::query()->with('users')->with('job_titles') |
240 | ->with('place_worker')->with('sertificate')->with('prev_company') | 240 | ->with('place_worker')->with('sertificate')->with('prev_company') |
241 | ->with('infobloks'); | 241 | ->with('infobloks'); |
242 | $Query = $Query->where('id', '=', $worker->id); | 242 | $Query = $Query->where('id', '=', $worker->id); |
243 | $Query = $Query->get(); | 243 | $Query = $Query->get(); |
244 | 244 | ||
245 | view()->share('Query',$Query); | 245 | view()->share('Query',$Query); |
246 | 246 | ||
247 | $status_work = WorkerStatuses::getWorkerStatuses(); | 247 | $status_work = WorkerStatuses::getWorkerStatuses(); |
248 | $infoblocks = infobloks::query()->get(); | 248 | $infoblocks = infobloks::query()->get(); |
249 | 249 | ||
250 | //return view('layout.pdf', compact('Query', 'status_work', 'infoblocks')); | 250 | //dd($Query[0]); |
251 | return view('layout.pdf', compact('Query', 'status_work', 'infoblocks')); | ||
251 | $pdf = PDF::loadView('layout.pdf', [ | 252 | $pdf = PDF::loadView('layout.pdf', [ |
252 | 'Query' => $Query, | 253 | 'Query' => $Query, |
253 | 'status_work' => $status_work, | 254 | 'status_work' => $status_work, |
254 | 'infoblocks' => $infoblocks | 255 | 'infoblocks' => $infoblocks |
255 | ])->setPaper('a4', 'landscape'); | 256 | ])->setPaper('a4', 'landscape'); |
256 | 257 | ||
257 | return $pdf->stream(); | 258 | return $pdf->stream(); |
258 | } | 259 | } |
259 | 260 | ||
260 | public function resume_download_all(Request $request) { | 261 | public function resume_download_all(Request $request) { |
261 | $spreadsheet = new Spreadsheet(); | 262 | $spreadsheet = new Spreadsheet(); |
262 | $sheet = $spreadsheet->getActiveSheet(); | 263 | $sheet = $spreadsheet->getActiveSheet(); |
263 | 264 | ||
264 | $columnMap = range('A', 'Z'); | 265 | $columnMap = range('A', 'Z'); |
265 | $columns = []; | 266 | $columns = []; |
266 | 267 | ||
267 | foreach (DbExportColumns::toArray() as $key => $value){ | 268 | foreach (DbExportColumns::toArray() as $key => $value){ |
268 | if ($request->input($key, 0)){ | 269 | if ($request->input($key, 0)){ |
269 | $sheet->setCellValue("{$columnMap[count($columns)]}1", ucfirst($value)); | 270 | $sheet->setCellValue("{$columnMap[count($columns)]}1", ucfirst($value)); |
270 | $columns[] = str_replace('__', '.', $key); | 271 | $columns[] = str_replace('__', '.', $key); |
271 | } | 272 | } |
272 | } | 273 | } |
273 | 274 | ||
274 | if (empty($columns)) { | 275 | if (empty($columns)) { |
275 | return redirect()->back()->with('error', 'Пожалуйста выберите хотя бы 1 колонку для экспорта.'); | 276 | return redirect()->back()->with('error', 'Пожалуйста выберите хотя бы 1 колонку для экспорта.'); |
276 | } | 277 | } |
277 | 278 | ||
278 | $query = User::select($columns) | 279 | $query = User::select($columns) |
279 | ->leftJoin('workers', 'users.id', '=', 'workers.user_id') | 280 | ->leftJoin('workers', 'users.id', '=', 'workers.user_id') |
280 | ->leftJoin('job_titles', 'workers.position_work', '=', 'job_titles.id') | 281 | ->leftJoin('job_titles', 'workers.position_work', '=', 'job_titles.id') |
281 | ->where('users.is_bd', '=', 1); | 282 | ->where('users.is_bd', '=', 1); |
282 | 283 | ||
283 | $job_title_list = $request->input('job_title_list', []); | 284 | $job_title_list = $request->input('job_title_list', []); |
284 | if (!empty($job_title_list)){ | 285 | if (!empty($job_title_list)){ |
285 | $query->whereIn('job_titles.id', $job_title_list); | 286 | $query->whereIn('job_titles.id', $job_title_list); |
286 | } | 287 | } |
287 | 288 | ||
288 | $users = $query->get(); | 289 | $users = $query->get(); |
289 | if ($users->count()){ | 290 | if ($users->count()){ |
290 | $i = 2; | 291 | $i = 2; |
291 | foreach ($users->toArray() as $user){ | 292 | foreach ($users->toArray() as $user){ |
292 | $j = 0; | 293 | $j = 0; |
293 | foreach ($user as $field){ | 294 | foreach ($user as $field){ |
294 | $sheet->setCellValue("{$columnMap[$j++]}$i", $field); | 295 | $sheet->setCellValue("{$columnMap[$j++]}$i", $field); |
295 | } | 296 | } |
296 | $i++; | 297 | $i++; |
297 | } | 298 | } |
298 | } | 299 | } |
299 | $writer = new Xlsx($spreadsheet); | 300 | $writer = new Xlsx($spreadsheet); |
300 | $fileName = 'DB.xlsx'; | 301 | $fileName = 'DB.xlsx'; |
301 | 302 | ||
302 | $response = new StreamedResponse(function() use ($writer) { | 303 | $response = new StreamedResponse(function() use ($writer) { |
303 | $writer->save('php://output'); | 304 | $writer->save('php://output'); |
304 | }); | 305 | }); |
305 | 306 | ||
306 | $response->headers->set('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); | 307 | $response->headers->set('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); |
307 | $response->headers->set('Content-Disposition', 'attachment;filename="' . $fileName . '"'); | 308 | $response->headers->set('Content-Disposition', 'attachment;filename="' . $fileName . '"'); |
308 | $response->headers->set('Cache-Control', 'max-age=0'); | 309 | $response->headers->set('Cache-Control', 'max-age=0'); |
309 | 310 | ||
310 | return $response; | 311 | return $response; |
311 | } | 312 | } |
312 | 313 | ||
313 | // Кабинет работника | 314 | // Кабинет работника |
314 | public function cabinet(Request $request) | 315 | public function cabinet(Request $request) |
315 | { | 316 | { |
316 | // дата год и месяц | 317 | // дата год и месяц |
317 | $get_date = date('Y.m'); | 318 | $get_date = date('Y.m'); |
318 | 319 | ||
319 | $id = Auth()->user()->id; | 320 | $id = Auth()->user()->id; |
320 | 321 | ||
321 | $Infobloks = infobloks::query()->get(); | 322 | $Infobloks = infobloks::query()->get(); |
322 | 323 | ||
323 | $Worker = Worker::query() | 324 | $Worker = Worker::query() |
324 | ->with(['users', 'sertificate', 'prev_company', 'infobloks', 'place_worker']) | 325 | ->with(['users', 'sertificate', 'prev_company', 'infobloks', 'place_worker']) |
325 | ->WhereHas('users', function (Builder $query) use ($id) { | 326 | ->WhereHas('users', function (Builder $query) use ($id) { |
326 | $query->Where('id', $id); | 327 | $query->Where('id', $id); |
327 | })->first(); | 328 | })->first(); |
328 | 329 | ||
329 | $Job_titles = Job_title::query()->where('is_remove', '=', '0') | 330 | $Job_titles = Job_title::query()->where('is_remove', '=', '0') |
330 | ->where('is_bd', '=' , '1') | 331 | ->where('is_bd', '=' , '1') |
331 | ->OrderByDesc('sort')->OrderBy('name') | 332 | ->OrderByDesc('sort')->OrderBy('name') |
332 | ->get(); | 333 | ->get(); |
333 | 334 | ||
334 | $stat = Static_worker::query()->where('year_month', '=', $get_date) | 335 | $stat = Static_worker::query()->where('year_month', '=', $get_date) |
335 | ->where('user_id', '=', $id) | 336 | ->where('user_id', '=', $id) |
336 | ->get(); | 337 | ->get(); |
337 | 338 | ||
338 | $persent = Tools::getWorkerProfilePercent($Worker); | 339 | $persent = Tools::getWorkerProfilePercent($Worker); |
339 | 340 | ||
340 | $status_work = WorkerStatuses::getWorkerStatuses(); | 341 | $status_work = WorkerStatuses::getWorkerStatuses(); |
341 | $additional_document_statuses = [0 => 'Не указано', 1 => 'В наличии', 2 => 'Отсутствует']; | 342 | $additional_document_statuses = [0 => 'Не указано', 1 => 'В наличии', 2 => 'Отсутствует']; |
342 | $info_blocks = infobloks::query()->OrderBy('name')->get(); | 343 | $info_blocks = infobloks::query()->OrderBy('name')->get(); |
343 | 344 | ||
344 | $worker = Worker::query() | 345 | $worker = Worker::query() |
345 | ->with('users') | 346 | ->with('users') |
346 | ->with('sertificate') | 347 | ->with('sertificate') |
347 | ->with('prev_company') | 348 | ->with('prev_company') |
348 | ->with('infobloks') | 349 | ->with('infobloks') |
349 | ->with('place_worker') | 350 | ->with('place_worker') |
350 | ->with('job_titles') | 351 | ->with('job_titles') |
351 | ->WhereHas('users', function (Builder $query) use ($id) { | 352 | ->WhereHas('users', function (Builder $query) use ($id) { |
352 | $query->Where('id', $id); | 353 | $query->Where('id', $id); |
353 | }) | 354 | }) |
354 | ->first(); | 355 | ->first(); |
355 | if ($worker->dop_info->count()){ | 356 | if ($worker->dop_info->count()){ |
356 | $worker->dop_info = $worker->dop_info->keyBy('infoblok_id')->toArray(); | 357 | $worker->dop_info = $worker->dop_info->keyBy('infoblok_id')->toArray(); |
357 | } | 358 | } |
358 | 359 | ||
359 | //dd($worker->dop_info); | 360 | //dd($worker->dop_info); |
360 | 361 | ||
361 | if ($request->has('print')) { | 362 | if ($request->has('print')) { |
362 | dd($Worker); | 363 | dd($Worker); |
363 | } else { | 364 | } else { |
364 | return view('workers.cabinet', compact( 'persent', 'Job_titles', 'stat', | 365 | return view('workers.cabinet', compact( 'persent', 'Job_titles', 'stat', |
365 | 'worker', 'info_blocks', 'status_work', 'additional_document_statuses' | 366 | 'worker', 'info_blocks', 'status_work', 'additional_document_statuses' |
366 | )); | 367 | )); |
367 | } | 368 | } |
368 | } | 369 | } |
369 | 370 | ||
370 | // Сохранение данных | 371 | // Сохранение данных |
371 | public function cabinet_save(Worker $worker, Request $request) | 372 | public function cabinet_save(Worker $worker, Request $request) |
372 | { | 373 | { |
373 | $id = $worker->id; | 374 | $id = $worker->id; |
374 | $params = $request->all(); | 375 | $params = $request->all(); |
375 | $job_title_id = $request->get('job_title_id'); | 376 | $job_title_id = $request->get('job_title_id'); |
376 | 377 | ||
377 | $rules = [ | 378 | $rules = [ |
378 | 'surname' => ['required', 'string', 'max:255'], | 379 | 'surname' => ['required', 'string', 'max:255'], |
379 | 'name_man' => ['required', 'string', 'max:255'], | 380 | 'name_man' => ['required', 'string', 'max:255'], |
380 | 'email' => ['required', 'string', 'email', 'max:255'], | 381 | 'email' => ['required', 'string', 'email', 'max:255'], |
381 | 382 | ||
382 | ]; | 383 | ]; |
383 | 384 | ||
384 | $messages = [ | 385 | $messages = [ |
385 | 'required' => 'Укажите обязательное поле', | 386 | 'required' => 'Укажите обязательное поле', |
386 | 'min' => [ | 387 | 'min' => [ |
387 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 388 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
388 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 389 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
389 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 390 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
390 | ], | 391 | ], |
391 | 'max' => [ | 392 | 'max' => [ |
392 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 393 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
393 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 394 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
394 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 395 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
395 | ] | 396 | ] |
396 | ]; | 397 | ]; |
397 | 398 | ||
398 | $validator = Validator::make($params, $rules, $messages); | 399 | $validator = Validator::make($params, $rules, $messages); |
399 | 400 | ||
400 | if ($validator->fails()) { | 401 | if ($validator->fails()) { |
401 | return redirect()->route('worker.cabinet')->withErrors($validator); | 402 | return redirect()->route('worker.cabinet')->withErrors($validator); |
402 | } else { | 403 | } else { |
403 | 404 | ||
404 | if ($request->has('photo')) { | 405 | if ($request->has('photo')) { |
405 | if (!empty($worker->photo)) { | 406 | if (!empty($worker->photo)) { |
406 | Storage::delete($worker->photo); | 407 | Storage::delete($worker->photo); |
407 | } | 408 | } |
408 | $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); | 409 | $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); |
409 | } | 410 | } |
410 | 411 | ||
411 | if ($request->has('file')) { | 412 | if ($request->has('file')) { |
412 | if (!empty($worker->file)) { | 413 | if (!empty($worker->file)) { |
413 | Storage::delete($worker->file); | 414 | Storage::delete($worker->file); |
414 | } | 415 | } |
415 | $params['file'] = $request->file('file')->store("worker/$id", 'public'); | 416 | $params['file'] = $request->file('file')->store("worker/$id", 'public'); |
416 | } | 417 | } |
417 | 418 | ||
418 | $worker->update($params); | 419 | $worker->update($params); |
419 | $use = User::find($worker->user_id); | 420 | $use = User::find($worker->user_id); |
420 | $use->surname = $request->get('surname'); | 421 | $use->surname = $request->get('surname'); |
421 | $use->name_man = $request->get('name_man'); | 422 | $use->name_man = $request->get('name_man'); |
422 | $use->surname2 = $request->get('surname2'); | 423 | $use->surname2 = $request->get('surname2'); |
423 | 424 | ||
424 | $use->save(); | 425 | $use->save(); |
425 | $worker->job_titles()->sync($job_title_id); | 426 | $worker->job_titles()->sync($job_title_id); |
426 | 427 | ||
427 | return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); | 428 | return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); |
428 | } | 429 | } |
429 | } | 430 | } |
430 | 431 | ||
431 | public function cabinet_save_foto(Worker $worker, Request $request){ | 432 | public function cabinet_save_foto(Worker $worker, Request $request){ |
432 | $params = ['photo' => null]; | 433 | $params = ['photo' => null]; |
433 | 434 | ||
434 | if ($request->has('photo')) { | 435 | if ($request->has('photo')) { |
435 | if (!empty($worker->photo)) { | 436 | if (!empty($worker->photo)) { |
436 | Storage::delete($worker->photo); | 437 | Storage::delete($worker->photo); |
437 | } | 438 | } |
438 | $params['photo'] = $request->file('photo')->store("worker/$worker->id", 'public'); | 439 | $params['photo'] = $request->file('photo')->store("worker/$worker->id", 'public'); |
439 | } | 440 | } |
440 | 441 | ||
441 | if ($request->has('file')) { | 442 | if ($request->has('file')) { |
442 | if (!empty($worker->file)) { | 443 | if (!empty($worker->file)) { |
443 | Storage::delete($worker->file); | 444 | Storage::delete($worker->file); |
444 | } | 445 | } |
445 | $params['file'] = $request->file('file')->store("worker/$worker->id", 'public'); | 446 | $params['file'] = $request->file('file')->store("worker/$worker->id", 'public'); |
446 | } | 447 | } |
447 | 448 | ||
448 | $worker->update($params); | 449 | $worker->update($params); |
449 | 450 | ||
450 | return redirect()->route('worker.cabinet'); | 451 | return redirect()->route('worker.cabinet'); |
451 | } | 452 | } |
452 | 453 | ||
453 | // Сообщения данные | 454 | // Сообщения данные |
454 | public function messages($type_message) | 455 | public function messages($type_message) |
455 | { | 456 | { |
456 | $user_id = Auth()->user()->id; | 457 | $user_id = Auth()->user()->id; |
457 | 458 | ||
458 | $chats = Chat::get_user_chats($user_id); | 459 | $chats = Chat::get_user_chats($user_id); |
459 | $admin_chat = Chat::get_user_admin_chat($user_id); | 460 | $admin_chat = Chat::get_user_admin_chat($user_id); |
460 | $user_type = 'worker'; | 461 | $user_type = 'worker'; |
461 | 462 | ||
462 | return view('workers.messages', compact('chats', 'admin_chat','user_id', 'user_type')); | 463 | return view('workers.messages', compact('chats', 'admin_chat','user_id', 'user_type')); |
463 | } | 464 | } |
464 | 465 | ||
465 | // Избранный | 466 | // Избранный |
466 | public function favorite() | 467 | public function favorite() |
467 | { | 468 | { |
468 | return view('workers.favorite'); | 469 | return view('workers.favorite'); |
469 | } | 470 | } |
470 | 471 | ||
471 | // Сменить пароль | 472 | // Сменить пароль |
472 | public function new_password() | 473 | public function new_password() |
473 | { | 474 | { |
474 | $email = Auth()->user()->email; | 475 | $email = Auth()->user()->email; |
475 | return view('workers.new_password', compact('email')); | 476 | return view('workers.new_password', compact('email')); |
476 | } | 477 | } |
477 | 478 | ||
478 | // Обновление пароля | 479 | // Обновление пароля |
479 | public function save_new_password(Request $request) { | 480 | public function save_new_password(Request $request) { |
480 | $use = Auth()->user(); | 481 | $use = Auth()->user(); |
481 | $request->validate([ | 482 | $request->validate([ |
482 | 'password' => 'required|string', | 483 | 'password' => 'required|string', |
483 | 'new_password' => 'required|string', | 484 | 'new_password' => 'required|string', |
484 | 'new_password2' => 'required|string' | 485 | 'new_password2' => 'required|string' |
485 | ]); | 486 | ]); |
486 | 487 | ||
487 | if ($request->get('new_password') == $request->get('new_password2')) | 488 | if ($request->get('new_password') == $request->get('new_password2')) |
488 | if ($request->get('password') !== $request->get('new_password')) { | 489 | if ($request->get('password') !== $request->get('new_password')) { |
489 | $credentials = $request->only('email', 'password'); | 490 | $credentials = $request->only('email', 'password'); |
490 | if (Auth::attempt($credentials, $request->has('save_me'))) { | 491 | if (Auth::attempt($credentials, $request->has('save_me'))) { |
491 | 492 | ||
492 | if (!is_null($use->email_verified_at)){ | 493 | if (!is_null($use->email_verified_at)){ |
493 | 494 | ||
494 | $user_data = User_Model::find($use->id); | 495 | $user_data = User_Model::find($use->id); |
495 | $user_data->update([ | 496 | $user_data->update([ |
496 | 'password' => Hash::make($request->get('new_password')), | 497 | 'password' => Hash::make($request->get('new_password')), |
497 | 'pubpassword' => base64_encode($request->get('new_password')), | 498 | 'pubpassword' => base64_encode($request->get('new_password')), |
498 | ]); | 499 | ]); |
499 | return redirect() | 500 | return redirect() |
500 | ->route('worker.new_password') | 501 | ->route('worker.new_password') |
501 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); | 502 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); |
502 | } | 503 | } |
503 | 504 | ||
504 | return redirect() | 505 | return redirect() |
505 | ->route('worker.new_password') | 506 | ->route('worker.new_password') |
506 | ->withError('Данная учетная запись не было верифицированна!'); | 507 | ->withError('Данная учетная запись не было верифицированна!'); |
507 | } | 508 | } |
508 | } | 509 | } |
509 | 510 | ||
510 | return redirect() | 511 | return redirect() |
511 | ->route('worker.new_password') | 512 | ->route('worker.new_password') |
512 | ->withErrors('Не совпадение данных, обновите пароли!'); | 513 | ->withErrors('Не совпадение данных, обновите пароли!'); |
513 | } | 514 | } |
514 | 515 | ||
515 | // Удаление профиля форма | 516 | // Удаление профиля форма |
516 | public function delete_profile() | 517 | public function delete_profile() |
517 | { | 518 | { |
518 | $login = Auth()->user()->email; | 519 | $login = Auth()->user()->email; |
519 | return view('workers.delete_profile', compact('login')); | 520 | return view('workers.delete_profile', compact('login')); |
520 | } | 521 | } |
521 | 522 | ||
522 | // Удаление профиля код | 523 | // Удаление профиля код |
523 | public function delete_profile_result(Request $request) { | 524 | public function delete_profile_result(Request $request) { |
524 | $Answer = $request->all(); | 525 | $Answer = $request->all(); |
525 | $user_id = Auth()->user()->id; | 526 | $user_id = Auth()->user()->id; |
526 | $request->validate([ | 527 | $request->validate([ |
527 | 'password' => 'required|string', | 528 | 'password' => 'required|string', |
528 | ]); | 529 | ]); |
529 | 530 | ||
530 | $credentials = $request->only('email', 'password'); | 531 | $credentials = $request->only('email', 'password'); |
531 | if (Auth::attempt($credentials)) { | 532 | if (Auth::attempt($credentials)) { |
532 | Auth::logout(); | 533 | Auth::logout(); |
533 | $it = User_Model::find($user_id); | 534 | $it = User_Model::find($user_id); |
534 | $it->delete(); | 535 | $it->delete(); |
535 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); | 536 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); |
536 | } else { | 537 | } else { |
537 | return redirect()->route('worker.delete_profile') | 538 | return redirect()->route('worker.delete_profile') |
538 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); | 539 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); |
539 | } | 540 | } |
540 | } | 541 | } |
541 | 542 | ||
542 | // Регистрация соискателя | 543 | // Регистрация соискателя |
543 | public function register_worker(Request $request) | 544 | public function register_worker(Request $request) |
544 | { | 545 | { |
545 | $params = $request->all(); | 546 | $params = $request->all(); |
546 | $params['is_worker'] = 1; | 547 | $params['is_worker'] = 1; |
547 | 548 | ||
548 | $rules = [ | 549 | $rules = [ |
549 | 'surname' => ['required', 'string', 'max:255'], | 550 | 'surname' => ['required', 'string', 'max:255'], |
550 | 'name_man' => ['required', 'string', 'max:255'], | 551 | 'name_man' => ['required', 'string', 'max:255'], |
551 | 'email' => ['required', 'email', 'max:255', 'unique:users'], | 552 | 'email' => ['required', 'email', 'max:255', 'unique:users'], |
552 | 'password' => ['required', 'string', 'min:6'] | 553 | 'password' => ['required', 'string', 'min:6'] |
553 | ]; | 554 | ]; |
554 | 555 | ||
555 | $messages = [ | 556 | $messages = [ |
556 | 'required' => 'Укажите обязательное поле', | 557 | 'required' => 'Укажите обязательное поле', |
557 | 'min' => [ | 558 | 'min' => [ |
558 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 559 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
559 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 560 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
560 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 561 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
561 | ], | 562 | ], |
562 | 'max' => [ | 563 | 'max' => [ |
563 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 564 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
564 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 565 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
565 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 566 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
566 | ] | 567 | ] |
567 | ]; | 568 | ]; |
568 | 569 | ||
569 | $email = $request->get('email'); | 570 | $email = $request->get('email'); |
570 | if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { | 571 | if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { |
571 | return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); | 572 | return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); |
572 | } | 573 | } |
573 | 574 | ||
574 | if ($request->get('password') !== $request->get('confirmed')){ | 575 | if ($request->get('password') !== $request->get('confirmed')){ |
575 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); | 576 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); |
576 | } | 577 | } |
577 | 578 | ||
578 | if (strlen($request->get('password')) < 6) { | 579 | if (strlen($request->get('password')) < 6) { |
579 | return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); | 580 | return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); |
580 | } | 581 | } |
581 | 582 | ||
582 | /*$haystack = $request->get('password'); | 583 | /*$haystack = $request->get('password'); |
583 | 584 | ||
584 | $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); | 585 | $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); |
585 | $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', | 586 | $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', |
586 | 'X', 'C', 'V', 'B', 'N', 'M'); | 587 | 'X', 'C', 'V', 'B', 'N', 'M'); |
587 | $lenpwd_bool = true; | 588 | $lenpwd_bool = true; |
588 | $spec_bool = false; | 589 | $spec_bool = false; |
589 | $alpha_bool = false; | 590 | $alpha_bool = false; |
590 | 591 | ||
591 | if (strlen($haystack) < 8) $lenpwd_bool = false; | 592 | if (strlen($haystack) < 8) $lenpwd_bool = false; |
592 | 593 | ||
593 | foreach ($specsumbol as $it) { | 594 | foreach ($specsumbol as $it) { |
594 | if (strpos($haystack, $it) !== false) { | 595 | if (strpos($haystack, $it) !== false) { |
595 | $spec_bool = true; | 596 | $spec_bool = true; |
596 | } | 597 | } |
597 | } | 598 | } |
598 | 599 | ||
599 | foreach ($alpha as $it) { | 600 | foreach ($alpha as $it) { |
600 | if (strpos($haystack, $it) !== false) { | 601 | if (strpos($haystack, $it) !== false) { |
601 | $alpha_bool = true; | 602 | $alpha_bool = true; |
602 | } | 603 | } |
603 | } | 604 | } |
604 | 605 | ||
605 | if ((!$spec_bool) || (!$alpha_bool)) { | 606 | if ((!$spec_bool) || (!$alpha_bool)) { |
606 | return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); | 607 | return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); |
607 | }*/ | 608 | }*/ |
608 | 609 | ||
609 | if (($request->has('politik')) && ($request->get('politik') == 1)) { | 610 | if (($request->has('politik')) && ($request->get('politik') == 1)) { |
610 | $validator = Validator::make($params, $rules, $messages); | 611 | $validator = Validator::make($params, $rules, $messages); |
611 | 612 | ||
612 | if ($validator->fails()) { | 613 | if ($validator->fails()) { |
613 | return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); | 614 | return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); |
614 | } else { | 615 | } else { |
615 | //dd($params); | 616 | //dd($params); |
616 | $user = $this->create($params); | 617 | $user = $this->create($params); |
617 | event(new Registered($user)); | 618 | event(new Registered($user)); |
618 | Auth::guard()->login($user); | 619 | Auth::guard()->login($user); |
619 | } | 620 | } |
620 | if ($user) { | 621 | if ($user) { |
621 | return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; | 622 | return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; |
622 | } else { | 623 | } else { |
623 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); | 624 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); |
624 | } | 625 | } |
625 | 626 | ||
626 | } else { | 627 | } else { |
627 | return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!")); | 628 | return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!")); |
628 | } | 629 | } |
629 | } | 630 | } |
630 | 631 | ||
631 | // Звездная оценка и ответ | 632 | // Звездная оценка и ответ |
632 | public function stars_answer(Request $request) { | 633 | public function stars_answer(Request $request) { |
633 | $params = $request->all(); | 634 | $params = $request->all(); |
634 | $rules = [ | 635 | $rules = [ |
635 | 'message' => ['required', 'string', 'max:255'], | 636 | 'message' => ['required', 'string', 'max:255'], |
636 | ]; | 637 | ]; |
637 | 638 | ||
638 | $messages = [ | 639 | $messages = [ |
639 | 'required' => 'Укажите обязательное поле', | 640 | 'required' => 'Укажите обязательное поле', |
640 | 'min' => [ | 641 | 'min' => [ |
641 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 642 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
642 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 643 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
643 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 644 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
644 | ], | 645 | ], |
645 | 'max' => [ | 646 | 'max' => [ |
646 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 647 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
647 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 648 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
648 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 649 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
649 | ] | 650 | ] |
650 | ]; | 651 | ]; |
651 | $response_worker = ResponseWork::create($params); | 652 | $response_worker = ResponseWork::create($params); |
652 | return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); | 653 | return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); |
653 | } | 654 | } |
654 | 655 | ||
655 | public function TestWorker() | 656 | public function TestWorker() |
656 | { | 657 | { |
657 | $Use = new User(); | 658 | $Use = new User(); |
658 | 659 | ||
659 | $Code_user = $Use->create([ | 660 | $Code_user = $Use->create([ |
660 | 'name' => 'surname name_man', | 661 | 'name' => 'surname name_man', |
661 | 'name_man' => 'name_man', | 662 | 'name_man' => 'name_man', |
662 | 'surname' => 'surname', | 663 | 'surname' => 'surname', |
663 | 'surname2' => 'surname2', | 664 | 'surname2' => 'surname2', |
664 | 'subscribe_email' => '1', | 665 | 'subscribe_email' => '1', |
665 | 'email' => 'email@mail.com', | 666 | 'email' => 'email@mail.com', |
666 | 'telephone' => '1234567890', | 667 | 'telephone' => '1234567890', |
667 | 'password' => Hash::make('password'), | 668 | 'password' => Hash::make('password'), |
668 | 'pubpassword' => base64_encode('password'), | 669 | 'pubpassword' => base64_encode('password'), |
669 | 'email_verified_at' => Carbon::now(), | 670 | 'email_verified_at' => Carbon::now(), |
670 | 'is_worker' => 1, | 671 | 'is_worker' => 1, |
671 | ]); | 672 | ]); |
672 | 673 | ||
673 | if ($Code_user->id > 0) { | 674 | if ($Code_user->id > 0) { |
674 | $Worker = new Worker(); | 675 | $Worker = new Worker(); |
675 | $Worker->user_id = $Code_user->id; | 676 | $Worker->user_id = $Code_user->id; |
676 | $Worker->position_work = 1; //'job_titles'; | 677 | $Worker->position_work = 1; //'job_titles'; |
677 | $Worker->email = 'email@email.com'; | 678 | $Worker->email = 'email@email.com'; |
678 | $Worker->telephone = '1234567890'; | 679 | $Worker->telephone = '1234567890'; |
679 | $status = $Worker->save(); | 680 | $status = $Worker->save(); |
680 | 681 | ||
681 | $Title_Worker = new Title_worker(); | 682 | $Title_Worker = new Title_worker(); |
682 | $Title_Worker->worker_id = $Worker->id; | 683 | $Title_Worker->worker_id = $Worker->id; |
683 | $Title_Worker->job_title_id = 1; | 684 | $Title_Worker->job_title_id = 1; |
684 | $Title_Worker->save(); | 685 | $Title_Worker->save(); |
685 | } | 686 | } |
686 | } | 687 | } |
687 | 688 | ||
688 | // Создание пользователя | 689 | // Создание пользователя |
689 | protected function create(array $data) | 690 | protected function create(array $data) |
690 | { | 691 | { |
691 | $Use = new User(); | 692 | $Use = new User(); |
692 | 693 | ||
693 | $Code_user = $Use->create([ | 694 | $Code_user = $Use->create([ |
694 | 'name' => $data['surname']." ".$data['name_man'], | 695 | 'name' => $data['surname']." ".$data['name_man'], |
695 | 'name_man' => $data['name_man'], | 696 | 'name_man' => $data['name_man'], |
696 | 'surname' => $data['surname'], | 697 | 'surname' => $data['surname'], |
697 | 'surname2' => $data['surname2'], | 698 | 'surname2' => $data['surname2'], |
698 | 'subscribe_email' => $data['email'], | 699 | 'subscribe_email' => $data['email'], |
699 | 'email' => $data['email'], | 700 | 'email' => $data['email'], |
700 | 'telephone' => $data['telephone'], | 701 | 'telephone' => $data['telephone'], |
701 | 'password' => Hash::make($data['password']), | 702 | 'password' => Hash::make($data['password']), |
702 | 'pubpassword' => base64_encode($data['password']), | 703 | 'pubpassword' => base64_encode($data['password']), |
703 | 'email_verified_at' => Carbon::now(), | 704 | 'email_verified_at' => Carbon::now(), |
704 | 'is_worker' => $data['is_worker'], | 705 | 'is_worker' => $data['is_worker'], |
705 | ]); | 706 | ]); |
706 | 707 | ||
707 | if ($Code_user->id > 0) { | 708 | if ($Code_user->id > 0) { |
708 | $Worker = new Worker(); | 709 | $Worker = new Worker(); |
709 | $Worker->user_id = $Code_user->id; | 710 | $Worker->user_id = $Code_user->id; |
710 | $Worker->position_work = $data['job_titles']; | 711 | $Worker->position_work = $data['job_titles']; |
711 | $Worker->email = $data['email']; | 712 | $Worker->email = $data['email']; |
712 | $Worker->telephone = $data['telephone']; | 713 | $Worker->telephone = $data['telephone']; |
713 | $Worker->save(); | 714 | $Worker->save(); |
714 | 715 | ||
715 | if (isset($Worker->id)) { | 716 | if (isset($Worker->id)) { |
716 | $Title_Worker = new Title_worker(); | 717 | $Title_Worker = new Title_worker(); |
717 | $Title_Worker->worker_id = $Worker->id; | 718 | $Title_Worker->worker_id = $Worker->id; |
718 | $Title_Worker->job_title_id = $data['job_titles']; | 719 | $Title_Worker->job_title_id = $data['job_titles']; |
719 | $Title_Worker->save(); | 720 | $Title_Worker->save(); |
720 | } | 721 | } |
721 | 722 | ||
722 | return $Code_user; | 723 | return $Code_user; |
723 | } | 724 | } |
724 | } | 725 | } |
725 | 726 | ||
726 | // Вакансии избранные | 727 | // Вакансии избранные |
727 | public function colorado(Request $request) { | 728 | public function colorado(Request $request) { |
728 | $IP_address = RusDate::ip_addr_client(); | 729 | $Arr = Like_vacancy::Query() |
729 | $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); | 730 | ->select('code_record') |
731 | ->where('user_id', Auth::user()->id) | ||
732 | ->get(); | ||
730 | 733 | ||
731 | if ($Arr->count()) { | 734 | if ($Arr->count()) { |
732 | $A = Array(); | 735 | $A = Array(); |
733 | foreach ($Arr as $it) { | 736 | foreach ($Arr as $it) { |
734 | $A[] = $it->code_record; | 737 | $A[] = $it->code_record; |
735 | } | 738 | } |
736 | 739 | ||
737 | $Query = Ad_employer::query()->whereIn('id', $A); | 740 | $Query = Ad_employer::query()->whereIn('id', $A); |
738 | } else { | 741 | } else { |
739 | $Query = Ad_employer::query()->where('id', '=', '0'); | 742 | $Query = Ad_employer::query()->where('id', '=', '0'); |
740 | } | 743 | } |
741 | 744 | ||
742 | $Query = $Query->with(['jobs', 'cat', 'employer']) | 745 | $Query = $Query->with(['jobs', 'cat', 'employer']) |
743 | ->whereHas('jobs_code', function ($query) use ($request) { | 746 | ->whereHas('jobs_code', function ($query) use ($request) { |
744 | if ($request->ajax()) { | 747 | if ($request->ajax()) { |
745 | if (null !== ($request->get('job'))) { | 748 | if (null !== ($request->get('job'))) { |
746 | $query->where('job_title_id', $request->get('job')); | 749 | $query->where('job_title_id', $request->get('job')); |
747 | } | 750 | } |
748 | } | 751 | } |
749 | }) | 752 | }) |
750 | ->select('ad_employers.*'); | 753 | ->select('ad_employers.*'); |
751 | 754 | ||
752 | if ($request->get('search') !== null) { | 755 | if ($request->get('search') !== null) { |
753 | $search = $request->get('search'); | 756 | $search = $request->get('search'); |
754 | $Query->where('name', 'LIKE', "%$search%"); | 757 | $Query->where('name', 'LIKE', "%$search%"); |
755 | } | 758 | } |
756 | 759 | ||
757 | //dd($Query->get()); | 760 | //dd($Query->get()); |
758 | 761 | ||
759 | $Job_title = Job_title::query()->OrderBy('name')->get(); | 762 | $Job_title = Job_title::query()->OrderBy('name')->get(); |
760 | 763 | ||
761 | $Query_count = $Query->count(); | 764 | $Query_count = $Query->count(); |
762 | 765 | ||
763 | $Query = $Query->OrderBy('updated_at')->paginate(3); | 766 | $Query = $Query->OrderBy('updated_at')->paginate(3); |
764 | 767 | ||
765 | return view('workers.favorite', compact('Query', | 768 | return view('workers.favorite', compact('Query', |
766 | 'Query_count', | 769 | 'Query_count', |
767 | 'Job_title')); | 770 | 'Job_title')); |
768 | 771 | ||
769 | } | 772 | } |
770 | 773 | ||
771 | //Переписка | 774 | //Переписка |
772 | public function dialog(Chat $chat, Request $request) { | 775 | public function dialog(Chat $chat, Request $request) { |
773 | // Получение параметров. | 776 | // Получение параметров. |
774 | if ($request->has('ad_employer')){ | 777 | if ($request->has('ad_employer')){ |
775 | $ad_employer = $request->get('ad_employer'); | 778 | $ad_employer = $request->get('ad_employer'); |
776 | } else { | 779 | } else { |
777 | $ad_employer = 0; | 780 | $ad_employer = 0; |
778 | } | 781 | } |
779 | 782 | ||
780 | $sender = User_Model::query()->with('workers')->with('employers')->where('id', $chat->user_id)->first(); | 783 | $sender = User_Model::query()->with('workers')->with('employers')->where('id', $chat->user_id)->first(); |
781 | $companion = User_Model::query()->with('workers')->with('employers')->where('id', $chat->to_user_id)->first(); | 784 | $companion = User_Model::query()->with('workers')->with('employers')->where('id', $chat->to_user_id)->first(); |
782 | 785 | ||
783 | $Messages = Chat::get_chat_messages($chat); | 786 | $Messages = Chat::get_chat_messages($chat); |
784 | 787 | ||
785 | Message::where('chat_id_to', '=', $chat->id)->update(['flag_new' => 0]); | 788 | Message::where('chat_id_to', '=', $chat->id)->update(['flag_new' => 0]); |
786 | 789 | ||
787 | return view('workers.dialog', compact('companion', 'sender', 'chat', 'Messages', 'ad_employer')); | 790 | return view('workers.dialog', compact('companion', 'sender', 'chat', 'Messages', 'ad_employer')); |
788 | } | 791 | } |
789 | 792 | ||
790 | // Даунылоады | 793 | // Даунылоады |
791 | public function download(Worker $worker) { | 794 | public function download(Worker $worker) { |
792 | $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; | 795 | $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; |
793 | view()->share('house',$arr_house); | 796 | view()->share('house',$arr_house); |
794 | $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); | 797 | $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); |
795 | return $pdf->stream(); | 798 | return $pdf->stream(); |
796 | } | 799 | } |
797 | 800 | ||
798 | // Поднятие анкеты | 801 | // Поднятие анкеты |
799 | public function up(Worker $worker) { | 802 | public function up(Worker $worker) { |
800 | $worker->updated_at = Carbon::now(); | 803 | $worker->updated_at = Carbon::now(); |
801 | $worker->save(); | 804 | $worker->save(); |
802 | // 0 | 805 | // 0 |
803 | return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); | 806 | return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); |
804 | } | 807 | } |
805 | 808 | ||
806 | // Форма сертификате | 809 | // Форма сертификате |
807 | public function new_sertificate(Worker $worker) { | 810 | public function new_sertificate(Worker $worker) { |
808 | return view('workers.sertificate_add', compact('worker')); | 811 | return view('workers.sertificate_add', compact('worker')); |
809 | } | 812 | } |
810 | 813 | ||
811 | // Добавление сертификата | 814 | // Добавление сертификата |
812 | public function add_serificate(SertificationRequest $request) { | 815 | public function add_serificate(SertificationRequest $request) { |
813 | $request->validate([ | 816 | $request->validate([ |
814 | 'name' => 'required|string|max:255', | 817 | 'name' => 'required|string|max:255', |
815 | 'end_begin' => 'required|date|date_format:d.m.Y' | 818 | 'end_begin' => 'required|date|date_format:d.m.Y' |
816 | ], | 819 | ], |
817 | [ | 820 | [ |
818 | 'name' => 'Навание сертификата обязательно для заполнения.', | 821 | 'name' => 'Навание сертификата обязательно для заполнения.', |
819 | 'end_begin' => 'Формат даты должен соответствовать дд.мм.гггг' | 822 | 'end_begin' => 'Формат даты должен соответствовать дд.мм.гггг' |
820 | ]); | 823 | ]); |
821 | 824 | ||
822 | $params = $request->all(); | 825 | $params = $request->all(); |
823 | 826 | ||
824 | $end_begin = DateTime::createFromFormat('d.m.Y', $params['end_begin']); | 827 | $end_begin = DateTime::createFromFormat('d.m.Y', $params['end_begin']); |
825 | $params['end_begin'] = $end_begin->format('Y-m-d'); | 828 | $params['end_begin'] = $end_begin->format('Y-m-d'); |
826 | 829 | ||
827 | $Sertificate = new sertification(); | 830 | $Sertificate = new sertification(); |
828 | $Sertificate->create($params); | 831 | $Sertificate->create($params); |
829 | 832 | ||
830 | return response()->json([ | 833 | return response()->json([ |
831 | 'success' => true | 834 | 'success' => true |
832 | ]); | 835 | ]); |
833 | } | 836 | } |
834 | 837 | ||
835 | // Удалить сертификат | 838 | // Удалить сертификат |
836 | public function delete_sertificate(sertification $doc) { | 839 | public function delete_sertificate(sertification $doc) { |
837 | $doc->delete(); | 840 | $doc->delete(); |
838 | 841 | ||
839 | return redirect()->route('worker.cabinet'); | 842 | return redirect()->route('worker.cabinet'); |
840 | } | 843 | } |
841 | 844 | ||
842 | // Редактирование сертификата | 845 | // Редактирование сертификата |
843 | public function edit_sertificate(Worker $worker, sertification $doc) { | 846 | public function edit_sertificate(Worker $worker, sertification $doc) { |
844 | return view('workers.sertificate_edit', compact('doc', 'worker')); | 847 | return view('workers.sertificate_edit', compact('doc', 'worker')); |
845 | } | 848 | } |
846 | 849 | ||
847 | // Редактирование обновление сертификата | 850 | // Редактирование обновление сертификата |
848 | public function update_serificate(SertificationRequest $request, sertification $doc) { | 851 | public function update_serificate(SertificationRequest $request, sertification $doc) { |
849 | $request->validate([ | 852 | $request->validate([ |
850 | 'name' => 'required|string|max:255', | 853 | 'name' => 'required|string|max:255', |
851 | 'end_begin' => 'required|date|date_format:d.m.Y' | 854 | 'end_begin' => 'required|date|date_format:d.m.Y' |
852 | ], | 855 | ], |
853 | [ | 856 | [ |
854 | 'name' => 'Навание сертификата обязательно для заполнения.', | 857 | 'name' => 'Навание сертификата обязательно для заполнения.', |
855 | 'end_begin' => 'Формат даты должен соответствовать дд.мм.гггг' | 858 | 'end_begin' => 'Формат даты должен соответствовать дд.мм.гггг' |
856 | ]); | 859 | ]); |
857 | 860 | ||
858 | $all = $request->all(); | 861 | $all = $request->all(); |
859 | 862 | ||
860 | $end_begin = DateTime::createFromFormat('d.m.Y', $all['end_begin']); | 863 | $end_begin = DateTime::createFromFormat('d.m.Y', $all['end_begin']); |
861 | $all['end_begin'] = $end_begin->format('Y-m-d'); | 864 | $all['end_begin'] = $end_begin->format('Y-m-d'); |
862 | 865 | ||
863 | $doc->worker_id = $all['worker_id']; | 866 | $doc->worker_id = $all['worker_id']; |
864 | $doc->name = $all['name']; | 867 | $doc->name = $all['name']; |
865 | $doc->end_begin = $all['end_begin']; | 868 | $doc->end_begin = $all['end_begin']; |
866 | $doc->save(); | 869 | $doc->save(); |
867 | 870 | ||
868 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); | 871 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); |
869 | } | 872 | } |
870 | 873 | ||
871 | public function edit_diploms(Request $request, Worker $worker) { | 874 | public function edit_diploms(Request $request, Worker $worker) { |
872 | $dop_info_data = $request->input('diploms'); | 875 | $dop_info_data = $request->input('diploms'); |
873 | 876 | ||
874 | if (empty($dop_info_data)) { | 877 | if (empty($dop_info_data)) { |
875 | return redirect()->route('worker.additional_documents')->with('error', 'Данные не предоставлены!'); | 878 | return redirect()->route('worker.additional_documents')->with('error', 'Данные не предоставлены!'); |
876 | } | 879 | } |
877 | 880 | ||
878 | foreach ($dop_info_data as $infoblok_id => $status) { | 881 | foreach ($dop_info_data as $infoblok_id => $status) { |
879 | Dop_info::updateOrCreate( | 882 | Dop_info::updateOrCreate( |
880 | ['worker_id' => $worker->id, 'infoblok_id' => $infoblok_id], | 883 | ['worker_id' => $worker->id, 'infoblok_id' => $infoblok_id], |
881 | ['status' => $status] | 884 | ['status' => $status] |
882 | ); | 885 | ); |
883 | } | 886 | } |
884 | 887 | ||
885 | return redirect()->route('worker.additional_documents')->with('success', 'Успешно сохранено!'); | 888 | return redirect()->route('worker.additional_documents')->with('success', 'Успешно сохранено!'); |
886 | } | 889 | } |
887 | 890 | ||
888 | public function delete_add_diplom(Request $request, Worker $worker) { | 891 | public function delete_add_diplom(Request $request, Worker $worker) { |
889 | $infoblok_id = $request->get('infoblok_id'); | 892 | $infoblok_id = $request->get('infoblok_id'); |
890 | 893 | ||
891 | if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0) | 894 | if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0) |
892 | $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete(); | 895 | $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete(); |
893 | else { | 896 | else { |
894 | $params['infoblok_id'] = $infoblok_id; | 897 | $params['infoblok_id'] = $infoblok_id; |
895 | $params['worker_id'] = $worker->id; | 898 | $params['worker_id'] = $worker->id; |
896 | $params['status'] = $request->get('val'); | 899 | $params['status'] = $request->get('val'); |
897 | $id = Dop_info::create($params); | 900 | $id = Dop_info::create($params); |
898 | //$id = $worker->infobloks()->sync([$infoblok_id]); | 901 | //$id = $worker->infobloks()->sync([$infoblok_id]); |
899 | } | 902 | } |
900 | 903 | ||
901 | //$Infoblocks = infobloks::query()->get(); | 904 | //$Infoblocks = infobloks::query()->get(); |
902 | return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks')); | 905 | return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks')); |
903 | } | 906 | } |
904 | 907 | ||
905 | 908 | ||
906 | 909 | ||
907 | // Добавление диплома | 910 | // Добавление диплома |
908 | public function add_diplom_ajax(Request $request) { | 911 | public function add_diplom_ajax(Request $request) { |
909 | // конец | 912 | // конец |
910 | $params = $request->all(); | 913 | $params = $request->all(); |
911 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); | 914 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); |
912 | 915 | ||
913 | if ($count == 0) $dop_info = Dop_info::create($params); | 916 | if ($count == 0) $dop_info = Dop_info::create($params); |
914 | $Infoblocks = infobloks::query()->get(); | 917 | $Infoblocks = infobloks::query()->get(); |
915 | $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); | 918 | $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); |
916 | $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); | 919 | $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); |
917 | return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); | 920 | return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); |
918 | } | 921 | } |
919 | 922 | ||
920 | // Добавление диплома без ajax | 923 | // Добавление диплома без ajax |
921 | public function add_diplom(Worker $worker) { | 924 | public function add_diplom(Worker $worker) { |
922 | $worker_id = $worker->id; | 925 | $worker_id = $worker->id; |
923 | $Infoblocks = infobloks::query()->get(); | 926 | $Infoblocks = infobloks::query()->get(); |
924 | return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); | 927 | return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); |
925 | } | 928 | } |
926 | // Сохранить | 929 | // Сохранить |
927 | // Сохраняю диплом | 930 | // Сохраняю диплом |
928 | public function add_diplom_save(Request $request) { | 931 | public function add_diplom_save(Request $request) { |
929 | $params = $request->all(); | 932 | $params = $request->all(); |
930 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); | 933 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); |
931 | if ($count == 0) $dop_info = Dop_info::create($params); | 934 | if ($count == 0) $dop_info = Dop_info::create($params); |
932 | return redirect()->route('worker.cabinet'); | 935 | return redirect()->route('worker.cabinet'); |
933 | } | 936 | } |
934 | 937 | ||
935 | // Добавление стандартного документа | 938 | // Добавление стандартного документа |
936 | public function add_document(Worker $worker) { | 939 | public function add_document(Worker $worker) { |
937 | return view('workers.docs', compact('worker')); | 940 | return view('workers.docs', compact('worker')); |
938 | } | 941 | } |
939 | 942 | ||
940 | //Сохранение стандартого документа | 943 | //Сохранение стандартого документа |
941 | public function add_document_save(DocumentsRequest $request) { | 944 | public function add_document_save(DocumentsRequest $request) { |
942 | $params = $request->all(); | 945 | $params = $request->all(); |
943 | place_works::create($params); | 946 | place_works::create($params); |
944 | return response()->json(['success' => true]); | 947 | return response()->json(['success' => true]); |
945 | } | 948 | } |
946 | 949 | ||
947 | // Редактирование документа | 950 | // Редактирование документа |
948 | public function edit_document(place_works $doc, Worker $worker) { | 951 | public function edit_document(place_works $doc, Worker $worker) { |
949 | return view('workers.docs-edit', compact('doc', 'worker')); | 952 | return view('workers.docs-edit', compact('doc', 'worker')); |
950 | } | 953 | } |
951 | 954 | ||
952 | //Сохранение отредактированного документа | 955 | //Сохранение отредактированного документа |
953 | public function edit_document_save(DocumentsRequest $request, place_works $doc) { | 956 | public function edit_document_save(DocumentsRequest $request, place_works $doc) { |
954 | $params = $request->all(); | 957 | $params = $request->all(); |
955 | $doc->update($params); | 958 | $doc->update($params); |
956 | 959 | ||
957 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); | 960 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); |
958 | } | 961 | } |
959 | 962 | ||
960 | // Удаление документа | 963 | // Удаление документа |
961 | public function delete_document(place_works $doc) { | 964 | public function delete_document(place_works $doc) { |
962 | $doc->delete(); | 965 | $doc->delete(); |
963 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); | 966 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); |
964 | } | 967 | } |
965 | 968 | ||
966 | //Отправка нового сообщения | 969 | //Отправка нового сообщения |
967 | public function new_message(Request $request) | 970 | public function new_message(Request $request) |
968 | { | 971 | { |
969 | $params = $request->all(); | 972 | $params = $request->all(); |
970 | 973 | ||
971 | $id = $params['user_from']; | 974 | $id = $params['user_from']; |
972 | 975 | ||
973 | Message::add_message( | 976 | Message::add_message( |
974 | $request, | 977 | $request, |
975 | $params['user_from'], | 978 | $params['user_from'], |
976 | $params['user_to'], | 979 | $params['user_to'], |
977 | [ | 980 | [ |
978 | 'text' => $params['comment'] ?? null, | 981 | 'text' => $params['comment'] ?? null, |
979 | 'ad_employer_id' => $params['vacancy'], | 982 | 'ad_employer_id' => $params['vacancy'], |
980 | 'flag_new' => 1 | 983 | 'flag_new' => 1 |
981 | ], | 984 | ], |
982 | file_store_path: "worker/$id" | 985 | file_store_path: "worker/$id" |
983 | ); | 986 | ); |
984 | 987 | ||
985 | return response([]); | 988 | return response([]); |
986 | //return redirect(route('list-vacancies').'/#response_sent'); | 989 | //return redirect(route('list-vacancies').'/#response_sent'); |
987 | } | 990 | } |
988 | 991 | ||
989 | 992 | ||
990 | public function test123(Request $request) { | 993 | public function test123(Request $request) { |
991 | $params = $request->all(); | 994 | $params = $request->all(); |
992 | $user1 = $params['user_id']; | 995 | $user1 = $params['user_id']; |
993 | $user2 = $params['to_user_id']; | 996 | $user2 = $params['to_user_id']; |
994 | 997 | ||
995 | $rules = [ | 998 | $rules = [ |
996 | 'text' => 'nullable|required_without:file|min:1|max:150000', | 999 | 'text' => 'nullable|required_without:file|min:1|max:150000', |
997 | 'file' => 'nullable|file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' | 1000 | 'file' => 'nullable|file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' |
998 | ]; | 1001 | ]; |
999 | $messages = [ | 1002 | $messages = [ |
1000 | 'required_without' => 'Поле «:attribute» обязательно, если файл не прикреплен', | 1003 | 'required_without' => 'Поле «:attribute» обязательно, если файл не прикреплен', |
1001 | 'min' => [ | 1004 | 'min' => [ |
1002 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 1005 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
1003 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 1006 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
1004 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 1007 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
1005 | ], | 1008 | ], |
1006 | 'max' => [ | 1009 | 'max' => [ |
1007 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 1010 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
1008 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 1011 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
1009 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 1012 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
1010 | ] | 1013 | ] |
1011 | ]; | 1014 | ]; |
1012 | 1015 | ||
1013 | $validator = Validator::make($request->all(), $rules, $messages); | 1016 | $validator = Validator::make($request->all(), $rules, $messages); |
1014 | 1017 | ||
1015 | if ($validator->fails()) { | 1018 | if ($validator->fails()) { |
1016 | $chat = Chat::where('user_id', $user1) | 1019 | $chat = Chat::where('user_id', $user1) |
1017 | ->where('to_user_id', $user2) | 1020 | ->where('to_user_id', $user2) |
1018 | ->where('is_removed', 0) | 1021 | ->where('is_removed', 0) |
1019 | ->first() | 1022 | ->first() |
1020 | ; | 1023 | ; |
1021 | 1024 | ||
1022 | if ($chat->id){ | 1025 | if ($chat->id){ |
1023 | return redirect()->route('worker.dialog', ['chat' => $chat->id])->withErrors($validator); | 1026 | return redirect()->route('worker.dialog', ['chat' => $chat->id])->withErrors($validator); |
1024 | } else { | 1027 | } else { |
1025 | return redirect()->route('cabinet.messages', ['type_message' => 'input'])->withErrors($validator); | 1028 | return redirect()->route('cabinet.messages', ['type_message' => 'input'])->withErrors($validator); |
1026 | } | 1029 | } |
1027 | } else { | 1030 | } else { |
1028 | $new_message = Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages'); | 1031 | $new_message = Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages'); |
1029 | 1032 | ||
1030 | return redirect()->route('worker.dialog', ['chat' => $new_message->chat_id_from]); | 1033 | return redirect()->route('worker.dialog', ['chat' => $new_message->chat_id_from]); |
1031 | 1034 | ||
1032 | } | 1035 | } |
1033 | } | 1036 | } |
1034 | 1037 | ||
1035 | // Информация о предыдущих компаниях | 1038 | // Информация о предыдущих компаниях |
1036 | public function new_prev_company(Worker $worker) { | 1039 | public function new_prev_company(Worker $worker) { |
1037 | return view('workers.prev_company_form', compact('worker')); | 1040 | return view('workers.prev_company_form', compact('worker')); |
1038 | } | 1041 | } |
1039 | 1042 | ||
1040 | // Добавление контакта компании | 1043 | // Добавление контакта компании |
1041 | public function add_prev_company(PrevCompanyRequest $request) { | 1044 | public function add_prev_company(PrevCompanyRequest $request) { |
1042 | // Возвращение параметров | 1045 | // Возвращение параметров |
1043 | $all = $request->all(); | 1046 | $all = $request->all(); |
1044 | PrevCompany::create($all); | 1047 | PrevCompany::create($all); |
1045 | 1048 | ||
1046 | return response()->json(['success' => true]); | 1049 | return response()->json(['success' => true]); |
1047 | } | 1050 | } |
1048 | 1051 | ||
1049 | // Редактирование контакта компании | 1052 | // Редактирование контакта компании |
1050 | public function edit_prev_company(PrevCompany $doc, Worker $worker) { | 1053 | public function edit_prev_company(PrevCompany $doc, Worker $worker) { |
1051 | return view('workers.prev_company_edit_form', compact('doc', 'worker')); | 1054 | return view('workers.prev_company_edit_form', compact('doc', 'worker')); |
1052 | } | 1055 | } |
1053 | 1056 | ||
1054 | //Сохранение редактирования контакта компании | 1057 | //Сохранение редактирования контакта компании |
1055 | public function update_prev_company(PrevCompany $doc, Request $request){ | 1058 | public function update_prev_company(PrevCompany $doc, Request $request){ |
1056 | $all = $request->all(); | 1059 | $all = $request->all(); |
1057 | $doc->update($all); | 1060 | $doc->update($all); |
1058 | 1061 | ||
1059 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись'); | 1062 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись'); |
1060 | } | 1063 | } |
1061 | 1064 | ||
1062 | // Удаление контакта предыдущей компании | 1065 | // Удаление контакта предыдущей компании |
1063 | public function delete_prev_company(PrevCompany $doc) { | 1066 | public function delete_prev_company(PrevCompany $doc) { |
1064 | $doc->delete(); | 1067 | $doc->delete(); |
1065 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); | 1068 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); |
1066 | } | 1069 | } |
1067 | } | 1070 | } |
1068 | 1071 | ||
1069 | 1072 |
app/Models/Worker.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Models; | 3 | namespace App\Models; |
4 | 4 | ||
5 | use Illuminate\Database\Eloquent\Builder; | 5 | use Illuminate\Database\Eloquent\Builder; |
6 | use Illuminate\Database\Eloquent\Factories\HasFactory; | 6 | use Illuminate\Database\Eloquent\Factories\HasFactory; |
7 | use Illuminate\Database\Eloquent\Model; | 7 | use Illuminate\Database\Eloquent\Model; |
8 | 8 | ||
9 | class Worker extends Model | 9 | class Worker extends Model |
10 | { | 10 | { |
11 | use HasFactory; | 11 | use HasFactory; |
12 | 12 | ||
13 | protected $table = 'workers'; | 13 | protected $table = 'workers'; |
14 | 14 | ||
15 | protected $fillable = [ | 15 | protected $fillable = [ |
16 | 'user_id', | 16 | 'user_id', |
17 | 'status_work', | 17 | 'status_work', |
18 | 'position_work', | 18 | 'position_work', |
19 | 'positions_work', | 19 | 'positions_work', |
20 | 'telephone', | 20 | 'telephone', |
21 | 'telephone2', | 21 | 'telephone2', |
22 | 'persent_anketa', | 22 | 'persent_anketa', |
23 | 'photo', | 23 | 'photo', |
24 | 'email_data', | 24 | 'email_data', |
25 | 'status_profile', | 25 | 'status_profile', |
26 | 'old_year', | 26 | 'old_year', |
27 | 'experience', | 27 | 'experience', |
28 | 'en_is', | 28 | 'en_is', |
29 | 'education', | 29 | 'education', |
30 | 'email', | 30 | 'email', |
31 | 'interpassport', | 31 | 'interpassport', |
32 | 'mk', | 32 | 'mk', |
33 | 'vvp', | 33 | 'vvp', |
34 | 'vlm', | 34 | 'vlm', |
35 | 'reka_diplom', | 35 | 'reka_diplom', |
36 | 'more_diplom', | 36 | 'more_diplom', |
37 | 'mpss', | 37 | 'mpss', |
38 | 'tanker', | 38 | 'tanker', |
39 | 'gmssb', | 39 | 'gmssb', |
40 | 'resume', | 40 | 'resume', |
41 | 'sort', | 41 | 'sort', |
42 | 'updated_at', | 42 | 'updated_at', |
43 | 'text', | 43 | 'text', |
44 | 'address', | 44 | 'address', |
45 | 'city', | 45 | 'city', |
46 | 'coord', | 46 | 'coord', |
47 | 'file', | 47 | 'file', |
48 | 'is_remove', | 48 | 'is_remove', |
49 | 'favorite_user', | 49 | 'favorite_user', |
50 | 'sroch_user', | 50 | 'sroch_user', |
51 | 'salary_expectations', | 51 | 'salary_expectations', |
52 | 'english_level', | 52 | 'english_level', |
53 | 'ready_boart_date', | 53 | 'ready_boart_date', |
54 | 'boart_type_preference', | 54 | 'boart_type_preference', |
55 | 'visa_available', | 55 | 'visa_available', |
56 | 'tanker_documents_available', | 56 | 'tanker_documents_available', |
57 | 'confirmation_work_for_vvp', | 57 | 'confirmation_work_for_vvp', |
58 | 'military_id_available' | 58 | 'military_id_available', |
59 | 'comment' | ||
59 | ]; | 60 | ]; |
60 | 61 | ||
61 | /** | 62 | /** |
62 | * Получить значение поля positions_work как массив. | 63 | * Получить значение поля positions_work как массив. |
63 | * | 64 | * |
64 | * @param string $value | 65 | * @param string $value |
65 | * @return array | 66 | * @return array |
66 | */ | 67 | */ |
67 | public function getPositionsWorkAttribute($value) | 68 | public function getPositionsWorkAttribute($value) |
68 | { | 69 | { |
69 | return json_decode($value, true); | 70 | return json_decode($value, true); |
70 | } | 71 | } |
71 | 72 | ||
72 | /** | 73 | /** |
73 | * Установить значение поля positions_work как JSON. | 74 | * Установить значение поля positions_work как JSON. |
74 | * | 75 | * |
75 | * @param array|string $value | 76 | * @param array|string $value |
76 | * @return void | 77 | * @return void |
77 | */ | 78 | */ |
78 | public function setPositionsWorkAttribute($value) | 79 | public function setPositionsWorkAttribute($value) |
79 | { | 80 | { |
80 | $this->attributes['positions_work'] = is_array($value) ? json_encode($value) : $value; | 81 | $this->attributes['positions_work'] = is_array($value) ? json_encode($value) : $value; |
81 | } | 82 | } |
82 | 83 | ||
83 | /* | 84 | /* |
84 | * Связь таблицы users с таблицей workers | 85 | * Связь таблицы users с таблицей workers |
85 | */ | 86 | */ |
86 | public function users() { | 87 | public function users() { |
87 | return $this->belongsTo(User::class, 'user_id'); | 88 | return $this->belongsTo(User::class, 'user_id'); |
88 | } | 89 | } |
89 | 90 | ||
90 | // Связь Работника с сертификами (0-0 - 1) | 91 | // Связь Работника с сертификами (0-0 - 1) |
91 | public function sertificate() { | 92 | public function sertificate() { |
92 | return $this->hasMany(sertification::class); | 93 | return $this->hasMany(sertification::class); |
93 | } | 94 | } |
94 | 95 | ||
95 | // Связь Работника с должностями (0-0 - 1) | 96 | // Связь Работника с должностями (0-0 - 1) |
96 | public function job_titles() { | 97 | public function job_titles() { |
97 | return $this->belongsToMany(Job_title::class, 'title_workers'); | 98 | return $this->belongsToMany(Job_title::class, 'title_workers'); |
98 | } | 99 | } |
99 | 100 | ||
100 | //Связь Работника с опытом работы (1 - 0-0) | 101 | //Связь Работника с опытом работы (1 - 0-0) |
101 | public function place_worker() { | 102 | public function place_worker() { |
102 | return $this->hasMany(place_works::class); | 103 | return $this->hasMany(place_works::class); |
103 | } | 104 | } |
104 | 105 | ||
105 | public function scopeActive($query) { | 106 | public function scopeActive($query) { |
106 | return $query->where('is_remove', '=', '0'); | 107 | return $query->where('is_remove', '=', '0'); |
107 | } | 108 | } |
108 | 109 | ||
109 | //Связь Работника с предыдущими компаниями | 110 | //Связь Работника с предыдущими компаниями |
110 | public function prev_company() { | 111 | public function prev_company() { |
111 | return $this->hasMany(PrevCompany::class); | 112 | return $this->hasMany(PrevCompany::class); |
112 | } | 113 | } |
113 | 114 | ||
114 | //Связь Работника с инфоблоками (0-0 - 0-0) | 115 | //Связь Работника с инфоблоками (0-0 - 0-0) |
115 | public function infobloks() { | 116 | public function infobloks() { |
116 | return $this->belongsToMany(infobloks::class,'dop_info', 'worker_id', 'infoblok_id'); | 117 | return $this->belongsToMany( |
118 | infobloks::class, | ||
119 | 'dop_info', | ||
120 | 'worker_id', | ||
121 | 'infoblok_id' | ||
122 | )->withPivot('status'); | ||
117 | } | 123 | } |
118 | 124 | ||
119 | //Связи Работника с дополнительными | 125 | //Связи Работника с дополнительными |
120 | public function dop_info() { | 126 | public function dop_info() { |
121 | return $this->hasMany(Dop_info::class, 'worker_id'); | 127 | return $this->hasMany(Dop_info::class, 'worker_id'); |
122 | } | 128 | } |
123 | 129 | ||
124 | public function response() { | 130 | public function response() { |
125 | return $this->hasMany(ResponseWork::class); | 131 | return $this->hasMany(ResponseWork::class); |
126 | } | 132 | } |
127 | 133 | ||
128 | public function getJobsAttribute() | 134 | public function getJobsAttribute() |
129 | { | 135 | { |
130 | $job_titles_ids = json_decode($this->attributes['positions_work'], true); | 136 | $job_titles_ids = json_decode($this->attributes['positions_work'], true); |
131 | return Job_title::whereIn('id', $job_titles_ids)->get(); | 137 | return Job_title::whereIn('id', $job_titles_ids)->get(); |
132 | } | 138 | } |
133 | } | 139 | } |
134 | 140 |
database/migrations/2024_10_07_073601_add_comment_to_workers_table.php
File was created | 1 | <?php | |
2 | |||
3 | use Illuminate\Database\Migrations\Migration; | ||
4 | use Illuminate\Database\Schema\Blueprint; | ||
5 | use Illuminate\Support\Facades\Schema; | ||
6 | |||
7 | return new class extends Migration | ||
8 | { | ||
9 | /** | ||
10 | * Run the migrations. | ||
11 | * | ||
12 | * @return void | ||
13 | */ | ||
14 | public function up() | ||
15 | { | ||
16 | Schema::table('workers', function (Blueprint $table) { | ||
17 | $table->string('comment')->nullable(); | ||
18 | }); | ||
19 | } | ||
20 | |||
21 | /** | ||
22 | * Reverse the migrations. | ||
23 | * | ||
24 | * @return void | ||
25 | */ | ||
26 | public function down() | ||
27 | { | ||
28 | Schema::table('workers', function (Blueprint $table) { | ||
29 | $table->dropColumn('comment'); | ||
30 | }); | ||
31 | } | ||
32 | }; | ||
33 |
resources/views/admin/users/form.blade.php
1 | <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> | 1 | <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> |
2 | @error('name') | 2 | @error('name') |
3 | {{ $message }} | 3 | {{ $message }} |
4 | @enderror | 4 | @enderror |
5 | 5 | ||
6 | <input name="name" id="name" type="hidden" | 6 | <input name="name" id="name" type="hidden" |
7 | 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" | 7 | 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" |
8 | placeholder="Имя/Псевдоним" value="{{ old('name') ?? $user->name ?? 'Пользователь базы данных' }}" | 8 | placeholder="Имя/Псевдоним" value="{{ old('name') ?? $user->name ?? 'Пользователь базы данных' }}" |
9 | /> | 9 | /> |
10 | 10 | ||
11 | <label class="block text-sm"> | 11 | <label class="block text-sm"> |
12 | <span class="text-gray-700 dark:text-gray-400">Должность</span> | 12 | <span class="text-gray-700 dark:text-gray-400">Должность</span> |
13 | <select name="positions_work[]" id="positions_work[]" data-placeholder="Выберите должность..." multiple="multiple"> | 13 | <select name="positions_work[]" id="positions_work[]" data-placeholder="Выберите должность..." multiple="multiple"> |
14 | @isset($list_job_titles) | 14 | @isset($list_job_titles) |
15 | @foreach($list_job_titles as $job_title) | 15 | @foreach($list_job_titles as $job_title) |
16 | <option value="{{ $job_title->id }}" | 16 | <option value="{{ $job_title->id }}" |
17 | @if (isset($user) && $user?->workers[0]?->positions_work && in_array($job_title->id , $user->workers[0]->positions_work)) | 17 | @if (isset($user) && $user?->workers[0]?->positions_work && in_array($job_title->id , $user->workers[0]->positions_work)) |
18 | selected | 18 | selected |
19 | @endif | 19 | @endif |
20 | > | 20 | > |
21 | {{ $job_title->name }} ({{ $job_title->id }}) | 21 | {{ $job_title->name }} ({{ $job_title->id }}) |
22 | </option> | 22 | </option> |
23 | @endforeach | 23 | @endforeach |
24 | @endisset | 24 | @endisset |
25 | </select> | 25 | </select> |
26 | @error('name') | 26 | @error('name') |
27 | <span class="text-xs text-red-600 dark:text-red-400"> | 27 | <span class="text-xs text-red-600 dark:text-red-400"> |
28 | {{ $message }} | 28 | {{ $message }} |
29 | </span> | 29 | </span> |
30 | @enderror | 30 | @enderror |
31 | </label><br> | 31 | </label><br> |
32 | 32 | ||
33 | <label class="block text-sm"> | 33 | <label class="block text-sm"> |
34 | <span class="text-gray-700 dark:text-gray-400">Фамилия</span> | 34 | <span class="text-gray-700 dark:text-gray-400">Фамилия</span> |
35 | <input name="surname" id="surname" | 35 | <input name="surname" id="surname" |
36 | 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" | 36 | 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" |
37 | placeholder="Фамилия" value="{{ old('surname') ?? $user->surname ?? '' }}" | 37 | placeholder="Фамилия" value="{{ old('surname') ?? $user->surname ?? '' }}" |
38 | /> | 38 | /> |
39 | @error('surname') | 39 | @error('surname') |
40 | <span class="text-xs text-red-600 dark:text-red-400"> | 40 | <span class="text-xs text-red-600 dark:text-red-400"> |
41 | {{ $message }} | 41 | {{ $message }} |
42 | </span> | 42 | </span> |
43 | @enderror | 43 | @enderror |
44 | </label><br> | 44 | </label><br> |
45 | 45 | ||
46 | <label class="block text-sm"> | 46 | <label class="block text-sm"> |
47 | <span class="text-gray-700 dark:text-gray-400">Имя</span> | 47 | <span class="text-gray-700 dark:text-gray-400">Имя</span> |
48 | <input name="name_man" id="name_man" | 48 | <input name="name_man" id="name_man" |
49 | 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" | 49 | 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" |
50 | placeholder="Имя" value="{{ old('name_man') ?? $user->name_man ?? '' }}" | 50 | placeholder="Имя" value="{{ old('name_man') ?? $user->name_man ?? '' }}" |
51 | /> | 51 | /> |
52 | @error('name_man') | 52 | @error('name_man') |
53 | <span class="text-xs text-red-600 dark:text-red-400"> | 53 | <span class="text-xs text-red-600 dark:text-red-400"> |
54 | {{ $message }} | 54 | {{ $message }} |
55 | </span> | 55 | </span> |
56 | @enderror | 56 | @enderror |
57 | </label><br> | 57 | </label><br> |
58 | 58 | ||
59 | <input type="hidden" name="is_worker" id="is_worker" value="1"/> | 59 | <input type="hidden" name="is_worker" id="is_worker" value="1"/> |
60 | <input type="hidden" name="is_bd" id="is_bd" value="1"/> | 60 | <input type="hidden" name="is_bd" id="is_bd" value="1"/> |
61 | <input type="hidden" name="admin" id="admin" value="0"/> | 61 | <input type="hidden" name="admin" id="admin" value="0"/> |
62 | <input type="hidden" name="password" id="password" value="1234567890"/> | 62 | <input type="hidden" name="password" id="password" value="1234567890"/> |
63 | 63 | ||
64 | <label class="block text-sm"> | 64 | <label class="block text-sm"> |
65 | <span class="text-gray-700 dark:text-gray-400">Отчество</span> | 65 | <span class="text-gray-700 dark:text-gray-400">Отчество</span> |
66 | <input name="surname2" id="surname2" | 66 | <input name="surname2" id="surname2" |
67 | 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" | 67 | 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" |
68 | placeholder="Отчество" value="{{ old('surname2') ?? $user->surname2 ?? '' }}" | 68 | placeholder="Отчество" value="{{ old('surname2') ?? $user->surname2 ?? '' }}" |
69 | /> | 69 | /> |
70 | @error('surname2') | 70 | @error('surname2') |
71 | <span class="text-xs text-red-600 dark:text-red-400"> | 71 | <span class="text-xs text-red-600 dark:text-red-400"> |
72 | {{ $message }} | 72 | {{ $message }} |
73 | </span> | 73 | </span> |
74 | @enderror | 74 | @enderror |
75 | </label><br> | 75 | </label><br> |
76 | 76 | ||
77 | <label class="block text-sm"> | 77 | <label class="block text-sm"> |
78 | <span class="text-gray-700 dark:text-gray-400">Email</span> | 78 | <span class="text-gray-700 dark:text-gray-400">Email</span> |
79 | <input name="email" id="email" | 79 | <input name="email" id="email" |
80 | 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" | 80 | 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" |
81 | placeholder="Email" value="{{ old('email') ?? $user->email ?? '' }}" | 81 | placeholder="Email" value="{{ old('email') ?? $user->email ?? '' }}" |
82 | /> | 82 | /> |
83 | @error('email') | 83 | @error('email') |
84 | <span class="text-xs text-red-600 dark:text-red-400"> | 84 | <span class="text-xs text-red-600 dark:text-red-400"> |
85 | {{ $message }} | 85 | {{ $message }} |
86 | </span> | 86 | </span> |
87 | @enderror | 87 | @enderror |
88 | </label><br> | 88 | </label><br> |
89 | 89 | ||
90 | <label class="block text-sm"> | 90 | <label class="block text-sm"> |
91 | <span class="text-gray-700 dark:text-gray-400">Телефон</span> | 91 | <span class="text-gray-700 dark:text-gray-400">Телефон</span> |
92 | <input name="telephone" id="telephone" | 92 | <input name="telephone" id="telephone" |
93 | 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" | 93 | 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" |
94 | placeholder="Телефон" value="{{ old('telephone') ?? $user->telephone ?? '' }}" | 94 | placeholder="Телефон" value="{{ old('telephone') ?? $user->telephone ?? '' }}" |
95 | /> | 95 | /> |
96 | @error('telephone') | 96 | @error('telephone') |
97 | <span class="text-xs text-red-600 dark:text-red-400"> | 97 | <span class="text-xs text-red-600 dark:text-red-400"> |
98 | {{ $message }} | 98 | {{ $message }} |
99 | </span> | 99 | </span> |
100 | @enderror | 100 | @enderror |
101 | </label><br> | 101 | </label><br> |
102 | 102 | ||
103 | <label class="block text-sm"> | 103 | <label class="block text-sm"> |
104 | <span class="text-gray-700 dark:text-gray-400">Комментарий</span> | ||
105 | <input name="comment" id="comment" | ||
106 | 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" | ||
107 | placeholder="Комментарий" value="{{ old('comment') ?? $user->comment ?? '' }}" | ||
108 | /> | ||
109 | @error('telephone') | ||
110 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
111 | {{ $message }} | ||
112 | </span> | ||
113 | @enderror | ||
114 | </label><br> | ||
115 | |||
116 | <label class="block text-sm"> | ||
104 | <span class="text-gray-700 dark:text-gray-400">Файл-анкета</span> | 117 | <span class="text-gray-700 dark:text-gray-400">Файл-анкета</span> |
105 | <input type="file" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 | 118 | <input type="file" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 |
106 | focus:border-purple-400 focus:outline-none focus:shadow-outline-purple | 119 | focus:border-purple-400 focus:outline-none focus:shadow-outline-purple |
107 | dark:text-gray-300 dark:focus:shadow-outline-gray form-input" | 120 | dark:text-gray-300 dark:focus:shadow-outline-gray form-input" |
108 | id="file" name="file"> | 121 | id="file" name="file"> |
109 | @error('file') | 122 | @error('file') |
110 | <span class="text-xs text-red-600 dark:text-red-400"> | 123 | <span class="text-xs text-red-600 dark:text-red-400"> |
111 | {{ $message }} | 124 | {{ $message }} |
112 | </span> | 125 | </span> |
113 | @enderror | 126 | @enderror |
114 | @isset($user->file) | 127 | @isset($user->file) |
115 | <a class="text-gray-700 dark:text-gray-400" target="blank" href="{{ asset(Storage::url($user->file)) }}">{{ $user->file }}</a> | 128 | <a class="text-gray-700 dark:text-gray-400" target="blank" href="{{ asset(Storage::url($user->file)) }}">{{ $user->file }}</a> |
116 | @endisset | 129 | @endisset |
117 | </label><br> | 130 | </label><br> |
118 | 131 | ||
119 | <!--<label class="block text-sm"> | 132 | <!--<label class="block text-sm"> |
120 | 133 | ||
121 | <input type="hidden" name="page_worker" value="0" /> | 134 | <input type="hidden" name="page_worker" value="0" /> |
122 | <input name="page_worker" @php if (isset($user->workers->id)) echo "checked"; @endphp | 135 | <input name="page_worker" @php if (isset($user->workers->id)) echo "checked"; @endphp |
123 | 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 " | 136 | 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 " |
124 | placeholder="" style="float:left; margin-right: 5px" type="checkbox" value="1" | 137 | placeholder="" style="float:left; margin-right: 5px" type="checkbox" value="1" |
125 | /><p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Анкета </p><br> | 138 | /><p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Анкета </p><br> |
126 | 139 | ||
127 | </label><br>--> | 140 | </label><br>--> |
128 | 141 | ||
129 | <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> | 142 | <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> |
130 | <div> | 143 | <div> |
131 | <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"> | 144 | <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"> |
132 | Сохранить | 145 | Сохранить |
133 | </button> | 146 | </button> |
134 | <a href="{{ route('admin.basedata') }}" | 147 | <a href="{{ route('admin.basedata') }}" |
135 | 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" | 148 | 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" |
136 | style="display: -webkit-inline-box; height: 30px!important;" | 149 | style="display: -webkit-inline-box; height: 30px!important;" |
137 | >Назад</a> | 150 | >Назад</a> |
138 | </div> | 151 | </div> |
139 | </div> | 152 | </div> |
140 | </div> | 153 | </div> |
141 | 154 | ||
142 | <script> | 155 | <script> |
143 | $(function(){ | 156 | $(function(){ |
144 | $('[name="positions_work[]"]').chosen({ | 157 | $('[name="positions_work[]"]').chosen({ |
145 | no_results_text: 'Не добавлено ни одной должности.', | 158 | no_results_text: 'Не добавлено ни одной должности.', |
146 | width: '100%' | 159 | width: '100%' |
147 | }) | 160 | }) |
148 | }); | 161 | }); |
149 | </script> | 162 | </script> |
150 | 163 |
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="Поиск…" value="@if (isset($_GET['search'])) {{ $_GET['search'] }} @endif"> | 77 | <input type="search" name="search" id="search" class="input" placeholder="Поиск…" 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>{{ $count_users->count() }}</b> | 139 | <b>{{ $count_users->count() }}</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>ФИО соискателя</th> | 150 | <th>ФИО соискателя</th> |
150 | <th>Должность</th> | 151 | <th>Должность</th> |
151 | <th>Наличие<br>анкеты</th> | 152 | <th>Наличие<br>анкеты</th> |
152 | </tr> | 153 | </tr> |
153 | </thead> | 154 | </thead> |
154 | <tbody> | 155 | <tbody> |
155 | @php | 156 | @php |
156 | $categories = 0; | 157 | $categories = 0; |
157 | 158 | ||
158 | @endphp | 159 | @endphp |
159 | 160 | ||
160 | @if ($users->count()) | 161 | @if ($users->count()) |
161 | @foreach ($users as $key => $it) | 162 | @foreach ($users as $key => $it) |
162 | <tr> | 163 | <tr> |
164 | <td style="max-width: 40px; min-width: 30px; font-size: 3rem">{{ $it->workers[0]->comment }}</td> | ||
165 | |||
163 | <td>{{ $it->surname." ".$it->name_man }}<br>{{ $it->surname2 }}</td> | 166 | <td>{{ $it->surname." ".$it->name_man }}<br>{{ $it->surname2 }}</td> |
164 | 167 | ||
165 | <td> | 168 | <td> |
166 | @if($it->workers[0]->positions_work) | 169 | @if($it->workers[0]->positions_work) |
167 | @foreach($it->workers[0]->jobs as $job) | 170 | @foreach($it->workers[0]->jobs as $job) |
168 | {{ $job->name }} | 171 | {{ $job->name }} |
169 | @if(!$loop->last) | 172 | @if(!$loop->last) |
170 | <br> | 173 | <br> |
171 | @endif | 174 | @endif |
172 | @endforeach | 175 | @endforeach |
173 | @endif | 176 | @endif |
174 | </td> | 177 | </td> |
175 | 178 | ||
176 | <td> | 179 | <td> |
177 | @if ($it->file !== null) | 180 | @if ($it->file !== null) |
178 | <a href="{{ asset(Storage::url($it->file)) }}" class="table__link"> | 181 | <a href="{{ asset(Storage::url($it->file)) }}" class="table__link"> |
179 | <svg> | 182 | <svg> |
180 | <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> | 183 | <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> |
181 | </svg> | 184 | </svg> |
182 | Скачать | 185 | Скачать |
183 | </a> | 186 | </a> |
184 | @endif | 187 | @endif |
185 | </td> | 188 | </td> |
186 | </tr> | 189 | </tr> |
187 | @endforeach | 190 | @endforeach |
188 | @endif | 191 | @endif |
189 | </tbody> | 192 | </tbody> |
190 | </table> | 193 | </table> |
191 | </div> | 194 | </div> |
192 | 195 | ||
193 | </div> | 196 | </div> |
194 | </div> | 197 | </div> |
195 | {{ $users->onEachSide(0)->appends($_GET)->links('paginate') }} | 198 | {{ $users->onEachSide(0)->appends($_GET)->links('paginate') }} |
196 | </div> | 199 | </div> |
197 | </div> | 200 | </div> |
198 | </div> | 201 | </div> |
199 | </div> | 202 | </div> |
200 | </section> | 203 | </section> |
201 | </div> | 204 | </div> |
202 | @endsection | 205 | @endsection |
203 | 206 |
resources/views/employers/dialog.blade.php
1 | @extends('layout.frontend', ['title' => 'Диалог-переписка - РекаМоре']) | 1 | @extends('layout.frontend', ['title' => 'Диалог-переписка - РекаМоре']) |
2 | 2 | ||
3 | @section('scripts') | 3 | @section('scripts') |
4 | <script> | 4 | <script> |
5 | $(function(){ | 5 | $(function(){ |
6 | var chatbox_div = $('.chatbox__list'); | 6 | var chatbox_div = $('.chatbox__list'); |
7 | chatbox_div.scrollTop(chatbox_div.prop("scrollHeight")); | 7 | chatbox_div.scrollTop(chatbox_div.prop("scrollHeight")); |
8 | 8 | ||
9 | $('form.chatbox__bottom [name="file"]').on('change', function() { | 9 | $('form.chatbox__bottom [name="file"]').on('change', function() { |
10 | var fileName = $(this).val().split('\\').pop(); | 10 | var fileName = $(this).val().split('\\').pop(); |
11 | $('.chatbox-file-name-wrap').text('Добавлен файл: ' + fileName); | 11 | $('.chatbox-file-name-wrap').text('Добавлен файл: ' + fileName); |
12 | }); | 12 | }); |
13 | }); | 13 | }); |
14 | 14 | ||
15 | $(document).on('change', '#send_btn', function() { | 15 | $(document).on('change', '#send_btn', function() { |
16 | var this_ = $(this); | 16 | var this_ = $(this); |
17 | var val_ = this_.val(); | 17 | var val_ = this_.val(); |
18 | console.log('sort items '+val_); | 18 | console.log('sort items '+val_); |
19 | 19 | ||
20 | $.ajax({ | 20 | $.ajax({ |
21 | type: "GET", | 21 | type: "GET", |
22 | url: "{{ route('shipping_companies') }}", | 22 | url: "{{ route('shipping_companies') }}", |
23 | data: "sort="+val_+"&block=1", | 23 | data: "sort="+val_+"&block=1", |
24 | success: function (data) { | 24 | success: function (data) { |
25 | console.log('Выбор сортировки'); | 25 | console.log('Выбор сортировки'); |
26 | console.log(data); | 26 | console.log(data); |
27 | $('#block_1').html(data); | 27 | $('#block_1').html(data); |
28 | }, | 28 | }, |
29 | headers: { | 29 | headers: { |
30 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 30 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
31 | }, | 31 | }, |
32 | error: function (data) { | 32 | error: function (data) { |
33 | data = JSON.stringify(data); | 33 | data = JSON.stringify(data); |
34 | console.log('Error: ' + data); | 34 | console.log('Error: ' + data); |
35 | } | 35 | } |
36 | }); | 36 | }); |
37 | 37 | ||
38 | $.ajax({ | 38 | $.ajax({ |
39 | type: "GET", | 39 | type: "GET", |
40 | url: "{{ route('shipping_companies') }}", | 40 | url: "{{ route('shipping_companies') }}", |
41 | data: "sort="+val_+"&block=2", | 41 | data: "sort="+val_+"&block=2", |
42 | success: function (data) { | 42 | success: function (data) { |
43 | console.log('Выбор сортировки2'); | 43 | console.log('Выбор сортировки2'); |
44 | console.log(data); | 44 | console.log(data); |
45 | history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); | 45 | history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); |
46 | $('#block_2').html(data); | 46 | $('#block_2').html(data); |
47 | }, | 47 | }, |
48 | headers: { | 48 | headers: { |
49 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 49 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
50 | }, | 50 | }, |
51 | error: function (data) { | 51 | error: function (data) { |
52 | data = JSON.stringify(data); | 52 | data = JSON.stringify(data); |
53 | console.log('Error: ' + data); | 53 | console.log('Error: ' + data); |
54 | } | 54 | } |
55 | }); | 55 | }); |
56 | }); | 56 | }); |
57 | </script> | 57 | </script> |
58 | @endsection | 58 | @endsection |
59 | 59 | ||
60 | @section('content') | 60 | @section('content') |
61 | <section class="cabinet"> | 61 | <section class="cabinet"> |
62 | <div class="container"> | 62 | <div class="container"> |
63 | <ul class="breadcrumbs cabinet__breadcrumbs"> | 63 | <ul class="breadcrumbs cabinet__breadcrumbs"> |
64 | <li><a href="{{ route('index') }}">Главная</a></li> | 64 | <li><a href="{{ route('index') }}">Главная</a></li> |
65 | <li><b>Личный кабинет</b></li> | 65 | <li><b>Личный кабинет</b></li> |
66 | </ul> | 66 | </ul> |
67 | <div class="cabinet__wrapper"> | 67 | <div class="cabinet__wrapper"> |
68 | <div class="cabinet__side"> | 68 | <div class="cabinet__side"> |
69 | <div class="cabinet__side-toper"> | 69 | <div class="cabinet__side-toper"> |
70 | @include('employers.emblema') | 70 | @include('employers.emblema') |
71 | </div> | 71 | </div> |
72 | @include('employers.menu', ['item' => 5]) | 72 | @include('employers.menu', ['item' => 5]) |
73 | </div> | 73 | </div> |
74 | <div class="cabinet__body"> | 74 | <div class="cabinet__body"> |
75 | <div class="cabinet__body-item"> | 75 | <div class="cabinet__body-item"> |
76 | <h2 class="title cabinet__title">Сообщения</h2> | 76 | <h2 class="title cabinet__title">Сообщения</h2> |
77 | </div> | 77 | </div> |
78 | <div class="cabinet__body-item"> | 78 | <div class="cabinet__body-item"> |
79 | <a href="{{ route('employer.messages', ['type_message' => 'input']) }}" class="back"> | 79 | <a href="{{ route('employer.messages', ['type_message' => 'input']) }}" class="back"> |
80 | <svg> | 80 | <svg> |
81 | <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> | 81 | <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> |
82 | </svg> | 82 | </svg> |
83 | <span> | 83 | <span> |
84 | К списку чатов | 84 | К списку чатов |
85 | </span> | 85 | </span> |
86 | </a> | 86 | </a> |
87 | <div class="chatbox"> | 87 | <div class="chatbox"> |
88 | <div class="chatbox__toper"> | 88 | <div class="chatbox__toper"> |
89 | @if ($companion->is_worker) | 89 | @if ($companion->is_worker) |
90 | <div class="chatbox__toper-info messages__item-info"> | 90 | <div class="chatbox__toper-info messages__item-info"> |
91 | <div class="messages__item-photo"> | 91 | <div class="messages__item-photo"> |
92 | <svg> | 92 | <svg> |
93 | <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> | 93 | <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> |
94 | </svg> | 94 | </svg> |
95 | @if ((isset($companion->workers[0]->photo)) && | 95 | @if ((isset($companion->workers[0]->photo)) && |
96 | (!empty($companion->workers[0]->photo))) | 96 | (!empty($companion->workers[0]->photo))) |
97 | <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt=""> | 97 | <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt=""> |
98 | @else | 98 | @else |
99 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> | 99 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> |
100 | @endif | 100 | @endif |
101 | </div> | 101 | </div> |
102 | <div class="messages__item-text"> | 102 | <div class="messages__item-text"> |
103 | <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div> | 103 | <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div> |
104 | </div> | 104 | </div> |
105 | </div> | 105 | </div> |
106 | @if (isset($companion->workers[0]->id)) | 106 | @if (isset($companion->workers[0]->id)) |
107 | <a href="{{ route('resume_profile', ['worker' => $companion->workers[0]->id]) }}" class="button chatbox__toper-button"> | 107 | <a href="{{ route('resume_profile', ['worker' => $companion->workers[0]->id]) }}" class="button chatbox__toper-button"> |
108 | <svg> | 108 | <svg> |
109 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use> | 109 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use> |
110 | </svg> | 110 | </svg> |
111 | Перейти в профиль | 111 | Перейти в профиль |
112 | </a> | 112 | </a> |
113 | @endif | 113 | @endif |
114 | @else | 114 | @else |
115 | <div class="chatbox__toper-info messages__item-info"> | 115 | <div class="chatbox__toper-info messages__item-info"> |
116 | <div class="messages__item-photo"> | 116 | <div class="messages__item-photo"> |
117 | <svg> | 117 | <svg> |
118 | <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> | 118 | <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> |
119 | </svg> | 119 | </svg> |
120 | @if ((isset($companion->employers[0]->logo)) && | 120 | @if ((isset($companion->employers[0]->logo)) && |
121 | (!empty($companion->employers[0]->logo))) | 121 | (!empty($companion->employers[0]->logo))) |
122 | <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt=""> | 122 | <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt=""> |
123 | @else | 123 | @else |
124 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> | 124 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> |
125 | @endif | 125 | @endif |
126 | </div> | 126 | </div> |
127 | <div class="messages__item-text"> | 127 | <div class="messages__item-text"> |
128 | <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div> | 128 | <div>{{ $companion->surname." ".$companion->name_man." ".$companion->surname2." (".$companion->id.")" }} </div> |
129 | <div><span>Статус:</span> Работодатель или Администратор</div> | 129 | <div><span>Статус:</span> Работодатель или Администратор</div> |
130 | </div> | 130 | </div> |
131 | </div> | 131 | </div> |
132 | @if (isset($companion->employer->id)) | 132 | @if (isset($companion->employer->id)) |
133 | <a href="" class="button chatbox__toper-button"> | 133 | <a href="" class="button chatbox__toper-button"> |
134 | <svg> | 134 | <svg> |
135 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use> | 135 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use> |
136 | </svg> | 136 | </svg> |
137 | Перейти в профиль | 137 | Перейти в профиль |
138 | </a> | 138 | </a> |
139 | @endif | 139 | @endif |
140 | @endif | 140 | @endif |
141 | </div> | 141 | </div> |
142 | 142 | ||
143 | @if ($errors->any()) | 143 | @if ($errors->any()) |
144 | <div class="red bold"> | 144 | <div class="red bold"> |
145 | <ul> | 145 | <ul> |
146 | @foreach ($errors->all() as $error) | 146 | @foreach ($errors->all() as $error) |
147 | <li>{{ $error }}</li> | 147 | <li>{{ $error }}</li> |
148 | @endforeach | 148 | @endforeach |
149 | </ul> | 149 | </ul> |
150 | </div> | 150 | </div> |
151 | @endif | 151 | @endif |
152 | 152 | ||
153 | <div class="chatbox__list" id="dialogs" name="dialogs"> | 153 | <div class="chatbox__list" id="dialogs" name="dialogs"> |
154 | @if ($Messages->count()) | 154 | @if ($Messages->count()) |
155 | @foreach ($Messages as $it) | 155 | @foreach ($Messages as $it) |
156 | @if ($it->user_id == $companion->id) | 156 | @if ($it->user_id == $companion->id) |
157 | <div class="chatbox__item"> | 157 | <div class="chatbox__item"> |
158 | <div class="chatbox__item-photo"> | 158 | <div class="chatbox__item-photo"> |
159 | <svg> | 159 | <svg> |
160 | <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> | 160 | <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> |
161 | </svg> | 161 | </svg> |
162 | 162 | ||
163 | @if ($companion->is_worker) | 163 | @if ($companion->is_worker) |
164 | @if ((isset($companion->workers[0]->photo)) && | 164 | @if ((isset($companion->workers[0]->photo)) && |
165 | (!empty($companion->workers[0]->photo))) | 165 | (!empty($companion->workers[0]->photo))) |
166 | <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt=""> | 166 | <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->workers[0]->photo)) }}" alt=""> |
167 | @else | 167 | @else |
168 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> | 168 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> |
169 | @endif | 169 | @endif |
170 | @else | 170 | @else |
171 | @if ((isset($companion->employers[0]->logo)) && | 171 | @if ((isset($companion->employers[0]->logo)) && |
172 | (!empty($companion->employers[0]->logo))) | 172 | (!empty($companion->employers[0]->logo))) |
173 | <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt=""> | 173 | <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($companion->employers[0]->logo)) }}" alt=""> |
174 | @else | 174 | @else |
175 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> | 175 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> |
176 | @endif | 176 | @endif |
177 | @endif | 177 | @endif |
178 | </div> | 178 | </div> |
179 | <div class="chatbox__item-body"> | 179 | <div class="chatbox__item-body"> |
180 | @if($it->text || $it->reply_message_id) | 180 | @if($it->text || $it->reply_message_id || $it->ad_employer_id > 0) |
181 | <div class="chatbox__item-text"> | 181 | <div class="chatbox__item-text"> |
182 | @if($it->ad_employer_id > 0) | 182 | @if($it->ad_employer_id > 0) |
183 | <b>Отклик на вакансию</b> "{{ \App\Models\Ad_employer::find($it->ad_employer_id)->name }}"<br> | 183 | <b>Отклик на вакансию</b> "{{ \App\Models\Ad_employer::find($it->ad_employer_id)?->name }}"<br> |
184 | @if($it->text) | 184 | @if($it->text) |
185 | <b>Комментарий:</b> {{ $it->text }} | 185 | <b>Комментарий:</b> {{ $it->text }} |
186 | @endif | 186 | @endif |
187 | @else | 187 | @else |
188 | @if($it->text) | 188 | @if($it->text) |
189 | {{ $it->text }} | 189 | {{ $it->text }} |
190 | @endif | 190 | @endif |
191 | @endif | 191 | @endif |
192 | 192 | ||
193 | @if($it->reply_message_id) | 193 | @if($it->reply_message_id) |
194 | <div class="reply-message"> | 194 | <div class="reply-message"> |
195 | {{ $it->reply_message->text }} | 195 | {{ $it->reply_message->text }} |
196 | </div> | 196 | </div> |
197 | @endif | 197 | @endif |
198 | </div> | 198 | </div> |
199 | @endif | 199 | @endif |
200 | @if ((isset($it->file)) && (!empty($it->file))) | 200 | @if ((isset($it->file)) && (!empty($it->file))) |
201 | <div class="chatbox__item-text chatbox__item-body-file-name-wrap"> | 201 | <div class="chatbox__item-text chatbox__item-body-file-name-wrap"> |
202 | <div class=""> | 202 | <div class=""> |
203 | @if($it->original_file_name) | 203 | @if($it->original_file_name) |
204 | {{ $it->original_file_name }} | 204 | {{ $it->original_file_name }} |
205 | @else | 205 | @else |
206 | <svg> | 206 | <svg> |
207 | <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use> | 207 | <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use> |
208 | </svg> | 208 | </svg> |
209 | @endif | 209 | @endif |
210 | </div> | 210 | </div> |
211 | <a href="{{ asset(Storage::url($it->file)) }}" class=""> | 211 | <a href="{{ asset(Storage::url($it->file)) }}" class=""> |
212 | Скачать | 212 | Скачать |
213 | </a> | 213 | </a> |
214 | </div> | 214 | </div> |
215 | @endif | 215 | @endif |
216 | </div> | 216 | </div> |
217 | <div class="chatbox__item-time">{{ $it->created_at }}</div> | 217 | <div class="chatbox__item-time">{{ $it->created_at }}</div> |
218 | </div> | 218 | </div> |
219 | @else | 219 | @else |
220 | <div class="chatbox__item chatbox__item_reverse"> | 220 | <div class="chatbox__item chatbox__item_reverse"> |
221 | <div class="chatbox__item-photo"> | 221 | <div class="chatbox__item-photo"> |
222 | <svg> | 222 | <svg> |
223 | <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> | 223 | <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> |
224 | </svg> | 224 | </svg> |
225 | 225 | ||
226 | @if ($sender->is_worker) | 226 | @if ($sender->is_worker) |
227 | @if ((isset($sender->workers[0]->photo)) && | 227 | @if ((isset($sender->workers[0]->photo)) && |
228 | (!empty($sender->workers[0]->photo))) | 228 | (!empty($sender->workers[0]->photo))) |
229 | <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->workers[0]->photo)) }}" alt=""> | 229 | <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->workers[0]->photo)) }}" alt=""> |
230 | @else | 230 | @else |
231 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> | 231 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> |
232 | @endif | 232 | @endif |
233 | @else | 233 | @else |
234 | @if ((isset($sender->employers[0]->logo)) && | 234 | @if ((isset($sender->employers[0]->logo)) && |
235 | (!empty($sender->employers[0]->logo))) | 235 | (!empty($sender->employers[0]->logo))) |
236 | <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->employers[0]->logo)) }}" alt=""> | 236 | <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($sender->employers[0]->logo)) }}" alt=""> |
237 | @else | 237 | @else |
238 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> | 238 | <img src="{{ asset('images/default_man.jpg') }}" alt=""> |
239 | @endif | 239 | @endif |
240 | @endif | 240 | @endif |
241 | 241 | ||
242 | </div> | 242 | </div> |
243 | <div class="chatbox__item-body"> | 243 | <div class="chatbox__item-body"> |
244 | @if($it->text) | 244 | @if($it->text) |
245 | <div class="chatbox__item-text"> | 245 | <div class="chatbox__item-text"> |
246 | @if($it->ad_employer_id > 0) | 246 | @if($it->ad_employer_id > 0) |
247 | <b>Отклик на вакансию</b> "{{ \App\Models\Ad_employer::find($it->ad_employer_id)->name }}"<br> | 247 | <b>Отклик на вакансию</b> "{{ \App\Models\Ad_employer::find($it->ad_employer_id)->name }}"<br> |
248 | @if($it->text) | 248 | @if($it->text) |
249 | <b>Комментарий:</b> {{ $it->text }} | 249 | <b>Комментарий:</b> {{ $it->text }} |
250 | @endif | 250 | @endif |
251 | @else | 251 | @else |
252 | @if($it->text) | 252 | @if($it->text) |
253 | {{ $it->text }} | 253 | {{ $it->text }} |
254 | @endif | 254 | @endif |
255 | @endif</div> | 255 | @endif</div> |
256 | @endif | 256 | @endif |
257 | @if ((isset($it->file)) && (!empty($it->file))) | 257 | @if ((isset($it->file)) && (!empty($it->file))) |
258 | <div class="chatbox__item-text chatbox__item-body-file-name-wrap"> | 258 | <div class="chatbox__item-text chatbox__item-body-file-name-wrap"> |
259 | <a href="{{ asset(Storage::url($it->file)) }}" class=""> | 259 | <a href="{{ asset(Storage::url($it->file)) }}" class=""> |
260 | Скачать | 260 | Скачать |
261 | </a> | 261 | </a> |
262 | <div class=""> | 262 | <div class=""> |
263 | @if($it->original_file_name) | 263 | @if($it->original_file_name) |
264 | {{ $it->original_file_name }} | 264 | {{ $it->original_file_name }} |
265 | @else | 265 | @else |
266 | <svg> | 266 | <svg> |
267 | <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use> | 267 | <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use> |
268 | </svg> | 268 | </svg> |
269 | @endif | 269 | @endif |
270 | </div> | 270 | </div> |
271 | </div> | 271 | </div> |
272 | @endif | 272 | @endif |
273 | </div> | 273 | </div> |
274 | <div class="chatbox__item-time">{{ $it->created_at }}</div> | 274 | <div class="chatbox__item-time">{{ $it->created_at }}</div> |
275 | </div> | 275 | </div> |
276 | @endif | 276 | @endif |
277 | 277 | ||
278 | @endforeach | 278 | @endforeach |
279 | @endif | 279 | @endif |
280 | </div> | 280 | </div> |
281 | <div> | 281 | <div> |
282 | <form action="{{ route('employer.test123') }}" class="chatbox__bottom" enctype="multipart/form-data" method="POST" > | 282 | <form action="{{ route('employer.test123') }}" class="chatbox__bottom" enctype="multipart/form-data" method="POST" > |
283 | @csrf | 283 | @csrf |
284 | <label class="chatbox__bottom-file"> | 284 | <label class="chatbox__bottom-file"> |
285 | <input id="file" name="file" type="file"> | 285 | <input id="file" name="file" type="file"> |
286 | <svg> | 286 | <svg> |
287 | <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use> | 287 | <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use> |
288 | </svg> | 288 | </svg> |
289 | </label> | 289 | </label> |
290 | <input type="hidden" name="_token" value="{{ csrf_token() }}"/> | 290 | <input type="hidden" name="_token" value="{{ csrf_token() }}"/> |
291 | <input type="hidden" id="user_id" name="user_id" value="{{ $sender->id }}"/> | 291 | <input type="hidden" id="user_id" name="user_id" value="{{ $sender->id }}"/> |
292 | <input type="hidden" id="to_user_id" name="to_user_id" value="{{ $companion->id }}"/> | 292 | <input type="hidden" id="to_user_id" name="to_user_id" value="{{ $companion->id }}"/> |
293 | <input type="hidden" id="ad_employer_id" name="ad_employer_id" value="{{ $ad_employer }}"/> | 293 | <input type="hidden" id="ad_employer_id" name="ad_employer_id" value="{{ $ad_employer }}"/> |
294 | <input type="hidden" id="ad_name" name="ad_name" value="@if (isset($_GET['ad_name'])){{ $_GET['ad_name'] }} @endif"/> | 294 | <input type="hidden" id="ad_name" name="ad_name" value="@if (isset($_GET['ad_name'])){{ $_GET['ad_name'] }} @endif"/> |
295 | <input id="text" name="text" type="text" class="input chatbox__bottom-text" placeholder="Ответить"> | 295 | <input id="text" name="text" type="text" class="input chatbox__bottom-text" placeholder="Ответить"> |
296 | <button type="submit" id="send_btn" name="send_btn" class="chatbox__bottom-send"> | 296 | <button type="submit" id="send_btn" name="send_btn" class="chatbox__bottom-send"> |
297 | <svg> | 297 | <svg> |
298 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> | 298 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> |
299 | </svg> | 299 | </svg> |
300 | </button> | 300 | </button> |
301 | </form> | 301 | </form> |
302 | <div class="chatbox-file-name-wrap mt-5 fw600"></div> | 302 | <div class="chatbox-file-name-wrap mt-5 fw600"></div> |
303 | </div> | 303 | </div> |
304 | </div> | 304 | </div> |
305 | </div> | 305 | </div> |
306 | </div> | 306 | </div> |
307 | </div> | 307 | </div> |
308 | </div> | 308 | </div> |
309 | </section> | 309 | </section> |
310 | </div> | 310 | </div> |
311 | @endsection | 311 | @endsection |
312 | 312 |
resources/views/employers/list_vacancy.blade.php
1 | @extends('layout.frontend', ['title' => 'Список вакансий - РекаМоре']) | 1 | @extends('layout.frontend', ['title' => 'Список вакансий - РекаМоре']) |
2 | 2 | ||
3 | @section('scripts') | 3 | @section('scripts') |
4 | <script> | 4 | <script> |
5 | $(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_); | 8 | console.log('sort items '+val_); |
9 | 9 | ||
10 | $.ajax({ | 10 | $.ajax({ |
11 | type: "GET", | 11 | type: "GET", |
12 | url: "{{ url()->current() }}", | 12 | url: "{{ url()->current() }}", |
13 | data: "sort="+val_+"&search=@if ((isset($_GET['search']))&&(!empty($_GET['search']))){{$_GET['search']}}@endif", | 13 | data: "sort="+val_+"&search=@if ((isset($_GET['search']))&&(!empty($_GET['search']))){{$_GET['search']}}@endif", |
14 | success: function (data) { | 14 | success: function (data) { |
15 | console.log('Выбор сортировки'); | 15 | console.log('Выбор сортировки'); |
16 | console.log(data); | 16 | console.log(data); |
17 | history.pushState({}, '', "{{ route('employer.vacancy_list') }}?search=@if ((isset($_GET['search']))&&(!empty($_GET['search']))){{$_GET['search']}}@endif"+"&sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); | 17 | history.pushState({}, '', "{{ route('employer.vacancy_list') }}?search=@if ((isset($_GET['search']))&&(!empty($_GET['search']))){{$_GET['search']}}@endif"+"&sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); |
18 | $('#main_ockar').html(data); | 18 | $('#main_ockar').html(data); |
19 | }, | 19 | }, |
20 | headers: { | 20 | headers: { |
21 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 21 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
22 | }, | 22 | }, |
23 | error: function (data) { | 23 | error: function (data) { |
24 | data = JSON.stringify(data); | 24 | data = JSON.stringify(data); |
25 | console.log('Error: ' + data); | 25 | console.log('Error: ' + data); |
26 | } | 26 | } |
27 | }); | 27 | }); |
28 | }); | 28 | }); |
29 | </script> | 29 | </script> |
30 | @endsection | 30 | @endsection |
31 | 31 | ||
32 | @section('content') | 32 | @section('content') |
33 | <section class="cabinet"> | 33 | <section class="cabinet"> |
34 | <div class="container"> | 34 | <div class="container"> |
35 | <ul class="breadcrumbs cabinet__breadcrumbs"> | 35 | <ul class="breadcrumbs cabinet__breadcrumbs"> |
36 | <li><a href="{{ route('index') }}">Главная</a></li> | 36 | <li><a href="{{ route('index') }}">Главная</a></li> |
37 | <li><b>Личный кабинет</b></li> | 37 | <li><b>Личный кабинет</b></li> |
38 | </ul> | 38 | </ul> |
39 | <div class="cabinet__wrapper"> | 39 | <div class="cabinet__wrapper"> |
40 | <div class="cabinet__side"> | 40 | <div class="cabinet__side"> |
41 | <div class="cabinet__side-toper"> | 41 | <div class="cabinet__side-toper"> |
42 | 42 | ||
43 | @include('employers.emblema') | 43 | @include('employers.emblema') |
44 | 44 | ||
45 | </div> | 45 | </div> |
46 | 46 | ||
47 | @include('employers.menu', ['item' => 3]) | 47 | @include('employers.menu', ['item' => 3]) |
48 | </div> | 48 | </div> |
49 | <div class="cabinet__body"> | 49 | <div class="cabinet__body"> |
50 | <div class="cabinet__body-item"> | 50 | <div class="cabinet__body-item"> |
51 | <h2 class="title cabinet__title">Мои вакансии</h2> | 51 | <h2 class="title cabinet__title">Мои вакансии</h2> |
52 | </div> | 52 | </div> |
53 | <div class="cabinet__body-item"> | 53 | <div class="cabinet__body-item"> |
54 | <div class="cabinet__filters"> | 54 | <div class="cabinet__filters"> |
55 | <div class="cabinet__filters-item"> | 55 | <div class="cabinet__filters-item"> |
56 | <form class="search" action="{{ url()->current() }}" method="GET"> | 56 | <form class="search" action="{{ url()->current() }}" method="GET"> |
57 | <input type="search" name="search" class="input" placeholder="Поиск…" value="@if ((isset($_GET['search'])) && (!empty($_GET['search']))) {{ $_GET['search'] }}@endif"> | 57 | <input type="search" name="search" class="input" placeholder="Поиск…" value="@if ((isset($_GET['search'])) && (!empty($_GET['search']))) {{ $_GET['search'] }}@endif"> |
58 | <button type="submit" class="button">Найти</button> | 58 | <button type="submit" class="button">Найти</button> |
59 | <span> | 59 | <span> |
60 | <svg> | 60 | <svg> |
61 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> | 61 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> |
62 | </svg> | 62 | </svg> |
63 | </span> | 63 | </span> |
64 | </form> | 64 | </form> |
65 | </div> | 65 | </div> |
66 | <div class="cabinet__filters-item"> | 66 | <div class="cabinet__filters-item"> |
67 | <div class="select"> | 67 | <div class="select"> |
68 | <select class="js-select2" id="sort_ajax" name="sort_ajax"> | 68 | <select class="js-select2" id="sort_ajax" name="sort_ajax"> |
69 | <option value="default" @if (isset($_GET['sort']) && ($_GET['sort'] == 'default')) selected @endif>От новых к старым (по умолчанию)</option> | 69 | <option value="default" @if (isset($_GET['sort']) && ($_GET['sort'] == 'default')) selected @endif>От новых к старым (по умолчанию)</option> |
70 | <option value="public" @if (isset($_GET['sort']) && ($_GET['sort'] == 'public')) selected @endif>Опубликовано</option> | 70 | <option value="public" @if (isset($_GET['sort']) && ($_GET['sort'] == 'public')) selected @endif>Опубликовано</option> |
71 | <option value="nopublic" @if (isset($_GET['sort']) && ($_GET['sort'] == 'nopublic')) selected @endif>Не опубликовано</option> | 71 | <option value="nopublic" @if (isset($_GET['sort']) && ($_GET['sort'] == 'nopublic')) selected @endif>Не опубликовано</option> |
72 | <!--<option value="name_up">По имени (возрастание)</option> | 72 | <!--<option value="name_up">По имени (возрастание)</option> |
73 | <option value="name_down">По имени (убывание)</option> | 73 | <option value="name_down">По имени (убывание)</option> |
74 | <option value="created_at_up">По дате (возрастание)</option> | 74 | <option value="created_at_up">По дате (возрастание)</option> |
75 | <option value="created_at_down">По дате (убывание)</option>--> | 75 | <option value="created_at_down">По дате (убывание)</option>--> |
76 | </select> | 76 | </select> |
77 | </div> | 77 | </div> |
78 | </div> | 78 | </div> |
79 | </div> | 79 | </div> |
80 | 80 | ||
81 | <div class="table table_spoiler" id="main_ockar" name="main_oskar"> | 81 | <div class="table table_spoiler" id="main_ockar" name="main_oskar"> |
82 | @if ($vacancy_list->count()) | 82 | @if ($vacancy_list->count()) |
83 | <div class="table__scroll"> | 83 | <div class="table__scroll"> |
84 | <div class="table__body table__body_min-width"> | 84 | <div class="table__body table__body_min-width"> |
85 | <table> | 85 | <table> |
86 | <thead> | 86 | <thead> |
87 | <tr> | 87 | <tr> |
88 | <th>№</th> | 88 | <th>№</th> |
89 | <th>Название</th> | 89 | <th>Название</th> |
90 | <th>Дата добавления<br>/ обновления</th> | 90 | <th>Дата добавления<br>/ обновления</th> |
91 | <th style="display:none">Должности</th> | 91 | <th style="display:none">Должности</th> |
92 | <th>Статус</th> | 92 | <th>Статус</th> |
93 | <th>Действия</th> | 93 | <th>Действия</th> |
94 | </tr> | 94 | </tr> |
95 | </thead> | 95 | </thead> |
96 | <tbody> | 96 | <tbody> |
97 | @foreach($vacancy_list as $it) | 97 | @foreach($vacancy_list as $it) |
98 | <tr> | 98 | <tr> |
99 | <td>{{ $it->id }}</td> | 99 | <td>{{ $it->id }}</td> |
100 | <td>{{ $it->name }}</td> | 100 | <td>{{ $it->name }}</td> |
101 | <td>{{ date('d.m.Y', strtotime($it->created_at)) }} <br>/ {{ date('d.m.Y', strtotime($it->updated_at)) }}</td> | 101 | <td>{{ date('d.m.Y', strtotime($it->created_at)) }} <br>/ {{ date('d.m.Y', strtotime($it->updated_at)) }}</td> |
102 | <td style="display:none"> <a href="{{ route('employer.add_job_in_vac', ['ad_employer' => $it->id]) }}" class="button">Добавить</a> | 102 | <td style="display:none"> <a href="{{ route('employer.add_job_in_vac', ['ad_employer' => $it->id]) }}" class="button">Добавить</a> |
103 | 103 | ||
104 | @if ($it->jobs->count()) | 104 | @if ($it->jobs->count()) |
105 | @foreach ($it->jobs as $key => $it_um) | 105 | @foreach ($it->jobs as $key => $it_um) |
106 | <p>@if (isset($it->jobs_code[$key])) | 106 | <p>@if (isset($it->jobs_code[$key])) |
107 | <a href="{{ route('employer.edit_job_in_vac', ['ad_job' => $it->jobs_code[$key]->id, 'ad_employer' => $it->id, 'job_title_id' => $it_um->id]) }}" style="text-decoration: underline">{{$it_um->name}}</a> | 107 | <a href="{{ route('employer.edit_job_in_vac', ['ad_job' => $it->jobs_code[$key]->id, 'ad_employer' => $it->id, 'job_title_id' => $it_um->id]) }}" style="text-decoration: underline">{{$it_um->name}}</a> |
108 | <a href="{{ route('employer.delete_job_in_vac', ['ad_job' => $it->jobs_code[$key]->id]) }}" style="text-decoration: underline">(Del)</a> | 108 | <a href="{{ route('employer.delete_job_in_vac', ['ad_job' => $it->jobs_code[$key]->id]) }}" style="text-decoration: underline">(Del)</a> |
109 | @endif | 109 | @endif |
110 | </p> | 110 | </p> |
111 | @endforeach | 111 | @endforeach |
112 | @else | 112 | @else |
113 | Нет связанных <br> с вакансией должностей | 113 | Нет связанных <br> с вакансией должностей |
114 | @endif | 114 | @endif |
115 | </td> | 115 | </td> |
116 | <td> | 116 | <td> |
117 | @if ($it->active_is) | 117 | @if ($it->active_is) |
118 | <span class="table__status green"><i></i>Опубликовано</span> | 118 | <span class="table__status green"><i></i>Опубликовано</span> |
119 | @else | 119 | @else |
120 | <span class="table__status"><i></i>Не опубликовано</span> | 120 | <span class="table__status"><i></i>Не опубликовано</span> |
121 | @endif | 121 | @endif |
122 | </td> | 122 | </td> |
123 | <td> | 123 | <td> |
124 | <span class="table__controls"> | 124 | <span class="table__controls"> |
125 | <a class="table__controls-item up-it" href="{{ route('employer.vacancy_up', ['ad_employer' => $it->id]) }}"> | 125 | <a class="table__controls-item up-it" title="Поднять вакансию" href="{{ route('employer.vacancy_up', ['ad_employer' => $it->id]) }}"> |
126 | <svg> | 126 | <svg> |
127 | <use xlink:href="{{ asset('images/sprite.svg#arrow-radius') }}"></use> | 127 | <use xlink:href="{{ asset('images/sprite.svg#arrow-radius') }}"></use> |
128 | </svg> | 128 | </svg> |
129 | </a> | 129 | </a> |
130 | <a href="{{ route('employer.vacancy_edit', ['ad_employer' => $it->id]) }}" class="table__controls-item"> | 130 | <a href="{{ route('employer.vacancy_edit', ['ad_employer' => $it->id]) }}" title="Редактировать вакансию" class="table__controls-item"> |
131 | <svg> | 131 | <svg> |
132 | <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> | 132 | <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> |
133 | </svg> | 133 | </svg> |
134 | </a> | 134 | </a> |
135 | <a class="table__controls-item" href="{{ route('employer.vacancy_delete', ['ad_employer' => $it->id]) }}"> | 135 | <a class="table__controls-item" title="Удалить вакансию" href="{{ route('employer.vacancy_delete', ['ad_employer' => $it->id]) }}"> |
136 | <svg> | 136 | <svg> |
137 | <use xlink:href="{{ asset('images/sprite.svg#cross') }}"></use> | 137 | <use xlink:href="{{ asset('images/sprite.svg#cross') }}"></use> |
138 | </svg> | 138 | </svg> |
139 | </a> | 139 | </a> |
140 | @if ($it->active_is) | 140 | @if ($it->active_is) |
141 | <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 0]) }}" class="table__controls-item"> | 141 | <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 0]) }}" title="Скрыть вакансию" class="table__controls-item"> |
142 | <svg> | 142 | <svg> |
143 | <use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use> | 143 | <use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use> |
144 | </svg> | 144 | </svg> |
145 | </a> | 145 | </a> |
146 | @else | 146 | @else |
147 | <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 1]) }}" class="table__controls-item"> | 147 | <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 1]) }}" title="Показать вакансию" class="table__controls-item"> |
148 | <svg> | 148 | <svg> |
149 | <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use> | 149 | <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use> |
150 | </svg> | 150 | </svg> |
151 | </a> | 151 | </a> |
152 | @endif | 152 | @endif |
153 | @if ($Employer->social_is == 1) | 153 | @if ($Employer->social_is == 1) |
154 | <a href="{{ route('employer.send-vacancy-to-social', ['social' => 'tg', 'vacancy' => $it->id]) }}" class="table__controls-item"> | 154 | <a href="{{ route('employer.send-vacancy-to-social', ['social' => 'tg', 'vacancy' => $it->id]) }}" title="Отправить вакансию в телеграм" class="table__controls-item"> |
155 | <svg> | 155 | <svg> |
156 | <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> | 156 | <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> |
157 | </svg> | 157 | </svg> |
158 | </a> | 158 | </a> |
159 | @endif | 159 | @endif |
160 | </span> | 160 | </span> |
161 | </td> | 161 | </td> |
162 | </tr> | 162 | </tr> |
163 | @endforeach | 163 | @endforeach |
164 | </tbody> | 164 | </tbody> |
165 | </table> | 165 | </table> |
166 | </div><br> | 166 | </div><br> |
167 | {{ $vacancy_list->appends($_GET)->links('paginate') }} | 167 | {{ $vacancy_list->appends($_GET)->links('paginate') }} |
168 | </div> | 168 | </div> |
169 | 169 | ||
170 | 170 | ||
171 | @else | 171 | @else |
172 | 172 | ||
173 | <div class="notify"> | 173 | <div class="notify"> |
174 | <svg> | 174 | <svg> |
175 | <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> | 175 | <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> |
176 | </svg> | 176 | </svg> |
177 | <span>Вы ещё не разместили ни одной вакансии</span> | 177 | <span>Вы ещё не разместили ни одной вакансии</span> |
178 | </div> | 178 | </div> |
179 | @endif | 179 | @endif |
180 | </div> | 180 | </div> |
181 | </div> | 181 | </div> |
182 | </div> | 182 | </div> |
183 | </div> | 183 | </div> |
184 | </div> | 184 | </div> |
185 | </section> | 185 | </section> |
186 | </div> | 186 | </div> |
187 | @endsection | 187 | @endsection |
188 | 188 |
resources/views/index.blade.php
1 | @extends('layout.frontend', ['title' => 'Главная страница РекаМоре']) | 1 | @extends('layout.frontend', ['title' => 'Главная страница РекаМоре']) |
2 | 2 | ||
3 | @section('scripts') | 3 | @section('scripts') |
4 | 4 | ||
5 | @endsection | 5 | @endsection |
6 | 6 | ||
7 | @section('content') | 7 | @section('content') |
8 | @include('messages_error') | 8 | @include('messages_error') |
9 | <section class="work"> | 9 | <section class="work"> |
10 | <div class="container"> | 10 | <div class="container"> |
11 | <img src="{{ asset('images/1.png') }}" alt="" class="work__pic"> | 11 | <img src="{{ asset('images/1.png') }}" alt="" class="work__pic"> |
12 | <div class="work__body"> | 12 | <div class="work__body"> |
13 | <div class="work__title"> | 13 | <div class="work__title"> |
14 | <h4>Работа в море / | 14 | <h4>Работа в море / |
15 | <span class="br">Работа на реке</span></h4> | 15 | <span class="br">Работа на реке</span></h4> |
16 | </div> | 16 | </div> |
17 | <div class="work__text">Информационный портал rekamore.su - место где работники морского и речного флота могут найти для себя хорошую работу, | 17 | <div class="work__text">Информационный портал rekamore.su - место где работники морского и речного флота могут найти для себя хорошую работу, |
18 | а работодатели отличных специалистов | 18 | а работодатели отличных специалистов |
19 | </div> | 19 | </div> |
20 | <div class="work__list"> | 20 | <div class="work__list"> |
21 | <div>Тысячи соискателей увидят Ваше объявление</div> | 21 | <div>Тысячи соискателей увидят Ваше объявление</div> |
22 | <div>Десятки компаний выкладывают объявления каждый день</div> | 22 | <div>Десятки компаний выкладывают объявления каждый день</div> |
23 | </div> | 23 | </div> |
24 | <form class="work__form width100 flex" style="" action="{{ route('vacancies') }}" method="GET"> | 24 | <form class="work__form width100 flex" style="" action="{{ route('vacancies') }}" method="GET"> |
25 | 25 | ||
26 | <div class="select select_search" style="max-width: 60%"> | 26 | <div class="select select_search" style="max-width: 60%"> |
27 | <div class="select__icon"> | 27 | <div class="select__icon"> |
28 | <svg> | 28 | <svg> |
29 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> | 29 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> |
30 | </svg> | 30 | </svg> |
31 | </div> | 31 | </div> |
32 | <select class="js-select2 jobs" id="job" name="job"> | 32 | <select class="js-select2 jobs" id="job" name="job"> |
33 | <option value="0">Выберите должность</option> | 33 | <option value="0">Выберите должность</option> |
34 | @if ($Job_title->count()) | 34 | @if ($Job_title->count()) |
35 | @foreach($Job_title as $JT) | 35 | @foreach($Job_title as $JT) |
36 | <option value="{{ $JT->id }}" @if ((isset($_GET['job'])) && ($_GET['job'] == $JT->id)) selected @endif>{{ $JT->name }}</option> | 36 | <option value="{{ $JT->id }}" @if ((isset($_GET['job'])) && ($_GET['job'] == $JT->id)) selected @endif>{{ $JT->name }}</option> |
37 | @endforeach | 37 | @endforeach |
38 | @endif | 38 | @endif |
39 | </select> | 39 | </select> |
40 | </div> | 40 | </div> |
41 | 41 | ||
42 | <button type="submit" class="button button_light" style="height: auto;">Посмотреть вакансии</button> | 42 | <button type="submit" class="button button_light" style="height: auto;">Посмотреть вакансии</button> |
43 | </form> | 43 | </form> |
44 | @if(Auth()->user() === null || Auth()->user()->is_worker === 1) | 44 | @if(Auth()->user() === null || Auth()->user()->is_worker === 1) |
45 | <a href="{{ route('page', ['pages' => 'Usloviya-razmescheniya']) }}" class="button work__search">Я ищу сотрудника</a> | 45 | <a href="{{ route('page', ['pages' => 'Usloviya-razmescheniya']) }}" class="button work__search">Я ищу сотрудника</a> |
46 | @else | 46 | @else |
47 | <a href="{{ route('employer.cabinet') }}" class="button work__search">Я ищу сотрудника</a> | 47 | <a href="{{ route('employer.cabinet') }}" class="button work__search">Я ищу сотрудника</a> |
48 | @endif | 48 | @endif |
49 | <div class="work__get"> | 49 | <div class="work__get"> |
50 | <b>Скачать приложение</b> | 50 | <b>Скачать приложение</b> |
51 | <a href=""> | 51 | <a href=""> |
52 | <img src="{{ asset('images/google.svg') }}" alt=""> | 52 | <img src="{{ asset('images/google.svg') }}" alt=""> |
53 | </a> | 53 | </a> |
54 | <a href=""> | 54 | <a href=""> |
55 | <img src="{{ asset('images/apple.svg') }}" alt=""> | 55 | <img src="{{ asset('images/apple.svg') }}" alt=""> |
56 | </a> | 56 | </a> |
57 | </div> | 57 | </div> |
58 | </div> | 58 | </div> |
59 | </div> | 59 | </div> |
60 | </section> | 60 | </section> |
61 | 61 | ||
62 | @if ($blocks_counters) | 62 | @if ($blocks_counters) |
63 | <section class="numbers"> | 63 | <section class="numbers"> |
64 | <div class="container"> | 64 | <div class="container"> |
65 | <div class="numbers__body"> | 65 | <div class="numbers__body"> |
66 | @foreach($blocks_counters as $block_counter) | 66 | @foreach($blocks_counters as $block_counter) |
67 | <div class="numbers__item"> | 67 | <div class="numbers__item"> |
68 | <b>{{$block_counter['extra']}}</b> | 68 | <b>{{$block_counter['extra']}}</b> |
69 | <span>{{$block_counter['title']}}</span> | 69 | <span>{{$block_counter['title']}}</span> |
70 | {{$block_counter['description']}} | 70 | {{$block_counter['description']}} |
71 | </div> | 71 | </div> |
72 | @endforeach | 72 | @endforeach |
73 | </div> | 73 | </div> |
74 | </div> | 74 | </div> |
75 | </section> | 75 | </section> |
76 | @endif | 76 | @endif |
77 | 77 | ||
78 | <main class="main"> | 78 | <main class="main"> |
79 | <div class="container"> | 79 | <div class="container"> |
80 | <div class="main__vacancies"> | 80 | <div class="main__vacancies"> |
81 | <h2 class="main__vacancies-title">Категории вакансий</h2> | 81 | <h2 class="main__vacancies-title">Категории вакансий</h2> |
82 | <div class="vacancies__body"> | 82 | <div class="vacancies__body"> |
83 | <div class="vacancies__list" id="block_ajax" name="block_ajax"> | 83 | <div class="vacancies__list" id="block_ajax" name="block_ajax"> |
84 | @foreach($Main_Job as $key => $it_main) | 84 | @foreach($Main_Job as $key => $it_main) |
85 | <div class="vacancies__list-col"> | 85 | <div class="vacancies__list-col"> |
86 | @include('block_real_new', ['it_main' => $it_main, 'category' => $key]) | 86 | @include('block_real_new', ['it_main' => $it_main, 'category' => $key]) |
87 | </div> | 87 | </div> |
88 | @endforeach | 88 | @endforeach |
89 | <!--_include('block_real', ['flot' => $flot, 'position' => $Position[$flot->position_id]])--> | 89 | <!--_include('block_real', ['flot' => $flot, 'position' => $Position[$flot->position_id]])--> |
90 | </div> | 90 | </div> |
91 | </div> | 91 | </div> |
92 | </div> | 92 | </div> |
93 | </div> | 93 | </div> |
94 | </main> | 94 | </main> |
95 | 95 | ||
96 | <section class="employer"> | 96 | <section class="employer"> |
97 | <div class="container"> | 97 | <div class="container"> |
98 | <div class="title"><h4>Работодатели</h4></div> | 98 | <div class="title"><h4>Работодатели</h4></div> |
99 | 99 | ||
100 | <div class="employer__body"> | 100 | <div class="employer__body"> |
101 | @if ($employers->count()) | 101 | @if ($employers->count()) |
102 | @foreach($employers as $emp) | 102 | @foreach($employers as $emp) |
103 | @if (!empty($emp->employer->logo)) | 103 | @if (!empty($emp->employer->logo)) |
104 | <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}"> | 104 | <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}"> |
105 | <img src="{{ asset(Storage::url($emp->employer->logo)) }}" alt="{{ $emp->employer->name_company }}"> | 105 | <img |
106 | src="{{ asset(Storage::url($emp->employer->logo)) }}" | ||
107 | alt="{{ $emp->employer->name_company }}" | ||
108 | title="{{ $emp->employer->name_company }}" | ||
109 | > | ||
106 | </a> | 110 | </a> |
107 | @else | 111 | @else |
108 | <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}"> | 112 | <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}"> |
109 | <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $emp->employer->name_company }}"> | 113 | <img |
114 | src="{{ asset('images/logo_emp.png') }}" | ||
115 | alt="{{ $emp->employer->name_company }}" | ||
116 | title="{{ $emp->employer->name_company }}" | ||
117 | > | ||
110 | </a> | 118 | </a> |
111 | @endif | 119 | @endif |
112 | @endforeach | 120 | @endforeach |
113 | @else | 121 | @else |
114 | <h5>Тут нет никаких записей</h5> | 122 | <h5>Тут нет никаких записей</h5> |
115 | @endif | 123 | @endif |
116 | </div> | 124 | </div> |
117 | 125 | ||
118 | <div class="swiper-pagination"></div> | 126 | <div class="swiper-pagination"></div> |
119 | </div> | 127 | </div> |
120 | <a href="{{ route('shipping_companies') }}" class="employer__more button button_light">Все работодатели</a> | 128 | <a href="{{ route('shipping_companies') }}" class="employer__more button button_light">Все работодатели</a> |
121 | 129 | ||
122 | </section> | 130 | </section> |
123 | <section class="about"> | 131 | <section class="about"> |
124 | <div class="container"> | 132 | <div class="container"> |
125 | <div class="about__wrapper"> | 133 | <div class="about__wrapper"> |
126 | <div class="title about__title"><h4>О нас</h4></div> | 134 | <div class="title about__title"><h4>О нас</h4></div> |
127 | <div class="about__body"> | 135 | <div class="about__body"> |
128 | <div class="about__line"></div> | 136 | <div class="about__line"></div> |
129 | <div class="about__item"> | 137 | <div class="about__item"> |
130 | <b>Для работодателей</b> | 138 | <b>Для работодателей</b> |
131 | <span> | 139 | <span> |
132 | Нашим ресурсом пользуются более 150 судоходных компаний России и СНГ, в настоящее время мы самая эффективная площадка. | 140 | Нашим ресурсом пользуются более 150 судоходных компаний России и СНГ, в настоящее время мы самая эффективная площадка. |
133 | Подробности о работе сервиса и стоимости обслуживания можно получить перейдя по ссылке | 141 | Подробности о работе сервиса и стоимости обслуживания можно получить перейдя по ссылке |
134 | <a href="{{ route('page', ['pages' => 'Stoimost-razmescheniya']) }}">здесь</a>. | 142 | <a href="{{ route('page', ['pages' => 'Stoimost-razmescheniya']) }}">здесь</a>. |
135 | </span> | 143 | </span> |
136 | <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('bd_resume') }}">Поиск сотрудников</a> | 144 | <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('bd_resume') }}">Поиск сотрудников</a> |
137 | </div> | 145 | </div> |
138 | <div class="about__item"> | 146 | <div class="about__item"> |
139 | <b>Для сотрудников</b> | 147 | <b>Для сотрудников</b> |
140 | <span> | 148 | <span> |
141 | Работа найдется для каждого, а удобная фильтрация вакансий по должностям сделает поиск приятным | 149 | Работа найдется для каждого, а удобная фильтрация вакансий по должностям сделает поиск приятным |
142 | </span> | 150 | </span> |
143 | <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('vacancies') }}">Ищу работу</a> | 151 | <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('vacancies') }}">Ищу работу</a> |
144 | </div> | 152 | </div> |
145 | </div> | 153 | </div> |
146 | </div> | 154 | </div> |
147 | </div> | 155 | </div> |
148 | </section> | 156 | </section> |
149 | 157 | ||
150 | @if ($news->count()) | 158 | @if ($news->count()) |
151 | <section class="news"> | 159 | <section class="news"> |
152 | <div class="container"> | 160 | <div class="container"> |
153 | <div class="news__toper"> | 161 | <div class="news__toper"> |
154 | <div class="title"><h4>Новости и статьи</h4></div> | 162 | <div class="title"><h4>Новости и статьи</h4></div> |
155 | <div class="navs"> | 163 | <div class="navs"> |
156 | <button class="js-news-swiper-button-prev"> | 164 | <button class="js-news-swiper-button-prev"> |
157 | <svg class="rotate180"> | 165 | <svg class="rotate180"> |
158 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> | 166 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> |
159 | </svg> | 167 | </svg> |
160 | </button> | 168 | </button> |
161 | <button class="js-news-swiper-button-next"> | 169 | <button class="js-news-swiper-button-next"> |
162 | <svg> | 170 | <svg> |
163 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> | 171 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> |
164 | </svg> | 172 | </svg> |
165 | </button> | 173 | </button> |
166 | </div> | 174 | </div> |
167 | </div> | 175 | </div> |
168 | 176 | ||
169 | <div class="swiper js-news-swiper"> | 177 | <div class="swiper js-news-swiper"> |
170 | <div class="swiper-wrapper"> | 178 | <div class="swiper-wrapper"> |
171 | 179 | ||
172 | @foreach ($news as $new) | 180 | @foreach ($news as $new) |
173 | <div class="swiper-slide"> | 181 | <div class="swiper-slide"> |
174 | <div class="news__item"> | 182 | <div class="news__item"> |
175 | @if (empty($new->image)) | 183 | @if (empty($new->image)) |
176 | <img src="{{ asset('/images/default_ship.jpg') }}" alt="" class="news__item-pic"> | 184 | <img src="{{ asset('/images/default_ship.jpg') }}" alt="" class="news__item-pic"> |
177 | @else | 185 | @else |
178 | <img src="{{ asset(Storage::url($new->image)) }}" alt="" class="news__item-pic"> | 186 | <img src="{{ asset(Storage::url($new->image)) }}" alt="" class="news__item-pic"> |
179 | @endif | 187 | @endif |
180 | <div class="news__item-body"> | 188 | <div class="news__item-body"> |
181 | <time datetime="{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}" class="news__item-date">{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}</time> | 189 | <time datetime="{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}" class="news__item-date">{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}</time> |
182 | <span class="news__item-title">{{ $new->title }}</span> | 190 | <span class="news__item-title">{{ $new->title }}</span> |
183 | <span class="news__item-text">{!! mb_strimwidth($new->text, 0, 100) !!}</span> | 191 | <span class="news__item-text">{!! mb_strimwidth($new->text, 0, 100) !!}</span> |
184 | <a href="{{ route('detail_new', ['new' => $new->id]) }}" class="news__item-more button button_light">Читать далее</a> | 192 | <a href="{{ route('detail_new', ['new' => $new->id]) }}" class="news__item-more button button_light">Читать далее</a> |
185 | </div> | 193 | </div> |
186 | </div> | 194 | </div> |
187 | </div> | 195 | </div> |
188 | @endforeach | 196 | @endforeach |
189 | 197 | ||
190 | </div> | 198 | </div> |
191 | <div class="swiper-pagination"></div> | 199 | <div class="swiper-pagination"></div> |
192 | </div> | 200 | </div> |
193 | <a href="{{ route('news') }}" class="news__all button button_light">Все новости</a> | 201 | <a href="{{ route('news') }}" class="news__all button button_light">Все новости</a> |
194 | 202 | ||
195 | </div> | 203 | </div> |
196 | </section> | 204 | </section> |
197 | @endif | 205 | @endif |
198 | 206 | ||
199 | <section class="info"> | 207 | <section class="info"> |
200 | <div class="container"> | 208 | <div class="container"> |
201 | <img src="images/5.png" alt="" class="info__pic"> | 209 | <img src="images/5.png" alt="" class="info__pic"> |
202 | <div class="info__body"> | 210 | <div class="info__body"> |
203 | <div class="title info__title"><h4>Мы в социальных сетях</h4></div> | 211 | <div class="title info__title"><h4>Мы в социальных сетях</h4></div> |
204 | <div class="info__item"> | 212 | <div class="info__item"> |
205 | <div class="info__text"> | 213 | <div class="info__text"> |
206 | Телеграм — Подпишитесь на наш телеграм канал и получайте уведомления о новых вакансиях прямо на свой смартфон | 214 | Телеграм — Подпишитесь на наш телеграм канал и получайте уведомления о новых вакансиях прямо на свой смартфон |
207 | </div> | 215 | </div> |
208 | <a href="{{ $companies[0]->telegram }}" class="info__link" style="background:#20A0E1"> | 216 | <a href="{{ $companies[0]->telegram }}" class="info__link" style="background:#20A0E1"> |
209 | <svg> | 217 | <svg> |
210 | <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> | 218 | <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> |
211 | </svg> | 219 | </svg> |
212 | Телеграм | 220 | Телеграм |
213 | </a> | 221 | </a> |
214 | </div> | 222 | </div> |
215 | <div class="info__item"> | 223 | <div class="info__item"> |
216 | <div class="info__text"> | 224 | <div class="info__text"> |
217 | Вконтакте — Сообщество работников морского и речного флота, актуальная подборка вакансий | 225 | Вконтакте — Сообщество работников морского и речного флота, актуальная подборка вакансий |
218 | </div> | 226 | </div> |
219 | <a href="{{ $companies[0]->vkontact }}" class="info__link" style="background:#2787F5"> | 227 | <a href="{{ $companies[0]->vkontact }}" class="info__link" style="background:#2787F5"> |
220 | <svg> | 228 | <svg> |
221 | <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> | 229 | <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> |
222 | </svg> | 230 | </svg> |
223 | ВКонтакте | 231 | ВКонтакте |
224 | </a> | 232 | </a> |
225 | </div> | 233 | </div> |
226 | </div> | 234 | </div> |
227 | </div> | 235 | </div> |
228 | </section> | 236 | </section> |
229 | @endsection | 237 | @endsection |
230 | 238 |
resources/views/layout/frontend.blade.php
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> | 2 | <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> |
3 | 3 | ||
4 | <head> | 4 | <head> |
5 | <meta charset="utf-8"> | 5 | <meta charset="utf-8"> |
6 | <title>{{ $title }}</title> | 6 | <title>{{ $title }}</title> |
7 | <meta name="viewport" content="width=device-width,initial-scale=1"> | 7 | <meta name="viewport" content="width=device-width,initial-scale=1"> |
8 | <meta name="theme-color" content="#377D87"> | 8 | <meta name="theme-color" content="#377D87"> |
9 | <script src="{{ asset('js/jquery.js') }}"></script> | 9 | <script src="{{ asset('js/jquery.js') }}"></script> |
10 | <script src="{{ asset('js/jquery-ui.js') }}"></script> | 10 | <script src="{{ asset('js/jquery-ui.js') }}"></script> |
11 | <script src="{{ asset('js/func.js') }}"></script> | 11 | <script src="{{ asset('js/func.js') }}"></script> |
12 | <link rel="stylesheet" href="{{ asset('js/chosen/chosen.min.css') }}"> | 12 | <link rel="stylesheet" href="{{ asset('js/chosen/chosen.min.css') }}"> |
13 | <script src="{{ asset('js/chosen/chosen.jquery.min.js') }}"></script> | 13 | <script src="{{ asset('js/chosen/chosen.jquery.min.js') }}"></script> |
14 | <!--<script type="text/javascript" src=" asset('js/jquery.cookie.js') }}"></script>--> | 14 | <!--<script type="text/javascript" src=" asset('js/jquery.cookie.js') }}"></script>--> |
15 | <link rel="stylesheet" href="{{ asset('css/telegram.css') }}"> | 15 | <link rel="stylesheet" href="{{ asset('css/telegram.css') }}"> |
16 | <link rel="stylesheet" href="{{ asset('css/star-rating.min.css') }}"> | 16 | <link rel="stylesheet" href="{{ asset('css/star-rating.min.css') }}"> |
17 | <link rel="stylesheet" href="{{ asset('css/style_may2024.css') }}"> | 17 | <link rel="stylesheet" href="{{ asset('css/style_may2024.css') }}"> |
18 | <link rel="stylesheet" href="{{ asset('css/helpers.css') }}"> | 18 | <link rel="stylesheet" href="{{ asset('css/helpers.css') }}"> |
19 | <style> | 19 | <style> |
20 | .err_red { | 20 | .err_red { |
21 | border: red 2px solid; | 21 | border: red 2px solid; |
22 | } | 22 | } |
23 | 23 | ||
24 | .input[disabled] { | 24 | .input[disabled] { |
25 | /* color: #9c9d9d; */ | 25 | /* color: #9c9d9d; */ |
26 | background: #FFFFFF; | 26 | background: #FFFFFF; |
27 | } | 27 | } |
28 | </style> | 28 | </style> |
29 | </head> | 29 | </head> |
30 | 30 | ||
31 | <body id="body" onload="createCaptcha()"> | 31 | <body id="body" onload="createCaptcha()"> |
32 | <a href="#body" class="to-top js-scroll-to"> | 32 | <a href="#body" class="to-top js-scroll-to"> |
33 | <svg> | 33 | <svg> |
34 | <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> | 34 | <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> |
35 | </svg> | 35 | </svg> |
36 | </a> | 36 | </a> |
37 | 37 | ||
38 | <div> <!-- BEGIN TOP WRAPPER --> | 38 | <div> <!-- BEGIN TOP WRAPPER --> |
39 | <header class="header"> | 39 | <header class="header"> |
40 | <div class="container"> | 40 | <div class="container"> |
41 | <div class="header__body"> | 41 | <div class="header__body"> |
42 | <div class="header__left"> | 42 | <div class="header__left"> |
43 | <a href="{{ route('index') }}" class="header__logo"> | 43 | <a href="{{ route('index') }}" class="header__logo"> |
44 | <svg> | 44 | <svg> |
45 | <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> | 45 | <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> |
46 | </svg> | 46 | </svg> |
47 | </a> | 47 | </a> |
48 | <nav class="header__menu"> | 48 | <nav class="header__menu"> |
49 | <a href="{{ route('vacancies') }}" class="header__menu-item">Вакансии</a> | 49 | <a href="{{ route('vacancies') }}" class="header__menu-item">Вакансии</a> |
50 | <a href="{{ route('shipping_companies') }}" class="header__menu-item">Судоходные компании</a> | 50 | <a href="{{ route('shipping_companies') }}" class="header__menu-item">Судоходные компании</a> |
51 | <a href="{{ route('education') }}" class="header__menu-item">Образование</a> | 51 | <a href="{{ route('education') }}" class="header__menu-item">Образование</a> |
52 | </nav> | 52 | </nav> |
53 | </div> | 53 | </div> |
54 | <div class="header__right"> | 54 | <div class="header__right"> |
55 | @guest | ||
56 | |||
57 | @else | ||
58 | <a href="@if ($UserId->is_worker) {{ route('worker.cabinet') }} @else {{ route('employer.cabinet') }} @endif" | ||
59 | class="header__notifs header__notifs_actived"> | ||
60 | <svg> | ||
61 | <use xlink:href="{{ asset('images/sprite.svg#ring') }}"></use> | ||
62 | </svg> | ||
63 | <span>Уведомления</span> | ||
64 | </a> | ||
65 | |||
66 | @endguest | ||
67 | <div class="header__right-line"></div> | 55 | <div class="header__right-line"></div> |
68 | <button class="header__burger"> | 56 | <button class="header__burger"> |
69 | <svg> | 57 | <svg> |
70 | <use xlink:href="{{ asset('images/sprite.svg#burger') }}"></use> | 58 | <use xlink:href="{{ asset('images/sprite.svg#burger') }}"></use> |
71 | </svg> | 59 | </svg> |
72 | </button> | 60 | </button> |
73 | @guest | 61 | @guest |
74 | <a class="button header__sign" data-fancybox data-src="#sign" | 62 | <a class="button header__sign" data-fancybox data-src="#sign" |
75 | data-options='{"touch":false,"autoFocus":false}'>Войти</a> | 63 | data-options='{"touch":false,"autoFocus":false}'>Войти</a> |
76 | @else | 64 | @else |
77 | <a class="button header__sign" href="{{ route('logout') }}">Выйти</a> | 65 | <a |
66 | class="button header__sign" | ||
67 | href="@if ($UserId->is_worker) {{ route('worker.cabinet') }} @else {{ route('employer.cabinet') }} @endif"> | ||
68 | Личный кабинет | ||
69 | </a> | ||
78 | @endguest | 70 | @endguest |
79 | </div> | 71 | </div> |
80 | </div> | 72 | </div> |
81 | </div> | 73 | </div> |
82 | </header> | 74 | </header> |
83 | 75 | ||
84 | @yield('content') | 76 | @yield('content') |
85 | </div> <!-- END TOP WRAPPER --> | 77 | </div> <!-- END TOP WRAPPER --> |
86 | 78 | ||
87 | <div> <!-- BEGIN BOTTOM WRAPPER --> | 79 | <div> <!-- BEGIN BOTTOM WRAPPER --> |
88 | <footer class="footer"> | 80 | <footer class="footer"> |
89 | <div class="container"> | 81 | <div class="container"> |
90 | <div class="footer__mobile"> | 82 | <div class="footer__mobile"> |
91 | 83 | ||
92 | <button class="footer__mobile-toper js-toggle active"> | 84 | <button class="footer__mobile-toper js-toggle active"> |
93 | <a href="{{ route('index') }}"> | 85 | <a href="{{ route('index') }}"> |
94 | <svg> | 86 | <svg> |
95 | <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> | 87 | <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> |
96 | </svg> | 88 | </svg> |
97 | </a> | 89 | </a> |
98 | <span> | 90 | <span> |
99 | <svg> | 91 | <svg> |
100 | <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> | 92 | <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> |
101 | </svg> | 93 | </svg> |
102 | </span> | 94 | </span> |
103 | </button> | 95 | </button> |
104 | <div class="footer__mobile-menu"> | 96 | <div class="footer__mobile-menu"> |
105 | <div class="footer__mobile-menu-item"> | 97 | <div class="footer__mobile-menu-item"> |
106 | <button class="js-toggle"> | 98 | <button class="js-toggle"> |
107 | <b>Соискателям</b> | 99 | <b>Соискателям</b> |
108 | <span><svg> | 100 | <span><svg> |
109 | <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> | 101 | <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> |
110 | </svg></span> | 102 | </svg></span> |
111 | </button> | 103 | </button> |
112 | <div> | 104 | <div> |
113 | @if (\Illuminate\Support\Facades\Auth::user() === null) | 105 | @if (\Illuminate\Support\Facades\Auth::user() === null) |
114 | <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a> | 106 | <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a> |
115 | @endif | 107 | @endif |
116 | <a href="{{ route('vacancies') }}">Вакансии</a> | 108 | <a href="{{ route('vacancies') }}">Вакансии</a> |
117 | <!--<a href=" route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>--> | 109 | <!--<a href=" route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>--> |
118 | <a href="{{ route('education') }}">Образование</a> | 110 | <a href="{{ route('education') }}">Образование</a> |
119 | <a href="{{ route('news') }}">Новости</a> | 111 | <a href="{{ route('news') }}">Новости</a> |
120 | <a href="{{ $companies[0]->telegram }}">Телеграм</a> | 112 | <a href="{{ $companies[0]->telegram }}">Телеграм</a> |
121 | <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a> | 113 | <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a> |
122 | <!--<a href=" route('contacts') }}">Контакты</a>--> | 114 | <!--<a href=" route('contacts') }}">Контакты</a>--> |
123 | <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная | 115 | <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная |
124 | оферта</a> | 116 | оферта</a> |
125 | </div> | 117 | </div> |
126 | </div> | 118 | </div> |
127 | <div class="footer__mobile-menu-item"> | 119 | <div class="footer__mobile-menu-item"> |
128 | <button class="js-toggle"> | 120 | <button class="js-toggle"> |
129 | <b>Работодателям</b> | 121 | <b>Работодателям</b> |
130 | <span><svg> | 122 | <span><svg> |
131 | <use xlink:href="{{asset('images/sprite.svg#arrow-top') }}"></use> | 123 | <use xlink:href="{{asset('images/sprite.svg#arrow-top') }}"></use> |
132 | </svg></span> | 124 | </svg></span> |
133 | </button> | 125 | </button> |
134 | <div> | 126 | <div> |
135 | @if (\Illuminate\Support\Facades\Auth::user() === null) | 127 | @if (\Illuminate\Support\Facades\Auth::user() === null) |
136 | <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a> | 128 | <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a> |
137 | @endif | 129 | @endif |
138 | <!--<a href=" route('register') }}">Регистрация</a>--> | 130 | <!--<a href=" route('register') }}">Регистрация</a>--> |
139 | <a href="{{ route('bd_resume') }}">База резюме</a> | 131 | <a href="{{ route('bd_resume') }}">База резюме</a> |
140 | <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a> | 132 | <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a> |
141 | <!--<a href=" route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a>--> | 133 | <!--<a href=" route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a>--> |
142 | <!--<a href=" route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a>--> | 134 | <!--<a href=" route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a>--> |
143 | <!--<a href=" route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a>--> | 135 | <!--<a href=" route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a>--> |
144 | <a href="{{ $companies[0]->telegram }}">Телеграм</a> | 136 | <a href="{{ $companies[0]->telegram }}">Телеграм</a> |
145 | <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a> | 137 | <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a> |
146 | <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная | 138 | <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная |
147 | оферта</a> | 139 | оферта</a> |
148 | </div> | 140 | </div> |
149 | </div> | 141 | </div> |
150 | </div> | 142 | </div> |
151 | <div class="footer__mobile-contacts"> | 143 | <div class="footer__mobile-contacts"> |
152 | <b>Контакты</b> | 144 | <b>Контакты</b> |
153 | <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a> | 145 | <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a> |
154 | <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a> | 146 | <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a> |
155 | </div> | 147 | </div> |
156 | <div class="footer__mobile-bottom"> | 148 | <div class="footer__mobile-bottom"> |
157 | <div class="socials"> | 149 | <div class="socials"> |
158 | <a href="{{ $companies[0]->vkontact }}" target="_blank"> | 150 | <a href="{{ $companies[0]->vkontact }}" target="_blank"> |
159 | <svg> | 151 | <svg> |
160 | <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> | 152 | <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> |
161 | </svg> | 153 | </svg> |
162 | </a> | 154 | </a> |
163 | <a href="{{ $companies[0]->telegram }}" target="_blank"> | 155 | <a href="{{ $companies[0]->telegram }}" target="_blank"> |
164 | <svg> | 156 | <svg> |
165 | <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> | 157 | <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> |
166 | </svg> | 158 | </svg> |
167 | </a> | 159 | </a> |
168 | </div> | 160 | </div> |
169 | <nav class="footer__mobile-links"> | 161 | <nav class="footer__mobile-links"> |
170 | <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика | 162 | <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика |
171 | конфиденциальности</a> | 163 | конфиденциальности</a> |
172 | <span></span> | 164 | <span></span> |
173 | <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское | 165 | <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское |
174 | соглашение</a> | 166 | соглашение</a> |
175 | </nav> | 167 | </nav> |
176 | © 2023 — RekaMore.su | 168 | © 2023 — RekaMore.su |
177 | <a href="{{ route('index') }}" class="nls" target="_blank"> | 169 | <a href="{{ route('index') }}" class="nls" target="_blank"> |
178 | <svg> | 170 | <svg> |
179 | <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use> | 171 | <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use> |
180 | </svg> | 172 | </svg> |
181 | <span> | 173 | <span> |
182 | Дизайн и разработка: | 174 | Дизайн и разработка: |
183 | <b>NoLogoStudio.ru</b> | 175 | <b>NoLogoStudio.ru</b> |
184 | </span> | 176 | </span> |
185 | </a> | 177 | </a> |
186 | </div> | 178 | </div> |
187 | </div> | 179 | </div> |
188 | <div class="footer__main"> | 180 | <div class="footer__main"> |
189 | <div class="footer__main-body"> | 181 | <div class="footer__main-body"> |
190 | 182 | ||
191 | <a href="" class="footer__main-logo"> | 183 | <a href="" class="footer__main-logo"> |
192 | <svg> | 184 | <svg> |
193 | <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> | 185 | <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> |
194 | </svg> | 186 | </svg> |
195 | </a> | 187 | </a> |
196 | <div class="footer__main-col"> | 188 | <div class="footer__main-col"> |
197 | <div class="footer__main-title">Соискателям</div> | 189 | <div class="footer__main-title">Соискателям</div> |
198 | <nav> | 190 | <nav> |
199 | @if (\Illuminate\Support\Facades\Auth::user() === null) | 191 | @if (\Illuminate\Support\Facades\Auth::user() === null) |
200 | <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a> | 192 | <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a> |
201 | @endif | 193 | @endif |
202 | <a href="{{ route('vacancies') }}">Вакансии</a> | 194 | <a href="{{ route('vacancies') }}">Вакансии</a> |
203 | <!--<a href=" route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>--> | 195 | <!--<a href=" route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>--> |
204 | <a href="{{ route('education') }}">Образование</a> | 196 | <a href="{{ route('education') }}">Образование</a> |
205 | <a href="{{ route('news') }}">Новости</a> | 197 | <a href="{{ route('news') }}">Новости</a> |
206 | <!--<a href=" route('contacts') }}">Контакты</a>--> | 198 | <!--<a href=" route('contacts') }}">Контакты</a>--> |
207 | <a href="{{ $companies[0]->telegram }}">Телеграм</a> | 199 | <a href="{{ $companies[0]->telegram }}">Телеграм</a> |
208 | <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a> | 200 | <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a> |
209 | <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная | 201 | <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная |
210 | оферта</a> | 202 | оферта</a> |
211 | </nav> | 203 | </nav> |
212 | </div> | 204 | </div> |
213 | <div class="footer__main-col"> | 205 | <div class="footer__main-col"> |
214 | <div class="footer__main-title">Работодателям</div> | 206 | <div class="footer__main-title">Работодателям</div> |
215 | <nav> | 207 | <nav> |
216 | @if (\Illuminate\Support\Facades\Auth::user() === null) | 208 | @if (\Illuminate\Support\Facades\Auth::user() === null) |
217 | <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a> | 209 | <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a> |
218 | @endif | 210 | @endif |
219 | <!--<a href=" route('register') }}">Регистрация</a>--> | 211 | <!--<a href=" route('register') }}">Регистрация</a>--> |
220 | <a href="{{ route('bd_resume') }}">База резюме</a> | 212 | <a href="{{ route('bd_resume') }}">База резюме</a> |
221 | <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a> | 213 | <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a> |
222 | <!--<a href=" route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a>--> | 214 | <!--<a href=" route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a>--> |
223 | <!--<a href=" route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a>--> | 215 | <!--<a href=" route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a>--> |
224 | <!--<a href=" route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a>--> | 216 | <!--<a href=" route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a>--> |
225 | <a href="{{ $companies[0]->telegram }}">Телеграм</a> | 217 | <a href="{{ $companies[0]->telegram }}">Телеграм</a> |
226 | <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a> | 218 | <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a> |
227 | <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная | 219 | <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная |
228 | оферта</a> | 220 | оферта</a> |
229 | </nav> | 221 | </nav> |
230 | </div> | 222 | </div> |
231 | 223 | ||
232 | <div class="footer__main-col"> | 224 | <div class="footer__main-col"> |
233 | <div class="footer__main-title">Контакты</div> | 225 | <div class="footer__main-title">Контакты</div> |
234 | <div class="footer__main-contacts"> | 226 | <div class="footer__main-contacts"> |
235 | <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a> | 227 | <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a> |
236 | <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a> | 228 | <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a> |
237 | </div> | 229 | </div> |
238 | <div class="socials"> | 230 | <div class="socials"> |
239 | <a href="{{ $companies[0]->vkontact }}" target="_blank"> | 231 | <a href="{{ $companies[0]->vkontact }}" target="_blank"> |
240 | <svg> | 232 | <svg> |
241 | <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> | 233 | <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> |
242 | </svg> | 234 | </svg> |
243 | </a> | 235 | </a> |
244 | <a href="{{ $companies[0]->telegram }}" target="_blank"> | 236 | <a href="{{ $companies[0]->telegram }}" target="_blank"> |
245 | <svg> | 237 | <svg> |
246 | <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> | 238 | <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> |
247 | </svg> | 239 | </svg> |
248 | </a> | 240 | </a> |
249 | </div> | 241 | </div> |
250 | </div> | 242 | </div> |
251 | </div> | 243 | </div> |
252 | 244 | ||
253 | <div class="footer__main-copy"> | 245 | <div class="footer__main-copy"> |
254 | <div>© 2023 — RekaMore.su</div> | 246 | <div>© 2023 — RekaMore.su</div> |
255 | <nav> | 247 | <nav> |
256 | <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика | 248 | <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика |
257 | конфиденциальности</a> | 249 | конфиденциальности</a> |
258 | <span></span> | 250 | <span></span> |
259 | <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское | 251 | <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское |
260 | соглашение</a> | 252 | соглашение</a> |
261 | </nav> | 253 | </nav> |
262 | <div> @if (isset($_COOKIE['favorite_vacancy'])) | 254 | <div> @if (isset($_COOKIE['favorite_vacancy'])) |
263 | Куки вакансий: {{ print_r($_COOKIE['favorite_vacancy']) }} | 255 | Куки вакансий: {{ print_r($_COOKIE['favorite_vacancy']) }} |
264 | @endif</div> | 256 | @endif</div> |
265 | <a href="{{ route('index') }}" class="nls" target="_blank"> | 257 | <a href="{{ route('index') }}" class="nls" target="_blank"> |
266 | <svg> | 258 | <svg> |
267 | <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use> | 259 | <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use> |
268 | </svg> | 260 | </svg> |
269 | <span> | 261 | <span> |
270 | Дизайн и разработка: | 262 | Дизайн и разработка: |
271 | <b>NoLogoStudio.ru</b> | 263 | <b>NoLogoStudio.ru</b> |
272 | </span> | 264 | </span> |
273 | </a> | 265 | </a> |
274 | </div> | 266 | </div> |
275 | </div> | 267 | </div> |
276 | </div> | 268 | </div> |
277 | </footer> | 269 | </footer> |
278 | </div> <!-- END BOTTOM WRAPPER --> | 270 | </div> <!-- END BOTTOM WRAPPER --> |
279 | 271 | ||
280 | <div hidden> <!-- BEGIN MODALS WRAPPER --> | 272 | <div hidden> <!-- BEGIN MODALS WRAPPER --> |
281 | <!-- Соискатель отправляет сообщение работодателю --> | 273 | <!-- Соискатель отправляет сообщение работодателю --> |
282 | @include('modals.send_worker_new') | 274 | @include('modals.send_worker_new') |
283 | 275 | ||
284 | <!-- Работодатель отправляет сообщение соискателю --> | 276 | <!-- Работодатель отправляет сообщение соискателю --> |
285 | @include('modals.send_employer') | 277 | @include('modals.send_employer') |
286 | 278 | ||
287 | <!-- Сообщение-предупреждение о том, что сообщения только можно отправить авторизованным пользователям --> | 279 | <!-- Сообщение-предупреждение о том, что сообщения только можно отправить авторизованным пользователям --> |
288 | @include('modals.send_message_noaut') | 280 | @include('modals.send_message_noaut') |
289 | 281 | ||
290 | @include('modals.send_message_noaut2') | 282 | @include('modals.send_message_noaut2') |
291 | 283 | ||
292 | <!-- Форма авторизации --> | 284 | <!-- Форма авторизации --> |
293 | @include('modals.send_login') | 285 | @include('modals.send_login') |
294 | 286 | ||
295 | <!-- Сбросить пароль --> | 287 | <!-- Сбросить пароль --> |
296 | @include('modals.reset_password') | 288 | @include('modals.reset_password') |
297 | 289 | ||
298 | <!-- Регистрация --> | 290 | <!-- Регистрация --> |
299 | @include('modals.register') | 291 | @include('modals.register') |
300 | 292 | ||
301 | <!-- Благодарность по отправке сообщения работодателю --> | 293 | <!-- Благодарность по отправке сообщения работодателю --> |
302 | @include('modals.thank_you_send_employer') | 294 | @include('modals.thank_you_send_employer') |
303 | 295 | ||
304 | <!-- Благодарность по отправке сообщения менеджеру --> | 296 | <!-- Благодарность по отправке сообщения менеджеру --> |
305 | @include('modals.thank_you_send_manager') | 297 | @include('modals.thank_you_send_manager') |
306 | 298 | ||
307 | <!-- Благодарность после регистрации --> | 299 | <!-- Благодарность после регистрации --> |
308 | @include('modals.thank_you_send_for_employer') | 300 | @include('modals.thank_you_send_for_employer') |
309 | 301 | ||
310 | <!-- Благодарность после регистрации для работника --> | 302 | <!-- Благодарность после регистрации для работника --> |
311 | @include('modals.thank_you_send_for_worker') | 303 | @include('modals.thank_you_send_for_worker') |
312 | 304 | ||
313 | <!-- Подтверждение удаления профиля --> | 305 | <!-- Подтверждение удаления профиля --> |
314 | @include('modals.delete_profile') | 306 | @include('modals.delete_profile') |
315 | 307 | ||
316 | <!-- Подверждение об удалении профиля --> | 308 | <!-- Подверждение об удалении профиля --> |
317 | @include('modals.success_delete_profile') | 309 | @include('modals.success_delete_profile') |
318 | 310 | ||
319 | @include('modals.vacancy.ask_user_to_complete_profile') | ||
320 | @include('modals.vacancy.ask_for_resume_comment') | ||
321 | @include('modals.vacancy.add_comment') | 311 | @include('modals.vacancy.add_comment') |
312 | @include('modals.vacancy.ask_for_resume_comment') | ||
313 | @include('modals.vacancy.ask_user_to_complete_profile') | ||
314 | @include('modals.vacancy.favorite_noaut') | ||
315 | @include('modals.vacancy.send_response_no_comment') | ||
322 | @include('modals.vacancy.send_response_to_employer') | 316 | @include('modals.vacancy.send_response_to_employer') |
323 | @include('modals.vacancy.tell_user_to_complete_profile') | 317 | @include('modals.vacancy.tell_user_to_complete_profile') |
324 | @include('modals.vacancy.favorite_noaut') | ||
325 | 318 | ||
326 | </div> <!-- END MODALS WRAPPER --> | 319 | </div> <!-- END MODALS WRAPPER --> |
327 | 320 | ||
328 | 321 | ||
329 | <script src="{{ asset('js/jquery.maskedinput.js') }}"></script> | 322 | <script src="{{ asset('js/jquery.maskedinput.js') }}"></script> |
330 | <script src="{{ asset('js/jquery.fancybox.js') }}"></script> | 323 | <script src="{{ asset('js/jquery.fancybox.js') }}"></script> |
331 | <script src="{{ asset('js/jquery.select2.js') }}"></script> | 324 | <script src="{{ asset('js/jquery.select2.js') }}"></script> |
332 | <script src="{{ asset('js/swiper.js') }}"></script> | 325 | <script src="{{ asset('js/swiper.js') }}"></script> |
333 | <script src="{{ asset('js/script-vc.js') }}"></script> | 326 | <script src="{{ asset('js/script-vc.js') }}"></script> |
334 | <script src="{{ asset('js/star-rating.min.js') }}"></script> | 327 | <script src="{{ asset('js/star-rating.min.js') }}"></script> |
335 | <script> | 328 | <script> |
336 | var getUrlParameter = function getUrlParameter(sParam) { | 329 | var getUrlParameter = function getUrlParameter(sParam) { |
337 | var sPageURL = decodeURIComponent(window.location.search.substring(1)), | 330 | var sPageURL = decodeURIComponent(window.location.search.substring(1)), |
338 | sURLVariables = sPageURL.split('&'), | 331 | sURLVariables = sPageURL.split('&'), |
339 | sParameterName, | 332 | sParameterName, |
340 | i; | 333 | i; |
341 | for (i = 0; i < sURLVariables.length; i++) { | 334 | for (i = 0; i < sURLVariables.length; i++) { |
342 | sParameterName = sURLVariables[i].split('='); | 335 | sParameterName = sURLVariables[i].split('='); |
343 | if (sParameterName[0] === sParam) { | 336 | if (sParameterName[0] === sParam) { |
344 | return sParameterName[1] === undefined ? true : sParameterName[1]; | 337 | return sParameterName[1] === undefined ? true : sParameterName[1]; |
345 | } | 338 | } |
346 | } | 339 | } |
347 | }; | 340 | }; |
348 | 341 | ||
349 | $(function () { | 342 | $(function () { |
350 | var style_link = "{{ asset('css/cke_wysiwyg_frame_style.css') }}"; | 343 | var style_link = "{{ asset('css/cke_wysiwyg_frame_style.css') }}"; |
351 | var iterator = 0; | 344 | var iterator = 0; |
352 | var wysiwyg_style_interval = window.setInterval(function () { | 345 | var wysiwyg_style_interval = window.setInterval(function () { |
353 | var frame = $('.cke_wysiwyg_frame'); | 346 | var frame = $('.cke_wysiwyg_frame'); |
354 | frame.contents().find('head').append( | 347 | frame.contents().find('head').append( |
355 | $('<link rel="stylesheet" type="text/css" href="' + style_link + '">') | 348 | $('<link rel="stylesheet" type="text/css" href="' + style_link + '">') |
356 | ); | 349 | ); |
357 | if (frame.length || (++iterator == 6)) { | 350 | if (frame.length || (++iterator == 6)) { |
358 | clearInterval(wysiwyg_style_interval); | 351 | clearInterval(wysiwyg_style_interval); |
359 | } | 352 | } |
360 | }, 500); | 353 | }, 500); |
resources/views/layout/pdf.blade.php
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | <html lang="ru"> | 2 | <html lang="ru"> |
3 | 3 | ||
4 | @php | 4 | @php |
5 | $worker = $Query[0]; | 5 | $worker = $Query[0]; |
6 | @endphp | 6 | @endphp |
7 | 7 | ||
8 | <head> | 8 | <head> |
9 | <meta charset="utf-8"> | 9 | <meta charset="utf-8"> |
10 | <title>Резюме соискателя</title> | 10 | <title>Резюме соискателя</title> |
11 | <meta name="viewport" content="width=device-width,initial-scale=1"> | 11 | <meta name="viewport" content="width=device-width,initial-scale=1"> |
12 | <meta name="theme-color" content="#377D87"> | 12 | <meta name="theme-color" content="#377D87"> |
13 | <style> | 13 | <style> |
14 | body { | 14 | body { |
15 | font-family:'DejaVu Sans',sans-serif; | 15 | font-family:'DejaVu Sans',sans-serif; |
16 | background:#fff; | 16 | background:#fff; |
17 | font-size:1.6rem; | 17 | font-size:1.6rem; |
18 | font-weight:400; | 18 | font-weight:400; |
19 | color:#363A3F; | 19 | color:#363A3F; |
20 | } | 20 | } |
21 | 21 | ||
22 | .main { | 22 | .main { |
23 | padding: 30px 0; | 23 | padding: 30px 0; |
24 | } | 24 | } |
25 | 25 | ||
26 | .thing { | 26 | .thing { |
27 | color: #3a3b3c; | 27 | color: #3a3b3c; |
28 | } | 28 | } |
29 | 29 | ||
30 | .thing__profile-photo { | 30 | .thing__profile-photo { |
31 | width: 200px; | 31 | width: 200px; |
32 | border-radius: 8px; | 32 | border-radius: 8px; |
33 | float: left; | 33 | float: left; |
34 | margin-right: 20px; | 34 | margin-right: 20px; |
35 | } | 35 | } |
36 | 36 | ||
37 | .thing__title { | 37 | .thing__title { |
38 | width: 100%; | 38 | width: 100%; |
39 | font-size: 32px; | 39 | font-size: 32px; |
40 | font-weight: 700; | 40 | font-weight: 700; |
41 | line-height: 1.1; | 41 | line-height: 1.1; |
42 | margin: 0; | 42 | margin: 0; |
43 | } | 43 | } |
44 | 44 | ||
45 | .thing__text { | 45 | .thing__text { |
46 | font-size: 14px; | 46 | font-size: 14px; |
47 | line-height: 1.4; | 47 | line-height: 1.4; |
48 | margin: 15px 0 0 0; | 48 | margin: 15px 0 0 0; |
49 | } | 49 | } |
50 | 50 | ||
51 | .main__spoiler { | 51 | .main__spoiler { |
52 | margin: 0px 0px 32px 0px; | 52 | margin: 0px 0px 32px 0px; |
53 | } | 53 | } |
54 | 54 | ||
55 | .main__table { | 55 | .main__table { |
56 | border-collapse: collapse; | 56 | border-collapse: collapse; |
57 | table-layout: fixed; | 57 | table-layout: fixed; |
58 | font-size: 14px; | 58 | font-size: 14px; |
59 | width: 100%; | 59 | width: 100%; |
60 | background: #ffffff; | 60 | background: #ffffff; |
61 | } | 61 | } |
62 | 62 | ||
63 | .main__table thead { | 63 | .main__table thead { |
64 | color: #ffffff; | 64 | color: #ffffff; |
65 | font-size: 16px; | 65 | font-size: 16px; |
66 | background-color: #377d87; | 66 | background-color: #377d87; |
67 | } | 67 | } |
68 | 68 | ||
69 | .main__table th { | 69 | .main__table th { |
70 | padding: 8px 16px; | 70 | padding: 8px 16px; |
71 | } | 71 | } |
72 | 72 | ||
73 | .main__table td { | 73 | .main__table td { |
74 | width: 40%; | 74 | width: 40%; |
75 | padding: 8px 16px; | 75 | padding: 8px 16px; |
76 | border: 1px solid #cecece; | 76 | border: 1px solid #cecece; |
77 | } | 77 | } |
78 | 78 | ||
79 | .main__table td b { | 79 | .main__table td b { |
80 | font-weight: 700; | 80 | font-weight: 700; |
81 | } | 81 | } |
82 | 82 | ||
83 | .main__table b { | 83 | .main__table b { |
84 | display: block; | 84 | display: block; |
85 | } | 85 | } |
86 | 86 | ||
87 | .main__table a { | 87 | .main__table a { |
88 | color: #377d87; | 88 | color: #377d87; |
89 | text-decoration: underline; | 89 | text-decoration: underline; |
90 | } | 90 | } |
91 | 91 | ||
92 | .main__table td + td { | 92 | .main__table td + td { |
93 | width: 60%; | 93 | width: 60%; |
94 | } | 94 | } |
95 | 95 | ||
96 | .main__table_three td { | 96 | .main__table_three td { |
97 | width: 25% !important; | 97 | width: 25% !important; |
98 | } | 98 | } |
99 | 99 | ||
100 | .main__table_experience td { | 100 | .main__table_experience td { |
101 | width: 5%; | 101 | width: 5%; |
102 | hyphens: auto; | 102 | hyphens: auto; |
103 | overflow: hidden; | 103 | overflow: hidden; |
104 | } | 104 | } |
105 | .main__table_experience td:first-child { | 105 | .main__table_experience td:first-child { |
106 | width: 80%; | 106 | width: 80%; |
107 | } | 107 | } |
108 | 108 | ||
109 | .main__table_three td:last-child { | 109 | .main__table_three td:last-child { |
110 | width: 50% !important; | 110 | width: 50% !important; |
111 | } | 111 | } |
112 | 112 | ||
113 | .main h2 { | 113 | .main h2 { |
114 | margin: 0; | 114 | margin: 0; |
115 | font-weight: 700; | 115 | font-weight: 700; |
116 | font-size: 30px; | 116 | font-size: 30px; |
117 | } | 117 | } |
118 | 118 | ||
119 | .main p { | 119 | .main p { |
120 | margin: 0; | 120 | margin: 0; |
121 | font-size: 14px; | 121 | font-size: 14px; |
122 | line-height: 1.4; | 122 | line-height: 1.4; |
123 | margin: 15px 0 0 0; | 123 | margin: 15px 0 0 0; |
124 | } | 124 | } |
125 | 125 | ||
126 | .main__resume-profile-info-body-inner li { | 126 | .main__resume-profile-info-body-inner li { |
127 | list-style-type: none; | 127 | list-style-type: none; |
128 | margin: 0px 0px 20px 0px; | 128 | margin: 0px 0px 20px 0px; |
129 | } | 129 | } |
130 | 130 | ||
131 | .main__resume-profile-info-body-inner b { | 131 | .main__resume-profile-info-body-inner b { |
132 | display: block; | 132 | display: block; |
133 | margin: 0px 0px 6px 0px; | 133 | margin: 0px 0px 6px 0px; |
134 | color: #377d87; | 134 | color: #377d87; |
135 | font-size: 14px; | 135 | font-size: 14px; |
136 | } | 136 | } |
137 | 137 | ||
138 | .main__resume-profile-info-body-inner span { | 138 | .main__resume-profile-info-body-inner span { |
139 | display: block; | 139 | display: block; |
140 | } | 140 | } |
141 | 141 | ||
142 | .main__resume-profile-info-body-inner a { | 142 | .main__resume-profile-info-body-inner a { |
143 | display: block; | 143 | display: block; |
144 | text-decoration: none; | 144 | text-decoration: none; |
145 | color: inherit; | 145 | color: inherit; |
146 | } | 146 | } |
147 | 147 | ||
148 | </style> | 148 | </style> |
149 | </head> | 149 | </head> |
150 | 150 | ||
151 | <body id="body" class="pdf"> | 151 | <body id="body" class="pdf"> |
152 | <section class="thing thing_pdf"> | 152 | <section class="thing thing_pdf"> |
153 | <div class="container"> | 153 | <div class="container"> |
154 | <div class="thing__profile"> | 154 | <div class="thing__profile"> |
155 | @if (!empty($Query[0]['photo'])) | 155 | @if (!empty($Query[0]['photo'])) |
156 | <img src="{{ asset(Storage::url($Query[0]['photo'])) }}" alt="" class="thing__profile-photo"> | 156 | <img src="{{ asset(Storage::url($Query[0]['photo'])) }}" alt="" class="thing__profile-photo"> |
157 | @else | 157 | @else |
158 | <img src="{{ asset('images/default_man.jpg') }}" alt="" class="thing__profile-photo"> | 158 | <img src="{{ asset('images/default_man.jpg') }}" alt="" class="thing__profile-photo"> |
159 | @endif | 159 | @endif |
160 | <div class="thing__profile-body"> | 160 | <div class="thing__profile-body"> |
161 | <h1 class="thing__title">{{ $Query[0]['users']['surname']." ".$Query[0]['users']['name_man']." ".$Query[0]['users']['surname2'] }}</h1> | 161 | <h1 class="thing__title">{{ $Query[0]['users']['surname']." ".$Query[0]['users']['name_man']." ".$Query[0]['users']['surname2'] }}</h1> |
162 | <div style="clear:both;"></div> | 162 | <div style="clear:both;"></div> |
163 | <p class="thing__text">{{ $Query[0]['text'] }}</p> | 163 | <p class="thing__text">{{ $Query[0]['text'] }}</p> |
164 | </div> | 164 | </div> |
165 | </div> | 165 | </div> |
166 | @if (!empty($Query[0]['users']['file'])) | 166 | @if (!empty($Query[0]['users']['file'])) |
167 | <a href="{{ asset(Storage::url($Query[0]['users']['file'])) }}">Анкета-файл</a> | 167 | <a href="{{ asset(Storage::url($Query[0]['users']['file'])) }}">Анкета-файл</a> |
168 | @endif | 168 | @endif |
169 | </div> | 169 | </div> |
170 | </section> | 170 | </section> |
171 | <main class="main"> | 171 | <main class="main"> |
172 | <div class="container"> | 172 | <div class="container"> |
173 | <div class="main__resume-profile"> | 173 | <div class="main__resume-profile"> |
174 | <div class="main__content"> | 174 | <div class="main__content"> |
175 | <div class="main__spoiler"> | 175 | <div class="main__spoiler"> |
176 | <div class="main__spoiler-body"> | 176 | <div class="main__spoiler-body"> |
177 | <table class="main__table"> | 177 | <table class="main__table"> |
178 | <thead> | 178 | <thead> |
179 | <tr> | 179 | <tr> |
180 | <th colspan="2">Основная информация</th> | 180 | <th colspan="2">Основная информация</th> |
181 | </tr> | 181 | </tr> |
182 | </thead> | 182 | </thead> |
183 | <tbody> | 183 | <tbody> |
184 | <tr> | 184 | <tr> |
185 | <td><b>Статус:</b></td> | 185 | <td><b>Статус:</b></td> |
186 | <td>{{ $status_work[$worker->status_work] }}</td> | 186 | <td>{{ $status_work[$worker->status_work] }}</td> |
187 | </tr> | 187 | </tr> |
188 | <tr> | 188 | <tr> |
189 | <td><b>ФИО:</b></td> | 189 | <td><b>ФИО:</b></td> |
190 | <td>{{ $worker->users->surname." ".$worker->users->name_man." ".$worker->users->surname2 }}</td> | 190 | <td>{{ $worker->users->surname." ".$worker->users->name_man." ".$worker->users->surname2 }}</td> |
191 | </tr> | 191 | </tr> |
192 | <tr> | 192 | <tr> |
193 | <td><b>Возраст:</b></td> | 193 | <td><b>Возраст:</b></td> |
194 | <td>{{ $worker->old_year ?? '-' }}</td> | 194 | <td>{{ $worker->old_year ?? '-' }}</td> |
195 | </tr> | 195 | </tr> |
196 | <tr> | 196 | <tr> |
197 | <td><b>Желаемые вакансии:</b></td> | 197 | <td><b>Желаемые вакансии:</b></td> |
198 | <td> | 198 | <td> |
199 | @if ($Query[0]->job_titles->count()) | 199 | @if ($Query[0]->job_titles->count()) |
200 | @foreach ($Query[0]->job_titles as $it) | 200 | @foreach ($Query[0]->job_titles as $it) |
201 | @if ($it->is_remove == 0) | 201 | @if ($it->is_remove == 0) |
202 | {{ $it->name }} / | 202 | {{ $it->name }} / |
203 | @endif | 203 | @endif |
204 | @endforeach | 204 | @endforeach |
205 | @else | 205 | @else |
206 | - | 206 | - |
207 | @endif | 207 | @endif |
208 | </td> | 208 | </td> |
209 | </tr> | 209 | </tr> |
210 | <tr> | 210 | <tr> |
211 | <td><b>Пожелания по З/П:</b></td> | 211 | <td><b>Пожелания по З/П:</b></td> |
212 | <td>{{ $worker->salary_expectations ?? '-' }}</td> | 212 | <td>{{ $worker->salary_expectations ?? '-' }}</td> |
213 | </tr> | 213 | </tr> |
214 | <tr> | 214 | <tr> |
215 | <td><b>Опыт работы:</b></td> | 215 | <td><b>Опыт работы:</b></td> |
216 | <td>{{ $worker->experience ?? '-' }}</td> | 216 | <td>{{ $worker->experience ?? '-' }}</td> |
217 | </tr> | 217 | </tr> |
218 | <tr> | 218 | <tr> |
219 | <td><b>Уровень английского:</b></td> | 219 | <td><b>Уровень английского:</b></td> |
220 | <td>{{ $worker->english_level ?? '-' }}</td> | 220 | <td>{{ $worker->english_level ?? '-' }}</td> |
221 | </tr> | 221 | </tr> |
222 | <tr> | 222 | <tr> |
223 | <td><b>Дата готовности к посадке:</b></td> | 223 | <td><b>Дата готовности к посадке:</b></td> |
224 | <td>{{ $worker->ready_boart_date ?? '-' }}</td> | 224 | <td>{{ $worker->ready_boart_date ?? '-' }}</td> |
225 | </tr> | 225 | </tr> |
226 | <tr> | 226 | <tr> |
227 | <td><b>Предпочтение по типу судна:</b></td> | 227 | <td><b>Предпочтение по типу судна:</b></td> |
228 | <td>{{ $worker->boart_type_preference ?? '-' }}</td> | 228 | <td>{{ $worker->boart_type_preference ?? '-' }}</td> |
229 | </tr> | 229 | </tr> |
230 | <tr> | 230 | <tr> |
231 | <td><b>Наличие визы:</b></td> | 231 | <td><b>Наличие визы:</b></td> |
232 | <td>{{ $worker->visa_available ?? '-' }}</td> | 232 | <td>{{ $worker->visa_available ?? '-' }}</td> |
233 | </tr> | 233 | </tr> |
234 | <tr> | 234 | <tr> |
235 | <td><b>Наличие танкерных документов:</b></td> | 235 | <td><b>Наличие танкерных документов:</b></td> |
236 | <td>{{ $worker->tanker_documents_available ?? '-' }}</td> | 236 | <td>{{ $worker->tanker_documents_available ?? '-' }}</td> |
237 | </tr> | 237 | </tr> |
238 | <tr> | 238 | <tr> |
239 | <td><b>Наличие подтверждения для работы на ВВП:</b></td> | 239 | <td><b>Наличие подтверждения для работы на ВВП:</b></td> |
240 | <td>{{ $worker->confirmation_work_for_vvp ?? '-' }}</td> | 240 | <td>{{ $worker->confirmation_work_for_vvp ?? '-' }}</td> |
241 | </tr> | 241 | </tr> |
242 | <tr> | 242 | <tr> |
243 | <td><b>Наличие военного билета / приписного свидетельства:</b></td> | 243 | <td><b>Наличие военного билета / приписного свидетельства:</b></td> |
244 | <td>{{ $worker->military_id_available ?? '-' }}</td> | 244 | <td>{{ $worker->military_id_available ?? '-' }}</td> |
245 | </tr> | 245 | </tr> |
246 | <tr> | 246 | <tr> |
247 | <td><b>Город проживания:</b></td> | 247 | <td><b>Город проживания:</b></td> |
248 | <td>{{ $worker->city ?? '-' }}</td> | 248 | <td>{{ $worker->city ?? '-' }}</td> |
249 | </tr> | 249 | </tr> |
250 | <tr> | 250 | <tr> |
251 | <td><b>Телефон:</b></td> | 251 | <td><b>Телефон:</b></td> |
252 | <td>{{ $worker->telephone ?? '-' }}</td> | 252 | <td>{{ $worker->telephone ?? '-' }}</td> |
253 | </tr> | 253 | </tr> |
254 | <tr> | 254 | <tr> |
255 | <td><b>E-mail:</b></td> | 255 | <td><b>E-mail:</b></td> |
256 | <td>{{ $worker->email ?? '-' }}</td> | 256 | <td>{{ $worker->email ?? '-' }}</td> |
257 | </tr> | 257 | </tr> |
258 | <tr> | 258 | <tr> |
259 | <td><b>Контакты родственников:</b></td> | 259 | <td><b>Контакты родственников:</b></td> |
260 | <td>{{ $worker->telephone2 ?? '-' }}</td> | 260 | <td>{{ $worker->telephone2 ?? '-' }}</td> |
261 | </tr> | 261 | </tr> |
262 | </tbody> | 262 | </tbody> |
263 | </table> | 263 | </table> |
264 | </div> | 264 | </div> |
265 | </div> | 265 | </div> |
266 | 266 | ||
267 | <div class="main__spoiler"> | 267 | <div class="main__spoiler"> |
268 | <div class="main__spoiler-body"> | 268 | <div class="main__spoiler-body"> |
269 | <table class="main__table"> | 269 | <table class="main__table"> |
270 | <thead> | 270 | <thead> |
271 | <tr> | 271 | <tr> |
272 | <th colspan="2">Сертификаты / документы</th> | 272 | <th colspan="2">Сертификаты / документы</th> |
273 | </tr> | 273 | </tr> |
274 | </thead> | 274 | </thead> |
275 | <tbody> | 275 | <tbody> |
276 | <tr> | 276 | <tr> |
277 | <td><b>Название сертификата:</b></td> | 277 | <td><b>Название сертификата:</b></td> |
278 | <td><b>Действителен до:</b></td> | 278 | <td><b>Действителен до:</b></td> |
279 | </tr> | 279 | </tr> |
280 | @if (isset($Query[0]->sertificate) && $Query[0]->sertificate->count()) | 280 | @if (isset($Query[0]->sertificate) && $Query[0]->sertificate->count()) |
281 | @foreach($Query[0]->sertificate as $it) | 281 | @foreach($Query[0]->sertificate as $it) |
282 | <tr> | 282 | <tr> |
283 | <td>{{ $it->name }}</td> | 283 | <td>{{ $it->name }}</td> |
284 | <td>{{ date('d.m.Y', strtotime($it->end_begin)) }}</td> | 284 | <td>{{ date('d.m.Y', strtotime($it->end_begin)) }}</td> |
285 | </tr> | 285 | </tr> |
286 | @endforeach | 286 | @endforeach |
287 | @else | 287 | @else |
288 | <tr> | 288 | <tr> |
289 | <td> - </td> | 289 | <td> - </td> |
290 | <td> - </td> | 290 | <td> - </td> |
291 | </tr> | 291 | </tr> |
292 | @endif | 292 | @endif |
293 | </tbody> | 293 | </tbody> |
294 | </table> | 294 | </table> |
295 | </div> | 295 | </div> |
296 | </div> | 296 | </div> |
297 | 297 | ||
298 | <div class="main__spoiler"> | 298 | <div class="main__spoiler"> |
299 | <div class="main__spoiler-body"> | 299 | <div class="main__spoiler-body"> |
300 | <table class="main__table"> | 300 | <table class="main__table"> |
301 | <thead> | 301 | <thead> |
302 | <tr> | 302 | <tr> |
303 | <th colspan="2">Дополнительные документы</th> | 303 | <th colspan="2">Дополнительные документы</th> |
304 | </tr> | 304 | </tr> |
305 | </thead> | 305 | </thead> |
306 | <tbody> | 306 | <tbody> |
307 | @if ($infoblocks->count()) | 307 | @if ($infoblocks->count()) |
308 | @foreach ($infoblocks as $info) | 308 | @foreach ($infoblocks as $info) |
309 | @php $finder = false; @endphp | 309 | @php $finder = false; @endphp |
310 | @if (isset($Query[0]->infobloks)) | 310 | @if (isset($Query[0]->infobloks)) |
311 | @if ($Query[0]->infobloks->count()) | 311 | @if ($Query[0]->infobloks->count()) |
312 | 312 | ||
313 | @foreach($Query[0]->infobloks as $it) | 313 | @foreach($Query[0]->infobloks as $it) |
314 | @if ($info->id == $it->id) | 314 | @if ($info->id == $it->id) |
315 | <tr> | 315 | <tr> |
316 | <td><b>{{ $it->name }}</b></td> | 316 | <td><b>{{ $it->name }}</b></td> |
317 | <td> | 317 | <td> |
318 | @if ($it->model_dop_info[0]->status == 0) Не указано | 318 | @if ($it->pivot->status == 0) Не указано |
319 | @elseif($it->model_dop_info[0]->status==1) В наличии | 319 | @elseif($it->pivot->status==1) В наличии |
320 | @else Отсутствует | 320 | @else Отсутствует |
321 | @endif | 321 | @endif |
322 | </td> | 322 | </td> |
323 | </tr> | 323 | </tr> |
324 | @php $finder = true; @endphp | 324 | @php $finder = true; @endphp |
325 | @endif | 325 | @endif |
326 | @endforeach | 326 | @endforeach |
327 | @endif | 327 | @endif |
328 | @endif | 328 | @endif |
329 | @if (!$finder) | 329 | @if (!$finder) |
330 | <tr> | 330 | <tr> |
331 | <td><b>{{ $info->name }}</b></td> | 331 | <td><b>{{ $info->name }}</b></td> |
332 | <td> | 332 | <td> |
333 | Не указано | 333 | Не указано |
334 | </td> | 334 | </td> |
335 | </tr> | 335 | </tr> |
336 | @endif | 336 | @endif |
337 | @endforeach | 337 | @endforeach |
338 | @endif | 338 | @endif |
339 | </tbody> | 339 | </tbody> |
340 | </table> | 340 | </table> |
341 | </div> | 341 | </div> |
342 | </div> | 342 | </div> |
343 | 343 | ||
344 | <div class="main__spoiler"> | 344 | <div class="main__spoiler"> |
345 | <div class="main__spoiler-body"> | 345 | <div class="main__spoiler-body"> |
346 | <table class="main__table main__table_experience"> | 346 | <table class="main__table main__table_experience"> |
347 | <thead> | 347 | <thead> |
348 | <tr> | 348 | <tr> |
349 | <th colspan="8">Опыт работы</th> | 349 | <th colspan="8">Опыт работы</th> |
350 | </tr> | 350 | </tr> |
351 | </thead> | 351 | </thead> |
352 | <tbody> | 352 | <tbody> |
353 | <tr> | 353 | <tr> |
354 | <td><b>Должность</b></td> | 354 | <td><b>Должность</b></td> |
355 | <td><b>Название т/х</b></td> | 355 | <td><b>Название т/х</b></td> |
356 | <td><b>Тип судна</b></td> | 356 | <td><b>Тип судна</b></td> |
357 | <td><b>Марка ГД</b></td> | 357 | <td><b>Марка ГД</b></td> |
358 | <td><b>Мощность ГД (кВТ)</b></td> | 358 | <td><b>Мощность ГД (кВТ)</b></td> |
359 | <td><b>Водо- измещение (DWT)</b></td> | 359 | <td><b>Водо- измещение (DWT)</b></td> |
360 | <td><b>Название компании</b></td> | 360 | <td><b>Название компании</b></td> |
361 | <td><b>Начало и окончание контракта</b></td> | 361 | <td><b>Начало и окончание контракта</b></td> |
362 | </tr> | 362 | </tr> |
363 | @if (count($Query[0]->place_worker) > 0) | 363 | @if (count($Query[0]->place_worker) > 0) |
364 | @foreach($Query[0]->place_worker as $it) | 364 | @foreach($Query[0]->place_worker as $it) |
365 | <tr> | 365 | <tr> |
366 | <td>{{ $it->job_title }}</td> | 366 | <td>{{ $it->job_title }}</td> |
367 | <td>{{ $it->teplohod }}</td> | 367 | <td>{{ $it->teplohod }}</td> |
368 | <td>{{ $it->GWT }}</td> | 368 | <td>{{ $it->GWT }}</td> |
369 | <td>{{ $it->Marka_GD }}</td> | 369 | <td>{{ $it->Marka_GD }}</td> |
370 | <td>{{ $it->KBT }}</td> | 370 | <td>{{ $it->KBT }}</td> |
371 | <td>{{ $it->GRT }}</td> | 371 | <td>{{ $it->GRT }}</td> |
372 | <td>{{ $it->name_company }}</td> | 372 | <td>{{ $it->name_company }}</td> |
373 | <td> | 373 | <td> |
374 | {{ date('d.m.Y', strtotime($it->begin_work)) }} | 374 | {{ date('d.m.Y', strtotime($it->begin_work)) }} |
375 | - | 375 | - |
376 | {{ date('d.m.Y', strtotime($it->end_work)) }} | 376 | {{ date('d.m.Y', strtotime($it->end_work)) }} |
377 | </td> | 377 | </td> |
378 | </tr> | 378 | </tr> |
379 | @endforeach | 379 | @endforeach |
380 | @else | 380 | @else |
381 | <td>-</td> | 381 | <td>-</td> |
382 | <td>-</td> | 382 | <td>-</td> |
383 | <td>-</td> | 383 | <td>-</td> |
384 | <td>-</td> | 384 | <td>-</td> |
385 | <td>-</td> | 385 | <td>-</td> |
386 | <td>-</td> | 386 | <td>-</td> |
387 | <td>-</td> | 387 | <td>-</td> |
388 | <td>-</td> | 388 | <td>-</td> |
389 | @endif | 389 | @endif |
390 | </tbody> | 390 | </tbody> |
391 | </table> | 391 | </table> |
392 | </div> | 392 | </div> |
393 | </div> | 393 | </div> |
394 | 394 | ||
395 | <div class="main__spoiler"> | 395 | <div class="main__spoiler"> |
396 | <div class="main__spoiler-body"> | 396 | <div class="main__spoiler-body"> |
397 | <table class="main__table main__table_three"> | 397 | <table class="main__table main__table_three"> |
398 | <thead> | 398 | <thead> |
399 | <tr> | 399 | <tr> |
400 | <th colspan="4">Данные о прошлых компаниях</th> | 400 | <th colspan="4">Данные о прошлых компаниях</th> |
401 | </tr> | 401 | </tr> |
402 | </thead> | 402 | </thead> |
403 | <tbody> | 403 | <tbody> |
404 | <tr> | 404 | <tr> |
405 | <td><b>Название компании</b></td> | 405 | <td><b>Название компании</b></td> |
406 | <td><b>ФИО сотрудника</b></td> | 406 | <td><b>ФИО сотрудника</b></td> |
407 | <td><b>Должность сотрудника</b></td> | 407 | <td><b>Должность сотрудника</b></td> |
408 | <td><b>Телефон сотрудника</b></td> | 408 | <td><b>Телефон сотрудника</b></td> |
409 | </tr> | 409 | </tr> |
410 | @if ((isset($worker->prev_company)) && ($worker->prev_company->count())) | 410 | @if ((isset($worker->prev_company)) && ($worker->prev_company->count())) |
411 | @foreach ($worker->prev_company as $prev_company) | 411 | @foreach ($worker->prev_company as $prev_company) |
412 | <tr> | 412 | <tr> |
413 | <td>{{ $prev_company->name_company }}</td> | 413 | <td>{{ $prev_company->name_company }}</td> |
414 | <td>{{ $prev_company->direct }}</td> | 414 | <td>{{ $prev_company->direct }}</td> |
415 | <td>{{ $prev_company->telephone }}</td> | 415 | <td>{{ $prev_company->telephone }}</td> |
416 | <td>{{ $prev_company->telephone2 }}</td> | 416 | <td>{{ $prev_company->telephone2 }}</td> |
417 | </tr> | 417 | </tr> |
418 | @endforeach | 418 | @endforeach |
419 | @else | 419 | @else |
420 | <tr> | 420 | <tr> |
421 | <td>-</td> | 421 | <td>-</td> |
422 | <td>-</td> | 422 | <td>-</td> |
423 | <td>-</td> | 423 | <td>-</td> |
424 | <td>-</td> | 424 | <td>-</td> |
425 | </tr> | 425 | </tr> |
426 | @endif | 426 | @endif |
427 | </tbody> | 427 | </tbody> |
428 | </table> | 428 | </table> |
429 | </div> | 429 | </div> |
430 | </div> | 430 | </div> |
431 | </div> | 431 | </div> |
432 | </div> | 432 | </div> |
433 | </div> | 433 | </div> |
434 | </main> | 434 | </main> |
435 | </body> | 435 | </body> |
436 | </html> | 436 | </html> |
437 | 437 |
resources/views/list_vacancies.blade.php
1 | @php | 1 | @php |
2 | use App\Classes\StatusUser; | 2 | use App\Classes\StatusUser; |
3 | @endphp | 3 | @endphp |
4 | 4 | ||
5 | @extends('layout.frontend', ['title' => 'Вакансии РекаМоре']) | 5 | @extends('layout.frontend', ['title' => 'Вакансии РекаМоре']) |
6 | 6 | ||
7 | @section('scripts') | 7 | @section('scripts') |
8 | <script> | 8 | <script> |
9 | $(document).on('change', '#jobs', function() { | 9 | $(document).on('change', '#jobs', function() { |
10 | var val = $(this).val(); | 10 | var val = $(this).val(); |
11 | var main_oskar = $('#main_ockar'); | 11 | var main_oskar = $('#main_ockar'); |
12 | var ti_head = $('#title_head'); | 12 | var ti_head = $('#title_head'); |
13 | 13 | ||
14 | console.log(val); | 14 | console.log(val); |
15 | 15 | ||
16 | $.ajax({ | 16 | $.ajax({ |
17 | type: "GET", | 17 | type: "GET", |
18 | url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", | 18 | url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", |
19 | data: "job="+val, | 19 | data: "job="+val, |
20 | success: function (data) { | 20 | success: function (data) { |
21 | main_oskar.html(data); | 21 | main_oskar.html(data); |
22 | history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?job="+val+"@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); | 22 | history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?job="+val+"@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); |
23 | }, | 23 | }, |
24 | headers: { | 24 | headers: { |
25 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 25 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
26 | }, | 26 | }, |
27 | error: function (data) { | 27 | error: function (data) { |
28 | data = JSON.stringify(data); | 28 | data = JSON.stringify(data); |
29 | console.log('Error: ' + data); | 29 | console.log('Error: ' + data); |
30 | } | 30 | } |
31 | }); | 31 | }); |
32 | 32 | ||
33 | if ((val == '') || (val == '0')) { | 33 | if ((val == '') || (val == '0')) { |
34 | title_head.html('Все категории'); | 34 | title_head.html('Все категории'); |
35 | } else { | 35 | } else { |
36 | $.ajax({ | 36 | $.ajax({ |
37 | type: "GET", | 37 | type: "GET", |
38 | url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}?@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif", | 38 | url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}?@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif", |
39 | data: "job=" + val +"&title=1", | 39 | data: "job=" + val +"&title=1", |
40 | success: function (data) { | 40 | success: function (data) { |
41 | }, | 41 | }, |
42 | 42 | ||
43 | headers: { | 43 | headers: { |
44 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 44 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
45 | }, | 45 | }, |
46 | 46 | ||
47 | error: function (data) { | 47 | error: function (data) { |
48 | data = JSON.stringify(data); | 48 | data = JSON.stringify(data); |
49 | console.log('Error: ' + data); | 49 | console.log('Error: ' + data); |
50 | } | 50 | } |
51 | }); | 51 | }); |
52 | } | 52 | } |
53 | }); | 53 | }); |
54 | 54 | ||
55 | $(document).on('click', '.ask_comment', function() { | 55 | $(document).on('click', '.ask_comment', function() { |
56 | var this_ = $(this); | 56 | var this_ = $(this); |
57 | 57 | ||
58 | $('#modal_user_id').val(this_.attr('data-uid')); | 58 | $('#modal_user_id').val(this_.attr('data-uid')); |
59 | $('#modal_to_user_id').val(this_.attr('data-tuid')); | 59 | $('#modal_to_user_id').val(this_.attr('data-tuid')); |
60 | $('#modal_vacancy').val(this_.attr('data-vacancy')); | 60 | $('#modal_vacancy').val(this_.attr('data-vacancy')); |
61 | }); | 61 | }); |
62 | 62 | ||
63 | $(document).on('click', '.ask_percent', function() { | 63 | $(document).on('click', '.ask_percent', function() { |
64 | $('#modal_vacancy') | 64 | $('#modal_vacancy') |
65 | .val($(this).attr('data-vacancy')) | 65 | .val($(this).attr('data-vacancy')) |
66 | .trigger('change'); | 66 | .trigger('change'); |
67 | }); | 67 | }); |
68 | 68 | ||
69 | $(document).on('change', '#sort_ajax', function() { | 69 | $(document).on('change', '#sort_ajax', function() { |
70 | var this_ = $(this); | 70 | var this_ = $(this); |
71 | var val_ = this_.val(); | 71 | var val_ = this_.val(); |
72 | 72 | ||
73 | $.ajax({ | 73 | $.ajax({ |
74 | type: "GET", | 74 | type: "GET", |
75 | url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", | 75 | url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", |
76 | data: "sort="+val_+"&block=1", | 76 | data: "sort="+val_+"&block=1", |
77 | success: function (data) { | 77 | success: function (data) { |
78 | $('#main_ockar').html(data); | 78 | $('#main_ockar').html(data); |
79 | history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?sort="+val_+"@if (isset($_GET['job']))&job={{ $_GET['job'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); | 79 | history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?sort="+val_+"@if (isset($_GET['job']))&job={{ $_GET['job'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); |
80 | }, | 80 | }, |
81 | headers: { | 81 | headers: { |
82 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 82 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
83 | }, | 83 | }, |
84 | error: function (data) { | 84 | error: function (data) { |
85 | data = JSON.stringify(data); | 85 | data = JSON.stringify(data); |
86 | console.log('Error: ' + data); | 86 | console.log('Error: ' + data); |
87 | } | 87 | } |
88 | }); | 88 | }); |
89 | }); | 89 | }); |
90 | 90 | ||
91 | $(document).ready(function(){ | 91 | $(document).ready(function(){ |
92 | var sel = $('#select2-sort_ajax-container'); | 92 | var sel = $('#select2-sort_ajax-container'); |
93 | var key = getUrlParameter('sort'); | 93 | var key = getUrlParameter('sort'); |
94 | 94 | ||
95 | if (key !=='') { | 95 | if (key !=='') { |
96 | switch (key) { | 96 | switch (key) { |
97 | case "default": sel.html('Сортировка (по умолчанию)'); break; | 97 | case "default": sel.html('Сортировка (по умолчанию)'); break; |
98 | case "name_up": sel.html('По имени (возрастание)'); break; | 98 | case "name_up": sel.html('По имени (возрастание)'); break; |
99 | case "name_down": sel.html('По дате (убывание)'); break; | 99 | case "name_down": sel.html('По дате (убывание)'); break; |
100 | case "created_at_up": sel.html('По дате (возрастание)'); break; | 100 | case "created_at_up": sel.html('По дате (возрастание)'); break; |
101 | case "created_at_down": sel.html('По дате (убывание)'); break; | 101 | case "created_at_down": sel.html('По дате (убывание)'); break; |
102 | } | 102 | } |
103 | 103 | ||
104 | } | 104 | } |
105 | }); | 105 | }); |
106 | </script> | 106 | </script> |
107 | @include('js.favorite-vacancy-45') | 107 | @include('js.favorite-vacancy-45') |
108 | @endsection | 108 | @endsection |
109 | @section('content') | 109 | @section('content') |
110 | <section class="thing"> | 110 | <section class="thing"> |
111 | <div class="container"> | 111 | <div class="container"> |
112 | <form class="thing__body" action="{{ route('list-vacancies', ['categories' => (!empty($Name_categori)) ? $Name_categori[0]->id : '0']) }}" method="POST"> | 112 | <form class="thing__body" action="{{ route('list-vacancies', ['categories' => (!empty($Name_categori)) ? $Name_categori[0]->id : '0']) }}" method="POST"> |
113 | <ul class="breadcrumbs thing__breadcrumbs"> | 113 | <ul class="breadcrumbs thing__breadcrumbs"> |
114 | <li><a href="{{ route('index') }}">Главная</a></li> | 114 | <li><a href="{{ route('index') }}">Главная</a></li> |
115 | <li><a href="{{ route('vacancies') }}">Вакансии</a></li> | 115 | <li><a href="{{ route('vacancies') }}">Вакансии</a></li> |
116 | <li><b>{{ isset($Name_categori[0]) ? $Name_categori[0]->name : 'Все категории' }}</b></li> | 116 | <li><b>{{ isset($Name_categori[0]) ? $Name_categori[0]->name : 'Все категории' }}</b></li> |
117 | </ul> | 117 | </ul> |
118 | <h1 class="thing__title">Вакансии</h1> | 118 | <h1 class="thing__title">Вакансии</h1> |
119 | <p class="thing__text"> | 119 | <p class="thing__text"> |
120 | Для удобного и быстрого поиска по определенной должности воспользуйтесь фильтром. В выпадающем списке выберите должность. | 120 | Для удобного и быстрого поиска по определенной должности воспользуйтесь фильтром. В выпадающем списке выберите должность. |
121 | </p> | 121 | </p> |
122 | <div class="select select_search thing__select"> | 122 | <div class="select select_search thing__select"> |
123 | <div class="select__icon"> | 123 | <div class="select__icon"> |
124 | <svg> | 124 | <svg> |
125 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> | 125 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> |
126 | </svg> | 126 | </svg> |
127 | </div> | 127 | </div> |
128 | <select class="js-select2" id="jobs" name="jobs"> | 128 | <select class="js-select2" id="jobs" name="jobs"> |
129 | <option value="0" selected>Выберите должность</option> | 129 | <option value="0" selected>Выберите должность</option> |
130 | @if ($Job_title->count()) | 130 | @if ($Job_title->count()) |
131 | @foreach($Job_title as $JT) | 131 | @foreach($Job_title as $JT) |
132 | <option value="{{ $JT->id }}" @if(isset($_GET['job']) && ($_GET['job'] == $JT->id)) selected @endif>{{ $JT->name }}</option> | 132 | <option value="{{ $JT->id }}" @if(isset($_GET['job']) && ($_GET['job'] == $JT->id)) selected @endif>{{ $JT->name }}</option> |
133 | @endforeach | 133 | @endforeach |
134 | @endif | 134 | @endif |
135 | </select> | 135 | </select> |
136 | </div> | 136 | </div> |
137 | </form> | 137 | </form> |
138 | </div> | 138 | </div> |
139 | </section> | 139 | </section> |
140 | <main class="main"> | 140 | <main class="main"> |
141 | <div class="container"> | 141 | <div class="container"> |
142 | <div class="main__vacancies" > | 142 | <div class="main__vacancies" > |
143 | @if (isset($Name_categori) && ($Name_categori !== '')) | 143 | @if (isset($Name_categori) && ($Name_categori !== '')) |
144 | <h2 class="main__vacancies-title">Категория вакансий {{ $Name_categori }}</h2> | 144 | <h2 class="main__vacancies-title">Категория вакансий {{ $Name_categori }}</h2> |
145 | @else | 145 | @else |
146 | <h2 class="main__vacancies-title" id="title_head" name="title_head">Все категории</h2> | 146 | <h2 class="main__vacancies-title" id="title_head" name="title_head">Все категории</h2> |
147 | @endif | 147 | @endif |
148 | <div class="filters main__vacancies-filters"> | 148 | <div class="filters main__vacancies-filters"> |
149 | <div class="filters__label" | 149 | <div class="filters__label" |
150 | id="col-vo" | 150 | id="col-vo" |
151 | name="col-vo" | 151 | name="col-vo" |
152 | > | 152 | > |
153 | Показано <span id="firstItem">{{ $Query->firstItem() }}</span> – <span id="lastItem">{{ $Query->lastItem() }}</span> из <span id="Query_count">@isset($Query_count) {{ $Query_count }} @else 0 @endisset</span> результатов поиска | 153 | Показано <span id="firstItem">{{ $Query->firstItem() }}</span> – <span id="lastItem">{{ $Query->lastItem() }}</span> из <span id="Query_count">@isset($Query_count) {{ $Query_count }} @else 0 @endisset</span> результатов поиска |
154 | </div> | 154 | </div> |
155 | </div> | 155 | </div> |
156 | <div class="main__vacancies" style="width:100%;" id="main_ockar" name="main_oskar"> | 156 | <div class="main__vacancies" style="width:100%;" id="main_ockar" name="main_oskar"> |
157 | @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp | 157 | @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp |
158 | @foreach ($Query as $Q) | 158 | @foreach ($Query as $Q) |
159 | @foreach ($Reclama as $Rec) | 159 | @foreach ($Reclama as $Rec) |
160 | @if ($Rec->position == $i) | 160 | @if ($Rec->position == $i) |
161 | <div class="main__vacancies-thing"> | 161 | <div class="main__vacancies-thing"> |
162 | @if (!empty($Rec->image)) | 162 | @if (!empty($Rec->image)) |
163 | <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> | 163 | <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> |
164 | @else | 164 | @else |
165 | <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> | 165 | <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> |
166 | @endif | 166 | @endif |
167 | <div class="main__vacancies-thing-body"> | 167 | <div class="main__vacancies-thing-body"> |
168 | <h2>{{ $Rec->title }}</h2> | 168 | <h2>{{ $Rec->title }}</h2> |
169 | <div class="main__vacancies-thing-scroll"> | 169 | <div class="main__vacancies-thing-scroll"> |
170 | {!! $Rec->text !!} | 170 | {!! $Rec->text !!} |
171 | </div> | 171 | </div> |
172 | <a href="{{ $Rec->link }}" class="button">Узнать больше</a> | 172 | <a href="{{ $Rec->link }}" class="button">Узнать больше</a> |
173 | </div> | 173 | </div> |
174 | </div> | 174 | </div> |
175 | @endif | 175 | @endif |
176 | @endforeach | 176 | @endforeach |
177 | <div class="main__vacancies-item main__employer-page-two-item" data-id="{{ $Q->id }}"> | 177 | <div class="main__vacancies-item main__employer-page-two-item" data-id="{{ $Q->id }}"> |
178 | <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" | 178 | <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" |
179 | class="back main__employer-page-two-item-back"> | 179 | class="back main__employer-page-two-item-back"> |
180 | <svg> | 180 | <svg> |
181 | <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> | 181 | <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> |
182 | </svg> | 182 | </svg> |
183 | <span> | 183 | <span> |
184 | Вернуться к списку вакансий | 184 | Вернуться к списку вакансий |
185 | </span> | 185 | </span> |
186 | </a> | 186 | </a> |
187 | <div class="main__employer-page-two-item-toper"> | 187 | <div class="main__employer-page-two-item-toper"> |
188 | @if (!empty($Q->employer->logo)) | 188 | @if (!empty($Q->employer->logo)) |
189 | <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}"> | 189 | <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}"> |
190 | @else | 190 | @else |
191 | <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> | 191 | <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> |
192 | @endif | 192 | @endif |
193 | <span>@if (isset($Q->employer->name_company)) {{ $Q->employer->name_company }} @else Не определена @endif</span> | 193 | <span>@if (isset($Q->employer->name_company)) {{ $Q->employer->name_company }} @else Не определена @endif</span> |
194 | </div> | 194 | </div> |
195 | <div class="main__employer-page-two-item-text"> | 195 | <div class="main__employer-page-two-item-text"> |
196 | <div class="main__employer-page-two-item-text-name"> | 196 | <div class="main__employer-page-two-item-text-name"> |
197 | <h3>@if (!empty($Q->name)) {{ $Q->name }}@else Не указано @endif </h3> | 197 | <h3>@if (!empty($Q->name)) {{ $Q->name }}@else Не указано @endif </h3> |
198 | </div> | 198 | </div> |
199 | </div> | 199 | </div> |
200 | <div class="main__employer-page-two-item-text"> | 200 | <div class="main__employer-page-two-item-text"> |
201 | <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> | 201 | <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> |
202 | <div class="main__employer-page-two-item-text-body"> | 202 | <div class="main__employer-page-two-item-text-body"> |
203 | {!! $Q->text !!} | 203 | {!! $Q->text !!} |
204 | </div> | 204 | </div> |
205 | </div> | 205 | </div> |
206 | <div class="main__employer-page-two-item-tags"> | 206 | <div class="main__employer-page-two-item-tags"> |
207 | @if (!empty($Q->jobs_code[0]->position_ship)) | 207 | @if (!empty($Q->jobs_code[0]->position_ship)) |
208 | <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span> | 208 | <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span> |
209 | @else | 209 | @else |
210 | @if (isset($Q->jobs)) | 210 | @if (isset($Q->jobs)) |
211 | @foreach ($Q->jobs as $key => $j) | 211 | @foreach ($Q->jobs as $key => $j) |
212 | <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span> | 212 | <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span> |
213 | @endforeach | 213 | @endforeach |
214 | @endif | 214 | @endif |
215 | @endif | 215 | @endif |
216 | </div> | 216 | </div> |
217 | <div class="main__employer-page-two-item-buttons"> | 217 | <div class="main__employer-page-two-item-buttons"> |
218 | @guest | 218 | @guest |
219 | <button type="button" | 219 | <button type="button" |
220 | data-fancybox | 220 | data-fancybox |
221 | data-src="#question" | 221 | data-src="#question" |
222 | data-options='{"touch":false,"autoFocus":false}' | 222 | data-options='{"touch":false,"autoFocus":false}' |
223 | class="button main__employer-page-two-item-button"> | 223 | class="button main__employer-page-two-item-button"> |
224 | Откликнуться | 224 | Откликнуться |
225 | </button> | 225 | </button> |
226 | @else | 226 | @else |
227 | @if (App\Classes\StatusUser::Status() == 1) | 227 | @if (App\Classes\StatusUser::Status() == 1) |
228 | <?php | 228 | <?php |
229 | if (\App\Classes\Tools::getWorkerProfilePercent(Auth()->user()->workers[0]) > 50) { | 229 | if (\App\Classes\Tools::getWorkerProfilePercent(Auth()->user()->workers[0]) >= 50) { |
230 | $buttonId = 'ask_comment'; | 230 | $buttonId = 'ask_comment'; |
231 | } else { | 231 | } else { |
232 | $buttonId = 'ask_percent'; | 232 | $buttonId = 'ask_percent'; |
233 | } | 233 | } |
234 | ?> | 234 | ?> |
235 | <button type="button" | 235 | <button type="button" |
236 | data-fancybox | 236 | data-fancybox |
237 | data-src="#{{$buttonId}}" | 237 | data-src="#{{$buttonId}}" |
238 | data-vacancy="{{ $Q->id }}" | 238 | data-vacancy="{{ $Q->id }}" |
239 | data-uid="{{ $uid }}" | 239 | data-uid="{{ $uid }}" |
240 | data-tuid="{{ $Q->employer->user_id }}" | 240 | data-tuid="{{ $Q->employer->user_id }}" |
241 | data-options='{"touch":false,"autoFocus":false}' | 241 | data-options='{"touch":false,"autoFocus":false}' |
242 | class="button main__employer-page-two-item-button {{ $buttonId }}"> | 242 | class="button main__employer-page-two-item-button {{ $buttonId }}"> |
243 | Откликнуться | 243 | Откликнуться |
244 | </button> | 244 | </button> |
245 | @endif | 245 | @endif |
246 | @endguest | 246 | @endguest |
247 | <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" | 247 | <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" |
248 | class="button button_light main__employer-page-two-item-button"> | 248 | class="button button_light main__employer-page-two-item-button"> |
249 | Подробнее | 249 | Подробнее |
250 | </a> | 250 | </a> |
251 | </div> | 251 | </div> |
252 | <div class="main__employer-page-two-item-bottom"> | 252 | <div class="main__employer-page-two-item-bottom"> |
253 | <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y', strtotime($Q->updated_at)) }}</div> | 253 | <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y', strtotime($Q->updated_at)) }}</div> |
254 | @guest | 254 | @guest |
255 | <button type="button" | 255 | <button type="button" |
256 | data-fancybox | 256 | data-fancybox |
257 | data-src="#favorite_noauth" | 257 | data-src="#favorite_noauth" |
258 | data-options='{"touch":false,"autoFocus":false}' | 258 | data-options='{"touch":false,"autoFocus":false}' |
259 | class="like main__employer-page-two-item-bottom-like"> | 259 | class="like main__employer-page-two-item-bottom-like"> |
260 | <svg> | 260 | <svg> |
261 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> | 261 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> |
262 | </svg> | 262 | </svg> |
263 | </button> | 263 | </button> |
264 | @else | 264 | @else |
265 | <button type="button" id="like{{ $Q->id }}" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}"> | 265 | <button type="button" |
266 | id="like{{ $Q->id }}" | ||
267 | data-val="{{ $Q->id }}" | ||
268 | class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}"> | ||
266 | <svg> | 269 | <svg> |
267 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> | 270 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> |
268 | </svg> | 271 | </svg> |
269 | </button> | 272 | </button> |
270 | @endguest | 273 | @endguest |
271 | </div> | 274 | </div> |
272 | </div> | 275 | </div> |
273 | @php $i++ @endphp | 276 | @php $i++ @endphp |
274 | @endforeach | 277 | @endforeach |
275 | <div style="margin-top: 20px"> | 278 | <div style="margin-top: 20px"> |
276 | {{ $Query->onEachSide(0)->appends($_GET)->links('paginate') }} | 279 | {{ $Query->onEachSide(0)->appends($_GET)->links('paginate') }} |
277 | </div> | 280 | </div> |
278 | </div> | 281 | </div> |
279 | </div> | 282 | </div> |
280 | </div> | 283 | </div> |
281 | </main> | 284 | </main> |
282 | @endsection | 285 | @endsection |
283 | 286 |