Commit 8e4c0bff2192f8436cb0484cb2b4fa4aaa1a9a8a

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

Коммит по срочным задачам

Showing 10 changed files with 78 additions and 43 deletions 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 $company = Employer::with('ads')->with('flots')->with('users') 52 $company = Employer::with('ads')->with('flots')->with('users')
52 ->where('id', '=', $company->id)->get(); 53 ->where('id', '=', $company->id)->get();
53 54
54 $title = $company[0]->name_company; 55 $title = $company[0]->name_company;
55 56
56 $ads = Ad_employer::query()->with('jobs')->with('jobs_code')-> 57 $ads = Ad_employer::query()->with('jobs')->with('jobs_code')->
57 OrderByDesc('id')-> 58 OrderByDesc('id')->
58 where('employer_id', '=', $company[0]->id)->paginate(2); 59 where('employer_id', '=', $company[0]->id)->paginate(2);
59 60
60 return view('info_company_new', compact('company', 'user_id', 'title', 'ads')); 61 return view('info_company_new', compact('company', 'user_id', 'title', 'ads'));
61 } 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 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 249 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
250 where('is_remove', '=', '0')-> 250 where('is_remove', '=', '0')->
251 where('is_bd', '=', '0')->get(); 251 where('is_bd', '=', '0')->get();
252 252
253 $Employer = Employer::query()->with('users')->with('ads')-> 253 $Employer = Employer::query()->with('users')->with('ads')->
254 with('flots')->where('user_id', $id)->first(); 254 with('flots')->where('user_id', $id)->first();
255 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); 255 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs'));
256 } 256 }
257 257
258 // Сохранение-редактирование записи 258 // Сохранение-редактирование записи
259 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { 259 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) {
260 $params = $request->all(); 260 $params = $request->all();
261 $params_job["job_title_id"] = $params['job_title_id']; 261 $params_job["job_title_id"] = $params['job_title_id'];
262 262
263 //$jobs['flot'] = $params['flot']; 263 //$jobs['flot'] = $params['flot'];
264 //$jobs['job_title_id'] = $params['job_title_id']; 264 //$jobs['job_title_id'] = $params['job_title_id'];
265 //$titles['position_id'] = $params['position_id']; 265 //$titles['position_id'] = $params['position_id'];
266 //unset($params['job_title_id']); 266 //unset($params['job_title_id']);
267 267 //dd($params);
268 $ad_employer->update($params); 268 $ad_employer->update($params);
269 $ad_employer->jobs()->sync($request->get('job_title_id')); 269 $ad_employer->jobs()->sync($request->get('job_title_id'));
270 270
271 //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])-> 271 //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])->
272 // where('ad_employer_id', $ad_employer->id)->first(); 272 // where('ad_employer_id', $ad_employer->id)->first();
273 //$data = Ad_jobs::find($job_->id); 273 //$data = Ad_jobs::find($job_->id);
274 //$ad_jobs = $data->update($jobs); 274 //$ad_jobs = $data->update($jobs);
275 275
276 return redirect()->route('employer.vacancy_list'); 276 return redirect()->route('employer.vacancy_list');
277 } 277 }
278 278
279 // Сохранение карточки вакансии 279 // Сохранение карточки вакансии
280 public function vacancy_save(Request $request, Ad_employer $ad_employer) { 280 public function vacancy_save(Request $request, Ad_employer $ad_employer) {
281 $all = $request->all(); 281 $all = $request->all();
282 $ad_employer->update($all); 282 $ad_employer->update($all);
283 return redirect()->route('employer.cabinet_vacancie'); 283 return redirect()->route('employer.cabinet_vacancie');
284 } 284 }
285 285
286 // Удаление карточки вакансии 286 // Удаление карточки вакансии
287 public function vacancy_delete(Ad_employer $ad_employer) { 287 public function vacancy_delete(Ad_employer $ad_employer) {
288 $ad_employer->delete(); 288 $ad_employer->delete();
289 289
290 return redirect()->route('employer.vacancy_list') 290 return redirect()->route('employer.vacancy_list')
291 ->with('success', 'Данные были успешно сохранены'); 291 ->with('success', 'Данные были успешно сохранены');
292 } 292 }
293 293
294 // Обновление даты 294 // Обновление даты
295 public function vacancy_up(Ad_employer $ad_employer) { 295 public function vacancy_up(Ad_employer $ad_employer) {
296 $up = date('m/d/Y h:i:s', time());; 296 $up = date('m/d/Y h:i:s', time());;
297 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 297 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
298 $vac_emp->updated_at = $up; 298 $vac_emp->updated_at = $up;
299 $vac_emp->save(); 299 $vac_emp->save();
300 300
301 return redirect()->route('employer.vacancy_list'); 301 return redirect()->route('employer.vacancy_list');
302 // начало конца 302 // начало конца
303 } 303 }
304 304
305 //Видимость вакансии 305 //Видимость вакансии
306 public function vacancy_eye(Ad_employer $ad_employer, $status) { 306 public function vacancy_eye(Ad_employer $ad_employer, $status) {
307 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 307 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
308 $vac_emp->active_is = $status; 308 $vac_emp->active_is = $status;
309 $vac_emp->save(); 309 $vac_emp->save();
310 310
311 return redirect()->route('employer.vacancy_list'); 311 return redirect()->route('employer.vacancy_list');
312 } 312 }
313 313
314 //Вакансия редактирования (шаблон) 314 //Вакансия редактирования (шаблон)
315 public function vacancy_update(Ad_employer $id) { 315 public function vacancy_update(Ad_employer $id) {
316 316
317 } 317 }
318 318
319 //Отклики на вакансию - лист 319 //Отклики на вакансию - лист
320 public function answers(Employer $employer, Request $request) { 320 public function answers(Employer $employer, Request $request) {
321 $user_id = Auth()->user()->id; 321 $user_id = Auth()->user()->id;
322 $answer = Ad_employer::query()->where('employer_id', $employer->id); 322 $answer = Ad_employer::query()->where('employer_id', $employer->id);
323 if ($request->has('search')) { 323 if ($request->has('search')) {
324 $search = trim($request->get('search')); 324 $search = trim($request->get('search'));
325 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); 325 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%");
326 } 326 }
327 327
328 $answer = $answer->with('response')->OrderByDESC('id')->get(); 328 $answer = $answer->with('response')->OrderByDESC('id')->get();
329 329
330 return view('employers.list_answer', compact('answer', 'user_id', 'employer')); 330 return view('employers.list_answer', compact('answer', 'user_id', 'employer'));
331 } 331 }
332 332
333 //Обновление статуса 333 //Обновление статуса
334 public function supple_status(employer $employer, ad_response $ad_response, $flag) { 334 public function supple_status(employer $employer, ad_response $ad_response, $flag) {
335 $ad_response->update(Array('flag' => $flag)); 335 $ad_response->update(Array('flag' => $flag));
336 return redirect()->route('employer.answers', ['employer' => $employer->id]); 336 return redirect()->route('employer.answers', ['employer' => $employer->id]);
337 } 337 }
338 338
339 //Страницы сообщений список 339 //Страницы сообщений список
340 public function messages($type_message) { 340 public function messages($type_message) {
341 $user_id = Auth()->user()->id; 341 $user_id = Auth()->user()->id;
342 342
343 $messages_input = Message::query()->with('vacancies')->with('user_from')-> 343 $messages_input = Message::query()->with('vacancies')->with('user_from')->
344 Where('to_user_id', $user_id)->OrderByDesc('created_at'); 344 Where('to_user_id', $user_id)->OrderByDesc('created_at');
345 345
346 $messages_output = Message::query()->with('vacancies')-> 346 $messages_output = Message::query()->with('vacancies')->
347 with('user_to')->where('user_id', $user_id)-> 347 with('user_to')->where('user_id', $user_id)->
348 OrderByDesc('created_at'); 348 OrderByDesc('created_at');
349 349
350 $count_input = $messages_input->count(); 350 $count_input = $messages_input->count();
351 $count_output = $messages_output->count(); 351 $count_output = $messages_output->count();
352 352
353 if ($type_message == 'input') { 353 if ($type_message == 'input') {
354 $messages = $messages_input->paginate(5); 354 $messages = $messages_input->paginate(5);
355 } 355 }
356 356
357 if ($type_message == 'output') { 357 if ($type_message == 'output') {
358 $messages = $messages_output->paginate(5); 358 $messages = $messages_output->paginate(5);
359 } 359 }
360 360
361 //dd($user_id, $messages[2]->vacancies); 361 //dd($user_id, $messages[2]->vacancies);
362 //jobs); 362 //jobs);
363 363
364 return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); 364 return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id'));
365 } 365 }
366 366
367 // Диалог между пользователями 367 // Диалог между пользователями
368 public function dialog(Request $request, User_Model $user1, User_Model $user2) { 368 public function dialog(Request $request, User_Model $user1, User_Model $user2) {
369 // Получение параметров. 369 // Получение параметров.
370 if ($request->has('ad_employer')){ 370 if ($request->has('ad_employer')){
371 $ad_employer = $request->get('ad_employer'); 371 $ad_employer = $request->get('ad_employer');
372 } else { 372 } else {
373 $ad_employer = 0; 373 $ad_employer = 0;
374 } 374 }
375 375
376 if (isset($user2->id)) { 376 if (isset($user2->id)) {
377 $companion = User_Model::query()->with('workers')-> 377 $companion = User_Model::query()->with('workers')->
378 with('employers')-> 378 with('employers')->
379 where('id', $user2->id)->first(); 379 where('id', $user2->id)->first();
380 } 380 }
381 381
382 $Messages = Message::query()-> 382 $Messages = Message::query()->
383 where('ad_employer_id', '=', $ad_employer)-> 383 where('ad_employer_id', '=', $ad_employer)->
384 where(function($query) use ($user1, $user2) { 384 where(function($query) use ($user1, $user2) {
385 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); 385 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id);
386 })->orWhere(function($query) use ($user1, $user2) { 386 })->orWhere(function($query) use ($user1, $user2) {
387 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); 387 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id);
388 })->where('ad_employer_id', '=', $ad_employer)->OrderBy('created_at')->get(); 388 })->where('ad_employer_id', '=', $ad_employer)->OrderBy('created_at')->get();
389 389
390 $id_vac = $Messages[$Messages->count() - 1]->ad_employer_id; 390 $id_vac = $Messages[$Messages->count() - 1]->ad_employer_id;
391 391
392 //$ad_employer = null; 392 //$ad_employer = null;
393 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); 393 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first();
394 $sender = $user1; 394 $sender = $user1;
395 395
396 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages')); 396 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages'));
397 } 397 }
398 398
399 // Регистрация работодателя 399 // Регистрация работодателя
400 public function register_employer(Request $request) { 400 public function register_employer(Request $request) {
401 $params = $request->all(); 401 $params = $request->all();
402 402
403 $rules = [ 403 $rules = [
404 //'surname' => ['required', 'string', 'max:255'], 404 //'surname' => ['required', 'string', 'max:255'],
405 //'name_man' => ['required', 'string', 'max:255'], 405 //'name_man' => ['required', 'string', 'max:255'],
406 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 406 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
407 'name_company' => ['required', 'string', 'max:255'], 407 'name_company' => ['required', 'string', 'max:255'],
408 'password' => ['required', 'string', 'min:6'], 408 'password' => ['required', 'string', 'min:6'],
409 ]; 409 ];
410 410
411 411
412 $messages = [ 412 $messages = [
413 'required' => 'Укажите обязательное поле', 413 'required' => 'Укажите обязательное поле',
414 'min' => [ 414 'min' => [
415 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 415 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
416 'integer' => 'Поле «:attribute» должно быть :min или больше', 416 'integer' => 'Поле «:attribute» должно быть :min или больше',
417 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 417 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
418 ], 418 ],
419 'max' => [ 419 'max' => [
420 'string' => 'Поле «:attribute» должно быть не больше :max символов', 420 'string' => 'Поле «:attribute» должно быть не больше :max символов',
421 'integer' => 'Поле «:attribute» должно быть :max или меньше', 421 'integer' => 'Поле «:attribute» должно быть :max или меньше',
422 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 422 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
423 ] 423 ]
424 ]; 424 ];
425 425
426 $email = $request->get('email'); 426 $email = $request->get('email');
427 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { 427 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) {
428 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); 428 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл"));
429 } 429 }
430 430
431 if ($request->get('password') !== $request->get('confirmed')){ 431 if ($request->get('password') !== $request->get('confirmed')){
432 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 432 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
433 } 433 }
434 434
435 if (strlen($request->get('password')) < 6) { 435 if (strlen($request->get('password')) < 6) {
436 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); 436 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
437 } 437 }
438 /* 438 /*
439 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); 439 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?');
440 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 440 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z',
441 'X', 'C', 'V', 'B', 'N', 'M'); 441 'X', 'C', 'V', 'B', 'N', 'M');
442 $spec_bool = false; 442 $spec_bool = false;
443 $alpha_bool = false; 443 $alpha_bool = false;
444 444
445 $haystack = $request->get('password'); 445 $haystack = $request->get('password');
446 446
447 foreach ($specsumbol as $it) { 447 foreach ($specsumbol as $it) {
448 if (strpos($haystack, $it) !== false) { 448 if (strpos($haystack, $it) !== false) {
449 $spec_bool = true; 449 $spec_bool = true;
450 } 450 }
451 } 451 }
452 452
453 foreach ($alpha as $it) { 453 foreach ($alpha as $it) {
454 if (strpos($haystack, $it) !== false) { 454 if (strpos($haystack, $it) !== false) {
455 $alpha_bool = true; 455 $alpha_bool = true;
456 } 456 }
457 } 457 }
458 458
459 if ((!$spec_bool) || (!$alpha_bool)) { 459 if ((!$spec_bool) || (!$alpha_bool)) {
460 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); 460 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?"));
461 }*/ 461 }*/
462 462
463 if (empty($request->get('surname'))) { 463 if (empty($request->get('surname'))) {
464 $params['surname'] = 'Неизвестно'; 464 $params['surname'] = 'Неизвестно';
465 } 465 }
466 if (empty($request->get('name_man'))) { 466 if (empty($request->get('name_man'))) {
467 $params['name_man'] = 'Неизвестно'; 467 $params['name_man'] = 'Неизвестно';
468 } 468 }
469 $validator = Validator::make($params, $rules, $messages); 469 $validator = Validator::make($params, $rules, $messages);
470 470
471 if ($validator->fails()) { 471 if ($validator->fails()) {
472 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 472 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
473 } else { 473 } else {
474 $user = $this->create($params); 474 $user = $this->create($params);
475 event(new Registered($user)); 475 event(new Registered($user));
476 Auth::guard()->login($user); 476 Auth::guard()->login($user);
477 } 477 }
478 478
479 if ($user) { 479 if ($user) {
480 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; 480 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));;
481 } else { 481 } else {
482 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 482 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
483 } 483 }
484 } 484 }
485 485
486 // Создание пользователя 486 // Создание пользователя
487 protected function create(array $data) 487 protected function create(array $data)
488 { 488 {
489 $Use = new User_Model(); 489 $Use = new User_Model();
490 $Code_user = $Use->create([ 490 $Code_user = $Use->create([
491 'name' => $data['surname']." ".$data['name_man'], 491 'name' => $data['surname']." ".$data['name_man'],
492 'name_man' => $data['name_man'], 492 'name_man' => $data['name_man'],
493 'surname' => $data['surname'], 493 'surname' => $data['surname'],
494 'surname2' => $data['surname2'], 494 'surname2' => $data['surname2'],
495 'subscribe_email' => $data['email'], 495 'subscribe_email' => $data['email'],
496 'email' => $data['email'], 496 'email' => $data['email'],
497 'telephone' => $data['telephone'], 497 'telephone' => $data['telephone'],
498 'is_worker' => 0, 498 'is_worker' => 0,
499 'password' => Hash::make($data['password']), 499 'password' => Hash::make($data['password']),
500 'pubpassword' => base64_encode($data['password']), 500 'pubpassword' => base64_encode($data['password']),
501 'email_verified_at' => Carbon::now() 501 'email_verified_at' => Carbon::now()
502 ]); 502 ]);
503 503
504 if ($Code_user->id > 0) { 504 if ($Code_user->id > 0) {
505 $Employer = new Employer(); 505 $Employer = new Employer();
506 $Employer->user_id = $Code_user->id; 506 $Employer->user_id = $Code_user->id;
507 $Employer->name_company = $data['name_company']; 507 $Employer->name_company = $data['name_company'];
508 $Employer->email = $data['email']; 508 $Employer->email = $data['email'];
509 $Employer->telephone = $data['telephone']; 509 $Employer->telephone = $data['telephone'];
510 $Employer->code = Tools::generator_id(10); 510 $Employer->code = Tools::generator_id(10);
511 $Employer->save(); 511 $Employer->save();
512 512
513 return $Code_user; 513 return $Code_user;
514 } 514 }
515 } 515 }
516 516
517 // Отправка сообщения от работодателя 517 // Отправка сообщения от работодателя
518 public function send_message(MessagesRequiest $request) { 518 public function send_message(MessagesRequiest $request) {
519 $params = $request->all(); 519 $params = $request->all();
520 dd($params); 520 dd($params);
521 $user1 = $params['user_id']; 521 $user1 = $params['user_id'];
522 $user2 = $params['to_user_id']; 522 $user2 = $params['to_user_id'];
523 523
524 if ($request->has('file')) { 524 if ($request->has('file')) {
525 $params['file'] = $request->file('file')->store("messages", 'public'); 525 $params['file'] = $request->file('file')->store("messages", 'public');
526 } 526 }
527 Message::create($params); 527 Message::create($params);
528 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 528 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
529 } 529 }
530 530
531 public function test123(Request $request) { 531 public function test123(Request $request) {
532 $params = $request->all(); 532 $params = $request->all();
533 $user1 = $params['user_id']; 533 $user1 = $params['user_id'];
534 $user2 = $params['to_user_id']; 534 $user2 = $params['to_user_id'];
535 $id_vacancy = $params['ad_employer_id']; 535 $id_vacancy = $params['ad_employer_id'];
536 $ad_name = $params['ad_name']; 536 $ad_name = $params['ad_name'];
537 537
538 $rules = [ 538 $rules = [
539 'text' => 'required|min:1|max:150000', 539 'text' => 'required|min:1|max:150000',
540 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' 540 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000'
541 ]; 541 ];
542 $messages = [ 542 $messages = [
543 'required' => 'Укажите обязательное поле', 543 'required' => 'Укажите обязательное поле',
544 'min' => [ 544 'min' => [
545 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 545 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
546 'integer' => 'Поле «:attribute» должно быть :min или больше', 546 'integer' => 'Поле «:attribute» должно быть :min или больше',
547 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 547 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
548 ], 548 ],
549 'max' => [ 549 'max' => [
550 'string' => 'Поле «:attribute» должно быть не больше :max символов', 550 'string' => 'Поле «:attribute» должно быть не больше :max символов',
551 'integer' => 'Поле «:attribute» должно быть :max или меньше', 551 'integer' => 'Поле «:attribute» должно быть :max или меньше',
552 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 552 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
553 ] 553 ]
554 ]; 554 ];
555 555
556 $validator = Validator::make($request->all(), $rules, $messages); 556 $validator = Validator::make($request->all(), $rules, $messages);
557 557
558 if ($validator->fails()) { 558 if ($validator->fails()) {
559 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) 559 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2])
560 ->withErrors($validator); 560 ->withErrors($validator);
561 } else { 561 } else {
562 if ($request->has('file')) { 562 if ($request->has('file')) {
563 $params['file'] = $request->file('file')->store("messages", 'public'); 563 $params['file'] = $request->file('file')->store("messages", 'public');
564 } 564 }
565 Message::create($params); 565 Message::create($params);
566 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 566 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
567 return redirect()->route('employer.dialog', 567 return redirect()->route('employer.dialog',
568 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]); 568 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]);
569 569
570 } 570 }
571 } 571 }
572 572
573 //Избранные люди 573 //Избранные люди
574 public function favorites(Request $request) { 574 public function favorites(Request $request) {
575 $IP_address = RusDate::ip_addr_client(); 575 $IP_address = RusDate::ip_addr_client();
576 $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); 576 $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get();
577 577
578 if ($Arr->count()) { 578 if ($Arr->count()) {
579 $A = Array(); 579 $A = Array();
580 foreach ($Arr as $it) { 580 foreach ($Arr as $it) {
581 $A[] = $it->code_record; 581 $A[] = $it->code_record;
582 } 582 }
583 583
584 $Workers = Worker::query()->whereIn('id', $A); 584 $Workers = Worker::query()->whereIn('id', $A);
585 } else { 585 } else {
586 $Workers = Worker::query()->where('id', '=', '0'); 586 $Workers = Worker::query()->where('id', '=', '0');
587 } 587 }
588 588
589 if (($request->has('search')) && (!empty($request->get('search')))) { 589 if (($request->has('search')) && (!empty($request->get('search')))) {
590 $search = $request->get('search'); 590 $search = $request->get('search');
591 591
592 $Workers = $Workers->WhereHas('users', 592 $Workers = $Workers->WhereHas('users',
593 function (Builder $query) use ($search) { 593 function (Builder $query) use ($search) {
594 $query->Where('surname', 'LIKE', "%$search%") 594 $query->Where('surname', 'LIKE', "%$search%")
595 ->orWhere('name_man', 'LIKE', "%$search%") 595 ->orWhere('name_man', 'LIKE', "%$search%")
596 ->orWhere('surname2', 'LIKE', "%$search%"); 596 ->orWhere('surname2', 'LIKE', "%$search%");
597 }); 597 });
598 } else { 598 } else {
599 $Workers = $Workers->with('users'); 599 $Workers = $Workers->with('users');
600 } 600 }
601 601
602 $Workers = $Workers->get(); 602 $Workers = $Workers->get();
603 603
604 604
605 return view('employers.favorite', compact('Workers')); 605 return view('employers.favorite', compact('Workers'));
606 } 606 }
607 607
608 // База данных 608 // База данных
609 public function bd(Request $request) { 609 public function bd(Request $request) {
610 // для типа BelongsTo 610 // для типа BelongsTo
611 //$documents = Document::query()->orderBy(Location::select('name') 611 //$documents = Document::query()->orderBy(Location::select('name')
612 // ->whereColumn('locations.id', 'documents.location_id') 612 // ->whereColumn('locations.id', 'documents.location_id')
613 //); 613 //);
614 614
615 // для типа HasOne/Many 615 // для типа HasOne/Many
616 // $documents = Document::::query()->orderBy(Location::select('name') 616 // $documents = Document::::query()->orderBy(Location::select('name')
617 // ->whereColumn('locations.document_id', 'documents.id') 617 // ->whereColumn('locations.document_id', 'documents.id')
618 //); 618 //);
619 619
620 620
621 $users = User_Model::query()->with('workers'); 621 $users = User_Model::query()->with('workers');
622 622
623 if ($request->has('search')) { 623 if ($request->has('search')) {
624 $find_key = $request->get('search'); 624 $find_key = $request->get('search');
625 $users = $users->where('name', 'LIKE', "%$find_key%") 625 $users = $users->where('name', 'LIKE', "%$find_key%")
626 ->orWhere('surname', 'LIKE', "%$find_key%") 626 ->orWhere('surname', 'LIKE', "%$find_key%")
627 ->orWhere('name_man', 'LIKE', "%$find_key%") 627 ->orWhere('name_man', 'LIKE', "%$find_key%")
628 ->orWhere('email', 'LIKE', "%$find_key%") 628 ->orWhere('email', 'LIKE', "%$find_key%")
629 ->orWhere('telephone', 'LIKE', "%$find_key%"); 629 ->orWhere('telephone', 'LIKE', "%$find_key%");
630 } 630 }
631 631
632 // Данные 632 // Данные
633 $users = $users->Baseuser()-> 633 $users = $users->Baseuser()->
634 orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id')); 634 orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id'));
635 $count_users = $users; 635 $count_users = $users;
636 $users = $users->paginate(5); 636 $users = $users->paginate(5);
637 637
638 638
639 return view('employers.bd', compact('users', 'count_users')); 639 return view('employers.bd', compact('users', 'count_users'));
640 } 640 }
641 641
642 //Настройка уведомлений 642 //Настройка уведомлений
643 public function subscribe() { 643 public function subscribe() {
644 return view('employers.subcribe'); 644 return view('employers.subcribe');
645 } 645 }
646 646
647 //Установка уведомлений сохранение 647 //Установка уведомлений сохранение
648 public function save_subscribe(Request $request) { 648 public function save_subscribe(Request $request) {
649 dd($request->all()); 649 dd($request->all());
650 $msg = $request->validate([ 650 $msg = $request->validate([
651 'subscribe_email' => 'required|email|min:5|max:255', 651 'subscribe_email' => 'required|email|min:5|max:255',
652 ]); 652 ]);
653 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); 653 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку');
654 } 654 }
655 655
656 //Сбросить форму с паролем 656 //Сбросить форму с паролем
657 public function password_reset() { 657 public function password_reset() {
658 $email = Auth()->user()->email; 658 $email = Auth()->user()->email;
659 return view('employers.password-reset', compact('email')); 659 return view('employers.password-reset', compact('email'));
660 } 660 }
661 661
662 //Обновление пароля 662 //Обновление пароля
663 public function new_password(Request $request) { 663 public function new_password(Request $request) {
664 $use = Auth()->user(); 664 $use = Auth()->user();
665 $request->validate([ 665 $request->validate([
666 'password' => 'required|string', 666 'password' => 'required|string',
667 'new_password' => 'required|string', 667 'new_password' => 'required|string',
668 'new_password2' => 'required|string' 668 'new_password2' => 'required|string'
669 ]); 669 ]);
670 670
671 if ($request->get('new_password') == $request->get('new_password2')) 671 if ($request->get('new_password') == $request->get('new_password2'))
672 if ($request->get('password') !== $request->get('new_password')) { 672 if ($request->get('password') !== $request->get('new_password')) {
673 $credentials = $request->only('email', 'password'); 673 $credentials = $request->only('email', 'password');
674 if (Auth::attempt($credentials)) { 674 if (Auth::attempt($credentials)) {
675 675
676 if (!is_null($use->email_verified_at)){ 676 if (!is_null($use->email_verified_at)){
677 677
678 $user_data = User_Model::find($use->id); 678 $user_data = User_Model::find($use->id);
679 $user_data->update([ 679 $user_data->update([
680 'password' => Hash::make($request->get('new_password')), 680 'password' => Hash::make($request->get('new_password')),
681 'pubpassword' => base64_encode($request->get('new_password')), 681 'pubpassword' => base64_encode($request->get('new_password')),
682 ]); 682 ]);
683 return redirect() 683 return redirect()
684 ->route('employer.password_reset') 684 ->route('employer.password_reset')
685 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 685 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
686 } 686 }
687 687
688 return redirect() 688 return redirect()
689 ->route('employer.password_reset') 689 ->route('employer.password_reset')
690 ->withError('Данная учетная запись не было верифицированна!'); 690 ->withError('Данная учетная запись не было верифицированна!');
691 } 691 }
692 } 692 }
693 693
694 return redirect() 694 return redirect()
695 ->route('employer.password_reset') 695 ->route('employer.password_reset')
696 ->withErrors('Не совпадение данных, обновите пароли!'); 696 ->withErrors('Не совпадение данных, обновите пароли!');
697 } 697 }
698 698
699 699
700 700
701 // Форма Удаление пипла 701 // Форма Удаление пипла
702 public function delete_people() { 702 public function delete_people() {
703 $login = Auth()->user()->email; 703 $login = Auth()->user()->email;
704 return view('employers.delete_people', compact('login')); 704 return view('employers.delete_people', compact('login'));
705 } 705 }
706 706
707 // Удаление аккаунта 707 // Удаление аккаунта
708 public function action_delete_user(Request $request) { 708 public function action_delete_user(Request $request) {
709 $Answer = $request->all(); 709 $Answer = $request->all();
710 $user_id = Auth()->user()->id; 710 $user_id = Auth()->user()->id;
711 $request->validate([ 711 $request->validate([
712 'password' => 'required|string', 712 'password' => 'required|string',
713 ]); 713 ]);
714 714
715 $credentials = $request->only('email', 'password'); 715 $credentials = $request->only('email', 'password');
716 if (Auth::attempt($credentials)) { 716 if (Auth::attempt($credentials)) {
717 Auth::logout(); 717 Auth::logout();
718 $it = User_Model::find($user_id); 718 $it = User_Model::find($user_id);
719 $it->delete(); 719 $it->delete();
720 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 720 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
721 } else { 721 } else {
722 return redirect()->route('employer.delete_people') 722 return redirect()->route('employer.delete_people')
723 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 723 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
724 } 724 }
725 } 725 }
726 726
727 public function ajax_delete_user(Request $request) { 727 public function ajax_delete_user(Request $request) {
728 $Answer = $request->all(); 728 $Answer = $request->all();
729 $user_id = Auth()->user()->id; 729 $user_id = Auth()->user()->id;
730 $request->validate([ 730 $request->validate([
731 'password' => 'required|string', 731 'password' => 'required|string',
732 ]); 732 ]);
733 $credentials = $request->only('email', 'password'); 733 $credentials = $request->only('email', 'password');
734 if (Auth::attempt($credentials)) { 734 if (Auth::attempt($credentials)) {
735 735
736 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', 736 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт',
737 'email' => $request->get('email'), 737 'email' => $request->get('email'),
738 'password' => $request->get('password'))); 738 'password' => $request->get('password')));
739 } else { 739 } else {
740 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); 740 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль'));
741 } 741 }
742 } 742 }
743 743
744 // FAQ - Вопросы/ответы для работодателей и соискателей 744 // FAQ - Вопросы/ответы для работодателей и соискателей
745 public function faq() { 745 public function faq() {
746 return view('employers.faq'); 746 return view('employers.faq');
747 } 747 }
748 748
749 // Рассылка сообщений 749 // Рассылка сообщений
750 public function send_all_messages() { 750 public function send_all_messages() {
751 $id = Auth()->user()->id; 751 $id = Auth()->user()->id;
752 $sending = Employer::query()->where('user_id', '=', "$id")->first(); 752 $sending = Employer::query()->where('user_id', '=', "$id")->first();
753 if ($sending->sending_is) 753 if ($sending->sending_is)
754 return view('employers.send_all'); 754 return view('employers.send_all');
755 else 755 else
756 return view('employers.send_all_danger'); 756 return view('employers.send_all_danger');
757 } 757 }
758 758
759 // Отправка сообщений для информации 759 // Отправка сообщений для информации
760 public function send_all_post(Request $request) { 760 public function send_all_post(Request $request) {
761 $data = $request->all(); 761 $data = $request->all();
762 762
763 $emails = User_Model::query()->where('is_worker', '1')->get(); 763 $emails = User_Model::query()->where('is_worker', '1')->get();
764 764
765 foreach ($emails as $e) { 765 foreach ($emails as $e) {
766 Mail::to($e->email)->send(new SendAllMessages($data)); 766 Mail::to($e->email)->send(new SendAllMessages($data));
767 } 767 }
768 768
769 return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); 769 return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены');
770 } 770 }
771 771
772 // База резюме 772 // База резюме
773 public function bd_tupe(Request $request) { 773 public function bd_tupe(Request $request) {
774 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); 774 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get();
775 775
776 return view('employers.bd_tupe', compact('Resume')); 776 return view('employers.bd_tupe', compact('Resume'));
777 } 777 }
778 778
779 ////////////////////////////////////////////////////////////////// 779 //////////////////////////////////////////////////////////////////
780 // Отправил сообщение 780 // Отправил сообщение
781 ////////////////////////////////////////////////////////////////// 781 //////////////////////////////////////////////////////////////////
782 public function new_message(Request $request) { 782 public function new_message(Request $request) {
783 $params = $request->all(); 783 $params = $request->all();
784 $id = $params['_user_id']; 784 $id = $params['_user_id'];
785 $message = new Message(); 785 $message = new Message();
786 $message->user_id = $params['_user_id']; 786 $message->user_id = $params['_user_id'];
787 $message->to_user_id = $params['_to_user_id']; 787 $message->to_user_id = $params['_to_user_id'];
788 $message->title = $params['title']; 788 $message->title = $params['title'];
789 $message->text = $params['text']; 789 $message->text = $params['text'];
790 if ($request->has('_file')) { 790 if ($request->has('_file')) {
791 $message->file = $request->file('_file')->store("worker/$id", 'public'); 791 $message->file = $request->file('_file')->store("worker/$id", 'public');
792 } 792 }
793 $message->ad_employer_id = $params['_vacancy']; 793 $message->ad_employer_id = $params['_vacancy'];
794 $message->flag_new = 1; 794 $message->flag_new = 1;
795 $id_message = $message->save(); 795 $id_message = $message->save();
796 796
797 //$data['message_id'] = $id_message; 797 //$data['message_id'] = $id_message;
798 //$data['ad_employer_id'] = $params['_vacancy']; 798 //$data['ad_employer_id'] = $params['_vacancy'];
799 //$data['job_title_id'] = 0; 799 //$data['job_title_id'] = 0;
800 800
801 $data['flag'] = 1; 801 $data['flag'] = 1;
802 //$ad_responce = ad_response::create($data); 802 //$ad_responce = ad_response::create($data);
803 return redirect()->route('employer.messages', ['type_message' => 'output']); 803 return redirect()->route('employer.messages', ['type_message' => 'output']);
804 } 804 }
805 805
806 // Восстановление пароля 806 // Восстановление пароля
807 public function repair_password(Request $request) { 807 public function repair_password(Request $request) {
808 $params = $request->get('email'); 808 $params = $request->get('email');
809 } 809 }
810 810
811 // Избранные люди на корабль 811 // Избранные люди на корабль
812 public function selected_people(Request $request) { 812 public function selected_people(Request $request) {
813 $id = $request->get('id'); 813 $id = $request->get('id');
814 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 814 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
815 where('is_remove', '=', '0')-> 815 where('is_remove', '=', '0')->
816 where('is_bd', '=', '0')-> 816 where('is_bd', '=', '0')->
817 where('position_id', $id)-> 817 where('position_id', $id)->
818 get(); 818 get();
819 return view('favorite_people', compact('favorite_people')); 819 return view('favorite_people', compact('favorite_people'));
820 } 820 }
821 } 821 }
822 822
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')->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 /*$BigFlot = Array(); 172 /*$BigFlot = Array();
173 foreach ($Position as $position) { 173 foreach ($Position as $position) {
174 $War_flot = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')-> 174 $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 orderBy('job_titles.sort')-> 175 orderBy('job_titles.sort')->
176 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 176 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
177 where('position_ship', "$position->name"); 177 where('position_ship', "$position->name");
178 if (($request->has('job')) && ($request->get('job') > 0)) { 178 if (($request->has('job')) && ($request->get('job') > 0)) {
179 $War_flot = $War_flot->where('job_title_id', $request->get('job')); 179 $War_flot = $War_flot->where('job_title_id', $request->get('job'));
180 } 180 }
181 $War_flot = $War_flot->groupby('job_title_id','position_ship')->get(); 181 $War_flot = $War_flot->groupby('job_title_id','position_ship')->get();
182 $BigFlot[] = $War_flot; 182 $BigFlot[] = $War_flot;
183 }*/ 183 }*/
184 /* 184 /*
185 $BigFlot = Array(); 185 $BigFlot = Array();
186 foreach ($Position as $position) { 186 foreach ($Position as $position) {
187 $WarFlot = DB::table('ad_jobs')-> 187 $WarFlot = DB::table('ad_jobs')->
188 selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')-> 188 selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')->
189 orderByDesc('job_titles.sort')-> 189 orderByDesc('job_titles.sort')->
190 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 190 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
191 where('job_titles.position_id', $position->id); 191 where('job_titles.position_id', $position->id);
192 if (($request->has('job')) && ($request->get('job') > 0)) { 192 if (($request->has('job')) && ($request->get('job') > 0)) {
193 $WarFlot = $WarFlot->where('job_title_id', $request->get('job')); 193 $WarFlot = $WarFlot->where('job_title_id', $request->get('job'));
194 } 194 }
195 $WarFlot = $WarFlot->groupby('job_title_id')->get(); 195 $WarFlot = $WarFlot->groupby('job_title_id')->get();
196 $BigFlot[] = $WarFlot; 196 $BigFlot[] = $WarFlot;
197 } 197 }
198 */ 198 */
199 199
200 $Data = DB::table('job_titles')-> 200 $Data = DB::table('job_titles')->
201 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')-> 201 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 where('categories.is_remove', '=', '0')-> 202 where('categories.is_remove', '=', '0')->
203 where('job_titles.is_bd', '=' , '0')-> 203 where('job_titles.is_bd', '=' , '0')->
204 where('job_titles.is_remove', '=', '0'); 204 where('job_titles.is_remove', '=', '0');
205 if (($request->has('job')) && ($request->get('job') > 0)) { 205 if (($request->has('job')) && ($request->get('job') > 0)) {
206 $Data = $Data->where('job_title_id', $request->get('job')); 206 $Data = $Data->where('job_title_id', $request->get('job'));
207 } 207 }
208 $Data = $Data->leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')-> 208 $Data = $Data->leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')->
209 join('categories', 'categories.id', '=', 'job_titles.position_id')-> 209 join('categories', 'categories.id', '=', 'job_titles.position_id')->
210 groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')-> 210 groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')->
211 orderByDesc('job_titles.sort')->get()->toArray(); 211 orderByDesc('job_titles.sort')->get()->toArray();
212 212
213 $Main_Job = array(); 213 $Main_Job = array();
214 $name_cat = ''; 214 $name_cat = '';
215 foreach ($Data as $it) { 215 foreach ($Data as $it) {
216 $it_arr = (array)$it; 216 $it_arr = (array)$it;
217 if ($name_cat != $it_arr['catname']) 217 if ($name_cat != $it_arr['catname'])
218 $name_cat = $it_arr['catname']; 218 $name_cat = $it_arr['catname'];
219 $Main_Job[$name_cat][] = $it_arr; 219 $Main_Job[$name_cat][] = $it_arr;
220 } 220 }
221 221
222 if ($request->ajax()) { 222 if ($request->ajax()) {
223 return view('ajax.new_sky', compact('categories', 'Main_Job')); 223 return view('ajax.new_sky', compact('categories', 'Main_Job'));
224 } else { 224 } else {
225 return view('new_sky', compact('Job_title', 'categories', 'Main_Job')); 225 return view('new_sky', compact('Job_title', 'categories', 'Main_Job'));
226 } 226 }
227 } 227 }
228 228
229 //Вакансии категория детальная 229 //Вакансии категория детальная
230 public function list_vacancies(Category $categories, Request $request) { 230 public function list_vacancies(Category $categories, Request $request) {
231 if (isset(Auth()->user()->id)) 231 if (isset(Auth()->user()->id))
232 $uid = Auth()->user()->id; 232 $uid = Auth()->user()->id;
233 else 233 else
234 $uid = 0; 234 $uid = 0;
235 235
236 if ($request->get('job') == 0) 236 if ($request->get('job') == 0)
237 $job_search = ''; 237 $job_search = '';
238 else 238 else
239 $job_search = $request->get('job'); 239 $job_search = $request->get('job');
240 240
241 $Query = Ad_employer::with('jobs')-> 241 $Query = Ad_employer::with('jobs')->
242 with('cat')-> 242 with('cat')->
243 with('employer')-> 243 with('employer')->
244
245 whereHas('jobs_code', function ($query) use ($job_search) { 244 whereHas('jobs_code', function ($query) use ($job_search) {
246 if (!empty($job_search)) { 245 if (!empty($job_search)) {
247 $query->where('job_title_id', $job_search); 246 $query->where('job_title_id', $job_search);
248 } 247 }
249 })->select('ad_employers.*'); 248 })->select('ad_employers.*');
250 249
251 if (isset($categories->id) && ($categories->id > 0)) { 250 if (isset($categories->id) && ($categories->id > 0)) {
252 $Query = $Query->where('category_id', '=', $categories->id); 251 $Query = $Query->where('category_id', '=', $categories->id);
253 $Name_categori = Category::query()->where('id', '=', $categories->id)->get(); 252 $Name_categori = Category::query()->where('id', '=', $categories->id)->get();
254 } else { 253 } else {
255 $Name_categori = ''; 254 $Name_categori = '';
256 } 255 }
257 256
258 if ($request->get('sort')) { 257 if ($request->get('sort')) {
259 $sort = $request->get('sort'); 258 $sort = $request->get('sort');
260 switch ($sort) { 259 switch ($sort) {
261 case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break; 260 case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break;
262 case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break; 261 case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break;
263 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; 262 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
264 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; 263 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
265 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; 264 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
266 default: $Query = $Query->orderbyDesc('updated_at')->orderBy('id'); break; 265 default: $Query = $Query->orderbyDesc('updated_at')->orderBy('id'); break;
267 } 266 }
268 } 267 }
269 268
270 $Job_title = Job_title::query()->where('is_bd', '=', '0')->OrderBy('name')->get(); 269 $Job_title = Job_title::query()->where('is_bd', '=', '0')->OrderBy('name')->get();
271 270
272 $Query_count = $Query->count(); 271 $Query_count = $Query->count();
273 272
274 $Query = $Query->OrderByDesc('updated_at')->paginate(3); 273 $Query = $Query->OrderByDesc('updated_at')->paginate(3);
275 274
276 $Reclama = reclame::query()->get(); 275 $Reclama = reclame::query()->get();
277 276
278 if ($request->ajax()) { 277 if ($request->ajax()) {
279 if ($request->has('title')) { 278 if ($request->has('title')) {
280 return view('ajax.list_category', compact( 279 return view('ajax.list_category', compact(
281 'Name_categori' 280 'Name_categori'
282 )); 281 ));
283 } else { 282 } else {
284 return view('ajax.list_vacancies', compact('Query', 283 return view('ajax.list_vacancies', compact('Query',
285 'Query_count', 284 'Query_count',
286 'Name_categori', 285 'Name_categori',
287 'Reclama', 286 'Reclama',
288 'categories', 287 'categories',
289 'Job_title', 288 'Job_title',
290 'uid')); 289 'uid'));
291 } 290 }
292 } else { 291 } else {
293 //Вернуть все 292 //Вернуть все
294 return view('list_vacancies', compact('Query', 293 return view('list_vacancies', compact('Query',
295 'Query_count', 294 'Query_count',
296 'Reclama', 295 'Reclama',
297 'Name_categori', 296 'Name_categori',
298 'categories', 297 'categories',
299 'Job_title', 298 'Job_title',
300 'uid')); 299 'uid'));
301 } 300 }
302 } 301 }
303 302
304 // Образование 303 // Образование
305 public function education(Request $request) { 304 public function education(Request $request) {
306 $educations = Education::query(); 305 $educations = Education::query();
307 if (($request->has('search')) && (!empty($request->get('search')))) { 306 if (($request->has('search')) && (!empty($request->get('search')))) {
308 $search = trim($request->get('search')); 307 $search = trim($request->get('search'));
309 $educations = $educations->where('name', 'LIKE', "%$search%"); 308 $educations = $educations->where('name', 'LIKE', "%$search%");
310 } 309 }
311 310
312 if ($request->get('sort')) { 311 if ($request->get('sort')) {
313 $sort = $request->get('sort'); 312 $sort = $request->get('sort');
314 switch ($sort) { 313 switch ($sort) {
315 case 'name_up': $educations = $educations->orderBy('name')->orderBy('id'); break; 314 case 'name_up': $educations = $educations->orderBy('name')->orderBy('id'); break;
316 case 'name_down': $educations = $educations->orderByDesc('name')->orderby('id'); break; 315 case 'name_down': $educations = $educations->orderByDesc('name')->orderby('id'); break;
317 case 'created_at_up': $educations = $educations->OrderBy('created_at')->orderBy('id'); break; 316 case 'created_at_up': $educations = $educations->OrderBy('created_at')->orderBy('id'); break;
318 case 'created_at_down': $educations = $educations->orderByDesc('created_at')->orderBy('id'); break; 317 case 'created_at_down': $educations = $educations->orderByDesc('created_at')->orderBy('id'); break;
319 case 'default': $educations = $educations->orderBy('id')->orderby('updated_at'); break; 318 case 'default': $educations = $educations->orderBy('id')->orderby('updated_at'); break;
320 default: $educations = $educations->orderBy('id')->orderby('updated_at'); break; 319 default: $educations = $educations->orderBy('id')->orderby('updated_at'); break;
321 } 320 }
322 } 321 }
323 322
324 $count_edu = $educations->count(); 323 $count_edu = $educations->count();
325 $educations = $educations->paginate(6); 324 $educations = $educations->paginate(6);
326 if ($request->ajax()) { 325 if ($request->ajax()) {
327 return view('ajax.education', compact('educations')); 326 return view('ajax.education', compact('educations'));
328 } else { 327 } else {
329 return view('education', compact('educations', 'count_edu')); 328 return view('education', compact('educations', 'count_edu'));
330 } 329 }
331 } 330 }
332 331
333 // Контакты 332 // Контакты
334 public function contacts() { 333 public function contacts() {
335 return view('contacts'); 334 return view('contacts');
336 } 335 }
337 336
338 // Вход в личный кабинет 337 // Вход в личный кабинет
339 public function input_login(Request $request) 338 public function input_login(Request $request)
340 { 339 {
341 $params = $request->all(); 340 $params = $request->all();
342 341
343 342
344 $rules = [ 343 $rules = [
345 'email' => 'required|string|email', 344 'email' => 'required|string|email',
346 'password' => 'required|string|min:3|max:25', 345 'password' => 'required|string|min:3|max:25',
347 ]; 346 ];
348 347
349 $messages = [ 348 $messages = [
350 'required' => 'Укажите обязательное поле «:attribute»', 349 'required' => 'Укажите обязательное поле «:attribute»',
351 'email' => 'Введите корректный email', 350 'email' => 'Введите корректный email',
352 'min' => [ 351 'min' => [
353 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 352 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
354 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 353 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
355 ], 354 ],
356 'max' => [ 355 'max' => [
357 'string' => 'Поле «:attribute» должно быть не больше :max символов', 356 'string' => 'Поле «:attribute» должно быть не больше :max символов',
358 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 357 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
359 ], 358 ],
360 ]; 359 ];
361 $validator = Validator::make($request->all(), $rules, $messages); 360 $validator = Validator::make($request->all(), $rules, $messages);
362 if ($validator->fails()) { 361 if ($validator->fails()) {
363 if (Auth::check()) 362 if (Auth::check())
364 $user_id = $request->user()->id; 363 $user_id = $request->user()->id;
365 else 364 else
366 $user_id = 0; 365 $user_id = 0;
367 366
368 if ($user_id > 0) 367 if ($user_id > 0)
369 return json_encode(Array("ERROR" => "Email или пароль невалидный!")); 368 return json_encode(Array("ERROR" => "Email или пароль невалидный!"));
370 else 369 else
371 return redirect()->route('index')->with('Error', "Email или пароль невалидный"); 370 return redirect()->route('index')->with('Error', "Email или пароль невалидный");
372 } else { 371 } else {
373 $credentials = $request->only('email', 'password'); 372 $credentials = $request->only('email', 'password');
374 373
375 if (Auth::attempt($credentials, $request->has('remember'))) { 374 if (Auth::attempt($credentials, $request->has('remember'))) {
376 375
377 if (is_null(Auth::user()->email_verified_at)) { 376 if (is_null(Auth::user()->email_verified_at)) {
378 Auth::logout(); 377 Auth::logout();
379 return json_encode(Array("ERROR" => "Адрес почты не подтвержден")); 378 return json_encode(Array("ERROR" => "Адрес почты не подтвержден"));
380 } 379 }
381 380
382 if (Auth::user()->is_worker) { 381 if (Auth::user()->is_worker) {
383 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl())); 382 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));
384 } else { 383 } else {
385 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl())); 384 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));
386 } 385 }
387 386
388 return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет")); 387 return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет"));
389 //->route('index') 388 //->route('index')
390 //->with('success', 'Вы вошли в личный кабинет.'); 389 //->with('success', 'Вы вошли в личный кабинет.');
391 } else { 390 } else {
392 return json_encode(Array("ERROR" => "Неверный логин или пароль!")); 391 return json_encode(Array("ERROR" => "Неверный логин или пароль!"));
393 } 392 }
394 } 393 }
395 } 394 }
396 395
397 // Восстановление пароля 396 // Восстановление пароля
398 public function repair_password(Request $request) { 397 public function repair_password(Request $request) {
399 $rules = [ 398 $rules = [
400 'email' => 'required|string|email', 399 'email' => 'required|string|email',
401 ]; 400 ];
402 401
403 $messages = [ 402 $messages = [
404 'required' => 'Укажите обязательное поле «:attribute»', 403 'required' => 'Укажите обязательное поле «:attribute»',
405 'email' => 'Введите корректный email', 404 'email' => 'Введите корректный email',
406 'min' => [ 405 'min' => [
407 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 406 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
408 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 407 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
409 ], 408 ],
410 'max' => [ 409 'max' => [
411 'string' => 'Поле «:attribute» должно быть не больше :max символов', 410 'string' => 'Поле «:attribute» должно быть не больше :max символов',
412 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 411 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
413 ], 412 ],
414 ]; 413 ];
415 414
416 $validator = Validator::make($request->all(), $rules, $messages); 415 $validator = Validator::make($request->all(), $rules, $messages);
417 416
418 if ($validator->fails()) { 417 if ($validator->fails()) {
419 return redirect()->back()->with('Error', "Email невалидный"); 418 return redirect()->back()->with('Error', "Email невалидный");
420 } else { 419 } else {
421 $new_password = Tools::generator_id(10); 420 $new_password = Tools::generator_id(10);
422 $hash_password = Hash::make($new_password); 421 $hash_password = Hash::make($new_password);
423 $user = User::query()->where('email', $request->get('email'))->first(); 422 $user = User::query()->where('email', $request->get('email'))->first();
424 $EditRec = User::find($user->id); 423 $EditRec = User::find($user->id);
425 $EditRec->password = $hash_password; 424 $EditRec->password = $hash_password;
426 $EditRec->save(); 425 $EditRec->save();
427 426
428 foreach ([$request->get('email')] as $recipient) { 427 foreach ([$request->get('email')] as $recipient) {
429 Mail::to($recipient)->send(new MailRepair($new_password)); 428 Mail::to($recipient)->send(new MailRepair($new_password));
430 } 429 }
431 return redirect()->route('index'); 430 return redirect()->route('index');
432 431
433 } 432 }
434 433
435 } 434 }
436 435
437 // Вывод новостей 436 // Вывод новостей
438 public function news(Request $request) { 437 public function news(Request $request) {
439 $Query = News::query(); 438 $Query = News::query();
440 if ($request->has('search')) { 439 if ($request->has('search')) {
441 $search = $request->get('search'); 440 $search = $request->get('search');
442 $Query = $Query->where('title', 'LIKE', "%$search%")-> 441 $Query = $Query->where('title', 'LIKE', "%$search%")->
443 orWhere('text', 'LIKE', "%$search%"); 442 orWhere('text', 'LIKE', "%$search%");
444 } 443 }
445 444
446 if ($request->ajax()) { 445 if ($request->ajax()) {
447 if ($request->get('sort')) { 446 if ($request->get('sort')) {
448 $sort = $request->get('sort'); 447 $sort = $request->get('sort');
449 switch ($sort) { 448 switch ($sort) {
450 case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break; 449 case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break;
451 case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break; 450 case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break;
452 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; 451 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
453 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; 452 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
454 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; 453 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
455 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; 454 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break;
456 } 455 }
457 } 456 }
458 } 457 }
459 $Query_count = $Query->count(); 458 $Query_count = $Query->count();
460 $Query = $Query->paginate(6); 459 $Query = $Query->paginate(6);
461 460
462 if ($request->ajax()) { 461 if ($request->ajax()) {
463 return view('ajax.news-list', compact('Query', 'Query_count')); 462 return view('ajax.news-list', compact('Query', 'Query_count'));
464 } else { 463 } else {
465 return view('news-list', compact('Query', 'Query_count')); 464 return view('news-list', compact('Query', 'Query_count'));
466 } 465 }
467 } 466 }
468 467
469 //Детальная новость 468 //Детальная новость
470 public function detail_new(News $new) { 469 public function detail_new(News $new) {
471 // Наборка 470 // Наборка
472 $Query = News::query()->where('id', $new->id)->get(); 471 $Query = News::query()->where('id', $new->id)->get();
473 $title = $Query[0]->title; 472 $title = $Query[0]->title;
474 $All_Query = News::query()->paginate(8); 473 $All_Query = News::query()->paginate(8);
475 return view('detail_new', compact('Query', 'All_Query', 'title')); 474 return view('detail_new', compact('Query', 'All_Query', 'title'));
476 } 475 }
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 $c = Static_worker::query()->where('year_month', '=', $get_date) 177 $c = Static_worker::query()->where('year_month', '=', $get_date)
176 ->where('user_id', '=', $worker->user_id) 178 ->where('user_id', '=', $worker->user_id)
177 ->get(); 179 ->get();
178 180
179 if ($c->count() > 0) { 181 if ($c->count() > 0) {
180 $upd = Static_worker::find($c[0]->id); 182 $upd = Static_worker::find($c[0]->id);
181 $upd->lookin = $upd->lookin + 1; 183 $upd->lookin = $upd->lookin + 1;
182 $upd->save(); 184 $upd->save();
183 } else { 185 } else {
184 $crt = new Static_worker(); 186 $crt = new Static_worker();
185 $crt->lookin = 1; 187 $crt->lookin = 1;
186 $crt->year_month = $get_date; 188 $crt->year_month = $get_date;
187 $crt->user_id = $worker->user_id; 189 $crt->user_id = $worker->user_id;
188 $status = $crt->save(); 190 $status = $crt->save();
189 } 191 }
192
190 $stat = Static_worker::query()->where('year_month', '=', $get_date) 193 $stat = Static_worker::query()->where('year_month', '=', $get_date)
191 ->where('user_id', '=', $worker->user_id) 194 ->where('user_id', '=', $worker->user_id)
192 ->get(); 195 ->get();
193 196
194 return view('worker', compact('Query', 'status_work', 'idiot', 'stat')); 197 return view('worker', compact('Query', 'infoblocks', 'status_work', 'idiot', 'stat'));
195 } 198 }
196 199
197 // скачать анкету соискателя 200 // скачать анкету соискателя
198 public function resume_download(Worker $worker) 201 public function resume_download(Worker $worker)
199 { 202 {
200 $status_work = $this->status_work; 203 $status_work = $this->status_work;
201 $Query = Worker::query()->with('users')->with('job_titles') 204 $Query = Worker::query()->with('users')->with('job_titles')
202 ->with('place_worker')->with('sertificate')->with('prev_company') 205 ->with('place_worker')->with('sertificate')->with('prev_company')
203 ->with('infobloks'); 206 ->with('infobloks');
204 $Query = $Query->where('id', '=', $worker->id); 207 $Query = $Query->where('id', '=', $worker->id);
205 $Query = $Query->get()->toArray(); 208 $Query = $Query->get()->toArray();
206 209
207 view()->share('Query',$Query); 210 view()->share('Query',$Query);
208 211
209 212
210 $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape'); 213 $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape');
211 214
212 return $pdf->stream(); 215 return $pdf->stream();
213 } 216 }
214 217
215 public function resume_download_all() { 218 public function resume_download_all() {
216 $status_work = $this->status_work; 219 $status_work = $this->status_work;
217 $Query = Worker::query()->with('users')->with('job_titles') 220 $Query = Worker::query()->with('users')->with('job_titles')
218 ->with('place_worker')->with('sertificate')->with('prev_company') 221 ->with('place_worker')->with('sertificate')->with('prev_company')
219 ->with('infobloks')-> 222 ->with('infobloks')->
220 whereHas('users', function (Builder $query) { 223 whereHas('users', function (Builder $query) {
221 $query->Where('is_worker', '=', '1') 224 $query->Where('is_worker', '=', '1')
222 ->Where('is_bd', '=', '1'); 225 ->Where('is_bd', '=', '1');
223 }); 226 });
224 //$Query = $Query->where('id', '=', $worker->id); 227 //$Query = $Query->where('id', '=', $worker->id);
225 $Query = $Query->get()->toArray(); 228 $Query = $Query->get()->toArray();
226 229
227 view()->share('Query',$Query); 230 view()->share('Query',$Query);
228 231
229 $pdf = PDF::loadView('layout.pdf-list-people', $Query); //->setPaper('a4', 'landscape'); 232 $pdf = PDF::loadView('layout.pdf-list-people', $Query); //->setPaper('a4', 'landscape');
230 233
231 return $pdf->stream(); 234 return $pdf->stream();
232 } 235 }
233 236
234 // Кабинет работника 237 // Кабинет работника
235 public function cabinet(Request $request) 238 public function cabinet(Request $request)
236 { 239 {
237 // дата год и месяц 240 // дата год и месяц
238 $get_date = date('Y.m'); 241 $get_date = date('Y.m');
239 242
240 $id = Auth()->user()->id; 243 $id = Auth()->user()->id;
241 244
242 $Infobloks = infobloks::query()->get(); 245 $Infobloks = infobloks::query()->get();
243 246
244 $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')-> 247 $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')->
245 with('infobloks')->with('place_worker')-> 248 with('infobloks')->with('place_worker')->
246 WhereHas('users', 249 WhereHas('users',
247 function (Builder $query) use ($id) {$query->Where('id', $id); 250 function (Builder $query) use ($id) {$query->Where('id', $id);
248 })->get(); 251 })->get();
249 252
250 $Job_titles = Job_title::query()->where('is_remove', '=', '0')-> 253 $Job_titles = Job_title::query()->where('is_remove', '=', '0')->
251 where('is_bd', '=' , '1')-> 254 where('is_bd', '=' , '1')->
252 OrderByDesc('sort')->OrderBy('name')->get(); 255 OrderByDesc('sort')->OrderBy('name')->get();
253 $Infoblocks = infobloks::query()->OrderBy('name')->get(); 256 $Infoblocks = infobloks::query()->OrderBy('name')->get();
254 257
255 $stat = Static_worker::query()->where('year_month', '=', $get_date) 258 $stat = Static_worker::query()->where('year_month', '=', $get_date)
256 ->where('user_id', '=', $id) 259 ->where('user_id', '=', $id)
257 ->get(); 260 ->get();
258 261
259 262
260 // 10% 263 // 10%
261 264
262 $persent = 10; 265 $persent = 10;
263 $persent1 = 0; 266 $persent1 = 0;
264 $persent2 = 0; 267 $persent2 = 0;
265 $persent3 = 0; 268 $persent3 = 0;
266 $persent4 = 0; 269 $persent4 = 0;
267 $persent5 = 0; 270 $persent5 = 0;
268 271
269 if ((!empty($Worker[0]->telephone)) && 272 if ((!empty($Worker[0]->telephone)) &&
270 (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) && 273 (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) &&
271 (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) { 274 (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) {
272 // 40% 275 // 40%
273 $persent = $persent + 40; 276 $persent = $persent + 40;
274 $persent1 = 40; 277 $persent1 = 40;
275 } 278 }
276 279
277 //dd($Worker[0]->status_work, $Worker[0]->telephone, $Worker[0]->email, $Worker[0]->experience, $Worker[0]->city, $Worker[0]->old_year); 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 if ($Worker[0]->sertificate->count() > 0) { 282 if ($Worker[0]->sertificate->count() > 0) {
280 // 15% 283 // 15%
281 $persent = $persent + 15; 284 $persent = $persent + 15;
282 $persent2 = 15; 285 $persent2 = 15;
283 } 286 }
284 287
285 if ($Worker[0]->infobloks->count() > 0) { 288 if ($Worker[0]->infobloks->count() > 0) {
286 // 20% 289 // 20%
287 $persent = $persent + 20; 290 $persent = $persent + 20;
288 $persent3 = 20; 291 $persent3 = 20;
289 } 292 }
290 293
291 if ($Worker[0]->prev_company->count() > 0) { 294 if ($Worker[0]->prev_company->count() > 0) {
292 // 10% 295 // 10%
293 $persent = $persent + 10; 296 $persent = $persent + 10;
294 $persent4 = 10; 297 $persent4 = 10;
295 } 298 }
296 299
297 if (!empty($Worker[0]->photo)) { 300 if (!empty($Worker[0]->photo)) {
298 // 5% 301 // 5%
299 $persent = $persent + 5; 302 $persent = $persent + 5;
300 $persent5 = 5; 303 $persent5 = 5;
301 } 304 }
302 if ($request->has('print')) { 305 if ($request->has('print')) {
303 dd($Worker); 306 dd($Worker);
304 } else { 307 } else {
305 return view('workers.cabinet', compact('Worker', 'Infobloks', 'persent', 'Job_titles', 'Infoblocks', 'stat')); 308 return view('workers.cabinet', compact('Worker', 'Infobloks', 'persent', 'Job_titles', 'Infoblocks', 'stat'));
306 } 309 }
307 } 310 }
308 311
309 // Сохранение данных 312 // Сохранение данных
310 public function cabinet_save(Worker $worker, Request $request) 313 public function cabinet_save(Worker $worker, Request $request)
311 { 314 {
312 $id = $worker->id; 315 $id = $worker->id;
313 $params = $request->all(); 316 $params = $request->all();
314 317
315 $job_title_id = $request->get('job_title_id'); 318 $job_title_id = $request->get('job_title_id');
316 319
317 unset($params['new_diplom']); 320 unset($params['new_diplom']);
318 unset($params['new_data_begin']); 321 unset($params['new_data_begin']);
319 unset($params['new_data_end']); 322 unset($params['new_data_end']);
320 unset($params['new_job_title']); 323 unset($params['new_job_title']);
321 unset($params['new_teplohod']); 324 unset($params['new_teplohod']);
322 unset($params['new_GWT']); 325 unset($params['new_GWT']);
323 unset($params['new_KBT']); 326 unset($params['new_KBT']);
324 unset($params['new_Begin_work']); 327 unset($params['new_Begin_work']);
325 unset($params['new_End_work']); 328 unset($params['new_End_work']);
326 unset($params['new_name_company']); 329 unset($params['new_name_company']);
327 330
328 $rules = [ 331 $rules = [
329 'surname' => ['required', 'string', 'max:255'], 332 'surname' => ['required', 'string', 'max:255'],
330 'name_man' => ['required', 'string', 'max:255'], 333 'name_man' => ['required', 'string', 'max:255'],
331 'email' => ['required', 'string', 'email', 'max:255'], 334 'email' => ['required', 'string', 'email', 'max:255'],
332 335
333 ]; 336 ];
334 337
335 $messages = [ 338 $messages = [
336 'required' => 'Укажите обязательное поле', 339 'required' => 'Укажите обязательное поле',
337 'min' => [ 340 'min' => [
338 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 341 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
339 'integer' => 'Поле «:attribute» должно быть :min или больше', 342 'integer' => 'Поле «:attribute» должно быть :min или больше',
340 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 343 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
341 ], 344 ],
342 'max' => [ 345 'max' => [
343 'string' => 'Поле «:attribute» должно быть не больше :max символов', 346 'string' => 'Поле «:attribute» должно быть не больше :max символов',
344 'integer' => 'Поле «:attribute» должно быть :max или меньше', 347 'integer' => 'Поле «:attribute» должно быть :max или меньше',
345 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 348 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
346 ] 349 ]
347 ]; 350 ];
348 351
349 $validator = Validator::make($params, $rules, $messages); 352 $validator = Validator::make($params, $rules, $messages);
350 353
351 if ($validator->fails()) { 354 if ($validator->fails()) {
352 return redirect()->route('worker.cabinet')->withErrors($validator); 355 return redirect()->route('worker.cabinet')->withErrors($validator);
353 } else { 356 } else {
354 357
355 if ($request->has('photo')) { 358 if ($request->has('photo')) {
356 if (!empty($Worker->photo)) { 359 if (!empty($Worker->photo)) {
357 Storage::delete($Worker->photo); 360 Storage::delete($Worker->photo);
358 } 361 }
359 $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); 362 $params['photo'] = $request->file('photo')->store("worker/$id", 'public');
360 } 363 }
361 364
362 if ($request->has('file')) { 365 if ($request->has('file')) {
363 if (!empty($Worker->file)) { 366 if (!empty($Worker->file)) {
364 Storage::delete($Worker->file); 367 Storage::delete($Worker->file);
365 } 368 }
366 $params['file'] = $request->file('file')->store("worker/$id", 'public'); 369 $params['file'] = $request->file('file')->store("worker/$id", 'public');
367 } 370 }
368 371
369 $id_wor = $worker->update($params); 372 $id_wor = $worker->update($params);
370 $use = User::find($worker->user_id); 373 $use = User::find($worker->user_id);
371 $use->surname = $request->get('surname'); 374 $use->surname = $request->get('surname');
372 $use->name_man = $request->get('name_man'); 375 $use->name_man = $request->get('name_man');
373 $use->surname2 = $request->get('surname2'); 376 $use->surname2 = $request->get('surname2');
374 377
375 $use->save(); 378 $use->save();
376 $worker->job_titles()->sync($job_title_id); 379 $worker->job_titles()->sync($job_title_id);
377 380
378 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); 381 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены');
379 } 382 }
380 } 383 }
381 384
382 // Сообщения данные 385 // Сообщения данные
383 public function messages($type_message) 386 public function messages($type_message)
384 { 387 {
385 $user_id = Auth()->user()->id; 388 $user_id = Auth()->user()->id;
386 389
387 $messages_input = Message::query()->with('vacancies')->with('user_from')-> 390 $messages_input = Message::query()->with('vacancies')->with('user_from')->
388 Where('to_user_id', $user_id)->OrderByDesc('created_at'); 391 Where('to_user_id', $user_id)->OrderByDesc('created_at');
389 392
390 $messages_output = Message::query()->with('vacancies')-> 393 $messages_output = Message::query()->with('vacancies')->
391 with('user_to')->where('user_id', $user_id)-> 394 with('user_to')->where('user_id', $user_id)->
392 OrderByDesc('created_at'); 395 OrderByDesc('created_at');
393 396
394 $count_input = $messages_input->count(); 397 $count_input = $messages_input->count();
395 $count_output = $messages_output->count(); 398 $count_output = $messages_output->count();
396 399
397 if ($type_message == 'input') { 400 if ($type_message == 'input') {
398 $messages = $messages_input->paginate(5); 401 $messages = $messages_input->paginate(5);
399 } 402 }
400 403
401 if ($type_message == 'output') { 404 if ($type_message == 'output') {
402 $messages = $messages_output->paginate(5); 405 $messages = $messages_output->paginate(5);
403 } 406 }
404 407
405 //dd($messages); 408 //dd($messages);
406 // Вернуть все 100% 409 // Вернуть все 100%
407 return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); 410 return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id'));
408 } 411 }
409 412
410 // Избранный 413 // Избранный
411 public function favorite() 414 public function favorite()
412 { 415 {
413 return view('workers.favorite'); 416 return view('workers.favorite');
414 } 417 }
415 418
416 // Сменить пароль 419 // Сменить пароль
417 public function new_password() 420 public function new_password()
418 { 421 {
419 $email = Auth()->user()->email; 422 $email = Auth()->user()->email;
420 return view('workers.new_password', compact('email')); 423 return view('workers.new_password', compact('email'));
421 } 424 }
422 425
423 // Обновление пароля 426 // Обновление пароля
424 public function save_new_password(Request $request) { 427 public function save_new_password(Request $request) {
425 $use = Auth()->user(); 428 $use = Auth()->user();
426 $request->validate([ 429 $request->validate([
427 'password' => 'required|string', 430 'password' => 'required|string',
428 'new_password' => 'required|string', 431 'new_password' => 'required|string',
429 'new_password2' => 'required|string' 432 'new_password2' => 'required|string'
430 ]); 433 ]);
431 434
432 if ($request->get('new_password') == $request->get('new_password2')) 435 if ($request->get('new_password') == $request->get('new_password2'))
433 if ($request->get('password') !== $request->get('new_password')) { 436 if ($request->get('password') !== $request->get('new_password')) {
434 $credentials = $request->only('email', 'password'); 437 $credentials = $request->only('email', 'password');
435 if (Auth::attempt($credentials, $request->has('save_me'))) { 438 if (Auth::attempt($credentials, $request->has('save_me'))) {
436 439
437 if (!is_null($use->email_verified_at)){ 440 if (!is_null($use->email_verified_at)){
438 441
439 $user_data = User_Model::find($use->id); 442 $user_data = User_Model::find($use->id);
440 $user_data->update([ 443 $user_data->update([
441 'password' => Hash::make($request->get('new_password')), 444 'password' => Hash::make($request->get('new_password')),
442 'pubpassword' => base64_encode($request->get('new_password')), 445 'pubpassword' => base64_encode($request->get('new_password')),
443 ]); 446 ]);
444 return redirect() 447 return redirect()
445 ->route('worker.new_password') 448 ->route('worker.new_password')
446 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 449 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
447 } 450 }
448 451
449 return redirect() 452 return redirect()
450 ->route('worker.new_password') 453 ->route('worker.new_password')
451 ->withError('Данная учетная запись не было верифицированна!'); 454 ->withError('Данная учетная запись не было верифицированна!');
452 } 455 }
453 } 456 }
454 457
455 return redirect() 458 return redirect()
456 ->route('worker.new_password') 459 ->route('worker.new_password')
457 ->withErrors('Не совпадение данных, обновите пароли!'); 460 ->withErrors('Не совпадение данных, обновите пароли!');
458 } 461 }
459 462
460 // Удаление профиля форма 463 // Удаление профиля форма
461 public function delete_profile() 464 public function delete_profile()
462 { 465 {
463 $login = Auth()->user()->email; 466 $login = Auth()->user()->email;
464 return view('workers.delete_profile', compact('login')); 467 return view('workers.delete_profile', compact('login'));
465 } 468 }
466 469
467 // Удаление профиля код 470 // Удаление профиля код
468 public function delete_profile_result(Request $request) { 471 public function delete_profile_result(Request $request) {
469 $Answer = $request->all(); 472 $Answer = $request->all();
470 $user_id = Auth()->user()->id; 473 $user_id = Auth()->user()->id;
471 $request->validate([ 474 $request->validate([
472 'password' => 'required|string', 475 'password' => 'required|string',
473 ]); 476 ]);
474 477
475 $credentials = $request->only('email', 'password'); 478 $credentials = $request->only('email', 'password');
476 if (Auth::attempt($credentials)) { 479 if (Auth::attempt($credentials)) {
477 Auth::logout(); 480 Auth::logout();
478 $it = User_Model::find($user_id); 481 $it = User_Model::find($user_id);
479 $it->delete(); 482 $it->delete();
480 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 483 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
481 } else { 484 } else {
482 return redirect()->route('worker.delete_profile') 485 return redirect()->route('worker.delete_profile')
483 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 486 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
484 } 487 }
485 } 488 }
486 489
487 // Регистрация соискателя 490 // Регистрация соискателя
488 public function register_worker(Request $request) 491 public function register_worker(Request $request)
489 { 492 {
490 $params = $request->all(); 493 $params = $request->all();
491 $params['is_worker'] = 1; 494 $params['is_worker'] = 1;
492 495
493 $rules = [ 496 $rules = [
494 'surname' => ['required', 'string', 'max:255'], 497 'surname' => ['required', 'string', 'max:255'],
495 'name_man' => ['required', 'string', 'max:255'], 498 'name_man' => ['required', 'string', 'max:255'],
496 'email' => ['required', 'email', 'max:255', 'unique:users'], 499 'email' => ['required', 'email', 'max:255', 'unique:users'],
497 'password' => ['required', 'string', 'min:6'] 500 'password' => ['required', 'string', 'min:6']
498 ]; 501 ];
499 502
500 $messages = [ 503 $messages = [
501 'required' => 'Укажите обязательное поле', 504 'required' => 'Укажите обязательное поле',
502 'min' => [ 505 'min' => [
503 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 506 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
504 'integer' => 'Поле «:attribute» должно быть :min или больше', 507 'integer' => 'Поле «:attribute» должно быть :min или больше',
505 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 508 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
506 ], 509 ],
507 'max' => [ 510 'max' => [
508 'string' => 'Поле «:attribute» должно быть не больше :max символов', 511 'string' => 'Поле «:attribute» должно быть не больше :max символов',
509 'integer' => 'Поле «:attribute» должно быть :max или меньше', 512 'integer' => 'Поле «:attribute» должно быть :max или меньше',
510 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 513 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
511 ] 514 ]
512 ]; 515 ];
513 516
514 $email = $request->get('email'); 517 $email = $request->get('email');
515 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { 518 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) {
516 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); 519 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл"));
517 } 520 }
518 521
519 if ($request->get('password') !== $request->get('confirmed')){ 522 if ($request->get('password') !== $request->get('confirmed')){
520 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 523 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
521 } 524 }
522 525
523 if (strlen($request->get('password')) < 6) { 526 if (strlen($request->get('password')) < 6) {
524 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); 527 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
525 } 528 }
526 529
527 /*$haystack = $request->get('password'); 530 /*$haystack = $request->get('password');
528 531
529 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); 532 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?');
530 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 533 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z',
531 'X', 'C', 'V', 'B', 'N', 'M'); 534 'X', 'C', 'V', 'B', 'N', 'M');
532 $lenpwd_bool = true; 535 $lenpwd_bool = true;
533 $spec_bool = false; 536 $spec_bool = false;
534 $alpha_bool = false; 537 $alpha_bool = false;
535 538
536 if (strlen($haystack) < 8) $lenpwd_bool = false; 539 if (strlen($haystack) < 8) $lenpwd_bool = false;
537 540
538 foreach ($specsumbol as $it) { 541 foreach ($specsumbol as $it) {
539 if (strpos($haystack, $it) !== false) { 542 if (strpos($haystack, $it) !== false) {
540 $spec_bool = true; 543 $spec_bool = true;
541 } 544 }
542 } 545 }
543 546
544 foreach ($alpha as $it) { 547 foreach ($alpha as $it) {
545 if (strpos($haystack, $it) !== false) { 548 if (strpos($haystack, $it) !== false) {
546 $alpha_bool = true; 549 $alpha_bool = true;
547 } 550 }
548 } 551 }
549 552
550 if ((!$spec_bool) || (!$alpha_bool)) { 553 if ((!$spec_bool) || (!$alpha_bool)) {
551 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); 554 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?"));
552 }*/ 555 }*/
553 556
554 if (($request->has('politik')) && ($request->get('politik') == 1)) { 557 if (($request->has('politik')) && ($request->get('politik') == 1)) {
555 $validator = Validator::make($params, $rules, $messages); 558 $validator = Validator::make($params, $rules, $messages);
556 559
557 if ($validator->fails()) { 560 if ($validator->fails()) {
558 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 561 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
559 } else { 562 } else {
560 //dd($params); 563 //dd($params);
561 $user = $this->create($params); 564 $user = $this->create($params);
562 event(new Registered($user)); 565 event(new Registered($user));
563 Auth::guard()->login($user); 566 Auth::guard()->login($user);
564 } 567 }
565 if ($user) { 568 if ($user) {
566 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; 569 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));;
567 } else { 570 } else {
568 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 571 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
569 } 572 }
570 573
571 } else { 574 } else {
572 return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!")); 575 return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!"));
573 } 576 }
574 } 577 }
575 578
576 // Звездная оценка и ответ 579 // Звездная оценка и ответ
577 public function stars_answer(Request $request) { 580 public function stars_answer(Request $request) {
578 $params = $request->all(); 581 $params = $request->all();
579 $rules = [ 582 $rules = [
580 'message' => ['required', 'string', 'max:255'], 583 'message' => ['required', 'string', 'max:255'],
581 ]; 584 ];
582 585
583 $messages = [ 586 $messages = [
584 'required' => 'Укажите обязательное поле', 587 'required' => 'Укажите обязательное поле',
585 'min' => [ 588 'min' => [
586 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 589 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
587 'integer' => 'Поле «:attribute» должно быть :min или больше', 590 'integer' => 'Поле «:attribute» должно быть :min или больше',
588 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 591 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
589 ], 592 ],
590 'max' => [ 593 'max' => [
591 'string' => 'Поле «:attribute» должно быть не больше :max символов', 594 'string' => 'Поле «:attribute» должно быть не больше :max символов',
592 'integer' => 'Поле «:attribute» должно быть :max или меньше', 595 'integer' => 'Поле «:attribute» должно быть :max или меньше',
593 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 596 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
594 ] 597 ]
595 ]; 598 ];
596 $response_worker = ResponseWork::create($params); 599 $response_worker = ResponseWork::create($params);
597 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); 600 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!');
598 } 601 }
599 602
600 public function TestWorker() 603 public function TestWorker()
601 { 604 {
602 $Use = new User(); 605 $Use = new User();
603 606
604 $Code_user = $Use->create([ 607 $Code_user = $Use->create([
605 'name' => 'surname name_man', 608 'name' => 'surname name_man',
606 'name_man' => 'name_man', 609 'name_man' => 'name_man',
607 'surname' => 'surname', 610 'surname' => 'surname',
608 'surname2' => 'surname2', 611 'surname2' => 'surname2',
609 'subscribe_email' => '1', 612 'subscribe_email' => '1',
610 'email' => 'email@mail.com', 613 'email' => 'email@mail.com',
611 'telephone' => '1234567890', 614 'telephone' => '1234567890',
612 'password' => Hash::make('password'), 615 'password' => Hash::make('password'),
613 'pubpassword' => base64_encode('password'), 616 'pubpassword' => base64_encode('password'),
614 'email_verified_at' => Carbon::now(), 617 'email_verified_at' => Carbon::now(),
615 'is_worker' => 1, 618 'is_worker' => 1,
616 ]); 619 ]);
617 620
618 if ($Code_user->id > 0) { 621 if ($Code_user->id > 0) {
619 $Worker = new Worker(); 622 $Worker = new Worker();
620 $Worker->user_id = $Code_user->id; 623 $Worker->user_id = $Code_user->id;
621 $Worker->position_work = 1; //'job_titles'; 624 $Worker->position_work = 1; //'job_titles';
622 $Worker->email = 'email@email.com'; 625 $Worker->email = 'email@email.com';
623 $Worker->telephone = '1234567890'; 626 $Worker->telephone = '1234567890';
624 $status = $Worker->save(); 627 $status = $Worker->save();
625 628
626 $Title_Worker = new Title_worker(); 629 $Title_Worker = new Title_worker();
627 $Title_Worker->worker_id = $Worker->id; 630 $Title_Worker->worker_id = $Worker->id;
628 $Title_Worker->job_title_id = 1; 631 $Title_Worker->job_title_id = 1;
629 $Title_Worker->save(); 632 $Title_Worker->save();
630 } 633 }
631 } 634 }
632 635
633 // Создание пользователя 636 // Создание пользователя
634 protected function create(array $data) 637 protected function create(array $data)
635 { 638 {
636 $Use = new User(); 639 $Use = new User();
637 640
638 $Code_user = $Use->create([ 641 $Code_user = $Use->create([
639 'name' => $data['surname']." ".$data['name_man'], 642 'name' => $data['surname']." ".$data['name_man'],
640 'name_man' => $data['name_man'], 643 'name_man' => $data['name_man'],
641 'surname' => $data['surname'], 644 'surname' => $data['surname'],
642 'surname2' => $data['surname2'], 645 'surname2' => $data['surname2'],
643 'subscribe_email' => $data['email'], 646 'subscribe_email' => $data['email'],
644 'email' => $data['email'], 647 'email' => $data['email'],
645 'telephone' => $data['telephone'], 648 'telephone' => $data['telephone'],
646 'password' => Hash::make($data['password']), 649 'password' => Hash::make($data['password']),
647 'pubpassword' => base64_encode($data['password']), 650 'pubpassword' => base64_encode($data['password']),
648 'email_verified_at' => Carbon::now(), 651 'email_verified_at' => Carbon::now(),
649 'is_worker' => $data['is_worker'], 652 'is_worker' => $data['is_worker'],
650 ]); 653 ]);
651 654
652 if ($Code_user->id > 0) { 655 if ($Code_user->id > 0) {
653 $Worker = new Worker(); 656 $Worker = new Worker();
654 $Worker->user_id = $Code_user->id; 657 $Worker->user_id = $Code_user->id;
655 $Worker->position_work = $data['job_titles']; 658 $Worker->position_work = $data['job_titles'];
656 $Worker->email = $data['email']; 659 $Worker->email = $data['email'];
657 $Worker->telephone = $data['telephone']; 660 $Worker->telephone = $data['telephone'];
658 $Worker->save(); 661 $Worker->save();
659 662
660 if (isset($Worker->id)) { 663 if (isset($Worker->id)) {
661 $Title_Worker = new Title_worker(); 664 $Title_Worker = new Title_worker();
662 $Title_Worker->worker_id = $Worker->id; 665 $Title_Worker->worker_id = $Worker->id;
663 $Title_Worker->job_title_id = $data['job_titles']; 666 $Title_Worker->job_title_id = $data['job_titles'];
664 $Title_Worker->save(); 667 $Title_Worker->save();
665 } 668 }
666 669
667 return $Code_user; 670 return $Code_user;
668 } 671 }
669 } 672 }
670 673
671 // Вакансии избранные 674 // Вакансии избранные
672 public function colorado(Request $request) { 675 public function colorado(Request $request) {
673 $IP_address = RusDate::ip_addr_client(); 676 $IP_address = RusDate::ip_addr_client();
674 $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); 677 $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get();
675 678
676 if ($Arr->count()) { 679 if ($Arr->count()) {
677 $A = Array(); 680 $A = Array();
678 foreach ($Arr as $it) { 681 foreach ($Arr as $it) {
679 $A[] = $it->code_record; 682 $A[] = $it->code_record;
680 } 683 }
681 684
682 $Query = Ad_employer::query()->whereIn('id', $A); 685 $Query = Ad_employer::query()->whereIn('id', $A);
683 } else { 686 } else {
684 $Query = Ad_employer::query()->where('id', '=', '0'); 687 $Query = Ad_employer::query()->where('id', '=', '0');
685 } 688 }
686 689
687 $Query = $Query->with('jobs')-> 690 $Query = $Query->with('jobs')->
688 with('cat')-> 691 with('cat')->
689 with('employer')-> 692 with('employer')->
690 whereHas('jobs_code', function ($query) use ($request) { 693 whereHas('jobs_code', function ($query) use ($request) {
691 if ($request->ajax()) { 694 if ($request->ajax()) {
692 if (null !== ($request->get('job'))) { 695 if (null !== ($request->get('job'))) {
693 $query->where('job_title_id', $request->get('job')); 696 $query->where('job_title_id', $request->get('job'));
694 } 697 }
695 } 698 }
696 })->select('ad_employers.*'); 699 })->select('ad_employers.*');
697 700
698 $Job_title = Job_title::query()->OrderBy('name')->get(); 701 $Job_title = Job_title::query()->OrderBy('name')->get();
699 702
700 $Query_count = $Query->count(); 703 $Query_count = $Query->count();
701 704
702 $Query = $Query->OrderBy('updated_at')->paginate(3); 705 $Query = $Query->OrderBy('updated_at')->paginate(3);
703 706
704 return view('workers.favorite', compact('Query', 707 return view('workers.favorite', compact('Query',
705 'Query_count', 708 'Query_count',
706 'Job_title')); 709 'Job_title'));
707 710
708 } 711 }
709 712
710 //Переписка 713 //Переписка
711 public function dialog(User_Model $user1, User_Model $user2, Request $request) { 714 public function dialog(User_Model $user1, User_Model $user2, Request $request) {
712 // Получение параметров. 715 // Получение параметров.
713 if ($request->has('ad_employer')){ 716 if ($request->has('ad_employer')){
714 $ad_employer = $request->get('ad_employer'); 717 $ad_employer = $request->get('ad_employer');
715 } else { 718 } else {
716 $ad_employer = 0; 719 $ad_employer = 0;
717 } 720 }
718 721
719 if (isset($user1->id)) { 722 if (isset($user1->id)) {
720 $sender = User_Model::query()->with('workers')-> 723 $sender = User_Model::query()->with('workers')->
721 with('employers')-> 724 with('employers')->
722 where('id', $user1->id)->first(); 725 where('id', $user1->id)->first();
723 } 726 }
724 727
725 if (isset($user2->id)) { 728 if (isset($user2->id)) {
726 $companion = User_Model::query()->with('workers')-> 729 $companion = User_Model::query()->with('workers')->
727 with('employers')-> 730 with('employers')->
728 where('id', $user2->id)->first(); 731 where('id', $user2->id)->first();
729 } 732 }
730 733
731 $Messages = Message::query()-> 734 $Messages = Message::query()->
732 //with('response')-> 735 //with('response')->
733 where(function($query) use ($user1, $user2) { 736 where(function($query) use ($user1, $user2) {
734 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); 737 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id);
735 })->orWhere(function($query) use ($user1, $user2) { 738 })->orWhere(function($query) use ($user1, $user2) {
736 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); 739 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id);
737 })->OrderBy('created_at')->get(); 740 })->OrderBy('created_at')->get();
738 741
739 $id_vac = null; 742 $id_vac = null;
740 /*foreach ($Messages as $it) { 743 /*foreach ($Messages as $it) {
741 if (isset($it->response)) { 744 if (isset($it->response)) {
742 foreach ($it->response as $r) { 745 foreach ($it->response as $r) {
743 if (isset($r->ad_employer_id)) { 746 if (isset($r->ad_employer_id)) {
744 $id_vac = $r->ad_employer_id; 747 $id_vac = $r->ad_employer_id;
745 break; 748 break;
746 } 749 }
747 } 750 }
748 } 751 }
749 if (!is_null($id_vac)) break; 752 if (!is_null($id_vac)) break;
750 }*/ 753 }*/
751 754
752 //$ad_employer = null; 755 //$ad_employer = null;
753 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); 756 //if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first();
754 757
755 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); 758 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer'));
756 } 759 }
757 760
758 // Даунылоады 761 // Даунылоады
759 public function download(Worker $worker) { 762 public function download(Worker $worker) {
760 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; 763 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...'];
761 view()->share('house',$arr_house); 764 view()->share('house',$arr_house);
762 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); 765 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape');
763 return $pdf->stream(); 766 return $pdf->stream();
764 } 767 }
765 768
766 // Поднятие анкеты 769 // Поднятие анкеты
767 public function up(Worker $worker) { 770 public function up(Worker $worker) {
768 $worker->updated_at = Carbon::now(); 771 $worker->updated_at = Carbon::now();
769 $worker->save(); 772 $worker->save();
770 // 0 773 // 0
771 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); 774 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных');
772 } 775 }
773 776
774 // Форма сертификате 777 // Форма сертификате
775 public function new_sertificate(Worker $worker) { 778 public function new_sertificate(Worker $worker) {
776 return view('workers.sertificate_add', compact('worker')); 779 return view('workers.sertificate_add', compact('worker'));
777 } 780 }
778 781
779 // Добавление сертификата 782 // Добавление сертификата
780 public function add_serificate(SertificationRequest $request) { 783 public function add_serificate(SertificationRequest $request) {
781 $params = $request->all(); 784 $params = $request->all();
782 785
783 $Sertificate = new sertification(); 786 $Sertificate = new sertification();
784 $Sertificate->create($params); 787 $Sertificate->create($params);
785 $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get(); 788 $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get();
786 return redirect()->route('worker.cabinet'); 789 return redirect()->route('worker.cabinet');
787 //return view('ajax.documents', compact('Docs')); 790 //return view('ajax.documents', compact('Docs'));
788 } 791 }
789 792
790 // Удалить сертификат 793 // Удалить сертификат
791 public function delete_sertificate(sertification $doc) { 794 public function delete_sertificate(sertification $doc) {
792 $doc->delete(); 795 $doc->delete();
793 796
794 return redirect()->route('worker.cabinet'); 797 return redirect()->route('worker.cabinet');
795 } 798 }
796 799
797 // Редактирование сертификата 800 // Редактирование сертификата
798 public function edit_sertificate(Worker $worker, sertification $doc) { 801 public function edit_sertificate(Worker $worker, sertification $doc) {
799 return view('workers.sertificate_edit', compact('doc', 'worker')); 802 return view('workers.sertificate_edit', compact('doc', 'worker'));
800 } 803 }
801 804
802 // Редактирование обновление сертификата 805 // Редактирование обновление сертификата
803 public function update_serificate(SertificationRequest $request, sertification $doc) { 806 public function update_serificate(SertificationRequest $request, sertification $doc) {
804 $all = $request->all(); 807 $all = $request->all();
805 $doc->worker_id = $all['worker_id']; 808 $doc->worker_id = $all['worker_id'];
806 $doc->name = $all['name']; 809 $doc->name = $all['name'];
807 $doc->end_begin = $all['end_begin']; 810 $doc->end_begin = $all['end_begin'];
808 $doc->save(); 811 $doc->save();
809 812
810 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); 813 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!');
811 } 814 }
812 815
813 public function delete_add_diplom(Request $request, Worker $worker) { 816 public function delete_add_diplom(Request $request, Worker $worker) {
814 $infoblok_id = $request->get('infoblok_id'); 817 $infoblok_id = $request->get('infoblok_id');
815 818
816 if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0) 819 if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0)
817 $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete(); 820 $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete();
818 else { 821 else {
819 $params['infoblok_id'] = $infoblok_id; 822 $params['infoblok_id'] = $infoblok_id;
820 $params['worker_id'] = $worker->id; 823 $params['worker_id'] = $worker->id;
821 $params['status'] = $request->get('val'); 824 $params['status'] = $request->get('val');
822 $id = Dop_info::create($params); 825 $id = Dop_info::create($params);
823 //$id = $worker->infobloks()->sync([$infoblok_id]); 826 //$id = $worker->infobloks()->sync([$infoblok_id]);
824 } 827 }
825 828
826 //$Infoblocks = infobloks::query()->get(); 829 //$Infoblocks = infobloks::query()->get();
827 return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks')); 830 return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks'));
828 } 831 }
829 832
830 833
831 834
832 // Добавление диплома 835 // Добавление диплома
833 public function add_diplom_ajax(Request $request) { 836 public function add_diplom_ajax(Request $request) {
834 // конец 837 // конец
835 $params = $request->all(); 838 $params = $request->all();
836 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 839 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
837 840
838 if ($count == 0) $dop_info = Dop_info::create($params); 841 if ($count == 0) $dop_info = Dop_info::create($params);
839 $Infoblocks = infobloks::query()->get(); 842 $Infoblocks = infobloks::query()->get();
840 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); 843 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get();
841 $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); 844 $data = Dop_info::query()->where('worker_id', $request->has('worker_id'));
842 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); 845 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker'));
843 } 846 }
844 847
845 // Добавление диплома без ajax 848 // Добавление диплома без ajax
846 public function add_diplom(Worker $worker) { 849 public function add_diplom(Worker $worker) {
847 $worker_id = $worker->id; 850 $worker_id = $worker->id;
848 $Infoblocks = infobloks::query()->get(); 851 $Infoblocks = infobloks::query()->get();
849 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); 852 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks'));
850 } 853 }
851 // Сохранить 854 // Сохранить
852 // Сохраняю диплом 855 // Сохраняю диплом
853 public function add_diplom_save(Request $request) { 856 public function add_diplom_save(Request $request) {
854 $params = $request->all(); 857 $params = $request->all();
855 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 858 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
856 if ($count == 0) $dop_info = Dop_info::create($params); 859 if ($count == 0) $dop_info = Dop_info::create($params);
857 return redirect()->route('worker.cabinet'); 860 return redirect()->route('worker.cabinet');
858 } 861 }
859 862
860 // Добавление стандартного документа 863 // Добавление стандартного документа
861 public function add_document(Worker $worker) { 864 public function add_document(Worker $worker) {
862 return view('workers.docs', compact('worker')); 865 return view('workers.docs', compact('worker'));
863 } 866 }
864 867
865 //Сохранение стандартого документа 868 //Сохранение стандартого документа
866 public function add_document_save(DocumentsRequest $request) { 869 public function add_document_save(DocumentsRequest $request) {
867 $params = $request->all(); 870 $params = $request->all();
868 $place_work = place_works::create($params); 871 $place_work = place_works::create($params);
869 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!'); 872 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!');
870 } 873 }
871 874
872 // Редактирование документа 875 // Редактирование документа
873 public function edit_document(place_works $doc, Worker $worker) { 876 public function edit_document(place_works $doc, Worker $worker) {
874 return view('workers.docs-edit', compact('doc', 'worker')); 877 return view('workers.docs-edit', compact('doc', 'worker'));
875 } 878 }
876 879
877 //Сохранение отредактированного документа 880 //Сохранение отредактированного документа
878 public function edit_document_save(DocumentsRequest $request, place_works $doc) { 881 public function edit_document_save(DocumentsRequest $request, place_works $doc) {
879 $params = $request->all(); 882 $params = $request->all();
880 $doc->update($params); 883 $doc->update($params);
881 884
882 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); 885 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!');
883 } 886 }
884 887
885 // Удаление документа 888 // Удаление документа
886 public function delete_document(place_works $doc) { 889 public function delete_document(place_works $doc) {
887 $doc->delete(); 890 $doc->delete();
888 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); 891 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!');
889 } 892 }
890 893
891 //Отправка нового сообщения 894 //Отправка нового сообщения
892 public function new_message(Request $request) { 895 public function new_message(Request $request) {
893 $params = $request->all(); 896 $params = $request->all();
894 897
895 $id = $params['send_user_id']; 898 $id = $params['send_user_id'];
896 $message = new Message(); 899 $message = new Message();
897 $message->user_id = $params['send_user_id']; 900 $message->user_id = $params['send_user_id'];
898 $message->to_user_id = $params['send_to_user_id']; 901 $message->to_user_id = $params['send_to_user_id'];
899 $message->title = $params['send_title']; 902 $message->title = $params['send_title'];
900 $message->text = $params['send_text']; 903 $message->text = $params['send_text'];
901 $message->ad_employer_id = $params['send_vacancy']; 904 $message->ad_employer_id = $params['send_vacancy'];
902 if ($request->has('send_file')) { 905 if ($request->has('send_file')) {
903 $message->file = $request->file('send_file')->store("worker/$id", 'public'); 906 $message->file = $request->file('send_file')->store("worker/$id", 'public');
904 } 907 }
905 $message->flag_new = 1; 908 $message->flag_new = 1;
906 $id_message = $message->save(); 909 $id_message = $message->save();
907 910
908 $data['message_id'] = $id_message; 911 $data['message_id'] = $id_message;
909 $data['ad_employer_id'] = $params['send_vacancy']; 912 $data['ad_employer_id'] = $params['send_vacancy'];
910 $data['job_title_id'] = $params['send_job_title_id']; 913 $data['job_title_id'] = $params['send_job_title_id'];
911 $data['flag'] = 1; 914 $data['flag'] = 1;
912 $ad_responce = ad_response::create($data); 915 $ad_responce = ad_response::create($data);
913 return redirect()->route('worker.messages', ['type_message' => 'output']); 916 return redirect()->route('worker.messages', ['type_message' => 'output']);
914 } 917 }
915 918
916 919
917 public function test123(Request $request) { 920 public function test123(Request $request) {
918 $params = $request->all(); 921 $params = $request->all();
919 $user1 = $params['user_id']; 922 $user1 = $params['user_id'];
920 $user2 = $params['to_user_id']; 923 $user2 = $params['to_user_id'];
921 $id_vacancy = $params['ad_employer_id']; 924 $id_vacancy = $params['ad_employer_id'];
922 $ad_name = $params['ad_name']; 925 $ad_name = $params['ad_name'];
923 926
924 $rules = [ 927 $rules = [
925 'text' => 'required|min:1|max:150000', 928 'text' => 'required|min:1|max:150000',
926 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' 929 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000'
927 ]; 930 ];
928 $messages = [ 931 $messages = [
929 'required' => 'Укажите обязательное поле', 932 'required' => 'Укажите обязательное поле',
930 'min' => [ 933 'min' => [
931 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 934 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
932 'integer' => 'Поле «:attribute» должно быть :min или больше', 935 'integer' => 'Поле «:attribute» должно быть :min или больше',
933 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 936 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
934 ], 937 ],
935 'max' => [ 938 'max' => [
936 'string' => 'Поле «:attribute» должно быть не больше :max символов', 939 'string' => 'Поле «:attribute» должно быть не больше :max символов',
937 'integer' => 'Поле «:attribute» должно быть :max или меньше', 940 'integer' => 'Поле «:attribute» должно быть :max или меньше',
938 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 941 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
939 ] 942 ]
940 ]; 943 ];
941 944
942 $validator = Validator::make($request->all(), $rules, $messages); 945 $validator = Validator::make($request->all(), $rules, $messages);
943 946
944 if ($validator->fails()) { 947 if ($validator->fails()) {
945 return redirect()->route('worker.dialog', ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]) 948 return redirect()->route('worker.dialog', ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name])
946 ->withErrors($validator); 949 ->withErrors($validator);
947 } else { 950 } else {
948 if ($request->has('file')) { 951 if ($request->has('file')) {
949 $params['file'] = $request->file('file')->store("messages", 'public'); 952 $params['file'] = $request->file('file')->store("messages", 'public');
950 } 953 }
951 Message::create($params); 954 Message::create($params);
952 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 955 //return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
953 return redirect()->route('worker.dialog', 956 return redirect()->route('worker.dialog',
954 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]); 957 ['user1' => $user1, 'user2' => $user2, 'ad_employer' => $id_vacancy, 'ad_name' => $ad_name]);
955 958
956 } 959 }
957 } 960 }
958 961
959 // Информация о предыдущих компаниях 962 // Информация о предыдущих компаниях
960 public function new_prev_company(Worker $worker) { 963 public function new_prev_company(Worker $worker) {
961 return view('workers.prev_company_form', compact('worker')); 964 return view('workers.prev_company_form', compact('worker'));
962 } 965 }
963 966
964 // Добавление контакта компании 967 // Добавление контакта компании
965 public function add_prev_company(PrevCompanyRequest $request) { 968 public function add_prev_company(PrevCompanyRequest $request) {
966 // Возвращение параметров 969 // Возвращение параметров
967 $all = $request->all(); 970 $all = $request->all();
968 $PrevCompany = PrevCompany::create($all); 971 $PrevCompany = PrevCompany::create($all);
969 972
970 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись'); 973 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись');
971 } 974 }
972 975
973 // Редактирование контакта компании 976 // Редактирование контакта компании
974 public function edit_prev_company(PrevCompany $doc, Worker $worker) { 977 public function edit_prev_company(PrevCompany $doc, Worker $worker) {
975 return view('workers.prev_company_edit_form', compact('doc', 'worker')); 978 return view('workers.prev_company_edit_form', compact('doc', 'worker'));
976 } 979 }
977 980
978 //Сохранение редактирования контакта компании 981 //Сохранение редактирования контакта компании
979 public function update_prev_company(PrevCompany $doc, Request $request){ 982 public function update_prev_company(PrevCompany $doc, Request $request){
980 $all = $request->all(); 983 $all = $request->all();
981 $doc->update($all); 984 $doc->update($all);
982 985
983 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись'); 986 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись');
984 } 987 }
985 988
986 // Удаление контакта предыдущей компании 989 // Удаление контакта предыдущей компании
987 public function delete_prev_company(PrevCompany $doc) { 990 public function delete_prev_company(PrevCompany $doc) {
988 $doc->delete(); 991 $doc->delete();
989 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); 992 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!');
990 } 993 }
991 } 994 }
992 995
993 996
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 public function messages() { 100 public function messages() {
100 return [ 101 return [
101 'required' => 'Поле «:attribute» обязательно для заполнения', 102 'required' => 'Поле «:attribute» обязательно для заполнения',
102 'unique' => 'Такое значение поля «:attribute» уже используется', 103 'unique' => 'Такое значение поля «:attribute» уже используется',
103 'min' => [ 104 'min' => [
104 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 105 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
105 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 106 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
106 ], 107 ],
107 'max' => [ 108 'max' => [
108 'string' => 'Поле «:attribute» должно быть не больше :max символов', 109 'string' => 'Поле «:attribute» должно быть не больше :max символов',
109 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 110 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
110 ], 111 ],
111 'mimes' => 'Файл «:attribute» должен иметь формат :values', 112 'mimes' => 'Файл «:attribute» должен иметь формат :values',
112 'numeric' => 'В поле «:attribute» должно быть указано целое число от 0 до 9999999', 113 'numeric' => 'В поле «:attribute» должно быть указано целое число от 0 до 9999999',
113 ]; 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' => $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 @endsection 83 @endsection
83 84
84 @section('content') 85 @section('content')
85 <section class="thing"> 86 <section class="thing">
86 <div class="container"> 87 <div class="container">
87 <div class="thing__body"> 88 <div class="thing__body">
88 <ul class="breadcrumbs thing__breadcrumbs"> 89 <ul class="breadcrumbs thing__breadcrumbs">
89 <li><a href="{{ route('index') }}">Главная</a></li> 90 <li><a href="{{ route('index') }}">Главная</a></li>
90 <li><a href="{{ route('shipping_companies') }}">Работодатели</a></li> 91 <li><a href="{{ route('shipping_companies') }}">Работодатели</a></li>
91 <li><b>@isset($title) {{ $title }} @else Не указано @endif</b></li> 92 <li><b>@isset($title) {{ $title }} @else Не указано @endif</b></li>
92 </ul> 93 </ul>
93 @if ($company[0]->oficial_status == 1) 94 @if ($company[0]->oficial_status == 1)
94 <div class="thing__badge"> 95 <div class="thing__badge">
95 <svg> 96 <svg>
96 <use xlink:href="{{ asset('images/sprite.svg#badge') }}"></use> 97 <use xlink:href="{{ asset('images/sprite.svg#badge') }}"></use>
97 </svg> 98 </svg>
98 Компания проверена 99 Компания проверена
99 </div> 100 </div>
100 @endif 101 @endif
101 102
102 @if (!empty($company[0]->logo)) 103 @if (!empty($company[0]->logo))
103 <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">
104 @else 105 @else
105 <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">
106 @endif 107 @endif
107 108
108 <h1 class="thing__title">{{ $company[0]->name_company }}</h1> 109 <h1 class="thing__title">{{ $company[0]->name_company }}</h1>
109 <!--<p class="thing__text"> $company[0]->text !!}</p>--> 110 <!--<p class="thing__text"> $company[0]->text !!}</p>-->
110 <div class="thing__buttons"> 111 <div class="thing__buttons">
111 <button type="button" class="button"> 112 <button type="button" class="button">
112 <svg> 113 <svg>
113 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use> 114 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use>
114 </svg> 115 </svg>
115 {{ $company[0]->ads->count() }} вакансии 116 {{ $company[0]->ads->count() }} вакансии
116 </button> 117 </button>
117 @if ($user_id == 0) 118 @if ($user_id == 0)
118 <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">
119 Написать сообщение 120 Написать сообщение
120 </a> 121 </a>
121 @else 122 @else
122 <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">
123 Написать сообщение 124 Написать сообщение
124 </a> 125 </a>
125 @endif 126 @endif
126 </div> 127 </div>
127 </div> 128 </div>
128 </div> 129 </div>
129 </section> 130 </section>
130 <main class="main"> 131 <main class="main">
131 <div class="container"> 132 <div class="container">
132 <div class="main__employer-page"> 133 <div class="main__employer-page">
133 <h2 class="main__employer-page-title">О компании</h2> 134 <h2 class="main__employer-page-title">О компании</h2>
134 <div class="main__employer-page-info"> 135 <div class="main__employer-page-info">
135 <div class="main__employer-page-item"> 136 <div class="main__employer-page-item">
136 <b>Адрес компании</b> 137 <b>Адрес компании</b>
137 <span> 138 <span>
138 {{ $company[0]->address }} 139 {{ $company[0]->address }}
139 </span> 140 </span>
140 </div> 141 </div>
141 <div class="main__employer-page-item"> 142 <div class="main__employer-page-item">
142 <b>Сайт</b> 143 <b>Сайт</b>
143 <span> 144 <span>
144 <a href="{{ $company[0]->site }}">{{ $company[0]->site }}</a> 145 <a href="{{ $company[0]->site }}">{{ $company[0]->site }}</a>
145 </span> 146 </span>
146 </div> 147 </div>
147 <div class="main__employer-page-item"> 148 <div class="main__employer-page-item">
148 <b>Почта</b> 149 <b>Почта</b>
149 <span> 150 <span>
150 <a href="mailto:">{{ $company[0]->email }}</a> 151 <a href="mailto:">{{ $company[0]->email }}</a>
151 </span> 152 </span>
152 </div> 153 </div>
153 <div class="main__employer-page-item"> 154 <div class="main__employer-page-item">
154 <b>Телефон</b> 155 <b>Телефон</b>
155 <span> 156 <span>
156 <a href="tel:{{ $company[0]->telephone }}">{{ $company[0]->telephone }}</a> 157 <a href="tel:{{ $company[0]->telephone }}">{{ $company[0]->telephone }}</a>
157 </span> 158 </span>
158 </div> 159 </div>
159 </div> 160 </div>
160 161
161 <div class="main__employer-page-item"> 162 <div class="main__employer-page-item">
162 <b>Описание</b> 163 <b>Описание</b>
163 <span> 164 <span>
164 {!! $company[0]->text !!} 165 {!! $company[0]->text !!}
165 </span> 166 </span>
166 </div> 167 </div>
167 168
168 <div> 169 <div>
169 170
170 <div class="main__employer-page-tabs"> 171 <div class="main__employer-page-tabs">
171 <button type="button" class="main__employer-page-tabs-item active" 172 <button type="button" class="main__employer-page-tabs-item active"
172 data-tab="1">Флот</button> 173 data-tab="1">Флот</button>
173 <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>
174 </div> 175 </div>
175 176
176 <div class="main__employer-page-body"> 177 <div class="main__employer-page-body">
177 <div class="main__employer-page-body-item showed" data-body="1"> 178 <div class="main__employer-page-body-item showed" data-body="1">
178 <div class="main__employer-page-one"> 179 <div class="main__employer-page-one">
179 @if ($company[0]->flots->count()) 180 @if ($company[0]->flots->count())
180 @foreach ($company[0]->flots as $flot) 181 @foreach ($company[0]->flots as $flot)
181 <a href="" class="main__employer-page-one-item"> 182 <a href="" class="main__employer-page-one-item">
182 @if (!empty($flot->image)) 183 @if (!empty($flot->image))
183 <img src="{{ asset(Storage::url($flot->image)) }}" alt="{{ $flot->name }}"> 184 <img src="{{ asset(Storage::url($flot->image)) }}" alt="{{ $flot->name }}">
184 @else 185 @else
185 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $flot->name }}"> 186 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $flot->name }}">
186 @endif 187 @endif
187 <b>{{ $flot->name }}</b> 188 <b>{{ $flot->name }}</b>
188 <b>{{ $flot->region }}</b> 189 <b>{{ $flot->region }}</b>
189 <span><i>DWT</i> {{ $flot->DWT }}</span> 190 <span><i>DWT</i> {{ $flot->DWT }}</span>
190 <span><i>Мощность ГД</i> {{ $flot->POWER_GD }}</span> 191 <span><i>Мощность ГД</i> {{ $flot->POWER_GD }}</span>
191 <span><i>IMO</i> {{ $flot->IMO }}</span> 192 <span><i>IMO</i> {{ $flot->IMO }}</span>
192 <span>{{ $flot->power }}</span> 193 <span>{{ $flot->power }}</span>
193 </a> 194 </a>
194 @endforeach 195 @endforeach
195 @endif 196 @endif
196 </div> 197 </div>
197 </div> 198 </div>
198 199
199 <div class="main__employer-page-body-item" data-body="2"> 200 <div class="main__employer-page-body-item" data-body="2">
200 <div class="main__employer-page-two"> 201 <div class="main__employer-page-two">
201 @foreach ($ads as $job) 202 @foreach ($ads as $job)
202 <div class="main__employer-page-two-item"> 203 <div class="main__employer-page-two-item">
203 <div class="main__employer-page-two-item-toper"> 204 <div class="main__employer-page-two-item-toper">
204 @if (!empty($company[0]->logo)) 205 @if (!empty($company[0]->logo))
205 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $job->name }}"> 206 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $job->name }}">
206 @else 207 @else
207 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $job->name }}"> 208 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $job->name }}">
208 @endif 209 @endif
209 <span>{{ $job->name }}</span> 210 <span>{{ $job->name }}</span>
210 <!--<span>Описание: 211 <!--<span>Описание:
211 $job->text !!} 212 $job->text !!}
212 </span>--> 213 </span>-->
213 </div> 214 </div>
214 <!--<div class="main__employer-page-two-item-title"> $item->flot }}</div>--> 215 <!--<div class="main__employer-page-two-item-title"> $item->flot }}</div>-->
215 <div class="main__employer-page-two-item-text"> 216 <div class="main__employer-page-two-item-text">
216 @if ((isset($job->jobs)) && ($job->jobs->count())) 217 @if ((isset($job->jobs)) && ($job->jobs->count()))
217 @foreach($job->jobs as $item) 218 @foreach($job->jobs as $item)
218 <a class="main__employer-page-two-item-text-name"> 219 <a class="main__employer-page-two-item-text-name">
219 {{ $item->name }} 220 {{ $item->name }}
220 </a> 221 </a>
221 @endforeach 222 @endforeach
222 @endif 223 @endif
223 <!--<div class="main__employer-page-two-item-text-body"> 224 <!--<div class="main__employer-page-two-item-text-body">
224 <p>Зарплата: $item->min_salary }} - $item->max_salary }}р + $item->sytki }} суточные.</p> 225 <p>Зарплата: $item->min_salary }} - $item->max_salary }}р + $item->sytki }} суточные.</p>
225 <p>Контракт: $item->period }} мес.</p> 226 <p>Контракт: $item->period }} мес.</p>
226 </div>--> 227 </div>-->
227 </div> 228 </div>
228 <!--<div class="main__employer-page-two-item-text"> 229 <!--<div class="main__employer-page-two-item-text">
229 <div class="main__employer-page-two-item-text-name">Район работы</div> 230 <div class="main__employer-page-two-item-text-name">Район работы</div>
230 <div class="main__employer-page-two-item-text-body"> 231 <div class="main__employer-page-two-item-text-body">
231 <p> $item->region }}</p> 232 <p> $item->region }}</p>
232 </div> 233 </div>
233 </div> 234 </div>
234 <div class="main__employer-page-two-item-text"> 235 <div class="main__employer-page-two-item-text">
235 <div class="main__employer-page-two-item-text-name">Посадка</div> 236 <div class="main__employer-page-two-item-text-name">Посадка</div>
236 <div class="main__employer-page-two-item-text-body"> 237 <div class="main__employer-page-two-item-text-body">
237 <p> $item->start }}</p> 238 <p> $item->start }}</p>
238 !! $item->description !!} 239 !! $item->description !!}
239 </div> 240 </div>
240 </div>--> 241 </div>-->
241 <div class="main__employer-page-two-item-text"> 242 <div class="main__employer-page-two-item-text">
242 <div class="main__employer-page-two-item-text-name">Звонить по вопросам на: 243 <div class="main__employer-page-two-item-text-name">Звонить по вопросам на:
243 </div> 244 </div>
244 <div class="main__employer-page-two-item-text-body"> 245 <div class="main__employer-page-two-item-text-body">
245 <a href="tel:{{ $job->telephone }}">{{ $job->telephone }}</a> 246 <a href="tel:{{ $job->telephone }}">{{ $job->telephone }}</a>
246 </div> 247 </div>
247 </div> 248 </div>
248 <div class="main__employer-page-two-item-text"> 249 <div class="main__employer-page-two-item-text">
249 <div class="main__employer-page-two-item-text-name">Анкеты присылать на 250 <div class="main__employer-page-two-item-text-name">Анкеты присылать на
250 почту: 251 почту:
251 </div> 252 </div>
252 <div class="main__employer-page-two-item-text-body"> 253 <div class="main__employer-page-two-item-text-body">
253 <a href="mailto: {{ $job->email }}">{{ $job->email }}</a> 254 <a href="mailto: {{ $job->email }}">{{ $job->email }}</a>
254 </div> 255 </div>
255 </div> 256 </div>
256 @if ((isset($job->jobs)) && ($job->jobs->count())) 257 @if ((isset($job->jobs)) && ($job->jobs->count()))
257 <div class="main__employer-page-two-item-tags"> 258 <div class="main__employer-page-two-item-tags">
258 @foreach ($job->jobs as $item) 259 @foreach ($job->jobs as $item)
259 <span class="main__employer-page-two-item-tag">#{{ $item->name }}</span> 260 <span class="main__employer-page-two-item-tag">#{{ $item->name }}</span>
260 @endforeach 261 @endforeach
261 </div> 262 </div>
262 @endif 263 @endif
263 <div class="main__employer-page-two-item-buttons"> 264 <div class="main__employer-page-two-item-buttons">
264 265
265 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $job->id }}" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}' 266 <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 class="button main__employer-page-two-item-button js_send_it_button">Оставить 267 class="button main__employer-page-two-item-button js_send_it_button">Оставить
267 отклик...</button> 268 отклик...</button>
268 269
269 <!--<a href="#" 270 <!--<a href="#"
270 class="button button_light main__employer-page-two-item-button">Подробнее</a>--> 271 class="button button_light main__employer-page-two-item-button">Подробнее</a>-->
271 </div> 272 </div>
272 <div class="main__employer-page-two-item-bottom"> 273 <div class="main__employer-page-two-item-bottom">
273 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($job->updated_at)) }}</div> 274 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($job->updated_at)) }}</div>
274 <button type="button" 275 <button type="button" id="like{{ $job->id }}" data-val="{{ $job->id }}"
275 class="like main__employer-page-two-item-bottom-like js-toggle"> 276 class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($job) }}">
276 <svg> 277 <svg>
277 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 278 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
278 </svg> 279 </svg>
279 </button> 280 </button>
280 </div> 281 </div>
281 </div> 282 </div>
282 @endforeach 283 @endforeach
283 284
284 <div style="margin-top: 20px"> 285 <div style="margin-top: 20px">
285 {{ $ads->onEachSide(0)->appends($_GET)->links('paginate') }} 286 {{ $ads->onEachSide(0)->appends($_GET)->links('paginate') }}
286 </div> 287 </div>
287 <!--<button type="button" class="button button_light button_more main__employer-page-two-more js-toggle js-parent-toggle"> 288 <!--<button type="button" class="button button_light button_more main__employer-page-two-more js-toggle js-parent-toggle">
288 <span>Показать ещё</span> 289 <span>Показать ещё</span>
289 <span>Скрыть</span> 290 <span>Скрыть</span>
290 </button>--> 291 </button>-->
291 </div> 292 </div>
292 </div> 293 </div>
293 </div> 294 </div>
294 </div> 295 </div>
295 </div> 296 </div>
296 </div> 297 </div>
297 </main> 298 </main>
298 @endsection 299 @endsection
299 300
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 <link rel="stylesheet" href="{{ asset('css/telegram.css') }}"> 11 <link rel="stylesheet" href="{{ asset('css/telegram.css') }}">
12 <link rel="stylesheet" href="{{ asset('css/star-rating.min.css') }}"> 12 <link rel="stylesheet" href="{{ asset('css/star-rating.min.css') }}">
13 <link rel="stylesheet" href="{{ asset('css/style_may2024.css') }}"> 13 <link rel="stylesheet" href="{{ asset('css/style_may2024.css') }}">
14 <style> 14 <style>
15 .err_red { 15 .err_red {
16 border: red 2px solid; 16 border: red 2px solid;
17 } 17 }
18 18
19 .input[disabled] { 19 .input[disabled] {
20 /* color: #9c9d9d; */ 20 /* color: #9c9d9d; */
21 background: #FFFFFF; 21 background: #FFFFFF;
22 } 22 }
23 </style> 23 </style>
24 </head> 24 </head>
25 25
26 <body id="body" onload="createCaptcha()"> 26 <body id="body" onload="createCaptcha()">
27 <a href="#body" class="to-top js-scroll-to"> 27 <a href="#body" class="to-top js-scroll-to">
28 <svg> 28 <svg>
29 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> 29 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use>
30 </svg> 30 </svg>
31 </a> 31 </a>
32 32
33 <div> <!-- BEGIN TOP WRAPPER --> 33 <div> <!-- BEGIN TOP WRAPPER -->
34 <header class="header"> 34 <header class="header">
35 <div class="container"> 35 <div class="container">
36 <div class="header__body"> 36 <div class="header__body">
37 <div class="header__left"> 37 <div class="header__left">
38 <a href="{{ route('index') }}" class="header__logo"> 38 <a href="{{ route('index') }}" class="header__logo">
39 <svg> 39 <svg>
40 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> 40 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use>
41 </svg> 41 </svg>
42 </a> 42 </a>
43 <nav class="header__menu"> 43 <nav class="header__menu">
44 <a href="{{ route('vacancies') }}" class="header__menu-item">Вакансии</a> 44 <a href="{{ route('vacancies') }}" class="header__menu-item">Вакансии</a>
45 <a href="{{ route('shipping_companies') }}" class="header__menu-item">Судоходные компании</a> 45 <a href="{{ route('shipping_companies') }}" class="header__menu-item">Судоходные компании</a>
46 <a href="{{ route('education') }}" class="header__menu-item">Образование</a> 46 <a href="{{ route('education') }}" class="header__menu-item">Образование</a>
47 </nav> 47 </nav>
48 </div> 48 </div>
49 <div class="header__right"> 49 <div class="header__right">
50 @guest 50 @guest
51 51
52 @else 52 @else
53 <a href="@if ($UserId->is_worker) {{ route('worker.cabinet') }} @else {{ route('employer.cabinet') }} @endif" class="header__notifs header__notifs_actived"> 53 <a href="@if ($UserId->is_worker) {{ route('worker.cabinet') }} @else {{ route('employer.cabinet') }} @endif" class="header__notifs header__notifs_actived">
54 <svg> 54 <svg>
55 <use xlink:href="{{ asset('images/sprite.svg#ring') }}"></use> 55 <use xlink:href="{{ asset('images/sprite.svg#ring') }}"></use>
56 </svg> 56 </svg>
57 <span>Уведомления</span> 57 <span>Уведомления</span>
58 </a> 58 </a>
59 59
60 @endguest 60 @endguest
61 <div class="header__right-line"></div> 61 <div class="header__right-line"></div>
62 <button class="header__burger"> 62 <button class="header__burger">
63 <svg> 63 <svg>
64 <use xlink:href="{{ asset('images/sprite.svg#burger') }}"></use> 64 <use xlink:href="{{ asset('images/sprite.svg#burger') }}"></use>
65 </svg> 65 </svg>
66 </button> 66 </button>
67 @guest 67 @guest
68 <a class="button header__sign" data-fancybox data-src="#sign" data-options='{"touch":false,"autoFocus":false}'>Войти</a> 68 <a class="button header__sign" data-fancybox data-src="#sign" data-options='{"touch":false,"autoFocus":false}'>Войти</a>
69 @else 69 @else
70 <a class="button header__sign" href="{{ route('logout') }}">Выйти</a> 70 <a class="button header__sign" href="{{ route('logout') }}">Выйти</a>
71 @endguest 71 @endguest
72 </div> 72 </div>
73 </div> 73 </div>
74 </div> 74 </div>
75 </header> 75 </header>
76 76
77 @yield('content') 77 @yield('content')
78 </div> <!-- END TOP WRAPPER --> 78 </div> <!-- END TOP WRAPPER -->
79 79
80 <div> <!-- BEGIN BOTTOM WRAPPER --> 80 <div> <!-- BEGIN BOTTOM WRAPPER -->
81 <footer class="footer"> 81 <footer class="footer">
82 <div class="container"> 82 <div class="container">
83 <div class="footer__mobile"> 83 <div class="footer__mobile">
84 84
85 <button class="footer__mobile-toper js-toggle active"> 85 <button class="footer__mobile-toper js-toggle active">
86 <a href="{{ route('index') }}"> 86 <a href="{{ route('index') }}">
87 <svg> 87 <svg>
88 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> 88 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use>
89 </svg> 89 </svg>
90 </a> 90 </a>
91 <span> 91 <span>
92 <svg> 92 <svg>
93 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> 93 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use>
94 </svg> 94 </svg>
95 </span> 95 </span>
96 </button> 96 </button>
97 <div class="footer__mobile-menu"> 97 <div class="footer__mobile-menu">
98 <div class="footer__mobile-menu-item"> 98 <div class="footer__mobile-menu-item">
99 <button class="js-toggle"> 99 <button class="js-toggle">
100 <b>Соискателям</b> 100 <b>Соискателям</b>
101 <span><svg> 101 <span><svg>
102 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> 102 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use>
103 </svg></span> 103 </svg></span>
104 </button> 104 </button>
105 <div> 105 <div>
106 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a>
106 <a href="{{ route('vacancies') }}">Вакансии</a> 107 <a href="{{ route('vacancies') }}">Вакансии</a>
107 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a> 108 <!--<a href=" route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>-->
108 <a href="{{ route('education') }}">Образование</a> 109 <a href="{{ route('education') }}">Образование</a>
109 <a href="{{ route('news') }}">Новости</a> 110 <a href="{{ route('news') }}">Новости</a>
110 <a href="{{ route('contacts') }}">Контакты</a> 111 <a href="{{ $companies[0]->telegram }}">Телеграм</a>
112 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a>
113 <!--<a href=" route('contacts') }}">Контакты</a>-->
111 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a> 114 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a>
112 </div> 115 </div>
113 </div> 116 </div>
114 <div class="footer__mobile-menu-item"> 117 <div class="footer__mobile-menu-item">
115 <button class="js-toggle"> 118 <button class="js-toggle">
116 <b>Работодателям</b> 119 <b>Работодателям</b>
117 <span><svg> 120 <span><svg>
118 <use xlink:href="{{asset('images/sprite.svg#arrow-top') }}"></use> 121 <use xlink:href="{{asset('images/sprite.svg#arrow-top') }}"></use>
119 </svg></span> 122 </svg></span>
120 </button> 123 </button>
121 <div> 124 <div>
122 <a href="{{ route('register') }}">Регистрация</a> 125 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a>
126 <!--<a href=" route('register') }}">Регистрация</a>-->
123 <a href="{{ route('bd_resume') }}">База резюме</a> 127 <a href="{{ route('bd_resume') }}">База резюме</a>
124 <a href="{{ route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a> 128 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>
125 <a href="{{ route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a> 129 <!--<a href=" route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a>-->
126 <a href="{{ route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a> 130 <!--<a href=" route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a>-->
131 <!--<a href=" route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a>-->
132 <a href="{{ $companies[0]->telegram }}">Телеграм</a>
133 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a>
127 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a> 134 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a>
128 </div> 135 </div>
129 </div> 136 </div>
130 </div> 137 </div>
131 <div class="footer__mobile-contacts"> 138 <div class="footer__mobile-contacts">
132 <b>Контакты</b> 139 <b>Контакты</b>
133 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a> 140 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a>
134 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a> 141 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a>
135 </div> 142 </div>
136 <div class="footer__mobile-bottom"> 143 <div class="footer__mobile-bottom">
137 <div class="socials"> 144 <div class="socials">
138 <a href="{{ $companies[0]->vkontact }}" target="_blank"> 145 <a href="{{ $companies[0]->vkontact }}" target="_blank">
139 <svg> 146 <svg>
140 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> 147 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use>
141 </svg> 148 </svg>
142 </a> 149 </a>
143 <a href="{{ $companies[0]->telegram }}" target="_blank"> 150 <a href="{{ $companies[0]->telegram }}" target="_blank">
144 <svg> 151 <svg>
145 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> 152 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use>
146 </svg> 153 </svg>
147 </a> 154 </a>
148 </div> 155 </div>
149 <nav class="footer__mobile-links"> 156 <nav class="footer__mobile-links">
150 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a> 157 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a>
151 <span></span> 158 <span></span>
152 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a> 159 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a>
153 </nav> 160 </nav>
154 &copy; 2023 &mdash; RekaMore.su 161 &copy; 2023 &mdash; RekaMore.su
155 <a href="{{ route('index') }}" class="nls" target="_blank"> 162 <a href="{{ route('index') }}" class="nls" target="_blank">
156 <svg> 163 <svg>
157 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use> 164 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use>
158 </svg> 165 </svg>
159 <span> 166 <span>
160 Дизайн и разработка: 167 Дизайн и разработка:
161 <b>NoLogoStudio.ru</b> 168 <b>NoLogoStudio.ru</b>
162 </span> 169 </span>
163 </a> 170 </a>
164 </div> 171 </div>
165 </div> 172 </div>
166 <div class="footer__main"> 173 <div class="footer__main">
167 <div class="footer__main-body"> 174 <div class="footer__main-body">
168 175
169 <a href="" class="footer__main-logo"> 176 <a href="" class="footer__main-logo">
170 <svg> 177 <svg>
171 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> 178 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use>
172 </svg> 179 </svg>
173 </a> 180 </a>
174 <div class="footer__main-col"> 181 <div class="footer__main-col">
175 <div class="footer__main-title">Соискателям</div> 182 <div class="footer__main-title">Соискателям</div>
176 <nav> 183 <nav>
184 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a>
177 <a href="{{ route('vacancies') }}">Вакансии</a> 185 <a href="{{ route('vacancies') }}">Вакансии</a>
178 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a> 186 <!--<a href=" route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>-->
179 <a href="{{ route('education') }}">Образование</a> 187 <a href="{{ route('education') }}">Образование</a>
180 <a href="{{ route('news') }}">Новости</a> 188 <a href="{{ route('news') }}">Новости</a>
181 <a href="{{ route('contacts') }}">Контакты</a> 189 <!--<a href=" route('contacts') }}">Контакты</a>-->
190 <a href="{{ $companies[0]->telegram }}">Телеграм</a>
191 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a>
182 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a> 192 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a>
183 </nav> 193 </nav>
184 </div> 194 </div>
185 <div class="footer__main-col"> 195 <div class="footer__main-col">
186 <div class="footer__main-title">Работодателям</div> 196 <div class="footer__main-title">Работодателям</div>
187 <nav> 197 <nav>
188 <a href="{{ route('register') }}">Регистрация</a> 198 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a>
199 <!--<a href=" route('register') }}">Регистрация</a>-->
189 <a href="{{ route('bd_resume') }}">База резюме</a> 200 <a href="{{ route('bd_resume') }}">База резюме</a>
190 <a href="{{ route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a> 201 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>
191 <a href="{{ route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a> 202 <!--<a href=" route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a>-->
192 <a href="{{ route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a> 203 <!--<a href=" route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a>-->
204 <!--<a href=" route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a>-->
205 <a href="{{ $companies[0]->telegram }}">Телеграм</a>
206 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a>
193 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a> 207 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a>
194 </nav> 208 </nav>
195 </div> 209 </div>
196 210
197 <div class="footer__main-col"> 211 <div class="footer__main-col">
198 <div class="footer__main-title">Контакты</div> 212 <div class="footer__main-title">Контакты</div>
199 <div class="footer__main-contacts"> 213 <div class="footer__main-contacts">
200 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a> 214 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a>
201 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a> 215 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a>
202 </div> 216 </div>
203 <div class="socials"> 217 <div class="socials">
204 <a href="{{ $companies[0]->vkontact }}" target="_blank"> 218 <a href="{{ $companies[0]->vkontact }}" target="_blank">
205 <svg> 219 <svg>
206 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> 220 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use>
207 </svg> 221 </svg>
208 </a> 222 </a>
209 <a href="{{ $companies[0]->telegram }}" target="_blank"> 223 <a href="{{ $companies[0]->telegram }}" target="_blank">
210 <svg> 224 <svg>
211 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> 225 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use>
212 </svg> 226 </svg>
213 </a> 227 </a>
214 </div> 228 </div>
215 </div> 229 </div>
216 </div> 230 </div>
217 231
218 <div class="footer__main-copy"> 232 <div class="footer__main-copy">
219 <div>&copy; 2023 &mdash; RekaMore.su</div> 233 <div>&copy; 2023 &mdash; RekaMore.su</div>
220 <nav> 234 <nav>
221 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a> 235 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a>
222 <span></span> 236 <span></span>
223 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a> 237 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a>
224 </nav> 238 </nav>
225 <div> @if (isset($_COOKIE['favorite_vacancy'])) Куки вакансий: {{ print_r($_COOKIE['favorite_vacancy']) }} @endif</div> 239 <div> @if (isset($_COOKIE['favorite_vacancy'])) Куки вакансий: {{ print_r($_COOKIE['favorite_vacancy']) }} @endif</div>
226 <a href="{{ route('index') }}" class="nls" target="_blank"> 240 <a href="{{ route('index') }}" class="nls" target="_blank">
227 <svg> 241 <svg>
228 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use> 242 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use>
229 </svg> 243 </svg>
230 <span> 244 <span>
231 Дизайн и разработка: 245 Дизайн и разработка:
232 <b>NoLogoStudio.ru</b> 246 <b>NoLogoStudio.ru</b>
233 </span> 247 </span>
234 </a> 248 </a>
235 </div> 249 </div>
236 </div> 250 </div>
237 </div> 251 </div>
238 </footer> 252 </footer>
239 </div> <!-- END BOTTOM WRAPPER --> 253 </div> <!-- END BOTTOM WRAPPER -->
240 254
241 <div hidden> <!-- BEGIN MODALS WRAPPER --> 255 <div hidden> <!-- BEGIN MODALS WRAPPER -->
242 <!-- Соискатель отправляет сообщение работодателю --> 256 <!-- Соискатель отправляет сообщение работодателю -->
243 @include('modals.send_worker_new') 257 @include('modals.send_worker_new')
244 258
245 <!-- Работодатель отправляет сообщение соискателю --> 259 <!-- Работодатель отправляет сообщение соискателю -->
246 @include('modals.send_employer') 260 @include('modals.send_employer')
247 261
248 <!-- Сообщение-предупреждение о том, что сообщения только можно отправить авторизованным пользователям --> 262 <!-- Сообщение-предупреждение о том, что сообщения только можно отправить авторизованным пользователям -->
249 @include('modals.send_message_noaut') 263 @include('modals.send_message_noaut')
250 264
251 @include('modals.send_message_noaut2') 265 @include('modals.send_message_noaut2')
252 266
253 <!-- Форма авторизации --> 267 <!-- Форма авторизации -->
254 @include('modals.send_login') 268 @include('modals.send_login')
255 269
256 <!-- Сбросить пароль --> 270 <!-- Сбросить пароль -->
257 @include('modals.reset_password') 271 @include('modals.reset_password')
258 272
259 <!-- Регистрация --> 273 <!-- Регистрация -->
260 @include('modals.register') 274 @include('modals.register')
261 275
262 <!-- Благодарность по отправке сообщения работодателю --> 276 <!-- Благодарность по отправке сообщения работодателю -->
263 @include('modals.thank_you_send_employer') 277 @include('modals.thank_you_send_employer')
264 278
265 <!-- Благодарность по отправке сообщения менеджеру --> 279 <!-- Благодарность по отправке сообщения менеджеру -->
266 @include('modals.thank_you_send_manager') 280 @include('modals.thank_you_send_manager')
267 281
268 <!-- Благодарность после регистрации --> 282 <!-- Благодарность после регистрации -->
269 @include('modals.thank_you_send_for_employer') 283 @include('modals.thank_you_send_for_employer')
270 284
271 <!-- Благодарность после регистрации для работника --> 285 <!-- Благодарность после регистрации для работника -->
272 @include('modals.thank_you_send_for_worker') 286 @include('modals.thank_you_send_for_worker')
273 287
274 <!-- Подтверждение удаления профиля --> 288 <!-- Подтверждение удаления профиля -->
275 @include('modals.delete_profile') 289 @include('modals.delete_profile')
276 290
277 <!-- Подверждение об удалении профиля --> 291 <!-- Подверждение об удалении профиля -->
278 @include('modals.success_delete_profile') 292 @include('modals.success_delete_profile')
279 293
280 </div> <!-- END MODALS WRAPPER --> 294 </div> <!-- END MODALS WRAPPER -->
281 295
282 296
283 <script src="{{ asset('js/jquery.maskedinput.js') }}"></script> 297 <script src="{{ asset('js/jquery.maskedinput.js') }}"></script>
284 <script src="{{ asset('js/jquery.fancybox.js') }}"></script> 298 <script src="{{ asset('js/jquery.fancybox.js') }}"></script>
285 <script src="{{ asset('js/jquery.select2.js') }}"></script> 299 <script src="{{ asset('js/jquery.select2.js') }}"></script>
286 <script src="{{ asset('js/swiper.js') }}"></script> 300 <script src="{{ asset('js/swiper.js') }}"></script>
287 <script src="{{ asset('js/script-vc.js') }}"></script> 301 <script src="{{ asset('js/script-vc.js') }}"></script>
288 <script src="{{ asset('js/star-rating.min.js') }}"></script> 302 <script src="{{ asset('js/star-rating.min.js') }}"></script>
289 <script> 303 <script>
290 var getUrlParameter = function getUrlParameter(sParam) { 304 var getUrlParameter = function getUrlParameter(sParam) {
291 var sPageURL = decodeURIComponent(window.location.search.substring(1)), 305 var sPageURL = decodeURIComponent(window.location.search.substring(1)),
292 sURLVariables = sPageURL.split('&'), 306 sURLVariables = sPageURL.split('&'),
293 sParameterName, 307 sParameterName,
294 i; 308 i;
295 for (i = 0; i < sURLVariables.length; i++) { 309 for (i = 0; i < sURLVariables.length; i++) {
296 sParameterName = sURLVariables[i].split('='); 310 sParameterName = sURLVariables[i].split('=');
297 if (sParameterName[0] === sParam) { 311 if (sParameterName[0] === sParam) {
298 return sParameterName[1] === undefined ? true : sParameterName[1]; 312 return sParameterName[1] === undefined ? true : sParameterName[1];
299 } 313 }
300 } 314 }
301 }; 315 };
302 </script> 316 </script>
303 @include('js.modals') 317 @include('js.modals')
304 @include('js.captha') 318 @include('js.captha')
305 @yield('scripts') 319 @yield('scripts')
306 </body> 320 </body>
307 </html> 321 </html>
308 322
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 236
230 @if (isset($Query[0]->infobloks)) 237 @foreach($Query[0]->infobloks as $it)
231 @if ($Query[0]->infobloks->count()) 238 @if ($info->id == $it->id)
232 <table class="main__table"> 239 <tr>
233 <tbody> 240 <td><b>{{ $it->name }}</b></td>
234 @foreach($Query[0]->infobloks as $it) 241 <td>
235 <tr> 242 @if ($it->model_dop_info[0]->status == 0) Не указано
236 <td><b>{{ $it->name }}</b></td> 243 @elseif($it->model_dop_info[0]->status==1) В наличии
237 <td> 244 @else Отсутствует
238 @if ($it->model_dop_info[0]->status == 0) Не указано 245 @endif
239 @elseif($it->model_dop_info[0]->status==1) В наличии 246 </td>
240 @else Отсутствует 247 </tr>
241 @endif 248 @php $finder = true; @endphp
242 </td> 249 @endif
243 </tr> 250 @endforeach
244 @endforeach 251 @endif
245 </tbody> 252 @endif
246 </table> 253 @if (!$finder)
247 @endif 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 @endif 264 @endif
249 </div> 265 </div>
250 </div> 266 </div>
251 </div> 267 </div>
252 268
253 <div class="main__resume-profile-about"> 269 <div class="main__resume-profile-about">
254 <h2 class="main__resume-profile-about-title">О себе</h2> 270 <h2 class="main__resume-profile-about-title">О себе</h2>
255 <p class="main__resume-profile-about-text">{{ $Query[0]->text }}</p> 271 <p class="main__resume-profile-about-text">{{ $Query[0]->text }}</p>
256 @if (App\Classes\StatusUser::Status()==0) 272 @if (App\Classes\StatusUser::Status()==0)
257 @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message)) 273 @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message))
258 <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> 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 @endif 275 @endif
260 @endif 276 @endif
261 </div> 277 </div>
262 <div class="main__resume-profile-info"> 278 <div class="main__resume-profile-info">
263 <h2 class="main__resume-profile-info-title">Данные о прошлых компаниях</h2> 279 <h2 class="main__resume-profile-info-title">Данные о прошлых компаниях</h2>
264 <div class="main__resume-profile-info-body"> 280 <div class="main__resume-profile-info-body">
265 @if ((isset($Query[0]->prev_company)) && ($Query[0]->prev_company->count())) 281 @if ((isset($Query[0]->prev_company)) && ($Query[0]->prev_company->count()))
266 @foreach ($Query[0]->prev_company as $it) 282 @foreach ($Query[0]->prev_company as $it)
267 <div class="main__resume-profile-info-body-item"> 283 <div class="main__resume-profile-info-body-item">
268 <h3 class="main__resume-profile-info-body-subtitle">{{ $it->name_company }}</h3> 284 <h3 class="main__resume-profile-info-body-subtitle">{{ $it->name_company }}</h3>
269 <ul class="main__resume-profile-info-body-inner"> 285 <ul class="main__resume-profile-info-body-inner">
270 <li> 286 <li>
271 <b>Руководитель</b> 287 <b>Руководитель</b>
272 <span>{{ $it->direct }}</span> 288 <span>{{ $it->direct }}</span>
273 </li> 289 </li>
274 <li> 290 <li>
275 <b>Телефон того, кто может дать рекомендацию</b> 291 <b>Телефон того, кто может дать рекомендацию</b>
276 <span> 292 <span>
277 @if (!empty($it->telephone)) 293 @if (!empty($it->telephone))
278 <a href="tel:{{$it->telephone }}">{{ $it->telephone }}</a> 294 <a href="tel:{{$it->telephone }}">{{ $it->telephone }}</a>
279 @endif 295 @endif
280 @if (!empty($it->telephone2)) 296 @if (!empty($it->telephone2))
281 <a href="tel:{{$it->telephone2 }}">{{ $it->telephone2 }}</a> 297 <a href="tel:{{$it->telephone2 }}">{{ $it->telephone2 }}</a>
282 @endif 298 @endif
283 </span> 299 </span>
284 </li> 300 </li>
285 </ul> 301 </ul>
286 </div> 302 </div>
287 @endforeach 303 @endforeach
288 @else 304 @else
289 <div class="main__resume-profile-info-body-item"> 305 <div class="main__resume-profile-info-body-item">
290 <h3 class="main__resume-profile-info-body-subtitle">Нету данных о компании</h3> 306 <h3 class="main__resume-profile-info-body-subtitle">Нету данных о компании</h3>
291 </div> 307 </div>
292 @endif 308 @endif
293 </div> 309 </div>
294 </div> 310 </div>
295 311
296 <div class="main__resume-profile-info"> 312 <div class="main__resume-profile-info">
297 <h2 class="main__resume-profile-info-title">Количество просмотров страницы: ({{ $stat[0]->lookin }})</h2> 313 <h2 class="main__resume-profile-info-title">Количество просмотров страницы: ({{ $stat[0]->lookin }})</h2>
298 </div> 314 </div>
299 315
300 <div class="main__resume-profile-info"> 316 <div class="main__resume-profile-info">
301 <h2 class="main__resume-profile-info-title">Отзывы о работнике ({{ $Query[0]->response->count() }})</h2> 317 <h2 class="main__resume-profile-info-title">Отзывы о работнике ({{ $Query[0]->response->count() }})</h2>
302 <div class="main__resume-profile-info-body"> 318 <div class="main__resume-profile-info-body">
303 @if ((isset($Query[0]->response)) && ($Query[0]->response->count())) 319 @if ((isset($Query[0]->response)) && ($Query[0]->response->count()))
304 <div class="main__resume-profile-info-body-item"> 320 <div class="main__resume-profile-info-body-item">
305 <ul class="main__resume-profile-info-body-inner"> 321 <ul class="main__resume-profile-info-body-inner">
306 @php $i = 1; @endphp 322 @php $i = 1; @endphp
307 @foreach($Query[0]->response as $it) 323 @foreach($Query[0]->response as $it)
308 <li> 324 <li>
309 <span><h3>Комментарий №{{$i}}</h3></span> 325 <span><h3>Комментарий №{{$i}}</h3></span>
310 <span><b>Оценка человека: {{ $it->stars }}</b></span> 326 <span><b>Оценка человека: {{ $it->stars }}</b></span>
311 <span><b>Сообщение: </b>{{ $it->message }}</span> 327 <span><b>Сообщение: </b>{{ $it->message }}</span>
312 </li> 328 </li>
313 @php $i++; @endphp 329 @php $i++; @endphp
314 @endforeach 330 @endforeach
315 </ul> 331 </ul>
316 </div> 332 </div>
317 @else 333 @else
318 <div class="main__resume-profile-info-body-item"> 334 <div class="main__resume-profile-info-body-item">
319 <h3 class="main__resume-profile-info-body-subtitle">Нету комментариев</h3> 335 <h3 class="main__resume-profile-info-body-subtitle">Нету комментариев</h3>
320 </div> 336 </div>
321 @endif 337 @endif
322 </div> 338 </div>
323 </div> 339 </div>
324 340
325 <div class="main__resume-profile-review"> 341 <div class="main__resume-profile-review">
326 <form action="{{ route('stars_answer') }}" method="POST"> 342 <form action="{{ route('stars_answer') }}" method="POST">
327 @csrf 343 @csrf
328 <h2 class="main__resume-profile-review-title">Оставить отзыв о работнике</h2> 344 <h2 class="main__resume-profile-review-title">Оставить отзыв о работнике</h2>
329 <div class="rate"> 345 <div class="rate">
330 <div class="rate__label">Ваша оценка:</div> 346 <div class="rate__label">Ваша оценка:</div>
331 <div class="rate__stars"> 347 <div class="rate__stars">
332 <select name="stars" id="stars" class="star-rating js-stars"> 348 <select name="stars" id="stars" class="star-rating js-stars">
333 <option value="5">5</option> 349 <option value="5">5</option>
334 <option value="4">4</option> 350 <option value="4">4</option>
335 <option value="3">3</option> 351 <option value="3">3</option>
336 <option value="2">2</option> 352 <option value="2">2</option>
337 <option value="1" selected>1</option> 353 <option value="1" selected>1</option>
338 </select> 354 </select>
339 </div> 355 </div>
340 </div> 356 </div>
341 <input type="hidden" name="worker_id" id="worker_id" value="{{ $Query[0]->id }}"/> 357 <input type="hidden" name="worker_id" id="worker_id" value="{{ $Query[0]->id }}"/>
342 <div class="main__resume-profile-review-body"> 358 <div class="main__resume-profile-review-body">
343 <h3>Ваш отзыв</h3> 359 <h3>Ваш отзыв</h3>
344 <textarea class="textarea" name="message" id="message" placeholder="Текст отзыва&hellip;" required></textarea> 360 <textarea class="textarea" name="message" id="message" placeholder="Текст отзыва&hellip;" required></textarea>
345 <button type="submit" class="button">Оставить отзыв</button> 361 <button type="submit" class="button">Оставить отзыв</button>
346 </div> 362 </div>
347 </form> 363 </form>
348 </div> 364 </div>
349 </div> 365 </div>
350 </div> 366 </div>
351 </main> 367 </main>
352 </div> 368 </div>
353 @endsection 369 @endsection
354 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