Merge Request #14

Merged
Created by Fedor K

task-132687 minor changes

Assignee: Fedor K
Milestone: None

Merged by Fedor K

Source branch has been removed
Commits (1)
1 participants

Showing 18 changed files Inline Diff

app/Classes/Tools.php
1 <?php 1 <?php
2 2
3 3
4 namespace App\Classes; 4 namespace App\Classes;
5 5
6 6
7 use App\Models\Worker; 7 use App\Models\Worker;
8 8
9 class Tools 9 class Tools
10 { 10 {
11 static function generator_id($length = 6) 11 static function generator_id($length = 6)
12 { 12 {
13 $word = ''; 13 $word = '';
14 $arr = array( 14 $arr = array(
15 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 15 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
16 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 16 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
17 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 17 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
18 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 18 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
19 '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' 19 '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'
20 ); 20 );
21 21
22 for ($i = 0; $i < $length; $i++) { 22 for ($i = 0; $i < $length; $i++) {
23 $word .= $arr[random_int(0, count($arr) - 1)]; 23 $word .= $arr[random_int(0, count($arr) - 1)];
24 } 24 }
25 return $word; 25 return $word;
26 } 26 }
27 27
28 public static function getWorkerProfilePercent(Worker $Worker): int 28 public static function getWorkerProfilePercent(Worker $Worker): int
29 { 29 {
30 $persent = 0; 30 $persent = 0;
31 $workerFields = [
32 'telephone',
33 'email',
34 'old_year',
35 'salary_expectations',
36 'experience',
37 'english_level',
38 'ready_boart_date',
39 'boart_type_preference',
40 'visa_available',
41 'confirmation_work_for_vvp',
42 'military_id_available',
43 'city',
44 'telephone2',
45 ];
31 46
32 if((!empty($Worker->users->surname)) && 47 $workerUserFields = [
33 (!empty($Worker->users->name_man)) && 48 'surname',
34 (!empty($Worker->telephone)) && 49 'name_man',
35 (!empty($Worker->email)) 50 'surname2',
36 ) { 51 ];
37 $persent += 10; 52
53 foreach ($workerFields as $fieldName) {
54 if (!empty($Worker->$fieldName)) {
55 $persent += 2.8;
56 }
57 }
58
59 foreach ($workerUserFields as $fieldName) {
60 if (!empty($Worker->user->$fieldName)) {
61 $persent += 2.8;
62 }
38 } 63 }
39 64
40 if ( 65 if ($Worker->job_titles->count() > 0) {
41 (!empty($Worker->users->surname2)) && 66 $persent += 2.8;
42 (!empty($Worker->old_year)) &&
43 ($Worker->job_titles->count() > 0) &&
44 (!empty($Worker->salary_expectations)) &&
45 (!empty($Worker->experience)) &&
46 (!empty($Worker->english_level)) &&
47 (!empty($Worker->ready_boart_date)) &&
48 (!empty($Worker->boart_type_preference)) &&
49 (!empty($Worker->visa_available)) &&
50 (!empty($Worker->confirmation_work_for_vvp)) &&
51 (!empty($Worker->military_id_available)) &&
52 (!empty($Worker->city)) &&
53 (!empty($Worker->telephone2))
54 ) {
55 $persent += 40;
56 } 67 }
57 68
58 if ($Worker->sertificate->count() > 0) { 69 if ($Worker->sertificate->count() > 0) {
59 $persent += 10; 70 $persent += 10;
60 } 71 }
61 72
62 if ($Worker->infobloks->where(fn($ib) => $ib->pivot->status === 1)->count() > 0) { 73 if ($Worker->infobloks->where(fn($ib) => $ib->pivot->status === 1)->count() > 0) {
63 $persent += 10; 74 $persent += 10;
app/Http/Controllers/Admin/UsersController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers\Admin; 3 namespace App\Http\Controllers\Admin;
4 4
5 use App\Http\Controllers\Controller; 5 use App\Http\Controllers\Controller;
6 use App\Http\Requests\BaseUserRequest; 6 use App\Http\Requests\BaseUserRequest;
7 use App\Models\ContentRoles; 7 use App\Models\ContentRoles;
8 use App\Models\Job_title; 8 use App\Models\Job_title;
9 use App\Models\User; 9 use App\Models\User;
10 use App\Models\Worker; 10 use App\Models\Worker;
11 use Illuminate\Http\Request; 11 use Illuminate\Http\Request;
12 use Illuminate\Support\Facades\Auth; 12 use Illuminate\Support\Facades\Auth;
13 use Illuminate\Support\Facades\Storage; 13 use Illuminate\Support\Facades\Storage;
14 use PhpOffice\PhpSpreadsheet\Spreadsheet; 14 use PhpOffice\PhpSpreadsheet\Spreadsheet;
15 use PhpOffice\PhpSpreadsheet\Style\Alignment; 15 use PhpOffice\PhpSpreadsheet\Style\Alignment;
16 use PhpOffice\PhpSpreadsheet\Style\Border; 16 use PhpOffice\PhpSpreadsheet\Style\Border;
17 use PhpOffice\PhpSpreadsheet\Style\Font; 17 use PhpOffice\PhpSpreadsheet\Style\Font;
18 use PhpOffice\PhpSpreadsheet\Writer\Xlsx; 18 use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
19 19
20 class UsersController extends Controller 20 class UsersController extends Controller
21 { 21 {
22 public function index(Request $request) { 22 public function index(Request $request) {
23 $title = 'Админка - Пользователи системы'; 23 $title = 'Админка - Пользователи системы';
24 $id_admin = Auth::user()->id; 24 $id_admin = Auth::user()->id;
25 if ($request->ajax()) { 25 if ($request->ajax()) {
26 $user = User::find($request->id); 26 $user = User::find($request->id);
27 $request->offsetUnset('id'); 27 $request->offsetUnset('id');
28 $user->update($request->all()); 28 $user->update($request->all());
29 } 29 }
30 30
31 $find_key = ""; 31 $find_key = "";
32 $users = User::query(); 32 $users = User::query();
33 if (isset($request->find)) { 33 if (isset($request->find)) {
34 $find_key = $request->find; 34 $find_key = $request->find;
35 $users = $users->where('name', 'LIKE', "%$find_key%") 35 $users = $users->where('name', 'LIKE', "%$find_key%")
36 ->orWhere('email', 'LIKE', "%$find_key%"); 36 ->orWhere('email', 'LIKE', "%$find_key%");
37 } 37 }
38 38
39 $users = $users->paginate(15); 39 $users = $users->paginate(15);
40 40
41 if ($request->ajax()) { 41 if ($request->ajax()) {
42 return view('admin.users.index_ajax', compact('users', 'id_admin')); 42 return view('admin.users.index_ajax', compact('users', 'id_admin'));
43 } else { 43 } else {
44 return view('admin.users.index', compact('users', 'title', 'id_admin', 'find_key')); 44 return view('admin.users.index', compact('users', 'title', 'id_admin', 'find_key'));
45 } 45 }
46 } 46 }
47 47
48 public function user_delete(User $user) { 48 public function user_delete(User $user) {
49 $id = $user->delete(); 49 $id = $user->delete();
50 50
51 return redirect()->route('admin.users')->with('Пользователь был удален из системы'); 51 return redirect()->route('admin.users')->with('Пользователь был удален из системы');
52 } 52 }
53 53
54 public function index_bd(Request $request) { 54 public function index_bd(Request $request) {
55 $title = 'Админка - Пользователи базы данных'; 55 $title = 'Админка - Пользователи базы данных';
56 56
57 $find_key = ""; 57 $find_key = "";
58 $users = User::query(); 58 $users = User::query();
59 if (isset($request->find)) { 59 if (isset($request->find)) {
60 $find_key = $request->find; 60 $find_key = $request->find;
61 $users = $users->where('name', 'LIKE', "%$find_key%") 61 $users = $users->where('name', 'LIKE', "%$find_key%")
62 ->orWhere('email', 'LIKE', "%$find_key%") 62 ->orWhere('email', 'LIKE', "%$find_key%")
63 ->orWhere('telephone', 'LIKE', "%$find_key%"); 63 ->orWhere('telephone', 'LIKE', "%$find_key%");
64 } 64 }
65 65
66 $users = $users->Baseuser() 66 $users = $users->Baseuser()
67 ->orderByDesc(Worker::select('created_at')->whereColumn('workers.user_id', 'users.id')) 67 ->orderByDesc(Worker::select('created_at')->whereColumn('workers.user_id', 'users.id'))
68 ->paginate(15); 68 ->paginate(15);
69 69
70 if ($request->ajax()) { 70 if ($request->ajax()) {
71 return view('admin.users.index_bd_ajax', compact('users')); 71 return view('admin.users.index_bd_ajax', compact('users'));
72 } else { 72 } else {
73 return view('admin.users.index_bd', compact('users', 'title', 'find_key')); 73 return view('admin.users.index_bd', compact('users', 'title', 'find_key'));
74 } 74 }
75 } 75 }
76 76
77 public function add_bd() { 77 public function add_bd() {
78 $list_job_titles = Job_title::query()->active()->where('is_bd', '=' , '2')->orderBy('name', 'asc')->get(); 78 $list_job_titles = Job_title::query()->active()->where('is_bd', '=' , '2')->orderBy('name', 'asc')->get();
79 return view('admin.users.add', compact('list_job_titles')); 79 return view('admin.users.add', compact('list_job_titles'));
80 } 80 }
81 81
82 public function add_store_bd(BaseUserRequest $request) { 82 public function add_store_bd(BaseUserRequest $request) {
83 $params = $request->all(); 83 $params = $request->all();
84 84
85 if ($request->has('file')) { 85 if ($request->has('file')) {
86 $params['file'] = $request->file('file')->store('basedata', 'public'); 86 $params['file'] = $request->file('file')->store('basedata', 'public');
87 } 87 }
88 88
89 if (isset($request->name)) { 89 if (isset($request->name)) {
90 $params['name'] = $request->surname." ".$request->name_man." ".$request->surname2; 90 $params['name'] = $request->surname." ".$request->name_man." ".$request->surname2;
91 } 91 }
92 92
93 $user = User::create($params); 93 $user = User::create($params);
94 $worker = new Worker(); 94 $worker = new Worker();
95 $worker->positions_work = isset($params['positions_work']) ? json_encode($params['positions_work']) : []; 95 $worker->positions_work = isset($params['positions_work']) ? json_encode($params['positions_work']) : [];
96 $worker->user_id = $user->id; 96 $worker->user_id = $user->id;
97 $worker->comment = isset($params['comment']) ? $params['comment'] : null; 97 $worker->comment = isset($params['comment']) ? $params['comment'] : null;
98 $worker->save(); 98 $worker->save();
99 99
100 return redirect()->route('admin.basedata'); 100 return redirect()->route('admin.basedata');
101 } 101 }
102 102
103 public function edit_bd(User $user) { 103 public function edit_bd(User $user) {
104 $list_job_titles = Job_title::query()->active()->where('is_bd', '=' , '2')-> 104 $list_job_titles = Job_title::query()
105 orderByDesc('sort')->orderBy('name', 'asc')->get(); 105 ->active()
106 ->where('is_bd', '=' , '2')
107 ->orderByDesc('sort')
108 ->orderBy('name', 'asc')
109 ->get();
106 return view('admin.users.edit', compact('user', 'list_job_titles')); 110 return view('admin.users.edit', compact('user', 'list_job_titles'));
107 } 111 }
108 112
109 public function update_bd(BaseUserRequest $request, User $user) { 113 public function update_bd(BaseUserRequest $request, User $user) {
110 $params = $request->all(); 114 $params = $request->all();
111 $positions_work = $request->input('positions_work', []); 115 $positions_work = $request->input('positions_work', []);
112 116
113 if ($request->has('file')) { 117 if ($request->has('file')) {
114 if (!empty($user->file)) Storage::delete($user->file); 118 if (!empty($user->file)) Storage::delete($user->file);
115 $params['file'] = $request->file('file')->store('basedata', 'public'); 119 $params['file'] = $request->file('file')->store('basedata', 'public');
116 } else { 120 } else {
117 if (!empty($user->image)) $params['file'] = $user->file; 121 if (!empty($user->image)) $params['file'] = $user->file;
118 } 122 }
119 123
120 if (isset($request->name)) { 124 if (isset($request->name)) {
121 $params['name'] = $request->surname." ".$request->name_man." ".$request->surname2; 125 $params['name'] = $request->surname." ".$request->name_man." ".$request->surname2;
122 } 126 }
123 127
124 $user->update($params); 128 $user->update($params);
125 if (isset($user->workers[0]->id)) { 129 if (isset($user->workers[0]->id)) {
126 $worker = Worker::find($user->workers[0]->id); 130 $worker = Worker::find($user->workers[0]->id);
127 $worker->positions_work = $positions_work; 131 $worker->positions_work = $positions_work;
128 $worker->comment = isset($params['comment']) ? $params['comment'] : null; 132 $worker->comment = isset($params['comment']) ? $params['comment'] : null;
129 $worker->save(); 133 $worker->save();
130 } else { 134 } else {
131 $worker = new Worker(); 135 $worker = new Worker();
132 $worker->user_id = $user->id; 136 $worker->user_id = $user->id;
133 $worker->positions_work = $positions_work; 137 $worker->positions_work = $positions_work;
134 $worker->comment = isset($params['comment']) ? $params['comment'] : null; 138 $worker->comment = isset($params['comment']) ? $params['comment'] : null;
135 $worker->save(); 139 $worker->save();
136 } 140 }
137 141
138 return redirect()->route('admin.basedata'); 142 return redirect()->route('admin.basedata');
139 } 143 }
140 144
141 public function destroy_bd(User $user) { 145 public function destroy_bd(User $user) {
142 $user->delete(); 146 $user->delete();
143 return redirect()->route('admin.basedata'); 147 return redirect()->route('admin.basedata');
144 } 148 }
145 149
146 public function roles(Request $request) { 150 public function roles(Request $request) {
147 if ($request->ajax()) { 151 if ($request->ajax()) {
148 $user = User::find($request->id); 152 $user = User::find($request->id);
149 $request->offsetUnset('id'); 153 $request->offsetUnset('id');
150 $user->update($request->all()); 154 $user->update($request->all());
151 } 155 }
152 156
153 $users = User::query()->Realuser()->paginate(15); 157 $users = User::query()->Realuser()->paginate(15);
154 158
155 if ($request->ajax()) { 159 if ($request->ajax()) {
156 return view('admin.users.roles.index_ajax', compact('users')); 160 return view('admin.users.roles.index_ajax', compact('users'));
157 } else { 161 } else {
158 return view('admin.users.roles.index', compact('users')); 162 return view('admin.users.roles.index', compact('users'));
159 } 163 }
160 } 164 }
161 165
162 public function admin_roles(Request $request) { 166 public function admin_roles(Request $request) {
163 167
164 if ($request->ajax()) { 168 if ($request->ajax()) {
165 $id = $request->id; 169 $id = $request->id;
166 $request->offsetUnset('id'); 170 $request->offsetUnset('id');
167 ContentRoles::where('id', '=', $id)->update($request->all()); 171 ContentRoles::where('id', '=', $id)->update($request->all());
168 } 172 }
169 $roles = ContentRoles::query()->OrderBy('id')->paginate(25); 173 $roles = ContentRoles::query()->OrderBy('id')->paginate(25);
170 174
171 175
172 if ($request->ajax()) { 176 if ($request->ajax()) {
173 return view('admin.content.roles_index_ajax', compact('roles')); 177 return view('admin.content.roles_index_ajax', compact('roles'));
174 } else { 178 } else {
175 return view('admin.content.roles_index', compact('roles')); 179 return view('admin.content.roles_index', compact('roles'));
176 } 180 }
177 } 181 }
178 182
179 public function doc_bd(User $user) { 183 public function doc_bd(User $user) {
180 $id = $user->id; 184 $id = $user->id;
181 $spreadsheet = new Spreadsheet(); 185 $spreadsheet = new Spreadsheet();
182 $activeWorksheet = $spreadsheet->getActiveSheet(); 186 $activeWorksheet = $spreadsheet->getActiveSheet();
183 $activeWorksheet->setCellValue('A1', 'Отчет по соискателю'); 187 $activeWorksheet->setCellValue('A1', 'Отчет по соискателю');
184 $activeWorksheet->getStyle('A1')->applyFromArray([ 188 $activeWorksheet->getStyle('A1')->applyFromArray([
185 'font' => [ 189 'font' => [
186 'name' => 'Arial', 190 'name' => 'Arial',
187 'bold' => true, 191 'bold' => true,
188 'italic' => false, 192 'italic' => false,
189 'underline' => Font::UNDERLINE_DOUBLE, 193 'underline' => Font::UNDERLINE_DOUBLE,
190 'strikethrough' => false, 194 'strikethrough' => false,
191 'color' => [ 195 'color' => [
192 'rgb' => '808080' 196 'rgb' => '808080'
193 ] 197 ]
194 ], 198 ],
195 'borders' => [ 199 'borders' => [
196 'allBorders' => [ 200 'allBorders' => [
197 'borderStyle' => Border::BORDER_THIN, 201 'borderStyle' => Border::BORDER_THIN,
198 'color' => [ 202 'color' => [
199 'rgb' => '808080' 203 'rgb' => '808080'
200 ] 204 ]
201 ], 205 ],
202 'outline' => array( 206 'outline' => array(
203 'style' => Border::BORDER_THIN, 207 'style' => Border::BORDER_THIN,
204 'color' => array('rgb' => '000000') 208 'color' => array('rgb' => '000000')
205 ), 209 ),
206 ], 210 ],
207 211
208 'alignment' => [ 212 'alignment' => [
209 'horizontal' => Alignment::HORIZONTAL_CENTER, 213 'horizontal' => Alignment::HORIZONTAL_CENTER,
210 'vertical' => Alignment::VERTICAL_CENTER, 214 'vertical' => Alignment::VERTICAL_CENTER,
211 'wrapText' => true, 215 'wrapText' => true,
212 ] 216 ]
213 ]); 217 ]);
214 218
215 $activeWorksheet->setCellValue('A2', "Псевдоним/имя: ".$user->name); 219 $activeWorksheet->setCellValue('A2', "Псевдоним/имя: ".$user->name);
216 $activeWorksheet->setCellValue('A3', "Фамилия: ".$user->surname); 220 $activeWorksheet->setCellValue('A3', "Фамилия: ".$user->surname);
217 $activeWorksheet->setCellValue('A4', "Имя: ".$user->name_man); 221 $activeWorksheet->setCellValue('A4', "Имя: ".$user->name_man);
218 $activeWorksheet->setCellValue('A5', "Отчество: ".$user->surname2); 222 $activeWorksheet->setCellValue('A5', "Отчество: ".$user->surname2);
219 $activeWorksheet->setCellValue('A6', "Телефон: ".$user->telephone); 223 $activeWorksheet->setCellValue('A6', "Телефон: ".$user->telephone);
220 $activeWorksheet->setCellValue('A7', "Емайл: ".$user->email); 224 $activeWorksheet->setCellValue('A7', "Емайл: ".$user->email);
221 225
222 if (isset($user->workers[0]->id)) { 226 if (isset($user->workers[0]->id)) {
223 $activeWorksheet->setCellValue('A9', "Анкета: "); 227 $activeWorksheet->setCellValue('A9', "Анкета: ");
224 $activeWorksheet->setCellValue('A10', "Телефон: " . $user->workers[0]->telephone); 228 $activeWorksheet->setCellValue('A10', "Телефон: " . $user->workers[0]->telephone);
225 $activeWorksheet->setCellValue('A11', "Емайл: " . $user->workers[0]->email); 229 $activeWorksheet->setCellValue('A11', "Емайл: " . $user->workers[0]->email);
226 } 230 }
227 231
228 if (isset($user->jobtitles[0]->id)) { 232 if (isset($user->jobtitles[0]->id)) {
229 $activeWorksheet->setCellValue('A12', "Должность: " . $user->jobtitles[0]->name); 233 $activeWorksheet->setCellValue('A12', "Должность: " . $user->jobtitles[0]->name);
230 } 234 }
231 $activeWorksheet->getColumnDimension("A")->setWidth(100); 235 $activeWorksheet->getColumnDimension("A")->setWidth(100);
232 $writer = new Xlsx($spreadsheet); 236 $writer = new Xlsx($spreadsheet);
233 237
234 header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); 238 header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
235 header('Content-Disposition: attachment; filename="user'.$id.'.xlsx"'); 239 header('Content-Disposition: attachment; filename="user'.$id.'.xlsx"');
236 header('Cache-Control: no-cache'); 240 header('Cache-Control: no-cache');
237 241
238 $writer->save('php://output'); 242 $writer->save('php://output');
239 $writer->save(storage_path("app/public/export/user$id.xlsx")); 243 $writer->save(storage_path("app/public/export/user$id.xlsx"));
240 244
241 //$spreadsheet->disconnectWorksheets(); 245 //$spreadsheet->disconnectWorksheets();
242 return redirect()->route('admin.basedata'); 246 return redirect()->route('admin.basedata');
243 247
244 } 248 }
245 } 249 }
246 250
app/Http/Controllers/EmployerController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Classes\RusDate; 5 use App\Classes\RusDate;
6 use App\Classes\Tools; 6 use App\Classes\Tools;
7 use App\Http\Requests\BaseUser_min_Request; 7 use App\Http\Requests\BaseUser_min_Request;
8 use App\Http\Requests\FlotRequest; 8 use App\Http\Requests\FlotRequest;
9 use App\Http\Requests\MessagesRequiest; 9 use App\Http\Requests\MessagesRequiest;
10 use App\Http\Requests\VacancyRequestEdit; 10 use App\Http\Requests\VacancyRequestEdit;
11 use App\Mail\MailCreateEmployer; 11 use App\Mail\MailCreateEmployer;
12 use App\Mail\MailSotrudnichestvo; 12 use App\Mail\MailSotrudnichestvo;
13 use App\Mail\MassSendingMessages; 13 use App\Mail\MassSendingMessages;
14 use App\Mail\SendAllMessages; 14 use App\Mail\SendAllMessages;
15 use App\Models\Ad_employer; 15 use App\Models\Ad_employer;
16 use App\Models\ad_response; 16 use App\Models\ad_response;
17 use App\Models\Category; 17 use App\Models\Category;
18 use App\Models\Chat; 18 use App\Models\Chat;
19 use App\Models\Employer; 19 use App\Models\Employer;
20 use App\Models\Flot; 20 use App\Models\Flot;
21 use App\Models\Job_title; 21 use App\Models\Job_title;
22 use App\Models\Like_worker; 22 use App\Models\Like_worker;
23 use App\Models\Message; 23 use App\Models\Message;
24 use App\Models\Worker; 24 use App\Models\Worker;
25 use App\Models\MessagesRequests; 25 use App\Models\MessagesRequests;
26 use Carbon\Carbon; 26 use Carbon\Carbon;
27 use Illuminate\Auth\Events\Registered; 27 use Illuminate\Auth\Events\Registered;
28 use Illuminate\Database\Eloquent\Builder; 28 use Illuminate\Database\Eloquent\Builder;
29 use Illuminate\Http\Request; 29 use Illuminate\Http\Request;
30 use Illuminate\Support\Facades\Auth; 30 use Illuminate\Support\Facades\Auth;
31 use Illuminate\Support\Facades\Hash; 31 use Illuminate\Support\Facades\Hash;
32 use Illuminate\Support\Facades\Log; 32 use Illuminate\Support\Facades\Log;
33 use Illuminate\Support\Facades\Mail; 33 use Illuminate\Support\Facades\Mail;
34 use Illuminate\Support\Facades\Storage; 34 use Illuminate\Support\Facades\Storage;
35 use App\Models\User as User_Model; 35 use App\Models\User as User_Model;
36 use Illuminate\Support\Facades\Validator; 36 use Illuminate\Support\Facades\Validator;
37 use App\Enums\DbExportColumns; 37 use App\Enums\DbExportColumns;
38 use Throwable; 38 use Throwable;
39 39
40 class EmployerController extends Controller 40 class EmployerController extends Controller
41 { 41 {
42 public function vacancie($vacancy, Request $request) { 42 public function vacancie($vacancy, Request $request) {
43 $title = 'Заголовок вакансии'; 43 $title = 'Заголовок вакансии';
44 $Query = Ad_employer::with('jobs')-> 44 $Query = Ad_employer::with('jobs')->
45 with('cat')-> 45 with('cat')->
46 with('employer')-> 46 with('employer')->
47 with('jobs_code')-> 47 with('jobs_code')->
48 select('ad_employers.*')-> 48 select('ad_employers.*')->
49 where('id', '=', $vacancy)->get(); 49 where('id', '=', $vacancy)->get();
50 50
51 if (isset(Auth()->user()->id)) 51 if (isset(Auth()->user()->id))
52 $uid = Auth()->user()->id; 52 $uid = Auth()->user()->id;
53 else 53 else
54 $uid = 0; 54 $uid = 0;
55 $title = $Query[0]->name; 55 $title = $Query[0]->name;
56 if ($request->ajax()) { 56 if ($request->ajax()) {
57 return view('ajax.vacance-item', compact('Query','uid')); 57 return view('ajax.vacance-item', compact('Query','uid'));
58 } else { 58 } else {
59 return view('vacance-item', compact('title', 'Query', 'uid')); 59 return view('vacance-item', compact('title', 'Query', 'uid'));
60 } 60 }
61 } 61 }
62 62
63 public function logout() { 63 public function logout() {
64 Auth::logout(); 64 Auth::logout();
65 return redirect()->route('index') 65 return redirect()->route('index')
66 ->with('success', 'Вы вышли из личного кабинета'); 66 ->with('success', 'Вы вышли из личного кабинета');
67 } 67 }
68 68
69 public function employer_info() { 69 public function employer_info() {
70 // код юзера 70 // код юзера
71 $user_info = Auth()->user(); 71 $user_info = Auth()->user();
72 // вьюшка для вывода данных 72 // вьюшка для вывода данных
73 return view('employers.info', compact('user_info')); 73 return view('employers.info', compact('user_info'));
74 } 74 }
75 75
76 public function employer_info_save(User_Model $user, BaseUser_min_Request $request) { 76 public function employer_info_save(User_Model $user, BaseUser_min_Request $request) {
77 // Все данные через реквест 77 // Все данные через реквест
78 $all = $request->all(); 78 $all = $request->all();
79 unset($all['_token']); 79 unset($all['_token']);
80 // обновление 80 // обновление
81 $user->update($all); 81 $user->update($all);
82 return redirect()->route('employer.employer_info'); 82 return redirect()->route('employer.employer_info');
83 } 83 }
84 84
85 public function cabinet() { 85 public function cabinet() {
86 $id = Auth()->user()->id; 86 $id = Auth()->user()->id;
87 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 87 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
88 WhereHas('users', 88 WhereHas('users',
89 function (Builder $query) use ($id) {$query->Where('id', $id); 89 function (Builder $query) use ($id) {$query->Where('id', $id);
90 })->get(); 90 })->get();
91 return view('employers.cabinet45', compact('Employer')); 91 return view('employers.cabinet45', compact('Employer'));
92 } 92 }
93 93
94 public function slider_flot() { 94 public function slider_flot() {
95 $id = Auth()->user()->id; 95 $id = Auth()->user()->id;
96 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 96 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
97 WhereHas('users', 97 WhereHas('users',
98 function (Builder $query) use ($id) {$query->Where('id', $id); 98 function (Builder $query) use ($id) {$query->Where('id', $id);
99 })->get(); 99 })->get();
100 return view('employers.fly-flot', compact('Employer')); 100 return view('employers.fly-flot', compact('Employer'));
101 } 101 }
102 102
103 public function cabinet_save(Employer $Employer, Request $request) { 103 public function cabinet_save(Employer $Employer, Request $request) {
104 $params = $request->all(); 104 $params = $request->all();
105 $params['user_id'] = Auth()->user()->id; 105 $params['user_id'] = Auth()->user()->id;
106 $id = $Employer->id; 106 $id = $Employer->id;
107 107
108 if ($request->has('logo')) { 108 if ($request->has('logo')) {
109 if (!empty($Employer->logo)) { 109 if (!empty($Employer->logo)) {
110 Storage::delete($Employer->logo); 110 Storage::delete($Employer->logo);
111 } 111 }
112 $params['logo'] = $request->file('logo')->store("employer/$id", 'public'); 112 $params['logo'] = $request->file('logo')->store("employer/$id", 'public');
113 } 113 }
114 114
115 $Employer->update($params); 115 $Employer->update($params);
116 116
117 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены'); 117 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены');
118 } 118 }
119 119
120 public function save_add_flot(FlotRequest $request) { 120 public function save_add_flot(FlotRequest $request) {
121 // отмена 121 // отмена
122 $params = $request->all(); 122 $params = $request->all();
123 123
124 if ($request->has('image')) { 124 if ($request->has('image')) {
125 $params['image'] = $request->file('image')->store("flot", 'public'); 125 $params['image'] = $request->file('image')->store("flot", 'public');
126 } 126 }
127 Flot::create($params); 127 Flot::create($params);
128 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get(); 128 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get();
129 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); 129 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен');
130 } 130 }
131 131
132 public function edit_flot(Flot $Flot, Employer $Employer) { 132 public function edit_flot(Flot $Flot, Employer $Employer) {
133 return view('employers.edit-flot', compact('Flot', 'Employer')); 133 return view('employers.edit-flot', compact('Flot', 'Employer'));
134 } 134 }
135 135
136 public function update_flot(FlotRequest $request, Flot $Flot) { 136 public function update_flot(FlotRequest $request, Flot $Flot) {
137 $params = $request->all(); 137 $params = $request->all();
138 138
139 if ($request->has('image')) { 139 if ($request->has('image')) {
140 if (!empty($flot->image)) { 140 if (!empty($flot->image)) {
141 Storage::delete($flot->image); 141 Storage::delete($flot->image);
142 } 142 }
143 $params['image'] = $request->file('image')->store("flot", 'public'); 143 $params['image'] = $request->file('image')->store("flot", 'public');
144 } else { 144 } else {
145 if (!empty($flot->image)) $params['image'] = $flot->image; 145 if (!empty($flot->image)) $params['image'] = $flot->image;
146 } 146 }
147 147
148 $Flot->update($params); 148 $Flot->update($params);
149 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); 149 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен');
150 } 150 }
151 151
152 public function delete_flot(Flot $Flot) { 152 public function delete_flot(Flot $Flot) {
153 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get(); 153 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get();
154 154
155 if (isset($Flot->id)) $Flot->delete(); 155 if (isset($Flot->id)) $Flot->delete();
156 return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален'); 156 return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален');
157 } 157 }
158 158
159 // Форма добавления вакансий 159 // Форма добавления вакансий
160 public function cabinet_vacancie() { 160 public function cabinet_vacancie() {
161 $id = Auth()->user()->id; 161 /** @var User_Model $user */
162 $user = Auth()->user();
162 163
163 if (Auth()->user()->is_public) { 164 if ($user->is_public) {
164 $categories = Category::query()->active()->get(); 165 $categories = Category::query()->active()->get();
165 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 166
166 where('is_remove', '=', '0')-> 167 $jobs = Job_title::query()
167 where('is_bd', '=', '0')-> 168 ->orderByDesc('sort')
168 get(); 169 ->OrderBy('name')
169 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 170 ->where('is_remove', '=', '0')
170 WhereHas('users', 171 ->where('is_bd', '=', '0')
171 function (Builder $query) use ($id) { 172 ->get();
172 $query->Where('id', $id); 173
173 })->get(); 174 $Employer = Employer::query()
175 ->with(['users', 'ads', 'flots'])
176 ->whereHas('users', fn (Builder $query) => $query->where('id', $user->id))
177 ->get();
178
174 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories')); 179 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories'));
175 } else {
176 return redirect()->route('employer.cabinet_vacancie_danger');
177 } 180 }
181
182 return redirect()->route('employer.cabinet_vacancie_danger');
178 } 183 }
179 184
180 // Форма предупреждения об оплате 185 // Форма предупреждения об оплате
181 public function cabinet_vacancie_danger() { 186 public function cabinet_vacancie_danger() {
182 return view('employers.add_vacancy_danger'); 187 return view('employers.add_vacancy_danger');
183 } 188 }
184 189
185 // Сохранение вакансии 190 // Сохранение вакансии
186 public function cabinet_vacancy_save1(VacancyRequestEdit $request) { 191 public function cabinet_vacancy_save1(VacancyRequestEdit $request) {
187 $params_emp = $request->all(); 192 $params_emp = $request->all();
188 193
189 $params_job["job_title_id"] = $params_emp['job_title_id']; 194 $params_job["job_title_id"] = $params_emp['job_title_id'];
190 //$params_job["min_salary"] = $params_emp['min_salary'];
191 //$params_job["max_salary"] = $params_emp['max_salary'];
192 //$params_job["region"] = $params_emp['region'];
193 //$params_job["power"] = $params_emp['power'];
194 //$params_job["sytki"] = $params_emp['sytki'];
195 //$params_job["start"] = $params_emp['start'];
196 //$params_job["flot"] = $params_emp['flot'];
197 //$params_job["description"] = $params_emp['description'];
198 195
199 $ad_jobs = Ad_employer::create($params_emp); 196 $ad_jobs = Ad_employer::create($params_emp);
200 //$params_job['ad_employer_id'] = $ad_jobs->id;
201 //Ad_jobs::create($params_job);
202 $ad_jobs->jobs()->sync($request->get('job_title_id')); 197 $ad_jobs->jobs()->sync($request->get('job_title_id'));
203 198
204 return redirect()->route('employer.vacancy_list'); 199 return redirect()->route('employer.vacancy_list');
205 } 200 }
206 201
207 // Список вакансий 202 // Список вакансий
208 public function vacancy_list(Request $request) { 203 public function vacancy_list(Request $request) {
209 $id = Auth()->user()->id; 204 $id = Auth()->user()->id;
210 205
211 //dd($request->all());
212 $Employer = Employer::query()->where('user_id', $id)->first(); 206 $Employer = Employer::query()->where('user_id', $id)->first();
213 $vacancy_list = Ad_employer::query() 207 $vacancy_list = Ad_employer::query()
214 ->with('jobs') 208 ->with('jobs')
215 ->with('jobs_code') 209 ->with('jobs_code')
216 ->where('employer_id', $Employer->id) 210 ->where('employer_id', $Employer->id)
217 ->where('is_remove', 0) 211 ->where('is_remove', 0)
218 ->orderbyDesc('updated_at') 212 ->orderbyDesc('updated_at')
219 ; 213 ;
220 214
221 if (($request->has('search')) && (!empty($request->get('search')))) { 215 if (($request->has('search')) && (!empty($request->get('search')))) {
222 $search = $request->get('search'); 216 $search = $request->get('search');
223 $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%"); 217 $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%");
224 } 218 }
225 219
226 if ($request->get('sort')) { 220 if ($request->get('sort')) {
227 $sort = $request->get('sort'); 221 $sort = $request->get('sort');
228 switch ($sort) { 222 switch ($sort) {
229 case 'nopublic': $vacancy_list->where('active_is', '=', 0);break; 223 case 'nopublic': $vacancy_list->orderByDesc('updated_at')
230 case 'public':$vacancy_list->where('active_is', '=', 1);break; 224 ->where('active_is', 0);
231 default: $vacancy_list = $vacancy_list->orderByDesc('id'); break; 225 break;
226 case 'public': $vacancy_list->orderByDesc('updated_at')
227 ->where('active_is',1);
228 break;
229 default: $vacancy_list->orderByDesc('updated_at');
230 break;
232 } 231 }
233 } else { 232 } else {
234 $vacancy_list = $vacancy_list->orderByDesc('updated_at')->orderBy('id'); 233 $vacancy_list = $vacancy_list->orderByDesc('updated_at')->orderBy('id');
235 } 234 }
236 235
237 $vacancy_list = $vacancy_list->paginate(10); 236 $vacancy_list = $vacancy_list->paginate(10);
238 237
239 //ajax
240 if ($request->ajax()) { 238 if ($request->ajax()) {
241 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); 239 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer'));
242 } else { 240 } else {
243 return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); 241 return view('employers.list_vacancy', compact('vacancy_list', 'Employer'));
244 } 242 }
245 } 243 }
246 244
247 // Карточка вакансии 245 // Карточка вакансии
248 public function vacancy_edit(Ad_employer $ad_employer) { 246 public function vacancy_edit(Ad_employer $ad_employer) {
249 $id = Auth()->user()->id; 247 $id = Auth()->user()->id;
250 $Positions = Category::query()->where('is_remove', '=', '0')->get(); 248 $Positions = Category::query()->where('is_remove', '=', '0')->get();
251 249
252 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 250 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
253 where('is_remove', '=', '0')-> 251 where('is_remove', '=', '0')->
254 where('is_bd', '=', '0')->get(); 252 where('is_bd', '=', '0')->get();
255 253
256 $Employer = Employer::query()->with('users')->with('ads')-> 254 $Employer = Employer::query()->with('users')->with('ads')->
257 with('flots')->where('user_id', $id)->first(); 255 with('flots')->where('user_id', $id)->first();
258 256
259 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); 257 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs'));
260 } 258 }
261 259
262 // Сохранение-редактирование записи 260 // Сохранение-редактирование записи
263 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { 261 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) {
264 $params = $request->all(); 262 $params = $request->all();
265 $params_job["job_title_id"] = $params['job_title_id']; 263 $params_job["job_title_id"] = $params['job_title_id'];
266 264
267 $ad_employer->update($params); 265 $ad_employer->update($params);
268 $ad_employer->jobs()->sync($request->get('job_title_id')); 266 $ad_employer->jobs()->sync($request->get('job_title_id'));
269 267
270 $id = Auth()->user()->id; 268 $id = Auth()->user()->id;
271 $Positions = Category::query()->where('is_remove', '=', '0')->get(); 269 $Positions = Category::query()->where('is_remove', '=', '0')->get();
272 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name') 270 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')
273 ->where('is_remove', '=', '0') 271 ->where('is_remove', '=', '0')
274 ->where('is_bd', '=', '0') 272 ->where('is_bd', '=', '0')
275 ->get(); 273 ->get();
276 274
277 $Employer = Employer::query() 275 $Employer = Employer::query()
278 ->with('users')->with('ads')->with('flots')->where('user_id', $id)->first(); 276 ->with('users')->with('ads')->with('flots')->where('user_id', $id)->first();
279 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); 277 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs'));
280 } 278 }
281 279
282 // Сохранение карточки вакансии 280 // Сохранение карточки вакансии
283 public function vacancy_save(Request $request, Ad_employer $ad_employer) { 281 public function vacancy_save(Request $request, Ad_employer $ad_employer) {
284 $all = $request->all(); 282 $all = $request->all();
285 $ad_employer->update($all); 283 $ad_employer->update($all);
286 return redirect()->route('employer.cabinet_vacancie'); 284 return redirect()->route('employer.cabinet_vacancie');
287 } 285 }
288 286
289 // Удаление карточки вакансии 287 // Удаление карточки вакансии
290 public function vacancy_delete(Ad_employer $ad_employer) { 288 public function vacancy_delete(Ad_employer $ad_employer) {
291 $ad_employer->delete(); 289 $ad_employer->delete();
292 290
293 return redirect()->route('employer.vacancy_list') 291 return redirect()->route('employer.vacancy_list')
294 ->with('success', 'Данные были успешно сохранены'); 292 ->with('success', 'Данные были успешно сохранены');
295 } 293 }
296 294
297 // Обновление даты 295 // Обновление даты
298 public function vacancy_up(Ad_employer $ad_employer) { 296 public function vacancy_up(Ad_employer $ad_employer) {
299 $up = date('m/d/Y h:i:s', time()); 297 $up = date('m/d/Y h:i:s', time());
300 $ad_employer->updated_at = $up; 298 $ad_employer->updated_at = $up;
301 $ad_employer->save(); 299 $ad_employer->save();
302 300
303 return redirect()->back(); 301 return redirect()->back();
304 } 302 }
305 303
306 //Видимость вакансии 304 //Видимость вакансии
307 public function vacancy_eye(Ad_employer $ad_employer, $status) { 305 public function vacancy_eye(Ad_employer $ad_employer, $status) {
308 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 306 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
309 $vac_emp->active_is = $status; 307 $vac_emp->active_is = $status;
310 $vac_emp->save(); 308 $vac_emp->save();
311 309
312 return redirect()->route('employer.vacancy_list'); 310 return redirect()->route('employer.vacancy_list');
313 } 311 }
314 312
315 //Вакансия редактирования (шаблон) 313 //Вакансия редактирования (шаблон)
316 public function vacancy_update(Ad_employer $id) { 314 public function vacancy_update(Ad_employer $id) {
317 315
318 } 316 }
319 317
320 //Отклики на вакансию - лист 318 //Отклики на вакансию - лист
321 public function answers(Employer $employer, Request $request) { 319 public function answers(Employer $employer, Request $request) {
322 $user_id = Auth()->user()->id; 320 $user_id = Auth()->user()->id;
323 $answer = Ad_employer::query()->where('employer_id', $employer->id); 321 $answer = Ad_employer::query()->where('employer_id', $employer->id);
324 if ($request->has('search')) { 322 if ($request->has('search')) {
325 $search = trim($request->get('search')); 323 $search = trim($request->get('search'));
326 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); 324 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%");
327 } 325 }
328 326
329 $answer = $answer->with('response')->OrderByDESC('id')->get(); 327 $answer = $answer->with('response')->OrderByDESC('id')->get();
330 328
331 return view('employers.list_answer', compact('answer', 'user_id', 'employer')); 329 return view('employers.list_answer', compact('answer', 'user_id', 'employer'));
332 } 330 }
333 331
334 //Обновление статуса 332 //Обновление статуса
335 public function supple_status(employer $employer, ad_response $ad_response, $flag) { 333 public function supple_status(employer $employer, ad_response $ad_response, $flag) {
336 $ad_response->update(Array('flag' => $flag)); 334 $ad_response->update(Array('flag' => $flag));
337 return redirect()->route('employer.answers', ['employer' => $employer->id]); 335 return redirect()->route('employer.answers', ['employer' => $employer->id]);
338 } 336 }
339 337
340 //Страницы сообщений список 338 //Страницы сообщений список
341 public function messages($type_message) { 339 public function messages($type_message) {
342 $user_id = Auth()->user()->id; 340 $user_id = Auth()->user()->id;
343 341
344 $chats = Chat::get_user_chats($user_id); 342 $chats = Chat::get_user_chats($user_id);
345 $user_type = 'employer'; 343 $user_type = 'employer';
346 $admin_chat = false; 344 $admin_chat = false;
347 345
348 return view('employers.messages', compact('chats', 'admin_chat', 'user_id', 'user_type')); 346 return view('employers.messages', compact('chats', 'admin_chat', 'user_id', 'user_type'));
349 } 347 }
350 348
351 // Диалог между пользователями 349 // Диалог между пользователями
352 public function dialog(Chat $chat, Request $request) { 350 public function dialog(Chat $chat, Request $request) {
353 // Получение параметров. 351 // Получение параметров.
354 if ($request->has('ad_employer')){ 352 if ($request->has('ad_employer')){
355 $ad_employer = $request->get('ad_employer'); 353 $ad_employer = $request->get('ad_employer');
356 } else { 354 } else {
357 $ad_employer = 0; 355 $ad_employer = 0;
358 } 356 }
359 357
360 $sender = User_Model::query()->with('workers')->with('employers')->where('id', $chat->user_id)->first(); 358 $sender = User_Model::query()->with('workers')->with('employers')->where('id', $chat->user_id)->first();
361 $companion = User_Model::query()->with('workers')->with('employers')->where('id', $chat->to_user_id)->first(); 359 $companion = User_Model::query()->with('workers')->with('employers')->where('id', $chat->to_user_id)->first();
362 360
363 $Messages = Chat::get_chat_messages($chat); 361 $Messages = Chat::get_chat_messages($chat);
364 362
365 Message::where('user_id', '=', $chat->to_user_id)->where('to_user_id', '=', $chat->user_id)->update(['flag_new' => 0]); 363 Message::where('user_id', '=', $chat->to_user_id)->where('to_user_id', '=', $chat->user_id)->update(['flag_new' => 0]);
366 364
367 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages')); 365 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages'));
368 } 366 }
369 367
370 public function pin_chat(Request $request){ 368 public function pin_chat(Request $request){
371 $chat_id = $request->get('id'); 369 $chat_id = $request->get('id');
372 $is_fixed = $request->get('is_fixed'); 370 $is_fixed = $request->get('is_fixed');
373 371
374 Chat::pin_chat($chat_id, $is_fixed); 372 Chat::pin_chat($chat_id, $is_fixed);
375 } 373 }
376 374
377 public function remove_chat(Request $request){ 375 public function remove_chat(Request $request){
378 $chat_id = $request->get('id'); 376 $chat_id = $request->get('id');
379 Chat::remove_chat($chat_id); 377 Chat::remove_chat($chat_id);
380 } 378 }
381 379
382 // Регистрация работодателя 380 // Регистрация работодателя
383 public function register_employer(Request $request) { 381 public function register_employer(Request $request) {
384 $params = $request->all(); 382 $params = $request->all();
385 383
386 $rules = [ 384 $rules = [
387 //'surname' => ['required', 'string', 'max:255'], 385 //'surname' => ['required', 'string', 'max:255'],
388 //'name_man' => ['required', 'string', 'max:255'], 386 //'name_man' => ['required', 'string', 'max:255'],
389 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 387 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
390 'name_company' => ['required', 'string', 'max:255'], 388 'name_company' => ['required', 'string', 'max:255'],
391 'password' => ['required', 'string', 'min:6'], 389 'password' => ['required', 'string', 'min:6'],
392 ]; 390 ];
393 391
394 $messages = [ 392 $messages = [
395 'required' => 'Укажите обязательное поле', 393 'required' => 'Укажите обязательное поле',
396 'min' => [ 394 'min' => [
397 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 395 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
398 'integer' => 'Поле «:attribute» должно быть :min или больше', 396 'integer' => 'Поле «:attribute» должно быть :min или больше',
399 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 397 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
400 ], 398 ],
401 'max' => [ 399 'max' => [
402 'string' => 'Поле «:attribute» должно быть не больше :max символов', 400 'string' => 'Поле «:attribute» должно быть не больше :max символов',
403 'integer' => 'Поле «:attribute» должно быть :max или меньше', 401 'integer' => 'Поле «:attribute» должно быть :max или меньше',
404 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 402 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
405 ] 403 ]
406 ]; 404 ];
407 405
408 $email = $request->get('email'); 406 $email = $request->get('email');
409 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { 407 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) {
410 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); 408 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл"));
411 } 409 }
412 410
413 if ($request->get('password') !== $request->get('confirmed')){ 411 if ($request->get('password') !== $request->get('confirmed')){
414 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 412 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
415 } 413 }
416 414
417 if (strlen($request->get('password')) < 6) { 415 if (strlen($request->get('password')) < 6) {
418 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); 416 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
419 } 417 }
420 418
421 if (empty($request->get('surname'))) { 419 if (empty($request->get('surname'))) {
422 $params['surname'] = 'Неизвестно'; 420 $params['surname'] = 'Неизвестно';
423 } 421 }
424 if (empty($request->get('name_man'))) { 422 if (empty($request->get('name_man'))) {
425 $params['name_man'] = 'Неизвестно'; 423 $params['name_man'] = 'Неизвестно';
426 } 424 }
427 $validator = Validator::make($params, $rules, $messages); 425 $validator = Validator::make($params, $rules, $messages);
428 426
429 if ($validator->fails()) { 427 if ($validator->fails()) {
430 return json_encode(Array("ERROR" => "Error: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 428 return json_encode(Array("ERROR" => "Error: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
431 } else { 429 } else {
432 $user = $this->create($params); 430 $user = $this->create($params);
433 event(new Registered($user)); 431 event(new Registered($user));
434 432
435 try { 433 try {
436 Mail::to(env('EMAIL_ADMIN'))->send(new MailCreateEmployer($params)); 434 Mail::to(env('EMAIL_ADMIN'))->send(new MailCreateEmployer($params));
437 } catch (Throwable $e) { 435 } catch (Throwable $e) {
438 Log::error($e); 436 Log::error($e);
439 } 437 }
440 438
441 Auth::guard()->login($user); 439 Auth::guard()->login($user);
442 } 440 }
443 441
444 if ($user) { 442 if ($user) {
445 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; 443 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));;
446 } else { 444 } else {
447 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 445 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
448 } 446 }
449 } 447 }
450 448
451 // Создание пользователя 449 // Создание пользователя
452 protected function create(array $data) 450 protected function create(array $data)
453 { 451 {
454 $Use = new User_Model(); 452 $Use = new User_Model();
455 $Code_user = $Use->create([ 453 $Code_user = $Use->create([
456 'name' => $data['surname']." ".$data['name_man'], 454 'name' => $data['surname']." ".$data['name_man'],
457 'name_man' => $data['name_man'], 455 'name_man' => $data['name_man'],
458 'surname' => $data['surname'], 456 'surname' => $data['surname'],
459 'surname2' => $data['surname2'], 457 'surname2' => $data['surname2'],
460 'subscribe_email' => $data['email'], 458 'subscribe_email' => $data['email'],
461 'email' => $data['email'], 459 'email' => $data['email'],
462 'telephone' => $data['telephone'], 460 'telephone' => $data['telephone'],
463 'is_worker' => 0, 461 'is_worker' => 0,
464 'password' => Hash::make($data['password']), 462 'password' => Hash::make($data['password']),
465 'pubpassword' => base64_encode($data['password']), 463 'pubpassword' => base64_encode($data['password']),
466 'email_verified_at' => Carbon::now() 464 'email_verified_at' => Carbon::now()
467 ]); 465 ]);
468 466
469 if ($Code_user->id > 0) { 467 if ($Code_user->id > 0) {
470 $Employer = new Employer(); 468 $Employer = new Employer();
471 $Employer->user_id = $Code_user->id; 469 $Employer->user_id = $Code_user->id;
472 $Employer->name_company = $data['name_company']; 470 $Employer->name_company = $data['name_company'];
473 $Employer->email = $data['email']; 471 $Employer->email = $data['email'];
474 $Employer->telephone = $data['telephone']; 472 $Employer->telephone = $data['telephone'];
475 $Employer->code = Tools::generator_id(10); 473 $Employer->code = Tools::generator_id(10);
476 $Employer->save(); 474 $Employer->save();
477 475
478 return $Code_user; 476 return $Code_user;
479 } 477 }
480 } 478 }
481 479
482 // Отправка сообщения от работодателя 480 // Отправка сообщения от работодателя
483 public function send_message(MessagesRequiest $request) { 481 public function send_message(MessagesRequiest $request) {
484 $params = $request->all(); 482 $params = $request->all();
485 dd($params); 483 dd($params);
486 $user1 = $params['user_id']; 484 $user1 = $params['user_id'];
487 $user2 = $params['to_user_id']; 485 $user2 = $params['to_user_id'];
488 486
489 if ($request->has('file')) { 487 if ($request->has('file')) {
490 $params['file'] = $request->file('file')->store("messages", 'public'); 488 $params['file'] = $request->file('file')->store("messages", 'public');
491 } 489 }
492 Message::create($params); 490 Message::create($params);
493 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 491 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
494 } 492 }
495 493
496 public function test123(Request $request) { 494 public function test123(Request $request) {
497 $params = $request->all(); 495 $params = $request->all();
498 $user1 = $params['user_id']; 496 $user1 = $params['user_id'];
499 $user2 = $params['to_user_id']; 497 $user2 = $params['to_user_id'];
500 498
501 $rules = [ 499 $rules = [
502 'text' => 'nullable|required_without:file|min:1|max:150000', 500 'text' => 'nullable|required_without:file|min:1|max:150000',
503 'file' => 'nullable|file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' 501 'file' => 'nullable|file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000'
504 ]; 502 ];
505 $messages = [ 503 $messages = [
506 'required_without' => 'Поле «:attribute» обязательно, если файл не прикреплен', 504 'required_without' => 'Поле «:attribute» обязательно, если файл не прикреплен',
507 'min' => [ 505 'min' => [
508 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 506 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
509 'integer' => 'Поле «:attribute» должно быть :min или больше', 507 'integer' => 'Поле «:attribute» должно быть :min или больше',
510 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 508 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
511 ], 509 ],
512 'max' => [ 510 'max' => [
513 'string' => 'Поле «:attribute» должно быть не больше :max символов', 511 'string' => 'Поле «:attribute» должно быть не больше :max символов',
514 'integer' => 'Поле «:attribute» должно быть :max или меньше', 512 'integer' => 'Поле «:attribute» должно быть :max или меньше',
515 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 513 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
516 ] 514 ]
517 ]; 515 ];
518 516
519 $validator = Validator::make($request->all(), $rules, $messages); 517 $validator = Validator::make($request->all(), $rules, $messages);
520 518
521 if ($validator->fails()) { 519 if ($validator->fails()) {
522 return redirect()->route('cabinet.messages', ['type_message' => 'input'])->withErrors($validator); 520 return redirect()->route('cabinet.messages', ['type_message' => 'input'])->withErrors($validator);
523 } 521 }
524 522
525 $new_message = Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages'); 523 $new_message = Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages');
526 return redirect()->route('employer.dialog', ['chat' => $new_message->chat_id_from]); 524 return redirect()->route('employer.dialog', ['chat' => $new_message->chat_id_from]);
527 525
528 } 526 }
529 527
530 //Избранные люди 528 //Избранные люди
531 public function favorites(Request $request) 529 public function favorites(Request $request)
532 { 530 {
533 $likedWorkersIds = Like_worker::query() 531 $likedWorkersIds = Like_worker::query()
534 ->where('user_id', Auth::user()->id) 532 ->where('user_id', Auth::user()->id)
535 ->get() 533 ->get()
536 ->pluck('code_record') 534 ->pluck('code_record')
537 ->toArray(); 535 ->toArray();
538 536
539 $workerBuilder = Worker::query() 537 $workerBuilder = Worker::query()
540 ->whereIn('id', $likedWorkersIds); 538 ->whereIn('id', $likedWorkersIds);
541 539
542 if (($request->has('search')) && (!empty($request->get('search')))) { 540 if (($request->has('search')) && (!empty($request->get('search')))) {
543 $search = $request->get('search'); 541 $search = $request->get('search');
544 542
545 $workerBuilder->whereHas('users', function (Builder $query) use ($search) { 543 $workerBuilder->whereHas('users', function (Builder $query) use ($search) {
546 $query->where('surname', 'LIKE', "%$search%") 544 $query->where('surname', 'LIKE', "%$search%")
547 ->orWhere('name_man', 'LIKE', "%$search%") 545 ->orWhere('name_man', 'LIKE', "%$search%")
548 ->orWhere('surname2', 'LIKE', "%$search%"); 546 ->orWhere('surname2', 'LIKE', "%$search%");
549 }); 547 });
550 } 548 }
551 549
552 $Workers = $workerBuilder->get(); 550 $Workers = $workerBuilder->get();
553 551
554 return view('employers.favorite', compact('Workers')); 552 return view('employers.favorite', compact('Workers'));
555 } 553 }
556 554
557 // База данных 555 // База данных
558 public function bd(Request $request) { 556 public function bd(Request $request) {
559 $users = User_Model::query()->with('workers')->with('jobtitles'); 557 $users = User_Model::query()->with('workers')->with('jobtitles');
560 558
561 if ($request->has('search')) { 559 if ($request->has('search')) {
562 $find_key = $request->get('search'); 560 $find_key = $request->get('search');
563 $users = $users->where('name', 'LIKE', "%$find_key%") 561 $users = $users->where('name', 'LIKE', "%$find_key%")
564 ->orWhere('surname', 'LIKE', "%$find_key%") 562 ->orWhere('surname', 'LIKE', "%$find_key%")
565 ->orWhere('name_man', 'LIKE', "%$find_key%") 563 ->orWhere('name_man', 'LIKE', "%$find_key%")
566 ->orWhere('email', 'LIKE', "%$find_key%") 564 ->orWhere('email', 'LIKE', "%$find_key%")
567 ->orWhere('telephone', 'LIKE', "%$find_key%"); 565 ->orWhere('telephone', 'LIKE', "%$find_key%");
568 } 566 }
569 567
570 // Данные 568 // Данные
571 $users = $users->Baseuser()-> 569 $users = $users->Baseuser()->
572 orderByDesc(Worker::select('created_at')->whereColumn('workers.user_id', 'users.id')); 570 orderByDesc(Worker::select('created_at')->whereColumn('workers.user_id', 'users.id'));
573 $count_users = $users; 571 $count_users = $users->count();
574 $users = $users->paginate(10); 572 $users = $users->paginate(10);
575 573
576 $export_options = DbExportColumns::toArray(); 574 $export_options = DbExportColumns::toArray();
577 575
578 $jobs_titles = Job_title::select('id', 'name') 576 $jobs_titles = Job_title::select('id', 'name')
579 ->where('is_remove', '=', 0) 577 ->where('is_remove', '=', 0)
580 ->where('is_bd', '=', 2) 578 ->where('is_bd', '=', 2)
581 ->orderByDesc('sort') 579 ->orderByDesc('sort')
582 ->orderBy('name', 'asc') 580 ->orderBy('name', 'asc')
583 ->get() 581 ->get()
584 ->toArray() 582 ->toArray()
585 ; 583 ;
586 584
587 return view('employers.bd', compact('users', 'count_users', 'export_options', 'jobs_titles')); 585 return view('employers.bd', compact('users', 'count_users', 'export_options', 'jobs_titles'));
588 } 586 }
589 587
590 //Настройка уведомлений 588 //Настройка уведомлений
591 public function subscribe() { 589 public function subscribe() {
592 return view('employers.subcribe'); 590 return view('employers.subcribe');
593 } 591 }
594 592
595 //Установка уведомлений сохранение 593 //Установка уведомлений сохранение
596 public function save_subscribe(Request $request) { 594 public function save_subscribe(Request $request) {
597 dd($request->all()); 595 dd($request->all());
598 $msg = $request->validate([ 596 $msg = $request->validate([
599 'subscribe_email' => 'required|email|min:5|max:255', 597 'subscribe_email' => 'required|email|min:5|max:255',
600 ]); 598 ]);
601 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); 599 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку');
602 } 600 }
603 601
604 //Сбросить форму с паролем 602 //Сбросить форму с паролем
605 public function password_reset() { 603 public function password_reset() {
606 $email = Auth()->user()->email; 604 $email = Auth()->user()->email;
607 return view('employers.password-reset', compact('email')); 605 return view('employers.password-reset', compact('email'));
608 } 606 }
609 607
610 //Обновление пароля 608 //Обновление пароля
611 public function new_password(Request $request) { 609 public function new_password(Request $request) {
612 $use = Auth()->user(); 610 $use = Auth()->user();
613 $request->validate([ 611 $request->validate([
614 'password' => 'required|string', 612 'password' => 'required|string',
615 'new_password' => 'required|string', 613 'new_password' => 'required|string',
616 'new_password2' => 'required|string' 614 'new_password2' => 'required|string'
617 ]); 615 ]);
618 616
619 if ($request->get('new_password') == $request->get('new_password2')) 617 if ($request->get('new_password') == $request->get('new_password2'))
620 if ($request->get('password') !== $request->get('new_password')) { 618 if ($request->get('password') !== $request->get('new_password')) {
621 $credentials = $request->only('email', 'password'); 619 $credentials = $request->only('email', 'password');
622 if (Auth::attempt($credentials)) { 620 if (Auth::attempt($credentials)) {
623 621
624 if (!is_null($use->email_verified_at)){ 622 if (!is_null($use->email_verified_at)){
625 623
626 $user_data = User_Model::find($use->id); 624 $user_data = User_Model::find($use->id);
627 $user_data->update([ 625 $user_data->update([
628 'password' => Hash::make($request->get('new_password')), 626 'password' => Hash::make($request->get('new_password')),
629 'pubpassword' => base64_encode($request->get('new_password')), 627 'pubpassword' => base64_encode($request->get('new_password')),
630 ]); 628 ]);
631 return redirect() 629 return redirect()
632 ->route('employer.password_reset') 630 ->route('employer.password_reset')
633 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 631 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
634 } 632 }
635 633
636 return redirect() 634 return redirect()
637 ->route('employer.password_reset') 635 ->route('employer.password_reset')
638 ->withError('Данная учетная запись не было верифицированна!'); 636 ->withError('Данная учетная запись не было верифицированна!');
639 } 637 }
640 } 638 }
641 639
642 return redirect() 640 return redirect()
643 ->route('employer.password_reset') 641 ->route('employer.password_reset')
644 ->withErrors('Не совпадение данных, обновите пароли!'); 642 ->withErrors('Не совпадение данных, обновите пароли!');
645 } 643 }
646 644
647 645
648 646
649 // Форма Удаление пипла 647 // Форма Удаление пипла
650 public function delete_people() { 648 public function delete_people() {
651 $login = Auth()->user()->email; 649 $login = Auth()->user()->email;
652 return view('employers.delete_people', compact('login')); 650 return view('employers.delete_people', compact('login'));
653 } 651 }
654 652
655 // Удаление аккаунта 653 // Удаление аккаунта
656 public function action_delete_user(Request $request) { 654 public function action_delete_user(Request $request) {
657 $Answer = $request->all(); 655 $Answer = $request->all();
658 $user_id = Auth()->user()->id; 656 $user_id = Auth()->user()->id;
659 $request->validate([ 657 $request->validate([
660 'password' => 'required|string', 658 'password' => 'required|string',
661 ]); 659 ]);
662 660
663 $credentials = $request->only('email', 'password'); 661 $credentials = $request->only('email', 'password');
664 if (Auth::attempt($credentials)) { 662 if (Auth::attempt($credentials)) {
665 Auth::logout(); 663 Auth::logout();
666 $it = User_Model::find($user_id); 664 $it = User_Model::find($user_id);
667 $it->delete(); 665 $it->delete();
668 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 666 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
669 } else { 667 } else {
670 return redirect()->route('employer.delete_people') 668 return redirect()->route('employer.delete_people')
671 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 669 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
672 } 670 }
673 } 671 }
674 672
675 public function ajax_delete_user(Request $request) { 673 public function ajax_delete_user(Request $request) {
676 $Answer = $request->all(); 674 $Answer = $request->all();
677 $user_id = Auth()->user()->id; 675 $user_id = Auth()->user()->id;
678 $request->validate([ 676 $request->validate([
679 'password' => 'required|string', 677 'password' => 'required|string',
680 ]); 678 ]);
681 $credentials = $request->only('email', 'password'); 679 $credentials = $request->only('email', 'password');
682 if (Auth::attempt($credentials)) { 680 if (Auth::attempt($credentials)) {
683 681
684 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', 682 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт',
685 'email' => $request->get('email'), 683 'email' => $request->get('email'),
686 'password' => $request->get('password'))); 684 'password' => $request->get('password')));
687 } else { 685 } else {
688 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); 686 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль'));
689 } 687 }
690 } 688 }
691 689
692 // Рассылка сообщений 690 // Рассылка сообщений
693 public function send_all_messages() { 691 public function send_all_messages() {
694 $id = Auth()->user()->id; 692 $id = Auth()->user()->id;
695 $sending = Employer::query()->where('user_id', '=', "$id")->first(); 693 $sending = Employer::query()->where('user_id', '=', "$id")->first();
696 694
697 $job_titles = Job_title::query() 695 $job_titles = Job_title::query()
698 ->where('is_remove', '=', 0) 696 ->where('is_remove', '=', 0)
699 ->where('is_bd', '=', 1) 697 ->where('is_bd', '=', 1)
700 ->orderByDesc('sort') 698 ->orderByDesc('sort')
701 ->get(); 699 ->get();
702 700
703 if ($sending->sending_is) 701 if ($sending->sending_is)
704 return view('employers.send_all', compact('job_titles')); 702 return view('employers.send_all', compact('job_titles'));
705 else 703 else
706 return view('employers.send_all_danger'); 704 return view('employers.send_all_danger');
707 } 705 }
708 706
709 // Отправка сообщений для информации 707 // Отправка сообщений для информации
710 public function send_all_post(Request $request) { 708 public function send_all_post(Request $request) {
711 $data = $request->all(); 709 $data = $request->all();
712 $data['user'] = Auth()->user(); 710 $data['user'] = Auth()->user();
713 711
714 $id = MessagesRequests::create([ 712 $id = MessagesRequests::create([
715 'user_id' => $data['user']->id, 713 'user_id' => $data['user']->id,
716 'job_titles' => isset($data['job_title_ids']) ? json_encode($data['job_title_ids']) : null, 714 'job_titles' => isset($data['job_title_ids']) ? json_encode($data['job_title_ids']) : null,
717 'text' => $data['message_text'], 715 'text' => $data['message_text'],
718 ]); 716 ]);
719 717
720 try { 718 try {
721 if (!empty($id)) { 719 if (!empty($id)) {
722 Mail::to(env('EMAIL_ADMIN'))->send(new MassSendingMessages($data)); 720 Mail::to(env('EMAIL_ADMIN'))->send(new MassSendingMessages($data));
723 } 721 }
724 } catch (Throwable $e) { 722 } catch (Throwable $e) {
725 Log::error($e); 723 Log::error($e);
726 return redirect()->route('employer.send_all_messages')->with('error', 'Ошибка почтового сервера, пожалуйста, повторите рассылку позднее'); 724 return redirect()->route('employer.send_all_messages')->with('error', 'Ошибка почтового сервера, пожалуйста, повторите рассылку позднее');
727 } 725 }
728 726
729 return redirect()->route('employer.send_all_messages')->with('success', 'Запрос на рассылку был успешно отправлен.'); 727 return redirect()->route('employer.send_all_messages')->with('success', 'Запрос на рассылку был успешно отправлен.');
730 } 728 }
731 729
732 // База резюме 730 // База резюме
733 public function bd_tupe(Request $request) { 731 public function bd_tupe(Request $request) {
734 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); 732 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get();
735 733
736 return view('employers.bd_tupe', compact('Resume')); 734 return view('employers.bd_tupe', compact('Resume'));
737 } 735 }
738 736
739 ////////////////////////////////////////////////////////////////// 737 //////////////////////////////////////////////////////////////////
740 // Отправил сообщение 738 // Отправил сообщение
741 ////////////////////////////////////////////////////////////////// 739 //////////////////////////////////////////////////////////////////
742 public function new_message(Request $request) 740 public function new_message(Request $request)
743 { 741 {
744 $params = $request->all(); 742 $params = $request->all();
745 743
746 $id = $params['_user_id']; 744 $id = $params['_user_id'];
747 $message_params = [ 745 $message_params = [
748 'title' => $params['title'], 746 'title' => $params['title'],
749 'text' => $params['text'], 747 'text' => $params['text'],
750 'ad_employer_id' => $params['_vacancy'], 748 'ad_employer_id' => $params['_vacancy'],
751 'flag_new' => 1 749 'flag_new' => 1
752 ]; 750 ];
753 751
754 $message = Message::add_message( 752 $message = Message::add_message(
755 $request, 753 $request,
756 $params['_user_id'], 754 $params['_user_id'],
757 $params['_to_user_id'], 755 $params['_to_user_id'],
758 $message_params, 756 $message_params,
759 file_store_path: "worker/$id" 757 file_store_path: "worker/$id"
760 ); 758 );
761 759
762 return redirect()->route('worker.dialog', ['chat' => $message->chat_id_to]); 760 return redirect()->route('employer.dialog', ['chat' => $message->chat_id_to]);
763 } 761 }
764 762
765 // Восстановление пароля 763 // Восстановление пароля
766 public function repair_password(Request $request) { 764 public function repair_password(Request $request) {
767 $params = $request->get('email'); 765 $params = $request->get('email');
768 } 766 }
769 767
app/Http/Controllers/MainController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Classes\RusDate; 5 use App\Classes\RusDate;
6 use App\Classes\Tools; 6 use App\Classes\Tools;
7 use App\Mail\MailRegistration; 7 use App\Mail\MailRegistration;
8 use App\Mail\MailRepair; 8 use App\Mail\MailRepair;
9 use App\Models\Ad_employer; 9 use App\Models\Ad_employer;
10 use App\Models\Ad_jobs; 10 use App\Models\Ad_jobs;
11 use App\Models\Category; 11 use App\Models\Category;
12 use App\Models\Education; 12 use App\Models\Education;
13 use App\Models\employers_main; 13 use App\Models\employers_main;
14 use App\Models\Job_title; 14 use App\Models\Job_title;
15 use App\Models\Like_vacancy; 15 use App\Models\Like_vacancy;
16 use App\Models\Like_worker; 16 use App\Models\Like_worker;
17 use App\Models\News; 17 use App\Models\News;
18 use App\Models\Positions; 18 use App\Models\Positions;
19 use App\Models\reclame; 19 use App\Models\reclame;
20 use App\Models\User; 20 use App\Models\User;
21 use Illuminate\Http\Request; 21 use Illuminate\Http\Request;
22 use Illuminate\Support\Facades\Auth; 22 use Illuminate\Support\Facades\Auth;
23 use Illuminate\Support\Facades\DB; 23 use Illuminate\Support\Facades\DB;
24 use Illuminate\Support\Facades\Hash; 24 use Illuminate\Support\Facades\Hash;
25 use Illuminate\Support\Facades\Mail; 25 use Illuminate\Support\Facades\Mail;
26 use Illuminate\Support\Facades\Validator; 26 use Illuminate\Support\Facades\Validator;
27 use App\Models\PageContent; 27 use App\Models\PageContent;
28 use App\Enums\MainPageCounters; 28 use App\Enums\MainPageCounters;
29 29
30 class MainController extends Controller 30 class MainController extends Controller
31 { 31 {
32 // Главная страница публичной части 32 // Главная страница публичной части
33 public function index() { 33 public function index() {
34 $news = News::query()->orderByDesc('id')->limit(6)->get(); 34 $news = News::query()->orderByDesc('id')->limit(6)->get();
35 35
36 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') 36 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*')
37 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') 37 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id')
38 ->OrderByDesc('created_at') 38 ->OrderByDesc('created_at')
39 ->GroupBy('categories.id') 39 ->GroupBy('categories.id')
40 ->get(); 40 ->get();
41 41
42 $Job_title = Job_title::query()->where('is_remove', '=', '0')-> 42 $Job_title = Job_title::query()->where('is_remove', '=', '0')->
43 where('is_bd', '=', '0')->orderByDesc('sort')->get(); 43 where('is_bd', '=', '0')->orderByDesc('sort')->get();
44 44
45 $Data = DB::table('job_titles')-> 45 $Data = DB::table('job_titles')->
46 selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')-> 46 selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')->
47 where('categories.is_remove', '=', '0')-> 47 where('categories.is_remove', '=', '0')->
48 where('job_titles.is_remove', '=', '0')-> 48 where('job_titles.is_remove', '=', '0')->
49 where('job_titles.is_bd', '=' , '0')-> 49 where('job_titles.is_bd', '=' , '0')->
50 leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')-> 50 leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')->
51 join('categories', 'categories.id', '=', 'job_titles.position_id')-> 51 join('categories', 'categories.id', '=', 'job_titles.position_id')->
52 groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')-> 52 groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')->
53 orderByDesc('job_titles.sort')->get()->toArray(); 53 orderByDesc('job_titles.sort')->get()->toArray();
54 54
55 $Main_Job = array(); 55 $Main_Job = array();
56 $name_cat = ''; 56 $name_cat = '';
57 foreach ($Data as $it) { 57 foreach ($Data as $it) {
58 $it_arr = (array)$it; 58 $it_arr = (array)$it;
59 if ($name_cat != $it_arr['catname']) $name_cat = $it_arr['catname']; 59 if ($name_cat != $it_arr['catname']) $name_cat = $it_arr['catname'];
60 $Main_Job[$name_cat][] = $it_arr; 60 $Main_Job[$name_cat][] = $it_arr;
61 } 61 }
62 62
63 $employers = employers_main::query()->with('employer')-> 63 $employers = employers_main::query()->with('employer')->
64 whereHas('employer', function ($query) { 64 whereHas('employer', function ($query) {
65 $query->where('status_hidden', '=', '0'); 65 $query->where('status_hidden', '=', '0');
66 })-> 66 })->
67 orderBy('sort')->get(); 67 orderBy('sort')->get();
68 $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get(); 68 $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get();
69 69
70 $block_names = MainPageCounters::values();; 70 $block_names = MainPageCounters::values();;
71 $blocks_counters = PageContent::select('name', 'title', 'description', 'extra') 71 $blocks_counters = PageContent::select('name', 'title', 'description', 'extra')
72 ->whereIn('name', $block_names) 72 ->whereIn('name', $block_names)
73 ->orderBy('name', 'asc') 73 ->orderBy('name', 'asc')
74 ->get() 74 ->get()
75 ->keyBy('name') 75 ->keyBy('name')
76 ->toArray(); 76 ->toArray();
77 77
78 return view('index', compact('news', 'Job_title', 'categories', 'employers', 'vacancy', 'Main_Job', 'blocks_counters')); 78 return view('index', compact('news', 'Job_title', 'categories', 'employers', 'vacancy', 'Main_Job', 'blocks_counters'));
79 } 79 }
80 80
81 public function search_vacancies(Request $request) { 81 public function search_vacancies(Request $request) {
82 if ($request->has('search')) { 82 if ($request->has('search')) {
83 $search = $request->get('search'); 83 $search = $request->get('search');
84 $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first(); 84 $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first();
85 if (isset($job_titles->id)) 85 if (isset($job_titles->id))
86 if ($job_titles->id > 0) 86 if ($job_titles->id > 0)
87 return redirect()->route('vacancies', ['job' => $job_titles->id]); 87 return redirect()->route('vacancies', ['job' => $job_titles->id]);
88 } 88 }
89 } 89 }
90 90
91 // Лайк вакансии 91 // Лайк вакансии
92 public function like_vacancy(Request $request) 92 public function like_vacancy(Request $request)
93 { 93 {
94 if(Auth::user() === null) { 94 if(Auth::user() === null) {
95 return;//todo unauthenticated behavior 95 return;//todo unauthenticated behavior
96 } 96 }
97 97
98 if ($request->has('code_record')) { 98 if ($request->has('code_record')) {
99 if ($request->has('delete')) { 99 if ($request->has('delete')) {
100 DB::table('like_vacancy') 100 DB::table('like_vacancy')
101 ->where('code_record', $request->get('code_record')) 101 ->where('code_record', $request->get('code_record'))
102 ->where('user_id', Auth::user()->id) 102 ->where('user_id', Auth::user()->id)
103 ->delete(); 103 ->delete();
104 104
105 } else { 105 } else {
106 $params = $request->all(); 106 $params = $request->all();
107 $params['user_id'] = Auth::user()->id; 107 $params['user_id'] = Auth::user()->id;
108 Like_vacancy::create($params); 108 Like_vacancy::create($params);
109 } 109 }
110 } 110 }
111 } 111 }
112 112
113 // Лайк соискателю. 113 // Лайк соискателю.
114 public function like_worker(Request $request) 114 public function like_worker(Request $request)
115 { 115 {
116 if(Auth::user() === null) { 116 if(Auth::user() === null) {
117 return;//todo unauthenticated behavior 117 return;//todo unauthenticated behavior
118 } 118 }
119 119
120 if ($request->has('code_record')) {//fixme make non-absurd validation 120 if ($request->has('code_record')) {//fixme make non-absurd validation
121 if ($request->has('delete')) { 121 if ($request->has('delete')) {
122 DB::table('like_worker') 122 DB::table('like_worker')
123 ->where('code_record', $request->get('code_record')) 123 ->where('code_record', $request->get('code_record'))
124 ->where('user_id', Auth::user()->id) 124 ->where('user_id', Auth::user()->id)
125 ->delete(); 125 ->delete();
126 126
127 return "Вот и результат удаления!"; 127 return response()->json(['deleted' => true, 'id' => $request->get('code_record')]);
128
129 } else { 128 } else {
130 $params = $request->all(); 129 $params = $request->all();
131 $params['user_id'] = Auth::user()->id; 130 $params['user_id'] = Auth::user()->id;
132 Like_worker::create($params); 131 Like_worker::create($params);
132 return response()->json(['deleted' => false, 'id' => $request->get('code_record')]);
133 } 133 }
134 } 134 }
135 } 135 }
136 136
137 public function vacancies(Request $request) { 137 public function vacancies(Request $request) {
138 //должности 138 //должности
139 $Job_title = Job_title::query()->where('is_remove', '=', '0')-> 139 $Job_title = Job_title::query()->where('is_remove', '=', '0')->
140 where('is_bd', '=', '0')->orderByDesc('sort')-> 140 where('is_bd', '=', '0')->orderByDesc('sort')->
141 orderBy('name')->get(); 141 orderBy('name')->get();
142 142
143 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') 143 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*')
144 ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary') 144 ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary')
145 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') 145 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id')
146 ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id'); 146 ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id');
147 147
148 //категории и вакансии 148 //категории и вакансии
149 if (($request->has('job')) && ($request->get('job') > 0)) { 149 if (($request->has('job')) && ($request->get('job') > 0)) {
150 $categories = $categories->Where('job_title_id', '=', $request->get('job')); 150 $categories = $categories->Where('job_title_id', '=', $request->get('job'));
151 } 151 }
152 152
153 $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get(); 153 $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get();
154 154
155 $Data = DB::table('job_titles')-> 155 $Data = DB::table('job_titles')->
156 selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')-> 156 selectRaw('job_titles.name as jn, count(`ad_jobs`.`job_title_id`) as cnt, job_titles.id as id_job, categories.name as catname, categories.id as id_cat')->
157 where('categories.is_remove', '=', '0')-> 157 where('categories.is_remove', '=', '0')->
158 where('job_titles.is_bd', '=' , '0')-> 158 where('job_titles.is_bd', '=' , '0')->
159 where('job_titles.is_remove', '=', '0'); 159 where('job_titles.is_remove', '=', '0');
160 160
161 if (($request->has('job')) && ($request->get('job') > 0)) { 161 if (($request->has('job')) && ($request->get('job') > 0)) {
162 $Data->where('job_title_id', $request->get('job')); 162 $Data->where('job_title_id', $request->get('job'));
163 } 163 }
164 164
165 $Data = $Data->leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id') 165 $Data = $Data->leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')
166 ->join('categories', 'categories.id', '=', 'job_titles.position_id') 166 ->join('categories', 'categories.id', '=', 'job_titles.position_id')
167 ->groupBy('job_titles.id') 167 ->groupBy('job_titles.id')
168 ->orderBy('categories.id') 168 ->orderBy('categories.id')
169 ->orderByDesc('job_titles.position_id') 169 ->orderByDesc('job_titles.position_id')
170 ->orderByDesc('job_titles.sort') 170 ->orderByDesc('job_titles.sort')
171 ->get() 171 ->get()
172 ->toArray(); 172 ->toArray();
173 173
174 $Main_Job = array(); 174 $Main_Job = array();
175 $name_cat = ''; 175 $name_cat = '';
176 foreach ($Data as $it) { 176 foreach ($Data as $it) {
177 $it_arr = (array)$it; 177 $it_arr = (array)$it;
178 if ($name_cat != $it_arr['catname']) { 178 if ($name_cat != $it_arr['catname']) {
179 $name_cat = $it_arr['catname']; 179 $name_cat = $it_arr['catname'];
180 } 180 }
181 $Main_Job[$name_cat][] = $it_arr; 181 $Main_Job[$name_cat][] = $it_arr;
182 } 182 }
183 183
184 if ($request->ajax()) { 184 if ($request->ajax()) {
185 return view('ajax.new_sky', compact('categories', 'Main_Job')); 185 return view('ajax.new_sky', compact('categories', 'Main_Job'));
186 } else { 186 } else {
187 return view('new_sky', compact('Job_title', 'categories', 'Main_Job')); 187 return view('new_sky', compact('Job_title', 'categories', 'Main_Job'));
188 } 188 }
189 } 189 }
190 190
191 //Вакансии категория детальная 191 //Вакансии категория детальная
192 public function list_vacancies(Category $categories, Request $request) 192 public function list_vacancies(Category $categories, Request $request)
193 { 193 {
194 if (isset(Auth()->user()->id)) 194 if (isset(Auth()->user()->id))
195 $uid = Auth()->user()->id; 195 $uid = Auth()->user()->id;
196 else 196 else
197 $uid = 0; 197 $uid = 0;
198 198
199 if ($request->get('job') == 0) 199 if ($request->get('job') == 0)
200 $job_search = ''; 200 $job_search = '';
201 else 201 else
202 $job_search = $request->get('job'); 202 $job_search = $request->get('job');
203 203
204 $Query = Ad_employer::with('jobs') 204 $Query = Ad_employer::with('jobs')
205 ->with('cat') 205 ->with('cat')
206 ->with('employer') 206 ->with('employer')
207 ->where('is_remove', 0) 207 ->where('is_remove', 0)
208 ->whereHas('jobs_code', function ($query) use ($job_search) { 208 ->whereHas('jobs_code', function ($query) use ($job_search) {
209 if (!empty($job_search)) { 209 if (!empty($job_search)) {
210 $query->where('job_title_id', $job_search); 210 $query->where('job_title_id', $job_search);
211 } 211 }
212 }) 212 })
213 ->select('ad_employers.*'); 213 ->select('ad_employers.*');
214 214
215 if (isset($categories->id) && ($categories->id > 0)) { 215 if (isset($categories->id) && ($categories->id > 0)) {
216 $Query = $Query->where('category_id', '=', $categories->id); 216 $Query = $Query->where('category_id', '=', $categories->id);
217 $Name_categori = Category::query()->where('id', '=', $categories->id)->first()->name; 217 $Name_categori = Category::query()->where('id', '=', $categories->id)->first()->name;
218 } else { 218 } else {
219 $Name_categori = ''; 219 $Name_categori = '';
220 } 220 }
221 221
222 if ($request->get('sort')) { 222 if ($request->get('sort')) {
223 $sort = $request->get('sort'); 223 $sort = $request->get('sort');
224 switch ($sort) { 224 switch ($sort) {
225 case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break; 225 case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break;
226 case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break; 226 case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break;
227 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; 227 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
228 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; 228 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
229 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; 229 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
230 default: $Query = $Query->orderbyDesc('updated_at')->orderBy('id'); break; 230 default: $Query = $Query->orderbyDesc('updated_at')->orderBy('id'); break;
231 } 231 }
232 } 232 }
233 233
234 $Job_title = Job_title::query()->where('is_remove', '=', '0')-> 234 $Job_title = Job_title::query()->where('is_remove', '=', '0')->
235 where('is_bd', '=', '0')->orderByDesc('sort')-> 235 where('is_bd', '=', '0')->orderByDesc('sort')->
236 orderBy('name')->get(); 236 orderBy('name')->get();
237 237
238 $Query_count = $Query->count(); 238 $Query_count = $Query->count();
239 239
240 $Query = $Query->OrderByDesc('updated_at')->paginate(10); 240 $Query = $Query->OrderByDesc('updated_at')->paginate(10);
241 241
242 $Reclama = reclame::query()->get(); 242 $Reclama = reclame::query()->get();
243 243
244 if ($request->ajax()) { 244 if ($request->ajax()) {
245 if ($request->has('title')) { 245 if ($request->has('title')) {
246 return view('ajax.list_category', compact('Name_categori')); 246 return view('ajax.list_category', compact('Name_categori'));
247 } 247 }
248 248
249 return view( 249 return view(
250 'ajax.list_vacancies', 250 'ajax.list_vacancies',
251 compact('Query','Query_count','Name_categori','Reclama','categories','Job_title','uid') 251 compact('Query','Query_count','Name_categori','Reclama','categories','Job_title','uid')
252 ); 252 );
253 } 253 }
254 254
255 //Вернуть все 255 //Вернуть все
256 return view( 256 return view(
257 'list_vacancies', 257 'list_vacancies',
258 compact('Query','Query_count','Reclama','Name_categori','categories','Job_title','uid') 258 compact('Query','Query_count','Reclama','Name_categori','categories','Job_title','uid')
259 ); 259 );
260 } 260 }
261 261
262 // Контакты 262 // Контакты
263 public function contacts() { 263 public function contacts() {
264 return view('contacts'); 264 return view('contacts');
265 } 265 }
266 266
267 // Вход в личный кабинет 267 // Вход в личный кабинет
268 public function input_login(Request $request) 268 public function input_login(Request $request)
269 { 269 {
270 $params = $request->all(); 270 $params = $request->all();
271 271
272 272
273 $rules = [ 273 $rules = [
274 'email' => 'required|string|email', 274 'email' => 'required|string|email',
275 'password' => 'required|string|min:3|max:25', 275 'password' => 'required|string|min:3|max:25',
276 ]; 276 ];
277 277
278 $messages = [ 278 $messages = [
279 'required' => 'Укажите обязательное поле «:attribute»', 279 'required' => 'Укажите обязательное поле «:attribute»',
280 'email' => 'Введите корректный email', 280 'email' => 'Введите корректный email',
281 'min' => [ 281 'min' => [
282 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 282 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
283 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 283 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
284 ], 284 ],
285 'max' => [ 285 'max' => [
286 'string' => 'Поле «:attribute» должно быть не больше :max символов', 286 'string' => 'Поле «:attribute» должно быть не больше :max символов',
287 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 287 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
288 ], 288 ],
289 ]; 289 ];
290 $validator = Validator::make($request->all(), $rules, $messages); 290 $validator = Validator::make($request->all(), $rules, $messages);
291 if ($validator->fails()) { 291 if ($validator->fails()) {
292 if (Auth::check()) 292 if (Auth::check())
293 $user_id = $request->user()->id; 293 $user_id = $request->user()->id;
294 else 294 else
295 $user_id = 0; 295 $user_id = 0;
296 296
297 if ($user_id > 0) 297 if ($user_id > 0)
298 return json_encode(Array("ERROR" => "Email или пароль невалидный!")); 298 return json_encode(Array("ERROR" => "Email или пароль невалидный!"));
299 else 299 else
300 return redirect()->route('index')->with('Error', "Email или пароль невалидный"); 300 return redirect()->route('index')->with('Error', "Email или пароль невалидный");
301 } else { 301 } else {
302 $credentials = $request->only('email', 'password'); 302 $credentials = $request->only('email', 'password');
303 303
304 if (Auth::attempt($credentials, $request->has('remember'))) { 304 if (Auth::attempt($credentials, $request->has('remember'))) {
305 305
306 if (is_null(Auth::user()->email_verified_at)) { 306 if (is_null(Auth::user()->email_verified_at)) {
307 Auth::logout(); 307 Auth::logout();
308 return json_encode(Array("ERROR" => "Адрес почты не подтвержден")); 308 return json_encode(Array("ERROR" => "Адрес почты не подтвержден"));
309 } 309 }
310 310
311 if (Auth::user()->is_worker) { 311 if (Auth::user()->is_worker) {
312 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl())); 312 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));
313 } else { 313 } else {
314 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl())); 314 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));
315 } 315 }
316 316
317 return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет")); 317 return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет"));
318 //->route('index') 318 //->route('index')
319 //->with('success', 'Вы вошли в личный кабинет.'); 319 //->with('success', 'Вы вошли в личный кабинет.');
320 } else { 320 } else {
321 return json_encode(Array("ERROR" => "Неверный логин или пароль!")); 321 return json_encode(Array("ERROR" => "Неверный логин или пароль!"));
322 } 322 }
323 } 323 }
324 } 324 }
325 325
326 // Восстановление пароля 326 // Восстановление пароля
327 public function repair_password(Request $request) { 327 public function repair_password(Request $request) {
328 $rules = [ 328 $rules = [
329 'email' => 'required|string|email', 329 'email' => 'required|string|email',
330 ]; 330 ];
331 331
332 $messages = [ 332 $messages = [
333 'required' => 'Укажите обязательное поле «:attribute»', 333 'required' => 'Укажите обязательное поле «:attribute»',
334 'email' => 'Введите корректный email', 334 'email' => 'Введите корректный email',
335 'min' => [ 335 'min' => [
336 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 336 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
337 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 337 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
338 ], 338 ],
339 'max' => [ 339 'max' => [
340 'string' => 'Поле «:attribute» должно быть не больше :max символов', 340 'string' => 'Поле «:attribute» должно быть не больше :max символов',
341 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 341 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
342 ], 342 ],
343 ]; 343 ];
344 344
345 $validator = Validator::make($request->all(), $rules, $messages); 345 $validator = Validator::make($request->all(), $rules, $messages);
346 346
347 if ($validator->fails()) { 347 if ($validator->fails()) {
348 return redirect()->back()->with('Error', "Email невалидный"); 348 return redirect()->back()->with('Error', "Email невалидный");
349 } else { 349 } else {
350 $new_password = Tools::generator_id(10); 350 $new_password = Tools::generator_id(10);
351 $hash_password = Hash::make($new_password); 351 $hash_password = Hash::make($new_password);
352 $user = User::query()->where('email', $request->get('email'))->first(); 352 $user = User::query()->where('email', $request->get('email'))->first();
353 $EditRec = User::find($user->id); 353 $EditRec = User::find($user->id);
354 $EditRec->password = $hash_password; 354 $EditRec->password = $hash_password;
355 $EditRec->save(); 355 $EditRec->save();
356 356
357 foreach ([$request->get('email')] as $recipient) { 357 foreach ([$request->get('email')] as $recipient) {
358 Mail::to($recipient)->send(new MailRepair($new_password)); 358 Mail::to($recipient)->send(new MailRepair($new_password));
359 } 359 }
360 return redirect()->route('index'); 360 return redirect()->route('index');
361 361
362 } 362 }
363 363
364 } 364 }
365 365
366 // Вывод новостей 366 // Вывод новостей
367 public function news(Request $request) { 367 public function news(Request $request) {
368 $Query = News::query(); 368 $Query = News::query();
369 if ($request->has('search')) { 369 if ($request->has('search')) {
370 $search = $request->get('search'); 370 $search = $request->get('search');
371 $Query = $Query->where('title', 'LIKE', "%$search%")-> 371 $Query = $Query->where('title', 'LIKE', "%$search%")->
372 orWhere('text', 'LIKE', "%$search%"); 372 orWhere('text', 'LIKE', "%$search%");
373 } 373 }
374 374
375 if ($request->ajax()) { 375 if ($request->ajax()) {
376 if ($request->get('sort')) { 376 if ($request->get('sort')) {
377 $sort = $request->get('sort'); 377 $sort = $request->get('sort');
378 switch ($sort) { 378 switch ($sort) {
379 case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break; 379 case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break;
380 case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break; 380 case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break;
381 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; 381 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
382 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; 382 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
383 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; 383 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
384 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; 384 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break;
385 } 385 }
386 } 386 }
387 } 387 }
388 $Query_count = $Query->count(); 388 $Query_count = $Query->count();
389 $Query = $Query->paginate(6); 389 $Query = $Query->paginate(6);
390 390
391 if ($request->ajax()) { 391 if ($request->ajax()) {
392 return view('ajax.news-list', compact('Query', 'Query_count')); 392 return view('ajax.news-list', compact('Query', 'Query_count'));
393 } else { 393 } else {
394 return view('news-list', compact('Query', 'Query_count')); 394 return view('news-list', compact('Query', 'Query_count'));
395 } 395 }
396 } 396 }
397 397
398 //Детальная новость 398 //Детальная новость
399 public function detail_new(News $new) { 399 public function detail_new(News $new) {
400 // Наборка 400 // Наборка
401 $Query = News::query()->where('id', $new->id)->get(); 401 $Query = News::query()->where('id', $new->id)->get();
402 $title = $Query[0]->title; 402 $title = $Query[0]->title;
403 $All_Query = News::query()->paginate(8); 403 $All_Query = News::query()->paginate(8);
404 return view('detail_new', compact('Query', 'All_Query', 'title')); 404 return view('detail_new', compact('Query', 'All_Query', 'title'));
405 } 405 }
406 } 406 }
resources/views/admin/users/form.blade.php
1 <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> 1 <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800">
2 @error('name') 2 @error('name')
3 {{ $message }} 3 {{ $message }}
4 @enderror 4 @enderror
5 5
6 <input name="name" id="name" type="hidden" 6 <input name="name" id="name" type="hidden"
7 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 7 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
8 placeholder="Имя/Псевдоним" value="{{ old('name') ?? $user->name ?? 'Пользователь базы данных' }}" 8 placeholder="Имя/Псевдоним" value="{{ old('name') ?? $user->name ?? 'Пользователь базы данных' }}"
9 /> 9 />
10 10
11 <label class="block text-sm"> 11 <label class="block text-sm">
12 <span class="text-gray-700 dark:text-gray-400">Должность</span> 12 <span class="text-gray-700 dark:text-gray-400">Должность</span>
13 <select name="positions_work[]" id="positions_work[]" data-placeholder="Выберите должность..." multiple="multiple"> 13 <select name="positions_work[]" id="positions_work[]" data-placeholder="Выберите должность..." multiple="multiple">
14 @isset($list_job_titles) 14 @isset($list_job_titles)
15 @foreach($list_job_titles as $job_title) 15 @foreach($list_job_titles as $job_title)
16 <option value="{{ $job_title->id }}" 16 <option value="{{ $job_title->id }}"
17 @if (isset($user) && $user?->workers[0]?->positions_work && in_array($job_title->id , $user->workers[0]->positions_work)) 17 @if (isset($user) && $user?->workers[0]?->positions_work && in_array($job_title->id , $user->workers[0]->positions_work))
18 selected 18 selected
19 @endif 19 @endif
20 > 20 >
21 {{ $job_title->name }} ({{ $job_title->id }}) 21 {{ $job_title->name }} ({{ $job_title->id }})
22 </option> 22 </option>
23 @endforeach 23 @endforeach
24 @endisset 24 @endisset
25 </select> 25 </select>
26 @error('name') 26 @error('name')
27 <span class="text-xs text-red-600 dark:text-red-400"> 27 <span class="text-xs text-red-600 dark:text-red-400">
28 {{ $message }} 28 {{ $message }}
29 </span> 29 </span>
30 @enderror 30 @enderror
31 </label><br> 31 </label><br>
32 32
33 <label class="block text-sm"> 33 <label class="block text-sm">
34 <span class="text-gray-700 dark:text-gray-400">Фамилия</span> 34 <span class="text-gray-700 dark:text-gray-400">Фамилия</span>
35 <input name="surname" id="surname" 35 <input name="surname" id="surname"
36 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 36 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
37 placeholder="Фамилия" value="{{ old('surname') ?? $user->surname ?? '' }}" 37 placeholder="Фамилия" value="{{ old('surname') ?? $user->surname ?? '' }}"
38 /> 38 />
39 @error('surname') 39 @error('surname')
40 <span class="text-xs text-red-600 dark:text-red-400"> 40 <span class="text-xs text-red-600 dark:text-red-400">
41 {{ $message }} 41 {{ $message }}
42 </span> 42 </span>
43 @enderror 43 @enderror
44 </label><br> 44 </label><br>
45 45
46 <label class="block text-sm"> 46 <label class="block text-sm">
47 <span class="text-gray-700 dark:text-gray-400">Имя</span> 47 <span class="text-gray-700 dark:text-gray-400">Имя</span>
48 <input name="name_man" id="name_man" 48 <input name="name_man" id="name_man"
49 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 49 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
50 placeholder="Имя" value="{{ old('name_man') ?? $user->name_man ?? '' }}" 50 placeholder="Имя" value="{{ old('name_man') ?? $user->name_man ?? '' }}"
51 /> 51 />
52 @error('name_man') 52 @error('name_man')
53 <span class="text-xs text-red-600 dark:text-red-400"> 53 <span class="text-xs text-red-600 dark:text-red-400">
54 {{ $message }} 54 {{ $message }}
55 </span> 55 </span>
56 @enderror 56 @enderror
57 </label><br> 57 </label><br>
58 58
59 <input type="hidden" name="is_worker" id="is_worker" value="1"/> 59 <input type="hidden" name="is_worker" id="is_worker" value="1"/>
60 <input type="hidden" name="is_bd" id="is_bd" value="1"/> 60 <input type="hidden" name="is_bd" id="is_bd" value="1"/>
61 <input type="hidden" name="admin" id="admin" value="0"/> 61 <input type="hidden" name="admin" id="admin" value="0"/>
62 <input type="hidden" name="password" id="password" value="1234567890"/> 62 <input type="hidden" name="password" id="password" value="1234567890"/>
63 63
64 <label class="block text-sm"> 64 <label class="block text-sm">
65 <span class="text-gray-700 dark:text-gray-400">Отчество</span> 65 <span class="text-gray-700 dark:text-gray-400">Отчество</span>
66 <input name="surname2" id="surname2" 66 <input name="surname2" id="surname2"
67 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 67 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
68 placeholder="Отчество" value="{{ old('surname2') ?? $user->surname2 ?? '' }}" 68 placeholder="Отчество" value="{{ old('surname2') ?? $user->surname2 ?? '' }}"
69 /> 69 />
70 @error('surname2') 70 @error('surname2')
71 <span class="text-xs text-red-600 dark:text-red-400"> 71 <span class="text-xs text-red-600 dark:text-red-400">
72 {{ $message }} 72 {{ $message }}
73 </span> 73 </span>
74 @enderror 74 @enderror
75 </label><br> 75 </label><br>
76 76
77 <label class="block text-sm"> 77 <label class="block text-sm">
78 <span class="text-gray-700 dark:text-gray-400">Email</span> 78 <span class="text-gray-700 dark:text-gray-400">Email</span>
79 <input name="email" id="email" 79 <input name="email" id="email"
80 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 80 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
81 placeholder="Email" value="{{ old('email') ?? $user->email ?? '' }}" 81 placeholder="Email" value="{{ old('email') ?? $user->email ?? '' }}"
82 /> 82 />
83 @error('email') 83 @error('email')
84 <span class="text-xs text-red-600 dark:text-red-400"> 84 <span class="text-xs text-red-600 dark:text-red-400">
85 {{ $message }} 85 {{ $message }}
86 </span> 86 </span>
87 @enderror 87 @enderror
88 </label><br> 88 </label><br>
89 89
90 <label class="block text-sm"> 90 <label class="block text-sm">
91 <span class="text-gray-700 dark:text-gray-400">Телефон</span> 91 <span class="text-gray-700 dark:text-gray-400">Телефон</span>
92 <input name="telephone" id="telephone" 92 <input name="telephone" id="telephone"
93 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 93 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
94 placeholder="Телефон" value="{{ old('telephone') ?? $user->telephone ?? '' }}" 94 placeholder="Телефон" value="{{ old('telephone') ?? $user->telephone ?? '' }}"
95 /> 95 />
96 @error('telephone') 96 @error('telephone')
97 <span class="text-xs text-red-600 dark:text-red-400"> 97 <span class="text-xs text-red-600 dark:text-red-400">
98 {{ $message }} 98 {{ $message }}
99 </span> 99 </span>
100 @enderror 100 @enderror
101 </label><br> 101 </label><br>
102 102
103 <label class="block text-sm"> 103 <label class="block text-sm">
104 <span class="text-gray-700 dark:text-gray-400">Комментарий</span> 104 <span class="text-gray-700 dark:text-gray-400">Комментарий</span>
105 <input name="comment" id="comment" 105 <input name="comment" id="comment"
106 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 106 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
107 placeholder="Комментарий" value="{{ old('comment') ?? $user->comment ?? '' }}" 107 placeholder="Комментарий" value="{{ old('comment') ?? $user->workers[0]->comment ?? '' }}"
108 /> 108 />
109 @error('telephone') 109 @error('comment')
110 <span class="text-xs text-red-600 dark:text-red-400"> 110 <span class="text-xs text-red-600 dark:text-red-400">
111 {{ $message }} 111 {{ $message }}
112 </span> 112 </span>
113 @enderror 113 @enderror
114 </label><br> 114 </label><br>
115 115
116 <label class="block text-sm"> 116 <label class="block text-sm">
117 <span class="text-gray-700 dark:text-gray-400">Файл-анкета</span> 117 <span class="text-gray-700 dark:text-gray-400">Файл-анкета</span>
118 <input type="file" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 118 <input type="file" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700
119 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple 119 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple
120 dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 120 dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
121 id="file" name="file"> 121 id="file" name="file">
122 @error('file') 122 @error('file')
123 <span class="text-xs text-red-600 dark:text-red-400"> 123 <span class="text-xs text-red-600 dark:text-red-400">
124 {{ $message }} 124 {{ $message }}
125 </span> 125 </span>
126 @enderror 126 @enderror
127 @isset($user->file) 127 @isset($user->file)
128 <a class="text-gray-700 dark:text-gray-400" target="blank" href="{{ asset(Storage::url($user->file)) }}">{{ $user->file }}</a> 128 <a class="text-gray-700 dark:text-gray-400" target="blank" href="{{ asset(Storage::url($user->file)) }}">{{ $user->file }}</a>
129 @endisset 129 @endisset
130 </label><br> 130 </label><br>
131 131
132 <!--<label class="block text-sm"> 132 <!--<label class="block text-sm">
133 133
134 <input type="hidden" name="page_worker" value="0" /> 134 <input type="hidden" name="page_worker" value="0" />
135 <input name="page_worker" @php if (isset($user->workers->id)) echo "checked"; @endphp 135 <input name="page_worker" @php if (isset($user->workers->id)) echo "checked"; @endphp
136 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray " 136 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray "
137 placeholder="" style="float:left; margin-right: 5px" type="checkbox" value="1" 137 placeholder="" style="float:left; margin-right: 5px" type="checkbox" value="1"
138 /><p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Анкета </p><br> 138 /><p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Анкета </p><br>
139 139
140 </label><br>--> 140 </label><br>-->
141 141
142 <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> 142 <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4">
143 <div> 143 <div>
144 <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"> 144 <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
145 Сохранить 145 Сохранить
146 </button> 146 </button>
147 <a href="{{ route('admin.basedata') }}" 147 <a href="{{ route('admin.basedata') }}"
148 class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" 148 class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"
149 style="display: -webkit-inline-box; height: 30px!important;" 149 style="display: -webkit-inline-box; height: 30px!important;"
150 >Назад</a> 150 >Назад</a>
151 </div> 151 </div>
152 </div> 152 </div>
153 </div> 153 </div>
154 154
155 <script> 155 <script>
156 $(function(){ 156 $(function(){
157 $('[name="positions_work[]"]').chosen({ 157 $('[name="positions_work[]"]').chosen({
158 no_results_text: 'Не добавлено ни одной должности.', 158 no_results_text: 'Не добавлено ни одной должности.',
159 width: '100%' 159 width: '100%'
160 }) 160 })
161 }); 161 });
162 </script> 162 </script>
163 163
resources/views/admin/worker/index.blade.php
1 @extends('layout.admin', ['title' => 'Админка - Работники']) 1 @extends('layout.admin', ['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', '.checkban', function () { 6 $(document).on('click', '.checkban', function () {
7 var this_ = $(this); 7 var this_ = $(this);
8 var value = this_.val(); 8 var value = this_.val();
9 var ajax_block = $('#ajax_block'); 9 var ajax_block = $('#ajax_block');
10 var bool = 0; 10 var bool = 0;
11 11
12 if(this.checked){ 12 if(this.checked){
13 bool = 1; 13 bool = 1;
14 } else { 14 } else {
15 bool = 0; 15 bool = 0;
16 } 16 }
17 17
18 $.ajax({ 18 $.ajax({
19 type: "GET", 19 type: "GET",
20 url: "{{ url()->full()}}", 20 url: "{{ url()->full()}}",
21 data: "id=" + value + "&is_ban=" + bool, 21 data: "id=" + value + "&is_ban=" + bool,
22 success: function (data) { 22 success: function (data) {
23 console.log('Обновление таблицы работников '); 23 console.log('Обновление таблицы работников ');
24 //data = JSON.parse(data); 24 //data = JSON.parse(data);
25 console.log(data); 25 console.log(data);
26 ajax_block.html(data); 26 ajax_block.html(data);
27 }, 27 },
28 headers: { 28 headers: {
29 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 29 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
30 }, 30 },
31 error: function (data) { 31 error: function (data) {
32 console.log('Error: ' + data); 32 console.log('Error: ' + data);
33 } 33 }
34 }); 34 });
35 }); 35 });
36 36
37 }); 37 });
38 </script> 38 </script>
39 @endsection 39 @endsection
40 40
41 @section('search') 41 @section('search')
42 @include('admin.find_worker', ['find_status_work' => $find_status_work]) 42 @include('admin.find_worker', ['find_status_work' => $find_status_work])
43 @endsection 43 @endsection
44 44
45 @section('content') 45 @section('content')
46 <div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-4"> 46 <div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-4">
47 47
48 <div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800"> 48 <div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
49 <div class="p-3 mr-4 text-orange-500 bg-orange-100 rounded-full dark:text-orange-100 dark:bg-orange-500"> 49 <div class="p-3 mr-4 text-orange-500 bg-orange-100 rounded-full dark:text-orange-100 dark:bg-orange-500">
50 <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> 50 <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
51 <path 51 <path
52 d="M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z"></path> 52 d="M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z"></path>
53 </svg> 53 </svg>
54 </div> 54 </div>
55 <div> 55 <div>
56 <p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400"> 56 <p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">
57 Всего соискателей 57 Всего соискателей
58 </p> 58 </p>
59 <p class="text-lg font-semibold text-gray-700 dark:text-gray-200"> 59 <p class="text-lg font-semibold text-gray-700 dark:text-gray-200">
60 {{ $all_worker }} 60 {{ $all_worker }}
61 </p> 61 </p>
62 </div> 62 </div>
63 </div> 63 </div>
64 </div> 64 </div>
65 65
66 <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> 66 <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block">
67 <div class="w-full overflow-x-auto"> 67 <div class="w-full overflow-x-auto">
68 <table class="w-full whitespace-no-wrap"> 68 <table class="w-full whitespace-no-wrap">
69 <thead> 69 <thead>
70 <tr 70 <tr
71 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" 71 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"
72 > 72 >
73 <th class="px-4 py-3">№</th> 73 <th class="px-4 py-3">№</th>
74 <th class="px-4 py-3">Лого</th> 74 <th class="px-4 py-3">Лого</th>
75 <th class="px-4 py-3">ФИО/Email/Телефон</th> 75 <th class="px-4 py-3">ФИО/Email/Телефон</th>
76 <th class="px-4 py-3">Статус</th> 76 <th class="px-4 py-3">Статус</th>
77 <th class="px-4 py-3">% анкеты</th> 77 <th class="px-4 py-3">% анкеты</th>
78 <th class="px-4 py-3">Должность</th> 78 <th class="px-4 py-3">Должность</th>
79 <th class="px-4 py-3">Дата регистрации</th> 79 <th class="px-4 py-3">Дата регистрации</th>
80 <th class="px-4 py-3">Изменить</th> 80 <th class="px-4 py-3">Изменить</th>
81 </tr> 81 </tr>
82 </thead> 82 </thead>
83 <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> 83 <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800">
84 @foreach($users as $user) 84 @foreach($users as $user)
85 @if (!isset($user->workers[0]))
86 @continue(1)
87 @endif
85 <tr class="text-gray-700 dark:text-gray-400"> 88 <tr class="text-gray-700 dark:text-gray-400">
86 <td class="px-4 py-3 text-xs"> 89 <td class="px-4 py-3 text-xs">
87 {{$user->id}} 90 {{$user->id}}
88 </td> 91 </td>
89 <td class="px-4 py-3 text-xs"> 92 <td class="px-4 py-3 text-xs">
90 @if (isset($user->workers[0]->photo)) 93 @if (isset($user->workers[0]->photo))
91 <div class="flex items-center text-sm"> 94 <div class="flex items-center text-sm">
92 <div 95 <div
93 class="relative hidden w-8 h-8 mr-3 rounded-full md:block" 96 class="relative hidden w-8 h-8 mr-3 rounded-full md:block"
94 > 97 >
95 <img 98 <img
96 class="object-cover w-full h-full rounded-full" 99 class="object-cover w-full h-full rounded-full"
97 src="{{ asset(Storage::url($user->workers[0]->photo)) }}" 100 src="{{ asset(Storage::url($user->workers[0]->photo)) }}"
98 alt="" 101 alt=""
99 loading="lazy" 102 loading="lazy"
100 /> 103 />
101 <div 104 <div
102 class="absolute inset-0 rounded-full shadow-inner" 105 class="absolute inset-0 rounded-full shadow-inner"
103 aria-hidden="true" 106 aria-hidden="true"
104 ></div> 107 ></div>
105 </div> 108 </div>
106 </div> 109 </div>
107 @else 110 @else
108 - 111 -
109 @endif 112 @endif
110 </td> 113 </td>
111 114
112 <td class="px-4 py-3 text-xs"> 115 <td class="px-4 py-3 text-xs">
113 <div class="flex items-center text-sm"> 116 <div class="flex items-center text-sm">
114 <div> 117 <div>
115 <p class="font-semibold"> 118 <p class="font-semibold">
116 @if (isset($user->id)) 119 @if (isset($user->id))
117 <a style="text-decoration: underline;" href="{{ route('admin.user-profile', ['user' => $user->id]) }}}">{{ $user->surname }} {{ !empty($user->name_man) ? $user->name_man : $user->name }} {{ $user->surname2 }}</a> 120 <a style="text-decoration: underline;" href="{{ route('admin.user-profile', ['user' => $user->id]) }}}">{{ $user->surname }} {{ !empty($user->name_man) ? $user->name_man : $user->name }} {{ $user->surname2 }}</a>
118 @else 121 @else
119 {{ $user->surname }} {{ !empty($user->name_man) ? $user->name_man : $user->name }} {{ $user->surname2 }} 122 {{ $user->surname }} {{ !empty($user->name_man) ? $user->name_man : $user->name }} {{ $user->surname2 }}
120 @endif 123 @endif
121 </p> 124 </p>
122 <p class="font-semibold">{{ empty($user->workers->email) ? $user->email : $user->workers->email }}</p> 125 <p class="font-semibold">{{ empty($user->workers->email) ? $user->email : $user->workers->email }}</p>
123 <p class="text-xs text-gray-600 dark:text-gray-400"> 126 <p class="text-xs text-gray-600 dark:text-gray-400">
124 {{ empty($user->workers->telephone) ? $user->telephone : $user->workers->telephone }} 127 {{ empty($user->workers->telephone) ? $user->telephone : $user->workers->telephone }}
125 </p> 128 </p>
126 </div> 129 </div>
127 </div> 130 </div>
128 </td> 131 </td>
129 132
130 <td class="px-4 py-3 text-xs"> 133 <td class="px-4 py-3 text-xs">
131 @if (isset($user->workers[0]->status_work)) 134 @if (isset($user->workers[0]->status_work))
132 {{ $status_wor[$user->workers[0]->status_work] }} 135 {{ $status_wor[$user->workers[0]->status_work] }}
133 @else 136 @else
134 - 137 -
135 @endif 138 @endif
136 </td> 139 </td>
137 140
138 <td class="px-4 py-3 text-xs"> 141 <td class="px-4 py-3 text-xs">
139 @if (isset($user->workers[0]->persent_anketa)) 142 <span class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full @if(($persent = \App\Classes\Tools::getWorkerProfilePercent($user->workers[0])) > 50) dark:bg-green-700 dark:text-green-100 @else dark:text-white dark:bg-orange-600 @endif">
140 @if ($user->workers[0]->persent_anketa > 40) 143 {{ $persent }}%
141 <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"> 144 </span>
142 {{$user->workers[0]->persent_anketa}}%
143 </span>
144 @else
145 <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">
146 {{ \App\Classes\Tools::getWorkerProfilePercent($user->workers[0]) }}%
147 </span>
148 @endif
149 @else
150 <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">
151 0%
152 </span>
153 @endif
154 </td> 145 </td>
146
155 <td class="px-4 py-3 text-xs"> 147 <td class="px-4 py-3 text-xs">
156 @if (isset($user->jobtitles[0]->name)) 148 @if (isset($user->jobtitles[0]->name))
157 {{ $user->jobtitles[0]->name }} 149 {{ $user->jobtitles[0]->name }}
158 @else 150 @else
159 Не задана 151 Не задана
160 @endif 152 @endif
161 </td> 153 </td>
162 <td class="px-4 py-3 text-xs"> 154 <td class="px-4 py-3 text-xs">
163 {{ date('d.m.Y h:i:s', strtotime($user->created_at)) }} 155 {{ date('d.m.Y h:i:s', strtotime($user->created_at)) }}
164 </td> 156 </td>
165 <td class="px-4 py-3 text-xs"> 157 <td class="px-4 py-3 text-xs">
166 <!--if ($user->id > 1)--> 158 @if (isset($user->workers[0]->id))
167 @if (isset($user->workers[0]->id)) 159 <a href="{{ route('admin.worker-profile-edit', ['worker' => $user->workers[0]->id]) }}">Изменить</a>
168 <a href="{{ route('admin.worker-profile-edit', ['worker' => $user->workers[0]->id]) }}">Изменить</a>
169 160
170 @endif
171 <!--endif-->
172 </td>
173 <!--<td class="px-4 py-3 text-sm">
174 @if ($user->id > 1)
175 <input type="checkbox" class="checkban" value="{{$user->id}}" name="ban_{{$user->id}}" {{ ($user->is_ban) ? "checked" : "" }}/>
176 @endif 161 @endif
177 </td>--> 162 </td>
178 </tr> 163 </tr>
179 @endforeach 164 @endforeach
180 </tbody> 165 </tbody>
181 </table> 166 </table>
182 </div> 167 </div>
183 168
184 <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"> 169 <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">
185 <?=$users->appends($_GET)->links('admin.pagginate'); ?> 170 <?=$users->appends($_GET)->links('admin.pagginate'); ?>
186 </div> 171 </div>
187 172
188 173
189 <!--<div 174 <!--<div
190 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" 175 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"
191 > 176 >
192 <span class="flex items-center col-span-3"> 177 <span class="flex items-center col-span-3">
193 Showing 21-30 of 100 178 Showing 21-30 of 100
194 </span> 179 </span>
195 <span class="col-span-2"></span> 180 <span class="col-span-2"></span>
196 181
197 <span class="flex col-span-4 mt-2 sm:mt-auto sm:justify-end"> 182 <span class="flex col-span-4 mt-2 sm:mt-auto sm:justify-end">
198 <nav aria-label="Table navigation"> 183 <nav aria-label="Table navigation">
199 <ul class="inline-flex items-center"> 184 <ul class="inline-flex items-center">
200 <li> 185 <li>
201 <button 186 <button
202 class="px-3 py-1 rounded-md rounded-l-lg focus:outline-none focus:shadow-outline-purple" 187 class="px-3 py-1 rounded-md rounded-l-lg focus:outline-none focus:shadow-outline-purple"
203 aria-label="Previous" 188 aria-label="Previous"
204 > 189 >
205 <svg 190 <svg
206 aria-hidden="true" 191 aria-hidden="true"
207 class="w-4 h-4 fill-current" 192 class="w-4 h-4 fill-current"
208 viewBox="0 0 20 20" 193 viewBox="0 0 20 20"
209 > 194 >
210 <path 195 <path
211 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" 196 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"
212 clip-rule="evenodd" 197 clip-rule="evenodd"
213 fill-rule="evenodd" 198 fill-rule="evenodd"
214 ></path> 199 ></path>
215 </svg> 200 </svg>
216 </button> 201 </button>
217 </li> 202 </li>
218 <li> 203 <li>
219 <button 204 <button
220 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" 205 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
221 > 206 >
222 1 207 1
223 </button> 208 </button>
224 </li> 209 </li>
225 <li> 210 <li>
226 <button 211 <button
227 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" 212 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
228 > 213 >
229 2 214 2
230 </button> 215 </button>
231 </li> 216 </li>
232 <li> 217 <li>
233 <button 218 <button
234 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" 219 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"
235 > 220 >
236 3 221 3
237 </button> 222 </button>
238 </li> 223 </li>
239 <li> 224 <li>
240 <button 225 <button
241 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" 226 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
242 > 227 >
243 4 228 4
244 </button> 229 </button>
245 </li> 230 </li>
246 <li> 231 <li>
247 <span class="px-3 py-1">...</span> 232 <span class="px-3 py-1">...</span>
248 </li> 233 </li>
249 <li> 234 <li>
250 <button 235 <button
251 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" 236 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
252 > 237 >
253 8 238 8
254 </button> 239 </button>
255 </li> 240 </li>
256 <li> 241 <li>
257 <button 242 <button
258 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" 243 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
259 > 244 >
260 9 245 9
261 </button> 246 </button>
262 </li> 247 </li>
263 <li> 248 <li>
264 <button 249 <button
265 class="px-3 py-1 rounded-md rounded-r-lg focus:outline-none focus:shadow-outline-purple" 250 class="px-3 py-1 rounded-md rounded-r-lg focus:outline-none focus:shadow-outline-purple"
266 aria-label="Next" 251 aria-label="Next"
267 > 252 >
268 <svg 253 <svg
269 class="w-4 h-4 fill-current" 254 class="w-4 h-4 fill-current"
270 aria-hidden="true" 255 aria-hidden="true"
271 viewBox="0 0 20 20" 256 viewBox="0 0 20 20"
272 > 257 >
273 <path 258 <path
274 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" 259 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"
275 clip-rule="evenodd" 260 clip-rule="evenodd"
276 fill-rule="evenodd" 261 fill-rule="evenodd"
277 ></path> 262 ></path>
278 </svg> 263 </svg>
279 </button> 264 </button>
280 </li> 265 </li>
281 </ul> 266 </ul>
282 </nav> 267 </nav>
283 </span> 268 </span>
284 </div>--> 269 </div>-->
285 </div> 270 </div>
286 271
287 <?//=$users->appends($_GET)->links('catalogs.paginate'); ?> 272 <?//=$users->appends($_GET)->links('catalogs.paginate'); ?>
resources/views/employers/add_vacancy.blade.php
1 @extends('layout.frontend', ['title' => 'Добавление вакансии РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Добавление вакансии РекаМоре'])
2 2
3 @section('scripts')
4 <script>
5 console.log('Приближаемся к системе, нас рой тут...');
6 $(document).on('change', '#category_id', function() {
7 var this_ = $(this);
8 var val_ = this_.val();
9 var ajax_ = $('#job_title_id');
10
11 console.log('Создания списка людей, которые поднимутся на корабль...');
12
13 $.ajax({
14 type: "GET",
15 url: "{{ route('employer.selected_people') }}",
16 data: "id="+val_,
17 success: function (data) {
18 console.log('Ответка пришла');
19 console.log('Список избранных людей создан');
20 ajax_.html(data);
21 },
22 headers: {
23 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
24 },
25 error: function (data) {
26 console.log('Обрыв связи');
27 console.log('Error: ' + data);
28 }
29 });
30 });
31 </script>
32 @endsection
33 @section('content') 3 @section('content')
34 <section class="cabinet"> 4 <section class="cabinet">
35 <div class="container"> 5 <div class="container">
36 <ul class="breadcrumbs cabinet__breadcrumbs"> 6 <ul class="breadcrumbs cabinet__breadcrumbs">
37 <li><a href="{{ route('index') }}">Главная</a></li> 7 <li><a href="{{ route('index') }}">Главная</a></li>
38 <li><b>Личный кабинет</b></li> 8 <li><b>Личный кабинет</b></li>
39 </ul> 9 </ul>
40 <div class="cabinet__wrapper"> 10 <div class="cabinet__wrapper">
41 <div class="cabinet__side"> 11 <div class="cabinet__side">
42 <div class="cabinet__side-toper"> 12 <div class="cabinet__side-toper">
43 13
44 @include('employers.emblema') 14 @include('employers.emblema')
45 15
46 </div> 16 </div>
47 17
48 @include('employers.menu', ['item' => 2]) 18 @include('employers.menu', ['item' => 2])
49 19
50 </div> 20 </div>
51 21
52 <form class="cabinet__body" action="{{ route('employer.vac_save') }}" method="POST"> 22 <form class="cabinet__body" action="{{ route('employer.vac_save') }}" method="POST">
53 @csrf 23 @csrf
54 <input type="hidden" name="employer_id" value="{{ $Employer[0]->id }}"/> 24 <input type="hidden" name="employer_id" value="{{ $Employer[0]->id }}"/>
55 <div class="cabinet__body-item"> 25 <div class="cabinet__body-item">
56 <div class="cabinet__descr"> 26 <div class="cabinet__descr">
57 <h2 class="title cabinet__title">Разместить вакансию</h2> 27 <h2 class="title cabinet__title">Разместить вакансию</h2>
58 <p class="cabinet__text"><b>Данные по вакансии</b></p> 28 <p class="cabinet__text"><b>Данные по вакансии</b></p>
59 <p class="cabinet__text">Все поля обязательны для заполнения *</p> 29 <p class="cabinet__text">Все поля обязательны для заполнения *</p>
60 </div> 30 </div>
61 </div> 31 </div>
62 32
63 <div class="cabinet__body-item"> 33 <div class="cabinet__body-item">
64 <h4>Поля для вакансии</h4> 34 <h4>Поля для вакансии</h4>
65 <div class="cabinet__inputs"> 35 <div class="cabinet__inputs">
66 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 36 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
67 <label class="form-group__label">Название вакансии</label> 37 <label class="form-group__label">Название вакансии</label>
68 <div class="form-group__item"> 38 <div class="form-group__item">
69 <input type="text" class="input" name="name" id="name" placeholder="Работа в море" value="{{ old('name') ?? $Employer[0]->name ?? '' }}" required> 39 <input type="text" class="input" name="name" id="name" placeholder="Работа в море" value="{{ old('name') ?? $Employer[0]->name ?? '' }}" required>
70 @error('name') 40 @error('name')
71 <span class="text-xs text-red-600 dark:text-red-400"> 41 <span class="text-xs text-red-600 dark:text-red-400">
72 {{ $message }} 42 {{ $message }}
73 </span> 43 </span>
74 @enderror 44 @enderror
75 </div> 45 </div>
76 </div> 46 </div>
77 47
78 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 48 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
79 <label class="form-group__label">Добавление должностей</label> 49 <label class="form-group__label">Добавление должностей</label>
80 <div class="form-group__item"> 50 <div class="form-group__item">
81 <div class="select"> 51 <div class="select">
82 <select class="js-select2" name="job_title_id[]" id="job_title_id[]" multiple="multiple"> 52 <select class="js-select2" name="job_title_id[]" id="job_title_id[]" multiple="multiple">
83 @php $i = 1 @endphp 53 @php $i = 1 @endphp
84 @if ($jobs->count()) 54 @if ($jobs->count())
85 @foreach($jobs as $it) 55 @foreach($jobs as $it)
86 @php $selected = false; @endphp 56 @php $selected = false; @endphp
87 @if (isset($Worker[0]->job_titles)) 57 @if (isset($Worker[0]->job_titles))
88 @if ($Worker[0]->job_titles->count()) 58 @if ($Worker[0]->job_titles->count())
89 @foreach($Worker[0]->job_titles as $select) 59 @foreach($Worker[0]->job_titles as $select)
90 @if ($it->id == $select->id) 60 @if ($it->id == $select->id)
91 @php $selected = true; @endphp 61 @php $selected = true; @endphp
92 @endif 62 @endif
93 @endforeach 63 @endforeach
94 @endif 64 @endif
95 @endif 65 @endif
96 <option value="{{ $it->id }}" @if ($selected) selected @endif>{{ $it->name }}</option> 66 <option value="{{ $it->id }}" @if ($selected || $it->id == 160/* im so fucking sorry */) selected @endif>{{ $it->name }}</option>
97 @endforeach 67 @endforeach
98 @endif 68 @endif
99 </select> 69 </select>
100 </div> 70 </div>
101 </div> 71 </div>
102 </div> 72 </div>
103 73
104 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none"> 74 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none">
105 <label class="form-group__label">Телефон</label> 75 <label class="form-group__label">Телефон</label>
106 <div class="form-group__item"> 76 <div class="form-group__item">
107 <input type="text" class="input" name="telephone" id="telephone" value="{{ old('telephone') ?? $Employer[0]->telephone ?? '' }}" placeholder="Свой телефон"> 77 <input type="text" class="input" name="telephone" id="telephone" value="{{ old('telephone') ?? $Employer[0]->telephone ?? '' }}" placeholder="Свой телефон">
108 @error('telephone') 78 @error('telephone')
109 <span class="text-xs text-red-600 dark:text-red-400"> 79 <span class="text-xs text-red-600 dark:text-red-400">
110 {{ $message }} 80 {{ $message }}
111 </span> 81 </span>
112 @enderror 82 @enderror
113 </div> 83 </div>
114 </div> 84 </div>
115 85
116 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none"> 86 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none">
117 <label class="form-group__label">Емайл</label> 87 <label class="form-group__label">Емайл</label>
118 <div class="form-group__item"> 88 <div class="form-group__item">
119 <input type="text" class="input" name="email" id="email" value="{{ old('email') ?? $Employer[0]->email ?? '' }}" placeholder="Своя почту"> 89 <input type="text" class="input" name="email" id="email" value="{{ old('email') ?? $Employer[0]->email ?? '' }}" placeholder="Своя почту">
120 @error('email') 90 @error('email')
121 <span class="text-xs text-red-600 dark:text-red-400"> 91 <span class="text-xs text-red-600 dark:text-red-400">
122 {{ $message }} 92 {{ $message }}
123 </span> 93 </span>
124 @enderror 94 @enderror
125 </div> 95 </div>
126 </div> 96 </div>
127 97
128 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none"> 98 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none">
129 <label class="form-group__label">Зарплата среднестатистическая для вакансии</label> 99 <label class="form-group__label">Зарплата среднестатистическая для вакансии</label>
130 <div class="form-group__item"> 100 <div class="form-group__item">
131 <input type="text" class="input" name="salary" id="salary" value="0" placeholder="Среднестатистическая зарплата"> 101 <input type="text" class="input" name="salary" id="salary" value="0" placeholder="Среднестатистическая зарплата">
132 @error('salary') 102 @error('salary')
133 <span class="text-xs text-red-600 dark:text-red-400"> 103 <span class="text-xs text-red-600 dark:text-red-400">
134 {{ $message }} 104 {{ $message }}
135 </span> 105 </span>
136 @enderror 106 @enderror
137 </div> 107 </div>
138 </div> 108 </div>
139 109
140 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none"> 110 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none">
141 <label class="form-group__label">Город посадки</label> 111 <label class="form-group__label">Город посадки</label>
142 <div class="form-group__item"> 112 <div class="form-group__item">
143 <input type="text" class="input" name="city" id="city" value="{{ old('city') ?? $Employer[0]->city ?? '' }}" placeholder="Севастополь"> 113 <input type="text" class="input" name="city" id="city" value="{{ old('city') ?? $Employer[0]->city ?? '' }}" placeholder="Севастополь">
144 @error('city') 114 @error('city')
145 <span class="text-xs text-red-600"> 115 <span class="text-xs text-red-600">
146 {{ $message }} 116 {{ $message }}
147 </span> 117 </span>
148 @enderror 118 @enderror
149 </div> 119 </div>
150 </div> 120 </div>
151 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
152 <label class="form-group__label">Категория (локация)</label>
153 <div class="form-group__item">
154 <div class="select">
155 <select class="js-select2" name="category_id" id="category_id">
156 <option selected> Выберите категорию из списка</option>
157 _php $i = 1 _endphp
158 _if ($categories->count())
159 _foreach($categories as $j)
160 <option value=" $j->id }}"> $j->name }}</option>
161 _php $i++ _endphp
162 _endforeach
163 _endif
164 </select>
165 _error('category_id')
166 <span class="text-xs text-red-600 dark:text-red-400">
167 $message }}
168 </span>
169 _enderror
170 </div>
171 </div>
172 </div>-->
173 121
174 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 122 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
175 <label class="form-group__label">Описание вакансии</label> 123 <label class="form-group__label">Описание вакансии</label>
176 <div class="form-group__item"> 124 <div class="form-group__item">
177 <textarea class="textarea ckeditor" name="text" id="text">{{ old('text') ?? '' }}</textarea> 125 <textarea class="textarea ckeditor" name="text" id="text">{{ old('text') ?? '' }}</textarea>
178 @error('text') 126 @error('text')
179 <span class="text-xs text-red-600"> 127 <span class="text-xs text-red-600">
180 {{ $message }} 128 {{ $message }}
181 </span> 129 </span>
182 @enderror 130 @enderror
183 </div> 131 </div>
184 </div> 132 </div>
185 </div> 133 </div>
186 </div> 134 </div>
187 135
188 <div class="cabinet__body-item"> 136 <div class="cabinet__body-item">
189 <!-- <div class="cabinet__body-item"> 137 <!-- <div class="cabinet__body-item">
190 <div class="cabinet__descr"> 138 <div class="cabinet__descr">
191 <p class="cabinet__text"><b>Добавление должности</b></p> 139 <p class="cabinet__text"><b>Добавление должности</b></p>
192 </div> 140 </div>
193 </div> 141 </div>
194 142
195 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 143 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
196 <label class="form-group__label">Должность соискателя</label> 144 <label class="form-group__label">Должность соискателя</label>
197 <div class="form-group__item"> 145 <div class="form-group__item">
198 <div class="select"> 146 <div class="select">
199 <select class="js-select2" name="job_title_id" id="job_title_id"> 147 <select class="js-select2" name="job_title_id" id="job_title_id">
200 php $i = 1 endphp 148 php $i = 1 endphp
201 if ($jobs->count()) 149 if ($jobs->count())
202 foreach($jobs as $j) 150 foreach($jobs as $j)
203 if ($i == 1) <option selected> Выберите должность из списка</option> 151 if ($i == 1) <option selected> Выберите должность из списка</option>
204 else 152 else
205 <option value=" $j->id }}"> $j->name }}</option> 153 <option value=" $j->id }}"> $j->name }}</option>
206 endif 154 endif
207 php $i++ endphp 155 php $i++ endphp
208 endforeach 156 endforeach
209 endif 157 endif
210 </select> 158 </select>
211 error('job_title_id') 159 error('job_title_id')
212 <span class="text-xs text-red-600 dark:text-red-400"> 160 <span class="text-xs text-red-600 dark:text-red-400">
213 $message }} 161 $message }}
214 </span> 162 </span>
215 enderror 163 enderror
216 </div> 164 </div>
217 </div> 165 </div>
218 </div>--> 166 </div>-->
219 167
220 <div class="cabinet__inputs-item cabinet__inputs-item_max form-group"> 168 <div class="cabinet__inputs-item cabinet__inputs-item_max form-group">
221 169
222 </div> 170 </div>
223 171
224 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 172 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
225 <label class="form-group__label">Минимальная зарплата</label> 173 <label class="form-group__label">Минимальная зарплата</label>
226 <div class="form-group__item"> 174 <div class="form-group__item">
227 <input type="text" class="input" name="min_salary" id="min_salary" value=" old('min_salary') ?? '' }}" placeholder="Минимальная зарплата"> 175 <input type="text" class="input" name="min_salary" id="min_salary" value=" old('min_salary') ?? '' }}" placeholder="Минимальная зарплата">
228 error('min_salary') 176 error('min_salary')
229 <span class="text-xs text-red-600"> 177 <span class="text-xs text-red-600">
230 $message }} 178 $message }}
231 </span> 179 </span>
232 enderror 180 enderror
233 </div> 181 </div>
234 </div> 182 </div>
235 183
236 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 184 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
237 <label class="form-group__label">Максимальная зарплата</label> 185 <label class="form-group__label">Максимальная зарплата</label>
238 <div class="form-group__item"> 186 <div class="form-group__item">
239 <input type="text" class="input" name="max_salary" id="max_salary" value=" old('max_salary') ?? '' }}" placeholder="Максимальная зарплата"> 187 <input type="text" class="input" name="max_salary" id="max_salary" value=" old('max_salary') ?? '' }}" placeholder="Максимальная зарплата">
240 error('salary') 188 error('salary')
241 <span class="text-xs text-red-600 dark:text-red-400"> 189 <span class="text-xs text-red-600 dark:text-red-400">
242 $message }} 190 $message }}
243 </span> 191 </span>
244 enderror 192 enderror
245 </div> 193 </div>
246 </div> 194 </div>
247 195
248 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 196 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
249 <label class="form-group__label">Регион отплытия</label> 197 <label class="form-group__label">Регион отплытия</label>
250 <div class="form-group__item"> 198 <div class="form-group__item">
251 <input type="text" class="input" name="region" id="region" value=" old('region') ?? $Employer[0]->city ?? '' }}" placeholder="Севастополь"> 199 <input type="text" class="input" name="region" id="region" value=" old('region') ?? $Employer[0]->city ?? '' }}" placeholder="Севастополь">
252 error('region') 200 error('region')
253 <span class="text-xs text-red-600"> 201 <span class="text-xs text-red-600">
254 $message }} 202 $message }}
255 </span> 203 </span>
256 enderror 204 enderror
257 </div> 205 </div>
258 </div> 206 </div>
259 207
260 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 208 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
261 <label class="form-group__label">Мощность</label> 209 <label class="form-group__label">Мощность</label>
262 <div class="form-group__item"> 210 <div class="form-group__item">
263 <input type="text" class="input" name="power" id="power" value=" old('power') ?? '' }}" placeholder="POWER-45"> 211 <input type="text" class="input" name="power" id="power" value=" old('power') ?? '' }}" placeholder="POWER-45">
264 error('power') 212 error('power')
265 <span class="text-xs text-red-600"> 213 <span class="text-xs text-red-600">
266 $message }} 214 $message }}
267 </span> 215 </span>
268 enderror 216 enderror
269 </div> 217 </div>
270 </div> 218 </div>
271 219
272 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 220 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
273 <label class="form-group__label">Суточные выплаты</label> 221 <label class="form-group__label">Суточные выплаты</label>
274 <div class="form-group__item"> 222 <div class="form-group__item">
275 <input type="text" class="input" name="sytki" id="sytki" value=" old('sytki') ?? '' }}" placeholder="2000"> 223 <input type="text" class="input" name="sytki" id="sytki" value=" old('sytki') ?? '' }}" placeholder="2000">
276 error('power') 224 error('power')
277 <span class="text-xs text-red-600"> 225 <span class="text-xs text-red-600">
278 $message }} 226 $message }}
279 </span> 227 </span>
280 enderror 228 enderror
281 </div> 229 </div>
282 </div> 230 </div>
283 231
284 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 232 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
285 <label class="form-group__label">Начало отплытия</label> 233 <label class="form-group__label">Начало отплытия</label>
286 <div class="form-group__item"> 234 <div class="form-group__item">
287 <input type="text" class="input" name="start" id="start" value=" old('start') ?? '' }}" placeholder="20 сентября 2024"> 235 <input type="text" class="input" name="start" id="start" value=" old('start') ?? '' }}" placeholder="20 сентября 2024">
288 error('power') 236 error('power')
289 <span class="text-xs text-red-600"> 237 <span class="text-xs text-red-600">
290 $message }} 238 $message }}
291 </span> 239 </span>
292 enderror 240 enderror
293 </div> 241 </div>
294 </div> 242 </div>
295 243
296 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 244 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
297 <label class="form-group__label">Корабль для посадки</label> 245 <label class="form-group__label">Корабль для посадки</label>
298 <div class="form-group__item"> 246 <div class="form-group__item">
299 <div class="select"> 247 <div class="select">
300 <select class="js-select2" name="flot" id="flot"> 248 <select class="js-select2" name="flot" id="flot">
301 <option value="" selected> Не указан корабль</option> 249 <option value="" selected> Не указан корабль</option>
302 if ($Employer[0]->flots->count()) 250 if ($Employer[0]->flots->count())
303 foreach($Employer[0]->flots as $j) 251 foreach($Employer[0]->flots as $j)
304 <option value=" $j->name }}"> $j->name }} ( $j->id }})</option> 252 <option value=" $j->name }}"> $j->name }} ( $j->id }})</option>
305 endforeach 253 endforeach
306 endif 254 endif
307 </select> 255 </select>
308 error('flot') 256 error('flot')
309 <span class="text-xs text-red-600"> 257 <span class="text-xs text-red-600">
310 $message }} 258 $message }}
311 </span> 259 </span>
312 enderror 260 enderror
313 </div> 261 </div>
314 </div> 262 </div>
315 </div>--> 263 </div>-->
316 264
317 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 265 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
318 <label class="form-group__label">Дополнительная информация</label> 266 <label class="form-group__label">Дополнительная информация</label>
319 <div class="form-group__item"> 267 <div class="form-group__item">
320 <textarea class="textarea" name="description" id="description"> old('description') ?? '' }}</textarea> 268 <textarea class="textarea" name="description" id="description"> old('description') ?? '' }}</textarea>
321 error('description') 269 error('description')
322 <span class="text-xs text-red-600"> 270 <span class="text-xs text-red-600">
323 $message }} 271 $message }}
324 </span> 272 </span>
325 enderror 273 enderror
326 </div> 274 </div>
327 </div>--> 275 </div>-->
328 276
329 </div> 277 </div>
330 <button type="submit" class="button cabinet__submit">Опубликовать</button> 278 <button type="submit" class="button cabinet__submit">Опубликовать</button>
331 </div> 279 </div>
332 </form> 280 </form>
333 </div> 281 </div>
334 </div> 282 </div>
335 </section> 283 </section>
336 </div> 284 </div>
337 <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script> 285 <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>
338 <script> 286 <script>
339 CKEDITOR.replace('text'); 287 CKEDITOR.replace('text');
340 //CKEDITOR.replace( 'text', { 288 //CKEDITOR.replace( 'text', {
341 // filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", 289 // filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
342 // filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", 290 // filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
343 // filebrowserUploadMethod: 'form' 291 // filebrowserUploadMethod: 'form'
344 // }); 292 // });
345 </script> 293 </script>
346 294
347 @endsection 295 @endsection
348 296
resources/views/employers/ajax/list_vacancy.blade.php
1 @if ($vacancy_list->count()) 1 @if ($vacancy_list->count())
2 <div class="table__scroll"> 2 <div class="table__scroll">
3 <div class="table__body table__body_min-width"> 3 <div class="table__body table__body_min-width">
4 <table> 4 <table>
5 <thead> 5 <thead>
6 <tr> 6 <tr>
7 <th>№</th> 7 <th>№</th>
8 <th>Название</th> 8 <th>Название</th>
9 <th>Дата добавления<br>/&nbsp;обновления</th> 9 <th>Дата добавления<br>/&nbsp;обновления</th>
10 <th style="display:none">Должности</th> 10 <th style="display:none">Должности</th>
11 <th>Статус</th> 11 <th>Статус</th>
12 <th>Действия</th> 12 <th>Действия</th>
13 </tr> 13 </tr>
14 </thead> 14 </thead>
15 <tbody> 15 <tbody>
16 @foreach($vacancy_list as $it) 16 @foreach($vacancy_list as $it)
17 <tr> 17 <tr>
18 <td>{{ $it->id }}</td> 18 <td>{{ $it->id }}</td>
19 <td>{{ $it->name }}</td> 19 <td>{{ $it->name }}</td>
20 <td>{{ date('d.m.Y', strtotime($it->created_at)) }} <br>/ {{ date('d.m.Y', strtotime($it->updated_at)) }}</td> 20 <td>{{ date('d.m.Y', strtotime($it->created_at)) }} <br>/ {{ date('d.m.Y', strtotime($it->updated_at)) }}</td>
21 <td style="display:none"> <a href="{{ route('employer.add_job_in_vac', ['ad_employer' => $it->id]) }}" class="button">Добавить</a> 21 <td style="display:none"> <a href="{{ route('employer.add_job_in_vac', ['ad_employer' => $it->id]) }}" class="button">Добавить</a>
22 22
23 @if ($it->jobs->count()) 23 @if ($it->jobs->count())
24 @foreach ($it->jobs as $key => $it_um) 24 @foreach ($it->jobs as $key => $it_um)
25 <p>@if (isset($it->jobs_code[$key])) 25 <p>@if (isset($it->jobs_code[$key]))
26 <a href="{{ route('employer.edit_job_in_vac', ['ad_job' => $it->jobs_code[$key]->id, 'ad_employer' => $it->id, 'job_title_id' => $it_um->id]) }}" style="text-decoration: underline">{{$it_um->name}}</a> 26 <a href="{{ route('employer.edit_job_in_vac', ['ad_job' => $it->jobs_code[$key]->id, 'ad_employer' => $it->id, 'job_title_id' => $it_um->id]) }}" style="text-decoration: underline">{{$it_um->name}}</a>
27 <a href="{{ route('employer.delete_job_in_vac', ['ad_job' => $it->jobs_code[$key]->id]) }}" style="text-decoration: underline">(Del)</a> 27 <a href="{{ route('employer.delete_job_in_vac', ['ad_job' => $it->jobs_code[$key]->id]) }}" style="text-decoration: underline">(Del)</a>
28 @endif 28 @endif
29 </p> 29 </p>
30 @endforeach 30 @endforeach
31 @else 31 @else
32 Нет связанных <br> с вакансией должностей 32 Нет связанных <br> с вакансией должностей
33 @endif 33 @endif
34 </td> 34 </td>
35 <td> 35 <td>
36 @if ($it->active_is) 36 @if ($it->active_is)
37 <span class="table__status green"><i></i>Опубликовано</span> 37 <span class="table__status green"><i></i>Опубликовано</span>
38 @else 38 @else
39 <span class="table__status"><i></i>Не опубликовано</span> 39 <span class="table__status"><i></i>Не опубликовано</span>
40 @endif 40 @endif
41 </td> 41 </td>
42 <td> 42 <td>
43 <span class="table__controls"> 43 <span class="table__controls">
44 <a class="table__controls-item up-it" href="{{ route('employer.vacancy_up', ['ad_employer' => $it->id]) }}"> 44 <a class="table__controls-item up-it" title="Поднять вакансию" href="{{ route('employer.vacancy_up', ['ad_employer' => $it->id]) }}">
45 <svg> 45 <svg>
46 <use xlink:href="{{ asset('images/sprite.svg#arrow-radius') }}"></use> 46 <use xlink:href="{{ asset('images/sprite.svg#arrow-radius') }}"></use>
47 </svg> 47 </svg>
48 </a> 48 </a>
49 <a href="{{ route('employer.vacancy_edit', ['ad_employer' => $it->id]) }}" class="table__controls-item"> 49 <a href="{{ route('employer.vacancy_edit', ['ad_employer' => $it->id]) }}" title="Редактировать вакансию" class="table__controls-item">
50 <svg> 50 <svg>
51 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> 51 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use>
52 </svg> 52 </svg>
53 </a> 53 </a>
54 <a class="table__controls-item" href="{{ route('employer.vacancy_delete', ['ad_employer' => $it->id]) }}"> 54 <a class="table__controls-item" title="Удалить вакансию" href="{{ route('employer.vacancy_delete', ['ad_employer' => $it->id]) }}">
55 <svg> 55 <svg>
56 <use xlink:href="{{ asset('images/sprite.svg#cross') }}"></use> 56 <use xlink:href="{{ asset('images/sprite.svg#cross') }}"></use>
57 </svg> 57 </svg>
58 </a> 58 </a>
59 @if ($it->active_is) 59 @if ($it->active_is)
60 <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 0]) }}" class="table__controls-item"> 60 <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 0]) }}" title="Скрыть вакансию" class="table__controls-item">
61 <svg> 61 <svg>
62 <use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use> 62 <use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use>
63 </svg> 63 </svg>
64 </a> 64 </a>
65 @else 65 @else
66 <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 1]) }}" class="table__controls-item"> 66 <a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 1]) }}" title="Показать вакансию" class="table__controls-item">
67 <svg> 67 <svg>
68 <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use> 68 <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use>
69 </svg> 69 </svg>
70 </a> 70 </a>
71 @endif 71 @endif
72 72 @if ($Employer->social_is == 1)
73 <!--<button type="button" class="table__controls-item"> 73 <a href="{{ route('employer.send-vacancy-to-social', ['social' => 'tg', 'vacancy' => $it->id]) }}" title="Отправить вакансию в телеграм" class="table__controls-item">
74 <svg> 74 <svg>
75 <use xlink:href=" asset('images/sprite.svg#tg') }}"></use> 75 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use>
76 </svg> 76 </svg>
77 </button> 77 </a>
78 --> 78 @endif
79 </span> 79 </span>
80 </td> 80 </td>
81 </tr> 81 </tr>
82 @endforeach 82 @endforeach
83 </tbody> 83 </tbody>
84 </table> 84 </table>
85 </div><br> 85 </div><br>
86 {{ $vacancy_list->appends($_GET)->links('paginate') }} 86 {{ $vacancy_list->appends($_GET)->links('paginate') }}
87 </div> 87 </div>
88 @else 88 @else
89 89
90 <div class="notify"> 90 <div class="notify">
91 <svg> 91 <svg>
92 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> 92 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use>
93 </svg> 93 </svg>
94 <span>Вы ещё не разместили ни одной вакансии</span> 94 <span>Вы ещё не разместили ни одной вакансии</span>
95 </div> 95 </div>
96 @endif 96 @endif
97 97
resources/views/employers/bd.blade.php
1 @extends('layout.frontend', ['title' => 'База данных - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'База данных - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 $(document).ready(function(){ 5 $(document).ready(function(){
6 $('[name="job_title_list[]"]').chosen({ 6 $('[name="job_title_list[]"]').chosen({
7 width: '100%' 7 width: '100%'
8 }) 8 })
9 $('[name="job_titles__name"]').change(function(){ 9 $('[name="job_titles__name"]').change(function(){
10 if ($(this).is(':checked')){ 10 if ($(this).is(':checked')){
11 $(".job-title-list-wrap").css("display", "block"); 11 $(".job-title-list-wrap").css("display", "block");
12 } else { 12 } else {
13 $(".job-title-list-wrap").css("display", "none"); 13 $(".job-title-list-wrap").css("display", "none");
14 } 14 }
15 }); 15 });
16 $('.cabinet__export-button-wrap button').click(function(){ 16 $('.cabinet__export-button-wrap button').click(function(){
17 $('.cabinet__export-error').parent().remove(); 17 $('.cabinet__export-error').parent().remove();
18 }); 18 });
19 19
20 $('.search-reset-button').click(function(){ 20 $('.search-reset-button').click(function(){
21 var wrap = $(this).closest('.cabinet__filters'); 21 var wrap = $(this).closest('.cabinet__filters');
22 wrap.find('[name="search"]').val(''); 22 wrap.find('[name="search"]').val('');
23 wrap.find('button').click(); 23 wrap.find('button').click();
24 }); 24 });
25 }); 25 });
26 26
27 27
28 $(document).on('click', '.die_black', function() { 28 $(document).on('click', '.die_black', function() {
29 var this_ = $(this); 29 var this_ = $(this);
30 var ajax_ = $('#ajax_flot_div'); 30 var ajax_ = $('#ajax_flot_div');
31 var id_ = this_.attr('data-test'); 31 var id_ = this_.attr('data-test');
32 var url_ = this_.attr('data-link'); 32 var url_ = this_.attr('data-link');
33 33
34 console.log(url_); 34 console.log(url_);
35 $.ajax({ 35 $.ajax({
36 type: "GET", 36 type: "GET",
37 url: url_, 37 url: url_,
38 success: function (data) { 38 success: function (data) {
39 console.log('Ответка'); 39 console.log('Ответка');
40 ajax_.html(data); 40 ajax_.html(data);
41 }, 41 },
42 headers: { 42 headers: {
43 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 43 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
44 }, 44 },
45 error: function (data) { 45 error: function (data) {
46 console.log('Error: ' + data); 46 console.log('Error: ' + data);
47 } 47 }
48 }); 48 });
49 49
50 }); 50 });
51 </script> 51 </script>
52 @endsection 52 @endsection
53 53
54 @section('content') 54 @section('content')
55 <section class="cabinet"> 55 <section class="cabinet">
56 <div class="container"> 56 <div class="container">
57 <ul class="breadcrumbs cabinet__breadcrumbs"> 57 <ul class="breadcrumbs cabinet__breadcrumbs">
58 <li><a href="{{ route('index') }}">Главная</a></li> 58 <li><a href="{{ route('index') }}">Главная</a></li>
59 <li><b>Личный кабинет</b></li> 59 <li><b>Личный кабинет</b></li>
60 </ul> 60 </ul>
61 <div class="cabinet__wrapper"> 61 <div class="cabinet__wrapper">
62 <div class="cabinet__side"> 62 <div class="cabinet__side">
63 <div class="cabinet__side-toper"> 63 <div class="cabinet__side-toper">
64 @include('employers.emblema') 64 @include('employers.emblema')
65 </div> 65 </div>
66 @include('employers.menu', ['item' => 7]) 66 @include('employers.menu', ['item' => 7])
67 </div> 67 </div>
68 68
69 <div class="cabinet__body"> 69 <div class="cabinet__body">
70 <div class="cabinet__body-item"> 70 <div class="cabinet__body-item">
71 <h2 class="title cabinet__title">База данных</h2> 71 <h2 class="title cabinet__title">База данных</h2>
72 </div> 72 </div>
73 <div class="cabinet__body-item"> 73 <div class="cabinet__body-item">
74 <div class="cabinet__filters" style="display: flex;flex-direction: unset;justify-content: left;align-items: center;"> 74 <div class="cabinet__filters" style="display: flex;flex-direction: unset;justify-content: left;align-items: center;">
75 <div class="cabinet__filters-item"> 75 <div class="cabinet__filters-item">
76 <form class="search" action="{{ route('employer.bd') }}"> 76 <form class="search" action="{{ route('employer.bd') }}">
77 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;" value="@if (isset($_GET['search'])) {{ $_GET['search'] }} @endif"> 77 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;" value="@if (isset($_GET['search'])) {{ $_GET['search'] }} @endif">
78 <button type="submit" class="button">Найти</button> 78 <button type="submit" class="button">Найти</button>
79 <span> 79 <span>
80 <svg> 80 <svg>
81 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 81 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
82 </svg> 82 </svg>
83 </span> 83 </span>
84 </form> 84 </form>
85 </div> 85 </div>
86 <a href="javascript:void(0)" class="search-reset-button bold font18" style="color: #377d87;">Сбросить поиск</a> 86 <a href="javascript:void(0)" class="search-reset-button bold font18" style="color: #377d87;">Сбросить поиск</a>
87 </div> 87 </div>
88 <div class="cabinet__filters"> 88 <div class="cabinet__filters">
89 <div class="cabinet__export-wrap"> 89 <div class="cabinet__export-wrap">
90 <form action="{{ route('resume_download_all') }}" method="GET" target="_blank"> 90 <form action="{{ route('resume_download_all') }}" method="GET" target="_blank">
91 <div class="cabinet__export-button-wrap"> 91 <div class="cabinet__export-button-wrap">
92 <button type="submit" class="button"> 92 <button type="submit" class="button">
93 <svg> 93 <svg>
94 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> 94 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
95 </svg> 95 </svg>
96 Экспорт 96 Экспорт
97 </button> 97 </button>
98 </div> 98 </div>
99 <div class="cabinet__export-options-wrap"> 99 <div class="cabinet__export-options-wrap">
100 @foreach ($export_options as $key => $value) 100 @foreach ($export_options as $key => $value)
101 <label class="checkbox"> 101 <label class="checkbox">
102 <input type="checkbox" value="1" name="{{$key}}" class="checkbox__input" checked=""> 102 <input type="checkbox" value="1" name="{{$key}}" class="checkbox__input" checked="">
103 <span class="checkbox__icon"> 103 <span class="checkbox__icon">
104 <svg> 104 <svg>
105 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use> 105 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use>
106 </svg> 106 </svg>
107 </span> 107 </span>
108 <span class="checkbox__text"> 108 <span class="checkbox__text">
109 <span>{{$value}}</span> 109 <span>{{$value}}</span>
110 </span> 110 </span>
111 </label> 111 </label>
112 @endforeach 112 @endforeach
113 </div> 113 </div>
114 <div class="job-title-list-wrap"> 114 <div class="job-title-list-wrap">
115 <select name="job_title_list[]" data-placeholder="Выберите должности" multiple > 115 <select name="job_title_list[]" data-placeholder="Выберите должности" multiple >
116 @foreach($jobs_titles as $job_title) 116 @foreach($jobs_titles as $job_title)
117 <option hover="background-color: #377d87;" value="{{$job_title['id']}}">{{$job_title['name']}}</option> 117 <option hover="background-color: #377d87;" value="{{$job_title['id']}}">{{$job_title['name']}}</option>
118 @endforeach 118 @endforeach
119 </select> 119 </select>
120 </div> 120 </div>
121 </form> 121 </form>
122 </div> 122 </div>
123 </div> 123 </div>
124 @if(session('error')) 124 @if(session('error'))
125 <div class="cabinet__filters"> 125 <div class="cabinet__filters">
126 <p class="cabinet__export-error">{{ session('error') }}</p> 126 <p class="cabinet__export-error">{{ session('error') }}</p>
127 </div> 127 </div>
128 @endif 128 @endif
129 129
130 </div> 130 </div>
131 131
132 <div class="cabinet__body-item"> 132 <div class="cabinet__body-item">
133 <div class="cabinet__table-header"> 133 <div class="cabinet__table-header">
134 <div> 134 <div>
135 Позиции работников 135 Позиции работников
136 </div> 136 </div>
137 <span> 137 <span>
138 Пользователей найдено: 138 Пользователей найдено:
139 <b>{{ $count_users->count() }}</b> 139 <b>{{ $users->count() }}</b>
140 </span> 140 </span>
141 </div> 141 </div>
142 <div class="table table_spoiler"> 142 <div class="table table_spoiler">
143 143
144 <div class="table__scroll"> 144 <div class="table__scroll">
145 <div class="table__body table__body_min-width"> 145 <div class="table__body table__body_min-width">
146 <table> 146 <table>
147 <thead> 147 <thead>
148 <tr> 148 <tr>
149 <th style="max-width: 40px; min-width: 30px"></th> 149 <th style="max-width: 40px; min-width: 30px"></th>
150 <th>ФИО соискателя</th> 150 <th>ФИО соискателя</th>
151 <th>Должность</th> 151 <th>Должность</th>
152 <th>Наличие<br>анкеты</th> 152 <th>Наличие<br>анкеты</th>
153 </tr> 153 </tr>
154 </thead> 154 </thead>
155 <tbody> 155 <tbody>
156 @php 156 @php
157 $categories = 0; 157 $categories = 0;
158 158
159 @endphp 159 @endphp
160 160
161 @if ($users->count()) 161 @if ($users->count())
162 @foreach ($users as $key => $it) 162 @foreach ($users as $key => $it)
163 <tr> 163 <tr>
164 <td style="max-width: 40px; min-width: 30px; font-size: 1.5rem">{{ $it->workers[0]->comment }}</td> 164 <td style="max-width: 40px; min-width: 30px; font-size: 1.5rem">{{ $it->workers[0]->comment }}</td>
165 165
166 <td>{{ $it->surname." ".$it->name_man }}<br>{{ $it->surname2 }}</td> 166 <td>{{ $it->surname." ".$it->name_man }}<br>{{ $it->surname2 }}</td>
167 167
168 <td> 168 <td>
169 @if($it->workers[0]->positions_work) 169 @if($it->workers[0]->positions_work)
170 @foreach($it->workers[0]->jobs as $job) 170 @foreach($it->workers[0]->jobs as $job)
171 {{ $job->name }} 171 {{ $job->name }}
172 @if(!$loop->last) 172 @if(!$loop->last)
173 <br> 173 <br>
174 @endif 174 @endif
175 @endforeach 175 @endforeach
176 @endif 176 @endif
177 </td> 177 </td>
178 178
179 <td> 179 <td>
180 @if ($it->file !== null) 180 @if ($it->file !== null)
181 <a href="{{ asset(Storage::url($it->file)) }}" class="table__link"> 181 <a href="{{ asset(Storage::url($it->file)) }}" class="table__link">
182 <svg> 182 <svg>
183 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> 183 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
184 </svg> 184 </svg>
185 Скачать 185 Скачать
186 </a> 186 </a>
187 @endif 187 @endif
188 </td> 188 </td>
189 </tr> 189 </tr>
190 @endforeach 190 @endforeach
191 @endif 191 @endif
192 </tbody> 192 </tbody>
193 </table> 193 </table>
194 </div> 194 </div>
195 195
196 </div> 196 </div>
197 </div> 197 </div>
198 {{ $users->onEachSide(0)->appends($_GET)->links('paginate') }} 198 {{ $users->onEachSide(0)->appends($_GET)->links('paginate') }}
199 </div> 199 </div>
200 </div> 200 </div>
201 </div> 201 </div>
202 </div> 202 </div>
203 </section> 203 </section>
204 </div> 204 </div>
205 @endsection 205 @endsection
206 206
resources/views/employers/favorite.blade.php
1 @extends('layout.frontend', ['title' => 'Избраннные соискатели - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Избраннные соискатели - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 $(document).on('change', '#sort_ajax', function() { 5 $(document).on('change', '#sort_ajax', function() {
6 var this_ = $(this); 6 var this_ = $(this);
7 var val_ = this_.val(); 7 var val_ = this_.val();
8 console.log('sort items '+val_); 8 console.log('sort items '+val_);
9 9
10 $.ajax({ 10 $.ajax({
11 type: "GET", 11 type: "GET",
12 url: "{{ route('shipping_companies') }}", 12 url: "{{ route('shipping_companies') }}",
13 data: "sort="+val_+"&block=1", 13 data: "sort="+val_+"&block=1",
14 success: function (data) { 14 success: function (data) {
15 console.log('Выбор сортировки'); 15 console.log('Выбор сортировки');
16 console.log(data); 16 console.log(data);
17 $('#block_1').html(data); 17 $('#block_1').html(data);
18 }, 18 },
19 headers: { 19 headers: {
20 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 20 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
21 }, 21 },
22 error: function (data) { 22 error: function (data) {
23 data = JSON.stringify(data); 23 data = JSON.stringify(data);
24 console.log('Error: ' + data); 24 console.log('Error: ' + data);
25 } 25 }
26 }); 26 });
27 27
28 $.ajax({ 28 $.ajax({
29 type: "GET", 29 type: "GET",
30 url: "{{ route('shipping_companies') }}", 30 url: "{{ route('shipping_companies') }}",
31 data: "sort="+val_+"&block=2", 31 data: "sort="+val_+"&block=2",
32 success: function (data) { 32 success: function (data) {
33 console.log('Выбор сортировки2'); 33 console.log('Выбор сортировки2');
34 console.log(data); 34 console.log(data);
35 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 35 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
36 $('#block_2').html(data); 36 $('#block_2').html(data);
37 }, 37 },
38 headers: { 38 headers: {
39 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 39 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
40 }, 40 },
41 error: function (data) { 41 error: function (data) {
42 data = JSON.stringify(data); 42 data = JSON.stringify(data);
43 console.log('Error: ' + data); 43 console.log('Error: ' + data);
44 } 44 }
45 }); 45 });
46 }); 46 });
47 47
48 $(document).ready(function() { 48 $(document).ready(function() {
49 $(document).on('click', '.js_box_favorit', function () { 49 $(document).on('click', '.js_box_favorit', function () {
50 var id_worker = $(this).attr('data-val'); 50 var id_worker = $(this).attr('data-val');
51 var data = {code_record: id_worker}; 51 var data = {code_record: id_worker};
52 52
53 if ($(this).hasClass('active')){ 53 if ($(this).hasClass('active')){
54 data.delete = 1; 54 data.delete = 1;
55 } 55 }
56 56
57 $.ajax({ 57 $.ajax({
58 type: "GET", 58 type: "GET",
59 url: "{{ route('like_resume') }}", 59 url: "{{ route('like_resume') }}",
60 data: data, 60 data: data,
61 headers: { 61 headers: {
62 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 62 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
63 }, 63 },
64 success: function (data) { 64 success: function (data) {
65 if ($(this).hasClass('active')){ 65 if (data.deleted){
66 $(this).removeClass('active'); 66 $('#elem_'+data.id).removeClass('active');
67 } else{ 67 } else {
68 $(this).addClass('active'); 68 $('#elem_'+data.id).addClass('active');
69 } 69 }
70 }, 70 },
71 error: function (data) { 71 error: function (data) {
72 data = JSON.stringify(data); 72 data = JSON.stringify(data);
73 console.log('Error: ' + data); 73 console.log('Error: ' + data);
74 } 74 }
75 }); 75 });
76 }); 76 });
77 }); 77 });
78 $(document).on('click', '.chat', function() {
79 var this_ = $(this);
80
81 $('#_user_id').val(this_.attr('data-uid'));
82 $('#_to_user_id').val(this_.attr('data-tuid'));
83 $('#_vacancy').val(this_.attr('data-vacancy'));
84 });
78 </script> 85 </script>
79 86
80 @endsection 87 @endsection
81 88
82 @section('content') 89 @section('content')
83 <section class="cabinet"> 90 <section class="cabinet">
84 <div class="container"> 91 <div class="container">
85 <ul class="breadcrumbs cabinet__breadcrumbs"> 92 <ul class="breadcrumbs cabinet__breadcrumbs">
86 <li><a href="{{ route('index') }}">Главная</a></li> 93 <li><a href="{{ route('index') }}">Главная</a></li>
87 <li><b>Личный кабинет</b></li> 94 <li><b>Личный кабинет</b></li>
88 </ul> 95 </ul>
89 <div class="cabinet__wrapper"> 96 <div class="cabinet__wrapper">
90 <div class="cabinet__side"> 97 <div class="cabinet__side">
91 <div class="cabinet__side-toper"> 98 <div class="cabinet__side-toper">
92 @include('employers.emblema') 99 @include('employers.emblema')
93 </div> 100 </div>
94 101
95 @include('employers.menu', ['item' => 6]) 102 @include('employers.menu', ['item' => 6])
96 103
97 </div> 104 </div>
98 105
99 <div class="cabinet__body"> 106 <div class="cabinet__body">
100 <div class="cabinet__body-item"> 107 <div class="cabinet__body-item">
101 <h2 class="title cabinet__title">Избранные кандидаты</h2> 108 <h2 class="title cabinet__title">Избранные кандидаты</h2>
102 </div> 109 </div>
103 <div class="cabinet__body-item"> 110 <div class="cabinet__body-item">
104 <div class="cabinet__filters"> 111 <div class="cabinet__filters">
105 <div class="cabinet__filters-item"> 112 <div class="cabinet__filters-item">
106 <form class="search" action="{{ route('employer.favorites') }}"> 113 <form class="search" action="{{ route('employer.favorites') }}">
107 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;" value="@if ((isset($_GET['search'])) && (!empty($_GET['search']))) {{ $_GET['search'] }} @endif"> 114 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;" value="@if ((isset($_GET['search'])) && (!empty($_GET['search']))) {{ $_GET['search'] }} @endif">
108 <button type="submit" class="button">Найти</button> 115 <button type="submit" class="button">Найти</button>
109 <span> 116 <span>
110 <svg> 117 <svg>
111 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 118 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
112 </svg> 119 </svg>
113 </span> 120 </span>
114 </form> 121 </form>
115 </div> 122 </div>
116 </div> 123 </div>
117 <div class="cvs"> 124 <div class="cvs">
118 @if ((isset($Workers) && ($Workers->count()))) 125 @if ((isset($Workers) && ($Workers->count())))
119 @foreach ($Workers as $it) 126 @foreach ($Workers as $it)
120 <div class="cvs__body"> 127 <div class="cvs__body">
121 <div class="cvs__item"> 128 <div class="cvs__item">
122 129
123 <div class="cvs__item-header"> 130 <div class="cvs__item-header">
124 <div class="cvs__item-photo"> 131 <div class="cvs__item-photo">
125 <svg> 132 <svg>
126 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 133 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
127 </svg> 134 </svg>
128 @if (!empty($it->photo)) 135 @if (!empty($it->photo))
129 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($it->photo)) }}" alt=""> 136 <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($it->photo)) }}" alt="">
130 @else 137 @else
131 <img src="{{ asset('images/default_man.jpg') }}" alt=""> 138 <img src="{{ asset('images/default_man.jpg') }}" alt="">
132 @endif 139 @endif
133 </div> 140 </div>
134 141
135 <div class="cvs__item-buttons"> 142 <div class="cvs__item-buttons">
136 <button type="button" 143 <button type="button"
137 id="elem_{{ $it->id }}" 144 id="elem_{{ $it->id }}"
138 data-val="{{ $it->id }}" 145 data-val="{{ $it->id }}"
139 class="like cvs__item-like js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($it) }}"> 146 class="like cvs__item-like js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($it) }}">
140 <svg class="mr-10"> 147 <svg class="mr-10">
141 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 148 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
142 </svg> 149 </svg>
143 <span class="to-favorites">Добавить в избранное</span> 150 <span class="to-favorites">Добавить в избранное</span>
144 <span class="in-favorites">Убрать из избранного</span> 151 <span class="in-favorites">Убрать из избранного</span>
145 </button> 152 </button>
146 153
147 @guest 154 <button type="button"
148 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' 155 class="chat"
149 class="chat"> 156 data-fancybox
150 <svg class="mr-10"> 157 data-src="#send2"
151 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> 158 data-vacancy="0"
152 </svg> 159 data-uid="{{ Auth()->user()->id }}"
153 <span>Написать</span> 160 data-tuid="{{ $it->users->id }}"
154 </button> 161 data-options='{"touch":false,"autoFocus":false}'>
155 @else 162 <svg class="mr-10">
156 @if (App\Classes\StatusUser::Status()==0) 163 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
157 @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message)) 164 </svg>
158 <button type="button" class="chat" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ Auth()->user()->id }}" data-tuid="{{ $it->users->id }}" data-options='{"touch":false,"autoFocus":false}'> 165 <span>Написать</span>
159 <svg class="mr-10"> 166 </button>
160 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
161 </svg>
162 <span>Написать</span>
163 </button>
164 @endif
165 @else
166 <button type="button" data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}'
167 class="chat">
168 <svg class="mr-10">
169 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
170 </svg>
171 <span>Написать</span>
172 </button>
173 @endif
174 @endif
175 167
176 <a href="{{ route('resume_profile', ['worker' => $it->id]) }}" class="button">Подробнее</a> 168 <a href="{{ route('resume_profile', ['worker' => $it->id]) }}" class="button">Подробнее</a>
177 </div> 169 </div>
178 </div> 170 </div>
179
180
181 <div class="cvs__item-text"> 171 <div class="cvs__item-text">
182 <div class="cvs__item-text-row"> 172 <div class="cvs__item-text-row">
183 <div class="flex" style="align-items: start;"> 173 <div class="flex" style="align-items: start;">
184 <div class="cvs__item-text-status @if ($it->status_work == 0) looking-for-job @endif"> 174 <div class="cvs__item-text-status @if ($it->status_work == 0) looking-for-job @endif">
185 @php 175 @php
186 $worker_statuses = App\Enums\WorkerStatuses::getWorkerStatuses(); 176 $worker_statuses = App\Enums\WorkerStatuses::getWorkerStatuses();
187 @endphp 177 @endphp
188 {{ $worker_statuses[$it->status_work] }} 178 {{ $worker_statuses[$it->status_work] }}
189 </div> 179 </div>
190 <div class="cvs__item-text-updated-at"> 180 <div class="cvs__item-text-updated-at">
191 Обновлено: {{ date('d.m.Y', strtotime($it->updated_at)) }} 181 Обновлено: {{ date('d.m.Y', strtotime($it->updated_at)) }}
192 </div> 182 </div>
193 </div> 183 </div>
194 <div> 184 <div>
195 <b>Предпочтение по типу судна:</b> 185 <b>Предпочтение по типу судна:</b>
196 <div>{{ $it->boart_type_preference ?? '-' }}</div> 186 <div>{{ $it->boart_type_preference ?? '-' }}</div>
197 </div> 187 </div>
198 </div> 188 </div>
199 189
200 <div class="cvs__item-text-row"> 190 <div class="cvs__item-text-row">
201 <div> 191 <div>
202 <b>ФИО:</b> 192 <b>ФИО:</b>
203 <div>@if (isset($it->users)){{ $it->users->surname." ".$it->users->name_man." ".$it->users->surname2 }} @endif</div> 193 <div>@if (isset($it->users)){{ $it->users->surname." ".$it->users->name_man." ".$it->users->surname2 }} @endif</div>
204 </div> 194 </div>
205 <div> 195 <div>
206 <b>Наличие визы:</b> 196 <b>Наличие визы:</b>
207 <div>{{ $it->visa_available ?? '-' }}</div> 197 <div>{{ $it->visa_available ?? '-' }}</div>
208 </div> 198 </div>
209 </div> 199 </div>
210 200
211 <div class="cvs__item-text-row"> 201 <div class="cvs__item-text-row">
212 <div> 202 <div>
213 <b>Возраст:</b> 203 <b>Возраст:</b>
214 <div>{{ $it->old_year ?? '-' }}</div> 204 <div>{{ $it->old_year ?? '-' }}</div>
215 </div> 205 </div>
216 <div> 206 <div>
217 <b>Наличие танкерных документов:</b> 207 <b>Наличие танкерных документов:</b>
218 <div>{{ $it->tanker_documents_available ?? '-' }}</div> 208 <div>{{ $it->tanker_documents_available ?? '-' }}</div>
219 </div> 209 </div>
220 </div> 210 </div>
221 211
222 <div class="cvs__item-text-row"> 212 <div class="cvs__item-text-row">
223 <div> 213 <div>
224 <b>Желаемые вакансии:</b> 214 <b>Желаемые вакансии:</b>
225 <div> 215 <div>
226 @if ($it->job_titles->count()) 216 @if ($it->job_titles->count())
227 @foreach ($it->job_titles as $job_title) 217 @foreach ($it->job_titles as $job_title)
228 {{ $job_title->name }} 218 {{ $job_title->name }}
229 @if (!$loop->last) / @endif 219 @if (!$loop->last) / @endif
230 @endforeach 220 @endforeach
231 @else 221 @else
232 - 222 -
233 @endif 223 @endif
234 </div> 224 </div>
235 </div> 225 </div>
236 <div> 226 <div>
237 <b>Наличие подтверждения для работы на ВВП:</b> 227 <b>Наличие подтверждения для работы на ВВП:</b>
238 <div>{{ $it->confirmation_work_for_vvp ?? '-' }}</div> 228 <div>{{ $it->confirmation_work_for_vvp ?? '-' }}</div>
239 </div> 229 </div>
240 </div> 230 </div>
241 231
242 <div class="cvs__item-text-row"> 232 <div class="cvs__item-text-row">
243 <div> 233 <div>
244 <b>Пожелание к З/П:</b> 234 <b>Пожелание к З/П:</b>
245 <div>{{ $it->salary_expectations ?? '-' }}</div> 235 <div>{{ $it->salary_expectations ?? '-' }}</div>
246 </div> 236 </div>
247 <div> 237 <div>
248 <b>Город проживания</b> 238 <b>Город проживания</b>
249 <div>{{ $it->city ?? "-" }}</div> 239 <div>{{ $it->city ?? "-" }}</div>
250 </div> 240 </div>
251 </div> 241 </div>
252 242
253 <div class="cvs__item-text-row"> 243 <div class="cvs__item-text-row">
254 <div> 244 <div>
255 <b>Уровень английского:</b> 245 <b>Уровень английского:</b>
256 <div>{{ $it->english_level ?? '-' }}</div> 246 <div>{{ $it->english_level ?? '-' }}</div>
257 </div> 247 </div>
258 <div> 248 <div>
259 <b>Телефон:</b> 249 <b>Телефон:</b>
260 <div><a href="tel:{{ $it->telephone }}">{{ $it->telephone ?? '-' }}</a></div> 250 <div><a href="tel:{{ $it->telephone }}">{{ $it->telephone ?? '-' }}</a></div>
261 </div> 251 </div>
262 </div> 252 </div>
263 253
264 <div class="cvs__item-text-row"> 254 <div class="cvs__item-text-row">
265 <div> 255 <div>
266 <b>Дата готовности к посадке:</b> 256 <b>Дата готовности к посадке:</b>
267 <div>{{ $it->ready_boart_date ?? '-' }}</div> 257 <div>{{ $it->ready_boart_date ?? '-' }}</div>
268 </div> 258 </div>
269 <div> 259 <div>
270 <b>E-mail:</b> 260 <b>E-mail:</b>
271 <div><a href="mailto:{{ $it->email }}">{{ $it->email }}</a></div> 261 <div><a href="mailto:{{ $it->email }}">{{ $it->email }}</a></div>
272 </div> 262 </div>
273 </div> 263 </div>
274 </div> 264 </div>
275 </div> 265 </div>
276 </div> 266 </div>
277 @endforeach 267 @endforeach
278 </div> 268 </div>
279 @else 269 @else
280 <div class="notify"> 270 <div class="notify">
281 <svg> 271 <svg>
282 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> 272 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use>
283 </svg> 273 </svg>
284 <span>Нет избранных кандидатов</span> 274 <span>Нет избранных кандидатов</span>
285 </div> 275 </div>
286 @endif 276 @endif
287 </div> 277 </div>
288 </div> 278 </div>
resources/views/index.blade.php
1 @extends('layout.frontend', ['title' => 'Главная страница РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Главная страница РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 4
5 @endsection 5 @endsection
6 6
7 @section('content') 7 @section('content')
8 @include('messages_error')
9 <section class="work"> 8 <section class="work">
10 <div class="container"> 9 <div class="container">
11 <img src="{{ asset('images/1.png') }}" alt="" class="work__pic"> 10 <img src="{{ asset('images/1.png') }}" alt="" class="work__pic">
12 <div class="work__body"> 11 <div class="work__body">
13 <div class="work__title"> 12 <div class="work__title">
14 <h4>Работа в море / 13 <h4>Работа в море /
15 <span class="br">Работа на реке</span></h4> 14 <span class="br">Работа на реке</span></h4>
16 </div> 15 </div>
17 <div class="work__text">Информационный портал rekamore.su - место где работники морского и речного флота могут найти для себя хорошую работу, 16 <div class="work__text">Информационный портал rekamore.su - место где работники морского и речного флота могут найти для себя хорошую работу,
18 а работодатели отличных специалистов 17 а работодатели отличных специалистов
19 </div> 18 </div>
20 <div class="work__list"> 19 <div class="work__list">
21 <div>Тысячи соискателей увидят Ваше объявление</div> 20 <div>Тысячи соискателей увидят Ваше объявление</div>
22 <div>Десятки компаний выкладывают объявления каждый день</div> 21 <div>Десятки компаний выкладывают объявления каждый день</div>
23 </div> 22 </div>
24 <form class="work__form width100 flex" style="" action="{{ route('vacancies') }}" method="GET"> 23 <form class="work__form width100 flex" style="" action="{{ route('vacancies') }}" method="GET">
25 24
26 <div class="select select_search" style="max-width: 60%"> 25 <div class="select select_search" style="max-width: 60%">
27 <div class="select__icon"> 26 <div class="select__icon">
28 <svg> 27 <svg>
29 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 28 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
30 </svg> 29 </svg>
31 </div> 30 </div>
32 <select class="js-select2 jobs" id="job" name="job"> 31 <select class="js-select2 jobs" id="job" name="job">
33 <option value="0">Выберите должность</option> 32 <option value="0">Выберите должность</option>
34 @if ($Job_title->count()) 33 @if ($Job_title->count())
35 @foreach($Job_title as $JT) 34 @foreach($Job_title as $JT)
36 <option value="{{ $JT->id }}" @if ((isset($_GET['job'])) && ($_GET['job'] == $JT->id)) selected @endif>{{ $JT->name }}</option> 35 <option value="{{ $JT->id }}" @if ((isset($_GET['job'])) && ($_GET['job'] == $JT->id)) selected @endif>{{ $JT->name }}</option>
37 @endforeach 36 @endforeach
38 @endif 37 @endif
39 </select> 38 </select>
40 </div> 39 </div>
41 40
42 <button type="submit" class="button button_light" style="height: auto;">Посмотреть&nbsp;вакансии</button> 41 <button type="submit" class="button button_light" style="height: auto;">Посмотреть&nbsp;вакансии</button>
43 </form> 42 </form>
44 @if(Auth()->user() === null || Auth()->user()->is_worker === 1) 43 @if(Auth()->user() === null || Auth()->user()->is_worker === 1)
45 <a href="{{ route('page', ['pages' => 'Usloviya-razmescheniya']) }}" class="button work__search">Я ищу сотрудника</a> 44 <a href="{{ route('page', ['pages' => 'Usloviya-razmescheniya']) }}" class="button work__search">Я ищу сотрудника</a>
46 @else 45 @else
47 <a href="{{ route('employer.cabinet') }}" class="button work__search">Я ищу сотрудника</a> 46 <a href="{{ route('employer.cabinet') }}" class="button work__search">Я ищу сотрудника</a>
48 @endif 47 @endif
49 <div class="work__get"> 48 <div class="work__get">
50 <b>Скачать приложение</b> 49 <b>Скачать приложение</b>
51 <a href=""> 50 <a href="">
52 <img src="{{ asset('images/google.svg') }}" alt=""> 51 <img src="{{ asset('images/google.svg') }}" alt="">
53 </a> 52 </a>
54 <a href=""> 53 <a href="">
55 <img src="{{ asset('images/apple.svg') }}" alt=""> 54 <img src="{{ asset('images/apple.svg') }}" alt="">
56 </a> 55 </a>
57 </div> 56 </div>
58 </div> 57 </div>
59 </div> 58 </div>
60 </section> 59 </section>
61 60
62 @if ($blocks_counters) 61 @if ($blocks_counters)
63 <section class="numbers"> 62 <section class="numbers">
64 <div class="container"> 63 <div class="container">
65 <div class="numbers__body"> 64 <div class="numbers__body">
66 @foreach($blocks_counters as $block_counter) 65 @foreach($blocks_counters as $block_counter)
67 <div class="numbers__item"> 66 <div class="numbers__item">
68 <b>{{$block_counter['extra']}}</b> 67 <b>{{$block_counter['extra']}}</b>
69 <span>{{$block_counter['title']}}</span> 68 <span>{{$block_counter['title']}}</span>
70 {{$block_counter['description']}} 69 {{$block_counter['description']}}
71 </div> 70 </div>
72 @endforeach 71 @endforeach
73 </div> 72 </div>
74 </div> 73 </div>
75 </section> 74 </section>
76 @endif 75 @endif
77 76
78 <main class="main"> 77 <main class="main">
79 <div class="container"> 78 <div class="container">
80 <div class="main__vacancies"> 79 <div class="main__vacancies">
81 <h2 class="main__vacancies-title">Категории вакансий</h2> 80 <h2 class="main__vacancies-title">Категории вакансий</h2>
82 <div class="vacancies__body"> 81 <div class="vacancies__body">
83 <div class="vacancies__list" id="block_ajax" name="block_ajax"> 82 <div class="vacancies__list" id="block_ajax" name="block_ajax">
84 @foreach($Main_Job as $key => $it_main) 83 @foreach($Main_Job as $key => $it_main)
85 <div class="vacancies__list-col"> 84 <div class="vacancies__list-col">
86 @include('block_real_new', ['it_main' => $it_main, 'category' => $key]) 85 @include('block_real_new', ['it_main' => $it_main, 'category' => $key])
87 </div> 86 </div>
88 @endforeach 87 @endforeach
89 <!--_include('block_real', ['flot' => $flot, 'position' => $Position[$flot->position_id]])--> 88 <!--_include('block_real', ['flot' => $flot, 'position' => $Position[$flot->position_id]])-->
90 </div> 89 </div>
91 </div> 90 </div>
92 </div> 91 </div>
93 </div> 92 </div>
94 </main> 93 </main>
95 94
96 <section class="employer"> 95 <section class="employer">
97 <div class="container"> 96 <div class="container">
98 <div class="title"><h4>Работодатели</h4></div> 97 <div class="title"><h4>Работодатели</h4></div>
99 98
100 <div class="employer__body"> 99 <div class="employer__body">
101 @if ($employers->count()) 100 @if ($employers->count())
102 @foreach($employers as $emp) 101 @foreach($employers as $emp)
103 @if (!empty($emp->employer->logo)) 102 @if (!empty($emp->employer->logo))
104 <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}"> 103 <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}">
105 <img 104 <img
106 src="{{ asset(Storage::url($emp->employer->logo)) }}" 105 src="{{ asset(Storage::url($emp->employer->logo)) }}"
107 alt="{{ $emp->employer->name_company }}" 106 alt="{{ $emp->employer->name_company }}"
108 title="{{ $emp->employer->name_company }}" 107 title="{{ $emp->employer->name_company }}"
109 > 108 >
110 </a> 109 </a>
111 @else 110 @else
112 <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}"> 111 <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}">
113 <img 112 <img
114 src="{{ asset('images/logo_emp.png') }}" 113 src="{{ asset('images/logo_emp.png') }}"
115 alt="{{ $emp->employer->name_company }}" 114 alt="{{ $emp->employer->name_company }}"
116 title="{{ $emp->employer->name_company }}" 115 title="{{ $emp->employer->name_company }}"
117 > 116 >
118 </a> 117 </a>
119 @endif 118 @endif
120 @endforeach 119 @endforeach
121 @else 120 @else
122 <h5>Тут нет никаких записей</h5> 121 <h5>Тут нет никаких записей</h5>
123 @endif 122 @endif
124 </div> 123 </div>
125 124
126 <div class="swiper-pagination"></div> 125 <div class="swiper-pagination"></div>
127 </div> 126 </div>
128 <a href="{{ route('shipping_companies') }}" class="employer__more button button_light">Все работодатели</a> 127 <a href="{{ route('shipping_companies') }}" class="employer__more button button_light">Все работодатели</a>
129 128
130 </section> 129 </section>
131 <section class="about"> 130 <section class="about">
132 <div class="container"> 131 <div class="container">
133 <div class="about__wrapper"> 132 <div class="about__wrapper">
134 <div class="title about__title"><h4>О нас</h4></div> 133 <div class="title about__title"><h4>О нас</h4></div>
135 <div class="about__body"> 134 <div class="about__body">
136 <div class="about__line"></div> 135 <div class="about__line"></div>
137 <div class="about__item"> 136 <div class="about__item">
138 <b>Для работодателей</b> 137 <b>Для работодателей</b>
139 <span> 138 <span>
140 Нашим ресурсом пользуются более 150 судоходных компаний России и СНГ, в настоящее время мы самая эффективная площадка. 139 Нашим ресурсом пользуются более 150 судоходных компаний России и СНГ, в настоящее время мы самая эффективная площадка.
141 Подробности о работе сервиса и стоимости обслуживания можно получить перейдя по ссылке 140 Подробности о работе сервиса и стоимости обслуживания можно получить перейдя по ссылке
142 <a href="{{ route('page', ['pages' => 'Stoimost-razmescheniya']) }}">здесь</a>. 141 <a href="{{ route('page', ['pages' => 'Stoimost-razmescheniya']) }}">здесь</a>.
143 </span> 142 </span>
144 <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('bd_resume') }}">Поиск сотрудников</a> 143 <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('bd_resume') }}">Поиск сотрудников</a>
145 </div> 144 </div>
146 <div class="about__item"> 145 <div class="about__item">
147 <b>Для сотрудников</b> 146 <b>Для сотрудников</b>
148 <span> 147 <span>
149 Работа найдется для каждого, а удобная фильтрация вакансий по должностям сделает поиск приятным 148 Работа найдется для каждого, а удобная фильтрация вакансий по должностям сделает поиск приятным
150 </span> 149 </span>
151 <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('vacancies') }}">Ищу работу</a> 150 <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('vacancies') }}">Ищу работу</a>
152 </div> 151 </div>
153 </div> 152 </div>
154 </div> 153 </div>
155 </div> 154 </div>
156 </section> 155 </section>
157 156
158 @if ($news->count()) 157 @if ($news->count())
159 <section class="news"> 158 <section class="news">
160 <div class="container"> 159 <div class="container">
161 <div class="news__toper"> 160 <div class="news__toper">
162 <div class="title"><h4>Новости и статьи</h4></div> 161 <div class="title"><h4>Новости и статьи</h4></div>
163 <div class="navs"> 162 <div class="navs">
164 <button class="js-news-swiper-button-prev"> 163 <button class="js-news-swiper-button-prev">
165 <svg class="rotate180"> 164 <svg class="rotate180">
166 <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> 165 <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use>
167 </svg> 166 </svg>
168 </button> 167 </button>
169 <button class="js-news-swiper-button-next"> 168 <button class="js-news-swiper-button-next">
170 <svg> 169 <svg>
171 <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> 170 <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use>
172 </svg> 171 </svg>
173 </button> 172 </button>
174 </div> 173 </div>
175 </div> 174 </div>
176 175
177 <div class="swiper js-news-swiper"> 176 <div class="swiper js-news-swiper">
178 <div class="swiper-wrapper"> 177 <div class="swiper-wrapper">
179 178
180 @foreach ($news as $new) 179 @foreach ($news as $new)
181 <div class="swiper-slide"> 180 <div class="swiper-slide">
182 <div class="news__item"> 181 <div class="news__item">
183 @if (empty($new->image)) 182 @if (empty($new->image))
184 <img src="{{ asset('/images/default_ship.jpg') }}" alt="" class="news__item-pic"> 183 <img src="{{ asset('/images/default_ship.jpg') }}" alt="" class="news__item-pic">
185 @else 184 @else
186 <img src="{{ asset(Storage::url($new->image)) }}" alt="" class="news__item-pic"> 185 <img src="{{ asset(Storage::url($new->image)) }}" alt="" class="news__item-pic">
187 @endif 186 @endif
188 <div class="news__item-body"> 187 <div class="news__item-body">
189 <time datetime="{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}" class="news__item-date">{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}</time> 188 <time datetime="{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}" class="news__item-date">{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}</time>
190 <span class="news__item-title">{{ $new->title }}</span> 189 <span class="news__item-title">{{ $new->title }}</span>
191 <span class="news__item-text">{!! mb_strimwidth($new->text, 0, 100) !!}</span> 190 <span class="news__item-text">{!! mb_strimwidth($new->text, 0, 100) !!}</span>
192 <a href="{{ route('detail_new', ['new' => $new->id]) }}" class="news__item-more button button_light">Читать далее</a> 191 <a href="{{ route('detail_new', ['new' => $new->id]) }}" class="news__item-more button button_light">Читать далее</a>
193 </div> 192 </div>
194 </div> 193 </div>
195 </div> 194 </div>
196 @endforeach 195 @endforeach
197 196
198 </div> 197 </div>
199 <div class="swiper-pagination"></div> 198 <div class="swiper-pagination"></div>
200 </div> 199 </div>
201 <a href="{{ route('news') }}" class="news__all button button_light">Все новости</a> 200 <a href="{{ route('news') }}" class="news__all button button_light">Все новости</a>
202 201
203 </div> 202 </div>
204 </section> 203 </section>
205 @endif 204 @endif
206 205
207 <section class="info"> 206 <section class="info">
208 <div class="container"> 207 <div class="container">
209 <img src="images/5.png" alt="" class="info__pic"> 208 <img src="images/5.png" alt="" class="info__pic">
210 <div class="info__body"> 209 <div class="info__body">
211 <div class="title info__title"><h4>Мы в социальных сетях</h4></div> 210 <div class="title info__title"><h4>Мы в социальных сетях</h4></div>
212 <div class="info__item"> 211 <div class="info__item">
213 <div class="info__text"> 212 <div class="info__text">
214 Телеграм — Подпишитесь на наш телеграм канал и получайте уведомления о новых вакансиях прямо на свой смартфон 213 Телеграм — Подпишитесь на наш телеграм канал и получайте уведомления о новых вакансиях прямо на свой смартфон
215 </div> 214 </div>
216 <a href="{{ $companies[0]->telegram }}" class="info__link" style="background:#20A0E1"> 215 <a href="{{ $companies[0]->telegram }}" class="info__link" style="background:#20A0E1">
217 <svg> 216 <svg>
218 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> 217 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use>
219 </svg> 218 </svg>
220 Телеграм 219 Телеграм
221 </a> 220 </a>
222 </div> 221 </div>
223 <div class="info__item"> 222 <div class="info__item">
224 <div class="info__text"> 223 <div class="info__text">
225 Вконтакте — Сообщество работников морского и речного флота, актуальная подборка вакансий 224 Вконтакте — Сообщество работников морского и речного флота, актуальная подборка вакансий
226 </div> 225 </div>
227 <a href="{{ $companies[0]->vkontact }}" class="info__link" style="background:#2787F5"> 226 <a href="{{ $companies[0]->vkontact }}" class="info__link" style="background:#2787F5">
228 <svg> 227 <svg>
229 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> 228 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use>
230 </svg> 229 </svg>
231 ВКонтакте 230 ВКонтакте
232 </a> 231 </a>
233 </div> 232 </div>
234 </div> 233 </div>
235 </div> 234 </div>
236 </section> 235 </section>
237 @endsection 236 @endsection
238 237
resources/views/js/vacancy-response.blade.php
File was created 1 <script>
2 $(document).on('click', '.ask_comment', function() {
3 var this_ = $(this);
4
5 $('#modal_user_id').val(this_.attr('data-uid'));
6 $('#modal_to_user_id').val(this_.attr('data-tuid'));
7 $('#modal_vacancy').val(this_.attr('data-vacancy'));
8 });
9
10 $(document).on('click', '.ask_percent', function() {
11 $('#modal_vacancy')
12 .val($(this).attr('data-vacancy'))
13 .trigger('change');
14 });
15 </script>
16
resources/views/list_vacancies.blade.php
1 @php 1 @php
2 use App\Classes\StatusUser; 2 use App\Classes\StatusUser;
3 @endphp 3 @endphp
4 4
5 @extends('layout.frontend', ['title' => 'Вакансии РекаМоре']) 5 @extends('layout.frontend', ['title' => 'Вакансии РекаМоре'])
6 6
7 @section('scripts') 7 @section('scripts')
8 <script> 8 <script>
9 $(document).on('change', '#jobs', function() { 9 $(document).on('change', '#jobs', function() {
10 var val = $(this).val(); 10 var val = $(this).val();
11 var main_oskar = $('#main_ockar'); 11 var main_oskar = $('#main_ockar');
12 var ti_head = $('#title_head'); 12 var ti_head = $('#title_head');
13 13
14 console.log(val); 14 console.log(val);
15 15
16 $.ajax({ 16 $.ajax({
17 type: "GET", 17 type: "GET",
18 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", 18 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}",
19 data: "job="+val, 19 data: "job="+val,
20 success: function (data) { 20 success: function (data) {
21 main_oskar.html(data); 21 main_oskar.html(data);
22 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?job="+val+"@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 22 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?job="+val+"@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
23 }, 23 },
24 headers: { 24 headers: {
25 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 25 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
26 }, 26 },
27 error: function (data) { 27 error: function (data) {
28 data = JSON.stringify(data); 28 data = JSON.stringify(data);
29 console.log('Error: ' + data); 29 console.log('Error: ' + data);
30 } 30 }
31 }); 31 });
32 32
33 if ((val == '') || (val == '0')) { 33 if ((val == '') || (val == '0')) {
34 title_head.html('Все категории'); 34 title_head.html('Все категории');
35 } else { 35 } else {
36 $.ajax({ 36 $.ajax({
37 type: "GET", 37 type: "GET",
38 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}?@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif", 38 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}?@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif",
39 data: "job=" + val +"&title=1", 39 data: "job=" + val +"&title=1",
40 success: function (data) { 40 success: function (data) {
41 }, 41 },
42 42
43 headers: { 43 headers: {
44 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 44 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
45 }, 45 },
46 46
47 error: function (data) { 47 error: function (data) {
48 data = JSON.stringify(data); 48 data = JSON.stringify(data);
49 console.log('Error: ' + data); 49 console.log('Error: ' + data);
50 } 50 }
51 }); 51 });
52 } 52 }
53 }); 53 });
54 54
55 $(document).on('click', '.ask_comment', function() {
56 var this_ = $(this);
57
58 $('#modal_user_id').val(this_.attr('data-uid'));
59 $('#modal_to_user_id').val(this_.attr('data-tuid'));
60 $('#modal_vacancy').val(this_.attr('data-vacancy'));
61 });
62
63 $(document).on('click', '.ask_percent', function() {
64 $('#modal_vacancy')
65 .val($(this).attr('data-vacancy'))
66 .trigger('change');
67 });
68
69 $(document).on('change', '#sort_ajax', function() { 55 $(document).on('change', '#sort_ajax', function() {
70 var this_ = $(this); 56 var this_ = $(this);
71 var val_ = this_.val(); 57 var val_ = this_.val();
72 58
73 $.ajax({ 59 $.ajax({
74 type: "GET", 60 type: "GET",
75 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", 61 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}",
76 data: "sort="+val_+"&block=1", 62 data: "sort="+val_+"&block=1",
77 success: function (data) { 63 success: function (data) {
78 $('#main_ockar').html(data); 64 $('#main_ockar').html(data);
79 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?sort="+val_+"@if (isset($_GET['job']))&job={{ $_GET['job'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 65 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?sort="+val_+"@if (isset($_GET['job']))&job={{ $_GET['job'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
80 }, 66 },
81 headers: { 67 headers: {
82 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 68 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
83 }, 69 },
84 error: function (data) { 70 error: function (data) {
85 data = JSON.stringify(data); 71 data = JSON.stringify(data);
86 console.log('Error: ' + data); 72 console.log('Error: ' + data);
87 } 73 }
88 }); 74 });
89 }); 75 });
90 76
91 $(document).ready(function(){ 77 $(document).ready(function(){
92 var sel = $('#select2-sort_ajax-container'); 78 var sel = $('#select2-sort_ajax-container');
93 var key = getUrlParameter('sort'); 79 var key = getUrlParameter('sort');
94 80
95 if (key !=='') { 81 if (key !=='') {
96 switch (key) { 82 switch (key) {
97 case "default": sel.html('Сортировка (по умолчанию)'); break; 83 case "default": sel.html('Сортировка (по умолчанию)'); break;
98 case "name_up": sel.html('По имени (возрастание)'); break; 84 case "name_up": sel.html('По имени (возрастание)'); break;
99 case "name_down": sel.html('По дате (убывание)'); break; 85 case "name_down": sel.html('По дате (убывание)'); break;
100 case "created_at_up": sel.html('По дате (возрастание)'); break; 86 case "created_at_up": sel.html('По дате (возрастание)'); break;
101 case "created_at_down": sel.html('По дате (убывание)'); break; 87 case "created_at_down": sel.html('По дате (убывание)'); break;
102 } 88 }
103 89
104 } 90 }
105 }); 91 });
106 </script> 92 </script>
107 @include('js.favorite-vacancy-45') 93 @include('js.favorite-vacancy-45')
94 @include('js.vacancy-response')
108 @endsection 95 @endsection
109 @section('content') 96 @section('content')
110 <section class="thing"> 97 <section class="thing">
111 <div class="container"> 98 <div class="container">
112 <form class="thing__body" action="{{ route('list-vacancies', ['categories' => (!empty($Name_categori)) ? $Name_categori[0]->id : '0']) }}" method="POST"> 99 <form class="thing__body" action="{{ route('list-vacancies', ['categories' => (!empty($Name_categori)) ? $Name_categori[0]->id : '0']) }}" method="POST">
113 <ul class="breadcrumbs thing__breadcrumbs"> 100 <ul class="breadcrumbs thing__breadcrumbs">
114 <li><a href="{{ route('index') }}">Главная</a></li> 101 <li><a href="{{ route('index') }}">Главная</a></li>
115 <li><a href="{{ route('vacancies') }}">Вакансии</a></li> 102 <li><a href="{{ route('vacancies') }}">Вакансии</a></li>
116 <li><b>{{ isset($Name_categori[0]) ? $Name_categori[0]->name : 'Все категории' }}</b></li> 103 <li><b>{{ isset($Name_categori[0]) ? $Name_categori[0]->name : 'Все категории' }}</b></li>
117 </ul> 104 </ul>
118 <h1 class="thing__title">Вакансии</h1> 105 <h1 class="thing__title">Вакансии</h1>
119 <p class="thing__text"> 106 <p class="thing__text">
120 Для удобного и быстрого поиска по определенной должности воспользуйтесь фильтром. В выпадающем списке выберите должность. 107 Для удобного и быстрого поиска по определенной должности воспользуйтесь фильтром. В выпадающем списке выберите должность.
121 </p> 108 </p>
122 <div class="select select_search thing__select"> 109 <div class="select select_search thing__select">
123 <div class="select__icon"> 110 <div class="select__icon">
124 <svg> 111 <svg>
125 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 112 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
126 </svg> 113 </svg>
127 </div> 114 </div>
128 <select class="js-select2" id="jobs" name="jobs"> 115 <select class="js-select2" id="jobs" name="jobs">
129 <option value="0" selected>Выберите должность</option> 116 <option value="0" selected>Выберите должность</option>
130 @if ($Job_title->count()) 117 @if ($Job_title->count())
131 @foreach($Job_title as $JT) 118 @foreach($Job_title as $JT)
132 <option value="{{ $JT->id }}" @if(isset($_GET['job']) && ($_GET['job'] == $JT->id)) selected @endif>{{ $JT->name }}</option> 119 <option value="{{ $JT->id }}" @if(isset($_GET['job']) && ($_GET['job'] == $JT->id)) selected @endif>{{ $JT->name }}</option>
133 @endforeach 120 @endforeach
134 @endif 121 @endif
135 </select> 122 </select>
136 </div> 123 </div>
137 </form> 124 </form>
138 </div> 125 </div>
139 </section> 126 </section>
140 <main class="main"> 127 <main class="main">
141 <div class="container"> 128 <div class="container">
142 <div class="main__vacancies" > 129 <div class="main__vacancies" >
143 @if (isset($Name_categori) && ($Name_categori !== '')) 130 @if (isset($Name_categori) && ($Name_categori !== ''))
144 <h2 class="main__vacancies-title">Категория вакансий {{ $Name_categori }}</h2> 131 <h2 class="main__vacancies-title">Категория вакансий {{ $Name_categori }}</h2>
145 @else 132 @else
146 <h2 class="main__vacancies-title" id="title_head" name="title_head">Все категории</h2> 133 <h2 class="main__vacancies-title" id="title_head" name="title_head">Все категории</h2>
147 @endif 134 @endif
148 <div class="filters main__vacancies-filters"> 135 <div class="filters main__vacancies-filters">
149 <div class="filters__label" 136 <div class="filters__label"
150 id="col-vo" 137 id="col-vo"
151 name="col-vo" 138 name="col-vo"
152 > 139 >
153 Показано <span id="firstItem">{{ $Query->firstItem() }}</span> – <span id="lastItem">{{ $Query->lastItem() }}</span> из <span id="Query_count">@isset($Query_count) {{ $Query_count }} @else 0 @endisset</span> результатов поиска 140 Показано <span id="firstItem">{{ $Query->firstItem() }}</span> – <span id="lastItem">{{ $Query->lastItem() }}</span> из <span id="Query_count">@isset($Query_count) {{ $Query_count }} @else 0 @endisset</span> результатов поиска
154 </div> 141 </div>
155 </div> 142 </div>
156 <div class="main__vacancies" style="width:100%;" id="main_ockar" name="main_oskar"> 143 <div class="main__vacancies" style="width:100%;" id="main_ockar" name="main_oskar">
157 @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp 144 @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp
158 @foreach ($Query as $Q) 145 @foreach ($Query as $Q)
159 @foreach ($Reclama as $Rec) 146 @foreach ($Reclama as $Rec)
160 @if ($Rec->position == $i) 147 @if ($Rec->position == $i)
161 <div class="main__vacancies-thing"> 148 <div class="main__vacancies-thing">
162 @if (!empty($Rec->image)) 149 @if (!empty($Rec->image))
163 <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 150 <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
164 @else 151 @else
165 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 152 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
166 @endif 153 @endif
167 <div class="main__vacancies-thing-body"> 154 <div class="main__vacancies-thing-body">
168 <h2>{{ $Rec->title }}</h2> 155 <h2>{{ $Rec->title }}</h2>
169 <div class="main__vacancies-thing-scroll"> 156 <div class="main__vacancies-thing-scroll">
170 {!! $Rec->text !!} 157 {!! $Rec->text !!}
171 </div> 158 </div>
172 <a href="{{ $Rec->link }}" class="button">Узнать больше</a> 159 <a href="{{ $Rec->link }}" class="button">Узнать больше</a>
173 </div> 160 </div>
174 </div> 161 </div>
175 @endif 162 @endif
176 @endforeach 163 @endforeach
177 <div class="main__vacancies-item main__employer-page-two-item" data-id="{{ $Q->id }}"> 164 <div class="main__vacancies-item main__employer-page-two-item" data-id="{{ $Q->id }}">
178 <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" 165 <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}"
179 class="back main__employer-page-two-item-back"> 166 class="back main__employer-page-two-item-back">
180 <svg> 167 <svg>
181 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 168 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
182 </svg> 169 </svg>
183 <span> 170 <span>
184 Вернуться к списку вакансий 171 Вернуться к списку вакансий
185 </span> 172 </span>
186 </a> 173 </a>
187 <div class="main__employer-page-two-item-toper"> 174 <div class="main__employer-page-two-item-toper">
188 @if (!empty($Q->employer->logo)) 175 @if (!empty($Q->employer->logo))
189 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}"> 176 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}">
190 @else 177 @else
191 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 178 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
192 @endif 179 @endif
193 <span>@if (isset($Q->employer->name_company)) {{ $Q->employer->name_company }} @else Не определена @endif</span> 180 <span>@if (isset($Q->employer->name_company)) {{ $Q->employer->name_company }} @else Не определена @endif</span>
194 </div> 181 </div>
195 <div class="main__employer-page-two-item-text"> 182 <div class="main__employer-page-two-item-text">
196 <div class="main__employer-page-two-item-text-name"> 183 <div class="main__employer-page-two-item-text-name">
197 <h3>@if (!empty($Q->name)) {{ $Q->name }}@else Не указано @endif </h3> 184 <h3>@if (!empty($Q->name)) {{ $Q->name }}@else Не указано @endif </h3>
198 </div> 185 </div>
199 </div> 186 </div>
200 <div class="main__employer-page-two-item-text"> 187 <div class="main__employer-page-two-item-text">
201 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 188 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
202 <div class="main__employer-page-two-item-text-body"> 189 <div class="main__employer-page-two-item-text-body">
203 {!! $Q->text !!} 190 {!! $Q->text !!}
204 </div> 191 </div>
205 </div> 192 </div>
206 <div class="main__employer-page-two-item-tags"> 193 <div class="main__employer-page-two-item-tags">
207 @if (!empty($Q->jobs_code[0]->position_ship)) 194 @if (!empty($Q->jobs_code[0]->position_ship))
208 <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span> 195 <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span>
209 @else 196 @else
210 @if (isset($Q->jobs)) 197 @if (isset($Q->jobs))
211 @foreach ($Q->jobs as $key => $j) 198 @foreach ($Q->jobs as $key => $j)
212 <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span> 199 <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span>
213 @endforeach 200 @endforeach
214 @endif 201 @endif
215 @endif 202 @endif
216 </div> 203 </div>
217 <div class="main__employer-page-two-item-buttons"> 204 <div class="main__employer-page-two-item-buttons">
218 @guest 205 @guest
219 <button type="button" 206 <button type="button"
220 data-fancybox 207 data-fancybox
221 data-src="#question" 208 data-src="#question"
222 data-options='{"touch":false,"autoFocus":false}' 209 data-options='{"touch":false,"autoFocus":false}'
223 class="button main__employer-page-two-item-button"> 210 class="button main__employer-page-two-item-button">
224 Откликнуться 211 Откликнуться
225 </button> 212 </button>
226 @else 213 @else
227 @if (App\Classes\StatusUser::Status() == 1) 214 @if (App\Classes\StatusUser::Status() == 1)
228 <?php 215 <?php
229 if (\App\Classes\Tools::getWorkerProfilePercent(Auth()->user()->workers[0]) >= 50) { 216 if (\App\Classes\Tools::getWorkerProfilePercent(Auth()->user()->workers[0]) >= 50) {
230 $buttonId = 'ask_comment'; 217 $buttonId = 'ask_comment';
231 } else { 218 } else {
232 $buttonId = 'ask_percent'; 219 $buttonId = 'ask_percent';
233 } 220 }
234 ?> 221 ?>
235 <button type="button" 222 <button type="button"
236 data-fancybox 223 data-fancybox
237 data-src="#{{$buttonId}}" 224 data-src="#{{$buttonId}}"
238 data-vacancy="{{ $Q->id }}" 225 data-vacancy="{{ $Q->id }}"
239 data-uid="{{ $uid }}" 226 data-uid="{{ $uid }}"
240 data-tuid="{{ $Q->employer->user_id }}" 227 data-tuid="{{ $Q->employer->user_id }}"
241 data-options='{"touch":false,"autoFocus":false}' 228 data-options='{"touch":false,"autoFocus":false}'
242 class="button main__employer-page-two-item-button {{ $buttonId }}"> 229 class="button main__employer-page-two-item-button {{ $buttonId }}">
243 Откликнуться 230 Откликнуться
244 </button> 231 </button>
245 @endif 232 @endif
246 @endguest 233 @endguest
247 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" 234 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}"
248 class="button button_light main__employer-page-two-item-button"> 235 class="button button_light main__employer-page-two-item-button">
249 Подробнее 236 Подробнее
250 </a> 237 </a>
251 </div> 238 </div>
252 <div class="main__employer-page-two-item-bottom"> 239 <div class="main__employer-page-two-item-bottom">
253 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y', strtotime($Q->updated_at)) }}</div> 240 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y', strtotime($Q->updated_at)) }}</div>
254 @guest 241 @guest
255 <button type="button" 242 <button type="button"
256 data-fancybox 243 data-fancybox
257 data-src="#favorite_noauth" 244 data-src="#favorite_noauth"
258 data-options='{"touch":false,"autoFocus":false}' 245 data-options='{"touch":false,"autoFocus":false}'
259 class="like main__employer-page-two-item-bottom-like"> 246 class="like main__employer-page-two-item-bottom-like">
260 <svg> 247 <svg>
261 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 248 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
262 </svg> 249 </svg>
263 </button> 250 </button>
264 @else 251 @else
265 <button type="button" 252 <button type="button"
266 id="like{{ $Q->id }}" 253 id="like{{ $Q->id }}"
267 data-val="{{ $Q->id }}" 254 data-val="{{ $Q->id }}"
268 class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}"> 255 class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}">
269 <svg> 256 <svg>
270 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 257 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
271 </svg> 258 </svg>
272 </button> 259 </button>
273 @endguest 260 @endguest
274 </div> 261 </div>
275 </div> 262 </div>
276 @php $i++ @endphp 263 @php $i++ @endphp
277 @endforeach 264 @endforeach
278 <div style="margin-top: 20px"> 265 <div style="margin-top: 20px">
279 {{ $Query->onEachSide(0)->appends($_GET)->links('paginate') }} 266 {{ $Query->onEachSide(0)->appends($_GET)->links('paginate') }}
280 </div> 267 </div>
281 </div> 268 </div>
282 </div> 269 </div>
283 </div> 270 </div>
284 </main> 271 </main>
285 @endsection 272 @endsection
resources/views/modals/send_employer.blade.php
1 <script> 1 <script>
2 $(document).on('change', '#file', function() { 2 $(document).on('change', '#file', function() {
3 let dirArray = $(this).val().split('\\') 3 let dirArray = $(this).val().split('\\')
4 $('#this_final_name').html(dirArray[dirArray.length - 1]) 4 $('#this_final_name').html(dirArray[dirArray.length - 1])
5 }); 5 });
6 </script> 6 </script>
7 <div id="send2" class="modal"> 7 <div id="send2" class="modal">
8 <div class="modal__body"> 8 <div class="modal__body">
9 <div class="modal__title">Отправить сообщение</div> 9 <div class="modal__title">Отправить сообщение</div>
10 <form class="modal__form" id="form_from_emp" name="form_from_emp" enctype="multipart/form-data" action="{{ route('employer.new_message') }}" method="POST"> 10 <form class="modal__form" id="form_from_emp" name="form_from_emp" enctype="multipart/form-data" action="{{ route('employer.new_message') }}" method="POST">
11 @csrf 11 @csrf
12 <div class="modal__form-item" style="display:none"> 12 <div class="modal__form-item" style="display:none">
13 <!-- Отправитель сообщения: --> 13 <!-- Отправитель сообщения: -->
14 <input type="hidden" id="_user_id" name="_user_id" class="input" placeholder="user_id" value=""> 14 <input type="hidden" id="_user_id" name="_user_id" class="input" placeholder="user_id" value="">
15 <!-- Получатель сообщения: --> 15 <!-- Получатель сообщения: -->
16 <input type="hidden" id="_to_user_id" name="_to_user_id" class="input" placeholder="to_user_id" value=""> 16 <input type="hidden" id="_to_user_id" name="_to_user_id" class="input" placeholder="to_user_id" value="">
17 <!-- Вакансия: --> 17 <!-- Вакансия: -->
18 <input type="hidden" id="_vacancy" name="_vacancy" class="input" placeholder="vacancy" value=""> 18 <input type="hidden" id="_vacancy" name="_vacancy" class="input" placeholder="vacancy" value="">
19 </div> 19 </div>
20 <div class="modal__form-item"> 20 <div class="modal__form-item">
21 <input id="i1" type="text" name="title" class="input" placeholder="Тема" required> 21 <input id="i1" type="text" name="title" class="input" placeholder="Тема" required>
22 <label for="i1">Не заполнено поле</label> 22 <label for="i1">Не заполнено поле</label>
23 </div> 23 </div>
24 <div class="modal__form-item"> 24 <div class="modal__form-item">
25 <textarea id="i2" class="textarea" name="text" placeholder="Укажите по какому поводу вы пишите работодателю, уточните название вакансии или прикрепите ссылку на вакансию, дайте как можно больше информации.&#10;&#10;ВАЖНО не стоит писать работодателю короткий текст цитирую «Какая зарплата?, работодатель не поймет о чем речь, опишите вопрос максимально подробно»." required></textarea> 25 <textarea id="i2" class="textarea" name="text" placeholder="Напишите текст с предложением о работе" required></textarea>
26 <label for="i2">Не заполнено поле</label> 26 <label for="i2">Не заполнено поле</label>
27 </div> 27 </div>
28 <div class="modal__form-item"> 28 <div class="modal__form-item">
29 <div class="file"> 29 <div class="file">
30 <label class="file__input"> 30 <label class="file__input">
31 <input type="file" name="file" id="file"> 31 <input type="file" name="file" id="file">
32 <span class="button button_light"> 32 <span class="button button_light">
33 <svg> 33 <svg>
34 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> 34 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
35 </svg> 35 </svg>
36 Прикрепить документ 36 Прикрепить документ
37 </span> 37 </span>
38 </label> 38 </label>
39 39
40 <div class="file__list"> 40 <div class="file__list">
41 <div class="file__list-item"> 41 <div class="file__list-item">
42 <div class="file__list-item-left"> 42 <div class="file__list-item-left">
43 <svg> 43 <svg>
44 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use> 44 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use>
45 </svg> 45 </svg>
46 <span id="this_final_name" name="this_final_name"></span> 46 <span id="this_final_name" name="this_final_name"></span>
47 </div> 47 </div>
48 <button type="button" class="file__list-item-right js-parent-remove"> 48 <button type="button" class="file__list-item-right js-parent-remove">
49 <svg> 49 <svg>
50 <use xlink:href="{{ asset('images/sprite.svg#cross-bold') }}"></use> 50 <use xlink:href="{{ asset('images/sprite.svg#cross-bold') }}"></use>
51 </svg> 51 </svg>
52 </button> 52 </button>
53 </div> 53 </div>
54 </div> 54 </div>
55 </div> 55 </div>
56 </div> 56 </div>
57 <div class="modal__form-item"> 57 <div class="modal__form-item">
58 <button type="submit" class="button">Отправить</button> 58 <button type="submit" class="button">Отправить</button>
59 </div> 59 </div>
60 </form> 60 </form>
61 </div> 61 </div>
62 </div> 62 </div>
63 63
resources/views/modals/send_worker.blade.php
1 <script> 1 <script>
2 $("#form_worker" ).submit(function(event) { 2 $("#form_worker" ).submit(function(event) {
3 var val = $(this).val(); 3 var val = $(this).val();
4 var send_title = $('#send_title'); 4 var send_title = $('#send_title');
5 var send_title_val = send_title.val(); 5 var send_title_val = send_title.val();
6 6
7 console.log('Click form.'); 7 console.log('Click form.');
8 }); 8 });
9 9
10 $(document).on('change', '#btn_send_file', function() { 10 $(document).on('change', '#btn_send_file', function() {
11 11
12 var send_name = $('#send_name'); 12 var send_name = $('#send_name');
13 var send_name_val = send_name.val(); 13 var send_name_val = send_name.val();
14 var send_name_file = $('#send_name_file'); 14 var send_name_file = $('#send_name_file');
15 15
16 console.log(send_name_val); 16 console.log(send_name_val);
17 send_name_file.html(send_name_val); 17 send_name_file.html(send_name_val);
18 18
19 }); 19 });
20 </script> 20 </script>
21 <div id="send3" class="modal"> 21 <div id="send3" class="modal">
22 <div class="modal__body"> 22 <div class="modal__body">
23 <div class="modal__title">Отправить сообщение работодателю</div> 23 <div class="modal__title">Отправить сообщение работодателю</div>
24 <form class="modal__form" id="form_worker" name="form_worker" enctype="multipart/form-data" action="{{ route('worker.new_message') }}" method="POST"> 24 <form class="modal__form" id="form_worker" name="form_worker" enctype="multipart/form-data" action="{{ route('worker.new_message') }}" method="POST">
25 @csrf 25 @csrf
26 <div class="modal__form-item" style="display: none"> 26 <div class="modal__form-item" style="display: none">
27 Отправитель сообщения: 27 Отправитель сообщения:
28 <input type="text" id="send_user_id" name="send_user_id" class="input" placeholder="user_id" value=""> 28 <input type="text" id="send_user_id" name="send_user_id" class="input" placeholder="user_id" value="">
29 Получатель сообщения: 29 Получатель сообщения:
30 <input type="text" id="send_to_user_id" name="send_to_user_id" class="input" placeholder="to_user_id" value=""> 30 <input type="text" id="send_to_user_id" name="send_to_user_id" class="input" placeholder="to_user_id" value="">
31 Вакансия: 31 Вакансия:
32 <input type="text" id="send_vacancy" name="send_vacancy" class="input" placeholder="vacancy" value=""> 32 <input type="text" id="send_vacancy" name="send_vacancy" class="input" placeholder="vacancy" value="">
33 </div> 33 </div>
34 <div class="modal__form-item send_title_div error_"> 34 <div class="modal__form-item send_title_div error_">
35 <input id="send_title" name="send_title" type="text" class="input" placeholder="Тема" required> 35 <input id="send_title" name="send_title" type="text" class="input" placeholder="Тема" required>
36 <label for="title">Не заполнено поле</label> 36 <label for="title">Не заполнено поле</label>
37 </div> 37 </div>
38 <div class="modal__form-item send_title_div error_"> 38 <div class="modal__form-item send_title_div error_">
39 <select class="js-select2" name="send_job_title_id" id="send_job_title_id"> 39 <select class="js-select2" name="send_job_title_id" id="send_job_title_id">
40 @if ($jobs->count()) 40 @if ($jobs->count())
41 @foreach($jobs as $j) 41 @foreach($jobs as $j)
42 <option value="{{ $j->id }}">{{ $j->name }} ({{ $j->id }})</option> 42 <option value="{{ $j->id }}">{{ $j->name }} ({{ $j->id }})</option>
43 @endforeach 43 @endforeach
44 @endif 44 @endif
45 </select> 45 </select>
46 <label for="title">Не заполнено поле</label> 46 <label for="title">Не заполнено поле</label>
47 </div> 47 </div>
48 <div class="modal__form-item send_text_div"> 48 <div class="modal__form-item send_text_div">
49 <textarea id="i2" class="textarea" id="send_text" name="send_text" placeholder="Напишите текст с предложением о работе" required></textarea> 49 <textarea id="i2" class="textarea" id="send_text" name="send_text" placeholder="Укажите по какому поводу вы пишите работодателю, уточните название вакансии или прикрепите ссылку на вакансию, дайте как можно больше информации.&#10;&#10;ВАЖНО не стоит писать работодателю короткий текст цитирую «Какая зарплата?, работодатель не поймет о чем речь, опишите вопрос максимально подробно»." required></textarea>
50 <label for="i2">Не заполнено поле</label> 50 <label for="i2">Не заполнено поле</label>
51 </div> 51 </div>
52 <div class="modal__form-item"> 52 <div class="modal__form-item">
53 <div class="file"> 53 <div class="file">
54 <label class="file__input" id="btn_send_file" name="btn_send_file"> 54 <label class="file__input" id="btn_send_file" name="btn_send_file">
55 <input type="file" name="send_file" id="send_name"> 55 <input type="file" name="send_file" id="send_name">
56 <span class="button button_light"> 56 <span class="button button_light">
57 <svg> 57 <svg>
58 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> 58 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
59 </svg> 59 </svg>
60 Прикрепить файл-документ 60 Прикрепить файл-документ
61 </span> 61 </span>
62 </label> 62 </label>
63 63
64 <div class="file__list" id="div_file" name="div_file"> 64 <div class="file__list" id="div_file" name="div_file">
65 <div class="file__list-item"> 65 <div class="file__list-item">
66 <div class="file__list-item-left"> 66 <div class="file__list-item-left">
67 <svg> 67 <svg>
68 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use> 68 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use>
69 </svg> 69 </svg>
70 <span id="send_name_file" name="send_name_file"></span> 70 <span id="send_name_file" name="send_name_file"></span>
71 </div> 71 </div>
72 <button type="button" class="file__list-item-right js-parent-remove"> 72 <button type="button" class="file__list-item-right js-parent-remove">
73 <svg> 73 <svg>
74 <use xlink:href="{{ asset('images/sprite.svg#cross-bold') }}"></use> 74 <use xlink:href="{{ asset('images/sprite.svg#cross-bold') }}"></use>
75 </svg> 75 </svg>
76 </button> 76 </button>
77 </div> 77 </div>
78 </div> 78 </div>
79 </div> 79 </div>
80 </div> 80 </div>
81 <div class="modal__form-item"> 81 <div class="modal__form-item">
82 <button type="submit" id="submit_form_worker" name="submit_form_worker" class="button">Отправить</button> 82 <button type="submit" id="submit_form_worker" name="submit_form_worker" class="button">Отправить</button>
83 </div> 83 </div>
84 </form> 84 </form>
85 </div> 85 </div>
86 </div> 86 </div>
87 87
resources/views/modals/vacancy/add_comment.blade.php
1 <div id="add_comment" class="modal"> 1 <div id="add_comment" class="modal">
2 <div class="modal__body"> 2 <div class="modal__body">
3 <div class="modal__title">Комментарий для работодателя</div> 3 <div class="modal__title">Комментарий для работодателя</div>
4 <form class="modal__form comment_form"> 4 <form class="modal__form comment_form">
5 @csrf 5 @csrf
6 <div class="modal__form-item" style="display:none"> 6 <div class="modal__form-item" style="display:none">
7 <!-- Отправитель сообщения: --> 7 <!-- Отправитель сообщения: -->
8 <input type="hidden" id="response_user_id" name="_user_id" class="input" placeholder="user_id" value=""> 8 <input type="hidden" id="response_user_id" name="_user_id" class="input" placeholder="user_id" value="">
9 <!-- Получатель сообщения: --> 9 <!-- Получатель сообщения: -->
10 <input type="hidden" id="response_to_user_id" name="_to_user_id" class="input" placeholder="to_user_id" value=""> 10 <input type="hidden" id="response_to_user_id" name="_to_user_id" class="input" placeholder="to_user_id" value="">
11 <!-- Вакансия: --> 11 <!-- Вакансия: -->
12 <input type="hidden" id="response_vacancy" name="_vacancy" class="input" placeholder="vacancy" value=""> 12 <input type="hidden" id="response_vacancy" name="_vacancy" class="input" placeholder="vacancy" value="">
13 </div> 13 </div>
14 <div class="modal__form-item"> 14 <div class="modal__form-item">
15 <textarea id="comment_text" class="textarea" name="text" placeholder="Комментарий" required value=""></textarea> 15 <textarea
16 id="comment_text"
17 class="textarea"
18 name="text"
19 placeholder="Пожалуйста напишите в комментарии вашу должность, номер телефона и дату готовности к посадке."
20 required
21 value="">
22 </textarea>
16 <label for="comment_text">Не заполнено поле</label> 23 <label for="comment_text">Не заполнено поле</label>
17 </div> 24 </div>
18 <div class="modal__form-item"> 25 <div class="modal__form-item">
19 <button type="button" 26 <button type="button"
20 data-fancybox 27 data-fancybox
21 data-src="#response_sent" 28 data-src="#response_sent"
22 class="button main__employer-page-two-item-button send_resume">Отправить</button> 29 class="button main__employer-page-two-item-button send_resume">Отправить</button>
23 <button type="button" 30 <button type="button"
24 data-fancybox 31 data-fancybox
25 data-src="#response_sent_no_comment" 32 data-src="#response_sent_no_comment"
26 class="button main__employer-page-two-item-button send_resume">Пропустить</button> 33 class="button main__employer-page-two-item-button send_resume">Пропустить</button>
27 </div> 34 </div>
28 </form> 35 </form>
29 </div> 36 </div>
30 </div> 37 </div>
31 38
32 <script> 39 <script>
33 $(document).on('click', '.send_resume', function(){ 40 $(document).on('click', '.send_resume', function(){
34 var data = { 41 var data = {
35 user_from: $('#response_user_id').val(), 42 user_from: $('#response_user_id').val(),
36 user_to: $('#response_to_user_id').val(), 43 user_to: $('#response_to_user_id').val(),
37 vacancy: $('#response_vacancy').val(), 44 vacancy: $('#response_vacancy').val(),
38 _token: '{{csrf_token()}}' 45 _token: '{{csrf_token()}}'
39 } 46 }
40 47
41 var comment = $('.comment_form textarea').serializeArray()[0].value; 48 var comment = $('.comment_form textarea').serializeArray()[0].value;
42 49
43 if (comment !== '') { 50 if (comment !== '') {
44 data.comment = comment; 51 data.comment = comment;
45 } 52 }
46 53
47 $.ajax({ 54 $.ajax({
48 url: '{{ route('worker.new_message') }}', 55 url: '{{ route('worker.new_message') }}',
49 type: 'POST', 56 type: 'POST',
50 data: data, 57 data: data,
51 success: function (data) { 58 success: function (data) {
52 // 59 //
53 } 60 }
54 }) 61 })
55 }) 62 })
56 </script> 63 </script>
57 64
resources/views/modals/vacancy/send_response_to_employer.blade.php
1 <div id="response_sent" class="modal modal_bg"> 1 <div id="response_sent" class="modal modal_bg">
2 <div class="modal__body"> 2 <div class="modal__body">
3 <div class="modal__text">Ваше резюме и комментарий отправлены работодателю.</div> 3 <div class="modal__text">Ваше резюме и комментарий отправлены работодателю.</div>
4 <div class="modal__text">Спасибо, что пользуетесь нашим сервисом.</div> 4 <div class="modal__text">Спасибо, что пользуетесь нашим сервисом.</div>
5 <div class="modal__text">Удачи Вам в поисках работы.</div> 5 <div class="modal__text">Удачи Вам в поисках работы.</div>
6 <div class="modal__text"></div> 6 <div class="modal__text"></div>
7 <div class="modal__text"></div> 7 <div class="modal__text"></div>
8 <button type="button" 8 <button type="button"
9 id="close-button" 9 id="close-button"
10 class="button" 10 class="button"
11 > 11 >
12 Вернуться 12 Вернуться
13 </button> 13 </button>
14 </div> 14 </div>
15 </div> 15 </div>
16 <script> 16 <script>
17 $('#close-button').click(function(){ 17 $('#close-button').click(function() {
18 $.fancybox.close(); 18 $.fancybox.close();
19 $.fancybox.close(); 19 $.fancybox.close();
20 $.fancybox.close(); 20 $.fancybox.close();
21 }); 21 });
22 </script> 22 </script>
23 23
resources/views/vacance-item.blade.php
1 @php 1 @php
2 use App\Classes\StatusUser; 2 use App\Classes\StatusUser;
3 @endphp 3 @endphp
4 4
5 @extends('layout.frontend', ['title' => $title]) 5 @extends('layout.frontend', ['title' => $title])
6 6
7 @section('scripts') 7 @section('scripts')
8 <script>
9 $(document).on('click', '.js_send_it_button', function() {
10 var this_ = $(this);
11 var code_user_id = this_.attr('data-uid');
12 var code_to_user_id = this_.attr('data-tuid');
13 var code_vacancy = this_.attr('data-vacancy');
14 var user_id = $('#_user_id');
15 var to_user_id = $('#_to_user_id');
16 var vacancy = $('#_vacancy');
17
18 user_id.val(code_user_id);
19 to_user_id.val(code_to_user_id);
20 vacancy.val(code_vacancy);
21 });
22 </script>
23 <script>
24 $(document).on('click', '.js_send_for_emp', function() {
25 var this_ = $(this);
26 var code_user_id = this_.attr('data-uid');
27 var code_to_user_id = this_.attr('data-tuid');
28 var code_vacancy = this_.attr('data-vacancy');
29 var user_id = $('#send_user_id');
30 var to_user_id = $('#send_to_user_id');
31 var vacancy = $('#send_vacancy');
32
33 user_id.val(code_user_id);
34 to_user_id.val(code_to_user_id);
35 vacancy.val(code_vacancy);
36 });
37 </script>
38 @include('js.favorite-vacancy-45') 8 @include('js.favorite-vacancy-45')
9 @include('js.vacancy-response')
39 @endsection 10 @endsection
40 11
41 @section('content') 12 @section('content')
42 <main class="main"> 13 <main class="main">
43 <div class="container"> 14 <div class="container">
44 <ul class="breadcrumbs main__breadcrumbs"> 15 <ul class="breadcrumbs main__breadcrumbs">
45 <li><a href="{{ route('index') }}">Главная</a></li> 16 <li><a href="{{ route('index') }}">Главная</a></li>
46 <li><a href="{{ route('vacancies') }}">Вакансии</a></li> 17 <li><a href="{{ route('vacancies') }}">Вакансии</a></li>
47 <li><b>{{ $title }}</b></li> 18 <li><b>{{ $title }}</b></li>
48 </ul> 19 </ul>
49 <div class="main__employer-page"> 20 <div class="main__employer-page">
50 21
51 @if (isset($Query[0]->employer)) 22 @if (isset($Query[0]->employer))
52 <h2 class="main__employer-page-title">О компании</h2> 23 <h2 class="main__employer-page-title">О компании</h2>
53 <div class="main__employer-page-two-item-toper"> 24 <div class="main__employer-page-two-item-toper">
54 @if (!empty($Query[0]->employer->logo)) 25 @if (!empty($Query[0]->employer->logo))
55 <img src="{{ asset(Storage::url($Query[0]->employer->logo)) }}" alt="{{ $Query[0]->employer->name }}"> 26 <img src="{{ asset(Storage::url($Query[0]->employer->logo)) }}" alt="{{ $Query[0]->employer->name }}">
56 @else 27 @else
57 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Query[0]->employer->name }}"> 28 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Query[0]->employer->name }}">
58 @endif 29 @endif
59 <span>{{ $Query[0]->employer->name_company }}</span> 30 <span>{{ $Query[0]->employer->name_company }}</span>
60 </div> 31 </div>
61 32
62 <div class="main__employer-page-info"> 33 <div class="main__employer-page-info">
63 <div class="main__employer-page-item"> 34 <div class="main__employer-page-item">
64 <b> Адрес компании</b> 35 <b> Адрес компании</b>
65 <span> 36 <span>
66 {{ $Query[0]->employer->address }} 37 {{ $Query[0]->employer->address }}
67 </span> 38 </span>
68 </div> 39 </div>
69 <div class="main__employer-page-item"> 40 <div class="main__employer-page-item">
70 <b>Сайт</b> 41 <b>Сайт</b>
71 <span> 42 <span>
72 {{ $Query[0]->employer->site }} 43 {{ $Query[0]->employer->site }}
73 </span> 44 </span>
74 </div> 45 </div>
75 <div class="main__employer-page-item"> 46 <div class="main__employer-page-item">
76 <b>Почта</b> 47 <b>Почта</b>
77 <span> 48 <span>
78 {{ $Query[0]->employer->email }} 49 {{ $Query[0]->employer->email }}
79 </span> 50 </span>
80 </div> 51 </div>
81 <div class="main__employer-page-item"> 52 <div class="main__employer-page-item">
82 <b>Телефон</b> 53 <b>Телефон</b>
83 <span> 54 <span>
84 {{ $Query[0]->employer->telephone }} 55 {{ $Query[0]->employer->telephone }}
85 </span> 56 </span>
86 </div> 57 </div>
87 </div> 58 </div>
88 @else 59 @else
89 <div class="main__employer-page-info"> 60 <div class="main__employer-page-info">
90 <div class="main__employer-page-item"> 61 <div class="main__employer-page-item">
91 <b>Ничего не найдено</b> 62 <b>Ничего не найдено</b>
92 <span> 63 <span>
93 Нет данных о компании 64 Нет данных о компании
94 </span> 65 </span>
95 </div> 66 </div>
96 </div> 67 </div>
97 @endif 68 @endif
98 <h2 class="main__employer-page-title">{{ $Query[0]->name }}</h2> 69 <h2 class="main__employer-page-title">{{ $Query[0]->name }}</h2>
99 <h3 class="main__employer-page-title_">Описание вакансии</h3> 70 <h3 class="main__employer-page-title_">Описание вакансии</h3>
100 </div> 71 </div>
101 72
102 @foreach ($Query as $Q) 73 @foreach ($Query as $Q)
103 <div class="main__vacancies-item-page main__employer-page-two-item"> 74 <div class="main__vacancies-item-page main__employer-page-two-item">
104 <div class="main__employer-page-two-item-text"> 75 <div class="main__employer-page-two-item-text">
105 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 76 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
106 <div class="main__employer-page-two-item-text-body"> 77 <div class="main__employer-page-two-item-text-body">
107 {!! $Q->text !!} 78 {!! $Q->text !!}
108 </div> 79 </div>
109 </div> 80 </div>
110 <div class="main__employer-page-two-item-tags"> 81 <div class="main__employer-page-two-item-tags">
111 @if (!empty($Q->jobs_code[0]->position_ship)) 82 @if (!empty($Q->jobs_code[0]->position_ship))
112 <span class="main__employer-page-two-item-tag">#{{ $Q->jobs_code[0]->position_ship }}</span> 83 <span class="main__employer-page-two-item-tag">#{{ $Q->jobs_code[0]->position_ship }}</span>
113 @else 84 @else
114 @if (isset($Q->jobs)) 85 @if (isset($Q->jobs))
115 @foreach ($Q->jobs as $key => $j) 86 @foreach ($Q->jobs as $key => $j)
116 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span> 87 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span>
117 @endforeach 88 @endforeach
118 @endif 89 @endif
119 @endif 90 @endif
120 </div> 91 </div>
121 <br> 92 <br>
122 <div class="main__employer-page-two-item-buttons"> 93 <div class="main__employer-page-two-item-buttons">
123 @guest 94 @guest
124 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' 95 <button type="button"
125 class="button main__employer-page-two-item-button">Откликнуться</button> 96 data-fancybox
97 data-src="#question"
98 data-options='{"touch":false,"autoFocus":false}'
99 class="button main__employer-page-two-item-button">
100 Откликнуться
101 </button>
126 @else 102 @else
127 @if (App\Classes\StatusUser::Status()==1) 103 @if (App\Classes\StatusUser::Status() == 1)
128 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}' 104 <?php
129 class="button main__employer-page-two-item-button js_send_for_emp">Откликнуться</button> 105 if (\App\Classes\Tools::getWorkerProfilePercent(Auth()->user()->workers[0]) >= 50) {
130 @else 106 $buttonId = 'ask_comment';
131 <button type="button" data-fancybox data-src="#send2" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}' 107 } else {
132 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> 108 $buttonId = 'ask_percent';
109 }
110 ?>
111 <button type="button"
112 data-fancybox
113 data-src="#{{$buttonId}}"
114 data-vacancy="{{ $Q->id }}"
115 data-uid="{{ $uid }}"
116 data-tuid="{{ $Q->employer->user_id }}"
117 data-options='{"touch":false,"autoFocus":false}'
118 class="button main__employer-page-two-item-button {{ $buttonId }}">
119 Откликнуться
120 </button>
121 <div class="main__employer-page-two-item-bottom">
122 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y', strtotime($Q->updated_at)) }}</div>
123 <button type="button" id="like{{ $Q->id }}" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js_vac_favorite js-toggle {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}">
124 <svg>
125 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
126 </svg>
127 </button>