Commit 0fc30621f713a8ce77202ac3bf923cf23f04d110
1 parent
73b12960f4
Exists in
master
and in
1 other branch
коммит от пятницы 26 числа
Showing 10 changed files with 325 additions and 111 deletions Inline Diff
- app/Http/Controllers/CompanyController.php
- app/Http/Controllers/EmployerController.php
- app/Http/Controllers/WorkerController.php
- resources/views/ajax/resume_1.blade.php
- resources/views/employers/add_vacancy_danger.blade.php
- resources/views/employers/bd_resume_danger.blade.php
- resources/views/employers/menu.blade.php
- resources/views/index.blade.php
- resources/views/resume.blade.php
- routes/web.php
app/Http/Controllers/CompanyController.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Http\Controllers; | 3 | namespace App\Http\Controllers; |
4 | 4 | ||
5 | use App\Models\Employer; | 5 | use App\Models\Employer; |
6 | use Illuminate\Http\Request; | 6 | use Illuminate\Http\Request; |
7 | 7 | ||
8 | class CompanyController extends Controller | 8 | class CompanyController extends Controller |
9 | { | 9 | { |
10 | public function shipping_companies(Request $request) { | 10 | public function shipping_companies(Request $request) { |
11 | $emps = Employer::query()->with('ads'); | 11 | $emps = Employer::query()->with('ads')->where('status_hidden', '=', '0'); |
12 | if (($request->has('search')) && (!empty($request->get('search')))) { | 12 | if (($request->has('search')) && (!empty($request->get('search')))) { |
13 | $search = $request->get('search'); | 13 | $search = $request->get('search'); |
14 | $emps = $emps->where('name_company', 'LIKE', "%$search%"); | 14 | $emps = $emps->where('name_company', 'LIKE', "%$search%"); |
15 | } | 15 | } |
16 | 16 | ||
17 | $count_emps = $emps->count(); | 17 | $count_emps = $emps->count(); |
18 | 18 | ||
19 | if ($request->get('sort')) { | 19 | if ($request->get('sort')) { |
20 | $sort = $request->get('sort'); | 20 | $sort = $request->get('sort'); |
21 | switch ($sort) { | 21 | switch ($sort) { |
22 | case 'name_up': $emps = $emps->orderBy('name_company')->orderBy('id'); break; | 22 | case 'name_up': $emps = $emps->orderBy('name_company')->orderBy('id'); break; |
23 | case 'name_down': $emps = $emps->orderByDesc('name_company')->orderby('id'); break; | 23 | case 'name_down': $emps = $emps->orderByDesc('name_company')->orderby('id'); break; |
24 | case 'created_at_up': $emps = $emps->OrderBy('created_at')->orderBy('id'); break; | 24 | case 'created_at_up': $emps = $emps->OrderBy('created_at')->orderBy('id'); break; |
25 | case 'created_at_down': $emps = $emps->orderByDesc('created_at')->orderBy('id'); break; | 25 | case 'created_at_down': $emps = $emps->orderByDesc('created_at')->orderBy('id'); break; |
26 | case 'default': $emps = $emps->orderBy('id')->orderby('updated_at'); break; | 26 | case 'default': $emps = $emps->orderBy('id')->orderby('updated_at'); break; |
27 | default: $emps = $emps->orderBy('id')->orderby('updated_at'); break; | 27 | default: $emps = $emps->orderBy('id')->orderby('updated_at'); break; |
28 | } | 28 | } |
29 | } | 29 | } |
30 | 30 | ||
31 | $emps = $emps->paginate(4); | 31 | $emps = $emps->paginate(4); |
32 | 32 | ||
33 | 33 | ||
34 | if ($request->ajax()) { | 34 | if ($request->ajax()) { |
35 | if ($request->get('block') == '1') | 35 | if ($request->get('block') == '1') |
36 | return view('ajax.companies', compact('emps', 'count_emps')); | 36 | return view('ajax.companies', compact('emps', 'count_emps')); |
37 | else | 37 | else |
38 | return view('ajax.companies2', compact('emps', 'count_emps')); | 38 | return view('ajax.companies2', compact('emps', 'count_emps')); |
39 | } else { | 39 | } else { |
40 | return view('companies', compact('emps', 'count_emps')); | 40 | return view('companies', compact('emps', 'count_emps')); |
41 | } | 41 | } |
42 | } | 42 | } |
43 | 43 | ||
44 | public function info_company(Employer $company) { | 44 | public function info_company(Employer $company) { |
45 | if (isset(Auth()->user()->id)) { | 45 | if (isset(Auth()->user()->id)) { |
46 | $user_id = Auth()->user()->id; | 46 | $user_id = Auth()->user()->id; |
47 | } else { | 47 | } else { |
48 | $user_id = 0; | 48 | $user_id = 0; |
49 | } | 49 | } |
50 | $company = Employer::with('ads')->with('flots')->with('users') | 50 | $company = Employer::with('ads')->with('flots')->with('users') |
51 | ->where('id', '=', $company->id)->get(); | 51 | ->where('id', '=', $company->id)->get(); |
52 | 52 | ||
53 | $title = $company[0]->name_company; | 53 | $title = $company[0]->name_company; |
54 | 54 | ||
55 | return view('info_company_new', compact('company', 'user_id', 'title')); | 55 | return view('info_company_new', compact('company', 'user_id', 'title')); |
56 | } | 56 | } |
57 | } | 57 | } |
58 | 58 |
app/Http/Controllers/EmployerController.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Http\Controllers; | 3 | namespace App\Http\Controllers; |
4 | 4 | ||
5 | use App\Classes\RusDate; | 5 | use App\Classes\RusDate; |
6 | use App\Classes\Tools; | 6 | use App\Classes\Tools; |
7 | use App\Http\Requests\BaseUser_min_Request; | 7 | use App\Http\Requests\BaseUser_min_Request; |
8 | use App\Http\Requests\BaseUserRequest; | 8 | use App\Http\Requests\BaseUserRequest; |
9 | use App\Http\Requests\FlotRequest; | 9 | use App\Http\Requests\FlotRequest; |
10 | use App\Http\Requests\MessagesRequiest; | 10 | use App\Http\Requests\MessagesRequiest; |
11 | use App\Http\Requests\VacancyRequestEdit; | 11 | use App\Http\Requests\VacancyRequestEdit; |
12 | use App\Http\Requests\VacansiaRequiest; | 12 | use App\Http\Requests\VacansiaRequiest; |
13 | use App\Mail\MailSotrudnichestvo; | 13 | use App\Mail\MailSotrudnichestvo; |
14 | use App\Mail\SendAllMessages; | 14 | use App\Mail\SendAllMessages; |
15 | use App\Models\Ad_employer; | 15 | use App\Models\Ad_employer; |
16 | use App\Models\Ad_jobs; | 16 | use App\Models\Ad_jobs; |
17 | use App\Models\ad_response; | 17 | use App\Models\ad_response; |
18 | use App\Models\Category; | 18 | use App\Models\Category; |
19 | use App\Models\Education; | 19 | use App\Models\Education; |
20 | use App\Models\Employer; | 20 | use App\Models\Employer; |
21 | use App\Models\employers_main; | 21 | use App\Models\employers_main; |
22 | use App\Models\Flot; | 22 | use App\Models\Flot; |
23 | use App\Models\Job_title; | 23 | use App\Models\Job_title; |
24 | use App\Models\Like_vacancy; | 24 | use App\Models\Like_vacancy; |
25 | use App\Models\Like_worker; | 25 | use App\Models\Like_worker; |
26 | use App\Models\Message; | 26 | use App\Models\Message; |
27 | use App\Models\Positions; | 27 | use App\Models\Positions; |
28 | use App\Models\Worker; | 28 | use App\Models\Worker; |
29 | use Carbon\Carbon; | 29 | use Carbon\Carbon; |
30 | use Illuminate\Auth\Events\Registered; | 30 | use Illuminate\Auth\Events\Registered; |
31 | use Illuminate\Database\Eloquent\Builder; | 31 | use Illuminate\Database\Eloquent\Builder; |
32 | use Illuminate\Database\Eloquent\Model; | 32 | use Illuminate\Database\Eloquent\Model; |
33 | use Illuminate\Foundation\Auth\User; | 33 | use Illuminate\Foundation\Auth\User; |
34 | use Illuminate\Http\Request; | 34 | use Illuminate\Http\Request; |
35 | use Illuminate\Support\Facades\Auth; | 35 | use Illuminate\Support\Facades\Auth; |
36 | use Illuminate\Support\Facades\Hash; | 36 | use Illuminate\Support\Facades\Hash; |
37 | use Illuminate\Support\Facades\Mail; | 37 | use Illuminate\Support\Facades\Mail; |
38 | use Illuminate\Support\Facades\Storage; | 38 | use Illuminate\Support\Facades\Storage; |
39 | use App\Models\User as User_Model; | 39 | use App\Models\User as User_Model; |
40 | use Illuminate\Support\Facades\Validator; | 40 | use Illuminate\Support\Facades\Validator; |
41 | 41 | ||
42 | class EmployerController extends Controller | 42 | class EmployerController extends Controller |
43 | { | 43 | { |
44 | public function vacancie($vacancy, Request $request) { | 44 | public function vacancie($vacancy, Request $request) { |
45 | $title = 'Заголовок вакансии'; | 45 | $title = 'Заголовок вакансии'; |
46 | $Query = Ad_employer::with('jobs')-> | 46 | $Query = Ad_employer::with('jobs')-> |
47 | with('cat')-> | 47 | with('cat')-> |
48 | with('employer')-> | 48 | with('employer')-> |
49 | with('jobs_code')-> | 49 | with('jobs_code')-> |
50 | select('ad_employers.*')-> | 50 | select('ad_employers.*')-> |
51 | where('id', '=', $vacancy)->get(); | 51 | where('id', '=', $vacancy)->get(); |
52 | 52 | ||
53 | if (isset(Auth()->user()->id)) | 53 | if (isset(Auth()->user()->id)) |
54 | $uid = Auth()->user()->id; | 54 | $uid = Auth()->user()->id; |
55 | else | 55 | else |
56 | $uid = 0; | 56 | $uid = 0; |
57 | $title = $Query[0]->name; | 57 | $title = $Query[0]->name; |
58 | if ($request->ajax()) { | 58 | if ($request->ajax()) { |
59 | return view('ajax.vacance-item', compact('Query','uid')); | 59 | return view('ajax.vacance-item', compact('Query','uid')); |
60 | } else { | 60 | } else { |
61 | return view('vacance-item', compact('title', 'Query', 'uid')); | 61 | return view('vacance-item', compact('title', 'Query', 'uid')); |
62 | } | 62 | } |
63 | } | 63 | } |
64 | 64 | ||
65 | public function logout() { | 65 | public function logout() { |
66 | Auth::logout(); | 66 | Auth::logout(); |
67 | return redirect()->route('index') | 67 | return redirect()->route('index') |
68 | ->with('success', 'Вы вышли из личного кабинета'); | 68 | ->with('success', 'Вы вышли из личного кабинета'); |
69 | } | 69 | } |
70 | 70 | ||
71 | public function employer_info() { | 71 | public function employer_info() { |
72 | // код юзера | 72 | // код юзера |
73 | $user_info = Auth()->user(); | 73 | $user_info = Auth()->user(); |
74 | // вьюшка для вывода данных | 74 | // вьюшка для вывода данных |
75 | return view('employers.info', compact('user_info')); | 75 | return view('employers.info', compact('user_info')); |
76 | } | 76 | } |
77 | 77 | ||
78 | public function employer_info_save(User_Model $user, BaseUser_min_Request $request) { | 78 | public function employer_info_save(User_Model $user, BaseUser_min_Request $request) { |
79 | // Все данные через реквест | 79 | // Все данные через реквест |
80 | $all = $request->all(); | 80 | $all = $request->all(); |
81 | unset($all['_token']); | 81 | unset($all['_token']); |
82 | // обновление | 82 | // обновление |
83 | $user->update($all); | 83 | $user->update($all); |
84 | return redirect()->route('employer.employer_info'); | 84 | return redirect()->route('employer.employer_info'); |
85 | } | 85 | } |
86 | 86 | ||
87 | public function cabinet() { | 87 | public function cabinet() { |
88 | $id = Auth()->user()->id; | 88 | $id = Auth()->user()->id; |
89 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | 89 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
90 | WhereHas('users', | 90 | WhereHas('users', |
91 | function (Builder $query) use ($id) {$query->Where('id', $id); | 91 | function (Builder $query) use ($id) {$query->Where('id', $id); |
92 | })->get(); | 92 | })->get(); |
93 | return view('employers.cabinet45', compact('Employer')); | 93 | return view('employers.cabinet45', compact('Employer')); |
94 | } | 94 | } |
95 | 95 | ||
96 | public function slider_flot() { | 96 | public function slider_flot() { |
97 | $id = Auth()->user()->id; | 97 | $id = Auth()->user()->id; |
98 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | 98 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
99 | WhereHas('users', | 99 | WhereHas('users', |
100 | function (Builder $query) use ($id) {$query->Where('id', $id); | 100 | function (Builder $query) use ($id) {$query->Where('id', $id); |
101 | })->get(); | 101 | })->get(); |
102 | return view('employers.fly-flot', compact('Employer')); | 102 | return view('employers.fly-flot', compact('Employer')); |
103 | } | 103 | } |
104 | 104 | ||
105 | public function cabinet_save(Employer $Employer, Request $request) { | 105 | public function cabinet_save(Employer $Employer, Request $request) { |
106 | $params = $request->all(); | 106 | $params = $request->all(); |
107 | $params['user_id'] = Auth()->user()->id; | 107 | $params['user_id'] = Auth()->user()->id; |
108 | $id = $Employer->id; | 108 | $id = $Employer->id; |
109 | 109 | ||
110 | if ($request->has('logo')) { | 110 | if ($request->has('logo')) { |
111 | if (!empty($Employer->logo)) { | 111 | if (!empty($Employer->logo)) { |
112 | Storage::delete($Employer->logo); | 112 | Storage::delete($Employer->logo); |
113 | } | 113 | } |
114 | $params['logo'] = $request->file('logo')->store("employer/$id", 'public'); | 114 | $params['logo'] = $request->file('logo')->store("employer/$id", 'public'); |
115 | } | 115 | } |
116 | 116 | ||
117 | $Employer->update($params); | 117 | $Employer->update($params); |
118 | 118 | ||
119 | return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены'); | 119 | return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены'); |
120 | } | 120 | } |
121 | 121 | ||
122 | public function save_add_flot(FlotRequest $request) { | 122 | public function save_add_flot(FlotRequest $request) { |
123 | // отмена | 123 | // отмена |
124 | $params = $request->all(); | 124 | $params = $request->all(); |
125 | 125 | ||
126 | if ($request->has('image')) { | 126 | if ($request->has('image')) { |
127 | $params['image'] = $request->file('image')->store("flot", 'public'); | 127 | $params['image'] = $request->file('image')->store("flot", 'public'); |
128 | } | 128 | } |
129 | Flot::create($params); | 129 | Flot::create($params); |
130 | $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get(); | 130 | $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get(); |
131 | return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); | 131 | return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); |
132 | } | 132 | } |
133 | 133 | ||
134 | public function edit_flot(Flot $Flot, Employer $Employer) { | 134 | public function edit_flot(Flot $Flot, Employer $Employer) { |
135 | return view('employers.edit-flot', compact('Flot', 'Employer')); | 135 | return view('employers.edit-flot', compact('Flot', 'Employer')); |
136 | } | 136 | } |
137 | 137 | ||
138 | public function update_flot(FlotRequest $request, Flot $Flot) { | 138 | public function update_flot(FlotRequest $request, Flot $Flot) { |
139 | $params = $request->all(); | 139 | $params = $request->all(); |
140 | 140 | ||
141 | if ($request->has('image')) { | 141 | if ($request->has('image')) { |
142 | if (!empty($flot->image)) { | 142 | if (!empty($flot->image)) { |
143 | Storage::delete($flot->image); | 143 | Storage::delete($flot->image); |
144 | } | 144 | } |
145 | $params['image'] = $request->file('image')->store("flot", 'public'); | 145 | $params['image'] = $request->file('image')->store("flot", 'public'); |
146 | } else { | 146 | } else { |
147 | if (!empty($flot->image)) $params['image'] = $flot->image; | 147 | if (!empty($flot->image)) $params['image'] = $flot->image; |
148 | } | 148 | } |
149 | 149 | ||
150 | $Flot->update($params); | 150 | $Flot->update($params); |
151 | return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); | 151 | return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); |
152 | } | 152 | } |
153 | 153 | ||
154 | public function delete_flot(Flot $Flot) { | 154 | public function delete_flot(Flot $Flot) { |
155 | $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get(); | 155 | $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get(); |
156 | 156 | ||
157 | if (isset($Flot->id)) $Flot->delete(); | 157 | if (isset($Flot->id)) $Flot->delete(); |
158 | return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален'); | 158 | return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален'); |
159 | } | 159 | } |
160 | 160 | ||
161 | // Форма добавления вакансий | 161 | // Форма добавления вакансий |
162 | public function cabinet_vacancie() { | 162 | public function cabinet_vacancie() { |
163 | $id = Auth()->user()->id; | 163 | $id = Auth()->user()->id; |
164 | 164 | ||
165 | $categories = Category::query()->active()->get(); | 165 | if (Auth()->user()->is_public) { |
166 | //if ($categories->count()) { | 166 | $categories = Category::query()->active()->get(); |
167 | // $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->Notbdif()->where('position_id', $categories[0]->id)->get(); | 167 | |
168 | //} else { | 168 | $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->where('is_bd', '=', '0')->get(); |
169 | // $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->Notbdif()->where('position_id', 0)->get(); | 169 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
170 | //} | 170 | |
171 | $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->where('is_bd', '=' , '0')->get(); | 171 | WhereHas('users', |
172 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | 172 | function (Builder $query) use ($id) { |
173 | WhereHas('users', | 173 | $query->Where('id', $id); |
174 | function (Builder $query) use ($id) {$query->Where('id', $id); | 174 | })->get(); |
175 | })->get(); | 175 | |
176 | return view('employers.add_vacancy', compact('Employer', 'jobs' , 'categories')); | 176 | return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories')); |
177 | } else { | ||
178 | return redirect()->route('employer.cabinet_vacancie_danger'); | ||
179 | } | ||
180 | } | ||
181 | |||
182 | // Форма предупреждения об оплате | ||
183 | public function cabinet_vacancie_danger() { | ||
184 | return view('employers.add_vacancy_danger'); | ||
177 | } | 185 | } |
178 | 186 | ||
179 | // Сохранение вакансии | 187 | // Сохранение вакансии |
180 | public function cabinet_vacancy_save1(VacancyRequestEdit $request) { | 188 | public function cabinet_vacancy_save1(VacancyRequestEdit $request) { |
181 | $params_emp = $request->all(); | 189 | $params_emp = $request->all(); |
182 | 190 | ||
183 | $params_job["job_title_id"] = $params_emp['job_title_id']; | 191 | $params_job["job_title_id"] = $params_emp['job_title_id']; |
184 | //$params_job["min_salary"] = $params_emp['min_salary']; | 192 | //$params_job["min_salary"] = $params_emp['min_salary']; |
185 | //$params_job["max_salary"] = $params_emp['max_salary']; | 193 | //$params_job["max_salary"] = $params_emp['max_salary']; |
186 | //$params_job["region"] = $params_emp['region']; | 194 | //$params_job["region"] = $params_emp['region']; |
187 | //$params_job["power"] = $params_emp['power']; | 195 | //$params_job["power"] = $params_emp['power']; |
188 | //$params_job["sytki"] = $params_emp['sytki']; | 196 | //$params_job["sytki"] = $params_emp['sytki']; |
189 | //$params_job["start"] = $params_emp['start']; | 197 | //$params_job["start"] = $params_emp['start']; |
190 | //$params_job["flot"] = $params_emp['flot']; | 198 | //$params_job["flot"] = $params_emp['flot']; |
191 | //$params_job["description"] = $params_emp['description']; | 199 | //$params_job["description"] = $params_emp['description']; |
192 | 200 | ||
193 | $ad_jobs = Ad_employer::create($params_emp); | 201 | $ad_jobs = Ad_employer::create($params_emp); |
194 | //$params_job['ad_employer_id'] = $ad_jobs->id; | 202 | //$params_job['ad_employer_id'] = $ad_jobs->id; |
195 | //Ad_jobs::create($params_job); | 203 | //Ad_jobs::create($params_job); |
196 | $ad_jobs->jobs()->sync($request->get('job_title_id')); | 204 | $ad_jobs->jobs()->sync($request->get('job_title_id')); |
197 | 205 | ||
198 | return redirect()->route('employer.vacancy_list'); | 206 | return redirect()->route('employer.vacancy_list'); |
199 | } | 207 | } |
200 | 208 | ||
201 | // Список вакансий | 209 | // Список вакансий |
202 | public function vacancy_list(Request $request) { | 210 | public function vacancy_list(Request $request) { |
203 | $id = Auth()->user()->id; | 211 | $id = Auth()->user()->id; |
204 | $Employer = Employer::query()->where('user_id', $id)->first(); | 212 | $Employer = Employer::query()->where('user_id', $id)->first(); |
205 | $vacancy_list = Ad_employer::query()->with('jobs')-> | 213 | $vacancy_list = Ad_employer::query()->with('jobs')-> |
206 | with('jobs_code')-> | 214 | with('jobs_code')-> |
207 | where('employer_id', $Employer->id); | 215 | where('employer_id', $Employer->id); |
208 | 216 | ||
209 | if ($request->get('sort')) { | 217 | if ($request->get('sort')) { |
210 | $sort = $request->get('sort'); | 218 | $sort = $request->get('sort'); |
211 | switch ($sort) { | 219 | switch ($sort) { |
212 | case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break; | 220 | case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break; |
213 | case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break; | 221 | case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break; |
214 | case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break; | 222 | case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break; |
215 | case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break; | 223 | case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break; |
216 | case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; | 224 | case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; |
217 | default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; | 225 | default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; |
218 | } | 226 | } |
219 | } | 227 | } |
220 | $vacancy_list = $vacancy_list->paginate(4); | 228 | $vacancy_list = $vacancy_list->paginate(4); |
221 | 229 | ||
222 | //ajax | 230 | //ajax |
223 | if ($request->ajax()) { | 231 | if ($request->ajax()) { |
224 | return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); | 232 | return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); |
225 | } else { | 233 | } else { |
226 | return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); | 234 | return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); |
227 | } | 235 | } |
228 | } | 236 | } |
229 | 237 | ||
230 | // Карточка вакансии | 238 | // Карточка вакансии |
231 | public function vacancy_edit(Ad_employer $ad_employer) { | 239 | public function vacancy_edit(Ad_employer $ad_employer) { |
232 | $id = Auth()->user()->id; | 240 | $id = Auth()->user()->id; |
233 | $Positions = Category::query()->where('is_remove', '=', '0')->get(); | 241 | $Positions = Category::query()->where('is_remove', '=', '0')->get(); |
234 | $jobs = Job_title::query()->OrderBy('name')-> | 242 | $jobs = Job_title::query()->OrderBy('name')-> |
235 | where('is_remove', 0)->where('is_bd', '=' , '0')->get(); | 243 | where('is_remove', 0)->where('is_bd', '=' , '0')->get(); |
236 | 244 | ||
237 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> | 245 | $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> |
238 | where('user_id', $id)->first(); | 246 | where('user_id', $id)->first(); |
239 | 247 | ||
240 | return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); | 248 | return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); |
241 | } | 249 | } |
242 | 250 | ||
243 | // Сохранение-редактирование записи | 251 | // Сохранение-редактирование записи |
244 | public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { | 252 | public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { |
245 | $params = $request->all(); | 253 | $params = $request->all(); |
246 | 254 | ||
247 | //$jobs['flot'] = $params['flot']; | 255 | //$jobs['flot'] = $params['flot']; |
248 | //$jobs['job_title_id'] = $params['job_title_id']; | 256 | //$jobs['job_title_id'] = $params['job_title_id']; |
249 | //$titles['position_id'] = $params['position_id']; | 257 | //$titles['position_id'] = $params['position_id']; |
250 | //unset($params['job_title_id']); | 258 | //unset($params['job_title_id']); |
251 | 259 | ||
252 | $ad_employer->update($params); | 260 | $ad_employer->update($params); |
253 | 261 | ||
254 | //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])-> | 262 | //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])-> |
255 | // where('ad_employer_id', $ad_employer->id)->first(); | 263 | // where('ad_employer_id', $ad_employer->id)->first(); |
256 | //$data = Ad_jobs::find($job_->id); | 264 | //$data = Ad_jobs::find($job_->id); |
257 | //$ad_jobs = $data->update($jobs); | 265 | //$ad_jobs = $data->update($jobs); |
258 | 266 | ||
259 | return redirect()->route('employer.vacancy_list'); | 267 | return redirect()->route('employer.vacancy_list'); |
260 | } | 268 | } |
261 | 269 | ||
262 | // Сохранение карточки вакансии | 270 | // Сохранение карточки вакансии |
263 | public function vacancy_save(Request $request, Ad_employer $ad_employer) { | 271 | public function vacancy_save(Request $request, Ad_employer $ad_employer) { |
264 | $all = $request->all(); | 272 | $all = $request->all(); |
265 | $ad_employer->update($all); | 273 | $ad_employer->update($all); |
266 | return redirect()->route('employer.cabinet_vacancie'); | 274 | return redirect()->route('employer.cabinet_vacancie'); |
267 | } | 275 | } |
268 | 276 | ||
269 | // Удаление карточки вакансии | 277 | // Удаление карточки вакансии |
270 | public function vacancy_delete(Ad_employer $ad_employer) { | 278 | public function vacancy_delete(Ad_employer $ad_employer) { |
271 | $ad_employer->delete(); | 279 | $ad_employer->delete(); |
272 | 280 | ||
273 | return redirect()->route('employer.vacancy_list') | 281 | return redirect()->route('employer.vacancy_list') |
274 | ->with('success', 'Данные были успешно сохранены'); | 282 | ->with('success', 'Данные были успешно сохранены'); |
275 | } | 283 | } |
276 | 284 | ||
277 | // Обновление даты | 285 | // Обновление даты |
278 | public function vacancy_up(Ad_employer $ad_employer) { | 286 | public function vacancy_up(Ad_employer $ad_employer) { |
279 | $up = date('m/d/Y h:i:s', time());; | 287 | $up = date('m/d/Y h:i:s', time());; |
280 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); | 288 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); |
281 | $vac_emp->updated_at = $up; | 289 | $vac_emp->updated_at = $up; |
282 | $vac_emp->save(); | 290 | $vac_emp->save(); |
283 | 291 | ||
284 | return redirect()->route('employer.vacancy_list'); | 292 | return redirect()->route('employer.vacancy_list'); |
285 | // начало конца | 293 | // начало конца |
286 | } | 294 | } |
287 | 295 | ||
288 | //Видимость вакансии | 296 | //Видимость вакансии |
289 | public function vacancy_eye(Ad_employer $ad_employer, $status) { | 297 | public function vacancy_eye(Ad_employer $ad_employer, $status) { |
290 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); | 298 | $vac_emp = Ad_employer::findOrFail($ad_employer->id); |
291 | $vac_emp->active_is = $status; | 299 | $vac_emp->active_is = $status; |
292 | $vac_emp->save(); | 300 | $vac_emp->save(); |
293 | 301 | ||
294 | return redirect()->route('employer.vacancy_list'); | 302 | return redirect()->route('employer.vacancy_list'); |
295 | } | 303 | } |
296 | 304 | ||
297 | //Вакансия редактирования (шаблон) | 305 | //Вакансия редактирования (шаблон) |
298 | public function vacancy_update(Ad_employer $id) { | 306 | public function vacancy_update(Ad_employer $id) { |
299 | 307 | ||
300 | } | 308 | } |
301 | 309 | ||
302 | //Отклики на вакансию - лист | 310 | //Отклики на вакансию - лист |
303 | public function answers(Employer $employer, Request $request) { | 311 | public function answers(Employer $employer, Request $request) { |
304 | $user_id = Auth()->user()->id; | 312 | $user_id = Auth()->user()->id; |
305 | $answer = Ad_employer::query()->where('employer_id', $employer->id); | 313 | $answer = Ad_employer::query()->where('employer_id', $employer->id); |
306 | if ($request->has('search')) { | 314 | if ($request->has('search')) { |
307 | $search = trim($request->get('search')); | 315 | $search = trim($request->get('search')); |
308 | if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); | 316 | if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); |
309 | } | 317 | } |
310 | 318 | ||
311 | $answer = $answer->with('response')->get(); | 319 | $answer = $answer->with('response')->get(); |
312 | 320 | ||
313 | return view('employers.list_answer', compact('answer', 'user_id', 'employer')); | 321 | return view('employers.list_answer', compact('answer', 'user_id', 'employer')); |
314 | } | 322 | } |
315 | 323 | ||
316 | //Обновление статуса | 324 | //Обновление статуса |
317 | public function supple_status(employer $employer, ad_response $ad_response, $flag) { | 325 | public function supple_status(employer $employer, ad_response $ad_response, $flag) { |
318 | $ad_response->update(Array('flag' => $flag)); | 326 | $ad_response->update(Array('flag' => $flag)); |
319 | return redirect()->route('employer.answers', ['employer' => $employer->id]); | 327 | return redirect()->route('employer.answers', ['employer' => $employer->id]); |
320 | } | 328 | } |
321 | 329 | ||
322 | //Страницы сообщений список | 330 | //Страницы сообщений список |
323 | public function messages($type_message) { | 331 | public function messages($type_message) { |
324 | $user_id = Auth()->user()->id; | 332 | $user_id = Auth()->user()->id; |
325 | 333 | ||
326 | $messages_input = Message::query()->with('vacancies')->with('user_from')-> | 334 | $messages_input = Message::query()->with('vacancies')->with('user_from')-> |
327 | Where('to_user_id', $user_id)->OrderByDesc('created_at'); | 335 | Where('to_user_id', $user_id)->OrderByDesc('created_at'); |
328 | 336 | ||
329 | $messages_output = Message::query()->with('vacancies')-> | 337 | $messages_output = Message::query()->with('vacancies')-> |
330 | with('user_to')->where('user_id', $user_id)-> | 338 | with('user_to')->where('user_id', $user_id)-> |
331 | OrderByDesc('created_at'); | 339 | OrderByDesc('created_at'); |
332 | 340 | ||
333 | 341 | ||
334 | $count_input = $messages_input->count(); | 342 | $count_input = $messages_input->count(); |
335 | $count_output = $messages_output->count(); | 343 | $count_output = $messages_output->count(); |
336 | 344 | ||
337 | if ($type_message == 'input') { | 345 | if ($type_message == 'input') { |
338 | $messages = $messages_input->paginate(5); | 346 | $messages = $messages_input->paginate(5); |
339 | } | 347 | } |
340 | 348 | ||
341 | if ($type_message == 'output') { | 349 | if ($type_message == 'output') { |
342 | $messages = $messages_output->paginate(5); | 350 | $messages = $messages_output->paginate(5); |
343 | } | 351 | } |
344 | 352 | ||
345 | //dd($user_id, $messages[2]->vacancies); | 353 | //dd($user_id, $messages[2]->vacancies); |
346 | //jobs); | 354 | //jobs); |
347 | 355 | ||
348 | return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); | 356 | return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); |
349 | } | 357 | } |
350 | 358 | ||
351 | // Диалог между пользователями | 359 | // Диалог между пользователями |
352 | public function dialog(Request $request, User_Model $user1, User_Model $user2) { | 360 | public function dialog(Request $request, User_Model $user1, User_Model $user2) { |
353 | // Получение параметров. | 361 | // Получение параметров. |
354 | if ($request->has('ad_employer')){ | 362 | if ($request->has('ad_employer')){ |
355 | $ad_employer = $request->get('ad_employer'); | 363 | $ad_employer = $request->get('ad_employer'); |
356 | } else { | 364 | } else { |
357 | $ad_employer = 0; | 365 | $ad_employer = 0; |
358 | } | 366 | } |
359 | 367 | ||
360 | if (isset($user2->id)) { | 368 | if (isset($user2->id)) { |
361 | $companion = User_Model::query()->with('workers')-> | 369 | $companion = User_Model::query()->with('workers')-> |
362 | with('employers')-> | 370 | with('employers')-> |
363 | where('id', $user2->id)->first(); | 371 | where('id', $user2->id)->first(); |
364 | } | 372 | } |
365 | 373 | ||
366 | $Messages = Message::query()-> | 374 | $Messages = Message::query()-> |
367 | where('ad_employer_id', '=', $ad_employer)-> | 375 | where('ad_employer_id', '=', $ad_employer)-> |
368 | where(function($query) use ($user1, $user2) { | 376 | where(function($query) use ($user1, $user2) { |
369 | $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); | 377 | $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); |
370 | })->orWhere(function($query) use ($user1, $user2) { | 378 | })->orWhere(function($query) use ($user1, $user2) { |
371 | $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); | 379 | $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); |
372 | })->where('ad_employer_id', '=', $ad_employer)->OrderBy('created_at')->get(); | 380 | })->where('ad_employer_id', '=', $ad_employer)->OrderBy('created_at')->get(); |
373 | 381 | ||
374 | $id_vac = $Messages[$Messages->count() - 1]->ad_employer_id; | 382 | $id_vac = $Messages[$Messages->count() - 1]->ad_employer_id; |
375 | 383 | ||
376 | //$ad_employer = null; | 384 | //$ad_employer = null; |
377 | //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); | 385 | //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); |
378 | $sender = $user1; | 386 | $sender = $user1; |
379 | 387 | ||
380 | return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages')); | 388 | return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages')); |
381 | } | 389 | } |
382 | 390 | ||
383 | // Регистрация работодателя | 391 | // Регистрация работодателя |
384 | public function register_employer(Request $request) { | 392 | public function register_employer(Request $request) { |
385 | $params = $request->all(); | 393 | $params = $request->all(); |
386 | 394 | ||
387 | $rules = [ | 395 | $rules = [ |
388 | //'surname' => ['required', 'string', 'max:255'], | 396 | //'surname' => ['required', 'string', 'max:255'], |
389 | //'name_man' => ['required', 'string', 'max:255'], | 397 | //'name_man' => ['required', 'string', 'max:255'], |
390 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], | 398 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], |
391 | 'name_company' => ['required', 'string', 'max:255'], | 399 | 'name_company' => ['required', 'string', 'max:255'], |
392 | 'password' => ['required', 'string', 'min:6'], | 400 | 'password' => ['required', 'string', 'min:6'], |
393 | ]; | 401 | ]; |
394 | 402 | ||
395 | 403 | ||
396 | $messages = [ | 404 | $messages = [ |
397 | 'required' => 'Укажите обязательное поле', | 405 | 'required' => 'Укажите обязательное поле', |
398 | 'min' => [ | 406 | 'min' => [ |
399 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 407 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
400 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 408 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
401 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 409 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
402 | ], | 410 | ], |
403 | 'max' => [ | 411 | 'max' => [ |
404 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 412 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
405 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 413 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
406 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 414 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
407 | ] | 415 | ] |
408 | ]; | 416 | ]; |
409 | 417 | ||
410 | $email = $request->get('email'); | 418 | $email = $request->get('email'); |
411 | if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { | 419 | if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { |
412 | return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); | 420 | return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); |
413 | } | 421 | } |
414 | 422 | ||
415 | if ($request->get('password') !== $request->get('confirmed')){ | 423 | if ($request->get('password') !== $request->get('confirmed')){ |
416 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); | 424 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); |
417 | } | 425 | } |
418 | 426 | ||
419 | if (strlen($request->get('password')) < 6) { | 427 | if (strlen($request->get('password')) < 6) { |
420 | return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); | 428 | return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); |
421 | } | 429 | } |
422 | /* | 430 | /* |
423 | $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); | 431 | $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); |
424 | $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', | 432 | $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', |
425 | 'X', 'C', 'V', 'B', 'N', 'M'); | 433 | 'X', 'C', 'V', 'B', 'N', 'M'); |
426 | $spec_bool = false; | 434 | $spec_bool = false; |
427 | $alpha_bool = false; | 435 | $alpha_bool = false; |
428 | 436 | ||
429 | $haystack = $request->get('password'); | 437 | $haystack = $request->get('password'); |
430 | 438 | ||
431 | foreach ($specsumbol as $it) { | 439 | foreach ($specsumbol as $it) { |
432 | if (strpos($haystack, $it) !== false) { | 440 | if (strpos($haystack, $it) !== false) { |
433 | $spec_bool = true; | 441 | $spec_bool = true; |
434 | } | 442 | } |
435 | } | 443 | } |
436 | 444 | ||
437 | foreach ($alpha as $it) { | 445 | foreach ($alpha as $it) { |
438 | if (strpos($haystack, $it) !== false) { | 446 | if (strpos($haystack, $it) !== false) { |
439 | $alpha_bool = true; | 447 | $alpha_bool = true; |
440 | } | 448 | } |
441 | } | 449 | } |
442 | 450 | ||
443 | if ((!$spec_bool) || (!$alpha_bool)) { | 451 | if ((!$spec_bool) || (!$alpha_bool)) { |
444 | return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); | 452 | return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); |
445 | }*/ | 453 | }*/ |
446 | 454 | ||
447 | if (empty($request->get('surname'))) { | 455 | if (empty($request->get('surname'))) { |
448 | $params['surname'] = 'Неизвестно'; | 456 | $params['surname'] = 'Неизвестно'; |
449 | } | 457 | } |
450 | if (empty($request->get('name_man'))) { | 458 | if (empty($request->get('name_man'))) { |
451 | $params['name_man'] = 'Неизвестно'; | 459 | $params['name_man'] = 'Неизвестно'; |
452 | } | 460 | } |
453 | $validator = Validator::make($params, $rules, $messages); | 461 | $validator = Validator::make($params, $rules, $messages); |
454 | 462 | ||
455 | if ($validator->fails()) { | 463 | if ($validator->fails()) { |
456 | return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); | 464 | return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); |
457 | } else { | 465 | } else { |
458 | $user = $this->create($params); | 466 | $user = $this->create($params); |
459 | event(new Registered($user)); | 467 | event(new Registered($user)); |
460 | Auth::guard()->login($user); | 468 | Auth::guard()->login($user); |
461 | } | 469 | } |
462 | 470 | ||
463 | if ($user) { | 471 | if ($user) { |
464 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; | 472 | return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; |
465 | } else { | 473 | } else { |
466 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); | 474 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); |
467 | } | 475 | } |
468 | } | 476 | } |
469 | 477 | ||
470 | // Создание пользователя | 478 | // Создание пользователя |
471 | protected function create(array $data) | 479 | protected function create(array $data) |
472 | { | 480 | { |
473 | $Use = new User_Model(); | 481 | $Use = new User_Model(); |
474 | $Code_user = $Use->create([ | 482 | $Code_user = $Use->create([ |
475 | 'name' => $data['surname']." ".$data['name_man'], | 483 | 'name' => $data['surname']." ".$data['name_man'], |
476 | 'name_man' => $data['name_man'], | 484 | 'name_man' => $data['name_man'], |
477 | 'surname' => $data['surname'], | 485 | 'surname' => $data['surname'], |
478 | 'surname2' => $data['surname2'], | 486 | 'surname2' => $data['surname2'], |
479 | 'subscribe_email' => $data['email'], | 487 | 'subscribe_email' => $data['email'], |
480 | 'email' => $data['email'], | 488 | 'email' => $data['email'], |
481 | 'telephone' => $data['telephone'], | 489 | 'telephone' => $data['telephone'], |
482 | 'is_worker' => 0, | 490 | 'is_worker' => 0, |
483 | 'password' => Hash::make($data['password']), | 491 | 'password' => Hash::make($data['password']), |
484 | 'pubpassword' => base64_encode($data['password']), | 492 | 'pubpassword' => base64_encode($data['password']), |
485 | 'email_verified_at' => Carbon::now() | 493 | 'email_verified_at' => Carbon::now() |
486 | ]); | 494 | ]); |
487 | 495 | ||
488 | if ($Code_user->id > 0) { | 496 | if ($Code_user->id > 0) { |
489 | $Employer = new Employer(); | 497 | $Employer = new Employer(); |
490 | $Employer->user_id = $Code_user->id; | 498 | $Employer->user_id = $Code_user->id; |
491 | $Employer->name_company = $data['name_company']; | 499 | $Employer->name_company = $data['name_company']; |
492 | $Employer->email = $data['email']; | 500 | $Employer->email = $data['email']; |
493 | $Employer->telephone = $data['telephone']; | 501 | $Employer->telephone = $data['telephone']; |
494 | $Employer->code = Tools::generator_id(10); | 502 | $Employer->code = Tools::generator_id(10); |
495 | $Employer->save(); | 503 | $Employer->save(); |
496 | 504 | ||
497 | return $Code_user; | 505 | return $Code_user; |
498 | } | 506 | } |
499 | } | 507 | } |
500 | 508 | ||
501 | // Отправка сообщения от работодателя | 509 | // Отправка сообщения от работодателя |
502 | public function send_message(MessagesRequiest $request) { | 510 | public function send_message(MessagesRequiest $request) { |
503 | $params = $request->all(); | 511 | $params = $request->all(); |
504 | dd($params); | 512 | dd($params); |
505 | $user1 = $params['user_id']; | 513 | $user1 = $params['user_id']; |
506 | $user2 = $params['to_user_id']; | 514 | $user2 = $params['to_user_id']; |
507 | 515 | ||
508 | if ($request->has('file')) { | 516 | if ($request->has('file')) { |
509 | $params['file'] = $request->file('file')->store("messages", 'public'); | 517 | $params['file'] = $request->file('file')->store("messages", 'public'); |
510 | } | 518 | } |
511 | Message::create($params); | 519 | Message::create($params); |
512 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); | 520 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); |
513 | } | 521 | } |
514 | 522 | ||
515 | public function test123(Request $request) { | 523 | public function test123(Request $request) { |
516 | $params = $request->all(); | 524 | $params = $request->all(); |
517 | $user1 = $params['user_id']; | 525 | $user1 = $params['user_id']; |
518 | $user2 = $params['to_user_id']; | 526 | $user2 = $params['to_user_id']; |
519 | 527 | ||
520 | $rules = [ | 528 | $rules = [ |
521 | 'text' => 'required|min:1|max:150000', | 529 | 'text' => 'required|min:1|max:150000', |
522 | 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' | 530 | 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' |
523 | ]; | 531 | ]; |
524 | $messages = [ | 532 | $messages = [ |
525 | 'required' => 'Укажите обязательное поле', | 533 | 'required' => 'Укажите обязательное поле', |
526 | 'min' => [ | 534 | 'min' => [ |
527 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 535 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
528 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 536 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
529 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 537 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
530 | ], | 538 | ], |
531 | 'max' => [ | 539 | 'max' => [ |
532 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 540 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
533 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 541 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
534 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 542 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
535 | ] | 543 | ] |
536 | ]; | 544 | ]; |
537 | 545 | ||
538 | $validator = Validator::make($request->all(), $rules, $messages); | 546 | $validator = Validator::make($request->all(), $rules, $messages); |
539 | 547 | ||
540 | if ($validator->fails()) { | 548 | if ($validator->fails()) { |
541 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) | 549 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) |
542 | ->withErrors($validator); | 550 | ->withErrors($validator); |
543 | } else { | 551 | } else { |
544 | if ($request->has('file')) { | 552 | if ($request->has('file')) { |
545 | $params['file'] = $request->file('file')->store("messages", 'public'); | 553 | $params['file'] = $request->file('file')->store("messages", 'public'); |
546 | } | 554 | } |
547 | Message::create($params); | 555 | Message::create($params); |
548 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); | 556 | return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); |
549 | 557 | ||
550 | } | 558 | } |
551 | } | 559 | } |
552 | 560 | ||
553 | //Избранные люди | 561 | //Избранные люди |
554 | public function favorites(Request $request) { | 562 | public function favorites(Request $request) { |
555 | $IP_address = RusDate::ip_addr_client(); | 563 | $IP_address = RusDate::ip_addr_client(); |
556 | $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); | 564 | $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); |
557 | 565 | ||
558 | if ($Arr->count()) { | 566 | if ($Arr->count()) { |
559 | $A = Array(); | 567 | $A = Array(); |
560 | foreach ($Arr as $it) { | 568 | foreach ($Arr as $it) { |
561 | $A[] = $it->code_record; | 569 | $A[] = $it->code_record; |
562 | } | 570 | } |
563 | 571 | ||
564 | $Workers = Worker::query()->whereIn('id', $A); | 572 | $Workers = Worker::query()->whereIn('id', $A); |
565 | } else { | 573 | } else { |
566 | $Workers = Worker::query()->where('id', '=', '0'); | 574 | $Workers = Worker::query()->where('id', '=', '0'); |
567 | } | 575 | } |
568 | 576 | ||
569 | if (($request->has('search')) && (!empty($request->get('search')))) { | 577 | if (($request->has('search')) && (!empty($request->get('search')))) { |
570 | $search = $request->get('search'); | 578 | $search = $request->get('search'); |
571 | 579 | ||
572 | $Workers = $Workers->WhereHas('users', | 580 | $Workers = $Workers->WhereHas('users', |
573 | function (Builder $query) use ($search) { | 581 | function (Builder $query) use ($search) { |
574 | $query->Where('surname', 'LIKE', "%$search%") | 582 | $query->Where('surname', 'LIKE', "%$search%") |
575 | ->orWhere('name_man', 'LIKE', "%$search%") | 583 | ->orWhere('name_man', 'LIKE', "%$search%") |
576 | ->orWhere('surname2', 'LIKE', "%$search%"); | 584 | ->orWhere('surname2', 'LIKE', "%$search%"); |
577 | }); | 585 | }); |
578 | } else { | 586 | } else { |
579 | $Workers = $Workers->with('users'); | 587 | $Workers = $Workers->with('users'); |
580 | } | 588 | } |
581 | 589 | ||
582 | $Workers = $Workers->get(); | 590 | $Workers = $Workers->get(); |
583 | 591 | ||
584 | 592 | ||
585 | return view('employers.favorite', compact('Workers')); | 593 | return view('employers.favorite', compact('Workers')); |
586 | } | 594 | } |
587 | 595 | ||
588 | // База данных | 596 | // База данных |
589 | public function bd(Request $request) { | 597 | public function bd(Request $request) { |
590 | // для типа BelongsTo | 598 | // для типа BelongsTo |
591 | //$documents = Document::query()->orderBy(Location::select('name') | 599 | //$documents = Document::query()->orderBy(Location::select('name') |
592 | // ->whereColumn('locations.id', 'documents.location_id') | 600 | // ->whereColumn('locations.id', 'documents.location_id') |
593 | //); | 601 | //); |
594 | 602 | ||
595 | // для типа HasOne/Many | 603 | // для типа HasOne/Many |
596 | // $documents = Document::::query()->orderBy(Location::select('name') | 604 | // $documents = Document::::query()->orderBy(Location::select('name') |
597 | // ->whereColumn('locations.document_id', 'documents.id') | 605 | // ->whereColumn('locations.document_id', 'documents.id') |
598 | //); | 606 | //); |
599 | 607 | ||
600 | 608 | ||
601 | $users = User_Model::query()->with('workers'); | 609 | $users = User_Model::query()->with('workers'); |
602 | 610 | ||
603 | if ($request->has('search')) { | 611 | if ($request->has('search')) { |
604 | $find_key = $request->get('search'); | 612 | $find_key = $request->get('search'); |
605 | $users = $users->where('name', 'LIKE', "%$find_key%") | 613 | $users = $users->where('name', 'LIKE', "%$find_key%") |
606 | ->orWhere('surname', 'LIKE', "%$find_key%") | 614 | ->orWhere('surname', 'LIKE', "%$find_key%") |
607 | ->orWhere('name_man', 'LIKE', "%$find_key%") | 615 | ->orWhere('name_man', 'LIKE', "%$find_key%") |
608 | ->orWhere('email', 'LIKE', "%$find_key%") | 616 | ->orWhere('email', 'LIKE', "%$find_key%") |
609 | ->orWhere('telephone', 'LIKE', "%$find_key%"); | 617 | ->orWhere('telephone', 'LIKE', "%$find_key%"); |
610 | } | 618 | } |
611 | 619 | ||
612 | // Данные | 620 | // Данные |
613 | $users = $users->Baseuser()-> | 621 | $users = $users->Baseuser()-> |
614 | orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id')); | 622 | orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id')); |
615 | $count_users = $users; | 623 | $count_users = $users; |
616 | $users = $users->paginate(5); | 624 | $users = $users->paginate(5); |
617 | 625 | ||
618 | 626 | ||
619 | return view('employers.bd', compact('users', 'count_users')); | 627 | return view('employers.bd', compact('users', 'count_users')); |
620 | } | 628 | } |
621 | 629 | ||
622 | //Настройка уведомлений | 630 | //Настройка уведомлений |
623 | public function subscribe() { | 631 | public function subscribe() { |
624 | return view('employers.subcribe'); | 632 | return view('employers.subcribe'); |
625 | } | 633 | } |
626 | 634 | ||
627 | //Установка уведомлений сохранение | 635 | //Установка уведомлений сохранение |
628 | public function save_subscribe(Request $request) { | 636 | public function save_subscribe(Request $request) { |
629 | dd($request->all()); | 637 | dd($request->all()); |
630 | $msg = $request->validate([ | 638 | $msg = $request->validate([ |
631 | 'subscribe_email' => 'required|email|min:5|max:255', | 639 | 'subscribe_email' => 'required|email|min:5|max:255', |
632 | ]); | 640 | ]); |
633 | return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); | 641 | return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); |
634 | } | 642 | } |
635 | 643 | ||
636 | //Сбросить форму с паролем | 644 | //Сбросить форму с паролем |
637 | public function password_reset() { | 645 | public function password_reset() { |
638 | $email = Auth()->user()->email; | 646 | $email = Auth()->user()->email; |
639 | return view('employers.password-reset', compact('email')); | 647 | return view('employers.password-reset', compact('email')); |
640 | } | 648 | } |
641 | 649 | ||
642 | //Обновление пароля | 650 | //Обновление пароля |
643 | public function new_password(Request $request) { | 651 | public function new_password(Request $request) { |
644 | $use = Auth()->user(); | 652 | $use = Auth()->user(); |
645 | $request->validate([ | 653 | $request->validate([ |
646 | 'password' => 'required|string', | 654 | 'password' => 'required|string', |
647 | 'new_password' => 'required|string', | 655 | 'new_password' => 'required|string', |
648 | 'new_password2' => 'required|string' | 656 | 'new_password2' => 'required|string' |
649 | ]); | 657 | ]); |
650 | 658 | ||
651 | if ($request->get('new_password') == $request->get('new_password2')) | 659 | if ($request->get('new_password') == $request->get('new_password2')) |
652 | if ($request->get('password') !== $request->get('new_password')) { | 660 | if ($request->get('password') !== $request->get('new_password')) { |
653 | $credentials = $request->only('email', 'password'); | 661 | $credentials = $request->only('email', 'password'); |
654 | if (Auth::attempt($credentials)) { | 662 | if (Auth::attempt($credentials)) { |
655 | 663 | ||
656 | if (!is_null($use->email_verified_at)){ | 664 | if (!is_null($use->email_verified_at)){ |
657 | 665 | ||
658 | $user_data = User_Model::find($use->id); | 666 | $user_data = User_Model::find($use->id); |
659 | $user_data->update([ | 667 | $user_data->update([ |
660 | 'password' => Hash::make($request->get('new_password')), | 668 | 'password' => Hash::make($request->get('new_password')), |
661 | 'pubpassword' => base64_encode($request->get('new_password')), | 669 | 'pubpassword' => base64_encode($request->get('new_password')), |
662 | ]); | 670 | ]); |
663 | return redirect() | 671 | return redirect() |
664 | ->route('employer.password_reset') | 672 | ->route('employer.password_reset') |
665 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); | 673 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); |
666 | } | 674 | } |
667 | 675 | ||
668 | return redirect() | 676 | return redirect() |
669 | ->route('employer.password_reset') | 677 | ->route('employer.password_reset') |
670 | ->withError('Данная учетная запись не было верифицированна!'); | 678 | ->withError('Данная учетная запись не было верифицированна!'); |
671 | } | 679 | } |
672 | } | 680 | } |
673 | 681 | ||
674 | return redirect() | 682 | return redirect() |
675 | ->route('employer.password_reset') | 683 | ->route('employer.password_reset') |
676 | ->withErrors('Не совпадение данных, обновите пароли!'); | 684 | ->withErrors('Не совпадение данных, обновите пароли!'); |
677 | } | 685 | } |
678 | 686 | ||
679 | 687 | ||
680 | 688 | ||
681 | // Форма Удаление пипла | 689 | // Форма Удаление пипла |
682 | public function delete_people() { | 690 | public function delete_people() { |
683 | $login = Auth()->user()->email; | 691 | $login = Auth()->user()->email; |
684 | return view('employers.delete_people', compact('login')); | 692 | return view('employers.delete_people', compact('login')); |
685 | } | 693 | } |
686 | 694 | ||
687 | // Удаление аккаунта | 695 | // Удаление аккаунта |
688 | public function action_delete_user(Request $request) { | 696 | public function action_delete_user(Request $request) { |
689 | $Answer = $request->all(); | 697 | $Answer = $request->all(); |
690 | $user_id = Auth()->user()->id; | 698 | $user_id = Auth()->user()->id; |
691 | $request->validate([ | 699 | $request->validate([ |
692 | 'password' => 'required|string', | 700 | 'password' => 'required|string', |
693 | ]); | 701 | ]); |
694 | 702 | ||
695 | $credentials = $request->only('email', 'password'); | 703 | $credentials = $request->only('email', 'password'); |
696 | if (Auth::attempt($credentials)) { | 704 | if (Auth::attempt($credentials)) { |
697 | Auth::logout(); | 705 | Auth::logout(); |
698 | $it = User_Model::find($user_id); | 706 | $it = User_Model::find($user_id); |
699 | $it->delete(); | 707 | $it->delete(); |
700 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); | 708 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); |
701 | } else { | 709 | } else { |
702 | return redirect()->route('employer.delete_people') | 710 | return redirect()->route('employer.delete_people') |
703 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); | 711 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); |
704 | } | 712 | } |
705 | } | 713 | } |
706 | 714 | ||
707 | public function ajax_delete_user(Request $request) { | 715 | public function ajax_delete_user(Request $request) { |
708 | $Answer = $request->all(); | 716 | $Answer = $request->all(); |
709 | $user_id = Auth()->user()->id; | 717 | $user_id = Auth()->user()->id; |
710 | $request->validate([ | 718 | $request->validate([ |
711 | 'password' => 'required|string', | 719 | 'password' => 'required|string', |
712 | ]); | 720 | ]); |
713 | $credentials = $request->only('email', 'password'); | 721 | $credentials = $request->only('email', 'password'); |
714 | if (Auth::attempt($credentials)) { | 722 | if (Auth::attempt($credentials)) { |
715 | 723 | ||
716 | return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', | 724 | return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', |
717 | 'email' => $request->get('email'), | 725 | 'email' => $request->get('email'), |
718 | 'password' => $request->get('password'))); | 726 | 'password' => $request->get('password'))); |
719 | } else { | 727 | } else { |
720 | return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); | 728 | return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); |
721 | } | 729 | } |
722 | } | 730 | } |
723 | 731 | ||
724 | // FAQ - Вопросы/ответы для работодателей и соискателей | 732 | // FAQ - Вопросы/ответы для работодателей и соискателей |
725 | public function faq() { | 733 | public function faq() { |
726 | return view('employers.faq'); | 734 | return view('employers.faq'); |
727 | } | 735 | } |
728 | 736 | ||
729 | // Рассылка сообщений | 737 | // Рассылка сообщений |
730 | public function send_all_messages() { | 738 | public function send_all_messages() { |
731 | return view('employers.send_all'); | 739 | return view('employers.send_all'); |
732 | } | 740 | } |
733 | 741 | ||
734 | // Отправка сообщений для информации | 742 | // Отправка сообщений для информации |
735 | public function send_all_post(Request $request) { | 743 | public function send_all_post(Request $request) { |
736 | $data = $request->all(); | 744 | $data = $request->all(); |
737 | 745 | ||
738 | $emails = User_Model::query()->where('is_worker', '1')->get(); | 746 | $emails = User_Model::query()->where('is_worker', '1')->get(); |
739 | 747 | ||
740 | foreach ($emails as $e) { | 748 | foreach ($emails as $e) { |
741 | Mail::to($e->email)->send(new SendAllMessages($data)); | 749 | Mail::to($e->email)->send(new SendAllMessages($data)); |
742 | } | 750 | } |
743 | 751 | ||
744 | return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); | 752 | return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); |
745 | } | 753 | } |
746 | 754 | ||
747 | // База резюме | 755 | // База резюме |
748 | public function bd_tupe(Request $request) { | 756 | public function bd_tupe(Request $request) { |
749 | $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); | 757 | $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); |
750 | 758 | ||
751 | return view('employers.bd_tupe', compact('Resume')); | 759 | return view('employers.bd_tupe', compact('Resume')); |
752 | } | 760 | } |
753 | 761 | ||
754 | ////////////////////////////////////////////////////////////////// | 762 | ////////////////////////////////////////////////////////////////// |
755 | // Отправил сообщение | 763 | // Отправил сообщение |
756 | ////////////////////////////////////////////////////////////////// | 764 | ////////////////////////////////////////////////////////////////// |
757 | public function new_message(Request $request) { | 765 | public function new_message(Request $request) { |
758 | $params = $request->all(); | 766 | $params = $request->all(); |
759 | $id = $params['_user_id']; | 767 | $id = $params['_user_id']; |
760 | $message = new Message(); | 768 | $message = new Message(); |
761 | $message->user_id = $params['_user_id']; | 769 | $message->user_id = $params['_user_id']; |
762 | $message->to_user_id = $params['_to_user_id']; | 770 | $message->to_user_id = $params['_to_user_id']; |
763 | $message->title = $params['title']; | 771 | $message->title = $params['title']; |
764 | $message->text = $params['text']; | 772 | $message->text = $params['text']; |
765 | if ($request->has('_file')) { | 773 | if ($request->has('_file')) { |
766 | $message->file = $request->file('_file')->store("worker/$id", 'public'); | 774 | $message->file = $request->file('_file')->store("worker/$id", 'public'); |
767 | } | 775 | } |
768 | $message->ad_employer_id = $params['_vacancy']; | 776 | $message->ad_employer_id = $params['_vacancy']; |
769 | $message->flag_new = 1; | 777 | $message->flag_new = 1; |
770 | $id_message = $message->save(); | 778 | $id_message = $message->save(); |
771 | 779 | ||
772 | //$data['message_id'] = $id_message; | 780 | //$data['message_id'] = $id_message; |
773 | //$data['ad_employer_id'] = $params['_vacancy']; | 781 | //$data['ad_employer_id'] = $params['_vacancy']; |
774 | //$data['job_title_id'] = 0; | 782 | //$data['job_title_id'] = 0; |
775 | 783 | ||
776 | $data['flag'] = 1; | 784 | $data['flag'] = 1; |
777 | //$ad_responce = ad_response::create($data); | 785 | //$ad_responce = ad_response::create($data); |
778 | return redirect()->route('employer.messages', ['type_message' => 'output']); | 786 | return redirect()->route('employer.messages', ['type_message' => 'output']); |
779 | } | 787 | } |
780 | 788 | ||
781 | // Восстановление пароля | 789 | // Восстановление пароля |
782 | public function repair_password(Request $request) { | 790 | public function repair_password(Request $request) { |
783 | $params = $request->get('email'); | 791 | $params = $request->get('email'); |
784 | } | 792 | } |
785 | 793 | ||
786 | // Избранные люди на корабль | 794 | // Избранные люди на корабль |
787 | public function selected_people(Request $request) { | 795 | public function selected_people(Request $request) { |
788 | $id = $request->get('id'); | 796 | $id = $request->get('id'); |
789 | $favorite_people = Job_title::query()->Notbdif()->where('is_remove', '=', '0')->where('position_id', $id)->get(); | 797 | $favorite_people = Job_title::query()->Notbdif()->where('is_remove', '=', '0')->where('position_id', $id)->get(); |
790 | return view('favorite_people', compact('favorite_people')); | 798 | return view('favorite_people', compact('favorite_people')); |
791 | } | 799 | } |
792 | } | 800 | } |
793 | 801 |
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\Category; | 11 | use App\Models\Category; |
12 | use App\Models\Dop_info; | 12 | use App\Models\Dop_info; |
13 | use App\Models\Employer; | 13 | use App\Models\Employer; |
14 | use App\Models\infobloks; | 14 | use App\Models\infobloks; |
15 | use App\Models\Job_title; | 15 | use App\Models\Job_title; |
16 | use App\Models\Like_vacancy; | 16 | use App\Models\Like_vacancy; |
17 | use App\Models\Like_worker; | 17 | use App\Models\Like_worker; |
18 | use App\Models\Message; | 18 | use App\Models\Message; |
19 | use App\Models\place_works; | 19 | use App\Models\place_works; |
20 | use App\Models\PrevCompany; | 20 | use App\Models\PrevCompany; |
21 | use App\Models\reclame; | 21 | use App\Models\reclame; |
22 | use App\Models\ResponseWork; | 22 | use App\Models\ResponseWork; |
23 | use App\Models\sertification; | 23 | use App\Models\sertification; |
24 | use App\Models\Static_worker; | 24 | use App\Models\Static_worker; |
25 | use App\Models\Title_worker; | 25 | use App\Models\Title_worker; |
26 | use App\Models\User; | 26 | use App\Models\User; |
27 | use App\Models\User as User_Model; | 27 | use App\Models\User as User_Model; |
28 | use App\Models\Worker; | 28 | use App\Models\Worker; |
29 | use Barryvdh\DomPDF\Facade\Pdf; | 29 | use Barryvdh\DomPDF\Facade\Pdf; |
30 | use Carbon\Carbon; | 30 | use Carbon\Carbon; |
31 | use Illuminate\Auth\Events\Registered; | 31 | use Illuminate\Auth\Events\Registered; |
32 | use Illuminate\Database\Eloquent\Builder; | 32 | use Illuminate\Database\Eloquent\Builder; |
33 | use Illuminate\Database\Eloquent\Model; | 33 | use Illuminate\Database\Eloquent\Model; |
34 | use Illuminate\Http\JsonResponse; | 34 | use Illuminate\Http\JsonResponse; |
35 | use Illuminate\Http\Request; | 35 | use Illuminate\Http\Request; |
36 | use Illuminate\Support\Facades\Auth; | 36 | use Illuminate\Support\Facades\Auth; |
37 | use Illuminate\Support\Facades\Hash; | 37 | use Illuminate\Support\Facades\Hash; |
38 | use Illuminate\Support\Facades\Storage; | 38 | use Illuminate\Support\Facades\Storage; |
39 | use Illuminate\Support\Facades\Validator; | 39 | use Illuminate\Support\Facades\Validator; |
40 | 40 | ||
41 | class WorkerController extends Controller | 41 | class WorkerController extends Controller |
42 | { | 42 | { |
43 | public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу'); | 43 | public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу'); |
44 | 44 | ||
45 | //профиль | 45 | //профиль |
46 | public function profile(Worker $worker) | 46 | public function profile(Worker $worker) |
47 | { | 47 | { |
48 | $get_date = date('Y.m'); | 48 | $get_date = date('Y.m'); |
49 | 49 | ||
50 | $c = Static_worker::query()->where('year_month', '=', $get_date) | 50 | $c = Static_worker::query()->where('year_month', '=', $get_date) |
51 | ->where('user_id', '=', $worker->users->id) | 51 | ->where('user_id', '=', $worker->users->id) |
52 | ->get(); | 52 | ->get(); |
53 | 53 | ||
54 | if ($c->count() > 0) { | 54 | if ($c->count() > 0) { |
55 | $upd = Static_worker::find($c[0]->id); | 55 | $upd = Static_worker::find($c[0]->id); |
56 | $upd->lookin = $upd->lookin + 1; | 56 | $upd->lookin = $upd->lookin + 1; |
57 | $upd->save(); | 57 | $upd->save(); |
58 | } else { | 58 | } else { |
59 | $crt = new Static_worker(); | 59 | $crt = new Static_worker(); |
60 | $crt->lookin = 1; | 60 | $crt->lookin = 1; |
61 | $crt->year_month = $get_date; | 61 | $crt->year_month = $get_date; |
62 | $crt->user_id = $worker->user_id; | 62 | $crt->user_id = $worker->user_id; |
63 | $crt->save(); | 63 | $crt->save(); |
64 | } | 64 | } |
65 | 65 | ||
66 | $stat = Static_worker::query()->where('year_month', '=', $get_date) | 66 | $stat = Static_worker::query()->where('year_month', '=', $get_date) |
67 | ->where('user_id', '=', $worker->users->id) | 67 | ->where('user_id', '=', $worker->users->id) |
68 | ->get(); | 68 | ->get(); |
69 | 69 | ||
70 | return view('public.workers.profile', compact('worker', 'stat')); | 70 | return view('public.workers.profile', compact('worker', 'stat')); |
71 | } | 71 | } |
72 | 72 | ||
73 | // лист база резюме | 73 | // лист база резюме |
74 | public function bd_resume(Request $request) | 74 | public function bd_resume(Request $request) |
75 | { | 75 | { |
76 | $look = false; | ||
77 | $idiot = 0; | ||
76 | if (isset(Auth()->user()->id)) { | 78 | if (isset(Auth()->user()->id)) { |
77 | $idiot = Auth()->user()->id; | 79 | $idiot = Auth()->user()->id; |
78 | } else { | 80 | if ((!Auth()->user()->is_worker) && (Auth()->user()->is_lookin)) |
79 | $idiot = 0; | 81 | $look = true; |
80 | } | 82 | } |
81 | 83 | ||
82 | $status_work = $this->status_work; | 84 | if ($look) { |
83 | $resumes = Worker::query()->with('users')->with('job_titles'); | 85 | $status_work = $this->status_work; |
84 | $resumes = $resumes->whereHas('users', function (Builder $query) { | 86 | $resumes = Worker::query()->with('users')->with('job_titles'); |
85 | $query->Where('is_worker', '=', '1') | 87 | $resumes = $resumes->whereHas('users', function (Builder $query) { |
86 | ->Where('is_bd', '=', '0'); | 88 | $query->Where('is_worker', '=', '1') |
87 | }); | 89 | ->Where('is_bd', '=', '0'); |
88 | |||
89 | //dd($request->get('job')); | ||
90 | if (($request->has('job')) && ($request->get('job') > 0)) { | ||
91 | $resumes = $resumes->whereHas('job_titles', function(Builder $query) use ($request) { | ||
92 | $query->Where('job_titles.id', $request->get('job')); | ||
93 | }); | 90 | }); |
94 | } | ||
95 | 91 | ||
96 | $Job_title = Job_title::query()->get(); | 92 | //dd($request->get('job')); |
97 | 93 | if (($request->has('job')) && ($request->get('job') > 0)) { | |
98 | if ($request->get('sort')) { | 94 | $resumes = $resumes->whereHas('job_titles', function (Builder $query) use ($request) { |
99 | $sort = $request->get('sort'); | 95 | $query->Where('job_titles.id', $request->get('job')); |
100 | switch ($sort) { | 96 | }); |
101 | case 'name_up': | ||
102 | $resumes = $resumes->orderBy(User::select('surname') | ||
103 | ->whereColumn('Workers.user_id', 'users.id') | ||
104 | ); | ||
105 | break; | ||
106 | case 'name_down': | ||
107 | $resumes = $resumes->orderByDesc(User::select('surname') | ||
108 | ->whereColumn('Workers.user_id', 'users.id') | ||
109 | ); | ||
110 | break; | ||
111 | case 'created_at_up': $resumes = $resumes->OrderBy('created_at')->orderBy('id'); break; | ||
112 | case 'created_at_down': $resumes = $resumes->orderByDesc('created_at')->orderBy('id'); break; | ||
113 | case 'default': $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; | ||
114 | default: $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; | ||
115 | } | 97 | } |
116 | } | ||
117 | 98 | ||
118 | $res_count = $resumes->count(); | 99 | $Job_title = Job_title::query()->get(); |
119 | //$resumes = $resumes->get(); | ||
120 | 100 | ||
121 | $resumes = $resumes->paginate(4); | 101 | if ($request->get('sort')) { |
122 | if ($request->ajax()) { | 102 | $sort = $request->get('sort'); |
123 | // Условия обставлены | 103 | switch ($sort) { |
124 | if ($request->has('block') && ($request->get('block') == 1)) { | 104 | case 'name_up': |
125 | return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot')); | 105 | $resumes = $resumes->orderBy(User::select('surname') |
106 | ->whereColumn('Workers.user_id', 'users.id') | ||
107 | ); | ||
108 | break; | ||
109 | case 'name_down': | ||
110 | $resumes = $resumes->orderByDesc(User::select('surname') | ||
111 | ->whereColumn('Workers.user_id', 'users.id') | ||
112 | ); | ||
113 | break; | ||
114 | case 'created_at_up': | ||
115 | $resumes = $resumes->OrderBy('created_at')->orderBy('id'); | ||
116 | break; | ||
117 | case 'created_at_down': | ||
118 | $resumes = $resumes->orderByDesc('created_at')->orderBy('id'); | ||
119 | break; | ||
120 | case 'default': | ||
121 | $resumes = $resumes->orderBy('id')->orderby('updated_at'); | ||
122 | break; | ||
123 | default: | ||
124 | $resumes = $resumes->orderBy('id')->orderby('updated_at'); | ||
125 | break; | ||
126 | } | ||
126 | } | 127 | } |
127 | 128 | ||
128 | if ($request->has('block') && ($request->get('block') == 2)) { | 129 | $res_count = $resumes->count(); |
129 | return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot')); | 130 | //$resumes = $resumes->get(); |
131 | $resumes = $resumes->paginate(4); | ||
132 | if ($request->ajax()) { | ||
133 | // Условия обставлены | ||
134 | if ($request->has('block') && ($request->get('block') == 1)) { | ||
135 | return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot')); | ||
136 | } | ||
137 | |||
138 | if ($request->has('block') && ($request->get('block') == 2)) { | ||
139 | return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot')); | ||
140 | } | ||
141 | } else { | ||
142 | return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot', 'Job_title')); | ||
130 | } | 143 | } |
131 | } else { | 144 | } else { |
132 | return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot', 'Job_title')); | 145 | return redirect()->route('index')->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]); |
133 | } | 146 | } |
134 | } | 147 | } |
135 | 148 | ||
136 | //Лайк резюме | 149 | //Лайк резюме |
137 | public function like_controller() { | 150 | public function like_controller() { |
138 | 151 | ||
139 | } | 152 | } |
140 | 153 | ||
141 | // анкета соискателя | 154 | // анкета соискателя |
142 | public function resume_profile(Worker $worker) | 155 | public function resume_profile(Worker $worker) |
143 | { | 156 | { |
144 | if (isset(Auth()->user()->id)) { | 157 | if (isset(Auth()->user()->id)) { |
145 | $idiot = Auth()->user()->id; | 158 | $idiot = Auth()->user()->id; |
146 | } else { | 159 | } else { |
147 | $idiot = 0; | 160 | $idiot = 0; |
148 | } | 161 | } |
149 | 162 | ||
150 | $status_work = $this->status_work; | 163 | $status_work = $this->status_work; |
151 | $Query = Worker::query()->with('users')->with('job_titles') | 164 | $Query = Worker::query()->with('users')->with('job_titles') |
152 | ->with('place_worker')->with('sertificate')->with('prev_company') | 165 | ->with('place_worker')->with('sertificate')->with('prev_company') |
153 | ->with('infobloks'); | 166 | ->with('infobloks'); |
154 | $Query = $Query->where('id', '=', $worker->id); | 167 | $Query = $Query->where('id', '=', $worker->id); |
155 | $Query = $Query->get(); | 168 | $Query = $Query->get(); |
156 | 169 | ||
157 | $get_date = date('Y.m'); | 170 | $get_date = date('Y.m'); |
158 | $c = Static_worker::query()->where('year_month', '=', $get_date) | 171 | $c = Static_worker::query()->where('year_month', '=', $get_date) |
159 | ->where('user_id', '=', $worker->id) | 172 | ->where('user_id', '=', $worker->id) |
160 | ->get(); | 173 | ->get(); |
161 | 174 | ||
162 | if ($c->count() > 0) { | 175 | if ($c->count() > 0) { |
163 | $upd = Static_worker::find($c[0]->id); | 176 | $upd = Static_worker::find($c[0]->id); |
164 | $upd->lookin = $upd->lookin + 1; | 177 | $upd->lookin = $upd->lookin + 1; |
165 | $upd->save(); | 178 | $upd->save(); |
166 | } else { | 179 | } else { |
167 | $crt = new Static_worker(); | 180 | $crt = new Static_worker(); |
168 | $crt->lookin = 1; | 181 | $crt->lookin = 1; |
169 | $crt->year_month = $get_date; | 182 | $crt->year_month = $get_date; |
170 | $crt->user_id = $worker->user_id; | 183 | $crt->user_id = $worker->user_id; |
171 | $crt->save(); | 184 | $crt->save(); |
172 | } | 185 | } |
173 | $stat = Static_worker::query()->where('year_month', '=', $get_date) | 186 | $stat = Static_worker::query()->where('year_month', '=', $get_date) |
174 | ->where('user_id', '=', $worker->id) | 187 | ->where('user_id', '=', $worker->id) |
175 | ->get(); | 188 | ->get(); |
176 | return view('worker', compact('Query', 'status_work', 'idiot')); | 189 | return view('worker', compact('Query', 'status_work', 'idiot')); |
177 | } | 190 | } |
178 | 191 | ||
179 | // скачать анкету соискателя | 192 | // скачать анкету соискателя |
180 | public function resume_download(Worker $worker) | 193 | public function resume_download(Worker $worker) |
181 | { | 194 | { |
182 | $status_work = $this->status_work; | 195 | $status_work = $this->status_work; |
183 | $Query = Worker::query()->with('users')->with('job_titles') | 196 | $Query = Worker::query()->with('users')->with('job_titles') |
184 | ->with('place_worker')->with('sertificate')->with('prev_company') | 197 | ->with('place_worker')->with('sertificate')->with('prev_company') |
185 | ->with('infobloks'); | 198 | ->with('infobloks'); |
186 | $Query = $Query->where('id', '=', $worker->id); | 199 | $Query = $Query->where('id', '=', $worker->id); |
187 | $Query = $Query->get()->toArray(); | 200 | $Query = $Query->get()->toArray(); |
188 | 201 | ||
189 | view()->share('Query',$Query); | 202 | view()->share('Query',$Query); |
190 | 203 | ||
191 | 204 | ||
192 | $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape'); | 205 | $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape'); |
193 | 206 | ||
194 | return $pdf->stream(); | 207 | return $pdf->stream(); |
195 | } | 208 | } |
196 | 209 | ||
197 | public function resume_download_all() { | 210 | public function resume_download_all() { |
198 | $status_work = $this->status_work; | 211 | $status_work = $this->status_work; |
199 | $Query = Worker::query()->with('users')->with('job_titles') | 212 | $Query = Worker::query()->with('users')->with('job_titles') |
200 | ->with('place_worker')->with('sertificate')->with('prev_company') | 213 | ->with('place_worker')->with('sertificate')->with('prev_company') |
201 | ->with('infobloks')-> | 214 | ->with('infobloks')-> |
202 | whereHas('users', function (Builder $query) { | 215 | whereHas('users', function (Builder $query) { |
203 | $query->Where('is_worker', '=', '1') | 216 | $query->Where('is_worker', '=', '1') |
204 | ->Where('is_bd', '=', '1'); | 217 | ->Where('is_bd', '=', '1'); |
205 | }); | 218 | }); |
206 | //$Query = $Query->where('id', '=', $worker->id); | 219 | //$Query = $Query->where('id', '=', $worker->id); |
207 | $Query = $Query->get()->toArray(); | 220 | $Query = $Query->get()->toArray(); |
208 | 221 | ||
209 | view()->share('Query',$Query); | 222 | view()->share('Query',$Query); |
210 | 223 | ||
211 | $pdf = PDF::loadView('layout.pdf-list-people', $Query); //->setPaper('a4', 'landscape'); | 224 | $pdf = PDF::loadView('layout.pdf-list-people', $Query); //->setPaper('a4', 'landscape'); |
212 | 225 | ||
213 | return $pdf->stream(); | 226 | return $pdf->stream(); |
214 | } | 227 | } |
215 | 228 | ||
216 | // Кабинет работника | 229 | // Кабинет работника |
217 | public function cabinet(Request $request) | 230 | public function cabinet(Request $request) |
218 | { | 231 | { |
219 | // дата год и месяц | 232 | // дата год и месяц |
220 | $get_date = date('Y.m'); | 233 | $get_date = date('Y.m'); |
221 | 234 | ||
222 | $id = Auth()->user()->id; | 235 | $id = Auth()->user()->id; |
223 | 236 | ||
224 | $Infobloks = infobloks::query()->get(); | 237 | $Infobloks = infobloks::query()->get(); |
225 | 238 | ||
226 | $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')-> | 239 | $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')-> |
227 | with('infobloks')->with('place_worker')-> | 240 | with('infobloks')->with('place_worker')-> |
228 | WhereHas('users', | 241 | WhereHas('users', |
229 | function (Builder $query) use ($id) {$query->Where('id', $id); | 242 | function (Builder $query) use ($id) {$query->Where('id', $id); |
230 | })->get(); | 243 | })->get(); |
231 | 244 | ||
232 | $Job_titles = Job_title::query()->where('is_remove', '=', '0')-> | 245 | $Job_titles = Job_title::query()->where('is_remove', '=', '0')-> |
233 | where('is_bd', '=' , '1')-> | 246 | where('is_bd', '=' , '1')-> |
234 | OrderBy('name')->get(); | 247 | OrderBy('name')->get(); |
235 | $Infoblocks = infobloks::query()->OrderBy('name')->get(); | 248 | $Infoblocks = infobloks::query()->OrderBy('name')->get(); |
236 | 249 | ||
237 | $stat = Static_worker::query()->where('year_month', '=', $get_date) | 250 | $stat = Static_worker::query()->where('year_month', '=', $get_date) |
238 | ->where('user_id', '=', $Worker[0]->id) | 251 | ->where('user_id', '=', $Worker[0]->id) |
239 | ->get(); | 252 | ->get(); |
240 | 253 | ||
241 | // 10% | 254 | // 10% |
242 | 255 | ||
243 | $persent = 10; | 256 | $persent = 10; |
244 | $persent1 = 0; | 257 | $persent1 = 0; |
245 | $persent2 = 0; | 258 | $persent2 = 0; |
246 | $persent3 = 0; | 259 | $persent3 = 0; |
247 | $persent4 = 0; | 260 | $persent4 = 0; |
248 | $persent5 = 0; | 261 | $persent5 = 0; |
249 | 262 | ||
250 | if ((!empty($Worker[0]->telephone)) && | 263 | if ((!empty($Worker[0]->telephone)) && |
251 | (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) && | 264 | (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) && |
252 | (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) { | 265 | (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) { |
253 | // 40% | 266 | // 40% |
254 | $persent = $persent + 40; | 267 | $persent = $persent + 40; |
255 | $persent1 = 40; | 268 | $persent1 = 40; |
256 | } | 269 | } |
257 | 270 | ||
258 | //dd($Worker[0]->status_work, $Worker[0]->telephone, $Worker[0]->email, $Worker[0]->experience, $Worker[0]->city, $Worker[0]->old_year); | 271 | //dd($Worker[0]->status_work, $Worker[0]->telephone, $Worker[0]->email, $Worker[0]->experience, $Worker[0]->city, $Worker[0]->old_year); |
259 | 272 | ||
260 | if ($Worker[0]->sertificate->count() > 0) { | 273 | if ($Worker[0]->sertificate->count() > 0) { |
261 | // 15% | 274 | // 15% |
262 | $persent = $persent + 15; | 275 | $persent = $persent + 15; |
263 | $persent2 = 15; | 276 | $persent2 = 15; |
264 | } | 277 | } |
265 | 278 | ||
266 | if ($Worker[0]->infobloks->count() > 0) { | 279 | if ($Worker[0]->infobloks->count() > 0) { |
267 | // 20% | 280 | // 20% |
268 | $persent = $persent + 20; | 281 | $persent = $persent + 20; |
269 | $persent3 = 20; | 282 | $persent3 = 20; |
270 | } | 283 | } |
271 | 284 | ||
272 | if ($Worker[0]->prev_company->count() > 0) { | 285 | if ($Worker[0]->prev_company->count() > 0) { |
273 | // 10% | 286 | // 10% |
274 | $persent = $persent + 10; | 287 | $persent = $persent + 10; |
275 | $persent4 = 10; | 288 | $persent4 = 10; |
276 | } | 289 | } |
277 | 290 | ||
278 | if (!empty($Worker[0]->photo)) { | 291 | if (!empty($Worker[0]->photo)) { |
279 | // 5% | 292 | // 5% |
280 | $persent = $persent + 5; | 293 | $persent = $persent + 5; |
281 | $persent5 = 5; | 294 | $persent5 = 5; |
282 | } | 295 | } |
283 | if ($request->has('print')) { | 296 | if ($request->has('print')) { |
284 | dd($Worker); | 297 | dd($Worker); |
285 | } else { | 298 | } else { |
286 | return view('workers.cabinet', compact('Worker', 'Infobloks', 'persent', 'Job_titles', 'Infoblocks', 'stat')); | 299 | return view('workers.cabinet', compact('Worker', 'Infobloks', 'persent', 'Job_titles', 'Infoblocks', 'stat')); |
287 | } | 300 | } |
288 | } | 301 | } |
289 | 302 | ||
290 | // Сохранение данных | 303 | // Сохранение данных |
291 | public function cabinet_save(Worker $worker, Request $request) | 304 | public function cabinet_save(Worker $worker, Request $request) |
292 | { | 305 | { |
293 | $id = $worker->id; | 306 | $id = $worker->id; |
294 | $params = $request->all(); | 307 | $params = $request->all(); |
295 | 308 | ||
296 | $job_title_id = $request->get('job_title_id'); | 309 | $job_title_id = $request->get('job_title_id'); |
297 | 310 | ||
298 | unset($params['new_diplom']); | 311 | unset($params['new_diplom']); |
299 | unset($params['new_data_begin']); | 312 | unset($params['new_data_begin']); |
300 | unset($params['new_data_end']); | 313 | unset($params['new_data_end']); |
301 | unset($params['new_job_title']); | 314 | unset($params['new_job_title']); |
302 | unset($params['new_teplohod']); | 315 | unset($params['new_teplohod']); |
303 | unset($params['new_GWT']); | 316 | unset($params['new_GWT']); |
304 | unset($params['new_KBT']); | 317 | unset($params['new_KBT']); |
305 | unset($params['new_Begin_work']); | 318 | unset($params['new_Begin_work']); |
306 | unset($params['new_End_work']); | 319 | unset($params['new_End_work']); |
307 | unset($params['new_name_company']); | 320 | unset($params['new_name_company']); |
308 | 321 | ||
309 | $rules = [ | 322 | $rules = [ |
310 | 'surname' => ['required', 'string', 'max:255'], | 323 | 'surname' => ['required', 'string', 'max:255'], |
311 | 'name_man' => ['required', 'string', 'max:255'], | 324 | 'name_man' => ['required', 'string', 'max:255'], |
312 | 'email' => ['required', 'string', 'email', 'max:255'], | 325 | 'email' => ['required', 'string', 'email', 'max:255'], |
313 | 326 | ||
314 | ]; | 327 | ]; |
315 | 328 | ||
316 | $messages = [ | 329 | $messages = [ |
317 | 'required' => 'Укажите обязательное поле', | 330 | 'required' => 'Укажите обязательное поле', |
318 | 'min' => [ | 331 | 'min' => [ |
319 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 332 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
320 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 333 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
321 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 334 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
322 | ], | 335 | ], |
323 | 'max' => [ | 336 | 'max' => [ |
324 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 337 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
325 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 338 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
326 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 339 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
327 | ] | 340 | ] |
328 | ]; | 341 | ]; |
329 | 342 | ||
330 | $validator = Validator::make($params, $rules, $messages); | 343 | $validator = Validator::make($params, $rules, $messages); |
331 | 344 | ||
332 | if ($validator->fails()) { | 345 | if ($validator->fails()) { |
333 | return redirect()->route('worker.cabinet')->withErrors($validator); | 346 | return redirect()->route('worker.cabinet')->withErrors($validator); |
334 | } else { | 347 | } else { |
335 | 348 | ||
336 | if ($request->has('photo')) { | 349 | if ($request->has('photo')) { |
337 | if (!empty($Worker->photo)) { | 350 | if (!empty($Worker->photo)) { |
338 | Storage::delete($Worker->photo); | 351 | Storage::delete($Worker->photo); |
339 | } | 352 | } |
340 | $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); | 353 | $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); |
341 | } | 354 | } |
342 | 355 | ||
343 | if ($request->has('file')) { | 356 | if ($request->has('file')) { |
344 | if (!empty($Worker->file)) { | 357 | if (!empty($Worker->file)) { |
345 | Storage::delete($Worker->file); | 358 | Storage::delete($Worker->file); |
346 | } | 359 | } |
347 | $params['file'] = $request->file('file')->store("worker/$id", 'public'); | 360 | $params['file'] = $request->file('file')->store("worker/$id", 'public'); |
348 | } | 361 | } |
349 | 362 | ||
350 | $id_wor = $worker->update($params); | 363 | $id_wor = $worker->update($params); |
351 | $use = User::find($worker->user_id); | 364 | $use = User::find($worker->user_id); |
352 | $use->surname = $request->get('surname'); | 365 | $use->surname = $request->get('surname'); |
353 | $use->name_man = $request->get('name_man'); | 366 | $use->name_man = $request->get('name_man'); |
354 | $use->surname2 = $request->get('surname2'); | 367 | $use->surname2 = $request->get('surname2'); |
355 | 368 | ||
356 | $use->save(); | 369 | $use->save(); |
357 | $worker->job_titles()->sync($job_title_id); | 370 | $worker->job_titles()->sync($job_title_id); |
358 | 371 | ||
359 | return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); | 372 | return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); |
360 | } | 373 | } |
361 | } | 374 | } |
362 | 375 | ||
363 | // Сообщения данные | 376 | // Сообщения данные |
364 | public function messages($type_message) | 377 | public function messages($type_message) |
365 | { | 378 | { |
366 | $user_id = Auth()->user()->id; | 379 | $user_id = Auth()->user()->id; |
367 | 380 | ||
368 | $messages_input = Message::query()->with('vacancies')->with('user_from')-> | 381 | $messages_input = Message::query()->with('vacancies')->with('user_from')-> |
369 | Where('to_user_id', $user_id)->OrderByDesc('created_at'); | 382 | Where('to_user_id', $user_id)->OrderByDesc('created_at'); |
370 | 383 | ||
371 | $messages_output = Message::query()->with('vacancies')-> | 384 | $messages_output = Message::query()->with('vacancies')-> |
372 | with('user_to')->where('user_id', $user_id)-> | 385 | with('user_to')->where('user_id', $user_id)-> |
373 | OrderByDesc('created_at'); | 386 | OrderByDesc('created_at'); |
374 | 387 | ||
375 | 388 | ||
376 | $count_input = $messages_input->count(); | 389 | $count_input = $messages_input->count(); |
377 | $count_output = $messages_output->count(); | 390 | $count_output = $messages_output->count(); |
378 | 391 | ||
379 | if ($type_message == 'input') { | 392 | if ($type_message == 'input') { |
380 | $messages = $messages_input->paginate(5); | 393 | $messages = $messages_input->paginate(5); |
381 | } | 394 | } |
382 | 395 | ||
383 | if ($type_message == 'output') { | 396 | if ($type_message == 'output') { |
384 | $messages = $messages_output->paginate(5); | 397 | $messages = $messages_output->paginate(5); |
385 | } | 398 | } |
386 | 399 | ||
387 | // Вернуть все 100% | 400 | // Вернуть все 100% |
388 | return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); | 401 | return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); |
389 | } | 402 | } |
390 | 403 | ||
391 | // Избранный | 404 | // Избранный |
392 | public function favorite() | 405 | public function favorite() |
393 | { | 406 | { |
394 | return view('workers.favorite'); | 407 | return view('workers.favorite'); |
395 | } | 408 | } |
396 | 409 | ||
397 | // Сменить пароль | 410 | // Сменить пароль |
398 | public function new_password() | 411 | public function new_password() |
399 | { | 412 | { |
400 | $email = Auth()->user()->email; | 413 | $email = Auth()->user()->email; |
401 | return view('workers.new_password', compact('email')); | 414 | return view('workers.new_password', compact('email')); |
402 | } | 415 | } |
403 | 416 | ||
404 | // Обновление пароля | 417 | // Обновление пароля |
405 | public function save_new_password(Request $request) { | 418 | public function save_new_password(Request $request) { |
406 | $use = Auth()->user(); | 419 | $use = Auth()->user(); |
407 | $request->validate([ | 420 | $request->validate([ |
408 | 'password' => 'required|string', | 421 | 'password' => 'required|string', |
409 | 'new_password' => 'required|string', | 422 | 'new_password' => 'required|string', |
410 | 'new_password2' => 'required|string' | 423 | 'new_password2' => 'required|string' |
411 | ]); | 424 | ]); |
412 | 425 | ||
413 | if ($request->get('new_password') == $request->get('new_password2')) | 426 | if ($request->get('new_password') == $request->get('new_password2')) |
414 | if ($request->get('password') !== $request->get('new_password')) { | 427 | if ($request->get('password') !== $request->get('new_password')) { |
415 | $credentials = $request->only('email', 'password'); | 428 | $credentials = $request->only('email', 'password'); |
416 | if (Auth::attempt($credentials, $request->has('save_me'))) { | 429 | if (Auth::attempt($credentials, $request->has('save_me'))) { |
417 | 430 | ||
418 | if (!is_null($use->email_verified_at)){ | 431 | if (!is_null($use->email_verified_at)){ |
419 | 432 | ||
420 | $user_data = User_Model::find($use->id); | 433 | $user_data = User_Model::find($use->id); |
421 | $user_data->update([ | 434 | $user_data->update([ |
422 | 'password' => Hash::make($request->get('new_password')), | 435 | 'password' => Hash::make($request->get('new_password')), |
423 | 'pubpassword' => base64_encode($request->get('new_password')), | 436 | 'pubpassword' => base64_encode($request->get('new_password')), |
424 | ]); | 437 | ]); |
425 | return redirect() | 438 | return redirect() |
426 | ->route('worker.new_password') | 439 | ->route('worker.new_password') |
427 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); | 440 | ->with('success', 'Поздравляю! Вы обновили свой пароль!'); |
428 | } | 441 | } |
429 | 442 | ||
430 | return redirect() | 443 | return redirect() |
431 | ->route('worker.new_password') | 444 | ->route('worker.new_password') |
432 | ->withError('Данная учетная запись не было верифицированна!'); | 445 | ->withError('Данная учетная запись не было верифицированна!'); |
433 | } | 446 | } |
434 | } | 447 | } |
435 | 448 | ||
436 | return redirect() | 449 | return redirect() |
437 | ->route('worker.new_password') | 450 | ->route('worker.new_password') |
438 | ->withErrors('Не совпадение данных, обновите пароли!'); | 451 | ->withErrors('Не совпадение данных, обновите пароли!'); |
439 | } | 452 | } |
440 | 453 | ||
441 | // Удаление профиля форма | 454 | // Удаление профиля форма |
442 | public function delete_profile() | 455 | public function delete_profile() |
443 | { | 456 | { |
444 | $login = Auth()->user()->email; | 457 | $login = Auth()->user()->email; |
445 | return view('workers.delete_profile', compact('login')); | 458 | return view('workers.delete_profile', compact('login')); |
446 | } | 459 | } |
447 | 460 | ||
448 | // Удаление профиля код | 461 | // Удаление профиля код |
449 | public function delete_profile_result(Request $request) { | 462 | public function delete_profile_result(Request $request) { |
450 | $Answer = $request->all(); | 463 | $Answer = $request->all(); |
451 | $user_id = Auth()->user()->id; | 464 | $user_id = Auth()->user()->id; |
452 | $request->validate([ | 465 | $request->validate([ |
453 | 'password' => 'required|string', | 466 | 'password' => 'required|string', |
454 | ]); | 467 | ]); |
455 | 468 | ||
456 | $credentials = $request->only('email', 'password'); | 469 | $credentials = $request->only('email', 'password'); |
457 | if (Auth::attempt($credentials)) { | 470 | if (Auth::attempt($credentials)) { |
458 | Auth::logout(); | 471 | Auth::logout(); |
459 | $it = User_Model::find($user_id); | 472 | $it = User_Model::find($user_id); |
460 | $it->delete(); | 473 | $it->delete(); |
461 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); | 474 | return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); |
462 | } else { | 475 | } else { |
463 | return redirect()->route('worker.delete_profile') | 476 | return redirect()->route('worker.delete_profile') |
464 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); | 477 | ->withErrors( 'Неверный пароль! Нужен корректный пароль'); |
465 | } | 478 | } |
466 | } | 479 | } |
467 | 480 | ||
468 | // Регистрация соискателя | 481 | // Регистрация соискателя |
469 | public function register_worker(Request $request) | 482 | public function register_worker(Request $request) |
470 | { | 483 | { |
471 | $params = $request->all(); | 484 | $params = $request->all(); |
472 | $params['is_worker'] = 1; | 485 | $params['is_worker'] = 1; |
473 | 486 | ||
474 | $rules = [ | 487 | $rules = [ |
475 | 'surname' => ['required', 'string', 'max:255'], | 488 | 'surname' => ['required', 'string', 'max:255'], |
476 | 'name_man' => ['required', 'string', 'max:255'], | 489 | 'name_man' => ['required', 'string', 'max:255'], |
477 | 'email' => ['required', 'email', 'max:255', 'unique:users'], | 490 | 'email' => ['required', 'email', 'max:255', 'unique:users'], |
478 | 'password' => ['required', 'string', 'min:6'] | 491 | 'password' => ['required', 'string', 'min:6'] |
479 | ]; | 492 | ]; |
480 | 493 | ||
481 | $messages = [ | 494 | $messages = [ |
482 | 'required' => 'Укажите обязательное поле', | 495 | 'required' => 'Укажите обязательное поле', |
483 | 'min' => [ | 496 | 'min' => [ |
484 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 497 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
485 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 498 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
486 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 499 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
487 | ], | 500 | ], |
488 | 'max' => [ | 501 | 'max' => [ |
489 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 502 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
490 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 503 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
491 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 504 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
492 | ] | 505 | ] |
493 | ]; | 506 | ]; |
494 | 507 | ||
495 | $email = $request->get('email'); | 508 | $email = $request->get('email'); |
496 | if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { | 509 | if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { |
497 | return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); | 510 | return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); |
498 | } | 511 | } |
499 | 512 | ||
500 | if ($request->get('password') !== $request->get('confirmed')){ | 513 | if ($request->get('password') !== $request->get('confirmed')){ |
501 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); | 514 | return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); |
502 | } | 515 | } |
503 | 516 | ||
504 | if (strlen($request->get('password')) < 6) { | 517 | if (strlen($request->get('password')) < 6) { |
505 | return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); | 518 | return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); |
506 | } | 519 | } |
507 | 520 | ||
508 | /*$haystack = $request->get('password'); | 521 | /*$haystack = $request->get('password'); |
509 | 522 | ||
510 | $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); | 523 | $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); |
511 | $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', | 524 | $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', |
512 | 'X', 'C', 'V', 'B', 'N', 'M'); | 525 | 'X', 'C', 'V', 'B', 'N', 'M'); |
513 | $lenpwd_bool = true; | 526 | $lenpwd_bool = true; |
514 | $spec_bool = false; | 527 | $spec_bool = false; |
515 | $alpha_bool = false; | 528 | $alpha_bool = false; |
516 | 529 | ||
517 | if (strlen($haystack) < 8) $lenpwd_bool = false; | 530 | if (strlen($haystack) < 8) $lenpwd_bool = false; |
518 | 531 | ||
519 | foreach ($specsumbol as $it) { | 532 | foreach ($specsumbol as $it) { |
520 | if (strpos($haystack, $it) !== false) { | 533 | if (strpos($haystack, $it) !== false) { |
521 | $spec_bool = true; | 534 | $spec_bool = true; |
522 | } | 535 | } |
523 | } | 536 | } |
524 | 537 | ||
525 | foreach ($alpha as $it) { | 538 | foreach ($alpha as $it) { |
526 | if (strpos($haystack, $it) !== false) { | 539 | if (strpos($haystack, $it) !== false) { |
527 | $alpha_bool = true; | 540 | $alpha_bool = true; |
528 | } | 541 | } |
529 | } | 542 | } |
530 | 543 | ||
531 | if ((!$spec_bool) || (!$alpha_bool)) { | 544 | if ((!$spec_bool) || (!$alpha_bool)) { |
532 | return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); | 545 | return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); |
533 | }*/ | 546 | }*/ |
534 | 547 | ||
535 | if (($request->has('politik')) && ($request->get('politik') == 1)) { | 548 | if (($request->has('politik')) && ($request->get('politik') == 1)) { |
536 | $validator = Validator::make($params, $rules, $messages); | 549 | $validator = Validator::make($params, $rules, $messages); |
537 | 550 | ||
538 | if ($validator->fails()) { | 551 | if ($validator->fails()) { |
539 | return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); | 552 | return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); |
540 | } else { | 553 | } else { |
541 | //dd($params); | 554 | //dd($params); |
542 | $user = $this->create($params); | 555 | $user = $this->create($params); |
543 | event(new Registered($user)); | 556 | event(new Registered($user)); |
544 | Auth::guard()->login($user); | 557 | Auth::guard()->login($user); |
545 | } | 558 | } |
546 | if ($user) { | 559 | if ($user) { |
547 | return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; | 560 | return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; |
548 | } else { | 561 | } else { |
549 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); | 562 | return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); |
550 | } | 563 | } |
551 | 564 | ||
552 | } else { | 565 | } else { |
553 | return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!")); | 566 | return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!")); |
554 | } | 567 | } |
555 | } | 568 | } |
556 | 569 | ||
557 | // Звездная оценка и ответ | 570 | // Звездная оценка и ответ |
558 | public function stars_answer(Request $request) { | 571 | public function stars_answer(Request $request) { |
559 | $params = $request->all(); | 572 | $params = $request->all(); |
560 | $rules = [ | 573 | $rules = [ |
561 | 'message' => ['required', 'string', 'max:255'], | 574 | 'message' => ['required', 'string', 'max:255'], |
562 | ]; | 575 | ]; |
563 | 576 | ||
564 | $messages = [ | 577 | $messages = [ |
565 | 'required' => 'Укажите обязательное поле', | 578 | 'required' => 'Укажите обязательное поле', |
566 | 'min' => [ | 579 | 'min' => [ |
567 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 580 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
568 | 'integer' => 'Поле «:attribute» должно быть :min или больше', | 581 | 'integer' => 'Поле «:attribute» должно быть :min или больше', |
569 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 582 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
570 | ], | 583 | ], |
571 | 'max' => [ | 584 | 'max' => [ |
572 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 585 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
573 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', | 586 | 'integer' => 'Поле «:attribute» должно быть :max или меньше', |
574 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 587 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
575 | ] | 588 | ] |
576 | ]; | 589 | ]; |
577 | $response_worker = ResponseWork::create($params); | 590 | $response_worker = ResponseWork::create($params); |
578 | return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); | 591 | return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); |
579 | } | 592 | } |
580 | 593 | ||
581 | public function TestWorker() | 594 | public function TestWorker() |
582 | { | 595 | { |
583 | $Use = new User(); | 596 | $Use = new User(); |
584 | 597 | ||
585 | $Code_user = $Use->create([ | 598 | $Code_user = $Use->create([ |
586 | 'name' => 'surname name_man', | 599 | 'name' => 'surname name_man', |
587 | 'name_man' => 'name_man', | 600 | 'name_man' => 'name_man', |
588 | 'surname' => 'surname', | 601 | 'surname' => 'surname', |
589 | 'surname2' => 'surname2', | 602 | 'surname2' => 'surname2', |
590 | 'subscribe_email' => '1', | 603 | 'subscribe_email' => '1', |
591 | 'email' => 'email@mail.com', | 604 | 'email' => 'email@mail.com', |
592 | 'telephone' => '1234567890', | 605 | 'telephone' => '1234567890', |
593 | 'password' => Hash::make('password'), | 606 | 'password' => Hash::make('password'), |
594 | 'pubpassword' => base64_encode('password'), | 607 | 'pubpassword' => base64_encode('password'), |
595 | 'email_verified_at' => Carbon::now(), | 608 | 'email_verified_at' => Carbon::now(), |
596 | 'is_worker' => 1, | 609 | 'is_worker' => 1, |
597 | ]); | 610 | ]); |
598 | 611 | ||
599 | if ($Code_user->id > 0) { | 612 | if ($Code_user->id > 0) { |
600 | $Worker = new Worker(); | 613 | $Worker = new Worker(); |
601 | $Worker->user_id = $Code_user->id; | 614 | $Worker->user_id = $Code_user->id; |
602 | $Worker->position_work = 1; //'job_titles'; | 615 | $Worker->position_work = 1; //'job_titles'; |
603 | $Worker->email = 'email@email.com'; | 616 | $Worker->email = 'email@email.com'; |
604 | $Worker->telephone = '1234567890'; | 617 | $Worker->telephone = '1234567890'; |
605 | $status = $Worker->save(); | 618 | $status = $Worker->save(); |
606 | 619 | ||
607 | $Title_Worker = new Title_worker(); | 620 | $Title_Worker = new Title_worker(); |
608 | $Title_Worker->worker_id = $Worker->id; | 621 | $Title_Worker->worker_id = $Worker->id; |
609 | $Title_Worker->job_title_id = 1; | 622 | $Title_Worker->job_title_id = 1; |
610 | $Title_Worker->save(); | 623 | $Title_Worker->save(); |
611 | } | 624 | } |
612 | } | 625 | } |
613 | 626 | ||
614 | // Создание пользователя | 627 | // Создание пользователя |
615 | protected function create(array $data) | 628 | protected function create(array $data) |
616 | { | 629 | { |
617 | $Use = new User(); | 630 | $Use = new User(); |
618 | 631 | ||
619 | $Code_user = $Use->create([ | 632 | $Code_user = $Use->create([ |
620 | 'name' => $data['surname']." ".$data['name_man'], | 633 | 'name' => $data['surname']." ".$data['name_man'], |
621 | 'name_man' => $data['name_man'], | 634 | 'name_man' => $data['name_man'], |
622 | 'surname' => $data['surname'], | 635 | 'surname' => $data['surname'], |
623 | 'surname2' => $data['surname2'], | 636 | 'surname2' => $data['surname2'], |
624 | 'subscribe_email' => $data['email'], | 637 | 'subscribe_email' => $data['email'], |
625 | 'email' => $data['email'], | 638 | 'email' => $data['email'], |
626 | 'telephone' => $data['telephone'], | 639 | 'telephone' => $data['telephone'], |
627 | 'password' => Hash::make($data['password']), | 640 | 'password' => Hash::make($data['password']), |
628 | 'pubpassword' => base64_encode($data['password']), | 641 | 'pubpassword' => base64_encode($data['password']), |
629 | 'email_verified_at' => Carbon::now(), | 642 | 'email_verified_at' => Carbon::now(), |
630 | 'is_worker' => $data['is_worker'], | 643 | 'is_worker' => $data['is_worker'], |
631 | ]); | 644 | ]); |
632 | 645 | ||
633 | if ($Code_user->id > 0) { | 646 | if ($Code_user->id > 0) { |
634 | $Worker = new Worker(); | 647 | $Worker = new Worker(); |
635 | $Worker->user_id = $Code_user->id; | 648 | $Worker->user_id = $Code_user->id; |
636 | $Worker->position_work = $data['job_titles']; | 649 | $Worker->position_work = $data['job_titles']; |
637 | $Worker->email = $data['email']; | 650 | $Worker->email = $data['email']; |
638 | $Worker->telephone = $data['telephone']; | 651 | $Worker->telephone = $data['telephone']; |
639 | $Worker->save(); | 652 | $Worker->save(); |
640 | 653 | ||
641 | if (isset($Worker->id)) { | 654 | if (isset($Worker->id)) { |
642 | $Title_Worker = new Title_worker(); | 655 | $Title_Worker = new Title_worker(); |
643 | $Title_Worker->worker_id = $Worker->id; | 656 | $Title_Worker->worker_id = $Worker->id; |
644 | $Title_Worker->job_title_id = $data['job_titles']; | 657 | $Title_Worker->job_title_id = $data['job_titles']; |
645 | $Title_Worker->save(); | 658 | $Title_Worker->save(); |
646 | } | 659 | } |
647 | 660 | ||
648 | return $Code_user; | 661 | return $Code_user; |
649 | } | 662 | } |
650 | } | 663 | } |
651 | 664 | ||
652 | // Вакансии избранные | 665 | // Вакансии избранные |
653 | public function colorado(Request $request) { | 666 | public function colorado(Request $request) { |
654 | $IP_address = RusDate::ip_addr_client(); | 667 | $IP_address = RusDate::ip_addr_client(); |
655 | $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); | 668 | $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); |
656 | 669 | ||
657 | if ($Arr->count()) { | 670 | if ($Arr->count()) { |
658 | $A = Array(); | 671 | $A = Array(); |
659 | foreach ($Arr as $it) { | 672 | foreach ($Arr as $it) { |
660 | $A[] = $it->code_record; | 673 | $A[] = $it->code_record; |
661 | } | 674 | } |
662 | 675 | ||
663 | $Query = Ad_employer::query()->whereIn('id', $A); | 676 | $Query = Ad_employer::query()->whereIn('id', $A); |
664 | } else { | 677 | } else { |
665 | $Query = Ad_employer::query()->where('id', '=', '0'); | 678 | $Query = Ad_employer::query()->where('id', '=', '0'); |
666 | } | 679 | } |
667 | 680 | ||
668 | $Query = $Query->with('jobs')-> | 681 | $Query = $Query->with('jobs')-> |
669 | with('cat')-> | 682 | with('cat')-> |
670 | with('employer')-> | 683 | with('employer')-> |
671 | whereHas('jobs_code', function ($query) use ($request) { | 684 | whereHas('jobs_code', function ($query) use ($request) { |
672 | if ($request->ajax()) { | 685 | if ($request->ajax()) { |
673 | if (null !== ($request->get('job'))) { | 686 | if (null !== ($request->get('job'))) { |
674 | $query->where('job_title_id', $request->get('job')); | 687 | $query->where('job_title_id', $request->get('job')); |
675 | } | 688 | } |
676 | } | 689 | } |
677 | })->select('ad_employers.*'); | 690 | })->select('ad_employers.*'); |
678 | 691 | ||
679 | $Job_title = Job_title::query()->OrderBy('name')->get(); | 692 | $Job_title = Job_title::query()->OrderBy('name')->get(); |
680 | 693 | ||
681 | $Query_count = $Query->count(); | 694 | $Query_count = $Query->count(); |
682 | 695 | ||
683 | $Query = $Query->OrderBy('updated_at')->paginate(3); | 696 | $Query = $Query->OrderBy('updated_at')->paginate(3); |
684 | 697 | ||
685 | return view('workers.favorite', compact('Query', | 698 | return view('workers.favorite', compact('Query', |
686 | 'Query_count', | 699 | 'Query_count', |
687 | 'Job_title')); | 700 | 'Job_title')); |
688 | 701 | ||
689 | } | 702 | } |
690 | 703 | ||
691 | //Переписка | 704 | //Переписка |
692 | public function dialog(User_Model $user1, User_Model $user2) { | 705 | public function dialog(User_Model $user1, User_Model $user2) { |
693 | if (isset($user2->id)) { | 706 | if (isset($user2->id)) { |
694 | $companion = User_Model::query()->with('workers')-> | 707 | $companion = User_Model::query()->with('workers')-> |
695 | with('employers')-> | 708 | with('employers')-> |
696 | where('id', $user2->id)->first(); | 709 | where('id', $user2->id)->first(); |
697 | } | 710 | } |
698 | 711 | ||
699 | $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) { | 712 | $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) { |
700 | $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); | 713 | $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); |
701 | })->orWhere(function($query) use ($user1, $user2) { | 714 | })->orWhere(function($query) use ($user1, $user2) { |
702 | $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); | 715 | $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); |
703 | })->OrderBy('created_at')->get(); | 716 | })->OrderBy('created_at')->get(); |
704 | 717 | ||
705 | $id_vac = null; | 718 | $id_vac = null; |
706 | foreach ($Messages as $it) { | 719 | foreach ($Messages as $it) { |
707 | if (isset($it->response)) { | 720 | if (isset($it->response)) { |
708 | foreach ($it->response as $r) { | 721 | foreach ($it->response as $r) { |
709 | if (isset($r->ad_employer_id)) { | 722 | if (isset($r->ad_employer_id)) { |
710 | $id_vac = $r->ad_employer_id; | 723 | $id_vac = $r->ad_employer_id; |
711 | break; | 724 | break; |
712 | } | 725 | } |
713 | } | 726 | } |
714 | } | 727 | } |
715 | if (!is_null($id_vac)) break; | 728 | if (!is_null($id_vac)) break; |
716 | } | 729 | } |
717 | 730 | ||
718 | $ad_employer = null; | 731 | $ad_employer = null; |
719 | if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); | 732 | if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); |
720 | $sender = $user1; | 733 | $sender = $user1; |
721 | 734 | ||
722 | return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); | 735 | return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); |
723 | } | 736 | } |
724 | 737 | ||
725 | // Даунылоады | 738 | // Даунылоады |
726 | public function download(Worker $worker) { | 739 | public function download(Worker $worker) { |
727 | $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; | 740 | $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; |
728 | view()->share('house',$arr_house); | 741 | view()->share('house',$arr_house); |
729 | $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); | 742 | $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); |
730 | return $pdf->stream(); | 743 | return $pdf->stream(); |
731 | } | 744 | } |
732 | 745 | ||
733 | // Поднятие анкеты | 746 | // Поднятие анкеты |
734 | public function up(Worker $worker) { | 747 | public function up(Worker $worker) { |
735 | $worker->updated_at = Carbon::now(); | 748 | $worker->updated_at = Carbon::now(); |
736 | $worker->save(); | 749 | $worker->save(); |
737 | // 0 | 750 | // 0 |
738 | return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); | 751 | return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); |
739 | } | 752 | } |
740 | 753 | ||
741 | // Форма сертификате | 754 | // Форма сертификате |
742 | public function new_sertificate(Worker $worker) { | 755 | public function new_sertificate(Worker $worker) { |
743 | return view('workers.sertificate_add', compact('worker')); | 756 | return view('workers.sertificate_add', compact('worker')); |
744 | } | 757 | } |
745 | 758 | ||
746 | // Добавление сертификата | 759 | // Добавление сертификата |
747 | public function add_serificate(SertificationRequest $request) { | 760 | public function add_serificate(SertificationRequest $request) { |
748 | $params = $request->all(); | 761 | $params = $request->all(); |
749 | 762 | ||
750 | $Sertificate = new sertification(); | 763 | $Sertificate = new sertification(); |
751 | $Sertificate->create($params); | 764 | $Sertificate->create($params); |
752 | $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get(); | 765 | $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get(); |
753 | return redirect()->route('worker.cabinet'); | 766 | return redirect()->route('worker.cabinet'); |
754 | //return view('ajax.documents', compact('Docs')); | 767 | //return view('ajax.documents', compact('Docs')); |
755 | } | 768 | } |
756 | 769 | ||
757 | // Удалить сертификат | 770 | // Удалить сертификат |
758 | public function delete_sertificate(sertification $doc) { | 771 | public function delete_sertificate(sertification $doc) { |
759 | $doc->delete(); | 772 | $doc->delete(); |
760 | 773 | ||
761 | return redirect()->route('worker.cabinet'); | 774 | return redirect()->route('worker.cabinet'); |
762 | } | 775 | } |
763 | 776 | ||
764 | // Редактирование сертификата | 777 | // Редактирование сертификата |
765 | public function edit_sertificate(Worker $worker, sertification $doc) { | 778 | public function edit_sertificate(Worker $worker, sertification $doc) { |
766 | return view('workers.sertificate_edit', compact('doc', 'worker')); | 779 | return view('workers.sertificate_edit', compact('doc', 'worker')); |
767 | } | 780 | } |
768 | 781 | ||
769 | // Редактирование обновление сертификата | 782 | // Редактирование обновление сертификата |
770 | public function update_serificate(SertificationRequest $request, sertification $doc) { | 783 | public function update_serificate(SertificationRequest $request, sertification $doc) { |
771 | $all = $request->all(); | 784 | $all = $request->all(); |
772 | $doc->worker_id = $all['worker_id']; | 785 | $doc->worker_id = $all['worker_id']; |
773 | $doc->name = $all['name']; | 786 | $doc->name = $all['name']; |
774 | $doc->end_begin = $all['end_begin']; | 787 | $doc->end_begin = $all['end_begin']; |
775 | $doc->save(); | 788 | $doc->save(); |
776 | 789 | ||
777 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); | 790 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); |
778 | } | 791 | } |
779 | 792 | ||
780 | public function delete_add_diplom(Request $request, Worker $worker) { | 793 | public function delete_add_diplom(Request $request, Worker $worker) { |
781 | $infoblok_id = $request->get('infoblok_id'); | 794 | $infoblok_id = $request->get('infoblok_id'); |
782 | 795 | ||
783 | if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0) | 796 | if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0) |
784 | $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete(); | 797 | $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete(); |
785 | else { | 798 | else { |
786 | $params['infoblok_id'] = $infoblok_id; | 799 | $params['infoblok_id'] = $infoblok_id; |
787 | $params['worker_id'] = $worker->id; | 800 | $params['worker_id'] = $worker->id; |
788 | $params['status'] = $request->get('val'); | 801 | $params['status'] = $request->get('val'); |
789 | $id = Dop_info::create($params); | 802 | $id = Dop_info::create($params); |
790 | //$id = $worker->infobloks()->sync([$infoblok_id]); | 803 | //$id = $worker->infobloks()->sync([$infoblok_id]); |
791 | } | 804 | } |
792 | 805 | ||
793 | //$Infoblocks = infobloks::query()->get(); | 806 | //$Infoblocks = infobloks::query()->get(); |
794 | return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks')); | 807 | return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks')); |
795 | } | 808 | } |
796 | 809 | ||
797 | 810 | ||
798 | 811 | ||
799 | // Добавление диплома | 812 | // Добавление диплома |
800 | public function add_diplom_ajax(Request $request) { | 813 | public function add_diplom_ajax(Request $request) { |
801 | // конец | 814 | // конец |
802 | $params = $request->all(); | 815 | $params = $request->all(); |
803 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); | 816 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); |
804 | 817 | ||
805 | if ($count == 0) $dop_info = Dop_info::create($params); | 818 | if ($count == 0) $dop_info = Dop_info::create($params); |
806 | $Infoblocks = infobloks::query()->get(); | 819 | $Infoblocks = infobloks::query()->get(); |
807 | $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); | 820 | $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); |
808 | $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); | 821 | $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); |
809 | return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); | 822 | return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); |
810 | } | 823 | } |
811 | 824 | ||
812 | // Добавление диплома без ajax | 825 | // Добавление диплома без ajax |
813 | public function add_diplom(Worker $worker) { | 826 | public function add_diplom(Worker $worker) { |
814 | $worker_id = $worker->id; | 827 | $worker_id = $worker->id; |
815 | $Infoblocks = infobloks::query()->get(); | 828 | $Infoblocks = infobloks::query()->get(); |
816 | return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); | 829 | return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); |
817 | } | 830 | } |
818 | // Сохранить | 831 | // Сохранить |
819 | // Сохраняю диплом | 832 | // Сохраняю диплом |
820 | public function add_diplom_save(Request $request) { | 833 | public function add_diplom_save(Request $request) { |
821 | $params = $request->all(); | 834 | $params = $request->all(); |
822 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); | 835 | $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); |
823 | if ($count == 0) $dop_info = Dop_info::create($params); | 836 | if ($count == 0) $dop_info = Dop_info::create($params); |
824 | return redirect()->route('worker.cabinet'); | 837 | return redirect()->route('worker.cabinet'); |
825 | } | 838 | } |
826 | 839 | ||
827 | // Добавление стандартного документа | 840 | // Добавление стандартного документа |
828 | public function add_document(Worker $worker) { | 841 | public function add_document(Worker $worker) { |
829 | return view('workers.docs', compact('worker')); | 842 | return view('workers.docs', compact('worker')); |
830 | } | 843 | } |
831 | 844 | ||
832 | //Сохранение стандартого документа | 845 | //Сохранение стандартого документа |
833 | public function add_document_save(DocumentsRequest $request) { | 846 | public function add_document_save(DocumentsRequest $request) { |
834 | $params = $request->all(); | 847 | $params = $request->all(); |
835 | $place_work = place_works::create($params); | 848 | $place_work = place_works::create($params); |
836 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!'); | 849 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!'); |
837 | } | 850 | } |
838 | 851 | ||
839 | // Редактирование документа | 852 | // Редактирование документа |
840 | public function edit_document(place_works $doc, Worker $worker) { | 853 | public function edit_document(place_works $doc, Worker $worker) { |
841 | return view('workers.docs-edit', compact('doc', 'worker')); | 854 | return view('workers.docs-edit', compact('doc', 'worker')); |
842 | } | 855 | } |
843 | 856 | ||
844 | //Сохранение отредактированного документа | 857 | //Сохранение отредактированного документа |
845 | public function edit_document_save(DocumentsRequest $request, place_works $doc) { | 858 | public function edit_document_save(DocumentsRequest $request, place_works $doc) { |
846 | $params = $request->all(); | 859 | $params = $request->all(); |
847 | $doc->update($params); | 860 | $doc->update($params); |
848 | 861 | ||
849 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); | 862 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); |
850 | } | 863 | } |
851 | 864 | ||
852 | // Удаление документа | 865 | // Удаление документа |
853 | public function delete_document(place_works $doc) { | 866 | public function delete_document(place_works $doc) { |
854 | $doc->delete(); | 867 | $doc->delete(); |
855 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); | 868 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); |
856 | } | 869 | } |
857 | 870 | ||
858 | //Отправка нового сообщения | 871 | //Отправка нового сообщения |
859 | public function new_message(Request $request) { | 872 | public function new_message(Request $request) { |
860 | $params = $request->all(); | 873 | $params = $request->all(); |
861 | 874 | ||
862 | $id = $params['send_user_id']; | 875 | $id = $params['send_user_id']; |
863 | $message = new Message(); | 876 | $message = new Message(); |
864 | $message->user_id = $params['send_user_id']; | 877 | $message->user_id = $params['send_user_id']; |
865 | $message->to_user_id = $params['send_to_user_id']; | 878 | $message->to_user_id = $params['send_to_user_id']; |
866 | $message->title = $params['send_title']; | 879 | $message->title = $params['send_title']; |
867 | $message->text = $params['send_text']; | 880 | $message->text = $params['send_text']; |
868 | if ($request->has('send_file')) { | 881 | if ($request->has('send_file')) { |
869 | $message->file = $request->file('send_file')->store("worker/$id", 'public'); | 882 | $message->file = $request->file('send_file')->store("worker/$id", 'public'); |
870 | } | 883 | } |
871 | $message->flag_new = 1; | 884 | $message->flag_new = 1; |
872 | $id_message = $message->save(); | 885 | $id_message = $message->save(); |
873 | 886 | ||
874 | $data['message_id'] = $id_message; | 887 | $data['message_id'] = $id_message; |
875 | $data['ad_employer_id'] = $params['send_vacancy']; | 888 | $data['ad_employer_id'] = $params['send_vacancy']; |
876 | $data['job_title_id'] = $params['send_job_title_id']; | 889 | $data['job_title_id'] = $params['send_job_title_id']; |
877 | $data['flag'] = 1; | 890 | $data['flag'] = 1; |
878 | $ad_responce = ad_response::create($data); | 891 | $ad_responce = ad_response::create($data); |
879 | return redirect()->route('worker.messages', ['type_message' => 'output']); | 892 | return redirect()->route('worker.messages', ['type_message' => 'output']); |
880 | } | 893 | } |
881 | 894 | ||
882 | // Информация о предыдущих компаниях | 895 | // Информация о предыдущих компаниях |
883 | public function new_prev_company(Worker $worker) { | 896 | public function new_prev_company(Worker $worker) { |
884 | return view('workers.prev_company_form', compact('worker')); | 897 | return view('workers.prev_company_form', compact('worker')); |
885 | } | 898 | } |
886 | 899 | ||
887 | // Добавление контакта компании | 900 | // Добавление контакта компании |
888 | public function add_prev_company(PrevCompanyRequest $request) { | 901 | public function add_prev_company(PrevCompanyRequest $request) { |
889 | // Возвращение параметров | 902 | // Возвращение параметров |
890 | $all = $request->all(); | 903 | $all = $request->all(); |
891 | $PrevCompany = PrevCompany::create($all); | 904 | $PrevCompany = PrevCompany::create($all); |
892 | 905 | ||
893 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись'); | 906 | return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись'); |
894 | } | 907 | } |
resources/views/ajax/resume_1.blade.php
1 | 1 | ||
2 | @if ($resumes->count()) | 2 | <div class="main__resume-base-body-item"> |
3 | @foreach ($resumes as $res) | 3 | <div class="main__resume-base-body-item-buttons"> |
4 | <div class="main__resume-base-body-item"> | 4 | <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 }}"> |
5 | <div class="main__resume-base-body-item-buttons"> | 5 | <svg> |
6 | <button type="button" class="like js-toggle js_box_favorites <?=\App\Classes\RusDate::selected_item($res->id);?>" data-val="{{ $res->id }}"> | 6 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> |
7 | <svg> | 7 | </svg> |
8 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> | 8 | </button> |
9 | </svg> | 9 | @guest |
10 | </button> | 10 | <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' |
11 | <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}'> | 11 | class="chat js-toggle js_it_button"> |
12 | <svg> | ||
13 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> | ||
14 | </svg> | ||
15 | </button> | ||
16 | @else | ||
17 | @if (App\Classes\StatusUser::Status()==0) | ||
18 | @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message)) | ||
19 | <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}'> | ||
20 | <svg> | ||
21 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> | ||
22 | </svg> | ||
23 | </button> | ||
24 | @endif | ||
25 | @else | ||
26 | <button type="button" data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' | ||
27 | class="chat js-toggle js_it_button"> | ||
12 | <svg> | 28 | <svg> |
13 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> | 29 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> |
14 | </svg> | 30 | </svg> |
15 | </button> | 31 | </button> @endif |
32 | @endif | ||
33 | </div> | ||
34 | <div class="main__resume-base-body-item-wrapper"> | ||
35 | <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"> | ||
36 | <div class="main__resume-base-body-item-inner"> | ||
37 | <div> | ||
38 | <b>Статус</b> | ||
39 | <span>{{ $status_work[$res->status_work] }}</span> | ||
16 | </div> | 40 | </div> |
17 | <div class="main__resume-base-body-item-wrapper"> | 41 | <div> |
18 | <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"> | 42 | <b>Имя работника</b> |
19 | <div class="main__resume-base-body-item-inner"> | 43 | <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> |
20 | <div> | ||
21 | <b>Статус</b> | ||
22 | <span>{{ $status_work[$res->status_work] }}</span> | ||
23 | </div> | ||
24 | <div> | ||
25 | <b>Имя работника</b> | ||
26 | <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> | ||
27 | </div> | ||
28 | <div> | ||
29 | <b>Номер телефона</b> | ||
30 | <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span> | ||
31 | </div> | ||
32 | <div> | ||
33 | <b>Электронный адрес</b> | ||
34 | <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> | ||
35 | </div> | ||
36 | <div> | ||
37 | <b>Город проживания</b> | ||
38 | <span>{{ $res->city }}</span> | ||
39 | </div> | ||
40 | <div> | ||
41 | <b>Опыт работы</b> | ||
42 | <span>{{ $res->experience }}</span> | ||
43 | </div> | ||
44 | </div> | ||
45 | </div> | 44 | </div> |
46 | <div class="main__employer-page-two-item-tags"> | 45 | <div> |
47 | @if ($res->job_titles->count()) | 46 | <b>Номер телефона</b> |
48 | @if (isset($res->job_titles)) | 47 | <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span> |
49 | @foreach ($res->job_titles as $key => $j) | 48 | </div> |
50 | <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span> | 49 | <div> |
51 | @endforeach | 50 | <b>Электронный адрес</b> |
52 | @endif | 51 | <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> |
53 | @endif | 52 | </div> |
53 | <div> | ||
54 | <b>Город проживания</b> | ||
55 | <span>{{ $res->city }}</span> |
resources/views/employers/add_vacancy_danger.blade.php
File was created | 1 | @extends('layout.frontend', ['title' => 'База данных - РекаМоре']) | |
2 | |||
3 | @section('scripts') | ||
4 | <script> | ||
5 | console.log('Test system'); | ||
6 | $(document).on('click', '.die_black', function() { | ||
7 | var this_ = $(this); | ||
8 | var ajax_ = $('#ajax_flot_div'); | ||
9 | var id_ = this_.attr('data-test'); | ||
10 | var url_ = this_.attr('data-link'); | ||
11 | |||
12 | console.log(url_); | ||
13 | $.ajax({ | ||
14 | type: "GET", | ||
15 | url: url_, | ||
16 | success: function (data) { | ||
17 | console.log('Ответка'); | ||
18 | ajax_.html(data); | ||
19 | }, | ||
20 | headers: { | ||
21 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | ||
22 | }, | ||
23 | error: function (data) { | ||
24 | console.log('Error: ' + data); | ||
25 | } | ||
26 | }); | ||
27 | }); | ||
28 | </script> | ||
29 | @endsection | ||
30 | |||
31 | @section('content') | ||
32 | <section class="cabinet"> | ||
33 | <div class="container"> | ||
34 | <ul class="breadcrumbs cabinet__breadcrumbs"> | ||
35 | <li><a href="{{ route('index') }}">Главная</a></li> | ||
36 | <li><b>Личный кабинет</b></li> | ||
37 | </ul> | ||
38 | <div class="cabinet__wrapper"> | ||
39 | <div class="cabinet__side"> | ||
40 | <div class="cabinet__side-toper"> | ||
41 | @include('employers.emblema') | ||
42 | </div> | ||
43 | @include('employers.menu', ['item' => 2]) | ||
44 | </div> | ||
45 | <div class="cabinet__body"> | ||
46 | <div class="cabinet__body-item"> | ||
47 | <h2 class="title cabinet__title">Добавление вакансии</h2> | ||
48 | </div> | ||
49 | <div class="cabinet__body-item"> | ||
50 | <div class="cabinet__table-header"> | ||
51 | <div><!--_if (isset($it->workers[0]->job_titles[0]->name)) _ $it->workers[0]->job_titles[0]->name }}_else Не указано _endif--> | ||
52 | Нельзя добавить вакансию, прочтите инструкцию для преодоления данной проблемы. | ||
53 | <a style="text-decoration:underline" href="{{ route('page', ['pages' => 'Usloviya-razmescheniya']) }}">Условия размещения</a> | ||
54 | </div> | ||
55 | </div> | ||
56 | </div> | ||
57 | </div> | ||
58 | </section> | ||
59 | </div> | ||
60 | @endsection | ||
61 |
resources/views/employers/bd_resume_danger.blade.php
File was created | 1 | @extends('layout.frontend', ['title' => 'База данных - РекаМоре']) | |
2 | |||
3 | @section('scripts') | ||
4 | <script> | ||
5 | console.log('Test system'); | ||
6 | $(document).on('click', '.die_black', function() { | ||
7 | var this_ = $(this); | ||
8 | var ajax_ = $('#ajax_flot_div'); | ||
9 | var id_ = this_.attr('data-test'); | ||
10 | var url_ = this_.attr('data-link'); | ||
11 | |||
12 | console.log(url_); | ||
13 | $.ajax({ | ||
14 | type: "GET", | ||
15 | url: url_, | ||
16 | success: function (data) { | ||
17 | console.log('Ответка'); | ||
18 | ajax_.html(data); | ||
19 | }, | ||
20 | headers: { | ||
21 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | ||
22 | }, | ||
23 | error: function (data) { | ||
24 | console.log('Error: ' + data); | ||
25 | } | ||
26 | }); | ||
27 | }); | ||
28 | </script> | ||
29 | @endsection | ||
30 | |||
31 | @section('content') | ||
32 | <section class="cabinet"> | ||
33 | <div class="container"> | ||
34 | <ul class="breadcrumbs cabinet__breadcrumbs"> | ||
35 | <li><a href="{{ route('index') }}">Главная</a></li> | ||
36 | <li><b>Личный кабинет</b></li> | ||
37 | </ul> | ||
38 | <div class="cabinet__wrapper"> | ||
39 | <div class="cabinet__side"> | ||
40 | <div class="cabinet__side-toper"> | ||
41 | @include('employers.emblema') | ||
42 | </div> | ||
43 | @include('employers.menu', ['item' => 8]) | ||
44 | </div> | ||
45 | <div class="cabinet__body"> | ||
46 | <div class="cabinet__body-item"> | ||
47 | <h2 class="title cabinet__title">База резюме</h2> | ||
48 | </div> | ||
49 | <div class="cabinet__body-item"> | ||
50 | <div class="cabinet__table-header"> | ||
51 | <div><!--_if (isset($it->workers[0]->job_titles[0]->name)) _ $it->workers[0]->job_titles[0]->name }}_else Не указано _endif--> | ||
52 | Данные нельзя просмотреть, прочтите инструкцию | ||
53 | <a style="text-decoration:underline" href="{{ route('page', ['pages' => 'Usloviya-razmescheniya']) }}">Условия размещения</a> | ||
54 | </div> | ||
55 | </div> | ||
56 | </div> | ||
57 | </div> | ||
58 | </section> | ||
59 | </div> | ||
60 | @endsection | ||
61 |
resources/views/employers/menu.blade.php
1 | <div class="cabinet__side-item"> | 1 | <div class="cabinet__side-item"> |
2 | <div class="cabinet__menu"> | 2 | <div class="cabinet__menu"> |
3 | <button type="button" class="cabinet__menu-toper js-toggle"> | 3 | <button type="button" class="cabinet__menu-toper js-toggle"> |
4 | <span class="cabinet__menu-toper-text"> | 4 | <span class="cabinet__menu-toper-text"> |
5 | <i> | 5 | <i> |
6 | <svg> | 6 | <svg> |
7 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use> | 7 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use> |
8 | </svg> | 8 | </svg> |
9 | </i> | 9 | </i> |
10 | <span>Профиль</span> | 10 | <span>Профиль</span> |
11 | </span> | 11 | </span> |
12 | <i class="cabinet__menu-toper-arrow"> | 12 | <i class="cabinet__menu-toper-arrow"> |
13 | <svg> | 13 | <svg> |
14 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> | 14 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> |
15 | </svg> | 15 | </svg> |
16 | </i> | 16 | </i> |
17 | </button> | 17 | </button> |
18 | <div class="cabinet__menu-body"> | 18 | <div class="cabinet__menu-body"> |
19 | <div class="cabinet__menu-items"> | 19 | <div class="cabinet__menu-items"> |
20 | <a href="{{ route('employer.employer_info') }}" class="cabinet__menu-item @if ($item==0) active @endif"> | 20 | <a href="{{ route('employer.employer_info') }}" class="cabinet__menu-item @if ($item==0) active @endif"> |
21 | <i> | 21 | <i> |
22 | <svg> | 22 | <svg> |
23 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use> | 23 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use> |
24 | </svg> | 24 | </svg> |
25 | </i> | 25 | </i> |
26 | <span>Личные данные</span> | 26 | <span>Личные данные</span> |
27 | </a> | 27 | </a> |
28 | <a href="{{ route('employer.cabinet') }}" class="cabinet__menu-item @if ($item==1) active @endif"> | 28 | <a href="{{ route('employer.cabinet') }}" class="cabinet__menu-item @if ($item==1) active @endif"> |
29 | <i> | 29 | <i> |
30 | <svg> | 30 | <svg> |
31 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use> | 31 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-1') }}"></use> |
32 | </svg> | 32 | </svg> |
33 | </i> | 33 | </i> |
34 | <span>Профиль</span> | 34 | <span>Профиль</span> |
35 | </a> | 35 | </a> |
36 | @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_public)) | ||
36 | <a href="{{ route('employer.cabinet_vacancie') }}" class="cabinet__menu-item @if ($item==2) active @endif"> | 37 | <a href="{{ route('employer.cabinet_vacancie') }}" class="cabinet__menu-item @if ($item==2) active @endif"> |
37 | <i> | 38 | <i> |
38 | <svg> | 39 | <svg> |
39 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-2') }}"></use> | 40 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-2') }}"></use> |
40 | </svg> | 41 | </svg> |
41 | </i> | 42 | </i> |
42 | <span>Разместить вакансию</span> | 43 | <span>Разместить вакансию</span> |
43 | </a> | 44 | </a> |
45 | @else | ||
46 | <a href="{{ route('employer.cabinet_vacancie_danger') }}" class="cabinet__menu-item @if ($item==2) active @endif"> | ||
47 | <i> | ||
48 | <svg> | ||
49 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-2') }}"></use> | ||
50 | </svg> | ||
51 | </i> | ||
52 | <span>Разместить вакансию</span> | ||
53 | </a> | ||
54 | @endif | ||
44 | <a href="{{ route('employer.vacancy_list') }}" class="cabinet__menu-item @if ($item==3) active @endif"> | 55 | <a href="{{ route('employer.vacancy_list') }}" class="cabinet__menu-item @if ($item==3) active @endif"> |
45 | <i> | 56 | <i> |
46 | <svg> | 57 | <svg> |
47 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-3') }}"></use> | 58 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-3') }}"></use> |
48 | </svg> | 59 | </svg> |
49 | </i> | 60 | </i> |
50 | <span>Мои вакансии</span> | 61 | <span>Мои вакансии</span> |
51 | </a> | 62 | </a> |
52 | <a href="{{ route('employer.answers', ['employer' => $id_employer]) }}" class="cabinet__menu-item @if ($item==4) active @endif"> | 63 | <a href="{{ route('employer.answers', ['employer' => $id_employer]) }}" class="cabinet__menu-item @if ($item==4) active @endif"> |
53 | <i> | 64 | <i> |
54 | <svg> | 65 | <svg> |
55 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-4') }}"></use> | 66 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-4') }}"></use> |
56 | </svg> | 67 | </svg> |
57 | </i> | 68 | </i> |
58 | <span>Отклики на вакансию</span> | 69 | <span>Отклики на вакансию</span> |
59 | </a> | 70 | </a> |
60 | <a href="{{ route('employer.messages', ['type_message' => 'input']) }}" class="cabinet__menu-item @if ($item==5) active @endif"> | 71 | <a href="{{ route('employer.messages', ['type_message' => 'input']) }}" class="cabinet__menu-item @if ($item==5) active @endif"> |
61 | <i> | 72 | <i> |
62 | <svg> | 73 | <svg> |
63 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-5') }}"></use> | 74 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-5') }}"></use> |
64 | </svg> | 75 | </svg> |
65 | </i> | 76 | </i> |
66 | <span>Сообщения</span> | 77 | <span>Сообщения</span> |
67 | </a> | 78 | </a> |
68 | <a href="{{ route('employer.favorites') }}" class="cabinet__menu-item @if ($item==6) active @endif"> | 79 | <a href="{{ route('employer.favorites') }}" class="cabinet__menu-item @if ($item==6) active @endif"> |
69 | <i> | 80 | <i> |
70 | <svg> | 81 | <svg> |
71 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-6') }}"></use> | 82 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-6') }}"></use> |
72 | </svg> | 83 | </svg> |
73 | </i> | 84 | </i> |
74 | <span>Избранные кандидаты</span> | 85 | <span>Избранные кандидаты</span> |
75 | </a> | 86 | </a> |
76 | <a href="{{ route('employer.bd') }}" class="cabinet__menu-item @if ($item==7) active @endif"> | 87 | <a href="{{ route('employer.bd') }}" class="cabinet__menu-item @if ($item==7) active @endif"> |
77 | <i> | 88 | <i> |
78 | <svg> | 89 | <svg> |
79 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-7')}}"></use> | 90 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-7')}}"></use> |
80 | </svg> | 91 | </svg> |
81 | </i> | 92 | </i> |
82 | <span>База данных</span> | 93 | <span>База данных</span> |
83 | </a> | 94 | </a> |
95 | @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_lookin)) | ||
84 | <a href="{{ route('bd_resume') }}" target="_blank" class="cabinet__menu-item @if ($item==8) active @endif"> | 96 | <a href="{{ route('bd_resume') }}" target="_blank" class="cabinet__menu-item @if ($item==8) active @endif"> |
85 | <i> | 97 | <i> |
86 | <svg> | 98 | <svg> |
87 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-8') }}"></use> | 99 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-8') }}"></use> |
88 | </svg> | 100 | </svg> |
89 | </i> | 101 | </i> |
90 | <span>База резюме</span> | 102 | <span>База резюме</span> |
91 | </a> | 103 | </a> |
104 | @else | ||
105 | <a href="{{ route('bd_resume_danger') }}" target="_blank" class="cabinet__menu-item @if ($item==8) active @endif"> | ||
106 | <i> | ||
107 | <svg> | ||
108 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-8') }}"></use> | ||
109 | </svg> | ||
110 | </i> | ||
111 | <span>База резюме</span> | ||
112 | </a> | ||
113 | @endif | ||
92 | <a href="{{ route('employer.send_all_messages') }}" class="cabinet__menu-item @if ($item==9) active @endif"> | 114 | <a href="{{ route('employer.send_all_messages') }}" class="cabinet__menu-item @if ($item==9) active @endif"> |
93 | <i> | 115 | <i> |
94 | <svg> | 116 | <svg> |
95 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-9') }}"></use> | 117 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-9') }}"></use> |
96 | </svg> | 118 | </svg> |
97 | </i> | 119 | </i> |
98 | <span>Рассылка сообщений</span> | 120 | <span>Рассылка сообщений</span> |
99 | </a> | 121 | </a> |
100 | <a href="{{ route('employer.faq') }}" class="cabinet__menu-item @if ($item==10) active @endif"> | 122 | <a href="{{ route('employer.faq') }}" class="cabinet__menu-item @if ($item==10) active @endif"> |
101 | <i> | 123 | <i> |
102 | <svg> | 124 | <svg> |
103 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-10') }}"></use> | 125 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-10') }}"></use> |
104 | </svg> | 126 | </svg> |
105 | </i> | 127 | </i> |
106 | <span>FAQ</span> | 128 | <span>FAQ</span> |
107 | </a> | 129 | </a> |
108 | <a href="{{ route('employer.subscribe') }}" class="cabinet__menu-item @if ($item==11) active @endif"> | 130 | <a href="{{ route('employer.subscribe') }}" class="cabinet__menu-item @if ($item==11) active @endif"> |
109 | <i> | 131 | <i> |
110 | <svg> | 132 | <svg> |
111 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-11') }}"></use> | 133 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-11') }}"></use> |
112 | </svg> | 134 | </svg> |
113 | </i> | 135 | </i> |
114 | <span>Настройки уведомлений</span> | 136 | <span>Настройки уведомлений</span> |
115 | </a> | 137 | </a> |
116 | <a href="{{ route('employer.slider_flot') }}" class="cabinet__menu-item @if ($item==12) active @endif"> | 138 | <a href="{{ route('employer.slider_flot') }}" class="cabinet__menu-item @if ($item==12) active @endif"> |
117 | <i> | 139 | <i> |
118 | <svg> | 140 | <svg> |
119 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-11') }}"></use> | 141 | <use xlink:href="{{ asset('images/sprite.svg#cabinet-11') }}"></use> |
120 | </svg> | 142 | </svg> |
121 | </i> | 143 | </i> |
122 | <span>Мой флот</span> | 144 | <span>Мой флот</span> |
123 | </a> | 145 | </a> |
124 | <a href="{{ route('employer.password_reset') }}" class="cabinet__menu-item green @if ($item==13) active @endif"> | 146 | <a href="{{ route('employer.password_reset') }}" class="cabinet__menu-item green @if ($item==13) active @endif"> |
125 | <i></i> | 147 | <i></i> |
126 | <span>Сменить пароль</span> | 148 | <span>Сменить пароль</span> |
127 | </a> | 149 | </a> |
128 | <a href="{{ route('employer.delete_people') }}" class="cabinet__menu-item red @if ($item==14) active @endif"> | 150 | <a href="{{ route('employer.delete_people') }}" class="cabinet__menu-item red @if ($item==14) active @endif"> |
129 | <i></i> | 151 | <i></i> |
130 | <span>Удалить профиль</span> | 152 | <span>Удалить профиль</span> |
131 | </a> | 153 | </a> |
132 | </div> | 154 | </div> |
133 | <div class="cabinet__menu-bottom"> | 155 | <div class="cabinet__menu-bottom"> |
134 | <a href="{{ route('logout') }}" class="button cabinet__menu-leave"> | 156 | <a href="{{ route('logout') }}" class="button cabinet__menu-leave"> |
135 | <svg> | 157 | <svg> |
136 | <use xlink:href="{{ asset('images/sprite.svg#leave') }}"></use> | 158 | <use xlink:href="{{ asset('images/sprite.svg#leave') }}"></use> |
137 | </svg> | 159 | </svg> |
138 | Выход | 160 | Выход |
139 | </a> | 161 | </a> |
140 | <span class="cabinet__menu-copy"> | 162 | <span class="cabinet__menu-copy"> |
141 | © 2020 – Rekamore.su | 163 | © 2020 – Rekamore.su |
142 | </span> | 164 | </span> |
143 | </div> | 165 | </div> |
144 | </div> | 166 | </div> |
145 | </div> | 167 | </div> |
146 | </div> | 168 | </div> |
147 | 169 |
resources/views/index.blade.php
1 | @extends('layout.frontend', ['title' => 'Главная страница РекаМоре']) | 1 | @extends('layout.frontend', ['title' => 'Главная страница РекаМоре']) |
2 | 2 | ||
3 | @section('scripts') | 3 | @section('scripts') |
4 | 4 | ||
5 | @endsection | 5 | @endsection |
6 | 6 | ||
7 | @section('content') | 7 | @section('content') |
8 | @include('messages_error') | ||
8 | <section class="work"> | 9 | <section class="work"> |
9 | <div class="container"> | 10 | <div class="container"> |
10 | <img src="{{ asset('images/1.png') }}" alt="" class="work__pic"> | 11 | <img src="{{ asset('images/1.png') }}" alt="" class="work__pic"> |
11 | <div class="work__body"> | 12 | <div class="work__body"> |
12 | <div class="work__title"> | 13 | <div class="work__title"> |
13 | <h4>Работа в море / | 14 | <h4>Работа в море / |
14 | <span class="br">Работа на реке</span></h4> | 15 | <span class="br">Работа на реке</span></h4> |
15 | </div> | 16 | </div> |
16 | <div class="work__text">Профессиональная сеть морского сообщества «RekaMore.su» приветствует вас — | 17 | <div class="work__text">Профессиональная сеть морского сообщества «RekaMore.su» приветствует вас — |
17 | тех, кто не представляет себе жизнь без моря, тех, кто готов связать свою жизнь с работой в | 18 | тех, кто не представляет себе жизнь без моря, тех, кто готов связать свою жизнь с работой в |
18 | сложных, но очень интересных условиях. </div> | 19 | сложных, но очень интересных условиях. </div> |
19 | <div class="work__list"> | 20 | <div class="work__list"> |
20 | <div>Тысячи соискателей увидят Ваше объявление</div> | 21 | <div>Тысячи соискателей увидят Ваше объявление</div> |
21 | <div>Десятки компаний выкладывают объявления каждый день</div> | 22 | <div>Десятки компаний выкладывают объявления каждый день</div> |
22 | </div> | 23 | </div> |
23 | <form class="search work__form" action="{{ route('search_vacancies') }}" method="GET"> | 24 | <form class="search work__form" action="{{ route('search_vacancies') }}" method="GET"> |
24 | <input type="search" id="search" name="search" class="input" placeholder="Желаемая должность" required> | 25 | <input type="search" id="search" name="search" class="input" placeholder="Желаемая должность" required> |
25 | <button type="submit" class="button button_light">Посмотреть вакансии</button> | 26 | <button type="submit" class="button button_light">Посмотреть вакансии</button> |
26 | <span> | 27 | <span> |
27 | <svg> | 28 | <svg> |
28 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> | 29 | <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> |
29 | </svg> | 30 | </svg> |
30 | </span> | 31 | </span> |
31 | </form> | 32 | </form> |
32 | @guest | 33 | @guest |
33 | <a data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' class="button work__search">Я ищу сотрудника</a> | 34 | <a data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' class="button work__search">Я ищу сотрудника</a> |
34 | @else | 35 | @else |
35 | <a href="{{ route('bd_resume') }}" class="button work__search">Я ищу сотрудника</a> | 36 | <a href="{{ route('bd_resume') }}" class="button work__search">Я ищу сотрудника</a> |
36 | @endguest | 37 | @endguest |
37 | <div class="work__get"> | 38 | <div class="work__get"> |
38 | <b>Скачать приложение</b> | 39 | <b>Скачать приложение</b> |
39 | <a href=""> | 40 | <a href=""> |
40 | <img src="{{ asset('images/google.svg') }}" alt=""> | 41 | <img src="{{ asset('images/google.svg') }}" alt=""> |
41 | </a> | 42 | </a> |
42 | <a href=""> | 43 | <a href=""> |
43 | <img src="{{ asset('images/apple.svg') }}" alt=""> | 44 | <img src="{{ asset('images/apple.svg') }}" alt=""> |
44 | </a> | 45 | </a> |
45 | </div> | 46 | </div> |
46 | </div> | 47 | </div> |
47 | </div> | 48 | </div> |
48 | </section> | 49 | </section> |
49 | <section class="numbers"> | 50 | <section class="numbers"> |
50 | <div class="container"> | 51 | <div class="container"> |
51 | <div class="numbers__body"> | 52 | <div class="numbers__body"> |
52 | <div class="numbers__item"> | 53 | <div class="numbers__item"> |
53 | <b>500+</b> | 54 | <b>500+</b> |
54 | <span>Резюме</span> | 55 | <span>Резюме</span> |
55 | Банальные, но неопровержимые выводы, а также элементы политического процесса лишь добавляют | 56 | Банальные, но неопровержимые выводы, а также элементы политического процесса лишь добавляют |
56 | фракционных разногласий и призваны к ответу. | 57 | фракционных разногласий и призваны к ответу. |
57 | </div> | 58 | </div> |
58 | <div class="numbers__item"> | 59 | <div class="numbers__item"> |
59 | <b>1 000+</b> | 60 | <b>1 000+</b> |
60 | <span>Вакансий</span> | 61 | <span>Вакансий</span> |
61 | В рамках спецификации современных стандартов, диаграммы связей заблокированы в рамках своих | 62 | В рамках спецификации современных стандартов, диаграммы связей заблокированы в рамках своих |
62 | собственных рациональных ограничений. | 63 | собственных рациональных ограничений. |
63 | </div> | 64 | </div> |
64 | <div class="numbers__item"> | 65 | <div class="numbers__item"> |
65 | <b>265</b> | 66 | <b>265</b> |
66 | <span>Компаний</span> | 67 | <span>Компаний</span> |
67 | Но сторонники тоталитаризма в науке заблокированы в рамках своих собственных рациональных | 68 | Но сторонники тоталитаризма в науке заблокированы в рамках своих собственных рациональных |
68 | ограничений. | 69 | ограничений. |
69 | </div> | 70 | </div> |
70 | </div> | 71 | </div> |
71 | </div> | 72 | </div> |
72 | </section> | 73 | </section> |
73 | <!--<section class="vacancies"> | 74 | <!--<section class="vacancies"> |
74 | <div class="container"> | 75 | <div class="container"> |
75 | <div class="title"><h4>Новые вакансии</h4></div> | 76 | <div class="title"><h4>Новые вакансии</h4></div> |
76 | <div class="vacancies__body"> | 77 | <div class="vacancies__body"> |
77 | <a class="vacancies__more button button_light js-parent-toggle" href="{{ route('vacancies') }}">Все должности</a> | 78 | <a class="vacancies__more button button_light js-parent-toggle" href="{{ route('vacancies') }}">Все должности</a> |
78 | <div class="vacancies__list"> | 79 | <div class="vacancies__list"> |
79 | _if ($categories->count()) | 80 | _if ($categories->count()) |
80 | _foreach ($categories as $cat) | 81 | _foreach ($categories as $cat) |
81 | <a href=" route('list-vacancies', ['categories' => $cat->id]) }}" class="vacancies__item"> | 82 | <a href=" route('list-vacancies', ['categories' => $cat->id]) }}" class="vacancies__item"> |
82 | <span style="border-color:#F4C4C2"> | 83 | <span style="border-color:#F4C4C2"> |
83 | <b> $cat->name }}</b> | 84 | <b> $cat->name }}</b> |
84 | <i>Вакансий: <span> $cat->cnt }}</span></i> | 85 | <i>Вакансий: <span> $cat->cnt }}</span></i> |
85 | </span> | 86 | </span> |
86 | </a> | 87 | </a> |
87 | _endforeach | 88 | _endforeach |
88 | _else | 89 | _else |
89 | Тут пока нет никаких вакансий | 90 | Тут пока нет никаких вакансий |
90 | _endif | 91 | _endif |
91 | </div> | 92 | </div> |
92 | </div> | 93 | </div> |
93 | </div> | 94 | </div> |
94 | </section>--> | 95 | </section>--> |
95 | 96 | ||
96 | <main class="main"> | 97 | <main class="main"> |
97 | <div class="container"> | 98 | <div class="container"> |
98 | <div class="main__vacancies"> | 99 | <div class="main__vacancies"> |
99 | <h2 class="main__vacancies-title">Категории вакансий</h2> | 100 | <h2 class="main__vacancies-title">Категории вакансий</h2> |
100 | <div class="vacancies__body"> | 101 | <div class="vacancies__body"> |
101 | <div class="vacancies__list" id="block_ajax" name="block_ajax"> | 102 | <div class="vacancies__list" id="block_ajax" name="block_ajax"> |
102 | @foreach($Main_Job as $key => $it_main) | 103 | @foreach($Main_Job as $key => $it_main) |
103 | <div class="vacancies__list-col"> | 104 | <div class="vacancies__list-col"> |
104 | @include('block_real_new', ['it_main' => $it_main, 'category' => $key]) | 105 | @include('block_real_new', ['it_main' => $it_main, 'category' => $key]) |
105 | </div> | 106 | </div> |
106 | @endforeach | 107 | @endforeach |
107 | <!--_include('block_real', ['flot' => $flot, 'position' => $Position[$flot->position_id]])--> | 108 | <!--_include('block_real', ['flot' => $flot, 'position' => $Position[$flot->position_id]])--> |
108 | </div> | 109 | </div> |
109 | </div> | 110 | </div> |
110 | </div> | 111 | </div> |
111 | </div> | 112 | </div> |
112 | </main> | 113 | </main> |
113 | 114 | ||
114 | <section class="employer"> | 115 | <section class="employer"> |
115 | <div class="container"> | 116 | <div class="container"> |
116 | <div class="title"><h4>Работодатели</h4></div> | 117 | <div class="title"><h4>Работодатели</h4></div> |
117 | <div class="swiper js-employer-swiper"> | 118 | <div class="swiper js-employer-swiper"> |
118 | <div class="swiper-wrapper"> | 119 | <div class="swiper-wrapper"> |
119 | 120 | ||
120 | @if ($employers->count()) | 121 | @if ($employers->count()) |
121 | @php | 122 | @php |
122 | $rec = 0; | 123 | $rec = 0; |
123 | $count = $employers->count(); | 124 | $count = $employers->count(); |
124 | 125 | ||
125 | @endphp | 126 | @endphp |
126 | 127 | ||
127 | @foreach($employers as $emp) | 128 | @foreach($employers as $emp) |
128 | @php $rec++ @endphp | 129 | @php $rec++ @endphp |
129 | @if (($rec==1) || ($rec==5) || ($rec==9) || ($rec==13) || ($rec==17)) | 130 | @if (($rec==1) || ($rec==5) || ($rec==9) || ($rec==13) || ($rec==17)) |
130 | <div class="swiper-slide"> | 131 | <div class="swiper-slide"> |
131 | <div class="employer__item"> | 132 | <div class="employer__item"> |
132 | @endif | 133 | @endif |
133 | @if (!empty($emp->employer->logo)) | 134 | @if (!empty($emp->employer->logo)) |
134 | <a href="{{ route('ad-employer', ['ad_employer' => $emp->employer->id]) }}"> | 135 | <a href="{{ route('ad-employer', ['ad_employer' => $emp->employer->id]) }}"> |
135 | <img src="{{ asset(Storage::url($emp->employer->logo)) }}" alt="{{ $emp->employer->name_company }}"> | 136 | <img src="{{ asset(Storage::url($emp->employer->logo)) }}" alt="{{ $emp->employer->name_company }}"> |
136 | </a> | 137 | </a> |
137 | @else | 138 | @else |
138 | <a href="{{ route('ad-employer', ['ad_employer' => $emp->employer->id]) }}"> | 139 | <a href="{{ route('ad-employer', ['ad_employer' => $emp->employer->id]) }}"> |
139 | <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $emp->employer->name_company }}"> | 140 | <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $emp->employer->name_company }}"> |
140 | </a> | 141 | </a> |
141 | @endif | 142 | @endif |
142 | @if (($rec==4) || ($rec==8) || ($rec==12) || ($rec==16) || ($rec==20) || ($rec == $count)) | 143 | @if (($rec==4) || ($rec==8) || ($rec==12) || ($rec==16) || ($rec==20) || ($rec == $count)) |
143 | </div> | 144 | </div> |
144 | </div> | 145 | </div> |
145 | @endif | 146 | @endif |
146 | @endforeach | 147 | @endforeach |
147 | @else | 148 | @else |
148 | <h5>Тут нет никаких записей</h5> | 149 | <h5>Тут нет никаких записей</h5> |
149 | @endif | 150 | @endif |
150 | </div> | 151 | </div> |
151 | <div class="swiper-pagination"></div> | 152 | <div class="swiper-pagination"></div> |
152 | </div> | 153 | </div> |
153 | <a href="{{ route('shipping_companies') }}" class="employer__more button button_light">Все работодатели</a> | 154 | <a href="{{ route('shipping_companies') }}" class="employer__more button button_light">Все работодатели</a> |
154 | </div> | 155 | </div> |
155 | </section> | 156 | </section> |
156 | <section class="about"> | 157 | <section class="about"> |
157 | <div class="container"> | 158 | <div class="container"> |
158 | <div class="about__wrapper"> | 159 | <div class="about__wrapper"> |
159 | <div class="title about__title"><h4>О нас</h4></div> | 160 | <div class="title about__title"><h4>О нас</h4></div> |
160 | <div class="about__body"> | 161 | <div class="about__body"> |
161 | <div class="about__line"></div> | 162 | <div class="about__line"></div> |
162 | <div class="about__item"> | 163 | <div class="about__item"> |
163 | <b>Для работодателей</b> | 164 | <b>Для работодателей</b> |
164 | <span>Наш ресурс позволит Вам за демократичную цену найти нужных специалистов в кратчайшие | 165 | <span>Наш ресурс позволит Вам за демократичную цену найти нужных специалистов в кратчайшие |
165 | сроки, подробнее об условиях можно узнать <a href="{{ route('page', ['pages' => 'Stoimost-razmescheniya']) }}">здесь</a>.</span> | 166 | сроки, подробнее об условиях можно узнать <a href="{{ route('page', ['pages' => 'Stoimost-razmescheniya']) }}">здесь</a>.</span> |
166 | <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('bd_resume') }}">Поиск сотрудников</a> | 167 | <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('bd_resume') }}">Поиск сотрудников</a> |
167 | </div> | 168 | </div> |
168 | <div class="about__item"> | 169 | <div class="about__item"> |
169 | <b>Для сотрудников</b> | 170 | <b>Для сотрудников</b> |
170 | <span>Наше преимущество — это большой объем вакансий, более 70 судоходных компаний России и | 171 | <span>Наше преимущество — это большой объем вакансий, более 70 судоходных компаний России и |
171 | СНГ ищут сотрудников через наши ресурсы</span> | 172 | СНГ ищут сотрудников через наши ресурсы</span> |
172 | <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('vacancies') }}">Ищу работу</a> | 173 | <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('vacancies') }}">Ищу работу</a> |
173 | </div> | 174 | </div> |
174 | </div> | 175 | </div> |
175 | </div> | 176 | </div> |
176 | </div> | 177 | </div> |
177 | </section> | 178 | </section> |
178 | 179 | ||
179 | @if ($news->count()) | 180 | @if ($news->count()) |
180 | <section class="news"> | 181 | <section class="news"> |
181 | <div class="container"> | 182 | <div class="container"> |
182 | <div class="news__toper"> | 183 | <div class="news__toper"> |
183 | <div class="title"><h4>Новости и статьи</h4></div> | 184 | <div class="title"><h4>Новости и статьи</h4></div> |
184 | <div class="navs"> | 185 | <div class="navs"> |
185 | <button class="js-news-swiper-button-prev"> | 186 | <button class="js-news-swiper-button-prev"> |
186 | <svg class="rotate180"> | 187 | <svg class="rotate180"> |
187 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> | 188 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> |
188 | </svg> | 189 | </svg> |
189 | </button> | 190 | </button> |
190 | <button class="js-news-swiper-button-next"> | 191 | <button class="js-news-swiper-button-next"> |
191 | <svg> | 192 | <svg> |
192 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> | 193 | <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> |
193 | </svg> | 194 | </svg> |
194 | </button> | 195 | </button> |
195 | </div> | 196 | </div> |
196 | </div> | 197 | </div> |
197 | 198 | ||
198 | <div class="swiper js-news-swiper"> | 199 | <div class="swiper js-news-swiper"> |
199 | <div class="swiper-wrapper"> | 200 | <div class="swiper-wrapper"> |
200 | 201 | ||
201 | @foreach ($news as $new) | 202 | @foreach ($news as $new) |
202 | <div class="swiper-slide"> | 203 | <div class="swiper-slide"> |
203 | <div class="news__item"> | 204 | <div class="news__item"> |
204 | @if (empty($new->image)) | 205 | @if (empty($new->image)) |
205 | <img src="{{ asset('/images/default_ship.jpg') }}" alt="" class="news__item-pic"> | 206 | <img src="{{ asset('/images/default_ship.jpg') }}" alt="" class="news__item-pic"> |
206 | @else | 207 | @else |
207 | <img src="{{ asset(Storage::url($new->image)) }}" alt="" class="news__item-pic"> | 208 | <img src="{{ asset(Storage::url($new->image)) }}" alt="" class="news__item-pic"> |
208 | @endif | 209 | @endif |
209 | <div class="news__item-body"> | 210 | <div class="news__item-body"> |
210 | <time datetime="{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}" class="news__item-date">{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}</time> | 211 | <time datetime="{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}" class="news__item-date">{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}</time> |
211 | <span class="news__item-title">{{ $new->title }}</span> | 212 | <span class="news__item-title">{{ $new->title }}</span> |
212 | <span class="news__item-text">{!! mb_strimwidth($new->text, 0, 100) !!}</span> | 213 | <span class="news__item-text">{!! mb_strimwidth($new->text, 0, 100) !!}</span> |
213 | <a href="{{ route('detail_new', ['new' => $new->id]) }}" class="news__item-more button button_light">Читать далее</a> | 214 | <a href="{{ route('detail_new', ['new' => $new->id]) }}" class="news__item-more button button_light">Читать далее</a> |
214 | </div> | 215 | </div> |
215 | </div> | 216 | </div> |
216 | </div> | 217 | </div> |
217 | @endforeach | 218 | @endforeach |
218 | 219 | ||
219 | </div> | 220 | </div> |
220 | <div class="swiper-pagination"></div> | 221 | <div class="swiper-pagination"></div> |
221 | </div> | 222 | </div> |
222 | <a href="{{ route('news') }}" class="news__all button button_light">Все новости</a> | 223 | <a href="{{ route('news') }}" class="news__all button button_light">Все новости</a> |
223 | 224 | ||
224 | </div> | 225 | </div> |
225 | </section> | 226 | </section> |
226 | @endif | 227 | @endif |
227 | 228 | ||
228 | <section class="info"> | 229 | <section class="info"> |
229 | <div class="container"> | 230 | <div class="container"> |
230 | <img src="images/5.png" alt="" class="info__pic"> | 231 | <img src="images/5.png" alt="" class="info__pic"> |
231 | <div class="info__body"> | 232 | <div class="info__body"> |
232 | <div class="title info__title"><h4>Мы в социальных сетях</h4></div> | 233 | <div class="title info__title"><h4>Мы в социальных сетях</h4></div> |
233 | <div class="info__item"> | 234 | <div class="info__item"> |
234 | <div class="info__text">Телеграм — Подпишитесь на наш телеграм канал и получайте уведомления о | 235 | <div class="info__text">Телеграм — Подпишитесь на наш телеграм канал и получайте уведомления о |
235 | новых вакансиях прямо на свой смартфон</div> | 236 | новых вакансиях прямо на свой смартфон</div> |
236 | <a href="{{ $companies[0]->telegram }}" class="info__link" style="background:#20A0E1"> | 237 | <a href="{{ $companies[0]->telegram }}" class="info__link" style="background:#20A0E1"> |
237 | <svg> | 238 | <svg> |
238 | <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> | 239 | <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> |
239 | </svg> | 240 | </svg> |
240 | Телеграм | 241 | Телеграм |
241 | </a> | 242 | </a> |
242 | </div> | 243 | </div> |
243 | <div class="info__item"> | 244 | <div class="info__item"> |
244 | <div class="info__text">ВКонтакте — Лучшие вакансии за неделю выкладываем именно тут, информация | 245 | <div class="info__text">ВКонтакте — Лучшие вакансии за неделю выкладываем именно тут, информация |
245 | о судоходных компаниях, инструкции по работе с сайтом, конкурсы и многое другое</div> | 246 | о судоходных компаниях, инструкции по работе с сайтом, конкурсы и многое другое</div> |
246 | <a href="{{ $companies[0]->vkontact }}" class="info__link" style="background:#2787F5"> | 247 | <a href="{{ $companies[0]->vkontact }}" class="info__link" style="background:#2787F5"> |
247 | <svg> | 248 | <svg> |
248 | <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> | 249 | <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> |
249 | </svg> | 250 | </svg> |
250 | ВКонтакте | 251 | ВКонтакте |
251 | </a> | 252 | </a> |
252 | </div> | 253 | </div> |
253 | </div> | 254 | </div> |
254 | </div> | 255 | </div> |
255 | </section> | 256 | </section> |
256 | @endsection | 257 | @endsection |
257 | 258 |
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-buttons"> | 328 | <div class="main__resume-base-body-item-buttons"> |
329 | <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 }}"> | 329 | <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 }}"> |
330 | <svg> | 330 | <svg> |
331 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> | 331 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> |
332 | </svg> | 332 | </svg> |
333 | </button> | 333 | </button> |
334 | @guest | 334 | @guest |
335 | <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' | 335 | <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' |
336 | class="chat js-toggle js_it_button"> | 336 | class="chat js-toggle js_it_button"> |
337 | <svg> | 337 | <svg> |
338 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> | 338 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> |
339 | </svg> | 339 | </svg> |
340 | </button> | 340 | </button> |
341 | @else | 341 | @else |
342 | @if (App\Classes\StatusUser::Status()==0) | 342 | @if (App\Classes\StatusUser::Status()==0) |
343 | @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message)) | ||
343 | <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}'> | 344 | <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}'> |
344 | <svg> | 345 | <svg> |
345 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> | 346 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> |
346 | </svg> | 347 | </svg> |
347 | </button> | 348 | </button> |
349 | @endif | ||
348 | @else | 350 | @else |
349 | <button type="button" data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' | 351 | <button type="button" data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' |
350 | class="chat js-toggle js_it_button"> | 352 | class="chat js-toggle js_it_button"> |
351 | <svg> | 353 | <svg> |
352 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> | 354 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> |
353 | </svg> | 355 | </svg> |
354 | </button> @endif | 356 | </button> |
357 | @endif | ||
355 | @endif | 358 | @endif |
356 | </div> | 359 | </div> |
357 | <div class="main__resume-base-body-item-wrapper"> | 360 | <div class="main__resume-base-body-item-wrapper"> |
358 | <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"> | 361 | <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"> |
359 | <div class="main__resume-base-body-item-inner"> | 362 | <div class="main__resume-base-body-item-inner"> |
360 | <div> | 363 | <div> |
361 | <b>Статус</b> | 364 | <b>Статус</b> |
362 | <span>{{ $status_work[$res->status_work] }}</span> | 365 | <span>{{ $status_work[$res->status_work] }}</span> |
363 | </div> | 366 | </div> |
364 | <div> | 367 | <div> |
365 | <b>Имя работника</b> | 368 | <b>Имя работника</b> |
366 | <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> | 369 | <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> |
367 | </div> | 370 | </div> |
368 | <div> | 371 | <div> |
369 | <b>Номер телефона</b> | 372 | <b>Номер телефона</b> |
370 | <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span> | 373 | <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span> |
371 | </div> | 374 | </div> |
372 | <div> | 375 | <div> |
373 | <b>Электронный адрес</b> | 376 | <b>Электронный адрес</b> |
374 | <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> | 377 | <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> |
375 | </div> | 378 | </div> |
376 | <div> | 379 | <div> |
377 | <b>Город проживания</b> | 380 | <b>Город проживания</b> |
378 | <span>{{ $res->city }}</span> | 381 | <span>{{ $res->city }}</span> |
379 | </div> | 382 | </div> |
380 | <div> | 383 | <div> |
381 | <b>Опыт работы</b> | 384 | <b>Опыт работы</b> |
382 | <span>{{ $res->experience }}</span> | 385 | <span>{{ $res->experience }}</span> |
383 | </div> | 386 | </div> |
384 | </div> | 387 | </div> |
385 | </div> | 388 | </div> |
386 | <div class="main__employer-page-two-item-tags"> | 389 | <div class="main__employer-page-two-item-tags"> |
387 | @if ($res->job_titles->count()) | 390 | @if ($res->job_titles->count()) |
388 | @if (isset($res->job_titles)) | 391 | @if (isset($res->job_titles)) |
389 | @foreach ($res->job_titles as $key => $j) | 392 | @foreach ($res->job_titles as $key => $j) |
390 | <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span> | 393 | <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span> |
391 | @endforeach | 394 | @endforeach |
392 | @endif | 395 | @endif |
393 | @endif | 396 | @endif |
394 | </div> | 397 | </div> |
395 | <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в резюме</a> | 398 | <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в резюме</a> |
396 | </div> | 399 | </div> |
397 | @endforeach | 400 | @endforeach |
398 | 401 | ||
399 | {{ $resumes->appends($_GET)->links('paginate') }} | 402 | {{ $resumes->appends($_GET)->links('paginate') }} |
400 | @else | 403 | @else |
401 | <p>По данному запросу ничего не найдено</p> | 404 | <p>По данному запросу ничего не найдено</p> |
402 | @endif | 405 | @endif |
403 | </div> | 406 | </div> |
404 | </div> | 407 | </div> |
405 | <div class="main__resume-base-body" data-body="2"> | 408 | <div class="main__resume-base-body" data-body="2"> |
406 | <div class="main__resume-base-body-two" id="block2" name="block2"> | 409 | <div class="main__resume-base-body-two" id="block2" name="block2"> |
407 | @if ($resumes->count()) | 410 | @if ($resumes->count()) |
408 | @foreach ($resumes as $res) | 411 | @foreach ($resumes as $res) |
409 | <div class="main__resume-base-body-item"> | 412 | <div class="main__resume-base-body-item"> |
410 | <div class="main__resume-base-body-item-buttons"> | 413 | <div class="main__resume-base-body-item-buttons"> |
411 | <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 }}"> | 414 | <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 }}"> |
412 | <svg> | 415 | <svg> |
413 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> | 416 | <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> |
414 | </svg> | 417 | </svg> |
415 | </button> | 418 | </button> |
416 | <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}'> | 419 | <!--<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}'> |
417 | <svg> | 420 | <svg> |
418 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> | 421 | <use xlink:href=" asset('images/sprite.svg#chat') }}"></use> |
419 | </svg> | 422 | </svg> |
420 | </button> | 423 | </button>--> |
424 | @guest | ||
425 | <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' | ||
426 | class="chat js-toggle js_it_button"> | ||
427 | <svg> | ||
428 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> | ||
429 | </svg> | ||
430 | </button> | ||
431 | @else | ||
432 | @if (App\Classes\StatusUser::Status()==0) | ||
433 | @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message)) | ||
434 | <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}'> | ||
435 | <svg> | ||
436 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> | ||
437 | </svg> | ||
438 | </button> | ||
439 | @endif | ||
440 | @else | ||
441 | <button type="button" data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' | ||
442 | class="chat js-toggle js_it_button"> | ||
443 | <svg> | ||
444 | <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> | ||
445 | </svg> | ||
446 | </button> | ||
447 | @endif | ||
448 | @endif | ||
421 | </div> | 449 | </div> |
422 | <div class="main__resume-base-body-item-wrapper"> | 450 | <div class="main__resume-base-body-item-wrapper"> |
423 | <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"> | 451 | <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"> |
424 | <div class="main__resume-base-body-item-inner"> | 452 | <div class="main__resume-base-body-item-inner"> |
425 | <div> | 453 | <div> |
426 | <b>Статус</b> | 454 | <b>Статус</b> |
427 | <span>{{ $status_work[$res->status_work] }}</span> | 455 | <span>{{ $status_work[$res->status_work] }}</span> |
428 | </div> | 456 | </div> |
429 | <div> | 457 | <div> |
430 | <b>Имя работника</b> | 458 | <b>Имя работника</b> |
431 | <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> | 459 | <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> |
432 | </div> | 460 | </div> |
433 | <div> | 461 | <div> |
434 | <b>Номер телефона</b> | 462 | <b>Номер телефона</b> |
435 | <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span> | 463 | <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span> |
436 | </div> | 464 | </div> |
437 | <div> | 465 | <div> |
438 | <b>Электронный адрес</b> | 466 | <b>Электронный адрес</b> |
439 | <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> | 467 | <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> |
440 | </div> | 468 | </div> |
441 | <div> | 469 | <div> |
442 | <b>Город проживания</b> | 470 | <b>Город проживания</b> |
443 | <span>{{ $res->city }}</span> | 471 | <span>{{ $res->city }}</span> |
444 | </div> | 472 | </div> |
445 | <div> | 473 | <div> |
446 | <b>Опыт работы</b> | 474 | <b>Опыт работы</b> |
447 | <span>{{ $res->experience }}</span> | 475 | <span>{{ $res->experience }}</span> |
448 | </div> | 476 | </div> |
449 | </div> | 477 | </div> |
450 | </div> | 478 | </div> |
451 | <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в | 479 | <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в |
452 | резюме</a> | 480 | резюме</a> |
453 | </div> | 481 | </div> |
454 | @endforeach | 482 | @endforeach |
455 | 483 | ||
456 | {{ $resumes->appends($_GET)->links('paginate') }} | 484 | {{ $resumes->appends($_GET)->links('paginate') }} |
457 | @endif | 485 | @endif |
458 | </div> | 486 | </div> |
459 | </div> | 487 | </div> |
460 | </div> | 488 | </div> |
461 | </div> | 489 | </div> |
462 | </main> | 490 | </main> |
463 | </div> | 491 | </div> |
464 | </div> | 492 | </div> |
465 | @endsection | 493 | @endsection |
466 | 494 |
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\Admin\EmployersController; | 9 | use App\Http\Controllers\Admin\EmployersController; |
10 | use App\Http\Controllers\EmployerController as FrontEmployersController; | 10 | use App\Http\Controllers\EmployerController as FrontEmployersController; |
11 | use App\Http\Controllers\Admin\InfoBloksController; | 11 | use App\Http\Controllers\Admin\InfoBloksController; |
12 | use App\Http\Controllers\Admin\JobTitlesController; | 12 | use App\Http\Controllers\Admin\JobTitlesController; |
13 | use App\Http\Controllers\Admin\UsersController; | 13 | use App\Http\Controllers\Admin\UsersController; |
14 | use App\Http\Controllers\Admin\WorkersController; | 14 | use App\Http\Controllers\Admin\WorkersController; |
15 | use App\Http\Controllers\Auth\ForgotPasswordController; | 15 | use App\Http\Controllers\Auth\ForgotPasswordController; |
16 | use App\Http\Controllers\Auth\LoginController; | 16 | use App\Http\Controllers\Auth\LoginController; |
17 | use App\Http\Controllers\Auth\RegisterController; | 17 | use App\Http\Controllers\Auth\RegisterController; |
18 | use App\Http\Controllers\CKEditorController; | 18 | use App\Http\Controllers\CKEditorController; |
19 | use App\Http\Controllers\MediaController; | 19 | use App\Http\Controllers\MediaController; |
20 | use App\Http\Controllers\WorkerController; | 20 | use App\Http\Controllers\WorkerController; |
21 | use App\Models\Ad_jobs; | 21 | use App\Models\Ad_jobs; |
22 | use App\Models\User; | 22 | use App\Models\User; |
23 | use App\Http\Controllers\MainController; | 23 | use App\Http\Controllers\MainController; |
24 | use App\Http\Controllers\HomeController; | 24 | use App\Http\Controllers\HomeController; |
25 | use Illuminate\Support\Facades\Route; | 25 | use Illuminate\Support\Facades\Route; |
26 | use App\Http\Controllers\Admin\CompanyController; | 26 | use App\Http\Controllers\Admin\CompanyController; |
27 | use App\Http\Controllers\Admin\Ad_EmployersController; | 27 | use App\Http\Controllers\Admin\Ad_EmployersController; |
28 | use App\Http\Controllers\Admin\MsgAnswersController; | 28 | use App\Http\Controllers\Admin\MsgAnswersController; |
29 | use App\Http\Controllers\Admin\GroupsController; | 29 | use App\Http\Controllers\Admin\GroupsController; |
30 | use App\Http\Controllers\PagesController; | 30 | use App\Http\Controllers\PagesController; |
31 | use Illuminate\Support\Facades\Storage; | 31 | use Illuminate\Support\Facades\Storage; |
32 | use App\Http\Controllers\EmployerController; | 32 | use App\Http\Controllers\EmployerController; |
33 | use App\Http\Controllers\CompanyController as FrontCompanyController; | 33 | use App\Http\Controllers\CompanyController as FrontCompanyController; |
34 | 34 | ||
35 | 35 | ||
36 | /* | 36 | /* |
37 | |-------------------------------------------------------------------------- | 37 | |-------------------------------------------------------------------------- |
38 | | Web Routes | 38 | | Web Routes |
39 | |-------------------------------------------------------------------------- | 39 | |-------------------------------------------------------------------------- |
40 | | | 40 | | |
41 | | Here is where you can register web routes for your application. These | 41 | | Here is where you can register web routes for your application. These |
42 | | routes are loaded by the RouteServiceProvider within a group which | 42 | | routes are loaded by the RouteServiceProvider within a group which |
43 | | contains the "web" middleware group. Now create something great! | 43 | | contains the "web" middleware group. Now create something great! |
44 | | | 44 | | |
45 | */ | 45 | */ |
46 | /* | 46 | /* |
47 | Route::get('/', function () { | 47 | Route::get('/', function () { |
48 | return view('welcome'); | 48 | return view('welcome'); |
49 | })->name('index'); | 49 | })->name('index'); |
50 | */ | 50 | */ |
51 | 51 | ||
52 | Route::get('/', [MainController::class, 'index'])->name('index'); | 52 | Route::get('/', [MainController::class, 'index'])->name('index'); |
53 | 53 | ||
54 | //Роуты авторизации, регистрации, восстановления, аутентификации | 54 | //Роуты авторизации, регистрации, восстановления, аутентификации |
55 | Auth::routes(['verify' => true]); | 55 | Auth::routes(['verify' => true]); |
56 | 56 | ||
57 | // роуты регистрации, авторизации, восстановления пароля, верификации почты | 57 | // роуты регистрации, авторизации, восстановления пароля, верификации почты |
58 | /*Route::group([ | 58 | /*Route::group([ |
59 | 'as' => 'auth.', //имя маршрута, например auth.index | 59 | 'as' => 'auth.', //имя маршрута, например auth.index |
60 | 'prefix' => 'auth', // префикс маршрута, например, auth/index | 60 | 'prefix' => 'auth', // префикс маршрута, например, auth/index |
61 | ], function () { | 61 | ], function () { |
62 | //форма регистрации | 62 | //форма регистрации |
63 | Route::get('register', [RegisterController::class, 'register'])->name('register'); | 63 | Route::get('register', [RegisterController::class, 'register'])->name('register'); |
64 | 64 | ||
65 | //создание пользователя | 65 | //создание пользователя |
66 | Route::post('register', [RegisterController::class, 'create'])->name('create'); | 66 | Route::post('register', [RegisterController::class, 'create'])->name('create'); |
67 | 67 | ||
68 | //форма входа авторизации | 68 | //форма входа авторизации |
69 | Route::get('login', [LoginController::class, 'login'])->name('login'); | 69 | Route::get('login', [LoginController::class, 'login'])->name('login'); |
70 | 70 | ||
71 | //аутентификация | 71 | //аутентификация |
72 | Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); | 72 | Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); |
73 | 73 | ||
74 | //выход | 74 | //выход |
75 | Route::get('logout', [LoginController::class, 'logout'])->name('logout'); | 75 | Route::get('logout', [LoginController::class, 'logout'])->name('logout'); |
76 | 76 | ||
77 | //форма ввода адреса почты | 77 | //форма ввода адреса почты |
78 | Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); | 78 | Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); |
79 | 79 | ||
80 | //письмо на почту | 80 | //письмо на почту |
81 | Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); | 81 | Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); |
82 | 82 | ||
83 | //форма восстановления пароля | 83 | //форма восстановления пароля |
84 | Route::get('reset-password/token/{token}/email/{email}', | 84 | Route::get('reset-password/token/{token}/email/{email}', |
85 | [ResetPasswordController::class, 'form'] | 85 | [ResetPasswordController::class, 'form'] |
86 | )->name('reset-form'); | 86 | )->name('reset-form'); |
87 | 87 | ||
88 | //восстановление пароля | 88 | //восстановление пароля |
89 | Route::post('reset-password', | 89 | Route::post('reset-password', |
90 | [ResetPasswordController::class, 'reset'] | 90 | [ResetPasswordController::class, 'reset'] |
91 | )->name('reset-password'); | 91 | )->name('reset-password'); |
92 | 92 | ||
93 | //сообщение о необходимости проверки адреса почты | 93 | //сообщение о необходимости проверки адреса почты |
94 | Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); | 94 | Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); |
95 | 95 | ||
96 | //подтверждение адреса почты нового пользователя | 96 | //подтверждение адреса почты нового пользователя |
97 | Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) | 97 | Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) |
98 | ->where('token', '[a-f0-9]{32}') | 98 | ->where('token', '[a-f0-9]{32}') |
99 | ->where('id', '[0-9]+') | 99 | ->where('id', '[0-9]+') |
100 | ->name('verify-email'); | 100 | ->name('verify-email'); |
101 | });*/ | 101 | });*/ |
102 | 102 | ||
103 | //Личный кабинет пользователя | 103 | //Личный кабинет пользователя |
104 | Route::get('/home', [HomeController::class, 'index'])->name('home'); | 104 | Route::get('/home', [HomeController::class, 'index'])->name('home'); |
105 | 105 | ||
106 | /* | 106 | /* |
107 | Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { | 107 | Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { |
108 | $user = User::where('email',$request->input('email'))->first(); | 108 | $user = User::where('email',$request->input('email'))->first(); |
109 | 109 | ||
110 | $user->sendEmailVerificationNotification(); | 110 | $user->sendEmailVerificationNotification(); |
111 | 111 | ||
112 | return 'your response'; | 112 | return 'your response'; |
113 | })->middleware('throttle:6,1')->name('verification.resend'); | 113 | })->middleware('throttle:6,1')->name('verification.resend'); |
114 | */ | 114 | */ |
115 | 115 | ||
116 | // Авторизация, регистрация в админку | 116 | // Авторизация, регистрация в админку |
117 | Route::group([ | 117 | Route::group([ |
118 | 'as' => 'admin.', // имя маршрута, например auth.index | 118 | 'as' => 'admin.', // имя маршрута, например auth.index |
119 | 'prefix' => 'admin', // префикс маршрута, например auth/index | 119 | 'prefix' => 'admin', // префикс маршрута, например auth/index |
120 | 'middleware' => ['guest'], | 120 | 'middleware' => ['guest'], |
121 | ], function () { | 121 | ], function () { |
122 | // Форма регистрации | 122 | // Форма регистрации |
123 | Route::get('register', [AdminController::class, 'register'])->name('register'); | 123 | Route::get('register', [AdminController::class, 'register'])->name('register'); |
124 | // Создание пользователя | 124 | // Создание пользователя |
125 | Route::post('register', [AdminController::class, 'create'])->name('create'); | 125 | Route::post('register', [AdminController::class, 'create'])->name('create'); |
126 | 126 | ||
127 | //Форма входа | 127 | //Форма входа |
128 | Route::get('login', [AdminController::class, 'login'])->name('login'); | 128 | Route::get('login', [AdminController::class, 'login'])->name('login'); |
129 | 129 | ||
130 | // аутентификация | 130 | // аутентификация |
131 | Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); | 131 | Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); |
132 | 132 | ||
133 | }); | 133 | }); |
134 | 134 | ||
135 | // Личный кабинет админки | 135 | // Личный кабинет админки |
136 | Route::group([ | 136 | Route::group([ |
137 | 'as' => 'admin.', // имя маршрута, например auth.index | 137 | 'as' => 'admin.', // имя маршрута, например auth.index |
138 | 'prefix' => 'admin', // префикс маршрута, например auth/index | 138 | 'prefix' => 'admin', // префикс маршрута, например auth/index |
139 | 'middleware' => ['auth'], ['admin'], | 139 | 'middleware' => ['auth'], ['admin'], |
140 | ], function() { | 140 | ], function() { |
141 | 141 | ||
142 | // выход | 142 | // выход |
143 | Route::get('logout', [AdminController::class, 'logout'])->name('logout'); | 143 | Route::get('logout', [AdminController::class, 'logout'])->name('logout'); |
144 | 144 | ||
145 | // кабинет главная страница | 145 | // кабинет главная страница |
146 | Route::get('cabinet', [AdminController::class, 'index'])->name('index'); | 146 | Route::get('cabinet', [AdminController::class, 'index'])->name('index'); |
147 | 147 | ||
148 | // кабинет профиль админа - форма | 148 | // кабинет профиль админа - форма |
149 | Route::get('profile', [AdminController::class, 'profile'])->name('profile'); | 149 | Route::get('profile', [AdminController::class, 'profile'])->name('profile'); |
150 | // кабинет профиль админа - сохранение формы | 150 | // кабинет профиль админа - сохранение формы |
151 | Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); | 151 | Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); |
152 | 152 | ||
153 | //кабинет сообщения админа | 153 | //кабинет сообщения админа |
154 | //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); | 154 | //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); |
155 | 155 | ||
156 | 156 | ||
157 | // кабинет профиль - форма пароли | 157 | // кабинет профиль - форма пароли |
158 | Route::get('password', [AdminController::class, 'profile_password'])->name('password'); | 158 | Route::get('password', [AdminController::class, 'profile_password'])->name('password'); |
159 | // кабинет профиль - сохранение формы пароля | 159 | // кабинет профиль - сохранение формы пароля |
160 | Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); | 160 | Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); |
161 | 161 | ||
162 | 162 | ||
163 | // кабинет профиль пользователя - форма | 163 | // кабинет профиль пользователя - форма |
164 | Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); | 164 | Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); |
165 | // кабинет профиль пользователя - сохранение формы | 165 | // кабинет профиль пользователя - сохранение формы |
166 | Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); | 166 | Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); |
167 | 167 | ||
168 | // кабинет профиль работодатель - форма | 168 | // кабинет профиль работодатель - форма |
169 | Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); | 169 | Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); |
170 | // кабинет профиль работодатель - сохранение формы | 170 | // кабинет профиль работодатель - сохранение формы |
171 | Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); | 171 | Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); |
172 | // кабинет удаление профиль работодателя и юзера | 172 | // кабинет удаление профиль работодателя и юзера |
173 | Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); | 173 | Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); |
174 | 174 | ||
175 | // кабинет профиль работник - форма | 175 | // кабинет профиль работник - форма |
176 | Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); | 176 | Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); |
177 | Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); | 177 | Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); |
178 | Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); | 178 | Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); |
179 | // кабинет профиль работник - сохранение формы | 179 | // кабинет профиль работник - сохранение формы |
180 | Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); | 180 | Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); |
181 | 181 | ||
182 | // Медиа | 182 | // Медиа |
183 | Route::get('media', [MediaController::class, 'index'])->name('media'); | 183 | Route::get('media', [MediaController::class, 'index'])->name('media'); |
184 | Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media'); | 184 | Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media'); |
185 | 185 | ||
186 | // кабинет настройки сайта - форма | 186 | // кабинет настройки сайта - форма |
187 | Route::get('config', [AdminController::class, 'config_form'])->name('config'); | 187 | Route::get('config', [AdminController::class, 'config_form'])->name('config'); |
188 | // кабинет настройки сайта сохранение формы | 188 | // кабинет настройки сайта сохранение формы |
189 | Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); | 189 | Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); |
190 | 190 | ||
191 | // кабинет - новости | 191 | // кабинет - новости |
192 | Route::get('news-list', [AdminController::class, 'news_admin'])->name('news_admin'); | 192 | Route::get('news-list', [AdminController::class, 'news_admin'])->name('news_admin'); |
193 | Route::get('news/add', [AdminController::class, 'new_admin_add'])->name('new_admin_add'); | 193 | Route::get('news/add', [AdminController::class, 'new_admin_add'])->name('new_admin_add'); |
194 | Route::post('news/add', [AdminController::class, 'new_admin_add_save'])->name('new_admin_save_add'); | 194 | Route::post('news/add', [AdminController::class, 'new_admin_add_save'])->name('new_admin_save_add'); |
195 | Route::get('news/edit/{new}', [AdminController::class, 'new_admin_edit'])->name('new_admin_edit'); | 195 | Route::get('news/edit/{new}', [AdminController::class, 'new_admin_edit'])->name('new_admin_edit'); |
196 | Route::post('news/edit/{new}', [AdminController::class, 'new_admin_update_save'])->name('new_admin_update'); | 196 | Route::post('news/edit/{new}', [AdminController::class, 'new_admin_update_save'])->name('new_admin_update'); |
197 | Route::get('news/delete/{new}', [AdminController::class, 'new_admin_delete'])->name('new_admin_delete'); | 197 | Route::get('news/delete/{new}', [AdminController::class, 'new_admin_delete'])->name('new_admin_delete'); |
198 | 198 | ||
199 | // кабинет - пользователи | 199 | // кабинет - пользователи |
200 | Route::get('users', [UsersController::class, 'index'])->name('users'); | 200 | Route::get('users', [UsersController::class, 'index'])->name('users'); |
201 | 201 | ||
202 | // кабинет - пользователи | 202 | // кабинет - пользователи |
203 | Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); | 203 | Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); |
204 | 204 | ||
205 | // кабинет - работодатели | 205 | // кабинет - работодатели |
206 | Route::get('employers', [EmployersController::class, 'index'])->name('employers'); | 206 | Route::get('employers', [EmployersController::class, 'index'])->name('employers'); |
207 | 207 | ||
208 | Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); | 208 | Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); |
209 | 209 | ||
210 | Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add'); | 210 | Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add'); |
211 | Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save'); | 211 | Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save'); |
212 | Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot'); | 212 | Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot'); |
213 | Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit'); | 213 | Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit'); |
214 | Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete'); | 214 | Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete'); |
215 | 215 | ||
216 | // кабинет - соискатели | 216 | // кабинет - соискатели |
217 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); | 217 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); |
218 | 218 | ||
219 | // кабинет - база данных | 219 | // кабинет - база данных |
220 | Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); | 220 | Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); |
221 | Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); | 221 | Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); |
222 | Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); | 222 | Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); |
223 | Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); | 223 | Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); |
224 | Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); | 224 | Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); |
225 | Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); | 225 | Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); |
226 | Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); | 226 | Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); |
227 | 227 | ||
228 | // кабинет - вакансии | 228 | // кабинет - вакансии |
229 | Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); | 229 | Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); |
230 | Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers'); | 230 | Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers'); |
231 | Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers'); | 231 | Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers'); |
232 | Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); | 232 | Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); |
233 | Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); | 233 | Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); |
234 | Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer'); | 234 | Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer'); |
235 | 235 | ||
236 | // Редактирование должности в вакансии | 236 | // Редактирование должности в вакансии |
237 | Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs'); | 237 | Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs'); |
238 | Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs'); | 238 | Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs'); |
239 | 239 | ||
240 | 240 | ||
241 | // кабинет - категории | 241 | // кабинет - категории |
242 | //Route::get('categories', [AdminController::class, 'index'])->name('categories'); | 242 | //Route::get('categories', [AdminController::class, 'index'])->name('categories'); |
243 | 243 | ||
244 | // СRUD-операции над Справочником Категории | 244 | // СRUD-операции над Справочником Категории |
245 | 245 | ||
246 | Route::resource('categories', CategoryController::class, ['except' => ['show']]); | 246 | Route::resource('categories', CategoryController::class, ['except' => ['show']]); |
247 | 247 | ||
248 | // CRUD-операции над справочником Категории для работодателей | 248 | // CRUD-операции над справочником Категории для работодателей |
249 | Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); | 249 | Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); |
250 | 250 | ||
251 | // CRUD-операции над справочником Образование | 251 | // CRUD-операции над справочником Образование |
252 | Route::resource('education', EducationController::class, ['except' => ['show']]); | 252 | Route::resource('education', EducationController::class, ['except' => ['show']]); |
253 | 253 | ||
254 | Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education'); | 254 | Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education'); |
255 | Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); | 255 | Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); |
256 | Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); | 256 | Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); |
257 | 257 | ||
258 | Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); | 258 | Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); |
259 | Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education'); | 259 | Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education'); |
260 | 260 | ||
261 | Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); | 261 | Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); |
262 | 262 | ||
263 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); | 263 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); |
264 | /* | 264 | /* |
265 | * кабинет - CRUD-операции по справочнику должности | 265 | * кабинет - CRUD-операции по справочнику должности |
266 | * | 266 | * |
267 | */ | 267 | */ |
268 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); | 268 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); |
269 | 269 | ||
270 | // кабинет - сообщения (чтение чужих) | 270 | // кабинет - сообщения (чтение чужих) |
271 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); | 271 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); |
272 | // кабинет - просмотр сообщения чужого (чтение) | 272 | // кабинет - просмотр сообщения чужого (чтение) |
273 | Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); | 273 | Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); |
274 | 274 | ||
275 | // кабинет - сообщения (админские) | 275 | // кабинет - сообщения (админские) |
276 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); | 276 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); |
277 | // кабинет - сообщения (админские) | 277 | // кабинет - сообщения (админские) |
278 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); | 278 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); |
279 | // кабинет - sql - конструкция запросов | 279 | // кабинет - sql - конструкция запросов |
280 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); | 280 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); |
281 | 281 | ||
282 | /* | 282 | /* |
283 | * Расписанный подход в описании каждой директорий групп пользователей. | 283 | * Расписанный подход в описании каждой директорий групп пользователей. |
284 | */ | 284 | */ |
285 | // кабинет - группы пользователей | 285 | // кабинет - группы пользователей |
286 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); | 286 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); |
287 | // кабинет - добавление форма группы пользователей | 287 | // кабинет - добавление форма группы пользователей |
288 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); | 288 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); |
289 | // кабинет - сохранение формы группы пользователей | 289 | // кабинет - сохранение формы группы пользователей |
290 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); | 290 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); |
291 | // кабинет - редактирование форма группы пользователей | 291 | // кабинет - редактирование форма группы пользователей |
292 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); | 292 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); |
293 | // кабинет - сохранение редактированной формы группы пользователей | 293 | // кабинет - сохранение редактированной формы группы пользователей |
294 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); | 294 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); |
295 | // кабинет - удаление группы пользователей | 295 | // кабинет - удаление группы пользователей |
296 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); | 296 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); |
297 | 297 | ||
298 | 298 | ||
299 | // кабинет - список админов | 299 | // кабинет - список админов |
300 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); | 300 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); |
301 | 301 | ||
302 | // справочник Позиции | 302 | // справочник Позиции |
303 | Route::get('positions', [AdminController::class, 'position'])->name('position'); | 303 | Route::get('positions', [AdminController::class, 'position'])->name('position'); |
304 | Route::get('positions/add', [AdminController::class, 'position_add'])->name('add-position'); | 304 | Route::get('positions/add', [AdminController::class, 'position_add'])->name('add-position'); |
305 | Route::post('positions/add', [AdminController::class, 'position_add_save'])->name('add-save-position'); | 305 | Route::post('positions/add', [AdminController::class, 'position_add_save'])->name('add-save-position'); |
306 | Route::get('positions/edit/{position}', [AdminController::class, 'position_edit'])->name('edit-position'); | 306 | Route::get('positions/edit/{position}', [AdminController::class, 'position_edit'])->name('edit-position'); |
307 | Route::post('position/edit/{position}', [AdminController::class, 'position_update'])->name('update-position'); | 307 | Route::post('position/edit/{position}', [AdminController::class, 'position_update'])->name('update-position'); |
308 | Route::get('position/delete/{position}', [AdminController::class, 'position_delete'])->name('delete-position'); | 308 | Route::get('position/delete/{position}', [AdminController::class, 'position_delete'])->name('delete-position'); |
309 | 309 | ||
310 | /////редактор////// кабинет - редактор сайта//////////////////////// | 310 | /////редактор////// кабинет - редактор сайта//////////////////////// |
311 | Route::get('editor-site', function() { | 311 | Route::get('editor-site', function() { |
312 | return view('admin.editor.index'); | 312 | return view('admin.editor.index'); |
313 | })->name('editor-site'); | 313 | })->name('editor-site'); |
314 | 314 | ||
315 | 315 | ||
316 | // кабинет - редактор шапки-футера сайта | 316 | // кабинет - редактор шапки-футера сайта |
317 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); | 317 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); |
318 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); | 318 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); |
319 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); | 319 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); |
320 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); | 320 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); |
321 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); | 321 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); |
322 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); | 322 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); |
323 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); | 323 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); |
324 | 324 | ||
325 | 325 | ||
326 | // кабинет - редактор должности на главной | 326 | // кабинет - редактор должности на главной |
327 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); | 327 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); |
328 | 328 | ||
329 | // кабинет - редактор работодатели на главной | 329 | // кабинет - редактор работодатели на главной |
330 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); | 330 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); |
331 | 331 | ||
332 | 332 | ||
333 | // кабинет - редактор seo-сайта | 333 | // кабинет - редактор seo-сайта |
334 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); | 334 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); |
335 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); | 335 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); |
336 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); | 336 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); |
337 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); | 337 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); |
338 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); | 338 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); |
339 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); | 339 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); |
340 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); | 340 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); |
341 | 341 | ||
342 | 342 | ||
343 | // кабинет - редактор страниц | 343 | // кабинет - редактор страниц |
344 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); | 344 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); |
345 | // кабинет - добавление страницы | 345 | // кабинет - добавление страницы |
346 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); | 346 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); |
347 | // кабинет - сохранение формы страницы | 347 | // кабинет - сохранение формы страницы |
348 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); | 348 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); |
349 | // кабинет - редактирование форма страницы | 349 | // кабинет - редактирование форма страницы |
350 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); | 350 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); |
351 | // кабинет - сохранение редактированной формы страницы | 351 | // кабинет - сохранение редактированной формы страницы |
352 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); | 352 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); |
353 | // кабинет - удаление страницы | 353 | // кабинет - удаление страницы |
354 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); | 354 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); |
355 | 355 | ||
356 | 356 | ||
357 | // кабинет - реклама сайта | 357 | // кабинет - реклама сайта |
358 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); | 358 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); |
359 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); | 359 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); |
360 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); | 360 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); |
361 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); | 361 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); |
362 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); | 362 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); |
363 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); | 363 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); |
364 | //////////////////////////////////////////////////////////////////////// | 364 | //////////////////////////////////////////////////////////////////////// |
365 | 365 | ||
366 | 366 | ||
367 | // кабинет - отзывы о работодателе для модерации | 367 | // кабинет - отзывы о работодателе для модерации |
368 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); | 368 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); |
369 | 369 | ||
370 | // Общая страница статистики | 370 | // Общая страница статистики |
371 | Route::get('statics', function () { | 371 | Route::get('statics', function () { |
372 | return view('admin.static.index'); | 372 | return view('admin.static.index'); |
373 | })->name('statics'); | 373 | })->name('statics'); |
374 | 374 | ||
375 | // кабинет - статистика работников | 375 | // кабинет - статистика работников |
376 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); | 376 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); |
377 | 377 | ||
378 | // кабинет - статистика вакансий работодателя | 378 | // кабинет - статистика вакансий работодателя |
379 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); | 379 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); |
380 | 380 | ||
381 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника | 381 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника |
382 | /* | 382 | /* |
383 | * CRUD-операции над справочником дипломы и документы | 383 | * CRUD-операции над справочником дипломы и документы |
384 | */ | 384 | */ |
385 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); | 385 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); |
386 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); | 386 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); |
387 | 387 | ||
388 | // кабинет - роли пользователя | 388 | // кабинет - роли пользователя |
389 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); | 389 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); |
390 | 390 | ||
391 | Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles'); | 391 | Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles'); |
392 | 392 | ||
393 | Route::get('logs', function() { | 393 | Route::get('logs', function() { |
394 | $files = Storage::files('logs/laravel.log'); | 394 | $files = Storage::files('logs/laravel.log'); |
395 | })->name('logs'); | 395 | })->name('logs'); |
396 | }); | 396 | }); |
397 | 397 | ||
398 | // Инструментальные страницы | 398 | // Инструментальные страницы |
399 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); | 399 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); |
400 | 400 | ||
401 | Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); | 401 | Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); |
402 | 402 | ||
403 | Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); | 403 | Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); |
404 | 404 | ||
405 | // Страницы с произвольным контентом | 405 | // Страницы с произвольным контентом |
406 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); | 406 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); |
407 | 407 | ||
408 | // Публичные страницы соискателя | 408 | // Публичные страницы соискателя |
409 | Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); | 409 | Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); |
410 | 410 | ||
411 | //Страница вакансии | 411 | //Страница вакансии |
412 | Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); | 412 | Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); |
413 | 413 | ||
414 | //Вакансии | 414 | //Вакансии |
415 | Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies'); | 415 | Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies'); |
416 | 416 | ||
417 | //Вакансии поиск на главной | 417 | //Вакансии поиск на главной |
418 | Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies'); | 418 | Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies'); |
419 | 419 | ||
420 | //Вакансии категория детальная | 420 | //Вакансии категория детальная |
421 | Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies'); | 421 | Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies'); |
422 | 422 | ||
423 | // Лайк вакансии | 423 | // Лайк вакансии |
424 | Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy'); | 424 | Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy'); |
425 | 425 | ||
426 | //Детальная страница вакансии - работодателя | 426 | //Детальная страница вакансии - работодателя |
427 | Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie'); | 427 | Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie'); |
428 | 428 | ||
429 | //Судоходные компании | 429 | //Судоходные компании |
430 | Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies'); | 430 | Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies'); |
431 | 431 | ||
432 | //Детальная инфа о компании | 432 | //Детальная инфа о компании |
433 | Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company'); | 433 | Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company'); |
434 | 434 | ||
435 | //Образование | 435 | //Образование |
436 | Route::get('education', [MainController::class, 'education'])->name('education'); | 436 | Route::get('education', [MainController::class, 'education'])->name('education'); |
437 | 437 | ||
438 | //Новости | 438 | //Новости |
439 | Route::get('news', [MainController::class, 'news'])->name('news'); | 439 | Route::get('news', [MainController::class, 'news'])->name('news'); |
440 | Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new'); | 440 | Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new'); |
441 | 441 | ||
442 | //Контакты | 442 | //Контакты |
443 | Route::get('contacts', [MainController::class, 'contacts'])->name('contacts'); | 443 | Route::get('contacts', [MainController::class, 'contacts'])->name('contacts'); |
444 | 444 | ||
445 | //База резюме | 445 | //База резюме |
446 | Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume'); | 446 | Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume'); |
447 | Route::get('bd_resume_danger', function(){ | ||
448 | return view('employers.bd_resume_danger'); | ||
449 | })->name('bd_resume_danger'); | ||
447 | 450 | ||
448 | Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume'); | 451 | Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume'); |
449 | 452 | ||
450 | //Анкета соискателя | 453 | //Анкета соискателя |
451 | Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile'); | 454 | Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile'); |
452 | 455 | ||
453 | //Скачать резюме | 456 | //Скачать резюме |
454 | Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download'); | 457 | Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download'); |
455 | Route::get('resume-download/all', [WorkerController::class, 'resume_download_all'])->name('resume_download_all2'); | 458 | Route::get('resume-download/all', [WorkerController::class, 'resume_download_all'])->name('resume_download_all2'); |
456 | Route::get('resume-download', [WorkerController::class, 'resume_download_all'])->name('resume_download_all'); | 459 | Route::get('resume-download', [WorkerController::class, 'resume_download_all'])->name('resume_download_all'); |
457 | 460 | ||
458 | 461 | ||
459 | //Вход в кабинет | 462 | //Вход в кабинет |
460 | Route::get('login', [MainController::class, 'input_login'])->name('login'); | 463 | Route::get('login', [MainController::class, 'input_login'])->name('login'); |
461 | 464 | ||
462 | // Выход из кабинета | 465 | // Выход из кабинета |
463 | Route::get('logout', [EmployerController::class, 'logout'])->name('logout'); | 466 | Route::get('logout', [EmployerController::class, 'logout'])->name('logout'); |
464 | 467 | ||
465 | Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker'); | 468 | Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker'); |
466 | Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer'); | 469 | Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer'); |
467 | 470 | ||
468 | //восстановление пароля | 471 | //восстановление пароля |
469 | Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password'); | 472 | Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password'); |
470 | // Звезда сообщения | 473 | // Звезда сообщения |
471 | Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer'); | 474 | Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer'); |
472 | 475 | ||
473 | // Борьба | 476 | // Борьба |
474 | Route::get('clear_cookie', function() { | 477 | Route::get('clear_cookie', function() { |
475 | \App\Classes\Cookies_vacancy::clear_vacancy(); | 478 | \App\Classes\Cookies_vacancy::clear_vacancy(); |
476 | return redirect()->route('index'); | 479 | return redirect()->route('index'); |
477 | })->name('clear_cookie'); | 480 | })->name('clear_cookie'); |
478 | 481 | ||
479 | Route::get('cookies', function() { | 482 | Route::get('cookies', function() { |
480 | return view('cookies'); | 483 | return view('cookies'); |
481 | })->name('cookies'); | 484 | })->name('cookies'); |
482 | 485 | ||
483 | // Личный кабинет работник | 486 | // Личный кабинет работник |
484 | Route::group([ | 487 | Route::group([ |
485 | 'as' => 'worker.', // имя маршрута, например auth.index | 488 | 'as' => 'worker.', // имя маршрута, например auth.index |
486 | 'prefix' => 'worker', // префикс маршрута, например auth/index | 489 | 'prefix' => 'worker', // префикс маршрута, например auth/index |
487 | 'middleware' => ['auth'], ['is_worker'], | 490 | 'middleware' => ['auth'], ['is_worker'], |
488 | ], function() { | 491 | ], function() { |
489 | // 1 страница - Моя анкета | 492 | // 1 страница - Моя анкета |
490 | Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); | 493 | Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); |
491 | Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); | 494 | Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); |
492 | 495 | ||
493 | // 2 страница - Сообщения | 496 | // 2 страница - Сообщения |
494 | Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); | 497 | Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); |
495 | Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog'); | 498 | Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog'); |
496 | // 3 страница - Избранные вакансии | 499 | // 3 страница - Избранные вакансии |
497 | Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); | 500 | Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); |
498 | // Продолжение борьбы против колорадов - избранные вакансии | 501 | // Продолжение борьбы против колорадов - избранные вакансии |
499 | Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); | 502 | Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); |
500 | 503 | ||
501 | // 4 страница - Сменить пароль | 504 | // 4 страница - Сменить пароль |
502 | Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); | 505 | Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); |
503 | Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password'); | 506 | Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password'); |
504 | 507 | ||
505 | // 5 страница - Удалить профиль | 508 | // 5 страница - Удалить профиль |
506 | Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); | 509 | Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); |
507 | Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); | 510 | Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); |
508 | 511 | ||
509 | // Резюме -pdf | 512 | // Резюме -pdf |
510 | Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); | 513 | Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); |
511 | 514 | ||
512 | // Поднятие анкеты | 515 | // Поднятие анкеты |
513 | Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); | 516 | Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); |
514 | 517 | ||
515 | // Добавление сертификата | 518 | // Добавление сертификата |
516 | Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate'); | 519 | Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate'); |
517 | Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); | 520 | Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); |
518 | Route::get('кабинет/edit_sertificate/{worker}/{doc}', [WorkerController::class, 'edit_sertificate'])->name('edit_sertificate'); | 521 | Route::get('кабинет/edit_sertificate/{worker}/{doc}', [WorkerController::class, 'edit_sertificate'])->name('edit_sertificate'); |
519 | Route::get('кабинет/edit_sertificate/{doc}', [WorkerController::class, 'update_serificate'])->name('update_serificate'); | 522 | Route::get('кабинет/edit_sertificate/{doc}', [WorkerController::class, 'update_serificate'])->name('update_serificate'); |
520 | Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); | 523 | Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); |
521 | 524 | ||
522 | // Добавление предыдущих контактов компании | 525 | // Добавление предыдущих контактов компании |
523 | Route::get('кабинет/prev_company/{worker}', [WorkerController::class, 'new_prev_company'])->name('new_prev_company'); | 526 | Route::get('кабинет/prev_company/{worker}', [WorkerController::class, 'new_prev_company'])->name('new_prev_company'); |
524 | Route::get('кабинет/add_prev_company', [WorkerController::class, 'add_prev_company'])->name('add_prev_company'); | 527 | Route::get('кабинет/add_prev_company', [WorkerController::class, 'add_prev_company'])->name('add_prev_company'); |
525 | Route::get('кабинет/edit_prev_company/{doc}/{worker}', [WorkerController::class, 'edit_prev_company'])->name('edit_prev_company'); | 528 | Route::get('кабинет/edit_prev_company/{doc}/{worker}', [WorkerController::class, 'edit_prev_company'])->name('edit_prev_company'); |
526 | Route::post('кабинет/update_prev_company/{doc}', [WorkerController::class, 'update_prev_company'])->name('update_prev_company'); | 529 | Route::post('кабинет/update_prev_company/{doc}', [WorkerController::class, 'update_prev_company'])->name('update_prev_company'); |
527 | Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company'); | 530 | Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company'); |
528 | 531 | ||
529 | // Добавление документа-диплома | 532 | // Добавление документа-диплома |
530 | Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); | 533 | Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); |
531 | Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); | 534 | Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); |
532 | Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom'); | 535 | Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom'); |
533 | 536 | ||
534 | // Добавление стандартного диплома | 537 | // Добавление стандартного диплома |
535 | Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); | 538 | Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); |
536 | Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); | 539 | Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); |
537 | Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); | 540 | Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); |
538 | Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); | 541 | Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); |
539 | Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); | 542 | Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); |
540 | 543 | ||
541 | // Отправка сообщения работодателю от соискателя | 544 | // Отправка сообщения работодателю от соискателя |
542 | Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message'); | 545 | Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message'); |
543 | }); | 546 | }); |
544 | 547 | ||
545 | // Личный кабинет работодателя | 548 | // Личный кабинет работодателя |
546 | Route::group([ | 549 | Route::group([ |
547 | 'as' => 'employer.', // имя маршрута, например auth.index | 550 | 'as' => 'employer.', // имя маршрута, например auth.index |
548 | 'prefix' => 'employer', // префикс маршрута, например auth/index | 551 | 'prefix' => 'employer', // префикс маршрута, например auth/index |
549 | 'middleware' => ['auth'], !['is_worker'], | 552 | 'middleware' => ['auth'], !['is_worker'], |
550 | ], function() { | 553 | ], function() { |
551 | // 0 страница - Личные данные работодателя | 554 | // 0 страница - Личные данные работодателя |
552 | Route::get('cabinet/employer_info', [EmployerController::class, 'employer_info'])->name('employer_info'); | 555 | Route::get('cabinet/employer_info', [EmployerController::class, 'employer_info'])->name('employer_info'); |
553 | Route::post('cabinet/employer_info/{user}', [EmployerController::class, 'employer_info_save'])->name('employer_info_save'); | 556 | Route::post('cabinet/employer_info/{user}', [EmployerController::class, 'employer_info_save'])->name('employer_info_save'); |
554 | 557 | ||
555 | // 1 страница - Профиль | 558 | // 1 страница - Профиль |
556 | Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); | 559 | Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); |
557 | Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); | 560 | Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); |
558 | Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); | 561 | Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); |
559 | Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); | 562 | Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); |
560 | Route::get('cabinet/flot_edit/{Flot}/{Employer}', [EmployerController::class, 'edit_flot'])->name('edit_flot'); | 563 | Route::get('cabinet/flot_edit/{Flot}/{Employer}', [EmployerController::class, 'edit_flot'])->name('edit_flot'); |
561 | Route::post('cabinet/flot_edit/{Flot}', [EmployerController::class, 'update_flot'])->name('update_flot_save'); | 564 | Route::post('cabinet/flot_edit/{Flot}', [EmployerController::class, 'update_flot'])->name('update_flot_save'); |
562 | Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot'); | 565 | Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot'); |
563 | 566 | ||
564 | // 2 страница - Добавление вакансий | 567 | // 2 страница - Добавление вакансий |
565 | Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); | 568 | Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); |
566 | Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); | 569 | Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); |
570 | Route::get('cabinet/vacancie_danger', [EmployerController::class, 'cabinet_vacancie_danger'])->name('cabinet_vacancie_danger'); | ||
571 | |||
567 | 572 | ||
568 | Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); | 573 | Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); |
569 | 574 | ||
570 | // 3 страница - Мои вакансии | 575 | // 3 страница - Мои вакансии |
571 | Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); | 576 | Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); |
572 | Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); | 577 | Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); |
573 | Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); | 578 | Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); |
574 | Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); | 579 | Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); |
575 | Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); | 580 | Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); |
576 | Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); | 581 | Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); |
577 | Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); | 582 | Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); |
578 | 583 | ||
579 | // 4.1Ю. | 584 | // 4.1Ю. |
580 | Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac'); | 585 | Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac'); |
581 | Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save'); | 586 | Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save'); |
582 | Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac'); | 587 | Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac'); |
583 | Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save'); | 588 | Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save'); |
584 | Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac'); | 589 | Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac'); |
585 | 590 | ||
586 | // 4 страница - Отклики на вакансии | 591 | // 4 страница - Отклики на вакансии |
587 | Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); | 592 | Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); |
588 | Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); | 593 | Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); |
589 | Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); | 594 | Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); |
590 | 595 | ||
591 | // 5 страница - Сообщения | 596 | // 5 страница - Сообщения |
592 | Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); | 597 | Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); |
593 | Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); | 598 | Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); |
594 | Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); | 599 | Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); |
595 | Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); | 600 | Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); |
596 | 601 | ||
597 | // 6 страница - Избранный | 602 | // 6 страница - Избранный |
598 | Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); | 603 | Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); |
599 | 604 | ||
600 | //7 страница - База данных | 605 | //7 страница - База данных |
601 | Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); | 606 | Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); |
602 | 607 | ||
603 | //8 страница - База резюме | 608 | //8 страница - База резюме |
604 | Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); | 609 | Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); |
605 | 610 | ||
606 | // 9 рассылка сообщений | 611 | // 9 рассылка сообщений |
607 | Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); | 612 | Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); |
608 | Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); | 613 | Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); |
609 | 614 | ||
610 | // 10 страница FAQ вопросы | 615 | // 10 страница FAQ вопросы |
611 | Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq'); | 616 | Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq'); |
612 | 617 | ||
613 | // 11 страница - Настройка уведомлений | 618 | // 11 страница - Настройка уведомлений |
614 | Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); | 619 | Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); |
615 | Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); | 620 | Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); |
616 | 621 | ||
617 | // 12 страница - Сменить пароль | 622 | // 12 страница - Сменить пароль |
618 | Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); | 623 | Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); |
619 | Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); | 624 | Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); |
620 | 625 | ||
621 | // 13 страница - Удаление профиля | 626 | // 13 страница - Удаление профиля |
622 | Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); | 627 | Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); |
623 | Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); | 628 | Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); |
624 | Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); | 629 | Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); |
625 | 630 | ||
626 | // Отправил сообщение | 631 | // Отправил сообщение |
627 | Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); | 632 | Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); |
628 | }); | 633 | }); |
629 | 634 | ||
630 | Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker'); | 635 | Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker'); |
631 | 636 | ||
632 | 637 |