Commit ad20c698a91ba734fc10b4c8ce749bf4593a6e40

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

Результаты на воскресенье 10 марта 2024

Showing 10 changed files with 553 additions and 21 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\Employer; 5 use App\Models\Employer;
6 use Illuminate\Http\Request; 6 use Illuminate\Http\Request;
7 7
8 class CompanyController extends Controller 8 class CompanyController extends Controller
9 { 9 {
10 public function shipping_companies(Request $request) { 10 public function shipping_companies(Request $request) {
11 $emps = Employer::query()->with('ads'); 11 $emps = Employer::query()->with('ads');
12 if (($request->has('search')) && (!empty($request->get('search')))) { 12 if (($request->has('search')) && (!empty($request->get('search')))) {
13 $search = $request->get('search'); 13 $search = $request->get('search');
14 $emps = $emps->where('name_company', 'LIKE', "%$search%"); 14 $emps = $emps->where('name_company', 'LIKE', "%$search%");
15 } 15 }
16 16
17 $count_emps = $emps->count(); 17 $count_emps = $emps->count();
18 18
19 if ($request->get('sort')) { 19 if ($request->get('sort')) {
20 $sort = $request->get('sort'); 20 $sort = $request->get('sort');
21 switch ($sort) { 21 switch ($sort) {
22 case 'name_up': $emps = $emps->orderBy('name_company')->orderBy('id'); break; 22 case 'name_up': $emps = $emps->orderBy('name_company')->orderBy('id'); break;
23 case 'name_down': $emps = $emps->orderByDesc('name_company')->orderby('id'); break; 23 case 'name_down': $emps = $emps->orderByDesc('name_company')->orderby('id'); break;
24 case 'created_at_up': $emps = $emps->OrderBy('created_at')->orderBy('id'); break; 24 case 'created_at_up': $emps = $emps->OrderBy('created_at')->orderBy('id'); break;
25 case 'created_at_down': $emps = $emps->orderByDesc('created_at')->orderBy('id'); break; 25 case 'created_at_down': $emps = $emps->orderByDesc('created_at')->orderBy('id'); break;
26 case 'default': $emps = $emps->orderBy('id')->orderby('updated_at'); break; 26 case 'default': $emps = $emps->orderBy('id')->orderby('updated_at'); break;
27 default: $emps = $emps->orderBy('id')->orderby('updated_at'); break; 27 default: $emps = $emps->orderBy('id')->orderby('updated_at'); break;
28 } 28 }
29 } 29 }
30 30
31 $emps = $emps->paginate(4); 31 $emps = $emps->paginate(4);
32 32
33 if ($request->ajax()) { 33 if ($request->ajax()) {
34 if ($request->get('block') == '1') 34 if ($request->get('block') == '1')
35 return view('ajax.companies', compact('emps', 'count_emps')); 35 return view('ajax.companies', compact('emps', 'count_emps'));
36 else 36 else
37 return view('ajax.companies2', compact('emps', 'count_emps')); 37 return view('ajax.companies2', compact('emps', 'count_emps'));
38 } else { 38 } else {
39 return view('companies', compact('emps', 'count_emps')); 39 return view('companies', compact('emps', 'count_emps'));
40 } 40 }
41 } 41 }
42 42
43 public function info_company(Employer $company) { 43 public function info_company(Employer $company) {
44 $user_id = Auth()->user()->id; 44 if (isset(Auth()->user()->id)) {
45 $user_id = Auth()->user()->id;
46 } else {
47 $user_id = 0;
48 }
45 $company = Employer::with('ads')->with('flots')->with('users') 49 $company = Employer::with('ads')->with('flots')->with('users')
46 ->where('id', '=', $company->id)->get(); 50 ->where('id', '=', $company->id)->get();
51
47 $title = $company[0]->name_company; 52 $title = $company[0]->name_company;
48 return view('info_company', compact('company', 'user_id', 'title')); 53
54 return view('info_company_new', compact('company', 'user_id', 'title'));
49 } 55 }
50 } 56 }
51 57
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\Tools; 5 use App\Classes\Tools;
6 use App\Mail\MailRegistration; 6 use App\Mail\MailRegistration;
7 use App\Mail\MailRepair; 7 use App\Mail\MailRepair;
8 use App\Models\Ad_employer; 8 use App\Models\Ad_employer;
9 use App\Models\Category; 9 use App\Models\Category;
10 use App\Models\Education; 10 use App\Models\Education;
11 use App\Models\Employer; 11 use App\Models\Employer;
12 use App\Models\Job_title; 12 use App\Models\Job_title;
13 use App\Models\News; 13 use App\Models\News;
14 use App\Models\reclame; 14 use App\Models\reclame;
15 use App\Models\User; 15 use App\Models\User;
16 use Illuminate\Http\Request; 16 use Illuminate\Http\Request;
17 use Illuminate\Support\Facades\Auth; 17 use Illuminate\Support\Facades\Auth;
18 use Illuminate\Support\Facades\Hash; 18 use Illuminate\Support\Facades\Hash;
19 use Illuminate\Support\Facades\Mail; 19 use Illuminate\Support\Facades\Mail;
20 use Illuminate\Support\Facades\Validator; 20 use Illuminate\Support\Facades\Validator;
21 use App\Classes\StatusUser; 21 use App\Classes\StatusUser;
22 22
23 class MainController extends Controller 23 class MainController extends Controller
24 { 24 {
25 // Главная страница публичной части 25 // Главная страница публичной части
26 public function index() { 26 public function index() {
27 $news = News::query()->orderBy('id')->limit(6)->get(); 27 $news = News::query()->orderBy('id')->limit(6)->get();
28 28
29 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') 29 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*')
30 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') 30 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id')
31 ->OrderByDesc('created_at') 31 ->OrderByDesc('created_at')
32 ->GroupBy('categories.id') 32 ->GroupBy('categories.id')
33 ->get(); 33 ->get();
34 34
35 $employers = Employer::query()->orderBy('id')->limit(20)->get(); 35 $employers = Employer::query()->orderBy('id')->limit(20)->get();
36 36
37 return view('index', compact('news', 'categories', 'employers')); 37 return view('index', compact('news', 'categories', 'employers'));
38 } 38 }
39 39
40 public function search_vacancies(Request $request) { 40 public function search_vacancies(Request $request) {
41 if ($request->has('search')) { 41 if ($request->has('search')) {
42 $search = $request->get('search'); 42 $search = $request->get('search');
43 $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first(); 43 $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first();
44 if (isset($job_titles->id)) 44 if (isset($job_titles->id))
45 if ($job_titles->id > 0) 45 if ($job_titles->id > 0)
46 return redirect()->route('vacancies', ['job' => $job_titles->id]); 46 return redirect()->route('vacancies', ['job' => $job_titles->id]);
47 } 47 }
48 } 48 }
49 49
50 public function vacancies(Request $request) { 50 public function vacancies(Request $request) {
51 //должности 51 //должности
52 $Job_title = Job_title::query()->orderBy('name')->get(); 52 $Job_title = Job_title::query()->orderBy('name')->get();
53 53
54 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') 54 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*')
55 ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary') 55 ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary')
56 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') 56 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id')
57 ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id'); 57 ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id');
58 58
59 //категории и вакансии 59 //категории и вакансии
60 if (($request->has('job')) && ($request->get('job') > 0)) { 60 if (($request->has('job')) && ($request->get('job') > 0)) {
61 $categories = $categories->Where('job_title_id', '=', $request->get('job')) 61 $categories = $categories->Where('job_title_id', '=', $request->get('job'))
62 ->OrderByDesc('created_at') 62 ->OrderByDesc('created_at')
63 ->GroupBy('categories.id') 63 ->GroupBy('categories.id')
64 ->get(); 64 ->get();
65 } else { 65 } else {
66 $categories = $categories->OrderByDesc('created_at') 66 $categories = $categories->OrderByDesc('created_at')
67 ->GroupBy('categories.id') 67 ->GroupBy('categories.id')
68 ->get(); 68 ->get();
69 } 69 }
70 70
71 if ($request->ajax()) { 71 if ($request->ajax()) {
72 return view('ajax.vacancies', compact('categories')); 72 return view('ajax.vacancies', compact('categories'));
73 } else { 73 } else {
74 return view('vacancies', compact('Job_title', 'categories')); 74 return view('vacancies', compact('Job_title', 'categories'));
75 } 75 }
76 } 76 }
77 77
78 //Вакансии категория детальная 78 //Вакансии категория детальная
79 public function list_vacancies(Category $categories, Request $request) { 79 public function list_vacancies(Category $categories, Request $request) {
80 if (isset(Auth()->user()->id)) 80 if (isset(Auth()->user()->id))
81 $uid = Auth()->user()->id; 81 $uid = Auth()->user()->id;
82 else 82 else
83 $uid = 0; 83 $uid = 0;
84 84
85 $Query = Ad_employer::with('jobs')-> 85 $Query = Ad_employer::with('jobs')->
86 with('cat')-> 86 with('cat')->
87 with('employer')-> 87 with('employer')->
88 whereHas('jobs_code', function ($query) use ($request) { 88 whereHas('jobs_code', function ($query) use ($request) {
89 if ($request->ajax()) { 89 if ($request->ajax()) {
90 if (null !== ($request->get('job')) && ($request->get('job') !== 0)) { 90 if (null !== ($request->get('job')) && ($request->get('job') !== 0)) {
91 $query->where('job_title_id', $request->get('job')); 91 $query->where('job_title_id', $request->get('job'));
92 } 92 }
93 } 93 }
94 }) 94 })
95 ->select('ad_employers.*'); 95 ->select('ad_employers.*');
96 96
97 97
98 98
99 if ($categories->id > 0) { 99 if ($categories->id > 0) {
100 $Query = $Query->where('category_id', '=', $categories->id); 100 $Query = $Query->where('category_id', '=', $categories->id);
101 $Name_categori = Category::query()->where('id', '=', $categories->id)->get(); 101 $Name_categori = Category::query()->where('id', '=', $categories->id)->get();
102 } 102 }
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': $Query = $Query->orderBy('name')->orderBy('id'); break; 107 case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break;
108 case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break; 108 case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break;
109 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; 109 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
110 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; 110 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
111 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; 111 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
112 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; 112 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break;
113 } 113 }
114 } 114 }
115 115
116 $Job_title = Job_title::query()->OrderBy('name')->get(); 116 $Job_title = Job_title::query()->OrderBy('name')->get();
117 117
118 $Query_count = $Query->count(); 118 $Query_count = $Query->count();
119 119
120 $Query = $Query->OrderBy('updated_at')->paginate(3); 120 $Query = $Query->OrderBy('updated_at')->paginate(3);
121 121
122 $Reclama = reclame::query()->limit(3)->get(); 122 $Reclama = reclame::query()->limit(3)->get();
123 123
124 124
125 125
126 if ($request->ajax()) { 126 if ($request->ajax()) {
127 return view('ajax.list_vacancies', compact('Query', 127 return view('ajax.list_vacancies', compact('Query',
128 'Query_count', 128 'Query_count',
129 'Name_categori', 129 'Name_categori',
130 'Reclama', 130 'Reclama',
131 'categories', 131 'categories',
132 'uid')); 132 'uid'));
133 } else { 133 } else {
134 //Вернуть все 134 //Вернуть все
135 return view('list_vacancies', compact('Query', 135 return view('list_vacancies', compact('Query',
136 'Query_count', 136 'Query_count',
137 'Reclama', 137 'Reclama',
138 'Name_categori', 138 'Name_categori',
139 'categories', 139 'categories',
140 'Job_title', 140 'Job_title',
141 'uid')); 141 'uid'));
142 } 142 }
143 } 143 }
144 144
145 // Образование 145 // Образование
146 public function education(Request $request) { 146 public function education(Request $request) {
147 $educations = Education::query(); 147 $educations = Education::query();
148 if (($request->has('search')) && (!empty($request->get('search')))) { 148 if (($request->has('search')) && (!empty($request->get('search')))) {
149 $search = trim($request->get('search')); 149 $search = trim($request->get('search'));
150 $educations = $educations->where('name', 'LIKE', "%$search%"); 150 $educations = $educations->where('name', 'LIKE', "%$search%");
151 } 151 }
152 152
153 if ($request->get('sort')) { 153 if ($request->get('sort')) {
154 $sort = $request->get('sort'); 154 $sort = $request->get('sort');
155 switch ($sort) { 155 switch ($sort) {
156 case 'name_up': $educations = $educations->orderBy('name')->orderBy('id'); break; 156 case 'name_up': $educations = $educations->orderBy('name')->orderBy('id'); break;
157 case 'name_down': $educations = $educations->orderByDesc('name')->orderby('id'); break; 157 case 'name_down': $educations = $educations->orderByDesc('name')->orderby('id'); break;
158 case 'created_at_up': $educations = $educations->OrderBy('created_at')->orderBy('id'); break; 158 case 'created_at_up': $educations = $educations->OrderBy('created_at')->orderBy('id'); break;
159 case 'created_at_down': $educations = $educations->orderByDesc('created_at')->orderBy('id'); break; 159 case 'created_at_down': $educations = $educations->orderByDesc('created_at')->orderBy('id'); break;
160 case 'default': $educations = $educations->orderBy('id')->orderby('updated_at'); break; 160 case 'default': $educations = $educations->orderBy('id')->orderby('updated_at'); break;
161 default: $educations = $educations->orderBy('id')->orderby('updated_at'); break; 161 default: $educations = $educations->orderBy('id')->orderby('updated_at'); break;
162 } 162 }
163 } 163 }
164 164
165 $count_edu = $educations->count(); 165 $count_edu = $educations->count();
166 $educations = $educations->paginate(6); 166 $educations = $educations->paginate(6);
167 if ($request->ajax()) { 167 if ($request->ajax()) {
168 return view('ajax.education', compact('educations')); 168 return view('ajax.education', compact('educations'));
169 } else { 169 } else {
170 return view('education', compact('educations', 'count_edu')); 170 return view('education', compact('educations', 'count_edu'));
171 } 171 }
172 } 172 }
173 173
174 // Контакты 174 // Контакты
175 public function contacts() { 175 public function contacts() {
176 return view('contacts'); 176 return view('contacts');
177 } 177 }
178 178
179 // Вход в личный кабинет 179 // Вход в личный кабинет
180 public function input_login(Request $request) 180 public function input_login(Request $request)
181 { 181 {
182 $params = $request->all();
183
184
182 $rules = [ 185 $rules = [
183 'email' => 'required|string|email', 186 'email' => 'required|string|email',
184 'password' => 'required|string', 187 'password' => 'required|string',
185 ]; 188 ];
186 189
187 $messages = [ 190 $messages = [
188 'required' => 'Укажите обязательное поле «:attribute»', 191 'required' => 'Укажите обязательное поле «:attribute»',
189 'email' => 'Введите корректный email', 192 'email' => 'Введите корректный email',
190 'min' => [ 193 'min' => [
191 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 194 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
192 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 195 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
193 ], 196 ],
194 'max' => [ 197 'max' => [
195 'string' => 'Поле «:attribute» должно быть не больше :max символов', 198 'string' => 'Поле «:attribute» должно быть не больше :max символов',
196 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 199 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
197 ], 200 ],
198 ]; 201 ];
199 202
200 $validator = Validator::make($request->all(), $rules, $messages); 203 $validator = Validator::make($request->all(), $rules, $messages);
201 204
205
202 if ($validator->fails()) { 206 if ($validator->fails()) {
203 return redirect()->route('index')->with('Error', "Email или пароль невалидный"); 207 return redirect()->route('index')->with('Error', "Email или пароль невалидный");
204 } else { 208 } else {
205 $credentials = $request->only('email', 'password'); 209 $credentials = $request->only('email', 'password');
206 210
207 if (Auth::attempt($credentials, $request->has('remember'))) { 211 if (Auth::attempt($credentials, $request->has('remember'))) {
208 212
209 if (is_null(Auth::user()->email_verified_at)) { 213 if (is_null(Auth::user()->email_verified_at)) {
210 Auth::logout(); 214 Auth::logout();
211 return json_encode(Array("ERROR" => "Адрес почты не подтвержден")); 215 return json_encode(Array("ERROR" => "Адрес почты не подтвержден"));
212 } 216 }
213 217
214 if (Auth::user()->is_worker) { 218 if (Auth::user()->is_worker) {
215 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl())); 219 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));
216 } else { 220 } else {
217 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl())); 221 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));
218 } 222 }
219 223
220 return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет")); 224 return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет"));
221 //->route('index') 225 //->route('index')
222 //->with('success', 'Вы вошли в личный кабинет.'); 226 //->with('success', 'Вы вошли в личный кабинет.');
223 } else { 227 } else {
224 return json_encode(Array("ERROR" => "Неверный логин или пароль!")); 228 return json_encode(Array("ERROR" => "Неверный логин или пароль!"));
225 } 229 }
226 } 230 }
227 } 231 }
228 232
229 // Восстановление пароля 233 // Восстановление пароля
230 public function repair_password(Request $request) { 234 public function repair_password(Request $request) {
231 $rules = [ 235 $rules = [
232 'email' => 'required|string|email', 236 'email' => 'required|string|email',
233 ]; 237 ];
234 238
235 $messages = [ 239 $messages = [
236 'required' => 'Укажите обязательное поле «:attribute»', 240 'required' => 'Укажите обязательное поле «:attribute»',
237 'email' => 'Введите корректный email', 241 'email' => 'Введите корректный email',
238 'min' => [ 242 'min' => [
239 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 243 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
240 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 244 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
241 ], 245 ],
242 'max' => [ 246 'max' => [
243 'string' => 'Поле «:attribute» должно быть не больше :max символов', 247 'string' => 'Поле «:attribute» должно быть не больше :max символов',
244 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 248 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
245 ], 249 ],
246 ]; 250 ];
247 251
248 $validator = Validator::make($request->all(), $rules, $messages); 252 $validator = Validator::make($request->all(), $rules, $messages);
249 253
250 if ($validator->fails()) { 254 if ($validator->fails()) {
251 return redirect()->back()->with('Error', "Email невалидный"); 255 return redirect()->back()->with('Error', "Email невалидный");
252 } else { 256 } else {
253 $new_password = Tools::generator_id(10); 257 $new_password = Tools::generator_id(10);
254 $hash_password = Hash::make($new_password); 258 $hash_password = Hash::make($new_password);
255 $user = User::query()->where('email', $request->get('email'))->first(); 259 $user = User::query()->where('email', $request->get('email'))->first();
256 $EditRec = User::find($user->id); 260 $EditRec = User::find($user->id);
257 $EditRec->password = $hash_password; 261 $EditRec->password = $hash_password;
258 $EditRec->save(); 262 $EditRec->save();
259 263
260 foreach ([$request->get('email')] as $recipient) { 264 foreach ([$request->get('email')] as $recipient) {
261 Mail::to($recipient)->send(new MailRepair($new_password)); 265 Mail::to($recipient)->send(new MailRepair($new_password));
262 } 266 }
267 return redirect()->route('index');
268
263 } 269 }
264 270
265 } 271 }
266 } 272 }
267 273
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\Models\Ad_employer; 7 use App\Models\Ad_employer;
8 use App\Models\ad_response; 8 use App\Models\ad_response;
9 use App\Models\Category; 9 use App\Models\Category;
10 use App\Models\Dop_info; 10 use App\Models\Dop_info;
11 use App\Models\Employer; 11 use App\Models\Employer;
12 use App\Models\infobloks; 12 use App\Models\infobloks;
13 use App\Models\Job_title; 13 use App\Models\Job_title;
14 use App\Models\Message; 14 use App\Models\Message;
15 use App\Models\place_works; 15 use App\Models\place_works;
16 use App\Models\reclame; 16 use App\Models\reclame;
17 use App\Models\sertification; 17 use App\Models\sertification;
18 use App\Models\Static_worker; 18 use App\Models\Static_worker;
19 use App\Models\User; 19 use App\Models\User;
20 use App\Models\User as User_Model; 20 use App\Models\User as User_Model;
21 use App\Models\Worker; 21 use App\Models\Worker;
22 use Carbon\Carbon; 22 use Carbon\Carbon;
23 use Illuminate\Auth\Events\Registered; 23 use Illuminate\Auth\Events\Registered;
24 use Illuminate\Database\Eloquent\Builder; 24 use Illuminate\Database\Eloquent\Builder;
25 use Illuminate\Http\JsonResponse; 25 use Illuminate\Http\JsonResponse;
26 use Illuminate\Http\Request; 26 use Illuminate\Http\Request;
27 use Illuminate\Support\Facades\Auth; 27 use Illuminate\Support\Facades\Auth;
28 use Illuminate\Support\Facades\Hash; 28 use Illuminate\Support\Facades\Hash;
29 use Illuminate\Support\Facades\Storage; 29 use Illuminate\Support\Facades\Storage;
30 use Illuminate\Support\Facades\Validator; 30 use Illuminate\Support\Facades\Validator;
31 31
32 class WorkerController extends Controller 32 class WorkerController extends Controller
33 { 33 {
34 public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу'); 34 public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу');
35 35
36 //профиль 36 //профиль
37 public function profile(Worker $worker) 37 public function profile(Worker $worker)
38 { 38 {
39 $get_date = date('Y.m'); 39 $get_date = date('Y.m');
40 40
41 $c = Static_worker::query()->where('year_month', '=', $get_date) 41 $c = Static_worker::query()->where('year_month', '=', $get_date)
42 ->where('user_id', '=', $worker->users->id) 42 ->where('user_id', '=', $worker->users->id)
43 ->get(); 43 ->get();
44 44
45 if ($c->count() > 0) { 45 if ($c->count() > 0) {
46 $upd = Static_worker::find($c[0]->id); 46 $upd = Static_worker::find($c[0]->id);
47 $upd->lookin = $upd->lookin + 1; 47 $upd->lookin = $upd->lookin + 1;
48 $upd->save(); 48 $upd->save();
49 } else { 49 } else {
50 $crt = new Static_worker(); 50 $crt = new Static_worker();
51 $crt->lookin = 1; 51 $crt->lookin = 1;
52 $crt->year_month = $get_date; 52 $crt->year_month = $get_date;
53 $crt->user_id = $worker->user_id; 53 $crt->user_id = $worker->user_id;
54 $crt->save(); 54 $crt->save();
55 } 55 }
56 56
57 $stat = Static_worker::query()->where('year_month', '=', $get_date) 57 $stat = Static_worker::query()->where('year_month', '=', $get_date)
58 ->where('user_id', '=', $worker->users->id) 58 ->where('user_id', '=', $worker->users->id)
59 ->get(); 59 ->get();
60 60
61 return view('public.workers.profile', compact('worker', 'stat')); 61 return view('public.workers.profile', compact('worker', 'stat'));
62 } 62 }
63 63
64 // лист база резюме 64 // лист база резюме
65 public function bd_resume() 65 public function bd_resume(Request $request)
66 { 66 {
67 if (isset(Auth()->user()->id)) { 67 if (isset(Auth()->user()->id)) {
68 $idiot = Auth()->user()->id; 68 $idiot = Auth()->user()->id;
69 } else { 69 } else {
70 $idiot = 0; 70 $idiot = 0;
71 } 71 }
72 72
73 $status_work = $this->status_work; 73 $status_work = $this->status_work;
74 $resumes = Worker::query()->with('users')->with('job_titles')-> 74 $resumes = Worker::query()->with('users')->with('job_titles')
75 WhereHas('users', 75 ->WhereHas('users',
76 function (Builder $query) { 76 function (Builder $query) {
77 $query->Where('is_worker', '=', '1')-> 77 $query->Where('is_worker', '=', '1')->
78 Where('is_bd', '=', '0'); 78 Where('is_bd', '=', '0');
79 }); 79 });
80
81 if ($request->get('sort')) {
82 $sort = $request->get('sort');
83 switch ($sort) {
84 case 'name_up':
85 $resumes = $resumes->whereHas('users', function (Builder $query) {
86 $query = $query->orderBy('surname')->orderBy('id');
87 });
88 break;
89 case 'name_down':
90 $resumes = $resumes->whereHas('users', function (Builder $query) {
91 $query = $query->orderByDesc('surname')->orderby('id');
92 });
93 break;
94 case 'created_at_up': $resumes = $resumes->OrderBy('created_at')->orderBy('id'); break;
95 case 'created_at_down': $resumes = $resumes->orderByDesc('created_at')->orderBy('id'); break;
96 case 'default': $resumes = $resumes->orderBy('id')->orderby('updated_at'); break;
97 default: $resumes = $resumes->orderBy('id')->orderby('updated_at'); break;
98 }
99 }
80 100
81 $res_count = $resumes->count(); 101 $res_count = $resumes->count();
82 $resumes = $resumes->paginate(5); 102 $resumes = $resumes->paginate(6);
103 if ($request->ajax()) {
104 // Условия обставлены
105 if ($request->has('block') && ($request->get('block') == 1)) {
106 return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot'));
107 }
83 108
84 return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot')); 109 if ($request->has('block') && ($request->get('block') == 2)) {
110 return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot'));
111 }
112 } else {
113 return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot'));
114 }
85 } 115 }
86 116
87 // анкета соискателя 117 // анкета соискателя
88 public function resume_profile(Worker $worker) 118 public function resume_profile(Worker $worker)
89 { 119 {
90 $status_work = $this->status_work; 120 $status_work = $this->status_work;
91 $Query = Worker::query()->with('users')->with('job_titles') 121 $Query = Worker::query()->with('users')->with('job_titles')
92 ->with('place_worker')->with('sertificate')->with('prev_company') 122 ->with('place_worker')->with('sertificate')->with('prev_company')
93 ->with('infobloks'); 123 ->with('infobloks');
94 $Query = $Query->where('id', '=', $worker->id); 124 $Query = $Query->where('id', '=', $worker->id);
95 $Query = $Query->get(); 125 $Query = $Query->get();
96 return view('worker', compact('Query', 'status_work')); 126 return view('worker', compact('Query', 'status_work'));
97 } 127 }
98 128
99 // скачать анкету соискателя 129 // скачать анкету соискателя
100 public function resume_download(Worker $worker) 130 public function resume_download(Worker $worker)
101 { 131 {
102 print_r('Резюме для скачивания'); 132 print_r('Резюме для скачивания');
103 } 133 }
104 134
105 // Кабинет работника 135 // Кабинет работника
106 public function cabinet() 136 public function cabinet()
107 { 137 {
108 $id = Auth()->user()->id; 138 $id = Auth()->user()->id;
109 $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')-> 139 $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')->
110 with('infobloks')->with('place_worker')-> 140 with('infobloks')->with('place_worker')->
111 WhereHas('users', 141 WhereHas('users',
112 function (Builder $query) use ($id) {$query->Where('id', $id); 142 function (Builder $query) use ($id) {$query->Where('id', $id);
113 })->get(); 143 })->get();
114 144
115 $Job_titles = Job_title::query()->OrderBy('name')->get(); 145 $Job_titles = Job_title::query()->OrderBy('name')->get();
116 $Infoblocks = infobloks::query()->OrderBy('name')->get(); 146 $Infoblocks = infobloks::query()->OrderBy('name')->get();
117 147
118 return view('workers.cabinet', compact('Worker', 'Job_titles', 'Infoblocks')); 148 return view('workers.cabinet', compact('Worker', 'Job_titles', 'Infoblocks'));
119 } 149 }
120 150
121 // Сохранение данных 151 // Сохранение данных
122 public function cabinet_save(Worker $worker, Request $request) 152 public function cabinet_save(Worker $worker, Request $request)
123 { 153 {
124 $id = $worker->id; 154 $id = $worker->id;
125 $params = $request->all(); 155 $params = $request->all();
126 156
127 $job_title_id = $request->get('job_title_id'); 157 $job_title_id = $request->get('job_title_id');
128 158
129 unset($params['new_diplom']); 159 unset($params['new_diplom']);
130 unset($params['new_data_begin']); 160 unset($params['new_data_begin']);
131 unset($params['new_data_end']); 161 unset($params['new_data_end']);
132 unset($params['new_job_title']); 162 unset($params['new_job_title']);
133 unset($params['new_teplohod']); 163 unset($params['new_teplohod']);
134 unset($params['new_GWT']); 164 unset($params['new_GWT']);
135 unset($params['new_KBT']); 165 unset($params['new_KBT']);
136 unset($params['new_Begin_work']); 166 unset($params['new_Begin_work']);
137 unset($params['new_End_work']); 167 unset($params['new_End_work']);
138 unset($params['new_name_company']); 168 unset($params['new_name_company']);
139 169
140 $rules = [ 170 $rules = [
141 'surname' => ['required', 'string', 'max:255'], 171 'surname' => ['required', 'string', 'max:255'],
142 'name_man' => ['required', 'string', 'max:255'], 172 'name_man' => ['required', 'string', 'max:255'],
143 'email' => ['required', 'string', 'email', 'max:255'], 173 'email' => ['required', 'string', 'email', 'max:255'],
144 174
145 ]; 175 ];
146 176
147 $messages = [ 177 $messages = [
148 'required' => 'Укажите обязательное поле', 178 'required' => 'Укажите обязательное поле',
149 'min' => [ 179 'min' => [
150 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 180 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
151 'integer' => 'Поле «:attribute» должно быть :min или больше', 181 'integer' => 'Поле «:attribute» должно быть :min или больше',
152 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 182 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
153 ], 183 ],
154 'max' => [ 184 'max' => [
155 'string' => 'Поле «:attribute» должно быть не больше :max символов', 185 'string' => 'Поле «:attribute» должно быть не больше :max символов',
156 'integer' => 'Поле «:attribute» должно быть :max или меньше', 186 'integer' => 'Поле «:attribute» должно быть :max или меньше',
157 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 187 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
158 ] 188 ]
159 ]; 189 ];
160 190
161 $validator = Validator::make($params, $rules, $messages); 191 $validator = Validator::make($params, $rules, $messages);
162 192
163 if ($validator->fails()) { 193 if ($validator->fails()) {
164 return redirect()->route('worker.cabinet')->withErrors($validator); 194 return redirect()->route('worker.cabinet')->withErrors($validator);
165 } else { 195 } else {
166 196
167 if ($request->has('photo')) { 197 if ($request->has('photo')) {
168 if (!empty($Worker->photo)) { 198 if (!empty($Worker->photo)) {
169 Storage::delete($Worker->photo); 199 Storage::delete($Worker->photo);
170 } 200 }
171 $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); 201 $params['photo'] = $request->file('photo')->store("worker/$id", 'public');
172 } 202 }
173 203
174 if ($request->has('file')) { 204 if ($request->has('file')) {
175 if (!empty($Worker->file)) { 205 if (!empty($Worker->file)) {
176 Storage::delete($Worker->file); 206 Storage::delete($Worker->file);
177 } 207 }
178 $params['file'] = $request->file('file')->store("worker/$id", 'public'); 208 $params['file'] = $request->file('file')->store("worker/$id", 'public');
179 } 209 }
180 210
181 $id_wor = $worker->update($params); 211 $id_wor = $worker->update($params);
182 212
183 $use = User_Model::find($id_wor); 213 $use = User_Model::find($id_wor);
184 $use->surname = $request->get('surname'); 214 $use->surname = $request->get('surname');
185 $use->name_man = $request->get('name_man'); 215 $use->name_man = $request->get('name_man');
186 $use->surname2 = $request->get('surname2'); 216 $use->surname2 = $request->get('surname2');
187 217
188 $use->save(); 218 $use->save();
189 $worker->job_titles()->sync($job_title_id); 219 $worker->job_titles()->sync($job_title_id);
190 220
191 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); 221 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены');
192 } 222 }
193 } 223 }
194 224
195 // Сообщения данные 225 // Сообщения данные
196 public function messages($type_message) 226 public function messages($type_message)
197 { 227 {
198 $user_id = Auth()->user()->id; 228 $user_id = Auth()->user()->id;
199 229
200 $messages_input = Message::query()->with('vacancies')->with('user_from')-> 230 $messages_input = Message::query()->with('vacancies')->with('user_from')->
201 Where('to_user_id', $user_id)->OrderByDesc('created_at'); 231 Where('to_user_id', $user_id)->OrderByDesc('created_at');
202 232
203 $messages_output = Message::query()->with('vacancies')-> 233 $messages_output = Message::query()->with('vacancies')->
204 with('user_to')->where('user_id', $user_id)-> 234 with('user_to')->where('user_id', $user_id)->
205 OrderByDesc('created_at'); 235 OrderByDesc('created_at');
206 236
207 237
208 $count_input = $messages_input->count(); 238 $count_input = $messages_input->count();
209 $count_output = $messages_output->count(); 239 $count_output = $messages_output->count();
210 240
211 if ($type_message == 'input') { 241 if ($type_message == 'input') {
212 $messages = $messages_input->paginate(15); 242 $messages = $messages_input->paginate(15);
213 } 243 }
214 244
215 if ($type_message == 'output') { 245 if ($type_message == 'output') {
216 $messages = $messages_output->paginate(15); 246 $messages = $messages_output->paginate(15);
217 } 247 }
218 // Вернуть все 100% 248 // Вернуть все 100%
219 return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); 249 return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id'));
220 } 250 }
221 251
222 // Избранный 252 // Избранный
223 public function favorite() 253 public function favorite()
224 { 254 {
225 return view('workers.favorite'); 255 return view('workers.favorite');
226 } 256 }
227 257
228 // Сменить пароль 258 // Сменить пароль
229 public function new_password() 259 public function new_password()
230 { 260 {
231 $email = Auth()->user()->email; 261 $email = Auth()->user()->email;
232 return view('workers.new_password', compact('email')); 262 return view('workers.new_password', compact('email'));
233 } 263 }
234 264
235 // Обновление пароля 265 // Обновление пароля
236 public function save_new_password(Request $request) { 266 public function save_new_password(Request $request) {
237 $use = Auth()->user(); 267 $use = Auth()->user();
238 $request->validate([ 268 $request->validate([
239 'password' => 'required|string', 269 'password' => 'required|string',
240 'new_password' => 'required|string', 270 'new_password' => 'required|string',
241 'new_password2' => 'required|string' 271 'new_password2' => 'required|string'
242 ]); 272 ]);
243 273
244 if ($request->get('new_password') == $request->get('new_password2')) 274 if ($request->get('new_password') == $request->get('new_password2'))
245 if ($request->get('password') !== $request->get('new_password')) { 275 if ($request->get('password') !== $request->get('new_password')) {
246 $credentials = $request->only('email', 'password'); 276 $credentials = $request->only('email', 'password');
247 if (Auth::attempt($credentials)) { 277 if (Auth::attempt($credentials, $request->has('save_me'))) {
248 278
249 if (!is_null($use->email_verified_at)){ 279 if (!is_null($use->email_verified_at)){
250 280
251 $user_data = User_Model::find($use->id); 281 $user_data = User_Model::find($use->id);
252 $user_data->update([ 282 $user_data->update([
253 'password' => Hash::make($request->get('new_password')), 283 'password' => Hash::make($request->get('new_password')),
254 'pubpassword' => base64_encode($request->get('new_password')), 284 'pubpassword' => base64_encode($request->get('new_password')),
255 ]); 285 ]);
256 return redirect() 286 return redirect()
257 ->route('worker.new_password') 287 ->route('worker.new_password')
258 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 288 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
259 } 289 }
260 290
261 return redirect() 291 return redirect()
262 ->route('worker.new_password') 292 ->route('worker.new_password')
263 ->withError('Данная учетная запись не было верифицированна!'); 293 ->withError('Данная учетная запись не было верифицированна!');
264 } 294 }
265 } 295 }
266 296
267 return redirect() 297 return redirect()
268 ->route('worker.new_password') 298 ->route('worker.new_password')
269 ->withErrors('Не совпадение данных, обновите пароли!'); 299 ->withErrors('Не совпадение данных, обновите пароли!');
270 } 300 }
271 301
272 // Удаление профиля форма 302 // Удаление профиля форма
273 public function delete_profile() 303 public function delete_profile()
274 { 304 {
275 $login = Auth()->user()->email; 305 $login = Auth()->user()->email;
276 return view('workers.delete_profile', compact('login')); 306 return view('workers.delete_profile', compact('login'));
277 } 307 }
278 308
279 // Удаление профиля код 309 // Удаление профиля код
280 public function delete_profile_result(Request $request) { 310 public function delete_profile_result(Request $request) {
281 $Answer = $request->all(); 311 $Answer = $request->all();
282 $user_id = Auth()->user()->id; 312 $user_id = Auth()->user()->id;
283 $request->validate([ 313 $request->validate([
284 'password' => 'required|string', 314 'password' => 'required|string',
285 ]); 315 ]);
286 316
287 $credentials = $request->only('email', 'password'); 317 $credentials = $request->only('email', 'password');
288 if (Auth::attempt($credentials)) { 318 if (Auth::attempt($credentials)) {
289 Auth::logout(); 319 Auth::logout();
290 $it = User_Model::find($user_id); 320 $it = User_Model::find($user_id);
291 //$it->delete(); 321 //$it->delete();
292 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 322 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
293 } else { 323 } else {
294 return redirect()->route('worker.delete_profile') 324 return redirect()->route('worker.delete_profile')
295 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 325 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
296 } 326 }
297 } 327 }
298 328
299 // Регистрация соискателя 329 // Регистрация соискателя
300 public function register_worker(Request $request) 330 public function register_worker(Request $request)
301 { 331 {
302 $params = $request->all(); 332 $params = $request->all();
303 333
304 $rules = [ 334 $rules = [
305 'surname' => ['required', 'string', 'max:255'], 335 'surname' => ['required', 'string', 'max:255'],
306 'name_man' => ['required', 'string', 'max:255'], 336 'name_man' => ['required', 'string', 'max:255'],
307 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 337 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
308 'password' => ['required', 'string', 'min:8'], 338 'password' => ['required', 'string', 'min:8'],
309 ]; 339 ];
310 340
311 $messages = [ 341 $messages = [
312 'required' => 'Укажите обязательное поле', 342 'required' => 'Укажите обязательное поле',
313 'min' => [ 343 'min' => [
314 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 344 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
315 'integer' => 'Поле «:attribute» должно быть :min или больше', 345 'integer' => 'Поле «:attribute» должно быть :min или больше',
316 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 346 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
317 ], 347 ],
318 'max' => [ 348 'max' => [
319 'string' => 'Поле «:attribute» должно быть не больше :max символов', 349 'string' => 'Поле «:attribute» должно быть не больше :max символов',
320 'integer' => 'Поле «:attribute» должно быть :max или меньше', 350 'integer' => 'Поле «:attribute» должно быть :max или меньше',
321 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 351 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
322 ] 352 ]
323 ]; 353 ];
324 354
325
326
327
328 if ($request->get('password') !== $request->get('confirmed')){ 355 if ($request->get('password') !== $request->get('confirmed')){
329 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 356 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
330 } 357 }
331 358
332 $validator = Validator::make($request->all(), $rules, $messages); 359 $validator = Validator::make($request->all(), $rules, $messages);
333 360
334 if ($validator->fails()) { 361 if ($validator->fails()) {
335 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 362 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
336 } else { 363 } else {
337 $user = $this->create($params); 364 $user = $this->create($params);
338 event(new Registered($user)); 365 event(new Registered($user));
339 366
340 Auth::guard()->login($user); 367 Auth::guard()->login($user);
341 } 368 }
342 if ($user) { 369 if ($user) {
343 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; 370 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));;
344 } else { 371 } else {
345 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 372 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
346 } 373 }
347 } 374 }
348 375
349 // Создание пользователя 376 // Создание пользователя
350 protected function create(array $data) 377 protected function create(array $data)
351 { 378 {
352 $Use = new User(); 379 $Use = new User();
353 $Code_user = $Use->create([ 380 $Code_user = $Use->create([
354 'name' => $data['surname']." ".$data['name_man'], 381 'name' => $data['surname']." ".$data['name_man'],
355 'name_man' => $data['name_man'], 382 'name_man' => $data['name_man'],
356 'surname' => $data['surname'], 383 'surname' => $data['surname'],
357 'surname2' => $data['surname2'], 384 'surname2' => $data['surname2'],
358 'subscribe_email' => $data['email'], 385 'subscribe_email' => $data['email'],
359 'email' => $data['email'], 386 'email' => $data['email'],
360 'telephone' => $data['telephone'], 387 'telephone' => $data['telephone'],
361 'password' => Hash::make($data['password']), 388 'password' => Hash::make($data['password']),
362 'pubpassword' => base64_encode($data['password']), 389 'pubpassword' => base64_encode($data['password']),
363 'email_verified_at' => Carbon::now() 390 'email_verified_at' => Carbon::now()
364 ]); 391 ]);
365 if ($Code_user->id > 0) { 392 if ($Code_user->id > 0) {
366 $Worker = new Worker(); 393 $Worker = new Worker();
367 $Worker->user_id = $Code_user->id; 394 $Worker->user_id = $Code_user->id;
368 $Worker->position_work = $data['job_titles']; 395 $Worker->position_work = $data['job_titles'];
369 $Worker->email = $data['email']; 396 $Worker->email = $data['email'];
370 $Worker->telephone = $data['telephone']; 397 $Worker->telephone = $data['telephone'];
371 $Worker->save(); 398 $Worker->save();
372 399
373 return $Code_user; 400 return $Code_user;
374 } 401 }
375 } 402 }
376 403
377 // Борьба против колорадских жуков, хотя жуков победил все таки 45. 404 // Борьба против колорадских жуков, хотя жуков победил все таки 45.
378 public function colorado(Request $request) { 405 public function colorado(Request $request) {
379 if (isset($_COOKIE['favorite_vac'])) { 406 if (isset($_COOKIE['favorite_vac'])) {
380 $items = RusDate::count_vacancy_fav(); 407 $items = RusDate::count_vacancy_fav();
381 $it = $_COOKIE['favorite_vac']; 408 $it = $_COOKIE['favorite_vac'];
382 $it = str_replace('"', "", $it); 409 $it = str_replace('"', "", $it);
383 $it = str_replace('[', "", $it); 410 $it = str_replace('[', "", $it);
384 $it = str_replace(']', "", $it); 411 $it = str_replace(']', "", $it);
385 $Arr = explode(",", $it); 412 $Arr = explode(",", $it);
386 } else { 413 } else {
387 $Arr = Array(); 414 $Arr = Array();
388 } 415 }
389 416
390 $Query = Ad_employer::Query(); 417 $Query = Ad_employer::Query();
391 if (count($Arr) > 0) { 418 if (count($Arr) > 0) {
392 $Query = $Query->whereIn('id', $Arr); 419 $Query = $Query->whereIn('id', $Arr);
393 } 420 }
394 $Query = $Query->with('jobs')-> 421 $Query = $Query->with('jobs')->
395 with('cat')-> 422 with('cat')->
396 with('employer')-> 423 with('employer')->
397 whereHas('jobs_code', function ($query) use ($request) { 424 whereHas('jobs_code', function ($query) use ($request) {
398 if ($request->ajax()) { 425 if ($request->ajax()) {
399 if (null !== ($request->get('job'))) { 426 if (null !== ($request->get('job'))) {
400 $query->where('job_title_id', $request->get('job')); 427 $query->where('job_title_id', $request->get('job'));
401 } 428 }
402 } 429 }
403 })->select('ad_employers.*'); 430 })->select('ad_employers.*');
404 431
405 $Job_title = Job_title::query()->OrderBy('name')->get(); 432 $Job_title = Job_title::query()->OrderBy('name')->get();
406 433
407 $Query_count = $Query->count(); 434 $Query_count = $Query->count();
408 435
409 $Query = $Query->OrderBy('updated_at')->paginate(3); 436 $Query = $Query->OrderBy('updated_at')->paginate(3);
410 437
411 return view('workers.favorite', compact('Query', 438 return view('workers.favorite', compact('Query',
412 'Query_count', 439 'Query_count',
413 'Job_title')); 440 'Job_title'));
414 441
415 } 442 }
416 443
417 //Переписка пись-пись-пись 444 //Переписка пись-пись-пись
418 public function dialog(User_Model $user1, User_Model $user2) { 445 public function dialog(User_Model $user1, User_Model $user2) {
419 if (isset($user2->id)) { 446 if (isset($user2->id)) {
420 $companion = User_Model::query()->with('workers')-> 447 $companion = User_Model::query()->with('workers')->
421 with('employers')-> 448 with('employers')->
422 where('id', $user2->id)->first(); 449 where('id', $user2->id)->first();
423 } 450 }
424 451
425 $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) { 452 $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) {
426 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); 453 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id);
427 })->orWhere(function($query) use ($user1, $user2) { 454 })->orWhere(function($query) use ($user1, $user2) {
428 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); 455 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id);
429 })->OrderBy('created_at')->get(); 456 })->OrderBy('created_at')->get();
430 457
431 $id_vac = null; 458 $id_vac = null;
432 foreach ($Messages as $it) { 459 foreach ($Messages as $it) {
433 if (isset($it->response)) { 460 if (isset($it->response)) {
434 foreach ($it->response as $r) { 461 foreach ($it->response as $r) {
435 if (isset($r->ad_employer_id)) { 462 if (isset($r->ad_employer_id)) {
436 $id_vac = $r->ad_employer_id; 463 $id_vac = $r->ad_employer_id;
437 break; 464 break;
438 } 465 }
439 } 466 }
440 } 467 }
441 if (!is_null($id_vac)) break; 468 if (!is_null($id_vac)) break;
442 } 469 }
443 470
444 $ad_employer = null; 471 $ad_employer = null;
445 if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); 472 if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first();
446 $sender = $user1; 473 $sender = $user1;
447 474
448 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); 475 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer'));
449 } 476 }
450 477
451 // Даунлоады 478 // Даунлоады
452 public function download(Worker $worker) { 479 public function download(Worker $worker) {
453 480
454 } 481 }
455 482
456 // Поднятие анкеты 483 // Поднятие анкеты
457 public function up(Worker $worker) { 484 public function up(Worker $worker) {
458 $worker->updated_at = Carbon::now(); 485 $worker->updated_at = Carbon::now();
459 $worker->save(); 486 $worker->save();
460 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); 487 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных');
461 } 488 }
462 489
463 // Добавление сертификата 490 // Добавление сертификата
464 public function add_serificate(Request $request) { 491 public function add_serificate(Request $request) {
465 $params = $request->all(); 492 $params = $request->all();
466 $params['date_begin'] = date('d.m.Y', strtotime($params['date_begin'])); 493 $params['date_begin'] = date('d.m.Y', strtotime($params['date_begin']));
467 $params['end_begin'] = date('d.m.Y', strtotime($params['end_begin'])); 494 $params['end_begin'] = date('d.m.Y', strtotime($params['end_begin']));
468 $Sertificate = new sertification(); 495 $Sertificate = new sertification();
469 $Sertificate->create($params); 496 $Sertificate->create($params);
470 $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get(); 497 $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get();
471 return view('ajax.documents', compact('Docs')); 498 return view('ajax.documents', compact('Docs'));
472 } 499 }
473 500
474 501
475 // Удалить сертификат 502 // Удалить сертификат
476 public function delete_sertificate(sertification $doc) { 503 public function delete_sertificate(sertification $doc) {
477 $doc->delete(); 504 $doc->delete();
478 505
479 return redirect()->route('worker.cabinet'); 506 return redirect()->route('worker.cabinet');
480 } 507 }
481 508
482 // Добавление диплома 509 // Добавление диплома
483 public function add_diplom_ajax(Request $request) { 510 public function add_diplom_ajax(Request $request) {
484 // конец 511 // конец
485 $params = $request->all(); 512 $params = $request->all();
486 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 513 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
487 514
488 if ($count == 0) $dop_info = Dop_info::create($params); 515 if ($count == 0) $dop_info = Dop_info::create($params);
489 $Infoblocks = infobloks::query()->get(); 516 $Infoblocks = infobloks::query()->get();
490 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); 517 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get();
491 $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); 518 $data = Dop_info::query()->where('worker_id', $request->has('worker_id'));
492 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); 519 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker'));
493 } 520 }
494 521
495 // Добавление диплома без ajax 522 // Добавление диплома без ajax
496 public function add_diplom(Worker $worker) { 523 public function add_diplom(Worker $worker) {
497 $worker_id = $worker->id; 524 $worker_id = $worker->id;
498 $Infoblocks = infobloks::query()->get(); 525 $Infoblocks = infobloks::query()->get();
499 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); 526 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks'));
500 } 527 }
501 // Сохранить 528 // Сохранить
502 // Сохраняю диплом 529 // Сохраняю диплом
503 public function add_diplom_save(Request $request) { 530 public function add_diplom_save(Request $request) {
504 $params = $request->all(); 531 $params = $request->all();
505 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 532 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
506 if ($count == 0) $dop_info = Dop_info::create($params); 533 if ($count == 0) $dop_info = Dop_info::create($params);
507 return redirect()->route('worker.cabinet'); 534 return redirect()->route('worker.cabinet');
508 } 535 }
509 536
510 // Добавление стандартного документа 537 // Добавление стандартного документа
511 public function add_document(Worker $worker) { 538 public function add_document(Worker $worker) {
512 return view('workers.docs', compact('worker')); 539 return view('workers.docs', compact('worker'));
513 } 540 }
514 541
515 //Сохранение стандартого документа 542 //Сохранение стандартого документа
516 public function add_document_save(DocumentsRequest $request) { 543 public function add_document_save(DocumentsRequest $request) {
517 $params = $request->all(); 544 $params = $request->all();
518 $place_work = place_works::create($params); 545 $place_work = place_works::create($params);
519 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!'); 546 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!');
520 } 547 }
521 548
522 // Редактирование документа 549 // Редактирование документа
523 public function edit_document(place_works $doc, Worker $worker) { 550 public function edit_document(place_works $doc, Worker $worker) {
524 return view('workers.docs-edit', compact('doc', 'worker')); 551 return view('workers.docs-edit', compact('doc', 'worker'));
525 } 552 }
526 553
527 //Сохранение отредактированного документа 554 //Сохранение отредактированного документа
528 public function edit_document_save(DocumentsRequest $request, place_works $doc) { 555 public function edit_document_save(DocumentsRequest $request, place_works $doc) {
529 $params = $request->all(); 556 $params = $request->all();
530 $doc->update($params); 557 $doc->update($params);
531 558
532 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); 559 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!');
533 } 560 }
534 561
535 // Удаление документа 562 // Удаление документа
536 public function delete_document(place_works $doc) { 563 public function delete_document(place_works $doc) {
537 $doc->delete(); 564 $doc->delete();
538 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); 565 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!');
539 } 566 }
540 567
541 //Отправка нового сообщения 568 //Отправка нового сообщения
542 public function new_message(Request $request) { 569 public function new_message(Request $request) {
543 $params = $request->all(); 570 $params = $request->all();
544 571
545 $id = $params['send_user_id']; 572 $id = $params['send_user_id'];
546 $message = new Message(); 573 $message = new Message();
547 $message->user_id = $params['send_user_id']; 574 $message->user_id = $params['send_user_id'];
548 $message->to_user_id = $params['send_to_user_id']; 575 $message->to_user_id = $params['send_to_user_id'];
549 $message->title = $params['send_title']; 576 $message->title = $params['send_title'];
550 $message->text = $params['send_text']; 577 $message->text = $params['send_text'];
551 if ($request->has('send_file')) { 578 if ($request->has('send_file')) {
552 $message->file = $request->file('send_file')->store("worker/$id", 'public'); 579 $message->file = $request->file('send_file')->store("worker/$id", 'public');
553 } 580 }
554 $message->flag_new = 1; 581 $message->flag_new = 1;
555 $id_message = $message->save(); 582 $id_message = $message->save();
556 583
557 $data['message_id'] = $id_message; 584 $data['message_id'] = $id_message;
558 $data['ad_employer_id'] = $params['send_vacancy']; 585 $data['ad_employer_id'] = $params['send_vacancy'];
559 $data['job_title_id'] = $params['send_job_title_id']; 586 $data['job_title_id'] = $params['send_job_title_id'];
560 $data['flag'] = 1; 587 $data['flag'] = 1;
561 $ad_responce = ad_response::create($data); 588 $ad_responce = ad_response::create($data);
562 return redirect()->route('worker.messages', ['type_message' => 'output']); 589 return redirect()->route('worker.messages', ['type_message' => 'output']);
563 } 590 }
resources/views/ajax/resume_1.blade.php
File was created 1 @if ($resumes->count())
2 @foreach ($resumes as $res)
3 <div class="main__resume-base-body-item">
4 <div class="main__resume-base-body-item-buttons">
5 <button type="button" class="like js-toggle js_box_favorites <?=\App\Classes\RusDate::selected_item($res->id);?>" data-val="{{ $res->id }}">
6 <svg>
7 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
8 </svg>
9 </button>
10 <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $res->id }}" data-options='{"touch":false,"autoFocus":false}'>
11 <svg>
12 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
13 </svg>
14 </button>
15 </div>
16 <div class="main__resume-base-body-item-wrapper">
17 <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo">
18 <div class="main__resume-base-body-item-inner">
19 <div>
20 <b>Статус</b>
21 <span>{{ $status_work[$res->status_work] }}</span>
22 </div>
23 <div>
24 <b>Имя работника</b>
25 <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span>
26 </div>
27 <div>
28 <b>Номер телефона</b>
29 <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span>
30 </div>
31 <div>
32 <b>Электронный адрес</b>
33 <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span>
34 </div>
35 <div>
36 <b>Город проживания</b>
37 <span>{{ $res->city }}</span>
38 </div>
39 <div>
40 <b>Опыт работы</b>
41 <span>{{ $res->experience }}</span>
42 </div>
43 </div>
44 </div>
45 <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в резюме</a>
46 </div>
47 @endforeach
48
49 {{ $resumes->appends($_GET)->links('paginate') }}
50 @endif
51
resources/views/ajax/resume_2.blade.php
File was created 1 @if ($resumes->count())
2 @foreach ($resumes as $res)
3 <div class="main__resume-base-body-item">
4 <div class="main__resume-base-body-item-buttons">
5 <button type="button" class="like js-toggle js_box_favorites <?=\App\Classes\RusDate::selected_item($res->id);?>" data-val="{{ $res->id }}">
6 <svg>
7 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
8 </svg>
9 </button>
10 <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $res->id }}" data-options='{"touch":false,"autoFocus":false}'>
11 <svg>
12 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
13 </svg>
14 </button>
15 </div>
16 <div class="main__resume-base-body-item-wrapper">
17 <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo">
18 <div class="main__resume-base-body-item-inner">
19 <div>
20 <b>Статус</b>
21 <span>{{ $status_work[$res->status_work] }}</span>
22 </div>
23 <div>
24 <b>Имя работника</b>
25 <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span>
26 </div>
27 <div>
28 <b>Номер телефона</b>
29 <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span>
30 </div>
31 <div>
32 <b>Электронный адрес</b>
33 <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span>
34 </div>
35 <div>
36 <b>Город проживания</b>
37 <span>{{ $res->city }}</span>
38 </div>
39 <div>
40 <b>Опыт работы</b>
41 <span>{{ $res->experience }}</span>
42 </div>
43 </div>
44 </div>
45 <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в
46 резюме</a>
47 </div>
48 @endforeach
49
50 {{ $resumes->appends($_GET)->links('paginate') }}
51 @endif
52
resources/views/info_company.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 52
53 if (key !=='') { 53 if (key !=='') {
54 console.log(key); 54 console.log(key);
55 switch (key) { 55 switch (key) {
56 case "default": sel.html('Сортировка (по умолчанию)'); break; 56 case "default": sel.html('Сортировка (по умолчанию)'); break;
57 case "name_up": sel.html('По имени (возрастание)'); break; 57 case "name_up": sel.html('По имени (возрастание)'); break;
58 case "name_down": sel.html('По дате (убывание)'); break; 58 case "name_down": sel.html('По дате (убывание)'); break;
59 case "created_at_up": sel.html('По дате (возрастание)'); break; 59 case "created_at_up": sel.html('По дате (возрастание)'); break;
60 case "created_at_down": sel.html('По дате (убывание)'); break; 60 case "created_at_down": sel.html('По дате (убывание)'); break;
61 } 61 }
62 62
63 } 63 }
64 }); 64 });
65 65
66 //end 66 //end
67 $(document).on('click', '.js_send_it_button', function() { 67 $(document).on('click', '.js_send_it_button', function() {
68 var this_ = $(this); 68 var this_ = $(this);
69 var code_user_id = this_.attr('data-uid'); 69 var code_user_id = this_.attr('data-uid');
70 var code_to_user_id = this_.attr('data-tuid'); 70 var code_to_user_id = this_.attr('data-tuid');
71 var code_vacancy = this_.attr('data-vacancy'); 71 var code_vacancy = this_.attr('data-vacancy');
72 var user_id = $('#send_user_id'); 72 var user_id = $('#send_user_id');
73 var to_user_id = $('#send_to_user_id'); 73 var to_user_id = $('#send_to_user_id');
74 var vacancy = $('#send_vacancy'); 74 var vacancy = $('#send_vacancy');
75 75
76 console.log('Клик на кнопки...'); 76 console.log('Клик на кнопки...');
77 77
78 user_id.val(code_user_id); 78 user_id.val(code_user_id);
79 to_user_id.val(code_to_user_id); 79 to_user_id.val(code_to_user_id);
80 vacancy.val(code_vacancy); 80 vacancy.val(code_vacancy);
81 }); 81 });
82 </script> 82 </script>
83 @endsection 83 @endsection
84 84
85 @section('content') 85 @section('content')
86 <section class="thing"> 86 <section class="thing">
87 <div class="container"> 87 <div class="container">
88 <div class="thing__body"> 88 <div class="thing__body">
89 <ul class="breadcrumbs thing__breadcrumbs"> 89 <ul class="breadcrumbs thing__breadcrumbs">
90 <li><a href="{{ route('index') }}">Главная</a></li> 90 <li><a href="{{ route('index') }}">Главная</a></li>
91 <li><a href="{{ route('shipping_companies') }}">Работодатели</a></li> 91 <li><a href="{{ route('shipping_companies') }}">Работодатели</a></li>
92 <li><b>@isset($title) {{ $title }} @else Не указано @endif</b></li> 92 <li><b>@isset($title) {{ $title }} @else Не указано @endif</b></li>
93 </ul> 93 </ul>
94 @if ($company[0]->oficial_status == 1) 94 @if ($company[0]->oficial_status == 1)
95 <div class="thing__badge"> 95 <div class="thing__badge">
96 <svg> 96 <svg>
97 <use xlink:href="{{ asset('images/sprite.svg#badge') }}"></use> 97 <use xlink:href="{{ asset('images/sprite.svg#badge') }}"></use>
98 </svg> 98 </svg>
99 Компания проверена 99 Компания проверена
100 </div> 100 </div>
101 @endif 101 @endif
102 102
103 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $company[0]->name_company }}" class="thing__pic"> 103 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $company[0]->name_company }}" class="thing__pic">
104 <h1 class="thing__title">{{ $company[0]->name_company }}</h1> 104 <h1 class="thing__title">{{ $company[0]->name_company }}</h1>
105 <p class="thing__text">{{ $company[0]->text }}</p> 105 <p class="thing__text">{{ $company[0]->text }}</p>
106 <div class="thing__buttons"> 106 <div class="thing__buttons">
107 <button type="button" class="button"> 107 <button type="button" class="button">
108 <svg> 108 <svg>
109 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use> 109 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use>
110 </svg> 110 </svg>
111 {{ $company[0]->ads->count() }} вакансии 111 {{ $company[0]->ads->count() }} вакансии
112 </button> 112 </button>
113 <a data-fancybox data-src="#send" data-vacancy="0" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button"> 113 <a data-fancybox data-src="#send" data-vacancy="0" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button">
114 Написать сообщение 114 Написать сообщение
115 </a> 115 </a>
116 </div> 116 </div>
117 </div> 117 </div>
118 </div> 118 </div>
119 </section> 119 </section>
120 <main class="main"> 120 <main class="main">
121 <div class="container"> 121 <div class="container">
122 <div class="main__employer-page"> 122 <div class="main__employer-page">
123 <h2 class="main__employer-page-title">О компании</h2> 123 <h2 class="main__employer-page-title">О компании</h2>
124 <div class="main__employer-page-info"> 124 <div class="main__employer-page-info">
125 <div class="main__employer-page-item"> 125 <div class="main__employer-page-item">
126 <b>Адрес компании</b> 126 <b>Адрес компании</b>
127 <span> 127 <span>
128 {{ $company[0]->address }} 128 {{ $company[0]->address }}
129 </span> 129 </span>
130 </div> 130 </div>
131 <div class="main__employer-page-item"> 131 <div class="main__employer-page-item">
132 <b>Сайт</b> 132 <b>Сайт</b>
133 <span> 133 <span>
134 <a href="{{ $company[0]->site }}">{{ $company[0]->site }}</a> 134 <a href="{{ $company[0]->site }}">{{ $company[0]->site }}</a>
135 </span> 135 </span>
136 </div> 136 </div>
137 <div class="main__employer-page-item"> 137 <div class="main__employer-page-item">
138 <b>Почта</b> 138 <b>Почта</b>
139 <span> 139 <span>
140 <a href="mailto:">{{ $company[0]->email }}</a> 140 <a href="mailto:">{{ $company[0]->email }}</a>
141 </span> 141 </span>
142 </div> 142 </div>
143 <div class="main__employer-page-item"> 143 <div class="main__employer-page-item">
144 <b>Телефон</b> 144 <b>Телефон</b>
145 <span> 145 <span>
146 <a href="tel:{{ $company[0]->telephone }}">{{ $company[0]->telephone }}</a> 146 <a href="tel:{{ $company[0]->telephone }}">{{ $company[0]->telephone }}</a>
147 </span> 147 </span>
148 </div> 148 </div>
149 </div> 149 </div>
150 <div class="main__employer-page-item"> 150 <div class="main__employer-page-item">
151 <b>Описание</b> 151 <b>Описание</b>
152 <span> 152 <span>
153 {{ $company[0]->text }} 153 {{ $company[0]->text }}
154 </span> 154 </span>
155 </div> 155 </div>
156 <div> 156 <div>
157 <div class="main__employer-page-tabs"> 157 <div class="main__employer-page-tabs">
158 <button type="button" class="main__employer-page-tabs-item active" 158 <button type="button" class="main__employer-page-tabs-item active"
159 data-tab="1">Флот</button> 159 data-tab="1">Флот</button>
160 <button type="button" class="main__employer-page-tabs-item" data-tab="2">Вакансии</button> 160 <button type="button" class="main__employer-page-tabs-item" data-tab="2">Вакансии</button>
161 </div> 161 </div>
162 <div class="main__employer-page-body"> 162 <div class="main__employer-page-body">
163 <div class="main__employer-page-body-item showed" data-body="1"> 163 <div class="main__employer-page-body-item showed" data-body="1">
164 <div class="main__employer-page-one"> 164 <div class="main__employer-page-one">
165 @if ($company[0]->flots->count()) 165 @if ($company[0]->flots->count())
166 @foreach ($company[0]->flots as $flot) 166 @foreach ($company[0]->flots as $flot)
167 <a href="" class="main__employer-page-one-item"> 167 <a href="" class="main__employer-page-one-item">
168 <img src="{{ asset(Storage::url($flot->image)) }}" alt="{{ $flot->name }}"> 168 <img src="{{ asset(Storage::url($flot->image)) }}" alt="{{ $flot->name }}">
169 <b>{{ $flot->region }}</b> 169 <b>{{ $flot->region }}</b>
170 <span>{{ $flot->power }}</span> 170 <span>{{ $flot->power }}</span>
171 </a> 171 </a>
172 @endforeach 172 @endforeach
173 @endif 173 @endif
174 </div> 174 </div>
175 </div> 175 </div>
176 176
177 <div class="main__employer-page-body-item" data-body="2"> 177 <div class="main__employer-page-body-item" data-body="2">
178 <div class="main__employer-page-two"> 178 <div class="main__employer-page-two">
179 @foreach ($company[0]->ads as $job) 179 @foreach ($company[0]->ads as $job)
180 @foreach ($job->ad_job as $item) 180 @foreach ($job->ad_job as $item)
181 <div class="main__employer-page-two-item"> 181 <div class="main__employer-page-two-item">
182 <div class="main__employer-page-two-item-toper"> 182 <div class="main__employer-page-two-item-toper">
183 <!-- end --> 183 <!-- end -->
184 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $job->name }}"> 184 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $job->name }}">
185 <span>{{ $job->name }}</span> 185 <span>{{ $job->name }}</span>
186 </div> 186 </div>
187 <div class="main__employer-page-two-item-title">{{ $item->flot }}</div> 187 <div class="main__employer-page-two-item-title">{{ $item->flot }}</div>
188 <div class="main__employer-page-two-item-text"> 188 <div class="main__employer-page-two-item-text">
189 <div class="main__employer-page-two-item-text-name"> 189 <div class="main__employer-page-two-item-text-name">
190 {{ $item->job_title->name }} 190 {{ $item->job_title->name }}
191 </div> 191 </div>
192 <div class="main__employer-page-two-item-text-body"> 192 <div class="main__employer-page-two-item-text-body">
193 <p>Зарплата:{{ $item->min_salary }} - {{ $item->max_salary }}р + {{ $item->sytki }} суточные.</p> 193 <p>Зарплата:{{ $item->min_salary }} - {{ $item->max_salary }}р + {{ $item->sytki }} суточные.</p>
194 <p>Контракт: {{ $item->period }} мес.</p> 194 <p>Контракт: {{ $item->period }} мес.</p>
195 </div> 195 </div>
196 </div> 196 </div>
197 <div class="main__employer-page-two-item-text"> 197 <div class="main__employer-page-two-item-text">
198 <div class="main__employer-page-two-item-text-name">Район работы</div> 198 <div class="main__employer-page-two-item-text-name">Район работы</div>
199 <div class="main__employer-page-two-item-text-body"> 199 <div class="main__employer-page-two-item-text-body">
200 <p>{{ $item->region }}</p> 200 <p>{{ $item->region }}</p>
201 </div> 201 </div>
202 </div> 202 </div>
203 <div class="main__employer-page-two-item-text"> 203 <div class="main__employer-page-two-item-text">
204 <div class="main__employer-page-two-item-text-name">Посадка</div> 204 <div class="main__employer-page-two-item-text-name">Посадка</div>
205 <div class="main__employer-page-two-item-text-body"> 205 <div class="main__employer-page-two-item-text-body">
206 <p> {{ $item->start }}</p> 206 <p> {{ $item->start }}</p>
207 {!! $item->description !!} 207 {!! $item->description !!}
208 </div> 208 </div>
209 </div> 209 </div>
210 <div class="main__employer-page-two-item-text"> 210 <div class="main__employer-page-two-item-text">
211 <div class="main__employer-page-two-item-text-name">Звонить по вопросам на: 211 <div class="main__employer-page-two-item-text-name">Звонить по вопросам на:
212 </div> 212 </div>
213 <div class="main__employer-page-two-item-text-body"> 213 <div class="main__employer-page-two-item-text-body">
214 <a href="tel:{{ $job->telephone }}">{{ $job->telephone }}</a> 214 <a href="tel:{{ $job->telephone }}">{{ $job->telephone }}</a>
215 </div> 215 </div>
216 </div> 216 </div>
217 <div class="main__employer-page-two-item-text"> 217 <div class="main__employer-page-two-item-text">
218 <div class="main__employer-page-two-item-text-name">Анкеты присылать на 218 <div class="main__employer-page-two-item-text-name">Анкеты присылать на
219 почту: 219 почту:
220 </div> 220 </div>
221 <div class="main__employer-page-two-item-text-body"> 221 <div class="main__employer-page-two-item-text-body">
222 <a href="mailto: {{ $job->email }}">{{ $job->email }}</a> 222 <a href="mailto: {{ $job->email }}">{{ $job->email }}</a>
223 </div> 223 </div>
224 </div> 224 </div>
225 <div class="main__employer-page-two-item-tags"> 225 <div class="main__employer-page-two-item-tags">
226 <span class="main__employer-page-two-item-tag">#{{ $item->job_title->name }}</span> 226 <span class="main__employer-page-two-item-tag">#{{ $item->job_title->name }}</span>
227 </div> 227 </div>
228 <div class="main__employer-page-two-item-buttons"> 228 <div class="main__employer-page-two-item-buttons">
229 @if ($user_id == 0)
230 <button type="button" data-fancybox data-src="#sign" data-options='{"touch":false,"autoFocus":false}'
231 class="button main__employer-page-two-item-button js_send_it_button">Оставить
232 отклик123</button>
233 @else
229 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $item->job_title->id }}" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}' 234 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $item->job_title->id }}" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}'
230 class="button main__employer-page-two-item-button js_send_it_button">Оставить 235 class="button main__employer-page-two-item-button js_send_it_button">Оставить
231 отклик</button> 236 отклик41-42-41</button>
237 @endif
232 <!--<a href="#" 238 <!--<a href="#"
233 class="button button_light main__employer-page-two-item-button">Подробнее</a>--> 239 class="button button_light main__employer-page-two-item-button">Подробнее</a>-->
234 </div> 240 </div>
235 <div class="main__employer-page-two-item-bottom"> 241 <div class="main__employer-page-two-item-bottom">
236 <div class="main__employer-page-two-item-bottom-date">{{ $job->updated_at }}</div> 242 <div class="main__employer-page-two-item-bottom-date">{{ $job->updated_at }}</div>
237 <button type="button" 243 <button type="button"
238 class="like main__employer-page-two-item-bottom-like js-toggle"> 244 class="like main__employer-page-two-item-bottom-like js-toggle">
239 <svg> 245 <svg>
240 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 246 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
241 </svg> 247 </svg>
242 </button> 248 </button>
243 </div> 249 </div>
244 </div> 250 </div>
245 @endforeach 251 @endforeach
246 @endforeach 252 @endforeach
247 <!--<button type="button" class="button button_light button_more main__employer-page-two-more js-toggle js-parent-toggle"> 253 <!--<button type="button" class="button button_light button_more main__employer-page-two-more js-toggle js-parent-toggle">
248 <span>Показать ещё</span> 254 <span>Показать ещё</span>
249 <span>Скрыть</span> 255 <span>Скрыть</span>
250 </button>--> 256 </button>-->
251 </div> 257 </div>
252 </div> 258 </div>
253 </div> 259 </div>
254 </div> 260 </div>
255 </div> 261 </div>
256 </div> 262 </div>
257 </main> 263 </main>
258 @endsection 264 @endsection
259 265
resources/views/info_company_new.blade.php
File was created 1 @extends('layout.frontend', ['title' => 'Описание компании '.$title.'- РекаМоре'])
2
3 @section('scripts')
4 <script>
5 console.log('Test system');
6 $(document).on('change', '#sort_ajax', function() {
7 var this_ = $(this);
8 var val_ = this_.val();
9 console.log('sort items '+val_);
10
11 $.ajax({
12 type: "GET",
13 url: "{{ route('shipping_companies') }}",
14 data: "sort="+val_+"&block=1",
15 success: function (data) {
16 console.log('Выбор сортировки');
17 console.log(data);
18 $('#block_1').html(data);
19 },
20 headers: {
21 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
22 },
23 error: function (data) {
24 data = JSON.stringify(data);
25 console.log('Error: ' + data);
26 }
27 });
28
29 $.ajax({
30 type: "GET",
31 url: "{{ route('shipping_companies') }}",
32 data: "sort="+val_+"&block=2",
33 success: function (data) {
34 console.log('Выбор сортировки2');
35 console.log(data);
36 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
37 $('#block_2').html(data);
38 },
39 headers: {
40 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
41 },
42 error: function (data) {
43 data = JSON.stringify(data);
44 console.log('Error: ' + data);
45 }
46 });
47 });
48
49 $(document).ready(function(){
50 var sel = $('#select2-sort_ajax-container');
51 var key = getUrlParameter('sort');
52
53 if (key !=='') {
54 console.log(key);
55 switch (key) {
56 case "default": sel.html('Сортировка (по умолчанию)'); break;
57 case "name_up": sel.html('По имени (возрастание)'); break;
58 case "name_down": sel.html('По дате (убывание)'); break;
59 case "created_at_up": sel.html('По дате (возрастание)'); break;
60 case "created_at_down": sel.html('По дате (убывание)'); break;
61 }
62
63 }
64 });
65
66 //end
67 $(document).on('click', '.js_send_it_button', function() {
68 var this_ = $(this);
69 var code_user_id = this_.attr('data-uid');
70 var code_to_user_id = this_.attr('data-tuid');
71 var code_vacancy = this_.attr('data-vacancy');
72 var user_id = $('#send_user_id');
73 var to_user_id = $('#send_to_user_id');
74 var vacancy = $('#send_vacancy');
75
76 console.log('Клик на кнопки...');
77
78 user_id.val(code_user_id);
79 to_user_id.val(code_to_user_id);
80 vacancy.val(code_vacancy);
81 });
82 </script>
83 @endsection
84
85 @section('content')
86 <section class="thing">
87 <div class="container">
88 <div class="thing__body">
89 <ul class="breadcrumbs thing__breadcrumbs">
90 <li><a href="{{ route('index') }}">Главная</a></li>
91 <li><a href="{{ route('shipping_companies') }}">Работодатели</a></li>
92 <li><b>@isset($title) {{ $title }} @else Не указано @endif</b></li>
93 </ul>
94 @if ($company[0]->oficial_status == 1)
95 <div class="thing__badge">
96 <svg>
97 <use xlink:href="{{ asset('images/sprite.svg#badge') }}"></use>
98 </svg>
99 Компания проверена
100 </div>
101 @endif
102
103 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $company[0]->name_company }}" class="thing__pic">
104 <h1 class="thing__title">{{ $company[0]->name_company }}</h1>
105 <p class="thing__text">{{ $company[0]->text }}</p>
106 <div class="thing__buttons">
107 <button type="button" class="button">
108 <svg>
109 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use>
110 </svg>
111 {{ $company[0]->ads->count() }} вакансии
112 </button>
113 @if ($user_id == 0)
114 <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button">
115 Написать сообщение
116 </a>
117 @else
118 <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button">
119 Написать сообщение
120 </a>
121 @endif
122 </div>
123 </div>
124 </div>
125 </section>
126 <main class="main">
127 <div class="container">
128 <div class="main__employer-page">
129 <h2 class="main__employer-page-title">О компании</h2>
130 <div class="main__employer-page-info">
131 <div class="main__employer-page-item">
132 <b>Адрес компании</b>
133 <span>
134 {{ $company[0]->address }}
135 </span>
136 </div>
137 <div class="main__employer-page-item">
138 <b>Сайт</b>
139 <span>
140 <a href="{{ $company[0]->site }}">{{ $company[0]->site }}</a>
141 </span>
142 </div>
143 <div class="main__employer-page-item">
144 <b>Почта</b>
145 <span>
146 <a href="mailto:">{{ $company[0]->email }}</a>
147 </span>
148 </div>
149 <div class="main__employer-page-item">
150 <b>Телефон</b>
151 <span>
152 <a href="tel:{{ $company[0]->telephone }}">{{ $company[0]->telephone }}</a>
153 </span>
154 </div>
155 </div>
156 <div class="main__employer-page-item">
157 <b>Описание</b>
158 <span>
159 {{ $company[0]->text }}
160 </span>
161 </div>
162 <div>
163 <div class="main__employer-page-tabs">
164 <button type="button" class="main__employer-page-tabs-item active"
165 data-tab="1">Флот</button>
166 <button type="button" class="main__employer-page-tabs-item" data-tab="2">Вакансии</button>
167 </div>
168 <div class="main__employer-page-body">
169 <div class="main__employer-page-body-item showed" data-body="1">
170 <div class="main__employer-page-one">
171 @if ($company[0]->flots->count())
172 @foreach ($company[0]->flots as $flot)
173 <a href="" class="main__employer-page-one-item">
174 <img src="{{ asset(Storage::url($flot->image)) }}" alt="{{ $flot->name }}">
175 <b>{{ $flot->region }}</b>
176 <span>{{ $flot->power }}</span>
177 </a>
178 @endforeach
179 @endif
180 </div>
181 </div>
182
183 <div class="main__employer-page-body-item" data-body="2">
184 <div class="main__employer-page-two">
185 @foreach ($company[0]->ads as $job)
186 @foreach ($job->ad_job as $item)
187 <div class="main__employer-page-two-item">
188 <div class="main__employer-page-two-item-toper">
189 <!-- end -->
190 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $job->name }}">
191 <span>{{ $job->name }}</span>
192 </div>
193 <div class="main__employer-page-two-item-title">{{ $item->flot }}</div>
194 <div class="main__employer-page-two-item-text">
195 <div class="main__employer-page-two-item-text-name">
196 {{ $item->job_title->name }}
197 </div>
198 <div class="main__employer-page-two-item-text-body">
199 <p>Зарплата:{{ $item->min_salary }} - {{ $item->max_salary }}р + {{ $item->sytki }} суточные.</p>
200 <p>Контракт: {{ $item->period }} мес.</p>
201 </div>
202 </div>
203 <div class="main__employer-page-two-item-text">
204 <div class="main__employer-page-two-item-text-name">Район работы</div>
205 <div class="main__employer-page-two-item-text-body">
206 <p>{{ $item->region }}</p>
207 </div>
208 </div>
209 <div class="main__employer-page-two-item-text">
210 <div class="main__employer-page-two-item-text-name">Посадка</div>
211 <div class="main__employer-page-two-item-text-body">
212 <p> {{ $item->start }}</p>
213 {!! $item->description !!}
214 </div>
215 </div>
216 <div class="main__employer-page-two-item-text">
217 <div class="main__employer-page-two-item-text-name">Звонить по вопросам на:
218 </div>
219 <div class="main__employer-page-two-item-text-body">
220 <a href="tel:{{ $job->telephone }}">{{ $job->telephone }}</a>
221 </div>
222 </div>
223 <div class="main__employer-page-two-item-text">
224 <div class="main__employer-page-two-item-text-name">Анкеты присылать на
225 почту:
226 </div>
227 <div class="main__employer-page-two-item-text-body">
228 <a href="mailto: {{ $job->email }}">{{ $job->email }}</a>
229 </div>
230 </div>
231 <div class="main__employer-page-two-item-tags">
232 <span class="main__employer-page-two-item-tag">#{{ $item->job_title->name }}</span>
233 </div>
234 <div class="main__employer-page-two-item-buttons">
235
236 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $item->job_title->id }}" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}'
237 class="button main__employer-page-two-item-button js_send_it_button">Оставить
238 отклик...</button>
239
240 <!--<a href="#"
241 class="button button_light main__employer-page-two-item-button">Подробнее</a>-->
242 </div>
243 <div class="main__employer-page-two-item-bottom">
244 <div class="main__employer-page-two-item-bottom-date">{{ $job->updated_at }}</div>
245 <button type="button"
246 class="like main__employer-page-two-item-bottom-like js-toggle">
247 <svg>
248 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
249 </svg>
250 </button>
251 </div>
252 </div>
253 @endforeach
254 @endforeach
255 <!--<button type="button" class="button button_light button_more main__employer-page-two-more js-toggle js-parent-toggle">
256 <span>Показать ещё</span>
257 <span>Скрыть</span>
258 </button>-->
259 </div>
260 </div>
261 </div>
262 </div>
263 </div>
264 </div>
265 </main>
266 @endsection
267
resources/views/js/modals.blade.php
1 <script> 1 <script>
2 console.log('Test system'); 2 console.log('Test system');
3 $(document).on('click', '#button_send', function() { 3 $(document).on('click', '#button_send', function() {
4 var field_login = $('#email'); 4 var field_login = $('#email_input');
5 var field_pwd = $('#password'); 5 var field_pwd = $('#password');
6 var login_val = field_login.val(); 6 var login_val = field_login.val();
7 var pwd_val = field_pwd.val(); 7 var pwd_val = field_pwd.val();
8 8
9 console.log('login: '+login_val+' password: '+pwd_val); 9 console.log('login: '+login_val+' password: '+pwd_val);
10 10
11 $.ajax({ 11 $.ajax({
12 type: "GET", 12 type: "GET",
13 url: "{{ route('login') }}", 13 url: "{{ route('login') }}",
14 data: "email="+login_val+"&password="+pwd_val, 14 data: "email="+login_val+"&password="+pwd_val,
15 success: function (data) { 15 success: function (data) {
16 console.log('Вход в систему'); 16 console.log('Вход в систему');
17 console.log(data);
17 let d = JSON.parse(data); 18 let d = JSON.parse(data);
18 if(typeof d['REDIRECT'] !== "undefined") { 19 if(typeof d['REDIRECT'] !== "undefined") {
19 location.href = d['REDIRECT']; 20 location.href = d['REDIRECT'];
20 console.log(d['REDIRECT']); 21 console.log(d['REDIRECT']);
21 } 22 }
22 if (typeof d['ERROR'] !== "undefined") { 23 if (typeof d['ERROR'] !== "undefined") {
23 console.log(d['ERROR']); 24 console.log(d['ERROR']);
24 $('#message_error').html(d['ERROR']); 25 $('#message_error').html(d['ERROR']);
25 } 26 }
26 console.log(d['REDIRECT']); 27 //console.log(d['REDIRECT']);
27 //$('#block_1').html(data); 28 //$('#block_1').html(data);
28 }, 29 },
29 headers: { 30 headers: {
30 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 31 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
31 }, 32 },
32 error: function (data) { 33 error: function (data) {
33 data = JSON.stringify(data); 34 data = JSON.stringify(data);
34 console.log('Error: ' + data); 35 console.log('Error: ' + data);
35 } 36 }
36 }); 37 });
37 }); 38 });
38 39
39 $(document).on('click', '#button_reg_worker', function() { 40 $(document).on('click', '#button_reg_worker', function() {
40 var field_login = $('#email_worker'); 41 var field_login = $('#email_worker');
41 var field_pwd = $('#password_worker'); 42 var field_pwd = $('#password_worker');
42 var field_confirm_pwd = $('#password_confirmation_worker'); 43 var field_confirm_pwd = $('#password_confirmation_worker');
43 var field_politik_worker = $('#politik_worker'); 44 var field_politik_worker = $('#politik_worker');
44 var field_telephone_worker = $('#telephone_worker'); 45 var field_telephone_worker = $('#telephone_worker');
45 var field_job_titles_worker = $('#job_titles_worker'); 46 var field_job_titles_worker = $('#job_titles_worker');
46 var field_surname_worker = $('#surname_worker'); 47 var field_surname_worker = $('#surname_worker');
47 var field_name_man = $('#name_man_worker'); 48 var field_name_man = $('#name_man_worker');
48 var field_surname2_worker = $('#surname2_worker'); 49 var field_surname2_worker = $('#surname2_worker');
49 50
50 var login = field_login.val(); 51 var login = field_login.val();
51 var pwd = field_pwd.val(); 52 var pwd = field_pwd.val();
52 var confirm_pwd = field_confirm_pwd.val(); 53 var confirm_pwd = field_confirm_pwd.val();
53 var politik = field_politik_worker.val(); 54 var politik = field_politik_worker.val();
54 var telephone = field_telephone_worker.val(); 55 var telephone = field_telephone_worker.val();
55 var job_titles = field_job_titles_worker.val(); 56 var job_titles = field_job_titles_worker.val();
56 var surname = field_surname_worker.val(); 57 var surname = field_surname_worker.val();
57 var name_man = field_name_man.val(); 58 var name_man = field_name_man.val();
58 var surname2 = field_surname2_worker.val(); 59 var surname2 = field_surname2_worker.val();
59 60
60 61
61 console.log('login: '+login+' password: '+pwd); 62 console.log('login: '+login+' password: '+pwd);
62 63
63 $.ajax({ 64 $.ajax({
64 type: "GET", 65 type: "GET",
65 url: "{{ route('register_worker') }}", 66 url: "{{ route('register_worker') }}",
66 data: "email="+login+"&password="+pwd+"&confirmed="+confirm_pwd+"&politik="+politik+ 67 data: "email="+login+"&password="+pwd+"&confirmed="+confirm_pwd+"&politik="+politik+
67 "&telephone="+telephone+"&job_titles="+job_titles+"&surname="+surname+"&name_man="+name_man+ 68 "&telephone="+telephone+"&job_titles="+job_titles+"&surname="+surname+"&name_man="+name_man+
68 "&surname2="+surname2+"&subscribe_email="+login, 69 "&surname2="+surname2+"&subscribe_email="+login,
69 success: function (data) { 70 success: function (data) {
70 console.log('Вход в систему'); 71 console.log('Вход в систему');
71 let d = JSON.parse(data); 72 let d = JSON.parse(data);
72 if(typeof d['REDIRECT'] !== "undefined") { 73 if(typeof d['REDIRECT'] !== "undefined") {
73 console.log(d['REDIRECT']); 74 console.log(d['REDIRECT']);
74 location.href = d['REDIRECT']; 75 location.href = d['REDIRECT'];
75 } 76 }
76 if (typeof d['ERROR'] !== "undefined") { 77 if (typeof d['ERROR'] !== "undefined") {
77 console.log(d['ERROR']); 78 console.log(d['ERROR']);
78 $('#block-info').css({'display': 'block'}); 79 $('#block-info').css({'display': 'block'});
79 $('#messages_error_reg').html(d['ERROR']); 80 $('#messages_error_reg').html(d['ERROR']);
80 } 81 }
81 console.log(d['REDIRECT']); 82 console.log(d['REDIRECT']);
82 83
83 }, 84 },
84 headers: { 85 headers: {
85 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 86 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
86 }, 87 },
87 error: function (data) { 88 error: function (data) {
88 data = JSON.stringify(data); 89 data = JSON.stringify(data);
89 console.log('Error: ' + data); 90 console.log('Error: ' + data);
90 } 91 }
91 }); 92 });
92 93
93 return false; 94 return false;
94 }); 95 });
95 96
96 $(document).on('click', '#button_reg_employer', function() { 97 $(document).on('click', '#button_reg_employer', function() {
97 var field_login = $('#email_employer'); 98 var field_login = $('#email_employer');
98 var field_pwd = $('#password_employer'); 99 var field_pwd = $('#password_employer');
99 var field_confirm_pwd = $('#password_confirmation_employer'); 100 var field_confirm_pwd = $('#password_confirmation_employer');
100 var field_politik_employer = $('#politik_employer'); 101 var field_politik_employer = $('#politik_employer');
101 var field_telephone_employer = $('#telephone_employer'); 102 var field_telephone_employer = $('#telephone_employer');
102 var field_company_employer = $('#company_employer'); 103 var field_company_employer = $('#company_employer');
103 var field_surname_employer = $('#surname_employer'); 104 var field_surname_employer = $('#surname_employer');
104 var field_name_man_employer = $('#name_man_employer'); 105 var field_name_man_employer = $('#name_man_employer');
105 var field_surname2_employer = $('#surname2_employer'); 106 var field_surname2_employer = $('#surname2_employer');
106 107
107 var login = field_login.val(); 108 var login = field_login.val();
108 var pwd = field_pwd.val(); 109 var pwd = field_pwd.val();
109 var confirm_pwd = field_confirm_pwd.val(); 110 var confirm_pwd = field_confirm_pwd.val();
110 var politik = field_politik_employer.val(); 111 var politik = field_politik_employer.val();
111 var telephone = field_telephone_employer.val(); 112 var telephone = field_telephone_employer.val();
112 var company_employer = field_company_employer.val(); 113 var company_employer = field_company_employer.val();
113 var surname = field_surname_employer.val(); 114 var surname = field_surname_employer.val();
114 var name_man = field_name_man_employer.val(); 115 var name_man = field_name_man_employer.val();
115 var surname2 = field_surname2_employer.val(); 116 var surname2 = field_surname2_employer.val();
116 117
117 118
118 console.log('login: '+login+' password: '+pwd); 119 console.log('login: '+login+' password: '+pwd);
119 120
120 121
121 $.ajax({ 122 $.ajax({
122 type: "GET", 123 type: "GET",
123 url: "{{ route('register_employer') }}", 124 url: "{{ route('register_employer') }}",
124 data: "email="+login+"&password="+pwd+"&confirmed="+confirm_pwd+"&politik="+politik+ 125 data: "email="+login+"&password="+pwd+"&confirmed="+confirm_pwd+"&politik="+politik+
125 "&telephone="+telephone+"&name_company="+company_employer+"&surname="+surname+"&name_man="+name_man+ 126 "&telephone="+telephone+"&name_company="+company_employer+"&surname="+surname+"&name_man="+name_man+
126 "&surname2="+surname2+"&subscribe_email="+login, 127 "&surname2="+surname2+"&subscribe_email="+login,
127 success: function (data) { 128 success: function (data) {
128 console.log('Вход в систему'); 129 console.log('Вход в систему');
129 let d = JSON.parse(data); 130 let d = JSON.parse(data);
130 if(typeof d['REDIRECT'] !== "undefined") { 131 if(typeof d['REDIRECT'] !== "undefined") {
131 console.log(d['REDIRECT']); 132 console.log(d['REDIRECT']);
132 location.href = d['REDIRECT']; 133 location.href = d['REDIRECT'];
133 } 134 }
134 if (typeof d['ERROR'] !== "undefined") { 135 if (typeof d['ERROR'] !== "undefined") {
135 console.log(d['ERROR']); 136 console.log(d['ERROR']);
136 $('#block-info').css({'display': 'block'}); 137 $('#block-info').css({'display': 'block'});
137 $('#messages_error_reg').html(d['ERROR']); 138 $('#messages_error_reg').html(d['ERROR']);
138 } 139 }
139 console.log(d['REDIRECT']); 140 console.log(d['REDIRECT']);
140 141
141 }, 142 },
142 headers: { 143 headers: {
143 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 144 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
144 }, 145 },
145 error: function (data) { 146 error: function (data) {
146 data = JSON.stringify(data); 147 data = JSON.stringify(data);
147 console.log('Error: ' + data); 148 console.log('Error: ' + data);
148 } 149 }
149 }); 150 });
150 151
151 return false; 152 return false;
152 }); 153 });
153 154
154 </script> 155 </script>
155 156
resources/views/modals/send_login.blade.php
1 <div id="sign" class="modal"> 1 <div id="sign" class="modal">
2 <div class="modal__body"> 2 <div class="modal__body">
3 <div class="modal__title left">Войти</div> 3 <div class="modal__title left">Войти</div>
4 <form class="modal__sign"> 4 <form class="modal__sign">
5 <div id="message_error" name="message_error"> 5 <div id="message_error" name="message_error">
6 </div> 6 </div>
7 <div class="modal__sign-item"> 7 <div class="modal__sign-item">
8 <input type="email" class="input" id="email" name="email" placeholder="E-mail" required> 8 <input type="email" class="input" id="email_input" name="email" placeholder="E-mail" required>
9 </div> 9 </div>
10 <div class="modal__sign-item"> 10 <div class="modal__sign-item">
11 <input type="password" class="input" id="password" name="password" placeholder="Пароль" required> 11 <input type="password" class="input" id="password" name="password" placeholder="Пароль" required>
12 <button type="button" class="eye"> 12 <button type="button" class="eye">
13 <svg class="js-password-show"> 13 <svg class="js-password-show">
14 <use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use> 14 <use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use>
15 </svg> 15 </svg>
16 <svg class="js-password-hide"> 16 <svg class="js-password-hide">
17 <use xlink:href="{{ asset('images/sprite.svg#eye-2') }}"></use> 17 <use xlink:href="{{ asset('images/sprite.svg#eye-2') }}"></use>
18 </svg> 18 </svg>
19 </button> 19 </button>
20 </div> 20 </div>
21 <div class="modal__sign-item"> 21 <div class="modal__sign-item">
22 <div class="modal__sign-bottom"> 22 <div class="modal__sign-bottom">
23 <div> 23 <div>
24 <label class="checkbox"> 24 <label class="checkbox">
25 <input type="checkbox" id="save_me" name="save_me" class="checkbox__input" required> 25 <input type="checkbox" id="save_me" name="save_me" class="checkbox__input" required>
26 <span class="checkbox__icon"> 26 <span class="checkbox__icon">
27 <svg> 27 <svg>
28 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use> 28 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use>
29 </svg> 29 </svg>
30 </span> 30 </span>
31 <span class="checkbox__text"> 31 <span class="checkbox__text">
32 <span> 32 <span>
33 Запомнить меня 33 Запомнить меня
34 </span> 34 </span>
35 </span> 35 </span>
36 </label> 36 </label>
37 </div> 37 </div>
38 <div> 38 <div>
39 <a data-fancybox data-src="#reset" data-options='{"touch":false,"autoFocus":false}' class="modal__sign-bottom-link">Забыли пароль?</a> 39 <a data-fancybox data-src="#reset" data-options='{"touch":false,"autoFocus":false}' class="modal__sign-bottom-link">Забыли пароль?</a>
40 </div> 40 </div>
41 </div> 41 </div>
42 </div> 42 </div>
43 <div class="modal__sign-item"> 43 <div class="modal__sign-item">
44 <a id="button_send" name="button_send" class="button">Войти</a> 44 <a id="button_send" name="button_send" class="button">Войти</a>
45 </div> 45 </div>
46 </form> 46 </form>
47 <div class="modal__text"> 47 <div class="modal__text">
48 <span>У Вас ещё нет аккаунта?</span> 48 <span>У Вас ещё нет аккаунта?</span>
49 &nbsp; 49 &nbsp;
50 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Создать аккаунт</a> 50 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Создать аккаунт</a>
51 </div> 51 </div>
52 </div> 52 </div>
53 </div> 53 </div>
54 54
resources/views/resume.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).ready(function() { 33 $(document).ready(function() {
34 $(document).on('click', '.js_box_favorites', function () { 34 $(document).on('click', '.js_box_favorites', function () {
35 var _this = $(this); 35 var _this = $(this);
36 var id_worker = _this.attr('data-val'); 36 var id_worker = _this.attr('data-val');
37 37
38 if (_this.hasClass('active')) { 38 if (_this.hasClass('active')) {
39 add_in_array(id_worker); 39 add_in_array(id_worker);
40 console.log('Добавлено в избранное id=' + id_worker); 40 console.log('Добавлено в избранное id=' + id_worker);
41 } else { 41 } else {
42 delete_in_array(id_worker); 42 delete_in_array(id_worker);
43 console.log('Удалено из избранных id='+id_worker) 43 console.log('Удалено из избранных id='+id_worker)
44 } 44 }
45 var str = $.cookie('favorite_worker'); 45 var str = $.cookie('favorite_worker');
46 console.log("Вывод куков "+str); 46 console.log("Вывод куков "+str);
47 47
48 }); 48 });
49 }); 49 });
50 50
51 //помеченный элемент 51 //помеченный элемент
52 function selected_item(obj) { 52 function selected_item(obj) {
53 var arr = read_array(); 53 var arr = read_array();
54 var index = arr.indexOf(obj); 54 var index = arr.indexOf(obj);
55 55
56 if (index > 0) 56 if (index > 0)
57 return "active"; 57 return "active";
58 else 58 else
59 return ""; 59 return "";
60 } 60 }
61 61
62 // запись элемента массива в cookie 62 // запись элемента массива в cookie
63 function add_in_array(obj){ 63 function add_in_array(obj){
64 var arr = read_array();//получаем текущее состояние массива 64 var arr = read_array();//получаем текущее состояние массива
65 arr[arr.length]=obj; //добавляем элемент в конец 65 arr[arr.length]=obj; //добавляем элемент в конец
66 //var str = JSON.stringify(arr);//конвертируем в строку 66 //var str = JSON.stringify(arr);//конвертируем в строку
67 //$.cookie('arr',str);//записываем массив в куки 67 //$.cookie('arr',str);//записываем массив в куки
68 $.cookie('favorite_worker', JSON.stringify(arr)); 68 $.cookie('favorite_worker', JSON.stringify(arr));
69 69
70 } 70 }
71 71
72 // удаление элемента из массива в cookie 72 // удаление элемента из массива в cookie
73 function delete_in_array(obj) { 73 function delete_in_array(obj) {
74 var arr = read_array(); 74 var arr = read_array();
75 var unique = [...new Set(arr)] 75 var unique = [...new Set(arr)]
76 var index = unique.indexOf(obj); 76 var index = unique.indexOf(obj);
77 77
78 unique.splice(index, 1); 78 unique.splice(index, 1);
79 79
80 //var str = JSON.stringify(arr);//конвертируем в строку 80 //var str = JSON.stringify(arr);//конвертируем в строку
81 //$.cookie('arr',str);//записываем массив в куки 81 //$.cookie('arr',str);//записываем массив в куки
82 $.cookie('favorite_worker', JSON.stringify(unique)); 82 $.cookie('favorite_worker', JSON.stringify(unique));
83 83
84 } 84 }
85 85
86 function read_array(){ 86 function read_array(){
87 var dataArr=$.cookie('favorite_worker');//считываем данные из куков 87 var dataArr=$.cookie('favorite_worker');//считываем данные из куков
88 88
89 //если массив не был обнаружен, иницилизируем его 89 //если массив не был обнаружен, иницилизируем его
90 if(dataArr===null){ 90 if(dataArr===null){
91 dataArr = init_array(); //возвращаем инициализированный пустой маасив 91 dataArr = init_array(); //возвращаем инициализированный пустой маасив
92 } 92 }
93 //возвращаем полученный массив 93 //возвращаем полученный массив
94 //return JSON.parse(dataArr); 94 //return JSON.parse(dataArr);
95 return JSON.parse(dataArr); 95 return JSON.parse(dataArr);
96 } 96 }
97 97
98 //другими словами создаем пустой массив 98 //другими словами создаем пустой массив
99 function init_array(){ 99 function init_array(){
100 //var str = JSON.stringify(new Array());//конвертируем в строку 100 //var str = JSON.stringify(new Array());//конвертируем в строку
101 var str = JSON.stringify(new Array()); 101 var str = JSON.stringify(new Array());
102 $.cookie('favorite_worker',str);//записываем массив в куки 102 $.cookie('favorite_worker',str);//записываем массив в куки
103 103
104 return str; 104 return str;
105 } 105 }
106 </script> 106 </script>
107 <script> 107 <script>
108 $(document).on('click', '.js_it_button', function() { 108 $(document).on('click', '.js_it_button', function() {
109 var this_ = $(this); 109 var this_ = $(this);
110 var code_user_id = this_.attr('data-uid'); 110 var code_user_id = this_.attr('data-uid');
111 var code_to_user_id = this_.attr('data-tuid'); 111 var code_to_user_id = this_.attr('data-tuid');
112 var code_vacancy = this_.attr('data-vacancy'); 112 var code_vacancy = this_.attr('data-vacancy');
113 var user_id = $('#_user_id'); 113 var user_id = $('#_user_id');
114 var to_user_id = $('#_to_user_id'); 114 var to_user_id = $('#_to_user_id');
115 var vacancy = $('#_vacancy'); 115 var vacancy = $('#_vacancy');
116 116
117 console.log('code_to_user_id='+code_to_user_id); 117 console.log('code_to_user_id='+code_to_user_id);
118 console.log('code_user_id='+code_user_id); 118 console.log('code_user_id='+code_user_id);
119 console.log('code_vacancy='+code_vacancy); 119 console.log('code_vacancy='+code_vacancy);
120 console.log('Клик на кнопке...'); 120 console.log('Клик на кнопке...');
121 121
122 user_id.val(code_user_id); 122 user_id.val(code_user_id);
123 to_user_id.val(code_to_user_id); 123 to_user_id.val(code_to_user_id);
124 vacancy.val(code_vacancy); 124 vacancy.val(code_vacancy);
125 }); 125 });
126 </script> 126 </script>
127 <script>
128 $(document).on('change', '#sort_ajax', function() {
129 var this_ = $(this);
130 var val_ = this_.val();
131 console.log('sort items '+val_);
132
133 $.ajax({
134 type: "GET",
135 url: "{{ route('bd_resume') }}",
136 data: "sort="+val_+"&block=1",
137 success: function (data) {
138 console.log('Выбор сортировки');
139 console.log(data);
140 $('#block1').html(data);
141 history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
142 },
143 headers: {
144 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
145 },
146 error: function (data) {
147 data = JSON.stringify(data);
148 console.log('Error: ' + data);
149 }
150 });
151
152 $.ajax({
153 type: "GET",
154 url: "{{ route('bd_resume') }}",
155 data: "sort="+val_+"&block=2",
156 success: function (data) {
157 console.log('Выбор сортировки');
158 console.log(data);
159 $('#block2').html(data);
160 history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
161 },
162 headers: {
163 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
164 },
165 error: function (data) {
166 data = JSON.stringify(data);
167 console.log('Error: ' + data);
168 }
169 });
170
171 });
172
173 $(document).ready(function(){
174 var sel = $('#select2-sort_ajax-container');
175 var key = getUrlParameter('sort');
176 console.log(sel);
177 console.log(key);
178
179 if (key !=='') {
180 console.log(key);
181 switch (key) {
182 case "default": sel.html('Сортировка (по умолчанию)'); break;
183 case "name_up": sel.html('По имени (возрастание)'); break;
184 case "name_down": sel.html('По дате (убывание)'); break;
185 case "created_at_up": sel.html('По дате (возрастание)'); break;
186 case "created_at_down": sel.html('По дате (убывание)'); break;
187 }
188
189 }
190 });
191 </script>
127 @endsection 192 @endsection
128 193
129 194
130 @section('content') 195 @section('content')
131 <section class="thing"> 196 <section class="thing">
132 <div class="container"> 197 <div class="container">
133 <form class="thing__body" action="{{ url()->current() }}"> 198 <form class="thing__body" action="{{ url()->current() }}">
134 <ul class="breadcrumbs thing__breadcrumbs"> 199 <ul class="breadcrumbs thing__breadcrumbs">
135 <li><a href="{{ route('index') }}">Главная</a></li> 200 <li><a href="{{ route('index') }}">Главная</a></li>
136 <li><b>База резюме</b></li> 201 <li><b>База резюме</b></li>
137 </ul> 202 </ul>
138 <h1 class="thing__title">База резюме</h1> 203 <h1 class="thing__title">База резюме</h1>
139 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для 204 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для
140 существующих финансовых и административных условий.</p> 205 существующих финансовых и административных условий.</p>
141 <div class="search thing__search"> 206 <div class="search thing__search">
142 <input type="search" class="input" name="search" id="search" placeholder="Введите наименование должности" required> 207 <input type="search" class="input" name="search" id="search" placeholder="Введите наименование должности" required>
143 <button type="submit" class="button">Найти</button> 208 <button type="submit" class="button">Найти</button>
144 <span> 209 <span>
145 <svg> 210 <svg>
146 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 211 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
147 </svg> 212 </svg>
148 </span> 213 </span>
149 </div> 214 </div>
150 <label class="checkbox thing__checkbox"> 215 <label class="checkbox thing__checkbox">
151 <input type="checkbox" class="checkbox__input" name="experience" id="experience"> 216 <input type="checkbox" class="checkbox__input" name="experience" id="experience">
152 <span class="checkbox__icon"> 217 <span class="checkbox__icon">
153 <svg> 218 <svg>
154 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use> 219 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use>
155 </svg> 220 </svg>
156 </span> 221 </span>
157 <span class="checkbox__text"> 222 <span class="checkbox__text">
158 <span> 223 <span>
159 Опыт работы 224 Опыт работы
160 </span> 225 </span>
161 </span> 226 </span>
162 </label> 227 </label>
163 </form> 228 </form>
164 </div> 229 </div>
165 </section> 230 </section>
166 <main class="main"> 231 <main class="main">
167 <div class="container"> 232 <div class="container">
168 <div class="main__resume-base"> 233 <div class="main__resume-base">
169 <h2>Резюме работников</h2> 234 <h2>Резюме работников</h2>
170 <div class="filters"> 235 <div class="filters">
171 <div class="filters__label">Показано @if ($res_count > 0) 1 @else 0 @endif – @if($res_count < 5) {{ $res_count }} @else 5 @endif из {{ $res_count }} результатов поиска</div> 236 <div class="filters__label">Показано @if ($res_count > 0) 1 @else 0 @endif – @if($res_count < 5) {{ $res_count }} @else 5 @endif из {{ $res_count }} результатов поиска</div>
172 <div class="filters__body"> 237 <div class="filters__body">
173 <div class="select filters__select"> 238 <div class="select filters__select">
174 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 239 <select class="js-select2" id="sort_ajax" name="sort_ajax">
175 <option value="default">Сортировка (по умолчанию)</option> 240 <option value="default">Сортировка (по умолчанию)</option>
176 <option value="name (asc)">По имени (возрастание)</option> 241 <option value="name_up">По имени (возрастание)</option>
177 <option value="name (desc)">По имени (убывание)</option> 242 <option value="name_down">По имени (убывание)</option>
178 <option value="created_at (asc)">По дате (возрастание)</option> 243 <option value="created_at_up">По дате (возрастание)</option>
179 <option value="created_at (desc)">По дате (убывание)</option> 244 <option value="created_at_down">По дате (убывание)</option>
180 </select> 245 </select>
181 </div> 246 </div>
182 <button type="button" class="filters__item active" data-tab="1"> 247 <button type="button" class="filters__item active" data-tab="1">
183 <svg> 248 <svg>
184 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use> 249 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use>
185 </svg> 250 </svg>
186 </button> 251 </button>
187 <button type="button" class="filters__item" data-tab="2"> 252 <button type="button" class="filters__item" data-tab="2">
188 <svg> 253 <svg>
189 <use xlink:href="{{ asset('images/sprite.svg#grid-2') }}"></use> 254 <use xlink:href="{{ asset('images/sprite.svg#grid-2') }}"></use>
190 </svg> 255 </svg>
191 </button> 256 </button>
192 </div> 257 </div>
193 </div> 258 </div>
194 <div class="main__resume-base-body showed" data-body="1"> 259 <div class="main__resume-base-body showed" data-body="1">
195 <div class="main__resume-base-body-one"> 260 <div class="main__resume-base-body-one" id="block1" name="block1">
196 @if ($resumes->count()) 261 @if ($resumes->count())
197 @foreach ($resumes as $res) 262 @foreach ($resumes as $res)
198 <div class="main__resume-base-body-item"> 263 <div class="main__resume-base-body-item">
199 <div class="main__resume-base-body-item-buttons"> 264 <div class="main__resume-base-body-item-buttons">
200 <button type="button" class="like js-toggle js_box_favorites <?=\App\Classes\RusDate::selected_item($res->id);?>" data-val="{{ $res->id }}"> 265 <button type="button" class="like js-toggle js_box_favorites <?=\App\Classes\RusDate::selected_item($res->id);?>" data-val="{{ $res->id }}">
201 <svg> 266 <svg>
202 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 267 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
203 </svg> 268 </svg>
204 </button> 269 </button>
205 <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $res->id }}" data-options='{"touch":false,"autoFocus":false}'> 270 <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $res->id }}" data-options='{"touch":false,"autoFocus":false}'>
206 <svg> 271 <svg>
207 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> 272 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
208 </svg> 273 </svg>
209 </button> 274 </button>
210 </div> 275 </div>
211 <div class="main__resume-base-body-item-wrapper"> 276 <div class="main__resume-base-body-item-wrapper">
212 <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo"> 277 <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo">
213 <div class="main__resume-base-body-item-inner"> 278 <div class="main__resume-base-body-item-inner">
214 <div> 279 <div>
215 <b>Статус</b> 280 <b>Статус</b>
216 <span>{{ $status_work[$res->status_work] }}</span> 281 <span>{{ $status_work[$res->status_work] }}</span>
217 </div> 282 </div>
218 <div> 283 <div>
219 <b>Имя работника</b> 284 <b>Имя работника</b>
220 <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> 285 <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span>
221 </div> 286 </div>
222 <div> 287 <div>
223 <b>Номер телефона</b> 288 <b>Номер телефона</b>
224 <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span> 289 <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span>
225 </div> 290 </div>
226 <div> 291 <div>
227 <b>Электронный адрес</b> 292 <b>Электронный адрес</b>
228 <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> 293 <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span>
229 </div> 294 </div>
230 <div> 295 <div>
231 <b>Город проживания</b> 296 <b>Город проживания</b>
232 <span>{{ $res->city }}</span> 297 <span>{{ $res->city }}</span>
233 </div> 298 </div>
234 <div> 299 <div>
235 <b>Опыт работы</b> 300 <b>Опыт работы</b>
236 <span>{{ $res->experience }}</span> 301 <span>{{ $res->experience }}</span>
237 </div> 302 </div>
238 </div> 303 </div>
239 </div> 304 </div>
240 <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в резюме</a> 305 <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в резюме</a>
241 </div> 306 </div>
242 @endforeach 307 @endforeach
243 308
244 {{ $resumes->appends($_GET)->links('paginate') }} 309 {{ $resumes->appends($_GET)->links('paginate') }}
245 @endif 310 @endif
246 </div> 311 </div>
247 </div> 312 </div>
313 <div class="main__resume-base-body" data-body="2">
314 <div class="main__resume-base-body-two" id="block2" name="block2">
315 @if ($resumes->count())
316 @foreach ($resumes as $res)
317 <div class="main__resume-base-body-item">
318 <div class="main__resume-base-body-item-buttons">
319 <button type="button" class="like js-toggle js_box_favorites <?=\App\Classes\RusDate::selected_item($res->id);?>" data-val="{{ $res->id }}">
320 <svg>
321 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
322 </svg>
323 </button>
324 <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ $idiot}}" data-tuid="{{ $res->id }}" data-options='{"touch":false,"autoFocus":false}'>
325 <svg>
326 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
327 </svg>
328 </button>
329 </div>
330 <div class="main__resume-base-body-item-wrapper">
331 <img src="@isset ($res->photo) {{ asset(Storage::url($res->photo)) }} @else {{ asset('images/default_man.jpg')}} @endif" alt="" class="main__resume-base-body-item-photo">
332 <div class="main__resume-base-body-item-inner">
333 <div>
334 <b>Статус</b>
335 <span>{{ $status_work[$res->status_work] }}</span>
336 </div>
337 <div>
338 <b>Имя работника</b>
339 <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span>
340 </div>
341 <div>
342 <b>Номер телефона</b>
343 <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span>
344 </div>
345 <div>
346 <b>Электронный адрес</b>
347 <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span>
348 </div>
349 <div>
350 <b>Город проживания</b>
351 <span>{{ $res->city }}</span>
352 </div>
353 <div>
354 <b>Опыт работы</b>
355 <span>{{ $res->experience }}</span>
356 </div>
357 </div>
358 </div>
359 <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в
360 резюме</a>
361 </div>
362 @endforeach
248 363
364 {{ $resumes->appends($_GET)->links('paginate') }}
365 @endif
366 </div>
367 </div>
249 </div> 368 </div>
250 </div> 369 </div>
251 </main> 370 </main>
252 </div> 371 </div>
253 </div> 372 </div>
254 @endsection 373 @endsection
255 374