Commit c54cbb05e525c523064361c53f1f90c77ef67bcb

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

Коммит субботний

Showing 8 changed files with 102 additions and 44 deletions Inline Diff

app/Http/Controllers/Admin/InfoBloksController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers\Admin; 3 namespace App\Http\Controllers\Admin;
4 4
5 use App\Http\Controllers\Controller; 5 use App\Http\Controllers\Controller;
6 use App\Models\infobloks; 6 use App\Models\infobloks;
7 use Illuminate\Http\Request; 7 use Illuminate\Http\Request;
8 8
9 class InfoBloksController extends Controller 9 class InfoBloksController extends Controller
10 { 10 {
11 /** 11 /**
12 * Display a listing of the resource. 12 * Display a listing of the resource.
13 * 13 *
14 * @return \Illuminate\Http\Response 14 * @return \Illuminate\Http\Response
15 */ 15 */
16 public function index() 16 public function index()
17 { 17 {
18 $infobloks = infobloks::query()->active()->orderByDesc('sort')->orderBy('name')->paginate(15); 18 $infobloks = infobloks::query()->
19 //active()->
20 orderByDesc('sort')->orderBy('name')->paginate(15);
19 return view('admin.infobloks.index', compact('infobloks')); 21 return view('admin.infobloks.index', compact('infobloks'));
20 } 22 }
21 23
22 /** 24 /**
23 * Show the form for creating a new resource. 25 * Show the form for creating a new resource.
24 * 26 *
25 * @return \Illuminate\Http\Response 27 * @return \Illuminate\Http\Response
26 */ 28 */
27 public function create() 29 public function create()
28 { 30 {
29 return view('admin.infobloks.add'); 31 return view('admin.infobloks.add');
30 } 32 }
31 33
32 /** 34 /**
33 * Store a newly created resource in storage. 35 * Store a newly created resource in storage.
34 * 36 *
35 * @param \Illuminate\Http\Request $request 37 * @param \Illuminate\Http\Request $request
36 * @return \Illuminate\Http\Response 38 * @return \Illuminate\Http\Response
37 */ 39 */
38 public function store(Request $request) 40 public function store(Request $request)
39 { 41 {
40 infobloks::create($request->all()); 42 infobloks::create($request->all());
41 return redirect()->route('admin.infobloks.index'); 43 return redirect()->route('admin.infobloks.index');
42 } 44 }
43 45
44 /** 46 /**
45 * Display the specified resource. 47 * Display the specified resource.
46 * 48 *
47 * @param \App\Models\infobloks $infobloks 49 * @param \App\Models\infobloks $infobloks
48 * @return \Illuminate\Http\Response 50 * @return \Illuminate\Http\Response
49 */ 51 */
50 public function show(infobloks $infobloks) 52 public function show(infobloks $infobloks)
51 { 53 {
52 // 54 //
53 } 55 }
54 56
55 /** 57 /**
56 * Show the form for editing the specified resource. 58 * Show the form for editing the specified resource.
57 * 59 *
58 * @param \App\Models\infobloks $infoblok 60 * @param \App\Models\infobloks $infoblok
59 * @return \Illuminate\Http\Response 61 * @return \Illuminate\Http\Response
60 */ 62 */
61 public function edit(infobloks $infoblok) 63 public function edit(infobloks $infoblok)
62 { 64 {
63 return view('admin.infobloks.edit', compact('infoblok')); 65 return view('admin.infobloks.edit', compact('infoblok'));
64 } 66 }
65 67
66 /** 68 /**
67 * Update the specified resource in storage. 69 * Update the specified resource in storage.
68 * 70 *
69 * @param \Illuminate\Http\Request $request 71 * @param \Illuminate\Http\Request $request
70 * @param \App\Models\infobloks $infobloks 72 * @param \App\Models\infobloks $infobloks
71 * @return \Illuminate\Http\Response 73 * @return \Illuminate\Http\Response
72 */ 74 */
73 public function update(Request $request, infobloks $infoblok) 75 public function update(Request $request, infobloks $infoblok)
74 { 76 {
75 $infoblok->update($request->all()); 77 $infoblok->update($request->all());
76 return redirect()->route('admin.infobloks.index'); 78 return redirect()->route('admin.infobloks.index');
77 } 79 }
78 80
79 /** 81 /**
80 * Remove the specified resource from storage. 82 * Remove the specified resource from storage.
81 * 83 *
82 * @param \App\Models\infobloks $infobloks 84 * @param \App\Models\infobloks $infobloks
83 * @return \Illuminate\Http\Response 85 * @return \Illuminate\Http\Response
84 */ 86 */
85 public function destroy(infobloks $infoblok) 87 public function destroy(infobloks $infoblok)
86 { 88 {
87 $infoblok->update(['is_remove' => 1]); 89 $infoblok->delete(); // update(['is_remove' => 1]);
88 return redirect()->route('admin.infobloks.index'); 90 return redirect()->route('admin.infobloks.index');
89 } 91 }
90 } 92 }
91 93
app/Http/Controllers/Admin/UsersController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers\Admin; 3 namespace App\Http\Controllers\Admin;
4 4
5 use App\Http\Controllers\Controller; 5 use App\Http\Controllers\Controller;
6 use App\Http\Requests\BaseUserRequest; 6 use App\Http\Requests\BaseUserRequest;
7 use App\Models\ContentRoles; 7 use App\Models\ContentRoles;
8 use App\Models\Job_title; 8 use App\Models\Job_title;
9 use App\Models\User; 9 use App\Models\User;
10 use App\Models\Worker; 10 use App\Models\Worker;
11 use Illuminate\Http\Request; 11 use Illuminate\Http\Request;
12 use Illuminate\Support\Facades\Auth; 12 use Illuminate\Support\Facades\Auth;
13 use Illuminate\Support\Facades\Storage; 13 use Illuminate\Support\Facades\Storage;
14 use PhpOffice\PhpSpreadsheet\Spreadsheet; 14 use PhpOffice\PhpSpreadsheet\Spreadsheet;
15 use PhpOffice\PhpSpreadsheet\Style\Alignment; 15 use PhpOffice\PhpSpreadsheet\Style\Alignment;
16 use PhpOffice\PhpSpreadsheet\Style\Border; 16 use PhpOffice\PhpSpreadsheet\Style\Border;
17 use PhpOffice\PhpSpreadsheet\Style\Font; 17 use PhpOffice\PhpSpreadsheet\Style\Font;
18 use PhpOffice\PhpSpreadsheet\Writer\Xlsx; 18 use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
19 19
20 class UsersController extends Controller 20 class UsersController extends Controller
21 { 21 {
22 public function index(Request $request) { 22 public function index(Request $request) {
23 $title = 'Админка - Пользователи системы'; 23 $title = 'Админка - Пользователи системы';
24 $id_admin = Auth::user()->id; 24 $id_admin = Auth::user()->id;
25 if ($request->ajax()) { 25 if ($request->ajax()) {
26 $user = User::find($request->id); 26 $user = User::find($request->id);
27 $request->offsetUnset('id'); 27 $request->offsetUnset('id');
28 $user->update($request->all()); 28 $user->update($request->all());
29 } 29 }
30 30
31 $find_key = ""; 31 $find_key = "";
32 $users = User::query(); 32 $users = User::query();
33 if (isset($request->find)) { 33 if (isset($request->find)) {
34 $find_key = $request->find; 34 $find_key = $request->find;
35 $users = $users->where('name', 'LIKE', "%$find_key%") 35 $users = $users->where('name', 'LIKE', "%$find_key%")
36 ->orWhere('email', 'LIKE', "%$find_key%"); 36 ->orWhere('email', 'LIKE', "%$find_key%");
37 } 37 }
38 38
39 $users = $users->paginate(15); 39 $users = $users->paginate(15);
40 40
41 if ($request->ajax()) { 41 if ($request->ajax()) {
42 return view('admin.users.index_ajax', compact('users', 'id_admin')); 42 return view('admin.users.index_ajax', compact('users', 'id_admin'));
43 } else { 43 } else {
44 return view('admin.users.index', compact('users', 'title', 'id_admin', 'find_key')); 44 return view('admin.users.index', compact('users', 'title', 'id_admin', 'find_key'));
45 } 45 }
46 } 46 }
47 47
48 public function user_delete(User $user) {
49 $id = $user->delete();
50
51 return redirect()->route('admin.users')->with('Пользователь был удален из системы');
52 }
53
48 public function index_bd(Request $request) { 54 public function index_bd(Request $request) {
49 $title = 'Админка - Пользователи базы данных'; 55 $title = 'Админка - Пользователи базы данных';
50 56
51 $find_key = ""; 57 $find_key = "";
52 $users = User::query(); 58 $users = User::query();
53 if (isset($request->find)) { 59 if (isset($request->find)) {
54 $find_key = $request->find; 60 $find_key = $request->find;
55 $users = $users->where('name', 'LIKE', "%$find_key%") 61 $users = $users->where('name', 'LIKE', "%$find_key%")
56 ->orWhere('email', 'LIKE', "%$find_key%") 62 ->orWhere('email', 'LIKE', "%$find_key%")
57 ->orWhere('telephone', 'LIKE', "%$find_key%"); 63 ->orWhere('telephone', 'LIKE', "%$find_key%");
58 } 64 }
59 65
60 $users = $users->Baseuser()->paginate(15); 66 $users = $users->Baseuser()->paginate(15);
61 67
62 if ($request->ajax()) { 68 if ($request->ajax()) {
63 return view('admin.users.index_bd_ajax', compact('users')); 69 return view('admin.users.index_bd_ajax', compact('users'));
64 } else { 70 } else {
65 return view('admin.users.index_bd', compact('users', 'title', 'find_key')); 71 return view('admin.users.index_bd', compact('users', 'title', 'find_key'));
66 } 72 }
67 } 73 }
68 74
69 public function add_bd() { 75 public function add_bd() {
70 $list_job_titles = Job_title::query()->active()->where('is_bd', '=' , '2')->orderBy('name', 'asc')->get(); 76 $list_job_titles = Job_title::query()->active()->where('is_bd', '=' , '2')->orderBy('name', 'asc')->get();
71 return view('admin.users.add', compact('list_job_titles')); 77 return view('admin.users.add', compact('list_job_titles'));
72 } 78 }
73 79
74 public function add_store_bd(BaseUserRequest $request) { 80 public function add_store_bd(BaseUserRequest $request) {
75 $params = $request->all(); 81 $params = $request->all();
76 $position_work = $request->position_work; 82 $position_work = $request->position_work;
77 83
78 if ($request->has('file')) { 84 if ($request->has('file')) {
79 $params['file'] = $request->file('file')->store('basedata', 'public'); 85 $params['file'] = $request->file('file')->store('basedata', 'public');
80 } 86 }
81 87
82 if (isset($request->name)) { 88 if (isset($request->name)) {
83 $params['name'] = $request->surname." ".$request->name_man." ".$request->surname2; 89 $params['name'] = $request->surname." ".$request->name_man." ".$request->surname2;
84 } 90 }
85 91
86 $user = User::create($params); 92 $user = User::create($params);
87 $user_id = $user->id; 93 $user_id = $user->id;
88 $worker = new Worker(); 94 $worker = new Worker();
89 $worker->position_work = $position_work; 95 $worker->position_work = $position_work;
90 $worker->user_id = $user_id; 96 $worker->user_id = $user_id;
91 $worker->save(); 97 $worker->save();
92 98
93 return redirect()->route('admin.basedata'); 99 return redirect()->route('admin.basedata');
94 } 100 }
95 101
96 public function edit_bd(User $user) { 102 public function edit_bd(User $user) {
97 $list_job_titles = Job_title::query()->active()->where('is_bd', '=' , '2')-> 103 $list_job_titles = Job_title::query()->active()->where('is_bd', '=' , '2')->
98 orderByDesc('sort')->orderBy('name', 'asc')->get(); 104 orderByDesc('sort')->orderBy('name', 'asc')->get();
99 return view('admin.users.edit', compact('user', 'list_job_titles')); 105 return view('admin.users.edit', compact('user', 'list_job_titles'));
100 } 106 }
101 107
102 public function update_bd(BaseUserRequest $request, User $user) { 108 public function update_bd(BaseUserRequest $request, User $user) {
103 $params = $request->all(); 109 $params = $request->all();
104 $position_work = $request->position_work; 110 $position_work = $request->position_work;
105 111
106 if ($request->has('file')) { 112 if ($request->has('file')) {
107 if (!empty($user->file)) Storage::delete($user->file); 113 if (!empty($user->file)) Storage::delete($user->file);
108 $params['file'] = $request->file('file')->store('basedata', 'public'); 114 $params['file'] = $request->file('file')->store('basedata', 'public');
109 } else { 115 } else {
110 if (!empty($user->image)) $params['file'] = $user->file; 116 if (!empty($user->image)) $params['file'] = $user->file;
111 } 117 }
112 118
113 if (isset($request->name)) { 119 if (isset($request->name)) {
114 $params['name'] = $request->surname." ".$request->name_man." ".$request->surname2; 120 $params['name'] = $request->surname." ".$request->name_man." ".$request->surname2;
115 } 121 }
116 122
117 $user->update($params); 123 $user->update($params);
118 if (isset($user->workers[0]->id)) { 124 if (isset($user->workers[0]->id)) {
119 $worker = Worker::find($user->workers[0]->id); 125 $worker = Worker::find($user->workers[0]->id);
120 $worker->position_work = $position_work; 126 $worker->position_work = $position_work;
121 $worker->save(); 127 $worker->save();
122 } else { 128 } else {
123 $worker = new Worker(); 129 $worker = new Worker();
124 $worker->user_id = $user->id; 130 $worker->user_id = $user->id;
125 $worker->position_work = $position_work; 131 $worker->position_work = $position_work;
126 $worker->save(); 132 $worker->save();
127 } 133 }
128 134
129 return redirect()->route('admin.basedata'); 135 return redirect()->route('admin.basedata');
130 } 136 }
131 137
132 public function destroy_bd(User $user) { 138 public function destroy_bd(User $user) {
133 $user->delete(); 139 $user->delete();
134 return redirect()->route('admin.basedata'); 140 return redirect()->route('admin.basedata');
135 } 141 }
136 142
137 public function roles(Request $request) { 143 public function roles(Request $request) {
138 if ($request->ajax()) { 144 if ($request->ajax()) {
139 $user = User::find($request->id); 145 $user = User::find($request->id);
140 $request->offsetUnset('id'); 146 $request->offsetUnset('id');
141 $user->update($request->all()); 147 $user->update($request->all());
142 } 148 }
143 149
144 $users = User::query()->Realuser()->paginate(15); 150 $users = User::query()->Realuser()->paginate(15);
145 151
146 if ($request->ajax()) { 152 if ($request->ajax()) {
147 return view('admin.users.roles.index_ajax', compact('users')); 153 return view('admin.users.roles.index_ajax', compact('users'));
148 } else { 154 } else {
149 return view('admin.users.roles.index', compact('users')); 155 return view('admin.users.roles.index', compact('users'));
150 } 156 }
151 } 157 }
152 158
153 public function admin_roles(Request $request) { 159 public function admin_roles(Request $request) {
154 160
155 if ($request->ajax()) { 161 if ($request->ajax()) {
156 $id = $request->id; 162 $id = $request->id;
157 $request->offsetUnset('id'); 163 $request->offsetUnset('id');
158 ContentRoles::where('id', '=', $id)->update($request->all()); 164 ContentRoles::where('id', '=', $id)->update($request->all());
159 } 165 }
160 $roles = ContentRoles::query()->OrderBy('id')->paginate(25); 166 $roles = ContentRoles::query()->OrderBy('id')->paginate(25);
161 167
162 168
163 if ($request->ajax()) { 169 if ($request->ajax()) {
164 return view('admin.content.roles_index_ajax', compact('roles')); 170 return view('admin.content.roles_index_ajax', compact('roles'));
165 } else { 171 } else {
166 return view('admin.content.roles_index', compact('roles')); 172 return view('admin.content.roles_index', compact('roles'));
167 } 173 }
168 } 174 }
169 175
170 public function doc_bd(User $user) { 176 public function doc_bd(User $user) {
171 $id = $user->id; 177 $id = $user->id;
172 $spreadsheet = new Spreadsheet(); 178 $spreadsheet = new Spreadsheet();
173 $activeWorksheet = $spreadsheet->getActiveSheet(); 179 $activeWorksheet = $spreadsheet->getActiveSheet();
174 $activeWorksheet->setCellValue('A1', 'Отчет по соискателю'); 180 $activeWorksheet->setCellValue('A1', 'Отчет по соискателю');
175 $activeWorksheet->getStyle('A1')->applyFromArray([ 181 $activeWorksheet->getStyle('A1')->applyFromArray([
176 'font' => [ 182 'font' => [
177 'name' => 'Arial', 183 'name' => 'Arial',
178 'bold' => true, 184 'bold' => true,
179 'italic' => false, 185 'italic' => false,
180 'underline' => Font::UNDERLINE_DOUBLE, 186 'underline' => Font::UNDERLINE_DOUBLE,
181 'strikethrough' => false, 187 'strikethrough' => false,
182 'color' => [ 188 'color' => [
183 'rgb' => '808080' 189 'rgb' => '808080'
184 ] 190 ]
185 ], 191 ],
186 'borders' => [ 192 'borders' => [
187 'allBorders' => [ 193 'allBorders' => [
188 'borderStyle' => Border::BORDER_THIN, 194 'borderStyle' => Border::BORDER_THIN,
189 'color' => [ 195 'color' => [
190 'rgb' => '808080' 196 'rgb' => '808080'
191 ] 197 ]
192 ], 198 ],
193 'outline' => array( 199 'outline' => array(
194 'style' => Border::BORDER_THIN, 200 'style' => Border::BORDER_THIN,
195 'color' => array('rgb' => '000000') 201 'color' => array('rgb' => '000000')
196 ), 202 ),
197 ], 203 ],
198 204
199 'alignment' => [ 205 'alignment' => [
200 'horizontal' => Alignment::HORIZONTAL_CENTER, 206 'horizontal' => Alignment::HORIZONTAL_CENTER,
201 'vertical' => Alignment::VERTICAL_CENTER, 207 'vertical' => Alignment::VERTICAL_CENTER,
202 'wrapText' => true, 208 'wrapText' => true,
203 ] 209 ]
204 ]); 210 ]);
205 211
206 $activeWorksheet->setCellValue('A2', "Псевдоним/имя: ".$user->name); 212 $activeWorksheet->setCellValue('A2', "Псевдоним/имя: ".$user->name);
207 $activeWorksheet->setCellValue('A3', "Фамилия: ".$user->surname); 213 $activeWorksheet->setCellValue('A3', "Фамилия: ".$user->surname);
208 $activeWorksheet->setCellValue('A4', "Имя: ".$user->name_man); 214 $activeWorksheet->setCellValue('A4', "Имя: ".$user->name_man);
209 $activeWorksheet->setCellValue('A5', "Отчество: ".$user->surname2); 215 $activeWorksheet->setCellValue('A5', "Отчество: ".$user->surname2);
210 $activeWorksheet->setCellValue('A6', "Телефон: ".$user->telephone); 216 $activeWorksheet->setCellValue('A6', "Телефон: ".$user->telephone);
211 $activeWorksheet->setCellValue('A7', "Емайл: ".$user->email); 217 $activeWorksheet->setCellValue('A7', "Емайл: ".$user->email);
212 218
213 if (isset($user->workers[0]->id)) { 219 if (isset($user->workers[0]->id)) {
214 $activeWorksheet->setCellValue('A9', "Анкета: "); 220 $activeWorksheet->setCellValue('A9', "Анкета: ");
215 $activeWorksheet->setCellValue('A10', "Телефон: " . $user->workers[0]->telephone); 221 $activeWorksheet->setCellValue('A10', "Телефон: " . $user->workers[0]->telephone);
216 $activeWorksheet->setCellValue('A11', "Емайл: " . $user->workers[0]->email); 222 $activeWorksheet->setCellValue('A11', "Емайл: " . $user->workers[0]->email);
217 } 223 }
218 224
219 if (isset($user->jobtitles[0]->id)) { 225 if (isset($user->jobtitles[0]->id)) {
220 $activeWorksheet->setCellValue('A12', "Должность: " . $user->jobtitles[0]->name); 226 $activeWorksheet->setCellValue('A12', "Должность: " . $user->jobtitles[0]->name);
221 } 227 }
222 $activeWorksheet->getColumnDimension("A")->setWidth(100); 228 $activeWorksheet->getColumnDimension("A")->setWidth(100);
223 $writer = new Xlsx($spreadsheet); 229 $writer = new Xlsx($spreadsheet);
224 230
225 header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); 231 header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
226 header('Content-Disposition: attachment; filename="user'.$id.'.xlsx"'); 232 header('Content-Disposition: attachment; filename="user'.$id.'.xlsx"');
227 header('Cache-Control: no-cache'); 233 header('Cache-Control: no-cache');
228 234
229 $writer->save('php://output'); 235 $writer->save('php://output');
230 $writer->save(storage_path("app/public/export/user$id.xlsx")); 236 $writer->save(storage_path("app/public/export/user$id.xlsx"));
231 237
232 //$spreadsheet->disconnectWorksheets(); 238 //$spreadsheet->disconnectWorksheets();
233 return redirect()->route('admin.basedata'); 239 return redirect()->route('admin.basedata');
234 240
235 } 241 }
236 } 242 }
237 243
app/Http/Controllers/CompanyController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Models\Ad_employer;
5 use App\Models\Employer; 6 use App\Models\Employer;
6 use Illuminate\Http\Request; 7 use Illuminate\Http\Request;
7 8
8 class CompanyController extends Controller 9 class CompanyController extends Controller
9 { 10 {
10 public function shipping_companies(Request $request) { 11 public function shipping_companies(Request $request) {
11 $emps = Employer::query()->with('ads')->where('status_hidden', '=', '0'); 12 $emps = Employer::query()->with('ads')->where('status_hidden', '=', '0');
12 if (($request->has('search')) && (!empty($request->get('search')))) { 13 if (($request->has('search')) && (!empty($request->get('search')))) {
13 $search = $request->get('search'); 14 $search = $request->get('search');
14 $emps = $emps->where('name_company', 'LIKE', "%$search%"); 15 $emps = $emps->where('name_company', 'LIKE', "%$search%");
15 } 16 }
16 17
17 $count_emps = $emps->count(); 18 $count_emps = $emps->count();
18 19
19 if ($request->get('sort')) { 20 if ($request->get('sort')) {
20 $sort = $request->get('sort'); 21 $sort = $request->get('sort');
21 switch ($sort) { 22 switch ($sort) {
22 case 'name_up': $emps = $emps->orderBy('name_company')->orderBy('id'); break; 23 case 'name_up': $emps = $emps->orderBy('name_company')->orderBy('id'); break;
23 case 'name_down': $emps = $emps->orderByDesc('name_company')->orderby('id'); break; 24 case 'name_down': $emps = $emps->orderByDesc('name_company')->orderby('id'); break;
24 case 'created_at_up': $emps = $emps->OrderBy('created_at')->orderBy('id'); break; 25 case 'created_at_up': $emps = $emps->OrderBy('created_at')->orderBy('id'); break;
25 case 'created_at_down': $emps = $emps->orderByDesc('created_at')->orderBy('id'); break; 26 case 'created_at_down': $emps = $emps->orderByDesc('created_at')->orderBy('id'); break;
26 case 'default': $emps = $emps->orderBy('id')->orderby('updated_at'); break; 27 case 'default': $emps = $emps->orderBy('id')->orderby('updated_at'); break;
27 default: $emps = $emps->orderBy('id')->orderby('updated_at'); break; 28 default: $emps = $emps->orderBy('id')->orderby('updated_at'); break;
28 } 29 }
29 } 30 }
30 31
31 $emps = $emps->paginate(4); 32 $emps = $emps->paginate(4);
32 33
33 34
34 if ($request->ajax()) { 35 if ($request->ajax()) {
35 if ($request->get('block') == '1') 36 if ($request->get('block') == '1')
36 return view('ajax.companies', compact('emps', 'count_emps')); 37 return view('ajax.companies', compact('emps', 'count_emps'));
37 else 38 else
38 return view('ajax.companies2', compact('emps', 'count_emps')); 39 return view('ajax.companies2', compact('emps', 'count_emps'));
39 } else { 40 } else {
40 return view('companies', compact('emps', 'count_emps')); 41 return view('companies', compact('emps', 'count_emps'));
41 } 42 }
42 } 43 }
43 44
44 public function info_company(Employer $company) { 45 public function info_company(Employer $company) {
45 if (isset(Auth()->user()->id)) { 46 if (isset(Auth()->user()->id)) {
46 $user_id = Auth()->user()->id; 47 $user_id = Auth()->user()->id;
47 } else { 48 } else {
48 $user_id = 0; 49 $user_id = 0;
49 } 50 }
50 $company = Employer::with('ads')->with('flots')->with('users') 51 $company = Employer::with('ads')->with('flots')->with('users')
51 ->where('id', '=', $company->id)->get(); 52 ->where('id', '=', $company->id)->get();
52 53
53 $title = $company[0]->name_company; 54 $title = $company[0]->name_company;
54 55
55 return view('info_company_new', compact('company', 'user_id', 'title')); 56 $ads = Ad_employer::query()->with('jobs')->with('jobs_code')->
57 OrderByDesc('id')->
58 where('employer_id', '=', $company[0]->id)->paginate(2);
59
60 return view('info_company_new', compact('company', 'user_id', 'title', 'ads'));
56 } 61 }
57 } 62 }
58 63
app/Http/Controllers/EmployerController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Classes\RusDate; 5 use App\Classes\RusDate;
6 use App\Classes\Tools; 6 use App\Classes\Tools;
7 use App\Http\Requests\BaseUser_min_Request; 7 use App\Http\Requests\BaseUser_min_Request;
8 use App\Http\Requests\BaseUserRequest; 8 use App\Http\Requests\BaseUserRequest;
9 use App\Http\Requests\FlotRequest; 9 use App\Http\Requests\FlotRequest;
10 use App\Http\Requests\MessagesRequiest; 10 use App\Http\Requests\MessagesRequiest;
11 use App\Http\Requests\VacancyRequestEdit; 11 use App\Http\Requests\VacancyRequestEdit;
12 use App\Http\Requests\VacansiaRequiest; 12 use App\Http\Requests\VacansiaRequiest;
13 use App\Mail\MailSotrudnichestvo; 13 use App\Mail\MailSotrudnichestvo;
14 use App\Mail\SendAllMessages; 14 use App\Mail\SendAllMessages;
15 use App\Models\Ad_employer; 15 use App\Models\Ad_employer;
16 use App\Models\Ad_jobs; 16 use App\Models\Ad_jobs;
17 use App\Models\ad_response; 17 use App\Models\ad_response;
18 use App\Models\Category; 18 use App\Models\Category;
19 use App\Models\Education; 19 use App\Models\Education;
20 use App\Models\Employer; 20 use App\Models\Employer;
21 use App\Models\employers_main; 21 use App\Models\employers_main;
22 use App\Models\Flot; 22 use App\Models\Flot;
23 use App\Models\Job_title; 23 use App\Models\Job_title;
24 use App\Models\Like_vacancy; 24 use App\Models\Like_vacancy;
25 use App\Models\Like_worker; 25 use App\Models\Like_worker;
26 use App\Models\Message; 26 use App\Models\Message;
27 use App\Models\Positions; 27 use App\Models\Positions;
28 use App\Models\Worker; 28 use App\Models\Worker;
29 use Carbon\Carbon; 29 use Carbon\Carbon;
30 use Illuminate\Auth\Events\Registered; 30 use Illuminate\Auth\Events\Registered;
31 use Illuminate\Database\Eloquent\Builder; 31 use Illuminate\Database\Eloquent\Builder;
32 use Illuminate\Database\Eloquent\Model; 32 use Illuminate\Database\Eloquent\Model;
33 use Illuminate\Foundation\Auth\User; 33 use Illuminate\Foundation\Auth\User;
34 use Illuminate\Http\Request; 34 use Illuminate\Http\Request;
35 use Illuminate\Support\Facades\Auth; 35 use Illuminate\Support\Facades\Auth;
36 use Illuminate\Support\Facades\Hash; 36 use Illuminate\Support\Facades\Hash;
37 use Illuminate\Support\Facades\Mail; 37 use Illuminate\Support\Facades\Mail;
38 use Illuminate\Support\Facades\Storage; 38 use Illuminate\Support\Facades\Storage;
39 use App\Models\User as User_Model; 39 use App\Models\User as User_Model;
40 use Illuminate\Support\Facades\Validator; 40 use Illuminate\Support\Facades\Validator;
41 41
42 class EmployerController extends Controller 42 class EmployerController extends Controller
43 { 43 {
44 public function vacancie($vacancy, Request $request) { 44 public function vacancie($vacancy, Request $request) {
45 $title = 'Заголовок вакансии'; 45 $title = 'Заголовок вакансии';
46 $Query = Ad_employer::with('jobs')-> 46 $Query = Ad_employer::with('jobs')->
47 with('cat')-> 47 with('cat')->
48 with('employer')-> 48 with('employer')->
49 with('jobs_code')-> 49 with('jobs_code')->
50 select('ad_employers.*')-> 50 select('ad_employers.*')->
51 where('id', '=', $vacancy)->get(); 51 where('id', '=', $vacancy)->get();
52 52
53 if (isset(Auth()->user()->id)) 53 if (isset(Auth()->user()->id))
54 $uid = Auth()->user()->id; 54 $uid = Auth()->user()->id;
55 else 55 else
56 $uid = 0; 56 $uid = 0;
57 $title = $Query[0]->name; 57 $title = $Query[0]->name;
58 if ($request->ajax()) { 58 if ($request->ajax()) {
59 return view('ajax.vacance-item', compact('Query','uid')); 59 return view('ajax.vacance-item', compact('Query','uid'));
60 } else { 60 } else {
61 return view('vacance-item', compact('title', 'Query', 'uid')); 61 return view('vacance-item', compact('title', 'Query', 'uid'));
62 } 62 }
63 } 63 }
64 64
65 public function logout() { 65 public function logout() {
66 Auth::logout(); 66 Auth::logout();
67 return redirect()->route('index') 67 return redirect()->route('index')
68 ->with('success', 'Вы вышли из личного кабинета'); 68 ->with('success', 'Вы вышли из личного кабинета');
69 } 69 }
70 70
71 public function employer_info() { 71 public function employer_info() {
72 // код юзера 72 // код юзера
73 $user_info = Auth()->user(); 73 $user_info = Auth()->user();
74 // вьюшка для вывода данных 74 // вьюшка для вывода данных
75 return view('employers.info', compact('user_info')); 75 return view('employers.info', compact('user_info'));
76 } 76 }
77 77
78 public function employer_info_save(User_Model $user, BaseUser_min_Request $request) { 78 public function employer_info_save(User_Model $user, BaseUser_min_Request $request) {
79 // Все данные через реквест 79 // Все данные через реквест
80 $all = $request->all(); 80 $all = $request->all();
81 unset($all['_token']); 81 unset($all['_token']);
82 // обновление 82 // обновление
83 $user->update($all); 83 $user->update($all);
84 return redirect()->route('employer.employer_info'); 84 return redirect()->route('employer.employer_info');
85 } 85 }
86 86
87 public function cabinet() { 87 public function cabinet() {
88 $id = Auth()->user()->id; 88 $id = Auth()->user()->id;
89 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 89 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
90 WhereHas('users', 90 WhereHas('users',
91 function (Builder $query) use ($id) {$query->Where('id', $id); 91 function (Builder $query) use ($id) {$query->Where('id', $id);
92 })->get(); 92 })->get();
93 return view('employers.cabinet45', compact('Employer')); 93 return view('employers.cabinet45', compact('Employer'));
94 } 94 }
95 95
96 public function slider_flot() { 96 public function slider_flot() {
97 $id = Auth()->user()->id; 97 $id = Auth()->user()->id;
98 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 98 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
99 WhereHas('users', 99 WhereHas('users',
100 function (Builder $query) use ($id) {$query->Where('id', $id); 100 function (Builder $query) use ($id) {$query->Where('id', $id);
101 })->get(); 101 })->get();
102 return view('employers.fly-flot', compact('Employer')); 102 return view('employers.fly-flot', compact('Employer'));
103 } 103 }
104 104
105 public function cabinet_save(Employer $Employer, Request $request) { 105 public function cabinet_save(Employer $Employer, Request $request) {
106 $params = $request->all(); 106 $params = $request->all();
107 $params['user_id'] = Auth()->user()->id; 107 $params['user_id'] = Auth()->user()->id;
108 $id = $Employer->id; 108 $id = $Employer->id;
109 109
110 if ($request->has('logo')) { 110 if ($request->has('logo')) {
111 if (!empty($Employer->logo)) { 111 if (!empty($Employer->logo)) {
112 Storage::delete($Employer->logo); 112 Storage::delete($Employer->logo);
113 } 113 }
114 $params['logo'] = $request->file('logo')->store("employer/$id", 'public'); 114 $params['logo'] = $request->file('logo')->store("employer/$id", 'public');
115 } 115 }
116 116
117 $Employer->update($params); 117 $Employer->update($params);
118 118
119 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены'); 119 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены');
120 } 120 }
121 121
122 public function save_add_flot(FlotRequest $request) { 122 public function save_add_flot(FlotRequest $request) {
123 // отмена 123 // отмена
124 $params = $request->all(); 124 $params = $request->all();
125 125
126 if ($request->has('image')) { 126 if ($request->has('image')) {
127 $params['image'] = $request->file('image')->store("flot", 'public'); 127 $params['image'] = $request->file('image')->store("flot", 'public');
128 } 128 }
129 Flot::create($params); 129 Flot::create($params);
130 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get(); 130 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get();
131 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); 131 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен');
132 } 132 }
133 133
134 public function edit_flot(Flot $Flot, Employer $Employer) { 134 public function edit_flot(Flot $Flot, Employer $Employer) {
135 return view('employers.edit-flot', compact('Flot', 'Employer')); 135 return view('employers.edit-flot', compact('Flot', 'Employer'));
136 } 136 }
137 137
138 public function update_flot(FlotRequest $request, Flot $Flot) { 138 public function update_flot(FlotRequest $request, Flot $Flot) {
139 $params = $request->all(); 139 $params = $request->all();
140 140
141 if ($request->has('image')) { 141 if ($request->has('image')) {
142 if (!empty($flot->image)) { 142 if (!empty($flot->image)) {
143 Storage::delete($flot->image); 143 Storage::delete($flot->image);
144 } 144 }
145 $params['image'] = $request->file('image')->store("flot", 'public'); 145 $params['image'] = $request->file('image')->store("flot", 'public');
146 } else { 146 } else {
147 if (!empty($flot->image)) $params['image'] = $flot->image; 147 if (!empty($flot->image)) $params['image'] = $flot->image;
148 } 148 }
149 149
150 $Flot->update($params); 150 $Flot->update($params);
151 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); 151 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен');
152 } 152 }
153 153
154 public function delete_flot(Flot $Flot) { 154 public function delete_flot(Flot $Flot) {
155 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get(); 155 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get();
156 156
157 if (isset($Flot->id)) $Flot->delete(); 157 if (isset($Flot->id)) $Flot->delete();
158 return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален'); 158 return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален');
159 } 159 }
160 160
161 // Форма добавления вакансий 161 // Форма добавления вакансий
162 public function cabinet_vacancie() { 162 public function cabinet_vacancie() {
163 $id = Auth()->user()->id; 163 $id = Auth()->user()->id;
164 164
165 if (Auth()->user()->is_public) { 165 if (Auth()->user()->is_public) {
166 $categories = Category::query()->active()->get(); 166 $categories = Category::query()->active()->get();
167
168 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 167 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
169 where('is_remove', '=', '0')-> 168 where('is_remove', '=', '0')->
170 where('is_bd', '=', '0')-> 169 where('is_bd', '=', '0')->
171 get(); 170 get();
172 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 171 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
173
174 WhereHas('users', 172 WhereHas('users',
175 function (Builder $query) use ($id) { 173 function (Builder $query) use ($id) {
176 $query->Where('id', $id); 174 $query->Where('id', $id);
177 })->get(); 175 })->get();
178
179 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories')); 176 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories'));
180 } else { 177 } else {
181 return redirect()->route('employer.cabinet_vacancie_danger'); 178 return redirect()->route('employer.cabinet_vacancie_danger');
182 } 179 }
183 } 180 }
184 181
185 // Форма предупреждения об оплате 182 // Форма предупреждения об оплате
186 public function cabinet_vacancie_danger() { 183 public function cabinet_vacancie_danger() {
187 return view('employers.add_vacancy_danger'); 184 return view('employers.add_vacancy_danger');
188 } 185 }
189 186
190 // Сохранение вакансии 187 // Сохранение вакансии
191 public function cabinet_vacancy_save1(VacancyRequestEdit $request) { 188 public function cabinet_vacancy_save1(VacancyRequestEdit $request) {
192 $params_emp = $request->all(); 189 $params_emp = $request->all();
193 190
194 $params_job["job_title_id"] = $params_emp['job_title_id']; 191 $params_job["job_title_id"] = $params_emp['job_title_id'];
195 //$params_job["min_salary"] = $params_emp['min_salary']; 192 //$params_job["min_salary"] = $params_emp['min_salary'];
196 //$params_job["max_salary"] = $params_emp['max_salary']; 193 //$params_job["max_salary"] = $params_emp['max_salary'];
197 //$params_job["region"] = $params_emp['region']; 194 //$params_job["region"] = $params_emp['region'];
198 //$params_job["power"] = $params_emp['power']; 195 //$params_job["power"] = $params_emp['power'];
199 //$params_job["sytki"] = $params_emp['sytki']; 196 //$params_job["sytki"] = $params_emp['sytki'];
200 //$params_job["start"] = $params_emp['start']; 197 //$params_job["start"] = $params_emp['start'];
201 //$params_job["flot"] = $params_emp['flot']; 198 //$params_job["flot"] = $params_emp['flot'];
202 //$params_job["description"] = $params_emp['description']; 199 //$params_job["description"] = $params_emp['description'];
203 200
204 $ad_jobs = Ad_employer::create($params_emp); 201 $ad_jobs = Ad_employer::create($params_emp);
205 //$params_job['ad_employer_id'] = $ad_jobs->id; 202 //$params_job['ad_employer_id'] = $ad_jobs->id;
206 //Ad_jobs::create($params_job); 203 //Ad_jobs::create($params_job);
207 $ad_jobs->jobs()->sync($request->get('job_title_id')); 204 $ad_jobs->jobs()->sync($request->get('job_title_id'));
208 205
209 return redirect()->route('employer.vacancy_list'); 206 return redirect()->route('employer.vacancy_list');
210 } 207 }
211 208
212 // Список вакансий 209 // Список вакансий
213 public function vacancy_list(Request $request) { 210 public function vacancy_list(Request $request) {
214 $id = Auth()->user()->id; 211 $id = Auth()->user()->id;
215 212
216 //dd($request->all()); 213 //dd($request->all());
217 $Employer = Employer::query()->where('user_id', $id)->first(); 214 $Employer = Employer::query()->where('user_id', $id)->first();
218 $vacancy_list = Ad_employer::query()->with('jobs')-> 215 $vacancy_list = Ad_employer::query()->with('jobs')->
219 with('jobs_code')-> 216 with('jobs_code')->
220 where('employer_id', $Employer->id); 217 where('employer_id', $Employer->id);
221 218
222 if (($request->has('search')) && (!empty($request->get('search')))) { 219 if (($request->has('search')) && (!empty($request->get('search')))) {
223 $search = $request->get('search'); 220 $search = $request->get('search');
224 $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%"); 221 $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%");
225 } 222 }
226 223
227 if ($request->get('sort')) { 224 if ($request->get('sort')) {
228 $sort = $request->get('sort'); 225 $sort = $request->get('sort');
229 switch ($sort) { 226 switch ($sort) {
230 case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break; 227 case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break;
231 case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break; 228 case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break;
232 case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break; 229 case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break;
233 case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break; 230 case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break;
234 case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; 231 case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break;
235 default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; 232 default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break;
236 } 233 }
237 } 234 }
238 $vacancy_list = $vacancy_list->paginate(4); 235 $vacancy_list = $vacancy_list->paginate(4);
239 236
240 //ajax 237 //ajax
241 if ($request->ajax()) { 238 if ($request->ajax()) {
242 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); 239 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer'));
243 } else { 240 } else {
244 return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); 241 return view('employers.list_vacancy', compact('vacancy_list', 'Employer'));
245 } 242 }
246 } 243 }
247 244
248 // Карточка вакансии 245 // Карточка вакансии
249 public function vacancy_edit(Ad_employer $ad_employer) { 246 public function vacancy_edit(Ad_employer $ad_employer) {
250 $id = Auth()->user()->id; 247 $id = Auth()->user()->id;
251 $Positions = Category::query()->where('is_remove', '=', '0')->get(); 248 $Positions = Category::query()->where('is_remove', '=', '0')->get();
252 $jobs = Job_title::query()->OrderBy('name')-> 249 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
253 where('is_remove', 0)->where('is_bd', '=' , '0')->get(); 250 where('is_remove', '=', '0')->
254 251 where('is_bd', '=', '0')->get();
255 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
256 where('user_id', $id)->first();
257 252
253 $Employer = Employer::query()->with('users')->with('ads')->
254 with('flots')->where('user_id', $id)->first();
258 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); 255 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs'));
259 } 256 }
260 257
261 // Сохранение-редактирование записи 258 // Сохранение-редактирование записи
262 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { 259 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) {
263 $params = $request->all(); 260 $params = $request->all();
261 $params_job["job_title_id"] = $params['job_title_id'];
264 262
265 //$jobs['flot'] = $params['flot']; 263 //$jobs['flot'] = $params['flot'];
266 //$jobs['job_title_id'] = $params['job_title_id']; 264 //$jobs['job_title_id'] = $params['job_title_id'];
267 //$titles['position_id'] = $params['position_id']; 265 //$titles['position_id'] = $params['position_id'];
268 //unset($params['job_title_id']); 266 //unset($params['job_title_id']);
269 267
270 $ad_employer->update($params); 268 $ad_employer->update($params);
269 $ad_employer->jobs()->sync($request->get('job_title_id'));
271 270
272 //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])-> 271 //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])->
273 // where('ad_employer_id', $ad_employer->id)->first(); 272 // where('ad_employer_id', $ad_employer->id)->first();
274 //$data = Ad_jobs::find($job_->id); 273 //$data = Ad_jobs::find($job_->id);
275 //$ad_jobs = $data->update($jobs); 274 //$ad_jobs = $data->update($jobs);
276 275
277 return redirect()->route('employer.vacancy_list'); 276 return redirect()->route('employer.vacancy_list');
278 } 277 }
279 278
280 // Сохранение карточки вакансии 279 // Сохранение карточки вакансии
281 public function vacancy_save(Request $request, Ad_employer $ad_employer) { 280 public function vacancy_save(Request $request, Ad_employer $ad_employer) {
282 $all = $request->all(); 281 $all = $request->all();
283 $ad_employer->update($all); 282 $ad_employer->update($all);
284 return redirect()->route('employer.cabinet_vacancie'); 283 return redirect()->route('employer.cabinet_vacancie');
285 } 284 }
286 285
287 // Удаление карточки вакансии 286 // Удаление карточки вакансии
288 public function vacancy_delete(Ad_employer $ad_employer) { 287 public function vacancy_delete(Ad_employer $ad_employer) {
289 $ad_employer->delete(); 288 $ad_employer->delete();
290 289
291 return redirect()->route('employer.vacancy_list') 290 return redirect()->route('employer.vacancy_list')
292 ->with('success', 'Данные были успешно сохранены'); 291 ->with('success', 'Данные были успешно сохранены');
293 } 292 }
294 293
295 // Обновление даты 294 // Обновление даты
296 public function vacancy_up(Ad_employer $ad_employer) { 295 public function vacancy_up(Ad_employer $ad_employer) {
297 $up = date('m/d/Y h:i:s', time());; 296 $up = date('m/d/Y h:i:s', time());;
298 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 297 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
299 $vac_emp->updated_at = $up; 298 $vac_emp->updated_at = $up;
300 $vac_emp->save(); 299 $vac_emp->save();
301 300
302 return redirect()->route('employer.vacancy_list'); 301 return redirect()->route('employer.vacancy_list');
303 // начало конца 302 // начало конца
304 } 303 }
305 304
306 //Видимость вакансии 305 //Видимость вакансии
307 public function vacancy_eye(Ad_employer $ad_employer, $status) { 306 public function vacancy_eye(Ad_employer $ad_employer, $status) {
308 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 307 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
309 $vac_emp->active_is = $status; 308 $vac_emp->active_is = $status;
310 $vac_emp->save(); 309 $vac_emp->save();
311 310
312 return redirect()->route('employer.vacancy_list'); 311 return redirect()->route('employer.vacancy_list');
313 } 312 }
314 313
315 //Вакансия редактирования (шаблон) 314 //Вакансия редактирования (шаблон)
316 public function vacancy_update(Ad_employer $id) { 315 public function vacancy_update(Ad_employer $id) {
317 316
318 } 317 }
319 318
320 //Отклики на вакансию - лист 319 //Отклики на вакансию - лист
321 public function answers(Employer $employer, Request $request) { 320 public function answers(Employer $employer, Request $request) {
322 $user_id = Auth()->user()->id; 321 $user_id = Auth()->user()->id;
323 $answer = Ad_employer::query()->where('employer_id', $employer->id); 322 $answer = Ad_employer::query()->where('employer_id', $employer->id);
324 if ($request->has('search')) { 323 if ($request->has('search')) {
325 $search = trim($request->get('search')); 324 $search = trim($request->get('search'));
326 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); 325 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%");
327 } 326 }
328 327
329 $answer = $answer->with('response')->OrderByDESC('id')->get(); 328 $answer = $answer->with('response')->OrderByDESC('id')->get();
330 329
331 return view('employers.list_answer', compact('answer', 'user_id', 'employer')); 330 return view('employers.list_answer', compact('answer', 'user_id', 'employer'));
332 } 331 }
333 332
334 //Обновление статуса 333 //Обновление статуса
335 public function supple_status(employer $employer, ad_response $ad_response, $flag) { 334 public function supple_status(employer $employer, ad_response $ad_response, $flag) {
336 $ad_response->update(Array('flag' => $flag)); 335 $ad_response->update(Array('flag' => $flag));
337 return redirect()->route('employer.answers', ['employer' => $employer->id]); 336 return redirect()->route('employer.answers', ['employer' => $employer->id]);
338 } 337 }
339 338
340 //Страницы сообщений список 339 //Страницы сообщений список
341 public function messages($type_message) { 340 public function messages($type_message) {
342 $user_id = Auth()->user()->id; 341 $user_id = Auth()->user()->id;
343 342
344 $messages_input = Message::query()->with('vacancies')->with('user_from')-> 343 $messages_input = Message::query()->with('vacancies')->with('user_from')->
345 Where('to_user_id', $user_id)->OrderByDesc('created_at'); 344 Where('to_user_id', $user_id)->OrderByDesc('created_at');
346 345
347 $messages_output = Message::query()->with('vacancies')-> 346 $messages_output = Message::query()->with('vacancies')->
348 with('user_to')->where('user_id', $user_id)-> 347 with('user_to')->where('user_id', $user_id)->
349 OrderByDesc('created_at'); 348 OrderByDesc('created_at');
350 349
351 $count_input = $messages_input->count(); 350 $count_input = $messages_input->count();
352 $count_output = $messages_output->count(); 351 $count_output = $messages_output->count();
353 352
354 if ($type_message == 'input') { 353 if ($type_message == 'input') {
355 $messages = $messages_input->paginate(5); 354 $messages = $messages_input->paginate(5);
356 } 355 }
357 356
358 if ($type_message == 'output') { 357 if ($type_message == 'output') {
359 $messages = $messages_output->paginate(5); 358 $messages = $messages_output->paginate(5);
360 } 359 }
361 360
362 //dd($user_id, $messages[2]->vacancies); 361 //dd($user_id, $messages[2]->vacancies);
363 //jobs); 362 //jobs);
364 363
365 return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); 364 return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id'));
366 } 365 }
367 366
368 // Диалог между пользователями 367 // Диалог между пользователями
369 public function dialog(Request $request, User_Model $user1, User_Model $user2) { 368 public function dialog(Request $request, User_Model $user1, User_Model $user2) {
370 // Получение параметров. 369 // Получение параметров.
371 if ($request->has('ad_employer')){ 370 if ($request->has('ad_employer')){
372 $ad_employer = $request->get('ad_employer'); 371 $ad_employer = $request->get('ad_employer');
373 } else { 372 } else {
374 $ad_employer = 0; 373 $ad_employer = 0;
375 } 374 }
376 375
377 if (isset($user2->id)) { 376 if (isset($user2->id)) {
378 $companion = User_Model::query()->with('workers')-> 377 $companion = User_Model::query()->with('workers')->
379 with('employers')-> 378 with('employers')->
380 where('id', $user2->id)->first(); 379 where('id', $user2->id)->first();
381 } 380 }
382 381
383 $Messages = Message::query()-> 382 $Messages = Message::query()->
384 where('ad_employer_id', '=', $ad_employer)-> 383 where('ad_employer_id', '=', $ad_employer)->
385 where(function($query) use ($user1, $user2) { 384 where(function($query) use ($user1, $user2) {
386 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); 385 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id);
387 })->orWhere(function($query) use ($user1, $user2) { 386 })->orWhere(function($query) use ($user1, $user2) {
388 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); 387 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id);
389 })->where('ad_employer_id', '=', $ad_employer)->OrderBy('created_at')->get(); 388 })->where('ad_employer_id', '=', $ad_employer)->OrderBy('created_at')->get();
390 389
391 $id_vac = $Messages[$Messages->count() - 1]->ad_employer_id; 390 $id_vac = $Messages[$Messages->count() - 1]->ad_employer_id;
392 391
393 //$ad_employer = null; 392 //$ad_employer = null;
394 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); 393 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first();
395 $sender = $user1; 394 $sender = $user1;
396 395
397 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages')); 396 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages'));
398 } 397 }
399 398
400 // Регистрация работодателя 399 // Регистрация работодателя
401 public function register_employer(Request $request) { 400 public function register_employer(Request $request) {
402 $params = $request->all(); 401 $params = $request->all();
403 402
404 $rules = [ 403 $rules = [
405 //'surname' => ['required', 'string', 'max:255'], 404 //'surname' => ['required', 'string', 'max:255'],
406 //'name_man' => ['required', 'string', 'max:255'], 405 //'name_man' => ['required', 'string', 'max:255'],
407 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 406 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
408 'name_company' => ['required', 'string', 'max:255'], 407 'name_company' => ['required', 'string', 'max:255'],
409 'password' => ['required', 'string', 'min:6'], 408 'password' => ['required', 'string', 'min:6'],
410 ]; 409 ];
411 410
412 411
413 $messages = [ 412 $messages = [
414 'required' => 'Укажите обязательное поле', 413 'required' => 'Укажите обязательное поле',
415 'min' => [ 414 'min' => [
416 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 415 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
417 'integer' => 'Поле «:attribute» должно быть :min или больше', 416 'integer' => 'Поле «:attribute» должно быть :min или больше',
418 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 417 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
419 ], 418 ],
420 'max' => [ 419 'max' => [
421 'string' => 'Поле «:attribute» должно быть не больше :max символов', 420 'string' => 'Поле «:attribute» должно быть не больше :max символов',
422 'integer' => 'Поле «:attribute» должно быть :max или меньше', 421 'integer' => 'Поле «:attribute» должно быть :max или меньше',
423 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 422 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
424 ] 423 ]
425 ]; 424 ];
426 425
427 $email = $request->get('email'); 426 $email = $request->get('email');
428 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { 427 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) {
429 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); 428 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл"));
430 } 429 }
431 430
432 if ($request->get('password') !== $request->get('confirmed')){ 431 if ($request->get('password') !== $request->get('confirmed')){
433 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 432 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
434 } 433 }
435 434
436 if (strlen($request->get('password')) < 6) { 435 if (strlen($request->get('password')) < 6) {
437 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); 436 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
438 } 437 }
439 /* 438 /*
440 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); 439 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?');
441 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 440 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z',
442 'X', 'C', 'V', 'B', 'N', 'M'); 441 'X', 'C', 'V', 'B', 'N', 'M');
443 $spec_bool = false; 442 $spec_bool = false;
444 $alpha_bool = false; 443 $alpha_bool = false;
445 444
446 $haystack = $request->get('password'); 445 $haystack = $request->get('password');
447 446
448 foreach ($specsumbol as $it) { 447 foreach ($specsumbol as $it) {
449 if (strpos($haystack, $it) !== false) { 448 if (strpos($haystack, $it) !== false) {
450 $spec_bool = true; 449 $spec_bool = true;
451 } 450 }
452 } 451 }
453 452
454 foreach ($alpha as $it) { 453 foreach ($alpha as $it) {
455 if (strpos($haystack, $it) !== false) { 454 if (strpos($haystack, $it) !== false) {
456 $alpha_bool = true; 455 $alpha_bool = true;
457 } 456 }
458 } 457 }
459 458
460 if ((!$spec_bool) || (!$alpha_bool)) { 459 if ((!$spec_bool) || (!$alpha_bool)) {
461 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); 460 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?"));
462 }*/ 461 }*/
463 462
464 if (empty($request->get('surname'))) { 463 if (empty($request->get('surname'))) {
465 $params['surname'] = 'Неизвестно'; 464 $params['surname'] = 'Неизвестно';
466 } 465 }
467 if (empty($request->get('name_man'))) { 466 if (empty($request->get('name_man'))) {
468 $params['name_man'] = 'Неизвестно'; 467 $params['name_man'] = 'Неизвестно';
469 } 468 }
470 $validator = Validator::make($params, $rules, $messages); 469 $validator = Validator::make($params, $rules, $messages);
471 470
472 if ($validator->fails()) { 471 if ($validator->fails()) {
473 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 472 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
474 } else { 473 } else {
475 $user = $this->create($params); 474 $user = $this->create($params);
476 event(new Registered($user)); 475 event(new Registered($user));
477 Auth::guard()->login($user); 476 Auth::guard()->login($user);
478 } 477 }
479 478
480 if ($user) { 479 if ($user) {
481 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; 480 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));;
482 } else { 481 } else {
483 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 482 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
484 } 483 }
485 } 484 }
486 485
487 // Создание пользователя 486 // Создание пользователя
488 protected function create(array $data) 487 protected function create(array $data)
489 { 488 {
490 $Use = new User_Model(); 489 $Use = new User_Model();
491 $Code_user = $Use->create([ 490 $Code_user = $Use->create([
492 'name' => $data['surname']." ".$data['name_man'], 491 'name' => $data['surname']." ".$data['name_man'],
493 'name_man' => $data['name_man'], 492 'name_man' => $data['name_man'],
494 'surname' => $data['surname'], 493 'surname' => $data['surname'],
495 'surname2' => $data['surname2'], 494 'surname2' => $data['surname2'],
496 'subscribe_email' => $data['email'], 495 'subscribe_email' => $data['email'],
497 'email' => $data['email'], 496 'email' => $data['email'],
498 'telephone' => $data['telephone'], 497 'telephone' => $data['telephone'],
499 'is_worker' => 0, 498 'is_worker' => 0,
500 'password' => Hash::make($data['password']), 499 'password' => Hash::make($data['password']),
501 'pubpassword' => base64_encode($data['password']), 500 'pubpassword' => base64_encode($data['password']),
502 'email_verified_at' => Carbon::now() 501 'email_verified_at' => Carbon::now()
503 ]); 502 ]);
504 503
505 if ($Code_user->id > 0) { 504 if ($Code_user->id > 0) {
506 $Employer = new Employer(); 505 $Employer = new Employer();
507 $Employer->user_id = $Code_user->id; 506 $Employer->user_id = $Code_user->id;
508 $Employer->name_company = $data['name_company']; 507 $Employer->name_company = $data['name_company'];
509 $Employer->email = $data['email']; 508 $Employer->email = $data['email'];
510 $Employer->telephone = $data['telephone']; 509 $Employer->telephone = $data['telephone'];
511 $Employer->code = Tools::generator_id(10); 510 $Employer->code = Tools::generator_id(10);
512 $Employer->save(); 511 $Employer->save();
513 512
514 return $Code_user; 513 return $Code_user;
515 } 514 }
516 } 515 }
517 516
518 // Отправка сообщения от работодателя 517 // Отправка сообщения от работодателя
519 public function send_message(MessagesRequiest $request) { 518 public function send_message(MessagesRequiest $request) {
520 $params = $request->all(); 519 $params = $request->all();
521 dd($params); 520 dd($params);
522 $user1 = $params['user_id']; 521 $user1 = $params['user_id'];
523 $user2 = $params['to_user_id']; 522 $user2 = $params['to_user_id'];
524 523
525 if ($request->has('file')) { 524 if ($request->has('file')) {
526 $params['file'] = $request->file('file')->store("messages", 'public'); 525 $params['file'] = $request->file('file')->store("messages", 'public');
527 } 526 }
528 Message::create($params); 527 Message::create($params);
529 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 528 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
530 } 529 }
531 530
532 public function test123(Request $request) { 531 public function test123(Request $request) {
533 $params = $request->all(); 532 $params = $request->all();
534 $user1 = $params['user_id']; 533 $user1 = $params['user_id'];
535 $user2 = $params['to_user_id']; 534 $user2 = $params['to_user_id'];
536 $id_vacancy = $params['ad_employer_id']; 535 $id_vacancy = $params['ad_employer_id'];
537 $ad_name = $params['ad_name']; 536 $ad_name = $params['ad_name'];
538 537
539 $rules = [ 538 $rules = [
540 'text' => 'required|min:1|max:150000', 539 'text' => 'required|min:1|max:150000',
541 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' 540 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000'
542 ]; 541 ];
543 $messages = [ 542 $messages = [
544 'required' => 'Укажите обязательное поле', 543 'required' => 'Укажите обязательное поле',
545 'min' => [ 544 'min' => [
546 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 545 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
547 'integer' => 'Поле «:attribute» должно быть :min или больше', 546 'integer' => 'Поле «:attribute» должно быть :min или больше',
548 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 547 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
549 ], 548 ],
550 'max' => [ 549 'max' => [
551 'string' => 'Поле «:attribute» должно быть не больше :max символов', 550 'string' => 'Поле «:attribute» должно быть не больше :max символов',
552 'integer' => 'Поле «:attribute» должно быть :max или меньше', 551 'integer' => 'Поле «:attribute» должно быть :max или меньше',
553 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 552 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
554 ] 553 ]
555 ]; 554 ];
556 555
557 $validator = Validator::make($request->all(), $rules, $messages); 556 $validator = Validator::make($request->all(), $rules, $messages);
558 557
559 if ($validator->fails()) { 558 if ($validator->fails()) {
560 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) 559 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2])
561 ->withErrors($validator); 560 ->withErrors($validator);
562 } else { 561 } else {
563 if ($request->has('file')) { 562 if ($request->has('file')) {
564 $params['file'] = $request->file('file')->store("messages", 'public'); 563 $params['file'] = $request->file('file')->store("messages", 'public');
565 } 564 }
566 Message::create($params); 565 Message::create($params);
567 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 566 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
568 return redirect()->route('employer.dialog', 567 return redirect()->route('employer.dialog',
569 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]); 568 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]);
570 569
571 } 570 }
572 } 571 }
573 572
574 //Избранные люди 573 //Избранные люди
575 public function favorites(Request $request) { 574 public function favorites(Request $request) {
576 $IP_address = RusDate::ip_addr_client(); 575 $IP_address = RusDate::ip_addr_client();
577 $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); 576 $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get();
578 577
579 if ($Arr->count()) { 578 if ($Arr->count()) {
580 $A = Array(); 579 $A = Array();
581 foreach ($Arr as $it) { 580 foreach ($Arr as $it) {
582 $A[] = $it->code_record; 581 $A[] = $it->code_record;
583 } 582 }
584 583
585 $Workers = Worker::query()->whereIn('id', $A); 584 $Workers = Worker::query()->whereIn('id', $A);
586 } else { 585 } else {
587 $Workers = Worker::query()->where('id', '=', '0'); 586 $Workers = Worker::query()->where('id', '=', '0');
588 } 587 }
589 588
590 if (($request->has('search')) && (!empty($request->get('search')))) { 589 if (($request->has('search')) && (!empty($request->get('search')))) {
591 $search = $request->get('search'); 590 $search = $request->get('search');
592 591
593 $Workers = $Workers->WhereHas('users', 592 $Workers = $Workers->WhereHas('users',
594 function (Builder $query) use ($search) { 593 function (Builder $query) use ($search) {
595 $query->Where('surname', 'LIKE', "%$search%") 594 $query->Where('surname', 'LIKE', "%$search%")
596 ->orWhere('name_man', 'LIKE', "%$search%") 595 ->orWhere('name_man', 'LIKE', "%$search%")
597 ->orWhere('surname2', 'LIKE', "%$search%"); 596 ->orWhere('surname2', 'LIKE', "%$search%");
598 }); 597 });
599 } else { 598 } else {
600 $Workers = $Workers->with('users'); 599 $Workers = $Workers->with('users');
601 } 600 }
602 601
603 $Workers = $Workers->get(); 602 $Workers = $Workers->get();
604 603
605 604
606 return view('employers.favorite', compact('Workers')); 605 return view('employers.favorite', compact('Workers'));
607 } 606 }
608 607
609 // База данных 608 // База данных
610 public function bd(Request $request) { 609 public function bd(Request $request) {
611 // для типа BelongsTo 610 // для типа BelongsTo
612 //$documents = Document::query()->orderBy(Location::select('name') 611 //$documents = Document::query()->orderBy(Location::select('name')
613 // ->whereColumn('locations.id', 'documents.location_id') 612 // ->whereColumn('locations.id', 'documents.location_id')
614 //); 613 //);
615 614
616 // для типа HasOne/Many 615 // для типа HasOne/Many
617 // $documents = Document::::query()->orderBy(Location::select('name') 616 // $documents = Document::::query()->orderBy(Location::select('name')
618 // ->whereColumn('locations.document_id', 'documents.id') 617 // ->whereColumn('locations.document_id', 'documents.id')
619 //); 618 //);
620 619
621 620
622 $users = User_Model::query()->with('workers'); 621 $users = User_Model::query()->with('workers');
623 622
624 if ($request->has('search')) { 623 if ($request->has('search')) {
625 $find_key = $request->get('search'); 624 $find_key = $request->get('search');
626 $users = $users->where('name', 'LIKE', "%$find_key%") 625 $users = $users->where('name', 'LIKE', "%$find_key%")
627 ->orWhere('surname', 'LIKE', "%$find_key%") 626 ->orWhere('surname', 'LIKE', "%$find_key%")
628 ->orWhere('name_man', 'LIKE', "%$find_key%") 627 ->orWhere('name_man', 'LIKE', "%$find_key%")
629 ->orWhere('email', 'LIKE', "%$find_key%") 628 ->orWhere('email', 'LIKE', "%$find_key%")
630 ->orWhere('telephone', 'LIKE', "%$find_key%"); 629 ->orWhere('telephone', 'LIKE', "%$find_key%");
631 } 630 }
632 631
633 // Данные 632 // Данные
634 $users = $users->Baseuser()-> 633 $users = $users->Baseuser()->
635 orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id')); 634 orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id'));
636 $count_users = $users; 635 $count_users = $users;
637 $users = $users->paginate(5); 636 $users = $users->paginate(5);
638 637
639 638
640 return view('employers.bd', compact('users', 'count_users')); 639 return view('employers.bd', compact('users', 'count_users'));
641 } 640 }
642 641
643 //Настройка уведомлений 642 //Настройка уведомлений
644 public function subscribe() { 643 public function subscribe() {
645 return view('employers.subcribe'); 644 return view('employers.subcribe');
646 } 645 }
647 646
648 //Установка уведомлений сохранение 647 //Установка уведомлений сохранение
649 public function save_subscribe(Request $request) { 648 public function save_subscribe(Request $request) {
650 dd($request->all()); 649 dd($request->all());
651 $msg = $request->validate([ 650 $msg = $request->validate([
652 'subscribe_email' => 'required|email|min:5|max:255', 651 'subscribe_email' => 'required|email|min:5|max:255',
653 ]); 652 ]);
654 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); 653 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку');
655 } 654 }
656 655
657 //Сбросить форму с паролем 656 //Сбросить форму с паролем
658 public function password_reset() { 657 public function password_reset() {
659 $email = Auth()->user()->email; 658 $email = Auth()->user()->email;
660 return view('employers.password-reset', compact('email')); 659 return view('employers.password-reset', compact('email'));
661 } 660 }
662 661
663 //Обновление пароля 662 //Обновление пароля
664 public function new_password(Request $request) { 663 public function new_password(Request $request) {
665 $use = Auth()->user(); 664 $use = Auth()->user();
666 $request->validate([ 665 $request->validate([
667 'password' => 'required|string', 666 'password' => 'required|string',
668 'new_password' => 'required|string', 667 'new_password' => 'required|string',
669 'new_password2' => 'required|string' 668 'new_password2' => 'required|string'
670 ]); 669 ]);
671 670
672 if ($request->get('new_password') == $request->get('new_password2')) 671 if ($request->get('new_password') == $request->get('new_password2'))
673 if ($request->get('password') !== $request->get('new_password')) { 672 if ($request->get('password') !== $request->get('new_password')) {
674 $credentials = $request->only('email', 'password'); 673 $credentials = $request->only('email', 'password');
675 if (Auth::attempt($credentials)) { 674 if (Auth::attempt($credentials)) {
676 675
677 if (!is_null($use->email_verified_at)){ 676 if (!is_null($use->email_verified_at)){
678 677
679 $user_data = User_Model::find($use->id); 678 $user_data = User_Model::find($use->id);
680 $user_data->update([ 679 $user_data->update([
681 'password' => Hash::make($request->get('new_password')), 680 'password' => Hash::make($request->get('new_password')),
682 'pubpassword' => base64_encode($request->get('new_password')), 681 'pubpassword' => base64_encode($request->get('new_password')),
683 ]); 682 ]);
684 return redirect() 683 return redirect()
685 ->route('employer.password_reset') 684 ->route('employer.password_reset')
686 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 685 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
687 } 686 }
688 687
689 return redirect() 688 return redirect()
690 ->route('employer.password_reset') 689 ->route('employer.password_reset')
691 ->withError('Данная учетная запись не было верифицированна!'); 690 ->withError('Данная учетная запись не было верифицированна!');
692 } 691 }
693 } 692 }
694 693
695 return redirect() 694 return redirect()
696 ->route('employer.password_reset') 695 ->route('employer.password_reset')
697 ->withErrors('Не совпадение данных, обновите пароли!'); 696 ->withErrors('Не совпадение данных, обновите пароли!');
698 } 697 }
699 698
700 699
701 700
702 // Форма Удаление пипла 701 // Форма Удаление пипла
703 public function delete_people() { 702 public function delete_people() {
704 $login = Auth()->user()->email; 703 $login = Auth()->user()->email;
705 return view('employers.delete_people', compact('login')); 704 return view('employers.delete_people', compact('login'));
706 } 705 }
707 706
708 // Удаление аккаунта 707 // Удаление аккаунта
709 public function action_delete_user(Request $request) { 708 public function action_delete_user(Request $request) {
710 $Answer = $request->all(); 709 $Answer = $request->all();
711 $user_id = Auth()->user()->id; 710 $user_id = Auth()->user()->id;
712 $request->validate([ 711 $request->validate([
713 'password' => 'required|string', 712 'password' => 'required|string',
714 ]); 713 ]);
715 714
716 $credentials = $request->only('email', 'password'); 715 $credentials = $request->only('email', 'password');
717 if (Auth::attempt($credentials)) { 716 if (Auth::attempt($credentials)) {
718 Auth::logout(); 717 Auth::logout();
719 $it = User_Model::find($user_id); 718 $it = User_Model::find($user_id);
720 $it->delete(); 719 $it->delete();
721 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 720 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
722 } else { 721 } else {
723 return redirect()->route('employer.delete_people') 722 return redirect()->route('employer.delete_people')
724 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 723 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
725 } 724 }
726 } 725 }
727 726
728 public function ajax_delete_user(Request $request) { 727 public function ajax_delete_user(Request $request) {
729 $Answer = $request->all(); 728 $Answer = $request->all();
730 $user_id = Auth()->user()->id; 729 $user_id = Auth()->user()->id;
731 $request->validate([ 730 $request->validate([
732 'password' => 'required|string', 731 'password' => 'required|string',
733 ]); 732 ]);
734 $credentials = $request->only('email', 'password'); 733 $credentials = $request->only('email', 'password');
735 if (Auth::attempt($credentials)) { 734 if (Auth::attempt($credentials)) {
736 735
737 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', 736 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт',
738 'email' => $request->get('email'), 737 'email' => $request->get('email'),
739 'password' => $request->get('password'))); 738 'password' => $request->get('password')));
740 } else { 739 } else {
741 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); 740 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль'));
742 } 741 }
743 } 742 }
744 743
745 // FAQ - Вопросы/ответы для работодателей и соискателей 744 // FAQ - Вопросы/ответы для работодателей и соискателей
746 public function faq() { 745 public function faq() {
747 return view('employers.faq'); 746 return view('employers.faq');
748 } 747 }
749 748
750 // Рассылка сообщений 749 // Рассылка сообщений
751 public function send_all_messages() { 750 public function send_all_messages() {
752 $id = Auth()->user()->id; 751 $id = Auth()->user()->id;
753 $sending = Employer::query()->where('user_id', '=', "$id")->first(); 752 $sending = Employer::query()->where('user_id', '=', "$id")->first();
754 if ($sending->sending_is) 753 if ($sending->sending_is)
755 return view('employers.send_all'); 754 return view('employers.send_all');
756 else 755 else
757 return view('employers.send_all_danger'); 756 return view('employers.send_all_danger');
758 } 757 }
759 758
760 // Отправка сообщений для информации 759 // Отправка сообщений для информации
761 public function send_all_post(Request $request) { 760 public function send_all_post(Request $request) {
762 $data = $request->all(); 761 $data = $request->all();
763 762
764 $emails = User_Model::query()->where('is_worker', '1')->get(); 763 $emails = User_Model::query()->where('is_worker', '1')->get();
765 764
766 foreach ($emails as $e) { 765 foreach ($emails as $e) {
767 Mail::to($e->email)->send(new SendAllMessages($data)); 766 Mail::to($e->email)->send(new SendAllMessages($data));
768 } 767 }
769 768
770 return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); 769 return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены');
771 } 770 }
772 771
773 // База резюме 772 // База резюме
774 public function bd_tupe(Request $request) { 773 public function bd_tupe(Request $request) {
775 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); 774 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get();
776 775
777 return view('employers.bd_tupe', compact('Resume')); 776 return view('employers.bd_tupe', compact('Resume'));
778 } 777 }
779 778
780 ////////////////////////////////////////////////////////////////// 779 //////////////////////////////////////////////////////////////////
781 // Отправил сообщение 780 // Отправил сообщение
782 ////////////////////////////////////////////////////////////////// 781 //////////////////////////////////////////////////////////////////
783 public function new_message(Request $request) { 782 public function new_message(Request $request) {
784 $params = $request->all(); 783 $params = $request->all();
785 $id = $params['_user_id']; 784 $id = $params['_user_id'];
786 $message = new Message(); 785 $message = new Message();
787 $message->user_id = $params['_user_id']; 786 $message->user_id = $params['_user_id'];
788 $message->to_user_id = $params['_to_user_id']; 787 $message->to_user_id = $params['_to_user_id'];
789 $message->title = $params['title']; 788 $message->title = $params['title'];
790 $message->text = $params['text']; 789 $message->text = $params['text'];
791 if ($request->has('_file')) { 790 if ($request->has('_file')) {
792 $message->file = $request->file('_file')->store("worker/$id", 'public'); 791 $message->file = $request->file('_file')->store("worker/$id", 'public');
793 } 792 }
794 $message->ad_employer_id = $params['_vacancy']; 793 $message->ad_employer_id = $params['_vacancy'];
795 $message->flag_new = 1; 794 $message->flag_new = 1;
796 $id_message = $message->save(); 795 $id_message = $message->save();
797 796
798 //$data['message_id'] = $id_message; 797 //$data['message_id'] = $id_message;
799 //$data['ad_employer_id'] = $params['_vacancy']; 798 //$data['ad_employer_id'] = $params['_vacancy'];
800 //$data['job_title_id'] = 0; 799 //$data['job_title_id'] = 0;
801 800
802 $data['flag'] = 1; 801 $data['flag'] = 1;
803 //$ad_responce = ad_response::create($data); 802 //$ad_responce = ad_response::create($data);
804 return redirect()->route('employer.messages', ['type_message' => 'output']); 803 return redirect()->route('employer.messages', ['type_message' => 'output']);
805 } 804 }
806 805
807 // Восстановление пароля 806 // Восстановление пароля
808 public function repair_password(Request $request) { 807 public function repair_password(Request $request) {
809 $params = $request->get('email'); 808 $params = $request->get('email');
810 } 809 }
811 810
812 // Избранные люди на корабль 811 // Избранные люди на корабль
813 public function selected_people(Request $request) { 812 public function selected_people(Request $request) {
814 $id = $request->get('id'); 813 $id = $request->get('id');
815 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 814 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
816 where('is_remove', '=', '0')-> 815 where('is_remove', '=', '0')->
817 where('is_bd', '=', '0')-> 816 where('is_bd', '=', '0')->
818 where('position_id', $id)-> 817 where('position_id', $id)->
819 get(); 818 get();
resources/views/admin/users/index.blade.php
1 @extends('layout.admin', ['title' => $title]) 1 @extends('layout.admin', ['title' => $title])
2 2
3 @section('script') 3 @section('script')
4 <script> 4 <script>
5 $(document).ready(function() { 5 $(document).ready(function() {
6 $(document).on('click', '.check_click', function () { 6 $(document).on('click', '.check_click', function () {
7 var this_ = $(this); 7 var this_ = $(this);
8 var value = this_.val(); 8 var value = this_.val();
9 var field = this_.attr('data-field'); 9 var field = this_.attr('data-field');
10 var value_id = this_.attr('data-id'); 10 var value_id = this_.attr('data-id');
11 var ajax_block = $('#ajax_block'); 11 var ajax_block = $('#ajax_block');
12 var bool = 0; 12 var bool = 0;
13 var str_get = ''; 13 var str_get = '';
14 14
15 if(this.checked){ 15 if(this.checked){
16 bool = 1; 16 bool = 1;
17 } else { 17 } else {
18 bool = 0; 18 bool = 0;
19 } 19 }
20 console.log(field); 20 console.log(field);
21 str_get = "id=" + value_id + "&" + field + "=" + bool; 21 str_get = "id=" + value_id + "&" + field + "=" + bool;
22 console.log(str_get); 22 console.log(str_get);
23 23
24 $.ajax({ 24 $.ajax({
25 type: "GET", 25 type: "GET",
26 url: "{{ url()->full()}}", 26 url: "{{ url()->full()}}",
27 data: str_get, 27 data: str_get,
28 success: function (data) { 28 success: function (data) {
29 console.log('Обновление таблицы пользователей '); 29 console.log('Обновление таблицы пользователей ');
30 //data = JSON.parse(data); 30 //data = JSON.parse(data);
31 //console.log(data); 31 //console.log(data);
32 ajax_block.html(data); 32 ajax_block.html(data);
33 }, 33 },
34 headers: { 34 headers: {
35 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 35 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
36 }, 36 },
37 error: function (data) { 37 error: function (data) {
38 console.log('Error: ' + data); 38 console.log('Error: ' + data);
39 } 39 }
40 }); 40 });
41 }); 41 });
42 }); 42 });
43 </script> 43 </script>
44 @endsection 44 @endsection
45 45
46 @section('search') 46 @section('search')
47 @include('admin.find') 47 @include('admin.find')
48 @endsection 48 @endsection
49 49
50 @section('content') 50 @section('content')
51 <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> 51 <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block">
52 <div class="w-full overflow-x-auto"> 52 <div class="w-full overflow-x-auto">
53 <table class="w-full whitespace-no-wrap"> 53 <table class="w-full whitespace-no-wrap">
54 <thead> 54 <thead>
55 <tr 55 <tr
56 class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800" 56 class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800"
57 > 57 >
58 <th class="px-4 py-3 text-xs">№</th> 58 <th class="px-4 py-3 text-xs">№</th>
59 <th class="px-4 py-3 text-xs">Имя</th> 59 <th class="px-4 py-3 text-xs">Имя</th>
60 <th class="px-4 py-3 text-xs">Email/логин</th> 60 <th class="px-4 py-3 text-xs">Email/логин</th>
61 <th class="px-4 py-3 text-xs">Работодатель/работник/администратор</th> 61 <th class="px-4 py-3 text-xs">Работодатель/работник/администратор</th>
62 <th class="px-4 py-3 text-xs">Админ</th> 62 <th class="px-4 py-3 text-xs">Админ</th>
63 <th class="px-4 py-3 text-xs">Менеджер</th> 63 <th class="px-4 py-3 text-xs">Менеджер</th>
64 <th class="px-4 py-3 text-xs">Дата регист.</th> 64 <th class="px-4 py-3 text-xs">Дата регист.</th>
65 <th class="px-4 py-3 text-xs">Удаление</th>
65 </tr> 66 </tr>
66 </thead> 67 </thead>
67 <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> 68 <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800">
68 @foreach($users as $user) 69 @foreach($users as $user)
69 <tr class="text-gray-700 dark:text-gray-400"> 70 <tr class="text-gray-700 dark:text-gray-400">
70 <td class="px-4 py-3 text-xs"> 71 <td class="px-4 py-3 text-xs">
71 {{$user->id}} 72 {{$user->id}}
72 </td> 73 </td>
73 <td class="px-4 py-3 text-xs"> 74 <td class="px-4 py-3 text-xs">
74 <a style="text-decoration: underline;" href="{{ route('admin.user-profile', ['user' => $user->id]) }}">{{ $user->name }}</a> 75 <a style="text-decoration: underline;" href="{{ route('admin.user-profile', ['user' => $user->id]) }}">{{ $user->name }}</a>
75 </td> 76 </td>
76 <td class="px-4 py-3 text-xs"> 77 <td class="px-4 py-3 text-xs">
77 {{ $user->email }} 78 {{ $user->email }}
78 </td> 79 </td>
79 <td class="px-4 py-3 text-xs"> 80 <td class="px-4 py-3 text-xs">
80 <span class="px-2 py-1 font-semibold leading-tight text-green-700 bg-green-100 rounded-full dark:bg-green-700 dark:text-green-100"> 81 <span class="px-2 py-1 font-semibold leading-tight text-green-700 bg-green-100 rounded-full dark:bg-green-700 dark:text-green-100">
81 @if ($user->is_worker) 82 @if ($user->is_worker)
82 Работник 83 Работник
83 @else 84 @else
84 Работодатель 85 Работодатель
85 @endif 86 @endif
86 </span> 87 </span>
87 @if ($user->admin) 88 @if ($user->admin)
88 <span class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:text-white dark:bg-orange-600"> 89 <span class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:text-white dark:bg-orange-600">
89 Администратор 90 Администратор
90 </span> 91 </span>
91 @endif 92 @endif
92 @if ($user->is_bd) 93 @if ($user->is_bd)
93 <span class="px-2 py-1 font-semibold leading-tight text-red-700 bg-red-100 rounded-full dark:text-red-100 dark:bg-red-700"> 94 <span class="px-2 py-1 font-semibold leading-tight text-red-700 bg-red-100 rounded-full dark:text-red-100 dark:bg-red-700">
94 База данных 95 База данных
95 </span> 96 </span>
96 @endif 97 @endif
97 </td> 98 </td>
98 99
99 <td class="px-4 py-3 text-xs"> 100 <td class="px-4 py-3 text-xs">
100 @if ($user->id > 1) 101 @if ($user->id > 1)
101 <input type="checkbox" class="check_click" data-id="{{$user->id}}" data-field="admin" name="admin_{{$user->id}}" {{ ($user->admin) ? "checked" : "" }}/> 102 <input type="checkbox" class="check_click" data-id="{{$user->id}}" data-field="admin" name="admin_{{$user->id}}" {{ ($user->admin) ? "checked" : "" }}/>
102 @endif 103 @endif
103 </td> 104 </td>
104 105
105 <td class="px-4 py-3 text-xs"> 106 <td class="px-4 py-3 text-xs">
106 @if ($user->id > 1) 107 @if ($user->id > 1)
107 <input type="checkbox" class="check_click" data-id="{{$user->id}}" data-field="is_manager" name="manager_{{$user->id}}" {{ ($user->is_manager) ? "checked" : "" }}/> 108 <input type="checkbox" class="check_click" data-id="{{$user->id}}" data-field="is_manager" name="manager_{{$user->id}}" {{ ($user->is_manager) ? "checked" : "" }}/>
108 @endif 109 @endif
109 </td> 110 </td>
110 111
111 <td class="px-4 py-3 text-xs"> 112 <td class="px-4 py-3 text-xs">
112 {{ date('d.m.Y', strtotime($user->created_at)) }} 113 {{ date('d.m.Y', strtotime($user->created_at)) }}
113 </td> 114 </td>
115
116 <td class="px-4 py-3 text-xs">
117 <a href="{{ route('admin.user_delete', ['user' => $user->id]) }}">Del</a>
118 </td>
114 </tr> 119 </tr>
115 @endforeach 120 @endforeach
116 </tbody> 121 </tbody>
117 </table> 122 </table>
118 </div> 123 </div>
119 124
120 <div class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800"> 125 <div class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800">
121 {{ $users->links('admin.pagginate') }} 126 {{ $users->links('admin.pagginate') }}
122 </div> 127 </div>
123 128
124 129
125 <!--<div 130 <!--<div
126 class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800" 131 class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800"
127 > 132 >
128 <span class="flex items-center col-span-3"> 133 <span class="flex items-center col-span-3">
129 Showing 21-30 of 100 134 Showing 21-30 of 100
130 </span> 135 </span>
131 <span class="col-span-2"></span> 136 <span class="col-span-2"></span>
132 137
133 <span class="flex col-span-4 mt-2 sm:mt-auto sm:justify-end"> 138 <span class="flex col-span-4 mt-2 sm:mt-auto sm:justify-end">
134 <nav aria-label="Table navigation"> 139 <nav aria-label="Table navigation">
135 <ul class="inline-flex items-center"> 140 <ul class="inline-flex items-center">
136 <li> 141 <li>
137 <button 142 <button
138 class="px-3 py-1 rounded-md rounded-l-lg focus:outline-none focus:shadow-outline-purple" 143 class="px-3 py-1 rounded-md rounded-l-lg focus:outline-none focus:shadow-outline-purple"
139 aria-label="Previous" 144 aria-label="Previous"
140 > 145 >
141 <svg 146 <svg
142 aria-hidden="true" 147 aria-hidden="true"
143 class="w-4 h-4 fill-current" 148 class="w-4 h-4 fill-current"
144 viewBox="0 0 20 20" 149 viewBox="0 0 20 20"
145 > 150 >
146 <path 151 <path
147 d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" 152 d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"
148 clip-rule="evenodd" 153 clip-rule="evenodd"
149 fill-rule="evenodd" 154 fill-rule="evenodd"
150 ></path> 155 ></path>
151 </svg> 156 </svg>
152 </button> 157 </button>
153 </li> 158 </li>
154 <li> 159 <li>
155 <button 160 <button
156 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" 161 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
157 > 162 >
158 1 163 1
159 </button> 164 </button>
160 </li> 165 </li>
161 <li> 166 <li>
162 <button 167 <button
163 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" 168 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
164 > 169 >
165 2 170 2
166 </button> 171 </button>
167 </li> 172 </li>
168 <li> 173 <li>
169 <button 174 <button
170 class="px-3 py-1 text-white transition-colors duration-150 bg-purple-600 border border-r-0 border-purple-600 rounded-md focus:outline-none focus:shadow-outline-purple" 175 class="px-3 py-1 text-white transition-colors duration-150 bg-purple-600 border border-r-0 border-purple-600 rounded-md focus:outline-none focus:shadow-outline-purple"
171 > 176 >
172 3 177 3
173 </button> 178 </button>
174 </li> 179 </li>
175 <li> 180 <li>
176 <button 181 <button
177 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" 182 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
178 > 183 >
179 4 184 4
180 </button> 185 </button>
181 </li> 186 </li>
182 <li> 187 <li>
183 <span class="px-3 py-1">...</span> 188 <span class="px-3 py-1">...</span>
184 </li> 189 </li>
185 <li> 190 <li>
186 <button 191 <button
187 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" 192 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
188 > 193 >
189 8 194 8
190 </button> 195 </button>
191 </li> 196 </li>
192 <li> 197 <li>
193 <button 198 <button
194 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" 199 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
195 > 200 >
196 9 201 9
197 </button> 202 </button>
198 </li> 203 </li>
199 <li> 204 <li>
200 <button 205 <button
201 class="px-3 py-1 rounded-md rounded-r-lg focus:outline-none focus:shadow-outline-purple" 206 class="px-3 py-1 rounded-md rounded-r-lg focus:outline-none focus:shadow-outline-purple"
202 aria-label="Next" 207 aria-label="Next"
203 > 208 >
204 <svg 209 <svg
205 class="w-4 h-4 fill-current" 210 class="w-4 h-4 fill-current"
206 aria-hidden="true" 211 aria-hidden="true"
207 viewBox="0 0 20 20" 212 viewBox="0 0 20 20"
208 > 213 >
209 <path 214 <path
210 d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" 215 d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
211 clip-rule="evenodd" 216 clip-rule="evenodd"
212 fill-rule="evenodd" 217 fill-rule="evenodd"
213 ></path> 218 ></path>
214 </svg> 219 </svg>
215 </button> 220 </button>
216 </li> 221 </li>
217 </ul> 222 </ul>
218 </nav> 223 </nav>
219 </span> 224 </span>
220 </div>--> 225 </div>-->
221 </div> 226 </div>
222 227
223 <?//=$users->appends($_GET)->links('catalogs.paginate'); ?> 228 <?//=$users->appends($_GET)->links('catalogs.paginate'); ?>
224 229
225 230
226 @endsection 231 @endsection
227 232
resources/views/employers/edit_vacancy.blade.php
1 @extends('layout.frontend', ['title' => 'Редактирование вакансии РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Редактирование вакансии РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 console.log('Приближаемся к системе, нас рой тут...'); 5 console.log('Приближаемся к системе, нас рой тут...');
6 $(document).on('change', '#position_id', function() { 6 $(document).on('change', '#position_id', function() {
7 var this_ = $(this); 7 var this_ = $(this);
8 var val_ = this_.val(); 8 var val_ = this_.val();
9 var ajax_ = $('#job_title_id'); 9 var ajax_ = $('#job_title_id');
10 10
11 console.log('Создания списка людей, которые поднимутся на корабль...'); 11 console.log('Создания списка людей, которые поднимутся на корабль...');
12 12
13 $.ajax({ 13 $.ajax({
14 type: "GET", 14 type: "GET",
15 url: "{{ route('employer.selected_people') }}", 15 url: "{{ route('employer.selected_people') }}",
16 data: "id="+val_, 16 data: "id="+val_,
17 success: function (data) { 17 success: function (data) {
18 console.log('Ответка пришла'); 18 console.log('Ответка пришла');
19 console.log('Список избранных людей создан'); 19 console.log('Список избранных людей создан');
20 ajax_.html(data); 20 ajax_.html(data);
21 }, 21 },
22 headers: { 22 headers: {
23 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 23 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
24 }, 24 },
25 error: function (data) { 25 error: function (data) {
26 console.log('Обрыв связи'); 26 console.log('Обрыв связи');
27 console.log('Error: ' + data); 27 console.log('Error: ' + data);
28 } 28 }
29 }); 29 });
30 }); 30 });
31 </script> 31 </script>
32 @endsection 32 @endsection
33 @section('content') 33 @section('content')
34 <section class="cabinet"> 34 <section class="cabinet">
35 <div class="container"> 35 <div class="container">
36 <ul class="breadcrumbs cabinet__breadcrumbs"> 36 <ul class="breadcrumbs cabinet__breadcrumbs">
37 <li><a href="{{ route('index') }}">Главная</a></li> 37 <li><a href="{{ route('index') }}">Главная</a></li>
38 <li><b>Личный кабинет</b></li> 38 <li><b>Личный кабинет</b></li>
39 </ul> 39 </ul>
40 <div class="cabinet__wrapper"> 40 <div class="cabinet__wrapper">
41 <div class="cabinet__side"> 41 <div class="cabinet__side">
42 <div class="cabinet__side-toper"> 42 <div class="cabinet__side-toper">
43 43
44 @include('employers.emblema') 44 @include('employers.emblema')
45 45
46 </div> 46 </div>
47 47
48 @include('employers.menu', ['item' => 3]) 48 @include('employers.menu', ['item' => 3])
49 49
50 </div> 50 </div>
51 51
52 <form class="cabinet__body" action="{{ route('employer.vacancy_save_me', ['ad_employer' => $Employer->id]) }}" method="POST"> 52 <form class="cabinet__body" action="{{ route('employer.vacancy_save_me', ['ad_employer' => $Employer->id]) }}" method="POST">
53 @csrf 53 @csrf
54 <input type="hidden" name="employer_id" value="{{ $Employer->id }}"/> 54 <input type="hidden" name="employer_id" value="{{ $Employer->id }}"/>
55 <div class="cabinet__body-item"> 55 <div class="cabinet__body-item">
56 <div class="cabinet__descr"> 56 <div class="cabinet__descr">
57 <h2 class="title cabinet__title">Редактировать вакансию</h2> 57 <h2 class="title cabinet__title">Редактировать вакансию</h2>
58 <p class="cabinet__text"><b>Данные по вакансии</b></p> 58 <p class="cabinet__text"><b>Данные по вакансии</b></p>
59 <p class="cabinet__text">Все поля обязательны для заполнения *</p> 59 <p class="cabinet__text">Все поля обязательны для заполнения *</p>
60 </div> 60 </div>
61 </div> 61 </div>
62 <div class="cabinet__body-item"> 62 <div class="cabinet__body-item">
63 <h4>Поля для вакансии</h4> 63 <h4>Поля для вакансии</h4>
64 <div class="cabinet__inputs"> 64 <div class="cabinet__inputs">
65 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 65 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
66 <label class="form-group__label">Название вакансии</label> 66 <label class="form-group__label">Название вакансии</label>
67 <div class="form-group__item"> 67 <div class="form-group__item">
68 <input type="text" class="input" name="name" id="name" placeholder="Работа в море" value="{{ old('name') ?? $ad_employer->name ?? '' }}" required> 68 <input type="text" class="input" name="name" id="name" placeholder="Работа в море" value="{{ old('name') ?? $ad_employer->name ?? '' }}" required>
69 @error('name') 69 @error('name')
70 <span class="text-xs text-red-600 dark:text-red-400"> 70 <span class="text-xs text-red-600 dark:text-red-400">
71 {{ $message }} 71 {{ $message }}
72 </span> 72 </span>
73 @enderror 73 @enderror
74 </div> 74 </div>
75 </div> 75 </div>
76 76
77 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none"> 77 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none">
78 <label class="form-group__label">Телефон</label> 78 <label class="form-group__label">Телефон</label>
79 <div class="form-group__item"> 79 <div class="form-group__item">
80 <input type="text" class="input" name="telephone" id="telephone" value="{{ old('telephone') ?? $ad_employer->telephone ?? '' }}" placeholder="Свой телефон"> 80 <input type="text" class="input" name="telephone" id="telephone" value="{{ old('telephone') ?? $ad_employer->telephone ?? '' }}" placeholder="Свой телефон">
81 @error('telephone') 81 @error('telephone')
82 <span class="text-xs text-red-600 dark:text-red-400"> 82 <span class="text-xs text-red-600 dark:text-red-400">
83 {{ $message }} 83 {{ $message }}
84 </span> 84 </span>
85 @enderror 85 @enderror
86 </div> 86 </div>
87 </div> 87 </div>
88 88
89 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none"> 89 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none">
90 <label class="form-group__label">Емайл</label> 90 <label class="form-group__label">Емайл</label>
91 <div class="form-group__item"> 91 <div class="form-group__item">
92 <input type="text" class="input" name="email" id="email" value="{{ old('email') ?? $ad_employer->email ?? '' }}" placeholder="Своя почту"> 92 <input type="text" class="input" name="email" id="email" value="{{ old('email') ?? $ad_employer->email ?? '' }}" placeholder="Своя почту">
93 @error('email') 93 @error('email')
94 <span class="text-xs text-red-600 dark:text-red-400"> 94 <span class="text-xs text-red-600 dark:text-red-400">
95 {{ $message }} 95 {{ $message }}
96 </span> 96 </span>
97 @enderror 97 @enderror
98 </div> 98 </div>
99 </div> 99 </div>
100 100
101 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none"> 101 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none">
102 <label class="form-group__label">Зарплата среднестатистическая для вакансии</label> 102 <label class="form-group__label">Зарплата среднестатистическая для вакансии</label>
103 <div class="form-group__item"> 103 <div class="form-group__item">
104 <input type="text" class="input" name="salary" id="salary" value="{{ old('salary') ?? $ad_employer->salary ??'' }}" placeholder="Среднестатистическая зарплата"> 104 <input type="text" class="input" name="salary" id="salary" value="{{ old('salary') ?? $ad_employer->salary ??'' }}" placeholder="Среднестатистическая зарплата">
105 @error('salary') 105 @error('salary')
106 <span class="text-xs text-red-600 dark:text-red-400"> 106 <span class="text-xs text-red-600 dark:text-red-400">
107 {{ $message }} 107 {{ $message }}
108 </span> 108 </span>
109 @enderror 109 @enderror
110 </div> 110 </div>
111 </div> 111 </div>
112 112
113 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 113 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display: none">
114 <label class="form-group__label">Город посадки</label> 114 <label class="form-group__label">Город посадки</label>
115 <div class="form-group__item"> 115 <div class="form-group__item">
116 <input type="text" class="input" name="city" id="city" value="{{ old('city') ?? $ad_employer->city ?? '' }}" placeholder="Севастополь"> 116 <input type="text" class="input" name="city" id="city" value="{{ old('city') ?? $ad_employer->city ?? 'Не указан' }}" placeholder="Севастополь">
117 @error('city') 117 @error('city')
118 <span class="text-xs text-red-600"> 118 <span class="text-xs text-red-600">
119 {{ $message }} 119 {{ $message }}
120 </span> 120 </span>
121 @enderror 121 @enderror
122 </div> 122 </div>
123 </div> 123 </div>
124 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style=""> 124 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="">
125 <label class="form-group__label">Категория (локация)</label> 125 <label class="form-group__label">Категория (локация)</label>
126 <div class="form-group__item"> 126 <div class="form-group__item">
127 <div class="select"> 127 <div class="select">
128 <select class="js-select2" name="category_id" id="category_id"> 128 <select class="js-select2" name="category_id" id="category_id">
129 php $i = 1 endphp 129 php $i = 1 endphp
130 if ($Positions->count()) 130 if ($Positions->count())
131 foreach($Positions as $j) 131 foreach($Positions as $j)
132 if ($i == 1) <option> Выберите категорию из списка</option> 132 if ($i == 1) <option> Выберите категорию из списка</option>
133 else 133 else
134 <option value=" $j->id }}" if ($ad_employer->category_id == $j->id) selected endif>$j->name }}</option> 134 <option value=" $j->id }}" if ($ad_employer->category_id == $j->id) selected endif>$j->name }}</option>
135 endif 135 endif
136 php $i++ endphp 136 php $i++ endphp
137 endforeach 137 endforeach
138 endif 138 endif
139 </select> 139 </select>
140 error('category_id') 140 error('category_id')
141 <span class="text-xs text-red-600 dark:text-red-400"> 141 <span class="text-xs text-red-600 dark:text-red-400">
142 $message }} 142 $message }}
143 </span> 143 </span>
144 enderror 144 enderror
145 </div> 145 </div>
146 </div> 146 </div>
147 </div>--> 147 </div>-->
148 148
149 <!--foreach ($ad_employer->jobs_code as $it_um)
150 <pre> print_r($it_um) }}</pre>
151 endforeach-->
152 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
153 <label class="form-group__label">Редактирование должностей</label>
154 <div class="form-group__item">
155 <div class="select">
156 <select class="js-select2" name="job_title_id[]" id="job_title_id[]" multiple="multiple">
157 @php $i = 1 @endphp
158 @if ($jobs->count())
159 @foreach($jobs as $it)
160 @php $selected = false; @endphp
161 @foreach ($ad_employer->jobs_code as $it_um)
162 @if (isset($it_um->job_title_id))
163 @if ($it_um->job_title_id == $it->id))
164 @php $selected = true; @endphp
165 @endif
166 @endif
167 @endforeach
168 <option value="{{ $it->id }}" @if ($selected) selected @endif>{{ $it->name }}</option>
169 @endforeach
170 @endif
171 </select>
172 </div>
173 </div>
174 </div>
175
149 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 176 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
150 <label class="form-group__label">Описание вакансии</label> 177 <label class="form-group__label">Описание вакансии</label>
151 <div class="form-group__item"> 178 <div class="form-group__item">
152 <textarea class="textarea ckeditor" name="text" id="text">{{ old('text') ?? $ad_employer->text ?? '' }}</textarea> 179 <textarea class="textarea ckeditor" name="text" id="text">{{ old('text') ?? $ad_employer->text ?? '' }}</textarea>
153 @error('text') 180 @error('text')
154 <span class="text-xs text-red-600"> 181 <span class="text-xs text-red-600">
155 {{ $message }} 182 {{ $message }}
156 </span> 183 </span>
157 @enderror 184 @enderror
158 </div> 185 </div>
159 </div> 186 </div>
160 187
161 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 188 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
162 <h4 class="form-group__label">Редактирование должностей</h4> 189 <h4 class="form-group__label">Редактирование должностей</h4>
163 <div class="form-group__item"> 190 <div class="form-group__item">
164 <a href="{{ route('employer.add_job_in_vac', ['ad_employer' => $ad_employer->id]) }}" class="button">Добавить</a> 191 <a href=" route('employer.add_job_in_vac', ['ad_employer' => $ad_employer->id]) }}" class="button">Добавить</a>
165 192
166 @if ($ad_employer->jobs->count()) 193 if ($ad_employer->jobs->count())
167 @foreach ($ad_employer->jobs as $key => $it_um) 194 foreach ($ad_employer->jobs as $key => $it_um)
168 <p>@if (isset($ad_employer->jobs_code[$key])) 195 <p>if (isset($ad_employer->jobs_code[$key]))
169 <a href="{{ route('employer.edit_job_in_vac', ['ad_job' => $ad_employer->jobs_code[$key]->id, 'ad_employer' => $ad_employer->id, 'job_title_id' => $it_um->id]) }}" style="text-decoration: underline">{{$it_um->name}}</a> 196 <a href=" route('employer.edit_job_in_vac', ['ad_job' => $ad_employer->jobs_code[$key]->id, 'ad_employer' => $ad_employer->id, 'job_title_id' => $it_um->id]) }}" style="text-decoration: underline">$it_um->name}}</a>
170 <a href="{{ route('employer.delete_job_in_vac', ['ad_job' => $ad_employer->jobs_code[$key]->id]) }}" style="text-decoration: underline">(Del)</a> 197 <a href=" route('employer.delete_job_in_vac', ['ad_job' => $ad_employer->jobs_code[$key]->id]) }}" style="text-decoration: underline">(Del)</a>
171 @endif 198 endif
172 </p> 199 </p>
173 @endforeach 200 endforeach
174 @else 201 else
175 Нет связанных <br> с вакансией должностей 202 Нет связанных <br> с вакансией должностей
176 @endif 203 endif
177 </div> 204 </div>
178 </div> 205 </div>-->
179 </div> 206 </div>
180 207
181 <a class="button cabinet__submit" href="{{ route('employer.vacancy_list') }}">Назад</a> 208 <a class="button cabinet__submit" href="{{ route('employer.vacancy_list') }}">Назад</a>
182 <button type="submit" class="button cabinet__submit">Опубликовать</button> 209 <button type="submit" class="button cabinet__submit">Опубликовать</button>
183 </div> 210 </div>
184 </form> 211 </form>
185 </div> 212 </div>
186 </div> 213 </div>
187 </section> 214 </section>
188 </div> 215 </div>
189 <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script> 216 <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>
190 <script> 217 <script>
191 CKEDITOR.replace('text'); 218 CKEDITOR.replace('text');
192 //CKEDITOR.replace( 'text', { 219 //CKEDITOR.replace( 'text', {
193 // filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", 220 // filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
194 // filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", 221 // filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
195 // filebrowserUploadMethod: 'form' 222 // filebrowserUploadMethod: 'form'
196 // }); 223 // });
197 </script> 224 </script>
198 @endsection 225 @endsection
199 226
resources/views/info_company_new.blade.php
1 @extends('layout.frontend', ['title' => 'Описание компании '.$title.'- РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Описание компании '.$title.'- РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 console.log('Test system'); 5 console.log('Test system');
6 $(document).on('change', '#sort_ajax', function() { 6 $(document).on('change', '#sort_ajax', function() {
7 var this_ = $(this); 7 var this_ = $(this);
8 var val_ = this_.val(); 8 var val_ = this_.val();
9 console.log('sort items '+val_); 9 console.log('sort items '+val_);
10 10
11 $.ajax({ 11 $.ajax({
12 type: "GET", 12 type: "GET",
13 url: "{{ route('shipping_companies') }}", 13 url: "{{ route('shipping_companies') }}",
14 data: "sort="+val_+"&block=1", 14 data: "sort="+val_+"&block=1",
15 success: function (data) { 15 success: function (data) {
16 console.log('Выбор сортировки'); 16 console.log('Выбор сортировки');
17 console.log(data); 17 console.log(data);
18 $('#block_1').html(data); 18 $('#block_1').html(data);
19 }, 19 },
20 headers: { 20 headers: {
21 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 21 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
22 }, 22 },
23 error: function (data) { 23 error: function (data) {
24 data = JSON.stringify(data); 24 data = JSON.stringify(data);
25 console.log('Error: ' + data); 25 console.log('Error: ' + data);
26 } 26 }
27 }); 27 });
28 28
29 $.ajax({ 29 $.ajax({
30 type: "GET", 30 type: "GET",
31 url: "{{ route('shipping_companies') }}", 31 url: "{{ route('shipping_companies') }}",
32 data: "sort="+val_+"&block=2", 32 data: "sort="+val_+"&block=2",
33 success: function (data) { 33 success: function (data) {
34 console.log('Выбор сортировки2'); 34 console.log('Выбор сортировки2');
35 console.log(data); 35 console.log(data);
36 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 36 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
37 $('#block_2').html(data); 37 $('#block_2').html(data);
38 }, 38 },
39 headers: { 39 headers: {
40 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 40 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
41 }, 41 },
42 error: function (data) { 42 error: function (data) {
43 data = JSON.stringify(data); 43 data = JSON.stringify(data);
44 console.log('Error: ' + data); 44 console.log('Error: ' + data);
45 } 45 }
46 }); 46 });
47 }); 47 });
48 48
49 $(document).ready(function(){ 49 $(document).ready(function(){
50 var sel = $('#select2-sort_ajax-container'); 50 var sel = $('#select2-sort_ajax-container');
51 var key = getUrlParameter('sort'); 51 var key = getUrlParameter('sort');
52 if (key !=='') { 52 if (key !=='') {
53 console.log(key); 53 console.log(key);
54 switch (key) { 54 switch (key) {
55 case "default": sel.html('Сортировка (по умолчанию)'); break; 55 case "default": sel.html('Сортировка (по умолчанию)'); break;
56 case "name_up": sel.html('По имени (возрастание)'); break; 56 case "name_up": sel.html('По имени (возрастание)'); break;
57 case "name_down": sel.html('По дате (убывание)'); break; 57 case "name_down": sel.html('По дате (убывание)'); break;
58 case "created_at_up": sel.html('По дате (возрастание)'); break; 58 case "created_at_up": sel.html('По дате (возрастание)'); break;
59 case "created_at_down": sel.html('По дате (убывание)'); break; 59 case "created_at_down": sel.html('По дате (убывание)'); break;
60 } 60 }
61 61
62 } 62 }
63 }); 63 });
64 64
65 //end 65 //end
66 $(document).on('click', '.js_send_it_button', function() { 66 $(document).on('click', '.js_send_it_button', function() {
67 var this_ = $(this); 67 var this_ = $(this);
68 var code_user_id = this_.attr('data-uid'); 68 var code_user_id = this_.attr('data-uid');
69 var code_to_user_id = this_.attr('data-tuid'); 69 var code_to_user_id = this_.attr('data-tuid');
70 var code_vacancy = this_.attr('data-vacancy'); 70 var code_vacancy = this_.attr('data-vacancy');
71 var user_id = $('#send_user_id'); 71 var user_id = $('#send_user_id');
72 var to_user_id = $('#send_to_user_id'); 72 var to_user_id = $('#send_to_user_id');
73 var vacancy = $('#send_vacancy'); 73 var vacancy = $('#send_vacancy');
74 74
75 console.log('Клик на кнопки...'); 75 console.log('Клик на кнопки...');
76 76
77 user_id.val(code_user_id); 77 user_id.val(code_user_id);
78 to_user_id.val(code_to_user_id); 78 to_user_id.val(code_to_user_id);
79 vacancy.val(code_vacancy); 79 vacancy.val(code_vacancy);
80 }); 80 });
81 </script> 81 </script>
82 @endsection 82 @endsection
83 83
84 @section('content') 84 @section('content')
85 <section class="thing"> 85 <section class="thing">
86 <div class="container"> 86 <div class="container">
87 <div class="thing__body"> 87 <div class="thing__body">
88 <ul class="breadcrumbs thing__breadcrumbs"> 88 <ul class="breadcrumbs thing__breadcrumbs">
89 <li><a href="{{ route('index') }}">Главная</a></li> 89 <li><a href="{{ route('index') }}">Главная</a></li>
90 <li><a href="{{ route('shipping_companies') }}">Работодатели</a></li> 90 <li><a href="{{ route('shipping_companies') }}">Работодатели</a></li>
91 <li><b>@isset($title) {{ $title }} @else Не указано @endif</b></li> 91 <li><b>@isset($title) {{ $title }} @else Не указано @endif</b></li>
92 </ul> 92 </ul>
93 @if ($company[0]->oficial_status == 1) 93 @if ($company[0]->oficial_status == 1)
94 <div class="thing__badge"> 94 <div class="thing__badge">
95 <svg> 95 <svg>
96 <use xlink:href="{{ asset('images/sprite.svg#badge') }}"></use> 96 <use xlink:href="{{ asset('images/sprite.svg#badge') }}"></use>
97 </svg> 97 </svg>
98 Компания проверена 98 Компания проверена
99 </div> 99 </div>
100 @endif 100 @endif
101 101
102 @if (!empty($company[0]->logo)) 102 @if (!empty($company[0]->logo))
103 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $company[0]->name_company }}" class="thing__pic"> 103 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $company[0]->name_company }}" class="thing__pic">
104 @else 104 @else
105 <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $company[0]->name_company }}" class="thing__pic"> 105 <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $company[0]->name_company }}" class="thing__pic">
106 @endif 106 @endif
107 107
108 <h1 class="thing__title">{{ $company[0]->name_company }}</h1> 108 <h1 class="thing__title">{{ $company[0]->name_company }}</h1>
109 <!--<p class="thing__text"> $company[0]->text !!}</p>--> 109 <!--<p class="thing__text"> $company[0]->text !!}</p>-->
110 <div class="thing__buttons"> 110 <div class="thing__buttons">
111 <button type="button" class="button"> 111 <button type="button" class="button">
112 <svg> 112 <svg>
113 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use> 113 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use>
114 </svg> 114 </svg>
115 {{ $company[0]->ads->count() }} вакансии 115 {{ $company[0]->ads->count() }} вакансии
116 </button> 116 </button>
117 @if ($user_id == 0) 117 @if ($user_id == 0)
118 <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button"> 118 <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button">
119 Написать сообщение 119 Написать сообщение
120 </a> 120 </a>
121 @else 121 @else
122 <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button"> 122 <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button">
123 Написать сообщение 123 Написать сообщение
124 </a> 124 </a>
125 @endif 125 @endif
126 </div> 126 </div>
127 </div> 127 </div>
128 </div> 128 </div>
129 </section> 129 </section>
130 <main class="main"> 130 <main class="main">
131 <div class="container"> 131 <div class="container">
132 <div class="main__employer-page"> 132 <div class="main__employer-page">
133 <h2 class="main__employer-page-title">О компании</h2> 133 <h2 class="main__employer-page-title">О компании</h2>
134 <div class="main__employer-page-info"> 134 <div class="main__employer-page-info">
135 <div class="main__employer-page-item"> 135 <div class="main__employer-page-item">
136 <b>Адрес компании</b> 136 <b>Адрес компании</b>
137 <span> 137 <span>
138 {{ $company[0]->address }} 138 {{ $company[0]->address }}
139 </span> 139 </span>
140 </div> 140 </div>
141 <div class="main__employer-page-item"> 141 <div class="main__employer-page-item">
142 <b>Сайт</b> 142 <b>Сайт</b>
143 <span> 143 <span>
144 <a href="{{ $company[0]->site }}">{{ $company[0]->site }}</a> 144 <a href="{{ $company[0]->site }}">{{ $company[0]->site }}</a>
145 </span> 145 </span>
146 </div> 146 </div>
147 <div class="main__employer-page-item"> 147 <div class="main__employer-page-item">
148 <b>Почта</b> 148 <b>Почта</b>
149 <span> 149 <span>
150 <a href="mailto:">{{ $company[0]->email }}</a> 150 <a href="mailto:">{{ $company[0]->email }}</a>
151 </span> 151 </span>
152 </div> 152 </div>
153 <div class="main__employer-page-item"> 153 <div class="main__employer-page-item">
154 <b>Телефон</b> 154 <b>Телефон</b>
155 <span> 155 <span>
156 <a href="tel:{{ $company[0]->telephone }}">{{ $company[0]->telephone }}</a> 156 <a href="tel:{{ $company[0]->telephone }}">{{ $company[0]->telephone }}</a>
157 </span> 157 </span>
158 </div> 158 </div>
159 </div> 159 </div>
160 160
161 <div class="main__employer-page-item"> 161 <div class="main__employer-page-item">
162 <b>Описание</b> 162 <b>Описание</b>
163 <span> 163 <span>
164 {!! $company[0]->text !!} 164 {!! $company[0]->text !!}
165 </span> 165 </span>
166 </div> 166 </div>
167 167
168 <div> 168 <div>
169 169
170 <div class="main__employer-page-tabs"> 170 <div class="main__employer-page-tabs">
171 <button type="button" class="main__employer-page-tabs-item active" 171 <button type="button" class="main__employer-page-tabs-item active"
172 data-tab="1">Флот</button> 172 data-tab="1">Флот</button>
173 <button type="button" class="main__employer-page-tabs-item" data-tab="2">Вакансии</button> 173 <button type="button" class="main__employer-page-tabs-item" data-tab="2">Вакансии</button>
174 </div> 174 </div>
175 175
176 <div class="main__employer-page-body"> 176 <div class="main__employer-page-body">
177 <div class="main__employer-page-body-item showed" data-body="1"> 177 <div class="main__employer-page-body-item showed" data-body="1">
178 <div class="main__employer-page-one"> 178 <div class="main__employer-page-one">
179 @if ($company[0]->flots->count()) 179 @if ($company[0]->flots->count())
180 @foreach ($company[0]->flots as $flot) 180 @foreach ($company[0]->flots as $flot)
181 <a href="" class="main__employer-page-one-item"> 181 <a href="" class="main__employer-page-one-item">
182 @if (!empty($flot->image)) 182 @if (!empty($flot->image))
183 <img src="{{ asset(Storage::url($flot->image)) }}" alt="{{ $flot->name }}"> 183 <img src="{{ asset(Storage::url($flot->image)) }}" alt="{{ $flot->name }}">
184 @else 184 @else
185 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $flot->name }}"> 185 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $flot->name }}">
186 @endif 186 @endif
187 <b>{{ $flot->name }}</b> 187 <b>{{ $flot->name }}</b>
188 <b>{{ $flot->region }}</b> 188 <b>{{ $flot->region }}</b>
189 <span><i>DWT</i> {{ $flot->DWT }}</span> 189 <span><i>DWT</i> {{ $flot->DWT }}</span>
190 <span><i>Мощность ГД</i> {{ $flot->POWER_GD }}</span> 190 <span><i>Мощность ГД</i> {{ $flot->POWER_GD }}</span>
191 <span><i>IMO</i> {{ $flot->IMO }}</span> 191 <span><i>IMO</i> {{ $flot->IMO }}</span>
192 <span>{{ $flot->power }}</span> 192 <span>{{ $flot->power }}</span>
193 </a> 193 </a>
194 @endforeach 194 @endforeach
195 @endif 195 @endif
196 </div> 196 </div>
197 </div> 197 </div>
198 198
199 <div class="main__employer-page-body-item" data-body="2"> 199 <div class="main__employer-page-body-item" data-body="2">
200 <div class="main__employer-page-two"> 200 <div class="main__employer-page-two">
201 @foreach ($company[0]->ads as $job) 201 @foreach ($ads as $job)
202 @foreach ($job->ad_job as $item)
203 <div class="main__employer-page-two-item"> 202 <div class="main__employer-page-two-item">
204 <div class="main__employer-page-two-item-toper"> 203 <div class="main__employer-page-two-item-toper">
205 @if (!empty($company[0]->logo)) 204 @if (!empty($company[0]->logo))
206 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $job->name }}"> 205 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $job->name }}">
207 @else 206 @else
208 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $job->name }}"> 207 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $job->name }}">
209 @endif 208 @endif
210 <span>{{ $job->name }}</span> 209 <span>{{ $job->name }}</span>
210 <!--<span>Описание:
211 $job->text !!}
212 </span>-->
211 </div> 213 </div>
212 <div class="main__employer-page-two-item-title">{{ $item->flot }}</div> 214 <!--<div class="main__employer-page-two-item-title"> $item->flot }}</div>-->
213 <div class="main__employer-page-two-item-text"> 215 <div class="main__employer-page-two-item-text">
214 <div class="main__employer-page-two-item-text-name"> 216 @if ((isset($job->jobs)) && ($job->jobs->count()))
215 {{ $item->job_title->name }} 217 @foreach($job->jobs as $item)
216 </div> 218 <a class="main__employer-page-two-item-text-name">
217 <div class="main__employer-page-two-item-text-body"> 219 {{ $item->name }}
218 <p>Зарплата:{{ $item->min_salary }} - {{ $item->max_salary }}р + {{ $item->sytki }} суточные.</p> 220 </a>
219 <p>Контракт: {{ $item->period }} мес.</p> 221 @endforeach
220 </div> 222 @endif
223 <!--<div class="main__employer-page-two-item-text-body">
224 <p>Зарплата: $item->min_salary }} - $item->max_salary }}р + $item->sytki }} суточные.</p>
225 <p>Контракт: $item->period }} мес.</p>
226 </div>-->
221 </div> 227 </div>
222 <div class="main__employer-page-two-item-text"> 228 <!--<div class="main__employer-page-two-item-text">
223 <div class="main__employer-page-two-item-text-name">Район работы</div> 229 <div class="main__employer-page-two-item-text-name">Район работы</div>
224 <div class="main__employer-page-two-item-text-body"> 230 <div class="main__employer-page-two-item-text-body">
225 <p>{{ $item->region }}</p> 231 <p> $item->region }}</p>
226 </div> 232 </div>
227 </div> 233 </div>
228 <div class="main__employer-page-two-item-text"> 234 <div class="main__employer-page-two-item-text">
229 <div class="main__employer-page-two-item-text-name">Посадка</div> 235 <div class="main__employer-page-two-item-text-name">Посадка</div>
230 <div class="main__employer-page-two-item-text-body"> 236 <div class="main__employer-page-two-item-text-body">
231 <p> {{ $item->start }}</p> 237 <p> $item->start }}</p>
232 {!! $item->description !!} 238 !! $item->description !!}
233 </div> 239 </div>
234 </div> 240 </div>-->
235 <div class="main__employer-page-two-item-text"> 241 <div class="main__employer-page-two-item-text">
236 <div class="main__employer-page-two-item-text-name">Звонить по вопросам на: 242 <div class="main__employer-page-two-item-text-name">Звонить по вопросам на:
237 </div> 243 </div>
238 <div class="main__employer-page-two-item-text-body"> 244 <div class="main__employer-page-two-item-text-body">
239 <a href="tel:{{ $job->telephone }}">{{ $job->telephone }}</a> 245 <a href="tel:{{ $job->telephone }}">{{ $job->telephone }}</a>
240 </div> 246 </div>
241 </div> 247 </div>
242 <div class="main__employer-page-two-item-text"> 248 <div class="main__employer-page-two-item-text">
243 <div class="main__employer-page-two-item-text-name">Анкеты присылать на 249 <div class="main__employer-page-two-item-text-name">Анкеты присылать на
244 почту: 250 почту:
245 </div> 251 </div>
246 <div class="main__employer-page-two-item-text-body"> 252 <div class="main__employer-page-two-item-text-body">
247 <a href="mailto: {{ $job->email }}">{{ $job->email }}</a> 253 <a href="mailto: {{ $job->email }}">{{ $job->email }}</a>
248 </div> 254 </div>
249 </div> 255 </div>
256 @if ((isset($job->jobs)) && ($job->jobs->count()))
250 <div class="main__employer-page-two-item-tags"> 257 <div class="main__employer-page-two-item-tags">
251 <span class="main__employer-page-two-item-tag">#{{ $item->job_title->name }}</span> 258 @foreach ($job->jobs as $item)
259 <span class="main__employer-page-two-item-tag">#{{ $item->name }}</span>
260 @endforeach
252 </div> 261 </div>
262 @endif
253 <div class="main__employer-page-two-item-buttons"> 263 <div class="main__employer-page-two-item-buttons">
254 264
255 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $item->job_title->id }}" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}' 265 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $job->id }}" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}'
256 class="button main__employer-page-two-item-button js_send_it_button">Оставить 266 class="button main__employer-page-two-item-button js_send_it_button">Оставить
257 отклик...</button> 267 отклик...</button>
258 268
259 <!--<a href="#" 269 <!--<a href="#"
260 class="button button_light main__employer-page-two-item-button">Подробнее</a>--> 270 class="button button_light main__employer-page-two-item-button">Подробнее</a>-->
261 </div> 271 </div>
262 <div class="main__employer-page-two-item-bottom"> 272 <div class="main__employer-page-two-item-bottom">
263 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($job->updated_at)) }}</div> 273 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($job->updated_at)) }}</div>
264 <button type="button" 274 <button type="button"
265 class="like main__employer-page-two-item-bottom-like js-toggle"> 275 class="like main__employer-page-two-item-bottom-like js-toggle">
266 <svg> 276 <svg>
267 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 277 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
268 </svg> 278 </svg>
269 </button> 279 </button>
270 </div> 280 </div>
271 </div> 281 </div>
272 @endforeach
273 @endforeach 282 @endforeach
283
284 <div style="margin-top: 20px">
285 {{ $ads->onEachSide(0)->appends($_GET)->links('paginate') }}
286 </div>
274 <!--<button type="button" class="button button_light button_more main__employer-page-two-more js-toggle js-parent-toggle"> 287 <!--<button type="button" class="button button_light button_more main__employer-page-two-more js-toggle js-parent-toggle">
275 <span>Показать ещё</span> 288 <span>Показать ещё</span>
276 <span>Скрыть</span> 289 <span>Скрыть</span>
277 </button>--> 290 </button>-->
278 </div> 291 </div>
279 </div> 292 </div>
280 </div> 293 </div>
281 </div> 294 </div>
282 </div> 295 </div>
283 </div> 296 </div>
284 </main> 297 </main>
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 Route::get('user-delete/{user}', [UsersController::class, 'user_delete'])->name('user_delete');
201 202
202 // кабинет - пользователи 203 // кабинет - пользователи
203 Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); 204 Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users');
204 205
205 // кабинет - работодатели 206 // кабинет - работодатели
206 Route::get('employers', [EmployersController::class, 'index'])->name('employers'); 207 Route::get('employers', [EmployersController::class, 'index'])->name('employers');
207 208
208 Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); 209 Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer');
209 210
210 Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add'); 211 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'); 212 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'); 213 Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot');
213 Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit'); 214 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'); 215 Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete');
215 216
216 // кабинет - соискатели 217 // кабинет - соискатели
217 Route::get('workers', [WorkersController::class, 'index'])->name('workers'); 218 Route::get('workers', [WorkersController::class, 'index'])->name('workers');
218 219
219 // кабинет - база данных 220 // кабинет - база данных
220 Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); 221 Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata');
221 Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); 222 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'); 223 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'); 224 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'); 225 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'); 226 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'); 227 Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata');
227 228
228 // кабинет - вакансии 229 // кабинет - вакансии
229 Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); 230 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'); 231 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'); 232 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'); 233 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'); 234 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'); 235 Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer');
235 236
236 // Редактирование должности в вакансии 237 // Редактирование должности в вакансии
237 Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs'); 238 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'); 239 Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs');
239 240
240 241
241 // кабинет - категории 242 // кабинет - категории
242 //Route::get('categories', [AdminController::class, 'index'])->name('categories'); 243 //Route::get('categories', [AdminController::class, 'index'])->name('categories');
243 244
244 // СRUD-операции над Справочником Категории 245 // СRUD-операции над Справочником Категории
245 246
246 Route::resource('categories', CategoryController::class, ['except' => ['show']]); 247 Route::resource('categories', CategoryController::class, ['except' => ['show']]);
247 248
248 // CRUD-операции над справочником Категории для работодателей 249 // CRUD-операции над справочником Категории для работодателей
249 Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); 250 Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]);
250 251
251 // CRUD-операции над справочником Образование 252 // CRUD-операции над справочником Образование
252 Route::resource('education', EducationController::class, ['except' => ['show']]); 253 Route::resource('education', EducationController::class, ['except' => ['show']]);
253 254
254 Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education'); 255 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'); 256 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'); 257 Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education');
257 258
258 Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); 259 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'); 260 Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education');
260 261
261 Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); 262 Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education');
262 263
263 //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); 264 //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles');
264 /* 265 /*
265 * кабинет - CRUD-операции по справочнику должности 266 * кабинет - CRUD-операции по справочнику должности
266 * 267 *
267 */ 268 */
268 Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); 269 Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]);
269 270
270 // кабинет - сообщения (чтение чужих) 271 // кабинет - сообщения (чтение чужих)
271 Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); 272 Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages');
272 // кабинет - просмотр сообщения чужого (чтение) 273 // кабинет - просмотр сообщения чужого (чтение)
273 Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); 274 Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message');
274 275
275 // кабинет - сообщения (админские) 276 // кабинет - сообщения (админские)
276 Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); 277 Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages');
277 // кабинет - сообщения (админские) 278 // кабинет - сообщения (админские)
278 Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); 279 Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post');
279 // кабинет - sql - конструкция запросов 280 // кабинет - sql - конструкция запросов
280 Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); 281 Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql');
281 282
282 /* 283 /*
283 * Расписанный подход в описании каждой директорий групп пользователей. 284 * Расписанный подход в описании каждой директорий групп пользователей.
284 */ 285 */
285 // кабинет - группы пользователей 286 // кабинет - группы пользователей
286 Route::get('groups', [GroupsController::class, 'index'])->name('groups'); 287 Route::get('groups', [GroupsController::class, 'index'])->name('groups');
287 // кабинет - добавление форма группы пользователей 288 // кабинет - добавление форма группы пользователей
288 Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); 289 Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group');
289 // кабинет - сохранение формы группы пользователей 290 // кабинет - сохранение формы группы пользователей
290 Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); 291 Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store');
291 // кабинет - редактирование форма группы пользователей 292 // кабинет - редактирование форма группы пользователей
292 Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); 293 Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group');
293 // кабинет - сохранение редактированной формы группы пользователей 294 // кабинет - сохранение редактированной формы группы пользователей
294 Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); 295 Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group');
295 // кабинет - удаление группы пользователей 296 // кабинет - удаление группы пользователей
296 Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); 297 Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group');
297 298
298 299
299 // кабинет - список админов 300 // кабинет - список админов
300 Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); 301 Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin');
301 302
302 // справочник Позиции 303 // справочник Позиции
303 Route::get('positions', [AdminController::class, 'position'])->name('position'); 304 Route::get('positions', [AdminController::class, 'position'])->name('position');
304 Route::get('positions/add', [AdminController::class, 'position_add'])->name('add-position'); 305 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'); 306 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'); 307 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'); 308 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'); 309 Route::get('position/delete/{position}', [AdminController::class, 'position_delete'])->name('delete-position');
309 310
310 /////редактор////// кабинет - редактор сайта//////////////////////// 311 /////редактор////// кабинет - редактор сайта////////////////////////
311 Route::get('editor-site', function() { 312 Route::get('editor-site', function() {
312 return view('admin.editor.index'); 313 return view('admin.editor.index');
313 })->name('editor-site'); 314 })->name('editor-site');
314 315
315 316
316 // кабинет - редактор шапки-футера сайта 317 // кабинет - редактор шапки-футера сайта
317 Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); 318 Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks');
318 Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); 319 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'); 320 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'); 321 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'); 322 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'); 323 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'); 324 Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block');
324 325
325 326
326 // кабинет - редактор должности на главной 327 // кабинет - редактор должности на главной
327 Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); 328 Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main');
328 329
329 // кабинет - редактор работодатели на главной 330 // кабинет - редактор работодатели на главной
330 Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); 331 Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main');
331 332
332 333
333 // кабинет - редактор seo-сайта 334 // кабинет - редактор seo-сайта
334 Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); 335 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'); 336 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'); 337 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'); 338 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'); 339 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'); 340 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'); 341 Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo');
341 342
342 343
343 // кабинет - редактор страниц 344 // кабинет - редактор страниц
344 Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); 345 Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages');
345 // кабинет - добавление страницы 346 // кабинет - добавление страницы
346 Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); 347 Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page');
347 // кабинет - сохранение формы страницы 348 // кабинет - сохранение формы страницы
348 Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); 349 Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store');
349 // кабинет - редактирование форма страницы 350 // кабинет - редактирование форма страницы
350 Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); 351 Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page');
351 // кабинет - сохранение редактированной формы страницы 352 // кабинет - сохранение редактированной формы страницы
352 Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); 353 Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page');
353 // кабинет - удаление страницы 354 // кабинет - удаление страницы
354 Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); 355 Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page');
355 356
356 357
357 // кабинет - реклама сайта 358 // кабинет - реклама сайта
358 Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); 359 Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames');
359 Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); 360 Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames');
360 Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); 361 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'); 362 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'); 363 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'); 364 Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames');
364 //////////////////////////////////////////////////////////////////////// 365 ////////////////////////////////////////////////////////////////////////
365 366
366 367
367 // кабинет - отзывы о работодателе для модерации 368 // кабинет - отзывы о работодателе для модерации
368 Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); 369 Route::get('answers', [EmployersController::class, 'answers'])->name('answers');
369 370
370 // Общая страница статистики 371 // Общая страница статистики
371 Route::get('statics', function () { 372 Route::get('statics', function () {
372 return view('admin.static.index'); 373 return view('admin.static.index');
373 })->name('statics'); 374 })->name('statics');
374 375
375 // кабинет - статистика работников 376 // кабинет - статистика работников
376 Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); 377 Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers');
377 378
378 // кабинет - статистика вакансий работодателя 379 // кабинет - статистика вакансий работодателя
379 Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); 380 Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads');
380 381
381 // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника 382 // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника
382 /* 383 /*
383 * CRUD-операции над справочником дипломы и документы 384 * CRUD-операции над справочником дипломы и документы
384 */ 385 */
385 //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); 386 //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks');
386 Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); 387 Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]);
387 388
388 // кабинет - роли пользователя 389 // кабинет - роли пользователя
389 Route::get('roles', [UsersController::class, 'roles'])->name('roles'); 390 Route::get('roles', [UsersController::class, 'roles'])->name('roles');
390 391
391 Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles'); 392 Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles');
392 393
393 Route::get('logs', function() { 394 Route::get('logs', function() {
394 $files = Storage::files('logs/laravel.log'); 395 $files = Storage::files('logs/laravel.log');
395 })->name('logs'); 396 })->name('logs');
396 }); 397 });
397 398
398 // Инструментальные страницы 399 // Инструментальные страницы
399 Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); 400 Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload');
400 401
401 Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); 402 Route::get('redis/', [PagesController::class, 'redis'])->name('redis');
402 403
403 Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); 404 Route::get('excel/', [PagesController::class, 'excel'])->name('excel');
404 405
405 // Страницы с произвольным контентом 406 // Страницы с произвольным контентом
406 Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); 407 Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page');
407 408
408 // Форма обратной связи 409 // Форма обратной связи
409 Route::post('form_feedback', [PagesController::class, 'form_feedback'])->name('form_feedback'); 410 Route::post('form_feedback', [PagesController::class, 'form_feedback'])->name('form_feedback');
410 411
411 // Публичные страницы соискателя 412 // Публичные страницы соискателя
412 Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); 413 Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page');
413 414
414 //Страница вакансии 415 //Страница вакансии
415 Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); 416 Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer');
416 417
417 //Вакансии 418 //Вакансии
418 Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies'); 419 Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies');
419 420
420 //Вакансии поиск на главной 421 //Вакансии поиск на главной
421 Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies'); 422 Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies');
422 423
423 //Вакансии категория детальная 424 //Вакансии категория детальная
424 Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies'); 425 Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies');
425 426
426 // Лайк вакансии 427 // Лайк вакансии
427 Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy'); 428 Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy');
428 429
429 //Детальная страница вакансии - работодателя 430 //Детальная страница вакансии - работодателя
430 Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie'); 431 Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie');
431 432
432 //Судоходные компании 433 //Судоходные компании
433 Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies'); 434 Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies');
434 435
435 //Детальная инфа о компании 436 //Детальная инфа о компании
436 Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company'); 437 Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company');
437 438
438 //Образование 439 //Образование
439 Route::get('education', [MainController::class, 'education'])->name('education'); 440 Route::get('education', [MainController::class, 'education'])->name('education');
440 441
441 //Новости 442 //Новости
442 Route::get('news', [MainController::class, 'news'])->name('news'); 443 Route::get('news', [MainController::class, 'news'])->name('news');
443 Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new'); 444 Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new');
444 445
445 //Контакты 446 //Контакты
446 Route::get('contacts', [MainController::class, 'contacts'])->name('contacts'); 447 Route::get('contacts', [MainController::class, 'contacts'])->name('contacts');
447 448
448 //База резюме 449 //База резюме
449 Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume'); 450 Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume');
450 Route::get('bd_resume_danger', function(){ 451 Route::get('bd_resume_danger', function(){
451 return view('employers.bd_resume_danger'); 452 return view('employers.bd_resume_danger');
452 })->name('bd_resume_danger'); 453 })->name('bd_resume_danger');
453 454
454 Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume'); 455 Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume');
455 456
456 //Анкета соискателя 457 //Анкета соискателя
457 Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile'); 458 Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile');
458 459
459 //Скачать резюме 460 //Скачать резюме
460 Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download'); 461 Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download');
461 Route::get('resume-download/all', [WorkerController::class, 'resume_download_all'])->name('resume_download_all2'); 462 Route::get('resume-download/all', [WorkerController::class, 'resume_download_all'])->name('resume_download_all2');
462 Route::get('resume-download', [WorkerController::class, 'resume_download_all'])->name('resume_download_all'); 463 Route::get('resume-download', [WorkerController::class, 'resume_download_all'])->name('resume_download_all');
463 464
464 465
465 //Вход в кабинет 466 //Вход в кабинет
466 Route::get('login', [MainController::class, 'input_login'])->name('login'); 467 Route::get('login', [MainController::class, 'input_login'])->name('login');
467 468
468 // Выход из кабинета 469 // Выход из кабинета
469 Route::get('logout', [EmployerController::class, 'logout'])->name('logout'); 470 Route::get('logout', [EmployerController::class, 'logout'])->name('logout');
470 471
471 Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker'); 472 Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker');
472 Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer'); 473 Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer');
473 474
474 //восстановление пароля 475 //восстановление пароля
475 Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password'); 476 Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password');
476 // Звезда сообщения 477 // Звезда сообщения
477 Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer'); 478 Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer');
478 479
479 // Борьба 480 // Борьба
480 Route::get('clear_cookie', function() { 481 Route::get('clear_cookie', function() {
481 \App\Classes\Cookies_vacancy::clear_vacancy(); 482 \App\Classes\Cookies_vacancy::clear_vacancy();
482 return redirect()->route('index'); 483 return redirect()->route('index');
483 })->name('clear_cookie'); 484 })->name('clear_cookie');
484 485
485 Route::get('cookies', function() { 486 Route::get('cookies', function() {
486 return view('cookies'); 487 return view('cookies');
487 })->name('cookies'); 488 })->name('cookies');
488 489
489 // Личный кабинет работник 490 // Личный кабинет работник
490 Route::group([ 491 Route::group([
491 'as' => 'worker.', // имя маршрута, например auth.index 492 'as' => 'worker.', // имя маршрута, например auth.index
492 'prefix' => 'worker', // префикс маршрута, например auth/index 493 'prefix' => 'worker', // префикс маршрута, например auth/index
493 'middleware' => ['auth'], ['is_worker'], 494 'middleware' => ['auth'], ['is_worker'],
494 ], function() { 495 ], function() {
495 // 1 страница - Моя анкета 496 // 1 страница - Моя анкета
496 Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); 497 Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet');
497 Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); 498 Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save');
498 499
499 // 2 страница - Сообщения 500 // 2 страница - Сообщения
500 Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); 501 Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages');
501 Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog'); 502 Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog');
502 // 3 страница - Избранные вакансии 503 // 3 страница - Избранные вакансии
503 Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); 504 Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite');
504 // Продолжение борьбы против колорадов - избранные вакансии 505 // Продолжение борьбы против колорадов - избранные вакансии
505 Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); 506 Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado');
506 507
507 // 4 страница - Сменить пароль 508 // 4 страница - Сменить пароль
508 Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); 509 Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password');
509 Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password'); 510 Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password');
510 511
511 // 5 страница - Удалить профиль 512 // 5 страница - Удалить профиль
512 Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); 513 Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile');
513 Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); 514 Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result');
514 515
515 // Резюме -pdf 516 // Резюме -pdf
516 Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); 517 Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download');
517 518
518 // Поднятие анкеты 519 // Поднятие анкеты
519 Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); 520 Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up');
520 521
521 Route::post('test123', [WorkerController::class, 'test123'])->name('test123'); 522 Route::post('test123', [WorkerController::class, 'test123'])->name('test123');
522 523
523 // Добавление сертификата 524 // Добавление сертификата
524 Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate'); 525 Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate');
525 Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); 526 Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate');
526 Route::get('кабинет/edit_sertificate/{worker}/{doc}', [WorkerController::class, 'edit_sertificate'])->name('edit_sertificate'); 527 Route::get('кабинет/edit_sertificate/{worker}/{doc}', [WorkerController::class, 'edit_sertificate'])->name('edit_sertificate');
527 Route::get('кабинет/edit_sertificate/{doc}', [WorkerController::class, 'update_serificate'])->name('update_serificate'); 528 Route::get('кабинет/edit_sertificate/{doc}', [WorkerController::class, 'update_serificate'])->name('update_serificate');
528 Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); 529 Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate');
529 530
530 // Добавление предыдущих контактов компании 531 // Добавление предыдущих контактов компании
531 Route::get('кабинет/prev_company/{worker}', [WorkerController::class, 'new_prev_company'])->name('new_prev_company'); 532 Route::get('кабинет/prev_company/{worker}', [WorkerController::class, 'new_prev_company'])->name('new_prev_company');
532 Route::get('кабинет/add_prev_company', [WorkerController::class, 'add_prev_company'])->name('add_prev_company'); 533 Route::get('кабинет/add_prev_company', [WorkerController::class, 'add_prev_company'])->name('add_prev_company');
533 Route::get('кабинет/edit_prev_company/{doc}/{worker}', [WorkerController::class, 'edit_prev_company'])->name('edit_prev_company'); 534 Route::get('кабинет/edit_prev_company/{doc}/{worker}', [WorkerController::class, 'edit_prev_company'])->name('edit_prev_company');
534 Route::post('кабинет/update_prev_company/{doc}', [WorkerController::class, 'update_prev_company'])->name('update_prev_company'); 535 Route::post('кабинет/update_prev_company/{doc}', [WorkerController::class, 'update_prev_company'])->name('update_prev_company');
535 Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company'); 536 Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company');
536 537
537 // Добавление документа-диплома 538 // Добавление документа-диплома
538 Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); 539 Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom');
539 Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); 540 Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save');
540 Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom'); 541 Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom');
541 542
542 // Добавление стандартного диплома 543 // Добавление стандартного диплома
543 Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); 544 Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document');
544 Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); 545 Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save');
545 Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); 546 Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document');
546 Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); 547 Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save');
547 Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); 548 Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document');
548 549
549 // Отправка сообщения работодателю от соискателя 550 // Отправка сообщения работодателю от соискателя
550 Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message'); 551 Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message');
551 }); 552 });
552 553
553 // Личный кабинет работодателя 554 // Личный кабинет работодателя
554 Route::group([ 555 Route::group([
555 'as' => 'employer.', // имя маршрута, например auth.index 556 'as' => 'employer.', // имя маршрута, например auth.index
556 'prefix' => 'employer', // префикс маршрута, например auth/index 557 'prefix' => 'employer', // префикс маршрута, например auth/index
557 'middleware' => ['auth'], !['is_worker'], 558 'middleware' => ['auth'], !['is_worker'],
558 ], function() { 559 ], function() {
559 // 0 страница - Личные данные работодателя 560 // 0 страница - Личные данные работодателя
560 Route::get('cabinet/employer_info', [EmployerController::class, 'employer_info'])->name('employer_info'); 561 Route::get('cabinet/employer_info', [EmployerController::class, 'employer_info'])->name('employer_info');
561 Route::post('cabinet/employer_info/{user}', [EmployerController::class, 'employer_info_save'])->name('employer_info_save'); 562 Route::post('cabinet/employer_info/{user}', [EmployerController::class, 'employer_info_save'])->name('employer_info_save');
562 563
563 // 1 страница - Профиль 564 // 1 страница - Профиль
564 Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); 565 Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet');
565 Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); 566 Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save');
566 Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); 567 Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot');
567 Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); 568 Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot');
568 Route::get('cabinet/flot_edit/{Flot}/{Employer}', [EmployerController::class, 'edit_flot'])->name('edit_flot'); 569 Route::get('cabinet/flot_edit/{Flot}/{Employer}', [EmployerController::class, 'edit_flot'])->name('edit_flot');
569 Route::post('cabinet/flot_edit/{Flot}', [EmployerController::class, 'update_flot'])->name('update_flot_save'); 570 Route::post('cabinet/flot_edit/{Flot}', [EmployerController::class, 'update_flot'])->name('update_flot_save');
570 Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot'); 571 Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot');
571 572
572 // 2 страница - Добавление вакансий 573 // 2 страница - Добавление вакансий
573 Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); 574 Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie');
574 Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); 575 Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save');
575 Route::get('cabinet/vacancie_danger', [EmployerController::class, 'cabinet_vacancie_danger'])->name('cabinet_vacancie_danger'); 576 Route::get('cabinet/vacancie_danger', [EmployerController::class, 'cabinet_vacancie_danger'])->name('cabinet_vacancie_danger');
576 577
577 578
578 Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); 579 Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people');
579 580
580 // 3 страница - Мои вакансии 581 // 3 страница - Мои вакансии
581 Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); 582 Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list');
582 Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); 583 Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit');
583 Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); 584 Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete');
584 Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); 585 Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up');
585 Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); 586 Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye');
586 Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); 587 Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit');
587 Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); 588 Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me');
588 589
589 // 4.1Ю. 590 // 4.1Ю.
590 Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac'); 591 Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac');
591 Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save'); 592 Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save');
592 Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac'); 593 Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac');
593 Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save'); 594 Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save');
594 Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac'); 595 Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac');
595 596
596 // 4 страница - Отклики на вакансии 597 // 4 страница - Отклики на вакансии
597 Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); 598 Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers');
598 Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); 599 Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple');
599 Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); 600 Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg');
600 601
601 // 5 страница - Сообщения 602 // 5 страница - Сообщения
602 Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); 603 Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages');
603 Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); 604 Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog');
604 Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); 605 Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message');
605 Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); 606 Route::post('test123', [EmployerController::class, 'test123'])->name('test123');
606 607
607 // 6 страница - Избранный 608 // 6 страница - Избранный
608 Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); 609 Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites');
609 610
610 //7 страница - База данных 611 //7 страница - База данных
611 Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); 612 Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd');
612 613
613 //8 страница - База резюме 614 //8 страница - База резюме
614 Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); 615 Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe');
615 616
616 // 9 рассылка сообщений 617 // 9 рассылка сообщений
617 Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); 618 Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages');
618 Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); 619 Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post');
619 620
620 // 10 страница FAQ вопросы 621 // 10 страница FAQ вопросы
621 Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq'); 622 Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq');
622 623
623 // 11 страница - Настройка уведомлений 624 // 11 страница - Настройка уведомлений
624 Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); 625 Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe');
625 Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); 626 Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe');
626 627
627 // 12 страница - Сменить пароль 628 // 12 страница - Сменить пароль
628 Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); 629 Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset');
629 Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); 630 Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password');
630 631
631 // 13 страница - Удаление профиля 632 // 13 страница - Удаление профиля
632 Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); 633 Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people');
633 Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); 634 Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user');
634 Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); 635 Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user');
635 636
636 // Отправил сообщение 637 // Отправил сообщение
637 Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); 638 Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message');
638 }); 639 });
639 640
640 Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker'); 641 Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker');
641 642
642 643