Commit 1f9ea1ff9766bf4406f9209c7047308c6d29c7d1

Authored by Андрей Ларионов
Exists in master

Коммит 102пункт

Showing 11 changed files Inline Diff

app/Http/Controllers/CompanyController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Models\Ad_employer; 5 use App\Models\Ad_employer;
6 use App\Models\Employer; 6 use App\Models\Employer;
7 use Illuminate\Http\Request; 7 use Illuminate\Http\Request;
8 8
9 class CompanyController extends Controller 9 class CompanyController extends Controller
10 { 10 {
11 public function shipping_companies(Request $request) { 11 public function shipping_companies(Request $request) {
12 $emps = Employer::query()->with('ads')->where('status_hidden', '=', '0'); 12 $emps = Employer::query()->with('ads')->where('status_hidden', '=', '0');
13 if (($request->has('search')) && (!empty($request->get('search')))) { 13 if (($request->has('search')) && (!empty($request->get('search')))) {
14 $search = $request->get('search'); 14 $search = $request->get('search');
15 $emps = $emps->where('name_company', 'LIKE', "%$search%"); 15 $emps = $emps->where('name_company', 'LIKE', "%$search%");
16 } 16 }
17 17
18 $count_emps = $emps->count(); 18 $count_emps = $emps->count();
19 19
20 if ($request->get('sort')) { 20 if ($request->get('sort')) {
21 $sort = $request->get('sort'); 21 $sort = $request->get('sort');
22 switch ($sort) { 22 switch ($sort) {
23 case 'name_up': $emps = $emps->orderBy('name_company')->orderBy('id'); break; 23 case 'name_up': $emps = $emps->orderBy('name_company')->orderBy('id'); break;
24 case 'name_down': $emps = $emps->orderByDesc('name_company')->orderby('id'); break; 24 case 'name_down': $emps = $emps->orderByDesc('name_company')->orderby('id'); break;
25 case 'created_at_up': $emps = $emps->OrderBy('created_at')->orderBy('id'); break; 25 case 'created_at_up': $emps = $emps->OrderBy('created_at')->orderBy('id'); break;
26 case 'created_at_down': $emps = $emps->orderByDesc('created_at')->orderBy('id'); break; 26 case 'created_at_down': $emps = $emps->orderByDesc('created_at')->orderBy('id'); break;
27 case 'default': $emps = $emps->orderBy('id')->orderby('updated_at'); break; 27 case 'default': $emps = $emps->orderBy('id')->orderby('updated_at'); break;
28 default: $emps = $emps->orderBy('id')->orderby('updated_at'); break; 28 default: $emps = $emps->orderBy('id')->orderby('updated_at'); break;
29 } 29 }
30 } 30 }
31 31
32 $emps = $emps->paginate(4); 32 $emps = $emps->paginate(4);
33 33
34 34
35 if ($request->ajax()) { 35 if ($request->ajax()) {
36 if ($request->get('block') == '1') 36 if ($request->get('block') == '1')
37 return view('ajax.companies', compact('emps', 'count_emps')); 37 return view('ajax.companies', compact('emps', 'count_emps'));
38 else 38 else
39 return view('ajax.companies2', compact('emps', 'count_emps')); 39 return view('ajax.companies2', compact('emps', 'count_emps'));
40 } else { 40 } else {
41 return view('companies', compact('emps', 'count_emps')); 41 return view('companies', compact('emps', 'count_emps'));
42 } 42 }
43 } 43 }
44 44
45 public function info_company(Employer $company) { 45 public function info_company(Employer $company) {
46 if (isset(Auth()->user()->id)) { 46 if (isset(Auth()->user()->id)) {
47 $user_id = Auth()->user()->id; 47 $user_id = Auth()->user()->id;
48 } else { 48 } else {
49 $user_id = 0; 49 $user_id = 0;
50 } 50 }
51
51 52 $company = Employer::with('ads')->with('flots')->with('users')
52 $company = Employer::with('ads')->with('flots')->with('users') 53 ->where('id', '=', $company->id)->get();
53 ->where('id', '=', $company->id)->get(); 54
54 55 $title = $company[0]->name_company;
55 $title = $company[0]->name_company; 56
56 57 $ads = Ad_employer::query()->with('jobs')->with('jobs_code')->
57 $ads = Ad_employer::query()->with('jobs')->with('jobs_code')-> 58 OrderByDesc('id')->
58 OrderByDesc('id')-> 59 where('employer_id', '=', $company[0]->id)->paginate(2);
59 where('employer_id', '=', $company[0]->id)->paginate(2); 60
60 61 return view('info_company_new', compact('company', 'user_id', 'title', 'ads'));
61 return view('info_company_new', compact('company', 'user_id', 'title', 'ads')); 62 }
62 } 63 }
63 } 64
app/Http/Controllers/EmployerController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Classes\RusDate; 5 use App\Classes\RusDate;
6 use App\Classes\Tools; 6 use App\Classes\Tools;
7 use App\Http\Requests\BaseUser_min_Request; 7 use App\Http\Requests\BaseUser_min_Request;
8 use App\Http\Requests\BaseUserRequest; 8 use App\Http\Requests\BaseUserRequest;
9 use App\Http\Requests\FlotRequest; 9 use App\Http\Requests\FlotRequest;
10 use App\Http\Requests\MessagesRequiest; 10 use App\Http\Requests\MessagesRequiest;
11 use App\Http\Requests\VacancyRequestEdit; 11 use App\Http\Requests\VacancyRequestEdit;
12 use App\Http\Requests\VacansiaRequiest; 12 use App\Http\Requests\VacansiaRequiest;
13 use App\Mail\MailSotrudnichestvo; 13 use App\Mail\MailSotrudnichestvo;
14 use App\Mail\SendAllMessages; 14 use App\Mail\SendAllMessages;
15 use App\Models\Ad_employer; 15 use App\Models\Ad_employer;
16 use App\Models\Ad_jobs; 16 use App\Models\Ad_jobs;
17 use App\Models\ad_response; 17 use App\Models\ad_response;
18 use App\Models\Category; 18 use App\Models\Category;
19 use App\Models\Education; 19 use App\Models\Education;
20 use App\Models\Employer; 20 use App\Models\Employer;
21 use App\Models\employers_main; 21 use App\Models\employers_main;
22 use App\Models\Flot; 22 use App\Models\Flot;
23 use App\Models\Job_title; 23 use App\Models\Job_title;
24 use App\Models\Like_vacancy; 24 use App\Models\Like_vacancy;
25 use App\Models\Like_worker; 25 use App\Models\Like_worker;
26 use App\Models\Message; 26 use App\Models\Message;
27 use App\Models\Positions; 27 use App\Models\Positions;
28 use App\Models\Worker; 28 use App\Models\Worker;
29 use Carbon\Carbon; 29 use Carbon\Carbon;
30 use Illuminate\Auth\Events\Registered; 30 use Illuminate\Auth\Events\Registered;
31 use Illuminate\Database\Eloquent\Builder; 31 use Illuminate\Database\Eloquent\Builder;
32 use Illuminate\Database\Eloquent\Model; 32 use Illuminate\Database\Eloquent\Model;
33 use Illuminate\Foundation\Auth\User; 33 use Illuminate\Foundation\Auth\User;
34 use Illuminate\Http\Request; 34 use Illuminate\Http\Request;
35 use Illuminate\Support\Facades\Auth; 35 use Illuminate\Support\Facades\Auth;
36 use Illuminate\Support\Facades\Hash; 36 use Illuminate\Support\Facades\Hash;
37 use Illuminate\Support\Facades\Mail; 37 use Illuminate\Support\Facades\Mail;
38 use Illuminate\Support\Facades\Storage; 38 use Illuminate\Support\Facades\Storage;
39 use App\Models\User as User_Model; 39 use App\Models\User as User_Model;
40 use Illuminate\Support\Facades\Validator; 40 use Illuminate\Support\Facades\Validator;
41 41
42 class EmployerController extends Controller 42 class EmployerController extends Controller
43 { 43 {
44 public function vacancie($vacancy, Request $request) { 44 public function vacancie($vacancy, Request $request) {
45 $title = 'Заголовок вакансии'; 45 $title = 'Заголовок вакансии';
46 $Query = Ad_employer::with('jobs')-> 46 $Query = Ad_employer::with('jobs')->
47 with('cat')-> 47 with('cat')->
48 with('employer')-> 48 with('employer')->
49 with('jobs_code')-> 49 with('jobs_code')->
50 select('ad_employers.*')-> 50 select('ad_employers.*')->
51 where('id', '=', $vacancy)->get(); 51 where('id', '=', $vacancy)->get();
52 52
53 if (isset(Auth()->user()->id)) 53 if (isset(Auth()->user()->id))
54 $uid = Auth()->user()->id; 54 $uid = Auth()->user()->id;
55 else 55 else
56 $uid = 0; 56 $uid = 0;
57 $title = $Query[0]->name; 57 $title = $Query[0]->name;
58 if ($request->ajax()) { 58 if ($request->ajax()) {
59 return view('ajax.vacance-item', compact('Query','uid')); 59 return view('ajax.vacance-item', compact('Query','uid'));
60 } else { 60 } else {
61 return view('vacance-item', compact('title', 'Query', 'uid')); 61 return view('vacance-item', compact('title', 'Query', 'uid'));
62 } 62 }
63 } 63 }
64 64
65 public function logout() { 65 public function logout() {
66 Auth::logout(); 66 Auth::logout();
67 return redirect()->route('index') 67 return redirect()->route('index')
68 ->with('success', 'Вы вышли из личного кабинета'); 68 ->with('success', 'Вы вышли из личного кабинета');
69 } 69 }
70 70
71 public function employer_info() { 71 public function employer_info() {
72 // код юзера 72 // код юзера
73 $user_info = Auth()->user(); 73 $user_info = Auth()->user();
74 // вьюшка для вывода данных 74 // вьюшка для вывода данных
75 return view('employers.info', compact('user_info')); 75 return view('employers.info', compact('user_info'));
76 } 76 }
77 77
78 public function employer_info_save(User_Model $user, BaseUser_min_Request $request) { 78 public function employer_info_save(User_Model $user, BaseUser_min_Request $request) {
79 // Все данные через реквест 79 // Все данные через реквест
80 $all = $request->all(); 80 $all = $request->all();
81 unset($all['_token']); 81 unset($all['_token']);
82 // обновление 82 // обновление
83 $user->update($all); 83 $user->update($all);
84 return redirect()->route('employer.employer_info'); 84 return redirect()->route('employer.employer_info');
85 } 85 }
86 86
87 public function cabinet() { 87 public function cabinet() {
88 $id = Auth()->user()->id; 88 $id = Auth()->user()->id;
89 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 89 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
90 WhereHas('users', 90 WhereHas('users',
91 function (Builder $query) use ($id) {$query->Where('id', $id); 91 function (Builder $query) use ($id) {$query->Where('id', $id);
92 })->get(); 92 })->get();
93 return view('employers.cabinet45', compact('Employer')); 93 return view('employers.cabinet45', compact('Employer'));
94 } 94 }
95 95
96 public function slider_flot() { 96 public function slider_flot() {
97 $id = Auth()->user()->id; 97 $id = Auth()->user()->id;
98 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 98 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
99 WhereHas('users', 99 WhereHas('users',
100 function (Builder $query) use ($id) {$query->Where('id', $id); 100 function (Builder $query) use ($id) {$query->Where('id', $id);
101 })->get(); 101 })->get();
102 return view('employers.fly-flot', compact('Employer')); 102 return view('employers.fly-flot', compact('Employer'));
103 } 103 }
104 104
105 public function cabinet_save(Employer $Employer, Request $request) { 105 public function cabinet_save(Employer $Employer, Request $request) {
106 $params = $request->all(); 106 $params = $request->all();
107 $params['user_id'] = Auth()->user()->id; 107 $params['user_id'] = Auth()->user()->id;
108 $id = $Employer->id; 108 $id = $Employer->id;
109 109
110 if ($request->has('logo')) { 110 if ($request->has('logo')) {
111 if (!empty($Employer->logo)) { 111 if (!empty($Employer->logo)) {
112 Storage::delete($Employer->logo); 112 Storage::delete($Employer->logo);
113 } 113 }
114 $params['logo'] = $request->file('logo')->store("employer/$id", 'public'); 114 $params['logo'] = $request->file('logo')->store("employer/$id", 'public');
115 } 115 }
116 116
117 $Employer->update($params); 117 $Employer->update($params);
118 118
119 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены'); 119 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены');
120 } 120 }
121 121
122 public function save_add_flot(FlotRequest $request) { 122 public function save_add_flot(FlotRequest $request) {
123 // отмена 123 // отмена
124 $params = $request->all(); 124 $params = $request->all();
125 125
126 if ($request->has('image')) { 126 if ($request->has('image')) {
127 $params['image'] = $request->file('image')->store("flot", 'public'); 127 $params['image'] = $request->file('image')->store("flot", 'public');
128 } 128 }
129 Flot::create($params); 129 Flot::create($params);
130 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get(); 130 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get();
131 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); 131 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен');
132 } 132 }
133 133
134 public function edit_flot(Flot $Flot, Employer $Employer) { 134 public function edit_flot(Flot $Flot, Employer $Employer) {
135 return view('employers.edit-flot', compact('Flot', 'Employer')); 135 return view('employers.edit-flot', compact('Flot', 'Employer'));
136 } 136 }
137 137
138 public function update_flot(FlotRequest $request, Flot $Flot) { 138 public function update_flot(FlotRequest $request, Flot $Flot) {
139 $params = $request->all(); 139 $params = $request->all();
140 140
141 if ($request->has('image')) { 141 if ($request->has('image')) {
142 if (!empty($flot->image)) { 142 if (!empty($flot->image)) {
143 Storage::delete($flot->image); 143 Storage::delete($flot->image);
144 } 144 }
145 $params['image'] = $request->file('image')->store("flot", 'public'); 145 $params['image'] = $request->file('image')->store("flot", 'public');
146 } else { 146 } else {
147 if (!empty($flot->image)) $params['image'] = $flot->image; 147 if (!empty($flot->image)) $params['image'] = $flot->image;
148 } 148 }
149 149
150 $Flot->update($params); 150 $Flot->update($params);
151 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); 151 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен');
152 } 152 }
153 153
154 public function delete_flot(Flot $Flot) { 154 public function delete_flot(Flot $Flot) {
155 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get(); 155 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get();
156 156
157 if (isset($Flot->id)) $Flot->delete(); 157 if (isset($Flot->id)) $Flot->delete();
158 return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален'); 158 return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален');
159 } 159 }
160 160
161 // Форма добавления вакансий 161 // Форма добавления вакансий
162 public function cabinet_vacancie() { 162 public function cabinet_vacancie() {
163 $id = Auth()->user()->id; 163 $id = Auth()->user()->id;
164 164
165 if (Auth()->user()->is_public) { 165 if (Auth()->user()->is_public) {
166 $categories = Category::query()->active()->get(); 166 $categories = Category::query()->active()->get();
167 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 167 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
168 where('is_remove', '=', '0')-> 168 where('is_remove', '=', '0')->
169 where('is_bd', '=', '0')-> 169 where('is_bd', '=', '0')->
170 get(); 170 get();
171 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 171 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
172 WhereHas('users', 172 WhereHas('users',
173 function (Builder $query) use ($id) { 173 function (Builder $query) use ($id) {
174 $query->Where('id', $id); 174 $query->Where('id', $id);
175 })->get(); 175 })->get();
176 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories')); 176 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories'));
177 } else { 177 } else {
178 return redirect()->route('employer.cabinet_vacancie_danger'); 178 return redirect()->route('employer.cabinet_vacancie_danger');
179 } 179 }
180 } 180 }
181 181
182 // Форма предупреждения об оплате 182 // Форма предупреждения об оплате
183 public function cabinet_vacancie_danger() { 183 public function cabinet_vacancie_danger() {
184 return view('employers.add_vacancy_danger'); 184 return view('employers.add_vacancy_danger');
185 } 185 }
186 186
187 // Сохранение вакансии 187 // Сохранение вакансии
188 public function cabinet_vacancy_save1(VacancyRequestEdit $request) { 188 public function cabinet_vacancy_save1(VacancyRequestEdit $request) {
189 $params_emp = $request->all(); 189 $params_emp = $request->all();
190 190
191 $params_job["job_title_id"] = $params_emp['job_title_id']; 191 $params_job["job_title_id"] = $params_emp['job_title_id'];
192 //$params_job["min_salary"] = $params_emp['min_salary']; 192 //$params_job["min_salary"] = $params_emp['min_salary'];
193 //$params_job["max_salary"] = $params_emp['max_salary']; 193 //$params_job["max_salary"] = $params_emp['max_salary'];
194 //$params_job["region"] = $params_emp['region']; 194 //$params_job["region"] = $params_emp['region'];
195 //$params_job["power"] = $params_emp['power']; 195 //$params_job["power"] = $params_emp['power'];
196 //$params_job["sytki"] = $params_emp['sytki']; 196 //$params_job["sytki"] = $params_emp['sytki'];
197 //$params_job["start"] = $params_emp['start']; 197 //$params_job["start"] = $params_emp['start'];
198 //$params_job["flot"] = $params_emp['flot']; 198 //$params_job["flot"] = $params_emp['flot'];
199 //$params_job["description"] = $params_emp['description']; 199 //$params_job["description"] = $params_emp['description'];
200 200
201 $ad_jobs = Ad_employer::create($params_emp); 201 $ad_jobs = Ad_employer::create($params_emp);
202 //$params_job['ad_employer_id'] = $ad_jobs->id; 202 //$params_job['ad_employer_id'] = $ad_jobs->id;
203 //Ad_jobs::create($params_job); 203 //Ad_jobs::create($params_job);
204 $ad_jobs->jobs()->sync($request->get('job_title_id')); 204 $ad_jobs->jobs()->sync($request->get('job_title_id'));
205 205
206 return redirect()->route('employer.vacancy_list'); 206 return redirect()->route('employer.vacancy_list');
207 } 207 }
208 208
209 // Список вакансий 209 // Список вакансий
210 public function vacancy_list(Request $request) { 210 public function vacancy_list(Request $request) {
211 $id = Auth()->user()->id; 211 $id = Auth()->user()->id;
212 212
213 //dd($request->all()); 213 //dd($request->all());
214 $Employer = Employer::query()->where('user_id', $id)->first(); 214 $Employer = Employer::query()->where('user_id', $id)->first();
215 $vacancy_list = Ad_employer::query()->with('jobs')-> 215 $vacancy_list = Ad_employer::query()->with('jobs')->
216 with('jobs_code')-> 216 with('jobs_code')->
217 where('employer_id', $Employer->id); 217 where('employer_id', $Employer->id);
218 218
219 if (($request->has('search')) && (!empty($request->get('search')))) { 219 if (($request->has('search')) && (!empty($request->get('search')))) {
220 $search = $request->get('search'); 220 $search = $request->get('search');
221 $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%"); 221 $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%");
222 } 222 }
223 223
224 if ($request->get('sort')) { 224 if ($request->get('sort')) {
225 $sort = $request->get('sort'); 225 $sort = $request->get('sort');
226 switch ($sort) { 226 switch ($sort) {
227 case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break; 227 case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break;
228 case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break; 228 case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break;
229 case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break; 229 case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break;
230 case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break; 230 case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break;
231 case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; 231 case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break;
232 default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; 232 default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break;
233 } 233 }
234 } 234 }
235 $vacancy_list = $vacancy_list->paginate(4); 235 $vacancy_list = $vacancy_list->paginate(4);
236 236
237 //ajax 237 //ajax
238 if ($request->ajax()) { 238 if ($request->ajax()) {
239 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); 239 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer'));
240 } else { 240 } else {
241 return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); 241 return view('employers.list_vacancy', compact('vacancy_list', 'Employer'));
242 } 242 }
243 } 243 }
244 244
245 // Карточка вакансии 245 // Карточка вакансии
246 public function vacancy_edit(Ad_employer $ad_employer) { 246 public function vacancy_edit(Ad_employer $ad_employer) {
247 $id = Auth()->user()->id; 247 $id = Auth()->user()->id;
248 $Positions = Category::query()->where('is_remove', '=', '0')->get(); 248 $Positions = Category::query()->where('is_remove', '=', '0')->get();
249 249
250 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 250 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
251 where('is_remove', '=', '0')-> 251 where('is_remove', '=', '0')->
252 where('is_bd', '=', '0')->get(); 252 where('is_bd', '=', '0')->get();
253 253
254 $Employer = Employer::query()->with('users')->with('ads')-> 254 $Employer = Employer::query()->with('users')->with('ads')->
255 with('flots')->where('user_id', $id)->first(); 255 with('flots')->where('user_id', $id)->first();
256 256
257 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); 257 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs'));
258 } 258 }
259 259
260 // Сохранение-редактирование записи 260 // Сохранение-редактирование записи
261 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { 261 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) {
262 $params = $request->all(); 262 $params = $request->all();
263 $params_job["job_title_id"] = $params['job_title_id']; 263 $params_job["job_title_id"] = $params['job_title_id'];
264 264
265 //$jobs['flot'] = $params['flot']; 265 //$jobs['flot'] = $params['flot'];
266 //$jobs['job_title_id'] = $params['job_title_id']; 266 //$jobs['job_title_id'] = $params['job_title_id'];
267 //$titles['position_id'] = $params['position_id']; 267 //$titles['position_id'] = $params['position_id'];
268 //unset($params['job_title_id']); 268 //unset($params['job_title_id']);
269 //dd($params); 269 //dd($params);
270 $ad_employer->update($params); 270 $ad_employer->update($params);
271 $ad_employer->jobs()->sync($request->get('job_title_id')); 271 $ad_employer->jobs()->sync($request->get('job_title_id'));
272 272
273 //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])-> 273 //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])->
274 // where('ad_employer_id', $ad_employer->id)->first(); 274 // where('ad_employer_id', $ad_employer->id)->first();
275 //$data = Ad_jobs::find($job_->id); 275 //$data = Ad_jobs::find($job_->id);
276 //$ad_jobs = $data->update($jobs); 276 //$ad_jobs = $data->update($jobs);
277 return redirect()->route('employer.vacancy_list'); 277 return redirect()->route('employer.vacancy_list');
278 } 278 }
279 279
280 // Сохранение карточки вакансии 280 // Сохранение карточки вакансии
281 public function vacancy_save(Request $request, Ad_employer $ad_employer) { 281 public function vacancy_save(Request $request, Ad_employer $ad_employer) {
282 $all = $request->all(); 282 $all = $request->all();
283 $ad_employer->update($all); 283 $ad_employer->update($all);
284 return redirect()->route('employer.cabinet_vacancie'); 284 return redirect()->route('employer.cabinet_vacancie');
285 } 285 }
286 286
287 // Удаление карточки вакансии 287 // Удаление карточки вакансии
288 public function vacancy_delete(Ad_employer $ad_employer) { 288 public function vacancy_delete(Ad_employer $ad_employer) {
289 $ad_employer->delete(); 289 $ad_employer->delete();
290 290
291 return redirect()->route('employer.vacancy_list') 291 return redirect()->route('employer.vacancy_list')
292 ->with('success', 'Данные были успешно сохранены'); 292 ->with('success', 'Данные были успешно сохранены');
293 } 293 }
294 294
295 // Обновление даты 295 // Обновление даты
296 public function vacancy_up(Ad_employer $ad_employer) { 296 public function vacancy_up(Ad_employer $ad_employer) {
297 $up = date('m/d/Y h:i:s', time());; 297 $up = date('m/d/Y h:i:s', time());;
298 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 298 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
299 $vac_emp->updated_at = $up; 299 $vac_emp->updated_at = $up;
300 $vac_emp->save(); 300 $vac_emp->save();
301 301
302 return redirect()->route('employer.vacancy_list'); 302 return redirect()->route('employer.vacancy_list');
303 // начало конца 303 // начало конца
304 } 304 }
305 305
306 //Видимость вакансии 306 //Видимость вакансии
307 public function vacancy_eye(Ad_employer $ad_employer, $status) { 307 public function vacancy_eye(Ad_employer $ad_employer, $status) {
308 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 308 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
309 $vac_emp->active_is = $status; 309 $vac_emp->active_is = $status;
310 $vac_emp->save(); 310 $vac_emp->save();
311 311
312 return redirect()->route('employer.vacancy_list'); 312 return redirect()->route('employer.vacancy_list');
313 } 313 }
314 314
315 //Вакансия редактирования (шаблон) 315 //Вакансия редактирования (шаблон)
316 public function vacancy_update(Ad_employer $id) { 316 public function vacancy_update(Ad_employer $id) {
317 317
318 } 318 }
319 319
320 //Отклики на вакансию - лист 320 //Отклики на вакансию - лист
321 public function answers(Employer $employer, Request $request) { 321 public function answers(Employer $employer, Request $request) {
322 $user_id = Auth()->user()->id; 322 $user_id = Auth()->user()->id;
323 $answer = Ad_employer::query()->where('employer_id', $employer->id); 323 $answer = Ad_employer::query()->where('employer_id', $employer->id);
324 if ($request->has('search')) { 324 if ($request->has('search')) {
325 $search = trim($request->get('search')); 325 $search = trim($request->get('search'));
326 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); 326 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%");
327 } 327 }
328 328
329 $answer = $answer->with('response')->OrderByDESC('id')->get(); 329 $answer = $answer->with('response')->OrderByDESC('id')->get();
330 330
331 return view('employers.list_answer', compact('answer', 'user_id', 'employer')); 331 return view('employers.list_answer', compact('answer', 'user_id', 'employer'));
332 } 332 }
333 333
334 //Обновление статуса 334 //Обновление статуса
335 public function supple_status(employer $employer, ad_response $ad_response, $flag) { 335 public function supple_status(employer $employer, ad_response $ad_response, $flag) {
336 $ad_response->update(Array('flag' => $flag)); 336 $ad_response->update(Array('flag' => $flag));
337 return redirect()->route('employer.answers', ['employer' => $employer->id]); 337 return redirect()->route('employer.answers', ['employer' => $employer->id]);
338 } 338 }
339 339
340 //Страницы сообщений список 340 //Страницы сообщений список
341 public function messages($type_message) { 341 public function messages($type_message) {
342 $user_id = Auth()->user()->id; 342 $user_id = Auth()->user()->id;
343 343
344 $messages_input = Message::query()->with('vacancies')->with('user_from')-> 344 $messages_input = Message::query()->with('vacancies')->with('user_from')->
345 Where('to_user_id', $user_id)->OrderByDesc('created_at'); 345 Where('to_user_id', $user_id)->OrderByDesc('created_at');
346 346
347 $messages_output = Message::query()->with('vacancies')-> 347 $messages_output = Message::query()->with('vacancies')->
348 with('user_to')->where('user_id', $user_id)-> 348 with('user_to')->where('user_id', $user_id)->
349 OrderByDesc('created_at'); 349 OrderByDesc('created_at');
350 350
351 $count_input = $messages_input->count(); 351 $count_input = $messages_input->count();
352 $count_output = $messages_output->count(); 352 $count_output = $messages_output->count();
353 353
354 if ($type_message == 'input') { 354 if ($type_message == 'input') {
355 $messages = $messages_input->paginate(5); 355 $messages = $messages_input->paginate(5);
356 } 356 }
357 357
358 if ($type_message == 'output') { 358 if ($type_message == 'output') {
359 $messages = $messages_output->paginate(5); 359 $messages = $messages_output->paginate(5);
360 } 360 }
361 361
362 //dd($user_id, $messages[2]->vacancies); 362 //dd($user_id, $messages[2]->vacancies);
363 //jobs); 363 //jobs);
364 364
365 return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); 365 return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id'));
366 } 366 }
367 367
368 // Диалог между пользователями 368 // Диалог между пользователями
369 public function dialog(Request $request, User_Model $user1, User_Model $user2) { 369 public function dialog(Request $request, User_Model $user1, User_Model $user2) {
370 // Получение параметров. 370 // Получение параметров.
371 if ($request->has('ad_employer')){ 371 if ($request->has('ad_employer')){
372 $ad_employer = $request->get('ad_employer'); 372 $ad_employer = $request->get('ad_employer');
373 } else { 373 } else {
374 $ad_employer = 0; 374 $ad_employer = 0;
375 } 375 }
376 376
377 if (isset($user2->id)) { 377 if (isset($user2->id)) {
378 $companion = User_Model::query()->with('workers')-> 378 $companion = User_Model::query()->with('workers')->
379 with('employers')-> 379 with('employers')->
380 where('id', $user2->id)->first(); 380 where('id', $user2->id)->first();
381 } 381 }
382 382
383 $Messages = Message::query()-> 383 $Messages = Message::query()->
384 where('ad_employer_id', '=', $ad_employer)-> 384 where('ad_employer_id', '=', $ad_employer)->
385 where(function($query) use ($user1, $user2) { 385 where(function($query) use ($user1, $user2) {
386 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); 386 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id);
387 })->orWhere(function($query) use ($user1, $user2) { 387 })->orWhere(function($query) use ($user1, $user2) {
388 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); 388 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id);
389 })->where('ad_employer_id', '=', $ad_employer)->OrderBy('created_at')->get(); 389 })->where('ad_employer_id', '=', $ad_employer)->OrderBy('created_at')->get();
390 390
391 $id_vac = $Messages[$Messages->count() - 1]->ad_employer_id; 391 $id_vac = $Messages[$Messages->count() - 1]->ad_employer_id;
392 392
393 //$ad_employer = null; 393 //$ad_employer = null;
394 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); 394 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first();
395 $sender = $user1; 395 $sender = $user1;
396 396
397 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages')); 397 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages'));
398 } 398 }
399 399
400 // Регистрация работодателя 400 // Регистрация работодателя
401 public function register_employer(Request $request) { 401 public function register_employer(Request $request) {
402 $params = $request->all(); 402 $params = $request->all();
403 403
404 $rules = [ 404 $rules = [
405 //'surname' => ['required', 'string', 'max:255'], 405 //'surname' => ['required', 'string', 'max:255'],
406 //'name_man' => ['required', 'string', 'max:255'], 406 //'name_man' => ['required', 'string', 'max:255'],
407 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 407 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
408 'name_company' => ['required', 'string', 'max:255'], 408 'name_company' => ['required', 'string', 'max:255'],
409 'password' => ['required', 'string', 'min:6'], 409 'password' => ['required', 'string', 'min:6'],
410 ]; 410 ];
411 411
412 412
413 $messages = [ 413 $messages = [
414 'required' => 'Укажите обязательное поле', 414 'required' => 'Укажите обязательное поле',
415 'min' => [ 415 'min' => [
416 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 416 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
417 'integer' => 'Поле «:attribute» должно быть :min или больше', 417 'integer' => 'Поле «:attribute» должно быть :min или больше',
418 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 418 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
419 ], 419 ],
420 'max' => [ 420 'max' => [
421 'string' => 'Поле «:attribute» должно быть не больше :max символов', 421 'string' => 'Поле «:attribute» должно быть не больше :max символов',
422 'integer' => 'Поле «:attribute» должно быть :max или меньше', 422 'integer' => 'Поле «:attribute» должно быть :max или меньше',
423 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 423 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
424 ] 424 ]
425 ]; 425 ];
426 426
427 $email = $request->get('email'); 427 $email = $request->get('email');
428 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { 428 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) {
429 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); 429 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл"));
430 } 430 }
431 431
432 if ($request->get('password') !== $request->get('confirmed')){ 432 if ($request->get('password') !== $request->get('confirmed')){
433 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 433 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
434 } 434 }
435 435
436 if (strlen($request->get('password')) < 6) { 436 if (strlen($request->get('password')) < 6) {
437 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); 437 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
438 } 438 }
439 /* 439 /*
440 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); 440 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?');
441 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 441 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z',
442 'X', 'C', 'V', 'B', 'N', 'M'); 442 'X', 'C', 'V', 'B', 'N', 'M');
443 $spec_bool = false; 443 $spec_bool = false;
444 $alpha_bool = false; 444 $alpha_bool = false;
445 445
446 $haystack = $request->get('password'); 446 $haystack = $request->get('password');
447 447
448 foreach ($specsumbol as $it) { 448 foreach ($specsumbol as $it) {
449 if (strpos($haystack, $it) !== false) { 449 if (strpos($haystack, $it) !== false) {
450 $spec_bool = true; 450 $spec_bool = true;
451 } 451 }
452 } 452 }
453 453
454 foreach ($alpha as $it) { 454 foreach ($alpha as $it) {
455 if (strpos($haystack, $it) !== false) { 455 if (strpos($haystack, $it) !== false) {
456 $alpha_bool = true; 456 $alpha_bool = true;
457 } 457 }
458 } 458 }
459 459
460 if ((!$spec_bool) || (!$alpha_bool)) { 460 if ((!$spec_bool) || (!$alpha_bool)) {
461 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); 461 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?"));
462 }*/ 462 }*/
463 463
464 if (empty($request->get('surname'))) { 464 if (empty($request->get('surname'))) {
465 $params['surname'] = 'Неизвестно'; 465 $params['surname'] = 'Неизвестно';
466 } 466 }
467 if (empty($request->get('name_man'))) { 467 if (empty($request->get('name_man'))) {
468 $params['name_man'] = 'Неизвестно'; 468 $params['name_man'] = 'Неизвестно';
469 } 469 }
470 $validator = Validator::make($params, $rules, $messages); 470 $validator = Validator::make($params, $rules, $messages);
471 471
472 if ($validator->fails()) { 472 if ($validator->fails()) {
473 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 473 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
474 } else { 474 } else {
475 $user = $this->create($params); 475 $user = $this->create($params);
476 event(new Registered($user)); 476 event(new Registered($user));
477 Auth::guard()->login($user); 477 Auth::guard()->login($user);
478 } 478 }
479 479
480 if ($user) { 480 if ($user) {
481 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; 481 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));;
482 } else { 482 } else {
483 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 483 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
484 } 484 }
485 } 485 }
486 486
487 // Создание пользователя 487 // Создание пользователя
488 protected function create(array $data) 488 protected function create(array $data)
489 { 489 {
490 $Use = new User_Model(); 490 $Use = new User_Model();
491 $Code_user = $Use->create([ 491 $Code_user = $Use->create([
492 'name' => $data['surname']." ".$data['name_man'], 492 'name' => $data['surname']." ".$data['name_man'],
493 'name_man' => $data['name_man'], 493 'name_man' => $data['name_man'],
494 'surname' => $data['surname'], 494 'surname' => $data['surname'],
495 'surname2' => $data['surname2'], 495 'surname2' => $data['surname2'],
496 'subscribe_email' => $data['email'], 496 'subscribe_email' => $data['email'],
497 'email' => $data['email'], 497 'email' => $data['email'],
498 'telephone' => $data['telephone'], 498 'telephone' => $data['telephone'],
499 'is_worker' => 0, 499 'is_worker' => 0,
500 'password' => Hash::make($data['password']), 500 'password' => Hash::make($data['password']),
501 'pubpassword' => base64_encode($data['password']), 501 'pubpassword' => base64_encode($data['password']),
502 'email_verified_at' => Carbon::now() 502 'email_verified_at' => Carbon::now()
503 ]); 503 ]);
504 504
505 if ($Code_user->id > 0) { 505 if ($Code_user->id > 0) {
506 $Employer = new Employer(); 506 $Employer = new Employer();
507 $Employer->user_id = $Code_user->id; 507 $Employer->user_id = $Code_user->id;
508 $Employer->name_company = $data['name_company']; 508 $Employer->name_company = $data['name_company'];
509 $Employer->email = $data['email']; 509 $Employer->email = $data['email'];
510 $Employer->telephone = $data['telephone']; 510 $Employer->telephone = $data['telephone'];
511 $Employer->code = Tools::generator_id(10); 511 $Employer->code = Tools::generator_id(10);
512 $Employer->save(); 512 $Employer->save();
513 513
514 return $Code_user; 514 return $Code_user;
515 } 515 }
516 } 516 }
517 517
518 // Отправка сообщения от работодателя 518 // Отправка сообщения от работодателя
519 public function send_message(MessagesRequiest $request) { 519 public function send_message(MessagesRequiest $request) {
520 $params = $request->all(); 520 $params = $request->all();
521 dd($params); 521 dd($params);
522 $user1 = $params['user_id']; 522 $user1 = $params['user_id'];
523 $user2 = $params['to_user_id']; 523 $user2 = $params['to_user_id'];
524 524
525 if ($request->has('file')) { 525 if ($request->has('file')) {
526 $params['file'] = $request->file('file')->store("messages", 'public'); 526 $params['file'] = $request->file('file')->store("messages", 'public');
527 } 527 }
528 Message::create($params); 528 Message::create($params);
529 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 529 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
530 } 530 }
531 531
532 public function test123(Request $request) { 532 public function test123(Request $request) {
533 $params = $request->all(); 533 $params = $request->all();
534 $user1 = $params['user_id']; 534 $user1 = $params['user_id'];
535 $user2 = $params['to_user_id']; 535 $user2 = $params['to_user_id'];
536 $id_vacancy = $params['ad_employer_id']; 536 $id_vacancy = $params['ad_employer_id'];
537 $ad_name = $params['ad_name']; 537 $ad_name = $params['ad_name'];
538 538
539 $rules = [ 539 $rules = [
540 'text' => 'required|min:1|max:150000', 540 'text' => 'required|min:1|max:150000',
541 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' 541 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000'
542 ]; 542 ];
543 $messages = [ 543 $messages = [
544 'required' => 'Укажите обязательное поле', 544 'required' => 'Укажите обязательное поле',
545 'min' => [ 545 'min' => [
546 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 546 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
547 'integer' => 'Поле «:attribute» должно быть :min или больше', 547 'integer' => 'Поле «:attribute» должно быть :min или больше',
548 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 548 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
549 ], 549 ],
550 'max' => [ 550 'max' => [
551 'string' => 'Поле «:attribute» должно быть не больше :max символов', 551 'string' => 'Поле «:attribute» должно быть не больше :max символов',
552 'integer' => 'Поле «:attribute» должно быть :max или меньше', 552 'integer' => 'Поле «:attribute» должно быть :max или меньше',
553 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 553 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
554 ] 554 ]
555 ]; 555 ];
556 556
557 $validator = Validator::make($request->all(), $rules, $messages); 557 $validator = Validator::make($request->all(), $rules, $messages);
558 558
559 if ($validator->fails()) { 559 if ($validator->fails()) {
560 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) 560 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2])
561 ->withErrors($validator); 561 ->withErrors($validator);
562 } else { 562 } else {
563 if ($request->has('file')) { 563 if ($request->has('file')) {
564 $params['file'] = $request->file('file')->store("messages", 'public'); 564 $params['file'] = $request->file('file')->store("messages", 'public');
565 } 565 }
566 Message::create($params); 566 Message::create($params);
567 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 567 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
568 return redirect()->route('employer.dialog', 568 return redirect()->route('employer.dialog',
569 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]); 569 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]);
570 570
571 } 571 }
572 } 572 }
573 573
574 //Избранные люди 574 //Избранные люди
575 public function favorites(Request $request) { 575 public function favorites(Request $request) {
576 $IP_address = RusDate::ip_addr_client(); 576 $IP_address = RusDate::ip_addr_client();
577 $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); 577 $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get();
578 578
579 if ($Arr->count()) { 579 if ($Arr->count()) {
580 $A = Array(); 580 $A = Array();
581 foreach ($Arr as $it) { 581 foreach ($Arr as $it) {
582 $A[] = $it->code_record; 582 $A[] = $it->code_record;
583 } 583 }
584 584
585 $Workers = Worker::query()->whereIn('id', $A); 585 $Workers = Worker::query()->whereIn('id', $A);
586 } else { 586 } else {
587 $Workers = Worker::query()->where('id', '=', '0'); 587 $Workers = Worker::query()->where('id', '=', '0');
588 } 588 }
589 589
590 if (($request->has('search')) && (!empty($request->get('search')))) { 590 if (($request->has('search')) && (!empty($request->get('search')))) {
591 $search = $request->get('search'); 591 $search = $request->get('search');
592 592
593 $Workers = $Workers->WhereHas('users', 593 $Workers = $Workers->WhereHas('users',
594 function (Builder $query) use ($search) { 594 function (Builder $query) use ($search) {
595 $query->Where('surname', 'LIKE', "%$search%") 595 $query->Where('surname', 'LIKE', "%$search%")
596 ->orWhere('name_man', 'LIKE', "%$search%") 596 ->orWhere('name_man', 'LIKE', "%$search%")
597 ->orWhere('surname2', 'LIKE', "%$search%"); 597 ->orWhere('surname2', 'LIKE', "%$search%");
598 }); 598 });
599 } else { 599 } else {
600 $Workers = $Workers->with('users'); 600 $Workers = $Workers->with('users');
601 } 601 }
602 602
603 $Workers = $Workers->get(); 603 $Workers = $Workers->get();
604 604
605 605
606 return view('employers.favorite', compact('Workers')); 606 return view('employers.favorite', compact('Workers'));
607 } 607 }
608 608
609 // База данных 609 // База данных
610 public function bd(Request $request) { 610 public function bd(Request $request) {
611 // для типа BelongsTo 611 // для типа BelongsTo
612 //$documents = Document::query()->orderBy(Location::select('name') 612 //$documents = Document::query()->orderBy(Location::select('name')
613 // ->whereColumn('locations.id', 'documents.location_id') 613 // ->whereColumn('locations.id', 'documents.location_id')
614 //); 614 //);
615 615
616 // для типа HasOne/Many 616 // для типа HasOne/Many
617 // $documents = Document::::query()->orderBy(Location::select('name') 617 // $documents = Document::::query()->orderBy(Location::select('name')
618 // ->whereColumn('locations.document_id', 'documents.id') 618 // ->whereColumn('locations.document_id', 'documents.id')
619 //); 619 //);
620 620
621 621
622 $users = User_Model::query()->with('workers'); 622 $users = User_Model::query()->with('workers');
623 623
624 if ($request->has('search')) { 624 if ($request->has('search')) {
625 $find_key = $request->get('search'); 625 $find_key = $request->get('search');
626 $users = $users->where('name', 'LIKE', "%$find_key%") 626 $users = $users->where('name', 'LIKE', "%$find_key%")
627 ->orWhere('surname', 'LIKE', "%$find_key%") 627 ->orWhere('surname', 'LIKE', "%$find_key%")
628 ->orWhere('name_man', 'LIKE', "%$find_key%") 628 ->orWhere('name_man', 'LIKE', "%$find_key%")
629 ->orWhere('email', 'LIKE', "%$find_key%") 629 ->orWhere('email', 'LIKE', "%$find_key%")
630 ->orWhere('telephone', 'LIKE', "%$find_key%"); 630 ->orWhere('telephone', 'LIKE', "%$find_key%");
631 } 631 }
632 632
633 // Данные 633 // Данные
634 $users = $users->Baseuser()-> 634 $users = $users->Baseuser()->
635 orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id')); 635 orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id'));
636 $count_users = $users; 636 $count_users = $users;
637 $users = $users->paginate(5); 637 $users = $users->paginate(5);
638 638
639 639
640 return view('employers.bd', compact('users', 'count_users')); 640 return view('employers.bd', compact('users', 'count_users'));
641 } 641 }
642 642
643 //Настройка уведомлений 643 //Настройка уведомлений
644 public function subscribe() { 644 public function subscribe() {
645 return view('employers.subcribe'); 645 return view('employers.subcribe');
646 } 646 }
647 647
648 //Установка уведомлений сохранение 648 //Установка уведомлений сохранение
649 public function save_subscribe(Request $request) { 649 public function save_subscribe(Request $request) {
650 dd($request->all()); 650 dd($request->all());
651 $msg = $request->validate([ 651 $msg = $request->validate([
652 'subscribe_email' => 'required|email|min:5|max:255', 652 'subscribe_email' => 'required|email|min:5|max:255',
653 ]); 653 ]);
654 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); 654 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку');
655 } 655 }
656 656
657 //Сбросить форму с паролем 657 //Сбросить форму с паролем
658 public function password_reset() { 658 public function password_reset() {
659 $email = Auth()->user()->email; 659 $email = Auth()->user()->email;
660 return view('employers.password-reset', compact('email')); 660 return view('employers.password-reset', compact('email'));
661 } 661 }
662 662
663 //Обновление пароля 663 //Обновление пароля
664 public function new_password(Request $request) { 664 public function new_password(Request $request) {
665 $use = Auth()->user(); 665 $use = Auth()->user();
666 $request->validate([ 666 $request->validate([
667 'password' => 'required|string', 667 'password' => 'required|string',
668 'new_password' => 'required|string', 668 'new_password' => 'required|string',
669 'new_password2' => 'required|string' 669 'new_password2' => 'required|string'
670 ]); 670 ]);
671 671
672 if ($request->get('new_password') == $request->get('new_password2')) 672 if ($request->get('new_password') == $request->get('new_password2'))
673 if ($request->get('password') !== $request->get('new_password')) { 673 if ($request->get('password') !== $request->get('new_password')) {
674 $credentials = $request->only('email', 'password'); 674 $credentials = $request->only('email', 'password');
675 if (Auth::attempt($credentials)) { 675 if (Auth::attempt($credentials)) {
676 676
677 if (!is_null($use->email_verified_at)){ 677 if (!is_null($use->email_verified_at)){
678 678
679 $user_data = User_Model::find($use->id); 679 $user_data = User_Model::find($use->id);
680 $user_data->update([ 680 $user_data->update([
681 'password' => Hash::make($request->get('new_password')), 681 'password' => Hash::make($request->get('new_password')),
682 'pubpassword' => base64_encode($request->get('new_password')), 682 'pubpassword' => base64_encode($request->get('new_password')),
683 ]); 683 ]);
684 return redirect() 684 return redirect()
685 ->route('employer.password_reset') 685 ->route('employer.password_reset')
686 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 686 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
687 } 687 }
688 688
689 return redirect() 689 return redirect()
690 ->route('employer.password_reset') 690 ->route('employer.password_reset')
691 ->withError('Данная учетная запись не было верифицированна!'); 691 ->withError('Данная учетная запись не было верифицированна!');
692 } 692 }
693 } 693 }
694 694
695 return redirect() 695 return redirect()
696 ->route('employer.password_reset') 696 ->route('employer.password_reset')
697 ->withErrors('Не совпадение данных, обновите пароли!'); 697 ->withErrors('Не совпадение данных, обновите пароли!');
698 } 698 }
699 699
700 700
701 701
702 // Форма Удаление пипла 702 // Форма Удаление пипла
703 public function delete_people() { 703 public function delete_people() {
704 $login = Auth()->user()->email; 704 $login = Auth()->user()->email;
705 return view('employers.delete_people', compact('login')); 705 return view('employers.delete_people', compact('login'));
706 } 706 }
707 707
708 // Удаление аккаунта 708 // Удаление аккаунта
709 public function action_delete_user(Request $request) { 709 public function action_delete_user(Request $request) {
710 $Answer = $request->all(); 710 $Answer = $request->all();
711 $user_id = Auth()->user()->id; 711 $user_id = Auth()->user()->id;
712 $request->validate([ 712 $request->validate([
713 'password' => 'required|string', 713 'password' => 'required|string',
714 ]); 714 ]);
715 715
716 $credentials = $request->only('email', 'password'); 716 $credentials = $request->only('email', 'password');
717 if (Auth::attempt($credentials)) { 717 if (Auth::attempt($credentials)) {
718 Auth::logout(); 718 Auth::logout();
719 $it = User_Model::find($user_id); 719 $it = User_Model::find($user_id);
720 $it->delete(); 720 $it->delete();
721 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 721 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
722 } else { 722 } else {
723 return redirect()->route('employer.delete_people') 723 return redirect()->route('employer.delete_people')
724 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 724 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
725 } 725 }
726 } 726 }
727 727
728 public function ajax_delete_user(Request $request) { 728 public function ajax_delete_user(Request $request) {
729 $Answer = $request->all(); 729 $Answer = $request->all();
730 $user_id = Auth()->user()->id; 730 $user_id = Auth()->user()->id;
731 $request->validate([ 731 $request->validate([
732 'password' => 'required|string', 732 'password' => 'required|string',
733 ]); 733 ]);
734 $credentials = $request->only('email', 'password'); 734 $credentials = $request->only('email', 'password');
735 if (Auth::attempt($credentials)) { 735 if (Auth::attempt($credentials)) {
736 736
737 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', 737 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт',
738 'email' => $request->get('email'), 738 'email' => $request->get('email'),
739 'password' => $request->get('password'))); 739 'password' => $request->get('password')));
740 } else { 740 } else {
741 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); 741 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль'));
742 } 742 }
743 } 743 }
744 744
745 // FAQ - Вопросы/ответы для работодателей и соискателей 745 // FAQ - Вопросы/ответы для работодателей и соискателей
746 public function faq() { 746 public function faq() {
747 return view('employers.faq'); 747 return view('employers.faq');
748 } 748 }
749 749
750 // Рассылка сообщений 750 // Рассылка сообщений
751 public function send_all_messages() { 751 public function send_all_messages() {
752 $id = Auth()->user()->id; 752 $id = Auth()->user()->id;
753 $sending = Employer::query()->where('user_id', '=', "$id")->first(); 753 $sending = Employer::query()->where('user_id', '=', "$id")->first();
754 754
755 if ($sending->sending_is) 755 if ($sending->sending_is)
756 return view('employers.send_all'); 756 return view('employers.send_all');
757 else 757 else
758 return view('employers.send_all_danger'); 758 return view('employers.send_all_danger');
759 } 759 }
760 760
761 // Отправка сообщений для информации 761 // Отправка сообщений для информации
762 public function send_all_post(Request $request) { 762 public function send_all_post(Request $request) {
763 $data = $request->all(); 763 $data = $request->all();
764 764
765 $emails = User_Model::query()->where('is_worker', '1')->get(); 765 $emails = User_Model::query()->where('is_worker', '1')->get();
766 766
767 foreach ($emails as $e) { 767 foreach ($emails as $e) {
768 Mail::to($e->email)->send(new SendAllMessages($data)); 768 Mail::to($e->email)->send(new SendAllMessages($data));
769 } 769 }
770 770
771 return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); 771 return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены');
772 } 772 }
773 773
774 // База резюме 774 // База резюме
775 public function bd_tupe(Request $request) { 775 public function bd_tupe(Request $request) {
776 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); 776 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get();
777 777
778 return view('employers.bd_tupe', compact('Resume')); 778 return view('employers.bd_tupe', compact('Resume'));
779 } 779 }
780 780
781 ////////////////////////////////////////////////////////////////// 781 //////////////////////////////////////////////////////////////////
782 // Отправил сообщение 782 // Отправил сообщение
783 ////////////////////////////////////////////////////////////////// 783 //////////////////////////////////////////////////////////////////
784 public function new_message(Request $request) { 784 public function new_message(Request $request) {
785 $params = $request->all(); 785 $params = $request->all();
786 $id = $params['_user_id']; 786 $id = $params['_user_id'];
787 $message = new Message(); 787 $message = new Message();
788 $message->user_id = $params['_user_id']; 788 $message->user_id = $params['_user_id'];
789 $message->to_user_id = $params['_to_user_id']; 789 $message->to_user_id = $params['_to_user_id'];
790 $message->title = $params['title']; 790 $message->title = $params['title'];
791 $message->text = $params['text']; 791 $message->text = $params['text'];
792 if ($request->has('_file')) { 792 if ($request->has('_file')) {
793 $message->file = $request->file('_file')->store("worker/$id", 'public'); 793 $message->file = $request->file('_file')->store("worker/$id", 'public');
794 } 794 }
795 $message->ad_employer_id = $params['_vacancy']; 795 $message->ad_employer_id = $params['_vacancy'];
796 $message->flag_new = 1; 796 $message->flag_new = 1;
797 $id_message = $message->save(); 797 $id_message = $message->save();
798 798
799 //$data['message_id'] = $id_message; 799 //$data['message_id'] = $id_message;
800 //$data['ad_employer_id'] = $params['_vacancy']; 800 //$data['ad_employer_id'] = $params['_vacancy'];
801 //$data['job_title_id'] = 0; 801 //$data['job_title_id'] = 0;
802 802
803 $data['flag'] = 1; 803 $data['flag'] = 1;
804 //$ad_responce = ad_response::create($data); 804 //$ad_responce = ad_response::create($data);
805 return redirect()->route('employer.messages', ['type_message' => 'output']); 805 return redirect()->route('employer.messages', ['type_message' => 'output']);
806 } 806 }
807 807
808 // Восстановление пароля 808 // Восстановление пароля
809 public function repair_password(Request $request) { 809 public function repair_password(Request $request) {
810 $params = $request->get('email'); 810 $params = $request->get('email');
811 } 811 }
812 812
813 // Избранные люди на корабль 813 // Избранные люди на корабль
814 public function selected_people(Request $request) { 814 public function selected_people(Request $request) {
815 $id = $request->get('id'); 815 $id = $request->get('id');
816 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 816 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
817 where('is_remove', '=', '0')-> 817 where('is_remove', '=', '0')->
818 where('is_bd', '=', '0')-> 818 where('is_bd', '=', '0')->
819 where('position_id', $id)-> 819 where('position_id', $id)->
820 get(); 820 get();
821 return view('favorite_people', compact('favorite_people')); 821 return view('favorite_people', compact('favorite_people'));
822 } 822 }
823 } 823 }
824 824
app/Http/Controllers/MainController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Classes\RusDate; 5 use App\Classes\RusDate;
6 use App\Classes\Tools; 6 use App\Classes\Tools;
7 use App\Mail\MailRegistration; 7 use App\Mail\MailRegistration;
8 use App\Mail\MailRepair; 8 use App\Mail\MailRepair;
9 use App\Models\Ad_employer; 9 use App\Models\Ad_employer;
10 use App\Models\Ad_jobs; 10 use App\Models\Ad_jobs;
11 use App\Models\Category; 11 use App\Models\Category;
12 use App\Models\Education; 12 use App\Models\Education;
13 use App\Models\Employer; 13 use App\Models\Employer;
14 use App\Models\employers_main; 14 use App\Models\employers_main;
15 use App\Models\Job_title; 15 use App\Models\Job_title;
16 use App\Models\Like_vacancy; 16 use App\Models\Like_vacancy;
17 use App\Models\Like_worker; 17 use App\Models\Like_worker;
18 use App\Models\News; 18 use App\Models\News;
19 use App\Models\Positions; 19 use App\Models\Positions;
20 use App\Models\reclame; 20 use App\Models\reclame;
21 use App\Models\User; 21 use App\Models\User;
22 use Illuminate\Http\Request; 22 use Illuminate\Http\Request;
23 use Illuminate\Support\Facades\Auth; 23 use Illuminate\Support\Facades\Auth;
24 use Illuminate\Support\Facades\DB; 24 use Illuminate\Support\Facades\DB;
25 use Illuminate\Support\Facades\Hash; 25 use Illuminate\Support\Facades\Hash;
26 use Illuminate\Support\Facades\Mail; 26 use Illuminate\Support\Facades\Mail;
27 use Illuminate\Support\Facades\Validator; 27 use Illuminate\Support\Facades\Validator;
28 use App\Classes\StatusUser; 28 use App\Classes\StatusUser;
29 29
30 class MainController extends Controller 30 class MainController extends Controller
31 { 31 {
32 // Главная страница публичной части 32 // Главная страница публичной части
33 public function index() { 33 public function index() {
34 $news = News::query()->orderByDesc('id')->limit(6)->get(); 34 $news = News::query()->orderByDesc('id')->limit(6)->get();
35 35
36 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') 36 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*')
37 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') 37 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id')
38 ->OrderByDesc('created_at') 38 ->OrderByDesc('created_at')
39 ->GroupBy('categories.id') 39 ->GroupBy('categories.id')
40 ->get(); 40 ->get();
41 41
42 //$Position = Category::query()->where('is_remove', '=', '0')->get(); 42 //$Position = Category::query()->where('is_remove', '=', '0')->get();
43 $Job_title = Job_title::query()->where('is_remove', '=', '0')-> 43 $Job_title = Job_title::query()->where('is_remove', '=', '0')->
44 where('is_bd', '=', '0')->orderBy('name')->get(); 44 where('is_bd', '=', '0')->orderBy('name')->get();
45 45
46 /*$BigFlot = Array(); 46 /*$BigFlot = Array();
47 foreach ($Position as $position) { 47 foreach ($Position as $position) {
48 $BigFlot[] = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')-> 48 $BigFlot[] = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')->
49 orderBy('job_titles.sort')-> 49 orderBy('job_titles.sort')->
50 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 50 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
51 where('position_ship', "$position->name")-> 51 where('position_ship', "$position->name")->
52 groupby('job_title_id','position_ship')-> 52 groupby('job_title_id','position_ship')->
53 get(); 53 get();
54 } 54 }
55 $BigFlot = Array(); 55 $BigFlot = Array();
56 foreach ($Position as $position) { 56 foreach ($Position as $position) {
57 $BigFlot[] = Ad_jobs::query()->with(['job_title' => function($query) { 57 $BigFlot[] = Ad_jobs::query()->with(['job_title' => function($query) {
58 $query->OrderBy('sort'); 58 $query->OrderBy('sort');
59 }])->whereHas('job_title', function ($query) use ($position) { 59 }])->whereHas('job_title', function ($query) use ($position) {
60 $query->where('position_id', $position->id); 60 $query->where('position_id', $position->id);
61 })-> 61 })->
62 distinct('job_title_id')-> 62 distinct('job_title_id')->
63 get(); 63 get();
64 }*/ 64 }*/
65 /*$BigFlot = Array(); 65 /*$BigFlot = Array();
66 foreach ($Position as $position) { 66 foreach ($Position as $position) {
67 $BigFlot[$position->id] = DB::table('ad_jobs')-> 67 $BigFlot[$position->id] = DB::table('ad_jobs')->
68 selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name, job_titles.position_id')-> 68 selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name, job_titles.position_id')->
69 orderByDesc('job_titles.sort')-> 69 orderByDesc('job_titles.sort')->
70 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 70 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
71 where('job_titles.position_id', $position->id)-> 71 where('job_titles.position_id', $position->id)->
72 groupby('job_title_id')-> 72 groupby('job_title_id')->
73 get(); 73 get();
74 }*/ 74 }*/
75 $Data = DB::table('job_titles')-> 75 $Data = DB::table('job_titles')->
76 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')-> 76 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')->
77 where('categories.is_remove', '=', '0')-> 77 where('categories.is_remove', '=', '0')->
78 where('job_titles.is_remove', '=', '0')-> 78 where('job_titles.is_remove', '=', '0')->
79 where('job_titles.is_bd', '=' , '0')-> 79 where('job_titles.is_bd', '=' , '0')->
80 leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')-> 80 leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')->
81 join('categories', 'categories.id', '=', 'job_titles.position_id')-> 81 join('categories', 'categories.id', '=', 'job_titles.position_id')->
82 groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')-> 82 groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')->
83 orderByDesc('job_titles.sort')->get()->toArray(); 83 orderByDesc('job_titles.sort')->get()->toArray();
84 84
85 $Main_Job = array(); 85 $Main_Job = array();
86 $name_cat = ''; 86 $name_cat = '';
87 foreach ($Data as $it) { 87 foreach ($Data as $it) {
88 $it_arr = (array)$it; 88 $it_arr = (array)$it;
89 if ($name_cat != $it_arr['catname']) $name_cat = $it_arr['catname']; 89 if ($name_cat != $it_arr['catname']) $name_cat = $it_arr['catname'];
90 $Main_Job[$name_cat][] = $it_arr; 90 $Main_Job[$name_cat][] = $it_arr;
91 } 91 }
92 92
93 $employers = employers_main::query()->with('employer')-> 93 $employers = employers_main::query()->with('employer')->
94 whereHas('employer', function ($query) { 94 whereHas('employer', function ($query) {
95 $query->where('status_hidden', '=', '0'); 95 $query->where('status_hidden', '=', '0');
96 })-> 96 })->
97 orderBy('sort')->get(); 97 orderBy('sort')->get();
98 $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get(); 98 $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get();
99 return view('index', compact('news', 'Job_title', 'categories', 'employers', 'vacancy', 'Main_Job')); 99 return view('index', compact('news', 'Job_title', 'categories', 'employers', 'vacancy', 'Main_Job'));
100 } 100 }
101 101
102 public function search_vacancies(Request $request) { 102 public function search_vacancies(Request $request) {
103 if ($request->has('search')) { 103 if ($request->has('search')) {
104 $search = $request->get('search'); 104 $search = $request->get('search');
105 $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first(); 105 $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first();
106 if (isset($job_titles->id)) 106 if (isset($job_titles->id))
107 if ($job_titles->id > 0) 107 if ($job_titles->id > 0)
108 return redirect()->route('vacancies', ['job' => $job_titles->id]); 108 return redirect()->route('vacancies', ['job' => $job_titles->id]);
109 } 109 }
110 } 110 }
111 111
112 // Лайк вакансии 112 // Лайк вакансии
113 public function like_vacancy(Request $request) { 113 public function like_vacancy(Request $request) {
114 $IP_address = RusDate::ip_addr_client(); 114 $IP_address = RusDate::ip_addr_client();
115 115
116 if ($request->has('code_record')) { 116 if ($request->has('code_record')) {
117 if ($request->has('delete')) { 117 if ($request->has('delete')) {
118 $code = $request->get('code_record'); 118 $code = $request->get('code_record');
119 $atomic_era = Like_vacancy::select('id')-> 119 $atomic_era = Like_vacancy::select('id')->
120 where('code_record', '=', $code)->toSql(); 120 where('code_record', '=', $code)->toSql();
121 DB::table('like_vacancy')->where('code_record', $request->get('code_record'))->delete(); 121 DB::table('like_vacancy')->where('code_record', $request->get('code_record'))->delete();
122 122
123 } else { 123 } else {
124 $params = $request->all(); 124 $params = $request->all();
125 $params['ip_address'] = $IP_address; 125 $params['ip_address'] = $IP_address;
126 Like_vacancy::create($params); 126 Like_vacancy::create($params);
127 } 127 }
128 } 128 }
129 } 129 }
130 130
131 // Лайк соискателю. 131 // Лайк соискателю.
132 public function like_worker(Request $request) { 132 public function like_worker(Request $request) {
133 $IP_address = RusDate::ip_addr_client(); 133 $IP_address = RusDate::ip_addr_client();
134 134
135 if ($request->has('code_record')) { 135 if ($request->has('code_record')) {
136 if ($request->has('delete')) { 136 if ($request->has('delete')) {
137 $atomic_era = Like_worker::select('id')-> 137 $atomic_era = Like_worker::select('id')->
138 where('code_record', '=', $request-> 138 where('code_record', '=', $request->
139 get('code_record'))->first(); 139 get('code_record'))->first();
140 140
141 DB::table('like_worker')->where('code_record', $request->get('code_record'))->delete(); 141 DB::table('like_worker')->where('code_record', $request->get('code_record'))->delete();
142 142
143 return "Вот и результат удаления!"; 143 return "Вот и результат удаления!";
144 144
145 } else { 145 } else {
146 $params = $request->all(); 146 $params = $request->all();
147 $params['ip_address'] = $IP_address; 147 $params['ip_address'] = $IP_address;
148 Like_worker::create($params); 148 Like_worker::create($params);
149 } 149 }
150 } 150 }
151 } 151 }
152 152
153 public function vacancies(Request $request) { 153 public function vacancies(Request $request) {
154 //должности 154 //должности
155 $Job_title = Job_title::query()->where('is_remove', '=', '0')-> 155 $Job_title = Job_title::query()->where('is_remove', '=', '0')->
156 where('is_bd', '=', '0')->orderByDesc('sort')->orderBy('name')->get(); 156 where('is_bd', '=', '0')->orderByDesc('sort')->orderBy('name')->get();
157 157
158 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') 158 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*')
159 ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary') 159 ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary')
160 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') 160 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id')
161 ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id'); 161 ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id');
162 162
163 //категории и вакансии 163 //категории и вакансии
164 if (($request->has('job')) && ($request->get('job') > 0)) { 164 if (($request->has('job')) && ($request->get('job') > 0)) {
165 $categories = $categories->Where('job_title_id', '=', $request->get('job')); 165 $categories = $categories->Where('job_title_id', '=', $request->get('job'));
166 } 166 }
167 167
168 $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get(); 168 $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get();
169 169
170 //$Position = Category::query()->where('is_remove', '=', '0')->get(); 170 //$Position = Category::query()->where('is_remove', '=', '0')->get();
171 171
172 172
173 /*$BigFlot = Array(); 173 /*$BigFlot = Array();
174 foreach ($Position as $position) { 174 foreach ($Position as $position) {
175 $War_flot = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')-> 175 $War_flot = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')->
176 orderBy('job_titles.sort')-> 176 orderBy('job_titles.sort')->
177 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 177 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
178 where('position_ship', "$position->name"); 178 where('position_ship', "$position->name");
179 if (($request->has('job')) && ($request->get('job') > 0)) { 179 if (($request->has('job')) && ($request->get('job') > 0)) {
180 $War_flot = $War_flot->where('job_title_id', $request->get('job')); 180 $War_flot = $War_flot->where('job_title_id', $request->get('job'));
181 } 181 }
182 $War_flot = $War_flot->groupby('job_title_id','position_ship')->get(); 182 $War_flot = $War_flot->groupby('job_title_id','position_ship')->get();
183 $BigFlot[] = $War_flot; 183 $BigFlot[] = $War_flot;
184 }*/ 184 }*/
185 /* 185 /*
186 $BigFlot = Array(); 186 $BigFlot = Array();
187 foreach ($Position as $position) { 187 foreach ($Position as $position) {
188 $WarFlot = DB::table('ad_jobs')-> 188 $WarFlot = DB::table('ad_jobs')->
189 selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')-> 189 selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')->
190 orderByDesc('job_titles.sort')-> 190 orderByDesc('job_titles.sort')->
191 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 191 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
192 where('job_titles.position_id', $position->id); 192 where('job_titles.position_id', $position->id);
193 if (($request->has('job')) && ($request->get('job') > 0)) { 193 if (($request->has('job')) && ($request->get('job') > 0)) {
194 $WarFlot = $WarFlot->where('job_title_id', $request->get('job')); 194 $WarFlot = $WarFlot->where('job_title_id', $request->get('job'));
195 } 195 }
196 $WarFlot = $WarFlot->groupby('job_title_id')->get(); 196 $WarFlot = $WarFlot->groupby('job_title_id')->get();
197 $BigFlot[] = $WarFlot; 197 $BigFlot[] = $WarFlot;
198 } 198 }
199 */ 199 */
200 200
201 $Data = DB::table('job_titles')-> 201 $Data = DB::table('job_titles')->
202 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')-> 202 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')->
203 where('categories.is_remove', '=', '0')-> 203 where('categories.is_remove', '=', '0')->
204 where('job_titles.is_bd', '=' , '0')-> 204 where('job_titles.is_bd', '=' , '0')->
205 where('job_titles.is_remove', '=', '0'); 205 where('job_titles.is_remove', '=', '0');
206 if (($request->has('job')) && ($request->get('job') > 0)) { 206 if (($request->has('job')) && ($request->get('job') > 0)) {
207 $Data = $Data->where('job_title_id', $request->get('job')); 207 $Data = $Data->where('job_title_id', $request->get('job'));
208 } 208 }
209 $Data = $Data->leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')-> 209 $Data = $Data->leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')->
210 join('categories', 'categories.id', '=', 'job_titles.position_id')-> 210 join('categories', 'categories.id', '=', 'job_titles.position_id')->
211 groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')-> 211 groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')->
212 orderByDesc('job_titles.sort')->get()->toArray(); 212 orderByDesc('job_titles.sort')->get()->toArray();
213 213
214 $Main_Job = array(); 214 $Main_Job = array();
215 $name_cat = ''; 215 $name_cat = '';
216 foreach ($Data as $it) { 216 foreach ($Data as $it) {
217 $it_arr = (array)$it; 217 $it_arr = (array)$it;
218 if ($name_cat != $it_arr['catname']) 218 if ($name_cat != $it_arr['catname'])
219 $name_cat = $it_arr['catname']; 219 $name_cat = $it_arr['catname'];
220 $Main_Job[$name_cat][] = $it_arr; 220 $Main_Job[$name_cat][] = $it_arr;
221 } 221 }
222 222
223 if ($request->ajax()) { 223 if ($request->ajax()) {
224 return view('ajax.new_sky', compact('categories', 'Main_Job')); 224 return view('ajax.new_sky', compact('categories', 'Main_Job'));
225 } else { 225 } else {
226 return view('new_sky', compact('Job_title', 'categories', 'Main_Job')); 226 return view('new_sky', compact('Job_title', 'categories', 'Main_Job'));
227 } 227 }
228 } 228 }
229 229
230 //Вакансии категория детальная 230 //Вакансии категория детальная
231 public function list_vacancies(Category $categories, Request $request) { 231 public function list_vacancies(Category $categories, Request $request) {
232 if (isset(Auth()->user()->id)) 232 if (isset(Auth()->user()->id))
233 $uid = Auth()->user()->id; 233 $uid = Auth()->user()->id;
234 else 234 else
235 $uid = 0; 235 $uid = 0;
236 236
237 if ($request->get('job') == 0) 237 if ($request->get('job') == 0)
238 $job_search = ''; 238 $job_search = '';
239 else 239 else
240 $job_search = $request->get('job'); 240 $job_search = $request->get('job');
241 241
242 $Query = Ad_employer::with('jobs')-> 242 $Query = Ad_employer::with('jobs')->
243 with('cat')-> 243 with('cat')->
244 with('employer')->
245 whereHas('jobs_code', function ($query) use ($job_search) { 244 with('employer')->
246 if (!empty($job_search)) { 245 whereHas('jobs_code', function ($query) use ($job_search) {
247 $query->where('job_title_id', $job_search); 246 if (!empty($job_search)) {
248 } 247 $query->where('job_title_id', $job_search);
249 })->select('ad_employers.*'); 248 }
250 249 })->select('ad_employers.*');
251 if (isset($categories->id) && ($categories->id > 0)) { 250
252 $Query = $Query->where('category_id', '=', $categories->id); 251 if (isset($categories->id) && ($categories->id > 0)) {
253 $Name_categori = Category::query()->where('id', '=', $categories->id)->get(); 252 $Query = $Query->where('category_id', '=', $categories->id);
254 } else { 253 $Name_categori = Category::query()->where('id', '=', $categories->id)->get();
255 $Name_categori = ''; 254 } else {
256 } 255 $Name_categori = '';
257 256 }
258 if ($request->get('sort')) { 257
259 $sort = $request->get('sort'); 258 if ($request->get('sort')) {
260 switch ($sort) { 259 $sort = $request->get('sort');
261 case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break; 260 switch ($sort) {
262 case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break; 261 case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break;
263 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; 262 case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break;
264 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; 263 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
265 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; 264 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
266 default: $Query = $Query->orderbyDesc('updated_at')->orderBy('id'); break; 265 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
267 } 266 default: $Query = $Query->orderbyDesc('updated_at')->orderBy('id'); break;
268 } 267 }
269 268 }
270 $Job_title = Job_title::query()->where('is_bd', '=', '0')->OrderBy('name')->get(); 269
271 270 $Job_title = Job_title::query()->where('is_bd', '=', '0')->OrderBy('name')->get();
272 $Query_count = $Query->count(); 271
273 272 $Query_count = $Query->count();
274 $Query = $Query->OrderByDesc('updated_at')->paginate(3); 273
275 274 $Query = $Query->OrderByDesc('updated_at')->paginate(3);
276 $Reclama = reclame::query()->get(); 275
277 276 $Reclama = reclame::query()->get();
278 if ($request->ajax()) { 277
279 if ($request->has('title')) { 278 if ($request->ajax()) {
280 return view('ajax.list_category', compact( 279 if ($request->has('title')) {
281 'Name_categori' 280 return view('ajax.list_category', compact(
282 )); 281 'Name_categori'
283 } else { 282 ));
284 return view('ajax.list_vacancies', compact('Query', 283 } else {
285 'Query_count', 284 return view('ajax.list_vacancies', compact('Query',
286 'Name_categori', 285 'Query_count',
287 'Reclama', 286 'Name_categori',
288 'categories', 287 'Reclama',
289 'Job_title', 288 'categories',
290 'uid')); 289 'Job_title',
291 } 290 'uid'));
292 } else { 291 }
293 //Вернуть все 292 } else {
294 return view('list_vacancies', compact('Query', 293 //Вернуть все
295 'Query_count', 294 return view('list_vacancies', compact('Query',
296 'Reclama', 295 'Query_count',
297 'Name_categori', 296 'Reclama',
298 'categories', 297 'Name_categori',
299 'Job_title', 298 'categories',
300 'uid')); 299 'Job_title',
301 } 300 'uid'));
302 } 301 }
303 302 }
304 // Образование 303
305 public function education(Request $request) { 304 // Образование
306 $educations = Education::query(); 305 public function education(Request $request) {
307 if (($request->has('search')) && (!empty($request->get('search')))) { 306 $educations = Education::query();
308 $search = trim($request->get('search')); 307 if (($request->has('search')) && (!empty($request->get('search')))) {
309 $educations = $educations->where('name', 'LIKE', "%$search%"); 308 $search = trim($request->get('search'));
310 } 309 $educations = $educations->where('name', 'LIKE', "%$search%");
311 310 }
312 if ($request->get('sort')) { 311
313 $sort = $request->get('sort'); 312 if ($request->get('sort')) {
314 switch ($sort) { 313 $sort = $request->get('sort');
315 case 'name_up': $educations = $educations->orderBy('name')->orderBy('id'); break; 314 switch ($sort) {
316 case 'name_down': $educations = $educations->orderByDesc('name')->orderby('id'); break; 315 case 'name_up': $educations = $educations->orderBy('name')->orderBy('id'); break;
317 case 'created_at_up': $educations = $educations->OrderBy('created_at')->orderBy('id'); break; 316 case 'name_down': $educations = $educations->orderByDesc('name')->orderby('id'); break;
318 case 'created_at_down': $educations = $educations->orderByDesc('created_at')->orderBy('id'); break; 317 case 'created_at_up': $educations = $educations->OrderBy('created_at')->orderBy('id'); break;
319 case 'default': $educations = $educations->orderBy('id')->orderby('updated_at'); break; 318 case 'created_at_down': $educations = $educations->orderByDesc('created_at')->orderBy('id'); break;
320 default: $educations = $educations->orderBy('id')->orderby('updated_at'); break; 319 case 'default': $educations = $educations->orderBy('id')->orderby('updated_at'); break;
321 } 320 default: $educations = $educations->orderBy('id')->orderby('updated_at'); break;
322 } 321 }
323 322 }
324 $count_edu = $educations->count(); 323
325 $educations = $educations->paginate(6); 324 $count_edu = $educations->count();
326 if ($request->ajax()) { 325 $educations = $educations->paginate(6);
327 return view('ajax.education', compact('educations')); 326 if ($request->ajax()) {
328 } else { 327 return view('ajax.education', compact('educations'));
329 return view('education', compact('educations', 'count_edu')); 328 } else {
330 } 329 return view('education', compact('educations', 'count_edu'));
331 } 330 }
332 331 }
333 // Контакты 332
334 public function contacts() { 333 // Контакты
335 return view('contacts'); 334 public function contacts() {
336 } 335 return view('contacts');
337 336 }
338 // Вход в личный кабинет 337
339 public function input_login(Request $request) 338 // Вход в личный кабинет
340 { 339 public function input_login(Request $request)
341 $params = $request->all(); 340 {
342 341 $params = $request->all();
343 342
344 $rules = [ 343
345 'email' => 'required|string|email', 344 $rules = [
346 'password' => 'required|string|min:3|max:25', 345 'email' => 'required|string|email',
347 ]; 346 'password' => 'required|string|min:3|max:25',
348 347 ];
349 $messages = [ 348
350 'required' => 'Укажите обязательное поле «:attribute»', 349 $messages = [
351 'email' => 'Введите корректный email', 350 'required' => 'Укажите обязательное поле «:attribute»',
352 'min' => [ 351 'email' => 'Введите корректный email',
353 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 352 'min' => [
354 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 353 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
355 ], 354 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
356 'max' => [ 355 ],
357 'string' => 'Поле «:attribute» должно быть не больше :max символов', 356 'max' => [
358 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 357 'string' => 'Поле «:attribute» должно быть не больше :max символов',
359 ], 358 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
360 ]; 359 ],
361 $validator = Validator::make($request->all(), $rules, $messages); 360 ];
362 if ($validator->fails()) { 361 $validator = Validator::make($request->all(), $rules, $messages);
363 if (Auth::check()) 362 if ($validator->fails()) {
364 $user_id = $request->user()->id; 363 if (Auth::check())
365 else 364 $user_id = $request->user()->id;
366 $user_id = 0; 365 else
367 366 $user_id = 0;
368 if ($user_id > 0) 367
369 return json_encode(Array("ERROR" => "Email или пароль невалидный!")); 368 if ($user_id > 0)
370 else 369 return json_encode(Array("ERROR" => "Email или пароль невалидный!"));
371 return redirect()->route('index')->with('Error', "Email или пароль невалидный"); 370 else
372 } else { 371 return redirect()->route('index')->with('Error', "Email или пароль невалидный");
373 $credentials = $request->only('email', 'password'); 372 } else {
374 373 $credentials = $request->only('email', 'password');
375 if (Auth::attempt($credentials, $request->has('remember'))) { 374
376 375 if (Auth::attempt($credentials, $request->has('remember'))) {
377 if (is_null(Auth::user()->email_verified_at)) { 376
378 Auth::logout(); 377 if (is_null(Auth::user()->email_verified_at)) {
379 return json_encode(Array("ERROR" => "Адрес почты не подтвержден")); 378 Auth::logout();
380 } 379 return json_encode(Array("ERROR" => "Адрес почты не подтвержден"));
381 380 }
382 if (Auth::user()->is_worker) { 381
383 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl())); 382 if (Auth::user()->is_worker) {
384 } else { 383 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));
385 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl())); 384 } else {
386 } 385 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));
387 386 }
388 return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет")); 387
389 //->route('index') 388 return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет"));
390 //->with('success', 'Вы вошли в личный кабинет.'); 389 //->route('index')
391 } else { 390 //->with('success', 'Вы вошли в личный кабинет.');
392 return json_encode(Array("ERROR" => "Неверный логин или пароль!")); 391 } else {
393 } 392 return json_encode(Array("ERROR" => "Неверный логин или пароль!"));
394 } 393 }
395 } 394 }
396 395 }
397 // Восстановление пароля 396
398 public function repair_password(Request $request) { 397 // Восстановление пароля
399 $rules = [ 398 public function repair_password(Request $request) {
400 'email' => 'required|string|email', 399 $rules = [
401 ]; 400 'email' => 'required|string|email',
402 401 ];
403 $messages = [ 402
404 'required' => 'Укажите обязательное поле «:attribute»', 403 $messages = [
405 'email' => 'Введите корректный email', 404 'required' => 'Укажите обязательное поле «:attribute»',
406 'min' => [ 405 'email' => 'Введите корректный email',
407 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 406 'min' => [
408 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 407 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
409 ], 408 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
410 'max' => [ 409 ],
411 'string' => 'Поле «:attribute» должно быть не больше :max символов', 410 'max' => [
412 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 411 'string' => 'Поле «:attribute» должно быть не больше :max символов',
413 ], 412 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
414 ]; 413 ],
415 414 ];
416 $validator = Validator::make($request->all(), $rules, $messages); 415
417 416 $validator = Validator::make($request->all(), $rules, $messages);
418 if ($validator->fails()) { 417
419 return redirect()->back()->with('Error', "Email невалидный"); 418 if ($validator->fails()) {
420 } else { 419 return redirect()->back()->with('Error', "Email невалидный");
421 $new_password = Tools::generator_id(10); 420 } else {
422 $hash_password = Hash::make($new_password); 421 $new_password = Tools::generator_id(10);
423 $user = User::query()->where('email', $request->get('email'))->first(); 422 $hash_password = Hash::make($new_password);
424 $EditRec = User::find($user->id); 423 $user = User::query()->where('email', $request->get('email'))->first();
425 $EditRec->password = $hash_password; 424 $EditRec = User::find($user->id);
426 $EditRec->save(); 425 $EditRec->password = $hash_password;
427 426 $EditRec->save();
428 foreach ([$request->get('email')] as $recipient) { 427
429 Mail::to($recipient)->send(new MailRepair($new_password)); 428 foreach ([$request->get('email')] as $recipient) {
430 } 429 Mail::to($recipient)->send(new MailRepair($new_password));
431 return redirect()->route('index'); 430 }
432 431 return redirect()->route('index');
433 } 432
434 433 }
435 } 434
436 435 }
437 // Вывод новостей 436
438 public function news(Request $request) { 437 // Вывод новостей
439 $Query = News::query(); 438 public function news(Request $request) {
440 if ($request->has('search')) { 439 $Query = News::query();
441 $search = $request->get('search'); 440 if ($request->has('search')) {
442 $Query = $Query->where('title', 'LIKE', "%$search%")-> 441 $search = $request->get('search');
443 orWhere('text', 'LIKE', "%$search%"); 442 $Query = $Query->where('title', 'LIKE', "%$search%")->
444 } 443 orWhere('text', 'LIKE', "%$search%");
445 444 }
446 if ($request->ajax()) { 445
447 if ($request->get('sort')) { 446 if ($request->ajax()) {
448 $sort = $request->get('sort'); 447 if ($request->get('sort')) {
449 switch ($sort) { 448 $sort = $request->get('sort');
450 case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break; 449 switch ($sort) {
451 case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break; 450 case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break;
452 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; 451 case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break;
453 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; 452 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
454 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; 453 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
455 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; 454 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
456 } 455 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break;
457 } 456 }
458 } 457 }
459 $Query_count = $Query->count(); 458 }
460 $Query = $Query->paginate(6); 459 $Query_count = $Query->count();
461 460 $Query = $Query->paginate(6);
462 if ($request->ajax()) { 461
463 return view('ajax.news-list', compact('Query', 'Query_count')); 462 if ($request->ajax()) {
464 } else { 463 return view('ajax.news-list', compact('Query', 'Query_count'));
465 return view('news-list', compact('Query', 'Query_count')); 464 } else {
466 } 465 return view('news-list', compact('Query', 'Query_count'));
467 } 466 }
468 467 }
469 //Детальная новость 468
470 public function detail_new(News $new) { 469 //Детальная новость
471 // Наборка 470 public function detail_new(News $new) {
472 $Query = News::query()->where('id', $new->id)->get(); 471 // Наборка
473 $title = $Query[0]->title; 472 $Query = News::query()->where('id', $new->id)->get();
474 $All_Query = News::query()->paginate(8); 473 $title = $Query[0]->title;
475 return view('detail_new', compact('Query', 'All_Query', 'title')); 474 $All_Query = News::query()->paginate(8);
476 } 475 return view('detail_new', compact('Query', 'All_Query', 'title'));
477 } 476 }
478 477 }
app/Http/Controllers/WorkerController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Classes\RusDate; 5 use App\Classes\RusDate;
6 use App\Http\Requests\DocumentsRequest; 6 use App\Http\Requests\DocumentsRequest;
7 use App\Http\Requests\PrevCompanyRequest; 7 use App\Http\Requests\PrevCompanyRequest;
8 use App\Http\Requests\SertificationRequest; 8 use App\Http\Requests\SertificationRequest;
9 use App\Models\Ad_employer; 9 use App\Models\Ad_employer;
10 use App\Models\ad_response; 10 use App\Models\ad_response;
11 use App\Models\Category; 11 use App\Models\Category;
12 use App\Models\Dop_info; 12 use App\Models\Dop_info;
13 use App\Models\Employer; 13 use App\Models\Employer;
14 use App\Models\infobloks; 14 use App\Models\infobloks;
15 use App\Models\Job_title; 15 use App\Models\Job_title;
16 use App\Models\Like_vacancy; 16 use App\Models\Like_vacancy;
17 use App\Models\Like_worker; 17 use App\Models\Like_worker;
18 use App\Models\Message; 18 use App\Models\Message;
19 use App\Models\place_works; 19 use App\Models\place_works;
20 use App\Models\PrevCompany; 20 use App\Models\PrevCompany;
21 use App\Models\reclame; 21 use App\Models\reclame;
22 use App\Models\ResponseWork; 22 use App\Models\ResponseWork;
23 use App\Models\sertification; 23 use App\Models\sertification;
24 use App\Models\Static_worker; 24 use App\Models\Static_worker;
25 use App\Models\Title_worker; 25 use App\Models\Title_worker;
26 use App\Models\User; 26 use App\Models\User;
27 use App\Models\User as User_Model; 27 use App\Models\User as User_Model;
28 use App\Models\Worker; 28 use App\Models\Worker;
29 use Barryvdh\DomPDF\Facade\Pdf; 29 use Barryvdh\DomPDF\Facade\Pdf;
30 use Carbon\Carbon; 30 use Carbon\Carbon;
31 use Illuminate\Auth\Events\Registered; 31 use Illuminate\Auth\Events\Registered;
32 use Illuminate\Database\Eloquent\Builder; 32 use Illuminate\Database\Eloquent\Builder;
33 use Illuminate\Database\Eloquent\Model; 33 use Illuminate\Database\Eloquent\Model;
34 use Illuminate\Http\JsonResponse; 34 use Illuminate\Http\JsonResponse;
35 use Illuminate\Http\Request; 35 use Illuminate\Http\Request;
36 use Illuminate\Support\Facades\Auth; 36 use Illuminate\Support\Facades\Auth;
37 use Illuminate\Support\Facades\Hash; 37 use Illuminate\Support\Facades\Hash;
38 use Illuminate\Support\Facades\Storage; 38 use Illuminate\Support\Facades\Storage;
39 use Illuminate\Support\Facades\Validator; 39 use Illuminate\Support\Facades\Validator;
40 40
41 class WorkerController extends Controller 41 class WorkerController extends Controller
42 { 42 {
43 public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу'); 43 public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу');
44 44
45 //профиль 45 //профиль
46 public function profile(Worker $worker) 46 public function profile(Worker $worker)
47 { 47 {
48 $get_date = date('Y.m'); 48 $get_date = date('Y.m');
49 49
50 $c = Static_worker::query()->where('year_month', '=', $get_date) 50 $c = Static_worker::query()->where('year_month', '=', $get_date)
51 ->where('user_id', '=', $worker->users->id) 51 ->where('user_id', '=', $worker->users->id)
52 ->get(); 52 ->get();
53 53
54 if ($c->count() > 0) { 54 if ($c->count() > 0) {
55 $upd = Static_worker::find($c[0]->id); 55 $upd = Static_worker::find($c[0]->id);
56 $upd->lookin = $upd->lookin + 1; 56 $upd->lookin = $upd->lookin + 1;
57 $upd->save(); 57 $upd->save();
58 } else { 58 } else {
59 $crt = new Static_worker(); 59 $crt = new Static_worker();
60 $crt->lookin = 1; 60 $crt->lookin = 1;
61 $crt->year_month = $get_date; 61 $crt->year_month = $get_date;
62 $crt->user_id = $worker->user_id; 62 $crt->user_id = $worker->user_id;
63 $crt->save(); 63 $crt->save();
64 } 64 }
65 65
66 $stat = Static_worker::query()->where('year_month', '=', $get_date) 66 $stat = Static_worker::query()->where('year_month', '=', $get_date)
67 ->where('user_id', '=', $worker->users->id) 67 ->where('user_id', '=', $worker->users->id)
68 ->get(); 68 ->get();
69 69
70 return view('public.workers.profile', compact('worker', 'stat')); 70 return view('public.workers.profile', compact('worker', 'stat'));
71 } 71 }
72 72
73 // лист база резюме 73 // лист база резюме
74 public function bd_resume(Request $request) 74 public function bd_resume(Request $request)
75 { 75 {
76 $look = false; 76 $look = false;
77 $idiot = 0; 77 $idiot = 0;
78 if (isset(Auth()->user()->id)) { 78 if (isset(Auth()->user()->id)) {
79 $idiot = Auth()->user()->id; 79 $idiot = Auth()->user()->id;
80 if ((!Auth()->user()->is_worker) && (Auth()->user()->is_lookin)) 80 if ((!Auth()->user()->is_worker) && (Auth()->user()->is_lookin))
81 $look = true; 81 $look = true;
82 } 82 }
83 83
84 if ($look) { 84 if ($look) {
85 $status_work = $this->status_work; 85 $status_work = $this->status_work;
86 $resumes = Worker::query()->with('users')->with('job_titles'); 86 $resumes = Worker::query()->with('users')->with('job_titles');
87 $resumes = $resumes->whereHas('users', function (Builder $query) { 87 $resumes = $resumes->whereHas('users', function (Builder $query) {
88 $query->Where('is_worker', '=', '1') 88 $query->Where('is_worker', '=', '1')
89 ->Where('is_bd', '=', '0'); 89 ->Where('is_bd', '=', '0');
90 }); 90 });
91 91
92 //dd($request->get('job')); 92 //dd($request->get('job'));
93 if (($request->has('job')) && ($request->get('job') > 0)) { 93 if (($request->has('job')) && ($request->get('job') > 0)) {
94 $resumes = $resumes->whereHas('job_titles', function (Builder $query) use ($request) { 94 $resumes = $resumes->whereHas('job_titles', function (Builder $query) use ($request) {
95 $query->Where('job_titles.id', $request->get('job')); 95 $query->Where('job_titles.id', $request->get('job'));
96 }); 96 });
97 } 97 }
98 98
99 $Job_title = Job_title::query()-> 99 $Job_title = Job_title::query()->
100 where('is_remove', '=', '0')-> 100 where('is_remove', '=', '0')->
101 where('is_bd', '=' , '1')-> 101 where('is_bd', '=' , '1')->
102 get(); 102 get();
103 103
104 if ($request->get('sort')) { 104 if ($request->get('sort')) {
105 $sort = $request->get('sort'); 105 $sort = $request->get('sort');
106 switch ($sort) { 106 switch ($sort) {
107 case 'name_up': 107 case 'name_up':
108 $resumes = $resumes->orderBy(User::select('surname') 108 $resumes = $resumes->orderBy(User::select('surname')
109 ->whereColumn('Workers.user_id', 'users.id') 109 ->whereColumn('Workers.user_id', 'users.id')
110 ); 110 );
111 break; 111 break;
112 case 'name_down': 112 case 'name_down':
113 $resumes = $resumes->orderByDesc(User::select('surname') 113 $resumes = $resumes->orderByDesc(User::select('surname')
114 ->whereColumn('Workers.user_id', 'users.id') 114 ->whereColumn('Workers.user_id', 'users.id')
115 ); 115 );
116 break; 116 break;
117 case 'created_at_up': 117 case 'created_at_up':
118 $resumes = $resumes->OrderBy('created_at')->orderBy('id'); 118 $resumes = $resumes->OrderBy('created_at')->orderBy('id');
119 break; 119 break;
120 case 'created_at_down': 120 case 'created_at_down':
121 $resumes = $resumes->orderByDesc('created_at')->orderBy('id'); 121 $resumes = $resumes->orderByDesc('created_at')->orderBy('id');
122 break; 122 break;
123 case 'default': 123 case 'default':
124 $resumes = $resumes->orderBy('id')->orderby('updated_at'); 124 $resumes = $resumes->orderBy('id')->orderby('updated_at');
125 break; 125 break;
126 default: 126 default:
127 $resumes = $resumes->orderBy('id')->orderby('updated_at'); 127 $resumes = $resumes->orderBy('id')->orderby('updated_at');
128 break; 128 break;
129 } 129 }
130 } 130 }
131 131
132 $res_count = $resumes->count(); 132 $res_count = $resumes->count();
133 //$resumes = $resumes->get(); 133 //$resumes = $resumes->get();
134 $resumes = $resumes->paginate(4); 134 $resumes = $resumes->paginate(4);
135 if ($request->ajax()) { 135 if ($request->ajax()) {
136 // Условия обставлены 136 // Условия обставлены
137 if ($request->has('block') && ($request->get('block') == 1)) { 137 if ($request->has('block') && ($request->get('block') == 1)) {
138 return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot')); 138 return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot'));
139 } 139 }
140 140
141 if ($request->has('block') && ($request->get('block') == 2)) { 141 if ($request->has('block') && ($request->get('block') == 2)) {
142 return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot')); 142 return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot'));
143 } 143 }
144 } else { 144 } else {
145 return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot', 'Job_title')); 145 return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot', 'Job_title'));
146 } 146 }
147 } else { 147 } else {
148 return redirect()->route('index')->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]); 148 return redirect()->route('index')->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]);
149 } 149 }
150 } 150 }
151 151
152 //Лайк резюме 152 //Лайк резюме
153 public function like_controller() { 153 public function like_controller() {
154 154
155 } 155 }
156 156
157 // анкета соискателя 157 // анкета соискателя
158 public function resume_profile(Worker $worker) 158 public function resume_profile(Worker $worker)
159 { 159 {
160 if (isset(Auth()->user()->id)) { 160 if (isset(Auth()->user()->id)) {
161 $idiot = Auth()->user()->id; 161 $idiot = Auth()->user()->id;
162 } else { 162 } else {
163 $idiot = 0; 163 $idiot = 0;
164 } 164 }
165 165
166 $status_work = $this->status_work; 166 $status_work = $this->status_work;
167 $Query = Worker::query()->with('users')->with('job_titles') 167 $Query = Worker::query()->with('users')->with('job_titles')
168 ->with('place_worker')->with('sertificate')->with('prev_company') 168 ->with('place_worker')->with('sertificate')->with('prev_company')
169 ->with('infobloks')->with('response'); 169 ->with('infobloks')->with('response');
170 $Query = $Query->where('id', '=', $worker->id); 170 $Query = $Query->where('id', '=', $worker->id);
171 $Query = $Query->get(); 171 $Query = $Query->get();
172 172
173 $get_date = date('Y.m'); 173 $get_date = date('Y.m');
174 174
175 $infoblocks = infobloks::query()->get();
176
175 $infoblocks = infobloks::query()->get(); 177 $c = Static_worker::query()->where('year_month', '=', $get_date)
176 178 ->where('user_id', '=', $worker->user_id)
177 $c = Static_worker::query()->where('year_month', '=', $get_date) 179 ->get();
178 ->where('user_id', '=', $worker->user_id) 180
179 ->get(); 181 if ($c->count() > 0) {
180 182 $upd = Static_worker::find($c[0]->id);
181 if ($c->count() > 0) { 183 $upd->lookin = $upd->lookin + 1;
182 $upd = Static_worker::find($c[0]->id); 184 $upd->save();
183 $upd->lookin = $upd->lookin + 1; 185 } else {
184 $upd->save(); 186 $crt = new Static_worker();
185 } else { 187 $crt->lookin = 1;
186 $crt = new Static_worker(); 188 $crt->year_month = $get_date;
187 $crt->lookin = 1; 189 $crt->user_id = $worker->user_id;
188 $crt->year_month = $get_date; 190 $status = $crt->save();
189 $crt->user_id = $worker->user_id; 191 }
192
190 $status = $crt->save(); 193 $stat = Static_worker::query()->where('year_month', '=', $get_date)
191 } 194 ->where('user_id', '=', $worker->user_id)
192 195 ->get();
193 $stat = Static_worker::query()->where('year_month', '=', $get_date) 196
194 ->where('user_id', '=', $worker->user_id) 197 return view('worker', compact('Query', 'infoblocks', 'status_work', 'idiot', 'stat'));
195 ->get(); 198 }
196 199
197 return view('worker', compact('Query', 'infoblocks', 'status_work', 'idiot', 'stat')); 200 // скачать анкету соискателя
198 } 201 public function resume_download(Worker $worker)
199 202 {
200 // скачать анкету соискателя 203 $status_work = $this->status_work;
201 public function resume_download(Worker $worker) 204 $Query = Worker::query()->with('users')->with('job_titles')
202 { 205 ->with('place_worker')->with('sertificate')->with('prev_company')
203 $status_work = $this->status_work; 206 ->with('infobloks');
204 $Query = Worker::query()->with('users')->with('job_titles') 207 $Query = $Query->where('id', '=', $worker->id);
205 ->with('place_worker')->with('sertificate')->with('prev_company') 208 $Query = $Query->get()->toArray();
206 ->with('infobloks'); 209
207 $Query = $Query->where('id', '=', $worker->id); 210 view()->share('Query',$Query);
208 $Query = $Query->get()->toArray(); 211
209 212
210 view()->share('Query',$Query); 213 $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape');
211 214
212 215 return $pdf->stream();
213 $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape'); 216 }
214 217
215 return $pdf->stream(); 218 public function resume_download_all() {
216 } 219 $status_work = $this->status_work;
217 220 $Query = Worker::query()->with('users')->with('job_titles')
218 public function resume_download_all() { 221 ->with('place_worker')->with('sertificate')->with('prev_company')
219 $status_work = $this->status_work; 222 ->with('infobloks')->
220 $Query = Worker::query()->with('users')->with('job_titles') 223 whereHas('users', function (Builder $query) {
221 ->with('place_worker')->with('sertificate')->with('prev_company') 224 $query->Where('is_worker', '=', '1')
222 ->with('infobloks')-> 225 ->Where('is_bd', '=', '1');
223 whereHas('users', function (Builder $query) { 226 });
224 $query->Where('is_worker', '=', '1') 227 //$Query = $Query->where('id', '=', $worker->id);
225 ->Where('is_bd', '=', '1'); 228 $Query = $Query->get()->toArray();
226 }); 229
227 //$Query = $Query->where('id', '=', $worker->id); 230 view()->share('Query',$Query);
228 $Query = $Query->get()->toArray(); 231
229 232 $pdf = PDF::loadView('layout.pdf-list-people', $Query); //->setPaper('a4', 'landscape');
230 view()->share('Query',$Query); 233
231 234 return $pdf->stream();
232 $pdf = PDF::loadView('layout.pdf-list-people', $Query); //->setPaper('a4', 'landscape'); 235 }
233 236
234 return $pdf->stream(); 237 // Кабинет работника
235 } 238 public function cabinet(Request $request)
236 239 {
237 // Кабинет работника 240 // дата год и месяц
238 public function cabinet(Request $request) 241 $get_date = date('Y.m');
239 { 242
240 // дата год и месяц 243 $id = Auth()->user()->id;
241 $get_date = date('Y.m'); 244
242 245 $Infobloks = infobloks::query()->get();
243 $id = Auth()->user()->id; 246
244 247 $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')->
245 $Infobloks = infobloks::query()->get(); 248 with('infobloks')->with('place_worker')->
246 249 WhereHas('users',
247 $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')-> 250 function (Builder $query) use ($id) {$query->Where('id', $id);
248 with('infobloks')->with('place_worker')-> 251 })->get();
249 WhereHas('users', 252
250 function (Builder $query) use ($id) {$query->Where('id', $id); 253 $Job_titles = Job_title::query()->where('is_remove', '=', '0')->
251 })->get(); 254 where('is_bd', '=' , '1')->
252 255 OrderByDesc('sort')->OrderBy('name')->get();
253 $Job_titles = Job_title::query()->where('is_remove', '=', '0')-> 256 $Infoblocks = infobloks::query()->OrderBy('name')->get();
254 where('is_bd', '=' , '1')-> 257
255 OrderByDesc('sort')->OrderBy('name')->get(); 258 $stat = Static_worker::query()->where('year_month', '=', $get_date)
256 $Infoblocks = infobloks::query()->OrderBy('name')->get(); 259 ->where('user_id', '=', $id)
257 260 ->get();
258 $stat = Static_worker::query()->where('year_month', '=', $get_date) 261
259 ->where('user_id', '=', $id) 262
260 ->get(); 263 // 10%
261 264
262 265 $persent = 10;
263 // 10% 266 $persent1 = 0;
264 267 $persent2 = 0;
265 $persent = 10; 268 $persent3 = 0;
266 $persent1 = 0; 269 $persent4 = 0;
267 $persent2 = 0; 270 $persent5 = 0;
268 $persent3 = 0; 271
269 $persent4 = 0; 272 if ((!empty($Worker[0]->telephone)) &&
270 $persent5 = 0; 273 (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) &&
271 274 (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) {
272 if ((!empty($Worker[0]->telephone)) && 275 // 40%
273 (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) && 276 $persent = $persent + 40;
274 (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) { 277 $persent1 = 40;
275 // 40% 278 }
276 $persent = $persent + 40; 279
277 $persent1 = 40; 280 //dd($Worker[0]->status_work, $Worker[0]->telephone, $Worker[0]->email, $Worker[0]->experience, $Worker[0]->city, $Worker[0]->old_year);
278 } 281
279 282 if ($Worker[0]->sertificate->count() > 0) {
280 //dd($Worker[0]->status_work, $Worker[0]->telephone, $Worker[0]->email, $Worker[0]->experience, $Worker[0]->city, $Worker[0]->old_year); 283 // 15%
281 284 $persent = $persent + 15;
282 if ($Worker[0]->sertificate->count() > 0) { 285 $persent2 = 15;
283 // 15% 286 }
284 $persent = $persent + 15; 287
285 $persent2 = 15; 288 if ($Worker[0]->infobloks->count() > 0) {
286 } 289 // 20%
287 290 $persent = $persent + 20;
288 if ($Worker[0]->infobloks->count() > 0) { 291 $persent3 = 20;
289 // 20% 292 }
290 $persent = $persent + 20; 293
291 $persent3 = 20; 294 if ($Worker[0]->prev_company->count() > 0) {
292 } 295 // 10%
293 296 $persent = $persent + 10;
294 if ($Worker[0]->prev_company->count() > 0) { 297 $persent4 = 10;
295 // 10% 298 }
296 $persent = $persent + 10; 299
297 $persent4 = 10; 300 if (!empty($Worker[0]->photo)) {
298 } 301 // 5%
299 302 $persent = $persent + 5;
300 if (!empty($Worker[0]->photo)) { 303 $persent5 = 5;
301 // 5% 304 }
302 $persent = $persent + 5; 305 if ($request->has('print')) {
303 $persent5 = 5; 306 dd($Worker);
304 } 307 } else {
305 if ($request->has('print')) { 308 return view('workers.cabinet', compact('Worker', 'Infobloks', 'persent', 'Job_titles', 'Infoblocks', 'stat'));
306 dd($Worker); 309 }
307 } else { 310 }
308 return view('workers.cabinet', compact('Worker', 'Infobloks', 'persent', 'Job_titles', 'Infoblocks', 'stat')); 311
309 } 312 // Сохранение данных
310 } 313 public function cabinet_save(Worker $worker, Request $request)
311 314 {
312 // Сохранение данных 315 $id = $worker->id;
313 public function cabinet_save(Worker $worker, Request $request) 316 $params = $request->all();
314 { 317
315 $id = $worker->id; 318 $job_title_id = $request->get('job_title_id');
316 $params = $request->all(); 319
317 320 unset($params['new_diplom']);
318 $job_title_id = $request->get('job_title_id'); 321 unset($params['new_data_begin']);
319 322 unset($params['new_data_end']);
320 unset($params['new_diplom']); 323 unset($params['new_job_title']);
321 unset($params['new_data_begin']); 324 unset($params['new_teplohod']);
322 unset($params['new_data_end']); 325 unset($params['new_GWT']);
323 unset($params['new_job_title']); 326 unset($params['new_KBT']);
324 unset($params['new_teplohod']); 327 unset($params['new_Begin_work']);
325 unset($params['new_GWT']); 328 unset($params['new_End_work']);
326 unset($params['new_KBT']); 329 unset($params['new_name_company']);
327 unset($params['new_Begin_work']); 330
328 unset($params['new_End_work']); 331 $rules = [
329 unset($params['new_name_company']); 332 'surname' => ['required', 'string', 'max:255'],
330 333 'name_man' => ['required', 'string', 'max:255'],
331 $rules = [ 334 'email' => ['required', 'string', 'email', 'max:255'],
332 'surname' => ['required', 'string', 'max:255'], 335
333 'name_man' => ['required', 'string', 'max:255'], 336 ];
334 'email' => ['required', 'string', 'email', 'max:255'], 337
335 338 $messages = [
336 ]; 339 'required' => 'Укажите обязательное поле',
337 340 'min' => [
338 $messages = [ 341 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
339 'required' => 'Укажите обязательное поле', 342 'integer' => 'Поле «:attribute» должно быть :min или больше',
340 'min' => [ 343 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
341 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 344 ],
342 'integer' => 'Поле «:attribute» должно быть :min или больше', 345 'max' => [
343 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 346 'string' => 'Поле «:attribute» должно быть не больше :max символов',
344 ], 347 'integer' => 'Поле «:attribute» должно быть :max или меньше',
345 'max' => [ 348 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
346 'string' => 'Поле «:attribute» должно быть не больше :max символов', 349 ]
347 'integer' => 'Поле «:attribute» должно быть :max или меньше', 350 ];
348 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 351
349 ] 352 $validator = Validator::make($params, $rules, $messages);
350 ]; 353
351 354 if ($validator->fails()) {
352 $validator = Validator::make($params, $rules, $messages); 355 return redirect()->route('worker.cabinet')->withErrors($validator);
353 356 } else {
354 if ($validator->fails()) { 357
355 return redirect()->route('worker.cabinet')->withErrors($validator); 358 if ($request->has('photo')) {
356 } else { 359 if (!empty($Worker->photo)) {
357 360 Storage::delete($Worker->photo);
358 if ($request->has('photo')) { 361 }
359 if (!empty($Worker->photo)) { 362 $params['photo'] = $request->file('photo')->store("worker/$id", 'public');
360 Storage::delete($Worker->photo); 363 }
361 } 364
362 $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); 365 if ($request->has('file')) {
363 } 366 if (!empty($Worker->file)) {
364 367 Storage::delete($Worker->file);
365 if ($request->has('file')) { 368 }
366 if (!empty($Worker->file)) { 369 $params['file'] = $request->file('file')->store("worker/$id", 'public');
367 Storage::delete($Worker->file); 370 }
368 } 371
369 $params['file'] = $request->file('file')->store("worker/$id", 'public'); 372 $id_wor = $worker->update($params);
370 } 373 $use = User::find($worker->user_id);
371 374 $use->surname = $request->get('surname');
372 $id_wor = $worker->update($params); 375 $use->name_man = $request->get('name_man');
373 $use = User::find($worker->user_id); 376 $use->surname2 = $request->get('surname2');
374 $use->surname = $request->get('surname'); 377
375 $use->name_man = $request->get('name_man'); 378 $use->save();
376 $use->surname2 = $request->get('surname2'); 379 $worker->job_titles()->sync($job_title_id);
377 380
378 $use->save(); 381 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены');
379 $worker->job_titles()->sync($job_title_id); 382 }
380 383 }
381 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); 384
382 } 385 // Сообщения данные
383 } 386 public function messages($type_message)
384 387 {
385 // Сообщения данные 388 $user_id = Auth()->user()->id;
386 public function messages($type_message) 389
387 { 390 $messages_input = Message::query()->with('vacancies')->with('user_from')->
388 $user_id = Auth()->user()->id; 391 Where('to_user_id', $user_id)->OrderByDesc('created_at');
389 392
390 $messages_input = Message::query()->with('vacancies')->with('user_from')-> 393 $messages_output = Message::query()->with('vacancies')->
391 Where('to_user_id', $user_id)->OrderByDesc('created_at'); 394 with('user_to')->where('user_id', $user_id)->
392 395 OrderByDesc('created_at');
393 $messages_output = Message::query()->with('vacancies')-> 396
394 with('user_to')->where('user_id', $user_id)-> 397 $count_input = $messages_input->count();
395 OrderByDesc('created_at'); 398 $count_output = $messages_output->count();
396 399
397 $count_input = $messages_input->count(); 400 if ($type_message == 'input') {
398 $count_output = $messages_output->count(); 401 $messages = $messages_input->paginate(5);
399 402 }
400 if ($type_message == 'input') { 403
401 $messages = $messages_input->paginate(5); 404 if ($type_message == 'output') {
402 } 405 $messages = $messages_output->paginate(5);
403 406 }
404 if ($type_message == 'output') { 407
405 $messages = $messages_output->paginate(5); 408 //dd($messages);
406 } 409 // Вернуть все 100%
407 410 return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id'));
408 //dd($messages); 411 }
409 // Вернуть все 100% 412
410 return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); 413 // Избранный
411 } 414 public function favorite()
412 415 {
413 // Избранный 416 return view('workers.favorite');
414 public function favorite() 417 }
415 { 418
416 return view('workers.favorite'); 419 // Сменить пароль
417 } 420 public function new_password()
418 421 {
419 // Сменить пароль 422 $email = Auth()->user()->email;
420 public function new_password() 423 return view('workers.new_password', compact('email'));
421 { 424 }
422 $email = Auth()->user()->email; 425
423 return view('workers.new_password', compact('email')); 426 // Обновление пароля
424 } 427 public function save_new_password(Request $request) {
425 428 $use = Auth()->user();
426 // Обновление пароля 429 $request->validate([
427 public function save_new_password(Request $request) { 430 'password' => 'required|string',
428 $use = Auth()->user(); 431 'new_password' => 'required|string',
429 $request->validate([ 432 'new_password2' => 'required|string'
430 'password' => 'required|string', 433 ]);
431 'new_password' => 'required|string', 434
432 'new_password2' => 'required|string' 435 if ($request->get('new_password') == $request->get('new_password2'))
433 ]); 436 if ($request->get('password') !== $request->get('new_password')) {
434 437 $credentials = $request->only('email', 'password');
435 if ($request->get('new_password') == $request->get('new_password2')) 438 if (Auth::attempt($credentials, $request->has('save_me'))) {
436 if ($request->get('password') !== $request->get('new_password')) { 439
437 $credentials = $request->only('email', 'password'); 440 if (!is_null($use->email_verified_at)){
438 if (Auth::attempt($credentials, $request->has('save_me'))) { 441
439 442 $user_data = User_Model::find($use->id);
440 if (!is_null($use->email_verified_at)){ 443 $user_data->update([
441 444 'password' => Hash::make($request->get('new_password')),
442 $user_data = User_Model::find($use->id); 445 'pubpassword' => base64_encode($request->get('new_password')),
443 $user_data->update([ 446 ]);
444 'password' => Hash::make($request->get('new_password')), 447 return redirect()
445 'pubpassword' => base64_encode($request->get('new_password')), 448 ->route('worker.new_password')
446 ]); 449 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
447 return redirect() 450 }
448 ->route('worker.new_password') 451
449 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 452 return redirect()
450 } 453 ->route('worker.new_password')
451 454 ->withError('Данная учетная запись не было верифицированна!');
452 return redirect() 455 }
453 ->route('worker.new_password') 456 }
454 ->withError('Данная учетная запись не было верифицированна!'); 457
455 } 458 return redirect()
456 } 459 ->route('worker.new_password')
457 460 ->withErrors('Не совпадение данных, обновите пароли!');
458 return redirect() 461 }
459 ->route('worker.new_password') 462
460 ->withErrors('Не совпадение данных, обновите пароли!'); 463 // Удаление профиля форма
461 } 464 public function delete_profile()
462 465 {
463 // Удаление профиля форма 466 $login = Auth()->user()->email;
464 public function delete_profile() 467 return view('workers.delete_profile', compact('login'));
465 { 468 }
466 $login = Auth()->user()->email; 469
467 return view('workers.delete_profile', compact('login')); 470 // Удаление профиля код
468 } 471 public function delete_profile_result(Request $request) {
469 472 $Answer = $request->all();
470 // Удаление профиля код 473 $user_id = Auth()->user()->id;
471 public function delete_profile_result(Request $request) { 474 $request->validate([
472 $Answer = $request->all(); 475 'password' => 'required|string',
473 $user_id = Auth()->user()->id; 476 ]);
474 $request->validate([ 477
475 'password' => 'required|string', 478 $credentials = $request->only('email', 'password');
476 ]); 479 if (Auth::attempt($credentials)) {
477 480 Auth::logout();
478 $credentials = $request->only('email', 'password'); 481 $it = User_Model::find($user_id);
479 if (Auth::attempt($credentials)) { 482 $it->delete();
480 Auth::logout(); 483 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
481 $it = User_Model::find($user_id); 484 } else {
482 $it->delete(); 485 return redirect()->route('worker.delete_profile')
483 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 486 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
484 } else { 487 }
485 return redirect()->route('worker.delete_profile') 488 }
486 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 489
487 } 490 // Регистрация соискателя
488 } 491 public function register_worker(Request $request)
489 492 {
490 // Регистрация соискателя 493 $params = $request->all();
491 public function register_worker(Request $request) 494 $params['is_worker'] = 1;
492 { 495
493 $params = $request->all(); 496 $rules = [
494 $params['is_worker'] = 1; 497 'surname' => ['required', 'string', 'max:255'],
495 498 'name_man' => ['required', 'string', 'max:255'],
496 $rules = [ 499 'email' => ['required', 'email', 'max:255', 'unique:users'],
497 'surname' => ['required', 'string', 'max:255'], 500 'password' => ['required', 'string', 'min:6']
498 'name_man' => ['required', 'string', 'max:255'], 501 ];
499 'email' => ['required', 'email', 'max:255', 'unique:users'], 502
500 'password' => ['required', 'string', 'min:6'] 503 $messages = [
501 ]; 504 'required' => 'Укажите обязательное поле',
502 505 'min' => [
503 $messages = [ 506 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
504 'required' => 'Укажите обязательное поле', 507 'integer' => 'Поле «:attribute» должно быть :min или больше',
505 'min' => [ 508 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
506 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 509 ],
507 'integer' => 'Поле «:attribute» должно быть :min или больше', 510 'max' => [
508 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 511 'string' => 'Поле «:attribute» должно быть не больше :max символов',
509 ], 512 'integer' => 'Поле «:attribute» должно быть :max или меньше',
510 'max' => [ 513 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
511 'string' => 'Поле «:attribute» должно быть не больше :max символов', 514 ]
512 'integer' => 'Поле «:attribute» должно быть :max или меньше', 515 ];
513 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 516
514 ] 517 $email = $request->get('email');
515 ]; 518 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) {
516 519 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл"));
517 $email = $request->get('email'); 520 }
518 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { 521
519 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); 522 if ($request->get('password') !== $request->get('confirmed')){
520 } 523 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
521 524 }
522 if ($request->get('password') !== $request->get('confirmed')){ 525
523 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 526 if (strlen($request->get('password')) < 6) {
524 } 527 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
525 528 }
526 if (strlen($request->get('password')) < 6) { 529
527 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); 530 /*$haystack = $request->get('password');
528 } 531
529 532 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?');
530 /*$haystack = $request->get('password'); 533 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z',
531 534 'X', 'C', 'V', 'B', 'N', 'M');
532 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); 535 $lenpwd_bool = true;
533 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 536 $spec_bool = false;
534 'X', 'C', 'V', 'B', 'N', 'M'); 537 $alpha_bool = false;
535 $lenpwd_bool = true; 538
536 $spec_bool = false; 539 if (strlen($haystack) < 8) $lenpwd_bool = false;
537 $alpha_bool = false; 540
538 541 foreach ($specsumbol as $it) {
539 if (strlen($haystack) < 8) $lenpwd_bool = false; 542 if (strpos($haystack, $it) !== false) {
540 543 $spec_bool = true;
541 foreach ($specsumbol as $it) { 544 }
542 if (strpos($haystack, $it) !== false) { 545 }
543 $spec_bool = true; 546
544 } 547 foreach ($alpha as $it) {
545 } 548 if (strpos($haystack, $it) !== false) {
546 549 $alpha_bool = true;
547 foreach ($alpha as $it) { 550 }
548 if (strpos($haystack, $it) !== false) { 551 }
549 $alpha_bool = true; 552
550 } 553 if ((!$spec_bool) || (!$alpha_bool)) {
551 } 554 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?"));
552 555 }*/
553 if ((!$spec_bool) || (!$alpha_bool)) { 556
554 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); 557 if (($request->has('politik')) && ($request->get('politik') == 1)) {
555 }*/ 558 $validator = Validator::make($params, $rules, $messages);
556 559
557 if (($request->has('politik')) && ($request->get('politik') == 1)) { 560 if ($validator->fails()) {
558 $validator = Validator::make($params, $rules, $messages); 561 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
559 562 } else {
560 if ($validator->fails()) { 563 //dd($params);
561 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 564 $user = $this->create($params);
562 } else { 565 event(new Registered($user));
563 //dd($params); 566 Auth::guard()->login($user);
564 $user = $this->create($params); 567 }
565 event(new Registered($user)); 568 if ($user) {
566 Auth::guard()->login($user); 569 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));;
567 } 570 } else {
568 if ($user) { 571 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
569 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; 572 }
570 } else { 573
571 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 574 } else {
572 } 575 return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!"));
573 576 }
574 } else { 577 }
575 return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!")); 578
576 } 579 // Звездная оценка и ответ
577 } 580 public function stars_answer(Request $request) {
578 581 $params = $request->all();
579 // Звездная оценка и ответ 582 $rules = [
580 public function stars_answer(Request $request) { 583 'message' => ['required', 'string', 'max:255'],
581 $params = $request->all(); 584 ];
582 $rules = [ 585
583 'message' => ['required', 'string', 'max:255'], 586 $messages = [
584 ]; 587 'required' => 'Укажите обязательное поле',
585 588 'min' => [
586 $messages = [ 589 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
587 'required' => 'Укажите обязательное поле', 590 'integer' => 'Поле «:attribute» должно быть :min или больше',
588 'min' => [ 591 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
589 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 592 ],
590 'integer' => 'Поле «:attribute» должно быть :min или больше', 593 'max' => [
591 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 594 'string' => 'Поле «:attribute» должно быть не больше :max символов',
592 ], 595 'integer' => 'Поле «:attribute» должно быть :max или меньше',
593 'max' => [ 596 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
594 'string' => 'Поле «:attribute» должно быть не больше :max символов', 597 ]
595 'integer' => 'Поле «:attribute» должно быть :max или меньше', 598 ];
596 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 599 $response_worker = ResponseWork::create($params);
597 ] 600 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!');
598 ]; 601 }
599 $response_worker = ResponseWork::create($params); 602
600 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); 603 public function TestWorker()
601 } 604 {
602 605 $Use = new User();
603 public function TestWorker() 606
604 { 607 $Code_user = $Use->create([
605 $Use = new User(); 608 'name' => 'surname name_man',
606 609 'name_man' => 'name_man',
607 $Code_user = $Use->create([ 610 'surname' => 'surname',
608 'name' => 'surname name_man', 611 'surname2' => 'surname2',
609 'name_man' => 'name_man', 612 'subscribe_email' => '1',
610 'surname' => 'surname', 613 'email' => 'email@mail.com',
611 'surname2' => 'surname2', 614 'telephone' => '1234567890',
612 'subscribe_email' => '1', 615 'password' => Hash::make('password'),
613 'email' => 'email@mail.com', 616 'pubpassword' => base64_encode('password'),
614 'telephone' => '1234567890', 617 'email_verified_at' => Carbon::now(),
615 'password' => Hash::make('password'), 618 'is_worker' => 1,
616 'pubpassword' => base64_encode('password'), 619 ]);
617 'email_verified_at' => Carbon::now(), 620
618 'is_worker' => 1, 621 if ($Code_user->id > 0) {
619 ]); 622 $Worker = new Worker();
620 623 $Worker->user_id = $Code_user->id;
621 if ($Code_user->id > 0) { 624 $Worker->position_work = 1; //'job_titles';
622 $Worker = new Worker(); 625 $Worker->email = 'email@email.com';
623 $Worker->user_id = $Code_user->id; 626 $Worker->telephone = '1234567890';
624 $Worker->position_work = 1; //'job_titles'; 627 $status = $Worker->save();
625 $Worker->email = 'email@email.com'; 628
626 $Worker->telephone = '1234567890'; 629 $Title_Worker = new Title_worker();
627 $status = $Worker->save(); 630 $Title_Worker->worker_id = $Worker->id;
628 631 $Title_Worker->job_title_id = 1;
629 $Title_Worker = new Title_worker(); 632 $Title_Worker->save();
630 $Title_Worker->worker_id = $Worker->id; 633 }
631 $Title_Worker->job_title_id = 1; 634 }
632 $Title_Worker->save(); 635
633 } 636 // Создание пользователя
634 } 637 protected function create(array $data)
635 638 {
636 // Создание пользователя 639 $Use = new User();
637 protected function create(array $data) 640
638 { 641 $Code_user = $Use->create([
639 $Use = new User(); 642 'name' => $data['surname']." ".$data['name_man'],
640 643 'name_man' => $data['name_man'],
641 $Code_user = $Use->create([ 644 'surname' => $data['surname'],
642 'name' => $data['surname']." ".$data['name_man'], 645 'surname2' => $data['surname2'],
643 'name_man' => $data['name_man'], 646 'subscribe_email' => $data['email'],
644 'surname' => $data['surname'], 647 'email' => $data['email'],
645 'surname2' => $data['surname2'], 648 'telephone' => $data['telephone'],
646 'subscribe_email' => $data['email'], 649 'password' => Hash::make($data['password']),
647 'email' => $data['email'], 650 'pubpassword' => base64_encode($data['password']),
648 'telephone' => $data['telephone'], 651 'email_verified_at' => Carbon::now(),
649 'password' => Hash::make($data['password']), 652 'is_worker' => $data['is_worker'],
650 'pubpassword' => base64_encode($data['password']), 653 ]);
651 'email_verified_at' => Carbon::now(), 654
652 'is_worker' => $data['is_worker'], 655 if ($Code_user->id > 0) {
653 ]); 656 $Worker = new Worker();
654 657 $Worker->user_id = $Code_user->id;
655 if ($Code_user->id > 0) { 658 $Worker->position_work = $data['job_titles'];
656 $Worker = new Worker(); 659 $Worker->email = $data['email'];
657 $Worker->user_id = $Code_user->id; 660 $Worker->telephone = $data['telephone'];
658 $Worker->position_work = $data['job_titles']; 661 $Worker->save();
659 $Worker->email = $data['email']; 662
660 $Worker->telephone = $data['telephone']; 663 if (isset($Worker->id)) {
661 $Worker->save(); 664 $Title_Worker = new Title_worker();
662 665 $Title_Worker->worker_id = $Worker->id;
663 if (isset($Worker->id)) { 666 $Title_Worker->job_title_id = $data['job_titles'];
664 $Title_Worker = new Title_worker(); 667 $Title_Worker->save();
665 $Title_Worker->worker_id = $Worker->id; 668 }
666 $Title_Worker->job_title_id = $data['job_titles']; 669
667 $Title_Worker->save(); 670 return $Code_user;
668 } 671 }
669 672 }
670 return $Code_user; 673
671 } 674 // Вакансии избранные
672 } 675 public function colorado(Request $request) {
673 676 $IP_address = RusDate::ip_addr_client();
674 // Вакансии избранные 677 $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get();
675 public function colorado(Request $request) { 678
676 $IP_address = RusDate::ip_addr_client(); 679 if ($Arr->count()) {
677 $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); 680 $A = Array();
678 681 foreach ($Arr as $it) {
679 if ($Arr->count()) { 682 $A[] = $it->code_record;
680 $A = Array(); 683 }
681 foreach ($Arr as $it) { 684
682 $A[] = $it->code_record; 685 $Query = Ad_employer::query()->whereIn('id', $A);
683 } 686 } else {
684 687 $Query = Ad_employer::query()->where('id', '=', '0');
685 $Query = Ad_employer::query()->whereIn('id', $A); 688 }
686 } else { 689
687 $Query = Ad_employer::query()->where('id', '=', '0'); 690 $Query = $Query->with('jobs')->
688 } 691 with('cat')->
689 692 with('employer')->
690 $Query = $Query->with('jobs')-> 693 whereHas('jobs_code', function ($query) use ($request) {
691 with('cat')-> 694 if ($request->ajax()) {
692 with('employer')-> 695 if (null !== ($request->get('job'))) {
693 whereHas('jobs_code', function ($query) use ($request) { 696 $query->where('job_title_id', $request->get('job'));
694 if ($request->ajax()) { 697 }
695 if (null !== ($request->get('job'))) { 698 }
696 $query->where('job_title_id', $request->get('job')); 699 })->select('ad_employers.*');
697 } 700
698 } 701 $Job_title = Job_title::query()->OrderBy('name')->get();
699 })->select('ad_employers.*'); 702
700 703 $Query_count = $Query->count();
701 $Job_title = Job_title::query()->OrderBy('name')->get(); 704
702 705 $Query = $Query->OrderBy('updated_at')->paginate(3);
703 $Query_count = $Query->count(); 706
704 707
705 $Query = $Query->OrderBy('updated_at')->paginate(3); 708 return view('workers.favorite', compact('Query',
706 709 'Query_count',
707 710 'Job_title'));
708 return view('workers.favorite', compact('Query', 711
709 'Query_count', 712 }
710 'Job_title')); 713
711 714 //Переписка
712 } 715 public function dialog(User_Model $user1, User_Model $user2, Request $request) {
713 716 // Получение параметров.
714 //Переписка 717 if ($request->has('ad_employer')){
715 public function dialog(User_Model $user1, User_Model $user2, Request $request) { 718 $ad_employer = $request->get('ad_employer');
716 // Получение параметров. 719 } else {
717 if ($request->has('ad_employer')){ 720 $ad_employer = 0;
718 $ad_employer = $request->get('ad_employer'); 721 }
719 } else { 722
720 $ad_employer = 0; 723 if (isset($user1->id)) {
721 } 724 $sender = User_Model::query()->with('workers')->
722 725 with('employers')->
723 if (isset($user1->id)) { 726 where('id', $user1->id)->first();
724 $sender = User_Model::query()->with('workers')-> 727 }
725 with('employers')-> 728
726 where('id', $user1->id)->first(); 729 if (isset($user2->id)) {
727 } 730 $companion = User_Model::query()->with('workers')->
728 731 with('employers')->
729 if (isset($user2->id)) { 732 where('id', $user2->id)->first();
730 $companion = User_Model::query()->with('workers')-> 733 }
731 with('employers')-> 734
732 where('id', $user2->id)->first(); 735 $Messages = Message::query()->
733 } 736 //with('response')->
734 737 where(function($query) use ($user1, $user2) {
735 $Messages = Message::query()-> 738 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id);
736 //with('response')-> 739 })->orWhere(function($query) use ($user1, $user2) {
737 where(function($query) use ($user1, $user2) { 740 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id);
738 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); 741 })->OrderBy('created_at')->get();
739 })->orWhere(function($query) use ($user1, $user2) { 742
740 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); 743 $id_vac = null;
741 })->OrderBy('created_at')->get(); 744 /*foreach ($Messages as $it) {
742 745 if (isset($it->response)) {
743 $id_vac = null; 746 foreach ($it->response as $r) {
744 /*foreach ($Messages as $it) { 747 if (isset($r->ad_employer_id)) {
745 if (isset($it->response)) { 748 $id_vac = $r->ad_employer_id;
746 foreach ($it->response as $r) { 749 break;
747 if (isset($r->ad_employer_id)) { 750 }
748 $id_vac = $r->ad_employer_id; 751 }
749 break; 752 }
750 } 753 if (!is_null($id_vac)) break;
751 } 754 }*/
752 } 755
753 if (!is_null($id_vac)) break; 756 //$ad_employer = null;
754 }*/ 757 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first();
755 758
756 //$ad_employer = null; 759 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer'));
757 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); 760 }
758 761
759 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); 762 // Даунылоады
760 } 763 public function download(Worker $worker) {
761 764 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...'];
762 // Даунылоады 765 view()->share('house',$arr_house);
763 public function download(Worker $worker) { 766 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape');
764 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; 767 return $pdf->stream();
765 view()->share('house',$arr_house); 768 }
766 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); 769
767 return $pdf->stream(); 770 // Поднятие анкеты
768 } 771 public function up(Worker $worker) {
769 772 $worker->updated_at = Carbon::now();
770 // Поднятие анкеты 773 $worker->save();
771 public function up(Worker $worker) { 774 // 0
772 $worker->updated_at = Carbon::now(); 775 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных');
773 $worker->save(); 776 }
774 // 0 777
775 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); 778 // Форма сертификате
776 } 779 public function new_sertificate(Worker $worker) {
777 780 return view('workers.sertificate_add', compact('worker'));
778 // Форма сертификате 781 }
779 public function new_sertificate(Worker $worker) { 782
780 return view('workers.sertificate_add', compact('worker')); 783 // Добавление сертификата
781 } 784 public function add_serificate(SertificationRequest $request) {
782 785 $params = $request->all();
783 // Добавление сертификата 786
784 public function add_serificate(SertificationRequest $request) { 787 $Sertificate = new sertification();
785 $params = $request->all(); 788 $Sertificate->create($params);
786 789 $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get();
787 $Sertificate = new sertification(); 790 return redirect()->route('worker.cabinet');
788 $Sertificate->create($params); 791 //return view('ajax.documents', compact('Docs'));
789 $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get(); 792 }
790 return redirect()->route('worker.cabinet'); 793
791 //return view('ajax.documents', compact('Docs')); 794 // Удалить сертификат
792 } 795 public function delete_sertificate(sertification $doc) {
793 796 $doc->delete();
794 // Удалить сертификат 797
795 public function delete_sertificate(sertification $doc) { 798 return redirect()->route('worker.cabinet');
796 $doc->delete(); 799 }
797 800
798 return redirect()->route('worker.cabinet'); 801 // Редактирование сертификата
799 } 802 public function edit_sertificate(Worker $worker, sertification $doc) {
800 803 return view('workers.sertificate_edit', compact('doc', 'worker'));
801 // Редактирование сертификата 804 }
802 public function edit_sertificate(Worker $worker, sertification $doc) { 805
803 return view('workers.sertificate_edit', compact('doc', 'worker')); 806 // Редактирование обновление сертификата
804 } 807 public function update_serificate(SertificationRequest $request, sertification $doc) {
805 808 $all = $request->all();
806 // Редактирование обновление сертификата 809 $doc->worker_id = $all['worker_id'];
807 public function update_serificate(SertificationRequest $request, sertification $doc) { 810 $doc->name = $all['name'];
808 $all = $request->all(); 811 $doc->end_begin = $all['end_begin'];
809 $doc->worker_id = $all['worker_id']; 812 $doc->save();
810 $doc->name = $all['name']; 813
811 $doc->end_begin = $all['end_begin']; 814 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!');
812 $doc->save(); 815 }
813 816
814 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); 817 public function delete_add_diplom(Request $request, Worker $worker) {
815 } 818 $infoblok_id = $request->get('infoblok_id');
816 819
817 public function delete_add_diplom(Request $request, Worker $worker) { 820 if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0)
818 $infoblok_id = $request->get('infoblok_id'); 821 $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete();
819 822 else {
820 if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0) 823 $params['infoblok_id'] = $infoblok_id;
821 $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete(); 824 $params['worker_id'] = $worker->id;
822 else { 825 $params['status'] = $request->get('val');
823 $params['infoblok_id'] = $infoblok_id; 826 $id = Dop_info::create($params);
824 $params['worker_id'] = $worker->id; 827 //$id = $worker->infobloks()->sync([$infoblok_id]);
825 $params['status'] = $request->get('val'); 828 }
826 $id = Dop_info::create($params); 829
827 //$id = $worker->infobloks()->sync([$infoblok_id]); 830 //$Infoblocks = infobloks::query()->get();
828 } 831 return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks'));
829 832 }
830 //$Infoblocks = infobloks::query()->get(); 833
831 return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks')); 834
832 } 835
833 836 // Добавление диплома
834 837 public function add_diplom_ajax(Request $request) {
835 838 // конец
836 // Добавление диплома 839 $params = $request->all();
837 public function add_diplom_ajax(Request $request) { 840 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
838 // конец 841
839 $params = $request->all(); 842 if ($count == 0) $dop_info = Dop_info::create($params);
840 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 843 $Infoblocks = infobloks::query()->get();
841 844 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get();
842 if ($count == 0) $dop_info = Dop_info::create($params); 845 $data = Dop_info::query()->where('worker_id', $request->has('worker_id'));
843 $Infoblocks = infobloks::query()->get(); 846 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker'));
844 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); 847 }
845 $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); 848
846 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); 849 // Добавление диплома без ajax
847 } 850 public function add_diplom(Worker $worker) {
848 851 $worker_id = $worker->id;
849 // Добавление диплома без ajax 852 $Infoblocks = infobloks::query()->get();
850 public function add_diplom(Worker $worker) { 853 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks'));
851 $worker_id = $worker->id; 854 }
852 $Infoblocks = infobloks::query()->get(); 855 // Сохранить
853 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); 856 // Сохраняю диплом
854 } 857 public function add_diplom_save(Request $request) {
855 // Сохранить 858 $params = $request->all();
856 // Сохраняю диплом 859 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
857 public function add_diplom_save(Request $request) { 860 if ($count == 0) $dop_info = Dop_info::create($params);
858 $params = $request->all(); 861 return redirect()->route('worker.cabinet');
859 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 862 }
860 if ($count == 0) $dop_info = Dop_info::create($params); 863
861 return redirect()->route('worker.cabinet'); 864 // Добавление стандартного документа
862 } 865 public function add_document(Worker $worker) {
863 866 return view('workers.docs', compact('worker'));
864 // Добавление стандартного документа 867 }
865 public function add_document(Worker $worker) { 868
866 return view('workers.docs', compact('worker')); 869 //Сохранение стандартого документа
867 } 870 public function add_document_save(DocumentsRequest $request) {
868 871 $params = $request->all();
869 //Сохранение стандартого документа 872 $place_work = place_works::create($params);
870 public function add_document_save(DocumentsRequest $request) { 873 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!');
871 $params = $request->all(); 874 }
872 $place_work = place_works::create($params); 875
873 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!'); 876 // Редактирование документа
874 } 877 public function edit_document(place_works $doc, Worker $worker) {
875 878 return view('workers.docs-edit', compact('doc', 'worker'));
876 // Редактирование документа 879 }
877 public function edit_document(place_works $doc, Worker $worker) { 880
878 return view('workers.docs-edit', compact('doc', 'worker')); 881 //Сохранение отредактированного документа
879 } 882 public function edit_document_save(DocumentsRequest $request, place_works $doc) {
880 883 $params = $request->all();
881 //Сохранение отредактированного документа 884 $doc->update($params);
882 public function edit_document_save(DocumentsRequest $request, place_works $doc) { 885
883 $params = $request->all(); 886 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!');
884 $doc->update($params); 887 }
885 888
886 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); 889 // Удаление документа
887 } 890 public function delete_document(place_works $doc) {
888 891 $doc->delete();
889 // Удаление документа 892 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!');
890 public function delete_document(place_works $doc) { 893 }
891 $doc->delete(); 894
892 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); 895 //Отправка нового сообщения
893 } 896 public function new_message(Request $request) {
894 897 $params = $request->all();
895 //Отправка нового сообщения 898
896 public function new_message(Request $request) { 899 $id = $params['send_user_id'];
897 $params = $request->all(); 900 $message = new Message();
898 901 $message->user_id = $params['send_user_id'];
899 $id = $params['send_user_id']; 902 $message->to_user_id = $params['send_to_user_id'];
900 $message = new Message(); 903 $message->title = $params['send_title'];
901 $message->user_id = $params['send_user_id']; 904 $message->text = $params['send_text'];
902 $message->to_user_id = $params['send_to_user_id']; 905 $message->ad_employer_id = $params['send_vacancy'];
903 $message->title = $params['send_title']; 906 if ($request->has('send_file')) {
904 $message->text = $params['send_text']; 907 $message->file = $request->file('send_file')->store("worker/$id", 'public');
905 $message->ad_employer_id = $params['send_vacancy']; 908 }
906 if ($request->has('send_file')) { 909 $message->flag_new = 1;
907 $message->file = $request->file('send_file')->store("worker/$id", 'public'); 910 $id_message = $message->save();
908 } 911
909 $message->flag_new = 1; 912 $data['message_id'] = $id_message;
910 $id_message = $message->save(); 913 $data['ad_employer_id'] = $params['send_vacancy'];
911 914 $data['job_title_id'] = $params['send_job_title_id'];
912 $data['message_id'] = $id_message; 915 $data['flag'] = 1;
913 $data['ad_employer_id'] = $params['send_vacancy']; 916 $ad_responce = ad_response::create($data);
914 $data['job_title_id'] = $params['send_job_title_id']; 917 return redirect()->route('worker.messages', ['type_message' => 'output']);
915 $data['flag'] = 1; 918 }
916 $ad_responce = ad_response::create($data); 919
917 return redirect()->route('worker.messages', ['type_message' => 'output']); 920
918 } 921 public function test123(Request $request) {
919 922 $params = $request->all();
920 923 $user1 = $params['user_id'];
921 public function test123(Request $request) { 924 $user2 = $params['to_user_id'];
922 $params = $request->all(); 925 $id_vacancy = $params['ad_employer_id'];
923 $user1 = $params['user_id']; 926 $ad_name = $params['ad_name'];
924 $user2 = $params['to_user_id']; 927
925 $id_vacancy = $params['ad_employer_id']; 928 $rules = [
926 $ad_name = $params['ad_name']; 929 'text' => 'required|min:1|max:150000',
927 930 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000'
928 $rules = [ 931 ];
929 'text' => 'required|min:1|max:150000', 932 $messages = [
930 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' 933 'required' => 'Укажите обязательное поле',
931 ]; 934 'min' => [
932 $messages = [ 935 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
933 'required' => 'Укажите обязательное поле', 936 'integer' => 'Поле «:attribute» должно быть :min или больше',
934 'min' => [ 937 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
935 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 938 ],
936 'integer' => 'Поле «:attribute» должно быть :min или больше', 939 'max' => [
937 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 940 'string' => 'Поле «:attribute» должно быть не больше :max символов',
938 ], 941 'integer' => 'Поле «:attribute» должно быть :max или меньше',
939 'max' => [ 942 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
940 'string' => 'Поле «:attribute» должно быть не больше :max символов', 943 ]
941 'integer' => 'Поле «:attribute» должно быть :max или меньше', 944 ];
942 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 945
943 ] 946 $validator = Validator::make($request->all(), $rules, $messages);
944 ]; 947
945 948 if ($validator->fails()) {
946 $validator = Validator::make($request->all(), $rules, $messages); 949 return redirect()->route('worker.dialog', ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name])
947 950 ->withErrors($validator);
948 if ($validator->fails()) { 951 } else {
949 return redirect()->route('worker.dialog', ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]) 952 if ($request->has('file')) {
950 ->withErrors($validator); 953 $params['file'] = $request->file('file')->store("messages", 'public');
951 } else { 954 }
952 if ($request->has('file')) { 955 Message::create($params);
953 $params['file'] = $request->file('file')->store("messages", 'public'); 956 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
954 } 957 return redirect()->route('worker.dialog',
955 Message::create($params); 958 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]);
956 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 959
957 return redirect()->route('worker.dialog', 960 }
958 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]); 961 }
959 962
960 } 963 // Информация о предыдущих компаниях
961 } 964 public function new_prev_company(Worker $worker) {
962 965 return view('workers.prev_company_form', compact('worker'));
963 // Информация о предыдущих компаниях 966 }
964 public function new_prev_company(Worker $worker) { 967
965 return view('workers.prev_company_form', compact('worker')); 968 // Добавление контакта компании
966 } 969 public function add_prev_company(PrevCompanyRequest $request) {
967 970 // Возвращение параметров
968 // Добавление контакта компании 971 $all = $request->all();
969 public function add_prev_company(PrevCompanyRequest $request) { 972 $PrevCompany = PrevCompany::create($all);
970 // Возвращение параметров 973
971 $all = $request->all(); 974 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись');
972 $PrevCompany = PrevCompany::create($all); 975 }
973 976
974 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись'); 977 // Редактирование контакта компании
975 } 978 public function edit_prev_company(PrevCompany $doc, Worker $worker) {
976 979 return view('workers.prev_company_edit_form', compact('doc', 'worker'));
977 // Редактирование контакта компании 980 }
978 public function edit_prev_company(PrevCompany $doc, Worker $worker) { 981
979 return view('workers.prev_company_edit_form', compact('doc', 'worker')); 982 //Сохранение редактирования контакта компании
980 } 983 public function update_prev_company(PrevCompany $doc, Request $request){
981 984 $all = $request->all();
982 //Сохранение редактирования контакта компании 985 $doc->update($all);
983 public function update_prev_company(PrevCompany $doc, Request $request){ 986
984 $all = $request->all(); 987 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись');
985 $doc->update($all); 988 }
986 989
987 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись'); 990 // Удаление контакта предыдущей компании
988 } 991 public function delete_prev_company(PrevCompany $doc) {
989 992 $doc->delete();
990 // Удаление контакта предыдущей компании 993 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!');
991 public function delete_prev_company(PrevCompany $doc) { 994 }
992 $doc->delete(); 995 }
993 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); 996
994 } 997
app/Http/Requests/VacancyRequestEdit.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Requests; 3 namespace App\Http\Requests;
4 4
5 use Illuminate\Foundation\Http\FormRequest; 5 use Illuminate\Foundation\Http\FormRequest;
6 6
7 class VacancyRequestEdit extends FormRequest 7 class VacancyRequestEdit extends FormRequest
8 { 8 {
9 public function authorize() 9 public function authorize()
10 { 10 {
11 return true; 11 return true;
12 } 12 }
13 13
14 /** 14 /**
15 * Get the validation rules that apply to the request. 15 * Get the validation rules that apply to the request.
16 * 16 *
17 * @return array<string, mixed> 17 * @return array<string, mixed>
18 */ 18 */
19 19
20 public function rules() 20 public function rules()
21 { 21 {
22 $Arr = [ 22 $Arr = [
23 'name' => [ 23 'name' => [
24 'required', 24 'required',
25 'min:3', 25 'min:3',
26 'max:255', 26 'max:255',
27 ], 27 ],
28 28
29 /* 'category_id' => [ 29 /* 'category_id' => [
30 'numeric', 30 'numeric',
31 'min:0', 31 'min:0',
32 'max:9999999', 32 'max:9999999',
33 ], 33 ],
34 34
35 'telephone' => [ 35 'telephone' => [
36 'min:3', 36 'min:3',
37 'max:255', 37 'max:255',
38 ], 38 ],
39 39
40 'email' => [ 40 'email' => [
41 'min:3', 41 'min:3',
42 'max:255', 42 'max:255',
43 ], 43 ],
44 44
45 'salary' => [ 45 'salary' => [
46 'numeric', 46 'numeric',
47 'min:3', 47 'min:3',
48 'max:255', 48 'max:255',
49 ], 49 ],
50 50
51 'min_salary' => [ 51 'min_salary' => [
52 'numeric', 52 'numeric',
53 'min:0', 53 'min:0',
54 'max:9999999', 54 'max:9999999',
55 ], 55 ],
56 56
57 'max_salary' => [ 57 'max_salary' => [
58 'numeric', 58 'numeric',
59 'min:0', 59 'min:0',
60 'max:9999999', 60 'max:9999999',
61 ], 61 ],
62 62
63 'city' => [ 63 'city' => [
64 'min:3', 64 'min:3',
65 'max:255', 65 'max:255',
66 ],*/ 66 ],*/
67 67
68 'job_title_id[]' => [ 68 'job_title_id[]' => [
69 'numeric', 69 'numeric',
70 'min:1', 70 'min:1',
71 'max:9999999' 71 'max:9999999'
72 ] 72 ]
73 ]; 73 ];
74 74
75 return [ 75 return [
76 'name' => [ 76 'name' => [
77 'required', 77 'required',
78 'min:3', 78 'min:3',
79 'max:255', 79 'max:255',
80 ], 80 ],
81 /* 81 /*
82 'category_id' => [ 82 'category_id' => [
83 'numeric', 83 'numeric',
84 'min:0', 84 'min:0',
85 'max:9999999', 85 'max:9999999',
86 ], 86 ],
87 87
88 'telephone' => [ 88 'telephone' => [
89 'min:3', 89 'min:3',
90 'max:255', 90 'max:255',
91 ], 91 ],
92 92
93 'email' => [ 93 'email' => [
94 'min:3', 94 'min:3',
95 'max:255', 95 'max:255',
96 ],*/ 96 ],*/
97 ];
97 ]; 98 }
98 } 99
99 100 public function messages() {
100 public function messages() { 101 return [
101 return [ 102 'required' => 'Поле «:attribute» обязательно для заполнения',
102 'required' => 'Поле «:attribute» обязательно для заполнения', 103 'unique' => 'Такое значение поля «:attribute» уже используется',
103 'unique' => 'Такое значение поля «:attribute» уже используется', 104 'min' => [
104 'min' => [ 105 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
105 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 106 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
106 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 107 ],
107 ], 108 'max' => [
108 'max' => [ 109 'string' => 'Поле «:attribute» должно быть не больше :max символов',
109 'string' => 'Поле «:attribute» должно быть не больше :max символов', 110 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
110 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 111 ],
111 ], 112 'mimes' => 'Файл «:attribute» должен иметь формат :values',
112 'mimes' => 'Файл «:attribute» должен иметь формат :values', 113 'numeric' => 'В поле «:attribute» должно быть указано целое число от 0 до 9999999',
113 'numeric' => 'В поле «:attribute» должно быть указано целое число от 0 до 9999999', 114 ];
114 ]; 115
115 116 }
116 } 117 }
117 } 118
resources/views/employers/edit_vacancy.blade.php
1 @extends('layout.frontend', ['title' => 'Редактирование вакансии РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Редактирование вакансии РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 console.log('Приближаемся к системе, нас рой тут...'); 5 console.log('Приближаемся к системе, нас рой тут...');
6 $(document).on('change', '#position_id', function() { 6 $(document).on('change', '#position_id', function() {
7 var this_ = $(this); 7 var this_ = $(this);
8 var val_ = this_.val(); 8 var val_ = this_.val();
9 var ajax_ = $('#job_title_id'); 9 var ajax_ = $('#job_title_id');
10 10
11 console.log('Создания списка людей, которые поднимутся на корабль...'); 11 console.log('Создания списка людей, которые поднимутся на корабль...');
12 12
13 $.ajax({ 13 $.ajax({
14 type: "GET", 14 type: "GET",
15 url: "{{ route('employer.selected_people') }}", 15 url: "{{ route('employer.selected_people') }}",
16 data: "id="+val_, 16 data: "id="+val_,
17 success: function (data) { 17 success: function (data) {
18 console.log('Ответка пришла'); 18 console.log('Ответка пришла');
19 console.log('Список избранных людей создан'); 19 console.log('Список избранных людей создан');
20 ajax_.html(data); 20 ajax_.html(data);
21 }, 21 },
22 headers: { 22 headers: {
23 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 23 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
24 }, 24 },
25 error: function (data) { 25 error: function (data) {
26 console.log('Обрыв связи'); 26 console.log('Обрыв связи');
27 console.log('Error: ' + data); 27 console.log('Error: ' + data);
28 } 28 }
29 }); 29 });
30 }); 30 });
31 </script> 31 </script>
32 @endsection 32 @endsection
33 @section('content') 33 @section('content')
34 <section class="cabinet"> 34 <section class="cabinet">
35 <div class="container"> 35 <div class="container">
36 <ul class="breadcrumbs cabinet__breadcrumbs"> 36 <ul class="breadcrumbs cabinet__breadcrumbs">
37 <li><a href="{{ route('index') }}">Главная</a></li> 37 <li><a href="{{ route('index') }}">Главная</a></li>
38 <li><b>Личный кабинет</b></li> 38 <li><b>Личный кабинет</b></li>
39 </ul> 39 </ul>
40 <div class="cabinet__wrapper"> 40 <div class="cabinet__wrapper">
41 <div class="cabinet__side"> 41 <div class="cabinet__side">
42 <div class="cabinet__side-toper"> 42 <div class="cabinet__side-toper">
43 43
44 @include('employers.emblema') 44 @include('employers.emblema')
45 45
46 </div> 46 </div>
47 47
48 @include('employers.menu', ['item' => 3]) 48 @include('employers.menu', ['item' => 3])
49 49
50 </div> 50 </div>
51 51
52 <form class="cabinet__body" action="{{ route('employer.vacancy_save_me', ['ad_employer' => $ad_employer->id]) }}" method="POST"> 52 <form class="cabinet__body" action="{{ route('employer.vacancy_save_me', ['ad_employer' => $ad_employer->id]) }}" method="POST">
53 @csrf 53 @csrf
54 <input type="hidden" name="employer_id" value="{{ $Employer->id }}"/> 54 <input type="hidden" name="employer_id" value="{{ $Employer->id }}"/>
55 <div class="cabinet__body-item"> 55 <div class="cabinet__body-item">
56 <div class="cabinet__descr"> 56 <div class="cabinet__descr">
57 <h2 class="title cabinet__title">Редактировать вакансию</h2> 57 <h2 class="title cabinet__title">Редактировать вакансию</h2>
58 <p class="cabinet__text"><b>Данные по вакансии</b></p> 58 <p class="cabinet__text"><b>Данные по вакансии</b></p>
59 <p class="cabinet__text">Все поля обязательны для заполнения *</p> 59 <p class="cabinet__text">Все поля обязательны для заполнения *</p>
60 </div> 60 </div>
61 </div> 61 </div>
62 <div class="cabinet__body-item"> 62 <div class="cabinet__body-item">
63 <h4>Поля для вакансии</h4> 63 <h4>Поля для вакансии</h4>
64 <div class="cabinet__inputs"> 64 <div class="cabinet__inputs">
65 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 65 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
66 <label class="form-group__label">Название вакансии</label> 66 <label class="form-group__label">Название вакансии</label>
67 <div class="form-group__item"> 67 <div class="form-group__item">
68 <input type="text" class="input" name="name" id="name" placeholder="Работа в море" value="{{ old('name') ?? $ad_employer->name ?? '' }}" required> 68 <input type="text" class="input" name="name" id="name" placeholder="Работа в море" value="{{ old('name') ?? $ad_employer->name ?? '' }}" required>
69 @error('name') 69 @error('name')
70 <span class="text-xs text-red-600 dark:text-red-400"> 70 <span class="text-xs text-red-600 dark:text-red-400">
71 {{ $message }} 71 {{ $message }}
72 </span> 72 </span>
73 @enderror 73 @enderror
74 </div> 74 </div>
75 </div> 75 </div>
76 76
77 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none"> 77 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none">
78 <label class="form-group__label">Телефон</label> 78 <label class="form-group__label">Телефон</label>
79 <div class="form-group__item"> 79 <div class="form-group__item">
80 <input type="text" class="input" name="telephone" id="telephone" value="{{ old('telephone') ?? $ad_employer->telephone ?? '' }}" placeholder="Свой телефон"> 80 <input type="text" class="input" name="telephone" id="telephone" value="{{ old('telephone') ?? $ad_employer->telephone ?? '' }}" placeholder="Свой телефон">
81 @error('telephone') 81 @error('telephone')
82 <span class="text-xs text-red-600 dark:text-red-400"> 82 <span class="text-xs text-red-600 dark:text-red-400">
83 {{ $message }} 83 {{ $message }}
84 </span> 84 </span>
85 @enderror 85 @enderror
86 </div> 86 </div>
87 </div> 87 </div>
88 88
89 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none"> 89 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none">
90 <label class="form-group__label">Емайл</label> 90 <label class="form-group__label">Емайл</label>
91 <div class="form-group__item"> 91 <div class="form-group__item">
92 <input type="text" class="input" name="email" id="email" value="{{ old('email') ?? $ad_employer->email ?? '' }}" placeholder="Своя почту"> 92 <input type="text" class="input" name="email" id="email" value="{{ old('email') ?? $ad_employer->email ?? '' }}" placeholder="Своя почту">
93 @error('email') 93 @error('email')
94 <span class="text-xs text-red-600 dark:text-red-400"> 94 <span class="text-xs text-red-600 dark:text-red-400">
95 {{ $message }} 95 {{ $message }}
96 </span> 96 </span>
97 @enderror 97 @enderror
98 </div> 98 </div>
99 </div> 99 </div>
100 100
101 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none"> 101 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display:none">
102 <label class="form-group__label">Зарплата среднестатистическая для вакансии</label> 102 <label class="form-group__label">Зарплата среднестатистическая для вакансии</label>
103 <div class="form-group__item"> 103 <div class="form-group__item">
104 <input type="text" class="input" name="salary" id="salary" value="{{ old('salary') ?? $ad_employer->salary ??'' }}" placeholder="Среднестатистическая зарплата"> 104 <input type="text" class="input" name="salary" id="salary" value="{{ old('salary') ?? $ad_employer->salary ??'' }}" placeholder="Среднестатистическая зарплата">
105 @error('salary') 105 @error('salary')
106 <span class="text-xs text-red-600 dark:text-red-400"> 106 <span class="text-xs text-red-600 dark:text-red-400">
107 {{ $message }} 107 {{ $message }}
108 </span> 108 </span>
109 @enderror 109 @enderror
110 </div> 110 </div>
111 </div> 111 </div>
112 112
113 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display: none"> 113 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="display: none">
114 <label class="form-group__label">Город посадки</label> 114 <label class="form-group__label">Город посадки</label>
115 <div class="form-group__item"> 115 <div class="form-group__item">
116 <input type="text" class="input" name="city" id="city" value="{{ old('city') ?? $ad_employer->city ?? 'Не указан' }}" placeholder="Севастополь"> 116 <input type="text" class="input" name="city" id="city" value="{{ old('city') ?? $ad_employer->city ?? 'Не указан' }}" placeholder="Севастополь">
117 @error('city') 117 @error('city')
118 <span class="text-xs text-red-600"> 118 <span class="text-xs text-red-600">
119 {{ $message }} 119 {{ $message }}
120 </span> 120 </span>
121 @enderror 121 @enderror
122 </div> 122 </div>
123 </div> 123 </div>
124 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style=""> 124 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group" style="">
125 <label class="form-group__label">Категория (локация)</label> 125 <label class="form-group__label">Категория (локация)</label>
126 <div class="form-group__item"> 126 <div class="form-group__item">
127 <div class="select"> 127 <div class="select">
128 <select class="js-select2" name="category_id" id="category_id"> 128 <select class="js-select2" name="category_id" id="category_id">
129 php $i = 1 endphp 129 php $i = 1 endphp
130 if ($Positions->count()) 130 if ($Positions->count())
131 foreach($Positions as $j) 131 foreach($Positions as $j)
132 if ($i == 1) <option> Выберите категорию из списка</option> 132 if ($i == 1) <option> Выберите категорию из списка</option>
133 else 133 else
134 <option value=" $j->id }}" if ($ad_employer->category_id == $j->id) selected endif>$j->name }}</option> 134 <option value=" $j->id }}" if ($ad_employer->category_id == $j->id) selected endif>$j->name }}</option>
135 endif 135 endif
136 php $i++ endphp 136 php $i++ endphp
137 endforeach 137 endforeach
138 endif 138 endif
139 </select> 139 </select>
140 error('category_id') 140 error('category_id')
141 <span class="text-xs text-red-600 dark:text-red-400"> 141 <span class="text-xs text-red-600 dark:text-red-400">
142 $message }} 142 $message }}
143 </span> 143 </span>
144 enderror 144 enderror
145 </div> 145 </div>
146 </div> 146 </div>
147 </div>--> 147 </div>-->
148 148
149 <!--foreach ($ad_employer->jobs_code as $it_um) 149 <!--foreach ($ad_employer->jobs_code as $it_um)
150 <pre> print_r($it_um) }}</pre> 150 <pre> print_r($it_um) }}</pre>
151 endforeach--> 151 endforeach-->
152 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 152 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
153 <label class="form-group__label">Редактирование должностей</label> 153 <label class="form-group__label">Редактирование должностей</label>
154 <div class="form-group__item"> 154 <div class="form-group__item">
155 <div class="select"> 155 <div class="select">
156 <select class="js-select2" name="job_title_id[]" id="job_title_id[]" multiple="multiple"> 156 <select class="js-select2" name="job_title_id[]" id="job_title_id[]" multiple="multiple">
157 @php $i = 1 @endphp 157 @php $i = 1 @endphp
158 @if ($jobs->count()) 158 @if ($jobs->count())
159 @foreach($jobs as $it) 159 @foreach($jobs as $it)
160 @php $selected = false; @endphp 160 @php $selected = false; @endphp
161 @foreach ($ad_employer->jobs_code as $it_um) 161 @foreach ($ad_employer->jobs_code as $it_um)
162 @if (isset($it_um->job_title_id)) 162 @if (isset($it_um->job_title_id))
163 @if ($it_um->job_title_id == $it->id)) 163 @if ($it_um->job_title_id == $it->id))
164 @php $selected = true; @endphp 164 @php $selected = true; @endphp
165 @endif 165 @endif
166 @endif 166 @endif
167 @endforeach 167 @endforeach
168 <option value="{{ $it->id }}" @if ($selected) selected @endif>{{ $it->name }}</option> 168 <option value="{{ $it->id }}" @if ($selected) selected @endif>{{ $it->name }}</option>
169 @endforeach 169 @endforeach
170 @endif 170 @endif
171 </select> 171 </select>
172 </div> 172 </div>
173 </div> 173 </div>
174 </div> 174 </div>
175 175
176 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 176 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
177 <label class="form-group__label">Описание вакансии</label> 177 <label class="form-group__label">Описание вакансии</label>
178 <div class="form-group__item"> 178 <div class="form-group__item">
179 <textarea class="textarea ckeditor" name="text" id="text">{{ old('text') ?? $ad_employer->text ?? '' }}</textarea> 179 <textarea class="textarea ckeditor" name="text" id="text">{{ old('text') ?? $ad_employer->text ?? '' }}</textarea>
180 @error('text') 180 @error('text')
181 <span class="text-xs text-red-600"> 181 <span class="text-xs text-red-600">
182 {{ $message }} 182 {{ $message }}
183 </span> 183 </span>
184 @enderror 184 @enderror
185 </div> 185 </div>
186 </div> 186 </div>
187 187
188 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group"> 188 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
189 <h4 class="form-group__label">Редактирование должностей</h4> 189 <h4 class="form-group__label">Редактирование должностей</h4>
190 <div class="form-group__item"> 190 <div class="form-group__item">
191 <a href=" route('employer.add_job_in_vac', ['ad_employer' => $ad_employer->id]) }}" class="button">Добавить</a> 191 <a href=" route('employer.add_job_in_vac', ['ad_employer' => $ad_employer->id]) }}" class="button">Добавить</a>
192 192
193 if ($ad_employer->jobs->count()) 193 if ($ad_employer->jobs->count())
194 foreach ($ad_employer->jobs as $key => $it_um) 194 foreach ($ad_employer->jobs as $key => $it_um)
195 <p>if (isset($ad_employer->jobs_code[$key])) 195 <p>if (isset($ad_employer->jobs_code[$key]))
196 <a href=" route('employer.edit_job_in_vac', ['ad_job' => $ad_employer->jobs_code[$key]->id, 'ad_employer' => $ad_employer->id, 'job_title_id' => $it_um->id]) }}" style="text-decoration: underline">$it_um->name}}</a> 196 <a href=" route('employer.edit_job_in_vac', ['ad_job' => $ad_employer->jobs_code[$key]->id, 'ad_employer' => $ad_employer->id, 'job_title_id' => $it_um->id]) }}" style="text-decoration: underline">$it_um->name}}</a>
197 <a href=" route('employer.delete_job_in_vac', ['ad_job' => $ad_employer->jobs_code[$key]->id]) }}" style="text-decoration: underline">(Del)</a> 197 <a href=" route('employer.delete_job_in_vac', ['ad_job' => $ad_employer->jobs_code[$key]->id]) }}" style="text-decoration: underline">(Del)</a>
198 endif 198 endif
199 </p> 199 </p>
200 endforeach 200 endforeach
201 else 201 else
202 Нет связанных <br> с вакансией должностей 202 Нет связанных <br> с вакансией должностей
203 endif 203 endif
204 </div> 204 </div>
205 </div>--> 205 </div>-->
206 </div> 206 </div>
207 207
208 <a class="button cabinet__submit" href="{{ route('employer.vacancy_list') }}">Назад</a> 208 <a class="button cabinet__submit" href="{{ route('employer.vacancy_list') }}">Назад</a>
209 <button type="submit" class="button cabinet__submit">Опубликовать</button> 209 <button type="submit" class="button cabinet__submit">Опубликовать</button>
210 </div> 210 </div>
211 </form> 211 </form>
212 </div> 212 </div>
213 </div> 213 </div>
214 </section> 214 </section>
215 </div> 215 </div>
216 <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script> 216 <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>
217 <script> 217 <script>
218 CKEDITOR.replace('text'); 218 CKEDITOR.replace('text');
219 //CKEDITOR.replace( 'text', { 219 //CKEDITOR.replace( 'text', {
220 // filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", 220 // filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
221 // filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", 221 // filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}",
222 // filebrowserUploadMethod: 'form' 222 // filebrowserUploadMethod: 'form'
223 // }); 223 // });
224 </script> 224 </script>
225 @endsection 225 @endsection
226 226
resources/views/info_company_new.blade.php
1 @extends('layout.frontend', ['title' => 'Описание компании '.$title.'- РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Описание компании '.$title.'- РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 console.log('Test system'); 5 console.log('Test system');
6 $(document).on('change', '#sort_ajax', function() { 6 $(document).on('change', '#sort_ajax', function() {
7 var this_ = $(this); 7 var this_ = $(this);
8 var val_ = this_.val(); 8 var val_ = this_.val();
9 console.log('sort items '+val_); 9 console.log('sort items '+val_);
10 10
11 $.ajax({ 11 $.ajax({
12 type: "GET", 12 type: "GET",
13 url: "{{ route('shipping_companies') }}", 13 url: "{{ route('shipping_companies') }}",
14 data: "sort="+val_+"&block=1", 14 data: "sort="+val_+"&block=1",
15 success: function (data) { 15 success: function (data) {
16 console.log('Выбор сортировки'); 16 console.log('Выбор сортировки');
17 console.log(data); 17 console.log(data);
18 $('#block_1').html(data); 18 $('#block_1').html(data);
19 }, 19 },
20 headers: { 20 headers: {
21 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 21 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
22 }, 22 },
23 error: function (data) { 23 error: function (data) {
24 data = JSON.stringify(data); 24 data = JSON.stringify(data);
25 console.log('Error: ' + data); 25 console.log('Error: ' + data);
26 } 26 }
27 }); 27 });
28 28
29 $.ajax({ 29 $.ajax({
30 type: "GET", 30 type: "GET",
31 url: "{{ route('shipping_companies') }}", 31 url: "{{ route('shipping_companies') }}",
32 data: "sort="+val_+"&block=2", 32 data: "sort="+val_+"&block=2",
33 success: function (data) { 33 success: function (data) {
34 console.log('Выбор сортировки2'); 34 console.log('Выбор сортировки2');
35 console.log(data); 35 console.log(data);
36 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 36 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
37 $('#block_2').html(data); 37 $('#block_2').html(data);
38 }, 38 },
39 headers: { 39 headers: {
40 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 40 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
41 }, 41 },
42 error: function (data) { 42 error: function (data) {
43 data = JSON.stringify(data); 43 data = JSON.stringify(data);
44 console.log('Error: ' + data); 44 console.log('Error: ' + data);
45 } 45 }
46 }); 46 });
47 }); 47 });
48 48
49 $(document).ready(function(){ 49 $(document).ready(function(){
50 var sel = $('#select2-sort_ajax-container'); 50 var sel = $('#select2-sort_ajax-container');
51 var key = getUrlParameter('sort'); 51 var key = getUrlParameter('sort');
52 if (key !=='') { 52 if (key !=='') {
53 console.log(key); 53 console.log(key);
54 switch (key) { 54 switch (key) {
55 case "default": sel.html('Сортировка (по умолчанию)'); break; 55 case "default": sel.html('Сортировка (по умолчанию)'); break;
56 case "name_up": sel.html('По имени (возрастание)'); break; 56 case "name_up": sel.html('По имени (возрастание)'); break;
57 case "name_down": sel.html('По дате (убывание)'); break; 57 case "name_down": sel.html('По дате (убывание)'); break;
58 case "created_at_up": sel.html('По дате (возрастание)'); break; 58 case "created_at_up": sel.html('По дате (возрастание)'); break;
59 case "created_at_down": sel.html('По дате (убывание)'); break; 59 case "created_at_down": sel.html('По дате (убывание)'); break;
60 } 60 }
61 61
62 } 62 }
63 }); 63 });
64 64
65 //end 65 //end
66 $(document).on('click', '.js_send_it_button', function() { 66 $(document).on('click', '.js_send_it_button', function() {
67 var this_ = $(this); 67 var this_ = $(this);
68 var code_user_id = this_.attr('data-uid'); 68 var code_user_id = this_.attr('data-uid');
69 var code_to_user_id = this_.attr('data-tuid'); 69 var code_to_user_id = this_.attr('data-tuid');
70 var code_vacancy = this_.attr('data-vacancy'); 70 var code_vacancy = this_.attr('data-vacancy');
71 var user_id = $('#send_user_id'); 71 var user_id = $('#send_user_id');
72 var to_user_id = $('#send_to_user_id'); 72 var to_user_id = $('#send_to_user_id');
73 var vacancy = $('#send_vacancy'); 73 var vacancy = $('#send_vacancy');
74 74
75 console.log('Клик на кнопки...'); 75 console.log('Клик на кнопки...');
76 76
77 user_id.val(code_user_id); 77 user_id.val(code_user_id);
78 to_user_id.val(code_to_user_id); 78 to_user_id.val(code_to_user_id);
79 vacancy.val(code_vacancy); 79 vacancy.val(code_vacancy);
80 }); 80 });
81 </script> 81 </script>
82 @include('js.favorite-vacancy-45')
82 @include('js.favorite-vacancy-45') 83 @endsection
83 @endsection 84
84 85 @section('content')
85 @section('content') 86 <section class="thing">
86 <section class="thing"> 87 <div class="container">
87 <div class="container"> 88 <div class="thing__body">
88 <div class="thing__body"> 89 <ul class="breadcrumbs thing__breadcrumbs">
89 <ul class="breadcrumbs thing__breadcrumbs"> 90 <li><a href="{{ route('index') }}">Главная</a></li>
90 <li><a href="{{ route('index') }}">Главная</a></li> 91 <li><a href="{{ route('shipping_companies') }}">Работодатели</a></li>
91 <li><a href="{{ route('shipping_companies') }}">Работодатели</a></li> 92 <li><b>@isset($title) {{ $title }} @else Не указано @endif</b></li>
92 <li><b>@isset($title) {{ $title }} @else Не указано @endif</b></li> 93 </ul>
93 </ul> 94 @if ($company[0]->oficial_status == 1)
94 @if ($company[0]->oficial_status == 1) 95 <div class="thing__badge">
95 <div class="thing__badge"> 96 <svg>
96 <svg> 97 <use xlink:href="{{ asset('images/sprite.svg#badge') }}"></use>
97 <use xlink:href="{{ asset('images/sprite.svg#badge') }}"></use> 98 </svg>
98 </svg> 99 Компания проверена
99 Компания проверена 100 </div>
100 </div> 101 @endif
101 @endif 102
102 103 @if (!empty($company[0]->logo))
103 @if (!empty($company[0]->logo)) 104 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $company[0]->name_company }}" class="thing__pic">
104 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $company[0]->name_company }}" class="thing__pic"> 105 @else
105 @else 106 <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $company[0]->name_company }}" class="thing__pic">
106 <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $company[0]->name_company }}" class="thing__pic"> 107 @endif
107 @endif 108
108 109 <h1 class="thing__title">{{ $company[0]->name_company }}</h1>
109 <h1 class="thing__title">{{ $company[0]->name_company }}</h1> 110 <!--<p class="thing__text"> $company[0]->text !!}</p>-->
110 <!--<p class="thing__text"> $company[0]->text !!}</p>--> 111 <div class="thing__buttons">
111 <div class="thing__buttons"> 112 <button type="button" class="button">
112 <button type="button" class="button"> 113 <svg>
113 <svg> 114 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use>
114 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use> 115 </svg>
115 </svg> 116 {{ $company[0]->ads->count() }} вакансии
116 {{ $company[0]->ads->count() }} вакансии 117 </button>
117 </button> 118 @if ($user_id == 0)
118 @if ($user_id == 0) 119 <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button">
119 <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button"> 120 Написать сообщение
120 Написать сообщение 121 </a>
121 </a> 122 @else
122 @else 123 <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button">
123 <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button"> 124 Написать сообщение
124 Написать сообщение 125 </a>
125 </a> 126 @endif
126 @endif 127 </div>
127 </div> 128 </div>
128 </div> 129 </div>
129 </div> 130 </section>
130 </section> 131 <main class="main">
131 <main class="main"> 132 <div class="container">
132 <div class="container"> 133 <div class="main__employer-page">
133 <div class="main__employer-page"> 134 <h2 class="main__employer-page-title">О компании</h2>
134 <h2 class="main__employer-page-title">О компании</h2> 135 <div class="main__employer-page-info">
135 <div class="main__employer-page-info"> 136 <div class="main__employer-page-item">
136 <div class="main__employer-page-item"> 137 <b>Адрес компании</b>
137 <b>Адрес компании</b> 138 <span>
138 <span> 139 {{ $company[0]->address }}
139 {{ $company[0]->address }} 140 </span>
140 </span> 141 </div>
141 </div> 142 <div class="main__employer-page-item">
142 <div class="main__employer-page-item"> 143 <b>Сайт</b>
143 <b>Сайт</b> 144 <span>
144 <span> 145 <a href="{{ $company[0]->site }}">{{ $company[0]->site }}</a>
145 <a href="{{ $company[0]->site }}">{{ $company[0]->site }}</a> 146 </span>
146 </span> 147 </div>
147 </div> 148 <div class="main__employer-page-item">
148 <div class="main__employer-page-item"> 149 <b>Почта</b>
149 <b>Почта</b> 150 <span>
150 <span> 151 <a href="mailto:">{{ $company[0]->email }}</a>
151 <a href="mailto:">{{ $company[0]->email }}</a> 152 </span>
152 </span> 153 </div>
153 </div> 154 <div class="main__employer-page-item">
154 <div class="main__employer-page-item"> 155 <b>Телефон</b>
155 <b>Телефон</b> 156 <span>
156 <span> 157 <a href="tel:{{ $company[0]->telephone }}">{{ $company[0]->telephone }}</a>
157 <a href="tel:{{ $company[0]->telephone }}">{{ $company[0]->telephone }}</a> 158 </span>
158 </span> 159 </div>
159 </div> 160 </div>
160 </div> 161
161 162 <div class="main__employer-page-item">
162 <div class="main__employer-page-item"> 163 <b>Описание</b>
163 <b>Описание</b> 164 <span>
164 <span> 165 {!! $company[0]->text !!}
165 {!! $company[0]->text !!} 166 </span>
166 </span> 167 </div>
167 </div> 168
168 169 <div>
169 <div> 170
170 171 <div class="main__employer-page-tabs">
171 <div class="main__employer-page-tabs"> 172 <button type="button" class="main__employer-page-tabs-item active"
172 <button type="button" class="main__employer-page-tabs-item active" 173 data-tab="1">Флот</button>
173 data-tab="1">Флот</button> 174 <button type="button" class="main__employer-page-tabs-item" data-tab="2">Вакансии</button>
174 <button type="button" class="main__employer-page-tabs-item" data-tab="2">Вакансии</button> 175 </div>
175 </div> 176
176 177 <div class="main__employer-page-body">
177 <div class="main__employer-page-body"> 178 <div class="main__employer-page-body-item showed" data-body="1">
178 <div class="main__employer-page-body-item showed" data-body="1"> 179 <div class="main__employer-page-one">
179 <div class="main__employer-page-one"> 180 @if ($company[0]->flots->count())
180 @if ($company[0]->flots->count()) 181 @foreach ($company[0]->flots as $flot)
181 @foreach ($company[0]->flots as $flot) 182 <a href="" class="main__employer-page-one-item">
182 <a href="" class="main__employer-page-one-item"> 183 @if (!empty($flot->image))
183 @if (!empty($flot->image)) 184 <img src="{{ asset(Storage::url($flot->image)) }}" alt="{{ $flot->name }}">
184 <img src="{{ asset(Storage::url($flot->image)) }}" alt="{{ $flot->name }}"> 185 @else
185 @else 186 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $flot->name }}">
186 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $flot->name }}"> 187 @endif
187 @endif 188 <b>{{ $flot->name }}</b>
188 <b>{{ $flot->name }}</b> 189 <b>{{ $flot->region }}</b>
189 <b>{{ $flot->region }}</b> 190 <span><i>DWT</i> {{ $flot->DWT }}</span>
190 <span><i>DWT</i> {{ $flot->DWT }}</span> 191 <span><i>Мощность ГД</i> {{ $flot->POWER_GD }}</span>
191 <span><i>Мощность ГД</i> {{ $flot->POWER_GD }}</span> 192 <span><i>IMO</i> {{ $flot->IMO }}</span>
192 <span><i>IMO</i> {{ $flot->IMO }}</span> 193 <span>{{ $flot->power }}</span>
193 <span>{{ $flot->power }}</span> 194 </a>
194 </a> 195 @endforeach
195 @endforeach 196 @endif
196 @endif 197 </div>
197 </div> 198 </div>
198 </div> 199
199 200 <div class="main__employer-page-body-item" data-body="2">
200 <div class="main__employer-page-body-item" data-body="2"> 201 <div class="main__employer-page-two">
201 <div class="main__employer-page-two"> 202 @foreach ($ads as $job)
202 @foreach ($ads as $job) 203 <div class="main__employer-page-two-item">
203 <div class="main__employer-page-two-item"> 204 <div class="main__employer-page-two-item-toper">
204 <div class="main__employer-page-two-item-toper"> 205 @if (!empty($company[0]->logo))
205 @if (!empty($company[0]->logo)) 206 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $job->name }}">
206 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $job->name }}"> 207 @else
207 @else 208 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $job->name }}">
208 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $job->name }}"> 209 @endif
209 @endif 210 <span>{{ $job->name }}</span>
210 <span>{{ $job->name }}</span>
211 </div>
212 <!--<div class="main__employer-page-two-item-title"> $item->flot }}</div>-->
213 <div class="main__employer-page-two-item-text"> 211 </div>
214 <span>Описание: 212 <!--<div class="main__employer-page-two-item-title"> $item->flot }}</div>-->
215 {!! $job->text !!} 213 <div class="main__employer-page-two-item-text">
216 </span> 214 @if ((isset($job->jobs)) && ($job->jobs->count()))
217 <!--if ((isset($job->jobs)) && ($job->jobs->count())) 215 @foreach($job->jobs as $item)
218 foreach($job->jobs as $item) 216 <a class="main__employer-page-two-item-text-name">
219 <a class="main__employer-page-two-item-text-name"> 217 {{ $item->name }}
220 $item->name }} 218 </a>
221 </a> 219 @endforeach
222 endforeach 220 @endif
221 <span>Описание:
222 {!! $job->text !!}
223 </span>
223 endif--> 224 <!--<div class="main__employer-page-two-item-text-body">
224 <!--<div class="main__employer-page-two-item-text-body"> 225 <p>Зарплата: $item->min_salary }} - $item->max_salary }}р + $item->sytki }} суточные.</p>
225 <p>Зарплата: $item->min_salary }} - $item->max_salary }}р + $item->sytki }} суточные.</p> 226 <p>Контракт: $item->period }} мес.</p>
226 <p>Контракт: $item->period }} мес.</p> 227 </div>-->
227 </div>--> 228 </div>
228 </div> 229 <!--<div class="main__employer-page-two-item-text">
229 <!--<div class="main__employer-page-two-item-text"> 230 <div class="main__employer-page-two-item-text-name">Район работы</div>
230 <div class="main__employer-page-two-item-text-name">Район работы</div> 231 <div class="main__employer-page-two-item-text-body">
231 <div class="main__employer-page-two-item-text-body"> 232 <p> $item->region }}</p>
232 <p> $item->region }}</p> 233 </div>
233 </div> 234 </div>
234 </div> 235 <div class="main__employer-page-two-item-text">
235 <div class="main__employer-page-two-item-text"> 236 <div class="main__employer-page-two-item-text-name">Посадка</div>
236 <div class="main__employer-page-two-item-text-name">Посадка</div> 237 <div class="main__employer-page-two-item-text-body">
237 <div class="main__employer-page-two-item-text-body"> 238 <p> $item->start }}</p>
238 <p> $item->start }}</p> 239 !! $item->description !!}
239 !! $item->description !!} 240 </div>
240 </div> 241 </div>-->
241 </div>--> 242
243 <!--<div class="main__employer-page-two-item-text">
242 244 <div class="main__employer-page-two-item-text-name">Звонить по вопросам на:
243 <!--<div class="main__employer-page-two-item-text"> 245 </div>
244 <div class="main__employer-page-two-item-text-name">Звонить по вопросам на: 246 <div class="main__employer-page-two-item-text-body">
245 </div> 247 <a href="tel: $job->telephone }}"> $job->telephone }}</a>
246 <div class="main__employer-page-two-item-text-body"> 248 </div>
247 <a href="tel: $job->telephone }}"> $job->telephone }}</a> 249 </div>
248 </div> 250 <div class="main__employer-page-two-item-text">
249 </div> 251 <div class="main__employer-page-two-item-text-name">Анкеты присылать на
250 <div class="main__employer-page-two-item-text"> 252 почту:
251 <div class="main__employer-page-two-item-text-name">Анкеты присылать на 253 </div>
252 почту: 254 <div class="main__employer-page-two-item-text-body">
253 </div> 255 <a href="mailto: $job->email }}"> $job->email }}</a>
254 <div class="main__employer-page-two-item-text-body"> 256 </div>
255 <a href="mailto: $job->email }}"> $job->email }}</a> 257 </div>-->
258
256 </div> 259 @if ((isset($job->jobs)) && ($job->jobs->count()))
257 </div>--> 260 <div class="main__employer-page-two-item-tags">
258 261 @foreach ($job->jobs as $item)
259 @if ((isset($job->jobs)) && ($job->jobs->count())) 262 <span class="main__employer-page-two-item-tag">#{{ $item->name }}</span>
260 <div class="main__employer-page-two-item-tags"> 263 @endforeach
261 @foreach ($job->jobs as $item) 264 </div>
262 <span class="main__employer-page-two-item-tag">#{{ $item->name }}</span> 265 @endif
263 @endforeach 266 <div class="main__employer-page-two-item-buttons">
264 </div> 267
265 @endif 268 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $job->id }}" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}'
266 <div class="main__employer-page-two-item-buttons"> 269 class="button main__employer-page-two-item-button js_send_it_button">Оставить
267 270 отклик...</button>
268 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $job->id }}" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}' 271
269 class="button main__employer-page-two-item-button js_send_it_button">Оставить 272 <!--<a href="#"
270 отклик...</button> 273 class="button button_light main__employer-page-two-item-button">Подробнее</a>-->
271 274 </div>
272 <!--<a href="#" 275 <div class="main__employer-page-two-item-bottom">
273 class="button button_light main__employer-page-two-item-button">Подробнее</a>--> 276 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($job->updated_at)) }}</div>
274 </div> 277 <button type="button" id="like{{ $job->id }}" data-val="{{ $job->id }}"
275 <div class="main__employer-page-two-item-bottom"> 278 class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($job) }}">
276 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($job->updated_at)) }}</div> 279 <svg>
277 <button type="button" id="like{{ $job->id }}" data-val="{{ $job->id }}" 280 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
278 class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($job) }}"> 281 </svg>
279 <svg> 282 </button>
280 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 283 </div>
281 </svg> 284 </div>
282 </button> 285 @endforeach
283 </div> 286
284 </div> 287 <div style="margin-top: 20px">
285 @endforeach 288 {{ $ads->onEachSide(0)->appends($_GET)->links('paginate') }}
286 289 </div>
287 <div style="margin-top: 20px"> 290 <!--<button type="button" class="button button_light button_more main__employer-page-two-more js-toggle js-parent-toggle">
288 {{ $ads->onEachSide(0)->appends($_GET)->links('paginate') }} 291 <span>Показать ещё</span>
289 </div> 292 <span>Скрыть</span>
290 <!--<button type="button" class="button button_light button_more main__employer-page-two-more js-toggle js-parent-toggle"> 293 </button>-->
291 <span>Показать ещё</span> 294 </div>
292 <span>Скрыть</span> 295 </div>
293 </button>--> 296 </div>
294 </div> 297 </div>
295 </div> 298 </div>
296 </div> 299 </div>
resources/views/layout/frontend.blade.php
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> 2 <html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
3 3
4 <head> 4 <head>
5 <meta charset="utf-8"> 5 <meta charset="utf-8">
6 <title>{{ $title }}</title> 6 <title>{{ $title }}</title>
7 <meta name="viewport" content="width=device-width,initial-scale=1"> 7 <meta name="viewport" content="width=device-width,initial-scale=1">
8 <meta name="theme-color" content="#377D87"> 8 <meta name="theme-color" content="#377D87">
9 <script src="{{ asset('js/jquery.js') }}"></script> 9 <script src="{{ asset('js/jquery.js') }}"></script>
10 <!--<script type="text/javascript" src=" asset('js/jquery.cookie.js') }}"></script>--> 10 <!--<script type="text/javascript" src=" asset('js/jquery.cookie.js') }}"></script>-->
11 11
12 <link rel="stylesheet" href="{{ asset('css/telegram.css') }}"> 12 <link rel="stylesheet" href="{{ asset('css/telegram.css') }}">
13 13
14 <link rel="stylesheet" href="{{ asset('css/star-rating.min.css') }}"> 14 <link rel="stylesheet" href="{{ asset('css/star-rating.min.css') }}">
15 <link rel="stylesheet" href="{{ asset('css/style_may2024.css') }}"> 15 <link rel="stylesheet" href="{{ asset('css/style_may2024.css') }}">
16 <style> 16 <style>
17 .err_red { 17 .err_red {
18 border: red 2px solid; 18 border: red 2px solid;
19 } 19 }
20 20
21 .input[disabled] { 21 .input[disabled] {
22 /* color: #9c9d9d; */ 22 /* color: #9c9d9d; */
23 background: #FFFFFF; 23 background: #FFFFFF;
24 } 24 }
25 </style> 25 </style>
26 </head> 26 </head>
27 27
28 <body id="body" onload="createCaptcha()"> 28 <body id="body" onload="createCaptcha()">
29 <a href="#body" class="to-top js-scroll-to"> 29 <a href="#body" class="to-top js-scroll-to">
30 <svg> 30 <svg>
31 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> 31 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use>
32 </svg> 32 </svg>
33 </a> 33 </a>
34 34
35 <div> <!-- BEGIN TOP WRAPPER --> 35 <div> <!-- BEGIN TOP WRAPPER -->
36 <header class="header"> 36 <header class="header">
37 <div class="container"> 37 <div class="container">
38 <div class="header__body"> 38 <div class="header__body">
39 <div class="header__left"> 39 <div class="header__left">
40 <a href="{{ route('index') }}" class="header__logo"> 40 <a href="{{ route('index') }}" class="header__logo">
41 <svg> 41 <svg>
42 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> 42 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use>
43 </svg> 43 </svg>
44 </a> 44 </a>
45 <nav class="header__menu"> 45 <nav class="header__menu">
46 <a href="{{ route('vacancies') }}" class="header__menu-item">Вакансии</a> 46 <a href="{{ route('vacancies') }}" class="header__menu-item">Вакансии</a>
47 <a href="{{ route('shipping_companies') }}" class="header__menu-item">Судоходные компании</a> 47 <a href="{{ route('shipping_companies') }}" class="header__menu-item">Судоходные компании</a>
48 <a href="{{ route('education') }}" class="header__menu-item">Образование</a> 48 <a href="{{ route('education') }}" class="header__menu-item">Образование</a>
49 </nav> 49 </nav>
50 </div> 50 </div>
51 <div class="header__right"> 51 <div class="header__right">
52 @guest 52 @guest
53 53
54 @else 54 @else
55 <a href="@if ($UserId->is_worker) {{ route('worker.cabinet') }} @else {{ route('employer.cabinet') }} @endif" class="header__notifs header__notifs_actived"> 55 <a href="@if ($UserId->is_worker) {{ route('worker.cabinet') }} @else {{ route('employer.cabinet') }} @endif" class="header__notifs header__notifs_actived">
56 <svg> 56 <svg>
57 <use xlink:href="{{ asset('images/sprite.svg#ring') }}"></use> 57 <use xlink:href="{{ asset('images/sprite.svg#ring') }}"></use>
58 </svg> 58 </svg>
59 <span>Уведомления</span> 59 <span>Уведомления</span>
60 </a> 60 </a>
61 61
62 @endguest 62 @endguest
63 <div class="header__right-line"></div> 63 <div class="header__right-line"></div>
64 <button class="header__burger"> 64 <button class="header__burger">
65 <svg> 65 <svg>
66 <use xlink:href="{{ asset('images/sprite.svg#burger') }}"></use> 66 <use xlink:href="{{ asset('images/sprite.svg#burger') }}"></use>
67 </svg> 67 </svg>
68 </button> 68 </button>
69 @guest 69 @guest
70 <a class="button header__sign" data-fancybox data-src="#sign" data-options='{"touch":false,"autoFocus":false}'>Войти</a> 70 <a class="button header__sign" data-fancybox data-src="#sign" data-options='{"touch":false,"autoFocus":false}'>Войти</a>
71 @else 71 @else
72 <a class="button header__sign" href="{{ route('logout') }}">Выйти</a> 72 <a class="button header__sign" href="{{ route('logout') }}">Выйти</a>
73 @endguest 73 @endguest
74 </div> 74 </div>
75 </div> 75 </div>
76 </div> 76 </div>
77 </header> 77 </header>
78 78
79 @yield('content') 79 @yield('content')
80 </div> <!-- END TOP WRAPPER --> 80 </div> <!-- END TOP WRAPPER -->
81 81
82 <div> <!-- BEGIN BOTTOM WRAPPER --> 82 <div> <!-- BEGIN BOTTOM WRAPPER -->
83 <footer class="footer"> 83 <footer class="footer">
84 <div class="container"> 84 <div class="container">
85 <div class="footer__mobile"> 85 <div class="footer__mobile">
86 86
87 <button class="footer__mobile-toper js-toggle active"> 87 <button class="footer__mobile-toper js-toggle active">
88 <a href="{{ route('index') }}"> 88 <a href="{{ route('index') }}">
89 <svg> 89 <svg>
90 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> 90 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use>
91 </svg> 91 </svg>
92 </a> 92 </a>
93 <span> 93 <span>
94 <svg> 94 <svg>
95 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> 95 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use>
96 </svg> 96 </svg>
97 </span> 97 </span>
98 </button> 98 </button>
99 <div class="footer__mobile-menu"> 99 <div class="footer__mobile-menu">
100 <div class="footer__mobile-menu-item"> 100 <div class="footer__mobile-menu-item">
101 <button class="js-toggle"> 101 <button class="js-toggle">
102 <b>Соискателям</b> 102 <b>Соискателям</b>
103 <span><svg> 103 <span><svg>
104 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> 104 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use>
105 </svg></span> 105 </svg></span>
106 </button>
106 </button> 107 <div>
107 <div> 108 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a>
108 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a> 109 <a href="{{ route('vacancies') }}">Вакансии</a>
109 <a href="{{ route('vacancies') }}">Вакансии</a> 110 <!--<a href=" route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>-->
110 <!--<a href=" route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>--> 111 <a href="{{ route('education') }}">Образование</a>
112 <a href="{{ route('news') }}">Новости</a>
113 <a href="{{ $companies[0]->telegram }}">Телеграм</a>
111 <a href="{{ route('education') }}">Образование</a> 114 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a>
112 <a href="{{ route('news') }}">Новости</a> 115 <!--<a href=" route('contacts') }}">Контакты</a>-->
113 <a href="{{ $companies[0]->telegram }}">Телеграм</a> 116 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a>
114 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a> 117 </div>
115 <!--<a href=" route('contacts') }}">Контакты</a>--> 118 </div>
116 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a> 119 <div class="footer__mobile-menu-item">
117 </div> 120 <button class="js-toggle">
118 </div> 121 <b>Работодателям</b>
119 <div class="footer__mobile-menu-item"> 122 <span><svg>
120 <button class="js-toggle"> 123 <use xlink:href="{{asset('images/sprite.svg#arrow-top') }}"></use>
121 <b>Работодателям</b> 124 </svg></span>
122 <span><svg> 125 </button>
126 <div>
123 <use xlink:href="{{asset('images/sprite.svg#arrow-top') }}"></use> 127 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a>
124 </svg></span> 128 <!--<a href=" route('register') }}">Регистрация</a>-->
125 </button> 129 <a href="{{ route('bd_resume') }}">База резюме</a>
126 <div> 130 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>
131 <!--<a href=" route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a>-->
132 <!--<a href=" route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a>-->
133 <!--<a href=" route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a>-->
127 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a> 134 <a href="{{ $companies[0]->telegram }}">Телеграм</a>
128 <!--<a href=" route('register') }}">Регистрация</a>--> 135 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a>
129 <a href="{{ route('bd_resume') }}">База резюме</a> 136 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a>
130 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a> 137 </div>
131 <!--<a href=" route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a>--> 138 </div>
132 <!--<a href=" route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a>--> 139 </div>
133 <!--<a href=" route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a>--> 140 <div class="footer__mobile-contacts">
134 <a href="{{ $companies[0]->telegram }}">Телеграм</a> 141 <b>Контакты</b>
135 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a> 142 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a>
136 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a> 143 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a>
137 </div> 144 </div>
138 </div> 145 <div class="footer__mobile-bottom">
139 </div> 146 <div class="socials">
140 <div class="footer__mobile-contacts"> 147 <a href="{{ $companies[0]->vkontact }}" target="_blank">
141 <b>Контакты</b> 148 <svg>
142 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a> 149 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use>
143 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a> 150 </svg>
144 </div> 151 </a>
145 <div class="footer__mobile-bottom"> 152 <a href="{{ $companies[0]->telegram }}" target="_blank">
146 <div class="socials"> 153 <svg>
147 <a href="{{ $companies[0]->vkontact }}" target="_blank"> 154 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use>
148 <svg> 155 </svg>
149 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> 156 </a>
150 </svg> 157 </div>
151 </a> 158 <nav class="footer__mobile-links">
152 <a href="{{ $companies[0]->telegram }}" target="_blank"> 159 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a>
153 <svg> 160 <span></span>
154 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> 161 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a>
155 </svg> 162 </nav>
156 </a> 163 &copy; 2023 &mdash; RekaMore.su
157 </div> 164 <a href="{{ route('index') }}" class="nls" target="_blank">
158 <nav class="footer__mobile-links"> 165 <svg>
159 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a> 166 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use>
160 <span></span> 167 </svg>
161 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a> 168 <span>
162 </nav> 169 Дизайн и разработка:
163 &copy; 2023 &mdash; RekaMore.su 170 <b>NoLogoStudio.ru</b>
164 <a href="{{ route('index') }}" class="nls" target="_blank"> 171 </span>
165 <svg> 172 </a>
166 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use> 173 </div>
167 </svg> 174 </div>
168 <span> 175 <div class="footer__main">
169 Дизайн и разработка: 176 <div class="footer__main-body">
170 <b>NoLogoStudio.ru</b> 177
171 </span> 178 <a href="" class="footer__main-logo">
172 </a> 179 <svg>
173 </div> 180 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use>
174 </div> 181 </svg>
175 <div class="footer__main"> 182 </a>
176 <div class="footer__main-body"> 183 <div class="footer__main-col">
184 <div class="footer__main-title">Соискателям</div>
177 185 <nav>
178 <a href="" class="footer__main-logo"> 186 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a>
179 <svg> 187 <a href="{{ route('vacancies') }}">Вакансии</a>
180 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> 188 <!--<a href=" route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>-->
181 </svg> 189 <a href="{{ route('education') }}">Образование</a>
190 <a href="{{ route('news') }}">Новости</a>
191 <!--<a href=" route('contacts') }}">Контакты</a>-->
182 </a> 192 <a href="{{ $companies[0]->telegram }}">Телеграм</a>
183 <div class="footer__main-col"> 193 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a>
184 <div class="footer__main-title">Соискателям</div> 194 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a>
185 <nav> 195 </nav>
186 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a> 196 </div>
187 <a href="{{ route('vacancies') }}">Вакансии</a> 197 <div class="footer__main-col">
188 <!--<a href=" route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>--> 198 <div class="footer__main-title">Работодателям</div>
199 <nav>
189 <a href="{{ route('education') }}">Образование</a> 200 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a>
190 <a href="{{ route('news') }}">Новости</a> 201 <!--<a href=" route('register') }}">Регистрация</a>-->
191 <!--<a href=" route('contacts') }}">Контакты</a>--> 202 <a href="{{ route('bd_resume') }}">База резюме</a>
192 <a href="{{ $companies[0]->telegram }}">Телеграм</a> 203 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>
204 <!--<a href=" route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a>-->
205 <!--<a href=" route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a>-->
206 <!--<a href=" route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a>-->
193 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a> 207 <a href="{{ $companies[0]->telegram }}">Телеграм</a>
194 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a> 208 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a>
195 </nav> 209 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a>
196 </div> 210 </nav>
197 <div class="footer__main-col"> 211 </div>
198 <div class="footer__main-title">Работодателям</div> 212
199 <nav> 213 <div class="footer__main-col">
200 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a> 214 <div class="footer__main-title">Контакты</div>
201 <!--<a href=" route('register') }}">Регистрация</a>--> 215 <div class="footer__main-contacts">
202 <a href="{{ route('bd_resume') }}">База резюме</a> 216 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a>
203 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a> 217 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a>
204 <!--<a href=" route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a>--> 218 </div>
205 <!--<a href=" route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a>--> 219 <div class="socials">
206 <!--<a href=" route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a>--> 220 <a href="{{ $companies[0]->vkontact }}" target="_blank">
207 <a href="{{ $companies[0]->telegram }}">Телеграм</a> 221 <svg>
208 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a> 222 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use>
209 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a> 223 </svg>
210 </nav> 224 </a>
211 </div> 225 <a href="{{ $companies[0]->telegram }}" target="_blank">
212 226 <svg>
213 <div class="footer__main-col"> 227 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use>
214 <div class="footer__main-title">Контакты</div> 228 </svg>
215 <div class="footer__main-contacts"> 229 </a>
216 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a> 230 </div>
217 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a> 231 </div>
218 </div> 232 </div>
219 <div class="socials"> 233
220 <a href="{{ $companies[0]->vkontact }}" target="_blank"> 234 <div class="footer__main-copy">
221 <svg> 235 <div>&copy; 2023 &mdash; RekaMore.su</div>
222 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> 236 <nav>
223 </svg> 237 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a>
224 </a> 238 <span></span>
225 <a href="{{ $companies[0]->telegram }}" target="_blank"> 239 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a>
226 <svg> 240 </nav>
227 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> 241 <div> @if (isset($_COOKIE['favorite_vacancy'])) Куки вакансий: {{ print_r($_COOKIE['favorite_vacancy']) }} @endif</div>
228 </svg> 242 <a href="{{ route('index') }}" class="nls" target="_blank">
229 </a> 243 <svg>
230 </div> 244 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use>
231 </div> 245 </svg>
232 </div> 246 <span>
233 247 Дизайн и разработка:
234 <div class="footer__main-copy"> 248 <b>NoLogoStudio.ru</b>
235 <div>&copy; 2023 &mdash; RekaMore.su</div> 249 </span>
236 <nav> 250 </a>
237 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a> 251 </div>
238 <span></span> 252 </div>
239 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a> 253 </div>
240 </nav> 254 </footer>
241 <div> @if (isset($_COOKIE['favorite_vacancy'])) Куки вакансий: {{ print_r($_COOKIE['favorite_vacancy']) }} @endif</div> 255 </div> <!-- END BOTTOM WRAPPER -->
242 <a href="{{ route('index') }}" class="nls" target="_blank"> 256
243 <svg> 257 <div hidden> <!-- BEGIN MODALS WRAPPER -->
244 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use> 258 <!-- Соискатель отправляет сообщение работодателю -->
245 </svg> 259 @include('modals.send_worker_new')
246 <span> 260
247 Дизайн и разработка: 261 <!-- Работодатель отправляет сообщение соискателю -->
248 <b>NoLogoStudio.ru</b> 262 @include('modals.send_employer')
249 </span> 263
250 </a> 264 <!-- Сообщение-предупреждение о том, что сообщения только можно отправить авторизованным пользователям -->
251 </div> 265 @include('modals.send_message_noaut')
252 </div> 266
253 </div> 267 @include('modals.send_message_noaut2')
254 </footer> 268
255 </div> <!-- END BOTTOM WRAPPER --> 269 <!-- Форма авторизации -->
256 270 @include('modals.send_login')
257 <div hidden> <!-- BEGIN MODALS WRAPPER --> 271
258 <!-- Соискатель отправляет сообщение работодателю --> 272 <!-- Сбросить пароль -->
259 @include('modals.send_worker_new') 273 @include('modals.reset_password')
260 274
261 <!-- Работодатель отправляет сообщение соискателю --> 275 <!-- Регистрация -->
262 @include('modals.send_employer') 276 @include('modals.register')
263 277
264 <!-- Сообщение-предупреждение о том, что сообщения только можно отправить авторизованным пользователям --> 278 <!-- Благодарность по отправке сообщения работодателю -->
265 @include('modals.send_message_noaut') 279 @include('modals.thank_you_send_employer')
266 280
267 @include('modals.send_message_noaut2') 281 <!-- Благодарность по отправке сообщения менеджеру -->
268 282 @include('modals.thank_you_send_manager')
269 <!-- Форма авторизации --> 283
270 @include('modals.send_login') 284 <!-- Благодарность после регистрации -->
271 285 @include('modals.thank_you_send_for_employer')
272 <!-- Сбросить пароль --> 286
273 @include('modals.reset_password') 287 <!-- Благодарность после регистрации для работника -->
274 288 @include('modals.thank_you_send_for_worker')
275 <!-- Регистрация --> 289
276 @include('modals.register') 290 <!-- Подтверждение удаления профиля -->
277 291 @include('modals.delete_profile')
278 <!-- Благодарность по отправке сообщения работодателю --> 292
279 @include('modals.thank_you_send_employer') 293 <!-- Подверждение об удалении профиля -->
280 294 @include('modals.success_delete_profile')
281 <!-- Благодарность по отправке сообщения менеджеру --> 295
282 @include('modals.thank_you_send_manager') 296 </div> <!-- END MODALS WRAPPER -->
283 297
284 <!-- Благодарность после регистрации --> 298
285 @include('modals.thank_you_send_for_employer') 299 <script src="{{ asset('js/jquery.maskedinput.js') }}"></script>
286 300 <script src="{{ asset('js/jquery.fancybox.js') }}"></script>
287 <!-- Благодарность после регистрации для работника --> 301 <script src="{{ asset('js/jquery.select2.js') }}"></script>
288 @include('modals.thank_you_send_for_worker') 302 <script src="{{ asset('js/swiper.js') }}"></script>
289 303 <script src="{{ asset('js/script-vc.js') }}"></script>
290 <!-- Подтверждение удаления профиля --> 304 <script src="{{ asset('js/star-rating.min.js') }}"></script>
291 @include('modals.delete_profile') 305 <script>
292 306 var getUrlParameter = function getUrlParameter(sParam) {
293 <!-- Подверждение об удалении профиля --> 307 var sPageURL = decodeURIComponent(window.location.search.substring(1)),
294 @include('modals.success_delete_profile') 308 sURLVariables = sPageURL.split('&'),
295 309 sParameterName,
296 </div> <!-- END MODALS WRAPPER --> 310 i;
297 311 for (i = 0; i < sURLVariables.length; i++) {
298 312 sParameterName = sURLVariables[i].split('=');
299 <script src="{{ asset('js/jquery.maskedinput.js') }}"></script> 313 if (sParameterName[0] === sParam) {
300 <script src="{{ asset('js/jquery.fancybox.js') }}"></script> 314 return sParameterName[1] === undefined ? true : sParameterName[1];
301 <script src="{{ asset('js/jquery.select2.js') }}"></script> 315 }
302 <script src="{{ asset('js/swiper.js') }}"></script> 316 }
303 <script src="{{ asset('js/script-vc.js') }}"></script> 317 };
304 <script src="{{ asset('js/star-rating.min.js') }}"></script> 318 </script>
305 <script> 319 @include('js.modals')
306 var getUrlParameter = function getUrlParameter(sParam) { 320 @include('js.captha')
307 var sPageURL = decodeURIComponent(window.location.search.substring(1)), 321 @yield('scripts')
308 sURLVariables = sPageURL.split('&'), 322 </body>
309 sParameterName, 323 </html>
310 i; 324
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 console.log('Test system'); 9 console.log('Test system');
10 $(document).on('change', '#jobs', function() { 10 $(document).on('change', '#jobs', function() {
11 var val = $(this).val(); 11 var val = $(this).val();
12 var main_oskar = $('#main_ockar'); 12 var main_oskar = $('#main_ockar');
13 var ti_head = $('#title_head'); 13 var ti_head = $('#title_head');
14 14
15 console.log('Code='+val); 15 console.log('Code='+val);
16 console.log('Click change...'); 16 console.log('Click change...');
17 $.ajax({ 17 $.ajax({
18 type: "GET", 18 type: "GET",
19 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", 19 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}",
20 data: "job="+val, 20 data: "job="+val,
21 success: function (data) { 21 success: function (data) {
22 console.log('Выбор сделан!'); 22 console.log('Выбор сделан!');
23 23
24 main_oskar.html(data); 24 main_oskar.html(data);
25 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"); 25 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");
26 }, 26 },
27 headers: { 27 headers: {
28 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 28 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
29 }, 29 },
30 error: function (data) { 30 error: function (data) {
31 data = JSON.stringify(data); 31 data = JSON.stringify(data);
32 console.log('Error: ' + data); 32 console.log('Error: ' + data);
33 } 33 }
34 }); 34 });
35 35
36 if ((val == '') || (val == '0')) { 36 if ((val == '') || (val == '0')) {
37 title_head.html('Все категории'); 37 title_head.html('Все категории');
38 } else { 38 } else {
39 $.ajax({ 39 $.ajax({
40 type: "GET", 40 type: "GET",
41 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}?@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif", 41 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}?@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif",
42 data: "job=" + val +"&title=1", 42 data: "job=" + val +"&title=1",
43 success: function (data) { 43 success: function (data) {
44 44
45 console.log(data); 45 console.log(data);
46 }, 46 },
47 47
48 headers: { 48 headers: {
49 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 49 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
50 }, 50 },
51 51
52 error: function (data) { 52 error: function (data) {
53 data = JSON.stringify(data); 53 data = JSON.stringify(data);
54 console.log('Error: ' + data); 54 console.log('Error: ' + data);
55 } 55 }
56 }); 56 });
57 57
58 } 58 }
59 }); 59 });
60 60
61 $(document).on('click', '.js_send_it_button', function() { 61 $(document).on('click', '.js_send_it_button', function() {
62 var this_ = $(this); 62 var this_ = $(this);
63 var code_user_id = this_.attr('data-uid'); 63 var code_user_id = this_.attr('data-uid');
64 var code_to_user_id = this_.attr('data-tuid'); 64 var code_to_user_id = this_.attr('data-tuid');
65 var code_vacancy = this_.attr('data-vacancy'); 65 var code_vacancy = this_.attr('data-vacancy');
66 var user_id = $('#_user_id'); 66 var user_id = $('#_user_id');
67 var to_user_id = $('#_to_user_id'); 67 var to_user_id = $('#_to_user_id');
68 var vacancy = $('#_vacancy'); 68 var vacancy = $('#_vacancy');
69 69
70 console.log('Клик на кнопки...'); 70 console.log('Клик на кнопки...');
71 71
72 user_id.val(code_user_id); 72 user_id.val(code_user_id);
73 to_user_id.val(code_to_user_id); 73 to_user_id.val(code_to_user_id);
74 vacancy.val(code_vacancy); 74 vacancy.val(code_vacancy);
75 }); 75 });
76 76
77 $(document).on('click', '.js_send_for_emp', function() { 77 $(document).on('click', '.js_send_for_emp', function() {
78 var this_ = $(this); 78 var this_ = $(this);
79 var code_user_id = this_.attr('data-uid'); 79 var code_user_id = this_.attr('data-uid');
80 var code_to_user_id = this_.attr('data-tuid'); 80 var code_to_user_id = this_.attr('data-tuid');
81 var code_vacancy = this_.attr('data-vacancy'); 81 var code_vacancy = this_.attr('data-vacancy');
82 var user_id = $('#send_user_id'); 82 var user_id = $('#send_user_id');
83 var to_user_id = $('#send_to_user_id'); 83 var to_user_id = $('#send_to_user_id');
84 var vacancy = $('#send_vacancy'); 84 var vacancy = $('#send_vacancy');
85 85
86 console.log('code_to_user_id='+code_to_user_id); 86 console.log('code_to_user_id='+code_to_user_id);
87 console.log('code_user_id='+code_user_id); 87 console.log('code_user_id='+code_user_id);
88 console.log('code_vacancy='+code_vacancy); 88 console.log('code_vacancy='+code_vacancy);
89 console.log('Клик на кнопке...'); 89 console.log('Клик на кнопке...');
90 90
91 user_id.val(code_user_id); 91 user_id.val(code_user_id);
92 to_user_id.val(code_to_user_id); 92 to_user_id.val(code_to_user_id);
93 vacancy.val(code_vacancy); 93 vacancy.val(code_vacancy);
94 }); 94 });
95 95
96 $(document).on('change', '#sort_ajax', function() { 96 $(document).on('change', '#sort_ajax', function() {
97 var this_ = $(this); 97 var this_ = $(this);
98 var val_ = this_.val(); 98 var val_ = this_.val();
99 console.log('sort items '+val_); 99 console.log('sort items '+val_);
100 100
101 $.ajax({ 101 $.ajax({
102 type: "GET", 102 type: "GET",
103 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", 103 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}",
104 data: "sort="+val_+"&block=1", 104 data: "sort="+val_+"&block=1",
105 success: function (data) { 105 success: function (data) {
106 console.log('Выбор сортировки'); 106 console.log('Выбор сортировки');
107 console.log(data); 107 console.log(data);
108 $('#main_ockar').html(data); 108 $('#main_ockar').html(data);
109 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"); 109 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");
110 }, 110 },
111 headers: { 111 headers: {
112 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 112 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
113 }, 113 },
114 error: function (data) { 114 error: function (data) {
115 data = JSON.stringify(data); 115 data = JSON.stringify(data);
116 console.log('Error: ' + data); 116 console.log('Error: ' + data);
117 } 117 }
118 }); 118 });
119 }); 119 });
120 120
121 121
122 122
123 $(document).ready(function(){ 123 $(document).ready(function(){
124 var sel = $('#select2-sort_ajax-container'); 124 var sel = $('#select2-sort_ajax-container');
125 var key = getUrlParameter('sort'); 125 var key = getUrlParameter('sort');
126 console.log(sel); 126 console.log(sel);
127 console.log(key); 127 console.log(key);
128 128
129 if (key !=='') { 129 if (key !=='') {
130 console.log(key); 130 console.log(key);
131 switch (key) { 131 switch (key) {
132 case "default": sel.html('Сортировка (по умолчанию)'); break; 132 case "default": sel.html('Сортировка (по умолчанию)'); break;
133 case "name_up": sel.html('По имени (возрастание)'); break; 133 case "name_up": sel.html('По имени (возрастание)'); break;
134 case "name_down": sel.html('По дате (убывание)'); break; 134 case "name_down": sel.html('По дате (убывание)'); break;
135 case "created_at_up": sel.html('По дате (возрастание)'); break; 135 case "created_at_up": sel.html('По дате (возрастание)'); break;
136 case "created_at_down": sel.html('По дате (убывание)'); break; 136 case "created_at_down": sel.html('По дате (убывание)'); break;
137 } 137 }
138 138
139 } 139 }
140 }); 140 });
141 </script> 141 </script>
142 @include('js.favorite-vacancy-45') 142 @include('js.favorite-vacancy-45')
143 @endsection 143 @endsection
144 @section('content') 144 @section('content')
145 <section class="thing"> 145 <section class="thing">
146 <div class="container"> 146 <div class="container">
147 <form class="thing__body" action="{{ route('list-vacancies', ['categories' => (!empty($Name_categori)) ? $Name_categori[0]->id : '0']) }}" method="POST"> 147 <form class="thing__body" action="{{ route('list-vacancies', ['categories' => (!empty($Name_categori)) ? $Name_categori[0]->id : '0']) }}" method="POST">
148 <ul class="breadcrumbs thing__breadcrumbs"> 148 <ul class="breadcrumbs thing__breadcrumbs">
149 <li><a href="{{ route('index') }}">Главная</a></li> 149 <li><a href="{{ route('index') }}">Главная</a></li>
150 <li><a href="{{ route('vacancies') }}">Вакансии</a></li> 150 <li><a href="{{ route('vacancies') }}">Вакансии</a></li>
151 <li><b>{{ isset($Name_categori[0]) ? $Name_categori[0]->name : 'Все категории' }}</b></li> 151 <li><b>{{ isset($Name_categori[0]) ? $Name_categori[0]->name : 'Все категории' }}</b></li>
152 </ul> 152 </ul>
153 <h1 class="thing__title">Вакансии</h1> 153 <h1 class="thing__title">Вакансии</h1>
154 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для 154 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для
155 существующих финансовых и административных условий.</p> 155 существующих финансовых и административных условий.</p>
156 <div class="select select_search thing__select"> 156 <div class="select select_search thing__select">
157 <div class="select__icon"> 157 <div class="select__icon">
158 <svg> 158 <svg>
159 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 159 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
160 </svg> 160 </svg>
161 </div> 161 </div>
162 <select class="js-select2" id="jobs" name="jobs"> 162 <select class="js-select2" id="jobs" name="jobs">
163 <option value="0" selected>Выберите должность</option> 163 <option value="0" selected>Выберите должность</option>
164 @if ($Job_title->count()) 164 @if ($Job_title->count())
165 @foreach($Job_title as $JT) 165 @foreach($Job_title as $JT)
166 <option value="{{ $JT->id }}" @if(isset($_GET['job']) && ($_GET['job'] == $JT->id)) selected @endif>{{ $JT->name }}</option> 166 <option value="{{ $JT->id }}" @if(isset($_GET['job']) && ($_GET['job'] == $JT->id)) selected @endif>{{ $JT->name }}</option>
167 @endforeach 167 @endforeach
168 @endif 168 @endif
169 </select> 169 </select>
170 </div> 170 </div>
171 </form> 171 </form>
172 </div> 172 </div>
173 </section> 173 </section>
174 <main class="main"> 174 <main class="main">
175 <div class="container"> 175 <div class="container">
176 <div class="main__vacancies" > 176 <div class="main__vacancies" >
177 @if (isset($Name_categori[0]->name)) 177 @if (isset($Name_categori[0]->name))
178 <h2 class="main__vacancies-title">Категория вакансий {{ $Name_categori[0]->name }}</h2> 178 <h2 class="main__vacancies-title">Категория вакансий {{ $Name_categori[0]->name }}</h2>
179 @else 179 @else
180 <h2 class="main__vacancies-title" id="title_head" name="title_head">Все категории</h2> 180 <h2 class="main__vacancies-title" id="title_head" name="title_head">Все категории</h2>
181 @endif 181 @endif
182 <div class="filters main__vacancies-filters"> 182 <div class="filters main__vacancies-filters">
183 <div class="filters__label" id="col-vo" name="col-vo">Показано {{ $Query->firstItem() }} – {{ $Query->lastItem() }} из @isset($Query_count) {{ $Query_count }} @else 0 @endisset результатов поиска</div> 183 <div class="filters__label" id="col-vo" name="col-vo">Показано {{ $Query->firstItem() }} – {{ $Query->lastItem() }} из @isset($Query_count) {{ $Query_count }} @else 0 @endisset результатов поиска</div>
184 <div class="filters__body"> 184 <div class="filters__body">
185 <div class="select filters__select"> 185 <div class="select filters__select">
186 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 186 <select class="js-select2" id="sort_ajax" name="sort_ajax">
187 <option value="default">Сортировка (по умолчанию)</option> 187 <option value="default">Сортировка (по умолчанию)</option>
188 <option value="name_up">По имени (возрастание)</option> 188 <option value="name_up">По имени (возрастание)</option>
189 <option value="name_down">По имени (убывание)</option> 189 <option value="name_down">По имени (убывание)</option>
190 <option value="created_at_up">По дате (возрастание)</option> 190 <option value="created_at_up">По дате (возрастание)</option>
191 <option value="created_at_down">По дате (убывание)</option> 191 <option value="created_at_down">По дате (убывание)</option>
192 </select> 192 </select>
193 </div> 193 </div>
194 </div> 194 </div>
195 </div> 195 </div>
196 196
197 <div class="main__vacancies" style="width:100%;" id="main_ockar" name="main_oskar"> 197 <div class="main__vacancies" style="width:100%;" id="main_ockar" name="main_oskar">
198 @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp 198 @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp
199 199
200 @foreach ($Query as $Q) 200 @foreach ($Query as $Q)
201 @foreach ($Reclama as $Rec) 201 @foreach ($Reclama as $Rec)
202 @if ($Rec->position == $i) 202 @if ($Rec->position == $i)
203 <div class="main__vacancies-thing"> 203 <div class="main__vacancies-thing">
204 @if (!empty($Rec->image)) 204 @if (!empty($Rec->image))
205 <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 205 <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
206 @else 206 @else
207 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 207 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
208 @endif 208 @endif
209 <div class="main__vacancies-thing-body"> 209 <div class="main__vacancies-thing-body">
210 <h2>{{ $Rec->title }}</h2> 210 <h2>{{ $Rec->title }}</h2>
211 <div class="main__vacancies-thing-scroll"> 211 <div class="main__vacancies-thing-scroll">
212 {!! $Rec->text !!} 212 {!! $Rec->text !!}
213 </div> 213 </div>
214 <a href="{{ $Rec->link }}" class="button">Узнать больше</a> 214 <a href="{{ $Rec->link }}" class="button">Узнать больше</a>
215 </div> 215 </div>
216 </div> 216 </div>
217 @endif 217 @endif
218 @endforeach 218 @endforeach
219 <div class="main__vacancies-item main__employer-page-two-item" data-id="{{ $Q->id }}"> 219 <div class="main__vacancies-item main__employer-page-two-item" data-id="{{ $Q->id }}">
220 220
221 <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" class="back main__employer-page-two-item-back"> 221 <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" class="back main__employer-page-two-item-back">
222 <svg> 222 <svg>
223 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 223 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
224 </svg> 224 </svg>
225 <span> 225 <span>
226 Вернуться к списку вакансий 123 226 Вернуться к списку вакансий 123
227 </span> 227 </span>
228 </a> 228 </a>
229 229
230 <div class="main__employer-page-two-item-toper"> 230 <div class="main__employer-page-two-item-toper">
231 @if (!empty($Q->employer->logo)) 231 @if (!empty($Q->employer->logo))
232 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}"> 232 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}">
233 @else 233 @else
234 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 234 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
235 @endif 235 @endif
236 <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span> 236 <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span>
237 </div> 237 </div>
238 238
239 <div class="main__employer-page-two-item-text"> 239 <div class="main__employer-page-two-item-text">
240 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор 240 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор
241 специалистов на следующие должности:</div> 241 специалистов на следующие должности:</div>
242 <div class="main__employer-page-two-item-text-links"> 242 <div class="main__employer-page-two-item-text-links">
243 @if (isset($Q->jobs)) 243 @if (isset($Q->jobs))
244 @foreach ($Q->jobs as $key => $j) 244 @foreach ($Q->jobs as $key => $j)
245 <a>“{{ $j->name }}” <!--– з/п от if (isset($Q->jobs_code[$key]->min_salary)) { $Q->jobs_code[$key]->min_salary }} endif - if (isset($Q->jobs_code[$key]->max_salary)) { $Q->jobs_code[$key]->max_salary }} endif рублей (на руки)--> 245 <a>“{{ $j->name }}” <!--– з/п от if (isset($Q->jobs_code[$key]->min_salary)) { $Q->jobs_code[$key]->min_salary }} endif - if (isset($Q->jobs_code[$key]->max_salary)) { $Q->jobs_code[$key]->max_salary }} endif рублей (на руки)-->
246 </a>
246 </a> 247 @endforeach
247 @endforeach 248 @endif
248 @endif 249 </div>
249 </div> 250 </div>
250 </div> 251
251 252 <div class="main__employer-page-two-item-text">
252 <div class="main__employer-page-two-item-text"> 253 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
253 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 254 <div class="main__employer-page-two-item-text-body">
254 <div class="main__employer-page-two-item-text-body"> 255 {!! $Q->text !!}
255 {!! $Q->text !!} 256 </div>
256 </div> 257 </div>
257 </div> 258 <!--<div class="main__employer-page-two-item-text">
258 <!--<div class="main__employer-page-two-item-text"> 259 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div>
259 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div> 260 <div class="main__employer-page-two-item-text-body">
260 <div class="main__employer-page-two-item-text-body"> 261 !! $Q->description !!}
261 !! $Q->description !!} 262 </div>
262 </div> 263 </div>
263 </div> 264 <div class="main__employer-page-two-item-text">
264 <div class="main__employer-page-two-item-text"> 265 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div>
265 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div> 266 <div class="main__employer-page-two-item-text-body">
266 <div class="main__employer-page-two-item-text-body"> 267 !! $Q->contacts_emails !!}
267 !! $Q->contacts_emails !!} 268 </div>
268 </div> 269 </div>
269 </div> 270 <div class="main__employer-page-two-item-text">
270 <div class="main__employer-page-two-item-text"> 271 <div class="main__employer-page-two-item-text-name">Или звоните:</div>
271 <div class="main__employer-page-two-item-text-name">Или звоните:</div> 272 <div class="main__employer-page-two-item-text-body">
272 <div class="main__employer-page-two-item-text-body"> 273 !! $Q->contacts_telephones !!}
273 !! $Q->contacts_telephones !!} 274 </div>
274 </div> 275 </div>-->
275 </div>--> 276
276 277 <div class="main__employer-page-two-item-tags">
277 <div class="main__employer-page-two-item-tags"> 278 @if (!empty($Q->jobs_code[0]->position_ship))
278 @if (!empty($Q->jobs_code[0]->position_ship)) 279 <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span>
279 <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span> 280 @else
280 @else 281 @if (isset($Q->jobs))
281 @if (isset($Q->jobs)) 282 @foreach ($Q->jobs as $key => $j)
282 @foreach ($Q->jobs as $key => $j) 283 <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span>
283 <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span> 284 @endforeach
284 @endforeach 285 @endif
285 @endif 286 @endif
286 @endif 287 </div>
287 </div> 288 <div class="main__employer-page-two-item-buttons">
288 <div class="main__employer-page-two-item-buttons"> 289 @guest
289 @guest 290 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
290 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' 291 class="button main__employer-page-two-item-button">Откликнуться</button>
291 class="button main__employer-page-two-item-button">Откликнуться</button> 292 @else
292 @else 293 @if (App\Classes\StatusUser::Status()==1)
293 @if (App\Classes\StatusUser::Status()==1) 294 <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}'
294 <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}' 295 class="button main__employer-page-two-item-button js_send_for_emp">Откликнуться</button>
295 class="button main__employer-page-two-item-button js_send_for_emp">Откликнуться</button> 296 @else
296 @else 297 <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}'
297 <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}' 298 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
298 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> 299 @endif
299 @endif 300 @endguest
300 @endguest 301 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a>
301 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a> 302 </div>
302 </div> 303 <div class="main__employer-page-two-item-bottom">
303 <div class="main__employer-page-two-item-bottom"> 304 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div>
304 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div> 305 <button type="button" id="like{{ $Q->id }}" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}">
305 <button type="button" id="like{{ $Q->id }}" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}"> 306 <svg>
306 <svg> 307 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
307 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 308 </svg>
308 </svg> 309 </button>
309 </button> 310 </div>
310 </div> 311 </div>
311 </div> 312 @php $i++ @endphp
312 @php $i++ @endphp 313 @endforeach
313 @endforeach 314 <div style="margin-top: 20px">
314 <div style="margin-top: 20px"> 315 {{ $Query->onEachSide(0)->appends($_GET)->links('paginate') }}
315 {{ $Query->onEachSide(0)->appends($_GET)->links('paginate') }} 316 </div><!-- конец -->
316 </div><!-- конец --> 317
317 318 </div>
318 </div> 319 </div>
319 </div> 320 </div>
320 </div> 321 </main>
321 </main> 322 @endsection
322 @endsection 323
resources/views/worker.blade.php
1 @extends('layout.frontend', ['title' => 'Карточка соискателя - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Карточка соискателя - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 console.log('Test system'); 5 console.log('Test system');
6 $(document).on('change', '#jobs', function() { 6 $(document).on('change', '#jobs', function() {
7 var val = $(this).val(); 7 var val = $(this).val();
8 var main_oskar = $('#main_ockar'); 8 var main_oskar = $('#main_ockar');
9 9
10 console.log('Code='+val); 10 console.log('Code='+val);
11 console.log('Click change...'); 11 console.log('Click change...');
12 $.ajax({ 12 $.ajax({
13 type: "GET", 13 type: "GET",
14 url: "", 14 url: "",
15 data: "job="+val, 15 data: "job="+val,
16 success: function (data) { 16 success: function (data) {
17 console.log('Выбор сделан!'); 17 console.log('Выбор сделан!');
18 console.log(data); 18 console.log(data);
19 main_oskar.html(data); 19 main_oskar.html(data);
20 }, 20 },
21 headers: { 21 headers: {
22 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 22 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
23 }, 23 },
24 error: function (data) { 24 error: function (data) {
25 data = JSON.stringify(data); 25 data = JSON.stringify(data);
26 console.log('Error: ' + data); 26 console.log('Error: ' + data);
27 } 27 }
28 }); 28 });
29 }); 29 });
30 </script> 30 </script>
31 31
32 <script> 32 <script>
33 $(document).on('click', '.js_it_button', function() { 33 $(document).on('click', '.js_it_button', function() {
34 var this_ = $(this); 34 var this_ = $(this);
35 var code_user_id = this_.attr('data-uid'); 35 var code_user_id = this_.attr('data-uid');
36 var code_to_user_id = this_.attr('data-tuid'); 36 var code_to_user_id = this_.attr('data-tuid');
37 var code_vacancy = this_.attr('data-vacancy'); 37 var code_vacancy = this_.attr('data-vacancy');
38 var user_id = $('#_user_id'); 38 var user_id = $('#_user_id');
39 var to_user_id = $('#_to_user_id'); 39 var to_user_id = $('#_to_user_id');
40 var vacancy = $('#_vacancy'); 40 var vacancy = $('#_vacancy');
41 41
42 console.log('code_to_user_id='+code_to_user_id); 42 console.log('code_to_user_id='+code_to_user_id);
43 console.log('code_user_id='+code_user_id); 43 console.log('code_user_id='+code_user_id);
44 console.log('code_vacancy='+code_vacancy); 44 console.log('code_vacancy='+code_vacancy);
45 console.log('Клик на кнопке...'); 45 console.log('Клик на кнопке...');
46 46
47 user_id.val(code_user_id); 47 user_id.val(code_user_id);
48 to_user_id.val(code_to_user_id); 48 to_user_id.val(code_to_user_id);
49 vacancy.val(code_vacancy); 49 vacancy.val(code_vacancy);
50 }); 50 });
51 </script> 51 </script>
52 @include('js.favorite-worker') 52 @include('js.favorite-worker')
53 @endsection 53 @endsection
54 54
55 @section('content') 55 @section('content')
56 <section class="thing"> 56 <section class="thing">
57 <div class="container"> 57 <div class="container">
58 <ul class="breadcrumbs thing__breadcrumbs"> 58 <ul class="breadcrumbs thing__breadcrumbs">
59 <li><a href="{{ route('index') }}">Главная</a></li> 59 <li><a href="{{ route('index') }}">Главная</a></li>
60 <li><a href="{{ route('bd_resume') }}">База резюме</a></li> 60 <li><a href="{{ route('bd_resume') }}">База резюме</a></li>
61 <li><b>@if (isset($Query[0]->users)) {{ $Query[0]->users->surname." ".$Query[0]->users->name_man." ".$Query[0]->users->surname2 }} @else Неизвестно @endif</b></li> 61 <li><b>@if (isset($Query[0]->users)) {{ $Query[0]->users->surname." ".$Query[0]->users->name_man." ".$Query[0]->users->surname2 }} @else Неизвестно @endif</b></li>
62 </ul> 62 </ul>
63 <div class="thing__profile"> 63 <div class="thing__profile">
64 <img src="@if (isset($Query[0]->photo)) {{ asset(Storage::url($Query[0]->photo)) }} @else {{ asset('images/default_man.jpg') }} @endif" alt="" class="main__resume-base-body-item-photo"> 64 <img src="@if (isset($Query[0]->photo)) {{ asset(Storage::url($Query[0]->photo)) }} @else {{ asset('images/default_man.jpg') }} @endif" alt="" class="main__resume-base-body-item-photo">
65 <div class="thing__profile-body"> 65 <div class="thing__profile-body">
66 <h1 class="thing__title">@if (isset($Query[0]->users)) {{ $Query[0]->users->surname." ".$Query[0]->users->name_man." ".$Query[0]->users->surname2 }} @else Неизвестно @endif</h1> 66 <h1 class="thing__title">@if (isset($Query[0]->users)) {{ $Query[0]->users->surname." ".$Query[0]->users->name_man." ".$Query[0]->users->surname2 }} @else Неизвестно @endif</h1>
67 <p class="thing__text">Сложно сказать, почему ключевые особенности структуры проекта рассмотрены 67 <p class="thing__text">Сложно сказать, почему ключевые особенности структуры проекта рассмотрены
68 исключительно в разрезе маркетинговых и финансовых предпосылок.</p> 68 исключительно в разрезе маркетинговых и финансовых предпосылок.</p>
69 <div class="thing__bottom"> 69 <div class="thing__bottom">
70 <a class="button" href="{{ route('resume_download', ['worker' => $Query[0]->id]) }}"> 70 <a class="button" href="{{ route('resume_download', ['worker' => $Query[0]->id]) }}">
71 Скачать резюме 71 Скачать резюме
72 <svg> 72 <svg>
73 <use xlink:href="{{ asset('images/sprite.svg#download') }}"></use> 73 <use xlink:href="{{ asset('images/sprite.svg#download') }}"></use>
74 </svg> 74 </svg>
75 </a> 75 </a>
76 <button type="button" class="like js-toggle js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($Query[0]) }}" data-val="{{ $Query[0]->id }}" id="elem{{ $Query[0]->id }}"> 76 <button type="button" class="like js-toggle js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($Query[0]) }}" data-val="{{ $Query[0]->id }}" id="elem{{ $Query[0]->id }}">
77 <svg> 77 <svg>
78 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 78 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
79 </svg> 79 </svg>
80 </button> 80 </button>
81 </div> 81 </div>
82 </div> 82 </div>
83 </div> 83 </div>
84 </div> 84 </div>
85 </section> 85 </section>
86 <main class="main"> 86 <main class="main">
87 <div class="container"> 87 <div class="container">
88 <div class="main__resume-profile"> 88 <div class="main__resume-profile">
89 <div class="main__content"> 89 <div class="main__content">
90 <div class="main__spoiler"> 90 <div class="main__spoiler">
91 <button type="button" class="main__spoiler-toper js-toggle active"> 91 <button type="button" class="main__spoiler-toper js-toggle active">
92 Основная информация</button> 92 Основная информация</button>
93 93
94 <div class="main__spoiler-body"> 94 <div class="main__spoiler-body">
95 <table class="main__table"> 95 <table class="main__table">
96 <tbody> 96 <tbody>
97 <tr> 97 <tr>
98 <td>Имя:</td> 98 <td>Имя:</td>
99 <td><b>{{ $Query[0]->users->name_man }}</b></td> 99 <td><b>{{ $Query[0]->users->name_man }}</b></td>
100 </tr> 100 </tr>
101 <tr> 101 <tr>
102 <td>Должность:</td> 102 <td>Должность:</td>
103 <td> 103 <td>
104 @if ($Query[0]->job_titles->count()) 104 @if ($Query[0]->job_titles->count())
105 @foreach ($Query[0]->job_titles as $it) 105 @foreach ($Query[0]->job_titles as $it)
106 @if ($it->is_remove == 0) 106 @if ($it->is_remove == 0)
107 <b>{{ $it->name }}</b> 107 <b>{{ $it->name }}</b>
108 @endif 108 @endif
109 @endforeach 109 @endforeach
110 @endif 110 @endif
111 </td> 111 </td>
112 </tr> 112 </tr>
113 <tr> 113 <tr>
114 <td>Телефон:</td> 114 <td>Телефон:</td>
115 <td><b><a href="tel:{{ $Query[0]->telephone }}">{{ $Query[0]->telephone }}</a></b></td> 115 <td><b><a href="tel:{{ $Query[0]->telephone }}">{{ $Query[0]->telephone }}</a></b></td>
116 </tr> 116 </tr>
117 <tr> 117 <tr>
118 <td>E-mail:</td> 118 <td>E-mail:</td>
119 <td><b><a href="mailto:{{ $Query[0]->email }}">{{ $Query[0]->email }}</a></b></td> 119 <td><b><a href="mailto:{{ $Query[0]->email }}">{{ $Query[0]->email }}</a></b></td>
120 </tr> 120 </tr>
121 <tr> 121 <tr>
122 <td>Возраст:</td> 122 <td>Возраст:</td>
123 <td><b>{{ $Query[0]->old_year }}</b></td> 123 <td><b>{{ $Query[0]->old_year }}</b></td>
124 </tr> 124 </tr>
125 <tr> 125 <tr>
126 <td>Статус:</td> 126 <td>Статус:</td>
127 <td><b>{{ $status_work[$Query[0]->status_work] }}</b></td> 127 <td><b>{{ $status_work[$Query[0]->status_work] }}</b></td>
128 </tr> 128 </tr>
129 <tr> 129 <tr>
130 <td>Город проживания:</td> 130 <td>Город проживания:</td>
131 <td><b>{{ $Query[0]->city }}</b></td> 131 <td><b>{{ $Query[0]->city }}</b></td>
132 </tr> 132 </tr>
133 <tr> 133 <tr>
134 <td>Уровень английского:</td> 134 <td>Уровень английского:</td>
135 <td><b>{{ $Query[0]->en_is }}</b></td> 135 <td><b>{{ $Query[0]->en_is }}</b></td>
136 </tr> 136 </tr>
137 <tr> 137 <tr>
138 <td>Опыт работы:</td> 138 <td>Опыт работы:</td>
139 <td><b>{{ $Query[0]->experience }}</b></td> 139 <td><b>{{ $Query[0]->experience }}</b></td>
140 </tr> 140 </tr>
141 </tbody> 141 </tbody>
142 </table> 142 </table>
143 </div> 143 </div>
144 </div> 144 </div>
145 <div class="main__spoiler"> 145 <div class="main__spoiler">
146 <button type="button" class="main__spoiler-toper js-toggle">Сертификаты / документы</button> 146 <button type="button" class="main__spoiler-toper js-toggle">Сертификаты / документы</button>
147 <div class="main__spoiler-body"> 147 <div class="main__spoiler-body">
148 148
149 @if (isset($Query[0]->sertificate)) 149 @if (isset($Query[0]->sertificate))
150 @if ($Query[0]->sertificate->count()) 150 @if ($Query[0]->sertificate->count())
151 @foreach($Query[0]->sertificate as $it) 151 @foreach($Query[0]->sertificate as $it)
152 <table class="main__table"> 152 <table class="main__table">
153 <tbody> 153 <tbody>
154 <tr> 154 <tr>
155 <td>Название сертификата:</td> 155 <td>Название сертификата:</td>
156 <td><b>{{ $it->name }}</b></td> 156 <td><b>{{ $it->name }}</b></td>
157 </tr> 157 </tr>
158 <tr> 158 <tr>
159 <td>Организация выдавшая документ:</td> 159 <td>Организация выдавшая документ:</td>
160 <td><b>{{ $it->education }}</b></td> 160 <td><b>{{ $it->education }}</b></td>
161 </tr> 161 </tr>
162 <tr> 162 <tr>
163 <td>Дата начала обучения:</td> 163 <td>Дата начала обучения:</td>
164 <td><b>{{ $it->date_begin }}</b></td> 164 <td><b>{{ $it->date_begin }}</b></td>
165 </tr> 165 </tr>
166 <tr> 166 <tr>
167 <td>Дата конца обучения:</td> 167 <td>Дата конца обучения:</td>
168 <td><b>{{ $it->end_begin }}</b></td> 168 <td><b>{{ $it->end_begin }}</b></td>
169 </tr> 169 </tr>
170 </tbody> 170 </tbody>
171 </table> 171 </table>
172 <br> 172 <br>
173 @endforeach 173 @endforeach
174 @endif 174 @endif
175 @endif 175 @endif
176 </div> 176 </div>
177 </div> 177 </div>
178 178
179 <div class="main__spoiler"> 179 <div class="main__spoiler">
180 <button type="button" class="main__spoiler-toper js-toggle">Опыт работы</button> 180 <button type="button" class="main__spoiler-toper js-toggle">Опыт работы</button>
181 <div class="main__spoiler-body"> 181 <div class="main__spoiler-body">
182 182
183 @if (isset($Query[0]->place_worker)) 183 @if (isset($Query[0]->place_worker))
184 @if ($Query[0]->place_worker->count()) 184 @if ($Query[0]->place_worker->count())
185 @foreach($Query[0]->place_worker as $it) 185 @foreach($Query[0]->place_worker as $it)
186 186
187 <table class="main__table"> 187 <table class="main__table">
188 <tbody> 188 <tbody>
189 <tr> 189 <tr>
190 <td>Должность:</td> 190 <td>Должность:</td>
191 <td><b>{{ $it->job_title }}</b></td> 191 <td><b>{{ $it->job_title }}</b></td>
192 </tr> 192 </tr>
193 <tr> 193 <tr>
194 <td>Опыт работы в танкерном флоте:</td> 194 <td>Опыт работы в танкерном флоте:</td>
195 <td><b>@if($it->tanker==1) Есть @else Нет @endif</b></td> 195 <td><b>@if($it->tanker==1) Есть @else Нет @endif</b></td>
196 </tr> 196 </tr>
197 <tr> 197 <tr>
198 <td>Дата начала работы:</td> 198 <td>Дата начала работы:</td>
199 <td><b>{{ $it->begin_work }}</b></td> 199 <td><b>{{ $it->begin_work }}</b></td>
200 </tr> 200 </tr>
201 <tr> 201 <tr>
202 <td>Дата конца работы:</td> 202 <td>Дата конца работы:</td>
203 <td><b>{{ $it->end_work }}</b></td> 203 <td><b>{{ $it->end_work }}</b></td>
204 </tr> 204 </tr>
205 <tr> 205 <tr>
206 <td>Название компании:</td> 206 <td>Название компании:</td>
207 <td><b>{{ $it->name_company }}</b></td> 207 <td><b>{{ $it->name_company }}</b></td>
208 </tr> 208 </tr>
209 <tr> 209 <tr>
210 <td>GWT тип</td> 210 <td>GWT тип</td>
211 <td><b>{{ $it->GWT }}</b></td> 211 <td><b>{{ $it->GWT }}</b></td>
212 </tr> 212 </tr>
213 <tr> 213 <tr>
214 <td>ГД:</td> 214 <td>ГД:</td>
215 <td><b>{{ $it->KBT }}</b></td> 215 <td><b>{{ $it->KBT }}</b></td>
216 </tr> 216 </tr>
217 </tbody> 217 </tbody>
218 </table> 218 </table>
219 <br> 219 <br>
220 @endforeach 220 @endforeach
221 @endif 221 @endif
222 @endif 222 @endif
223 </div> 223 </div>
224 </div> 224 </div>
225 225
226 <div class="main__spoiler"> 226 <div class="main__spoiler">
227 <button type="button" class="main__spoiler-toper js-toggle">Дополнительные документы</button> 227 <button type="button" class="main__spoiler-toper js-toggle">Дополнительные документы</button>
228 <div class="main__spoiler-body"> 228 <div class="main__spoiler-body">
229 @if ($infoblocks->count())
230 <table class="main__table">
231 <tbody>
232 @foreach ($infoblocks as $info)
233 @php $finder = false; @endphp
234 @if (isset($Query[0]->infobloks))
235 @if ($Query[0]->infobloks->count())
229 @if ($infoblocks->count()) 236
230 <table class="main__table"> 237 @foreach($Query[0]->infobloks as $it)
231 <tbody> 238 @if ($info->id == $it->id)
232 @foreach ($infoblocks as $info) 239 <tr>
233 @php $finder = false; @endphp 240 <td><b>{{ $it->name }}</b></td>
234 @if (isset($Query[0]->infobloks)) 241 <td>
235 @if ($Query[0]->infobloks->count()) 242 @if ($it->model_dop_info[0]->status == 0) Не указано
236 243 @elseif($it->model_dop_info[0]->status==1) В наличии
237 @foreach($Query[0]->infobloks as $it) 244 @else Отсутствует
238 @if ($info->id == $it->id) 245 @endif
239 <tr> 246 </td>
240 <td><b>{{ $it->name }}</b></td> 247 </tr>
241 <td> 248 @php $finder = true; @endphp
242 @if ($it->model_dop_info[0]->status == 0) Не указано 249 @endif
243 @elseif($it->model_dop_info[0]->status==1) В наличии 250 @endforeach
244 @else Отсутствует 251 @endif
245 @endif 252 @endif
246 </td> 253 @if (!$finder)
247 </tr> 254 <tr>
255 <td><b>{{ $info->name }}</b></td>
256 <td>
257 Не указано
258 </td>
259 </tr>
260 @endif
261 @endforeach
262 </tbody>
263 </table>
248 @php $finder = true; @endphp 264 @endif
249 @endif 265 </div>
250 @endforeach 266 </div>
251 @endif 267 </div>
252 @endif 268
253 @if (!$finder) 269 <div class="main__resume-profile-about">
254 <tr> 270 <h2 class="main__resume-profile-about-title">О себе</h2>
255 <td><b>{{ $info->name }}</b></td> 271 <p class="main__resume-profile-about-text">{{ $Query[0]->text }}</p>
256 <td> 272 @if (App\Classes\StatusUser::Status()==0)
257 Не указано 273 @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message))
258 </td> 274 <div class="button main__resume-profile-about-button js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot }}" data-tuid="{{ $Query[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}'>Написать сообщение</div>
259 </tr> 275 @endif
260 @endif 276 @endif
261 @endforeach 277 </div>
262 </tbody> 278 <div class="main__resume-profile-info">
263 </table> 279 <h2 class="main__resume-profile-info-title">Данные о прошлых компаниях</h2>
264 @endif 280 <div class="main__resume-profile-info-body">
265 </div> 281 @if ((isset($Query[0]->prev_company)) && ($Query[0]->prev_company->count()))
266 </div> 282 @foreach ($Query[0]->prev_company as $it)
267 </div> 283 <div class="main__resume-profile-info-body-item">
268 284 <h3 class="main__resume-profile-info-body-subtitle">{{ $it->name_company }}</h3>
269 <div class="main__resume-profile-about"> 285 <ul class="main__resume-profile-info-body-inner">
270 <h2 class="main__resume-profile-about-title">О себе</h2> 286 <li>
271 <p class="main__resume-profile-about-text">{{ $Query[0]->text }}</p> 287 <b>Руководитель</b>
272 @if (App\Classes\StatusUser::Status()==0) 288 <span>{{ $it->direct }}</span>
273 @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message)) 289 </li>
274 <div class="button main__resume-profile-about-button js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot }}" data-tuid="{{ $Query[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}'>Написать сообщение</div> 290 <li>
275 @endif 291 <b>Телефон того, кто может дать рекомендацию</b>
276 @endif 292 <span>
277 </div> 293 @if (!empty($it->telephone))
278 <div class="main__resume-profile-info"> 294 <a href="tel:{{$it->telephone }}">{{ $it->telephone }}</a>
279 <h2 class="main__resume-profile-info-title">Данные о прошлых компаниях</h2> 295 @endif
280 <div class="main__resume-profile-info-body"> 296 @if (!empty($it->telephone2))
281 @if ((isset($Query[0]->prev_company)) && ($Query[0]->prev_company->count())) 297 <a href="tel:{{$it->telephone2 }}">{{ $it->telephone2 }}</a>
282 @foreach ($Query[0]->prev_company as $it) 298 @endif
283 <div class="main__resume-profile-info-body-item"> 299 </span>
284 <h3 class="main__resume-profile-info-body-subtitle">{{ $it->name_company }}</h3> 300 </li>
285 <ul class="main__resume-profile-info-body-inner"> 301 </ul>
286 <li> 302 </div>
287 <b>Руководитель</b> 303 @endforeach
288 <span>{{ $it->direct }}</span> 304 @else
289 </li> 305 <div class="main__resume-profile-info-body-item">
290 <li> 306 <h3 class="main__resume-profile-info-body-subtitle">Нету данных о компании</h3>
291 <b>Телефон того, кто может дать рекомендацию</b> 307 </div>
292 <span> 308 @endif
293 @if (!empty($it->telephone)) 309 </div>
294 <a href="tel:{{$it->telephone }}">{{ $it->telephone }}</a> 310 </div>
295 @endif 311
296 @if (!empty($it->telephone2)) 312 <div class="main__resume-profile-info">
297 <a href="tel:{{$it->telephone2 }}">{{ $it->telephone2 }}</a> 313 <h2 class="main__resume-profile-info-title">Количество просмотров страницы: ({{ $stat[0]->lookin }})</h2>
298 @endif 314 </div>
299 </span> 315
300 </li> 316 <div class="main__resume-profile-info">
301 </ul> 317 <h2 class="main__resume-profile-info-title">Отзывы о работнике ({{ $Query[0]->response->count() }})</h2>
302 </div> 318 <div class="main__resume-profile-info-body">
303 @endforeach 319 @if ((isset($Query[0]->response)) && ($Query[0]->response->count()))
304 @else 320 <div class="main__resume-profile-info-body-item">
305 <div class="main__resume-profile-info-body-item"> 321 <ul class="main__resume-profile-info-body-inner">
306 <h3 class="main__resume-profile-info-body-subtitle">Нету данных о компании</h3> 322 @php $i = 1; @endphp
307 </div> 323 @foreach($Query[0]->response as $it)
308 @endif 324 <li>
309 </div> 325 <span><h3>Комментарий №{{$i}}</h3></span>
310 </div> 326 <span><b>Оценка человека: {{ $it->stars }}</b></span>
311 327 <span><b>Сообщение: </b>{{ $it->message }}</span>
312 <div class="main__resume-profile-info"> 328 </li>
313 <h2 class="main__resume-profile-info-title">Количество просмотров страницы: ({{ $stat[0]->lookin }})</h2> 329 @php $i++; @endphp
314 </div> 330 @endforeach
315 331 </ul>
316 <div class="main__resume-profile-info"> 332 </div>
317 <h2 class="main__resume-profile-info-title">Отзывы о работнике ({{ $Query[0]->response->count() }})</h2> 333 @else
318 <div class="main__resume-profile-info-body"> 334 <div class="main__resume-profile-info-body-item">
319 @if ((isset($Query[0]->response)) && ($Query[0]->response->count())) 335 <h3 class="main__resume-profile-info-body-subtitle">Нету комментариев</h3>
320 <div class="main__resume-profile-info-body-item"> 336 </div>
321 <ul class="main__resume-profile-info-body-inner"> 337 @endif
322 @php $i = 1; @endphp 338 </div>
323 @foreach($Query[0]->response as $it) 339 </div>
324 <li> 340
325 <span><h3>Комментарий №{{$i}}</h3></span> 341 <div class="main__resume-profile-review">
326 <span><b>Оценка человека: {{ $it->stars }}</b></span> 342 <form action="{{ route('stars_answer') }}" method="POST">
327 <span><b>Сообщение: </b>{{ $it->message }}</span> 343 @csrf
328 </li> 344 <h2 class="main__resume-profile-review-title">Оставить отзыв о работнике</h2>
329 @php $i++; @endphp 345 <div class="rate">
330 @endforeach 346 <div class="rate__label">Ваша оценка:</div>
331 </ul> 347 <div class="rate__stars">
332 </div> 348 <select name="stars" id="stars" class="star-rating js-stars">
333 @else 349 <option value="5">5</option>
334 <div class="main__resume-profile-info-body-item"> 350 <option value="4">4</option>
335 <h3 class="main__resume-profile-info-body-subtitle">Нету комментариев</h3> 351 <option value="3">3</option>
336 </div> 352 <option value="2">2</option>
337 @endif 353 <option value="1" selected>1</option>
338 </div> 354 </select>
339 </div> 355 </div>
340 356 </div>
341 <div class="main__resume-profile-review"> 357 <input type="hidden" name="worker_id" id="worker_id" value="{{ $Query[0]->id }}"/>
342 <form action="{{ route('stars_answer') }}" method="POST"> 358 <div class="main__resume-profile-review-body">
343 @csrf 359 <h3>Ваш отзыв</h3>
344 <h2 class="main__resume-profile-review-title">Оставить отзыв о работнике</h2> 360 <textarea class="textarea" name="message" id="message" placeholder="Текст отзыва&hellip;" required></textarea>
345 <div class="rate"> 361 <button type="submit" class="button">Оставить отзыв</button>
346 <div class="rate__label">Ваша оценка:</div> 362 </div>
347 <div class="rate__stars"> 363 </form>
348 <select name="stars" id="stars" class="star-rating js-stars"> 364 </div>
349 <option value="5">5</option> 365 </div>
350 <option value="4">4</option> 366 </div>
351 <option value="3">3</option> 367 </main>
352 <option value="2">2</option> 368 </div>
353 <option value="1" selected>1</option> 369 @endsection
354 </select> 370
resources/views/workers/favorite.blade.php
1 @extends('layout.frontend', ['title' => 'Избранные - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Избранные - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 @include('js.favorite-vacancy-45') 4 @include('js.favorite-vacancy-45')
5 @endsection 5 @endsection
6 6
7 @section('content') 7 @section('content')
8 <section class="cabinet"> 8 <section class="cabinet">
9 <div class="container"> 9 <div class="container">
10 <ul class="breadcrumbs cabinet__breadcrumbs"> 10 <ul class="breadcrumbs cabinet__breadcrumbs">
11 <li><a href="{{ route('index') }}">Главная</a></li> 11 <li><a href="{{ route('index') }}">Главная</a></li>
12 <li><b>Личный кабинет</b></li> 12 <li><b>Личный кабинет</b></li>
13 </ul> 13 </ul>
14 <div class="cabinet__wrapper"> 14 <div class="cabinet__wrapper">
15 <div class="cabinet__side"> 15 <div class="cabinet__side">
16 <div class="cabinet__side-toper"> 16 <div class="cabinet__side-toper">
17 @include('workers.emblema') 17 @include('workers.emblema')
18 18
19 </div> 19 </div>
20 @include('workers.menu', ['item' => 3]) 20 @include('workers.menu', ['item' => 3])
21 </div> 21 </div>
22 22
23 <div class="cabinet__body"> 23 <div class="cabinet__body">
24 <div class="cabinet__body-item"> 24 <div class="cabinet__body-item">
25 <h2 class="title cabinet__title">Избранные вакансии</h2> 25 <h2 class="title cabinet__title">Избранные вакансии</h2>
26 </div> 26 </div>
27 <div class="cabinet__body-item"> 27 <div class="cabinet__body-item">
28 <div class="cabinet__filters"> 28 <div class="cabinet__filters">
29 <div class="cabinet__filters-item"> 29 <div class="cabinet__filters-item">
30 <form class="search" action="{{ route('worker.colorado') }}" method="GET"> 30 <form class="search" action="{{ route('worker.colorado') }}" method="GET">
31 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;"> 31 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;">
32 <button type="submit" class="button">Найти</button> 32 <button type="submit" class="button">Найти</button>
33 <span> 33 <span>
34 <svg> 34 <svg>
35 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 35 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
36 </svg> 36 </svg>
37 </span> 37 </span>
38 </form> 38 </form>
39 </div> 39 </div>
40 <!--<div class="cabinet__filters-item"> 40 <!--<div class="cabinet__filters-item">
41 <div class="select"> 41 <div class="select">
42 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 42 <select class="js-select2" id="sort_ajax" name="sort_ajax">
43 <option value="default">Сортировка (по умолчанию)</option> 43 <option value="default">Сортировка (по умолчанию)</option>
44 <option value="name (asc)">По имени (возрастание)</option> 44 <option value="name (asc)">По имени (возрастание)</option>
45 <option value="name (desc)">По имени (убывание)</option> 45 <option value="name (desc)">По имени (убывание)</option>
46 <option value="created_at (asc)">По дате (возрастание)</option> 46 <option value="created_at (asc)">По дате (возрастание)</option>
47 <option value="created_at (desc)">По дате (убывание)</option> 47 <option value="created_at (desc)">По дате (убывание)</option>
48 </select> 48 </select>
49 </div> 49 </div>
50 </div>--> 50 </div>-->
51 </div> 51 </div>
52 @if ($Query->count()) 52 @if ($Query->count())
53 <div class="cabinet__vacs"> 53 <div class="cabinet__vacs">
54 <div id="main_ockar" name="main_ockar" class="cabinet__vacs-body" style="width:100%;"> 54 <div id="main_ockar" name="main_ockar" class="cabinet__vacs-body" style="width:100%;">
55 @foreach ($Query as $Q) 55 @foreach ($Query as $Q)
56 <div class="main__vacancies-item main__employer-page-two-item"> 56 <div class="main__vacancies-item main__employer-page-two-item">
57 <a href="{{ route('list-vacancies') }}" class="back main__employer-page-two-item-back"> 57 <a href="{{ route('list-vacancies') }}" class="back main__employer-page-two-item-back">
58 <svg> 58 <svg>
59 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 59 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
60 </svg> 60 </svg>
61 <span> 61 <span>
62 Вернуться к списку вакансий 62 Вернуться к списку вакансий
63 </span> 63 </span>
64 </a> 64 </a>
65 <div class="main__employer-page-two-item-toper"> 65 <div class="main__employer-page-two-item-toper">
66 @if (!empty($Q->employer->logo)) 66 @if (!empty($Q->employer->logo))
67 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}"> 67 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}">
68 @else 68 @else
69 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Q->employer->name }}" class="main__vacancies-thing-pic"> 69 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Q->employer->name }}" class="main__vacancies-thing-pic">
70 @endif 70 @endif
71 <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span> 71 <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span>
72 </div> 72 </div>
73 <div class="main__employer-page-two-item-text"> 73 <div class="main__employer-page-two-item-text">
74 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор 74 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор
75 специалистов на следующие должности:</div> 75 специалистов на следующие должности:</div>
76 <div class="main__employer-page-two-item-text-links"> 76 <div class="main__employer-page-two-item-text-links">
77 @if (isset($Q->jobs)) 77 @if (isset($Q->jobs))
78 @foreach ($Q->jobs as $key => $j) 78 @foreach ($Q->jobs as $key => $j)
79 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a> 79 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a>
80 @endforeach 80 @endforeach
81 @endif 81 @endif
82 </div> 82 </div>
83 </div> 83 </div>
84 <div class="main__employer-page-two-item-text"> 84 <div class="main__employer-page-two-item-text">
85 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 85 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
86 <div class="main__employer-page-two-item-text-body"> 86 <div class="main__employer-page-two-item-text-body">
87 {!! $Q->text !!} 87 {!! $Q->text !!}
88 </div> 88 </div>
89 </div> 89 </div>
90 <div class="main__employer-page-two-item-text"> 90 <div class="main__employer-page-two-item-text">
91 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div> 91 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div>
92 <div class="main__employer-page-two-item-text-body"> 92 <div class="main__employer-page-two-item-text-body">
93 {!! $Q->description !!} 93 {!! $Q->description !!}
94 </div> 94 </div>
95 </div> 95 </div>
96 <div class="main__employer-page-two-item-text"> 96 <div class="main__employer-page-two-item-text">
97 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div> 97 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div>
98 <div class="main__employer-page-two-item-text-body"> 98 <div class="main__employer-page-two-item-text-body">
99 {!! $Q->contacts_emails !!} 99 {!! $Q->contacts_emails !!}
100 </div> 100 </div>
101 </div> 101 </div>
102 <div class="main__employer-page-two-item-text"> 102 <div class="main__employer-page-two-item-text">
103 <div class="main__employer-page-two-item-text-name">Или звоните:</div> 103 <div class="main__employer-page-two-item-text-name">Или звоните:</div>
104 <div class="main__employer-page-two-item-text-body"> 104 <div class="main__employer-page-two-item-text-body">
105 {!! $Q->contacts_telephones !!} 105 {!! $Q->contacts_telephones !!}
106 </div> 106 </div>
107 </div> 107 </div>
108 <div class="main__employer-page-two-item-tags"> 108 <div class="main__employer-page-two-item-tags">
109 @if (isset($Q->jobs)) 109 @if (isset($Q->jobs))
110 @foreach ($Q->jobs as $key => $j) 110 @foreach ($Q->jobs as $key => $j)
111 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span> 111 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span>
112 @endforeach 112 @endforeach
113 @endif 113 @endif
114 </div> 114 </div>
115 <div class="main__employer-page-two-item-buttons"> 115 <div class="main__employer-page-two-item-buttons">
116 <!--<button type="button" 116 <!--<button type="button"
117 class="button main__employer-page-two-item-button">Откликнуться</button>--> 117 class="button main__employer-page-two-item-button">Откликнуться</button>-->
118 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a> 118 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a>
119 </div> 119 </div>
120 <div class="main__employer-page-two-item-bottom"> 120 <div class="main__employer-page-two-item-bottom">
121 <div class="main__employer-page-two-item-bottom-date">{{ $Q->created_at }}</div> 121 <div class="main__employer-page-two-item-bottom-date">{{ $Q->created_at }}</div>
122 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}?>"> 122 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($Q) }}?>">
123 <svg> 123 <svg>
124 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 124 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
125 </svg> 125 </svg>
126 </button> 126 </button>
127 </div> 127 </div>
128 </div> 128 </div>
129 @endforeach 129 @endforeach
130 <div style="margin-top: 20px"> 130 <div style="margin-top: 20px">
131 {{ $Query->appends($_GET)->links('paginate') }} 131 {{ $Query->appends($_GET)->links('paginate') }}
132 </div> 132 </div>
133 </div> 133 </div>
134 @else 134 @else
135 <div class="notify"> 135 <div class="notify">
136 <svg> 136 <svg>
137 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> 137 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use>
138 </svg> 138 </svg>
139 <span>Нет избранных вакансий</span> 139 <span>Нет избранных вакансий</span>
140 </div> 140 </div>
141 @endif 141 @endif
142 </div> 142 </div>
143 </div> 143 </div>
144 </div> 144 </div>
145 </div> 145 </div>
146 </section> 146 </section>
147 </div> 147 </div>
148 148
149 @endsection 149 @endsection
150 150