Commit 7243b8e24ff5eeb747552407780e71e7abb36141

Authored by Андрей Ларионов
1 parent b5178c9a13

Обновление проекта по багам от 19 числа

Showing 9 changed files with 152 additions and 10 deletions Inline Diff

app/Http/Controllers/MainController.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\Mail\MailRegistration; 7 use App\Mail\MailRegistration;
8 use App\Mail\MailRepair; 8 use App\Mail\MailRepair;
9 use App\Models\Ad_employer; 9 use App\Models\Ad_employer;
10 use App\Models\Ad_jobs; 10 use App\Models\Ad_jobs;
11 use App\Models\Category; 11 use App\Models\Category;
12 use App\Models\Education; 12 use App\Models\Education;
13 use App\Models\Employer; 13 use App\Models\Employer;
14 use App\Models\employers_main; 14 use App\Models\employers_main;
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\News; 18 use App\Models\News;
19 use App\Models\Positions; 19 use App\Models\Positions;
20 use App\Models\reclame; 20 use App\Models\reclame;
21 use App\Models\User; 21 use App\Models\User;
22 use Illuminate\Http\Request; 22 use Illuminate\Http\Request;
23 use Illuminate\Support\Facades\Auth; 23 use Illuminate\Support\Facades\Auth;
24 use Illuminate\Support\Facades\DB; 24 use Illuminate\Support\Facades\DB;
25 use Illuminate\Support\Facades\Hash; 25 use Illuminate\Support\Facades\Hash;
26 use Illuminate\Support\Facades\Mail; 26 use Illuminate\Support\Facades\Mail;
27 use Illuminate\Support\Facades\Validator; 27 use Illuminate\Support\Facades\Validator;
28 use App\Classes\StatusUser; 28 use App\Classes\StatusUser;
29 29
30 class MainController extends Controller 30 class MainController extends Controller
31 { 31 {
32 // Главная страница публичной части 32 // Главная страница публичной части
33 public function index() { 33 public function index() {
34 $news = News::query()->orderByDesc('id')->limit(6)->get(); 34 $news = News::query()->orderByDesc('id')->limit(6)->get();
35 35
36 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') 36 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*')
37 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') 37 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id')
38 ->OrderByDesc('created_at') 38 ->OrderByDesc('created_at')
39 ->GroupBy('categories.id') 39 ->GroupBy('categories.id')
40 ->get(); 40 ->get();
41 41
42 $Position = Category::query()->where('is_remove', '=', '0')->get(); 42 $Position = Category::query()->where('is_remove', '=', '0')->get();
43 $job_titles = Job_title::query()->where('is_remove', '=', 0)->get(); 43 $job_titles = Job_title::query()->where('is_remove', '=', 0)->get();
44 /*$BigFlot = Array(); 44 /*$BigFlot = Array();
45 foreach ($Position as $position) { 45 foreach ($Position as $position) {
46 $BigFlot[] = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')-> 46 $BigFlot[] = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')->
47 orderBy('job_titles.sort')-> 47 orderBy('job_titles.sort')->
48 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 48 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
49 where('position_ship', "$position->name")-> 49 where('position_ship', "$position->name")->
50 groupby('job_title_id','position_ship')-> 50 groupby('job_title_id','position_ship')->
51 get(); 51 get();
52 } 52 }
53 $BigFlot = Array(); 53 $BigFlot = Array();
54 foreach ($Position as $position) { 54 foreach ($Position as $position) {
55 $BigFlot[] = Ad_jobs::query()->with(['job_title' => function($query) { 55 $BigFlot[] = Ad_jobs::query()->with(['job_title' => function($query) {
56 $query->OrderBy('sort'); 56 $query->OrderBy('sort');
57 }])->whereHas('job_title', function ($query) use ($position) { 57 }])->whereHas('job_title', function ($query) use ($position) {
58 $query->where('position_id', $position->id); 58 $query->where('position_id', $position->id);
59 })-> 59 })->
60 distinct('job_title_id')-> 60 distinct('job_title_id')->
61 get(); 61 get();
62 }*/ 62 }*/
63 /*$BigFlot = Array(); 63 /*$BigFlot = Array();
64 foreach ($Position as $position) { 64 foreach ($Position as $position) {
65 $BigFlot[$position->id] = DB::table('ad_jobs')-> 65 $BigFlot[$position->id] = DB::table('ad_jobs')->
66 selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name, job_titles.position_id')-> 66 selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name, job_titles.position_id')->
67 orderByDesc('job_titles.sort')-> 67 orderByDesc('job_titles.sort')->
68 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 68 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
69 where('job_titles.position_id', $position->id)-> 69 where('job_titles.position_id', $position->id)->
70 groupby('job_title_id')-> 70 groupby('job_title_id')->
71 get(); 71 get();
72 }*/ 72 }*/
73 $Data = DB::table('job_titles')-> 73 $Data = DB::table('job_titles')->
74 selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')-> 74 selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')->
75 where('categories.is_remove', '=', '0')-> 75 where('categories.is_remove', '=', '0')->
76 where('job_titles.is_remove', '=', '0')-> 76 where('job_titles.is_remove', '=', '0')->
77 leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')-> 77 leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')->
78 join('categories', 'categories.id', '=', 'job_titles.position_id')-> 78 join('categories', 'categories.id', '=', 'job_titles.position_id')->
79 groupBy('job_titles.id')->orderByDesc('job_titles.position_id')-> 79 groupBy('job_titles.id')->orderByDesc('job_titles.position_id')->
80 orderByDesc('job_titles.sort')->get()->toArray(); 80 orderByDesc('job_titles.sort')->get()->toArray();
81 81
82 $Main_Job = array(); 82 $Main_Job = array();
83 $name_cat = ''; 83 $name_cat = '';
84 foreach ($Data as $it) { 84 foreach ($Data as $it) {
85 $it_arr = (array)$it; 85 $it_arr = (array)$it;
86 if ($name_cat != $it_arr['catname']) $name_cat = $it_arr['catname']; 86 if ($name_cat != $it_arr['catname']) $name_cat = $it_arr['catname'];
87 $Main_Job[$name_cat][] = $it_arr; 87 $Main_Job[$name_cat][] = $it_arr;
88 } 88 }
89 89
90 $employers = employers_main::query()->with('employer')->orderBy('id')->limit(8)->get(); 90 $employers = employers_main::query()->with('employer')->orderBy('id')->limit(8)->get();
91 $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get(); 91 $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get();
92 return view('index', compact('news', 'job_titles', 'categories', 'employers', 'vacancy', 'Main_Job')); 92 return view('index', compact('news', 'job_titles', 'categories', 'employers', 'vacancy', 'Main_Job'));
93 } 93 }
94 94
95 public function search_vacancies(Request $request) { 95 public function search_vacancies(Request $request) {
96 if ($request->has('search')) { 96 if ($request->has('search')) {
97 $search = $request->get('search'); 97 $search = $request->get('search');
98 $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first(); 98 $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first();
99 if (isset($job_titles->id)) 99 if (isset($job_titles->id))
100 if ($job_titles->id > 0) 100 if ($job_titles->id > 0)
101 return redirect()->route('vacancies', ['job' => $job_titles->id]); 101 return redirect()->route('vacancies', ['job' => $job_titles->id]);
102 } 102 }
103 } 103 }
104 104
105 // Лайк вакансии 105 // Лайк вакансии
106 public function like_vacancy(Request $request) { 106 public function like_vacancy(Request $request) {
107 $IP_address = RusDate::ip_addr_client(); 107 $IP_address = RusDate::ip_addr_client();
108 108
109 if ($request->has('code_record')) { 109 if ($request->has('code_record')) {
110 if ($request->has('delete')) { 110 if ($request->has('delete')) {
111 $atomic_era = Like_vacancy::select('id')-> 111 $atomic_era = Like_vacancy::select('id')->
112 where('code_record', '=', $request-> 112 where('code_record', '=', $request->
113 get('code_record'))->first(); 113 get('code_record'))->first();
114 114
115 DB::table('like_vacancy')->where('code_record', $request->get('code_record'))->delete(); 115 DB::table('like_vacancy')->where('code_record', $request->get('code_record'))->delete();
116 116
117 } else { 117 } else {
118 $params = $request->all(); 118 $params = $request->all();
119 $params['ip_address'] = $IP_address; 119 $params['ip_address'] = $IP_address;
120 Like_vacancy::create($params); 120 Like_vacancy::create($params);
121 } 121 }
122 } 122 }
123 } 123 }
124 124
125 // Лайк соискателю. 125 // Лайк соискателю.
126 public function like_worker(Request $request) { 126 public function like_worker(Request $request) {
127 $IP_address = RusDate::ip_addr_client(); 127 $IP_address = RusDate::ip_addr_client();
128 128
129 if ($request->has('code_record')) { 129 if ($request->has('code_record')) {
130 if ($request->has('delete')) { 130 if ($request->has('delete')) {
131 $atomic_era = Like_worker::select('id')-> 131 $atomic_era = Like_worker::select('id')->
132 where('code_record', '=', $request-> 132 where('code_record', '=', $request->
133 get('code_record'))->first(); 133 get('code_record'))->first();
134 134
135 DB::table('like_worker')->where('code_record', $request->get('code_record'))->delete(); 135 DB::table('like_worker')->where('code_record', $request->get('code_record'))->delete();
136 136
137 return "Вот и результат удаления!"; 137 return "Вот и результат удаления!";
138 138
139 } else { 139 } else {
140 $params = $request->all(); 140 $params = $request->all();
141 $params['ip_address'] = $IP_address; 141 $params['ip_address'] = $IP_address;
142 Like_worker::create($params); 142 Like_worker::create($params);
143 } 143 }
144 } 144 }
145 } 145 }
146 146
147 public function vacancies(Request $request) { 147 public function vacancies(Request $request) {
148 //должности 148 //должности
149 $Job_title = Job_title::query()->where('is_remove', '=', '0')->orderBy('name')->get(); 149 $Job_title = Job_title::query()->where('is_remove', '=', '0')->orderBy('name')->get();
150 150
151 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') 151 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*')
152 ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary') 152 ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary')
153 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') 153 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id')
154 ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id'); 154 ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id');
155 155
156 //категории и вакансии 156 //категории и вакансии
157 if (($request->has('job')) && ($request->get('job') > 0)) { 157 if (($request->has('job')) && ($request->get('job') > 0)) {
158 $categories = $categories->Where('job_title_id', '=', $request->get('job')); 158 $categories = $categories->Where('job_title_id', '=', $request->get('job'));
159 } 159 }
160 160
161 $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get(); 161 $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get();
162 162
163 //$Position = Category::query()->where('is_remove', '=', '0')->get(); 163 //$Position = Category::query()->where('is_remove', '=', '0')->get();
164 164
165 /*$BigFlot = Array(); 165 /*$BigFlot = Array();
166 foreach ($Position as $position) { 166 foreach ($Position as $position) {
167 $War_flot = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')-> 167 $War_flot = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')->
168 orderBy('job_titles.sort')-> 168 orderBy('job_titles.sort')->
169 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 169 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
170 where('position_ship', "$position->name"); 170 where('position_ship', "$position->name");
171 if (($request->has('job')) && ($request->get('job') > 0)) { 171 if (($request->has('job')) && ($request->get('job') > 0)) {
172 $War_flot = $War_flot->where('job_title_id', $request->get('job')); 172 $War_flot = $War_flot->where('job_title_id', $request->get('job'));
173 } 173 }
174 $War_flot = $War_flot->groupby('job_title_id','position_ship')->get(); 174 $War_flot = $War_flot->groupby('job_title_id','position_ship')->get();
175 $BigFlot[] = $War_flot; 175 $BigFlot[] = $War_flot;
176 }*/ 176 }*/
177 /* 177 /*
178 $BigFlot = Array(); 178 $BigFlot = Array();
179 foreach ($Position as $position) { 179 foreach ($Position as $position) {
180 $WarFlot = DB::table('ad_jobs')-> 180 $WarFlot = DB::table('ad_jobs')->
181 selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')-> 181 selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')->
182 orderByDesc('job_titles.sort')-> 182 orderByDesc('job_titles.sort')->
183 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 183 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
184 where('job_titles.position_id', $position->id); 184 where('job_titles.position_id', $position->id);
185 if (($request->has('job')) && ($request->get('job') > 0)) { 185 if (($request->has('job')) && ($request->get('job') > 0)) {
186 $WarFlot = $WarFlot->where('job_title_id', $request->get('job')); 186 $WarFlot = $WarFlot->where('job_title_id', $request->get('job'));
187 } 187 }
188 $WarFlot = $WarFlot->groupby('job_title_id')->get(); 188 $WarFlot = $WarFlot->groupby('job_title_id')->get();
189 $BigFlot[] = $WarFlot; 189 $BigFlot[] = $WarFlot;
190 } 190 }
191 */ 191 */
192 192
193 $Data = DB::table('job_titles')-> 193 $Data = DB::table('job_titles')->
194 selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')-> 194 selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')->
195 where('categories.is_remove', '=', '0')-> 195 where('categories.is_remove', '=', '0')->
196 where('job_titles.is_remove', '=', '0'); 196 where('job_titles.is_remove', '=', '0');
197 if (($request->has('job')) && ($request->get('job') > 0)) { 197 if (($request->has('job')) && ($request->get('job') > 0)) {
198 $Data = $Data->where('job_title_id', $request->get('job')); 198 $Data = $Data->where('job_title_id', $request->get('job'));
199 } 199 }
200 $Data = $Data->leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')-> 200 $Data = $Data->leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')->
201 join('categories', 'categories.id', '=', 'job_titles.position_id')-> 201 join('categories', 'categories.id', '=', 'job_titles.position_id')->
202 groupBy('job_titles.id')->orderByDesc('job_titles.position_id')-> 202 groupBy('job_titles.id')->orderByDesc('job_titles.position_id')->
203 orderByDesc('job_titles.sort')->get()->toArray(); 203 orderByDesc('job_titles.sort')->get()->toArray();
204 204
205 $Main_Job = array(); 205 $Main_Job = array();
206 $name_cat = ''; 206 $name_cat = '';
207 foreach ($Data as $it) { 207 foreach ($Data as $it) {
208 $it_arr = (array)$it; 208 $it_arr = (array)$it;
209 if ($name_cat != $it_arr['catname']) 209 if ($name_cat != $it_arr['catname'])
210 $name_cat = $it_arr['catname']; 210 $name_cat = $it_arr['catname'];
211 $Main_Job[$name_cat][] = $it_arr; 211 $Main_Job[$name_cat][] = $it_arr;
212 } 212 }
213 213
214 if ($request->ajax()) { 214 if ($request->ajax()) {
215 return view('ajax.new_sky', compact('categories', 'Main_Job')); 215 return view('ajax.new_sky', compact('categories', 'Main_Job'));
216 } else { 216 } else {
217 return view('new_sky', compact('Job_title', 'categories', 'Main_Job')); 217 return view('new_sky', compact('Job_title', 'categories', 'Main_Job'));
218 } 218 }
219 } 219 }
220 220
221 //Вакансии категория детальная 221 //Вакансии категория детальная
222 public function list_vacancies(Category $categories, Request $request) { 222 public function list_vacancies(Category $categories, Request $request) {
223 if (isset(Auth()->user()->id)) 223 if (isset(Auth()->user()->id))
224 $uid = Auth()->user()->id; 224 $uid = Auth()->user()->id;
225 else 225 else
226 $uid = 0; 226 $uid = 0;
227 227
228 if ($request->get('job') == 0) 228 if ($request->get('job') == 0)
229 $job_search = ''; 229 $job_search = '';
230 else 230 else
231 $job_search = $request->get('job'); 231 $job_search = $request->get('job');
232 232
233 $Query = Ad_employer::with('jobs')-> 233 $Query = Ad_employer::with('jobs')->
234 with('cat')-> 234 with('cat')->
235 with('employer')-> 235 with('employer')->
236 236
237 whereHas('jobs_code', function ($query) use ($job_search) { 237 whereHas('jobs_code', function ($query) use ($job_search) {
238 if (!empty($job_search)) { 238 if (!empty($job_search)) {
239 $query->where('job_title_id', $job_search); 239 $query->where('job_title_id', $job_search);
240 } 240 }
241 })->select('ad_employers.*'); 241 })->select('ad_employers.*');
242 242
243 if (isset($categories->id) && ($categories->id > 0)) { 243 if (isset($categories->id) && ($categories->id > 0)) {
244 $Query = $Query->where('category_id', '=', $categories->id); 244 $Query = $Query->where('category_id', '=', $categories->id);
245 $Name_categori = Category::query()->where('id', '=', $categories->id)->get(); 245 $Name_categori = Category::query()->where('id', '=', $categories->id)->get();
246 } else { 246 } else {
247 $Name_categori = ''; 247 $Name_categori = '';
248 } 248 }
249 249
250 if ($request->get('sort')) { 250 if ($request->get('sort')) {
251 $sort = $request->get('sort'); 251 $sort = $request->get('sort');
252 switch ($sort) { 252 switch ($sort) {
253 case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break; 253 case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break;
254 case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break; 254 case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break;
255 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; 255 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
256 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; 256 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
257 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; 257 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
258 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; 258 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break;
259 } 259 }
260 } 260 }
261 261
262 $Job_title = Job_title::query()->OrderBy('name')->get(); 262 $Job_title = Job_title::query()->OrderBy('name')->get();
263 263
264 $Query_count = $Query->count(); 264 $Query_count = $Query->count();
265 265
266 $Query = $Query->OrderBy('updated_at')->paginate(3); 266 $Query = $Query->OrderBy('updated_at')->paginate(3);
267 267
268 $Reclama = reclame::query()->get(); 268 $Reclama = reclame::query()->get();
269 269
270 if ($request->ajax()) { 270 if ($request->ajax()) {
271 if ($request->has('title')) { 271 if ($request->has('title')) {
272 return view('ajax.list_category', compact( 272 return view('ajax.list_category', compact(
273 'Name_categori' 273 'Name_categori'
274 )); 274 ));
275 } else { 275 } else {
276 return view('ajax.list_vacancies', compact('Query', 276 return view('ajax.list_vacancies', compact('Query',
277 'Query_count', 277 'Query_count',
278 'Name_categori', 278 'Name_categori',
279 'Reclama', 279 'Reclama',
280 'categories', 280 'categories',
281 'Job_title', 281 'Job_title',
282 'uid')); 282 'uid'));
283 } 283 }
284 } else { 284 } else {
285 //Вернуть все 285 //Вернуть все
286 return view('list_vacancies', compact('Query', 286 return view('list_vacancies', compact('Query',
287 'Query_count', 287 'Query_count',
288 'Reclama', 288 'Reclama',
289 'Name_categori', 289 'Name_categori',
290 'categories', 290 'categories',
291 'Job_title', 291 'Job_title',
292 'uid')); 292 'uid'));
293 } 293 }
294 } 294 }
295 295
296 // Образование 296 // Образование
297 public function education(Request $request) { 297 public function education(Request $request) {
298 $educations = Education::query(); 298 $educations = Education::query();
299 if (($request->has('search')) && (!empty($request->get('search')))) { 299 if (($request->has('search')) && (!empty($request->get('search')))) {
300 $search = trim($request->get('search')); 300 $search = trim($request->get('search'));
301 $educations = $educations->where('name', 'LIKE', "%$search%"); 301 $educations = $educations->where('name', 'LIKE', "%$search%");
302 } 302 }
303 303
304 if ($request->get('sort')) { 304 if ($request->get('sort')) {
305 $sort = $request->get('sort'); 305 $sort = $request->get('sort');
306 switch ($sort) { 306 switch ($sort) {
307 case 'name_up': $educations = $educations->orderBy('name')->orderBy('id'); break; 307 case 'name_up': $educations = $educations->orderBy('name')->orderBy('id'); break;
308 case 'name_down': $educations = $educations->orderByDesc('name')->orderby('id'); break; 308 case 'name_down': $educations = $educations->orderByDesc('name')->orderby('id'); break;
309 case 'created_at_up': $educations = $educations->OrderBy('created_at')->orderBy('id'); break; 309 case 'created_at_up': $educations = $educations->OrderBy('created_at')->orderBy('id'); break;
310 case 'created_at_down': $educations = $educations->orderByDesc('created_at')->orderBy('id'); break; 310 case 'created_at_down': $educations = $educations->orderByDesc('created_at')->orderBy('id'); break;
311 case 'default': $educations = $educations->orderBy('id')->orderby('updated_at'); break; 311 case 'default': $educations = $educations->orderBy('id')->orderby('updated_at'); break;
312 default: $educations = $educations->orderBy('id')->orderby('updated_at'); break; 312 default: $educations = $educations->orderBy('id')->orderby('updated_at'); break;
313 } 313 }
314 } 314 }
315 315
316 $count_edu = $educations->count(); 316 $count_edu = $educations->count();
317 $educations = $educations->paginate(6); 317 $educations = $educations->paginate(6);
318 if ($request->ajax()) { 318 if ($request->ajax()) {
319 return view('ajax.education', compact('educations')); 319 return view('ajax.education', compact('educations'));
320 } else { 320 } else {
321 return view('education', compact('educations', 'count_edu')); 321 return view('education', compact('educations', 'count_edu'));
322 } 322 }
323 } 323 }
324 324
325 // Контакты 325 // Контакты
326 public function contacts() { 326 public function contacts() {
327 return view('contacts'); 327 return view('contacts');
328 } 328 }
329 329
330 // Вход в личный кабинет 330 // Вход в личный кабинет
331 public function input_login(Request $request) 331 public function input_login(Request $request)
332 { 332 {
333 $params = $request->all(); 333 $params = $request->all();
334 334
335 335
336 $rules = [ 336 $rules = [
337 'email' => 'required|string|email', 337 'email' => 'required|string|email',
338 'password' => 'required|string|min:3|max:25', 338 'password' => 'required|string|min:3|max:25',
339 ]; 339 ];
340 340
341 $messages = [ 341 $messages = [
342 'required' => 'Укажите обязательное поле «:attribute»', 342 'required' => 'Укажите обязательное поле «:attribute»',
343 'email' => 'Введите корректный email', 343 'email' => 'Введите корректный email',
344 'min' => [ 344 'min' => [
345 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 345 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
346 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 346 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
347 ], 347 ],
348 'max' => [ 348 'max' => [
349 'string' => 'Поле «:attribute» должно быть не больше :max символов', 349 'string' => 'Поле «:attribute» должно быть не больше :max символов',
350 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 350 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
351 ], 351 ],
352 ]; 352 ];
353 $validator = Validator::make($request->all(), $rules, $messages); 353 $validator = Validator::make($request->all(), $rules, $messages);
354 if ($validator->fails()) { 354 if ($validator->fails()) {
355 $user_id = $request->user()->id; 355 if (Auth::check())
356 $user_id = $request->user()->id;
357 else
358 $user_id = 0;
359
356 if ($user_id > 0) 360 if ($user_id > 0)
357 return json_encode(Array("ERROR" => "Email или пароль невалидный!")); 361 return json_encode(Array("ERROR" => "Email или пароль невалидный!"));
358 else 362 else
359 return redirect()->route('index')->with('Error', "Email или пароль невалидный"); 363 return redirect()->route('index')->with('Error', "Email или пароль невалидный");
360 } else { 364 } else {
361 $credentials = $request->only('email', 'password'); 365 $credentials = $request->only('email', 'password');
362 366
363 if (Auth::attempt($credentials, $request->has('remember'))) { 367 if (Auth::attempt($credentials, $request->has('remember'))) {
364 368
365 if (is_null(Auth::user()->email_verified_at)) { 369 if (is_null(Auth::user()->email_verified_at)) {
366 Auth::logout(); 370 Auth::logout();
367 return json_encode(Array("ERROR" => "Адрес почты не подтвержден")); 371 return json_encode(Array("ERROR" => "Адрес почты не подтвержден"));
368 } 372 }
369 373
370 if (Auth::user()->is_worker) { 374 if (Auth::user()->is_worker) {
371 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl())); 375 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));
372 } else { 376 } else {
373 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl())); 377 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));
374 } 378 }
375 379
376 return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет")); 380 return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет"));
377 //->route('index') 381 //->route('index')
378 //->with('success', 'Вы вошли в личный кабинет.'); 382 //->with('success', 'Вы вошли в личный кабинет.');
379 } else { 383 } else {
380 return json_encode(Array("ERROR" => "Неверный логин или пароль!")); 384 return json_encode(Array("ERROR" => "Неверный логин или пароль!"));
381 } 385 }
382 } 386 }
383 } 387 }
384 388
385 // Восстановление пароля 389 // Восстановление пароля
386 public function repair_password(Request $request) { 390 public function repair_password(Request $request) {
387 $rules = [ 391 $rules = [
388 'email' => 'required|string|email', 392 'email' => 'required|string|email',
389 ]; 393 ];
390 394
391 $messages = [ 395 $messages = [
392 'required' => 'Укажите обязательное поле «:attribute»', 396 'required' => 'Укажите обязательное поле «:attribute»',
393 'email' => 'Введите корректный email', 397 'email' => 'Введите корректный email',
394 'min' => [ 398 'min' => [
395 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 399 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
396 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 400 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
397 ], 401 ],
398 'max' => [ 402 'max' => [
399 'string' => 'Поле «:attribute» должно быть не больше :max символов', 403 'string' => 'Поле «:attribute» должно быть не больше :max символов',
400 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 404 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
401 ], 405 ],
402 ]; 406 ];
403 407
404 $validator = Validator::make($request->all(), $rules, $messages); 408 $validator = Validator::make($request->all(), $rules, $messages);
405 409
406 if ($validator->fails()) { 410 if ($validator->fails()) {
407 return redirect()->back()->with('Error', "Email невалидный"); 411 return redirect()->back()->with('Error', "Email невалидный");
408 } else { 412 } else {
409 $new_password = Tools::generator_id(10); 413 $new_password = Tools::generator_id(10);
410 $hash_password = Hash::make($new_password); 414 $hash_password = Hash::make($new_password);
411 $user = User::query()->where('email', $request->get('email'))->first(); 415 $user = User::query()->where('email', $request->get('email'))->first();
412 $EditRec = User::find($user->id); 416 $EditRec = User::find($user->id);
413 $EditRec->password = $hash_password; 417 $EditRec->password = $hash_password;
414 $EditRec->save(); 418 $EditRec->save();
415 419
416 foreach ([$request->get('email')] as $recipient) { 420 foreach ([$request->get('email')] as $recipient) {
417 Mail::to($recipient)->send(new MailRepair($new_password)); 421 Mail::to($recipient)->send(new MailRepair($new_password));
418 } 422 }
419 return redirect()->route('index'); 423 return redirect()->route('index');
420 424
421 } 425 }
422 426
423 } 427 }
424 428
425 // Вывод новостей 429 // Вывод новостей
426 public function news(Request $request) { 430 public function news(Request $request) {
427 $Query = News::query(); 431 $Query = News::query();
428 if ($request->has('search')) { 432 if ($request->has('search')) {
429 $search = $request->get('search'); 433 $search = $request->get('search');
430 $Query = $Query->where('title', 'LIKE', "%$search%")-> 434 $Query = $Query->where('title', 'LIKE', "%$search%")->
431 orWhere('text', 'LIKE', "%$search%"); 435 orWhere('text', 'LIKE', "%$search%");
432 } 436 }
433 437
434 if ($request->ajax()) { 438 if ($request->ajax()) {
435 if ($request->get('sort')) { 439 if ($request->get('sort')) {
436 $sort = $request->get('sort'); 440 $sort = $request->get('sort');
437 switch ($sort) { 441 switch ($sort) {
438 case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break; 442 case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break;
439 case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break; 443 case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break;
440 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; 444 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
441 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; 445 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
442 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; 446 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
443 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; 447 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break;
444 } 448 }
445 } 449 }
446 } 450 }
447 $Query_count = $Query->count(); 451 $Query_count = $Query->count();
448 $Query = $Query->paginate(6); 452 $Query = $Query->paginate(6);
449 453
450 if ($request->ajax()) { 454 if ($request->ajax()) {
451 return view('ajax.news-list', compact('Query', 'Query_count')); 455 return view('ajax.news-list', compact('Query', 'Query_count'));
452 } else { 456 } else {
453 return view('news-list', compact('Query', 'Query_count')); 457 return view('news-list', compact('Query', 'Query_count'));
454 } 458 }
455 } 459 }
456 460
457 //Детальная новость 461 //Детальная новость
458 public function detail_new(News $new) { 462 public function detail_new(News $new) {
459 // Наборка 463 // Наборка
460 $Query = News::query()->where('id', $new->id)->get(); 464 $Query = News::query()->where('id', $new->id)->get();
461 $title = $Query[0]->title; 465 $title = $Query[0]->title;
462 $All_Query = News::query()->paginate(8); 466 $All_Query = News::query()->paginate(8);
463 return view('detail_new', compact('Query', 'All_Query', 'title')); 467 return view('detail_new', compact('Query', 'All_Query', 'title'));
464 } 468 }
465 } 469 }
466 470
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 if (isset(Auth()->user()->id)) { 76 if (isset(Auth()->user()->id)) {
77 $idiot = Auth()->user()->id; 77 $idiot = Auth()->user()->id;
78 } else { 78 } else {
79 $idiot = 0; 79 $idiot = 0;
80 } 80 }
81 81
82 $status_work = $this->status_work; 82 $status_work = $this->status_work;
83 $resumes = Worker::query()->with('users')->with('job_titles'); 83 $resumes = Worker::query()->with('users')->with('job_titles');
84 $resumes = $resumes->whereHas('users', function (Builder $query) { 84 $resumes = $resumes->whereHas('users', function (Builder $query) {
85 $query->Where('is_worker', '=', '1') 85 $query->Where('is_worker', '=', '1')
86 ->Where('is_bd', '=', '0'); 86 ->Where('is_bd', '=', '0');
87 }); 87 });
88 88
89 //dd($request->get('job')); 89 //dd($request->get('job'));
90 if (($request->has('job')) && ($request->get('job') > 0)) { 90 if (($request->has('job')) && ($request->get('job') > 0)) {
91 $resumes = $resumes->whereHas('job_titles', function(Builder $query) use ($request) { 91 $resumes = $resumes->whereHas('job_titles', function(Builder $query) use ($request) {
92 $query->Where('job_titles.id', $request->get('job')); 92 $query->Where('job_titles.id', $request->get('job'));
93 }); 93 });
94 } 94 }
95 95
96 $Job_title = Job_title::query()->get(); 96 $Job_title = Job_title::query()->get();
97 97
98 if ($request->get('sort')) { 98 if ($request->get('sort')) {
99 $sort = $request->get('sort'); 99 $sort = $request->get('sort');
100 switch ($sort) { 100 switch ($sort) {
101 case 'name_up': 101 case 'name_up':
102 $resumes = $resumes->orderBy(User::select('surname') 102 $resumes = $resumes->orderBy(User::select('surname')
103 ->whereColumn('Workers.user_id', 'users.id') 103 ->whereColumn('Workers.user_id', 'users.id')
104 ); 104 );
105 break; 105 break;
106 case 'name_down': 106 case 'name_down':
107 $resumes = $resumes->orderByDesc(User::select('surname') 107 $resumes = $resumes->orderByDesc(User::select('surname')
108 ->whereColumn('Workers.user_id', 'users.id') 108 ->whereColumn('Workers.user_id', 'users.id')
109 ); 109 );
110 break; 110 break;
111 case 'created_at_up': $resumes = $resumes->OrderBy('created_at')->orderBy('id'); 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; 112 case 'created_at_down': $resumes = $resumes->orderByDesc('created_at')->orderBy('id'); break;
113 case 'default': $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; 113 case 'default': $resumes = $resumes->orderBy('id')->orderby('updated_at'); break;
114 default: $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; 114 default: $resumes = $resumes->orderBy('id')->orderby('updated_at'); break;
115 } 115 }
116 } 116 }
117 117
118 $res_count = $resumes->count(); 118 $res_count = $resumes->count();
119 //$resumes = $resumes->get(); 119 //$resumes = $resumes->get();
120 120
121 $resumes = $resumes->paginate(4); 121 $resumes = $resumes->paginate(4);
122 if ($request->ajax()) { 122 if ($request->ajax()) {
123 // Условия обставлены 123 // Условия обставлены
124 if ($request->has('block') && ($request->get('block') == 1)) { 124 if ($request->has('block') && ($request->get('block') == 1)) {
125 return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot')); 125 return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot'));
126 } 126 }
127 127
128 if ($request->has('block') && ($request->get('block') == 2)) { 128 if ($request->has('block') && ($request->get('block') == 2)) {
129 return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot')); 129 return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot'));
130 } 130 }
131 } else { 131 } else {
132 return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot', 'Job_title')); 132 return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot', 'Job_title'));
133 } 133 }
134 } 134 }
135 135
136 //Лайк резюме 136 //Лайк резюме
137 public function like_controller() { 137 public function like_controller() {
138 138
139 } 139 }
140 140
141 // анкета соискателя 141 // анкета соискателя
142 public function resume_profile(Worker $worker) 142 public function resume_profile(Worker $worker)
143 { 143 {
144 if (isset(Auth()->user()->id)) { 144 if (isset(Auth()->user()->id)) {
145 $idiot = Auth()->user()->id; 145 $idiot = Auth()->user()->id;
146 } else { 146 } else {
147 $idiot = 0; 147 $idiot = 0;
148 } 148 }
149 149
150 $status_work = $this->status_work; 150 $status_work = $this->status_work;
151 $Query = Worker::query()->with('users')->with('job_titles') 151 $Query = Worker::query()->with('users')->with('job_titles')
152 ->with('place_worker')->with('sertificate')->with('prev_company') 152 ->with('place_worker')->with('sertificate')->with('prev_company')
153 ->with('infobloks'); 153 ->with('infobloks');
154 $Query = $Query->where('id', '=', $worker->id); 154 $Query = $Query->where('id', '=', $worker->id);
155 $Query = $Query->get(); 155 $Query = $Query->get();
156 156
157 $get_date = date('Y.m'); 157 $get_date = date('Y.m');
158 $c = Static_worker::query()->where('year_month', '=', $get_date) 158 $c = Static_worker::query()->where('year_month', '=', $get_date)
159 ->where('user_id', '=', $worker->id) 159 ->where('user_id', '=', $worker->id)
160 ->get(); 160 ->get();
161 161
162 if ($c->count() > 0) { 162 if ($c->count() > 0) {
163 $upd = Static_worker::find($c[0]->id); 163 $upd = Static_worker::find($c[0]->id);
164 $upd->lookin = $upd->lookin + 1; 164 $upd->lookin = $upd->lookin + 1;
165 $upd->save(); 165 $upd->save();
166 } else { 166 } else {
167 $crt = new Static_worker(); 167 $crt = new Static_worker();
168 $crt->lookin = 1; 168 $crt->lookin = 1;
169 $crt->year_month = $get_date; 169 $crt->year_month = $get_date;
170 $crt->user_id = $worker->user_id; 170 $crt->user_id = $worker->user_id;
171 $crt->save(); 171 $crt->save();
172 } 172 }
173 $stat = Static_worker::query()->where('year_month', '=', $get_date) 173 $stat = Static_worker::query()->where('year_month', '=', $get_date)
174 ->where('user_id', '=', $worker->id) 174 ->where('user_id', '=', $worker->id)
175 ->get(); 175 ->get();
176 return view('worker', compact('Query', 'status_work', 'idiot')); 176 return view('worker', compact('Query', 'status_work', 'idiot'));
177 } 177 }
178 178
179 // скачать анкету соискателя 179 // скачать анкету соискателя
180 public function resume_download(Worker $worker) 180 public function resume_download(Worker $worker)
181 { 181 {
182 $status_work = $this->status_work; 182 $status_work = $this->status_work;
183 $Query = Worker::query()->with('users')->with('job_titles') 183 $Query = Worker::query()->with('users')->with('job_titles')
184 ->with('place_worker')->with('sertificate')->with('prev_company') 184 ->with('place_worker')->with('sertificate')->with('prev_company')
185 ->with('infobloks'); 185 ->with('infobloks');
186 $Query = $Query->where('id', '=', $worker->id); 186 $Query = $Query->where('id', '=', $worker->id);
187 $Query = $Query->get()->toArray(); 187 $Query = $Query->get()->toArray();
188 188
189 view()->share('Query',$Query); 189 view()->share('Query',$Query);
190 190
191 $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape'); 191 $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape');
192 192
193 return $pdf->stream(); 193 return $pdf->stream();
194 } 194 }
195 195
196 public function resume_download_all() { 196 public function resume_download_all() {
197 $status_work = $this->status_work; 197 $status_work = $this->status_work;
198 $Query = Worker::query()->with('users')->with('job_titles') 198 $Query = Worker::query()->with('users')->with('job_titles')
199 ->with('place_worker')->with('sertificate')->with('prev_company') 199 ->with('place_worker')->with('sertificate')->with('prev_company')
200 ->with('infobloks'); 200 ->with('infobloks');
201 //$Query = $Query->where('id', '=', $worker->id); 201 //$Query = $Query->where('id', '=', $worker->id);
202 $Query = $Query->get()->toArray(); 202 $Query = $Query->get()->toArray();
203 203
204 view()->share('Query',$Query); 204 view()->share('Query',$Query);
205 205
206 $pdf = PDF::loadView('layout.pdf-list-people', $Query); //->setPaper('a4', 'landscape'); 206 $pdf = PDF::loadView('layout.pdf-list-people', $Query); //->setPaper('a4', 'landscape');
207 207
208 return $pdf->stream(); 208 return $pdf->stream();
209 } 209 }
210 210
211 // Кабинет работника 211 // Кабинет работника
212 public function cabinet(Request $request) 212 public function cabinet(Request $request)
213 { 213 {
214 // дата год и месяц 214 // дата год и месяц
215 $get_date = date('Y.m'); 215 $get_date = date('Y.m');
216 216
217 $id = Auth()->user()->id; 217 $id = Auth()->user()->id;
218 218
219 $Infobloks = infobloks::query()->get(); 219 $Infobloks = infobloks::query()->get();
220 220
221 $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')-> 221 $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')->
222 with('infobloks')->with('place_worker')-> 222 with('infobloks')->with('place_worker')->
223 WhereHas('users', 223 WhereHas('users',
224 function (Builder $query) use ($id) {$query->Where('id', $id); 224 function (Builder $query) use ($id) {$query->Where('id', $id);
225 })->get(); 225 })->get();
226 226
227 $Job_titles = Job_title::query()->where('is_remove', '=', '0')->OrderBy('name')->get(); 227 $Job_titles = Job_title::query()->where('is_remove', '=', '0')->OrderBy('name')->get();
228 $Infoblocks = infobloks::query()->OrderBy('name')->get(); 228 $Infoblocks = infobloks::query()->OrderBy('name')->get();
229 229
230 $stat = Static_worker::query()->where('year_month', '=', $get_date) 230 $stat = Static_worker::query()->where('year_month', '=', $get_date)
231 ->where('user_id', '=', $Worker[0]->id) 231 ->where('user_id', '=', $Worker[0]->id)
232 ->get(); 232 ->get();
233 233
234 // 10% 234 // 10%
235 235
236 $persent = 10; 236 $persent = 10;
237 $persent1 = 0; 237 $persent1 = 0;
238 $persent2 = 0; 238 $persent2 = 0;
239 $persent3 = 0; 239 $persent3 = 0;
240 $persent4 = 0; 240 $persent4 = 0;
241 $persent5 = 0; 241 $persent5 = 0;
242 242
243 if ((!empty($Worker[0]->telephone)) && 243 if ((!empty($Worker[0]->telephone)) &&
244 (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) && 244 (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) &&
245 (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) { 245 (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) {
246 // 40% 246 // 40%
247 $persent = $persent + 40; 247 $persent = $persent + 40;
248 $persent1 = 40; 248 $persent1 = 40;
249 } 249 }
250 250
251 //dd($Worker[0]->status_work, $Worker[0]->telephone, $Worker[0]->email, $Worker[0]->experience, $Worker[0]->city, $Worker[0]->old_year); 251 //dd($Worker[0]->status_work, $Worker[0]->telephone, $Worker[0]->email, $Worker[0]->experience, $Worker[0]->city, $Worker[0]->old_year);
252 252
253 if ($Worker[0]->sertificate->count() > 0) { 253 if ($Worker[0]->sertificate->count() > 0) {
254 // 15% 254 // 15%
255 $persent = $persent + 15; 255 $persent = $persent + 15;
256 $persent2 = 15; 256 $persent2 = 15;
257 } 257 }
258 258
259 if ($Worker[0]->infobloks->count() > 0) { 259 if ($Worker[0]->infobloks->count() > 0) {
260 // 20% 260 // 20%
261 $persent = $persent + 20; 261 $persent = $persent + 20;
262 $persent3 = 20; 262 $persent3 = 20;
263 } 263 }
264 264
265 if ($Worker[0]->prev_company->count() > 0) { 265 if ($Worker[0]->prev_company->count() > 0) {
266 // 10% 266 // 10%
267 $persent = $persent + 10; 267 $persent = $persent + 10;
268 $persent4 = 10; 268 $persent4 = 10;
269 } 269 }
270 270
271 if (!empty($Worker[0]->photo)) { 271 if (!empty($Worker[0]->photo)) {
272 // 5% 272 // 5%
273 $persent = $persent + 5; 273 $persent = $persent + 5;
274 $persent5 = 5; 274 $persent5 = 5;
275 } 275 }
276 276
277 //dd($persent1, $persent2, $persent3, $persent4, $persent5); 277 //dd($persent1, $persent2, $persent3, $persent4, $persent5);
278 278
279 if ($request->has('print')) { 279 if ($request->has('print')) {
280 dd($Worker); 280 dd($Worker);
281 } else { 281 } else {
282 return view('workers.cabinet', compact('Worker', 'Infobloks', 'persent', 'Job_titles', 'Infoblocks', 'stat')); 282 return view('workers.cabinet', compact('Worker', 'Infobloks', 'persent', 'Job_titles', 'Infoblocks', 'stat'));
283 } 283 }
284 } 284 }
285 285
286 // Сохранение данных 286 // Сохранение данных
287 public function cabinet_save(Worker $worker, Request $request) 287 public function cabinet_save(Worker $worker, Request $request)
288 { 288 {
289 $id = $worker->id; 289 $id = $worker->id;
290 $params = $request->all(); 290 $params = $request->all();
291 291
292 $job_title_id = $request->get('job_title_id'); 292 $job_title_id = $request->get('job_title_id');
293 293
294 unset($params['new_diplom']); 294 unset($params['new_diplom']);
295 unset($params['new_data_begin']); 295 unset($params['new_data_begin']);
296 unset($params['new_data_end']); 296 unset($params['new_data_end']);
297 unset($params['new_job_title']); 297 unset($params['new_job_title']);
298 unset($params['new_teplohod']); 298 unset($params['new_teplohod']);
299 unset($params['new_GWT']); 299 unset($params['new_GWT']);
300 unset($params['new_KBT']); 300 unset($params['new_KBT']);
301 unset($params['new_Begin_work']); 301 unset($params['new_Begin_work']);
302 unset($params['new_End_work']); 302 unset($params['new_End_work']);
303 unset($params['new_name_company']); 303 unset($params['new_name_company']);
304 304
305 $rules = [ 305 $rules = [
306 'surname' => ['required', 'string', 'max:255'], 306 'surname' => ['required', 'string', 'max:255'],
307 'name_man' => ['required', 'string', 'max:255'], 307 'name_man' => ['required', 'string', 'max:255'],
308 'email' => ['required', 'string', 'email', 'max:255'], 308 'email' => ['required', 'string', 'email', 'max:255'],
309 309
310 ]; 310 ];
311 311
312 $messages = [ 312 $messages = [
313 'required' => 'Укажите обязательное поле', 313 'required' => 'Укажите обязательное поле',
314 'min' => [ 314 'min' => [
315 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 315 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
316 'integer' => 'Поле «:attribute» должно быть :min или больше', 316 'integer' => 'Поле «:attribute» должно быть :min или больше',
317 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 317 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
318 ], 318 ],
319 'max' => [ 319 'max' => [
320 'string' => 'Поле «:attribute» должно быть не больше :max символов', 320 'string' => 'Поле «:attribute» должно быть не больше :max символов',
321 'integer' => 'Поле «:attribute» должно быть :max или меньше', 321 'integer' => 'Поле «:attribute» должно быть :max или меньше',
322 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 322 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
323 ] 323 ]
324 ]; 324 ];
325 325
326 $validator = Validator::make($params, $rules, $messages); 326 $validator = Validator::make($params, $rules, $messages);
327 327
328 if ($validator->fails()) { 328 if ($validator->fails()) {
329 return redirect()->route('worker.cabinet')->withErrors($validator); 329 return redirect()->route('worker.cabinet')->withErrors($validator);
330 } else { 330 } else {
331 331
332 if ($request->has('photo')) { 332 if ($request->has('photo')) {
333 if (!empty($Worker->photo)) { 333 if (!empty($Worker->photo)) {
334 Storage::delete($Worker->photo); 334 Storage::delete($Worker->photo);
335 } 335 }
336 $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); 336 $params['photo'] = $request->file('photo')->store("worker/$id", 'public');
337 } 337 }
338 338
339 if ($request->has('file')) { 339 if ($request->has('file')) {
340 if (!empty($Worker->file)) { 340 if (!empty($Worker->file)) {
341 Storage::delete($Worker->file); 341 Storage::delete($Worker->file);
342 } 342 }
343 $params['file'] = $request->file('file')->store("worker/$id", 'public'); 343 $params['file'] = $request->file('file')->store("worker/$id", 'public');
344 } 344 }
345 345
346 $id_wor = $worker->update($params); 346 $id_wor = $worker->update($params);
347 $use = User::find($worker->user_id); 347 $use = User::find($worker->user_id);
348 $use->surname = $request->get('surname'); 348 $use->surname = $request->get('surname');
349 $use->name_man = $request->get('name_man'); 349 $use->name_man = $request->get('name_man');
350 $use->surname2 = $request->get('surname2'); 350 $use->surname2 = $request->get('surname2');
351 351
352 $use->save(); 352 $use->save();
353 $worker->job_titles()->sync($job_title_id); 353 $worker->job_titles()->sync($job_title_id);
354 354
355 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); 355 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены');
356 } 356 }
357 } 357 }
358 358
359 // Сообщения данные 359 // Сообщения данные
360 public function messages($type_message) 360 public function messages($type_message)
361 { 361 {
362 $user_id = Auth()->user()->id; 362 $user_id = Auth()->user()->id;
363 363
364 $messages_input = Message::query()->with('vacancies')->with('user_from')-> 364 $messages_input = Message::query()->with('vacancies')->with('user_from')->
365 Where('to_user_id', $user_id)->OrderByDesc('created_at'); 365 Where('to_user_id', $user_id)->OrderByDesc('created_at');
366 366
367 $messages_output = Message::query()->with('vacancies')-> 367 $messages_output = Message::query()->with('vacancies')->
368 with('user_to')->where('user_id', $user_id)-> 368 with('user_to')->where('user_id', $user_id)->
369 OrderByDesc('created_at'); 369 OrderByDesc('created_at');
370 370
371 371
372 $count_input = $messages_input->count(); 372 $count_input = $messages_input->count();
373 $count_output = $messages_output->count(); 373 $count_output = $messages_output->count();
374 374
375 if ($type_message == 'input') { 375 if ($type_message == 'input') {
376 $messages = $messages_input->paginate(5); 376 $messages = $messages_input->paginate(5);
377 } 377 }
378 378
379 if ($type_message == 'output') { 379 if ($type_message == 'output') {
380 $messages = $messages_output->paginate(5); 380 $messages = $messages_output->paginate(5);
381 } 381 }
382 382
383 // Вернуть все 100% 383 // Вернуть все 100%
384 return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); 384 return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id'));
385 } 385 }
386 386
387 // Избранный 387 // Избранный
388 public function favorite() 388 public function favorite()
389 { 389 {
390 return view('workers.favorite'); 390 return view('workers.favorite');
391 } 391 }
392 392
393 // Сменить пароль 393 // Сменить пароль
394 public function new_password() 394 public function new_password()
395 { 395 {
396 $email = Auth()->user()->email; 396 $email = Auth()->user()->email;
397 return view('workers.new_password', compact('email')); 397 return view('workers.new_password', compact('email'));
398 } 398 }
399 399
400 // Обновление пароля 400 // Обновление пароля
401 public function save_new_password(Request $request) { 401 public function save_new_password(Request $request) {
402 $use = Auth()->user(); 402 $use = Auth()->user();
403 $request->validate([ 403 $request->validate([
404 'password' => 'required|string', 404 'password' => 'required|string',
405 'new_password' => 'required|string', 405 'new_password' => 'required|string',
406 'new_password2' => 'required|string' 406 'new_password2' => 'required|string'
407 ]); 407 ]);
408 408
409 if ($request->get('new_password') == $request->get('new_password2')) 409 if ($request->get('new_password') == $request->get('new_password2'))
410 if ($request->get('password') !== $request->get('new_password')) { 410 if ($request->get('password') !== $request->get('new_password')) {
411 $credentials = $request->only('email', 'password'); 411 $credentials = $request->only('email', 'password');
412 if (Auth::attempt($credentials, $request->has('save_me'))) { 412 if (Auth::attempt($credentials, $request->has('save_me'))) {
413 413
414 if (!is_null($use->email_verified_at)){ 414 if (!is_null($use->email_verified_at)){
415 415
416 $user_data = User_Model::find($use->id); 416 $user_data = User_Model::find($use->id);
417 $user_data->update([ 417 $user_data->update([
418 'password' => Hash::make($request->get('new_password')), 418 'password' => Hash::make($request->get('new_password')),
419 'pubpassword' => base64_encode($request->get('new_password')), 419 'pubpassword' => base64_encode($request->get('new_password')),
420 ]); 420 ]);
421 return redirect() 421 return redirect()
422 ->route('worker.new_password') 422 ->route('worker.new_password')
423 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 423 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
424 } 424 }
425 425
426 return redirect() 426 return redirect()
427 ->route('worker.new_password') 427 ->route('worker.new_password')
428 ->withError('Данная учетная запись не было верифицированна!'); 428 ->withError('Данная учетная запись не было верифицированна!');
429 } 429 }
430 } 430 }
431 431
432 return redirect() 432 return redirect()
433 ->route('worker.new_password') 433 ->route('worker.new_password')
434 ->withErrors('Не совпадение данных, обновите пароли!'); 434 ->withErrors('Не совпадение данных, обновите пароли!');
435 } 435 }
436 436
437 // Удаление профиля форма 437 // Удаление профиля форма
438 public function delete_profile() 438 public function delete_profile()
439 { 439 {
440 $login = Auth()->user()->email; 440 $login = Auth()->user()->email;
441 return view('workers.delete_profile', compact('login')); 441 return view('workers.delete_profile', compact('login'));
442 } 442 }
443 443
444 // Удаление профиля код 444 // Удаление профиля код
445 public function delete_profile_result(Request $request) { 445 public function delete_profile_result(Request $request) {
446 $Answer = $request->all(); 446 $Answer = $request->all();
447 $user_id = Auth()->user()->id; 447 $user_id = Auth()->user()->id;
448 $request->validate([ 448 $request->validate([
449 'password' => 'required|string', 449 'password' => 'required|string',
450 ]); 450 ]);
451 451
452 $credentials = $request->only('email', 'password'); 452 $credentials = $request->only('email', 'password');
453 if (Auth::attempt($credentials)) { 453 if (Auth::attempt($credentials)) {
454 Auth::logout(); 454 Auth::logout();
455 $it = User_Model::find($user_id); 455 $it = User_Model::find($user_id);
456 $it->delete(); 456 $it->delete();
457 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 457 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
458 } else { 458 } else {
459 return redirect()->route('worker.delete_profile') 459 return redirect()->route('worker.delete_profile')
460 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 460 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
461 } 461 }
462 } 462 }
463 463
464 // Регистрация соискателя 464 // Регистрация соискателя
465 public function register_worker(Request $request) 465 public function register_worker(Request $request)
466 { 466 {
467 $params = $request->all(); 467 $params = $request->all();
468 $params['is_worker'] = 1; 468 $params['is_worker'] = 1;
469 469
470 $rules = [ 470 $rules = [
471 'surname' => ['required', 'string', 'max:255'], 471 'surname' => ['required', 'string', 'max:255'],
472 'name_man' => ['required', 'string', 'max:255'], 472 'name_man' => ['required', 'string', 'max:255'],
473 'email' => ['required', 'email', 'max:255', 'unique:users'], 473 'email' => ['required', 'email', 'max:255', 'unique:users'],
474 'password' => ['required', 'string', 'min:8'] 474 'password' => ['required', 'string', 'min:8']
475 ]; 475 ];
476 476
477 $messages = [ 477 $messages = [
478 'required' => 'Укажите обязательное поле', 478 'required' => 'Укажите обязательное поле',
479 'min' => [ 479 'min' => [
480 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 480 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
481 'integer' => 'Поле «:attribute» должно быть :min или больше', 481 'integer' => 'Поле «:attribute» должно быть :min или больше',
482 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 482 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
483 ], 483 ],
484 'max' => [ 484 'max' => [
485 'string' => 'Поле «:attribute» должно быть не больше :max символов', 485 'string' => 'Поле «:attribute» должно быть не больше :max символов',
486 'integer' => 'Поле «:attribute» должно быть :max или меньше', 486 'integer' => 'Поле «:attribute» должно быть :max или меньше',
487 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 487 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
488 ] 488 ]
489 ]; 489 ];
490 490
491 $email = $request->get('email'); 491 $email = $request->get('email');
492 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { 492 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) {
493 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); 493 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл"));
494 } 494 }
495 495
496 if ($request->get('password') !== $request->get('confirmed')){ 496 if ($request->get('password') !== $request->get('confirmed')){
497 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 497 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
498 } 498 }
499 499
500 $haystack = $request->get('password'); 500 $haystack = $request->get('password');
501 501
502 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); 502 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?');
503 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 503 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z',
504 'X', 'C', 'V', 'B', 'N', 'M'); 504 'X', 'C', 'V', 'B', 'N', 'M');
505 $lenpwd_bool = true; 505 $lenpwd_bool = true;
506 $spec_bool = false; 506 $spec_bool = false;
507 $alpha_bool = false; 507 $alpha_bool = false;
508 508
509 if (strlen($haystack) < 8) $lenpwd_bool = false; 509 if (strlen($haystack) < 8) $lenpwd_bool = false;
510 510
511 foreach ($specsumbol as $it) { 511 foreach ($specsumbol as $it) {
512 if (strpos($haystack, $it) !== false) { 512 if (strpos($haystack, $it) !== false) {
513 $spec_bool = true; 513 $spec_bool = true;
514 } 514 }
515 } 515 }
516 516
517 foreach ($alpha as $it) { 517 foreach ($alpha as $it) {
518 if (strpos($haystack, $it) !== false) { 518 if (strpos($haystack, $it) !== false) {
519 $alpha_bool = true; 519 $alpha_bool = true;
520 } 520 }
521 } 521 }
522 522
523 if (!$lenpwd_bool) { 523 if (!$lenpwd_bool) {
524 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); 524 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
525 } 525 }
526 526
527 if ((!$spec_bool) || (!$alpha_bool)) { 527 if ((!$spec_bool) || (!$alpha_bool)) {
528 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); 528 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?"));
529 } 529 }
530 530
531 if (($request->has('politik')) && ($request->get('politik') == 1)) { 531 if (($request->has('politik')) && ($request->get('politik') == 1)) {
532 $validator = Validator::make($params, $rules, $messages); 532 $validator = Validator::make($params, $rules, $messages);
533 533
534 if ($validator->fails()) { 534 if ($validator->fails()) {
535 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 535 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
536 } else { 536 } else {
537 //dd($params); 537 //dd($params);
538 $user = $this->create($params); 538 $user = $this->create($params);
539 event(new Registered($user)); 539 event(new Registered($user));
540 Auth::guard()->login($user); 540 Auth::guard()->login($user);
541 } 541 }
542 if ($user) { 542 if ($user) {
543 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; 543 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));;
544 } else { 544 } else {
545 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 545 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
546 } 546 }
547 547
548 } else { 548 } else {
549 return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!")); 549 return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!"));
550 } 550 }
551 } 551 }
552 552
553 // Звездная оценка и ответ 553 // Звездная оценка и ответ
554 public function stars_answer(Request $request) { 554 public function stars_answer(Request $request) {
555 $params = $request->all(); 555 $params = $request->all();
556 $rules = [ 556 $rules = [
557 'message' => ['required', 'string', 'max:255'], 557 'message' => ['required', 'string', 'max:255'],
558 ]; 558 ];
559 559
560 $messages = [ 560 $messages = [
561 'required' => 'Укажите обязательное поле', 561 'required' => 'Укажите обязательное поле',
562 'min' => [ 562 'min' => [
563 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 563 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
564 'integer' => 'Поле «:attribute» должно быть :min или больше', 564 'integer' => 'Поле «:attribute» должно быть :min или больше',
565 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 565 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
566 ], 566 ],
567 'max' => [ 567 'max' => [
568 'string' => 'Поле «:attribute» должно быть не больше :max символов', 568 'string' => 'Поле «:attribute» должно быть не больше :max символов',
569 'integer' => 'Поле «:attribute» должно быть :max или меньше', 569 'integer' => 'Поле «:attribute» должно быть :max или меньше',
570 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 570 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
571 ] 571 ]
572 ]; 572 ];
573 $response_worker = ResponseWork::create($params); 573 $response_worker = ResponseWork::create($params);
574 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); 574 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!');
575 } 575 }
576 576
577 public function TestWorker() 577 public function TestWorker()
578 { 578 {
579 $Use = new User(); 579 $Use = new User();
580 580
581 $Code_user = $Use->create([ 581 $Code_user = $Use->create([
582 'name' => 'surname name_man', 582 'name' => 'surname name_man',
583 'name_man' => 'name_man', 583 'name_man' => 'name_man',
584 'surname' => 'surname', 584 'surname' => 'surname',
585 'surname2' => 'surname2', 585 'surname2' => 'surname2',
586 'subscribe_email' => '1', 586 'subscribe_email' => '1',
587 'email' => 'email@mail.com', 587 'email' => 'email@mail.com',
588 'telephone' => '1234567890', 588 'telephone' => '1234567890',
589 'password' => Hash::make('password'), 589 'password' => Hash::make('password'),
590 'pubpassword' => base64_encode('password'), 590 'pubpassword' => base64_encode('password'),
591 'email_verified_at' => Carbon::now(), 591 'email_verified_at' => Carbon::now(),
592 'is_worker' => 1, 592 'is_worker' => 1,
593 ]); 593 ]);
594 594
595 if ($Code_user->id > 0) { 595 if ($Code_user->id > 0) {
596 $Worker = new Worker(); 596 $Worker = new Worker();
597 $Worker->user_id = $Code_user->id; 597 $Worker->user_id = $Code_user->id;
598 $Worker->position_work = 1; //'job_titles'; 598 $Worker->position_work = 1; //'job_titles';
599 $Worker->email = 'email@email.com'; 599 $Worker->email = 'email@email.com';
600 $Worker->telephone = '1234567890'; 600 $Worker->telephone = '1234567890';
601 $status = $Worker->save(); 601 $status = $Worker->save();
602 602
603 $Title_Worker = new Title_worker(); 603 $Title_Worker = new Title_worker();
604 $Title_Worker->worker_id = $Worker->id; 604 $Title_Worker->worker_id = $Worker->id;
605 $Title_Worker->job_title_id = 1; 605 $Title_Worker->job_title_id = 1;
606 $Title_Worker->save(); 606 $Title_Worker->save();
607 } 607 }
608 } 608 }
609 609
610 // Создание пользователя 610 // Создание пользователя
611 protected function create(array $data) 611 protected function create(array $data)
612 { 612 {
613 $Use = new User(); 613 $Use = new User();
614 614
615 $Code_user = $Use->create([ 615 $Code_user = $Use->create([
616 'name' => $data['surname']." ".$data['name_man'], 616 'name' => $data['surname']." ".$data['name_man'],
617 'name_man' => $data['name_man'], 617 'name_man' => $data['name_man'],
618 'surname' => $data['surname'], 618 'surname' => $data['surname'],
619 'surname2' => $data['surname2'], 619 'surname2' => $data['surname2'],
620 'subscribe_email' => $data['email'], 620 'subscribe_email' => $data['email'],
621 'email' => $data['email'], 621 'email' => $data['email'],
622 'telephone' => $data['telephone'], 622 'telephone' => $data['telephone'],
623 'password' => Hash::make($data['password']), 623 'password' => Hash::make($data['password']),
624 'pubpassword' => base64_encode($data['password']), 624 'pubpassword' => base64_encode($data['password']),
625 'email_verified_at' => Carbon::now(), 625 'email_verified_at' => Carbon::now(),
626 'is_worker' => $data['is_worker'], 626 'is_worker' => $data['is_worker'],
627 ]); 627 ]);
628 628
629 if ($Code_user->id > 0) { 629 if ($Code_user->id > 0) {
630 $Worker = new Worker(); 630 $Worker = new Worker();
631 $Worker->user_id = $Code_user->id; 631 $Worker->user_id = $Code_user->id;
632 $Worker->position_work = $data['job_titles']; 632 $Worker->position_work = $data['job_titles'];
633 $Worker->email = $data['email']; 633 $Worker->email = $data['email'];
634 $Worker->telephone = $data['telephone']; 634 $Worker->telephone = $data['telephone'];
635 $Worker->save(); 635 $Worker->save();
636 636
637 if (isset($Worker->id)) { 637 if (isset($Worker->id)) {
638 $Title_Worker = new Title_worker(); 638 $Title_Worker = new Title_worker();
639 $Title_Worker->worker_id = $Worker->id; 639 $Title_Worker->worker_id = $Worker->id;
640 $Title_Worker->job_title_id = $data['job_titles']; 640 $Title_Worker->job_title_id = $data['job_titles'];
641 $Title_Worker->save(); 641 $Title_Worker->save();
642 } 642 }
643 643
644 return $Code_user; 644 return $Code_user;
645 } 645 }
646 } 646 }
647 647
648 // Вакансии избранные 648 // Вакансии избранные
649 public function colorado(Request $request) { 649 public function colorado(Request $request) {
650 $IP_address = RusDate::ip_addr_client(); 650 $IP_address = RusDate::ip_addr_client();
651 $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); 651 $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get();
652 652
653 if ($Arr->count()) { 653 if ($Arr->count()) {
654 $A = Array(); 654 $A = Array();
655 foreach ($Arr as $it) { 655 foreach ($Arr as $it) {
656 $A[] = $it->code_record; 656 $A[] = $it->code_record;
657 } 657 }
658 658
659 $Query = Ad_employer::query()->whereIn('id', $A); 659 $Query = Ad_employer::query()->whereIn('id', $A);
660 } else { 660 } else {
661 $Query = Ad_employer::query()->where('id', '=', '0'); 661 $Query = Ad_employer::query()->where('id', '=', '0');
662 } 662 }
663 663
664 $Query = $Query->with('jobs')-> 664 $Query = $Query->with('jobs')->
665 with('cat')-> 665 with('cat')->
666 with('employer')-> 666 with('employer')->
667 whereHas('jobs_code', function ($query) use ($request) { 667 whereHas('jobs_code', function ($query) use ($request) {
668 if ($request->ajax()) { 668 if ($request->ajax()) {
669 if (null !== ($request->get('job'))) { 669 if (null !== ($request->get('job'))) {
670 $query->where('job_title_id', $request->get('job')); 670 $query->where('job_title_id', $request->get('job'));
671 } 671 }
672 } 672 }
673 })->select('ad_employers.*'); 673 })->select('ad_employers.*');
674 674
675 $Job_title = Job_title::query()->OrderBy('name')->get(); 675 $Job_title = Job_title::query()->OrderBy('name')->get();
676 676
677 $Query_count = $Query->count(); 677 $Query_count = $Query->count();
678 678
679 $Query = $Query->OrderBy('updated_at')->paginate(3); 679 $Query = $Query->OrderBy('updated_at')->paginate(3);
680 680
681 return view('workers.favorite', compact('Query', 681 return view('workers.favorite', compact('Query',
682 'Query_count', 682 'Query_count',
683 'Job_title')); 683 'Job_title'));
684 684
685 } 685 }
686 686
687 //Переписка 687 //Переписка
688 public function dialog(User_Model $user1, User_Model $user2) { 688 public function dialog(User_Model $user1, User_Model $user2) {
689 if (isset($user2->id)) { 689 if (isset($user2->id)) {
690 $companion = User_Model::query()->with('workers')-> 690 $companion = User_Model::query()->with('workers')->
691 with('employers')-> 691 with('employers')->
692 where('id', $user2->id)->first(); 692 where('id', $user2->id)->first();
693 } 693 }
694 694
695 $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) { 695 $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) {
696 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); 696 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id);
697 })->orWhere(function($query) use ($user1, $user2) { 697 })->orWhere(function($query) use ($user1, $user2) {
698 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); 698 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id);
699 })->OrderBy('created_at')->get(); 699 })->OrderBy('created_at')->get();
700 700
701 $id_vac = null; 701 $id_vac = null;
702 foreach ($Messages as $it) { 702 foreach ($Messages as $it) {
703 if (isset($it->response)) { 703 if (isset($it->response)) {
704 foreach ($it->response as $r) { 704 foreach ($it->response as $r) {
705 if (isset($r->ad_employer_id)) { 705 if (isset($r->ad_employer_id)) {
706 $id_vac = $r->ad_employer_id; 706 $id_vac = $r->ad_employer_id;
707 break; 707 break;
708 } 708 }
709 } 709 }
710 } 710 }
711 if (!is_null($id_vac)) break; 711 if (!is_null($id_vac)) break;
712 } 712 }
713 713
714 $ad_employer = null; 714 $ad_employer = null;
715 if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); 715 if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first();
716 $sender = $user1; 716 $sender = $user1;
717 717
718 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); 718 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer'));
719 } 719 }
720 720
721 // Даунылоады 721 // Даунылоады
722 public function download(Worker $worker) { 722 public function download(Worker $worker) {
723 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; 723 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...'];
724 view()->share('house',$arr_house); 724 view()->share('house',$arr_house);
725 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); 725 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape');
726 return $pdf->stream(); 726 return $pdf->stream();
727 } 727 }
728 728
729 // Поднятие анкеты 729 // Поднятие анкеты
730 public function up(Worker $worker) { 730 public function up(Worker $worker) {
731 $worker->updated_at = Carbon::now(); 731 $worker->updated_at = Carbon::now();
732 $worker->save(); 732 $worker->save();
733 // 0 733 // 0
734 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); 734 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных');
735 } 735 }
736 736
737 // Форма сертификате 737 // Форма сертификате
738 public function new_sertificate(Worker $worker) { 738 public function new_sertificate(Worker $worker) {
739 return view('workers.sertificate_add', compact('worker')); 739 return view('workers.sertificate_add', compact('worker'));
740 } 740 }
741 741
742 // Добавление сертификата 742 // Добавление сертификата
743 public function add_serificate(SertificationRequest $request) { 743 public function add_serificate(SertificationRequest $request) {
744 $params = $request->all(); 744 $params = $request->all();
745 745
746 $Sertificate = new sertification(); 746 $Sertificate = new sertification();
747 $Sertificate->create($params); 747 $Sertificate->create($params);
748 $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get(); 748 $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get();
749 return redirect()->route('worker.cabinet'); 749 return redirect()->route('worker.cabinet');
750 //return view('ajax.documents', compact('Docs')); 750 //return view('ajax.documents', compact('Docs'));
751 } 751 }
752 752
753 // Удалить сертификат 753 // Удалить сертификат
754 public function delete_sertificate(sertification $doc) { 754 public function delete_sertificate(sertification $doc) {
755 $doc->delete(); 755 $doc->delete();
756 756
757 return redirect()->route('worker.cabinet'); 757 return redirect()->route('worker.cabinet');
758 } 758 }
759 759
760 // Редактирование сертификата 760 // Редактирование сертификата
761 public function edit_sertificate(Worker $worker, sertification $doc) { 761 public function edit_sertificate(Worker $worker, sertification $doc) {
762 return view('workers.sertificate_edit', compact('doc', 'worker')); 762 return view('workers.sertificate_edit', compact('doc', 'worker'));
763 } 763 }
764 764
765 // Редактирование обновление сертификата 765 // Редактирование обновление сертификата
766 public function update_serificate(SertificationRequest $request, sertification $doc) { 766 public function update_serificate(SertificationRequest $request, sertification $doc) {
767 $all = $request->all(); 767 $all = $request->all();
768 $doc->worker_id = $all['worker_id']; 768 $doc->worker_id = $all['worker_id'];
769 $doc->name = $all['name']; 769 $doc->name = $all['name'];
770 $doc->end_begin = $all['end_begin']; 770 $doc->end_begin = $all['end_begin'];
771 $doc->save(); 771 $doc->save();
772 772
773 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); 773 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!');
774 } 774 }
775 775
776 public function delete_add_diplom(Request $request, Worker $worker) { 776 public function delete_add_diplom(Request $request, Worker $worker) {
777 $infoblok_id = $request->get('infoblok_id'); 777 $infoblok_id = $request->get('infoblok_id');
778 778
779 if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0) 779 if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0)
780 $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete(); 780 $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete();
781 else { 781 else {
782 $params['infoblok_id'] = $infoblok_id; 782 $params['infoblok_id'] = $infoblok_id;
783 $params['worker_id'] = $worker->id; 783 $params['worker_id'] = $worker->id;
784 $params['status'] = $request->get('val');
784 $id = Dop_info::create($params); 785 $id = Dop_info::create($params);
785 //$id = $worker->infobloks()->sync([$infoblok_id]); 786 //$id = $worker->infobloks()->sync([$infoblok_id]);
786 } 787 }
787 788
788 //$Infoblocks = infobloks::query()->get(); 789 //$Infoblocks = infobloks::query()->get();
789 return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks')); 790 return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks'));
790 } 791 }
791 792
792 793
793 794
794 // Добавление диплома 795 // Добавление диплома
795 public function add_diplom_ajax(Request $request) { 796 public function add_diplom_ajax(Request $request) {
796 // конец 797 // конец
797 $params = $request->all(); 798 $params = $request->all();
798 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 799 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
799 800
800 if ($count == 0) $dop_info = Dop_info::create($params); 801 if ($count == 0) $dop_info = Dop_info::create($params);
801 $Infoblocks = infobloks::query()->get(); 802 $Infoblocks = infobloks::query()->get();
802 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); 803 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get();
803 $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); 804 $data = Dop_info::query()->where('worker_id', $request->has('worker_id'));
804 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); 805 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker'));
805 } 806 }
806 807
807 // Добавление диплома без ajax 808 // Добавление диплома без ajax
808 public function add_diplom(Worker $worker) { 809 public function add_diplom(Worker $worker) {
809 $worker_id = $worker->id; 810 $worker_id = $worker->id;
810 $Infoblocks = infobloks::query()->get(); 811 $Infoblocks = infobloks::query()->get();
811 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); 812 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks'));
812 } 813 }
813 // Сохранить 814 // Сохранить
814 // Сохраняю диплом 815 // Сохраняю диплом
815 public function add_diplom_save(Request $request) { 816 public function add_diplom_save(Request $request) {
816 $params = $request->all(); 817 $params = $request->all();
817 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 818 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
818 if ($count == 0) $dop_info = Dop_info::create($params); 819 if ($count == 0) $dop_info = Dop_info::create($params);
819 return redirect()->route('worker.cabinet'); 820 return redirect()->route('worker.cabinet');
820 } 821 }
821 822
822 // Добавление стандартного документа 823 // Добавление стандартного документа
823 public function add_document(Worker $worker) { 824 public function add_document(Worker $worker) {
824 return view('workers.docs', compact('worker')); 825 return view('workers.docs', compact('worker'));
825 } 826 }
826 827
827 //Сохранение стандартого документа 828 //Сохранение стандартого документа
828 public function add_document_save(DocumentsRequest $request) { 829 public function add_document_save(DocumentsRequest $request) {
829 $params = $request->all(); 830 $params = $request->all();
830 $place_work = place_works::create($params); 831 $place_work = place_works::create($params);
831 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!'); 832 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!');
832 } 833 }
833 834
834 // Редактирование документа 835 // Редактирование документа
835 public function edit_document(place_works $doc, Worker $worker) { 836 public function edit_document(place_works $doc, Worker $worker) {
836 return view('workers.docs-edit', compact('doc', 'worker')); 837 return view('workers.docs-edit', compact('doc', 'worker'));
837 } 838 }
838 839
839 //Сохранение отредактированного документа 840 //Сохранение отредактированного документа
840 public function edit_document_save(DocumentsRequest $request, place_works $doc) { 841 public function edit_document_save(DocumentsRequest $request, place_works $doc) {
841 $params = $request->all(); 842 $params = $request->all();
842 $doc->update($params); 843 $doc->update($params);
843 844
844 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); 845 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!');
845 } 846 }
846 847
847 // Удаление документа 848 // Удаление документа
848 public function delete_document(place_works $doc) { 849 public function delete_document(place_works $doc) {
849 $doc->delete(); 850 $doc->delete();
850 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); 851 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!');
851 } 852 }
852 853
853 //Отправка нового сообщения 854 //Отправка нового сообщения
854 public function new_message(Request $request) { 855 public function new_message(Request $request) {
855 $params = $request->all(); 856 $params = $request->all();
856 857
857 $id = $params['send_user_id']; 858 $id = $params['send_user_id'];
858 $message = new Message(); 859 $message = new Message();
859 $message->user_id = $params['send_user_id']; 860 $message->user_id = $params['send_user_id'];
860 $message->to_user_id = $params['send_to_user_id']; 861 $message->to_user_id = $params['send_to_user_id'];
861 $message->title = $params['send_title']; 862 $message->title = $params['send_title'];
862 $message->text = $params['send_text']; 863 $message->text = $params['send_text'];
863 if ($request->has('send_file')) { 864 if ($request->has('send_file')) {
864 $message->file = $request->file('send_file')->store("worker/$id", 'public'); 865 $message->file = $request->file('send_file')->store("worker/$id", 'public');
865 } 866 }
866 $message->flag_new = 1; 867 $message->flag_new = 1;
867 $id_message = $message->save(); 868 $id_message = $message->save();
868 869
869 $data['message_id'] = $id_message; 870 $data['message_id'] = $id_message;
870 $data['ad_employer_id'] = $params['send_vacancy']; 871 $data['ad_employer_id'] = $params['send_vacancy'];
871 $data['job_title_id'] = $params['send_job_title_id']; 872 $data['job_title_id'] = $params['send_job_title_id'];
872 $data['flag'] = 1; 873 $data['flag'] = 1;
873 $ad_responce = ad_response::create($data); 874 $ad_responce = ad_response::create($data);
874 return redirect()->route('worker.messages', ['type_message' => 'output']); 875 return redirect()->route('worker.messages', ['type_message' => 'output']);
875 } 876 }
876 877
877 // Информация о предыдущих компаниях 878 // Информация о предыдущих компаниях
878 public function new_prev_company(Worker $worker) { 879 public function new_prev_company(Worker $worker) {
879 return view('workers.prev_company_form', compact('worker')); 880 return view('workers.prev_company_form', compact('worker'));
880 } 881 }
881 882
882 // Добавление контакта компании 883 // Добавление контакта компании
883 public function add_prev_company(PrevCompanyRequest $request) { 884 public function add_prev_company(PrevCompanyRequest $request) {
884 // Возвращение параметров 885 // Возвращение параметров
885 $all = $request->all(); 886 $all = $request->all();
886 $PrevCompany = PrevCompany::create($all); 887 $PrevCompany = PrevCompany::create($all);
887 888
888 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись'); 889 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись');
889 } 890 }
890 891
892 // Редактирование контакта компании
893 public function edit_prev_company(PrevCompany $doc, Worker $worker) {
894 return view('workers.prev_company_edit_form', compact('doc', 'worker'));
895 }
896
897 //Сохранение редактирования контакта компании
898 public function update_prev_company(PrevCompany $doc, Request $request){
899 $all = $request->all();
900 $doc->update($all);
901
902 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись');
903 }
904
891 // Удаление контакта предыдущей компании 905 // Удаление контакта предыдущей компании
892 public function delete_prev_company(PrevCompany $doc) { 906 public function delete_prev_company(PrevCompany $doc) {
893 $doc->delete(); 907 $doc->delete();
894 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); 908 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!');
895 } 909 }
896 } 910 }
897 911
898 912
app/Models/Dop_info.php
1 <?php 1 <?php
2 2
3 namespace App\Models; 3 namespace App\Models;
4 4
5 use Illuminate\Database\Eloquent\Factories\HasFactory; 5 use Illuminate\Database\Eloquent\Factories\HasFactory;
6 use Illuminate\Database\Eloquent\Model; 6 use Illuminate\Database\Eloquent\Model;
7 7
8 class Dop_info extends Model 8 class Dop_info extends Model
9 { 9 {
10 use HasFactory; 10 use HasFactory;
11 11
12 public $table = 'dop_info'; 12 public $table = 'dop_info';
13 13
14 public $fillable = [ 14 public $fillable = [
15 'worker_id', 15 'worker_id',
16 'infoblok_id', 16 'infoblok_id',
17 'text' 17 'text',
18 'status'
18 ]; 19 ];
19 } 20 }
20 21
app/Models/Worker.php
1 <?php 1 <?php
2 2
3 namespace App\Models; 3 namespace App\Models;
4 4
5 use Illuminate\Database\Eloquent\Factories\HasFactory; 5 use Illuminate\Database\Eloquent\Factories\HasFactory;
6 use Illuminate\Database\Eloquent\Model; 6 use Illuminate\Database\Eloquent\Model;
7 7
8 class Worker extends Model 8 class Worker extends Model
9 { 9 {
10 use HasFactory; 10 use HasFactory;
11 11
12 protected $table = 'Workers'; 12 protected $table = 'Workers';
13 13
14 protected $fillable = [ 14 protected $fillable = [
15 'user_id', 15 'user_id',
16 'status_work', 16 'status_work',
17 'position_work', 17 'position_work',
18 'telephone', 18 'telephone',
19 'telephone2', 19 'telephone2',
20 'persent_anketa', 20 'persent_anketa',
21 'photo', 21 'photo',
22 'email_data', 22 'email_data',
23 'status_profile', 23 'status_profile',
24 'old_year', 24 'old_year',
25 'experience', 25 'experience',
26 'en_is', 26 'en_is',
27 'education', 27 'education',
28 'email', 28 'email',
29 'interpassport', 29 'interpassport',
30 'mk', 30 'mk',
31 'vvp', 31 'vvp',
32 'vlm', 32 'vlm',
33 'reka_diplom', 33 'reka_diplom',
34 'more_diplom', 34 'more_diplom',
35 'mpss', 35 'mpss',
36 'tanker', 36 'tanker',
37 'gmssb', 37 'gmssb',
38 'resume', 38 'resume',
39 'sort', 39 'sort',
40 'updated_at', 40 'updated_at',
41 'text', 41 'text',
42 'address', 42 'address',
43 'city', 43 'city',
44 'coord', 44 'coord',
45 'file', 45 'file',
46 'is_remove', 46 'is_remove',
47 'favorite_user', 47 'favorite_user',
48 'sroch_user' 48 'sroch_user'
49 ]; 49 ];
50 50
51 /* 51 /*
52 * Связь таблицы users с таблицей workers 52 * Связь таблицы users с таблицей workers
53 */ 53 */
54 public function users() { 54 public function users() {
55 return $this->belongsTo(User::class, 'user_id'); 55 return $this->belongsTo(User::class, 'user_id');
56 } 56 }
57 57
58 // Связь Работника с сертификами (0-0 - 1) 58 // Связь Работника с сертификами (0-0 - 1)
59 public function sertificate() { 59 public function sertificate() {
60 return $this->hasMany(sertification::class); 60 return $this->hasMany(sertification::class);
61 } 61 }
62 62
63 // Связь Работника с должностями (0-0 - 1) 63 // Связь Работника с должностями (0-0 - 1)
64 public function job_titles() { 64 public function job_titles() {
65 return $this->belongsToMany(Job_title::class, 'title_workers'); 65 return $this->belongsToMany(Job_title::class, 'title_workers');
66 } 66 }
67 67
68 //Связь Работника с опытом работы (1 - 0-0) 68 //Связь Работника с опытом работы (1 - 0-0)
69 public function place_worker() { 69 public function place_worker() {
70 return $this->hasMany(place_works::class); 70 return $this->hasMany(place_works::class);
71 } 71 }
72 72
73 public function scopeActive($query) { 73 public function scopeActive($query) {
74 return $query->where('is_remove', '=', '0'); 74 return $query->where('is_remove', '=', '0');
75 } 75 }
76 76
77 //Связь Работника с предыдущими компаниями 77 //Связь Работника с предыдущими компаниями
78 public function prev_company() { 78 public function prev_company() {
79 return $this->hasMany(PrevCompany::class); 79 return $this->hasMany(PrevCompany::class);
80 } 80 }
81 81
82 //Связь Работника с инфоблоками (0-0 - 0-0) 82 //Связь Работника с инфоблоками (0-0 - 0-0)
83 public function infobloks() { 83 public function infobloks() {
84 return $this->belongsToMany(infobloks::class,'dop_info', 'worker_id', 'infoblok_id'); 84 return $this->belongsToMany(infobloks::class,'dop_info', 'worker_id', 'infoblok_id');
85 } 85 }
86 86
87 //Связи Работника с дополнительными 87 //Связи Работника с дополнительными
88 public function dop_info() { 88 public function dop_info() {
89 return $this->hasMany(Dop_info::class, 'infoblok_id'); 89 return $this->hasMany(Dop_info::class, 'worker_id');
90 } 90 }
91 91
92 } 92 }
93 93
database/migrations/2024_04_19_092957_alter_table_dop_info.php
File was created 1 <?php
2
3 use Illuminate\Database\Migrations\Migration;
4 use Illuminate\Database\Schema\Blueprint;
5 use Illuminate\Support\Facades\Schema;
6
7 return new class extends Migration
8 {
9 /**
10 * Run the migrations.
11 *
12 * @return void
13 */
14 public function up()
15 {
16 Schema::table('dop_info', function (Blueprint $table) {
17 $table->integer('status')->default(0);
18 });
19 }
20
21 /**
22 * Reverse the migrations.
23 *
24 * @return void
25 */
26 public function down()
27 {
28 Schema::table('messages', function (Blueprint $table) {
29 $table->dropColumn('status');
30 });
31 }
32 };
33
resources/views/employers/cabinet.blade.php
1 @extends('layout.frontend', ['title' => 'Образование и образовательные программы - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Образование и образовательные программы - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 console.log('Test system'); 5 console.log('Test system');
6
7
6 $(document).on('click', '.die_black', function() { 8 $(document).on('click', '.die_black', function() {
7 var this_ = $(this); 9 var this_ = $(this);
8 var ajax_ = $('#ajax_flot_div'); 10 var ajax_ = $('#ajax_flot_div');
9 var id_ = this_.attr('data-test'); 11 var id_ = this_.attr('data-test');
10 var url_ = this_.attr('data-link'); 12 var url_ = this_.attr('data-link');
11 13
12 console.log(url_); 14 console.log(url_);
13 $.ajax({ 15 $.ajax({
14 type: "GET", 16 type: "GET",
15 url: url_, 17 url: url_,
16 success: function (data) { 18 success: function (data) {
17 console.log('Ответка'); 19 console.log('Ответка');
18 ajax_.html(data); 20 ajax_.html(data);
19 }, 21 },
20 headers: { 22 headers: {
21 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 23 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
22 }, 24 },
23 error: function (data) { 25 error: function (data) {
24 console.log('Error: ' + data); 26 console.log('Error: ' + data);
25 } 27 }
26 }); 28 });
27 29
28 }); 30 });
29 </script> 31 </script>
30 @endsection 32 @endsection
31 @section('content') 33 @section('content')
32 <section class="cabinet"> 34 <section class="cabinet">
33 <div class="container"> 35 <div class="container">
34 <ul class="breadcrumbs cabinet__breadcrumbs"> 36 <ul class="breadcrumbs cabinet__breadcrumbs">
35 <li><a href="{{ route('index') }}">Главная</a></li> 37 <li><a href="{{ route('index') }}">Главная</a></li>
36 <li><b>Личный кабинет</b></li> 38 <li><b>Личный кабинет</b></li>
37 </ul> 39 </ul>
38 <div class="cabinet__wrapper"> 40 <div class="cabinet__wrapper">
39 <div class="cabinet__side"> 41 <div class="cabinet__side">
40 <div class="cabinet__side-toper"> 42 <div class="cabinet__side-toper">
41 <div class="cabinet__side-toper-pic"> 43 <div class="cabinet__side-toper-pic">
42 @if (isset($Employer[0]->logo)) 44 @if (isset($Employer[0]->logo))
43 <img src="{{ asset(Storage::url($Employer[0]->logo)) }}" width="150" alt="{{ $Employer[0]->name_company }}"> 45 <img src="{{ asset(Storage::url($Employer[0]->logo)) }}" width="150" alt="{{ $Employer[0]->name_company }}">
44 @else 46 @else
45 <img src="{{ asset('images/logo_emp.png') }}" width="150" alt="{{ $Employer[0]->name_company }}"/> 47 <img src="{{ asset('images/logo_emp.png') }}" width="150" alt="{{ $Employer[0]->name_company }}"/>
46 @endif 48 @endif
47 </div> 49 </div>
48 <b>{{ $Employer[0]->name_company }}</b> 50 <b>{{ $Employer[0]->name_company }}</b>
49 </div> 51 </div>
50 52
51 @include('employers.menu') 53 @include('employers.menu')
52 54
53 </div> 55 </div>
54 <div class="cabinet__body"> 56 <div class="cabinet__body">
55 @include('messages_error') 57 @include('messages_error')
56 58
57 <form action="{{ route('employer.cabinet_save', ['Employer' => $Employer[0]->id]) }}" method="POST" enctype="multipart/form-data"> 59 <form action="{{ route('employer.cabinet_save', ['Employer' => $Employer[0]->id]) }}" method="POST" enctype="multipart/form-data">
58 @csrf 60 @csrf
59 <div class="cabinet__body-item"> 61 <div class="cabinet__body-item">
60 <div class="cabinet__descr"> 62 <div class="cabinet__descr">
61 <h2 class="title cabinet__title">Мой профиль</h2> 63 <h2 class="title cabinet__title">Мой профиль</h2>
62 <p class="cabinet__text">Все поля обязательны для заполнения *</p> 64 <p class="cabinet__text">Все поля обязательны для заполнения *</p>
63 </div> 65 </div>
64 <div class="cabinet__avatar"> 66 <div class="cabinet__avatar">
65 <div class="cabinet__avatar-pic"> 67 <div class="cabinet__avatar-pic">
66 @if (isset($Employer[0]->logo)) 68 @if (isset($Employer[0]->logo))
67 <img src="{{ asset(Storage::url($Employer[0]->logo)) }}" width="150" alt="{{ $Employer[0]->name_company }}"> 69 <img src="{{ asset(Storage::url($Employer[0]->logo)) }}" width="150" alt="{{ $Employer[0]->name_company }}">
68 @else 70 @else
69 <img src="{{ asset('images/logo_emp.png') }}" width="150" alt="{{ $Employer[0]->name_company }}"/> 71 <img src="{{ asset('images/logo_emp.png') }}" width="150" alt="{{ $Employer[0]->name_company }}"/>
70 @endif 72 @endif
71 </div> 73 </div>
72 <div class="cabinet__avatar-form"> 74 <div class="cabinet__avatar-form">
73 <label class="file"> 75 <label class="file">
74 <span class="file__input"> 76 <span class="file__input">
75 <input type="file" name="logo"> 77 <input type="file" name="logo">
76 <span class="button"> 78 <span class="button">
77 <svg> 79 <svg>
78 <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use> 80 <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use>
79 </svg> 81 </svg>
80 Загрузить 82 Загрузить
81 </span> 83 </span>
82 </span> 84 </span>
83 </label> 85 </label>
84 <p class="cabinet__text">Загрузите логотип в формате .svg, .jpg, .png или .jpeg</p> 86 <p class="cabinet__text">Загрузите логотип в формате .svg, .jpg, .png или .jpeg</p>
85 </div> 87 </div>
86 </div> 88 </div>
87 <div class="cabinet__inputs"> 89 <div class="cabinet__inputs">
88 <div class="cabinet__inputs-item form-group"> 90 <div class="cabinet__inputs-item form-group">
89 <label class="form-group__label">Название судоходной компании</label> 91 <label class="form-group__label">Название судоходной компании</label>
90 <div class="form-group__item"> 92 <div class="form-group__item">
91 <input type="text" class="input" name="name_company" id="name_company" placeholder="ООО Река Море" value="{{ old('name_company') ?? $Employer[0]->name_company ?? '' }}" required> 93 <input type="text" class="input" name="name_company" id="name_company" placeholder="ООО Река Море" value="{{ old('name_company') ?? $Employer[0]->name_company ?? '' }}" required>
92 @error('name_company') 94 @error('name_company')
93 <span class="text-xs text-red-600"> 95 <span class="text-xs text-red-600">
94 {{ $message }} 96 {{ $message }}
95 </span> 97 </span>
96 @enderror 98 @enderror
97 </div> 99 </div>
98 </div> 100 </div>
99 <div class="cabinet__inputs-item form-group"> 101 <div class="cabinet__inputs-item form-group">
100 <label class="form-group__label">Электронная почта</label> 102 <label class="form-group__label">Электронная почта</label>
101 <div class="form-group__item"> 103 <div class="form-group__item">
102 <input type="email" name="email" class="input" placeholder="info@rekamore.su" value="{{ old('email') ?? $Employer[0]->email ?? '' }}" required> 104 <input type="email" name="email" class="input" placeholder="info@rekamore.su" value="{{ old('email') ?? $Employer[0]->email ?? '' }}" required>
103 @error('email') 105 @error('email')
104 <span class="text-xs text-red-600"> 106 <span class="text-xs text-red-600">
105 {{ $message }} 107 {{ $message }}
106 </span> 108 </span>
107 @enderror 109 @enderror
108 </div> 110 </div>
109 </div> 111 </div>
110 <div class="cabinet__inputs-item form-group"> 112 <div class="cabinet__inputs-item form-group">
111 <label class="form-group__label">Номер телефона</label> 113 <label class="form-group__label">Номер телефона</label>
112 <div class="form-group__item"> 114 <div class="form-group__item">
113 <input type="tel" name="telephone" class="input" placeholder="+7 (___) ___-__-__" value="{{ old('telephone') ?? $Employer[0]->telephone ?? '' }}" required> 115 <input type="tel" name="telephone" class="input" placeholder="+7 (___) ___-__-__" value="{{ old('telephone') ?? $Employer[0]->telephone ?? '' }}" required>
114 @error('telephone') 116 @error('telephone')
115 <span class="text-xs text-red-600"> 117 <span class="text-xs text-red-600">
116 {{ $message }} 118 {{ $message }}
117 </span> 119 </span>
118 @enderror 120 @enderror
119 </div> 121 </div>
120 </div> 122 </div>
121 <div class="cabinet__inputs-item form-group"> 123 <div class="cabinet__inputs-item form-group">
122 <label class="form-group__label">Адрес компании</label> 124 <label class="form-group__label">Адрес компании</label>
123 <div class="form-group__item"> 125 <div class="form-group__item">
124 <input type="text" name="address" class="input" value="{{ old('address') ?? $Employer[0]->address ?? '' }}" placeholder="692904, Приморский край, г. Находка, ул. Портовая 3А, 5 этаж" required> 126 <input type="text" name="address" class="input" value="{{ old('address') ?? $Employer[0]->address ?? '' }}" placeholder="692904, Приморский край, г. Находка, ул. Портовая 3А, 5 этаж" required>
125 @error('address') 127 @error('address')
126 <span class="text-xs text-red-600"> 128 <span class="text-xs text-red-600">
127 {{ $message }} 129 {{ $message }}
128 </span> 130 </span>
129 @enderror 131 @enderror
130 </div> 132 </div>
131 </div> 133 </div>
132 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 134 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
133 <label class="form-group__label">Ссылка на сайт</label> 135 <label class="form-group__label">Ссылка на сайт</label>
134 <div class="form-group__item"> 136 <div class="form-group__item">
135 <input type="url" name="site" class="input" value="{{ old('site') ?? $Employer[0]->site ?? '' }}" placeholder="https://rekamore.su" required> 137 <input type="url" name="site" class="input" value="{{ old('site') ?? $Employer[0]->site ?? '' }}" placeholder="https://rekamore.su" required>
136 @error('site') 138 @error('site')
137 <span class="text-xs text-red-600"> 139 <span class="text-xs text-red-600">
138 {{ $message }} 140 {{ $message }}
139 </span> 141 </span>
140 @enderror 142 @enderror
141 </div> 143 </div>
142 </div> 144 </div>
143 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 145 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
144 <label class="form-group__label">О компании</label> 146 <label class="form-group__label">О компании</label>
145 <div class="form-group__item"> 147 <div class="form-group__item">
146 <textarea name="text" class="textarea" required>{{ old('text') ?? $Employer[0]->text ?? '' }}</textarea> 148 <textarea name="text" class="textarea" required>{{ old('text') ?? $Employer[0]->text ?? '' }}</textarea>
147 @error('text') 149 @error('text')
148 <span class="text-xs text-red-600"> 150 <span class="text-xs text-red-600">
149 {{ $message }} 151 {{ $message }}
150 </span> 152 </span>
151 @enderror 153 @enderror
152 </div> 154 </div>
153 </div> 155 </div>
154 </div> 156 </div>
155 </div><br> 157 </div><br>
156 <button type="submit" class="button cabinet__submit">Сохранить изменения</button> 158 <button type="submit" class="button cabinet__submit">Сохранить изменения</button>
157 </form> 159 </form>
158 160
159 <div class="cabinet__body-item"> 161 <div class="cabinet__body-item">
160 <div class="cabinet__descr"> 162 <div class="cabinet__descr">
161 <h2 class="title cabinet__title">Мой флот</h2> 163 <h2 class="title cabinet__title">Мой флот</h2>
162 </div> 164 </div>
163 165
164 <form action="{{ route('employer.save_add_flot') }}" method="POST" class="cabinet__add" enctype="multipart/form-data"> 166 <form action="{{ route('employer.save_add_flot') }}" method="POST" class="cabinet__add" enctype="multipart/form-data">
165 @csrf 167 @csrf
166 <label class="cabinet__add-pic" style="vertical-align: top"> 168 <label class="cabinet__add-pic" style="vertical-align: top">
167 <input type="file" name="image" id="image"> 169 <input type="file" name="image" id="image">
168 <input type="hidden" name="employer_id" id="employer_id" value="{{ $Employer[0]->id }}"/> 170 <input type="hidden" name="employer_id" id="employer_id" value="{{ $Employer[0]->id }}"/>
169 <svg> 171 <svg>
170 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 172 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
171 </svg> 173 </svg>
172 <span> 174 <span>
173 <svg> 175 <svg>
174 <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use> 176 <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use>
175 </svg> 177 </svg>
176 Загрузить фото 178 Загрузить фото
177 </span> 179 </span>
178 </label> 180 </label>
179 181
180 <div class="cabinet__add-body"> 182 <div class="cabinet__add-body">
181 <div class="form-group"> 183 <div class="form-group">
182 <label class="form-group__label">Название корабля</label> 184 <label class="form-group__label">Название корабля</label>
183 <div class="form-group__item"> 185 <div class="form-group__item">
184 <input type="text" name="name" id="flot_name" class="input" placeholder="Корабль №000001" required> 186 <input type="text" name="name" id="flot_name" class="input" placeholder="Корабль №000001" required>
185 </div> 187 </div>
186 </div> 188 </div>
187 <div class="form-group"> 189 <div class="form-group">
188 <label class="form-group__label">Описание</label> 190 <label class="form-group__label">Описание</label>
189 <div class="form-group__item"> 191 <div class="form-group__item">
190 <input type="text" name="text" id="flot_text" class="input" placeholder="Это судно находится..." required> 192 <input type="text" name="text" id="flot_text" class="input" placeholder="Это судно находится..." required>
191 </div> 193 </div>
192 </div> 194 </div>
193 <div class="form-group"> 195 <div class="form-group">
194 <label class="form-group__label">Регион</label> 196 <label class="form-group__label">Регион</label>
195 <div class="form-group__item"> 197 <div class="form-group__item">
196 <input type="text" name="region" id="region" class="input" placeholder="Мурманск" required> 198 <input type="text" name="region" id="region" class="input" placeholder="Мурманск" required>
197 </div> 199 </div>
198 </div> 200 </div>
199 <div class="form-group"> 201 <div class="form-group">
200 <label class="form-group__label">Мощность</label> 202 <label class="form-group__label">Мощность</label>
201 <div class="form-group__item"> 203 <div class="form-group__item">
202 <input type="text" name="power" id="flot_power" class="input" placeholder="Dw 40000 9000Kw" required> 204 <input type="text" name="power" id="flot_power" class="input" placeholder="Dw 40000 9000Kw" required>
203 </div> 205 </div>
204 </div> 206 </div>
205 <button type="submit" class="button" id="ajax_flot" name="ajax_flot">Добавить флот</button> 207 <button type="submit" class="button" id="ajax_flot" name="ajax_flot">Добавить флот</button>
206 </div> 208 </div>
207 209
208 </form> 210 </form>
209 211
210 <div class="cabinet__fleet" id="ajax_flot_div" name="ajax_flot_div"> 212 <div class="cabinet__fleet" id="ajax_flot_div" name="ajax_flot_div">
211 @if (isset($Employer[0]->flots)) 213 @if (isset($Employer[0]->flots))
212 @if ($Employer[0]->flots->count()) 214 @if ($Employer[0]->flots->count())
213 @foreach ($Employer[0]->flots as $it) 215 @foreach ($Employer[0]->flots as $it)
214 <div class="cabinet__fleet-item main__employer-page-one-item"> 216 <div class="cabinet__fleet-item main__employer-page-one-item">
215 <div class="del die_black" data-test="{{ $it->id }}" data-link="{{ route('employer.delete_flot', ['Flot' => $it->id]) }}"> 217 <div class="del die_black" data-test="{{ $it->id }}" data-link="{{ route('employer.delete_flot', ['Flot' => $it->id]) }}">
216 <svg> 218 <svg>
217 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> 219 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use>
218 </svg> 220 </svg>
219 </div> 221 </div>
220 @if (!empty($it->image)) 222 @if (!empty($it->image))
221 <img src="{{ asset(Storage::url($it->image)) }}" alt="{{ $it->name }}"> 223 <img src="{{ asset(Storage::url($it->image)) }}" alt="{{ $it->name }}">
222 @else 224 @else
223 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $it->name }}"/> 225 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $it->name }}"/>
224 @endif 226 @endif
225 <b>{{ $it->name }}</b> 227 <b>{{ $it->name }}</b>
226 <span>{{ $it->text }}</span> 228 <span>{{ $it->text }}</span>
227 </div> 229 </div>
228 @endforeach 230 @endforeach
229 @endif 231 @endif
230 @endif 232 @endif
231 </div> 233 </div>
232 </div> 234 </div>
233 </div> 235 </div>
234 </div> 236 </div>
235 </div> 237 </div>
236 </section> 238 </section>
237 </div> <!-- END TOP WRAPPER --> 239 </div> <!-- END TOP WRAPPER -->
238 @endsection 240 @endsection
239 241
resources/views/workers/cabinet.blade.php
1 @extends('layout.frontend', ['title' => 'Моя анкета - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Моя анкета - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 console.log('Test system'); 5 console.log('Test system');
6 $(document).on('click', '#button_new_doc123', function() { 6 $(document).on('click', '#button_new_doc123', function() {
7 var this_ = $(this); 7 var this_ = $(this);
8 var val_ = this_.attr('data-val'); 8 var val_ = this_.attr('data-val');
9 var new_diplom = $('#new_diplom'); 9 var new_diplom = $('#new_diplom');
10 var new_diplom_val = new_diplom.val(); 10 var new_diplom_val = new_diplom.val();
11 var new_data_begin = $('#new_data_begin'); 11 var new_data_begin = $('#new_data_begin');
12 var new_data_begin_val = new_data_begin.val(); 12 var new_data_begin_val = new_data_begin.val();
13 var new_data_end = $('#new_data_end'); 13 var new_data_end = $('#new_data_end');
14 var new_data_end_val = new_data_end.val(); 14 var new_data_end_val = new_data_end.val();
15 var education = $('#education'); 15 var education = $('#education');
16 var education_val = education.val(); 16 var education_val = education.val();
17 var worker_id = $('#new_id'); 17 var worker_id = $('#new_id');
18 var worker_val = worker_id.val(); 18 var worker_val = worker_id.val();
19 19
20 console.log('sort items ' + val_); 20 console.log('sort items ' + val_);
21 21
22 if (new_diplom_val == '') { 22 if (new_diplom_val == '') {
23 new_diplom.addClass('err_red'); 23 new_diplom.addClass('err_red');
24 console.log('Border Up'); 24 console.log('Border Up');
25 } else { 25 } else {
26 $.ajax({ 26 $.ajax({
27 type: "GET", 27 type: "GET",
28 url: "{{ route('worker.add_serificate') }}", 28 url: "{{ route('worker.add_serificate') }}",
29 data: "worker_id="+worker_val+"&date_begin="+new_data_begin_val + "&end_begin=" + new_data_end_val + "&name=" + new_diplom_val + "&education="+education_val, 29 data: "worker_id="+worker_val+"&date_begin="+new_data_begin_val + "&end_begin=" + new_data_end_val + "&name=" + new_diplom_val + "&education="+education_val,
30 success: function (data) { 30 success: function (data) {
31 console.log('Блокировка...'); 31 console.log('Блокировка...');
32 console.log(data); 32 console.log(data);
33 $('#sertificate').html(data); 33 $('#sertificate').html(data);
34 if (new_diplom.hasClass('err_red')) new_diplom.removeClass('err_red'); 34 if (new_diplom.hasClass('err_red')) new_diplom.removeClass('err_red');
35 }, 35 },
36 headers: { 36 headers: {
37 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 37 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
38 }, 38 },
39 error: function (data) { 39 error: function (data) {
40 data = JSON.stringify(data); 40 data = JSON.stringify(data);
41 console.log('Error: ' + data); 41 console.log('Error: ' + data);
42 } 42 }
43 }); 43 });
44 } 44 }
45 }); 45 });
46 46
47 $(document).on('click', '#btn_new_diplom123', function() { 47 $(document).on('click', '#btn_new_diplom123', function() {
48 var this_ = $(this); 48 var this_ = $(this);
49 var val_ = this_.attr('data-val'); 49 var val_ = this_.attr('data-val');
50 var documents = $('#documents'); 50 var documents = $('#documents');
51 var doc_val = documents.val(); 51 var doc_val = documents.val();
52 var block = $('#ajax_dop_diplomi'); 52 var block = $('#ajax_dop_diplomi');
53 53
54 console.log('worker_id='+val_+'it_infoblock='+ doc_val); 54 console.log('worker_id='+val_+'it_infoblock='+ doc_val);
55 55
56 $.ajax({ 56 $.ajax({
57 type: "GET", 57 type: "GET",
58 url: "", 58 url: "",
59 data: "worker_id="+val_+"&infoblok_id="+doc_val, 59 data: "worker_id="+val_+"&infoblok_id="+doc_val,
60 success: function (data) { 60 success: function (data) {
61 location.url = data; 61 location.url = data;
62 console.log('Добавление документа-диплома'); 62 console.log('Добавление документа-диплома');
63 console.log(data); 63 console.log(data);
64 block.html(data); 64 block.html(data);
65 }, 65 },
66 headers: { 66 headers: {
67 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 67 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
68 }, 68 },
69 error: function (data) { 69 error: function (data) {
70 data = JSON.stringify(data); 70 data = JSON.stringify(data);
71 console.log('Error: ' + data); 71 console.log('Error: ' + data);
72 } 72 }
73 }); 73 });
74 }); 74 });
75 75
76 $(document).on('click', '#new_work', function() { 76 $(document).on('click', '#new_work', function() {
77 var this_ = $(this); 77 var this_ = $(this);
78 var val_ = this_.attr('data-val'); 78 var val_ = this_.attr('data-val');
79 var new_diplom = $('#new_diplom').val(); 79 var new_diplom = $('#new_diplom').val();
80 var new_data_begin = $('#new_data_begin').val(); 80 var new_data_begin = $('#new_data_begin').val();
81 var new_data_end = $('#new_data_end').val(); 81 var new_data_end = $('#new_data_end').val();
82 var new_job_title = $('#new_job_title').val(); 82 var new_job_title = $('#new_job_title').val();
83 var new_teplohod = $('#new_teplohod').val(); 83 var new_teplohod = $('#new_teplohod').val();
84 var new_GWT = $('#new_GWT').val(); 84 var new_GWT = $('#new_GWT').val();
85 var new_KBT = $('#new_KBT').val(); 85 var new_KBT = $('#new_KBT').val();
86 var new_Begin_work = $('#new_Begin_work').val(); 86 var new_Begin_work = $('#new_Begin_work').val();
87 var new_End_work = $('#new_End_work').val(); 87 var new_End_work = $('#new_End_work').val();
88 var new_name_company = $('#new_name_company').val(); 88 var new_name_company = $('#new_name_company').val();
89 89
90 console.log('worker_id='+val_+'it_infoblock='+ doc_val); 90 console.log('worker_id='+val_+'it_infoblock='+ doc_val);
91 91
92 $.ajax({ 92 $.ajax({
93 type: "GET", 93 type: "GET",
94 url: "", 94 url: "",
95 data: "worker_id="+val_+"&infoblok_id="+doc_val, 95 data: "worker_id="+val_+"&infoblok_id="+doc_val,
96 success: function (data) { 96 success: function (data) {
97 location.url = data; 97 location.url = data;
98 console.log('Добавление документа-диплома'); 98 console.log('Добавление документа-диплома');
99 console.log(data); 99 console.log(data);
100 block.html(data); 100 block.html(data);
101 }, 101 },
102 headers: { 102 headers: {
103 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 103 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
104 }, 104 },
105 error: function (data) { 105 error: function (data) {
106 data = JSON.stringify(data); 106 data = JSON.stringify(data);
107 console.log('Error: ' + data); 107 console.log('Error: ' + data);
108 } 108 }
109 }); 109 });
110 }); 110 });
111 111
112 $(document).on('click', '#old_year', function() { 112 $(document).on('click', '#old_year', function() {
113 var this_ = $(this); 113 var this_ = $(this);
114 var val = this_.val(); 114 var val = this_.val();
115 115
116 if (val < 0) 116 if (val < 0)
117 $('#old_year').val(0); 117 $('#old_year').val(0);
118 118
119 console.log('Возраст не может выполнить такую операцию'); 119 console.log('Возраст не может выполнить такую операцию');
120 }); 120 });
121 121
122 $(document).on('change', '.sertificates_js', function() { 122 $(document).on('change', '.sertificates_js', function() {
123 var this_ = $(this); 123 var this_ = $(this);
124 var infoblock_id = this_.attr('data-info'); 124 var infoblock_id = this_.attr('data-info');
125 var val = this_.val(); 125 var val = this_.val();
126 var block = $('#block_sertificate'); 126 var block = $('#block_sertificate');
127 127
128 console.log('infoblok='+infoblock_id); 128 console.log('infoblok='+infoblock_id);
129 console.log('val='+val); 129 console.log('val='+val);
130 130
131 $.ajax({ 131 $.ajax({
132 type: "GET", 132 type: "GET",
133 url: "{{ route('worker.delete_add_diplom', ['worker' => $Worker[0]->id]) }}", 133 url: "{{ route('worker.delete_add_diplom', ['worker' => $Worker[0]->id]) }}",
134 data: "&infoblok_id=" + infoblock_id+"&val="+val, 134 data: "&infoblok_id=" + infoblock_id+"&val="+val,
135 success: function (data) { 135 success: function (data) {
136 location.url = data; 136 location.url = data;
137 console.log('Удаление левых документов + добавление реальных документов'); 137 console.log('Удаление левых документов + добавление реальных документов');
138 138
139 console.log('Info 100% +'+ data); 139 console.log('Info 100% +'+ data);
140 //window.location.href = data; 140 //window.location.href = data;
141 //block.html(data); 141 //block.html(data);
142 }, 142 },
143 headers: { 143 headers: {
144 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 144 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
145 }, 145 },
146 error: function (data) { 146 error: function (data) {
147 data = JSON.stringify(data); 147 data = JSON.stringify(data);
148 console.log('Error: ' + data); 148 console.log('Error: ' + data);
149 } 149 }
150 }); 150 });
151 151
152 }); 152 });
153 153
154 </script> 154 </script>
155 @endsection 155 @endsection
156 156
157 @section('content') 157 @section('content')
158 <section class="cabinet"> 158 <section class="cabinet">
159 <div class="container"> 159 <div class="container">
160 <ul class="breadcrumbs cabinet__breadcrumbs"> 160 <ul class="breadcrumbs cabinet__breadcrumbs">
161 <li><a href="{{ route('index') }}">Главная</a></li> 161 <li><a href="{{ route('index') }}">Главная</a></li>
162 <li><b>Личный кабинет</b></li> 162 <li><b>Личный кабинет</b></li>
163 </ul> 163 </ul>
164 <div class="cabinet__wrapper"> 164 <div class="cabinet__wrapper">
165 <div class="cabinet__side"> 165 <div class="cabinet__side">
166 <div class="cabinet__side-toper"> 166 <div class="cabinet__side-toper">
167 @include('workers.emblema') 167 @include('workers.emblema')
168 168
169 </div> 169 </div>
170 170
171 @include('workers.menu', ['item' => 1]) 171 @include('workers.menu', ['item' => 1])
172 </div> 172 </div>
173 <form class="cabinet__body" action="{{ route('worker.cabinet_save', ['worker' => $Worker[0]->id]) }}" enctype="multipart/form-data" method="POST"> 173 <form class="cabinet__body" action="{{ route('worker.cabinet_save', ['worker' => $Worker[0]->id]) }}" enctype="multipart/form-data" method="POST">
174 @csrf 174 @csrf
175 @include('messages_error') 175 @include('messages_error')
176 <div class="cabinet__body-item"> 176 <div class="cabinet__body-item">
177 <div class="cabinet__anketa"> 177 <div class="cabinet__anketa">
178 <h2 class="title cabinet__title">Моя анкета</h2> 178 <h2 class="title cabinet__title">Моя анкета</h2>
179 <div class="cabinet__anketa-buttons"> 179 <div class="cabinet__anketa-buttons">
180 <a href="{{ route('worker.up', ['worker' => $Worker[0]->id]) }}" class="button">Поднять резюме</a> 180 <a href="{{ route('worker.up', ['worker' => $Worker[0]->id]) }}" class="button">Поднять резюме</a>
181 <a href="{{ route('resume_download', ['worker' => $Worker[0]->id]) }}" target="_blank" class="button"> 181 <a href="{{ route('resume_download', ['worker' => $Worker[0]->id]) }}" target="_blank" class="button">
182 <svg> 182 <svg>
183 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> 183 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
184 </svg> 184 </svg>
185 Скачать резюме 185 Скачать резюме
186 </a> 186 </a>
187 </div> 187 </div>
188 </div> 188 </div>
189 </div> 189 </div>
190 <div class="cabinet__body-item"> 190 <div class="cabinet__body-item">
191 <div class="cabinet__stats"> 191 <div class="cabinet__stats">
192 <h3 class="cabinet__subtitle cabinet__stats-title">Статистика</h3> 192 <h3 class="cabinet__subtitle cabinet__stats-title">Статистика</h3>
193 <div class="cabinet__stats-body"> 193 <div class="cabinet__stats-body">
194 <div class="cabinet__stats-item"> 194 <div class="cabinet__stats-item">
195 <svg> 195 <svg>
196 <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use> 196 <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use>
197 </svg> 197 </svg>
198 <span>Просмотров:</span> 198 <span>Просмотров:</span>
199 <b>@if (isset($stat[0]->lookin)) {{ $stat[0]->lookin }} @else 0 @endif</b> 199 <b>@if (isset($stat[0]->lookin)) {{ $stat[0]->lookin }} @else 0 @endif</b>
200 </div> 200 </div>
201 <div class="cabinet__stats-item"> 201 <div class="cabinet__stats-item">
202 <svg> 202 <svg>
203 <use xlink:href="{{ asset('images/sprite.svg#warning') }}"></use> 203 <use xlink:href="{{ asset('images/sprite.svg#warning') }}"></use>
204 </svg> 204 </svg>
205 <span>Отзывов:</span> 205 <span>Отзывов:</span>
206 <b>@if (isset($stat[0]->message)) {{ $stat[0]->message }} @else 0 @endif</b> 206 <b>@if (isset($stat[0]->message)) {{ $stat[0]->message }} @else 0 @endif</b>
207 </div> 207 </div>
208 </div> 208 </div>
209 <div class="cabinet__stats-subtitle">Анкета заполнена на {{ $persent }}%</div> 209 <div class="cabinet__stats-subtitle">Анкета заполнена на {{ $persent }}%</div>
210 <div class="cabinet__stats-line"> 210 <div class="cabinet__stats-line">
211 <span style="width:{{ $persent }}%"></span> 211 <span style="width:{{ $persent }}%"></span>
212 </div> 212 </div>
213 <div class="cabinet__stats-bottom">Заполните профиль, чтобы повысить процент анкеты на 80%</div> 213 <div class="cabinet__stats-bottom">Заполните профиль, чтобы повысить процент анкеты на 80%</div>
214 </div> 214 </div>
215 </div> 215 </div>
216 <div class="cabinet__body-item"> 216 <div class="cabinet__body-item">
217 <h3 class="cabinet__subtitle">Профиль</h3> 217 <h3 class="cabinet__subtitle">Профиль</h3>
218 <div class="cabinet__avatar"> 218 <div class="cabinet__avatar">
219 <div class="cabinet__avatar-pic"> 219 <div class="cabinet__avatar-pic">
220 220
221 @if (!empty($Worker[0]->photo)) 221 @if (!empty($Worker[0]->photo))
222 <img src="{{ asset(Storage::url($Worker[0]->photo)) }}"/> 222 <img src="{{ asset(Storage::url($Worker[0]->photo)) }}"/>
223 @else 223 @else
224 <svg> 224 <svg>
225 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 225 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
226 </svg> 226 </svg>
227 @endif 227 @endif
228 </div> 228 </div>
229 <div class="cabinet__avatar-form"> 229 <div class="cabinet__avatar-form">
230 <label class="file"> 230 <label class="file">
231 <span class="file__input"> 231 <span class="file__input">
232 <input type="file" name="photo" id="photo"> 232 <input type="file" name="photo" id="photo">
233 233
234 <span class="button"> 234 <span class="button">
235 <svg> 235 <svg>
236 <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use> 236 <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use>
237 </svg> 237 </svg>
238 Загрузить 238 Загрузить
239 </span> 239 </span>
240 </span> 240 </span>
241 </label> 241 </label>
242 <p class="cabinet__text">Загрузите фотографию в формате svg., jpg., jpeg., png.</p> 242 <p class="cabinet__text">Загрузите фотографию в формате svg., jpg., jpeg., png.</p>
243 </div> 243 </div>
244 </div> 244 </div>
245 </div> 245 </div>
246 <div class="cabinet__body-item"> 246 <div class="cabinet__body-item">
247 <div class="cabinet__inputs"> 247 <div class="cabinet__inputs">
248 <div class="cabinet__inputs-item form-group"> 248 <div class="cabinet__inputs-item form-group">
249 <label class="form-group__label">Электронная почта *</label> 249 <label class="form-group__label">Электронная почта *</label>
250 <div class="form-group__item"> 250 <div class="form-group__item">
251 <input type="email" name="email" id="email" value="{{ $Worker[0]->email }}" class="input" placeholder="info@rekamore.su" required> 251 <input type="email" name="email" id="email" value="{{ $Worker[0]->email }}" class="input" placeholder="info@rekamore.su" required>
252 </div> 252 </div>
253 </div> 253 </div>
254 <div class="cabinet__inputs-item form-group"> 254 <div class="cabinet__inputs-item form-group">
255 <label class="form-group__label">Статус</label> 255 <label class="form-group__label">Статус</label>
256 <div class="form-group__item"> 256 <div class="form-group__item">
257 <div class="select"> 257 <div class="select">
258 <select class="js-select2" name="status_work" id="status_work"> 258 <select class="js-select2" name="status_work" id="status_work">
259 <option value="1" @if ($Worker[0]->status_work == 1) selected @endif>Не указано</option> 259 <option value="1" @if ($Worker[0]->status_work == 1) selected @endif>Не указано</option>
260 <option value="2" @if ($Worker[0]->status_work == 2) selected @endif>Не ищу работу</option> 260 <option value="2" @if ($Worker[0]->status_work == 2) selected @endif>Не ищу работу</option>
261 <option value="0" @if ($Worker[0]->status_work == 0) selected @endif>Ищу работу</option> 261 <option value="0" @if ($Worker[0]->status_work == 0) selected @endif>Ищу работу</option>
262 </select> 262 </select>
263 </div> 263 </div>
264 </div> 264 </div>
265 </div> 265 </div>
266 <!--<div class="cabinet__inputs-item form-group"> 266 <!--<div class="cabinet__inputs-item form-group">
267 <label class="form-group__label">Статус *</label> 267 <label class="form-group__label">Статус *</label>
268 <div class="form-group__item"> 268 <div class="form-group__item">
269 <input type="text" class="input" required> 269 <input type="text" class="input" required>
270 </div> 270 </div>
271 </div>--> 271 </div>-->
272 @if (isset($Worker[0]->users)) 272 @if (isset($Worker[0]->users))
273 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 273 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
274 <label class="form-group__label">Фамилия *</label> 274 <label class="form-group__label">Фамилия *</label>
275 <div class="form-group__item"> 275 <div class="form-group__item">
276 <input type="text" name="surname" id="surmane" class="input" value="{{ $Worker[0]->users->surname }}" placeholder="Филиппов" required> 276 <input type="text" name="surname" id="surmane" class="input" value="{{ $Worker[0]->users->surname }}" placeholder="Филиппов" required>
277 </div> 277 </div>
278 </div> 278 </div>
279 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 279 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
280 <label class="form-group__label">Имя *</label> 280 <label class="form-group__label">Имя *</label>
281 <div class="form-group__item"> 281 <div class="form-group__item">
282 <input type="text" name="name_man" id="name_man" class="input" value="{{ $Worker[0]->users->name_man }}" placeholder="Егор" required> 282 <input type="text" name="name_man" id="name_man" class="input" value="{{ $Worker[0]->users->name_man }}" placeholder="Егор" required>
283 </div> 283 </div>
284 </div> 284 </div>
285 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 285 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
286 <label class="form-group__label">Отчество *</label> 286 <label class="form-group__label">Отчество *</label>
287 <div class="form-group__item"> 287 <div class="form-group__item">
288 <input type="text" class="input" name="surname2" id="surmane2" value="{{ $Worker[0]->users->surname2 }}" placeholder="Алексеевич"> 288 <input type="text" class="input" name="surname2" id="surmane2" value="{{ $Worker[0]->users->surname2 }}" placeholder="Алексеевич">
289 </div> 289 </div>
290 </div> 290 </div>
291 @endif 291 @endif
292 </div> 292 </div>
293 </div> 293 </div>
294 <div class="cabinet__body-item"> 294 <div class="cabinet__body-item">
295 <h3 class="cabinet__subtitle">Основная информация</h3> 295 <h3 class="cabinet__subtitle">Основная информация</h3>
296 <div class="cabinet__inputs"> 296 <div class="cabinet__inputs">
297 <div class="cabinet__inputs-item cabinet__inputs-item_min form-group"> 297 <div class="cabinet__inputs-item cabinet__inputs-item_min form-group">
298 <label class="form-group__label">Возраст</label> 298 <label class="form-group__label">Возраст</label>
299 <div class="form-group__item"> 299 <div class="form-group__item">
300 <input type="number" name="old_year" id="old_year" value="{{ $Worker[0]->old_year }}" class="input" placeholder="0" required> 300 <input type="number" name="old_year" id="old_year" value="{{ $Worker[0]->old_year }}" class="input" placeholder="0" required>
301 </div> 301 </div>
302 </div> 302 </div>
303 <div class="cabinet__inputs-item cabinet__inputs-item_max form-group"> 303 <div class="cabinet__inputs-item cabinet__inputs-item_max form-group">
304 <label class="form-group__label">Желаемые вакансии</label> 304 <label class="form-group__label">Желаемые вакансии</label>
305 <div class="form-group__item"> 305 <div class="form-group__item">
306 <div class="select"> 306 <div class="select">
307 <select class="js-select2" name="job_title_id[]" id="job_title_id[]" multiple="multiple"> 307 <select class="js-select2" name="job_title_id[]" id="job_title_id[]" multiple="multiple">
308 @if ($Job_titles->count()) 308 @if ($Job_titles->count())
309 @foreach($Job_titles as $it) 309 @foreach($Job_titles as $it)
310 @if (isset($Worker[0]->job_titles)) 310 @if (isset($Worker[0]->job_titles))
311 @if ($Worker[0]->job_titles->count()) 311 @if ($Worker[0]->job_titles->count())
312 @foreach($Worker[0]->job_titles as $select) 312 @foreach($Worker[0]->job_titles as $select)
313 <option value="{{ $it->id }}" @if ($it->id == $select->id) selected @endif>{{ $it->name }}</option> 313 <option value="{{ $it->id }}" @if ($it->id == $select->id) selected @endif>{{ $it->name }}</option>
314 @endforeach 314 @endforeach
315 @else 315 @else
316 <option value="{{ $it->id }}">{{ $it->name }} ({{ $it->id }})</option> 316 <option value="{{ $it->id }}">{{ $it->name }} ({{ $it->id }})</option>
317 @endif 317 @endif
318 @else 318 @else
319 <option value="{{ $it->id }}">{{ $it->name }} ({{ $it->id }})</option> 319 <option value="{{ $it->id }}">{{ $it->name }} ({{ $it->id }})</option>
320 @endif 320 @endif
321 @endforeach 321 @endforeach
322 @endif 322 @endif
323 </select> 323 </select>
324 </div> 324 </div>
325 </div> 325 </div>
326 </div> 326 </div>
327 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 327 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
328 <label class="form-group__label">Город</label> 328 <label class="form-group__label">Город</label>
329 <div class="form-group__item"> 329 <div class="form-group__item">
330 <input type="text" name="city" id="city" value="{{ $Worker[0]->city }}" class="input" placeholder="Челябинск" required> 330 <input type="text" name="city" id="city" value="{{ $Worker[0]->city }}" class="input" placeholder="Челябинск" required>
331 </div> 331 </div>
332 </div> 332 </div>
333 <div class="cabinet__inputs-item form-group"> 333 <div class="cabinet__inputs-item form-group">
334 <label class="form-group__label">Опыт работы</label> 334 <label class="form-group__label">Опыт работы</label>
335 <div class="form-group__item"> 335 <div class="form-group__item">
336 <div class="select"> 336 <div class="select">
337 <select class="js-select2" id="experience" name="experience"> 337 <select class="js-select2" id="experience" name="experience">
338 <option value="Не указано" @if (empty($Worker[0]->experience)) selected @endif>Не указано</option> 338 <option value="Не указано" @if (empty($Worker[0]->experience)) selected @endif>Не указано</option>
339 <option value="меньше 1 года" @if ($Worker[0]->experience == 'меньше 1 года') selected @endif>меньше 1 года</option> 339 <option value="меньше 1 года" @if ($Worker[0]->experience == 'меньше 1 года') selected @endif>меньше 1 года</option>
340 <option value="от 1 года до 3 лет" @if ($Worker[0]->experience == 'от 1 года до 3 лет') selected @endif>от 1 года до 3 лет</option> 340 <option value="от 1 года до 3 лет" @if ($Worker[0]->experience == 'от 1 года до 3 лет') selected @endif>от 1 года до 3 лет</option>
341 <option value="от 3 до 5 лет" @if ($Worker[0]->experience == 'от 3 до 5 лет') selected @endif>от 3 до 5 лет</option> 341 <option value="от 3 до 5 лет" @if ($Worker[0]->experience == 'от 3 до 5 лет') selected @endif>от 3 до 5 лет</option>
342 <option value="от 5 до 10 лет" @if ($Worker[0]->experience == 'от 5 до 10 лет') selected @endif>от 5 до 10 лет</option> 342 <option value="от 5 до 10 лет" @if ($Worker[0]->experience == 'от 5 до 10 лет') selected @endif>от 5 до 10 лет</option>
343 <option value="Больше 10 лет" @if ($Worker[0]->experience == 'Больше 10 лет') selected @endif>Больше 10 лет</option> 343 <option value="Больше 10 лет" @if ($Worker[0]->experience == 'Больше 10 лет') selected @endif>Больше 10 лет</option>
344 </select> 344 </select>
345 </div> 345 </div>
346 </div> 346 </div>
347 </div> 347 </div>
348 348
349 <div class="cabinet__inputs-item form-group"> 349 <div class="cabinet__inputs-item form-group">
350 <label class="form-group__label">Номер телефона 1</label> 350 <label class="form-group__label">Номер телефона 1</label>
351 <div class="form-group__item"> 351 <div class="form-group__item">
352 <input type="tel" name="telephone" id="telephone" value="{{ old('telephone') ?? $Worker[0]->telephone ?? '' }}" class="input" placeholder="+7 (___) ___-__-__" required> 352 <input type="tel" name="telephone" id="telephone" value="{{ old('telephone') ?? $Worker[0]->telephone ?? '' }}" class="input" placeholder="+7 (___) ___-__-__" required>
353 </div> 353 </div>
354 </div> 354 </div>
355 <div class="cabinet__inputs-item form-group"> 355 <div class="cabinet__inputs-item form-group">
356 <label class="form-group__label">Номер телефона 2</label> 356 <label class="form-group__label">Номер телефона 2</label>
357 <div class="form-group__item"> 357 <div class="form-group__item">
358 <input type="tel" name="telephone2" id="telephon2" value="{{ old('telephone2') ?? $Worker[0]->telephone2 ?? '' }}" class="input" placeholder="+7 (___) ___-__-__"> 358 <input type="tel" name="telephone2" id="telephon2" value="{{ old('telephone2') ?? $Worker[0]->telephone2 ?? '' }}" class="input" placeholder="+7 (___) ___-__-__">
359 </div> 359 </div>
360 </div> 360 </div>
361 </div> 361 </div>
362 </div> 362 </div>
363 363
364 <div class="cabinet__body-item"> 364 <div class="cabinet__body-item">
365 <h4 class="cabinet__h4">О себе</h4> 365 <h4 class="cabinet__h4">О себе</h4>
366 <textarea class="textarea" name="text" id="text" placeholder="Не указано">{{ $Worker[0]->text }}</textarea> 366 <textarea class="textarea" name="text" id="text" placeholder="Не указано">{{ $Worker[0]->text }}</textarea>
367 <div class="cabinet__buttons"> 367 <div class="cabinet__buttons">
368 <button type="submit" class="button">Сохранить</button> 368 <button type="submit" class="button">Сохранить</button>
369 <label class="file"> 369 <label class="file">
370 <span class="file__input"> 370 <span class="file__input">
371 <input type="file" name="file" id="file"> 371 <input type="file" name="file" id="file">
372 <span class="button button_light">@if (empty($Worker[0]->file)) Прикрепить резюме @else Обновить резюме @endif</span> 372 <span class="button button_light">@if (empty($Worker[0]->file)) Прикрепить резюме @else Обновить резюме @endif</span>
373 </span> 373 </span>
374 </label> 374 </label>
375 </div> 375 </div>
376 </div> 376 </div>
377 377
378 378
379 <div id="sertificate" name="sertificate"> 379 <div id="sertificate" name="sertificate">
380 @if ((isset($Worker[0]->sertificate)) && ($Worker[0]->sertificate->count() > 0)) 380 @if ((isset($Worker[0]->sertificate)) && ($Worker[0]->sertificate->count() > 0))
381 @php $i = 0; @endphp 381 @php $i = 0; @endphp
382 @foreach($Worker[0]->sertificate as $it) 382 @foreach($Worker[0]->sertificate as $it)
383 <div style="margin-bottom: 20px" class="cabinet__body-item"> 383 <div style="margin-bottom: 20px" class="cabinet__body-item">
384 @if ($i == 0) 384 @if ($i == 0)
385 <h3 class="cabinet__subtitle">Сертификаты / документы</h3> 385 <h3 class="cabinet__subtitle">Сертификаты / документы</h3>
386 @endif 386 @endif
387 <h4 class="cabinet__h4">Сертификат {{ $i+1 }}</h4> 387 <h4 class="cabinet__h4">Сертификат {{ $i+1 }}</h4>
388 <div class="cabinet__inputs"> 388 <div class="cabinet__inputs">
389 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 389 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
390 <label class="form-group__label">Название сертификата:</label> 390 <label class="form-group__label">Название сертификата:</label>
391 <div class="form-group__item"> 391 <div class="form-group__item">
392 <input type="text" class="input" value="{{ $it->name }}" disabled> 392 <input type="text" class="input" value="{{ $it->name }}" disabled>
393 </div> 393 </div>
394 </div> 394 </div>
395 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 395 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
396 <label class="form-group__label">Учебное заведение</label> 396 <label class="form-group__label">Учебное заведение</label>
397 <div class="form-group__item"> 397 <div class="form-group__item">
398 <input type="text" class="input" value=" $it->education }}" disabled> 398 <input type="text" class="input" value=" $it->education }}" disabled>
399 </div> 399 </div>
400 </div>--> 400 </div>-->
401 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 401 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
402 <label class="form-group__label">Действителен до:</label> 402 <label class="form-group__label">Действителен до:</label>
403 <div class="form-group__item"> 403 <div class="form-group__item">
404 <input type="text" class="input" value="{{ $it->end_begin }}" disabled> 404 <input type="text" class="input" value="{{ $it->end_begin }}" disabled>
405 </div> 405 </div>
406 </div> 406 </div>
407 <a href="{{ route('worker.delete_sertificate', ['doc' => $it->id]) }}" class="button button_light"> 407 <a href="{{ route('worker.delete_sertificate', ['doc' => $it->id]) }}" class="button button_light">
408 <svg> 408 <svg>
409 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> 409 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use>
410 </svg> 410 </svg>
411 Удалить 411 Удалить
412 </a> 412 </a>
413 <a href="{{ route('worker.edit_sertificate', ['worker' => $Worker[0]->id, 'doc' => $it->id ]) }}" class="button">Редактирование</a> 413 <a href="{{ route('worker.edit_sertificate', ['worker' => $Worker[0]->id, 'doc' => $it->id ]) }}" class="button">Редактирование</a>
414 </div> 414 </div>
415 </div> 415 </div>
416 @php $i++ @endphp 416 @php $i++ @endphp
417 @endforeach 417 @endforeach
418 @else 418 @else
419 <div style="margin-bottom: 20px" class="cabinet__body-item"> 419 <div style="margin-bottom: 20px" class="cabinet__body-item">
420 <h3 class="cabinet__subtitle">Сертификаты / документы</h3> 420 <h3 class="cabinet__subtitle">Сертификаты / документы</h3>
421 Нет сертификатов 421 Нет сертификатов
422 </div> 422 </div>
423 @endif 423 @endif
424 </div> 424 </div>
425 425
426 <div class="cabinet__body-item"> 426 <div class="cabinet__body-item">
427 <a class="button button_light" href="{{ route('worker.new_sertificate',['worker' => $Worker[0]->id]) }}" id="button_new_doc" name="button_new_doc"> 427 <a class="button button_light" href="{{ route('worker.new_sertificate',['worker' => $Worker[0]->id]) }}" id="button_new_doc" name="button_new_doc">
428 Добавить сертификат 428 Добавить сертификат
429 </a> 429 </a>
430 </div> 430 </div>
431 431
432 <div class="cabinet__body-item" name="ajax_dop_diplomi" id="ajax_dop_diplomi"> 432 <div class="cabinet__body-item" name="ajax_dop_diplomi" id="ajax_dop_diplomi">
433 <h4 class="cabinet__h4">Дополнительная информация</h4> 433 <h4 class="cabinet__h4">Дополнительная информация</h4>
434 <div class="cabinet__inputs" id="block_sertificate"> 434 <div class="cabinet__inputs" id="block_sertificate">
435 @if ($Infobloks->count()) 435 @if ($Infobloks->count())
436 @foreach ($Infobloks as $doc) 436 @foreach ($Infobloks as $doc)
437 <div class="cabinet__inputs-item form-group"> 437 <div class="cabinet__inputs-item form-group">
438 <label class="form-group__label">{{ $doc->name }}</label> 438 <label class="form-group__label">{{ $doc->name }}</label>
439 <div class="form-group__item"> 439 <div class="form-group__item">
440 <div class="select"> 440 <div class="select">
441 @php $Selected = false; @endphp 441 @php $Selected = 0; @endphp
442 @if ($Worker[0]->infobloks->count()) 442 @if ($Worker[0]->infobloks->count())
443 @foreach ($Worker[0]->infobloks as $info) 443 @foreach ($Worker[0]->dop_info as $info)
444 @if ($info->id == $doc->id) 444 @if ($info->infoblok_id == $doc->id)
445 @php $Selected = true; @endphp 445 @php $Selected = $info->status; @endphp
446 @endif 446 @endif
447 @endforeach 447 @endforeach
448 @endif 448 @endif
449 <select data-info="{{ $doc->id }}" class="js-select2 sertificates_js"> 449 <select data-info="{{ $doc->id }}" class="js-select2 sertificates_js">
450 <option value="0">Нет</option> 450 <option value="0" @if ($Selected == 0) selected @endif>Не указано</option>
451 <option value="1" @if ($Selected) selected @endif>Да</option> 451 <option value="1" @if ($Selected == 1) selected @endif>В наличии</option>
452 <option value="2" @if ($Selected == 2) selected @endif>Отсутствует</option>
452 </select> 453 </select>
453 </div> 454 </div>
454 </div> 455 </div>
455 </div> 456 </div>
456 @endforeach 457 @endforeach
457 @endif 458 @endif
458
459 <!--_if (isset($Worker[0]->infobloks)) 459 <!--_if (isset($Worker[0]->infobloks))
460 _php dd($Worker[0]->infobloks) _endphp 460 _php dd($Worker[0]->infobloks) _endphp
461 _if ($Worker[0]->infobloks->count()) 461 _if ($Worker[0]->infobloks->count())
462 _php $i = 1; _endphp 462 _php $i = 1; _endphp
463 _foreach ($Worker[0]->infobloks as $info) 463 _foreach ($Worker[0]->infobloks as $info)
464 <div class="cabinet__inputs-item form-group"> 464 <div class="cabinet__inputs-item form-group">
465 <label class="form-group__label"> $info->name }}</label> 465 <label class="form-group__label"> $info->name }}</label>
466 <div class="form-group__item"> 466 <div class="form-group__item">
467 <div class="select"> 467 <div class="select">
468 <select data-info=" $info->id }}" class="js-select2 sertificates_js"> 468 <select data-info=" $info->id }}" class="js-select2 sertificates_js">
469 <option value="0">Нет</option> 469 <option value="0">Нет</option>
470 <option value="1" selected>Да</option> 470 <option value="1" selected>Да</option>
471 </select> 471 </select>
472 </div> 472 </div>
473 </div> 473 </div>
474 </div> 474 </div>
475 _php $i++; _endphp 475 _php $i++; _endphp
476 _endforeach 476 _endforeach
477 _endif 477 _endif
478 _endif 478 _endif
479 --> 479 -->
480 480
481 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 481 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
482 <label class="form-group__label">Образцы дипломов и документов</label> 482 <label class="form-group__label">Образцы дипломов и документов</label>
483 <div class="form-group__item"> 483 <div class="form-group__item">
484 <div class="select"> 484 <div class="select">
485 <select class="js-select2" id="documents" name="documents"> 485 <select class="js-select2" id="documents" name="documents">
486 _if ($Infoblocks->count()) 486 _if ($Infoblocks->count())
487 _foreach ($Infoblocks as $it) 487 _foreach ($Infoblocks as $it)
488 <option value="_$it->id }}">_$it->name }}</option> 488 <option value="_$it->id }}">_$it->name }}</option>
489 _endforeach 489 _endforeach
490 _endif 490 _endif
491 </select> 491 </select>
492 </div> 492 </div>
493 </div> 493 </div>
494 </div>--> 494 </div>-->
495 </div> 495 </div>
496 <!--<a href=" route('worker.add_diplom', ['worker' => $Worker[0]->id]) }}" name="btn_new_diplom" data-val="{{ $Worker[0]->id }}" id="btn_new_diplom" class="button button_light"> 496 <!--<a href=" route('worker.add_diplom', ['worker' => $Worker[0]->id]) }}" name="btn_new_diplom" data-val="{{ $Worker[0]->id }}" id="btn_new_diplom" class="button button_light">
497 Добавить документ 497 Добавить документ
498 </a>--> 498 </a>-->
499 </div> 499 </div>
500 <div class="cabinet__body-item"> 500 <div class="cabinet__body-item">
501 <div class="cabinet__works"> 501 <div class="cabinet__works">
502 @if (isset($Worker[0]->place_worker)) 502 @if (isset($Worker[0]->place_worker))
503 @php $i = 1; @endphp 503 @php $i = 1; @endphp
504 @foreach($Worker[0]->place_worker as $company) 504 @foreach($Worker[0]->place_worker as $company)
505 <div class="cabinet__works-item"> 505 <div class="cabinet__works-item">
506 <div class="cabinet__works-spoiler active"> 506 <div class="cabinet__works-spoiler active">
507 <div class="cabinet__works-spoiler-left"> 507 <div class="cabinet__works-spoiler-left">
508 <div class="cabinet__works-spoiler-buttons"> 508 <div class="cabinet__works-spoiler-buttons">
509 <a href="{{ route('worker.delete_document', ['doc' => $company->id]) }}" class="button button_light js-works-remove"> 509 <a href="{{ route('worker.delete_document', ['doc' => $company->id]) }}" class="button button_light js-works-remove">
510 <svg> 510 <svg>
511 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> 511 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use>
512 </svg> 512 </svg>
513 </a> 513 </a>
514 <a href="{{ route('worker.edit_document', ['doc' => $company->id, 'worker' => $Worker[0]->id]) }}" type="button" class="button button_light js-works-edit"> 514 <a href="{{ route('worker.edit_document', ['doc' => $company->id, 'worker' => $Worker[0]->id]) }}" type="button" class="button button_light js-works-edit">
515 <svg> 515 <svg>
516 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> 516 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use>
517 </svg> 517 </svg>
518 </a> 518 </a>
519 </div> 519 </div>
520 <div class="cabinet__works-spoiler-text">Место работы {{ $i }}</div> 520 <div class="cabinet__works-spoiler-text">Место работы {{ $i }}</div>
521 </div> 521 </div>
522 <button type="button" class="cabinet__works-spoiler-right js-parent-toggle"> 522 <button type="button" class="cabinet__works-spoiler-right js-parent-toggle">
523 <svg> 523 <svg>
524 <use xlink:href="{{ asset('images/sprite.svg#arrow-bold') }}"></use> 524 <use xlink:href="{{ asset('images/sprite.svg#arrow-bold') }}"></use>
525 </svg> 525 </svg>
526 </button> 526 </button>
527 </div> 527 </div>
528 <div class="cabinet__works-body"> 528 <div class="cabinet__works-body">
529 <div class="cabinet__inputs"> 529 <div class="cabinet__inputs">
530 <div class="cabinet__inputs-item form-group"> 530 <div class="cabinet__inputs-item form-group">
531 <label class="form-group__label">Должность</label> 531 <label class="form-group__label">Должность</label>
532 <div class="form-group__item"> 532 <div class="form-group__item">
533 <input type="text" class="input" value="{{ $company->job_title }}"> 533 <input type="text" class="input" value="{{ $company->job_title }}">
534 </div> 534 </div>
535 </div> 535 </div>
536 <!--<div class="cabinet__inputs-item form-group"> 536 <!--<div class="cabinet__inputs-item form-group">
537 <label class="form-group__label">Опыт работы в танкерном флоте</label> 537 <label class="form-group__label">Опыт работы в танкерном флоте</label>
538 <div class="form-group__item"> 538 <div class="form-group__item">
539 <input type="text" class="input" value="@if ($company->tanker) Есть @else Нет @endif"> 539 <input type="text" class="input" value="@if ($company->tanker) Есть @else Нет @endif">
540 </div> 540 </div>
541 </div>--> 541 </div>-->
542 <div class="cabinet__inputs-item form-group"> 542 <div class="cabinet__inputs-item form-group">
543 <label class="form-group__label">Название т/х</label> 543 <label class="form-group__label">Название т/х</label>
544 <div class="form-group__item"> 544 <div class="form-group__item">
545 <input type="text" class="input" value="{{ $company->teplohod }}"> 545 <input type="text" class="input" value="{{ $company->teplohod }}">
546 </div> 546 </div>
547 </div> 547 </div>
548 <div class="cabinet__inputs-item form-group"> 548 <div class="cabinet__inputs-item form-group">
549 <label class="form-group__label">Тип суда (GWT)</label> 549 <label class="form-group__label">Тип суда (GWT)</label>
550 <div class="form-group__item"> 550 <div class="form-group__item">
551 <input type="text" class="input" value="{{ $company->GWT }}"> 551 <input type="text" class="input" value="{{ $company->GWT }}">
552 </div> 552 </div>
553 </div> 553 </div>
554 <div class="cabinet__inputs-item form-group"> 554 <div class="cabinet__inputs-item form-group">
555 <label class="form-group__label">Марка ГД</label> 555 <label class="form-group__label">Марка ГД</label>
556 <div class="form-group__item"> 556 <div class="form-group__item">
557 <input type="text" class="input" value="{{ $company->Marka_GD }}"> 557 <input type="text" class="input" value="{{ $company->Marka_GD }}">
558 </div> 558 </div>
559 </div> 559 </div>
560 <div class="cabinet__inputs-item form-group"> 560 <div class="cabinet__inputs-item form-group">
561 <label class="form-group__label">Мощность ГД (кВТ)</label> 561 <label class="form-group__label">Мощность ГД (кВТ)</label>
562 <div class="form-group__item"> 562 <div class="form-group__item">
563 <input type="text" class="input" value="{{ $company->KBT }}"> 563 <input type="text" class="input" value="{{ $company->KBT }}">
564 </div> 564 </div>
565 </div> 565 </div>
566 <div class="cabinet__inputs-item form-group"> 566 <div class="cabinet__inputs-item form-group">
567 <label class="form-group__label">Водоизмещение (GRT)</label> 567 <label class="form-group__label">Водоизмещение (GRT)</label>
568 <div class="form-group__item"> 568 <div class="form-group__item">
569 <input type="text" class="input" value="{{ $company->GRT }}"> 569 <input type="text" class="input" value="{{ $company->GRT }}">
570 </div> 570 </div>
571 </div> 571 </div>
572 <div class="cabinet__inputs-item form-group"> 572 <div class="cabinet__inputs-item form-group">
573 <label class="form-group__label">Название компании</label> 573 <label class="form-group__label">Название компании</label>
574 <div class="form-group__item"> 574 <div class="form-group__item">
575 <input type="text" class="input" value="{{ $company->name_company }}"> 575 <input type="text" class="input" value="{{ $company->name_company }}">
576 </div> 576 </div>
577 </div> 577 </div>
578 <div class="cabinet__inputs-item form-group"> 578 <div class="cabinet__inputs-item form-group">
579 <label class="form-group__label">Начало контракта</label> 579 <label class="form-group__label">Начало контракта</label>
580 <div class="form-group__item"> 580 <div class="form-group__item">
581 <input type="text" class="input" value="{{ $company->begin_work }}"> 581 <input type="text" class="input" value="{{ $company->begin_work }}">
582 </div> 582 </div>
583 </div> 583 </div>
584 <div class="cabinet__inputs-item form-group"> 584 <div class="cabinet__inputs-item form-group">
585 <label class="form-group__label">Окончание контракта</label> 585 <label class="form-group__label">Окончание контракта</label>
586 <div class="form-group__item"> 586 <div class="form-group__item">
587 <input type="text" class="input" value="{{ $company->end_work }}"> 587 <input type="text" class="input" value="{{ $company->end_work }}">
588 </div> 588 </div>
589 </div> 589 </div>
590 590
591 </div> 591 </div>
592 </div> 592 </div>
593 </div> 593 </div>
594 @php $i++ @endphp 594 @php $i++ @endphp
595 @endforeach 595 @endforeach
596 @endif 596 @endif
597 </div> 597 </div>
598 598
599 </div> 599 </div>
600 600
601 <a href="{{ route('worker.add_document', ['worker' => $Worker[0]->id]) }}" id="new_work" name="new_work" class="button button_light cabinet__works-add" style="width:100%; max-width:none;">Новое место работы</a> 601 <a href="{{ route('worker.add_document', ['worker' => $Worker[0]->id]) }}" id="new_work" name="new_work" class="button button_light cabinet__works-add" style="width:100%; max-width:none;">Новое место работы</a>
602 602
603 <div id="prev_worker" name="prev_worker"> 603 <div id="prev_worker" name="prev_worker">
604 @if ((isset($Worker[0]->prev_company)) && ($Worker[0]->prev_company->count() > 0)) 604 @if ((isset($Worker[0]->prev_company)) && ($Worker[0]->prev_company->count() > 0))
605 @php $i = 0; @endphp 605 @php $i = 0; @endphp
606 @foreach($Worker[0]->prev_company as $it) 606 @foreach($Worker[0]->prev_company as $it)
607 <div style="margin-bottom: 20px" class="cabinet__body-item"> 607 <div style="margin-bottom: 20px" class="cabinet__body-item">
608 @if ($i == 0) 608 @if ($i == 0)
609 <h3 class="cabinet__subtitle">Контакты предыдущих компаний</h3> 609 <h3 class="cabinet__subtitle">Контакты предыдущих компаний</h3>
610 @endif 610 @endif
611 <h4 class="cabinet__h4">Компания {{ $i+1 }}</h4> 611 <h4 class="cabinet__h4">Компания {{ $i+1 }}</h4>
612 <div class="cabinet__inputs"> 612 <div class="cabinet__inputs">
613 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 613 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
614 <label class="form-group__label">Название компании</label> 614 <label class="form-group__label">Название компании</label>
615 <div class="form-group__item"> 615 <div class="form-group__item">
616 <input type="text" class="input" value="{{ $it->name_company }}" disabled> 616 <input type="text" class="input" value="{{ $it->name_company }}" disabled>
617 </div> 617 </div>
618 </div> 618 </div>
619 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 619 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
620 <label class="form-group__label">Директор</label> 620 <label class="form-group__label">Директор</label>
621 <div class="form-group__item"> 621 <div class="form-group__item">
622 <input type="text" class="input" value="{{ $it->direct }}" disabled> 622 <input type="text" class="input" value="{{ $it->direct }}" disabled>
623 </div> 623 </div>
624 </div> 624 </div>
625 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 625 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
626 <label class="form-group__label">Телефон</label> 626 <label class="form-group__label">Телефон</label>
627 <div class="form-group__item"> 627 <div class="form-group__item">
628 <input type="text" class="input" value="{{ $it->telephone }}" disabled> 628 <input type="text" class="input" value="{{ $it->telephone }}" disabled>
629 </div> 629 </div>
630 </div> 630 </div>
631 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 631 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
632 <label class="form-group__label">Телефон2</label> 632 <label class="form-group__label">Телефон2</label>
633 <div class="form-group__item"> 633 <div class="form-group__item">
634 <input type="text" class="input" value="{{ $it->telephone2 }}" disabled> 634 <input type="text" class="input" value="{{ $it->telephone2 }}" disabled>
635 </div> 635 </div>
636 </div> 636 </div>
637 <a href="{{ route('worker.delete_prev_company', ['doc' => $it->id]) }}" class="button button_light"> 637 <a href="{{ route('worker.delete_prev_company', ['doc' => $it->id]) }}" class="button button_light">
638 <svg> 638 <svg>
639 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> 639 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use>
640 </svg> 640 </svg>
641 Удалить 641 Удалить
642 </a> 642 </a>
643 <a href="{{ route('worker.edit_prev_company', ['worker' => $Worker[0]->id, 'doc' => $it->id ]) }}" class="button">Редактирование</a>
643 </div> 644 </div>
644 </div> 645 </div>
645 @php $i++ @endphp 646 @php $i++ @endphp
646 @endforeach 647 @endforeach
647 @else 648 @else
648 <div style="margin-bottom: 20px" class="cabinet__body-item"> 649 <div style="margin-bottom: 20px" class="cabinet__body-item">
649 <h3 class="cabinet__subtitle">Предыдущие компании</h3> 650 <h3 class="cabinet__subtitle">Предыдущие компании</h3>
650 Нет предыдущих компаний 651 Нет предыдущих компаний
651 </div> 652 </div>
652 @endif 653 @endif
653 </div> 654 </div>
654 655
655 <div class="cabinet__body-item"> 656 <div class="cabinet__body-item">
656 <a class="button button_light" href="{{ route('worker.new_prev_company',['worker' => $Worker[0]->id]) }}" id="button_new_doc" name="button_new_doc"> 657 <a class="button button_light" href="{{ route('worker.new_prev_company',['worker' => $Worker[0]->id]) }}" id="button_new_doc" name="button_new_doc">
657 Добавить официльную контактную информацию 658 Добавить официльную контактную информацию
658 </a> 659 </a>
659 </div> 660 </div>
660 661
661 </form> 662 </form>
662 </div> 663 </div>
663 </div> 664 </div>
664 </section> 665 </section>
665 </div> 666 </div>
666 <div> 667 <div>
667 @endsection 668 @endsection
resources/views/workers/prev_company_edit_form.blade.php
File was created 1 @extends('layout.frontend', ['title' => 'Редактирование контакта предыдущей компании - РекаМоре'])
2
3 @section('scripts')
4 <script>
5 console.log('Test system');
6 $(document).on('submit', '#submit_form', function() {
7 var this_ = $(this);
8 var new_diplom = $('#name');
9 var new_diplom_val = new_diplom.val();
10 var new_data_begin = $('#new_data_begin');
11 var new_data_begin_val = new_data_begin.val();
12 var new_data_end = $('#new_data_end');
13 var new_data_end_val = new_data_end.val();
14 var education = $('#education');
15 var education_val = education.val();
16 var worker_id = $('#new_id');
17 var worker_val = worker_id.val();
18
19 console.log('Валидация формы.');
20
21 if (new_diplom_val == '') {
22 new_diplom.addClass('err_red');
23 console.log('Border Up');
24 return false;
25 } else {
26 return true;
27 }
28 });
29 </script>
30 @endsection
31
32 @section('content')
33 <section class="cabinet">
34 <div class="container">
35 <ul class="breadcrumbs cabinet__breadcrumbs">
36 <li><a href="{{ route('index') }}">Главная</a></li>
37 <li><b>Личный кабинет</b></li>
38 </ul>
39 <div class="cabinet__wrapper">
40 <div class="cabinet__side">
41 <div class="cabinet__side-toper">
42 @include('workers.emblema')
43 </div>
44 @include('workers.menu', ['item' => 1])
45 </div>
46
47 <div class="cabinet__body">
48 <div class="cabinet__body-item">
49 <h4 class="cabinet__h4">Добавление контакта предыдущей компании</h4>
50 <form id="submit_form" name="submit_form" action="{{ route('worker.update_prev_company', ['doc' => $doc]) }}" class="cabinet__inputs" method="POST">
51 @csrf
52 <input type="hidden" name="worker_id" id="worker_id" class="input" value="{{ $worker->id }}">
53 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
54 <label class="form-group__label">Название компании</label>
55 <div class="form-group__item">
56 <input type="text" name="name_company" id="name_company" class="input" value="{{ old('name_company') ?? $doc->name_company ?? '' }}">
57 </div>
58 </div>
59 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
60 <label class="form-group__label">ФИО директора</label>
61 <div class="form-group__item">
62 <input type="text" name="direct" id="direct" class="input" value="{{ old('direct') ?? $doc->direct ?? '' }}">
63 </div>
64 </div>
65 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
66 <label class="form-group__label">Телефон</label>
67 <div class="form-group__item">
68 <input type="text" name="telephone" id="telephone" class="input" value="{{ old('telephone') ?? $doc->telephone ?? '' }}">
69 </div>
70 </div>
71 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
72 <label class="form-group__label">Телефон 2</label>
73 <div class="form-group__item">
74 <input type="text" name="telephone2" id="telephone2" class="input" value="{{ old('telephone2') ?? $doc->telephone2 ?? '' }}">
75 </div>
76 </div>
77 <button type="submit" class="button">Сохранить</button>
78 <a href="{{ route('worker.cabinet') }}" class="button">Назад</a>
79 </form>
80 </div>
81 </div>
82 </div>
83 </div>
84 </section>
85
86 @endsection
87
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 447
448 Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume'); 448 Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume');
449 449
450 //Анкета соискателя 450 //Анкета соискателя
451 Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile'); 451 Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile');
452 452
453 //Скачать резюме 453 //Скачать резюме
454 Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download'); 454 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'); 455 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'); 456 Route::get('resume-download', [WorkerController::class, 'resume_download_all'])->name('resume_download_all');
457 457
458 458
459 //Вход в кабинет 459 //Вход в кабинет
460 Route::get('login', [MainController::class, 'input_login'])->name('login'); 460 Route::get('login', [MainController::class, 'input_login'])->name('login');
461 461
462 // Выход из кабинета 462 // Выход из кабинета
463 Route::get('logout', [EmployerController::class, 'logout'])->name('logout'); 463 Route::get('logout', [EmployerController::class, 'logout'])->name('logout');
464 464
465 Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker'); 465 Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker');
466 Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer'); 466 Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer');
467 467
468 //восстановление пароля 468 //восстановление пароля
469 Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password'); 469 Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password');
470 // Звезда сообщения 470 // Звезда сообщения
471 Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer'); 471 Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer');
472 472
473 // Борьба 473 // Борьба
474 Route::get('clear_cookie', function() { 474 Route::get('clear_cookie', function() {
475 \App\Classes\Cookies_vacancy::clear_vacancy(); 475 \App\Classes\Cookies_vacancy::clear_vacancy();
476 return redirect()->route('index'); 476 return redirect()->route('index');
477 })->name('clear_cookie'); 477 })->name('clear_cookie');
478 478
479 Route::get('cookies', function() { 479 Route::get('cookies', function() {
480 return view('cookies'); 480 return view('cookies');
481 })->name('cookies'); 481 })->name('cookies');
482 482
483 // Личный кабинет работник 483 // Личный кабинет работник
484 Route::group([ 484 Route::group([
485 'as' => 'worker.', // имя маршрута, например auth.index 485 'as' => 'worker.', // имя маршрута, например auth.index
486 'prefix' => 'worker', // префикс маршрута, например auth/index 486 'prefix' => 'worker', // префикс маршрута, например auth/index
487 'middleware' => ['auth'], ['is_worker'], 487 'middleware' => ['auth'], ['is_worker'],
488 ], function() { 488 ], function() {
489 // 1 страница - Моя анкета 489 // 1 страница - Моя анкета
490 Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); 490 Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet');
491 Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); 491 Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save');
492 492
493 // 2 страница - Сообщения 493 // 2 страница - Сообщения
494 Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); 494 Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages');
495 Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog'); 495 Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog');
496 // 3 страница - Избранные вакансии 496 // 3 страница - Избранные вакансии
497 Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); 497 Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite');
498 // Продолжение борьбы против колорадов - избранные вакансии 498 // Продолжение борьбы против колорадов - избранные вакансии
499 Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); 499 Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado');
500 500
501 // 4 страница - Сменить пароль 501 // 4 страница - Сменить пароль
502 Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); 502 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'); 503 Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password');
504 504
505 // 5 страница - Удалить профиль 505 // 5 страница - Удалить профиль
506 Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); 506 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'); 507 Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result');
508 508
509 // Резюме -pdf 509 // Резюме -pdf
510 Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); 510 Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download');
511 511
512 // Поднятие анкеты 512 // Поднятие анкеты
513 Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); 513 Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up');
514 514
515 // Добавление сертификата 515 // Добавление сертификата
516 Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate'); 516 Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate');
517 Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); 517 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'); 518 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'); 519 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'); 520 Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate');
521 521
522 // Добавление предыдущих контактов компании 522 // Добавление предыдущих контактов компании
523 Route::get('кабинет/prev_company/{worker}', [WorkerController::class, 'new_prev_company'])->name('new_prev_company'); 523 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'); 524 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');
526 Route::post('кабинет/update_prev_company/{doc}', [WorkerController::class, 'update_prev_company'])->name('update_prev_company');
525 Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company'); 527 Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company');
526 528
527 // Добавление документа-диплома 529 // Добавление документа-диплома
528 Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); 530 Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom');
529 Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); 531 Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save');
530 Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom'); 532 Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom');
531 533
532 // Добавление стандартного диплома 534 // Добавление стандартного диплома
533 Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); 535 Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document');
534 Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); 536 Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save');
535 Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); 537 Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document');
536 Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); 538 Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save');
537 Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); 539 Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document');
538 540
539 // Отправка сообщения работодателю от соискателя 541 // Отправка сообщения работодателю от соискателя
540 Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message'); 542 Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message');
541 }); 543 });
542 544
543 // Личный кабинет работодателя 545 // Личный кабинет работодателя
544 Route::group([ 546 Route::group([
545 'as' => 'employer.', // имя маршрута, например auth.index 547 'as' => 'employer.', // имя маршрута, например auth.index
546 'prefix' => 'employer', // префикс маршрута, например auth/index 548 'prefix' => 'employer', // префикс маршрута, например auth/index
547 'middleware' => ['auth'], !['is_worker'], 549 'middleware' => ['auth'], !['is_worker'],
548 ], function() { 550 ], function() {
549 // 0 страница - Личные данные работодателя 551 // 0 страница - Личные данные работодателя
550 Route::get('cabinet/employer_info', [EmployerController::class, 'employer_info'])->name('employer_info'); 552 Route::get('cabinet/employer_info', [EmployerController::class, 'employer_info'])->name('employer_info');
551 Route::post('cabinet/employer_info/{user}', [EmployerController::class, 'employer_info_save'])->name('employer_info_save'); 553 Route::post('cabinet/employer_info/{user}', [EmployerController::class, 'employer_info_save'])->name('employer_info_save');
552 554
553 // 1 страница - Профиль 555 // 1 страница - Профиль
554 Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); 556 Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet');
555 Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); 557 Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save');
556 Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); 558 Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot');
557 Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); 559 Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot');
558 Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot'); 560 Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot');
559 561
560 // 2 страница - Добавление вакансий 562 // 2 страница - Добавление вакансий
561 Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); 563 Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie');
562 Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); 564 Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save');
563 565
564 Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); 566 Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people');
565 567
566 // 3 страница - Мои вакансии 568 // 3 страница - Мои вакансии
567 Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); 569 Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list');
568 Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); 570 Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit');
569 Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); 571 Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete');
570 Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); 572 Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up');
571 Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); 573 Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye');
572 Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); 574 Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit');
573 Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); 575 Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me');
574 576
575 // 4.1Ю. 577 // 4.1Ю.
576 Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac'); 578 Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac');
577 Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save'); 579 Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save');
578 Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac'); 580 Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac');
579 Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save'); 581 Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save');
580 Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac'); 582 Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac');
581 583
582 // 4 страница - Отклики на вакансии 584 // 4 страница - Отклики на вакансии
583 Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); 585 Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers');
584 Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); 586 Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple');
585 Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); 587 Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg');
586 588
587 // 5 страница - Сообщения 589 // 5 страница - Сообщения
588 Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); 590 Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages');
589 Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); 591 Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog');
590 Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); 592 Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message');
591 Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); 593 Route::post('test123', [EmployerController::class, 'test123'])->name('test123');
592 594
593 // 6 страница - Избранный 595 // 6 страница - Избранный
594 Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); 596 Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites');
595 597
596 //7 страница - База данных 598 //7 страница - База данных
597 Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); 599 Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd');
598 600
599 //8 страница - База резюме 601 //8 страница - База резюме
600 Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); 602 Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe');
601 603
602 // 9 рассылка сообщений 604 // 9 рассылка сообщений
603 Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); 605 Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages');
604 Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); 606 Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post');
605 607
606 // 10 страница FAQ вопросы 608 // 10 страница FAQ вопросы
607 Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq'); 609 Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq');
608 610
609 // 11 страница - Настройка уведомлений 611 // 11 страница - Настройка уведомлений
610 Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); 612 Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe');
611 Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); 613 Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe');
612 614
613 // 12 страница - Сменить пароль 615 // 12 страница - Сменить пароль
614 Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); 616 Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset');
615 Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); 617 Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password');
616 618
617 // 13 страница - Удаление профиля 619 // 13 страница - Удаление профиля
618 Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); 620 Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people');
619 Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); 621 Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user');
620 Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); 622 Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user');
621 623
622 // Отправил сообщение 624 // Отправил сообщение
623 Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); 625 Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message');
624 }); 626 });
625 627
626 Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker'); 628 Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker');
627 629
628 630