Commit 9d2ae55e9b5d836e6362507b6f1de22d49fc5989
1 parent
505f4f18d2
Exists in
master
Анкета работника + фиксы
Showing 4 changed files with 76 additions and 144 deletions Inline Diff
app/Http/Controllers/WorkerController.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Http\Controllers; | 3 | namespace App\Http\Controllers; |
4 | 4 | ||
5 | use App\Classes\RusDate; | 5 | use App\Classes\RusDate; |
6 | use App\Http\Requests\DocumentsRequest; | 6 | use App\Http\Requests\DocumentsRequest; |
7 | use App\Http\Requests\PrevCompanyRequest; | 7 | use App\Http\Requests\PrevCompanyRequest; |
8 | use App\Http\Requests\SertificationRequest; | 8 | use App\Http\Requests\SertificationRequest; |
9 | use App\Models\Ad_employer; | 9 | use App\Models\Ad_employer; |
10 | use App\Models\ad_response; | 10 | use App\Models\ad_response; |
11 | use App\Models\Dop_info; | 11 | use App\Models\Dop_info; |
12 | use App\Models\infobloks; | 12 | use App\Models\infobloks; |
13 | use App\Models\Job_title; | 13 | use App\Models\Job_title; |
14 | use App\Models\Like_vacancy; | 14 | use App\Models\Like_vacancy; |
15 | use App\Models\Message; | 15 | use App\Models\Message; |
16 | use App\Models\place_works; | 16 | use App\Models\place_works; |
17 | use App\Models\PrevCompany; | 17 | use App\Models\PrevCompany; |
18 | use App\Models\ResponseWork; | 18 | use App\Models\ResponseWork; |
19 | use App\Models\sertification; | 19 | use App\Models\sertification; |
20 | use App\Models\Static_worker; | 20 | use App\Models\Static_worker; |
21 | use App\Models\Title_worker; | 21 | use App\Models\Title_worker; |
22 | use App\Models\User; | 22 | use App\Models\User; |
23 | use App\Models\User as User_Model; | 23 | use App\Models\User as User_Model; |
24 | use App\Models\Worker; | 24 | use App\Models\Worker; |
25 | use Barryvdh\DomPDF\Facade\Pdf; | 25 | use Barryvdh\DomPDF\Facade\Pdf; |
26 | use Carbon\Carbon; | 26 | use Carbon\Carbon; |
27 | use Illuminate\Auth\Events\Registered; | 27 | use Illuminate\Auth\Events\Registered; |
28 | use Illuminate\Database\Eloquent\Builder; | 28 | use Illuminate\Database\Eloquent\Builder; |
29 | use Illuminate\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\Storage; | 32 | use Illuminate\Support\Facades\Storage; |
33 | use Illuminate\Support\Facades\Validator; | 33 | use Illuminate\Support\Facades\Validator; |
34 | use PhpOffice\PhpSpreadsheet\Spreadsheet; | 34 | use PhpOffice\PhpSpreadsheet\Spreadsheet; |
35 | use PhpOffice\PhpSpreadsheet\Writer\Xlsx; | 35 | use PhpOffice\PhpSpreadsheet\Writer\Xlsx; |
36 | use Symfony\Component\HttpFoundation\StreamedResponse; | 36 | use Symfony\Component\HttpFoundation\StreamedResponse; |
37 | use App\Enums\DbExportColumns; | 37 | use App\Enums\DbExportColumns; |
38 | use DateTime; | 38 | use DateTime; |
39 | 39 | ||
40 | class WorkerController extends Controller | 40 | class WorkerController extends Controller |
41 | { | 41 | { |
42 | public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу'); | 42 | public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу'); |
43 | 43 | ||
44 | //профиль | 44 | //профиль |
45 | public function profile(Worker $worker) | 45 | public function profile(Worker $worker) |
46 | { | 46 | { |
47 | $get_date = date('Y.m'); | 47 | $get_date = date('Y.m'); |
48 | 48 | ||
49 | $c = Static_worker::query()->where('year_month', '=', $get_date) | 49 | $c = Static_worker::query()->where('year_month', '=', $get_date) |
50 | ->where('user_id', '=', $worker->users->id) | 50 | ->where('user_id', '=', $worker->users->id) |
51 | ->get(); | 51 | ->get(); |
52 | 52 | ||
53 | if ($c->count() > 0) { | 53 | if ($c->count() > 0) { |
54 | $upd = Static_worker::find($c[0]->id); | 54 | $upd = Static_worker::find($c[0]->id); |
55 | $upd->lookin = $upd->lookin + 1; | 55 | $upd->lookin = $upd->lookin + 1; |
56 | $upd->save(); | 56 | $upd->save(); |
57 | } else { | 57 | } else { |
58 | $crt = new Static_worker(); | 58 | $crt = new Static_worker(); |
59 | $crt->lookin = 1; | 59 | $crt->lookin = 1; |
60 | $crt->year_month = $get_date; | 60 | $crt->year_month = $get_date; |
61 | $crt->user_id = $worker->user_id; | 61 | $crt->user_id = $worker->user_id; |
62 | $crt->save(); | 62 | $crt->save(); |
63 | } | 63 | } |
64 | 64 | ||
65 | $stat = Static_worker::query()->where('year_month', '=', $get_date) | 65 | $stat = Static_worker::query()->where('year_month', '=', $get_date) |
66 | ->where('user_id', '=', $worker->users->id) | 66 | ->where('user_id', '=', $worker->users->id) |
67 | ->get(); | 67 | ->get(); |
68 | 68 | ||
69 | return view('public.workers.profile', compact('worker', 'stat')); | 69 | return view('public.workers.profile', compact('worker', 'stat')); |
70 | } | 70 | } |
71 | 71 | ||
72 | // лист база резюме | 72 | // лист база резюме |
73 | public function bd_resume(Request $request) | 73 | public function bd_resume(Request $request) |
74 | { | 74 | { |
75 | $look = false; | 75 | $look = false; |
76 | $idiot = 0; | 76 | $idiot = 0; |
77 | if (isset(Auth()->user()->id)) { | 77 | if (isset(Auth()->user()->id)) { |
78 | $idiot = Auth()->user()->id; | 78 | $idiot = Auth()->user()->id; |
79 | if ((!Auth()->user()->is_worker) && (Auth()->user()->is_lookin)) | 79 | if ((!Auth()->user()->is_worker) && (Auth()->user()->is_lookin)) |
80 | $look = true; | 80 | $look = true; |
81 | } | 81 | } |
82 | 82 | ||
83 | if ($look) { | 83 | if ($look) { |
84 | $status_work = $this->status_work; | 84 | $status_work = $this->status_work; |
85 | $resumes = Worker::query()->with('users')->with('job_titles'); | 85 | $resumes = Worker::query()->with('users')->with('job_titles'); |
86 | $resumes = $resumes->whereHas('users', function (Builder $query) { | 86 | $resumes = $resumes->whereHas('users', function (Builder $query) { |
87 | $query->Where('is_worker', '=', '1') | 87 | $query->Where('is_worker', '=', '1') |
88 | ->Where('is_bd', '=', '0'); | 88 | ->Where('is_bd', '=', '0'); |
89 | }); | 89 | }); |
90 | 90 | ||
91 | //dd($request->get('job')); | 91 | //dd($request->get('job')); |
92 | if (($request->has('job')) && ($request->get('job') > 0)) { | 92 | if (($request->has('job')) && ($request->get('job') > 0)) { |
93 | $resumes = $resumes->whereHas('job_titles', function (Builder $query) use ($request) { | 93 | $resumes = $resumes->whereHas('job_titles', function (Builder $query) use ($request) { |
94 | $query->Where('job_titles.id', $request->get('job')); | 94 | $query->Where('job_titles.id', $request->get('job')); |
95 | }); | 95 | }); |
96 | } | 96 | } |
97 | 97 | ||
98 | $Job_title = Job_title::query()-> | 98 | $Job_title = Job_title::query()-> |
99 | where('is_remove', '=', '0')-> | 99 | where('is_remove', '=', '0')-> |
100 | where('is_bd', '=' , '1')-> | 100 | where('is_bd', '=' , '1')-> |
101 | get(); | 101 | get(); |
102 | 102 | ||
103 | if ($request->get('sort')) { | 103 | if ($request->get('sort')) { |
104 | $sort = $request->get('sort'); | 104 | $sort = $request->get('sort'); |
105 | switch ($sort) { | 105 | switch ($sort) { |
106 | case 'name_up': | 106 | case 'name_up': |
107 | $resumes = $resumes->orderBy(User::select('surname') | 107 | $resumes = $resumes->orderBy(User::select('surname') |
108 | ->whereColumn('workers.user_id', 'users.id') | 108 | ->whereColumn('workers.user_id', 'users.id') |
109 | ); | 109 | ); |
110 | break; | 110 | break; |
111 | case 'name_down': | 111 | case 'name_down': |
112 | $resumes = $resumes->orderByDesc(User::select('surname') | 112 | $resumes = $resumes->orderByDesc(User::select('surname') |
113 | ->whereColumn('workers.user_id', 'users.id') | 113 | ->whereColumn('workers.user_id', 'users.id') |
114 | ); | 114 | ); |
115 | break; | 115 | break; |
116 | case 'created_at_up': | 116 | case 'created_at_up': |
117 | $resumes = $resumes->OrderBy('created_at')->orderBy('id'); | 117 | $resumes = $resumes->OrderBy('created_at')->orderBy('id'); |
118 | break; | 118 | break; |
119 | case 'created_at_down': | 119 | case 'created_at_down': |
120 | $resumes = $resumes->orderByDesc('created_at')->orderBy('id'); | 120 | $resumes = $resumes->orderByDesc('created_at')->orderBy('id'); |
121 | break; | 121 | break; |
122 | case 'default': | 122 | case 'default': |
123 | $resumes = $resumes->orderBy('id')->orderby('updated_at'); | 123 | $resumes = $resumes->orderBy('id')->orderby('updated_at'); |
124 | break; | 124 | break; |
125 | default: | 125 | default: |
126 | $resumes = $resumes->orderBy('id')->orderby('updated_at'); | 126 | $resumes = $resumes->orderBy('id')->orderby('updated_at'); |
127 | break; | 127 | break; |
128 | } | 128 | } |
129 | } | 129 | } |
130 | 130 | ||
131 | $res_count = $resumes->count(); | 131 | $res_count = $resumes->count(); |
132 | //$resumes = $resumes->get(); | 132 | //$resumes = $resumes->get(); |
133 | $resumes = $resumes->paginate(4); | 133 | $resumes = $resumes->paginate(4); |
134 | if ($request->ajax()) { | 134 | if ($request->ajax()) { |
135 | // Условия обставлены | 135 | // Условия обставлены |
136 | if ($request->has('block') && ($request->get('block') == 1)) { | 136 | if ($request->has('block') && ($request->get('block') == 1)) { |
137 | return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot')); | 137 | return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot')); |
138 | } | 138 | } |
139 | 139 | ||
140 | if ($request->has('block') && ($request->get('block') == 2)) { | 140 | if ($request->has('block') && ($request->get('block') == 2)) { |
141 | return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot')); | 141 | return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot')); |
142 | } | 142 | } |
143 | } else { | 143 | } else { |
144 | return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot', 'Job_title')); | 144 | return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot', 'Job_title')); |
145 | } | 145 | } |
146 | } else { | 146 | } else { |
147 | return redirect()->route('index')->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]); | 147 | return redirect()->route('index')->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]); |
148 | } | 148 | } |
149 | } | 149 | } |
150 | 150 | ||
151 | public function basic_information(){ | 151 | public function basic_information(){ |
152 | if (!isset(Auth()->user()->id)) { | 152 | if (!isset(Auth()->user()->id)) { |
153 | abort(404); | 153 | abort(404); |
154 | } | 154 | } |
155 | 155 | ||
156 | $user_id = Auth()->user()->id; | 156 | $user_id = Auth()->user()->id; |
157 | 157 | ||
158 | $user = User::query() | 158 | $user = User::query() |
159 | ->with('workers') | 159 | ->with('workers') |
160 | ->with(['jobtitles' => function ($query) { | 160 | ->with(['jobtitles' => function ($query) { |
161 | $query->select('job_titles.id'); | 161 | $query->select('job_titles.id'); |
162 | }]) | 162 | }]) |
163 | ->where('id', '=', $user_id) | 163 | ->where('id', '=', $user_id) |
164 | ->first(); | 164 | ->first(); |
165 | $user->workers[0]->job_titles = $user->workers[0]->job_titles->pluck('id')->toArray(); | 165 | $user->workers[0]->job_titles = $user->workers[0]->job_titles->pluck('id')->toArray(); |
166 | 166 | ||
167 | $job_titles = Job_title::all()->sortBy('name'); | 167 | $job_titles = Job_title::all()->sortBy('name'); |
168 | 168 | ||
169 | return view('workers.form_basic_information', compact('user', 'job_titles')); | 169 | return view('workers.form_basic_information', compact('user', 'job_titles')); |
170 | } | 170 | } |
171 | 171 | ||
172 | public function additional_documents(){ | 172 | public function additional_documents(){ |
173 | if (!isset(Auth()->user()->id)) { | 173 | if (!isset(Auth()->user()->id)) { |
174 | abort(404); | 174 | abort(404); |
175 | } | 175 | } |
176 | 176 | ||
177 | $user_id = Auth()->user()->id; | 177 | $user_id = Auth()->user()->id; |
178 | 178 | ||
179 | $info_blocks = infobloks::query()->OrderBy('name')->get(); | 179 | $info_blocks = infobloks::query()->OrderBy('name')->get(); |
180 | $additional_document_statuses = [0 => 'Не указано', 1 => 'В наличии', 2 => 'Отсутствует']; | 180 | $additional_document_statuses = [0 => 'Не указано', 1 => 'В наличии', 2 => 'Отсутствует']; |
181 | 181 | ||
182 | $worker = Worker::query() | 182 | $worker = Worker::query() |
183 | ->with('users') | 183 | ->with('users') |
184 | ->with('infobloks') | 184 | ->with('infobloks') |
185 | ->WhereHas('users', function (Builder $query) use ($user_id) { | 185 | ->WhereHas('users', function (Builder $query) use ($user_id) { |
186 | $query->Where('id', $user_id); | 186 | $query->Where('id', $user_id); |
187 | }) | 187 | }) |
188 | ->first(); | 188 | ->first(); |
189 | if ($worker->dop_info->count()){ | 189 | if ($worker->dop_info->count()){ |
190 | $worker->dop_info = $worker->dop_info->keyBy('infoblok_id')->toArray(); | 190 | $worker->dop_info = $worker->dop_info->keyBy('infoblok_id')->toArray(); |
191 | } | 191 | } |
192 | 192 | ||
193 | return view('workers.form_additional_documents', compact('worker', 'info_blocks', 'additional_document_statuses')); | 193 | return view('workers.form_additional_documents', compact('worker', 'info_blocks', 'additional_document_statuses')); |
194 | } | 194 | } |
195 | 195 | ||
196 | //Лайк резюме | 196 | //Лайк резюме |
197 | public function like_controller() { | 197 | public function like_controller() { |
198 | 198 | ||
199 | } | 199 | } |
200 | 200 | ||
201 | // анкета соискателя | 201 | // анкета соискателя |
202 | public function resume_profile(Worker $worker) | 202 | public function resume_profile(Worker $worker) |
203 | { | 203 | { |
204 | if (isset(Auth()->user()->id)) { | 204 | if (isset(Auth()->user()->id)) { |
205 | $idiot = Auth()->user()->id; | 205 | $idiot = Auth()->user()->id; |
206 | } else { | 206 | } else { |
207 | $idiot = 0; | 207 | $idiot = 0; |
208 | } | 208 | } |
209 | 209 | ||
210 | $status_work = $this->status_work; | 210 | $status_work = $this->status_work; |
211 | $Query = Worker::query()->with('users')->with('job_titles') | 211 | $Query = Worker::query()->with('users')->with('job_titles') |
212 | ->with('place_worker')->with('sertificate')->with('prev_company') | 212 | ->with('place_worker')->with('sertificate')->with('prev_company') |
213 | ->with('infobloks')->with('response'); | 213 | ->with('infobloks')->with('response'); |
214 | $Query = $Query->where('id', '=', $worker->id); | 214 | $Query = $Query->where('id', '=', $worker->id); |
215 | $Query = $Query->get(); | 215 | $Query = $Query->get(); |
216 | 216 | ||
217 | $get_date = date('Y.m'); | 217 | $get_date = date('Y.m'); |
218 | 218 | ||
219 | $infoblocks = infobloks::query()->get(); | 219 | $infoblocks = infobloks::query()->get(); |
220 | 220 | ||
221 | $c = Static_worker::query()->where('year_month', '=', $get_date) | 221 | $c = Static_worker::query()->where('year_month', '=', $get_date) |
222 | ->where('user_id', '=', $worker->user_id) | 222 | ->where('user_id', '=', $worker->user_id) |
223 | ->get(); | 223 | ->get(); |
224 | 224 | ||
225 | if ($c->count() > 0) { | 225 | if ($c->count() > 0) { |
226 | $upd = Static_worker::find($c[0]->id); | 226 | $upd = Static_worker::find($c[0]->id); |
227 | $upd->lookin = $upd->lookin + 1; | 227 | $upd->lookin = $upd->lookin + 1; |
228 | $upd->save(); | 228 | $upd->save(); |
229 | } else { | 229 | } else { |
230 | $crt = new Static_worker(); | 230 | $crt = new Static_worker(); |
231 | $crt->lookin = 1; | 231 | $crt->lookin = 1; |
232 | $crt->year_month = $get_date; | 232 | $crt->year_month = $get_date; |
233 | $crt->user_id = $worker->user_id; | 233 | $crt->user_id = $worker->user_id; |
234 | $status = $crt->save(); | 234 | $status = $crt->save(); |
235 | } | 235 | } |
236 | 236 | ||
237 | $stat = Static_worker::query()->where('year_month', '=', $get_date) | 237 | $stat = Static_worker::query()->where('year_month', '=', $get_date) |
238 | ->where('user_id', '=', $worker->user_id) | 238 | ->where('user_id', '=', $worker->user_id) |
239 | ->get(); | 239 | ->get(); |
240 | 240 | ||
241 | return view('worker', compact('Query', 'infoblocks', 'status_work', 'idiot', 'stat')); | 241 | return view('worker', compact('Query', 'infoblocks', 'status_work', 'idiot', 'stat')); |
242 | } | 242 | } |
243 | 243 | ||
244 | // скачать анкету соискателя | 244 | // скачать анкету соискателя |
245 | public function resume_download(Worker $worker) | 245 | public function resume_download(Worker $worker) |
246 | { | 246 | { |
247 | $status_work = $this->status_work; | 247 | $status_work = $this->status_work; |
248 | $Query = Worker::query()->with('users')->with('job_titles') | 248 | $Query = Worker::query()->with('users')->with('job_titles') |
249 | ->with('place_worker')->with('sertificate')->with('prev_company') | 249 | ->with('place_worker')->with('sertificate')->with('prev_company') |
250 | ->with('infobloks'); | 250 | ->with('infobloks'); |
251 | $Query = $Query->where('id', '=', $worker->id); | 251 | $Query = $Query->where('id', '=', $worker->id); |
252 | $Query = $Query->get()->toArray(); | 252 | $Query = $Query->get()->toArray(); |
253 | 253 | ||
254 | view()->share('Query',$Query); | 254 | view()->share('Query',$Query); |
255 | 255 | ||
256 | 256 | ||
257 | $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape'); | 257 | $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape'); |
258 | 258 | ||
259 | return $pdf->stream(); | 259 | return $pdf->stream(); |
260 | } | 260 | } |
261 | 261 | ||
262 | public function resume_download_all(Request $request) { | 262 | public function resume_download_all(Request $request) { |
263 | $spreadsheet = new Spreadsheet(); | 263 | $spreadsheet = new Spreadsheet(); |
264 | $sheet = $spreadsheet->getActiveSheet(); | 264 | $sheet = $spreadsheet->getActiveSheet(); |
265 | 265 | ||
266 | $columnMap = range('A', 'Z'); | 266 | $columnMap = range('A', 'Z'); |
267 | $columns = []; | 267 | $columns = []; |
268 | 268 | ||
269 | foreach (DbExportColumns::toArray() as $key => $value){ | 269 | foreach (DbExportColumns::toArray() as $key => $value){ |
270 | if ($request->input($key, 0)){ | 270 | if ($request->input($key, 0)){ |
271 | $sheet->setCellValue("{$columnMap[count($columns)]}1", ucfirst($value)); | 271 | $sheet->setCellValue("{$columnMap[count($columns)]}1", ucfirst($value)); |
272 | $columns[] = str_replace('__', '.', $key); | 272 | $columns[] = str_replace('__', '.', $key); |
273 | } | 273 | } |
274 | } | 274 | } |
275 | 275 | ||
276 | if (empty($columns)) { | 276 | if (empty($columns)) { |
277 | return redirect()->back()->with('error', 'Пожалуйста выберите хотя бы 1 колонку для экспорта.'); | 277 | return redirect()->back()->with('error', 'Пожалуйста выберите хотя бы 1 колонку для экспорта.'); |
278 | } | 278 | } |
279 | 279 | ||
280 | $query = User::select($columns) | 280 | $query = User::select($columns) |
281 | ->leftJoin('workers', 'users.id', '=', 'workers.user_id') | 281 | ->leftJoin('workers', 'users.id', '=', 'workers.user_id') |
282 | ->leftJoin('job_titles', 'workers.position_work', '=', 'job_titles.id') | 282 | ->leftJoin('job_titles', 'workers.position_work', '=', 'job_titles.id') |
283 | ->where('users.is_bd', '=', 1) | 283 | ->where('users.is_bd', '=', 1) |
284 | ; | 284 | ; |
285 | 285 | ||
286 | $job_title_list = $request->input('job_title_list', []); | 286 | $job_title_list = $request->input('job_title_list', []); |
287 | if (!empty($job_title_list)){ | 287 | if (!empty($job_title_list)){ |
288 | $query->whereIn('job_titles.id', $job_title_list); | 288 | $query->whereIn('job_titles.id', $job_title_list); |
289 | } | 289 | } |
290 | 290 | ||
291 | $users = $query->get(); | 291 | $users = $query->get(); |
292 | if ($users->count()){ | 292 | if ($users->count()){ |
293 | $i = 2; | 293 | $i = 2; |
294 | foreach ($users->toArray() as $user){ | 294 | foreach ($users->toArray() as $user){ |
295 | $j = 0; | 295 | $j = 0; |
296 | foreach ($user as $field){ | 296 | foreach ($user as $field){ |
297 | $sheet->setCellValue("{$columnMap[$j++]}$i", $field); | 297 | $sheet->setCellValue("{$columnMap[$j++]}$i", $field); |
298 | } | 298 | } |
299 | $i++; | 299 | $i++; |
300 | } | 300 | } |
301 | } | 301 | } |
302 | $writer = new Xlsx($spreadsheet); | 302 | $writer = new Xlsx($spreadsheet); |
303 | $fileName = 'DB.xlsx'; | 303 | $fileName = 'DB.xlsx'; |
304 | 304 | ||
305 | $response = new StreamedResponse(function() use ($writer) { | 305 | $response = new StreamedResponse(function() use ($writer) { |
306 | $writer->save('php://output'); | 306 | $writer->save('php://output'); |
307 | }); | 307 | }); |
308 | 308 | ||
309 | $response->headers->set('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); | 309 | $response->headers->set('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); |
310 | $response->headers->set('Content-Disposition', 'attachment;filename="' . $fileName . '"'); | 310 | $response->headers->set('Content-Disposition', 'attachment;filename="' . $fileName . '"'); |
311 | $response->headers->set('Cache-Control', 'max-age=0'); | 311 | $response->headers->set('Cache-Control', 'max-age=0'); |
312 | 312 | ||
313 | return $response; | 313 | return $response; |
314 | } | 314 | } |
315 | 315 | ||
316 | // Кабинет работника | 316 | // Кабинет работника |
317 | public function cabinet(Request $request) | 317 | public function cabinet(Request $request) |
318 | { | 318 | { |
319 | // дата год и месяц | 319 | // дата год и месяц |
320 | $get_date = date('Y.m'); | 320 | $get_date = date('Y.m'); |
321 | 321 | ||
322 | $id = Auth()->user()->id; | 322 | $id = Auth()->user()->id; |
323 | 323 | ||
324 | $Infobloks = infobloks::query()->get(); | 324 | $Infobloks = infobloks::query()->get(); |
325 | 325 | ||
326 | $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')-> | 326 | $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')-> |
327 | with('infobloks')->with('place_worker')-> | 327 | with('infobloks')->with('place_worker')-> |
328 | WhereHas('users', | 328 | WhereHas('users', |
329 | function (Builder $query) use ($id) {$query->Where('id', $id); | 329 | function (Builder $query) use ($id) {$query->Where('id', $id); |
330 | })->get(); | 330 | })->get(); |
331 | 331 | ||
332 | $Job_titles = Job_title::query()->where('is_remove', '=', '0')-> | 332 | $Job_titles = Job_title::query()->where('is_remove', '=', '0')-> |
333 | where('is_bd', '=' , '1')-> | 333 | where('is_bd', '=' , '1')-> |
334 | OrderByDesc('sort')->OrderBy('name')->get(); | 334 | OrderByDesc('sort')->OrderBy('name')->get(); |
335 | 335 | ||
336 | 336 | ||
337 | $stat = Static_worker::query()->where('year_month', '=', $get_date) | 337 | $stat = Static_worker::query()->where('year_month', '=', $get_date) |
338 | ->where('user_id', '=', $id) | 338 | ->where('user_id', '=', $id) |
339 | ->get(); | 339 | ->get(); |
340 | 340 | ||
341 | 341 | ||
342 | // 10% | 342 | // 10% |
343 | 343 | ||
344 | $persent = 10; | 344 | $persent = 10; |
345 | $persent1 = 0; | 345 | $persent1 = 0; |
346 | $persent2 = 0; | 346 | $persent2 = 0; |
347 | $persent3 = 0; | 347 | $persent3 = 0; |
348 | $persent4 = 0; | 348 | $persent4 = 0; |
349 | $persent5 = 0; | 349 | $persent5 = 0; |
350 | 350 | ||
351 | if ((!empty($Worker[0]->telephone)) && | 351 | if ((!empty($Worker[0]->telephone)) && |
352 | (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) && | 352 | (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) && |
353 | (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) { | 353 | (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) { |
354 | // 40% | 354 | // 40% |
355 | $persent = $persent + 40; | 355 | $persent = $persent + 40; |
356 | $persent1 = 40; | 356 | $persent1 = 40; |
357 | } | 357 | } |
358 | 358 | ||
359 | //dd($Worker[0]->status_work, $Worker[0]->telephone, $Worker[0]->email, $Worker[0]->experience, $Worker[0]->city, $Worker[0]->old_year); | 359 | //dd($Worker[0]->status_work, $Worker[0]->telephone, $Worker[0]->email, $Worker[0]->experience, $Worker[0]->city, $Worker[0]->old_year); |
360 | 360 | ||
361 | if ($Worker[0]->sertificate->count() > 0) { | 361 | if ($Worker[0]->sertificate->count() > 0) { |
362 | // 15% | 362 | // 15% |
363 | $persent = $persent + 15; | 363 | $persent = $persent + 15; |
364 | $persent2 = 15; | 364 | $persent2 = 15; |
365 | } | 365 | } |
366 | 366 | ||
367 | if ($Worker[0]->infobloks->count() > 0) { | 367 | if ($Worker[0]->infobloks->count() > 0) { |
368 | // 20% | 368 | // 20% |
369 | $persent = $persent + 20; | 369 | $persent = $persent + 20; |
370 | $persent3 = 20; | 370 | $persent3 = 20; |
371 | } | 371 | } |
372 | 372 | ||
373 | if ($Worker[0]->prev_company->count() > 0) { | 373 | if ($Worker[0]->prev_company->count() > 0) { |
374 | // 10% | 374 | // 10% |
375 | $persent = $persent + 10; | 375 | $persent = $persent + 10; |
376 | $persent4 = 10; | 376 | $persent4 = 10; |
377 | } | 377 | } |
378 | 378 | ||
379 | if (!empty($Worker[0]->photo)) { | 379 | if (!empty($Worker[0]->photo)) { |
380 | // 5% | 380 | // 5% |
381 | $persent = $persent + 5; | 381 | $persent = $persent + 5; |
382 | $persent5 = 5; | 382 | $persent5 = 5; |
383 | } | 383 | } |
384 | 384 | ||
385 | $status_work = $this->status_work; | 385 | $status_work = $this->status_work; |
386 | $additional_document_statuses = [0 => 'Не указано', 1 => 'В наличии', 2 => 'Отсутствует']; | 386 | $additional_document_statuses = [0 => 'Не указано', 1 => 'В наличии', 2 => 'Отсутствует']; |
387 | $info_blocks = infobloks::query()->OrderBy('name')->get(); | 387 | $info_blocks = infobloks::query()->OrderBy('name')->get(); |
388 | 388 | ||
389 | $worker = Worker::query() | 389 | $worker = Worker::query() |
390 | ->with('users') | 390 | ->with('users') |
391 | ->with('sertificate') | 391 | ->with('sertificate') |
392 | ->with('prev_company') | 392 | ->with('prev_company') |
393 | ->with('infobloks') | 393 | ->with('infobloks') |
394 | ->with('place_worker') | 394 | ->with('place_worker') |
395 | ->with('job_titles') | 395 | ->with('job_titles') |
396 | ->WhereHas('users', function (Builder $query) use ($id) { | 396 | ->WhereHas('users', function (Builder $query) use ($id) { |
397 | $query->Where('id', $id); | 397 | $query->Where('id', $id); |
398 | }) | 398 | }) |
399 | ->first(); | 399 | ->first(); |
400 | if ($worker->dop_info->count()){ | 400 | if ($worker->dop_info->count()){ |
401 | $worker->dop_info = $worker->dop_info->keyBy('infoblok_id')->toArray(); | 401 | $worker->dop_info = $worker->dop_info->keyBy('infoblok_id')->toArray(); |
402 | } | 402 | } |
403 | 403 | ||
404 | //dd($worker->dop_info); | 404 | //dd($worker->dop_info); |
405 | 405 | ||
406 | if ($request->has('print')) { | 406 | if ($request->has('print')) { |
407 | dd($Worker); | 407 | dd($Worker); |
408 | } else { | 408 | } else { |
409 | return view('workers.cabinet', compact( 'persent', 'Job_titles', 'stat', | 409 | return view('workers.cabinet', compact( 'persent', 'Job_titles', 'stat', |
410 | 'worker', 'info_blocks', 'status_work', 'additional_document_statuses' | 410 | 'worker', 'info_blocks', 'status_work', 'additional_document_statuses' |
411 | )); | 411 | )); |
412 | } | 412 | } |
413 | } | 413 | } |
414 | 414 | ||
415 | // Сохранение данных | 415 | // Сохранение данных |
416 | public function cabinet_save(Worker $worker, Request $request) | 416 | public function cabinet_save(Worker $worker, Request $request) |
417 | { | 417 | { |
418 | $id = $worker->id; | 418 | $id = $worker->id; |
419 | $params = $request->all(); | 419 | $params = $request->all(); |
420 | $job_title_id = $request->get('job_title_id'); | 420 | $job_title_id = $request->get('job_title_id'); |
421 | 421 | ||
422 | $rules = [ | 422 | $rules = [ |
423 | 'surname' => ['required', 'string', 'max:255'], | 423 | 'surname' => ['required', 'string', 'max:255'], |
424 | 'name_man' => ['required', 'string', 'max:255'], | 424 | 'name_man' => ['required', 'string', 'max:255'], |
425 | 'email' => ['required', 'string', 'email', 'max:255'], | 425 | 'email' => ['required', 'string', 'email', 'max:255'], |
426 | 426 | ||
427 | ]; | 427 | ]; |
428 | 428 | ||
429 | $messages = [ | 429 | $messages = [ |
430 | 'required' => 'Укажите обязательное поле', | 430 | 'required' => 'Укажите обязательное поле', |
431 | 'min' => [ | 431 | 'min' => [ |
432 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 432 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
433 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 433 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
434 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 434 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
435 | ], | 435 | ], |
436 | 'max' => [ | 436 | 'max' => [ |
437 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 437 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
438 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 438 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
439 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 439 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
440 | ] | 440 | ] |
441 | ]; | 441 | ]; |
442 | 442 | ||
443 | $validator = Validator::make($params, $rules, $messages); | 443 | $validator = Validator::make($params, $rules, $messages); |
444 | 444 | ||
445 | if ($validator->fails()) { | 445 | if ($validator->fails()) { |
446 | return redirect()->route('worker.cabinet')->withErrors($validator); | 446 | return redirect()->route('worker.cabinet')->withErrors($validator); |
447 | } else { | 447 | } else { |
448 | 448 | ||
449 | if ($request->has('photo')) { | 449 | if ($request->has('photo')) { |
450 | if (!empty($worker->photo)) { | 450 | if (!empty($worker->photo)) { |
451 | Storage::delete($worker->photo); | 451 | Storage::delete($worker->photo); |
452 | } | 452 | } |
453 | $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); | 453 | $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); |
454 | } | 454 | } |
455 | 455 | ||
456 | if ($request->has('file')) { | 456 | if ($request->has('file')) { |
457 | if (!empty($worker->file)) { | 457 | if (!empty($worker->file)) { |
458 | Storage::delete($worker->file); | 458 | Storage::delete($worker->file); |
459 | } | 459 | } |
460 | $params['file'] = $request->file('file')->store("worker/$id", 'public'); | 460 | $params['file'] = $request->file('file')->store("worker/$id", 'public'); |
461 | } | 461 | } |
462 | 462 | ||
463 | $worker->update($params); | 463 | $worker->update($params); |
464 | $use = User::find($worker->user_id); | 464 | $use = User::find($worker->user_id); |
465 | $use->surname = $request->get('surname'); | 465 | $use->surname = $request->get('surname'); |
466 | $use->name_man = $request->get('name_man'); | 466 | $use->name_man = $request->get('name_man'); |
467 | $use->surname2 = $request->get('surname2'); | 467 | $use->surname2 = $request->get('surname2'); |
468 | 468 | ||
469 | $use->save(); | 469 | $use->save(); |
470 | $worker->job_titles()->sync($job_title_id); | 470 | $worker->job_titles()->sync($job_title_id); |
471 | 471 | ||
472 | return redirect()->route('worker.basic_information')->with('success', 'Данные были успешно сохранены'); | 472 | return redirect()->route('worker.basic_information')->with('success', 'Данные были успешно сохранены'); |
473 | } | 473 | } |
474 | } | 474 | } |
475 | 475 | ||
476 | public function cabinet_save_foto(Worker $worker, Request $request){ | ||
477 | $params = ['photo' => null]; | ||
478 | |||
479 | if ($request->has('photo')) { | ||
480 | if (!empty($worker->photo)) { | ||
481 | Storage::delete($worker->photo); | ||
482 | } | ||
483 | $params['photo'] = $request->file('photo')->store("worker/$worker->id", 'public'); | ||
484 | } | ||
485 | |||
486 | if ($request->has('file')) { | ||
487 | if (!empty($worker->file)) { | ||
488 | Storage::delete($worker->file); | ||
489 | } | ||
490 | $params['file'] = $request->file('file')->store("worker/$worker->id", 'public'); | ||
491 | } | ||
492 | |||
493 | $worker->update($params); | ||
494 | |||
495 | return redirect()->route('worker.cabinet'); | ||
496 | } | ||
497 | |||
476 | // Сообщения данные | 498 | // Сообщения данные |
477 | public function messages($type_message) | 499 | public function messages($type_message) |
478 | { | 500 | { |
479 | $user_id = Auth()->user()->id; | 501 | $user_id = Auth()->user()->id; |
480 | 502 | ||
481 | $messages_input = Message::query()->with('vacancies')->with('user_from')-> | 503 | $messages_input = Message::query()->with('vacancies')->with('user_from')-> |
482 | Where('to_user_id', $user_id)->OrderByDesc('created_at'); | 504 | Where('to_user_id', $user_id)->OrderByDesc('created_at'); |
483 | 505 | ||
484 | $messages_output = Message::query()->with('vacancies')-> | 506 | $messages_output = Message::query()->with('vacancies')-> |
485 | with('user_to')->where('user_id', $user_id)-> | 507 | with('user_to')->where('user_id', $user_id)-> |
486 | OrderByDesc('created_at'); | 508 | OrderByDesc('created_at'); |
487 | 509 | ||
488 | $count_input = $messages_input->count(); | 510 | $count_input = $messages_input->count(); |
489 | $count_output = $messages_output->count(); | 511 | $count_output = $messages_output->count(); |
490 | 512 | ||
491 | if ($type_message == 'input') { | 513 | if ($type_message == 'input') { |
492 | $messages = $messages_input->paginate(5); | 514 | $messages = $messages_input->paginate(5); |
493 | } | 515 | } |
494 | 516 | ||
495 | if ($type_message == 'output') { | 517 | if ($type_message == 'output') { |
496 | $messages = $messages_output->paginate(5); | 518 | $messages = $messages_output->paginate(5); |
497 | } | 519 | } |
498 | 520 | ||
499 | //dd($messages); | 521 | //dd($messages); |
500 | // Вернуть все 100% | 522 | // Вернуть все 100% |
501 | return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); | 523 | return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); |
502 | } | 524 | } |
503 | 525 | ||
504 | // Избранный | 526 | // Избранный |
505 | public function favorite() | 527 | public function favorite() |
506 | { | 528 | { |
507 | return view('workers.favorite'); | 529 | return view('workers.favorite'); |
508 | } | 530 | } |
509 | 531 | ||
510 | // Сменить пароль | 532 | // Сменить пароль |
511 | public function new_password() | 533 | public function new_password() |
512 | { | 534 | { |
513 | $email = Auth()->user()->email; | 535 | $email = Auth()->user()->email; |
514 | return view('workers.new_password', compact('email')); | 536 | return view('workers.new_password', compact('email')); |
515 | } | 537 | } |
516 | 538 | ||
517 | // Обновление пароля | 539 | // Обновление пароля |
518 | public function save_new_password(Request $request) { | 540 | public function save_new_password(Request $request) { |
519 | $use = Auth()->user(); | 541 | $use = Auth()->user(); |
520 | $request->validate([ | 542 | $request->validate([ |
521 | 'password' => 'required|string', | 543 | 'password' => 'required|string', |
522 | 'new_password' => 'required|string', | 544 | 'new_password' => 'required|string', |
523 | 'new_password2' => 'required|string' | 545 | 'new_password2' => 'required|string' |
524 | ]); | 546 | ]); |
525 | 547 | ||
526 | if ($request->get('new_password') == $request->get('new_password2')) | 548 | if ($request->get('new_password') == $request->get('new_password2')) |
527 | if ($request->get('password') !== $request->get('new_password')) { | 549 | if ($request->get('password') !== $request->get('new_password')) { |
528 | $credentials = $request->only('email', 'password'); | 550 | $credentials = $request->only('email', 'password'); |
529 | if (Auth::attempt($credentials, $request->has('save_me'))) { | 551 | if (Auth::attempt($credentials, $request->has('save_me'))) { |
530 | 552 | ||
531 | if (!is_null($use->email_verified_at)){ | 553 | if (!is_null($use->email_verified_at)){ |
532 | 554 | ||
533 | $user_data = User_Model::find($use->id); | 555 | $user_data = User_Model::find($use->id); |
534 | $user_data->update([ | 556 | $user_data->update([ |
535 | 'password' => Hash::make($request->get('new_password')), | 557 | 'password' => Hash::make($request->get('new_password')), |
536 | 'pubpassword' => base64_encode($request->get('new_password')), | 558 | 'pubpassword' => base64_encode($request->get('new_password')), |
537 | ]); | 559 | ]); |
538 | return redirect() | 560 | return redirect() |
539 | ->route('worker.new_password') | 561 | ->route('worker.new_password') |
540 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); | 562 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); |
541 | } | 563 | } |
542 | 564 | ||
543 | return redirect() | 565 | return redirect() |
544 | ->route('worker.new_password') | 566 | ->route('worker.new_password') |
545 | ->withError('Данная учетная запись не было верифицированна!'); | 567 | ->withError('Данная учетная запись не было верифицированна!'); |
546 | } | 568 | } |
547 | } | 569 | } |
548 | 570 | ||
549 | return redirect() | 571 | return redirect() |
550 | ->route('worker.new_password') | 572 | ->route('worker.new_password') |
551 | ->withErrors('Не совпадение данных, обновите пароли!'); | 573 | ->withErrors('Не совпадение данных, обновите пароли!'); |
552 | } | 574 | } |
553 | 575 | ||
554 | // Удаление профиля форма | 576 | // Удаление профиля форма |
555 | public function delete_profile() | 577 | public function delete_profile() |
556 | { | 578 | { |
557 | $login = Auth()->user()->email; | 579 | $login = Auth()->user()->email; |
558 | return view('workers.delete_profile', compact('login')); | 580 | return view('workers.delete_profile', compact('login')); |
559 | } | 581 | } |
560 | 582 | ||
561 | // Удаление профиля код | 583 | // Удаление профиля код |
562 | public function delete_profile_result(Request $request) { | 584 | public function delete_profile_result(Request $request) { |
563 | $Answer = $request->all(); | 585 | $Answer = $request->all(); |
564 | $user_id = Auth()->user()->id; | 586 | $user_id = Auth()->user()->id; |
565 | $request->validate([ | 587 | $request->validate([ |
566 | 'password' => 'required|string', | 588 | 'password' => 'required|string', |
567 | ]); | 589 | ]); |
568 | 590 | ||
569 | $credentials = $request->only('email', 'password'); | 591 | $credentials = $request->only('email', 'password'); |
570 | if (Auth::attempt($credentials)) { | 592 | if (Auth::attempt($credentials)) { |
571 | Auth::logout(); | 593 | Auth::logout(); |
572 | $it = User_Model::find($user_id); | 594 | $it = User_Model::find($user_id); |
573 | $it->delete(); | 595 | $it->delete(); |
574 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); | 596 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); |
575 | } else { | 597 | } else { |
576 | return redirect()->route('worker.delete_profile') | 598 | return redirect()->route('worker.delete_profile') |
577 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); | 599 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); |
578 | } | 600 | } |
579 | } | 601 | } |
580 | 602 | ||
581 | // Регистрация соискателя | 603 | // Регистрация соискателя |
582 | public function register_worker(Request $request) | 604 | public function register_worker(Request $request) |
583 | { | 605 | { |
584 | $params = $request->all(); | 606 | $params = $request->all(); |
585 | $params['is_worker'] = 1; | 607 | $params['is_worker'] = 1; |
586 | 608 | ||
587 | $rules = [ | 609 | $rules = [ |
588 | 'surname' => ['required', 'string', 'max:255'], | 610 | 'surname' => ['required', 'string', 'max:255'], |
589 | 'name_man' => ['required', 'string', 'max:255'], | 611 | 'name_man' => ['required', 'string', 'max:255'], |
590 | 'email' => ['required', 'email', 'max:255', 'unique:users'], | 612 | 'email' => ['required', 'email', 'max:255', 'unique:users'], |
591 | 'password' => ['required', 'string', 'min:6'] | 613 | 'password' => ['required', 'string', 'min:6'] |
592 | ]; | 614 | ]; |
593 | 615 | ||
594 | $messages = [ | 616 | $messages = [ |
595 | 'required' => 'Укажите обязательное поле', | 617 | 'required' => 'Укажите обязательное поле', |
596 | 'min' => [ | 618 | 'min' => [ |
597 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 619 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
598 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 620 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
599 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 621 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
600 | ], | 622 | ], |
601 | 'max' => [ | 623 | 'max' => [ |
602 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 624 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
603 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 625 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
604 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 626 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
605 | ] | 627 | ] |
606 | ]; | 628 | ]; |
607 | 629 | ||
608 | $email = $request->get('email'); | 630 | $email = $request->get('email'); |
609 | if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { | 631 | if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { |
610 | return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); | 632 | return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); |
611 | } | 633 | } |
612 | 634 | ||
613 | if ($request->get('password') !== $request->get('confirmed')){ | 635 | if ($request->get('password') !== $request->get('confirmed')){ |
614 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); | 636 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); |
615 | } | 637 | } |
616 | 638 | ||
617 | if (strlen($request->get('password')) < 6) { | 639 | if (strlen($request->get('password')) < 6) { |
618 | return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); | 640 | return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); |
619 | } | 641 | } |
620 | 642 | ||
621 | /*$haystack = $request->get('password'); | 643 | /*$haystack = $request->get('password'); |
622 | 644 | ||
623 | $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); | 645 | $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); |
624 | $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', | 646 | $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', |
625 | 'X', 'C', 'V', 'B', 'N', 'M'); | 647 | 'X', 'C', 'V', 'B', 'N', 'M'); |
626 | $lenpwd_bool = true; | 648 | $lenpwd_bool = true; |
627 | $spec_bool = false; | 649 | $spec_bool = false; |
628 | $alpha_bool = false; | 650 | $alpha_bool = false; |
629 | 651 | ||
630 | if (strlen($haystack) < 8) $lenpwd_bool = false; | 652 | if (strlen($haystack) < 8) $lenpwd_bool = false; |
631 | 653 | ||
632 | foreach ($specsumbol as $it) { | 654 | foreach ($specsumbol as $it) { |
633 | if (strpos($haystack, $it) !== false) { | 655 | if (strpos($haystack, $it) !== false) { |
634 | $spec_bool = true; | 656 | $spec_bool = true; |
635 | } | 657 | } |
636 | } | 658 | } |
637 | 659 | ||
638 | foreach ($alpha as $it) { | 660 | foreach ($alpha as $it) { |
639 | if (strpos($haystack, $it) !== false) { | 661 | if (strpos($haystack, $it) !== false) { |
640 | $alpha_bool = true; | 662 | $alpha_bool = true; |
641 | } | 663 | } |
642 | } | 664 | } |
643 | 665 | ||
644 | if ((!$spec_bool) || (!$alpha_bool)) { | 666 | if ((!$spec_bool) || (!$alpha_bool)) { |
645 | return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); | 667 | return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); |
646 | }*/ | 668 | }*/ |
647 | 669 | ||
648 | if (($request->has('politik')) && ($request->get('politik') == 1)) { | 670 | if (($request->has('politik')) && ($request->get('politik') == 1)) { |
649 | $validator = Validator::make($params, $rules, $messages); | 671 | $validator = Validator::make($params, $rules, $messages); |
650 | 672 | ||
651 | if ($validator->fails()) { | 673 | if ($validator->fails()) { |
652 | return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); | 674 | return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); |
653 | } else { | 675 | } else { |
654 | //dd($params); | 676 | //dd($params); |
655 | $user = $this->create($params); | 677 | $user = $this->create($params); |
656 | event(new Registered($user)); | 678 | event(new Registered($user)); |
657 | Auth::guard()->login($user); | 679 | Auth::guard()->login($user); |
658 | } | 680 | } |
659 | if ($user) { | 681 | if ($user) { |
660 | return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; | 682 | return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; |
661 | } else { | 683 | } else { |
662 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); | 684 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); |
663 | } | 685 | } |
664 | 686 | ||
665 | } else { | 687 | } else { |
666 | return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!")); | 688 | return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!")); |
667 | } | 689 | } |
668 | } | 690 | } |
669 | 691 | ||
670 | // Звездная оценка и ответ | 692 | // Звездная оценка и ответ |
671 | public function stars_answer(Request $request) { | 693 | public function stars_answer(Request $request) { |
672 | $params = $request->all(); | 694 | $params = $request->all(); |
673 | $rules = [ | 695 | $rules = [ |
674 | 'message' => ['required', 'string', 'max:255'], | 696 | 'message' => ['required', 'string', 'max:255'], |
675 | ]; | 697 | ]; |
676 | 698 | ||
677 | $messages = [ | 699 | $messages = [ |
678 | 'required' => 'Укажите обязательное поле', | 700 | 'required' => 'Укажите обязательное поле', |
679 | 'min' => [ | 701 | 'min' => [ |
680 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 702 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
681 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 703 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
682 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 704 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
683 | ], | 705 | ], |
684 | 'max' => [ | 706 | 'max' => [ |
685 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 707 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
686 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 708 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
687 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 709 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
688 | ] | 710 | ] |
689 | ]; | 711 | ]; |
690 | $response_worker = ResponseWork::create($params); | 712 | $response_worker = ResponseWork::create($params); |
691 | return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); | 713 | return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); |
692 | } | 714 | } |
693 | 715 | ||
694 | public function TestWorker() | 716 | public function TestWorker() |
695 | { | 717 | { |
696 | $Use = new User(); | 718 | $Use = new User(); |
697 | 719 | ||
698 | $Code_user = $Use->create([ | 720 | $Code_user = $Use->create([ |
699 | 'name' => 'surname name_man', | 721 | 'name' => 'surname name_man', |
700 | 'name_man' => 'name_man', | 722 | 'name_man' => 'name_man', |
701 | 'surname' => 'surname', | 723 | 'surname' => 'surname', |
702 | 'surname2' => 'surname2', | 724 | 'surname2' => 'surname2', |
703 | 'subscribe_email' => '1', | 725 | 'subscribe_email' => '1', |
704 | 'email' => 'email@mail.com', | 726 | 'email' => 'email@mail.com', |
705 | 'telephone' => '1234567890', | 727 | 'telephone' => '1234567890', |
706 | 'password' => Hash::make('password'), | 728 | 'password' => Hash::make('password'), |
707 | 'pubpassword' => base64_encode('password'), | 729 | 'pubpassword' => base64_encode('password'), |
708 | 'email_verified_at' => Carbon::now(), | 730 | 'email_verified_at' => Carbon::now(), |
709 | 'is_worker' => 1, | 731 | 'is_worker' => 1, |
710 | ]); | 732 | ]); |
711 | 733 | ||
712 | if ($Code_user->id > 0) { | 734 | if ($Code_user->id > 0) { |
713 | $Worker = new Worker(); | 735 | $Worker = new Worker(); |
714 | $Worker->user_id = $Code_user->id; | 736 | $Worker->user_id = $Code_user->id; |
715 | $Worker->position_work = 1; //'job_titles'; | 737 | $Worker->position_work = 1; //'job_titles'; |
716 | $Worker->email = 'email@email.com'; | 738 | $Worker->email = 'email@email.com'; |
717 | $Worker->telephone = '1234567890'; | 739 | $Worker->telephone = '1234567890'; |
718 | $status = $Worker->save(); | 740 | $status = $Worker->save(); |
719 | 741 | ||
720 | $Title_Worker = new Title_worker(); | 742 | $Title_Worker = new Title_worker(); |
721 | $Title_Worker->worker_id = $Worker->id; | 743 | $Title_Worker->worker_id = $Worker->id; |
722 | $Title_Worker->job_title_id = 1; | 744 | $Title_Worker->job_title_id = 1; |
723 | $Title_Worker->save(); | 745 | $Title_Worker->save(); |
724 | } | 746 | } |
725 | } | 747 | } |
726 | 748 | ||
727 | // Создание пользователя | 749 | // Создание пользователя |
728 | protected function create(array $data) | 750 | protected function create(array $data) |
729 | { | 751 | { |
730 | $Use = new User(); | 752 | $Use = new User(); |
731 | 753 | ||
732 | $Code_user = $Use->create([ | 754 | $Code_user = $Use->create([ |
733 | 'name' => $data['surname']." ".$data['name_man'], | 755 | 'name' => $data['surname']." ".$data['name_man'], |
734 | 'name_man' => $data['name_man'], | 756 | 'name_man' => $data['name_man'], |
735 | 'surname' => $data['surname'], | 757 | 'surname' => $data['surname'], |
736 | 'surname2' => $data['surname2'], | 758 | 'surname2' => $data['surname2'], |
737 | 'subscribe_email' => $data['email'], | 759 | 'subscribe_email' => $data['email'], |
738 | 'email' => $data['email'], | 760 | 'email' => $data['email'], |
739 | 'telephone' => $data['telephone'], | 761 | 'telephone' => $data['telephone'], |
740 | 'password' => Hash::make($data['password']), | 762 | 'password' => Hash::make($data['password']), |
741 | 'pubpassword' => base64_encode($data['password']), | 763 | 'pubpassword' => base64_encode($data['password']), |
742 | 'email_verified_at' => Carbon::now(), | 764 | 'email_verified_at' => Carbon::now(), |
743 | 'is_worker' => $data['is_worker'], | 765 | 'is_worker' => $data['is_worker'], |
744 | ]); | 766 | ]); |
745 | 767 | ||
746 | if ($Code_user->id > 0) { | 768 | if ($Code_user->id > 0) { |
747 | $Worker = new Worker(); | 769 | $Worker = new Worker(); |
748 | $Worker->user_id = $Code_user->id; | 770 | $Worker->user_id = $Code_user->id; |
749 | $Worker->position_work = $data['job_titles']; | 771 | $Worker->position_work = $data['job_titles']; |
750 | $Worker->email = $data['email']; | 772 | $Worker->email = $data['email']; |
751 | $Worker->telephone = $data['telephone']; | 773 | $Worker->telephone = $data['telephone']; |
752 | $Worker->save(); | 774 | $Worker->save(); |
753 | 775 | ||
754 | if (isset($Worker->id)) { | 776 | if (isset($Worker->id)) { |
755 | $Title_Worker = new Title_worker(); | 777 | $Title_Worker = new Title_worker(); |
756 | $Title_Worker->worker_id = $Worker->id; | 778 | $Title_Worker->worker_id = $Worker->id; |
757 | $Title_Worker->job_title_id = $data['job_titles']; | 779 | $Title_Worker->job_title_id = $data['job_titles']; |
758 | $Title_Worker->save(); | 780 | $Title_Worker->save(); |
759 | } | 781 | } |
760 | 782 | ||
761 | return $Code_user; | 783 | return $Code_user; |
762 | } | 784 | } |
763 | } | 785 | } |
764 | 786 | ||
765 | // Вакансии избранные | 787 | // Вакансии избранные |
766 | public function colorado(Request $request) { | 788 | public function colorado(Request $request) { |
767 | $IP_address = RusDate::ip_addr_client(); | 789 | $IP_address = RusDate::ip_addr_client(); |
768 | $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); | 790 | $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); |
769 | 791 | ||
770 | if ($Arr->count()) { | 792 | if ($Arr->count()) { |
771 | $A = Array(); | 793 | $A = Array(); |
772 | foreach ($Arr as $it) { | 794 | foreach ($Arr as $it) { |
773 | $A[] = $it->code_record; | 795 | $A[] = $it->code_record; |
774 | } | 796 | } |
775 | 797 | ||
776 | $Query = Ad_employer::query()->whereIn('id', $A); | 798 | $Query = Ad_employer::query()->whereIn('id', $A); |
777 | } else { | 799 | } else { |
778 | $Query = Ad_employer::query()->where('id', '=', '0'); | 800 | $Query = Ad_employer::query()->where('id', '=', '0'); |
779 | } | 801 | } |
780 | 802 | ||
781 | $Query = $Query->with('jobs')-> | 803 | $Query = $Query->with('jobs')-> |
782 | with('cat')-> | 804 | with('cat')-> |
783 | with('employer')-> | 805 | with('employer')-> |
784 | whereHas('jobs_code', function ($query) use ($request) { | 806 | whereHas('jobs_code', function ($query) use ($request) { |
785 | if ($request->ajax()) { | 807 | if ($request->ajax()) { |
786 | if (null !== ($request->get('job'))) { | 808 | if (null !== ($request->get('job'))) { |
787 | $query->where('job_title_id', $request->get('job')); | 809 | $query->where('job_title_id', $request->get('job')); |
788 | } | 810 | } |
789 | } | 811 | } |
790 | })->select('ad_employers.*'); | 812 | })->select('ad_employers.*'); |
791 | 813 | ||
792 | $Job_title = Job_title::query()->OrderBy('name')->get(); | 814 | $Job_title = Job_title::query()->OrderBy('name')->get(); |
793 | 815 | ||
794 | $Query_count = $Query->count(); | 816 | $Query_count = $Query->count(); |
795 | 817 | ||
796 | $Query = $Query->OrderBy('updated_at')->paginate(3); | 818 | $Query = $Query->OrderBy('updated_at')->paginate(3); |
797 | 819 | ||
798 | 820 | ||
799 | return view('workers.favorite', compact('Query', | 821 | return view('workers.favorite', compact('Query', |
800 | 'Query_count', | 822 | 'Query_count', |
801 | 'Job_title')); | 823 | 'Job_title')); |
802 | 824 | ||
803 | } | 825 | } |
804 | 826 | ||
805 | //Переписка | 827 | //Переписка |
806 | public function dialog(User_Model $user1, User_Model $user2, Request $request) { | 828 | public function dialog(User_Model $user1, User_Model $user2, Request $request) { |
807 | // Получение параметров. | 829 | // Получение параметров. |
808 | if ($request->has('ad_employer')){ | 830 | if ($request->has('ad_employer')){ |
809 | $ad_employer = $request->get('ad_employer'); | 831 | $ad_employer = $request->get('ad_employer'); |
810 | } else { | 832 | } else { |
811 | $ad_employer = 0; | 833 | $ad_employer = 0; |
812 | } | 834 | } |
813 | 835 | ||
814 | if (isset($user1->id)) { | 836 | if (isset($user1->id)) { |
815 | $sender = User_Model::query()->with('workers')-> | 837 | $sender = User_Model::query()->with('workers')-> |
816 | with('employers')-> | 838 | with('employers')-> |
817 | where('id', $user1->id)->first(); | 839 | where('id', $user1->id)->first(); |
818 | } | 840 | } |
819 | 841 | ||
820 | if (isset($user2->id)) { | 842 | if (isset($user2->id)) { |
821 | $companion = User_Model::query()->with('workers')-> | 843 | $companion = User_Model::query()->with('workers')-> |
822 | with('employers')-> | 844 | with('employers')-> |
823 | where('id', $user2->id)->first(); | 845 | where('id', $user2->id)->first(); |
824 | } | 846 | } |
825 | 847 | ||
826 | $Messages = Message::query()-> | 848 | $Messages = Message::query()-> |
827 | //with('response')-> | 849 | //with('response')-> |
828 | where(function($query) use ($user1, $user2) { | 850 | where(function($query) use ($user1, $user2) { |
829 | $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); | 851 | $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); |
830 | })->orWhere(function($query) use ($user1, $user2) { | 852 | })->orWhere(function($query) use ($user1, $user2) { |
831 | $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); | 853 | $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); |
832 | })->OrderBy('created_at')->get(); | 854 | })->OrderBy('created_at')->get(); |
833 | 855 | ||
834 | $id_vac = null; | 856 | $id_vac = null; |
835 | /*foreach ($Messages as $it) { | 857 | /*foreach ($Messages as $it) { |
836 | if (isset($it->response)) { | 858 | if (isset($it->response)) { |
837 | foreach ($it->response as $r) { | 859 | foreach ($it->response as $r) { |
838 | if (isset($r->ad_employer_id)) { | 860 | if (isset($r->ad_employer_id)) { |
839 | $id_vac = $r->ad_employer_id; | 861 | $id_vac = $r->ad_employer_id; |
840 | break; | 862 | break; |
841 | } | 863 | } |
842 | } | 864 | } |
843 | } | 865 | } |
844 | if (!is_null($id_vac)) break; | 866 | if (!is_null($id_vac)) break; |
845 | }*/ | 867 | }*/ |
846 | 868 | ||
847 | //$ad_employer = null; | 869 | //$ad_employer = null; |
848 | //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); | 870 | //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); |
849 | 871 | ||
850 | return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); | 872 | return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); |
851 | } | 873 | } |
852 | 874 | ||
853 | // Даунылоады | 875 | // Даунылоады |
854 | public function download(Worker $worker) { | 876 | public function download(Worker $worker) { |
855 | $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; | 877 | $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; |
856 | view()->share('house',$arr_house); | 878 | view()->share('house',$arr_house); |
857 | $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); | 879 | $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); |
858 | return $pdf->stream(); | 880 | return $pdf->stream(); |
859 | } | 881 | } |
860 | 882 | ||
861 | // Поднятие анкеты | 883 | // Поднятие анкеты |
862 | public function up(Worker $worker) { | 884 | public function up(Worker $worker) { |
863 | $worker->updated_at = Carbon::now(); | 885 | $worker->updated_at = Carbon::now(); |
864 | $worker->save(); | 886 | $worker->save(); |
865 | // 0 | 887 | // 0 |
866 | return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); | 888 | return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); |
867 | } | 889 | } |
868 | 890 | ||
869 | // Форма сертификате | 891 | // Форма сертификате |
870 | public function new_sertificate(Worker $worker) { | 892 | public function new_sertificate(Worker $worker) { |
871 | return view('workers.sertificate_add', compact('worker')); | 893 | return view('workers.sertificate_add', compact('worker')); |
872 | } | 894 | } |
873 | 895 | ||
874 | // Добавление сертификата | 896 | // Добавление сертификата |
875 | public function add_serificate(SertificationRequest $request) { | 897 | public function add_serificate(SertificationRequest $request) { |
876 | $request->validate([ | 898 | $request->validate([ |
877 | 'name' => 'required|string|max:255', | 899 | 'name' => 'required|string|max:255', |
878 | 'end_begin' => 'required|date|date_format:d.m.Y' | 900 | 'end_begin' => 'required|date|date_format:d.m.Y' |
879 | ], | 901 | ], |
880 | [ | 902 | [ |
881 | 'name' => 'Навание сертификата обязательно для заполнения.', | 903 | 'name' => 'Навание сертификата обязательно для заполнения.', |
882 | 'end_begin' => 'Формат даты должен соответствовать дд.мм.гггг' | 904 | 'end_begin' => 'Формат даты должен соответствовать дд.мм.гггг' |
883 | ]); | 905 | ]); |
884 | 906 | ||
885 | $params = $request->all(); | 907 | $params = $request->all(); |
886 | 908 | ||
887 | $end_begin = DateTime::createFromFormat('d.m.Y', $params['end_begin']); | 909 | $end_begin = DateTime::createFromFormat('d.m.Y', $params['end_begin']); |
888 | $params['end_begin'] = $end_begin->format('Y-m-d'); | 910 | $params['end_begin'] = $end_begin->format('Y-m-d'); |
889 | 911 | ||
890 | $Sertificate = new sertification(); | 912 | $Sertificate = new sertification(); |
891 | $Sertificate->create($params); | 913 | $Sertificate->create($params); |
892 | $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get(); | 914 | $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get(); |
893 | return redirect()->route('worker.cabinet'); | 915 | return redirect()->route('worker.cabinet'); |
894 | //return view('ajax.documents', compact('Docs')); | 916 | //return view('ajax.documents', compact('Docs')); |
895 | } | 917 | } |
896 | 918 | ||
897 | // Удалить сертификат | 919 | // Удалить сертификат |
898 | public function delete_sertificate(sertification $doc) { | 920 | public function delete_sertificate(sertification $doc) { |
899 | $doc->delete(); | 921 | $doc->delete(); |
900 | 922 | ||
901 | return redirect()->route('worker.cabinet'); | 923 | return redirect()->route('worker.cabinet'); |
902 | } | 924 | } |
903 | 925 | ||
904 | // Редактирование сертификата | 926 | // Редактирование сертификата |
905 | public function edit_sertificate(Worker $worker, sertification $doc) { | 927 | public function edit_sertificate(Worker $worker, sertification $doc) { |
906 | return view('workers.sertificate_edit', compact('doc', 'worker')); | 928 | return view('workers.sertificate_edit', compact('doc', 'worker')); |
907 | } | 929 | } |
908 | 930 | ||
909 | // Редактирование обновление сертификата | 931 | // Редактирование обновление сертификата |
910 | public function update_serificate(SertificationRequest $request, sertification $doc) { | 932 | public function update_serificate(SertificationRequest $request, sertification $doc) { |
911 | $request->validate([ | 933 | $request->validate([ |
912 | 'name' => 'required|string|max:255', | 934 | 'name' => 'required|string|max:255', |
913 | 'end_begin' => 'required|date|date_format:d.m.Y' | 935 | 'end_begin' => 'required|date|date_format:d.m.Y' |
914 | ], | 936 | ], |
915 | [ | 937 | [ |
916 | 'name' => 'Навание сертификата обязательно для заполнения.', | 938 | 'name' => 'Навание сертификата обязательно для заполнения.', |
917 | 'end_begin' => 'Формат даты должен соответствовать дд.мм.гггг' | 939 | 'end_begin' => 'Формат даты должен соответствовать дд.мм.гггг' |
918 | ]); | 940 | ]); |
919 | 941 | ||
920 | $all = $request->all(); | 942 | $all = $request->all(); |
921 | 943 | ||
922 | $end_begin = DateTime::createFromFormat('d.m.Y', $all['end_begin']); | 944 | $end_begin = DateTime::createFromFormat('d.m.Y', $all['end_begin']); |
923 | $all['end_begin'] = $end_begin->format('Y-m-d'); | 945 | $all['end_begin'] = $end_begin->format('Y-m-d'); |
924 | 946 | ||
925 | $doc->worker_id = $all['worker_id']; | 947 | $doc->worker_id = $all['worker_id']; |
926 | $doc->name = $all['name']; | 948 | $doc->name = $all['name']; |
927 | $doc->end_begin = $all['end_begin']; | 949 | $doc->end_begin = $all['end_begin']; |
928 | $doc->save(); | 950 | $doc->save(); |
929 | 951 | ||
930 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); | 952 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); |
931 | } | 953 | } |
932 | 954 | ||
933 | public function delete_add_diplom(Request $request, Worker $worker) { | 955 | public function delete_add_diplom(Request $request, Worker $worker) { |
934 | $infoblok_id = $request->get('infoblok_id'); | 956 | $infoblok_id = $request->get('infoblok_id'); |
935 | 957 | ||
936 | if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0) | 958 | if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0) |
937 | $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete(); | 959 | $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete(); |
938 | else { | 960 | else { |
939 | $params['infoblok_id'] = $infoblok_id; | 961 | $params['infoblok_id'] = $infoblok_id; |
940 | $params['worker_id'] = $worker->id; | 962 | $params['worker_id'] = $worker->id; |
941 | $params['status'] = $request->get('val'); | 963 | $params['status'] = $request->get('val'); |
942 | $id = Dop_info::create($params); | 964 | $id = Dop_info::create($params); |
943 | //$id = $worker->infobloks()->sync([$infoblok_id]); | 965 | //$id = $worker->infobloks()->sync([$infoblok_id]); |
944 | } | 966 | } |
945 | 967 | ||
946 | //$Infoblocks = infobloks::query()->get(); | 968 | //$Infoblocks = infobloks::query()->get(); |
947 | return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks')); | 969 | return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks')); |
948 | } | 970 | } |
949 | 971 | ||
950 | 972 | ||
951 | 973 | ||
952 | // Добавление диплома | 974 | // Добавление диплома |
953 | public function add_diplom_ajax(Request $request) { | 975 | public function add_diplom_ajax(Request $request) { |
954 | // конец | 976 | // конец |
955 | $params = $request->all(); | 977 | $params = $request->all(); |
956 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); | 978 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); |
957 | 979 | ||
958 | if ($count == 0) $dop_info = Dop_info::create($params); | 980 | if ($count == 0) $dop_info = Dop_info::create($params); |
959 | $Infoblocks = infobloks::query()->get(); | 981 | $Infoblocks = infobloks::query()->get(); |
960 | $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); | 982 | $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); |
961 | $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); | 983 | $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); |
962 | return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); | 984 | return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); |
963 | } | 985 | } |
964 | 986 | ||
965 | // Добавление диплома без ajax | 987 | // Добавление диплома без ajax |
966 | public function add_diplom(Worker $worker) { | 988 | public function add_diplom(Worker $worker) { |
967 | $worker_id = $worker->id; | 989 | $worker_id = $worker->id; |
968 | $Infoblocks = infobloks::query()->get(); | 990 | $Infoblocks = infobloks::query()->get(); |
969 | return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); | 991 | return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); |
970 | } | 992 | } |
971 | // Сохранить | 993 | // Сохранить |
972 | // Сохраняю диплом | 994 | // Сохраняю диплом |
973 | public function add_diplom_save(Request $request) { | 995 | public function add_diplom_save(Request $request) { |
974 | $params = $request->all(); | 996 | $params = $request->all(); |
975 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); | 997 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); |
976 | if ($count == 0) $dop_info = Dop_info::create($params); | 998 | if ($count == 0) $dop_info = Dop_info::create($params); |
977 | return redirect()->route('worker.cabinet'); | 999 | return redirect()->route('worker.cabinet'); |
978 | } | 1000 | } |
979 | 1001 | ||
980 | // Добавление стандартного документа | 1002 | // Добавление стандартного документа |
981 | public function add_document(Worker $worker) { | 1003 | public function add_document(Worker $worker) { |
982 | return view('workers.docs', compact('worker')); | 1004 | return view('workers.docs', compact('worker')); |
983 | } | 1005 | } |
984 | 1006 | ||
985 | //Сохранение стандартого документа | 1007 | //Сохранение стандартого документа |
986 | public function add_document_save(DocumentsRequest $request) { | 1008 | public function add_document_save(DocumentsRequest $request) { |
987 | $params = $request->all(); | 1009 | $params = $request->all(); |
988 | $place_work = place_works::create($params); | 1010 | $place_work = place_works::create($params); |
989 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!'); | 1011 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!'); |
990 | } | 1012 | } |
991 | 1013 | ||
992 | // Редактирование документа | 1014 | // Редактирование документа |
993 | public function edit_document(place_works $doc, Worker $worker) { | 1015 | public function edit_document(place_works $doc, Worker $worker) { |
994 | return view('workers.docs-edit', compact('doc', 'worker')); | 1016 | return view('workers.docs-edit', compact('doc', 'worker')); |
995 | } | 1017 | } |
996 | 1018 | ||
997 | //Сохранение отредактированного документа | 1019 | //Сохранение отредактированного документа |
998 | public function edit_document_save(DocumentsRequest $request, place_works $doc) { | 1020 | public function edit_document_save(DocumentsRequest $request, place_works $doc) { |
999 | $params = $request->all(); | 1021 | $params = $request->all(); |
1000 | $doc->update($params); | 1022 | $doc->update($params); |
1001 | 1023 | ||
1002 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); | 1024 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); |
1003 | } | 1025 | } |
1004 | 1026 | ||
1005 | // Удаление документа | 1027 | // Удаление документа |
1006 | public function delete_document(place_works $doc) { | 1028 | public function delete_document(place_works $doc) { |
1007 | $doc->delete(); | 1029 | $doc->delete(); |
1008 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); | 1030 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); |
1009 | } | 1031 | } |
1010 | 1032 | ||
1011 | //Отправка нового сообщения | 1033 | //Отправка нового сообщения |
1012 | public function new_message(Request $request) { | 1034 | public function new_message(Request $request) { |
1013 | $params = $request->all(); | 1035 | $params = $request->all(); |
1014 | 1036 | ||
1015 | $id = $params['send_user_id']; | 1037 | $id = $params['send_user_id']; |
1016 | $message = new Message(); | 1038 | $message = new Message(); |
1017 | $message->user_id = $params['send_user_id']; | 1039 | $message->user_id = $params['send_user_id']; |
1018 | $message->to_user_id = $params['send_to_user_id']; | 1040 | $message->to_user_id = $params['send_to_user_id']; |
1019 | $message->title = $params['send_title']; | 1041 | $message->title = $params['send_title']; |
1020 | $message->text = $params['send_text']; | 1042 | $message->text = $params['send_text']; |
1021 | $message->ad_employer_id = $params['send_vacancy']; | 1043 | $message->ad_employer_id = $params['send_vacancy']; |
1022 | if ($request->has('send_file')) { | 1044 | if ($request->has('send_file')) { |
1023 | $message->file = $request->file('send_file')->store("worker/$id", 'public'); | 1045 | $message->file = $request->file('send_file')->store("worker/$id", 'public'); |
1024 | } | 1046 | } |
1025 | $message->flag_new = 1; | 1047 | $message->flag_new = 1; |
1026 | $id_message = $message->save(); | 1048 | $id_message = $message->save(); |
1027 | 1049 | ||
1028 | $data['message_id'] = $id_message; | 1050 | $data['message_id'] = $id_message; |
1029 | $data['ad_employer_id'] = $params['send_vacancy']; | 1051 | $data['ad_employer_id'] = $params['send_vacancy']; |
1030 | $data['job_title_id'] = $params['send_job_title_id']; | 1052 | $data['job_title_id'] = $params['send_job_title_id']; |
1031 | $data['flag'] = 1; | 1053 | $data['flag'] = 1; |
1032 | $ad_responce = ad_response::create($data); | 1054 | $ad_responce = ad_response::create($data); |
1033 | return redirect()->route('worker.messages', ['type_message' => 'output']); | 1055 | return redirect()->route('worker.messages', ['type_message' => 'output']); |
1034 | } | 1056 | } |
1035 | 1057 | ||
1036 | 1058 | ||
1037 | public function test123(Request $request) { | 1059 | public function test123(Request $request) { |
1038 | $params = $request->all(); | 1060 | $params = $request->all(); |
1039 | $user1 = $params['user_id']; | 1061 | $user1 = $params['user_id']; |
1040 | $user2 = $params['to_user_id']; | 1062 | $user2 = $params['to_user_id']; |
1041 | $id_vacancy = $params['ad_employer_id']; | 1063 | $id_vacancy = $params['ad_employer_id']; |
1042 | $ad_name = $params['ad_name']; | 1064 | $ad_name = $params['ad_name']; |
1043 | 1065 | ||
1044 | $rules = [ | 1066 | $rules = [ |
1045 | 'text' => 'required|min:1|max:150000', | 1067 | 'text' => 'required|min:1|max:150000', |
1046 | 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' | 1068 | 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' |
1047 | ]; | 1069 | ]; |
1048 | $messages = [ | 1070 | $messages = [ |
1049 | 'required' => 'Укажите обязательное поле', | 1071 | 'required' => 'Укажите обязательное поле', |
1050 | 'min' => [ | 1072 | 'min' => [ |
1051 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 1073 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
1052 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 1074 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
1053 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 1075 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
1054 | ], | 1076 | ], |
1055 | 'max' => [ | 1077 | 'max' => [ |
1056 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 1078 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
1057 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 1079 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
1058 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 1080 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
1059 | ] | 1081 | ] |
1060 | ]; | 1082 | ]; |
1061 | 1083 | ||
1062 | $validator = Validator::make($request->all(), $rules, $messages); | 1084 | $validator = Validator::make($request->all(), $rules, $messages); |
1063 | 1085 | ||
1064 | if ($validator->fails()) { | 1086 | if ($validator->fails()) { |
1065 | return redirect()->route('worker.dialog', ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]) | 1087 | return redirect()->route('worker.dialog', ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]) |
1066 | ->withErrors($validator); | 1088 | ->withErrors($validator); |
1067 | } else { | 1089 | } else { |
1068 | if ($request->has('file')) { | 1090 | if ($request->has('file')) { |
1069 | $params['file'] = $request->file('file')->store("messages", 'public'); | 1091 | $params['file'] = $request->file('file')->store("messages", 'public'); |
1070 | } | 1092 | } |
1071 | Message::create($params); | 1093 | Message::create($params); |
1072 | //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); | 1094 | //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); |
1073 | return redirect()->route('worker.dialog', | 1095 | return redirect()->route('worker.dialog', |
1074 | ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]); | 1096 | ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]); |
1075 | 1097 | ||
1076 | } | 1098 | } |
1077 | } | 1099 | } |
1078 | 1100 | ||
1079 | // Информация о предыдущих компаниях | 1101 | // Информация о предыдущих компаниях |
1080 | public function new_prev_company(Worker $worker) { | 1102 | public function new_prev_company(Worker $worker) { |
1081 | return view('workers.prev_company_form', compact('worker')); | 1103 | return view('workers.prev_company_form', compact('worker')); |
1082 | } | 1104 | } |
1083 | 1105 | ||
1084 | // Добавление контакта компании | 1106 | // Добавление контакта компании |
1085 | public function add_prev_company(PrevCompanyRequest $request) { | 1107 | public function add_prev_company(PrevCompanyRequest $request) { |
1086 | // Возвращение параметров | 1108 | // Возвращение параметров |
1087 | $all = $request->all(); | 1109 | $all = $request->all(); |
1088 | $PrevCompany = PrevCompany::create($all); | 1110 | $PrevCompany = PrevCompany::create($all); |
1089 | 1111 | ||
1090 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись'); | 1112 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись'); |
1091 | } | 1113 | } |
1092 | 1114 | ||
1093 | // Редактирование контакта компании | 1115 | // Редактирование контакта компании |
1094 | public function edit_prev_company(PrevCompany $doc, Worker $worker) { | 1116 | public function edit_prev_company(PrevCompany $doc, Worker $worker) { |
1095 | return view('workers.prev_company_edit_form', compact('doc', 'worker')); | 1117 | return view('workers.prev_company_edit_form', compact('doc', 'worker')); |
1096 | } | 1118 | } |
1097 | 1119 | ||
1098 | //Сохранение редактирования контакта компании | 1120 | //Сохранение редактирования контакта компании |
1099 | public function update_prev_company(PrevCompany $doc, Request $request){ | 1121 | public function update_prev_company(PrevCompany $doc, Request $request){ |
1100 | $all = $request->all(); | 1122 | $all = $request->all(); |
1101 | $doc->update($all); | 1123 | $doc->update($all); |
1102 | 1124 | ||
1103 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись'); | 1125 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись'); |
1104 | } | 1126 | } |
1105 | 1127 | ||
1106 | // Удаление контакта предыдущей компании | 1128 | // Удаление контакта предыдущей компании |
1107 | public function delete_prev_company(PrevCompany $doc) { | 1129 | public function delete_prev_company(PrevCompany $doc) { |
1108 | $doc->delete(); | 1130 | $doc->delete(); |
1109 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); | 1131 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); |
1110 | } | 1132 | } |
1111 | } | 1133 | } |
1112 | 1134 | ||
1113 | 1135 |
resources/views/resume.blade.php
1 | @extends('layout.frontend', ['title' => 'База резюме - РекаМоре']) | 1 | @extends('layout.frontend', ['title' => 'База резюме - РекаМоре']) |
2 | 2 | ||
3 | @section('scripts') | 3 | @section('scripts') |
4 | <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script> | 4 | <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script> |
5 | <script> | 5 | <script> |
6 | console.log('Test system'); | 6 | console.log('Test system'); |
7 | $(document).on('change', '#jobs', function() { | 7 | $(document).on('change', '#jobs', function() { |
8 | var val = $(this).val(); | 8 | var val = $(this).val(); |
9 | var main_oskar = $('#main_ockar'); | 9 | var main_oskar = $('#main_ockar'); |
10 | 10 | ||
11 | console.log('Code='+val); | 11 | console.log('Code='+val); |
12 | console.log('Click change...'); | 12 | console.log('Click change...'); |
13 | $.ajax({ | 13 | $.ajax({ |
14 | type: "GET", | 14 | type: "GET", |
15 | url: "", | 15 | url: "", |
16 | data: "job="+val, | 16 | data: "job="+val, |
17 | success: function (data) { | 17 | success: function (data) { |
18 | console.log('Выбор сделан!'); | 18 | console.log('Выбор сделан!'); |
19 | console.log(data); | 19 | console.log(data); |
20 | main_oskar.html(data); | 20 | main_oskar.html(data); |
21 | }, | 21 | }, |
22 | headers: { | 22 | headers: { |
23 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 23 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
24 | }, | 24 | }, |
25 | error: function (data) { | 25 | error: function (data) { |
26 | data = JSON.stringify(data); | 26 | data = JSON.stringify(data); |
27 | console.log('Error: ' + data); | 27 | console.log('Error: ' + data); |
28 | } | 28 | } |
29 | }); | 29 | }); |
30 | }); | 30 | }); |
31 | </script> | 31 | </script> |
32 | 32 | ||
33 | <script> | 33 | <script> |
34 | $(document).ready(function() { | 34 | $(document).ready(function() { |
35 | $(document).on('click', '.js_box_favorites', function () { | 35 | $(document).on('click', '.js_box_favorites', function () { |
36 | var _this = $(this); | 36 | var _this = $(this); |
37 | var id_worker = _this.attr('data-val'); | 37 | var id_worker = _this.attr('data-val'); |
38 | 38 | ||
39 | if (_this.hasClass('active')) { | 39 | if (_this.hasClass('active')) { |
40 | add_in_array(id_worker); | 40 | add_in_array(id_worker); |
41 | console.log('Добавлено в избранное id=' + id_worker); | 41 | console.log('Добавлено в избранное id=' + id_worker); |
42 | } else { | 42 | } else { |
43 | delete_in_array(id_worker); | 43 | delete_in_array(id_worker); |
44 | console.log('Удалено из избранных id='+id_worker) | 44 | console.log('Удалено из избранных id='+id_worker) |
45 | } | 45 | } |
46 | var str = $.cookie('favorite_worker'); | 46 | var str = $.cookie('favorite_worker'); |
47 | console.log("Вывод куков "+str); | 47 | console.log("Вывод куков "+str); |
48 | 48 | ||
49 | }); | 49 | }); |
50 | }); | 50 | }); |
51 | 51 | ||
52 | //помеченный элемент | 52 | //помеченный элемент |
53 | function selected_item(obj) { | 53 | function selected_item(obj) { |
54 | var arr = read_array(); | 54 | var arr = read_array(); |
55 | var index = arr.indexOf(obj); | 55 | var index = arr.indexOf(obj); |
56 | 56 | ||
57 | if (index > 0) | 57 | if (index > 0) |
58 | return "active"; | 58 | return "active"; |
59 | else | 59 | else |
60 | return ""; | 60 | return ""; |
61 | } | 61 | } |
62 | 62 | ||
63 | // запись элемента массива в cookie | 63 | // запись элемента массива в cookie |
64 | function add_in_array(obj){ | 64 | function add_in_array(obj){ |
65 | var arr = read_array();//получаем текущее состояние массива | 65 | var arr = read_array();//получаем текущее состояние массива |
66 | arr[arr.length]=obj; //добавляем элемент в конец | 66 | arr[arr.length]=obj; //добавляем элемент в конец |
67 | //var str = JSON.stringify(arr);//конвертируем в строку | 67 | //var str = JSON.stringify(arr);//конвертируем в строку |
68 | //$.cookie('arr',str);//записываем массив в куки | 68 | //$.cookie('arr',str);//записываем массив в куки |
69 | $.cookie('favorite_worker', JSON.stringify(arr)); | 69 | $.cookie('favorite_worker', JSON.stringify(arr)); |
70 | 70 | ||
71 | } | 71 | } |
72 | 72 | ||
73 | // удаление элемента из массива в cookie | 73 | // удаление элемента из массива в cookie |
74 | function delete_in_array(obj) { | 74 | function delete_in_array(obj) { |
75 | var arr = read_array(); | 75 | var arr = read_array(); |
76 | var unique = [...new Set(arr)] | 76 | var unique = [...new Set(arr)] |
77 | var index = unique.indexOf(obj); | 77 | var index = unique.indexOf(obj); |
78 | 78 | ||
79 | unique.splice(index, 1); | 79 | unique.splice(index, 1); |
80 | 80 | ||
81 | //var str = JSON.stringify(arr);//конвертируем в строку | 81 | //var str = JSON.stringify(arr);//конвертируем в строку |
82 | //$.cookie('arr',str);//записываем массив в куки | 82 | //$.cookie('arr',str);//записываем массив в куки |
83 | $.cookie('favorite_worker', JSON.stringify(unique)); | 83 | $.cookie('favorite_worker', JSON.stringify(unique)); |
84 | 84 | ||
85 | } | 85 | } |
86 | 86 | ||
87 | function read_array(){ | 87 | function read_array(){ |
88 | var dataArr=$.cookie('favorite_worker');//считываем данные из куков | 88 | var dataArr=$.cookie('favorite_worker');//считываем данные из куков |
89 | 89 | ||
90 | //если массив не был обнаружен, иницилизируем его | 90 | //если массив не был обнаружен, иницилизируем его |
91 | if(dataArr===null){ | 91 | if(dataArr===null){ |
92 | dataArr = init_array(); //возвращаем инициализированный пустой маасив | 92 | dataArr = init_array(); //возвращаем инициализированный пустой маасив |
93 | } | 93 | } |
94 | //возвращаем полученный массив | 94 | //возвращаем полученный массив |
95 | //return JSON.parse(dataArr); | 95 | //return JSON.parse(dataArr); |
96 | return JSON.parse(dataArr); | 96 | return JSON.parse(dataArr); |
97 | } | 97 | } |
98 | 98 | ||
99 | //другими словами создаем пустой массив | 99 | //другими словами создаем пустой массив |
100 | function init_array(){ | 100 | function init_array(){ |
101 | //var str = JSON.stringify(new Array());//конвертируем в строку | 101 | //var str = JSON.stringify(new Array());//конвертируем в строку |
102 | var str = JSON.stringify(new Array()); | 102 | var str = JSON.stringify(new Array()); |
103 | $.cookie('favorite_worker',str);//записываем массив в куки | 103 | $.cookie('favorite_worker',str);//записываем массив в куки |
104 | 104 | ||
105 | return str; | 105 | return str; |
106 | } | 106 | } |
107 | </script> | 107 | </script> |
108 | <script> | 108 | <script> |
109 | $(document).on('click', '.js_it_button', function() { | 109 | $(document).on('click', '.js_it_button', function() { |
110 | var this_ = $(this); | 110 | var this_ = $(this); |
111 | var code_user_id = this_.attr('data-uid'); | 111 | var code_user_id = this_.attr('data-uid'); |
112 | var code_to_user_id = this_.attr('data-tuid'); | 112 | var code_to_user_id = this_.attr('data-tuid'); |
113 | var code_vacancy = this_.attr('data-vacancy'); | 113 | var code_vacancy = this_.attr('data-vacancy'); |
114 | var user_id = $('#_user_id'); | 114 | var user_id = $('#_user_id'); |
115 | var to_user_id = $('#_to_user_id'); | 115 | var to_user_id = $('#_to_user_id'); |
116 | var vacancy = $('#_vacancy'); | 116 | var vacancy = $('#_vacancy'); |
117 | 117 | ||
118 | console.log('code_to_user_id='+code_to_user_id); | 118 | console.log('code_to_user_id='+code_to_user_id); |
119 | console.log('code_user_id='+code_user_id); | 119 | console.log('code_user_id='+code_user_id); |
120 | console.log('code_vacancy='+code_vacancy); | 120 | console.log('code_vacancy='+code_vacancy); |
121 | console.log('Клик на кнопке...'); | 121 | console.log('Клик на кнопке...'); |
122 | 122 | ||
123 | user_id.val(code_user_id); | 123 | user_id.val(code_user_id); |
124 | to_user_id.val(code_to_user_id); | 124 | to_user_id.val(code_to_user_id); |
125 | vacancy.val(code_vacancy); | 125 | vacancy.val(code_vacancy); |
126 | }); | 126 | }); |
127 | </script> | 127 | </script> |
128 | <script> | 128 | <script> |
129 | $(document).on('change', '#sort_ajax', function() { | 129 | $(document).on('change', '#sort_ajax', function() { |
130 | var this_ = $(this); | 130 | var this_ = $(this); |
131 | var val_ = this_.val(); | 131 | var val_ = this_.val(); |
132 | console.log('sort items '+val_); | 132 | console.log('sort items '+val_); |
133 | 133 | ||
134 | $.ajax({ | 134 | $.ajax({ |
135 | type: "GET", | 135 | type: "GET", |
136 | url: "{{ route('bd_resume') }}", | 136 | url: "{{ route('bd_resume') }}", |
137 | data: "sort="+val_+"&block=1", | 137 | data: "sort="+val_+"&block=1", |
138 | success: function (data) { | 138 | success: function (data) { |
139 | console.log('Выбор сортировки'); | 139 | console.log('Выбор сортировки'); |
140 | console.log(data); | 140 | console.log(data); |
141 | $('#block1').html(data); | 141 | $('#block1').html(data); |
142 | history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); | 142 | history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); |
143 | }, | 143 | }, |
144 | headers: { | 144 | headers: { |
145 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 145 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
146 | }, | 146 | }, |
147 | error: function (data) { | 147 | error: function (data) { |
148 | data = JSON.stringify(data); | 148 | data = JSON.stringify(data); |
149 | console.log('Error: ' + data); | 149 | console.log('Error: ' + data); |
150 | } | 150 | } |
151 | }); | 151 | }); |
152 | 152 | ||
153 | $.ajax({ | 153 | $.ajax({ |
154 | type: "GET", | 154 | type: "GET", |
155 | url: "{{ route('bd_resume') }}", | 155 | url: "{{ route('bd_resume') }}", |
156 | data: "sort="+val_+"&block=2", | 156 | data: "sort="+val_+"&block=2", |
157 | success: function (data) { | 157 | success: function (data) { |
158 | console.log('Выбор сортировки'); | 158 | console.log('Выбор сортировки'); |
159 | console.log(data); | 159 | console.log(data); |
160 | $('#block2').html(data); | 160 | $('#block2').html(data); |
161 | history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); | 161 | history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); |
162 | }, | 162 | }, |
163 | headers: { | 163 | headers: { |
164 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 164 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
165 | }, | 165 | }, |
166 | error: function (data) { | 166 | error: function (data) { |
167 | data = JSON.stringify(data); | 167 | data = JSON.stringify(data); |
168 | console.log('Error: ' + data); | 168 | console.log('Error: ' + data); |
169 | } | 169 | } |
170 | }); | 170 | }); |
171 | 171 | ||
172 | }); | 172 | }); |
173 | 173 | ||
174 | $(document).ready(function(){ | 174 | $(document).ready(function(){ |
175 | var sel = $('#select2-sort_ajax-container'); | 175 | var sel = $('#select2-sort_ajax-container'); |
176 | var key = getUrlParameter('sort'); | 176 | var key = getUrlParameter('sort'); |
177 | console.log(sel); | 177 | console.log(sel); |
178 | console.log(key); | 178 | console.log(key); |
179 | 179 | ||
180 | if (key !=='') { | 180 | if (key !=='') { |
181 | console.log(key); | 181 | console.log(key); |
182 | switch (key) { | 182 | switch (key) { |
183 | case "default": sel.html('Сортировка (по умолчанию)'); break; | 183 | case "default": sel.html('Сортировка (по умолчанию)'); break; |
184 | case "name_up": sel.html('По имени (возрастание)'); break; | 184 | case "name_up": sel.html('По имени (возрастание)'); break; |
185 | case "name_down": sel.html('По дате (убывание)'); break; | 185 | case "name_down": sel.html('По дате (убывание)'); break; |
186 | case "created_at_up": sel.html('По дате (возрастание)'); break; | 186 | case "created_at_up": sel.html('По дате (возрастание)'); break; |
187 | case "created_at_down": sel.html('По дате (убывание)'); break; | 187 | case "created_at_down": sel.html('По дате (убывание)'); break; |
188 | } | 188 | } |
189 | 189 | ||
190 | } | 190 | } |
191 | }); | 191 | }); |
192 | </script> | 192 | </script> |
193 | 193 | ||
194 | <script> | 194 | <script> |
195 | console.log('Test system'); | 195 | console.log('Test system'); |
196 | $(document).on('change', '.jobs', function() { | 196 | $(document).on('change', '.jobs', function() { |
197 | var val = $(this).val(); | 197 | var val = $(this).val(); |
198 | 198 | ||
199 | console.log('Click filter вакансии...'); | 199 | console.log('Click filter вакансии...'); |
200 | $.ajax({ | 200 | $.ajax({ |
201 | type: "GET", | 201 | type: "GET", |
202 | url: "{{ route('bd_resume') }}", | 202 | url: "{{ route('bd_resume') }}", |
203 | data: "job="+val+'&block=1', | 203 | data: "job="+val+'&block=1', |
204 | success: function (data) { | 204 | success: function (data) { |
205 | console.log('Выбор должности'); | 205 | console.log('Выбор должности'); |
206 | console.log(data); | 206 | console.log(data); |
207 | $('#block1').html(data); | 207 | $('#block1').html(data); |
208 | history.pushState({}, '', "{{ route('bd_resume') }}?job="+val+"@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); | 208 | history.pushState({}, '', "{{ route('bd_resume') }}?job="+val+"@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); |
209 | }, | 209 | }, |
210 | headers: { | 210 | headers: { |
211 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 211 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
212 | }, | 212 | }, |
213 | error: function (data) { | 213 | error: function (data) { |
214 | data = JSON.stringify(data); | 214 | data = JSON.stringify(data); |
215 | console.log('Error: ' + data); | 215 | console.log('Error: ' + data); |
216 | } | 216 | } |
217 | }); | 217 | }); |
218 | 218 | ||
219 | $.ajax({ | 219 | $.ajax({ |
220 | type: "GET", | 220 | type: "GET", |
221 | url: "{{ route('bd_resume') }}", | 221 | url: "{{ route('bd_resume') }}", |
222 | data: "job="+val+'&block=2', | 222 | data: "job="+val+'&block=2', |
223 | success: function (data) { | 223 | success: function (data) { |
224 | console.log('Выбор должности'); | 224 | console.log('Выбор должности'); |
225 | console.log(data); | 225 | console.log(data); |
226 | $('#block2').html(data); | 226 | $('#block2').html(data); |
227 | }, | 227 | }, |
228 | headers: { | 228 | headers: { |
229 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 229 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
230 | }, | 230 | }, |
231 | error: function (data) { | 231 | error: function (data) { |
232 | data = JSON.stringify(data); | 232 | data = JSON.stringify(data); |
233 | console.log('Error: ' + data); | 233 | console.log('Error: ' + data); |
234 | } | 234 | } |
235 | }); | 235 | }); |
236 | }); | 236 | }); |
237 | </script> | 237 | </script> |
238 | @include('js.favorite-worker') | 238 | @include('js.favorite-worker') |
239 | @endsection | 239 | @endsection |
240 | 240 | ||
241 | 241 | ||
242 | @section('content') | 242 | @section('content') |
243 | <section class="thing"> | 243 | <section class="thing"> |
244 | <div class="container"> | 244 | <div class="container"> |
245 | <form class="thing__body" action="{{ url()->current() }}"> | 245 | <form class="thing__body" action="{{ url()->current() }}"> |
246 | <ul class="breadcrumbs thing__breadcrumbs"> | 246 | <ul class="breadcrumbs thing__breadcrumbs"> |
247 | <li><a href="{{ route('index') }}">Главная</a></li> | 247 | <li><a href="{{ route('index') }}">Главная</a></li> |
248 | <li><b>База резюме</b></li> | 248 | <li><b>База резюме</b></li> |
249 | </ul> | 249 | </ul> |
250 | <h1 class="thing__title">База резюме</h1> | 250 | <h1 class="thing__title">База резюме</h1> |
251 | <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для | 251 | <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для |
252 | существующих финансовых и административных условий.</p> | 252 | существующих финансовых и административных условий.</p> |
253 | <!--<div class="search thing__search"> | 253 | <!--<div class="search thing__search"> |
254 | <input type="search" class="input" name="search" id="search" placeholder="Введите наименование должности" required> | 254 | <input type="search" class="input" name="search" id="search" placeholder="Введите наименование должности" required> |
255 | <button type="submit" class="button">Найти</button> | 255 | <button type="submit" class="button">Найти</button> |
256 | <span> | 256 | <span> |
257 | <svg> | 257 | <svg> |
258 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> | 258 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> |
259 | </svg> | 259 | </svg> |
260 | </span> | 260 | </span> |
261 | </div>--> | 261 | </div>--> |
262 | 262 | ||
263 | <div class="select select_search thing__select"> | 263 | <div class="select select_search thing__select"> |
264 | <div class="select__icon"> | 264 | <div class="select__icon"> |
265 | <svg> | 265 | <svg> |
266 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> | 266 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> |
267 | </svg> | 267 | </svg> |
268 | </div> | 268 | </div> |
269 | <select class="js-select2 jobs" name="search" id="search"> | 269 | <select class="js-select2 jobs" name="search" id="search"> |
270 | <option value="0">Выберите должность</option> | 270 | <option value="0">Выберите должность</option> |
271 | @if($Job_title->count()) | 271 | @if($Job_title->count()) |
272 | @foreach($Job_title as $JT) | 272 | @foreach($Job_title as $JT) |
273 | <option value="{{ $JT->id }}" @if (isset($_GET['job'])) @if($_GET['job'] == $JT->id) selected @endif @endif>{{ $JT->name }}</option> | 273 | <option value="{{ $JT->id }}" @if (isset($_GET['job'])) @if($_GET['job'] == $JT->id) selected @endif @endif>{{ $JT->name }}</option> |
274 | @endforeach | 274 | @endforeach |
275 | @endif | 275 | @endif |
276 | </select> | 276 | </select> |
277 | </div> | 277 | </div> |
278 | 278 | ||
279 | <!--<label class="checkbox thing__checkbox"> | 279 | <!--<label class="checkbox thing__checkbox"> |
280 | <input type="checkbox" class="checkbox__input" name="experience" id="experience"> | 280 | <input type="checkbox" class="checkbox__input" name="experience" id="experience"> |
281 | <span class="checkbox__icon"> | 281 | <span class="checkbox__icon"> |
282 | <svg> | 282 | <svg> |
283 | <use xlink:href=" asset('images/sprite.svg#v') }}"></use> | 283 | <use xlink:href=" asset('images/sprite.svg#v') }}"></use> |
284 | </svg> | 284 | </svg> |
285 | </span> | 285 | </span> |
286 | <span class="checkbox__text"> | 286 | <span class="checkbox__text"> |
287 | <span> | 287 | <span> |
288 | Опыт работы | 288 | Опыт работы |
289 | </span> | 289 | </span> |
290 | </span> | 290 | </span> |
291 | </label>--> | 291 | </label>--> |
292 | </form> | 292 | </form> |
293 | </div> | 293 | </div> |
294 | </section> | 294 | </section> |
295 | <main class="main"> | 295 | <main class="main"> |
296 | <div class="container"> | 296 | <div class="container"> |
297 | <div class="main__resume-base"> | 297 | <div class="main__resume-base"> |
298 | <h2>Резюме работников</h2> | 298 | <h2>Резюме работников</h2> |
299 | <div class="filters"> | 299 | <div class="filters"> |
300 | <div class="filters__label">Показано {{ $resumes->firstItem() }} – {{ $resumes->lastItem() }} из {{ $res_count }} результатов поиска</div> | 300 | <div class="filters__label">Показано {{ $resumes->firstItem() }} – {{ $resumes->lastItem() }} из {{ $res_count }} результатов поиска</div> |
301 | <div class="filters__body"> | 301 | <div class="filters__body"> |
302 | <div class="select filters__select"> | 302 | <div class="select filters__select"> |
303 | <select class="js-select2" id="sort_ajax" name="sort_ajax"> | 303 | <select class="js-select2" id="sort_ajax" name="sort_ajax"> |
304 | <option value="default">Сортировка (по умолчанию)</option> | 304 | <option value="default">Сортировка (по умолчанию)</option> |
305 | <option value="name_up">По имени (возрастание)</option> | 305 | <option value="name_up">По имени (возрастание)</option> |
306 | <option value="name_down">По имени (убывание)</option> | 306 | <option value="name_down">По имени (убывание)</option> |
307 | <option value="created_at_up">По дате (возрастание)</option> | 307 | <option value="created_at_up">По дате (возрастание)</option> |
308 | <option value="created_at_down">По дате (убывание)</option> | 308 | <option value="created_at_down">По дате (убывание)</option> |
309 | </select> | 309 | </select> |
310 | </div> | 310 | </div> |
311 | <button type="button" class="filters__item active" data-tab="1"> | 311 | <button type="button" class="filters__item active" data-tab="1"> |
312 | <svg> | 312 | <svg> |
313 | <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use> | 313 | <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use> |
314 | </svg> | 314 | </svg> |
315 | </button> | 315 | </button> |
316 | <button type="button" class="filters__item" data-tab="2"> | 316 | <button type="button" class="filters__item" data-tab="2"> |
317 | <svg> | 317 | <svg> |
318 | <use xlink:href="{{ asset('images/sprite.svg#grid-2') }}"></use> | 318 | <use xlink:href="{{ asset('images/sprite.svg#grid-2') }}"></use> |
319 | </svg> | 319 | </svg> |
320 | </button> | 320 | </button> |
321 | </div> | 321 | </div> |
322 | </div> | 322 | </div> |
323 | <div class="main__resume-base-body showed" data-body="1"> | 323 | <div class="main__resume-base-body showed" data-body="1"> |
324 | <div class="main__resume-base-body-one" id="block1" name="block1"> | 324 | <div class="main__resume-base-body-one" id="block1" name="block1"> |
325 | @if ($resumes->count()) | 325 | @if ($resumes->count()) |
326 | @foreach ($resumes as $res) | 326 | @foreach ($resumes as $res) |
327 | <div class="main__resume-base-body-item"> | 327 | <div class="main__resume-base-body-item"> |
328 | <div class="main__resume-base-body-item-wrapper"> | 328 | <div class="main__resume-base-body-item-wrapper"> |
329 | <div> | 329 | <div> |
330 | <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo"> | 330 | <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo"> |
331 | <div> | 331 | <div> |
332 | <div class="main__resume-base-body-item-buttons"> | 332 | <div class="main__resume-base-body-item-buttons"> |
333 | <button type="button" data-id="{{ $res->id }}" id="elem{{ $res->id }}" class="like js-toggle js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($res) }}" data-val="{{ $res->id }}"> | 333 | <button type="button" data-id="{{ $res->id }}" id="elem{{ $res->id }}" class="like js-toggle js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($res) }}" data-val="{{ $res->id }}"> |
334 | <svg> | 334 | <svg> |
335 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> | 335 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> |
336 | </svg> | 336 | </svg> |
337 | <span class="to-favorites">В избранное</span> | 337 | <span class="to-favorites">В избранное</span> |
338 | <span class="in-favorites">В избранном</span> | 338 | <span class="in-favorites">В избранном</span> |
339 | </button> | 339 | </button> |
340 | 340 | ||
341 | @guest | 341 | @guest |
342 | <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' | 342 | <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' |
343 | class="chat js-toggle js_it_button"> | 343 | class="chat js-toggle js_it_button"> |
344 | <svg> | 344 | <svg> |
345 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> | 345 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> |
346 | </svg> | 346 | </svg> |
347 | <span>Написать</span> | 347 | <span>Написать</span> |
348 | </button> | 348 | </button> |
349 | @else | 349 | @else |
350 | @if (App\Classes\StatusUser::Status()==0) | 350 | @if (App\Classes\StatusUser::Status()==0) |
351 | @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message)) | 351 | @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message)) |
352 | <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $res->users->id }}" data-options='{"touch":false,"autoFocus":false}'> | 352 | <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $res->users->id }}" data-options='{"touch":false,"autoFocus":false}'> |
353 | <svg> | 353 | <svg> |
354 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> | 354 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> |
355 | </svg> | 355 | </svg> |
356 | <span>Написать</span> | 356 | <span>Написать</span> |
357 | </button> | 357 | </button> |
358 | @endif | 358 | @endif |
359 | @else | 359 | @else |
360 | <button type="button" data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' | 360 | <button type="button" data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' |
361 | class="chat js-toggle js_it_button"> | 361 | class="chat js-toggle js_it_button"> |
362 | <svg> | 362 | <svg> |
363 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> | 363 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> |
364 | </svg> | 364 | </svg> |
365 | <span>Написать</span> | 365 | <span>Написать</span> |
366 | </button> | 366 | </button> |
367 | @endif | 367 | @endif |
368 | @endif | 368 | @endif |
369 | 369 | ||
370 | <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Подробнее</a> | 370 | <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Подробнее</a> |
371 | </div> | 371 | </div> |
372 | </div> | 372 | </div> |
373 | </div> | 373 | </div> |
374 | <div class="main__resume-base-body-item-inner"> | 374 | <div class="main__resume-base-body-item-inner"> |
375 | <div class="horizontal"> | 375 | <div class="horizontal"> |
376 | <div class="main__resume-base-item-status @if ($res->status_work == 0) looking-for-job @endif"> | 376 | <div class="main__resume-base-item-status @if ($res->status_work == 0) looking-for-job @endif"> |
377 | {{ $status_work[$res->status_work] }} | 377 | {{ $status_work[$res->status_work] }} |
378 | </div> | 378 | </div> |
379 | <div class="main__resume-base-item-updated-at"> | 379 | <div class="main__resume-base-item-updated-at"> |
380 | Обновлено: {{ date('d.m.Y', strtotime($res->updated_at)) }} | 380 | Обновлено: {{ date('d.m.Y', strtotime($res->updated_at)) }} |
381 | </div> | 381 | </div> |
382 | </div> | 382 | </div> |
383 | <div> | 383 | <div> |
384 | <b>Предпочтение по типу судна:</b> | 384 | <b>Предпочтение по типу судна:</b> |
385 | <span></span> | 385 | <span>{{ $res->boart_type_preference ?? '-' }}</span> |
386 | </div> | 386 | </div> |
387 | <div> | 387 | <div> |
388 | <b>ФИО:</b> | 388 | <b>ФИО:</b> |
389 | <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> | 389 | <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> |
390 | </div> | 390 | </div> |
391 | <div> | 391 | <div> |
392 | <b>Наличие визы:</b> | 392 | <b>Наличие визы:</b> |
393 | <span>{{ $res->visa_available ?? '-' }}</span> | ||
393 | </div> | 394 | </div> |
394 | <div> | 395 | <div> |
395 | <b>Возраст:</b> | 396 | <b>Возраст:</b> |
396 | <span>@if (isset($res->old_year)) {{ $res->old_year }} @else - @endif</span> | 397 | <span>{{ $res->old_year ?? '-' }}</span> |
397 | </div> | 398 | </div> |
398 | <div> | 399 | <div> |
399 | <b>Наличие танкерных документов:</b> | 400 | <b>Наличие танкерных документов:</b> |
401 | <span>{{ $res->tanker_documents_available ?? '-' }}</span> | ||
400 | </div> | 402 | </div> |
401 | <div> | 403 | <div> |
402 | <b>Желаемые вакансии:</b> | 404 | <b>Желаемые вакансии:</b> |
403 | <span> | 405 | <span> |
404 | @if ($res->job_titles->count()) | 406 | @if ($res->job_titles->count()) |
405 | @foreach ($res->job_titles as $job_title) | 407 | @foreach ($res->job_titles as $job_title) |
406 | {{ $job_title->name }} | 408 | {{ $job_title->name }} |
407 | @if (!$loop->last) / @endif | 409 | @if (!$loop->last) / @endif |
408 | @endforeach | 410 | @endforeach |
411 | @else | ||
412 | - | ||
409 | @endif | 413 | @endif |
410 | </span> | 414 | </span> |
411 | </div> | 415 | </div> |
412 | <div> | 416 | <div> |
413 | <b>Наличие подтверждения для работы на ВВП:</b> | 417 | <b>Наличие подтверждения для работы на ВВП:</b> |
418 | <span>{{ $res->confirmation_work_for_vvp ?? '-' }}</span> | ||
414 | </div> | 419 | </div> |
415 | <div> | 420 | <div> |
416 | <b>Пожелание к З/П:</b> | 421 | <b>Пожелание к З/П:</b> |
422 | <span>{{ $res->salary_expectations ?? '-' }}</span> | ||
417 | </div> | 423 | </div> |
418 | <div> | 424 | <div> |
419 | <b>Город проживания</b> | 425 | <b>Город проживания</b> |
420 | <span>{{ $res->city ?? "-" }}</span> | 426 | <span>{{ $res->city ?? "-" }}</span> |
421 | </div> | 427 | </div> |
422 | <div> | 428 | <div> |
423 | <b>Уровень английского:</b> | 429 | <b>Уровень английского:</b> |
430 | <span>{{ $res->english_level ?? '-' }}</span> | ||
424 | </div> | 431 | </div> |
425 | <div> | 432 | <div> |
426 | <b>Номер телефона</b> | 433 | <b>Номер телефона</b> |
427 | <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span> | 434 | <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone ?? '-' }}</a></span> |
428 | </div> | 435 | </div> |
429 | <div> | 436 | <div> |
430 | <b>Дата готовности к посадке:</b> | 437 | <b>Дата готовности к посадке:</b> |
438 | <span>{{ $res->ready_boart_date ?? '-' }}</span> | ||
431 | </div> | 439 | </div> |
432 | <div> | 440 | <div> |
433 | <b>E-mail:</b> | 441 | <b>E-mail:</b> |
434 | <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> | 442 | <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> |
435 | </div> | 443 | </div> |
436 | <div> | 444 | <div> |
437 | <b>Опыт работы:</b> | 445 | <b>Опыт работы:</b> |
438 | <span>{{ $res->experience }}</span> | 446 | <span>{{ $res->experience }}</span> |
439 | </div> | 447 | </div> |
440 | </div> | 448 | </div> |
441 | </div> | 449 | </div> |
442 | </div> | 450 | </div> |
443 | @endforeach | 451 | @endforeach |
444 | 452 | ||
445 | {{ $resumes->appends($_GET)->links('paginate') }} | 453 | {{ $resumes->appends($_GET)->links('paginate') }} |
446 | @else | 454 | @else |
447 | <p>По данному запросу ничего не найдено</p> | 455 | <p>По данному запросу ничего не найдено</p> |
448 | @endif | 456 | @endif |
449 | </div> | 457 | </div> |
450 | </div> | 458 | </div> |
451 | <div class="main__resume-base-body" data-body="2"> | 459 | <div class="main__resume-base-body" data-body="2"> |
452 | <div class="main__resume-base-body-two" id="block2" name="block2"> | 460 | <div class="main__resume-base-body-two" id="block2" name="block2"> |
453 | @if ($resumes->count()) | 461 | @if ($resumes->count()) |
454 | @foreach ($resumes as $res) | 462 | @foreach ($resumes as $res) |
455 | <div class="main__resume-base-body-item"> | 463 | <div class="main__resume-base-body-item"> |
456 | <div class="main__resume-base-body-item-buttons"> | 464 | <div class="main__resume-base-body-item-buttons"> |
457 | <button type="button" id="elem_{{ $res->id }}" class="like js-toggle js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($res) }}" data-val="{{ $res->id }}"> | 465 | <button type="button" id="elem_{{ $res->id }}" class="like js-toggle js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($res) }}" data-val="{{ $res->id }}"> |
458 | <svg> | 466 | <svg> |
459 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> | 467 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> |
460 | </svg> | 468 | </svg> |
461 | </button> | 469 | </button> |
462 | <!--<button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid=" $idiot}}" data-tuid=" $res->id }}" data-options='{"touch":false,"autoFocus":false}'> | 470 | <!--<button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid=" $idiot}}" data-tuid=" $res->id }}" data-options='{"touch":false,"autoFocus":false}'> |
463 | <svg> | 471 | <svg> |
464 | <use xlink:href=" asset('images/sprite.svg#chat') }}"></use> | 472 | <use xlink:href=" asset('images/sprite.svg#chat') }}"></use> |
465 | </svg> | 473 | </svg> |
466 | </button>--> | 474 | </button>--> |
467 | @guest | 475 | @guest |
468 | <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' | 476 | <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' |
469 | class="chat js-toggle js_it_button"> | 477 | class="chat js-toggle js_it_button"> |
470 | <svg> | 478 | <svg> |
471 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> | 479 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> |
472 | </svg> | 480 | </svg> |
473 | </button> | 481 | </button> |
474 | @else | 482 | @else |
475 | @if (App\Classes\StatusUser::Status()==0) | 483 | @if (App\Classes\StatusUser::Status()==0) |
476 | @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message)) | 484 | @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message)) |
477 | <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $res->users->id }}" data-options='{"touch":false,"autoFocus":false}'> | 485 | <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $res->users->id }}" data-options='{"touch":false,"autoFocus":false}'> |
478 | <svg> | 486 | <svg> |
479 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> | 487 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> |
480 | </svg> | 488 | </svg> |
481 | </button> | 489 | </button> |
482 | @endif | 490 | @endif |
483 | @else | 491 | @else |
484 | <button type="button" data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' | 492 | <button type="button" data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' |
485 | class="chat js-toggle js_it_button"> | 493 | class="chat js-toggle js_it_button"> |
486 | <svg> | 494 | <svg> |
487 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> | 495 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> |
488 | </svg> | 496 | </svg> |
489 | </button> | 497 | </button> |
490 | @endif | 498 | @endif |
491 | @endif | 499 | @endif |
492 | </div> | 500 | </div> |
493 | <div class="main__resume-base-body-item-wrapper"> | 501 | <div class="main__resume-base-body-item-wrapper"> |
494 | <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo"> | 502 | <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo"> |
495 | <div class="main__resume-base-body-item-inner"> | 503 | <div class="main__resume-base-body-item-inner"> |
496 | <div> | 504 | <div> |
497 | <b>Статус</b> | 505 | <b>Статус</b> |
498 | <span>{{ $status_work[$res->status_work] }}</span> | 506 | <span>{{ $status_work[$res->status_work] }}</span> |
499 | </div> | 507 | </div> |
500 | <div> | 508 | <div> |
501 | <b>Имя работника</b> | 509 | <b>Имя работника</b> |
502 | <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> | 510 | <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> |
503 | </div> | 511 | </div> |
504 | <div> | 512 | <div> |
505 | <b>Номер телефона</b> | 513 | <b>Номер телефона</b> |
506 | <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span> | 514 | <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span> |
507 | </div> | 515 | </div> |
508 | <div> | 516 | <div> |
509 | <b>Электронный адрес</b> | 517 | <b>Электронный адрес</b> |
510 | <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> | 518 | <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> |
511 | </div> | 519 | </div> |
512 | <div> | 520 | <div> |
513 | <b>Город проживания</b> | 521 | <b>Город проживания</b> |
514 | <span>{{ $res->city }}</span> | 522 | <span>{{ $res->city }}</span> |
515 | </div> | 523 | </div> |
516 | <div> | 524 | <div> |
517 | <b>Опыт работы</b> | 525 | <b>Опыт работы</b> |
518 | <span>{{ $res->experience }}</span> | 526 | <span>{{ $res->experience }}</span> |
519 | </div> | 527 | </div> |
520 | </div> | 528 | </div> |
521 | </div> | 529 | </div> |
522 | <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в | 530 | <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в |
523 | резюме</a> | 531 | резюме</a> |
524 | </div> | 532 | </div> |
525 | @endforeach | 533 | @endforeach |
526 | 534 | ||
527 | {{ $resumes->appends($_GET)->links('paginate') }} | 535 | {{ $resumes->appends($_GET)->links('paginate') }} |
528 | @endif | 536 | @endif |
529 | </div> | 537 | </div> |
530 | </div> | 538 | </div> |
531 | </div> | 539 | </div> |
532 | </div> | 540 | </div> |
533 | </main> | 541 | </main> |
534 | </div> | 542 | </div> |
535 | </div> | 543 | </div> |
536 | @endsection | 544 | @endsection |
537 | 545 |
resources/views/workers/cabinet.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 | $('.cabinet__avatar-form [type="file"][name="photo"]').change(function (event) { | 6 | $('.cabinet__avatar-form [type="file"][name="photo"]').change(function (event) { |
7 | var form = $(this).closest('form'); | ||
7 | const file = event.target.files[0]; | 8 | const file = event.target.files[0]; |
8 | 9 | ||
9 | if (file) { | 10 | if (file) { |
10 | var img_wrap = $('.cabinet__avatar-pic'); | 11 | var img_wrap = $('.cabinet__avatar-pic'); |
11 | var img = $('<img src="#"/>'); | 12 | var img = $('<img src="#"/>'); |
12 | const reader = new FileReader(); | 13 | const reader = new FileReader(); |
13 | 14 | ||
14 | reader.onload = function(e) { | 15 | reader.onload = function(e) { |
15 | img.attr('src', e.target.result); | 16 | img.attr('src', e.target.result); |
16 | img_wrap.find('svg, img').remove(); | 17 | img_wrap.find('svg, img').remove(); |
17 | img_wrap.append(img); | 18 | img_wrap.append(img); |
19 | |||
20 | setTimeout(function () { | ||
21 | form.submit(); | ||
22 | }, 1000); | ||
18 | }; | 23 | }; |
19 | 24 | ||
20 | reader.readAsDataURL(file); | 25 | reader.readAsDataURL(file); |
21 | } | 26 | } |
22 | }); | 27 | }); |
23 | }); | 28 | }); |
24 | 29 | ||
25 | $(document).on('click', '#button_new_doc123', function() { | ||
26 | var this_ = $(this); | ||
27 | var val_ = this_.attr('data-val'); | ||
28 | var new_diplom = $('#new_diplom'); | ||
29 | var new_diplom_val = new_diplom.val(); | ||
30 | var new_data_begin = $('#new_data_begin'); | ||
31 | var new_data_begin_val = new_data_begin.val(); | ||
32 | var new_data_end = $('#new_data_end'); | ||
33 | var new_data_end_val = new_data_end.val(); | ||
34 | var education = $('#education'); | ||
35 | var education_val = education.val(); | ||
36 | var worker_id = $('#new_id'); | ||
37 | var worker_val = worker_id.val(); | ||
38 | |||
39 | console.log('sort items ' + val_); | ||
40 | |||
41 | if (new_diplom_val == '') { | ||
42 | new_diplom.addClass('err_red'); | ||
43 | console.log('Border Up'); | ||
44 | } else { | ||
45 | $.ajax({ | ||
46 | type: "GET", | ||
47 | url: "{{ route('worker.add_serificate') }}", | ||
48 | data: "worker_id="+worker_val+"&date_begin="+new_data_begin_val + "&end_begin=" + new_data_end_val + "&name=" + new_diplom_val + "&education="+education_val, | ||
49 | success: function (data) { | ||
50 | console.log('Блокировка...'); | ||
51 | console.log(data); | ||
52 | $('#sertificate').html(data); | ||
53 | if (new_diplom.hasClass('err_red')) new_diplom.removeClass('err_red'); | ||
54 | }, | ||
55 | headers: { | ||
56 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | ||
57 | }, | ||
58 | error: function (data) { | ||
59 | data = JSON.stringify(data); | ||
60 | console.log('Error: ' + data); | ||
61 | } | ||
62 | }); | ||
63 | } | ||
64 | }); | ||
65 | |||
66 | $(document).on('click', '#btn_new_diplom123', function() { | ||
67 | var this_ = $(this); | ||
68 | var val_ = this_.attr('data-val'); | ||
69 | var documents = $('#documents'); | ||
70 | var doc_val = documents.val(); | ||
71 | var block = $('#ajax_dop_diplomi'); | ||
72 | |||
73 | console.log('worker_id='+val_+'it_infoblock='+ doc_val); | ||
74 | |||
75 | $.ajax({ | ||
76 | type: "GET", | ||
77 | url: "", | ||
78 | data: "worker_id="+val_+"&infoblok_id="+doc_val, | ||
79 | success: function (data) { | ||
80 | location.url = data; | ||
81 | console.log('Добавление документа-диплома'); | ||
82 | console.log(data); | ||
83 | block.html(data); | ||
84 | }, | ||
85 | headers: { | ||
86 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | ||
87 | }, | ||
88 | error: function (data) { | ||
89 | data = JSON.stringify(data); | ||
90 | console.log('Error: ' + data); | ||
91 | } | ||
92 | }); | ||
93 | }); | ||
94 | |||
95 | $(document).on('click', '#new_work', function() { | ||
96 | var this_ = $(this); | ||
97 | var val_ = this_.attr('data-val'); | ||
98 | var new_diplom = $('#new_diplom').val(); | ||
99 | var new_data_begin = $('#new_data_begin').val(); | ||
100 | var new_data_end = $('#new_data_end').val(); | ||
101 | var new_job_title = $('#new_job_title').val(); | ||
102 | var new_teplohod = $('#new_teplohod').val(); | ||
103 | var new_GWT = $('#new_GWT').val(); | ||
104 | var new_KBT = $('#new_KBT').val(); | ||
105 | var new_Begin_work = $('#new_Begin_work').val(); | ||
106 | var new_End_work = $('#new_End_work').val(); | ||
107 | var new_name_company = $('#new_name_company').val(); | ||
108 | |||
109 | console.log('worker_id='+val_+'it_infoblock='+ doc_val); | ||
110 | |||
111 | $.ajax({ | ||
112 | type: "GET", | ||
113 | url: "", | ||
114 | data: "worker_id="+val_+"&infoblok_id="+doc_val, | ||
115 | success: function (data) { | ||
116 | location.url = data; | ||
117 | console.log('Добавление документа-диплома'); | ||
118 | console.log(data); | ||
119 | block.html(data); | ||
120 | }, | ||
121 | headers: { | ||
122 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | ||
123 | }, | ||
124 | error: function (data) { | ||
125 | data = JSON.stringify(data); | ||
126 | console.log('Error: ' + data); | ||
127 | } | ||
128 | }); | ||
129 | }); | ||
130 | |||
131 | $(document).on('click', '#old_year', function() { | 30 | $(document).on('click', '#old_year', function() { |
132 | var this_ = $(this); | 31 | var this_ = $(this); |
133 | var val = this_.val(); | 32 | var val = this_.val(); |
134 | 33 | ||
135 | if (val < 0) | 34 | if (val < 0) |
136 | $('#old_year').val(0); | 35 | $('#old_year').val(0); |
137 | |||
138 | console.log('Возраст не может выполнить такую операцию'); | ||
139 | }); | 36 | }); |
140 | </script> | 37 | </script> |
141 | @endsection | 38 | @endsection |
142 | 39 | ||
143 | @section('content') | 40 | @section('content') |
144 | @php | 41 | @php |
145 | $user = $worker->users | 42 | $user = $worker->users |
146 | @endphp | 43 | @endphp |
147 | <section class="cabinet"> | 44 | <section class="cabinet"> |
148 | <div class="container"> | 45 | <div class="container"> |
149 | <ul class="breadcrumbs cabinet__breadcrumbs"> | 46 | <ul class="breadcrumbs cabinet__breadcrumbs"> |
150 | <li><a href="{{ route('index') }}">Главная</a></li> | 47 | <li><a href="{{ route('index') }}">Главная</a></li> |
151 | <li><b>Личный кабинет</b></li> | 48 | <li><b>Личный кабинет</b></li> |
152 | </ul> | 49 | </ul> |
153 | <div class="cabinet__wrapper"> | 50 | <div class="cabinet__wrapper"> |
154 | <div class="cabinet__side"> | 51 | <div class="cabinet__side"> |
155 | <div class="cabinet__side-toper"> | 52 | <div class="cabinet__side-toper"> |
156 | @include('workers.emblema') | 53 | @include('workers.emblema') |
157 | 54 | ||
158 | </div> | 55 | </div> |
159 | 56 | ||
160 | @include('workers.menu', ['item' => 1]) | 57 | @include('workers.menu', ['item' => 1]) |
161 | </div> | 58 | </div> |
162 | <form class="cabinet__body" action="{{ route('worker.cabinet_save', ['worker' => $worker->id]) }}" enctype="multipart/form-data" method="POST"> | 59 | <div class="cabinet__body"> |
163 | @csrf | ||
164 | @include('messages_error') | ||
165 | <div class="cabinet__body-item"> | 60 | <div class="cabinet__body-item"> |
166 | <div class="cabinet__anketa"> | 61 | <div class="cabinet__anketa"> |
167 | <h2 class="title cabinet__title">Моя анкета</h2> | 62 | <h2 class="title cabinet__title">Моя анкета</h2> |
168 | <div class="cabinet__anketa-buttons"> | 63 | <div class="cabinet__anketa-buttons"> |
169 | <a href="{{ route('worker.up', ['worker' => $worker->id]) }}" class="button">Поднять резюме</a> | 64 | <a href="{{ route('worker.up', ['worker' => $worker->id]) }}" class="button">Поднять резюме</a> |
170 | <a href="{{ route('resume_download', ['worker' => $worker->id]) }}" target="_blank" class="button"> | 65 | <a href="{{ route('resume_download', ['worker' => $worker->id]) }}" target="_blank" class="button"> |
171 | <svg> | 66 | <svg> |
172 | <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> | 67 | <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> |
173 | </svg> | 68 | </svg> |
174 | Скачать резюме | 69 | Скачать резюме |
175 | </a> | 70 | </a> |
176 | </div> | 71 | </div> |
177 | </div> | 72 | </div> |
178 | </div> | 73 | </div> |
74 | |||
179 | <div class="cabinet__body-item"> | 75 | <div class="cabinet__body-item"> |
180 | <div class="cabinet__stats"> | 76 | <div class="cabinet__stats"> |
181 | <h3 class="cabinet__subtitle cabinet__stats-title">Статистика</h3> | 77 | <h3 class="cabinet__subtitle cabinet__stats-title">Статистика</h3> |
182 | <div class="cabinet__stats-body"> | 78 | <div class="cabinet__stats-body"> |
183 | <div class="cabinet__stats-item"> | 79 | <div class="cabinet__stats-item"> |
184 | <svg> | 80 | <svg> |
185 | <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use> | 81 | <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use> |
186 | </svg> | 82 | </svg> |
187 | <span>Просмотров:</span> | 83 | <span>Просмотров:</span> |
188 | <b>@if (isset($stat[0]->lookin)) {{ $stat[0]->lookin }} @else 0 @endif</b> | 84 | <b>@if (isset($stat[0]->lookin)) {{ $stat[0]->lookin }} @else 0 @endif</b> |
189 | </div> | 85 | </div> |
190 | <div class="cabinet__stats-item"> | 86 | <div class="cabinet__stats-item"> |
191 | <svg> | 87 | <svg> |
192 | <use xlink:href="{{ asset('images/sprite.svg#warning') }}"></use> | 88 | <use xlink:href="{{ asset('images/sprite.svg#warning') }}"></use> |
193 | </svg> | 89 | </svg> |
194 | <span>Отзывов:</span> | 90 | <span>Отзывов:</span> |
195 | <b>@if(isset($worker->response)) {{ $worker->response->count() }} @else 0 @endif</b> | 91 | <b>@if(isset($worker->response)) {{ $worker->response->count() }} @else 0 @endif</b> |
196 | </div> | 92 | </div> |
197 | </div> | 93 | </div> |
198 | <div class="cabinet__stats-subtitle">Анкета заполнена на {{ $persent }}%</div> | 94 | <div class="cabinet__stats-subtitle">Анкета заполнена на {{ $persent }}%</div> |
199 | <div class="cabinet__stats-line"> | 95 | <div class="cabinet__stats-line"> |
200 | <span style="width:{{ $persent }}%"></span> | 96 | <span style="width:{{ $persent }}%"></span> |
201 | </div> | 97 | </div> |
202 | <div class="cabinet__stats-bottom">Заполните профиль, чтобы повысить процент анкеты на 80%</div> | 98 | <div class="cabinet__stats-bottom">Заполните профиль, чтобы повысить процент анкеты на 80%</div> |
203 | </div> | 99 | </div> |
204 | </div> | 100 | </div> |
205 | <div class="cabinet__body-item"> | 101 | |
206 | <h3 class="cabinet__subtitle">Профиль</h3> | 102 | <form class="" action="{{ route('worker.cabinet_save_foto', ['worker' => $worker->id]) }}" enctype="multipart/form-data" method="POST"> |
207 | <div class="cabinet__avatar"> | 103 | @csrf |
208 | <div class="cabinet__avatar-pic"> | 104 | @include('messages_error') |
209 | 105 | ||
210 | @if (!empty($worker->photo)) | 106 | <div class="cabinet__body-item"> |
211 | <img src="{{ asset(Storage::url($worker->photo)) }}"/> | 107 | <h3 class="cabinet__subtitle">Профиль</h3> |
212 | @else | 108 | <div class="cabinet__avatar"> |
213 | <svg> | 109 | <div class="cabinet__avatar-pic"> |
214 | <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> | 110 | |
215 | </svg> | 111 | @if (!empty($worker->photo)) |
216 | @endif | 112 | <img src="{{ asset(Storage::url($worker->photo)) }}"/> |
217 | </div> | 113 | @else |
218 | <div class="cabinet__avatar-form"> | 114 | <svg> |
219 | <label class="file"> | 115 | <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> |
220 | <span class="file__input"> | 116 | </svg> |
221 | <input type="file" name="photo" id="photo"> | 117 | @endif |
222 | 118 | </div> | |
223 | <span class="button"> | 119 | <div class="cabinet__avatar-form"> |
224 | <svg> | 120 | <label class="file"> |
225 | <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use> | 121 | <span class="file__input"> |
226 | </svg> | 122 | <input type="file" name="photo" id="photo"> |
227 | Загрузить | 123 | |
124 | <span class="button"> | ||
125 | <svg> | ||
126 | <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use> | ||
127 | </svg> | ||
128 | Загрузить | ||
129 | </span> | ||
228 | </span> | 130 | </span> |
229 | </span> | 131 | </label> |
230 | </label> | 132 | <p class="cabinet__text">Загрузите фотографию в формате svg., jpg., jpeg., png.</p> |
231 | <p class="cabinet__text">Загрузите фотографию в формате svg., jpg., jpeg., png.</p> | 133 | </div> |
232 | </div> | 134 | </div> |
233 | </div> | 135 | </div> |
234 | </div> | 136 | </form> |
235 | |||
236 | 137 | ||
237 | <div class="cabinet__body-item mb-40"> | 138 | <div class="cabinet__body-item mb-40"> |
238 | <h3 class="cabinet__subtitle font30">Основная информация</h3> | 139 | <h3 class="cabinet__subtitle font30">Основная информация</h3> |
239 | 140 | ||
240 | <div class="cabinet__inputs"> | 141 | <div class="cabinet__inputs"> |
241 | <div class="cabinet__inputs-item form-group"> | 142 | <div class="cabinet__inputs-item form-group"> |
242 | <label class="form-group__label">Фамилия:</label> | 143 | <label class="form-group__label">Фамилия:</label> |
243 | <div class="form-group__item"> | 144 | <div class="form-group__item"> |
244 | {{ $user->surname }} | 145 | {{ $user->surname }} |
245 | </div> | 146 | </div> |
246 | </div> | 147 | </div> |
247 | <div class="cabinet__inputs-item form-group"> | 148 | <div class="cabinet__inputs-item form-group"> |
248 | <label class="form-group__label">Наличие визы:</label> | 149 | <label class="form-group__label">Наличие визы:</label> |
249 | <div class="form-group__item"> | 150 | <div class="form-group__item"> |
250 | {{ $worker->visa_available }} | 151 | {{ $worker->visa_available }} |
251 | </div> | 152 | </div> |
252 | </div> | 153 | </div> |
253 | 154 | ||
254 | <div class="cabinet__inputs-item form-group"> | 155 | <div class="cabinet__inputs-item form-group"> |
255 | <label class="form-group__label">Имя:</label> | 156 | <label class="form-group__label">Имя:</label> |
256 | <div class="form-group__item"> | 157 | <div class="form-group__item"> |
257 | {{ $user->name_man }} | 158 | {{ $user->name_man }} |
258 | </div> | 159 | </div> |
259 | </div> | 160 | </div> |
260 | <div class="cabinet__inputs-item form-group"> | 161 | <div class="cabinet__inputs-item form-group"> |
261 | <label class="form-group__label">Наличие танкерных документов:</label> | 162 | <label class="form-group__label">Наличие танкерных документов:</label> |
262 | <div class="form-group__item"> | 163 | <div class="form-group__item"> |
263 | {{ $worker->tanker_documents_available ?? '-' }} | 164 | {{ $worker->tanker_documents_available ?? '-' }} |
264 | </div> | 165 | </div> |
265 | </div> | 166 | </div> |
266 | 167 | ||
267 | <div class="cabinet__inputs-item form-group"> | 168 | <div class="cabinet__inputs-item form-group"> |
268 | <label class="form-group__label">Отчество:</label> | 169 | <label class="form-group__label">Отчество:</label> |
269 | <div class="form-group__item"> | 170 | <div class="form-group__item"> |
270 | {{ $user->surname2 }} | 171 | {{ $user->surname2 }} |
271 | </div> | 172 | </div> |
272 | </div> | 173 | </div> |
273 | <div class="cabinet__inputs-item form-group"> | 174 | <div class="cabinet__inputs-item form-group"> |
274 | <label class="form-group__label">Наличие подтверждения для работы на ВВП:</label> | 175 | <label class="form-group__label">Наличие подтверждения для работы на ВВП:</label> |
275 | <div class="form-group__item"> | 176 | <div class="form-group__item"> |
276 | {{ $worker->confirmation_work_for_vvp ?? '-' }} | 177 | {{ $worker->confirmation_work_for_vvp ?? '-' }} |
277 | </div> | 178 | </div> |
278 | </div> | 179 | </div> |
279 | 180 | ||
280 | <div class="cabinet__inputs-item form-group"> | 181 | <div class="cabinet__inputs-item form-group"> |
281 | <label class="form-group__label">Возраст:</label> | 182 | <label class="form-group__label">Возраст:</label> |
282 | <div class="form-group__item"> | 183 | <div class="form-group__item"> |
283 | {{ $worker->old_year ?? '-' }} | 184 | {{ $worker->old_year ?? '-' }} |
284 | </div> | 185 | </div> |
285 | </div> | 186 | </div> |
286 | <div class="cabinet__inputs-item form-group"> | 187 | <div class="cabinet__inputs-item form-group"> |
287 | <label class="form-group__label">Наличие военного билета / приписного свидетельства:</label> | 188 | <label class="form-group__label">Наличие военного билета / приписного свидетельства:</label> |
288 | <div class="form-group__item"> | 189 | <div class="form-group__item"> |
289 | {{ $worker->military_id_available ?? '-' }} | 190 | {{ $worker->military_id_available ?? '-' }} |
290 | </div> | 191 | </div> |
291 | </div> | 192 | </div> |
292 | 193 | ||
293 | <div class="cabinet__inputs-item form-group"> | 194 | <div class="cabinet__inputs-item form-group"> |
294 | <label class="form-group__label">Статус:</label> | 195 | <label class="form-group__label">Статус:</label> |
295 | <div class="form-group__item"> | 196 | <div class="form-group__item"> |
296 | {{ $status_work[$worker->status_work] ?? '-' }} | 197 | {{ $status_work[$worker->status_work] ?? '-' }} |
297 | </div> | 198 | </div> |
298 | </div> | 199 | </div> |
299 | <div class="cabinet__inputs-item form-group"> | 200 | <div class="cabinet__inputs-item form-group"> |
300 | <label class="form-group__label">Город проживания:</label> | 201 | <label class="form-group__label">Город проживания:</label> |
301 | <div class="form-group__item"> | 202 | <div class="form-group__item"> |
302 | {{ $worker->city ?? '-' }} | 203 | {{ $worker->city ?? '-' }} |
303 | </div> | 204 | </div> |
304 | </div> | 205 | </div> |
305 | 206 | ||
306 | <div class="cabinet__inputs-item form-group"> | 207 | <div class="cabinet__inputs-item form-group"> |
307 | <label class="form-group__label">Желаемые вакансии:</label> | 208 | <label class="form-group__label">Желаемые вакансии:</label> |
308 | <div class="form-group__item"> | 209 | <div class="form-group__item"> |
309 | @if ($worker->job_titles->count()) | 210 | @if ($worker->job_titles->count()) |
310 | @foreach($worker->job_titles as $job_title) | 211 | @foreach($worker->job_titles as $job_title) |
311 | {{ $job_title->name }} | 212 | {{ $job_title->name }} |
312 | @if (!$loop->last) / @endif | 213 | @if (!$loop->last) / @endif |
313 | @endforeach | 214 | @endforeach |
314 | @endif | 215 | @endif |
315 | </div> | 216 | </div> |
316 | </div> | 217 | </div> |
317 | <div class="cabinet__inputs-item form-group"> | 218 | <div class="cabinet__inputs-item form-group"> |
318 | <label class="form-group__label">Город проживания:</label> | 219 | <label class="form-group__label">Город проживания:</label> |
319 | <div class="form-group__item"> | 220 | <div class="form-group__item"> |
320 | {{ $worker->city ?? '-' }} | 221 | {{ $worker->city ?? '-' }} |
321 | </div> | 222 | </div> |
322 | </div> | 223 | </div> |
323 | 224 | ||
324 | <div class="cabinet__inputs-item form-group"> | 225 | <div class="cabinet__inputs-item form-group"> |
325 | <label class="form-group__label">Пожелания к З/П:</label> | 226 | <label class="form-group__label">Пожелания к З/П:</label> |
326 | <div class="form-group__item"> | 227 | <div class="form-group__item"> |
327 | {{ $worker->salary_expectations ?? '-' }} | 228 | {{ $worker->salary_expectations ?? '-' }} |
328 | </div> | 229 | </div> |
329 | </div> | 230 | </div> |
330 | <div class="cabinet__inputs-item form-group"> | 231 | <div class="cabinet__inputs-item form-group"> |
331 | <label class="form-group__label">E-mail:</label> | 232 | <label class="form-group__label">E-mail:</label> |
332 | <div class="form-group__item"> | 233 | <div class="form-group__item"> |
333 | {{ $worker->email ?? '-' }} | 234 | {{ $worker->email ?? '-' }} |
334 | </div> | 235 | </div> |
335 | </div> | 236 | </div> |
336 | 237 | ||
337 | <div class="cabinet__inputs-item form-group"> | 238 | <div class="cabinet__inputs-item form-group"> |
338 | <label class="form-group__label">Уровень английского:</label> | 239 | <label class="form-group__label">Уровень английского:</label> |
339 | <div class="form-group__item"> | 240 | <div class="form-group__item"> |
340 | {{ $worker->english_level ?? '-' }} | 241 | {{ $worker->english_level ?? '-' }} |
341 | </div> | 242 | </div> |
342 | </div> | 243 | </div> |
343 | <div class="cabinet__inputs-item form-group"> | 244 | <div class="cabinet__inputs-item form-group"> |
344 | <label class="form-group__label">Контакты родственников:</label> | 245 | <label class="form-group__label">Контакты родственников:</label> |
345 | <div class="form-group__item"> | 246 | <div class="form-group__item"> |
346 | {{ $worker->telephon2 ?? '-' }} | 247 | {{ $worker->telephon2 ?? '-' }} |
347 | </div> | 248 | </div> |
348 | </div> | 249 | </div> |
349 | 250 | ||
350 | <div class="cabinet__inputs-item form-group"> | 251 | <div class="cabinet__inputs-item form-group"> |
351 | <label class="form-group__label">Дата готовности к посадке:</label> | 252 | <label class="form-group__label">Дата готовности к посадке:</label> |
352 | <div class="form-group__item"> | 253 | <div class="form-group__item"> |
353 | {{ $worker->ready_boart_date ?? '-' }} | 254 | {{ $worker->ready_boart_date ?? '-' }} |
354 | </div> | 255 | </div> |
355 | </div> | 256 | </div> |
356 | <div class="cabinet__inputs-item form-group"> | 257 | <div class="cabinet__inputs-item form-group"> |
357 | <label class="form-group__label">Предпочтение по типу судна:</label> | 258 | <label class="form-group__label">Предпочтение по типу судна:</label> |
358 | <div class="form-group__item"> | 259 | <div class="form-group__item"> |
359 | {{ $worker->boart_type_preference ?? '-' }} | 260 | {{ $worker->boart_type_preference ?? '-' }} |
360 | </div> | 261 | </div> |
361 | </div> | 262 | </div> |
362 | 263 | ||
363 | <div class="width100"> | 264 | <div class="width100"> |
364 | <h4 class="cabinet__h4 mb-10">О себе</h4> | 265 | <h4 class="cabinet__h4 mb-10">О себе</h4> |
365 | <div>{{ $worker->text }}</div> | 266 | <div>{{ $worker->text }}</div> |
366 | </div> | 267 | </div> |
367 | 268 | ||
368 | <div class=""> | 269 | <div class=""> |
369 | <a href="{{ route('worker.basic_information') }}" class="button active">Редактировать основную информацию</a> | 270 | <a href="{{ route('worker.basic_information') }}" class="button active">Редактировать основную информацию</a> |
370 | </div> | 271 | </div> |
371 | </div> | 272 | </div> |
372 | </div> | 273 | </div> |
373 | 274 | ||
374 | <div class="mb-40" id="sertificate" name="sertificate"> | 275 | <div class="mb-40" id="sertificate" name="sertificate"> |
375 | <h3 class="cabinet__subtitle font30 mb-20">Сертификаты / документы</h3> | 276 | <h3 class="cabinet__subtitle font30 mb-20">Сертификаты / документы</h3> |
376 | 277 | ||
377 | @if($worker->sertificate->count()) | 278 | @if($worker->sertificate->count()) |
378 | @foreach($worker->sertificate as $sertificate) | 279 | @foreach($worker->sertificate as $sertificate) |
379 | <div class="one-sertificate"> | 280 | <div class="one-sertificate"> |
380 | <div class="sertificate-field sertificate-name"> | 281 | <div class="sertificate-field sertificate-name"> |
381 | <label class="bold">Название сертификата:</label> | 282 | <label class="bold">Название сертификата:</label> |
382 | <div>{{ $sertificate->name }}</div> | 283 | <div>{{ $sertificate->name }}</div> |
383 | </div> | 284 | </div> |
384 | <div class="sertificate-field"> | 285 | <div class="sertificate-field"> |
385 | <label class="bold">Действителен до:</label> | 286 | <label class="bold">Действителен до:</label> |
386 | <div>{{ date('d.m.Y', strtotime($sertificate->end_begin)) }}</div> | 287 | <div>{{ date('d.m.Y', strtotime($sertificate->end_begin)) }}</div> |
387 | </div> | 288 | </div> |
388 | <div class="sertificate-field sertificate-buttons"> | 289 | <div class="sertificate-field sertificate-buttons"> |
389 | <a href="{{ route('worker.edit_sertificate', ['worker' => $worker->id, 'doc' => $sertificate->id ]) }}" class="button button_light mr-10"> | 290 | <a href="{{ route('worker.edit_sertificate', ['worker' => $worker->id, 'doc' => $sertificate->id ]) }}" class="button button_light mr-10"> |
390 | <svg><use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use></svg> | 291 | <svg><use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use></svg> |
391 | </a> | 292 | </a> |
392 | <a href="{{ route('worker.delete_sertificate', ['doc' => $sertificate->id]) }}" class="button button_light"> | 293 | <a href="{{ route('worker.delete_sertificate', ['doc' => $sertificate->id]) }}" class="button button_light"> |
393 | <svg><use xlink:href="{{ asset('images/sprite.svg#del') }}"></use></svg> | 294 | <svg><use xlink:href="{{ asset('images/sprite.svg#del') }}"></use></svg> |
394 | </a> | 295 | </a> |
395 | </div> | 296 | </div> |
396 | </div> | 297 | </div> |
397 | @endforeach | 298 | @endforeach |
398 | @endif | 299 | @endif |
399 | 300 | ||
400 | <a class="button fit-content" href="{{ route('worker.new_sertificate',['worker' => $worker->id]) }}" id="button_new_doc" name="button_new_doc"> | 301 | <a class="button fit-content" href="{{ route('worker.new_sertificate',['worker' => $worker->id]) }}" id="button_new_doc" name="button_new_doc"> |
401 | Добавить сертификат / документ | 302 | Добавить сертификат / документ |
402 | </a> | 303 | </a> |
403 | </div> | 304 | </div> |
404 | 305 | ||
405 | <div class="cabinet__body-item mb-40" name="ajax_dop_diplomi" id="ajax_dop_diplomi"> | 306 | <div class="cabinet__body-item mb-40" name="ajax_dop_diplomi" id="ajax_dop_diplomi"> |
406 | <h3 class="cabinet__subtitle font30">Дополнительные документы</h3> | 307 | <h3 class="cabinet__subtitle font30">Дополнительные документы</h3> |
407 | 308 | ||
408 | <div class="cabinet__inputs" id="block_sertificate"> | 309 | <div class="cabinet__inputs" id="block_sertificate"> |
409 | @if ($info_blocks->count()) | 310 | @if ($info_blocks->count()) |
410 | @foreach ($info_blocks as $info_block) | 311 | @foreach ($info_blocks as $info_block) |
411 | <div class="cabinet__inputs-item column-count-3 form-group"> | 312 | <div class="cabinet__inputs-item column-count-3 form-group"> |
412 | <label class="form-group__label">{{ $info_block->name }}:</label> | 313 | <label class="form-group__label">{{ $info_block->name }}:</label> |
413 | 314 | ||
414 | <div class="form-group__item"> | 315 | <div class="form-group__item"> |
415 | @php $status = 0; @endphp | 316 | @php $status = 0; @endphp |
416 | @if (!empty($worker->dop_info[$info_block->id]) && $worker->dop_info[$info_block->id]['status']) | 317 | @if (!empty($worker->dop_info[$info_block->id]) && $worker->dop_info[$info_block->id]['status']) |
417 | @php $status = $worker->dop_info[$info_block->id]['status']; @endphp | 318 | @php $status = $worker->dop_info[$info_block->id]['status']; @endphp |
418 | @endif | 319 | @endif |
419 | {{ $additional_document_statuses[$status] }} | 320 | {{ $additional_document_statuses[$status] }} |
420 | </div> | 321 | </div> |
421 | </div> | 322 | </div> |
422 | @endforeach | 323 | @endforeach |
423 | @endif | 324 | @endif |
424 | </div> | 325 | </div> |
425 | 326 | ||
426 | <a class="button fit-content" href="{{ route('worker.additional_documents') }}"> | 327 | <a class="button fit-content" href="{{ route('worker.additional_documents') }}"> |
427 | Редактировать дополнительные документы | 328 | Редактировать дополнительные документы |
428 | </a> | 329 | </a> |
429 | </div> | 330 | </div> |
430 | 331 | ||
431 | <div class="cabinet__body-item mb-20"> | 332 | <div class="cabinet__body-item mb-20"> |
432 | <div> | 333 | <div> |
433 | <h3 class="cabinet__subtitle font30">Опыт работы</h3> | 334 | <h3 class="cabinet__subtitle font30">Опыт работы</h3> |
434 | <div class="">Начните заполнение анкеты с указания последнего места работы</div> | 335 | <div class="">Начните заполнение анкеты с указания последнего места работы</div> |
435 | </div> | 336 | </div> |
436 | 337 | ||
437 | <div class="cabinet__works"> | 338 | <div class="cabinet__works"> |
438 | @if (isset($worker->place_worker)) | 339 | @if (isset($worker->place_worker)) |
439 | @foreach($worker->place_worker as $company) | 340 | @foreach($worker->place_worker as $company) |
440 | <div class="cabinet__works-item"> | 341 | <div class="cabinet__works-item"> |
441 | <div class="cabinet__works-spoiler active"> | 342 | <div class="cabinet__works-spoiler active"> |
442 | <div class="cabinet__works-spoiler-left"> | 343 | <div class="cabinet__works-spoiler-left"> |
443 | <div class="cabinet__works-spoiler-text">Место работы {{ $loop->iteration }}</div> | 344 | <div class="cabinet__works-spoiler-text">Место работы {{ $loop->iteration }}</div> |
444 | </div> | 345 | </div> |
445 | <div class="cabinet__works-spoiler-buttons"> | 346 | <div class="cabinet__works-spoiler-buttons"> |
446 | <a href="{{ route('worker.delete_document', ['doc' => $company->id]) }}" class="button button_light js-works-remove"> | 347 | <a href="{{ route('worker.delete_document', ['doc' => $company->id]) }}" class="button button_light js-works-remove"> |
447 | <svg> | 348 | <svg> |
448 | <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> | 349 | <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> |
449 | </svg> | 350 | </svg> |
450 | </a> | 351 | </a> |
451 | <a href="{{ route('worker.edit_document', ['doc' => $company->id, 'worker' => $worker->id]) }}" type="button" class="button button_light js-works-edit"> | 352 | <a href="{{ route('worker.edit_document', ['doc' => $company->id, 'worker' => $worker->id]) }}" type="button" class="button button_light js-works-edit"> |
452 | <svg> | 353 | <svg> |
453 | <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> | 354 | <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> |
454 | </svg> | 355 | </svg> |
455 | </a> | 356 | </a> |
456 | </div> | 357 | </div> |
457 | </div> | 358 | </div> |
458 | 359 | ||
459 | <div class="cabinet__works-body"> | 360 | <div class="cabinet__works-body"> |
460 | <div class="cabinet__inputs"> | 361 | <div class="cabinet__inputs"> |
461 | <div class="cabinet__inputs-item column-count-3 form-group"> | 362 | <div class="cabinet__inputs-item column-count-3 form-group"> |
462 | <label class="form-group__label">Должность:</label> | 363 | <label class="form-group__label">Должность:</label> |
463 | <div class="form-group__item"> | 364 | <div class="form-group__item"> |
464 | {{ $company->job_title ?? '-' }} | 365 | {{ $company->job_title ?? '-' }} |
465 | </div> | 366 | </div> |
466 | </div> | 367 | </div> |
467 | 368 | ||
468 | <div class="cabinet__inputs-item column-count-3 form-group"> | 369 | <div class="cabinet__inputs-item column-count-3 form-group"> |
469 | <label class="form-group__label">Название т/х:</label> | 370 | <label class="form-group__label">Название т/х:</label> |
470 | <div class="form-group__item"> | 371 | <div class="form-group__item"> |
471 | {{ $company->teplohod ?? '-' }} | 372 | {{ $company->teplohod ?? '-' }} |
472 | </div> | 373 | </div> |
473 | </div> | 374 | </div> |
474 | <div class="cabinet__inputs-item column-count-3 form-group"> | 375 | <div class="cabinet__inputs-item column-count-3 form-group"> |
475 | <label class="form-group__label">Тип суда:</label> | 376 | <label class="form-group__label">Тип суда:</label> |
476 | <div class="form-group__item"> | 377 | <div class="form-group__item"> |
477 | {{ $company->GWT ?? '-' }} | 378 | {{ $company->GWT ?? '-' }} |
478 | </div> | 379 | </div> |
479 | </div> | 380 | </div> |
480 | <div class="cabinet__inputs-item column-count-3 form-group"> | 381 | <div class="cabinet__inputs-item column-count-3 form-group"> |
481 | <label class="form-group__label">Марка ГД:</label> | 382 | <label class="form-group__label">Марка ГД:</label> |
482 | <div class="form-group__item"> | 383 | <div class="form-group__item"> |
483 | {{ $company->Marka_GD ?? '-' }} | 384 | {{ $company->Marka_GD ?? '-' }} |
484 | </div> | 385 | </div> |
485 | </div> | 386 | </div> |
486 | <div class="cabinet__inputs-item column-count-3 form-group"> | 387 | <div class="cabinet__inputs-item column-count-3 form-group"> |
487 | <label class="form-group__label">Мощность ГД (кВТ):</label> | 388 | <label class="form-group__label">Мощность ГД (кВТ):</label> |
488 | <div class="form-group__item"> | 389 | <div class="form-group__item"> |
489 | {{ $company->KBT ?? '-' }} | 390 | {{ $company->KBT ?? '-' }} |
490 | </div> | 391 | </div> |
491 | </div> | 392 | </div> |
492 | <div class="cabinet__inputs-item column-count-3 form-group"> | 393 | <div class="cabinet__inputs-item column-count-3 form-group"> |
493 | <label class="form-group__label">Водоизмещение (DWT):</label> | 394 | <label class="form-group__label">Водоизмещение (DWT):</label> |
494 | <div class="form-group__item"> | 395 | <div class="form-group__item"> |
495 | {{ $company->GRT ?? '-' }} | 396 | {{ $company->GRT ?? '-' }} |
496 | </div> | 397 | </div> |
497 | </div> | 398 | </div> |
498 | <div class="cabinet__inputs-item column-count-3 form-group"> | 399 | <div class="cabinet__inputs-item column-count-3 form-group"> |
499 | <label class="form-group__label">Название компании:</label> | 400 | <label class="form-group__label">Название компании:</label> |
500 | <div class="form-group__item"> | 401 | <div class="form-group__item"> |
501 | {{ $company->name_company ?? '-' }} | 402 | {{ $company->name_company ?? '-' }} |
502 | </div> | 403 | </div> |
503 | </div> | 404 | </div> |
504 | <div class="cabinet__inputs-item column-count-3 form-group"> | 405 | <div class="cabinet__inputs-item column-count-3 form-group"> |
505 | <label class="form-group__label">Начало контракта:</label> | 406 | <label class="form-group__label">Начало контракта:</label> |
506 | <div class="form-group__item"> | 407 | <div class="form-group__item"> |
507 | {{ $company->begin_work ?? '-' }} | 408 | {{ $company->begin_work ?? '-' }} |
508 | </div> | 409 | </div> |
509 | </div> | 410 | </div> |
510 | <div class="cabinet__inputs-item column-count-3 form-group"> | 411 | <div class="cabinet__inputs-item column-count-3 form-group"> |
511 | <label class="form-group__label">Окончание контракта:</label> | 412 | <label class="form-group__label">Окончание контракта:</label> |
512 | <div class="form-group__item"> | 413 | <div class="form-group__item"> |
513 | {{ $company->end_work ?? '-' }} | 414 | {{ $company->end_work ?? '-' }} |
514 | </div> | 415 | </div> |
515 | </div> | 416 | </div> |
516 | 417 | ||
517 | </div> | 418 | </div> |
518 | </div> | 419 | </div> |
519 | </div> | 420 | </div> |
520 | @endforeach | 421 | @endforeach |
521 | @endif | 422 | @endif |
522 | </div> | 423 | </div> |
523 | 424 | ||
524 | <a href="{{ route('worker.add_document', ['worker' => $worker->id]) }}" id="new_work" name="new_work" class="button fit-content"> | 425 | <a href="{{ route('worker.add_document', ['worker' => $worker->id]) }}" id="new_work" name="new_work" class="button fit-content"> |
525 | Добавить место работы | 426 | Добавить место работы |
526 | </a> | 427 | </a> |
527 | </div> | 428 | </div> |
528 | 429 | ||
529 | <div id="prev_worker" name="prev_worker"> | 430 | <div id="prev_worker" name="prev_worker"> |
530 | <div> | 431 | <div> |
531 | <h3 class="cabinet__subtitle font30">Рекомендации</h3> | 432 | <h3 class="cabinet__subtitle font30">Рекомендации</h3> |
532 | <div class="">Укажите контакты компаний, которые могут дать рекомендации</div> | 433 | <div class="">Укажите контакты компаний, которые могут дать рекомендации</div> |
533 | </div> | 434 | </div> |
534 | 435 | ||
535 | @if ((isset($worker->prev_company)) && ($worker->prev_company->count() > 0)) | 436 | @if ((isset($worker->prev_company)) && ($worker->prev_company->count() > 0)) |
536 | @foreach($worker->prev_company as $it) | 437 | @foreach($worker->prev_company as $it) |
537 | <div class="cabinet__body-item"> | 438 | <div class="cabinet__body-item"> |
538 | <div class="cabinet__inputs mt-30"> | 439 | <div class="cabinet__inputs mt-30"> |
539 | <div class="cabinet__inputs-item column-count-3 form-group"> | 440 | <div class="cabinet__inputs-item column-count-3 form-group"> |
540 | <label class="form-group__label">Название компании:</label> | 441 | <label class="form-group__label">Название компании:</label> |
541 | <div class="form-group__item"> | 442 | <div class="form-group__item"> |
542 | {{ $it->name_company }} | 443 | {{ $it->name_company }} |
543 | </div> | 444 | </div> |
544 | </div> | 445 | </div> |
545 | <div class="cabinet__inputs-item column-count-3 form-group"> | 446 | <div class="cabinet__inputs-item column-count-3 form-group"> |
546 | <label class="form-group__label">ФИО сотрудника:</label> | 447 | <label class="form-group__label">ФИО сотрудника:</label> |
547 | <div class="form-group__item"> | 448 | <div class="form-group__item"> |
548 | {{ $it->direct }} | 449 | {{ $it->direct }} |
549 | </div> | 450 | </div> |
550 | </div> | 451 | </div> |
551 | <div class="cabinet__inputs-item column-count-3 form-group cabinet__inputs-item-buttons"> | 452 | <div class="cabinet__inputs-item column-count-3 form-group cabinet__inputs-item-buttons"> |
552 | <div class="flex"> | 453 | <div class="flex"> |
553 | <a href="{{ route('worker.delete_prev_company', ['doc' => $it->id]) }}" class="button button_light mr-10"> | 454 | <a href="{{ route('worker.delete_prev_company', ['doc' => $it->id]) }}" class="button button_light mr-10"> |
554 | <svg> | 455 | <svg> |
555 | <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> | 456 | <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> |
556 | </svg> | 457 | </svg> |
557 | </a> | 458 | </a> |
558 | <a href="{{ route('worker.edit_prev_company', ['worker' => $worker->id, 'doc' => $it->id ]) }}" class="button button_light"> | 459 | <a href="{{ route('worker.edit_prev_company', ['worker' => $worker->id, 'doc' => $it->id ]) }}" class="button button_light"> |
559 | <svg> | 460 | <svg> |
560 | <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> | 461 | <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> |
561 | </svg> | 462 | </svg> |
562 | </a> | 463 | </a> |
563 | </div> | 464 | </div> |
564 | </div> | 465 | </div> |
565 | <div class="cabinet__inputs-item column-count-3 form-group"> | 466 | <div class="cabinet__inputs-item column-count-3 form-group"> |
566 | <label class="form-group__label">Должность сотрудника:</label> | 467 | <label class="form-group__label">Должность сотрудника:</label> |
567 | <div class="form-group__item"> | 468 | <div class="form-group__item"> |
568 | {{ $it->telephone }} | 469 | {{ $it->telephone }} |
569 | </div> | 470 | </div> |
570 | </div> | 471 | </div> |
571 | <div class="cabinet__inputs-item column-count-3 form-group"> | 472 | <div class="cabinet__inputs-item column-count-3 form-group"> |
572 | <label class="form-group__label">Телефон сотрудника:</label> | 473 | <label class="form-group__label">Телефон сотрудника:</label> |
573 | <div class="form-group__item"> | 474 | <div class="form-group__item"> |
574 | {{ $it->telephone2 }} | 475 | {{ $it->telephone2 }} |
575 | </div> | 476 | </div> |
576 | </div> | 477 | </div> |
577 | <div class="cabinet__inputs-item column-count-3 form-group cabinet__inputs-item-buttons"></div> | 478 | <div class="cabinet__inputs-item column-count-3 form-group cabinet__inputs-item-buttons"></div> |
578 | </div> | 479 | </div> |
579 | </div> | 480 | </div> |
580 | @endforeach | 481 | @endforeach |
581 | @endif | 482 | @endif |
582 | </div> | 483 | </div> |
583 | 484 |
routes/web.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | use App\Http\Controllers\Ad_jobsController; | 3 | use App\Http\Controllers\Ad_jobsController; |
4 | use App\Http\Controllers\AdEmployerController; | 4 | use App\Http\Controllers\AdEmployerController; |
5 | use App\Http\Controllers\Admin\AdminController; | 5 | use App\Http\Controllers\Admin\AdminController; |
6 | use App\Http\Controllers\Admin\CategoryController; | 6 | use App\Http\Controllers\Admin\CategoryController; |
7 | use App\Http\Controllers\Admin\CategoryEmpController; | 7 | use App\Http\Controllers\Admin\CategoryEmpController; |
8 | use App\Http\Controllers\Admin\EducationController; | 8 | use App\Http\Controllers\Admin\EducationController; |
9 | use App\Http\Controllers\EducationController as EducationFrontController; | 9 | use App\Http\Controllers\EducationController as EducationFrontController; |
10 | use App\Http\Controllers\Admin\EmployersController; | 10 | use App\Http\Controllers\Admin\EmployersController; |
11 | use App\Http\Controllers\EmployerController as FrontEmployersController; | 11 | use App\Http\Controllers\EmployerController as FrontEmployersController; |
12 | use App\Http\Controllers\Admin\InfoBloksController; | 12 | use App\Http\Controllers\Admin\InfoBloksController; |
13 | use App\Http\Controllers\Admin\JobTitlesController; | 13 | use App\Http\Controllers\Admin\JobTitlesController; |
14 | use App\Http\Controllers\Admin\UsersController; | 14 | use App\Http\Controllers\Admin\UsersController; |
15 | use App\Http\Controllers\Admin\WorkersController; | 15 | use App\Http\Controllers\Admin\WorkersController; |
16 | use App\Http\Controllers\Auth\ForgotPasswordController; | 16 | use App\Http\Controllers\Auth\ForgotPasswordController; |
17 | use App\Http\Controllers\Auth\LoginController; | 17 | use App\Http\Controllers\Auth\LoginController; |
18 | use App\Http\Controllers\Auth\RegisterController; | 18 | use App\Http\Controllers\Auth\RegisterController; |
19 | use App\Http\Controllers\CKEditorController; | 19 | use App\Http\Controllers\CKEditorController; |
20 | use App\Http\Controllers\MediaController; | 20 | use App\Http\Controllers\MediaController; |
21 | use App\Http\Controllers\WorkerController; | 21 | use App\Http\Controllers\WorkerController; |
22 | use App\Models\Ad_jobs; | 22 | use App\Models\Ad_jobs; |
23 | use App\Models\User; | 23 | use App\Models\User; |
24 | use App\Http\Controllers\MainController; | 24 | use App\Http\Controllers\MainController; |
25 | use App\Http\Controllers\HomeController; | 25 | use App\Http\Controllers\HomeController; |
26 | use Illuminate\Support\Facades\Route; | 26 | use Illuminate\Support\Facades\Route; |
27 | use App\Http\Controllers\Admin\CompanyController; | 27 | use App\Http\Controllers\Admin\CompanyController; |
28 | use App\Http\Controllers\Admin\Ad_EmployersController; | 28 | use App\Http\Controllers\Admin\Ad_EmployersController; |
29 | use App\Http\Controllers\Admin\MsgAnswersController; | 29 | use App\Http\Controllers\Admin\MsgAnswersController; |
30 | use App\Http\Controllers\Admin\GroupsController; | 30 | use App\Http\Controllers\Admin\GroupsController; |
31 | use App\Http\Controllers\PagesController; | 31 | use App\Http\Controllers\PagesController; |
32 | use Illuminate\Support\Facades\Storage; | 32 | use Illuminate\Support\Facades\Storage; |
33 | use App\Http\Controllers\EmployerController; | 33 | use App\Http\Controllers\EmployerController; |
34 | use App\Http\Controllers\CompanyController as FrontCompanyController; | 34 | use App\Http\Controllers\CompanyController as FrontCompanyController; |
35 | 35 | ||
36 | 36 | ||
37 | /* | 37 | /* |
38 | |-------------------------------------------------------------------------- | 38 | |-------------------------------------------------------------------------- |
39 | | Web Routes | 39 | | Web Routes |
40 | |-------------------------------------------------------------------------- | 40 | |-------------------------------------------------------------------------- |
41 | | | 41 | | |
42 | | Here is where you can register web routes for your application. These | 42 | | Here is where you can register web routes for your application. These |
43 | | routes are loaded by the RouteServiceProvider within a group which | 43 | | routes are loaded by the RouteServiceProvider within a group which |
44 | | contains the "web" middleware group. Now create something great! | 44 | | contains the "web" middleware group. Now create something great! |
45 | | | 45 | | |
46 | */ | 46 | */ |
47 | /* | 47 | /* |
48 | Route::get('/', function () { | 48 | Route::get('/', function () { |
49 | return view('welcome'); | 49 | return view('welcome'); |
50 | })->name('index'); | 50 | })->name('index'); |
51 | */ | 51 | */ |
52 | 52 | ||
53 | Route::get('/', [MainController::class, 'index'])->name('index'); | 53 | Route::get('/', [MainController::class, 'index'])->name('index'); |
54 | 54 | ||
55 | //Роуты авторизации, регистрации, восстановления, аутентификации | 55 | //Роуты авторизации, регистрации, восстановления, аутентификации |
56 | Auth::routes(['verify' => true]); | 56 | Auth::routes(['verify' => true]); |
57 | 57 | ||
58 | // роуты регистрации, авторизации, восстановления пароля, верификации почты | 58 | // роуты регистрации, авторизации, восстановления пароля, верификации почты |
59 | /*Route::group([ | 59 | /*Route::group([ |
60 | 'as' => 'auth.', //имя маршрута, например auth.index | 60 | 'as' => 'auth.', //имя маршрута, например auth.index |
61 | 'prefix' => 'auth', // префикс маршрута, например, auth/index | 61 | 'prefix' => 'auth', // префикс маршрута, например, auth/index |
62 | ], function () { | 62 | ], function () { |
63 | //форма регистрации | 63 | //форма регистрации |
64 | Route::get('register', [RegisterController::class, 'register'])->name('register'); | 64 | Route::get('register', [RegisterController::class, 'register'])->name('register'); |
65 | 65 | ||
66 | //создание пользователя | 66 | //создание пользователя |
67 | Route::post('register', [RegisterController::class, 'create'])->name('create'); | 67 | Route::post('register', [RegisterController::class, 'create'])->name('create'); |
68 | 68 | ||
69 | //форма входа авторизации | 69 | //форма входа авторизации |
70 | Route::get('login', [LoginController::class, 'login'])->name('login'); | 70 | Route::get('login', [LoginController::class, 'login'])->name('login'); |
71 | 71 | ||
72 | //аутентификация | 72 | //аутентификация |
73 | Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); | 73 | Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); |
74 | 74 | ||
75 | //выход | 75 | //выход |
76 | Route::get('logout', [LoginController::class, 'logout'])->name('logout'); | 76 | Route::get('logout', [LoginController::class, 'logout'])->name('logout'); |
77 | 77 | ||
78 | //форма ввода адреса почты | 78 | //форма ввода адреса почты |
79 | Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); | 79 | Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); |
80 | 80 | ||
81 | //письмо на почту | 81 | //письмо на почту |
82 | Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); | 82 | Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); |
83 | 83 | ||
84 | //форма восстановления пароля | 84 | //форма восстановления пароля |
85 | Route::get('reset-password/token/{token}/email/{email}', | 85 | Route::get('reset-password/token/{token}/email/{email}', |
86 | [ResetPasswordController::class, 'form'] | 86 | [ResetPasswordController::class, 'form'] |
87 | )->name('reset-form'); | 87 | )->name('reset-form'); |
88 | 88 | ||
89 | //восстановление пароля | 89 | //восстановление пароля |
90 | Route::post('reset-password', | 90 | Route::post('reset-password', |
91 | [ResetPasswordController::class, 'reset'] | 91 | [ResetPasswordController::class, 'reset'] |
92 | )->name('reset-password'); | 92 | )->name('reset-password'); |
93 | 93 | ||
94 | //сообщение о необходимости проверки адреса почты | 94 | //сообщение о необходимости проверки адреса почты |
95 | Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); | 95 | Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); |
96 | 96 | ||
97 | //подтверждение адреса почты нового пользователя | 97 | //подтверждение адреса почты нового пользователя |
98 | Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) | 98 | Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) |
99 | ->where('token', '[a-f0-9]{32}') | 99 | ->where('token', '[a-f0-9]{32}') |
100 | ->where('id', '[0-9]+') | 100 | ->where('id', '[0-9]+') |
101 | ->name('verify-email'); | 101 | ->name('verify-email'); |
102 | });*/ | 102 | });*/ |
103 | 103 | ||
104 | //Личный кабинет пользователя | 104 | //Личный кабинет пользователя |
105 | Route::get('/home', [HomeController::class, 'index'])->name('home'); | 105 | Route::get('/home', [HomeController::class, 'index'])->name('home'); |
106 | 106 | ||
107 | /* | 107 | /* |
108 | Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { | 108 | Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { |
109 | $user = User::where('email',$request->input('email'))->first(); | 109 | $user = User::where('email',$request->input('email'))->first(); |
110 | 110 | ||
111 | $user->sendEmailVerificationNotification(); | 111 | $user->sendEmailVerificationNotification(); |
112 | 112 | ||
113 | return 'your response'; | 113 | return 'your response'; |
114 | })->middleware('throttle:6,1')->name('verification.resend'); | 114 | })->middleware('throttle:6,1')->name('verification.resend'); |
115 | */ | 115 | */ |
116 | 116 | ||
117 | // Авторизация, регистрация в админку | 117 | // Авторизация, регистрация в админку |
118 | Route::group([ | 118 | Route::group([ |
119 | 'as' => 'admin.', // имя маршрута, например auth.index | 119 | 'as' => 'admin.', // имя маршрута, например auth.index |
120 | 'prefix' => 'admin', // префикс маршрута, например auth/index | 120 | 'prefix' => 'admin', // префикс маршрута, например auth/index |
121 | 'middleware' => ['guest'], | 121 | 'middleware' => ['guest'], |
122 | ], function () { | 122 | ], function () { |
123 | // Форма регистрации | 123 | // Форма регистрации |
124 | Route::get('register', [AdminController::class, 'register'])->name('register'); | 124 | Route::get('register', [AdminController::class, 'register'])->name('register'); |
125 | // Создание пользователя | 125 | // Создание пользователя |
126 | Route::post('register', [AdminController::class, 'create'])->name('create'); | 126 | Route::post('register', [AdminController::class, 'create'])->name('create'); |
127 | 127 | ||
128 | //Форма входа | 128 | //Форма входа |
129 | Route::get('login', [AdminController::class, 'login'])->name('login'); | 129 | Route::get('login', [AdminController::class, 'login'])->name('login'); |
130 | 130 | ||
131 | // аутентификация | 131 | // аутентификация |
132 | Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); | 132 | Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); |
133 | 133 | ||
134 | }); | 134 | }); |
135 | 135 | ||
136 | // Личный кабинет админки | 136 | // Личный кабинет админки |
137 | Route::group([ | 137 | Route::group([ |
138 | 'as' => 'admin.', // имя маршрута, например auth.index | 138 | 'as' => 'admin.', // имя маршрута, например auth.index |
139 | 'prefix' => 'admin', // префикс маршрута, например auth/index | 139 | 'prefix' => 'admin', // префикс маршрута, например auth/index |
140 | 'middleware' => ['auth'], ['admin'], | 140 | 'middleware' => ['auth'], ['admin'], |
141 | ], function() { | 141 | ], function() { |
142 | 142 | ||
143 | // выход | 143 | // выход |
144 | Route::get('logout', [AdminController::class, 'logout'])->name('logout'); | 144 | Route::get('logout', [AdminController::class, 'logout'])->name('logout'); |
145 | 145 | ||
146 | // кабинет главная страница | 146 | // кабинет главная страница |
147 | Route::get('cabinet', [AdminController::class, 'index'])->name('index'); | 147 | Route::get('cabinet', [AdminController::class, 'index'])->name('index'); |
148 | 148 | ||
149 | // кабинет профиль админа - форма | 149 | // кабинет профиль админа - форма |
150 | Route::get('profile', [AdminController::class, 'profile'])->name('profile'); | 150 | Route::get('profile', [AdminController::class, 'profile'])->name('profile'); |
151 | // кабинет профиль админа - сохранение формы | 151 | // кабинет профиль админа - сохранение формы |
152 | Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); | 152 | Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); |
153 | 153 | ||
154 | //кабинет сообщения админа | 154 | //кабинет сообщения админа |
155 | //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); | 155 | //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); |
156 | 156 | ||
157 | 157 | ||
158 | // кабинет профиль - форма пароли | 158 | // кабинет профиль - форма пароли |
159 | Route::get('password', [AdminController::class, 'profile_password'])->name('password'); | 159 | Route::get('password', [AdminController::class, 'profile_password'])->name('password'); |
160 | // кабинет профиль - сохранение формы пароля | 160 | // кабинет профиль - сохранение формы пароля |
161 | Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); | 161 | Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); |
162 | 162 | ||
163 | 163 | ||
164 | // кабинет профиль пользователя - форма | 164 | // кабинет профиль пользователя - форма |
165 | Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); | 165 | Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); |
166 | // кабинет профиль пользователя - сохранение формы | 166 | // кабинет профиль пользователя - сохранение формы |
167 | Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); | 167 | Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); |
168 | 168 | ||
169 | // кабинет профиль работодатель - форма | 169 | // кабинет профиль работодатель - форма |
170 | Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); | 170 | Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); |
171 | // кабинет профиль работодатель - сохранение формы | 171 | // кабинет профиль работодатель - сохранение формы |
172 | Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); | 172 | Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); |
173 | // кабинет удаление профиль работодателя и юзера | 173 | // кабинет удаление профиль работодателя и юзера |
174 | Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); | 174 | Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); |
175 | 175 | ||
176 | // кабинет профиль работник - форма | 176 | // кабинет профиль работник - форма |
177 | Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); | 177 | Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); |
178 | Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); | 178 | Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); |
179 | Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); | 179 | Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); |
180 | // кабинет профиль работник - сохранение формы | 180 | // кабинет профиль работник - сохранение формы |
181 | Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); | 181 | Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); |
182 | 182 | ||
183 | // Медиа | 183 | // Медиа |
184 | Route::get('media', [MediaController::class, 'index'])->name('media'); | 184 | Route::get('media', [MediaController::class, 'index'])->name('media'); |
185 | Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media'); | 185 | Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media'); |
186 | 186 | ||
187 | // кабинет настройки сайта - форма | 187 | // кабинет настройки сайта - форма |
188 | Route::get('config', [AdminController::class, 'config_form'])->name('config'); | 188 | Route::get('config', [AdminController::class, 'config_form'])->name('config'); |
189 | // кабинет настройки сайта сохранение формы | 189 | // кабинет настройки сайта сохранение формы |
190 | Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); | 190 | Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); |
191 | 191 | ||
192 | // кабинет - новости | 192 | // кабинет - новости |
193 | Route::get('news-list', [AdminController::class, 'news_admin'])->name('news_admin'); | 193 | Route::get('news-list', [AdminController::class, 'news_admin'])->name('news_admin'); |
194 | Route::get('news/add', [AdminController::class, 'new_admin_add'])->name('new_admin_add'); | 194 | Route::get('news/add', [AdminController::class, 'new_admin_add'])->name('new_admin_add'); |
195 | Route::post('news/add', [AdminController::class, 'new_admin_add_save'])->name('new_admin_save_add'); | 195 | Route::post('news/add', [AdminController::class, 'new_admin_add_save'])->name('new_admin_save_add'); |
196 | Route::get('news/edit/{new}', [AdminController::class, 'new_admin_edit'])->name('new_admin_edit'); | 196 | Route::get('news/edit/{new}', [AdminController::class, 'new_admin_edit'])->name('new_admin_edit'); |
197 | Route::post('news/edit/{new}', [AdminController::class, 'new_admin_update_save'])->name('new_admin_update'); | 197 | Route::post('news/edit/{new}', [AdminController::class, 'new_admin_update_save'])->name('new_admin_update'); |
198 | Route::get('news/delete/{new}', [AdminController::class, 'new_admin_delete'])->name('new_admin_delete'); | 198 | Route::get('news/delete/{new}', [AdminController::class, 'new_admin_delete'])->name('new_admin_delete'); |
199 | 199 | ||
200 | // кабинет - пользователи | 200 | // кабинет - пользователи |
201 | Route::get('users', [UsersController::class, 'index'])->name('users'); | 201 | Route::get('users', [UsersController::class, 'index'])->name('users'); |
202 | Route::get('user-delete/{user}', [UsersController::class, 'user_delete'])->name('user_delete'); | 202 | Route::get('user-delete/{user}', [UsersController::class, 'user_delete'])->name('user_delete'); |
203 | 203 | ||
204 | // кабинет - пользователи | 204 | // кабинет - пользователи |
205 | Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); | 205 | Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); |
206 | 206 | ||
207 | // кабинет - работодатели | 207 | // кабинет - работодатели |
208 | Route::get('employers', [EmployersController::class, 'index'])->name('employers'); | 208 | Route::get('employers', [EmployersController::class, 'index'])->name('employers'); |
209 | 209 | ||
210 | Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); | 210 | Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); |
211 | 211 | ||
212 | Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add'); | 212 | Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add'); |
213 | Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save'); | 213 | Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save'); |
214 | Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot'); | 214 | Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot'); |
215 | Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit'); | 215 | Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit'); |
216 | Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete'); | 216 | Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete'); |
217 | 217 | ||
218 | // кабинет - соискатели | 218 | // кабинет - соискатели |
219 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); | 219 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); |
220 | 220 | ||
221 | // кабинет - база данных | 221 | // кабинет - база данных |
222 | Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); | 222 | Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); |
223 | Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); | 223 | Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); |
224 | Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); | 224 | Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); |
225 | Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); | 225 | Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); |
226 | Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); | 226 | Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); |
227 | Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); | 227 | Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); |
228 | Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); | 228 | Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); |
229 | 229 | ||
230 | // кабинет - вакансии | 230 | // кабинет - вакансии |
231 | Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); | 231 | Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); |
232 | Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers'); | 232 | Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers'); |
233 | Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers'); | 233 | Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers'); |
234 | Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); | 234 | Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); |
235 | Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); | 235 | Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); |
236 | Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer'); | 236 | Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer'); |
237 | 237 | ||
238 | // Редактирование должности в вакансии | 238 | // Редактирование должности в вакансии |
239 | Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs'); | 239 | Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs'); |
240 | Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs'); | 240 | Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs'); |
241 | 241 | ||
242 | 242 | ||
243 | // кабинет - категории | 243 | // кабинет - категории |
244 | //Route::get('categories', [AdminController::class, 'index'])->name('categories'); | 244 | //Route::get('categories', [AdminController::class, 'index'])->name('categories'); |
245 | 245 | ||
246 | // СRUD-операции над Справочником Категории | 246 | // СRUD-операции над Справочником Категории |
247 | 247 | ||
248 | Route::resource('categories', CategoryController::class, ['except' => ['show']]); | 248 | Route::resource('categories', CategoryController::class, ['except' => ['show']]); |
249 | 249 | ||
250 | // CRUD-операции над справочником Категории для работодателей | 250 | // CRUD-операции над справочником Категории для работодателей |
251 | Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); | 251 | Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); |
252 | 252 | ||
253 | // CRUD-операции над справочником Образование | 253 | // CRUD-операции над справочником Образование |
254 | Route::resource('education', EducationController::class, ['except' => ['show']]); | 254 | Route::resource('education', EducationController::class, ['except' => ['show']]); |
255 | 255 | ||
256 | Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education'); | 256 | Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education'); |
257 | Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); | 257 | Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); |
258 | Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); | 258 | Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); |
259 | 259 | ||
260 | Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); | 260 | Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); |
261 | Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education'); | 261 | Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education'); |
262 | 262 | ||
263 | Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); | 263 | Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); |
264 | 264 | ||
265 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); | 265 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); |
266 | /* | 266 | /* |
267 | * кабинет - CRUD-операции по справочнику должности | 267 | * кабинет - CRUD-операции по справочнику должности |
268 | * | 268 | * |
269 | */ | 269 | */ |
270 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); | 270 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); |
271 | 271 | ||
272 | // кабинет - сообщения (чтение чужих) | 272 | // кабинет - сообщения (чтение чужих) |
273 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); | 273 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); |
274 | // кабинет - просмотр сообщения чужого (чтение) | 274 | // кабинет - просмотр сообщения чужого (чтение) |
275 | Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); | 275 | Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); |
276 | 276 | ||
277 | // кабинет - сообщения (админские) | 277 | // кабинет - сообщения (админские) |
278 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); | 278 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); |
279 | // кабинет - сообщения (админские) | 279 | // кабинет - сообщения (админские) |
280 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); | 280 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); |
281 | // кабинет - sql - конструкция запросов | 281 | // кабинет - sql - конструкция запросов |
282 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); | 282 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); |
283 | 283 | ||
284 | /* | 284 | /* |
285 | * Расписанный подход в описании каждой директорий групп пользователей. | 285 | * Расписанный подход в описании каждой директорий групп пользователей. |
286 | */ | 286 | */ |
287 | // кабинет - группы пользователей | 287 | // кабинет - группы пользователей |
288 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); | 288 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); |
289 | // кабинет - добавление форма группы пользователей | 289 | // кабинет - добавление форма группы пользователей |
290 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); | 290 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); |
291 | // кабинет - сохранение формы группы пользователей | 291 | // кабинет - сохранение формы группы пользователей |
292 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); | 292 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); |
293 | // кабинет - редактирование форма группы пользователей | 293 | // кабинет - редактирование форма группы пользователей |
294 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); | 294 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); |
295 | // кабинет - сохранение редактированной формы группы пользователей | 295 | // кабинет - сохранение редактированной формы группы пользователей |
296 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); | 296 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); |
297 | // кабинет - удаление группы пользователей | 297 | // кабинет - удаление группы пользователей |
298 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); | 298 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); |
299 | 299 | ||
300 | 300 | ||
301 | // кабинет - список админов | 301 | // кабинет - список админов |
302 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); | 302 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); |
303 | 303 | ||
304 | // справочник Позиции | 304 | // справочник Позиции |
305 | Route::get('positions', [AdminController::class, 'position'])->name('position'); | 305 | Route::get('positions', [AdminController::class, 'position'])->name('position'); |
306 | Route::get('positions/add', [AdminController::class, 'position_add'])->name('add-position'); | 306 | Route::get('positions/add', [AdminController::class, 'position_add'])->name('add-position'); |
307 | Route::post('positions/add', [AdminController::class, 'position_add_save'])->name('add-save-position'); | 307 | Route::post('positions/add', [AdminController::class, 'position_add_save'])->name('add-save-position'); |
308 | Route::get('positions/edit/{position}', [AdminController::class, 'position_edit'])->name('edit-position'); | 308 | Route::get('positions/edit/{position}', [AdminController::class, 'position_edit'])->name('edit-position'); |
309 | Route::post('position/edit/{position}', [AdminController::class, 'position_update'])->name('update-position'); | 309 | Route::post('position/edit/{position}', [AdminController::class, 'position_update'])->name('update-position'); |
310 | Route::get('position/delete/{position}', [AdminController::class, 'position_delete'])->name('delete-position'); | 310 | Route::get('position/delete/{position}', [AdminController::class, 'position_delete'])->name('delete-position'); |
311 | 311 | ||
312 | /////редактор////// кабинет - редактор сайта//////////////////////// | 312 | /////редактор////// кабинет - редактор сайта//////////////////////// |
313 | Route::get('editor-site', function() { | 313 | Route::get('editor-site', function() { |
314 | return view('admin.editor.index'); | 314 | return view('admin.editor.index'); |
315 | })->name('editor-site'); | 315 | })->name('editor-site'); |
316 | 316 | ||
317 | 317 | ||
318 | // кабинет - редактор шапки-футера сайта | 318 | // кабинет - редактор шапки-футера сайта |
319 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); | 319 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); |
320 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); | 320 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); |
321 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); | 321 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); |
322 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); | 322 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); |
323 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); | 323 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); |
324 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); | 324 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); |
325 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); | 325 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); |
326 | 326 | ||
327 | 327 | ||
328 | // кабинет - редактор должности на главной | 328 | // кабинет - редактор должности на главной |
329 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); | 329 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); |
330 | 330 | ||
331 | // кабинет - счетчики на главной | 331 | // кабинет - счетчики на главной |
332 | Route::get('counters-main', [CompanyController::class, 'counters_main'])->name('counters-main'); | 332 | Route::get('counters-main', [CompanyController::class, 'counters_main'])->name('counters-main'); |
333 | Route::post('counters-main/edit/{name}', [CompanyController::class, 'counters_main_update'])->name('counters-main-update'); | 333 | Route::post('counters-main/edit/{name}', [CompanyController::class, 'counters_main_update'])->name('counters-main-update'); |
334 | 334 | ||
335 | // кабинет - редактор работодатели на главной | 335 | // кабинет - редактор работодатели на главной |
336 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); | 336 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); |
337 | 337 | ||
338 | 338 | ||
339 | // кабинет - редактор seo-сайта | 339 | // кабинет - редактор seo-сайта |
340 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); | 340 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); |
341 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); | 341 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); |
342 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); | 342 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); |
343 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); | 343 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); |
344 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); | 344 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); |
345 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); | 345 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); |
346 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); | 346 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); |
347 | 347 | ||
348 | 348 | ||
349 | // кабинет - редактор страниц | 349 | // кабинет - редактор страниц |
350 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); | 350 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); |
351 | // кабинет - добавление страницы | 351 | // кабинет - добавление страницы |
352 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); | 352 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); |
353 | // кабинет - сохранение формы страницы | 353 | // кабинет - сохранение формы страницы |
354 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); | 354 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); |
355 | // кабинет - редактирование форма страницы | 355 | // кабинет - редактирование форма страницы |
356 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); | 356 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); |
357 | // кабинет - сохранение редактированной формы страницы | 357 | // кабинет - сохранение редактированной формы страницы |
358 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); | 358 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); |
359 | // кабинет - удаление страницы | 359 | // кабинет - удаление страницы |
360 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); | 360 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); |
361 | 361 | ||
362 | 362 | ||
363 | // кабинет - реклама сайта | 363 | // кабинет - реклама сайта |
364 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); | 364 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); |
365 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); | 365 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); |
366 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); | 366 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); |
367 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); | 367 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); |
368 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); | 368 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); |
369 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); | 369 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); |
370 | //////////////////////////////////////////////////////////////////////// | 370 | //////////////////////////////////////////////////////////////////////// |
371 | 371 | ||
372 | 372 | ||
373 | // кабинет - отзывы о работодателе для модерации | 373 | // кабинет - отзывы о работодателе для модерации |
374 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); | 374 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); |
375 | 375 | ||
376 | // Общая страница статистики | 376 | // Общая страница статистики |
377 | Route::get('statics', function () { | 377 | Route::get('statics', function () { |
378 | return view('admin.static.index'); | 378 | return view('admin.static.index'); |
379 | })->name('statics'); | 379 | })->name('statics'); |
380 | 380 | ||
381 | // кабинет - статистика работников | 381 | // кабинет - статистика работников |
382 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); | 382 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); |
383 | 383 | ||
384 | // кабинет - статистика вакансий работодателя | 384 | // кабинет - статистика вакансий работодателя |
385 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); | 385 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); |
386 | 386 | ||
387 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника | 387 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника |
388 | /* | 388 | /* |
389 | * CRUD-операции над справочником дипломы и документы | 389 | * CRUD-операции над справочником дипломы и документы |
390 | */ | 390 | */ |
391 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); | 391 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); |
392 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); | 392 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); |
393 | 393 | ||
394 | // кабинет - роли пользователя | 394 | // кабинет - роли пользователя |
395 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); | 395 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); |
396 | 396 | ||
397 | Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles'); | 397 | Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles'); |
398 | 398 | ||
399 | Route::get('logs', function() { | 399 | Route::get('logs', function() { |
400 | $files = Storage::files('logs/laravel.log'); | 400 | $files = Storage::files('logs/laravel.log'); |
401 | })->name('logs'); | 401 | })->name('logs'); |
402 | }); | 402 | }); |
403 | 403 | ||
404 | // Инструментальные страницы | 404 | // Инструментальные страницы |
405 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); | 405 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); |
406 | 406 | ||
407 | Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); | 407 | Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); |
408 | 408 | ||
409 | Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); | 409 | Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); |
410 | 410 | ||
411 | // Страницы с произвольным контентом | 411 | // Страницы с произвольным контентом |
412 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); | 412 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); |
413 | 413 | ||
414 | // Форма обратной связи | 414 | // Форма обратной связи |
415 | Route::post('form_feedback', [PagesController::class, 'form_feedback'])->name('form_feedback'); | 415 | Route::post('form_feedback', [PagesController::class, 'form_feedback'])->name('form_feedback'); |
416 | 416 | ||
417 | // Публичные страницы соискателя | 417 | // Публичные страницы соискателя |
418 | Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); | 418 | Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); |
419 | 419 | ||
420 | //Страница вакансии | 420 | //Страница вакансии |
421 | Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); | 421 | Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); |
422 | 422 | ||
423 | //Вакансии | 423 | //Вакансии |
424 | Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies'); | 424 | Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies'); |
425 | 425 | ||
426 | //Вакансии поиск на главной | 426 | //Вакансии поиск на главной |
427 | Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies'); | 427 | Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies'); |
428 | 428 | ||
429 | //Вакансии категория детальная | 429 | //Вакансии категория детальная |
430 | Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies'); | 430 | Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies'); |
431 | 431 | ||
432 | // Лайк вакансии | 432 | // Лайк вакансии |
433 | Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy'); | 433 | Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy'); |
434 | 434 | ||
435 | //Детальная страница вакансии - работодателя | 435 | //Детальная страница вакансии - работодателя |
436 | Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie'); | 436 | Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie'); |
437 | 437 | ||
438 | //Судоходные компании | 438 | //Судоходные компании |
439 | Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies'); | 439 | Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies'); |
440 | 440 | ||
441 | //Детальная инфа о компании | 441 | //Детальная инфа о компании |
442 | Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company'); | 442 | Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company'); |
443 | 443 | ||
444 | //Образование | 444 | //Образование |
445 | Route::get('education', [EducationFrontController::class, 'index'])->name('education'); | 445 | Route::get('education', [EducationFrontController::class, 'index'])->name('education'); |
446 | Route::get('education/{education}', [EducationFrontController::class, 'show'])->name('show_education')->where('education', '[0-9]+');; | 446 | Route::get('education/{education}', [EducationFrontController::class, 'show'])->name('show_education')->where('education', '[0-9]+');; |
447 | 447 | ||
448 | //Новости | 448 | //Новости |
449 | Route::get('news', [MainController::class, 'news'])->name('news'); | 449 | Route::get('news', [MainController::class, 'news'])->name('news'); |
450 | Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new'); | 450 | Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new'); |
451 | 451 | ||
452 | //Контакты | 452 | //Контакты |
453 | Route::get('contacts', [MainController::class, 'contacts'])->name('contacts'); | 453 | Route::get('contacts', [MainController::class, 'contacts'])->name('contacts'); |
454 | 454 | ||
455 | //База резюме | 455 | //База резюме |
456 | Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume'); | 456 | Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume'); |
457 | Route::get('bd_resume_danger', function(){ | 457 | Route::get('bd_resume_danger', function(){ |
458 | return view('employers.bd_resume_danger'); | 458 | return view('employers.bd_resume_danger'); |
459 | })->name('bd_resume_danger'); | 459 | })->name('bd_resume_danger'); |
460 | 460 | ||
461 | Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume'); | 461 | Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume'); |
462 | 462 | ||
463 | //Анкета соискателя | 463 | //Анкета соискателя |
464 | Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile'); | 464 | Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile'); |
465 | 465 | ||
466 | //Скачать резюме | 466 | //Скачать резюме |
467 | Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download'); | 467 | Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download'); |
468 | Route::get('resume-download/all', [WorkerController::class, 'resume_download_all'])->name('resume_download_all2'); | 468 | Route::get('resume-download/all', [WorkerController::class, 'resume_download_all'])->name('resume_download_all2'); |
469 | Route::get('resume-download', [WorkerController::class, 'resume_download_all'])->name('resume_download_all'); | 469 | Route::get('resume-download', [WorkerController::class, 'resume_download_all'])->name('resume_download_all'); |
470 | 470 | ||
471 | 471 | ||
472 | //Вход в кабинет | 472 | //Вход в кабинет |
473 | Route::get('login', [MainController::class, 'input_login'])->name('login'); | 473 | Route::get('login', [MainController::class, 'input_login'])->name('login'); |
474 | 474 | ||
475 | // Выход из кабинета | 475 | // Выход из кабинета |
476 | Route::get('logout', [EmployerController::class, 'logout'])->name('logout'); | 476 | Route::get('logout', [EmployerController::class, 'logout'])->name('logout'); |
477 | 477 | ||
478 | Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker'); | 478 | Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker'); |
479 | Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer'); | 479 | Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer'); |
480 | 480 | ||
481 | //восстановление пароля | 481 | //восстановление пароля |
482 | Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password'); | 482 | Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password'); |
483 | // Звезда сообщения | 483 | // Звезда сообщения |
484 | Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer'); | 484 | Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer'); |
485 | 485 | ||
486 | // Борьба | 486 | // Борьба |
487 | Route::get('clear_cookie', function() { | 487 | Route::get('clear_cookie', function() { |
488 | \App\Classes\Cookies_vacancy::clear_vacancy(); | 488 | \App\Classes\Cookies_vacancy::clear_vacancy(); |
489 | return redirect()->route('index'); | 489 | return redirect()->route('index'); |
490 | })->name('clear_cookie'); | 490 | })->name('clear_cookie'); |
491 | 491 | ||
492 | Route::get('cookies', function() { | 492 | Route::get('cookies', function() { |
493 | return view('cookies'); | 493 | return view('cookies'); |
494 | })->name('cookies'); | 494 | })->name('cookies'); |
495 | 495 | ||
496 | // Личный кабинет работник | 496 | // Личный кабинет работник |
497 | Route::group([ | 497 | Route::group([ |
498 | 'as' => 'worker.', // имя маршрута, например auth.index | 498 | 'as' => 'worker.', // имя маршрута, например auth.index |
499 | 'prefix' => 'worker', // префикс маршрута, например auth/index | 499 | 'prefix' => 'worker', // префикс маршрута, например auth/index |
500 | 'middleware' => ['auth'], ['is_worker'], | 500 | 'middleware' => ['auth'], ['is_worker'], |
501 | ], function() { | 501 | ], function() { |
502 | // Формы редактирования | 502 | // Формы редактирования |
503 | Route::get('cabinet/basic_information', [WorkerController::class, 'basic_information'])->name('basic_information'); | 503 | Route::get('cabinet/basic_information', [WorkerController::class, 'basic_information'])->name('basic_information'); |
504 | Route::get('cabinet/additional_documents', [WorkerController::class, 'additional_documents'])->name('additional_documents'); | 504 | Route::get('cabinet/additional_documents', [WorkerController::class, 'additional_documents'])->name('additional_documents'); |
505 | 505 | ||
506 | // 1 страница - Моя анкета | 506 | // 1 страница - Моя анкета |
507 | Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); | 507 | Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); |
508 | Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); | 508 | Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); |
509 | Route::post('cabinet/cabinet_save_foto/{worker}', [WorkerController::class, 'cabinet_save_foto'])->name('cabinet_save_foto'); | ||
510 | |||
509 | 511 | ||
510 | // 2 страница - Сообщения | 512 | // 2 страница - Сообщения |
511 | Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); | 513 | Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); |
512 | Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog'); | 514 | Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog'); |
513 | // 3 страница - Избранные вакансии | 515 | // 3 страница - Избранные вакансии |
514 | Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); | 516 | Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); |
515 | // Продолжение борьбы против колорадов - избранные вакансии | 517 | // Продолжение борьбы против колорадов - избранные вакансии |
516 | Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); | 518 | Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); |
517 | 519 | ||
518 | // 4 страница - Сменить пароль | 520 | // 4 страница - Сменить пароль |
519 | Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); | 521 | Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); |
520 | Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password'); | 522 | Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password'); |
521 | 523 | ||
522 | // 5 страница - Удалить профиль | 524 | // 5 страница - Удалить профиль |
523 | Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); | 525 | Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); |
524 | Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); | 526 | Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); |
525 | 527 | ||
526 | // Резюме -pdf | 528 | // Резюме -pdf |
527 | Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); | 529 | Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); |
528 | 530 | ||
529 | // Поднятие анкеты | 531 | // Поднятие анкеты |
530 | Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); | 532 | Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); |
531 | 533 | ||
532 | Route::post('test123', [WorkerController::class, 'test123'])->name('test123'); | 534 | Route::post('test123', [WorkerController::class, 'test123'])->name('test123'); |
533 | 535 | ||
534 | // Добавление сертификата | 536 | // Добавление сертификата |
535 | Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate'); | 537 | Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate'); |
536 | Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); | 538 | Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); |
537 | Route::get('кабинет/edit_sertificate/{worker}/{doc}', [WorkerController::class, 'edit_sertificate'])->name('edit_sertificate'); | 539 | Route::get('кабинет/edit_sertificate/{worker}/{doc}', [WorkerController::class, 'edit_sertificate'])->name('edit_sertificate'); |
538 | Route::get('кабинет/edit_sertificate/{doc}', [WorkerController::class, 'update_serificate'])->name('update_serificate'); | 540 | Route::get('кабинет/edit_sertificate/{doc}', [WorkerController::class, 'update_serificate'])->name('update_serificate'); |
539 | Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); | 541 | Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); |
540 | 542 | ||
541 | // Добавление предыдущих контактов компании | 543 | // Добавление предыдущих контактов компании |
542 | Route::get('кабинет/prev_company/{worker}', [WorkerController::class, 'new_prev_company'])->name('new_prev_company'); | 544 | Route::get('кабинет/prev_company/{worker}', [WorkerController::class, 'new_prev_company'])->name('new_prev_company'); |
543 | Route::get('кабинет/add_prev_company', [WorkerController::class, 'add_prev_company'])->name('add_prev_company'); | 545 | Route::get('кабинет/add_prev_company', [WorkerController::class, 'add_prev_company'])->name('add_prev_company'); |
544 | Route::get('кабинет/edit_prev_company/{doc}/{worker}', [WorkerController::class, 'edit_prev_company'])->name('edit_prev_company'); | 546 | Route::get('кабинет/edit_prev_company/{doc}/{worker}', [WorkerController::class, 'edit_prev_company'])->name('edit_prev_company'); |
545 | Route::post('кабинет/update_prev_company/{doc}', [WorkerController::class, 'update_prev_company'])->name('update_prev_company'); | 547 | Route::post('кабинет/update_prev_company/{doc}', [WorkerController::class, 'update_prev_company'])->name('update_prev_company'); |
546 | Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company'); | 548 | Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company'); |
547 | 549 | ||
548 | // Добавление документа-диплома | 550 | // Добавление документа-диплома |
549 | Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); | 551 | Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); |
550 | Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); | 552 | Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); |
551 | Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom'); | 553 | Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom'); |
552 | 554 | ||
553 | // Добавление стандартного диплома | 555 | // Добавление стандартного диплома |
554 | Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); | 556 | Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); |
555 | Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); | 557 | Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); |
556 | Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); | 558 | Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); |
557 | Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); | 559 | Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); |
558 | Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); | 560 | Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); |
559 | 561 | ||
560 | // Отправка сообщения работодателю от соискателя | 562 | // Отправка сообщения работодателю от соискателя |
561 | Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message'); | 563 | Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message'); |
562 | }); | 564 | }); |
563 | 565 | ||
564 | // Личный кабинет работодателя | 566 | // Личный кабинет работодателя |
565 | Route::group([ | 567 | Route::group([ |
566 | 'as' => 'employer.', // имя маршрута, например auth.index | 568 | 'as' => 'employer.', // имя маршрута, например auth.index |
567 | 'prefix' => 'employer', // префикс маршрута, например auth/index | 569 | 'prefix' => 'employer', // префикс маршрута, например auth/index |
568 | 'middleware' => ['auth'], !['is_worker'], | 570 | 'middleware' => ['auth'], !['is_worker'], |
569 | ], function() { | 571 | ], function() { |
570 | // 0 страница - Личные данные работодателя | 572 | // 0 страница - Личные данные работодателя |
571 | Route::get('cabinet/employer_info', [EmployerController::class, 'employer_info'])->name('employer_info'); | 573 | Route::get('cabinet/employer_info', [EmployerController::class, 'employer_info'])->name('employer_info'); |
572 | Route::post('cabinet/employer_info/{user}', [EmployerController::class, 'employer_info_save'])->name('employer_info_save'); | 574 | Route::post('cabinet/employer_info/{user}', [EmployerController::class, 'employer_info_save'])->name('employer_info_save'); |
573 | 575 | ||
574 | // 1 страница - Профиль | 576 | // 1 страница - Профиль |
575 | Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); | 577 | Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); |
576 | Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); | 578 | Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); |
577 | Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); | 579 | Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); |
578 | Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); | 580 | Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); |
579 | Route::get('cabinet/flot_edit/{Flot}/{Employer}', [EmployerController::class, 'edit_flot'])->name('edit_flot'); | 581 | Route::get('cabinet/flot_edit/{Flot}/{Employer}', [EmployerController::class, 'edit_flot'])->name('edit_flot'); |
580 | Route::post('cabinet/flot_edit/{Flot}', [EmployerController::class, 'update_flot'])->name('update_flot_save'); | 582 | Route::post('cabinet/flot_edit/{Flot}', [EmployerController::class, 'update_flot'])->name('update_flot_save'); |
581 | Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot'); | 583 | Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot'); |
582 | 584 | ||
583 | // 2 страница - Добавление вакансий | 585 | // 2 страница - Добавление вакансий |
584 | Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); | 586 | Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); |
585 | Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); | 587 | Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); |
586 | Route::get('cabinet/vacancie_danger', [EmployerController::class, 'cabinet_vacancie_danger'])->name('cabinet_vacancie_danger'); | 588 | Route::get('cabinet/vacancie_danger', [EmployerController::class, 'cabinet_vacancie_danger'])->name('cabinet_vacancie_danger'); |
587 | 589 | ||
588 | 590 | ||
589 | Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); | 591 | Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); |
590 | 592 | ||
591 | // 3 страница - Мои вакансии | 593 | // 3 страница - Мои вакансии |
592 | Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); | 594 | Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); |
593 | Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); | 595 | Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); |
594 | Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); | 596 | Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); |
595 | Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); | 597 | Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); |
596 | Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); | 598 | Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); |
597 | Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); | 599 | Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); |
598 | Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); | 600 | Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); |
599 | 601 | ||
600 | // 4.1Ю. | 602 | // 4.1Ю. |
601 | Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac'); | 603 | Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac'); |
602 | Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save'); | 604 | Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save'); |
603 | Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac'); | 605 | Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac'); |
604 | Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save'); | 606 | Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save'); |
605 | Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac'); | 607 | Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac'); |
606 | 608 | ||
607 | // 4 страница - Отклики на вакансии | 609 | // 4 страница - Отклики на вакансии |
608 | Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); | 610 | Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); |
609 | Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); | 611 | Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); |
610 | Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); | 612 | Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); |
611 | 613 | ||
612 | // 5 страница - Сообщения | 614 | // 5 страница - Сообщения |
613 | Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); | 615 | Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); |
614 | Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); | 616 | Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); |
615 | Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); | 617 | Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); |
616 | Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); | 618 | Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); |
617 | 619 | ||
618 | // 6 страница - Избранный | 620 | // 6 страница - Избранный |
619 | Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); | 621 | Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); |
620 | 622 | ||
621 | //7 страница - База данных | 623 | //7 страница - База данных |
622 | Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); | 624 | Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); |
623 | 625 | ||
624 | //8 страница - База резюме | 626 | //8 страница - База резюме |
625 | Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); | 627 | Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); |
626 | 628 | ||
627 | // 9 рассылка сообщений | 629 | // 9 рассылка сообщений |
628 | Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); | 630 | Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); |
629 | Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); | 631 | Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); |
630 | 632 | ||
631 | // 10 страница FAQ вопросы | 633 | // 10 страница FAQ вопросы |
632 | Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq'); | 634 | Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq'); |
633 | 635 | ||
634 | // 11 страница - Настройка уведомлений | 636 | // 11 страница - Настройка уведомлений |
635 | Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); | 637 | Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); |
636 | Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); | 638 | Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); |
637 | 639 | ||
638 | // 12 страница - Сменить пароль | 640 | // 12 страница - Сменить пароль |
639 | Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); | 641 | Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); |
640 | Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); | 642 | Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); |
641 | 643 | ||
642 | // 13 страница - Удаление профиля | 644 | // 13 страница - Удаление профиля |
643 | Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); | 645 | Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); |
644 | Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); | 646 | Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); |
645 | Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); | 647 | Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); |
646 | 648 | ||
647 | // Отправил сообщение | 649 | // Отправил сообщение |
648 | Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); | 650 | Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); |
649 | }); | 651 | }); |
650 | 652 | ||
651 | Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker'); | 653 | Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker'); |
652 | 654 | ||
653 | 655 |