Commit ac606bc382b783237712bdcd3ac407a9c6caf2c6

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

Работа на сервере.

Showing 17 changed files with 326 additions and 135 deletions Inline Diff

app/Classes/Cookies_vacancy.php
1 <?php 1 <?php
2 2
3 3
4 namespace App\Classes; 4 namespace App\Classes;
5 5
6 6
7 use DateTime; 7 use DateTime;
8 8
9 class Cookies_vacancy 9 class Cookies_vacancy
10 { 10 {
11 public static function selected_vacancy($item) { 11 public static function selected_vacancy($item) {
12 if (empty($_COOKIE['favorite_vacancy'])) 12 if (empty($_COOKIE['favorit_vacancy']))
13 return ""; 13 return "";
14 else { 14 else {
15 $Str = json_decode($_COOKIE['favorite_vacancy'], true); 15 $Str = json_decode($_COOKIE['favorit_vacancy'], true);
16 //$Arr = explode(",", $Str); 16 //$Arr = explode(",", $Str);
17 if (in_array($item, $Str)) 17 if (in_array($item, $Str))
18 return " active "; 18 return " active ";
19 else 19 else
20 return ""; 20 return "";
21 } 21 }
22 } 22 }
23 23
24 // Вывод избранных вакансий 24 // Вывод избранных вакансий
25 public static function count_vacancy_fav() { 25 public static function count_vacancy_fav() {
26 if (empty($_COOKIE['favorite_vacancy'])) 26 if (empty($_COOKIE['favorit_vacancy']))
27 return 0; 27 return 0;
28 else { 28 else {
29 29
30 $Arr = json_decode($_COOKIE['favorite_vacancy'], true); 30 $Arr = json_decode($_COOKIE['favorit_vacancy'], true);
31 31
32 32
33 return count($Arr); 33 return count($Arr);
34 } 34 }
35 } 35 }
36 36
37 // Удаление избранных вакансий 37 // Удаление избранных вакансий
38 public static function clear_vacancy() { 38 public static function clear_vacancy() {
39 if (!empty($_COOKIE['favorite_vacancy'])) 39 if (!empty($_COOKIE['favorit_vacancy']))
40 unset($_COOKIE['favorite_vacancy']); 40 unset($_COOKIE['favorit_vacancy']);
41 } 41 }
42 42
43 } 43 }
44 44
app/Classes/RusDate.php
1 <?php 1 <?php
2 2
3 3
4 namespace App\Classes; 4 namespace App\Classes;
5 5
6 6
7 use DateTime; 7 use DateTime;
8 8
9 class RusDate 9 class RusDate
10 { // Русские даты 10 { // Русские даты
11 public static function russian_date($date = null){ 11 public static function russian_date($date = null){
12 $date=explode(".", date("d.m.Y")); 12 $date=explode(".", date("d.m.Y"));
13 $m = ""; 13 $m = "";
14 14
15 switch ($date[1]){ 15 switch ($date[1]){
16 case 1: $m = 'января'; break; 16 case 1: $m = 'января'; break;
17 case 2: $m = 'февраля'; break; 17 case 2: $m = 'февраля'; break;
18 case 3: $m = 'марта'; break; 18 case 3: $m = 'марта'; break;
19 case 4: $m = 'апреля'; break; 19 case 4: $m = 'апреля'; break;
20 case 5: $m = 'мая'; break; 20 case 5: $m = 'мая'; break;
21 case 6: $m = 'июня'; break; 21 case 6: $m = 'июня'; break;
22 case 7: $m = 'июля'; break; 22 case 7: $m = 'июля'; break;
23 case 8: $m = 'августа'; break; 23 case 8: $m = 'августа'; break;
24 case 9: $m = 'сентября'; break; 24 case 9: $m = 'сентября'; break;
25 case 10: $m = 'октября'; break; 25 case 10: $m = 'октября'; break;
26 case 11: $m = 'ноября'; break; 26 case 11: $m = 'ноября'; break;
27 case 12: $m = 'декабря'; break; 27 case 12: $m = 'декабря'; break;
28 } 28 }
29 return $date[0].' '.$m.' '.$date[2]; 29 return $date[0].' '.$m.' '.$date[2];
30 } 30 }
31 // Русские названия 31 // Русские названия
32 public static function russian_month($month) { 32 public static function russian_month($month) {
33 switch ($month){ 33 switch ($month){
34 case 1: $m = 'января'; break; 34 case 1: $m = 'января'; break;
35 case 2: $m = 'февраля'; break; 35 case 2: $m = 'февраля'; break;
36 case 3: $m = 'марта'; break; 36 case 3: $m = 'марта'; break;
37 case 4: $m = 'апреля'; break; 37 case 4: $m = 'апреля'; break;
38 case 5: $m = 'мая'; break; 38 case 5: $m = 'мая'; break;
39 case 6: $m = 'июня'; break; 39 case 6: $m = 'июня'; break;
40 case 7: $m = 'июля'; break; 40 case 7: $m = 'июля'; break;
41 case 8: $m = 'августа'; break; 41 case 8: $m = 'августа'; break;
42 case 9: $m = 'сентября'; break; 42 case 9: $m = 'сентября'; break;
43 case 10: $m = 'октября'; break; 43 case 10: $m = 'октября'; break;
44 case 11: $m = 'ноября'; break; 44 case 11: $m = 'ноября'; break;
45 case 12: $m = 'декабря'; break; 45 case 12: $m = 'декабря'; break;
46 } 46 }
47 return $m; 47 return $m;
48 } 48 }
49 // Избранные работники 49 // Избранные работники
50 public static function selected_item($item) { 50 public static function selected_item($item) {
51 if (empty($_COOKIE['favorite_worker'])) 51 if (empty($_COOKIE['favorite_worker']))
52 return ""; 52 return "";
53 else { 53 else {
54 $Str = json_decode($_COOKIE['favorite_worker'], true); 54 $Str = json_decode($_COOKIE['favorite_worker'], true);
55 //$Arr = explode(",", $Str); 55 //$Arr = explode(",", $Str);
56 if (in_array($item, $Str)) 56 if (in_array($item, $Str))
57 return " active "; 57 return " active ";
58 else 58 else
59 return ""; 59 return "";
60 } 60 }
61 } 61 }
62 // Избранные вакансии 62 // Избранные вакансии
63 public static function selected_vacancy($item) { 63 public static function selected_vacancy($item) {
64 if (empty($_COOKIE['favorite_vac'])) 64 if (empty($_COOKIE['favorit_vacancy']))
65 return ""; 65 return "";
66 else { 66 else {
67 $Str = json_decode($_COOKIE['favorite_vac'], true); 67 $Str = json_decode($_COOKIE['favorit_vacancy'], true);
68 //$Arr = explode(",", $Str); 68 //$Arr = explode(",", $Str);
69 if (in_array($item, $Str)) 69 if (in_array($item, $Str))
70 return " active "; 70 return " active ";
71 else 71 else
72 return ""; 72 return "";
73 } 73 }
74 } 74 }
75 75
76 // Вывод избранных работников 76 // Вывод избранных работников
77 public static function count_item_fav() { 77 public static function count_item_fav() {
78 if (empty($_COOKIE['favorite_worker'])) 78 if (empty($_COOKIE['favorite_worker']))
79 return 0; 79 return 0;
80 else { 80 else {
81 81
82 $Arr = json_decode($_COOKIE['favorite_worker'], true); 82 $Arr = json_decode($_COOKIE['favorite_worker'], true);
83 83
84 return count($Arr); 84 return count($Arr);
85 } 85 }
86 } 86 }
87 87
88 // Удаление избранных работников 88 // Удаление избранных работников
89 public static function clear_items() { 89 public static function clear_items() {
90 if (!empty($_COOKIE['favorite_worker'])) 90 if (!empty($_COOKIE['favorite_worker']))
91 unset($_COOKIE['favorite_worker']); 91 unset($_COOKIE['favorite_worker']);
92 } 92 }
93 93
94 public static function interval_month($date) { 94 public static function interval_month($date) {
95 $now = new DateTime(); 95 $now = new DateTime();
96 $date = new DateTime($date); //::createFromFormat("Y-m-d H:i", $date); 96 $date = new DateTime($date); //::createFromFormat("Y-m-d H:i", $date);
97 $interval = $now->diff($date); 97 $interval = $now->diff($date);
98 $y = $interval->y; 98 $y = $interval->y;
99 $d = $interval->d; 99 $d = $interval->d;
100 $h = $interval->h; 100 $h = $interval->h;
101 $i = $interval->i; 101 $i = $interval->i;
102 102
103 if ($d > 30) 103 if ($d > 30)
104 return true; 104 return true;
105 else 105 else
106 return false; 106 return false;
107 } 107 }
108 108
109 public static function interval_day($date) { 109 public static function interval_day($date) {
110 $now = new DateTime(); 110 $now = new DateTime();
111 $date = new DateTime($date); //::createFromFormat("Y-m-d H:i", $date); 111 $date = new DateTime($date); //::createFromFormat("Y-m-d H:i", $date);
112 $interval = $now->diff($date); 112 $interval = $now->diff($date);
113 $y = $interval->y; 113 $y = $interval->y;
114 $d = $interval->d; 114 $d = $interval->d;
115 $h = $interval->h; 115 $h = $interval->h;
116 $i = $interval->i; 116 $i = $interval->i;
117 117
118 if (($h > 24) || ($d > 0) || ($y > 0)) 118 if (($h > 24) || ($d > 0) || ($y > 0))
119 return true; 119 return true;
120 else 120 else
121 return false; 121 return false;
122 } 122 }
123 123
124 public static function ip_addr_client() { 124 public static function ip_addr_client() {
125 $client = @$_SERVER['HTTP_CLIENT_IP']; 125 $client = @$_SERVER['HTTP_CLIENT_IP'];
126 $forward = @$_SERVER['HTTP_X_FORWARDED_FOR']; 126 $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
127 $remote = @$_SERVER['REMOTE_ADDR']; 127 $remote = @$_SERVER['REMOTE_ADDR'];
128 128
129 if(filter_var($client, FILTER_VALIDATE_IP)) $ip = $client; 129 if(filter_var($client, FILTER_VALIDATE_IP)) $ip = $client;
130 elseif(filter_var($forward, FILTER_VALIDATE_IP)) $ip = $forward; 130 elseif(filter_var($forward, FILTER_VALIDATE_IP)) $ip = $forward;
131 else $ip = $remote; 131 else $ip = $remote;
132 132
133 return $ip; 133 return $ip;
134 } 134 }
135 135
136 // Вывод избранных вакансий 136 // Вывод избранных вакансий
137 public static function count_vacancy_fav() { 137 public static function count_vacancy_fav() {
138 if (empty($_COOKIE['favorite_vac'])) 138 if (empty($_COOKIE['favorit_vacancy']))
139 return 0; 139 return 0;
140 else { 140 else {
141 141
142 $Arr = json_decode($_COOKIE['favorite_vac'], true); 142 $Arr = json_decode($_COOKIE['favorit_vacancy'], true);
143 143
144 144
145 return count($Arr); 145 return count($Arr);
146 } 146 }
147 } 147 }
148 148
149 // Удаление избранных вакансий 149 // Удаление избранных вакансий
150 public static function clear_vacancy() { 150 public static function clear_vacancy() {
151 if (!empty($_COOKIE['favorite_vac'])) 151 if (!empty($_COOKIE['favorit_vacancy']))
152 unset($_COOKIE['favorite_vac']); 152 unset($_COOKIE['favorit_vacancy']);
153 } 153 }
154 154
155 } 155 }
156 156
app/Http/Controllers/EmployerController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Classes\RusDate; 5 use App\Classes\RusDate;
6 use App\Classes\Tools; 6 use App\Classes\Tools;
7 use App\Http\Requests\FlotRequest; 7 use App\Http\Requests\FlotRequest;
8 use App\Http\Requests\MessagesRequiest; 8 use App\Http\Requests\MessagesRequiest;
9 use App\Http\Requests\VacancyRequestEdit; 9 use App\Http\Requests\VacancyRequestEdit;
10 use App\Http\Requests\VacansiaRequiest; 10 use App\Http\Requests\VacansiaRequiest;
11 use App\Mail\MailSotrudnichestvo; 11 use App\Mail\MailSotrudnichestvo;
12 use App\Mail\SendAllMessages; 12 use App\Mail\SendAllMessages;
13 use App\Models\Ad_employer; 13 use App\Models\Ad_employer;
14 use App\Models\Ad_jobs; 14 use App\Models\Ad_jobs;
15 use App\Models\ad_response; 15 use App\Models\ad_response;
16 use App\Models\Category; 16 use App\Models\Category;
17 use App\Models\Education; 17 use App\Models\Education;
18 use App\Models\Employer; 18 use App\Models\Employer;
19 use App\Models\employers_main; 19 use App\Models\employers_main;
20 use App\Models\Flot; 20 use App\Models\Flot;
21 use App\Models\Job_title; 21 use App\Models\Job_title;
22 use App\Models\Message; 22 use App\Models\Message;
23 use App\Models\Worker; 23 use App\Models\Worker;
24 use Carbon\Carbon; 24 use Carbon\Carbon;
25 use Illuminate\Auth\Events\Registered; 25 use Illuminate\Auth\Events\Registered;
26 use Illuminate\Database\Eloquent\Builder; 26 use Illuminate\Database\Eloquent\Builder;
27 use Illuminate\Database\Eloquent\Model; 27 use Illuminate\Database\Eloquent\Model;
28 use Illuminate\Foundation\Auth\User; 28 use Illuminate\Foundation\Auth\User;
29 use Illuminate\Http\Request; 29 use Illuminate\Http\Request;
30 use Illuminate\Support\Facades\Auth; 30 use Illuminate\Support\Facades\Auth;
31 use Illuminate\Support\Facades\Hash; 31 use Illuminate\Support\Facades\Hash;
32 use Illuminate\Support\Facades\Mail; 32 use Illuminate\Support\Facades\Mail;
33 use Illuminate\Support\Facades\Storage; 33 use Illuminate\Support\Facades\Storage;
34 use App\Models\User as User_Model; 34 use App\Models\User as User_Model;
35 use Illuminate\Support\Facades\Validator; 35 use Illuminate\Support\Facades\Validator;
36 36
37 class EmployerController extends Controller 37 class EmployerController extends Controller
38 { 38 {
39 public function vacancie($vacancy, Request $request) { 39 public function vacancie($vacancy, Request $request) {
40 $title = 'Заголовок вакансии'; 40 $title = 'Заголовок вакансии';
41
42 $Query = Ad_employer::with('jobs')-> 41 $Query = Ad_employer::with('jobs')->
43 with('cat')-> 42 with('cat')->
44 with('employer')-> 43 with('employer')->
45 with('jobs_code')-> 44 with('jobs_code')->
46 select('ad_employers.*')-> 45 select('ad_employers.*')->
47 where('id', '=', $vacancy)->get(); 46 where('id', '=', $vacancy)->get();
48 47
48 if (isset(Auth()->user()->id))
49 $uid = Auth()->user()->id;
50 else
51 $uid = 0;
49 $title = $Query[0]->name; 52 $title = $Query[0]->name;
50
51 if ($request->ajax()) { 53 if ($request->ajax()) {
52 return view('ajax.vacance-item', compact('Query')); 54 return view('ajax.vacance-item', compact('Query','uid'));
53 } else { 55 } else {
54 return view('vacance-item', compact('title', 'Query')); 56 return view('vacance-item', compact('title', 'Query', 'uid'));
55 } 57 }
56 } 58 }
57 59
58 public function logout() { 60 public function logout() {
59 Auth::logout(); 61 Auth::logout();
60 return redirect()->route('index') 62 return redirect()->route('index')
61 ->with('success', 'Вы вышли из личного кабинета'); 63 ->with('success', 'Вы вышли из личного кабинета');
62 } 64 }
63 65
64 public function cabinet() { 66 public function cabinet() {
65 $id = Auth()->user()->id; 67 $id = Auth()->user()->id;
66 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 68 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
67 WhereHas('users', 69 WhereHas('users',
68 function (Builder $query) use ($id) {$query->Where('id', $id); 70 function (Builder $query) use ($id) {$query->Where('id', $id);
69 })->get(); 71 })->get();
70 return view('employers.cabinet45', compact('Employer')); 72 return view('employers.cabinet45', compact('Employer'));
71 } 73 }
72 74
73 public function cabinet_save(Employer $Employer, Request $request) { 75 public function cabinet_save(Employer $Employer, Request $request) {
74 $params = $request->all(); 76 $params = $request->all();
75 $params['user_id'] = Auth()->user()->id; 77 $params['user_id'] = Auth()->user()->id;
76 $id = $Employer->id; 78 $id = $Employer->id;
77 79
78 if ($request->has('logo')) { 80 if ($request->has('logo')) {
79 if (!empty($Employer->logo)) { 81 if (!empty($Employer->logo)) {
80 Storage::delete($Employer->logo); 82 Storage::delete($Employer->logo);
81 } 83 }
82 $params['logo'] = $request->file('logo')->store("employer/$id", 'public'); 84 $params['logo'] = $request->file('logo')->store("employer/$id", 'public');
83 } 85 }
84 86
85 $Employer->update($params); 87 $Employer->update($params);
86 88
87 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены'); 89 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены');
88 } 90 }
89 91
90 public function save_add_flot(FlotRequest $request) { 92 public function save_add_flot(FlotRequest $request) {
91 // отмена 93 // отмена
92 $params = $request->all(); 94 $params = $request->all();
93 95
94 if ($request->has('image')) { 96 if ($request->has('image')) {
95 $params['image'] = $request->file('image')->store("flot", 'public'); 97 $params['image'] = $request->file('image')->store("flot", 'public');
96 } 98 }
97 Flot::create($params); 99 Flot::create($params);
98 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get(); 100 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get();
99 return redirect()->route('employer.cabinet')->with('success', 'Новый корабль был добавлен'); 101 return redirect()->route('employer.cabinet')->with('success', 'Новый корабль был добавлен');
100 } 102 }
101 103
102 public function delete_flot(Flot $Flot) { 104 public function delete_flot(Flot $Flot) {
103 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get(); 105 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get();
104 106
105 if (isset($Flot->id)) $Flot->delete(); 107 if (isset($Flot->id)) $Flot->delete();
106 return redirect()->route('employer.cabinet')->with('success', 'Корабль был удален'); 108 return redirect()->route('employer.cabinet')->with('success', 'Корабль был удален');
107 } 109 }
108 110
109 // Форма добавления вакансий 111 // Форма добавления вакансий
110 public function cabinet_vacancie() { 112 public function cabinet_vacancie() {
111 $id = Auth()->user()->id; 113 $id = Auth()->user()->id;
112 $jobs = Job_title::query()->OrderBy('name')->get(); 114 $jobs = Job_title::query()->OrderBy('name')->get();
113 $categories = Category::query()->get(); 115 $categories = Category::query()->get();
114 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 116 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
115 WhereHas('users', 117 WhereHas('users',
116 function (Builder $query) use ($id) {$query->Where('id', $id); 118 function (Builder $query) use ($id) {$query->Where('id', $id);
117 })->get(); 119 })->get();
118 120
119 return view('employers.add_vacancy', compact('Employer', 'jobs' , 'categories')); 121 return view('employers.add_vacancy', compact('Employer', 'jobs' , 'categories'));
120 } 122 }
121 123
122 // Сохранение вакансии 124 // Сохранение вакансии
123 public function cabinet_vacancy_save1(VacancyRequestEdit $request) { 125 public function cabinet_vacancy_save1(VacancyRequestEdit $request) {
124 $params = $request->all(); 126 $params = $request->all();
125 $jobs['min_salary'] = $params['min_salary']; 127 $jobs['min_salary'] = $params['min_salary'];
126 $jobs['max_salary'] = $params['max_salary']; 128 $jobs['max_salary'] = $params['max_salary'];
127 $jobs['flot'] = $params['flot']; 129 $jobs['flot'] = $params['flot'];
128 $jobs['power'] = $params['power']; 130 $jobs['power'] = $params['power'];
129 $jobs['sytki'] = $params['sytki']; 131 $jobs['sytki'] = $params['sytki'];
130 $jobs['start'] = $params['start']; 132 $jobs['start'] = $params['start'];
131 $jobs['job_title_id'] = $params['job_title_id']; 133 $jobs['job_title_id'] = $params['job_title_id'];
132 $jobs['description'] = $params['description']; 134 $jobs['description'] = $params['description'];
133 $jobs['region'] = $params['city']; 135 $jobs['region'] = $params['city'];
134 $jobs['position_ship'] = $params['position_ship']; 136 $jobs['position_ship'] = $params['position_ship'];
135 unset($params['min_salary']); 137 unset($params['min_salary']);
136 unset($params['max_salary']); 138 unset($params['max_salary']);
137 unset($params['flot']); 139 unset($params['flot']);
138 unset($params['sytki']); 140 unset($params['sytki']);
139 unset($params['start']); 141 unset($params['start']);
140 unset($params['job_title_id']); 142 unset($params['job_title_id']);
141 unset($params['description']); 143 unset($params['description']);
142 144
143 $id = Ad_employer::create($params)->id; 145 $id = Ad_employer::create($params)->id;
144 $jobs['ad_employer_id'] = $id; 146 $jobs['ad_employer_id'] = $id;
145 Ad_jobs::create($jobs); 147 Ad_jobs::create($jobs);
146 return redirect()->route('employer.vacancy_list'); 148 return redirect()->route('employer.vacancy_list');
147 } 149 }
148 150
149 // Список вакансий 151 // Список вакансий
150 public function vacancy_list(Request $request) { 152 public function vacancy_list(Request $request) {
151 $id = Auth()->user()->id; 153 $id = Auth()->user()->id;
152 $Employer = Employer::query()->where('user_id', $id)->first(); 154 $Employer = Employer::query()->where('user_id', $id)->first();
153 $vacancy_list = Ad_employer::query()->where('employer_id', $Employer->id); 155 $vacancy_list = Ad_employer::query()->where('employer_id', $Employer->id);
154 156
155 if ($request->get('sort')) { 157 if ($request->get('sort')) {
156 $sort = $request->get('sort'); 158 $sort = $request->get('sort');
157 switch ($sort) { 159 switch ($sort) {
158 case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break; 160 case 'name_up': $vacancy_list = $vacancy_list->orderBy('name')->orderBy('id'); break;
159 case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break; 161 case 'name_down': $vacancy_list = $vacancy_list->orderByDesc('name')->orderby('id'); break;
160 case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break; 162 case 'created_at_up': $vacancy_list = $vacancy_list->OrderBy('created_at')->orderBy('id'); break;
161 case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break; 163 case 'created_at_down': $vacancy_list = $vacancy_list->orderByDesc('created_at')->orderBy('id'); break;
162 case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; 164 case 'default': $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break;
163 default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break; 165 default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break;
164 } 166 }
165 } 167 }
166 $vacancy_list = $vacancy_list->get(); 168 $vacancy_list = $vacancy_list->get();
167 169
168 //ajax 170 //ajax
169 if ($request->ajax()) { 171 if ($request->ajax()) {
170 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); 172 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer'));
171 } else { 173 } else {
172 return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); 174 return view('employers.list_vacancy', compact('vacancy_list', 'Employer'));
173 } 175 }
174 } 176 }
175 177
176 // Карточка вакансии 178 // Карточка вакансии
177 public function vacancy_edit(Ad_employer $ad_employer) { 179 public function vacancy_edit(Ad_employer $ad_employer) {
178 $id = Auth()->user()->id; 180 $id = Auth()->user()->id;
179 $jobs = Job_title::query()->OrderBy('name')->get(); 181 $jobs = Job_title::query()->OrderBy('name')->get();
180 $categories = Category::query()->get(); 182 $categories = Category::query()->get();
181 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 183 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
182 where('user_id', $id)->first(); 184 where('user_id', $id)->first();
183 185
184 return view('employers.edit_vacancy', compact('ad_employer', 'categories','Employer', 'jobs')); 186 return view('employers.edit_vacancy', compact('ad_employer', 'categories','Employer', 'jobs'));
185 } 187 }
186 188
187 // Сохранение-редактирование записи 189 // Сохранение-редактирование записи
188 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { 190 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) {
189 $all = $request->all(); 191 $all = $request->all();
190 192
191 $ad_employer->update($all); 193 $ad_employer->update($all);
192 194
193 return redirect()->route('employer.vacancy_list'); 195 return redirect()->route('employer.vacancy_list');
194 } 196 }
195 197
196 // Сохранение карточки вакансии 198 // Сохранение карточки вакансии
197 public function vacancy_save(Request $request, Ad_employer $ad_employer) { 199 public function vacancy_save(Request $request, Ad_employer $ad_employer) {
198 $all = $request->all(); 200 $all = $request->all();
199 $ad_employer->update($all); 201 $ad_employer->update($all);
200 return redirect()->route('employer.cabinet_vacancie'); 202 return redirect()->route('employer.cabinet_vacancie');
201 } 203 }
202 204
203 // Удаление карточки вакансии 205 // Удаление карточки вакансии
204 public function vacancy_delete(Ad_employer $ad_employer) { 206 public function vacancy_delete(Ad_employer $ad_employer) {
205 $ad_employer->delete(); 207 $ad_employer->delete();
206 208
207 return redirect()->route('employer.vacancy_list') 209 return redirect()->route('employer.vacancy_list')
208 ->with('success', 'Данные были успешно сохранены'); 210 ->with('success', 'Данные были успешно сохранены');
209 } 211 }
210 212
211 // Обновление даты 213 // Обновление даты
212 public function vacancy_up(Ad_employer $ad_employer) { 214 public function vacancy_up(Ad_employer $ad_employer) {
213 $up = date('m/d/Y h:i:s', time());; 215 $up = date('m/d/Y h:i:s', time());;
214 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 216 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
215 $vac_emp->updated_at = $up; 217 $vac_emp->updated_at = $up;
216 $vac_emp->save(); 218 $vac_emp->save();
217 219
218 return redirect()->route('employer.vacancy_list'); 220 return redirect()->route('employer.vacancy_list');
219 // начало конца 221 // начало конца
220 } 222 }
221 223
222 //Видимость вакансии 224 //Видимость вакансии
223 public function vacancy_eye(Ad_employer $ad_employer, $status) { 225 public function vacancy_eye(Ad_employer $ad_employer, $status) {
224 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 226 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
225 $vac_emp->active_is = $status; 227 $vac_emp->active_is = $status;
226 $vac_emp->save(); 228 $vac_emp->save();
227 229
228 return redirect()->route('employer.vacancy_list'); 230 return redirect()->route('employer.vacancy_list');
229 } 231 }
230 232
231 //Вакансия редактирования (шаблон) 233 //Вакансия редактирования (шаблон)
232 public function vacancy_update(Ad_employer $id) { 234 public function vacancy_update(Ad_employer $id) {
233 235
234 } 236 }
235 237
236 //Отклики на вакансию - лист 238 //Отклики на вакансию - лист
237 public function answers(Employer $employer, Request $request) { 239 public function answers(Employer $employer, Request $request) {
238 $user_id = Auth()->user()->id; 240 $user_id = Auth()->user()->id;
239 $answer = Ad_employer::query()->where('employer_id', $employer->id); 241 $answer = Ad_employer::query()->where('employer_id', $employer->id);
240 if ($request->has('search')) { 242 if ($request->has('search')) {
241 $search = trim($request->get('search')); 243 $search = trim($request->get('search'));
242 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); 244 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%");
243 } 245 }
244 246
245 $answer = $answer->with('response')->get(); 247 $answer = $answer->with('response')->get();
246 248
247 return view('employers.list_answer', compact('answer', 'user_id', 'employer')); 249 return view('employers.list_answer', compact('answer', 'user_id', 'employer'));
248 } 250 }
249 251
250 //Обновление статуса 252 //Обновление статуса
251 public function supple_status(employer $employer, ad_response $ad_response, $flag) { 253 public function supple_status(employer $employer, ad_response $ad_response, $flag) {
252 $ad_response->update(Array('flag' => $flag)); 254 $ad_response->update(Array('flag' => $flag));
253 return redirect()->route('employer.answers', ['employer' => $employer->id]); 255 return redirect()->route('employer.answers', ['employer' => $employer->id]);
254 } 256 }
255 257
256 //Страницы сообщений список 258 //Страницы сообщений список
257 public function messages($type_message) { 259 public function messages($type_message) {
258 $user_id = Auth()->user()->id; 260 $user_id = Auth()->user()->id;
259 261
260 $messages_input = Message::query()->with('vacancies')->with('user_from')-> 262 $messages_input = Message::query()->with('vacancies')->with('user_from')->
261 Where('to_user_id', $user_id)->OrderByDesc('created_at'); 263 Where('to_user_id', $user_id)->OrderByDesc('created_at');
262 264
263 $messages_output = Message::query()->with('vacancies')-> 265 $messages_output = Message::query()->with('vacancies')->
264 with('user_to')->where('user_id', $user_id)-> 266 with('user_to')->where('user_id', $user_id)->
265 OrderByDesc('created_at'); 267 OrderByDesc('created_at');
266 268
267 269
268 $count_input = $messages_input->count(); 270 $count_input = $messages_input->count();
269 $count_output = $messages_output->count(); 271 $count_output = $messages_output->count();
270 272
271 if ($type_message == 'input') { 273 if ($type_message == 'input') {
272 $messages = $messages_input->paginate(15); 274 $messages = $messages_input->paginate(15);
273 } 275 }
274 276
275 if ($type_message == 'output') { 277 if ($type_message == 'output') {
276 $messages = $messages_output->paginate(15); 278 $messages = $messages_output->paginate(15);
277 } 279 }
278 280
279 return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); 281 return view('employers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id'));
280 } 282 }
281 283
282 // Диалог между пользователями 284 // Диалог между пользователями
283 public function dialog(User_Model $user1, User_Model $user2) { 285 public function dialog(User_Model $user1, User_Model $user2) {
284 if (isset($user2->id)) { 286 if (isset($user2->id)) {
285 $companion = User_Model::query()->with('workers')-> 287 $companion = User_Model::query()->with('workers')->
286 with('employers')-> 288 with('employers')->
287 where('id', $user2->id)->first(); 289 where('id', $user2->id)->first();
288 } 290 }
289 291
290 $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) { 292 $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) {
291 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); 293 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id);
292 })->orWhere(function($query) use ($user1, $user2) { 294 })->orWhere(function($query) use ($user1, $user2) {
293 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); 295 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id);
294 })->OrderBy('created_at')->get(); 296 })->OrderBy('created_at')->get();
295 297
296 $id_vac = null; 298 $id_vac = null;
297 foreach ($Messages as $it) { 299 foreach ($Messages as $it) {
298 if (isset($it->response)) { 300 if (isset($it->response)) {
299 foreach ($it->response as $r) { 301 foreach ($it->response as $r) {
300 if (isset($r->ad_employer_id)) { 302 if (isset($r->ad_employer_id)) {
301 $id_vac = $r->ad_employer_id; 303 $id_vac = $r->ad_employer_id;
302 break; 304 break;
303 } 305 }
304 } 306 }
305 } 307 }
306 if (!is_null($id_vac)) break; 308 if (!is_null($id_vac)) break;
307 } 309 }
308 310
309 $ad_employer = null; 311 $ad_employer = null;
310 if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); 312 if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first();
311 $sender = $user1; 313 $sender = $user1;
312 314
313 return view('employers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); 315 return view('employers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer'));
314 } 316 }
315 317
316 // Регистрация работодателя 318 // Регистрация работодателя
317 public function register_employer(Request $request) { 319 public function register_employer(Request $request) {
318 $params = $request->all(); 320 $params = $request->all();
319 321
320 $rules = [ 322 $rules = [
321 'surname' => ['required', 'string', 'max:255'], 323 'surname' => ['required', 'string', 'max:255'],
322 'name_man' => ['required', 'string', 'max:255'], 324 'name_man' => ['required', 'string', 'max:255'],
323 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 325 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
324 'name_company' => ['required', 'string', 'max:255'], 326 'name_company' => ['required', 'string', 'max:255'],
325 'password' => ['required', 'string', 'min:8'], 327 'password' => ['required', 'string', 'min:8'],
326 ]; 328 ];
327 329
328 330
329 $messages = [ 331 $messages = [
330 'required' => 'Укажите обязательное поле', 332 'required' => 'Укажите обязательное поле',
331 'min' => [ 333 'min' => [
332 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 334 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
333 'integer' => 'Поле «:attribute» должно быть :min или больше', 335 'integer' => 'Поле «:attribute» должно быть :min или больше',
334 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 336 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
335 ], 337 ],
336 'max' => [ 338 'max' => [
337 'string' => 'Поле «:attribute» должно быть не больше :max символов', 339 'string' => 'Поле «:attribute» должно быть не больше :max символов',
338 'integer' => 'Поле «:attribute» должно быть :max или меньше', 340 'integer' => 'Поле «:attribute» должно быть :max или меньше',
339 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 341 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
340 ] 342 ]
341 ]; 343 ];
342 344
343 if ($request->get('password') !== $request->get('confirmed')){ 345 if ($request->get('password') !== $request->get('confirmed')){
344 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 346 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
345 } 347 }
346 348
347 $validator = Validator::make($request->all(), $rules, $messages); 349 $validator = Validator::make($request->all(), $rules, $messages);
348 350
349 if ($validator->fails()) { 351 if ($validator->fails()) {
350 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 352 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
351 } else { 353 } else {
352 $user = $this->create($params); 354 $user = $this->create($params);
353 event(new Registered($user)); 355 event(new Registered($user));
354 356
355 Auth::guard()->login($user); 357 Auth::guard()->login($user);
356 } 358 }
357 if ($user) { 359 if ($user) {
358 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; 360 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));;
359 } else { 361 } else {
360 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 362 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
361 } 363 }
362 } 364 }
363 365
364 // Создание пользователя 366 // Создание пользователя
365 protected function create(array $data) 367 protected function create(array $data)
366 { 368 {
367 $Use = new User_Model(); 369 $Use = new User_Model();
368 $Code_user = $Use->create([ 370 $Code_user = $Use->create([
369 'name' => $data['surname']." ".$data['name_man'], 371 'name' => $data['surname']." ".$data['name_man'],
370 'name_man' => $data['name_man'], 372 'name_man' => $data['name_man'],
371 'surname' => $data['surname'], 373 'surname' => $data['surname'],
372 'surname2' => $data['surname2'], 374 'surname2' => $data['surname2'],
373 'subscribe_email' => $data['email'], 375 'subscribe_email' => $data['email'],
374 'email' => $data['email'], 376 'email' => $data['email'],
375 'telephone' => $data['telephone'], 377 'telephone' => $data['telephone'],
376 'is_worker' => 0, 378 'is_worker' => 0,
377 'password' => Hash::make($data['password']), 379 'password' => Hash::make($data['password']),
378 'pubpassword' => base64_encode($data['password']), 380 'pubpassword' => base64_encode($data['password']),
379 'email_verified_at' => Carbon::now() 381 'email_verified_at' => Carbon::now()
380 ]); 382 ]);
381 383
382 if ($Code_user->id > 0) { 384 if ($Code_user->id > 0) {
383 $Employer = new Employer(); 385 $Employer = new Employer();
384 $Employer->user_id = $Code_user->id; 386 $Employer->user_id = $Code_user->id;
385 $Employer->name_company = $data['name_company']; 387 $Employer->name_company = $data['name_company'];
386 $Employer->email = $data['email']; 388 $Employer->email = $data['email'];
387 $Employer->telephone = $data['telephone']; 389 $Employer->telephone = $data['telephone'];
388 $Employer->code = Tools::generator_id(10); 390 $Employer->code = Tools::generator_id(10);
389 $Employer->save(); 391 $Employer->save();
390 392
391 return $Code_user; 393 return $Code_user;
392 } 394 }
393 } 395 }
394 396
395 // Отправка сообщения от работодателя 397 // Отправка сообщения от работодателя
396 public function send_message(MessagesRequiest $request) { 398 public function send_message(MessagesRequiest $request) {
397 $params = $request->all(); 399 $params = $request->all();
398 dd($params); 400 dd($params);
399 $user1 = $params['user_id']; 401 $user1 = $params['user_id'];
400 $user2 = $params['to_user_id']; 402 $user2 = $params['to_user_id'];
401 403
402 if ($request->has('file')) { 404 if ($request->has('file')) {
403 $params['file'] = $request->file('file')->store("messages", 'public'); 405 $params['file'] = $request->file('file')->store("messages", 'public');
404 } 406 }
405 Message::create($params); 407 Message::create($params);
406 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 408 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
407 } 409 }
408 410
409 public function test123(Request $request) { 411 public function test123(Request $request) {
410 $params = $request->all(); 412 $params = $request->all();
411 $user1 = $params['user_id']; 413 $user1 = $params['user_id'];
412 $user2 = $params['to_user_id']; 414 $user2 = $params['to_user_id'];
413 415
414 $rules = [ 416 $rules = [
415 'text' => 'required|min:1|max:150000', 417 'text' => 'required|min:1|max:150000',
416 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' 418 'file' => 'file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000'
417 ]; 419 ];
418 $messages = [ 420 $messages = [
419 'required' => 'Укажите обязательное поле', 421 'required' => 'Укажите обязательное поле',
420 'min' => [ 422 'min' => [
421 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 423 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
422 'integer' => 'Поле «:attribute» должно быть :min или больше', 424 'integer' => 'Поле «:attribute» должно быть :min или больше',
423 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 425 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
424 ], 426 ],
425 'max' => [ 427 'max' => [
426 'string' => 'Поле «:attribute» должно быть не больше :max символов', 428 'string' => 'Поле «:attribute» должно быть не больше :max символов',
427 'integer' => 'Поле «:attribute» должно быть :max или меньше', 429 'integer' => 'Поле «:attribute» должно быть :max или меньше',
428 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 430 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
429 ] 431 ]
430 ]; 432 ];
431 433
432 $validator = Validator::make($request->all(), $rules, $messages); 434 $validator = Validator::make($request->all(), $rules, $messages);
433 435
434 if ($validator->fails()) { 436 if ($validator->fails()) {
435 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]) 437 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2])
436 ->withErrors($validator); 438 ->withErrors($validator);
437 } else { 439 } else {
438 if ($request->has('file')) { 440 if ($request->has('file')) {
439 $params['file'] = $request->file('file')->store("messages", 'public'); 441 $params['file'] = $request->file('file')->store("messages", 'public');
440 } 442 }
441 Message::create($params); 443 Message::create($params);
442 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 444 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
443 445
444 } 446 }
445 } 447 }
446 448
447 //Избранные люди 449 //Избранные люди
448 public function favorites(Request $request) { 450 public function favorites(Request $request) {
449 if (isset($_COOKIE['favorite_worker'])) { 451 if (isset($_COOKIE['favorite_worker'])) {
450 $items = RusDate::count_item_fav(); 452 $items = RusDate::count_item_fav();
451 $it = $_COOKIE['favorite_worker']; 453 $it = $_COOKIE['favorite_worker'];
452 $it = str_replace('"', "", $it); 454 $it = str_replace('"', "", $it);
453 $it = str_replace('[', "", $it); 455 $it = str_replace('[', "", $it);
454 $it = str_replace(']', "", $it); 456 $it = str_replace(']', "", $it);
455 $Arr = explode(",", $it); 457 $Arr = explode(",", $it);
456 } else { 458 } else {
457 $Arr = Array(); 459 $Arr = Array();
458 } 460 }
459 461
460 $Workers = Worker::query(); 462 $Workers = Worker::query();
461 $Workers = $Workers->whereIn('id', $Arr); 463 $Workers = $Workers->whereIn('id', $Arr);
462 464
463 if (($request->has('search')) && (!empty($request->get('search')))) { 465 if (($request->has('search')) && (!empty($request->get('search')))) {
464 $search = $request->get('search'); 466 $search = $request->get('search');
465 467
466 $Workers = $Workers->WhereHas('users', 468 $Workers = $Workers->WhereHas('users',
467 function (Builder $query) use ($search) { 469 function (Builder $query) use ($search) {
468 $query->Where('surname', 'LIKE', "%$search%") 470 $query->Where('surname', 'LIKE', "%$search%")
469 ->orWhere('name_man', 'LIKE', "%$search%") 471 ->orWhere('name_man', 'LIKE', "%$search%")
470 ->orWhere('surname2', 'LIKE', "%$search%"); 472 ->orWhere('surname2', 'LIKE', "%$search%");
471 }); 473 });
472 } else { 474 } else {
473 $Workers = $Workers->with('users'); 475 $Workers = $Workers->with('users');
474 } 476 }
475 477
476 $Workers = $Workers->get(); 478 $Workers = $Workers->get();
477 return view('employers.favorite', compact('Workers')); 479 return view('employers.favorite', compact('Workers'));
478 } 480 }
479 481
480 // База данных 482 // База данных
481 public function bd(Request $request) { 483 public function bd(Request $request) {
482 // для типа BelongsTo 484 // для типа BelongsTo
483 //$documents = Document::query()->orderBy(Location::select('name') 485 //$documents = Document::query()->orderBy(Location::select('name')
484 // ->whereColumn('locations.id', 'documents.location_id') 486 // ->whereColumn('locations.id', 'documents.location_id')
485 //); 487 //);
486 488
487 // для типа HasOne/Many 489 // для типа HasOne/Many
488 // $documents = Document::::query()->orderBy(Location::select('name') 490 // $documents = Document::::query()->orderBy(Location::select('name')
489 // ->whereColumn('locations.document_id', 'documents.id') 491 // ->whereColumn('locations.document_id', 'documents.id')
490 //); 492 //);
491 493
492 $users = User_Model::query()->with('workers'); 494 $users = User_Model::query()->with('workers');
493 if (isset($request->find)) { 495 if (isset($request->find)) {
494 $find_key = $request->find; 496 $find_key = $request->find;
495 $users = $users->where('name', 'LIKE', "%$find_key%") 497 $users = $users->where('name', 'LIKE', "%$find_key%")
496 ->orWhere('email', 'LIKE', "%$find_key%") 498 ->orWhere('email', 'LIKE', "%$find_key%")
497 ->orWhere('telephone', 'LIKE', "%$find_key%"); 499 ->orWhere('telephone', 'LIKE', "%$find_key%");
498 } 500 }
499 501
500 // Данные 502 // Данные
501 $users = $users->Baseuser()-> 503 $users = $users->Baseuser()->
502 orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id'))-> 504 orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id'))->
503 paginate(5); 505 paginate(5);
504 506
505 return view('employers.bd', compact('users')); 507 return view('employers.bd', compact('users'));
506 } 508 }
507 509
508 //Настройка уведомлений 510 //Настройка уведомлений
509 public function subscribe() { 511 public function subscribe() {
510 return view('employers.subcribe'); 512 return view('employers.subcribe');
511 } 513 }
512 514
513 //Установка уведомлений сохранение 515 //Установка уведомлений сохранение
514 public function save_subscribe(Request $request) { 516 public function save_subscribe(Request $request) {
515 dd($request->all()); 517 dd($request->all());
516 $msg = $request->validate([ 518 $msg = $request->validate([
517 'subscribe_email' => 'required|email|min:5|max:255', 519 'subscribe_email' => 'required|email|min:5|max:255',
518 ]); 520 ]);
519 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); 521 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку');
520 } 522 }
521 523
522 //Сбросить форму с паролем 524 //Сбросить форму с паролем
523 public function password_reset() { 525 public function password_reset() {
524 $email = Auth()->user()->email; 526 $email = Auth()->user()->email;
525 return view('employers.password-reset', compact('email')); 527 return view('employers.password-reset', compact('email'));
526 } 528 }
527 529
528 //Обновление пароля 530 //Обновление пароля
529 public function new_password(Request $request) { 531 public function new_password(Request $request) {
530 $use = Auth()->user(); 532 $use = Auth()->user();
531 $request->validate([ 533 $request->validate([
532 'password' => 'required|string', 534 'password' => 'required|string',
533 'new_password' => 'required|string', 535 'new_password' => 'required|string',
534 'new_password2' => 'required|string' 536 'new_password2' => 'required|string'
535 ]); 537 ]);
536 538
537 if ($request->get('new_password') == $request->get('new_password2')) 539 if ($request->get('new_password') == $request->get('new_password2'))
538 if ($request->get('password') !== $request->get('new_password')) { 540 if ($request->get('password') !== $request->get('new_password')) {
539 $credentials = $request->only('email', 'password'); 541 $credentials = $request->only('email', 'password');
540 if (Auth::attempt($credentials)) { 542 if (Auth::attempt($credentials)) {
541 543
542 if (!is_null($use->email_verified_at)){ 544 if (!is_null($use->email_verified_at)){
543 545
544 $user_data = User_Model::find($use->id); 546 $user_data = User_Model::find($use->id);
545 $user_data->update([ 547 $user_data->update([
546 'password' => Hash::make($request->get('new_password')), 548 'password' => Hash::make($request->get('new_password')),
547 'pubpassword' => base64_encode($request->get('new_password')), 549 'pubpassword' => base64_encode($request->get('new_password')),
548 ]); 550 ]);
549 return redirect() 551 return redirect()
550 ->route('employer.password_reset') 552 ->route('employer.password_reset')
551 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 553 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
552 } 554 }
553 555
554 return redirect() 556 return redirect()
555 ->route('employer.password_reset') 557 ->route('employer.password_reset')
556 ->withError('Данная учетная запись не было верифицированна!'); 558 ->withError('Данная учетная запись не было верифицированна!');
557 } 559 }
558 } 560 }
559 561
560 return redirect() 562 return redirect()
561 ->route('employer.password_reset') 563 ->route('employer.password_reset')
562 ->withErrors('Не совпадение данных, обновите пароли!'); 564 ->withErrors('Не совпадение данных, обновите пароли!');
563 } 565 }
564 566
565 567
566 568
567 // Форма Удаление пипла 569 // Форма Удаление пипла
568 public function delete_people() { 570 public function delete_people() {
569 $login = Auth()->user()->email; 571 $login = Auth()->user()->email;
570 return view('employers.delete_people', compact('login')); 572 return view('employers.delete_people', compact('login'));
571 } 573 }
572 574
573 // Удаление аккаунта 575 // Удаление аккаунта
574 public function action_delete_user(Request $request) { 576 public function action_delete_user(Request $request) {
575 $Answer = $request->all(); 577 $Answer = $request->all();
576 $user_id = Auth()->user()->id; 578 $user_id = Auth()->user()->id;
577 $request->validate([ 579 $request->validate([
578 'password' => 'required|string', 580 'password' => 'required|string',
579 ]); 581 ]);
580 582
581 $credentials = $request->only('email', 'password'); 583 $credentials = $request->only('email', 'password');
582 if (Auth::attempt($credentials)) { 584 if (Auth::attempt($credentials)) {
583 Auth::logout(); 585 Auth::logout();
584 $it = User_Model::find($user_id); 586 $it = User_Model::find($user_id);
585 //$it->delete(); 587 //$it->delete();
586 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 588 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
587 } else { 589 } else {
588 return redirect()->route('employer.delete_people') 590 return redirect()->route('employer.delete_people')
589 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 591 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
590 } 592 }
591 } 593 }
592 594
593 public function ajax_delete_user(Request $request) { 595 public function ajax_delete_user(Request $request) {
594 $Answer = $request->all(); 596 $Answer = $request->all();
595 $user_id = Auth()->user()->id; 597 $user_id = Auth()->user()->id;
596 $request->validate([ 598 $request->validate([
597 'password' => 'required|string', 599 'password' => 'required|string',
598 ]); 600 ]);
599 $credentials = $request->only('email', 'password'); 601 $credentials = $request->only('email', 'password');
600 if (Auth::attempt($credentials)) { 602 if (Auth::attempt($credentials)) {
601 603
602 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', 604 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт',
603 'email' => $request->get('email'), 605 'email' => $request->get('email'),
604 'password' => $request->get('password'))); 606 'password' => $request->get('password')));
605 } else { 607 } else {
606 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); 608 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль'));
607 } 609 }
608 } 610 }
609 611
610 612
611 // FAQ - Вопросы/ответы для работодателей и соискателей 613 // FAQ - Вопросы/ответы для работодателей и соискателей
612 public function faq() { 614 public function faq() {
613 return view('employers.faq'); 615 return view('employers.faq');
614 } 616 }
615 617
616 // Рассылка сообщений 618 // Рассылка сообщений
617 public function send_all_messages() { 619 public function send_all_messages() {
618 return view('employers.send_all'); 620 return view('employers.send_all');
619 } 621 }
620 622
621 // Отправка сообщений для информации 623 // Отправка сообщений для информации
622 public function send_all_post(Request $request) { 624 public function send_all_post(Request $request) {
623 $data = $request->all(); 625 $data = $request->all();
624 626
625 $emails = User_Model::query()->where('is_worker', '1')->get(); 627 $emails = User_Model::query()->where('is_worker', '1')->get();
626 628
627 foreach ($emails as $e) { 629 foreach ($emails as $e) {
628 Mail::to($e->email)->send(new SendAllMessages($data)); 630 Mail::to($e->email)->send(new SendAllMessages($data));
629 } 631 }
630 632
631 return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены'); 633 return redirect()->route('employer.send_all_messages')->with('success', 'Письма были отправлены');
632 } 634 }
633 635
634 // База резюме 636 // База резюме
635 public function bd_tupe(Request $request) { 637 public function bd_tupe(Request $request) {
636 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); 638 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get();
637 639
638 return view('employers.bd_tupe', compact('Resume')); 640 return view('employers.bd_tupe', compact('Resume'));
639 } 641 }
640 642
641 ////////////////////////////////////////////////////////////////// 643 //////////////////////////////////////////////////////////////////
642 // 644 //
643 // 645 //
644 // Отправил сообщение 646 // Отправил сообщение
645 // 647 //
646 // 648 //
647 // 649 //
648 // 650 //
649 ////////////////////////////////////////////////////////////////// 651 //////////////////////////////////////////////////////////////////
650 public function new_message(Request $request) { 652 public function new_message(Request $request) {
651 $params = $request->all(); 653 $params = $request->all();
652 654
653 $id = $params['_user_id']; 655 $id = $params['_user_id'];
654 $message = new Message(); 656 $message = new Message();
655 $message->user_id = $params['_user_id']; 657 $message->user_id = $params['_user_id'];
656 $message->to_user_id = $params['_to_user_id']; 658 $message->to_user_id = $params['_to_user_id'];
657 $message->title = $params['title']; 659 $message->title = $params['title'];
658 $message->text = $params['text']; 660 $message->text = $params['text'];
659 if ($request->has('_file')) { 661 if ($request->has('_file')) {
660 $message->file = $request->file('_file')->store("worker/$id", 'public'); 662 $message->file = $request->file('_file')->store("worker/$id", 'public');
661 } 663 }
662 $message->flag_new = 1; 664 $message->flag_new = 1;
663 $id_message = $message->save(); 665 $id_message = $message->save();
664 666
665 $data['message_id'] = $id_message; 667 $data['message_id'] = $id_message;
666 $data['ad_employer_id'] = $params['_vacancy']; 668 $data['ad_employer_id'] = $params['_vacancy'];
667 $data['job_title_id'] = 0; 669 $data['job_title_id'] = 0;
668 670
669 $data['flag'] = 1; 671 $data['flag'] = 1;
670 $ad_responce = ad_response::create($data); 672 $ad_responce = ad_response::create($data);
671 return redirect()->route('employer.messages', ['type_message' => 'output']); 673 return redirect()->route('employer.messages', ['type_message' => 'output']);
672 } 674 }
673 675
674 // Восстановление пароля 676 // Восстановление пароля
675 public function repair_password(Request $request) { 677 public function repair_password(Request $request) {
676 $params = $request->get('email'); 678 $params = $request->get('email');
677 679
678 680
679 } 681 }
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\Ad_jobs; 9 use App\Models\Ad_jobs;
10 use App\Models\Category; 10 use App\Models\Category;
11 use App\Models\Education; 11 use App\Models\Education;
12 use App\Models\Employer; 12 use App\Models\Employer;
13 use App\Models\employers_main; 13 use App\Models\employers_main;
14 use App\Models\Job_title; 14 use App\Models\Job_title;
15 use App\Models\News; 15 use App\Models\News;
16 use App\Models\reclame; 16 use App\Models\reclame;
17 use App\Models\User; 17 use App\Models\User;
18 use Illuminate\Http\Request; 18 use Illuminate\Http\Request;
19 use Illuminate\Support\Facades\Auth; 19 use Illuminate\Support\Facades\Auth;
20 use Illuminate\Support\Facades\DB; 20 use Illuminate\Support\Facades\DB;
21 use Illuminate\Support\Facades\Hash; 21 use Illuminate\Support\Facades\Hash;
22 use Illuminate\Support\Facades\Mail; 22 use Illuminate\Support\Facades\Mail;
23 use Illuminate\Support\Facades\Validator; 23 use Illuminate\Support\Facades\Validator;
24 use App\Classes\StatusUser; 24 use App\Classes\StatusUser;
25 25
26 class MainController extends Controller 26 class MainController extends Controller
27 { 27 {
28 // Главная страница публичной части 28 // Главная страница публичной части
29 public function index() { 29 public function index() {
30 $news = News::query()->orderBy('id')->limit(6)->get(); 30 $news = News::query()->orderBy('id')->limit(6)->get();
31 31
32 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') 32 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*')
33 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') 33 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id')
34 ->OrderByDesc('created_at') 34 ->OrderByDesc('created_at')
35 ->GroupBy('categories.id') 35 ->GroupBy('categories.id')
36 ->get(); 36 ->get();
37 $employers = employers_main::query()->with('employer')->orderBy('id')->limit(8)->get(); 37 $employers = employers_main::query()->with('employer')->orderBy('id')->limit(8)->get();
38 $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get(); 38 $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get();
39 return view('index', compact('news', 'categories', 'employers', 'vacancy')); 39 return view('index', compact('news', 'categories', 'employers', 'vacancy'));
40 } 40 }
41 41
42 public function search_vacancies(Request $request) { 42 public function search_vacancies(Request $request) {
43 if ($request->has('search')) { 43 if ($request->has('search')) {
44 $search = $request->get('search'); 44 $search = $request->get('search');
45 $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first(); 45 $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first();
46 if (isset($job_titles->id)) 46 if (isset($job_titles->id))
47 if ($job_titles->id > 0) 47 if ($job_titles->id > 0)
48 return redirect()->route('vacancies', ['job' => $job_titles->id]); 48 return redirect()->route('vacancies', ['job' => $job_titles->id]);
49 } 49 }
50 } 50 }
51 51
52 public function vacancies(Request $request) { 52 public function vacancies(Request $request) {
53 //должности 53 //должности
54 $Job_title = Job_title::query()->orderBy('name')->get(); 54 $Job_title = Job_title::query()->orderBy('name')->get();
55 55
56 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') 56 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*')
57 ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary') 57 ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary')
58 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') 58 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id')
59 ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id'); 59 ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id');
60 60
61 //категории и вакансии 61 //категории и вакансии
62 if (($request->has('job')) && ($request->get('job') > 0)) { 62 if (($request->has('job')) && ($request->get('job') > 0)) {
63 $categories = $categories->Where('job_title_id', '=', $request->get('job')); 63 $categories = $categories->Where('job_title_id', '=', $request->get('job'));
64 } 64 }
65 65
66 $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get(); 66 $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get();
67 67
68 68
69 $flot_paluba = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')-> 69 $flot_paluba = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')->
70 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 70 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
71 where('position_ship', 'Палуба'); 71 where('position_ship', 'Палуба');
72 if (!empty($request->get('job'))) { 72 if (!empty($request->get('job'))) {
73 $flot_paluba = $flot_paluba->where('job_title_id', '=', $request->get('job')); 73 $flot_paluba = $flot_paluba->where('job_title_id', '=', $request->get('job'));
74 } 74 }
75 $flot_paluba = $flot_paluba->groupby('job_title_id')->get(); 75 $flot_paluba = $flot_paluba->groupby('job_title_id')->get();
76 76
77 $flot_MO = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')-> 77 $flot_MO = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')->
78 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 78 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
79 where('position_ship', '=', 'МО'); 79 where('position_ship', '=', 'МО');
80 if (!empty($request->get('job'))) { 80 if (!empty($request->get('job'))) {
81 $flot_MO = $flot_MO->where('job_title_id', '=', $request->get('job')); 81 $flot_MO = $flot_MO->where('job_title_id', '=', $request->get('job'));
82 } 82 }
83 $flot_MO = $flot_MO->groupby('ad_jobs.id')->get(); 83 $flot_MO = $flot_MO->groupby('ad_jobs.id')->get();
84 84
85 $flot_radovie = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')-> 85 $flot_radovie = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')->
86 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 86 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
87 where('position_ship', '=', 'Рядовые'); 87 where('position_ship', '=', 'Рядовые');
88 if (!empty($request->get('job'))) { 88 if (!empty($request->get('job'))) {
89 $flot_radovie = $flot_radovie->where('job_title_id', '=', $request->get('job')); 89 $flot_radovie = $flot_radovie->where('job_title_id', '=', $request->get('job'));
90 } 90 }
91 $flot_radovie = $flot_radovie->groupby('ad_jobs.id')->get(); 91 $flot_radovie = $flot_radovie->groupby('ad_jobs.id')->get();
92 92
93 $flot_prochee = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')-> 93 $flot_prochee = DB::table('ad_jobs')->selectRaw('DISTINCT(job_titles.name), job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt')->
94 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')-> 94 join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
95 where('position_ship', '=', 'Прочее'); 95 where('position_ship', '=', 'Прочее');
96 if (!empty($request->get('job'))) { 96 if (!empty($request->get('job'))) {
97 $flot_prochee = $flot_prochee->where('job_title_id', '=', $request->get('job')); 97 $flot_prochee = $flot_prochee->where('job_title_id', '=', $request->get('job'));
98 } 98 }
99 $flot_prochee = $flot_prochee->groupby('ad_jobs.id')->get(); 99 $flot_prochee = $flot_prochee->groupby('ad_jobs.id')->get();
100 100
101 if ($request->ajax()) { 101 if ($request->ajax()) {
102 return view('ajax.new_sky', compact('categories', 'flot_paluba', 'flot_MO', 'flot_radovie', 'flot_prochee')); 102 return view('ajax.new_sky', compact('categories', 'flot_paluba', 'flot_MO', 'flot_radovie', 'flot_prochee'));
103 } else { 103 } else {
104 return view('new_sky', compact('Job_title', 'categories', 104 return view('new_sky', compact('Job_title', 'categories',
105 'flot_paluba', 'flot_MO', 'flot_radovie', 'flot_prochee')); 105 'flot_paluba', 'flot_MO', 'flot_radovie', 'flot_prochee'));
106 } 106 }
107 } 107 }
108 108
109 //Вакансии категория детальная 109 //Вакансии категория детальная
110 public function list_vacancies(Category $categories, Request $request) { 110 public function list_vacancies(Category $categories, Request $request) {
111 if (isset(Auth()->user()->id)) 111 if (isset(Auth()->user()->id))
112 $uid = Auth()->user()->id; 112 $uid = Auth()->user()->id;
113 else 113 else
114 $uid = 0; 114 $uid = 0;
115 115
116 $Query = Ad_employer::with('jobs')-> 116 $Query = Ad_employer::with('jobs')->
117 with('cat')-> 117 with('cat')->
118 with('employer')-> 118 with('employer')->
119 whereHas('jobs_code', function ($query) use ($request) { 119 whereHas('jobs_code', function ($query) use ($request) {
120 if ($request->ajax()) {
121 if (null !== ($request->get('job')) && ($request->get('job') !== 0)) { 120 if (null !== ($request->get('job')) && ($request->get('job') !== 0)) {
122 $query->where('job_title_id', $request->get('job')); 121 $query->where('job_title_id', $request->get('job'));
123 } 122 }
124 }
125 }) 123 })
126 ->select('ad_employers.*'); 124 ->select('ad_employers.*');
127 125
128 126
129 127 if (isset($categories->id) && ($categories->id > 0)) {
130 if ($categories->id > 0) {
131 $Query = $Query->where('category_id', '=', $categories->id); 128 $Query = $Query->where('category_id', '=', $categories->id);
132 $Name_categori = Category::query()->where('id', '=', $categories->id)->get(); 129 $Name_categori = Category::query()->where('id', '=', $categories->id)->get();
130 } else {
131 $Name_categori = '';
133 } 132 }
134 133
134
135
135 if ($request->get('sort')) { 136 if ($request->get('sort')) {
136 $sort = $request->get('sort'); 137 $sort = $request->get('sort');
138
139
137 switch ($sort) { 140 switch ($sort) {
138 case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break; 141 case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break;
139 case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break; 142 case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break;
140 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; 143 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
141 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; 144 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
142 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; 145 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
143 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; 146 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break;
144 } 147 }
145 } 148 }
146 149
147 $Job_title = Job_title::query()->OrderBy('name')->get(); 150 $Job_title = Job_title::query()->OrderBy('name')->get();
148 151
149 $Query_count = $Query->count(); 152 $Query_count = $Query->count();
150 153
151 $Query = $Query->OrderBy('updated_at')->paginate(3); 154 $Query = $Query->OrderBy('updated_at')->paginate(3);
152 155
153 $Reclama = reclame::query()->get(); 156 $Reclama = reclame::query()->get();
154 157
155 158
156 159
157 if ($request->ajax()) { 160 if ($request->ajax()) {
158 if ($request->has('title')) { 161 if ($request->has('title')) {
159 return view('ajax.list_category', compact( 162 return view('ajax.list_category', compact(
160 'Name_categori' 163 'Name_categori'
161 )); 164 ));
162 } else { 165 } else {
163 return view('ajax.list_vacancies', compact('Query', 166 return view('ajax.list_vacancies', compact('Query',
164 'Query_count', 167 'Query_count',
165 'Name_categori', 168 'Name_categori',
166 'Reclama', 169 'Reclama',
167 'categories', 170 'categories',
168 'Job_title', 171 'Job_title',
169 'uid')); 172 'uid'));
170 } 173 }
171 } else { 174 } else {
172 //Вернуть все 175 //Вернуть все
173 return view('list_vacancies', compact('Query', 176 return view('list_vacancies', compact('Query',
174 'Query_count', 177 'Query_count',
175 'Reclama', 178 'Reclama',
176 'Name_categori', 179 'Name_categori',
177 'categories', 180 'categories',
178 'Job_title', 181 'Job_title',
179 'uid')); 182 'uid'));
180 } 183 }
181 } 184 }
182 185
183 // Образование 186 // Образование
184 public function education(Request $request) { 187 public function education(Request $request) {
185 $educations = Education::query(); 188 $educations = Education::query();
186 if (($request->has('search')) && (!empty($request->get('search')))) { 189 if (($request->has('search')) && (!empty($request->get('search')))) {
187 $search = trim($request->get('search')); 190 $search = trim($request->get('search'));
188 $educations = $educations->where('name', 'LIKE', "%$search%"); 191 $educations = $educations->where('name', 'LIKE', "%$search%");
189 } 192 }
190 193
191 if ($request->get('sort')) { 194 if ($request->get('sort')) {
192 $sort = $request->get('sort'); 195 $sort = $request->get('sort');
193 switch ($sort) { 196 switch ($sort) {
194 case 'name_up': $educations = $educations->orderBy('name')->orderBy('id'); break; 197 case 'name_up': $educations = $educations->orderBy('name')->orderBy('id'); break;
195 case 'name_down': $educations = $educations->orderByDesc('name')->orderby('id'); break; 198 case 'name_down': $educations = $educations->orderByDesc('name')->orderby('id'); break;
196 case 'created_at_up': $educations = $educations->OrderBy('created_at')->orderBy('id'); break; 199 case 'created_at_up': $educations = $educations->OrderBy('created_at')->orderBy('id'); break;
197 case 'created_at_down': $educations = $educations->orderByDesc('created_at')->orderBy('id'); break; 200 case 'created_at_down': $educations = $educations->orderByDesc('created_at')->orderBy('id'); break;
198 case 'default': $educations = $educations->orderBy('id')->orderby('updated_at'); break; 201 case 'default': $educations = $educations->orderBy('id')->orderby('updated_at'); break;
199 default: $educations = $educations->orderBy('id')->orderby('updated_at'); break; 202 default: $educations = $educations->orderBy('id')->orderby('updated_at'); break;
200 } 203 }
201 } 204 }
202 205
203 $count_edu = $educations->count(); 206 $count_edu = $educations->count();
204 $educations = $educations->paginate(6); 207 $educations = $educations->paginate(6);
205 if ($request->ajax()) { 208 if ($request->ajax()) {
206 return view('ajax.education', compact('educations')); 209 return view('ajax.education', compact('educations'));
207 } else { 210 } else {
208 return view('education', compact('educations', 'count_edu')); 211 return view('education', compact('educations', 'count_edu'));
209 } 212 }
210 } 213 }
211 214
212 // Контакты 215 // Контакты
213 public function contacts() { 216 public function contacts() {
214 return view('contacts'); 217 return view('contacts');
215 } 218 }
216 219
217 // Вход в личный кабинет 220 // Вход в личный кабинет
218 public function input_login(Request $request) 221 public function input_login(Request $request)
219 { 222 {
220 $params = $request->all(); 223 $params = $request->all();
221 224
222 225
223 $rules = [ 226 $rules = [
224 'email' => 'required|string|email', 227 'email' => 'required|string|email',
225 'password' => 'required|string|min:3|max:25', 228 'password' => 'required|string|min:3|max:25',
226 ]; 229 ];
227 230
228 $messages = [ 231 $messages = [
229 'required' => 'Укажите обязательное поле «:attribute»', 232 'required' => 'Укажите обязательное поле «:attribute»',
230 'email' => 'Введите корректный email', 233 'email' => 'Введите корректный email',
231 'min' => [ 234 'min' => [
232 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 235 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
233 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 236 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
234 ], 237 ],
235 'max' => [ 238 'max' => [
236 'string' => 'Поле «:attribute» должно быть не больше :max символов', 239 'string' => 'Поле «:attribute» должно быть не больше :max символов',
237 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 240 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
238 ], 241 ],
239 ]; 242 ];
240 243
241 $validator = Validator::make($request->all(), $rules, $messages); 244 $validator = Validator::make($request->all(), $rules, $messages);
242 245
243 246
244 if ($validator->fails()) { 247 if ($validator->fails()) {
245 return redirect()->route('index')->with('Error', "Email или пароль невалидный"); 248 return redirect()->route('index')->with('Error', "Email или пароль невалидный");
246 } else { 249 } else {
247 $credentials = $request->only('email', 'password'); 250 $credentials = $request->only('email', 'password');
248 251
249 if (Auth::attempt($credentials, $request->has('remember'))) { 252 if (Auth::attempt($credentials, $request->has('remember'))) {
250 253
251 if (is_null(Auth::user()->email_verified_at)) { 254 if (is_null(Auth::user()->email_verified_at)) {
252 Auth::logout(); 255 Auth::logout();
253 return json_encode(Array("ERROR" => "Адрес почты не подтвержден")); 256 return json_encode(Array("ERROR" => "Адрес почты не подтвержден"));
254 } 257 }
255 258
256 if (Auth::user()->is_worker) { 259 if (Auth::user()->is_worker) {
257 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl())); 260 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));
258 } else { 261 } else {
259 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl())); 262 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));
260 } 263 }
261 264
262 return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет")); 265 return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет"));
263 //->route('index') 266 //->route('index')
264 //->with('success', 'Вы вошли в личный кабинет.'); 267 //->with('success', 'Вы вошли в личный кабинет.');
265 } else { 268 } else {
266 return json_encode(Array("ERROR" => "Неверный логин или пароль!")); 269 return json_encode(Array("ERROR" => "Неверный логин или пароль!"));
267 } 270 }
268 } 271 }
269 } 272 }
270 273
271 // Восстановление пароля 274 // Восстановление пароля
272 public function repair_password(Request $request) { 275 public function repair_password(Request $request) {
273 $rules = [ 276 $rules = [
274 'email' => 'required|string|email', 277 'email' => 'required|string|email',
275 ]; 278 ];
276 279
277 $messages = [ 280 $messages = [
278 'required' => 'Укажите обязательное поле «:attribute»', 281 'required' => 'Укажите обязательное поле «:attribute»',
279 'email' => 'Введите корректный email', 282 'email' => 'Введите корректный email',
280 'min' => [ 283 'min' => [
281 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 284 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
282 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 285 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
283 ], 286 ],
284 'max' => [ 287 'max' => [
285 'string' => 'Поле «:attribute» должно быть не больше :max символов', 288 'string' => 'Поле «:attribute» должно быть не больше :max символов',
286 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 289 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
287 ], 290 ],
288 ]; 291 ];
289 292
290 $validator = Validator::make($request->all(), $rules, $messages); 293 $validator = Validator::make($request->all(), $rules, $messages);
291 294
292 if ($validator->fails()) { 295 if ($validator->fails()) {
293 return redirect()->back()->with('Error', "Email невалидный"); 296 return redirect()->back()->with('Error', "Email невалидный");
294 } else { 297 } else {
295 $new_password = Tools::generator_id(10); 298 $new_password = Tools::generator_id(10);
296 $hash_password = Hash::make($new_password); 299 $hash_password = Hash::make($new_password);
297 $user = User::query()->where('email', $request->get('email'))->first(); 300 $user = User::query()->where('email', $request->get('email'))->first();
298 $EditRec = User::find($user->id); 301 $EditRec = User::find($user->id);
299 $EditRec->password = $hash_password; 302 $EditRec->password = $hash_password;
300 $EditRec->save(); 303 $EditRec->save();
301 304
302 foreach ([$request->get('email')] as $recipient) { 305 foreach ([$request->get('email')] as $recipient) {
303 Mail::to($recipient)->send(new MailRepair($new_password)); 306 Mail::to($recipient)->send(new MailRepair($new_password));
304 } 307 }
305 return redirect()->route('index'); 308 return redirect()->route('index');
306 309
307 } 310 }
308 311
309 } 312 }
310 313
311 // Вывод новостей 314 // Вывод новостей
312 public function news(Request $request) { 315 public function news(Request $request) {
313 $Query = News::query(); 316 $Query = News::query();
314 if ($request->has('search')) { 317 if ($request->has('search')) {
315 $search = $request->get('search'); 318 $search = $request->get('search');
316 $Query = $Query->where('title', 'LIKE', "%$search%")-> 319 $Query = $Query->where('title', 'LIKE', "%$search%")->
317 orWhere('text', 'LIKE', "%$search%"); 320 orWhere('text', 'LIKE', "%$search%");
318 } 321 }
319 322
320 if ($request->ajax()) { 323 if ($request->ajax()) {
321 if ($request->get('sort')) { 324 if ($request->get('sort')) {
322 $sort = $request->get('sort'); 325 $sort = $request->get('sort');
323 switch ($sort) { 326 switch ($sort) {
324 case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break; 327 case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break;
325 case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break; 328 case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break;
326 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; 329 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
327 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; 330 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
328 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; 331 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
329 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; 332 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break;
330 } 333 }
331 } 334 }
332 } 335 }
333 $Query_count = $Query->count(); 336 $Query_count = $Query->count();
334 $Query = $Query->paginate(6); 337 $Query = $Query->paginate(6);
335 338
336 if ($request->ajax()) { 339 if ($request->ajax()) {
337 return view('ajax.news-list', compact('Query', 'Query_count')); 340 return view('ajax.news-list', compact('Query', 'Query_count'));
338 } else { 341 } else {
339 return view('news-list', compact('Query', 'Query_count')); 342 return view('news-list', compact('Query', 'Query_count'));
340 } 343 }
341 } 344 }
342 345
343 //Детальная новость 346 //Детальная новость
344 public function detail_new(News $new) { 347 public function detail_new(News $new) {
345 // Выборка 348 // Выборка
346 $Query = News::query()->where('id', $new->id)->get(); 349 $Query = News::query()->where('id', $new->id)->get();
347 $title = $Query[0]->title; 350 $title = $Query[0]->title;
348 $All_Query = News::query()->paginate(8); 351 $All_Query = News::query()->paginate(8);
349 return view('detail_new', compact('Query', 'All_Query', 'title')); 352 return view('detail_new', compact('Query', 'All_Query', 'title'));
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\ResponseWork; 17 use App\Models\ResponseWork;
18 use App\Models\sertification; 18 use App\Models\sertification;
19 use App\Models\Static_worker; 19 use App\Models\Static_worker;
20 use App\Models\User; 20 use App\Models\User;
21 use App\Models\User as User_Model; 21 use App\Models\User as User_Model;
22 use App\Models\Worker; 22 use App\Models\Worker;
23 use Barryvdh\DomPDF\Facade\Pdf; 23 use Barryvdh\DomPDF\Facade\Pdf;
24 use Carbon\Carbon; 24 use Carbon\Carbon;
25 use Illuminate\Auth\Events\Registered; 25 use Illuminate\Auth\Events\Registered;
26 use Illuminate\Database\Eloquent\Builder; 26 use Illuminate\Database\Eloquent\Builder;
27 use Illuminate\Database\Eloquent\Model; 27 use Illuminate\Database\Eloquent\Model;
28 use Illuminate\Http\JsonResponse; 28 use Illuminate\Http\JsonResponse;
29 use Illuminate\Http\Request; 29 use Illuminate\Http\Request;
30 use Illuminate\Support\Facades\Auth; 30 use Illuminate\Support\Facades\Auth;
31 use Illuminate\Support\Facades\Hash; 31 use Illuminate\Support\Facades\Hash;
32 use Illuminate\Support\Facades\Storage; 32 use Illuminate\Support\Facades\Storage;
33 use Illuminate\Support\Facades\Validator; 33 use Illuminate\Support\Facades\Validator;
34 34
35 class WorkerController extends Controller 35 class WorkerController extends Controller
36 { 36 {
37 public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу'); 37 public $status_work = array(0 => 'Ищу работу', 1 => 'Не указано', 2 => 'Не ищу работу');
38 38
39 //профиль 39 //профиль
40 public function profile(Worker $worker) 40 public function profile(Worker $worker)
41 { 41 {
42 $get_date = date('Y.m'); 42 $get_date = date('Y.m');
43 43
44 $c = Static_worker::query()->where('year_month', '=', $get_date) 44 $c = Static_worker::query()->where('year_month', '=', $get_date)
45 ->where('user_id', '=', $worker->users->id) 45 ->where('user_id', '=', $worker->users->id)
46 ->get(); 46 ->get();
47 47
48 if ($c->count() > 0) { 48 if ($c->count() > 0) {
49 $upd = Static_worker::find($c[0]->id); 49 $upd = Static_worker::find($c[0]->id);
50 $upd->lookin = $upd->lookin + 1; 50 $upd->lookin = $upd->lookin + 1;
51 $upd->save(); 51 $upd->save();
52 } else { 52 } else {
53 $crt = new Static_worker(); 53 $crt = new Static_worker();
54 $crt->lookin = 1; 54 $crt->lookin = 1;
55 $crt->year_month = $get_date; 55 $crt->year_month = $get_date;
56 $crt->user_id = $worker->user_id; 56 $crt->user_id = $worker->user_id;
57 $crt->save(); 57 $crt->save();
58 } 58 }
59 59
60 $stat = Static_worker::query()->where('year_month', '=', $get_date) 60 $stat = Static_worker::query()->where('year_month', '=', $get_date)
61 ->where('user_id', '=', $worker->users->id) 61 ->where('user_id', '=', $worker->users->id)
62 ->get(); 62 ->get();
63 63
64 return view('public.workers.profile', compact('worker', 'stat')); 64 return view('public.workers.profile', compact('worker', 'stat'));
65 } 65 }
66 66
67 // лист база резюме 67 // лист база резюме
68 public function bd_resume(Request $request) 68 public function bd_resume(Request $request)
69 { 69 {
70 if (isset(Auth()->user()->id)) { 70 if (isset(Auth()->user()->id)) {
71 $idiot = Auth()->user()->id; 71 $idiot = Auth()->user()->id;
72 } else { 72 } else {
73 $idiot = 0; 73 $idiot = 0;
74 } 74 }
75 75
76 $status_work = $this->status_work; 76 $status_work = $this->status_work;
77 $resumes = Worker::query()->with('users')->with('job_titles'); 77 $resumes = Worker::query()->with('users')->with('job_titles');
78 $resumes = $resumes->whereHas('users', function (Builder $query) { 78 $resumes = $resumes->whereHas('users', function (Builder $query) {
79 $query->Where('is_worker', '=', '1') 79 $query->Where('is_worker', '=', '1')
80 ->Where('is_bd', '=', '0'); 80 ->Where('is_bd', '=', '0');
81 }); 81 });
82 82
83 if ($request->get('sort')) { 83 if ($request->get('sort')) {
84 $sort = $request->get('sort'); 84 $sort = $request->get('sort');
85 switch ($sort) { 85 switch ($sort) {
86 case 'name_up': 86 case 'name_up':
87 $resumes = $resumes->orderBy(User::select('surname') 87 $resumes = $resumes->orderBy(User::select('surname')
88 ->whereColumn('Workers.user_id', 'users.id') 88 ->whereColumn('Workers.user_id', 'users.id')
89 ); 89 );
90 break; 90 break;
91 case 'name_down': 91 case 'name_down':
92 $resumes = $resumes->orderByDesc(User::select('surname') 92 $resumes = $resumes->orderByDesc(User::select('surname')
93 ->whereColumn('Workers.user_id', 'users.id') 93 ->whereColumn('Workers.user_id', 'users.id')
94 ); 94 );
95 break; 95 break;
96 case 'created_at_up': $resumes = $resumes->OrderBy('created_at')->orderBy('id'); break; 96 case 'created_at_up': $resumes = $resumes->OrderBy('created_at')->orderBy('id'); break;
97 case 'created_at_down': $resumes = $resumes->orderByDesc('created_at')->orderBy('id'); break; 97 case 'created_at_down': $resumes = $resumes->orderByDesc('created_at')->orderBy('id'); break;
98 case 'default': $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; 98 case 'default': $resumes = $resumes->orderBy('id')->orderby('updated_at'); break;
99 default: $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; 99 default: $resumes = $resumes->orderBy('id')->orderby('updated_at'); break;
100 } 100 }
101 } 101 }
102 102
103 $res_count = $resumes->count(); 103 $res_count = $resumes->count();
104 $resumes = $resumes->paginate(6); 104 $resumes = $resumes->paginate(6);
105 if ($request->ajax()) { 105 if ($request->ajax()) {
106 // Условия обставлены 106 // Условия обставлены
107 if ($request->has('block') && ($request->get('block') == 1)) { 107 if ($request->has('block') && ($request->get('block') == 1)) {
108 return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot')); 108 return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot'));
109 } 109 }
110 110
111 if ($request->has('block') && ($request->get('block') == 2)) { 111 if ($request->has('block') && ($request->get('block') == 2)) {
112 return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot')); 112 return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot'));
113 } 113 }
114 } else { 114 } else {
115 return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot')); 115 return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot'));
116 } 116 }
117 } 117 }
118 118
119 // анкета соискателя 119 // анкета соискателя
120 public function resume_profile(Worker $worker) 120 public function resume_profile(Worker $worker)
121 { 121 {
122 $status_work = $this->status_work; 122 $status_work = $this->status_work;
123 $Query = Worker::query()->with('users')->with('job_titles') 123 $Query = Worker::query()->with('users')->with('job_titles')
124 ->with('place_worker')->with('sertificate')->with('prev_company') 124 ->with('place_worker')->with('sertificate')->with('prev_company')
125 ->with('infobloks'); 125 ->with('infobloks');
126 $Query = $Query->where('id', '=', $worker->id); 126 $Query = $Query->where('id', '=', $worker->id);
127 $Query = $Query->get(); 127 $Query = $Query->get();
128 128
129 $get_date = date('Y.m'); 129 $get_date = date('Y.m');
130 $c = Static_worker::query()->where('year_month', '=', $get_date) 130 $c = Static_worker::query()->where('year_month', '=', $get_date)
131 ->where('user_id', '=', $worker->id) 131 ->where('user_id', '=', $worker->id)
132 ->get(); 132 ->get();
133 133
134 if ($c->count() > 0) { 134 if ($c->count() > 0) {
135 $upd = Static_worker::find($c[0]->id); 135 $upd = Static_worker::find($c[0]->id);
136 $upd->lookin = $upd->lookin + 1; 136 $upd->lookin = $upd->lookin + 1;
137 $upd->save(); 137 $upd->save();
138 } else { 138 } else {
139 $crt = new Static_worker(); 139 $crt = new Static_worker();
140 $crt->lookin = 1; 140 $crt->lookin = 1;
141 $crt->year_month = $get_date; 141 $crt->year_month = $get_date;
142 $crt->user_id = $worker->user_id; 142 $crt->user_id = $worker->user_id;
143 $crt->save(); 143 $crt->save();
144 } 144 }
145 145
146 $stat = Static_worker::query()->where('year_month', '=', $get_date) 146 $stat = Static_worker::query()->where('year_month', '=', $get_date)
147 ->where('user_id', '=', $worker->id) 147 ->where('user_id', '=', $worker->id)
148 ->get(); 148 ->get();
149 149
150 return view('worker', compact('Query', 'status_work')); 150 return view('worker', compact('Query', 'status_work'));
151 } 151 }
152 152
153 // скачать анкету соискателя 153 // скачать анкету соискателя
154 public function resume_download(Worker $worker) 154 public function resume_download(Worker $worker)
155 { 155 {
156 $status_work = $this->status_work; 156 $status_work = $this->status_work;
157 $Query = Worker::query()->with('users')->with('job_titles') 157 $Query = Worker::query()->with('users')->with('job_titles')
158 ->with('place_worker')->with('sertificate')->with('prev_company') 158 ->with('place_worker')->with('sertificate')->with('prev_company')
159 ->with('infobloks'); 159 ->with('infobloks');
160 $Query = $Query->where('id', '=', $worker->id); 160 $Query = $Query->where('id', '=', $worker->id);
161 $Query = $Query->get()->toArray(); 161 $Query = $Query->get()->toArray();
162 162
163 view()->share('Query',$Query); 163 view()->share('Query',$Query);
164 164
165 $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape'); 165 $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape');
166 166
167 return $pdf->stream(); 167 return $pdf->stream();
168 } 168 }
169 169
170 // Кабинет работника 170 // Кабинет работника
171 public function cabinet(Request $request) 171 public function cabinet(Request $request)
172 { 172 {
173 $get_date = date('Y.m'); 173 $get_date = date('Y.m');
174 174
175 $id = Auth()->user()->id; 175 $id = Auth()->user()->id;
176 $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')-> 176 $Worker = Worker::query()->with('users')->with('sertificate')->with('prev_company')->
177 with('infobloks')->with('place_worker')-> 177 with('infobloks')->with('place_worker')->
178 WhereHas('users', 178 WhereHas('users',
179 function (Builder $query) use ($id) {$query->Where('id', $id); 179 function (Builder $query) use ($id) {$query->Where('id', $id);
180 })->get(); 180 })->get();
181 181
182 $Job_titles = Job_title::query()->OrderBy('name')->get(); 182 $Job_titles = Job_title::query()->OrderBy('name')->get();
183 $Infoblocks = infobloks::query()->OrderBy('name')->get(); 183 $Infoblocks = infobloks::query()->OrderBy('name')->get();
184 184
185 $stat = Static_worker::query()->where('year_month', '=', $get_date) 185 $stat = Static_worker::query()->where('year_month', '=', $get_date)
186 ->where('user_id', '=', $Worker[0]->id) 186 ->where('user_id', '=', $Worker[0]->id)
187 ->get(); 187 ->get();
188 188
189 $persent = 10; 189 $persent = 10;
190 if ((!empty($Worker[0]->status_work)) && (!empty($Worker[0]->telephone)) && 190 if ((!empty($Worker[0]->status_work)) && (!empty($Worker[0]->telephone)) &&
191 (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) && 191 (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) &&
192 (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) { 192 (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) {
193 $persent = $persent + 40; 193 $persent = $persent + 40;
194 } 194 }
195 195
196 if ($Worker[0]->sertificate->count() > 0) { 196 if ($Worker[0]->sertificate->count() > 0) {
197 $persent = $persent + 15; 197 $persent = $persent + 15;
198 } 198 }
199 199
200 if ($Worker[0]->infobloks->count() > 0) { 200 if ($Worker[0]->infobloks->count() > 0) {
201 $persent = $persent + 20; 201 $persent = $persent + 20;
202 } 202 }
203 203
204 if ($Worker[0]->prev_company->count() > 0) { 204 if ($Worker[0]->prev_company->count() > 0) {
205 $persent = $persent + 10; 205 $persent = $persent + 10;
206 } 206 }
207 207
208 if (!empty($Worker[0]->photo)) { 208 if (!empty($Worker[0]->photo)) {
209 // 5% 209 // 5%
210 $persent = $persent + 5; 210 $persent = $persent + 5;
211 } 211 }
212 212
213 if ($request->has('print')) { 213 if ($request->has('print')) {
214 dd($Worker); 214 dd($Worker);
215 } else { 215 } else {
216 return view('workers.cabinet', compact('Worker', 'persent', 'Job_titles', 'Infoblocks', 'stat')); 216 return view('workers.cabinet', compact('Worker', 'persent', 'Job_titles', 'Infoblocks', 'stat'));
217 } 217 }
218 } 218 }
219 219
220 // Сохранение данных 220 // Сохранение данных
221 public function cabinet_save(Worker $worker, Request $request) 221 public function cabinet_save(Worker $worker, Request $request)
222 { 222 {
223 $id = $worker->id; 223 $id = $worker->id;
224 $params = $request->all(); 224 $params = $request->all();
225 225
226 $job_title_id = $request->get('job_title_id'); 226 $job_title_id = $request->get('job_title_id');
227 227
228 unset($params['new_diplom']); 228 unset($params['new_diplom']);
229 unset($params['new_data_begin']); 229 unset($params['new_data_begin']);
230 unset($params['new_data_end']); 230 unset($params['new_data_end']);
231 unset($params['new_job_title']); 231 unset($params['new_job_title']);
232 unset($params['new_teplohod']); 232 unset($params['new_teplohod']);
233 unset($params['new_GWT']); 233 unset($params['new_GWT']);
234 unset($params['new_KBT']); 234 unset($params['new_KBT']);
235 unset($params['new_Begin_work']); 235 unset($params['new_Begin_work']);
236 unset($params['new_End_work']); 236 unset($params['new_End_work']);
237 unset($params['new_name_company']); 237 unset($params['new_name_company']);
238 238
239 $rules = [ 239 $rules = [
240 'surname' => ['required', 'string', 'max:255'], 240 'surname' => ['required', 'string', 'max:255'],
241 'name_man' => ['required', 'string', 'max:255'], 241 'name_man' => ['required', 'string', 'max:255'],
242 'email' => ['required', 'string', 'email', 'max:255'], 242 'email' => ['required', 'string', 'email', 'max:255'],
243 243
244 ]; 244 ];
245 245
246 $messages = [ 246 $messages = [
247 'required' => 'Укажите обязательное поле', 247 'required' => 'Укажите обязательное поле',
248 'min' => [ 248 'min' => [
249 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 249 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
250 'integer' => 'Поле «:attribute» должно быть :min или больше', 250 'integer' => 'Поле «:attribute» должно быть :min или больше',
251 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 251 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
252 ], 252 ],
253 'max' => [ 253 'max' => [
254 'string' => 'Поле «:attribute» должно быть не больше :max символов', 254 'string' => 'Поле «:attribute» должно быть не больше :max символов',
255 'integer' => 'Поле «:attribute» должно быть :max или меньше', 255 'integer' => 'Поле «:attribute» должно быть :max или меньше',
256 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 256 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
257 ] 257 ]
258 ]; 258 ];
259 259
260 $validator = Validator::make($params, $rules, $messages); 260 $validator = Validator::make($params, $rules, $messages);
261 261
262 if ($validator->fails()) { 262 if ($validator->fails()) {
263 return redirect()->route('worker.cabinet')->withErrors($validator); 263 return redirect()->route('worker.cabinet')->withErrors($validator);
264 } else { 264 } else {
265 265
266 if ($request->has('photo')) { 266 if ($request->has('photo')) {
267 if (!empty($Worker->photo)) { 267 if (!empty($Worker->photo)) {
268 Storage::delete($Worker->photo); 268 Storage::delete($Worker->photo);
269 } 269 }
270 $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); 270 $params['photo'] = $request->file('photo')->store("worker/$id", 'public');
271 } 271 }
272 272
273 if ($request->has('file')) { 273 if ($request->has('file')) {
274 if (!empty($Worker->file)) { 274 if (!empty($Worker->file)) {
275 Storage::delete($Worker->file); 275 Storage::delete($Worker->file);
276 } 276 }
277 $params['file'] = $request->file('file')->store("worker/$id", 'public'); 277 $params['file'] = $request->file('file')->store("worker/$id", 'public');
278 } 278 }
279 279
280 $id_wor = $worker->update($params); 280 $id_wor = $worker->update($params);
281 281
282 $use = User_Model::find($id_wor); 282 $use = User_Model::find($id_wor);
283 $use->surname = $request->get('surname'); 283 $use->surname = $request->get('surname');
284 $use->name_man = $request->get('name_man'); 284 $use->name_man = $request->get('name_man');
285 $use->surname2 = $request->get('surname2'); 285 $use->surname2 = $request->get('surname2');
286 286
287 $use->save(); 287 $use->save();
288 $worker->job_titles()->sync($job_title_id); 288 $worker->job_titles()->sync($job_title_id);
289 289
290 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); 290 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены');
291 } 291 }
292 } 292 }
293 293
294 // Сообщения данные 294 // Сообщения данные
295 public function messages($type_message) 295 public function messages($type_message)
296 { 296 {
297 $user_id = Auth()->user()->id; 297 $user_id = Auth()->user()->id;
298 298
299 $messages_input = Message::query()->with('vacancies')->with('user_from')-> 299 $messages_input = Message::query()->with('vacancies')->with('user_from')->
300 Where('to_user_id', $user_id)->OrderByDesc('created_at'); 300 Where('to_user_id', $user_id)->OrderByDesc('created_at');
301 301
302 $messages_output = Message::query()->with('vacancies')-> 302 $messages_output = Message::query()->with('vacancies')->
303 with('user_to')->where('user_id', $user_id)-> 303 with('user_to')->where('user_id', $user_id)->
304 OrderByDesc('created_at'); 304 OrderByDesc('created_at');
305 305
306 306
307 $count_input = $messages_input->count(); 307 $count_input = $messages_input->count();
308 $count_output = $messages_output->count(); 308 $count_output = $messages_output->count();
309 309
310 if ($type_message == 'input') { 310 if ($type_message == 'input') {
311 $messages = $messages_input->paginate(15); 311 $messages = $messages_input->paginate(15);
312 } 312 }
313 313
314 if ($type_message == 'output') { 314 if ($type_message == 'output') {
315 $messages = $messages_output->paginate(15); 315 $messages = $messages_output->paginate(15);
316 } 316 }
317 // Вернуть все 100% 317 // Вернуть все 100%
318 return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id')); 318 return view('workers.messages', compact('messages', 'count_input', 'count_output', 'type_message', 'user_id'));
319 } 319 }
320 320
321 // Избранный 321 // Избранный
322 public function favorite() 322 public function favorite()
323 { 323 {
324 return view('workers.favorite'); 324 return view('workers.favorite');
325 } 325 }
326 326
327 // Сменить пароль 327 // Сменить пароль
328 public function new_password() 328 public function new_password()
329 { 329 {
330 $email = Auth()->user()->email; 330 $email = Auth()->user()->email;
331 return view('workers.new_password', compact('email')); 331 return view('workers.new_password', compact('email'));
332 } 332 }
333 333
334 // Обновление пароля 334 // Обновление пароля
335 public function save_new_password(Request $request) { 335 public function save_new_password(Request $request) {
336 $use = Auth()->user(); 336 $use = Auth()->user();
337 $request->validate([ 337 $request->validate([
338 'password' => 'required|string', 338 'password' => 'required|string',
339 'new_password' => 'required|string', 339 'new_password' => 'required|string',
340 'new_password2' => 'required|string' 340 'new_password2' => 'required|string'
341 ]); 341 ]);
342 342
343 if ($request->get('new_password') == $request->get('new_password2')) 343 if ($request->get('new_password') == $request->get('new_password2'))
344 if ($request->get('password') !== $request->get('new_password')) { 344 if ($request->get('password') !== $request->get('new_password')) {
345 $credentials = $request->only('email', 'password'); 345 $credentials = $request->only('email', 'password');
346 if (Auth::attempt($credentials, $request->has('save_me'))) { 346 if (Auth::attempt($credentials, $request->has('save_me'))) {
347 347
348 if (!is_null($use->email_verified_at)){ 348 if (!is_null($use->email_verified_at)){
349 349
350 $user_data = User_Model::find($use->id); 350 $user_data = User_Model::find($use->id);
351 $user_data->update([ 351 $user_data->update([
352 'password' => Hash::make($request->get('new_password')), 352 'password' => Hash::make($request->get('new_password')),
353 'pubpassword' => base64_encode($request->get('new_password')), 353 'pubpassword' => base64_encode($request->get('new_password')),
354 ]); 354 ]);
355 return redirect() 355 return redirect()
356 ->route('worker.new_password') 356 ->route('worker.new_password')
357 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 357 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
358 } 358 }
359 359
360 return redirect() 360 return redirect()
361 ->route('worker.new_password') 361 ->route('worker.new_password')
362 ->withError('Данная учетная запись не было верифицированна!'); 362 ->withError('Данная учетная запись не было верифицированна!');
363 } 363 }
364 } 364 }
365 365
366 return redirect() 366 return redirect()
367 ->route('worker.new_password') 367 ->route('worker.new_password')
368 ->withErrors('Не совпадение данных, обновите пароли!'); 368 ->withErrors('Не совпадение данных, обновите пароли!');
369 } 369 }
370 370
371 // Удаление профиля форма 371 // Удаление профиля форма
372 public function delete_profile() 372 public function delete_profile()
373 { 373 {
374 $login = Auth()->user()->email; 374 $login = Auth()->user()->email;
375 return view('workers.delete_profile', compact('login')); 375 return view('workers.delete_profile', compact('login'));
376 } 376 }
377 377
378 // Удаление профиля код 378 // Удаление профиля код
379 public function delete_profile_result(Request $request) { 379 public function delete_profile_result(Request $request) {
380 $Answer = $request->all(); 380 $Answer = $request->all();
381 $user_id = Auth()->user()->id; 381 $user_id = Auth()->user()->id;
382 $request->validate([ 382 $request->validate([
383 'password' => 'required|string', 383 'password' => 'required|string',
384 ]); 384 ]);
385 385
386 $credentials = $request->only('email', 'password'); 386 $credentials = $request->only('email', 'password');
387 if (Auth::attempt($credentials)) { 387 if (Auth::attempt($credentials)) {
388 Auth::logout(); 388 Auth::logout();
389 $it = User_Model::find($user_id); 389 $it = User_Model::find($user_id);
390 //$it->delete(); 390 //$it->delete();
391 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 391 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
392 } else { 392 } else {
393 return redirect()->route('worker.delete_profile') 393 return redirect()->route('worker.delete_profile')
394 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 394 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
395 } 395 }
396 } 396 }
397 397
398 // Регистрация соискателя 398 // Регистрация соискателя
399 public function register_worker(Request $request) 399 public function register_worker(Request $request)
400 { 400 {
401 $params = $request->all(); 401 $params = $request->all();
402 402
403 $rules = [ 403 $rules = [
404 'surname' => ['required', 'string', 'max:255'], 404 'surname' => ['required', 'string', 'max:255'],
405 'name_man' => ['required', 'string', 'max:255'], 405 'name_man' => ['required', 'string', 'max:255'],
406 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 406 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
407 'password' => ['required', 'string', 'min:8'], 407 'password' => ['required', 'string', 'min:8'],
408 ]; 408 ];
409 409
410 $messages = [ 410 $messages = [
411 'required' => 'Укажите обязательное поле', 411 'required' => 'Укажите обязательное поле',
412 'min' => [ 412 'min' => [
413 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 413 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
414 'integer' => 'Поле «:attribute» должно быть :min или больше', 414 'integer' => 'Поле «:attribute» должно быть :min или больше',
415 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 415 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
416 ], 416 ],
417 'max' => [ 417 'max' => [
418 'string' => 'Поле «:attribute» должно быть не больше :max символов', 418 'string' => 'Поле «:attribute» должно быть не больше :max символов',
419 'integer' => 'Поле «:attribute» должно быть :max или меньше', 419 'integer' => 'Поле «:attribute» должно быть :max или меньше',
420 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 420 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
421 ] 421 ]
422 ]; 422 ];
423 423
424 if ($request->get('password') !== $request->get('confirmed')){ 424 if ($request->get('password') !== $request->get('confirmed')){
425 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 425 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
426 } 426 }
427 427
428 $validator = Validator::make($request->all(), $rules, $messages); 428 $validator = Validator::make($request->all(), $rules, $messages);
429 429
430 if ($validator->fails()) { 430 if ($validator->fails()) {
431 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 431 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
432 } else { 432 } else {
433 $user = $this->create($params); 433 $user = $this->create($params);
434 event(new Registered($user)); 434 event(new Registered($user));
435 435
436 Auth::guard()->login($user); 436 Auth::guard()->login($user);
437 } 437 }
438 if ($user) { 438 if ($user) {
439 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; 439 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));;
440 } else { 440 } else {
441 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 441 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
442 } 442 }
443 } 443 }
444 444
445 445
446 // Звездная оценка и ответ 446 // Звездная оценка и ответ
447 public function stars_answer(Request $request) { 447 public function stars_answer(Request $request) {
448 $params = $request->all(); 448 $params = $request->all();
449 $rules = [ 449 $rules = [
450 'message' => ['required', 'string', 'max:255'], 450 'message' => ['required', 'string', 'max:255'],
451 ]; 451 ];
452 452
453 $messages = [ 453 $messages = [
454 'required' => 'Укажите обязательное поле', 454 'required' => 'Укажите обязательное поле',
455 'min' => [ 455 'min' => [
456 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 456 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
457 'integer' => 'Поле «:attribute» должно быть :min или больше', 457 'integer' => 'Поле «:attribute» должно быть :min или больше',
458 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 458 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
459 ], 459 ],
460 'max' => [ 460 'max' => [
461 'string' => 'Поле «:attribute» должно быть не больше :max символов', 461 'string' => 'Поле «:attribute» должно быть не больше :max символов',
462 'integer' => 'Поле «:attribute» должно быть :max или меньше', 462 'integer' => 'Поле «:attribute» должно быть :max или меньше',
463 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 463 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
464 ] 464 ]
465 ]; 465 ];
466 $response_worker = ResponseWork::create($params); 466 $response_worker = ResponseWork::create($params);
467 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); 467 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!');
468 } 468 }
469 469
470 // Создание пользователя 470 // Создание пользователя
471 protected function create(array $data) 471 protected function create(array $data)
472 { 472 {
473 $Use = new User(); 473 $Use = new User();
474 $Code_user = $Use->create([ 474 $Code_user = $Use->create([
475 'name' => $data['surname']." ".$data['name_man'], 475 'name' => $data['surname']." ".$data['name_man'],
476 'name_man' => $data['name_man'], 476 'name_man' => $data['name_man'],
477 'surname' => $data['surname'], 477 'surname' => $data['surname'],
478 'surname2' => $data['surname2'], 478 'surname2' => $data['surname2'],
479 'subscribe_email' => $data['email'], 479 'subscribe_email' => $data['email'],
480 'email' => $data['email'], 480 'email' => $data['email'],
481 'telephone' => $data['telephone'], 481 'telephone' => $data['telephone'],
482 'password' => Hash::make($data['password']), 482 'password' => Hash::make($data['password']),
483 'pubpassword' => base64_encode($data['password']), 483 'pubpassword' => base64_encode($data['password']),
484 'email_verified_at' => Carbon::now() 484 'email_verified_at' => Carbon::now()
485 ]); 485 ]);
486 if ($Code_user->id > 0) { 486 if ($Code_user->id > 0) {
487 $Worker = new Worker(); 487 $Worker = new Worker();
488 $Worker->user_id = $Code_user->id; 488 $Worker->user_id = $Code_user->id;
489 $Worker->position_work = $data['job_titles']; 489 $Worker->position_work = $data['job_titles'];
490 $Worker->email = $data['email']; 490 $Worker->email = $data['email'];
491 $Worker->telephone = $data['telephone']; 491 $Worker->telephone = $data['telephone'];
492 $Worker->save(); 492 $Worker->save();
493 493
494 return $Code_user; 494 return $Code_user;
495 } 495 }
496 } 496 }
497 497
498 // Борьба против колорадских жуков, хотя жуков победил все таки 45. 498 // Борьба против колорадских жуков, хотя жуков победил все таки 45.
499 public function colorado(Request $request) { 499 public function colorado(Request $request) {
500 if (isset($_COOKIE['favorite_vac'])) { 500 if (isset($_COOKIE['favorit_vacancy'])) {
501 $items = RusDate::count_vacancy_fav(); 501 $items = RusDate::count_vacancy_fav();
502 $it = $_COOKIE['favorite_vac']; 502 $it = $_COOKIE['favorit_vacancy'];
503 $it = str_replace('"', "", $it); 503 $it = str_replace('"', "", $it);
504 $it = str_replace('[', "", $it); 504 $it = str_replace('[', "", $it);
505 $it = str_replace(']', "", $it); 505 $it = str_replace(']', "", $it);
506 $Arr = explode(",", $it); 506 $Arr = explode(",", $it);
507 } else { 507 } else {
508 $Arr = Array(); 508 $Arr = Array('$0');
509 } 509 }
510 510
511 $Query = Ad_employer::Query(); 511 $Query = Ad_employer::Query();
512 if (count($Arr) > 0) { 512 if (count($Arr) > 0) {
513 $Query = $Query->whereIn('id', $Arr); 513 $Query = $Query->whereIn('id', $Arr);
514 } 514 }
515 $Query = $Query->with('jobs')-> 515 $Query = $Query->with('jobs')->
516 with('cat')-> 516 with('cat')->
517 with('employer')-> 517 with('employer')->
518 whereHas('jobs_code', function ($query) use ($request) { 518 whereHas('jobs_code', function ($query) use ($request) {
519 if ($request->ajax()) { 519 if ($request->ajax()) {
520 if (null !== ($request->get('job'))) { 520 if (null !== ($request->get('job'))) {
521 $query->where('job_title_id', $request->get('job')); 521 $query->where('job_title_id', $request->get('job'));
522 } 522 }
523 } 523 }
524 })->select('ad_employers.*'); 524 })->select('ad_employers.*');
525 525
526 $Job_title = Job_title::query()->OrderBy('name')->get(); 526 $Job_title = Job_title::query()->OrderBy('name')->get();
527 527
528 $Query_count = $Query->count(); 528 $Query_count = $Query->count();
529 529
530 $Query = $Query->OrderBy('updated_at')->paginate(3); 530 $Query = $Query->OrderBy('updated_at')->paginate(3);
531 531
532 return view('workers.favorite', compact('Query', 532 return view('workers.favorite', compact('Query',
533 'Query_count', 533 'Query_count',
534 'Job_title')); 534 'Job_title'));
535 535
536 } 536 }
537 537
538 //Переписка 538 //Переписка
539 public function dialog(User_Model $user1, User_Model $user2) { 539 public function dialog(User_Model $user1, User_Model $user2) {
540 if (isset($user2->id)) { 540 if (isset($user2->id)) {
541 $companion = User_Model::query()->with('workers')-> 541 $companion = User_Model::query()->with('workers')->
542 with('employers')-> 542 with('employers')->
543 where('id', $user2->id)->first(); 543 where('id', $user2->id)->first();
544 } 544 }
545 545
546 $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) { 546 $Messages = Message::query()->with('response')->where(function($query) use ($user1, $user2) {
547 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id); 547 $query->where('user_id', $user1->id)->where('to_user_id', $user2->id);
548 })->orWhere(function($query) use ($user1, $user2) { 548 })->orWhere(function($query) use ($user1, $user2) {
549 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id); 549 $query->where('user_id', $user2->id)->where('to_user_id', $user1->id);
550 })->OrderBy('created_at')->get(); 550 })->OrderBy('created_at')->get();
551 551
552 $id_vac = null; 552 $id_vac = null;
553 foreach ($Messages as $it) { 553 foreach ($Messages as $it) {
554 if (isset($it->response)) { 554 if (isset($it->response)) {
555 foreach ($it->response as $r) { 555 foreach ($it->response as $r) {
556 if (isset($r->ad_employer_id)) { 556 if (isset($r->ad_employer_id)) {
557 $id_vac = $r->ad_employer_id; 557 $id_vac = $r->ad_employer_id;
558 break; 558 break;
559 } 559 }
560 } 560 }
561 } 561 }
562 if (!is_null($id_vac)) break; 562 if (!is_null($id_vac)) break;
563 } 563 }
564 564
565 $ad_employer = null; 565 $ad_employer = null;
566 if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first(); 566 if (!is_null($id_vac)) $ad_employer = Ad_employer::query()->where('id', $id_vac)->first();
567 $sender = $user1; 567 $sender = $user1;
568 568
569 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer')); 569 return view('workers.dialog', compact('companion', 'sender', 'Messages', 'ad_employer'));
570 } 570 }
571 571
572 // Даунылоады 572 // Даунылоады
573 public function download(Worker $worker) { 573 public function download(Worker $worker) {
574 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; 574 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...'];
575 view()->share('house',$arr_house); 575 view()->share('house',$arr_house);
576 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); 576 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape');
577 return $pdf->stream(); 577 return $pdf->stream();
578 } 578 }
579 579
580 // Поднятие анкеты 580 // Поднятие анкеты
581 public function up(Worker $worker) { 581 public function up(Worker $worker) {
582 $worker->updated_at = Carbon::now(); 582 $worker->updated_at = Carbon::now();
583 $worker->save(); 583 $worker->save();
584 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); 584 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных');
585 } 585 }
586 586
587 // Добавление сертификата 587 // Добавление сертификата
588 public function add_serificate(Request $request) { 588 public function add_serificate(Request $request) {
589 $params = $request->all(); 589 $params = $request->all();
590 $params['date_begin'] = date('d.m.Y', strtotime($params['date_begin'])); 590 $params['date_begin'] = date('d.m.Y', strtotime($params['date_begin']));
591 $params['end_begin'] = date('d.m.Y', strtotime($params['end_begin'])); 591 $params['end_begin'] = date('d.m.Y', strtotime($params['end_begin']));
592 $Sertificate = new sertification(); 592 $Sertificate = new sertification();
593 $Sertificate->create($params); 593 $Sertificate->create($params);
594 $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get(); 594 $Docs = sertification::query()->where('worker_id', $request->get('worker_id'))->get();
595 return view('ajax.documents', compact('Docs')); 595 return view('ajax.documents', compact('Docs'));
596 } 596 }
597 597
598 598
599 // Удалить сертификат 599 // Удалить сертификат
600 public function delete_sertificate(sertification $doc) { 600 public function delete_sertificate(sertification $doc) {
601 $doc->delete(); 601 $doc->delete();
602 602
603 return redirect()->route('worker.cabinet'); 603 return redirect()->route('worker.cabinet');
604 } 604 }
605 605
606 // Добавление диплома 606 // Добавление диплома
607 public function add_diplom_ajax(Request $request) { 607 public function add_diplom_ajax(Request $request) {
608 // конец 608 // конец
609 $params = $request->all(); 609 $params = $request->all();
610 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 610 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
611 611
612 if ($count == 0) $dop_info = Dop_info::create($params); 612 if ($count == 0) $dop_info = Dop_info::create($params);
613 $Infoblocks = infobloks::query()->get(); 613 $Infoblocks = infobloks::query()->get();
614 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); 614 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get();
615 $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); 615 $data = Dop_info::query()->where('worker_id', $request->has('worker_id'));
616 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); 616 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker'));
617 } 617 }
618 618
619 // Добавление диплома без ajax 619 // Добавление диплома без ajax
620 public function add_diplom(Worker $worker) { 620 public function add_diplom(Worker $worker) {
621 $worker_id = $worker->id; 621 $worker_id = $worker->id;
622 $Infoblocks = infobloks::query()->get(); 622 $Infoblocks = infobloks::query()->get();
623 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); 623 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks'));
624 } 624 }
625 // Сохранить 625 // Сохранить
626 // Сохраняю диплом 626 // Сохраняю диплом
627 public function add_diplom_save(Request $request) { 627 public function add_diplom_save(Request $request) {
628 $params = $request->all(); 628 $params = $request->all();
629 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 629 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
630 if ($count == 0) $dop_info = Dop_info::create($params); 630 if ($count == 0) $dop_info = Dop_info::create($params);
631 return redirect()->route('worker.cabinet'); 631 return redirect()->route('worker.cabinet');
632 } 632 }
633 633
634 // Добавление стандартного документа 634 // Добавление стандартного документа
635 public function add_document(Worker $worker) { 635 public function add_document(Worker $worker) {
636 return view('workers.docs', compact('worker')); 636 return view('workers.docs', compact('worker'));
637 } 637 }
638 638
639 //Сохранение стандартого документа 639 //Сохранение стандартого документа
640 public function add_document_save(DocumentsRequest $request) { 640 public function add_document_save(DocumentsRequest $request) {
641 $params = $request->all(); 641 $params = $request->all();
642 $place_work = place_works::create($params); 642 $place_work = place_works::create($params);
643 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!'); 643 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно добавили запись!');
644 } 644 }
645 645
646 // Редактирование документа 646 // Редактирование документа
647 public function edit_document(place_works $doc, Worker $worker) { 647 public function edit_document(place_works $doc, Worker $worker) {
648 return view('workers.docs-edit', compact('doc', 'worker')); 648 return view('workers.docs-edit', compact('doc', 'worker'));
649 } 649 }
650 650
651 //Сохранение отредактированного документа 651 //Сохранение отредактированного документа
652 public function edit_document_save(DocumentsRequest $request, place_works $doc) { 652 public function edit_document_save(DocumentsRequest $request, place_works $doc) {
653 $params = $request->all(); 653 $params = $request->all();
654 $doc->update($params); 654 $doc->update($params);
655 655
656 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); 656 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!');
657 } 657 }
658 658
659 // Удаление документа 659 // Удаление документа
660 public function delete_document(place_works $doc) { 660 public function delete_document(place_works $doc) {
661 $doc->delete(); 661 $doc->delete();
662 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); 662 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!');
663 } 663 }
664 664
665 //Отправка нового сообщения 665 //Отправка нового сообщения
666 public function new_message(Request $request) { 666 public function new_message(Request $request) {
667 $params = $request->all(); 667 $params = $request->all();
668 668
669 $id = $params['send_user_id']; 669 $id = $params['send_user_id'];
670 $message = new Message(); 670 $message = new Message();
671 $message->user_id = $params['send_user_id']; 671 $message->user_id = $params['send_user_id'];
672 $message->to_user_id = $params['send_to_user_id']; 672 $message->to_user_id = $params['send_to_user_id'];
673 $message->title = $params['send_title']; 673 $message->title = $params['send_title'];
674 $message->text = $params['send_text']; 674 $message->text = $params['send_text'];
675 if ($request->has('send_file')) { 675 if ($request->has('send_file')) {
676 $message->file = $request->file('send_file')->store("worker/$id", 'public'); 676 $message->file = $request->file('send_file')->store("worker/$id", 'public');
677 } 677 }
678 $message->flag_new = 1; 678 $message->flag_new = 1;
679 $id_message = $message->save(); 679 $id_message = $message->save();
680 680
681 $data['message_id'] = $id_message; 681 $data['message_id'] = $id_message;
682 $data['ad_employer_id'] = $params['send_vacancy']; 682 $data['ad_employer_id'] = $params['send_vacancy'];
683 $data['job_title_id'] = $params['send_job_title_id']; 683 $data['job_title_id'] = $params['send_job_title_id'];
684 $data['flag'] = 1; 684 $data['flag'] = 1;
685 $ad_responce = ad_response::create($data); 685 $ad_responce = ad_response::create($data);
686 return redirect()->route('worker.messages', ['type_message' => 'output']); 686 return redirect()->route('worker.messages', ['type_message' => 'output']);
687 } 687 }
688 688
689 } 689 }
690 690
691 691
resources/views/ajax/list_vacancies.blade.php
1 @if ($Query->count()) 1 @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp
2
2 @foreach ($Query as $Q) 3 @foreach ($Query as $Q)
3 <div class="main__vacancies-item main__employer-page-two-item"> 4 @foreach ($Reclama as $Rec)
4 <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" class="back main__employer-page-two-item-back"> 5 @if ($Rec->position == $i)
5 <svg> 6 <div class="main__vacancies-thing">
6 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 7 @if (!empty($Rec->image))
7 </svg> 8 <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
8 <span> 9 @else
9 Вернуться к списку вакансий 10 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
10 </span> 11 @endif
11 </a> 12 <div class="main__vacancies-thing-body">
12 <div class="main__employer-page-two-item-toper"> 13 <h2>{{ $Rec->title }}</h2>
13 @if (isset($Q->employer)) 14 <div class="main__vacancies-thing-scroll">
14 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}"> 15 {!! $Rec->text !!}
16 </div>
17 <a href="{{ $Rec->link }}" class="button">Узнать больше</a>
18 </div>
19 </div>
15 @endif 20 @endif
16 <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span> 21 @endforeach
17 </div> 22 <div class="main__vacancies-item main__employer-page-two-item">
18 <div class="main__employer-page-two-item-text"> 23
19 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор 24 <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" class="back main__employer-page-two-item-back">
20 специалистов на следующие должности:</div> 25 <svg>
21 <div class="main__employer-page-two-item-text-links"> 26 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
22 @if (isset($Q->jobs)) 27 </svg>
23 @foreach ($Q->jobs as $key => $j) 28 <span>
24 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a> 29 Вернуться к списку вакансий
25 @endforeach 30 </span>
31 </a>
32
33 <div class="main__employer-page-two-item-toper">
34 @if (!empty($Q->employer->logo))
35 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}">
36 @else
37 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
26 @endif 38 @endif
39 <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span>
27 </div> 40 </div>
28 </div> 41
29 <div class="main__employer-page-two-item-text"> 42 <div class="main__employer-page-two-item-text">
30 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 43 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор
31 <div class="main__employer-page-two-item-text-body"> 44 специалистов на следующие должности:</div>
32 {!! $Q->text !!} 45 <div class="main__employer-page-two-item-text-links">
46 @if (isset($Q->jobs))
47 @foreach ($Q->jobs as $key => $j)
48 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a>
49 @endforeach
50 @endif
51 </div>
33 </div> 52 </div>
34 </div> 53
35 <div class="main__employer-page-two-item-text"> 54 <div class="main__employer-page-two-item-text">
36 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div> 55 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
37 <div class="main__employer-page-two-item-text-body"> 56 <div class="main__employer-page-two-item-text-body">
38 {!! $Q->description !!} 57 {!! $Q->text !!}
58 </div>
39 </div> 59 </div>
40 </div> 60 <div class="main__employer-page-two-item-text">
41 <div class="main__employer-page-two-item-text"> 61 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div>
42 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div> 62 <div class="main__employer-page-two-item-text-body">
43 <div class="main__employer-page-two-item-text-body"> 63 {!! $Q->description !!}
44 {!! $Q->contacts_emails !!} 64 </div>
45 </div> 65 </div>
46 </div> 66 <div class="main__employer-page-two-item-text">
47 <div class="main__employer-page-two-item-text"> 67 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div>
48 <div class="main__employer-page-two-item-text-name">Или звоните:</div> 68 <div class="main__employer-page-two-item-text-body">
49 <div class="main__employer-page-two-item-text-body"> 69 {!! $Q->contacts_emails !!}
50 {!! $Q->contacts_telephones !!} 70 </div>
71 </div>
72 <div class="main__employer-page-two-item-text">
73 <div class="main__employer-page-two-item-text-name">Или звоните:</div>
74 <div class="main__employer-page-two-item-text-body">
75 {!! $Q->contacts_telephones !!}
76 </div>
77 </div>
78
79 <div class="main__employer-page-two-item-tags">
80 @if (!empty($Q->jobs_code[0]->position_ship))
81 <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span>
82 @else
83 @if (isset($Q->jobs))
84 @foreach ($Q->jobs as $key => $j)
85 <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span>
86 @endforeach
87 @endif
88 @endif
89 </div>
90 <div class="main__employer-page-two-item-buttons">
91 @guest
92 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
93 class="button main__employer-page-two-item-button">Откликнуться</button>
94 @else
95 @if (App\Classes\StatusUser::Status()==1)
96 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
97 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
98 @else
99 <button type="button" data-fancybox data-src="#send2" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
100 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
101 @endif
102 @endguest
103 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a>
104 </div>
105 <div class="main__employer-page-two-item-bottom">
106 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div>
107 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vacancy_favorites <?=App\Classes\Cookies_vacancy::selected_vacancy($Q->id);?>">
108 <svg>
109 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
110 </svg>
111 </button>
51 </div> 112 </div>
52 </div> 113 </div>
53 <div class="main__employer-page-two-item-tags"> 114 @php $i++ @endphp
54 @if (isset($Q->jobs))
55 @foreach ($Q->jobs as $key => $j)
56 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span>
57 @endforeach
58 @endif
resources/views/block_real.blade.php
1 @php $colors = Array('#F4C4C2', '#FBF1C8', '#ECFDEF', '#F3ECF6', '#ECFDEF'); 1 @php $colors = Array('#F4C4C2', '#FBF1C8', '#ECFDEF', '#F3ECF6', '#ECFDEF');
2 $i = 0; 2 $i = 0;
3 $k = 0; 3 $k = 0;
4 @endphp 4 @endphp
5 @if ($flot->count()) 5 @if ($flot->count())
6 @foreach ($flot as $key => $cat) 6 @foreach ($flot as $key => $cat)
7 @if ($k == 0) 7 @if ($k == 0)
8 <div class="vacancies__list-label">{{ $title }}</div> 8 <div class="vacancies__list-label">{{ $title }}</div>
9 @endif 9 @endif
10 <a href="{{ route('list-vacancies', ['categories' => $cat->id_title]) }}" class="vacancies__item"> 10 <a href="{{ route('list-vacancies', ['job' => $cat->id_title]) }}" class="vacancies__item">
11 <span style="border-color:{{$colors[$i]}}"> 11 <span style="border-color:{{$colors[$i]}}">
12 <b>{{ $cat->name }}</b> 12 <b>{{ $cat->name }}</b>
13 <i>Вакансий: <span>{{ $cat->cnt }}</span></i> 13 <i>Вакансий: <span>{{ $cat->cnt }}</span></i>
14 </span> 14 </span>
15 </a> 15 </a>
16 16
17 @php 17 @php
18 $i++; 18 $i++;
19 $k++; 19 $k++;
20 if ($i > 4) {$i = 0;} 20 if ($i > 4) {$i = 0;}
21 @endphp 21 @endphp
22 @endforeach 22 @endforeach
23 @else 23 @else
24 <div class="vacancies__list-label">{{ $title }}</div> 24 <div class="vacancies__list-label">{{ $title }}</div>
25 <a class="vacancies__item"> 25 <a class="vacancies__item">
26 <span style="border-color:{{$colors[1]}}"> 26 <span style="border-color:{{$colors[1]}}">
27 <b>Тут нет информации</b> 27 <b>Тут нет информации</b>
28 </span> 28 </span>
29 </a> 29 </a>
30 @endif 30 @endif
31 31
resources/views/js/favorite-vacancy-1.blade.php
File was created 1
2 <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
3 <script>
4 console.log('js выполняется...');
5 console.log($.cookie('favorite_vacancy'));
6 console.log('...................');
7
8 $(document).ready(function() {
9 $(document).on('click', '.js_vacancy_favorites', function () {
10 var _this = $(this);
11 var id_worker = _this.attr('data-val');
12
13 console.log('Test test test test test...');
14 console.log('id_worker='+id_worker);
15
16 if (_this.hasClass('active')) {
17 //add_in_array(id_worker);
18 add_new_element(id_worker);
19 console.log('Добавлено в избранное id=' + id_worker);
20 } else {
21 //delete_in_array(id_worker);
22 console.log('Удалено из избранных id='+id_worker)
23 }
24 var str = $.cookie('favorite_vacancy');
25 console.log("Вывод куков "+str);
26
27 });
28 });
29
30 function add_new_element(obj) {
31 var dataArr = $.cookie('favorite_vacancy');//считываем данные из куков
32 var Arr;
33
34 if(dataArr===null){
35 dataArr = JSON.stringify(new Array());
36 }
37
38 console.log('data='+dataArr);
39 Arr = JSON.parse(dataArr);
40 Arr[Arr.length] = obj;
41 $.cookie("favorite_vacancy", JSON.stringify(Arr), '/');
42 }
43
44 function delete_new_element(obj) {
45 var dataArr=$.cookie('favorite_vacancy');//считываем данные из куков
46
47 if(dataArr===null){
48 dataArr = JSON.stringify(new Array());
49 }
50
51 var unique = [...new Set(dataArr)]
52 var index = unique.indexOf(obj);
53
54 unique.splice(index, 1);
55 console.log('Вывод массива='+dataArr);
56 $.cookie("favorite_vacancy", JSON.stringify(index), '/');
57
58 }
59
60 //помеченный элемент
61 function selected_item(obj) {
62 var arr = read_array();
63 var index = arr.indexOf(obj);
64
65 if (index > 0)
66 return "active";
67 else
68 return "";
69 }
70
71 // запись элемента массива в cookie
72 function add_in_array(obj){
73 var arr = read_array();//получаем текущее состояние массива
74 console.log(obj);
75 arr[arr.length]=obj; //добавляем элемент в конец
76 //var str = JSON.stringify(arr);//конвертируем в строку
77 //$.cookie('arr',str);//записываем массив в куки
78 //$.cookie('favorite_vac', JSON.stringify(arr));
79 //console.log(obj);
80 //SetCookie("favorite_vacancy", JSON.stringify(arr), time()+60*60*24*1, '/');
81 }
82
83 // удаление элемента из массива в cookie
84 function delete_in_array(obj) {
85 var arr = read_array();
86 var unique = [...new Set(arr)]
87 var index = unique.indexOf(obj);
88
89 unique.splice(index, 1);
90
91 //var str = JSON.stringify(arr);//конвертируем в строку
92 //$.cookie('arr',str);//записываем массив в куки
93 //$.cookie('favorite_vac', JSON.stringify(unique));
94 SetCookie("favorite_vacancy", JSON.stringify(unique), time()+60*60*24*1, '/');
95
96 }
97
98 function read_array(){
99 var dataArr=$.cookie('favorite_vacancy');//считываем данные из куков
100
101 //если массив не был обнаружен, иницилизируем его
102 if(dataArr===null){
103 dataArr = init_array(); //возвращаем инициализированный пустой маасив
104 }
105 //возвращаем полученный массив
106 //return JSON.parse(dataArr);
107 console.log(dataArr);
108 return JSON.parse(dataArr);
109 }
110
111 //другими словами создаем пустой массив
112 function init_array(){
113 //var str = JSON.stringify(new Array());//конвертируем в строку
114 var str = JSON.stringify(new Array());
115 //$.cookie('favorite_vac',str);//записываем массив в куки
116 //SetCookie("favorite_vacancy", str, time()+60*60*24*1, '/');
117 $.cookie("favorite_vacancy", str);
118 return str;
119 }
120 </script>
121
resources/views/js/favorite-vacancy.blade.php
1
2 <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
1 <script> 3 <script>
4 console.log('js выполняется...');
2 console.log(read_array()); 5 console.log(read_array());
3 $(document).ready(function() { 6 $(document).ready(function() {
4 $(document).on('click', '.js_vacancy_favorites', function () { 7 $(document).on('click', '.js_vacancy_favorites', function () {
5 var _this = $(this); 8 var _this = $(this);
6 var id_worker = _this.attr('data-val'); 9 var id_worker = _this.attr('data-val');
7 10
11 console.log('Test test test test test...');
12 console.log('id_worker='+id_worker);
13
8 if (_this.hasClass('active')) { 14 if (_this.hasClass('active')) {
9 add_in_array(id_worker); 15 add_in_array(id_worker);
10 console.log('Добавлено в избранное id=' + id_worker); 16 console.log('Добавлено в избранное id=' + id_worker);
11 } else { 17 } else {
12 delete_in_array(id_worker); 18 delete_in_array(id_worker);
13 console.log('Удалено из избранных id='+id_worker) 19 console.log('Удалено из избранных id='+id_worker)
14 } 20 }
15 var str = $.cookie('favorite_vacancy'); 21 var str = $.cookie('favorit_vacancy');
16 console.log("Вывод куков "+str); 22 console.log("Вывод куков "+str);
17 23
18 }); 24 });
19 }); 25 });
20 26
21 //помеченный элемент 27 //помеченный элемент
22 function selected_item(obj) { 28 function selected_item(obj) {
23 var arr = read_array(); 29 var arr = read_array();
24 var index = arr.indexOf(obj); 30 var index = arr.indexOf(obj);
25 31
26 if (index > 0) 32 if (index > 0)
27 return "active"; 33 return "active";
28 else 34 else
29 return ""; 35 return "";
30 } 36 }
31 37
32 // запись элемента массива в cookie 38 // запись элемента массива в cookie
33 function add_in_array(obj){ 39 function add_in_array(obj){
34 var arr = read_array();//получаем текущее состояние массива 40 var arr = read_array();//получаем текущее состояние массива
35 arr[arr.length]=obj; //добавляем элемент в конец 41 arr[arr.length]=obj; //добавляем элемент в конец
36 //var str = JSON.stringify(arr);//конвертируем в строку 42 //var str = JSON.stringify(arr);//конвертируем в строку
37 //$.cookie('arr',str);//записываем массив в куки 43 //$.cookie('arr',str);//записываем массив в куки
38 //$.cookie('favorite_vac', JSON.stringify(arr)); 44 //$.cookie('favorite_vac', JSON.stringify(arr));
39 SetCookie("favorite_vacancy", JSON.stringify(arr), time()+60*60*24*1, '/'); 45 console.log(arr);
46 $.cookie("favorit_vacancy", JSON.stringify(arr), { expires: 360, path: '/' });
40 47
41 } 48 }
42 49
43 // удаление элемента из массива в cookie 50 // удаление элемента из массива в cookie
44 function delete_in_array(obj) { 51 function delete_in_array(obj) {
45 var arr = read_array(); 52 var arr = read_array();
46 var unique = [...new Set(arr)] 53 var unique = [...new Set(arr)]
47 var index = unique.indexOf(obj); 54 var index = unique.indexOf(obj);
48 55
49 unique.splice(index, 1); 56 unique.splice(index, 1);
50 57
51 //var str = JSON.stringify(arr);//конвертируем в строку 58 //var str = JSON.stringify(arr);//конвертируем в строку
52 //$.cookie('arr',str);//записываем массив в куки 59 //$.cookie('arr',str);//записываем массив в куки
53 //$.cookie('favorite_vac', JSON.stringify(unique)); 60 //$.cookie('favorite_vac', JSON.stringify(unique));
54 SetCookie("favorite_vacancy", JSON.stringify(unique), time()+60*60*24*1, '/'); 61 $.cookie("favorit_vacancy", JSON.stringify(unique), { expires: 360, path: '/' });
55 62
56 } 63 }
57 64
58 function read_array(){ 65 function read_array(){
66 // у-тв-арь
59 var dataArr=$.cookie('favorite_vacancy');//считываем данные из куков 67 var dataArr=$.cookie('favorite_vacancy');//считываем данные из куков
60 68
61 //если массив не был обнаружен, иницилизируем его 69 //если массив не был обнаружен, иницилизируем его
62 if(dataArr===null){ 70 if(dataArr===undefined) {
63 dataArr = init_array(); //возвращаем инициализированный пустой маасив 71 dataArr = init_array(); //возвращаем инициализированный пустой маасив
64 } 72 }
65 //возвращаем полученный массив 73 //возвращаем полученный массив
66 //return JSON.parse(dataArr); 74 //return JSON.parse(dataArr);
67 return JSON.parse(dataArr); 75 return JSON.parse(dataArr);
68 } 76 }
69 77
70 //другими словами создаем пустой массив 78 //другими словами создаем пустой массив
71 function init_array(){ 79 function init_array(){
72 //var str = JSON.stringify(new Array());//конвертируем в строку 80 //var str = JSON.stringify(new Array());//конвертируем в строку
73 var str = JSON.stringify(new Array()); 81 var str = JSON.stringify(new Array());
74 //$.cookie('favorite_vac',str);//записываем массив в куки 82 //$.cookie('favorite_vac',str);//записываем массив в куки
75 SetCookie("favorite_vacancy", str, time()+60*60*24*1, '/'); 83 $.cookie("favorit_vacancy", str, { expires: 360, path: '/' });
76 return str; 84 return str;
77 } 85 }
86
78 </script> 87 </script>
79 88
resources/views/layout/frontend.blade.php
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> 2 <html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
3 3
4 <head> 4 <head>
5 <meta charset="utf-8"> 5 <meta charset="utf-8">
6 <title>{{ $title }}</title> 6 <title>{{ $title }}</title>
7 <meta name="viewport" content="width=device-width,initial-scale=1"> 7 <meta name="viewport" content="width=device-width,initial-scale=1">
8 <meta name="theme-color" content="#377D87"> 8 <meta name="theme-color" content="#377D87">
9 <script src="{{ asset('js/jquery.js') }}"></script> 9 <script src="{{ asset('js/jquery.js') }}"></script>
10 <script type="text/javascript" src="{{ asset('js/jquery.cookie.js') }}"></script> 10 <!--<script type="text/javascript" src=" asset('js/jquery.cookie.js') }}"></script>-->
11 <link rel="stylesheet" href="{{ asset('css/style_21march.css') }}"> 11 <link rel="stylesheet" href="{{ asset('css/style_21march.css') }}">
12 <link rel="stylesheet" href="{{ asset('css/star-rating.min.css') }}"> 12 <link rel="stylesheet" href="{{ asset('css/star-rating.min.css') }}">
13 <style> 13 <style>
14 .err_red { 14 .err_red {
15 border: red 2px solid; 15 border: red 2px solid;
16 } 16 }
17 </style> 17 </style>
18 </head> 18 </head>
19 19
20 <body id="body"> 20 <body id="body">
21 <a href="#body" class="to-top js-scroll-to"> 21 <a href="#body" class="to-top js-scroll-to">
22 <svg> 22 <svg>
23 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> 23 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use>
24 </svg> 24 </svg>
25 </a> 25 </a>
26 26
27 <div> <!-- BEGIN TOP WRAPPER --> 27 <div> <!-- BEGIN TOP WRAPPER -->
28 <header class="header"> 28 <header class="header">
29 <div class="container"> 29 <div class="container">
30 <div class="header__body"> 30 <div class="header__body">
31 <div class="header__left"> 31 <div class="header__left">
32 <a href="{{ route('index') }}" class="header__logo"> 32 <a href="{{ route('index') }}" class="header__logo">
33 <svg> 33 <svg>
34 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> 34 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use>
35 </svg> 35 </svg>
36 </a> 36 </a>
37 <nav class="header__menu"> 37 <nav class="header__menu">
38 <a href="{{ route('vacancies') }}" class="header__menu-item">Вакансии</a> 38 <a href="{{ route('vacancies') }}" class="header__menu-item">Вакансии</a>
39 <a href="{{ route('shipping_companies') }}" class="header__menu-item">Судоходные компании</a> 39 <a href="{{ route('shipping_companies') }}" class="header__menu-item">Судоходные компании</a>
40 <a href="{{ route('education') }}" class="header__menu-item">Образование</a> 40 <a href="{{ route('education') }}" class="header__menu-item">Образование</a>
41 </nav> 41 </nav>
42 </div> 42 </div>
43 <div class="header__right"> 43 <div class="header__right">
44 @guest 44 @guest
45 45
46 @else 46 @else
47 <a href="@if ($UserId->is_worker) {{ route('worker.cabinet') }} @else {{ route('employer.cabinet') }} @endif" class="header__notifs header__notifs_actived"> 47 <a href="@if ($UserId->is_worker) {{ route('worker.cabinet') }} @else {{ route('employer.cabinet') }} @endif" class="header__notifs header__notifs_actived">
48 <svg> 48 <svg>
49 <use xlink:href="{{ asset('images/sprite.svg#ring') }}"></use> 49 <use xlink:href="{{ asset('images/sprite.svg#ring') }}"></use>
50 </svg> 50 </svg>
51 <span>Уведомления</span> 51 <span>Уведомления</span>
52 </a> 52 </a>
53 53
54 @endguest 54 @endguest
55 <div class="header__right-line"></div> 55 <div class="header__right-line"></div>
56 <button class="header__burger"> 56 <button class="header__burger">
57 <svg> 57 <svg>
58 <use xlink:href="{{ asset('images/sprite.svg#burger') }}"></use> 58 <use xlink:href="{{ asset('images/sprite.svg#burger') }}"></use>
59 </svg> 59 </svg>
60 </button> 60 </button>
61 @guest 61 @guest
62 <a class="button header__sign" data-fancybox data-src="#sign" data-options='{"touch":false,"autoFocus":false}'>Войти</a> 62 <a class="button header__sign" data-fancybox data-src="#sign" data-options='{"touch":false,"autoFocus":false}'>Войти</a>
63 @else 63 @else
64 <a class="button header__sign" href="{{ route('logout') }}">Выйти</a> 64 <a class="button header__sign" href="{{ route('logout') }}">Выйти</a>
65 @endguest 65 @endguest
66 </div> 66 </div>
67 </div> 67 </div>
68 </div> 68 </div>
69 </header> 69 </header>
70 @yield('content') 70 @yield('content')
71 </div> <!-- END TOP WRAPPER --> 71 </div> <!-- END TOP WRAPPER -->
72 72
73 <div> <!-- BEGIN BOTTOM WRAPPER --> 73 <div> <!-- BEGIN BOTTOM WRAPPER -->
74 <footer class="footer"> 74 <footer class="footer">
75 <div class="container"> 75 <div class="container">
76 <div class="footer__mobile"> 76 <div class="footer__mobile">
77 77
78 <button class="footer__mobile-toper js-toggle active"> 78 <button class="footer__mobile-toper js-toggle active">
79 <a href="{{ route('index') }}"> 79 <a href="{{ route('index') }}">
80 <svg> 80 <svg>
81 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> 81 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use>
82 </svg> 82 </svg>
83 </a> 83 </a>
84 <span> 84 <span>
85 <svg> 85 <svg>
86 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> 86 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use>
87 </svg> 87 </svg>
88 </span> 88 </span>
89 </button> 89 </button>
90 <div class="footer__mobile-menu"> 90 <div class="footer__mobile-menu">
91 <div class="footer__mobile-menu-item"> 91 <div class="footer__mobile-menu-item">
92 <button class="js-toggle"> 92 <button class="js-toggle">
93 <b>Соискателям</b> 93 <b>Соискателям</b>
94 <span><svg> 94 <span><svg>
95 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> 95 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use>
96 </svg></span> 96 </svg></span>
97 </button> 97 </button>
98 <div> 98 <div>
99 <a href="{{ route('vacancies') }}">Вакансии</a> 99 <a href="{{ route('vacancies') }}">Вакансии</a>
100 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a> 100 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>
101 <a href="{{ route('education') }}">Образование</a> 101 <a href="{{ route('education') }}">Образование</a>
102 <a href="{{ route('news') }}">Новости</a> 102 <a href="{{ route('news') }}">Новости</a>
103 <a href="{{ route('contacts') }}">Контакты</a> 103 <a href="{{ route('contacts') }}">Контакты</a>
104 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a> 104 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a>
105 </div> 105 </div>
106 </div> 106 </div>
107 <div class="footer__mobile-menu-item"> 107 <div class="footer__mobile-menu-item">
108 <button class="js-toggle"> 108 <button class="js-toggle">
109 <b>Работодателям</b> 109 <b>Работодателям</b>
110 <span><svg> 110 <span><svg>
111 <use xlink:href="{{asset('images/sprite.svg#arrow-top') }}"></use> 111 <use xlink:href="{{asset('images/sprite.svg#arrow-top') }}"></use>
112 </svg></span> 112 </svg></span>
113 </button> 113 </button>
114 <div> 114 <div>
115 <a href="{{ route('register') }}">Регистрация</a> 115 <a href="{{ route('register') }}">Регистрация</a>
116 <a href="{{ route('bd_resume') }}">База резюме</a> 116 <a href="{{ route('bd_resume') }}">База резюме</a>
117 <a href="{{ route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a> 117 <a href="{{ route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a>
118 <a href="{{ route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a> 118 <a href="{{ route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a>
119 <a href="{{ route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a> 119 <a href="{{ route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a>
120 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a> 120 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a>
121 </div> 121 </div>
122 </div> 122 </div>
123 </div> 123 </div>
124 <div class="footer__mobile-contacts"> 124 <div class="footer__mobile-contacts">
125 <b>Контакты</b> 125 <b>Контакты</b>
126 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a> 126 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a>
127 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a> 127 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a>
128 </div> 128 </div>
129 <div class="footer__mobile-bottom"> 129 <div class="footer__mobile-bottom">
130 <div class="socials"> 130 <div class="socials">
131 <a href="{{ $companies[0]->vkontact }}" target="_blank"> 131 <a href="{{ $companies[0]->vkontact }}" target="_blank">
132 <svg> 132 <svg>
133 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> 133 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use>
134 </svg> 134 </svg>
135 </a> 135 </a>
136 <a href="{{ $companies[0]->telegram }}" target="_blank"> 136 <a href="{{ $companies[0]->telegram }}" target="_blank">
137 <svg> 137 <svg>
138 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> 138 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use>
139 </svg> 139 </svg>
140 </a> 140 </a>
141 </div> 141 </div>
142 <nav class="footer__mobile-links"> 142 <nav class="footer__mobile-links">
143 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a> 143 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a>
144 <span></span> 144 <span></span>
145 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a> 145 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a>
146 </nav> 146 </nav>
147 &copy; 2023 &mdash; RekaMore.su 147 &copy; 2023 &mdash; RekaMore.su
148 <a href="{{ route('index') }}" class="nls" target="_blank"> 148 <a href="{{ route('index') }}" class="nls" target="_blank">
149 <svg> 149 <svg>
150 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use> 150 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use>
151 </svg> 151 </svg>
152 <span> 152 <span>
153 Дизайн и разработка: 153 Дизайн и разработка:
154 <b>NoLogoStudio.ru</b> 154 <b>NoLogoStudio.ru</b>
155 </span> 155 </span>
156 </a> 156 </a>
157 </div> 157 </div>
158 </div> 158 </div>
159 <div class="footer__main"> 159 <div class="footer__main">
160 <div class="footer__main-body"> 160 <div class="footer__main-body">
161 161
162 <a href="" class="footer__main-logo"> 162 <a href="" class="footer__main-logo">
163 <svg> 163 <svg>
164 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> 164 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use>
165 </svg> 165 </svg>
166 </a> 166 </a>
167 <div class="footer__main-col"> 167 <div class="footer__main-col">
168 <div class="footer__main-title">Соискателям</div> 168 <div class="footer__main-title">Соискателям</div>
169 <nav> 169 <nav>
170 <a href="{{ route('vacancies') }}">Вакансии</a> 170 <a href="{{ route('vacancies') }}">Вакансии</a>
171 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a> 171 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>
172 <a href="{{ route('education') }}">Образование</a> 172 <a href="{{ route('education') }}">Образование</a>
173 <a href="{{ route('news') }}">Новости</a> 173 <a href="{{ route('news') }}">Новости</a>
174 <a href="{{ route('contacts') }}">Контакты</a> 174 <a href="{{ route('contacts') }}">Контакты</a>
175 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a> 175 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a>
176 </nav> 176 </nav>
177 </div> 177 </div>
178 <div class="footer__main-col"> 178 <div class="footer__main-col">
179 <div class="footer__main-title">Работодателям</div> 179 <div class="footer__main-title">Работодателям</div>
180 <nav> 180 <nav>
181 <a href="{{ route('register') }}">Регистрация</a> 181 <a href="{{ route('register') }}">Регистрация</a>
182 <a href="{{ route('bd_resume') }}">База резюме</a> 182 <a href="{{ route('bd_resume') }}">База резюме</a>
183 <a href="{{ route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a> 183 <a href="{{ route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a>
184 <a href="{{ route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a> 184 <a href="{{ route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a>
185 <a href="{{ route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a> 185 <a href="{{ route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a>
186 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a> 186 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a>
187 </nav> 187 </nav>
188 </div> 188 </div>
189 189
190 <div class="footer__main-col"> 190 <div class="footer__main-col">
191 <div class="footer__main-title">Контакты</div> 191 <div class="footer__main-title">Контакты</div>
192 <div class="footer__main-contacts"> 192 <div class="footer__main-contacts">
193 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a> 193 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a>
194 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a> 194 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a>
195 </div> 195 </div>
196 <div class="socials"> 196 <div class="socials">
197 <a href="{{ $companies[0]->vkontact }}" target="_blank"> 197 <a href="{{ $companies[0]->vkontact }}" target="_blank">
198 <svg> 198 <svg>
199 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> 199 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use>
200 </svg> 200 </svg>
201 </a> 201 </a>
202 <a href="{{ $companies[0]->telegram }}" target="_blank"> 202 <a href="{{ $companies[0]->telegram }}" target="_blank">
203 <svg> 203 <svg>
204 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> 204 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use>
205 </svg> 205 </svg>
206 </a> 206 </a>
207 </div> 207 </div>
208 </div> 208 </div>
209 </div> 209 </div>
210 210
211 <div class="footer__main-copy"> 211 <div class="footer__main-copy">
212 <div>&copy; 2023 &mdash; RekaMore.su</div> 212 <div>&copy; 2023 &mdash; RekaMore.su</div>
213 <nav> 213 <nav>
214 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a> 214 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a>
215 <span></span> 215 <span></span>
216 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a> 216 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a>
217 </nav> 217 </nav>
218 <div> @if (isset($_COOKIE['favorite_vacancy'])) Куки вакансий: {{ print_r($_COOKIE['favorite_vacancy']) }} @endif</div>
218 <a href="{{ route('index') }}" class="nls" target="_blank"> 219 <a href="{{ route('index') }}" class="nls" target="_blank">
219 <svg> 220 <svg>
220 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use> 221 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use>
221 </svg> 222 </svg>
222 <span> 223 <span>
223 Дизайн и разработка: 224 Дизайн и разработка:
224 <b>NoLogoStudio.ru</b> 225 <b>NoLogoStudio.ru</b>
225 </span> 226 </span>
226 </a> 227 </a>
227 </div> 228 </div>
228 </div> 229 </div>
229 </div> 230 </div>
230 </footer> 231 </footer>
231 </div> <!-- END BOTTOM WRAPPER --> 232 </div> <!-- END BOTTOM WRAPPER -->
232 233
233 <div hidden> <!-- BEGIN MODALS WRAPPER --> 234 <div hidden> <!-- BEGIN MODALS WRAPPER -->
234 <!-- Соискатель отправляет сообщение работодателю --> 235 <!-- Соискатель отправляет сообщение работодателю -->
235 @include('modals.send_worker_new') 236 @include('modals.send_worker_new')
236 237
237 <!-- Работодатель отправляет сообщение соискателю --> 238 <!-- Работодатель отправляет сообщение соискателю -->
238 @include('modals.send_employer_new') 239 @include('modals.send_employer')
239 240
240 <!-- Сообщение-предупреждение о том, что сообщения только можно отправить авторизованным пользователям --> 241 <!-- Сообщение-предупреждение о том, что сообщения только можно отправить авторизованным пользователям -->
241 @include('modals.send_message_noaut') 242 @include('modals.send_message_noaut')
242 243
243 @include('modals.send_message_noaut2') 244 @include('modals.send_message_noaut2')
244 245
245 <!-- Форма авторизации --> 246 <!-- Форма авторизации -->
246 @include('modals.send_login') 247 @include('modals.send_login')
247 248
248 <!-- Сбросить пароль --> 249 <!-- Сбросить пароль -->
249 @include('modals.reset_password') 250 @include('modals.reset_password')
250 251
251 <!-- Регистрация --> 252 <!-- Регистрация -->
252 @include('modals.register') 253 @include('modals.register')
253 254
254 <!-- Благодарность по отправке сообщения работодателю --> 255 <!-- Благодарность по отправке сообщения работодателю -->
255 @include('modals.thank_you_send_employer') 256 @include('modals.thank_you_send_employer')
256 257
257 <!-- Благодарность по отправке сообщения менеджеру --> 258 <!-- Благодарность по отправке сообщения менеджеру -->
258 @include('modals.thank_you_send_manager') 259 @include('modals.thank_you_send_manager')
259 260
260 <!-- Благодарность после регистрации --> 261 <!-- Благодарность после регистрации -->
261 @include('modals.thank_you_send_for_employer') 262 @include('modals.thank_you_send_for_employer')
262 263
263 <!-- Благодарность после регистрации для работника --> 264 <!-- Благодарность после регистрации для работника -->
264 @include('modals.thank_you_send_for_worker') 265 @include('modals.thank_you_send_for_worker')
265 266
266 <!-- Подтверждение удаления профиля --> 267 <!-- Подтверждение удаления профиля -->
267 @include('modals.delete_profile') 268 @include('modals.delete_profile')
268 269
269 <!-- Подверждение об удалении профиля --> 270 <!-- Подверждение об удалении профиля -->
270 @include('modals.success_delete_profile') 271 @include('modals.success_delete_profile')
271 272
272 </div> <!-- END MODALS WRAPPER --> 273 </div> <!-- END MODALS WRAPPER -->
273 274
274 275
275 <script src="{{ asset('js/jquery.maskedinput.js') }}"></script> 276 <script src="{{ asset('js/jquery.maskedinput.js') }}"></script>
276 <script src="{{ asset('js/jquery.fancybox.js') }}"></script> 277 <script src="{{ asset('js/jquery.fancybox.js') }}"></script>
277 <script src="{{ asset('js/jquery.select2.js') }}"></script> 278 <script src="{{ asset('js/jquery.select2.js') }}"></script>
278 <script src="{{ asset('js/swiper.js') }}"></script> 279 <script src="{{ asset('js/swiper.js') }}"></script>
279 <script src="{{ asset('js/script.js') }}"></script> 280 <script src="{{ asset('js/script.js') }}"></script>
280 <script src="{{ asset('js/star-rating.min.js') }}"></script> 281 <script src="{{ asset('js/star-rating.min.js') }}"></script>
281 <script> 282 <script>
282 var getUrlParameter = function getUrlParameter(sParam) { 283 var getUrlParameter = function getUrlParameter(sParam) {
283 var sPageURL = decodeURIComponent(window.location.search.substring(1)), 284 var sPageURL = decodeURIComponent(window.location.search.substring(1)),
284 sURLVariables = sPageURL.split('&'), 285 sURLVariables = sPageURL.split('&'),
285 sParameterName, 286 sParameterName,
286 i; 287 i;
287 for (i = 0; i < sURLVariables.length; i++) { 288 for (i = 0; i < sURLVariables.length; i++) {
288 sParameterName = sURLVariables[i].split('='); 289 sParameterName = sURLVariables[i].split('=');
289 if (sParameterName[0] === sParam) { 290 if (sParameterName[0] === sParam) {
290 return sParameterName[1] === undefined ? true : sParameterName[1]; 291 return sParameterName[1] === undefined ? true : sParameterName[1];
291 } 292 }
292 } 293 }
293 }; 294 };
294 </script> 295 </script>
295 @yield('scripts') 296 @yield('scripts')
296 297
297 @include('js.modals') 298 @include('js.modals')
298 </body> 299 </body>
299 </html> 300 </html>
300 301
resources/views/list_vacancies.blade.php
1 @php 1 @php
2 use App\Classes\StatusUser; 2 use App\Classes\StatusUser;
3 @endphp 3 @endphp
4 4
5 @extends('layout.frontend', ['title' => 'Вакансии РекаМоре']) 5 @extends('layout.frontend', ['title' => 'Вакансии РекаМоре'])
6 6
7 @section('scripts') 7 @section('scripts')
8 <script> 8 <script>
9 console.log('Test system'); 9 console.log('Test system');
10 $(document).on('change', '#jobs', function() { 10 $(document).on('change', '#jobs', function() {
11 var val = $(this).val(); 11 var val = $(this).val();
12 var main_oskar = $('#main_ockar'); 12 var main_oskar = $('#main_ockar');
13 var ti_head = $('#title_head'); 13 var ti_head = $('#title_head');
14 14
15 console.log('Code='+val); 15 console.log('Code='+val);
16 console.log('Click change...'); 16 console.log('Click change...');
17 $.ajax({ 17 $.ajax({
18 type: "GET", 18 type: "GET",
19 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", 19 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}",
20 data: "job="+val, 20 data: "job="+val,
21 success: function (data) { 21 success: function (data) {
22 console.log('Выбор сделан!'); 22 console.log('Выбор сделан!');
23 23
24 main_oskar.html(data); 24 main_oskar.html(data);
25 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?sort="+val+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 25 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?job="+val+"@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
26 }, 26 },
27 headers: { 27 headers: {
28 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 28 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
29 }, 29 },
30 error: function (data) { 30 error: function (data) {
31 data = JSON.stringify(data); 31 data = JSON.stringify(data);
32 console.log('Error: ' + data); 32 console.log('Error: ' + data);
33 } 33 }
34 }); 34 });
35 35
36 if ((val == '') || (val == '0')) { 36 if ((val == '') || (val == '0')) {
37 title_head.html('Все категории'); 37 title_head.html('Все категории');
38 } else { 38 } else {
39 $.ajax({ 39 $.ajax({
40 type: "GET", 40 type: "GET",
41 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", 41 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}?@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif",
42 data: "job=" + val +"&title=1", 42 data: "job=" + val +"&title=1",
43 success: function (data) { 43 success: function (data) {
44 44
45 console.log(data); 45 console.log(data);
46 }, 46 },
47 47
48 headers: { 48 headers: {
49 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 49 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
50 }, 50 },
51 51
52 error: function (data) { 52 error: function (data) {
53 data = JSON.stringify(data); 53 data = JSON.stringify(data);
54 console.log('Error: ' + data); 54 console.log('Error: ' + data);
55 } 55 }
56 }); 56 });
57 57
58 } 58 }
59 }); 59 });
60 60
61 $(document).on('click', '.js_send_it_button', function() { 61 $(document).on('click', '.js_send_it_button', function() {
62 var this_ = $(this); 62 var this_ = $(this);
63 var code_user_id = this_.attr('data-uid'); 63 var code_user_id = this_.attr('data-uid');
64 var code_to_user_id = this_.attr('data-tuid'); 64 var code_to_user_id = this_.attr('data-tuid');
65 var code_vacancy = this_.attr('data-vacancy'); 65 var code_vacancy = this_.attr('data-vacancy');
66 var user_id = $('#_user_id'); 66 var user_id = $('#_user_id');
67 var to_user_id = $('#_to_user_id'); 67 var to_user_id = $('#_to_user_id');
68 var vacancy = $('#_vacancy'); 68 var vacancy = $('#_vacancy');
69 69
70 console.log('Клик на кнопки...'); 70 console.log('Клик на кнопки...');
71 71
72 user_id.val(code_user_id); 72 user_id.val(code_user_id);
73 to_user_id.val(code_to_user_id); 73 to_user_id.val(code_to_user_id);
74 vacancy.val(code_vacancy); 74 vacancy.val(code_vacancy);
75 }); 75 });
76 76
77 $(document).on('change', '#sort_ajax', function() { 77 $(document).on('change', '#sort_ajax', function() {
78 var this_ = $(this); 78 var this_ = $(this);
79 var val_ = this_.val(); 79 var val_ = this_.val();
80 console.log('sort items '+val_); 80 console.log('sort items '+val_);
81 81
82 $.ajax({ 82 $.ajax({
83 type: "GET", 83 type: "GET",
84 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", 84 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}",
85 data: "sort="+val_+"&block=1", 85 data: "sort="+val_+"&block=1",
86 success: function (data) { 86 success: function (data) {
87 console.log('Выбор сортировки'); 87 console.log('Выбор сортировки');
88 console.log(data); 88 console.log(data);
89 $('#main_ockar').html(data); 89 $('#main_ockar').html(data);
90 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 90 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?sort="+val_+"@if (isset($_GET['job']))&job={{ $_GET['job'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
91 }, 91 },
92 headers: { 92 headers: {
93 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 93 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
94 }, 94 },
95 error: function (data) { 95 error: function (data) {
96 data = JSON.stringify(data); 96 data = JSON.stringify(data);
97 console.log('Error: ' + data); 97 console.log('Error: ' + data);
98 } 98 }
99 }); 99 });
100 }); 100 });
101 101
102 102
103 103
104 $(document).ready(function(){ 104 $(document).ready(function(){
105 var sel = $('#select2-sort_ajax-container'); 105 var sel = $('#select2-sort_ajax-container');
106 var key = getUrlParameter('sort'); 106 var key = getUrlParameter('sort');
107 console.log(sel); 107 console.log(sel);
108 console.log(key); 108 console.log(key);
109 109
110 if (key !=='') { 110 if (key !=='') {
111 console.log(key); 111 console.log(key);
112 switch (key) { 112 switch (key) {
113 case "default": sel.html('Сортировка (по умолчанию)'); break; 113 case "default": sel.html('Сортировка (по умолчанию)'); break;
114 case "name_up": sel.html('По имени (возрастание)'); break; 114 case "name_up": sel.html('По имени (возрастание)'); break;
115 case "name_down": sel.html('По дате (убывание)'); break; 115 case "name_down": sel.html('По дате (убывание)'); break;
116 case "created_at_up": sel.html('По дате (возрастание)'); break; 116 case "created_at_up": sel.html('По дате (возрастание)'); break;
117 case "created_at_down": sel.html('По дате (убывание)'); break; 117 case "created_at_down": sel.html('По дате (убывание)'); break;
118 } 118 }
119 119
120 } 120 }
121 }); 121 });
122 </script> 122 </script>
123 @include('js.favorite-vacancy') 123 @include('js.favorite-vacancy')
124 @endsection 124 @endsection
125 @section('content') 125 @section('content')
126 <section class="thing"> 126 <section class="thing">
127 <div class="container"> 127 <div class="container">
128 <form class="thing__body" action="{{ route('list-vacancies', ['categories' => $Name_categori[0]->id]) }}" method="POST"> 128 <form class="thing__body" action="{{ route('list-vacancies', ['categories' => (!empty($Name_categori)) ? $Name_categori[0]->id : '0']) }}" method="POST">
129 <ul class="breadcrumbs thing__breadcrumbs"> 129 <ul class="breadcrumbs thing__breadcrumbs">
130 <li><a href="{{ route('index') }}">Главная</a></li> 130 <li><a href="{{ route('index') }}">Главная</a></li>
131 <li><a href="{{ route('vacancies') }}">Вакансии</a></li> 131 <li><a href="{{ route('vacancies') }}">Вакансии</a></li>
132 <li><b>{{ isset($Name_categori[0]) ? $Name_categori[0]->name : 'Все категории' }}</b></li> 132 <li><b>{{ isset($Name_categori[0]) ? $Name_categori[0]->name : 'Все категории' }}</b></li>
133 </ul> 133 </ul>
134 <h1 class="thing__title">Вакансии</h1> 134 <h1 class="thing__title">Вакансии</h1>
135 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для 135 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для
136 существующих финансовых и административных условий.</p> 136 существующих финансовых и административных условий.</p>
137 <div class="select select_search thing__select"> 137 <div class="select select_search thing__select">
138 <div class="select__icon"> 138 <div class="select__icon">
139 <svg> 139 <svg>
140 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 140 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
141 </svg> 141 </svg>
142 </div> 142 </div>
143 <select class="js-select2" id="jobs" name="jobs"> 143 <select class="js-select2" id="jobs" name="jobs">
144 <option value="0" selected>Выберите должность</option> 144 <option value="0" selected>Выберите должность</option>
145 @if ($Job_title->count()) 145 @if ($Job_title->count())
146 @foreach($Job_title as $JT) 146 @foreach($Job_title as $JT)
147 <option value="{{ $JT->id }}">{{ $JT->name }}</option> 147 <option value="{{ $JT->id }}">{{ $JT->name }}</option>
148 @endforeach 148 @endforeach
149 @endif 149 @endif
150 </select> 150 </select>
151 </div> 151 </div>
152 </form> 152 </form>
153 </div> 153 </div>
154 </section> 154 </section>
155 <main class="main"> 155 <main class="main">
156 <div class="container"> 156 <div class="container">
157 <div class="main__vacancies" > 157 <div class="main__vacancies" >
158 @if (isset($Name_categori[0]->name)) 158 @if (isset($Name_categori[0]->name))
159 <h2 class="main__vacancies-title">Категория вакансий {{ $Name_categori[0]->name }}</h2> 159 <h2 class="main__vacancies-title">Категория вакансий {{ $Name_categori[0]->name }}</h2>
160 @else 160 @else
161 <h2 class="main__vacancies-title" id="title_head" name="title_head">Все категории</h2> 161 <h2 class="main__vacancies-title" id="title_head" name="title_head">Все категории</h2>
162 @endif 162 @endif
163 <div class="filters main__vacancies-filters"> 163 <div class="filters main__vacancies-filters">
164 <div class="filters__label" id="col-vo" name="col-vo">Показано @if ($Query_count < 3) {{$Query_count}} @else 3 @endif из @isset($Query_count) {{ $Query_count }} @else 0 @endisset результатов поиска</div> 164 <div class="filters__label" id="col-vo" name="col-vo">Показано @if ($Query_count < 3) {{$Query_count}} @else 3 @endif из @isset($Query_count) {{ $Query_count }} @else 0 @endisset результатов поиска</div>
165 <div class="filters__body"> 165 <div class="filters__body">
166 <div class="select filters__select"> 166 <div class="select filters__select">
167 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 167 <select class="js-select2" id="sort_ajax" name="sort_ajax">
168 <option value="default">Сортировка (по умолчанию)</option> 168 <option value="default">Сортировка (по умолчанию)</option>
169 <option value="name_up">По имени (возрастание)</option> 169 <option value="name_up">По имени (возрастание)</option>
170 <option value="name_down">По имени (убывание)</option> 170 <option value="name_down">По имени (убывание)</option>
171 <option value="created_at_up">По дате (возрастание)</option> 171 <option value="created_at_up">По дате (возрастание)</option>
172 <option value="created_at_down">По дате (убывание)</option> 172 <option value="created_at_down">По дате (убывание)</option>
173 </select> 173 </select>
174 </div> 174 </div>
175 </div> 175 </div>
176 </div> 176 </div>
177 177
178 <div class="main__vacancies" style="width:100%;" id="main_ockar" name="main_oskar"> 178 <div class="main__vacancies" style="width:100%;" id="main_ockar" name="main_oskar">
179 @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp 179 @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp
180 180
181 @foreach ($Query as $Q) 181 @foreach ($Query as $Q)
182 @foreach ($Reclama as $Rec) 182 @foreach ($Reclama as $Rec)
183 @if ($Rec->position == $i) 183 @if ($Rec->position == $i)
184 <div class="main__vacancies-thing"> 184 <div class="main__vacancies-thing">
185 @if (!empty($Rec->image)) 185 @if (!empty($Rec->image))
186 <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 186 <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
187 @else 187 @else
188 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 188 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
189 @endif 189 @endif
190 <div class="main__vacancies-thing-body"> 190 <div class="main__vacancies-thing-body">
191 <h2>{{ $Rec->title }}</h2> 191 <h2>{{ $Rec->title }}</h2>
192 <div class="main__vacancies-thing-scroll"> 192 <div class="main__vacancies-thing-scroll">
193 {!! $Rec->text !!} 193 {!! $Rec->text !!}
194 </div> 194 </div>
195 <a href="{{ $Rec->link }}" class="button">Узнать больше</a> 195 <a href="{{ $Rec->link }}" class="button">Узнать больше</a>
196 </div> 196 </div>
197 </div> 197 </div>
198 @endif 198 @endif
199 @endforeach 199 @endforeach
200 <div class="main__vacancies-item main__employer-page-two-item"> 200 <div class="main__vacancies-item main__employer-page-two-item" data-id="{{ $Q->id }}">
201 201
202 <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" class="back main__employer-page-two-item-back"> 202 <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" class="back main__employer-page-two-item-back">
203 <svg> 203 <svg>
204 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 204 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
205 </svg> 205 </svg>
206 <span> 206 <span>
207 Вернуться к списку вакансий 207 Вернуться к списку вакансий 123
208 </span> 208 </span>
209 </a> 209 </a>
210 210
211 <div class="main__employer-page-two-item-toper"> 211 <div class="main__employer-page-two-item-toper">
212 @if (!empty($Q->employer->logo)) 212 @if (!empty($Q->employer->logo))
213 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}"> 213 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}">
214 @else 214 @else
215 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 215 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
216 @endif 216 @endif
217 <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span> 217 <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span>
218 </div> 218 </div>
219 219
220 <div class="main__employer-page-two-item-text"> 220 <div class="main__employer-page-two-item-text">
221 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор 221 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор
222 специалистов на следующие должности:</div> 222 специалистов на следующие должности:</div>
223 <div class="main__employer-page-two-item-text-links"> 223 <div class="main__employer-page-two-item-text-links">
224 @if (isset($Q->jobs)) 224 @if (isset($Q->jobs))
225 @foreach ($Q->jobs as $key => $j) 225 @foreach ($Q->jobs as $key => $j)
226 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a> 226 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a>
227 @endforeach 227 @endforeach
228 @endif 228 @endif
229 </div> 229 </div>
230 </div> 230 </div>
231 231
232 <div class="main__employer-page-two-item-text"> 232 <div class="main__employer-page-two-item-text">
233 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 233 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
234 <div class="main__employer-page-two-item-text-body"> 234 <div class="main__employer-page-two-item-text-body">
235 {!! $Q->text !!} 235 {!! $Q->text !!}
236 </div> 236 </div>
237 </div> 237 </div>
238 <div class="main__employer-page-two-item-text"> 238 <div class="main__employer-page-two-item-text">
239 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div> 239 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div>
240 <div class="main__employer-page-two-item-text-body"> 240 <div class="main__employer-page-two-item-text-body">
241 {!! $Q->description !!} 241 {!! $Q->description !!}
242 </div> 242 </div>
243 </div> 243 </div>
244 <div class="main__employer-page-two-item-text"> 244 <div class="main__employer-page-two-item-text">
245 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div> 245 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div>
246 <div class="main__employer-page-two-item-text-body"> 246 <div class="main__employer-page-two-item-text-body">
247 {!! $Q->contacts_emails !!} 247 {!! $Q->contacts_emails !!}
248 </div> 248 </div>
249 </div> 249 </div>
250 <div class="main__employer-page-two-item-text"> 250 <div class="main__employer-page-two-item-text">
251 <div class="main__employer-page-two-item-text-name">Или звоните:</div> 251 <div class="main__employer-page-two-item-text-name">Или звоните:</div>
252 <div class="main__employer-page-two-item-text-body"> 252 <div class="main__employer-page-two-item-text-body">
253 {!! $Q->contacts_telephones !!} 253 {!! $Q->contacts_telephones !!}
254 </div> 254 </div>
255 </div> 255 </div>
256 256
257 <div class="main__employer-page-two-item-tags"> 257 <div class="main__employer-page-two-item-tags">
258 @if (!empty($Q->jobs_code[0]->position_ship)) 258 @if (!empty($Q->jobs_code[0]->position_ship))
259 <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span> 259 <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span>
260 @else 260 @else
261 @if (isset($Q->jobs)) 261 @if (isset($Q->jobs))
262 @foreach ($Q->jobs as $key => $j) 262 @foreach ($Q->jobs as $key => $j)
263 <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span> 263 <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span>
264 @endforeach 264 @endforeach
265 @endif 265 @endif
266 @endif 266 @endif
267 </div> 267 </div>
268 <div class="main__employer-page-two-item-buttons"> 268 <div class="main__employer-page-two-item-buttons">
269 @guest 269 @guest
270 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' 270 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
271 class="button main__employer-page-two-item-button">Откликнуться</button> 271 class="button main__employer-page-two-item-button">Откликнуться</button>
272 @else 272 @else
273 @if (App\Classes\StatusUser::Status()==1) 273 @if (App\Classes\StatusUser::Status()==1)
274 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}' 274 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
275 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> 275 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
276 @else 276 @else
277 <button type="button" data-fancybox data-src="#send2" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}' 277 <button type="button" data-fancybox data-src="#send2" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
278 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> 278 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
279 @endif 279 @endif
280 @endguest 280 @endguest
281 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a> 281 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a>
282 </div> 282 </div>
283 <div class="main__employer-page-two-item-bottom"> 283 <div class="main__employer-page-two-item-bottom">
284 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div> 284 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div>
285 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vacancy_favorites <?=App\Classes\Cookies_vacancy::selected_vacancy($Q->id);?>"> 285 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vacancy_favorites <?=App\Classes\Cookies_vacancy::selected_vacancy($Q->id);?>">
286 <svg> 286 <svg>
287 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 287 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
288 </svg> 288 </svg>
289 </button> 289 </button>
290 </div> 290 </div>
291 </div> 291 </div>
292 @php $i++ @endphp 292 @php $i++ @endphp
293 @endforeach 293 @endforeach
294 <div style="margin-top: 20px"> 294 <div style="margin-top: 20px">
295 {{ $Query->appends($_GET)->links('paginate') }} 295 {{ $Query->appends($_GET)->links('paginate') }}
296 </div><!-- конец --> 296 </div><!-- конец -->
297
297 </div> 298 </div>
298 </div> 299 </div>
299 </div> 300 </div>
300 </main> 301 </main>
301 @endsection 302 @endsection
302 303
resources/views/modals/send_employer.blade.php
1 <script> 1 <script>
2 console.log('Сообщение работнику'); 2 console.log('Сообщение работнику');
3 $(document).on('change', '#btn_send_file', function() { 3 $(document).on('change', '#btn_send_file', function() {
4 var send_name = $('#send_name'); 4 var send_name = $('#send_name');
5 var send_name_val = send_name.val(); 5 var send_name_val = send_name.val();
6 var this_final_name = $('#this_final_name'); 6 var this_final_name = $('#this_final_name');
7 7
8 console.log(send_name_val); 8 console.log(send_name_val);
9 this_final_name.html(send_name_val); 9 this_final_name.html(send_name_val);
10 10
11 }); 11 });
12 </script> 12 </script>
13 <div id="send2" class="modal"> 13 <div id="send2" class="modal">
14 <div class="modal__body"> 14 <div class="modal__body">
15 <div class="modal__title">Отправить сообщение соискателю</div> 15 <div class="modal__title">Отправить сообщение</div>
16 <div class="modal__text">Если у вас есть предложение для соискателя, вы можете сделать предложение</div> 16 <div class="modal__text">Если у вас есть предложение, вы можете сделать конретное предложение</div>
17 <form class="modal__form" id="form_from_emp" name="form_from_emp" enctype="multipart/form-data" action="{{ route('employer.new_message') }}" method="POST"> 17 <form class="modal__form" id="form_from_emp" name="form_from_emp" enctype="multipart/form-data" action="{{ route('employer.new_message') }}" method="POST">
18 @csrf 18 @csrf
19 <div class="modal__form-item"> 19 <div class="modal__form-item" style="display:none">
20 Отправитель сообщения: 20 Отправитель сообщения:
21 <input type="text" id="_user_id" name="_user_id" class="input" placeholder="user_id" value=""> 21 <input type="text" id="_user_id" name="_user_id" class="input" placeholder="user_id" value="">
22 Получатель сообщения: 22 Получатель сообщения:
23 <input type="text" id="_to_user_id" name="_to_user_id" class="input" placeholder="to_user_id" value=""> 23 <input type="text" id="_to_user_id" name="_to_user_id" class="input" placeholder="to_user_id" value="">
24 Вакансия: 24 Вакансия:
25 <input type="text" id="_vacancy" name="_vacancy" class="input" placeholder="vacancy" value=""> 25 <input type="text" id="_vacancy" name="_vacancy" class="input" placeholder="vacancy" value="">
26 </div> 26 </div>
27 <div class="modal__form-item"> 27 <div class="modal__form-item">
28 <input id="i1" type="text" name="title" class="input" placeholder="Тема" required> 28 <input id="i1" type="text" name="title" class="input" placeholder="Тема" required>
29 <label for="i1">Не заполнено поле</label> 29 <label for="i1">Не заполнено поле</label>
30 </div> 30 </div>
31 <div class="modal__form-item"> 31 <div class="modal__form-item">
32 <textarea id="i2" class="textarea" name="text" placeholder="Укажите по какому поводу вы пишите работодателю, уточните название вакансии или прикрепите ссылку на вакансию, дайте как можно больше информации.&#10;&#10;ВАЖНО не стоит писать работодателю короткий текст цитирую «Какая зарплата?, работодатель не поймет о чем речь, опишите вопрос максимально подробно»." required></textarea> 32 <textarea id="i2" class="textarea" name="text" placeholder="Укажите по какому поводу вы пишите работодателю, уточните название вакансии или прикрепите ссылку на вакансию, дайте как можно больше информации.&#10;&#10;ВАЖНО не стоит писать работодателю короткий текст цитирую «Какая зарплата?, работодатель не поймет о чем речь, опишите вопрос максимально подробно»." required></textarea>
33 <label for="i2">Не заполнено поле</label> 33 <label for="i2">Не заполнено поле</label>
34 </div> 34 </div>
35 <div class="modal__form-item"> 35 <div class="modal__form-item">
36 <div class="file"> 36 <div class="file">
37 <label class="file__input"> 37 <label class="file__input">
38 <input type="file" name="file"> 38 <input type="file" name="file">
39 <span class="button button_light"> 39 <span class="button button_light">
40 <svg> 40 <svg>
41 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> 41 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
42 </svg> 42 </svg>
43 Прикрепить резюме 43 Прикрепить документ
44 </span> 44 </span>
45 </label> 45 </label>
46 46
47 <div class="file__list"> 47 <div class="file__list">
48 <div class="file__list-item"> 48 <div class="file__list-item">
49 <div class="file__list-item-left"> 49 <div class="file__list-item-left">
50 <svg> 50 <svg>
51 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use> 51 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use>
52 </svg> 52 </svg>
53 <span id="this_final_name" name="this_final_name"></span> 53 <span id="this_final_name" name="this_final_name"></span>
54 </div> 54 </div>
55 <button type="button" class="file__list-item-right js-parent-remove"> 55 <button type="button" class="file__list-item-right js-parent-remove">
56 <svg> 56 <svg>
57 <use xlink:href="{{ asset('images/sprite.svg#cross-bold') }}"></use> 57 <use xlink:href="{{ asset('images/sprite.svg#cross-bold') }}"></use>
58 </svg> 58 </svg>
59 </button> 59 </button>
60 </div> 60 </div>
61 </div> 61 </div>
62 </div> 62 </div>
63 </div> 63 </div>
64 <div class="modal__form-item"> 64 <div class="modal__form-item">
65 <button type="submit" class="button">Отправить</button> 65 <button type="submit" class="button">Отправить</button>
66 </div> 66 </div>
67 </form> 67 </form>
68 </div> 68 </div>
69 </div> 69 </div>
70 70
resources/views/modals/send_employer_new.blade.php
No preview for this file type
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 type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
4 <script> 5 <script>
5 console.log('Test system'); 6 console.log('Test system');
6 $(document).on('change', '#jobs', function() { 7 $(document).on('change', '#jobs', function() {
7 var val = $(this).val(); 8 var val = $(this).val();
8 var main_oskar = $('#main_ockar'); 9 var main_oskar = $('#main_ockar');
9 10
10 console.log('Code='+val); 11 console.log('Code='+val);
11 console.log('Click change...'); 12 console.log('Click change...');
12 $.ajax({ 13 $.ajax({
13 type: "GET", 14 type: "GET",
14 url: "", 15 url: "",
15 data: "job="+val, 16 data: "job="+val,
16 success: function (data) { 17 success: function (data) {
17 console.log('Выбор сделан!'); 18 console.log('Выбор сделан!');
18 console.log(data); 19 console.log(data);
19 main_oskar.html(data); 20 main_oskar.html(data);
20 }, 21 },
21 headers: { 22 headers: {
22 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 23 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
23 }, 24 },
24 error: function (data) { 25 error: function (data) {
25 data = JSON.stringify(data); 26 data = JSON.stringify(data);
26 console.log('Error: ' + data); 27 console.log('Error: ' + data);
27 } 28 }
28 }); 29 });
29 }); 30 });
30 </script> 31 </script>
31 32
32 <script> 33 <script>
33 $(document).ready(function() { 34 $(document).ready(function() {
34 $(document).on('click', '.js_box_favorites', function () { 35 $(document).on('click', '.js_box_favorites', function () {
35 var _this = $(this); 36 var _this = $(this);
36 var id_worker = _this.attr('data-val'); 37 var id_worker = _this.attr('data-val');
37 38
38 if (_this.hasClass('active')) { 39 if (_this.hasClass('active')) {
39 add_in_array(id_worker); 40 add_in_array(id_worker);
40 console.log('Добавлено в избранное id=' + id_worker); 41 console.log('Добавлено в избранное id=' + id_worker);
41 } else { 42 } else {
42 delete_in_array(id_worker); 43 delete_in_array(id_worker);
43 console.log('Удалено из избранных id='+id_worker) 44 console.log('Удалено из избранных id='+id_worker)
44 } 45 }
45 var str = $.cookie('favorite_worker'); 46 var str = $.cookie('favorite_worker');
46 console.log("Вывод куков "+str); 47 console.log("Вывод куков "+str);
47 48
48 }); 49 });
49 }); 50 });
50 51
51 //помеченный элемент 52 //помеченный элемент
52 function selected_item(obj) { 53 function selected_item(obj) {
53 var arr = read_array(); 54 var arr = read_array();
54 var index = arr.indexOf(obj); 55 var index = arr.indexOf(obj);
55 56
56 if (index > 0) 57 if (index > 0)
57 return "active"; 58 return "active";
58 else 59 else
59 return ""; 60 return "";
60 } 61 }
61 62
62 // запись элемента массива в cookie 63 // запись элемента массива в cookie
63 function add_in_array(obj){ 64 function add_in_array(obj){
64 var arr = read_array();//получаем текущее состояние массива 65 var arr = read_array();//получаем текущее состояние массива
65 arr[arr.length]=obj; //добавляем элемент в конец 66 arr[arr.length]=obj; //добавляем элемент в конец
66 //var str = JSON.stringify(arr);//конвертируем в строку 67 //var str = JSON.stringify(arr);//конвертируем в строку
67 //$.cookie('arr',str);//записываем массив в куки 68 //$.cookie('arr',str);//записываем массив в куки
68 $.cookie('favorite_worker', JSON.stringify(arr)); 69 $.cookie('favorite_worker', JSON.stringify(arr));
69 70
70 } 71 }
71 72
72 // удаление элемента из массива в cookie 73 // удаление элемента из массива в cookie
73 function delete_in_array(obj) { 74 function delete_in_array(obj) {
74 var arr = read_array(); 75 var arr = read_array();
75 var unique = [...new Set(arr)] 76 var unique = [...new Set(arr)]
76 var index = unique.indexOf(obj); 77 var index = unique.indexOf(obj);
77 78
78 unique.splice(index, 1); 79 unique.splice(index, 1);
79 80
80 //var str = JSON.stringify(arr);//конвертируем в строку 81 //var str = JSON.stringify(arr);//конвертируем в строку
81 //$.cookie('arr',str);//записываем массив в куки 82 //$.cookie('arr',str);//записываем массив в куки
82 $.cookie('favorite_worker', JSON.stringify(unique)); 83 $.cookie('favorite_worker', JSON.stringify(unique));
83 84
84 } 85 }
85 86
86 function read_array(){ 87 function read_array(){
87 var dataArr=$.cookie('favorite_worker');//считываем данные из куков 88 var dataArr=$.cookie('favorite_worker');//считываем данные из куков
88 89
89 //если массив не был обнаружен, иницилизируем его 90 //если массив не был обнаружен, иницилизируем его
90 if(dataArr===null){ 91 if(dataArr===null){
91 dataArr = init_array(); //возвращаем инициализированный пустой маасив 92 dataArr = init_array(); //возвращаем инициализированный пустой маасив
92 } 93 }
93 //возвращаем полученный массив 94 //возвращаем полученный массив
94 //return JSON.parse(dataArr); 95 //return JSON.parse(dataArr);
95 return JSON.parse(dataArr); 96 return JSON.parse(dataArr);
96 } 97 }
97 98
98 //другими словами создаем пустой массив 99 //другими словами создаем пустой массив
99 function init_array(){ 100 function init_array(){
100 //var str = JSON.stringify(new Array());//конвертируем в строку 101 //var str = JSON.stringify(new Array());//конвертируем в строку
101 var str = JSON.stringify(new Array()); 102 var str = JSON.stringify(new Array());
102 $.cookie('favorite_worker',str);//записываем массив в куки 103 $.cookie('favorite_worker',str);//записываем массив в куки
103 104
104 return str; 105 return str;
105 } 106 }
106 </script> 107 </script>
107 <script> 108 <script>
108 $(document).on('click', '.js_it_button', function() { 109 $(document).on('click', '.js_it_button', function() {
109 var this_ = $(this); 110 var this_ = $(this);
110 var code_user_id = this_.attr('data-uid'); 111 var code_user_id = this_.attr('data-uid');
111 var code_to_user_id = this_.attr('data-tuid'); 112 var code_to_user_id = this_.attr('data-tuid');
112 var code_vacancy = this_.attr('data-vacancy'); 113 var code_vacancy = this_.attr('data-vacancy');
113 var user_id = $('#_user_id'); 114 var user_id = $('#_user_id');
114 var to_user_id = $('#_to_user_id'); 115 var to_user_id = $('#_to_user_id');
115 var vacancy = $('#_vacancy'); 116 var vacancy = $('#_vacancy');
116 117
117 console.log('code_to_user_id='+code_to_user_id); 118 console.log('code_to_user_id='+code_to_user_id);
118 console.log('code_user_id='+code_user_id); 119 console.log('code_user_id='+code_user_id);
119 console.log('code_vacancy='+code_vacancy); 120 console.log('code_vacancy='+code_vacancy);
120 console.log('Клик на кнопке...'); 121 console.log('Клик на кнопке...');
121 122
122 user_id.val(code_user_id); 123 user_id.val(code_user_id);
123 to_user_id.val(code_to_user_id); 124 to_user_id.val(code_to_user_id);
124 vacancy.val(code_vacancy); 125 vacancy.val(code_vacancy);
125 }); 126 });
126 </script> 127 </script>
127 <script> 128 <script>
128 $(document).on('change', '#sort_ajax', function() { 129 $(document).on('change', '#sort_ajax', function() {
129 var this_ = $(this); 130 var this_ = $(this);
130 var val_ = this_.val(); 131 var val_ = this_.val();
131 console.log('sort items '+val_); 132 console.log('sort items '+val_);
132 133
133 $.ajax({ 134 $.ajax({
134 type: "GET", 135 type: "GET",
135 url: "{{ route('bd_resume') }}", 136 url: "{{ route('bd_resume') }}",
136 data: "sort="+val_+"&block=1", 137 data: "sort="+val_+"&block=1",
137 success: function (data) { 138 success: function (data) {
138 console.log('Выбор сортировки'); 139 console.log('Выбор сортировки');
139 console.log(data); 140 console.log(data);
140 $('#block1').html(data); 141 $('#block1').html(data);
141 history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 142 history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
142 }, 143 },
143 headers: { 144 headers: {
144 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 145 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
145 }, 146 },
146 error: function (data) { 147 error: function (data) {
147 data = JSON.stringify(data); 148 data = JSON.stringify(data);
148 console.log('Error: ' + data); 149 console.log('Error: ' + data);
149 } 150 }
150 }); 151 });
151 152
152 $.ajax({ 153 $.ajax({
153 type: "GET", 154 type: "GET",
154 url: "{{ route('bd_resume') }}", 155 url: "{{ route('bd_resume') }}",
155 data: "sort="+val_+"&block=2", 156 data: "sort="+val_+"&block=2",
156 success: function (data) { 157 success: function (data) {
157 console.log('Выбор сортировки'); 158 console.log('Выбор сортировки');
158 console.log(data); 159 console.log(data);
159 $('#block2').html(data); 160 $('#block2').html(data);
160 history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 161 history.pushState({}, '', "{{ route('bd_resume') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
161 }, 162 },
162 headers: { 163 headers: {
163 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 164 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
164 }, 165 },
165 error: function (data) { 166 error: function (data) {
166 data = JSON.stringify(data); 167 data = JSON.stringify(data);
167 console.log('Error: ' + data); 168 console.log('Error: ' + data);
168 } 169 }
169 }); 170 });
170 171
171 }); 172 });
172 173
173 $(document).ready(function(){ 174 $(document).ready(function(){
174 var sel = $('#select2-sort_ajax-container'); 175 var sel = $('#select2-sort_ajax-container');
175 var key = getUrlParameter('sort'); 176 var key = getUrlParameter('sort');
176 console.log(sel); 177 console.log(sel);
177 console.log(key); 178 console.log(key);
178 179
179 if (key !=='') { 180 if (key !=='') {
180 console.log(key); 181 console.log(key);
181 switch (key) { 182 switch (key) {
182 case "default": sel.html('Сортировка (по умолчанию)'); break; 183 case "default": sel.html('Сортировка (по умолчанию)'); break;
183 case "name_up": sel.html('По имени (возрастание)'); break; 184 case "name_up": sel.html('По имени (возрастание)'); break;
184 case "name_down": sel.html('По дате (убывание)'); break; 185 case "name_down": sel.html('По дате (убывание)'); break;
185 case "created_at_up": sel.html('По дате (возрастание)'); break; 186 case "created_at_up": sel.html('По дате (возрастание)'); break;
186 case "created_at_down": sel.html('По дате (убывание)'); break; 187 case "created_at_down": sel.html('По дате (убывание)'); break;
187 } 188 }
188 189
189 } 190 }
190 }); 191 });
191 </script> 192 </script>
192 @endsection 193 @endsection
193 194
194 195
195 @section('content') 196 @section('content')
196 <section class="thing"> 197 <section class="thing">
197 <div class="container"> 198 <div class="container">
198 <form class="thing__body" action="{{ url()->current() }}"> 199 <form class="thing__body" action="{{ url()->current() }}">
199 <ul class="breadcrumbs thing__breadcrumbs"> 200 <ul class="breadcrumbs thing__breadcrumbs">
200 <li><a href="{{ route('index') }}">Главная</a></li> 201 <li><a href="{{ route('index') }}">Главная</a></li>
201 <li><b>База резюме</b></li> 202 <li><b>База резюме</b></li>
202 </ul> 203 </ul>
203 <h1 class="thing__title">База резюме</h1> 204 <h1 class="thing__title">База резюме</h1>
204 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для 205 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для
205 существующих финансовых и административных условий.</p> 206 существующих финансовых и административных условий.</p>
206 <div class="search thing__search"> 207 <div class="search thing__search">
207 <input type="search" class="input" name="search" id="search" placeholder="Введите наименование должности" required> 208 <input type="search" class="input" name="search" id="search" placeholder="Введите наименование должности" required>
208 <button type="submit" class="button">Найти</button> 209 <button type="submit" class="button">Найти</button>
209 <span> 210 <span>
210 <svg> 211 <svg>
211 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 212 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
212 </svg> 213 </svg>
213 </span> 214 </span>
214 </div> 215 </div>
215 <label class="checkbox thing__checkbox"> 216 <label class="checkbox thing__checkbox">
216 <input type="checkbox" class="checkbox__input" name="experience" id="experience"> 217 <input type="checkbox" class="checkbox__input" name="experience" id="experience">
217 <span class="checkbox__icon"> 218 <span class="checkbox__icon">
218 <svg> 219 <svg>
219 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use> 220 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use>
220 </svg> 221 </svg>
221 </span> 222 </span>
222 <span class="checkbox__text"> 223 <span class="checkbox__text">
223 <span> 224 <span>
224 Опыт работы 225 Опыт работы
225 </span> 226 </span>
226 </span> 227 </span>
227 </label> 228 </label>
228 </form> 229 </form>
229 </div> 230 </div>
230 </section> 231 </section>
231 <main class="main"> 232 <main class="main">
232 <div class="container"> 233 <div class="container">
233 <div class="main__resume-base"> 234 <div class="main__resume-base">
234 <h2>Резюме работников</h2> 235 <h2>Резюме работников</h2>
235 <div class="filters"> 236 <div class="filters">
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> 237 <div class="filters__label">Показано @if ($res_count > 0) 1 @else 0 @endif – @if($res_count < 5) {{ $res_count }} @else 5 @endif из {{ $res_count }} результатов поиска</div>
237 <div class="filters__body"> 238 <div class="filters__body">
238 <div class="select filters__select"> 239 <div class="select filters__select">
239 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 240 <select class="js-select2" id="sort_ajax" name="sort_ajax">
240 <option value="default">Сортировка (по умолчанию)</option> 241 <option value="default">Сортировка (по умолчанию)</option>
241 <option value="name_up">По имени (возрастание)</option> 242 <option value="name_up">По имени (возрастание)</option>
242 <option value="name_down">По имени (убывание)</option> 243 <option value="name_down">По имени (убывание)</option>
243 <option value="created_at_up">По дате (возрастание)</option> 244 <option value="created_at_up">По дате (возрастание)</option>
244 <option value="created_at_down">По дате (убывание)</option> 245 <option value="created_at_down">По дате (убывание)</option>
245 </select> 246 </select>
246 </div> 247 </div>
247 <button type="button" class="filters__item active" data-tab="1"> 248 <button type="button" class="filters__item active" data-tab="1">
248 <svg> 249 <svg>
249 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use> 250 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use>
250 </svg> 251 </svg>
251 </button> 252 </button>
252 <button type="button" class="filters__item" data-tab="2"> 253 <button type="button" class="filters__item" data-tab="2">
253 <svg> 254 <svg>
254 <use xlink:href="{{ asset('images/sprite.svg#grid-2') }}"></use> 255 <use xlink:href="{{ asset('images/sprite.svg#grid-2') }}"></use>
255 </svg> 256 </svg>
256 </button> 257 </button>
257 </div> 258 </div>
258 </div> 259 </div>
259 <div class="main__resume-base-body showed" data-body="1"> 260 <div class="main__resume-base-body showed" data-body="1">
260 <div class="main__resume-base-body-one" id="block1" name="block1"> 261 <div class="main__resume-base-body-one" id="block1" name="block1">
261 @if ($resumes->count()) 262 @if ($resumes->count())
262 @foreach ($resumes as $res) 263 @foreach ($resumes as $res)
263 <div class="main__resume-base-body-item"> 264 <div class="main__resume-base-body-item">
264 <div class="main__resume-base-body-item-buttons"> 265 <div class="main__resume-base-body-item-buttons">
265 <button type="button" class="like js-toggle js_box_favorites <?=\App\Classes\RusDate::selected_item($res->id);?>" data-val="{{ $res->id }}"> 266 <button type="button" class="like js-toggle js_box_favorites <?=\App\Classes\RusDate::selected_item($res->id);?>" data-val="{{ $res->id }}">
266 <svg> 267 <svg>
267 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 268 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
268 </svg> 269 </svg>
269 </button> 270 </button>
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}'> 271 <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}'>
271 <svg> 272 <svg>
272 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> 273 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
273 </svg> 274 </svg>
274 </button> 275 </button>
275 </div> 276 </div>
276 <div class="main__resume-base-body-item-wrapper"> 277 <div class="main__resume-base-body-item-wrapper">
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"> 278 <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">
278 <div class="main__resume-base-body-item-inner"> 279 <div class="main__resume-base-body-item-inner">
279 <div> 280 <div>
280 <b>Статус</b> 281 <b>Статус</b>
281 <span>{{ $status_work[$res->status_work] }}</span> 282 <span>{{ $status_work[$res->status_work] }}</span>
282 </div> 283 </div>
283 <div> 284 <div>
284 <b>Имя работника</b> 285 <b>Имя работника</b>
285 <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> 286 <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span>
286 </div> 287 </div>
287 <div> 288 <div>
288 <b>Номер телефона</b> 289 <b>Номер телефона</b>
289 <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span> 290 <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span>
290 </div> 291 </div>
291 <div> 292 <div>
292 <b>Электронный адрес</b> 293 <b>Электронный адрес</b>
293 <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> 294 <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span>
294 </div> 295 </div>
295 <div> 296 <div>
296 <b>Город проживания</b> 297 <b>Город проживания</b>
297 <span>{{ $res->city }}</span> 298 <span>{{ $res->city }}</span>
298 </div> 299 </div>
299 <div> 300 <div>
300 <b>Опыт работы</b> 301 <b>Опыт работы</b>
301 <span>{{ $res->experience }}</span> 302 <span>{{ $res->experience }}</span>
302 </div> 303 </div>
303 </div> 304 </div>
304 </div> 305 </div>
305 <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в резюме</a> 306 <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в резюме</a>
306 </div> 307 </div>
307 @endforeach 308 @endforeach
308 309
309 {{ $resumes->appends($_GET)->links('paginate') }} 310 {{ $resumes->appends($_GET)->links('paginate') }}
310 @endif 311 @endif
311 </div> 312 </div>
312 </div> 313 </div>
313 <div class="main__resume-base-body" data-body="2"> 314 <div class="main__resume-base-body" data-body="2">
314 <div class="main__resume-base-body-two" id="block2" name="block2"> 315 <div class="main__resume-base-body-two" id="block2" name="block2">
315 @if ($resumes->count()) 316 @if ($resumes->count())
316 @foreach ($resumes as $res) 317 @foreach ($resumes as $res)
317 <div class="main__resume-base-body-item"> 318 <div class="main__resume-base-body-item">
318 <div class="main__resume-base-body-item-buttons"> 319 <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 <button type="button" class="like js-toggle js_box_favorites <?=\App\Classes\RusDate::selected_item($res->id);?>" data-val="{{ $res->id }}">
320 <svg> 321 <svg>
321 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 322 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
322 </svg> 323 </svg>
323 </button> 324 </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 <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 <svg>
326 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> 327 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
327 </svg> 328 </svg>
328 </button> 329 </button>
329 </div> 330 </div>
330 <div class="main__resume-base-body-item-wrapper"> 331 <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 <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 class="main__resume-base-body-item-inner">
333 <div> 334 <div>
334 <b>Статус</b> 335 <b>Статус</b>
335 <span>{{ $status_work[$res->status_work] }}</span> 336 <span>{{ $status_work[$res->status_work] }}</span>
336 </div> 337 </div>
337 <div> 338 <div>
338 <b>Имя работника</b> 339 <b>Имя работника</b>
339 <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> 340 <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span>
340 </div> 341 </div>
341 <div> 342 <div>
342 <b>Номер телефона</b> 343 <b>Номер телефона</b>
343 <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span> 344 <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone }}</a></span>
344 </div> 345 </div>
345 <div> 346 <div>
346 <b>Электронный адрес</b> 347 <b>Электронный адрес</b>
347 <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> 348 <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span>
348 </div> 349 </div>
349 <div> 350 <div>
350 <b>Город проживания</b> 351 <b>Город проживания</b>
351 <span>{{ $res->city }}</span> 352 <span>{{ $res->city }}</span>
352 </div> 353 </div>
353 <div> 354 <div>
354 <b>Опыт работы</b> 355 <b>Опыт работы</b>
355 <span>{{ $res->experience }}</span> 356 <span>{{ $res->experience }}</span>
356 </div> 357 </div>
357 </div> 358 </div>
358 </div> 359 </div>
359 <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в 360 <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Перейти в
360 резюме</a> 361 резюме</a>
361 </div> 362 </div>
362 @endforeach 363 @endforeach
363 364
364 {{ $resumes->appends($_GET)->links('paginate') }} 365 {{ $resumes->appends($_GET)->links('paginate') }}
365 @endif 366 @endif
366 </div> 367 </div>
367 </div> 368 </div>
368 </div> 369 </div>
369 </div> 370 </div>
370 </main> 371 </main>
371 </div> 372 </div>
372 </div> 373 </div>
373 @endsection 374 @endsection
374 375
resources/views/vacance-item.blade.php
1 @php
2 use App\Classes\StatusUser;
3 @endphp
4
1 @extends('layout.frontend', ['title' => $title]) 5 @extends('layout.frontend', ['title' => $title])
2 6
3 @section('scripts') 7 @section('scripts')
4 @include('js.favorite-vacancy') 8 @include('js.favorite-vacancy')
9 <script>
10 $(document).on('click', '.js_send_it_button', function() {
11 var this_ = $(this);
12 var code_user_id = this_.attr('data-uid');
13 var code_to_user_id = this_.attr('data-tuid');
14 var code_vacancy = this_.attr('data-vacancy');
15 var user_id = $('#_user_id');
16 var to_user_id = $('#_to_user_id');
17 var vacancy = $('#_vacancy');
18
19 console.log('Клик на кнопки...');
20
21 user_id.val(code_user_id);
22 to_user_id.val(code_to_user_id);
23 vacancy.val(code_vacancy);
24 });
25 </script>
5 @endsection 26 @endsection
6 27
7 @section('content') 28 @section('content')
8 <main class="main"> 29 <main class="main">
9 <div class="container"> 30 <div class="container">
10 <ul class="breadcrumbs main__breadcrumbs"> 31 <ul class="breadcrumbs main__breadcrumbs">
11 <li><a href="{{ route('index') }}">Главная</a></li> 32 <li><a href="{{ route('index') }}">Главная</a></li>
12 <li><a href="{{ route('vacancies') }}">Вакансии</a></li> 33 <li><a href="{{ route('vacancies') }}">Вакансии</a></li>
13 <li><b>{{ $title }}</b></li> 34 <li><b>{{ $title }}</b></li>
14 </ul> 35 </ul>
15 <div class="main__employer-page"> 36 <div class="main__employer-page">
16 37
17 @if (isset($Query[0]->employer)) 38 @if (isset($Query[0]->employer))
18 <h2 class="main__employer-page-title">О компании</h2> 39 <h2 class="main__employer-page-title">О компании</h2>
19 <div class="main__employer-page-two-item-toper"> 40 <div class="main__employer-page-two-item-toper">
20 @if (!empty($Query[0]->employer->logo)) 41 @if (!empty($Query[0]->employer->logo))
21 <img src="{{ asset(Storage::url($Query[0]->employer->logo)) }}" alt="{{ $Query[0]->employer->name }}"> 42 <img src="{{ asset(Storage::url($Query[0]->employer->logo)) }}" alt="{{ $Query[0]->employer->name }}">
22 @else 43 @else
23 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Query[0]->employer->name }}"> 44 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Query[0]->employer->name }}">
24 @endif 45 @endif
25 <span>{{ $Query[0]->employer->name_company }}</span> 46 <span>{{ $Query[0]->employer->name_company }}</span>
26 </div> 47 </div>
27 48
28 <div class="main__employer-page-info"> 49 <div class="main__employer-page-info">
29 <div class="main__employer-page-item"> 50 <div class="main__employer-page-item">
30 <b> Адрес компании</b> 51 <b> Адрес компании</b>
31 <span> 52 <span>
32 {{ $Query[0]->employer->address }} 53 {{ $Query[0]->employer->address }}
33 </span> 54 </span>
34 </div> 55 </div>
35 <div class="main__employer-page-item"> 56 <div class="main__employer-page-item">
36 <b>Сайт</b> 57 <b>Сайт</b>
37 <span> 58 <span>
38 <a href="{{ $Query[0]->employer->site }}">{{ $Query[0]->employer->site }}</a> 59 <a href="{{ $Query[0]->employer->site }}">{{ $Query[0]->employer->site }}</a>
39 </span> 60 </span>
40 </div> 61 </div>
41 <div class="main__employer-page-item"> 62 <div class="main__employer-page-item">
42 <b>Почта</b> 63 <b>Почта</b>
43 <span> 64 <span>
44 <a href="{{ $Query[0]->employer->email }}">{{ $Query[0]->employer->email }}</a> 65 <a href="{{ $Query[0]->employer->email }}">{{ $Query[0]->employer->email }}</a>
45 </span> 66 </span>
46 </div> 67 </div>
47 <div class="main__employer-page-item"> 68 <div class="main__employer-page-item">
48 <b>Телефон</b> 69 <b>Телефон</b>
49 <span> 70 <span>
50 <a href="tel:{{ $Query[0]->employer->telephone }}">{{ $Query[0]->employer->telephone }}</a> 71 <a href="tel:{{ $Query[0]->employer->telephone }}">{{ $Query[0]->employer->telephone }}</a>
51 </span> 72 </span>
52 </div> 73 </div>
53 </div> 74 </div>
54 @else 75 @else
55 <div class="main__employer-page-info"> 76 <div class="main__employer-page-info">
56 <div class="main__employer-page-item"> 77 <div class="main__employer-page-item">
57 <b>Ничего не найдено</b> 78 <b>Ничего не найдено</b>
58 <span> 79 <span>
59 Нет данных о компании 80 Нет данных о компании
60 </span> 81 </span>
61 </div> 82 </div>
62 </div> 83 </div>
63 @endif 84 @endif
64 <h2 class="main__employer-page-title">Описание вакансии</h2> 85 <h2 class="main__employer-page-title">Описание вакансии</h2>
65 86
66 </div> 87 </div>
67 88
68 @foreach ($Query as $Q) 89 @foreach ($Query as $Q)
69 <div class="main__vacancies-item-page main__employer-page-two-item"> 90 <div class="main__vacancies-item-page main__employer-page-two-item">
70 <div class="main__employer-page-two-item-text"> 91 <div class="main__employer-page-two-item-text">
71 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор 92 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор
72 специалистов на следующие должности:</div> 93 специалистов на следующие должности:</div>
73 <div class="main__employer-page-two-item-text-links"> 94 <div class="main__employer-page-two-item-text-links">
74 @if (isset($Q->jobs)) 95 @if (isset($Q->jobs))
75 @foreach ($Q->jobs as $key => $j) 96 @foreach ($Q->jobs as $key => $j)
76 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a> 97 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a>
77 @endforeach 98 @endforeach
78 @endif 99 @endif
79 </div> 100 </div>
80 </div> 101 </div>
81 <div class="main__employer-page-two-item-text"> 102 <div class="main__employer-page-two-item-text">
82 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 103 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
83 <div class="main__employer-page-two-item-text-body"> 104 <div class="main__employer-page-two-item-text-body">
84 {!! $Q->text !!} 105 {!! $Q->text !!}
85 </div> 106 </div>
86 </div> 107 </div>
87 <div class="main__employer-page-two-item-text"> 108 <div class="main__employer-page-two-item-text">
88 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div> 109 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div>
89 <div class="main__employer-page-two-item-text-body"> 110 <div class="main__employer-page-two-item-text-body">
90 {!! $Q->description !!} 111 {!! $Q->description !!}
91 </div> 112 </div>
92 </div> 113 </div>
93 <div class="main__employer-page-two-item-text"> 114 <div class="main__employer-page-two-item-text">
94 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div> 115 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div>
95 <div class="main__employer-page-two-item-text-body"> 116 <div class="main__employer-page-two-item-text-body">
96 {!! $Q->contacts_emails !!} 117 {!! $Q->contacts_emails !!}
97 </div> 118 </div>
98 <div class="main__employer-page-two-item-text"> 119 <div class="main__employer-page-two-item-text">
99 <div class="main__employer-page-two-item-text-name">Или звоните:</div> 120 <div class="main__employer-page-two-item-text-name">Или звоните:</div>
100 <div class="main__employer-page-two-item-text-body"> 121 <div class="main__employer-page-two-item-text-body">
101 {!! $Q->contacts_telephones !!} 122 {!! $Q->contacts_telephones !!}
102 </div> 123 </div>
103 </div> 124 </div>
104 125
105 <div class="main__employer-page-two-item-tags"> 126 <div class="main__employer-page-two-item-tags">
106 @if (!empty($Q->jobs_code[0]->position_ship)) 127 @if (!empty($Q->jobs_code[0]->position_ship))
107 <span class="main__employer-page-two-item-tag">#{{ $Q->jobs_code[0]->position_ship }}</span> 128 <span class="main__employer-page-two-item-tag">#{{ $Q->jobs_code[0]->position_ship }}</span>
108 @else 129 @else
109 @if (isset($Q->jobs)) 130 @if (isset($Q->jobs))
110 @foreach ($Q->jobs as $key => $j) 131 @foreach ($Q->jobs as $key => $j)
111 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span> 132 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span>
112 @endforeach 133 @endforeach
113 @endif 134 @endif
114 @endif 135 @endif
115 </div> 136 </div>
116 <br> 137 <br>
117 <div class="main__employer-page-two-item-buttons"> 138 <div class="main__employer-page-two-item-buttons">
118 <button type="button" class="button main__employer-page-two-item-button">Откликнуться</button> 139 @guest
140 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
141 class="button main__employer-page-two-item-button">Откликнуться</button>
142 @else
143 @if (App\Classes\StatusUser::Status()==1)
144 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
145 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
146 @else
147 <button type="button" data-fancybox data-src="#send2" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}" data-options='{"touch":false,"autoFocus":false}'
148 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
149 @endif
150 @endguest
119 </div> 151 </div>
120 <div class="main__employer-page-two-item-bottom"> 152 <div class="main__employer-page-two-item-bottom">
121 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div> 153 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div>
122 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js_vacancy_favorites js-toggle <?=\App\Classes\RusDate::selected_vacancy($Q->id);?>"> 154 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js_vacancy_favorites js-toggle <?=\App\Classes\RusDate::selected_vacancy($Q->id);?>">
123 <svg> 155 <svg>
124 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 156 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
125 </svg> 157 </svg>
126 </button> 158 </button>
127 </div> 159 </div>
128 160
129 </div> 161 </div>
130 162
131 @endforeach 163 @endforeach
132 164
133 </div> <a href="{{ redirect()->back()->getTargetUrl() }}" class="back"> 165 </div> <a href="{{ redirect()->back()->getTargetUrl() }}" class="back">
134 <svg> 166 <svg>
135 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 167 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
136 </svg> 168 </svg>
137 <span> 169 <span>
138 Вернуться к списку вакансий 170 Вернуться к списку вакансий
139 </span> 171 </span>
140 </a> 172 </a>
141 </main> 173 </main>
142 </div> 174 </div>
143 @endsection 175 @endsection
144 176
resources/views/workers/favorite.blade.php
1 @extends('layout.frontend', ['title' => 'Избранные - РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Избранные - РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 4 @include('js.favorite-vacancy')
5 @endsection 5 @endsection
6 6
7 @section('content') 7 @section('content')
8 <section class="cabinet"> 8 <section class="cabinet">
9 <div class="container"> 9 <div class="container">
10 <ul class="breadcrumbs cabinet__breadcrumbs"> 10 <ul class="breadcrumbs cabinet__breadcrumbs">
11 <li><a href="{{ route('index') }}">Главная</a></li> 11 <li><a href="{{ route('index') }}">Главная</a></li>
12 <li><b>Личный кабинет</b></li> 12 <li><b>Личный кабинет</b></li>
13 </ul> 13 </ul>
14 <div class="cabinet__wrapper"> 14 <div class="cabinet__wrapper">
15 <div class="cabinet__side"> 15 <div class="cabinet__side">
16 <div class="cabinet__side-toper"> 16 <div class="cabinet__side-toper">
17 @include('workers.emblema') 17 @include('workers.emblema')
18 18
19 </div> 19 </div>
20 @include('workers.menu', ['item' => 3]) 20 @include('workers.menu', ['item' => 3])
21 </div> 21 </div>
22 22
23 <div class="cabinet__body"> 23 <div class="cabinet__body">
24 <div class="cabinet__body-item"> 24 <div class="cabinet__body-item">
25 <h2 class="title cabinet__title">Избранные вакансии</h2> 25 <h2 class="title cabinet__title">Избранные вакансии</h2>
26 </div> 26 </div>
27 <div class="cabinet__body-item"> 27 <div class="cabinet__body-item">
28 <div class="cabinet__filters"> 28 <div class="cabinet__filters">
29 <div class="cabinet__filters-item"> 29 <div class="cabinet__filters-item">
30 <form class="search" action="{{ route('worker.colorado') }}" method="GET"> 30 <form class="search" action="{{ route('worker.colorado') }}" method="GET">
31 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;"> 31 <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;">
32 <button type="submit" class="button">Найти</button> 32 <button type="submit" class="button">Найти</button>
33 <span> 33 <span>
34 <svg> 34 <svg>
35 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 35 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
36 </svg> 36 </svg>
37 </span> 37 </span>
38 </form> 38 </form>
39 </div> 39 </div>
40 <div class="cabinet__filters-item"> 40 <div class="cabinet__filters-item">
41 <div class="select"> 41 <div class="select">
42 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 42 <select class="js-select2" id="sort_ajax" name="sort_ajax">
43 <option value="default">Сортировка (по умолчанию)</option> 43 <option value="default">Сортировка (по умолчанию)</option>
44 <option value="name (asc)">По имени (возрастание)</option> 44 <option value="name (asc)">По имени (возрастание)</option>
45 <option value="name (desc)">По имени (убывание)</option> 45 <option value="name (desc)">По имени (убывание)</option>
46 <option value="created_at (asc)">По дате (возрастание)</option> 46 <option value="created_at (asc)">По дате (возрастание)</option>
47 <option value="created_at (desc)">По дате (убывание)</option> 47 <option value="created_at (desc)">По дате (убывание)</option>
48 </select> 48 </select>
49 </div> 49 </div>
50 </div> 50 </div>
51 </div> 51 </div>
52 @if ($Query->count()) 52 @if ($Query->count())
53 <div class="cabinet__vacs"> 53 <div class="cabinet__vacs">
54 <div id="main_ockar" name="main_ockar" class="cabinet__vacs-body" style="width:100%;"> 54 <div id="main_ockar" name="main_ockar" class="cabinet__vacs-body" style="width:100%;">
55 @foreach ($Query as $Q) 55 @foreach ($Query as $Q)
56 <div class="main__vacancies-item main__employer-page-two-item"> 56 <div class="main__vacancies-item main__employer-page-two-item">
57 <a href="" class="back main__employer-page-two-item-back"> 57 <a href="{{ route('list-vacancies') }}" class="back main__employer-page-two-item-back">
58 <svg> 58 <svg>
59 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 59 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
60 </svg> 60 </svg>
61 <span> 61 <span>
62 Вернуться к списку вакансий 62 Вернуться к списку вакансий
63 </span> 63 </span>
64 </a> 64 </a>
65 <div class="main__employer-page-two-item-toper"> 65 <div class="main__employer-page-two-item-toper">
66 @if (isset($Q->employer)) 66 @if (!empty($Q->employer->logo))
67 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}"> 67 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}">
68 @endif 68 @else
69 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Q->employer->name }}" class="main__vacancies-thing-pic">
70 @endif
69 <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span> 71 <span>@if (!empty($Q->name)) {{ $Q->name }} @endif</span>
70 </div> 72 </div>
71 <div class="main__employer-page-two-item-text"> 73 <div class="main__employer-page-two-item-text">
72 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор 74 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор
73 специалистов на следующие должности:</div> 75 специалистов на следующие должности:</div>
74 <div class="main__employer-page-two-item-text-links"> 76 <div class="main__employer-page-two-item-text-links">
75 @if (isset($Q->jobs)) 77 @if (isset($Q->jobs))
76 @foreach ($Q->jobs as $key => $j) 78 @foreach ($Q->jobs as $key => $j)
77 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a> 79 <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a>
78 @endforeach 80 @endforeach
79 @endif 81 @endif
80 </div> 82 </div>
81 </div> 83 </div>
82 <div class="main__employer-page-two-item-text"> 84 <div class="main__employer-page-two-item-text">
83 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 85 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
84 <div class="main__employer-page-two-item-text-body"> 86 <div class="main__employer-page-two-item-text-body">
85 {!! $Q->text !!} 87 {!! $Q->text !!}
86 </div> 88 </div>
87 </div> 89 </div>
88 <div class="main__employer-page-two-item-text"> 90 <div class="main__employer-page-two-item-text">
89 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div> 91 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div>
90 <div class="main__employer-page-two-item-text-body"> 92 <div class="main__employer-page-two-item-text-body">
91 {!! $Q->description !!} 93 {!! $Q->description !!}
92 </div> 94 </div>
93 </div> 95 </div>
94 <div class="main__employer-page-two-item-text"> 96 <div class="main__employer-page-two-item-text">
95 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div> 97 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div>
96 <div class="main__employer-page-two-item-text-body"> 98 <div class="main__employer-page-two-item-text-body">
97 {!! $Q->contacts_emails !!} 99 {!! $Q->contacts_emails !!}
98 </div> 100 </div>
99 </div> 101 </div>
100 <div class="main__employer-page-two-item-text"> 102 <div class="main__employer-page-two-item-text">
101 <div class="main__employer-page-two-item-text-name">Или звоните:</div> 103 <div class="main__employer-page-two-item-text-name">Или звоните:</div>
102 <div class="main__employer-page-two-item-text-body"> 104 <div class="main__employer-page-two-item-text-body">
103 {!! $Q->contacts_telephones !!} 105 {!! $Q->contacts_telephones !!}
104 </div> 106 </div>
105 </div> 107 </div>
106 <div class="main__employer-page-two-item-tags"> 108 <div class="main__employer-page-two-item-tags">
107 @if (isset($Q->jobs)) 109 @if (isset($Q->jobs))
108 @foreach ($Q->jobs as $key => $j) 110 @foreach ($Q->jobs as $key => $j)
109 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span> 111 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span>
110 @endforeach 112 @endforeach
111 @endif 113 @endif
112 </div> 114 </div>
113 <div class="main__employer-page-two-item-buttons"> 115 <div class="main__employer-page-two-item-buttons">
114 <button type="button" 116 <button type="button"
115 class="button main__employer-page-two-item-button">Откликнуться</button> 117 class="button main__employer-page-two-item-button">Откликнуться</button>
116 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a> 118 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a>
117 </div> 119 </div>
118 <div class="main__employer-page-two-item-bottom"> 120 <div class="main__employer-page-two-item-bottom">
119 <div class="main__employer-page-two-item-bottom-date">{{ $Q->created_at }}</div> 121 <div class="main__employer-page-two-item-bottom-date">{{ $Q->created_at }}</div>
120 <button type="button" class="like main__employer-page-two-item-bottom-like js-toggle"> 122 <button type="button" class="like main__employer-page-two-item-bottom-like js-toggle js_vacancy_favorites <?=App\Classes\Cookies_vacancy::selected_vacancy($Q->id);?>">
121 <svg> 123 <svg>
122 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 124 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
123 </svg> 125 </svg>
124 </button> 126 </button>
125 </div> 127 </div>
126 </div> 128 </div>
127 @endforeach 129 @endforeach
128 <div style="margin-top: 20px"> 130 <div style="margin-top: 20px">
129 {{ $Query->appends($_GET)->links('paginate') }} 131 {{ $Query->appends($_GET)->links('paginate') }}
130 </div> 132 </div>
131 </div> 133 </div>
132 @else 134 @else
133 <div class="notify"> 135 <div class="notify">
134 <svg> 136 <svg>
135 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use> 137 <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use>
136 </svg> 138 </svg>
137 <span>Нет избранных работодателей</span> 139 <span>Нет избранных работодателей</span>
138 </div> 140 </div>
139 @endif 141 @endif
140 </div> 142 </div>
141 </div> 143 </div>
142 </div> 144 </div>
143 </div> 145 </div>
144 </section> 146 </section>
145 </div> 147 </div>
146 148
147 @endsection 149 @endsection
148 150
1 <?php 1 <?php
2 2
3 use App\Http\Controllers\AdEmployerController; 3 use App\Http\Controllers\AdEmployerController;
4 use App\Http\Controllers\Admin\AdminController; 4 use App\Http\Controllers\Admin\AdminController;
5 use App\Http\Controllers\Admin\CategoryController; 5 use App\Http\Controllers\Admin\CategoryController;
6 use App\Http\Controllers\Admin\CategoryEmpController; 6 use App\Http\Controllers\Admin\CategoryEmpController;
7 use App\Http\Controllers\Admin\EducationController; 7 use App\Http\Controllers\Admin\EducationController;
8 use App\Http\Controllers\Admin\EmployersController; 8 use App\Http\Controllers\Admin\EmployersController;
9 use App\Http\Controllers\EmployerController as FrontEmployersController; 9 use App\Http\Controllers\EmployerController as FrontEmployersController;
10 use App\Http\Controllers\Admin\InfoBloksController; 10 use App\Http\Controllers\Admin\InfoBloksController;
11 use App\Http\Controllers\Admin\JobTitlesController; 11 use App\Http\Controllers\Admin\JobTitlesController;
12 use App\Http\Controllers\Admin\UsersController; 12 use App\Http\Controllers\Admin\UsersController;
13 use App\Http\Controllers\Admin\WorkersController; 13 use App\Http\Controllers\Admin\WorkersController;
14 use App\Http\Controllers\Auth\ForgotPasswordController; 14 use App\Http\Controllers\Auth\ForgotPasswordController;
15 use App\Http\Controllers\Auth\LoginController; 15 use App\Http\Controllers\Auth\LoginController;
16 use App\Http\Controllers\Auth\RegisterController; 16 use App\Http\Controllers\Auth\RegisterController;
17 use App\Http\Controllers\CKEditorController; 17 use App\Http\Controllers\CKEditorController;
18 use App\Http\Controllers\MediaController; 18 use App\Http\Controllers\MediaController;
19 use App\Http\Controllers\WorkerController; 19 use App\Http\Controllers\WorkerController;
20 use App\Models\User; 20 use App\Models\User;
21 use App\Http\Controllers\MainController; 21 use App\Http\Controllers\MainController;
22 use App\Http\Controllers\HomeController; 22 use App\Http\Controllers\HomeController;
23 use Illuminate\Support\Facades\Route; 23 use Illuminate\Support\Facades\Route;
24 use App\Http\Controllers\Admin\CompanyController; 24 use App\Http\Controllers\Admin\CompanyController;
25 use App\Http\Controllers\Admin\Ad_EmployersController; 25 use App\Http\Controllers\Admin\Ad_EmployersController;
26 use App\Http\Controllers\Admin\MsgAnswersController; 26 use App\Http\Controllers\Admin\MsgAnswersController;
27 use App\Http\Controllers\Admin\GroupsController; 27 use App\Http\Controllers\Admin\GroupsController;
28 use App\Http\Controllers\PagesController; 28 use App\Http\Controllers\PagesController;
29 use Illuminate\Support\Facades\Storage; 29 use Illuminate\Support\Facades\Storage;
30 use App\Http\Controllers\EmployerController; 30 use App\Http\Controllers\EmployerController;
31 use App\Http\Controllers\CompanyController as FrontCompanyController; 31 use App\Http\Controllers\CompanyController as FrontCompanyController;
32 32
33 33
34 /* 34 /*
35 |-------------------------------------------------------------------------- 35 |--------------------------------------------------------------------------
36 | Web Routes 36 | Web Routes
37 |-------------------------------------------------------------------------- 37 |--------------------------------------------------------------------------
38 | 38 |
39 | Here is where you can register web routes for your application. These 39 | Here is where you can register web routes for your application. These
40 | routes are loaded by the RouteServiceProvider within a group which 40 | routes are loaded by the RouteServiceProvider within a group which
41 | contains the "web" middleware group. Now create something great! 41 | contains the "web" middleware group. Now create something great!
42 | 42 |
43 */ 43 */
44 /* 44 /*
45 Route::get('/', function () { 45 Route::get('/', function () {
46 return view('welcome'); 46 return view('welcome');
47 })->name('index'); 47 })->name('index');
48 */ 48 */
49 49
50 Route::get('/', [MainController::class, 'index'])->name('index'); 50 Route::get('/', [MainController::class, 'index'])->name('index');
51 51
52 //Роуты авторизации, регистрации, восстановления, аутентификации 52 //Роуты авторизации, регистрации, восстановления, аутентификации
53 Auth::routes(['verify' => true]); 53 Auth::routes(['verify' => true]);
54 54
55 // роуты регистрации, авторизации, восстановления пароля, верификации почты 55 // роуты регистрации, авторизации, восстановления пароля, верификации почты
56 /*Route::group([ 56 /*Route::group([
57 'as' => 'auth.', //имя маршрута, например auth.index 57 'as' => 'auth.', //имя маршрута, например auth.index
58 'prefix' => 'auth', // префикс маршрута, например, auth/index 58 'prefix' => 'auth', // префикс маршрута, например, auth/index
59 ], function () { 59 ], function () {
60 //форма регистрации 60 //форма регистрации
61 Route::get('register', [RegisterController::class, 'register'])->name('register'); 61 Route::get('register', [RegisterController::class, 'register'])->name('register');
62 62
63 //создание пользователя 63 //создание пользователя
64 Route::post('register', [RegisterController::class, 'create'])->name('create'); 64 Route::post('register', [RegisterController::class, 'create'])->name('create');
65 65
66 //форма входа авторизации 66 //форма входа авторизации
67 Route::get('login', [LoginController::class, 'login'])->name('login'); 67 Route::get('login', [LoginController::class, 'login'])->name('login');
68 68
69 //аутентификация 69 //аутентификация
70 Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); 70 Route::post('login', [LoginController::class, 'authenticate'])->name('auth');
71 71
72 //выход 72 //выход
73 Route::get('logout', [LoginController::class, 'logout'])->name('logout'); 73 Route::get('logout', [LoginController::class, 'logout'])->name('logout');
74 74
75 //форма ввода адреса почты 75 //форма ввода адреса почты
76 Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); 76 Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form');
77 77
78 //письмо на почту 78 //письмо на почту
79 Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); 79 Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail');
80 80
81 //форма восстановления пароля 81 //форма восстановления пароля
82 Route::get('reset-password/token/{token}/email/{email}', 82 Route::get('reset-password/token/{token}/email/{email}',
83 [ResetPasswordController::class, 'form'] 83 [ResetPasswordController::class, 'form']
84 )->name('reset-form'); 84 )->name('reset-form');
85 85
86 //восстановление пароля 86 //восстановление пароля
87 Route::post('reset-password', 87 Route::post('reset-password',
88 [ResetPasswordController::class, 'reset'] 88 [ResetPasswordController::class, 'reset']
89 )->name('reset-password'); 89 )->name('reset-password');
90 90
91 //сообщение о необходимости проверки адреса почты 91 //сообщение о необходимости проверки адреса почты
92 Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); 92 Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message');
93 93
94 //подтверждение адреса почты нового пользователя 94 //подтверждение адреса почты нового пользователя
95 Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) 95 Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify'])
96 ->where('token', '[a-f0-9]{32}') 96 ->where('token', '[a-f0-9]{32}')
97 ->where('id', '[0-9]+') 97 ->where('id', '[0-9]+')
98 ->name('verify-email'); 98 ->name('verify-email');
99 });*/ 99 });*/
100 100
101 //Личный кабинет пользователя 101 //Личный кабинет пользователя
102 Route::get('/home', [HomeController::class, 'index'])->name('home'); 102 Route::get('/home', [HomeController::class, 'index'])->name('home');
103 103
104 /* 104 /*
105 Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { 105 Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) {
106 $user = User::where('email',$request->input('email'))->first(); 106 $user = User::where('email',$request->input('email'))->first();
107 107
108 $user->sendEmailVerificationNotification(); 108 $user->sendEmailVerificationNotification();
109 109
110 return 'your response'; 110 return 'your response';
111 })->middleware('throttle:6,1')->name('verification.resend'); 111 })->middleware('throttle:6,1')->name('verification.resend');
112 */ 112 */
113 113
114 // Авторизация, регистрация в админку 114 // Авторизация, регистрация в админку
115 Route::group([ 115 Route::group([
116 'as' => 'admin.', // имя маршрута, например auth.index 116 'as' => 'admin.', // имя маршрута, например auth.index
117 'prefix' => 'admin', // префикс маршрута, например auth/index 117 'prefix' => 'admin', // префикс маршрута, например auth/index
118 'middleware' => ['guest'], 118 'middleware' => ['guest'],
119 ], function () { 119 ], function () {
120 // Форма регистрации 120 // Форма регистрации
121 Route::get('register', [AdminController::class, 'register'])->name('register'); 121 Route::get('register', [AdminController::class, 'register'])->name('register');
122 // Создание пользователя 122 // Создание пользователя
123 Route::post('register', [AdminController::class, 'create'])->name('create'); 123 Route::post('register', [AdminController::class, 'create'])->name('create');
124 124
125 //Форма входа 125 //Форма входа
126 Route::get('login', [AdminController::class, 'login'])->name('login'); 126 Route::get('login', [AdminController::class, 'login'])->name('login');
127 127
128 // аутентификация 128 // аутентификация
129 Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); 129 Route::post('login', [AdminController::class, 'autenticate'])->name('auth');
130 130
131 }); 131 });
132 132
133 // Личный кабинет админки 133 // Личный кабинет админки
134 Route::group([ 134 Route::group([
135 'as' => 'admin.', // имя маршрута, например auth.index 135 'as' => 'admin.', // имя маршрута, например auth.index
136 'prefix' => 'admin', // префикс маршрута, например auth/index 136 'prefix' => 'admin', // префикс маршрута, например auth/index
137 'middleware' => ['auth'], ['admin'], 137 'middleware' => ['auth'], ['admin'],
138 ], function() { 138 ], function() {
139 139
140 // выход 140 // выход
141 Route::get('logout', [AdminController::class, 'logout'])->name('logout'); 141 Route::get('logout', [AdminController::class, 'logout'])->name('logout');
142 142
143 // кабинет главная страница 143 // кабинет главная страница
144 Route::get('cabinet', [AdminController::class, 'index'])->name('index'); 144 Route::get('cabinet', [AdminController::class, 'index'])->name('index');
145 145
146 // кабинет профиль админа - форма 146 // кабинет профиль админа - форма
147 Route::get('profile', [AdminController::class, 'profile'])->name('profile'); 147 Route::get('profile', [AdminController::class, 'profile'])->name('profile');
148 // кабинет профиль админа - сохранение формы 148 // кабинет профиль админа - сохранение формы
149 Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); 149 Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile');
150 150
151 //кабинет сообщения админа 151 //кабинет сообщения админа
152 //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); 152 //Route::get('messages', [AdminController::class, 'profile'])->name('profile');
153 153
154 154
155 // кабинет профиль - форма пароли 155 // кабинет профиль - форма пароли
156 Route::get('password', [AdminController::class, 'profile_password'])->name('password'); 156 Route::get('password', [AdminController::class, 'profile_password'])->name('password');
157 // кабинет профиль - сохранение формы пароля 157 // кабинет профиль - сохранение формы пароля
158 Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); 158 Route::post('password', [AdminController::class, 'profile_password_new'])->name('password');
159 159
160 160
161 // кабинет профиль пользователя - форма 161 // кабинет профиль пользователя - форма
162 Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); 162 Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile');
163 // кабинет профиль пользователя - сохранение формы 163 // кабинет профиль пользователя - сохранение формы
164 Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); 164 Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile');
165 165
166 // кабинет профиль работодатель - форма 166 // кабинет профиль работодатель - форма
167 Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); 167 Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile');
168 // кабинет профиль работодатель - сохранение формы 168 // кабинет профиль работодатель - сохранение формы
169 Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); 169 Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile');
170 // кабинет удаление профиль работодателя и юзера 170 // кабинет удаление профиль работодателя и юзера
171 Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); 171 Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer');
172 172
173 // кабинет профиль работник - форма 173 // кабинет профиль работник - форма
174 Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); 174 Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add');
175 Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); 175 Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store');
176 Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); 176 Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit');
177 // кабинет профиль работник - сохранение формы 177 // кабинет профиль работник - сохранение формы
178 Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); 178 Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update');
179 179
180 // Медиа 180 // Медиа
181 Route::get('media', [MediaController::class, 'index'])->name('media'); 181 Route::get('media', [MediaController::class, 'index'])->name('media');
182 Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media'); 182 Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media');
183 183
184 // кабинет настройки сайта - форма 184 // кабинет настройки сайта - форма
185 Route::get('config', [AdminController::class, 'config_form'])->name('config'); 185 Route::get('config', [AdminController::class, 'config_form'])->name('config');
186 // кабинет настройки сайта сохранение формы 186 // кабинет настройки сайта сохранение формы
187 Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); 187 Route::post('config', [AdminController::class, 'store_config'])->name('store_config');
188 188
189 // кабинет - пользователи 189 // кабинет - пользователи
190 Route::get('users', [UsersController::class, 'index'])->name('users'); 190 Route::get('users', [UsersController::class, 'index'])->name('users');
191 191
192 // кабинет - пользователи 192 // кабинет - пользователи
193 Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); 193 Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users');
194 194
195 // кабинет - работодатели 195 // кабинет - работодатели
196 Route::get('employers', [EmployersController::class, 'index'])->name('employers'); 196 Route::get('employers', [EmployersController::class, 'index'])->name('employers');
197 197
198 Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); 198 Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer');
199 199
200 Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add'); 200 Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add');
201 Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save'); 201 Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save');
202 Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot'); 202 Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot');
203 Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit'); 203 Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit');
204 Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete'); 204 Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete');
205 205
206 // кабинет - соискатели 206 // кабинет - соискатели
207 Route::get('workers', [WorkersController::class, 'index'])->name('workers'); 207 Route::get('workers', [WorkersController::class, 'index'])->name('workers');
208 208
209 // кабинет - база данных 209 // кабинет - база данных
210 Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); 210 Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata');
211 Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); 211 Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata');
212 Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); 212 Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata');
213 Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); 213 Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata');
214 Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); 214 Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata');
215 Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); 215 Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata');
216 Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); 216 Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata');
217 217
218 // кабинет - вакансии 218 // кабинет - вакансии
219 Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); 219 Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers');
220 Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers'); 220 Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers');
221 Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers'); 221 Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers');
222 Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); 222 Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers');
223 Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); 223 Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers');
224 Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer'); 224 Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer');
225 225
226 // Редактирование должности в вакансии 226 // Редактирование должности в вакансии
227 Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs'); 227 Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs');
228 Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs'); 228 Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs');
229 229
230 230
231 // кабинет - категории 231 // кабинет - категории
232 //Route::get('categories', [AdminController::class, 'index'])->name('categories'); 232 //Route::get('categories', [AdminController::class, 'index'])->name('categories');
233 /* 233 /*
234 * CRUD-операции над Справочником Категории 234 * CRUD-операции над Справочником Категории
235 */ 235 */
236 Route::resource('categories', CategoryController::class, ['except' => ['show']]); 236 Route::resource('categories', CategoryController::class, ['except' => ['show']]);
237 237
238 // CRUD-операции над справочником Категории для работодателей 238 // CRUD-операции над справочником Категории для работодателей
239 Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); 239 Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]);
240 240
241 // CRUD-операции над справочником Образование 241 // CRUD-операции над справочником Образование
242 Route::resource('education', EducationController::class, ['except' => ['show']]); 242 Route::resource('education', EducationController::class, ['except' => ['show']]);
243 243
244 Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education'); 244 Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education');
245 Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); 245 Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education');
246 Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); 246 Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education');
247 247
248 Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); 248 Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education');
249 Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education'); 249 Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education');
250 250
251 Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); 251 Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education');
252 252
253 //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); 253 //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles');
254 /* 254 /*
255 * кабинет - CRUD-операции по справочнику должности 255 * кабинет - CRUD-операции по справочнику должности
256 * 256 *
257 */ 257 */
258 Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); 258 Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]);
259 259
260 // кабинет - сообщения (чтение чужих) 260 // кабинет - сообщения (чтение чужих)
261 Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); 261 Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages');
262 // кабинет - просмотр сообщения чужого (чтение) 262 // кабинет - просмотр сообщения чужого (чтение)
263 Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); 263 Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message');
264 264
265 // кабинет - сообщения (админские) 265 // кабинет - сообщения (админские)
266 Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); 266 Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages');
267 // кабинет - сообщения (админские) 267 // кабинет - сообщения (админские)
268 Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); 268 Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post');
269 // кабинет - sql - конструкция запросов 269 // кабинет - sql - конструкция запросов
270 Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); 270 Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql');
271 271
272 /* 272 /*
273 * Расписанный подход в описании каждой директорий групп пользователей. 273 * Расписанный подход в описании каждой директорий групп пользователей.
274 */ 274 */
275 // кабинет - группы пользователей 275 // кабинет - группы пользователей
276 Route::get('groups', [GroupsController::class, 'index'])->name('groups'); 276 Route::get('groups', [GroupsController::class, 'index'])->name('groups');
277 // кабинет - добавление форма группы пользователей 277 // кабинет - добавление форма группы пользователей
278 Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); 278 Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group');
279 // кабинет - сохранение формы группы пользователей 279 // кабинет - сохранение формы группы пользователей
280 Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); 280 Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store');
281 // кабинет - редактирование форма группы пользователей 281 // кабинет - редактирование форма группы пользователей
282 Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); 282 Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group');
283 // кабинет - сохранение редактированной формы группы пользователей 283 // кабинет - сохранение редактированной формы группы пользователей
284 Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); 284 Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group');
285 // кабинет - удаление группы пользователей 285 // кабинет - удаление группы пользователей
286 Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); 286 Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group');
287 287
288 288
289 // кабинет - список админов 289 // кабинет - список админов
290 Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); 290 Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin');
291 291
292 292
293 /////редактор////// кабинет - редактор сайта//////////////////////// 293 /////редактор////// кабинет - редактор сайта////////////////////////
294 Route::get('editor-site', function() { 294 Route::get('editor-site', function() {
295 return view('admin.editor.index'); 295 return view('admin.editor.index');
296 })->name('editor-site'); 296 })->name('editor-site');
297 297
298 298
299 // кабинет - редактор шапки-футера сайта 299 // кабинет - редактор шапки-футера сайта
300 Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); 300 Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks');
301 Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); 301 Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block');
302 Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); 302 Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store');
303 Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); 303 Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block');
304 Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); 304 Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block');
305 Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); 305 Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block');
306 Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); 306 Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block');
307 307
308 308
309 // кабинет - редактор должности на главной 309 // кабинет - редактор должности на главной
310 Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); 310 Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main');
311 311
312 // кабинет - редактор работодатели на главной 312 // кабинет - редактор работодатели на главной
313 Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); 313 Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main');
314 314
315 315
316 // кабинет - редактор seo-сайта 316 // кабинет - редактор seo-сайта
317 Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); 317 Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo');
318 Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); 318 Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo');
319 Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); 319 Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store');
320 Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); 320 Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo');
321 Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); 321 Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo');
322 Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); 322 Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo');
323 Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); 323 Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo');
324 324
325 325
326 // кабинет - редактор страниц 326 // кабинет - редактор страниц
327 Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); 327 Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages');
328 // кабинет - добавление страницы 328 // кабинет - добавление страницы
329 Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); 329 Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page');
330 // кабинет - сохранение формы страницы 330 // кабинет - сохранение формы страницы
331 Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); 331 Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store');
332 // кабинет - редактирование форма страницы 332 // кабинет - редактирование форма страницы
333 Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); 333 Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page');
334 // кабинет - сохранение редактированной формы страницы 334 // кабинет - сохранение редактированной формы страницы
335 Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); 335 Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page');
336 // кабинет - удаление страницы 336 // кабинет - удаление страницы
337 Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); 337 Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page');
338 338
339 339
340 // кабинет - реклама сайта 340 // кабинет - реклама сайта
341 Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); 341 Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames');
342 Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); 342 Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames');
343 Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); 343 Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store');
344 Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); 344 Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames');
345 Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); 345 Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames');
346 Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); 346 Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames');
347 //////////////////////////////////////////////////////////////////////// 347 ////////////////////////////////////////////////////////////////////////
348 348
349 349
350 // кабинет - отзывы о работодателе для модерации 350 // кабинет - отзывы о работодателе для модерации
351 Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); 351 Route::get('answers', [EmployersController::class, 'answers'])->name('answers');
352 352
353 // Общая страница статистики 353 // Общая страница статистики
354 Route::get('statics', function () { 354 Route::get('statics', function () {
355 return view('admin.static.index'); 355 return view('admin.static.index');
356 })->name('statics'); 356 })->name('statics');
357 357
358 // кабинет - статистика работников 358 // кабинет - статистика работников
359 Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); 359 Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers');
360 360
361 // кабинет - статистика вакансий работодателя 361 // кабинет - статистика вакансий работодателя
362 Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); 362 Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads');
363 363
364 // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника 364 // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника
365 /* 365 /*
366 * CRUD-операции над справочником дипломы и документы 366 * CRUD-операции над справочником дипломы и документы
367 */ 367 */
368 //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); 368 //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks');
369 Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); 369 Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]);
370 370
371 // кабинет - роли пользователя 371 // кабинет - роли пользователя
372 Route::get('roles', [UsersController::class, 'roles'])->name('roles'); 372 Route::get('roles', [UsersController::class, 'roles'])->name('roles');
373 373
374 Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles'); 374 Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles');
375 375
376 Route::get('logs', function() { 376 Route::get('logs', function() {
377 $files = Storage::files('logs/laravel.log'); 377 $files = Storage::files('logs/laravel.log');
378 })->name('logs'); 378 })->name('logs');
379 }); 379 });
380 380
381 // Инструментальные страницы 381 // Инструментальные страницы
382 Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); 382 Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload');
383 383
384 Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); 384 Route::get('redis/', [PagesController::class, 'redis'])->name('redis');
385 385
386 Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); 386 Route::get('excel/', [PagesController::class, 'excel'])->name('excel');
387 387
388 // Страницы с произвольным контентом 388 // Страницы с произвольным контентом
389 Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); 389 Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page');
390 390
391 // Публичные страницы соискателя 391 // Публичные страницы соискателя
392 Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); 392 Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page');
393 393
394 //Страница вакансии 394 //Страница вакансии
395 Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); 395 Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer');
396 396
397 //Вакансии 397 //Вакансии
398 Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies'); 398 Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies');
399 399
400 //Вакансии поиск на главной 400 //Вакансии поиск на главной
401 Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies'); 401 Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies');
402 402
403 //Вакансии категория детальная 403 //Вакансии категория детальная
404 Route::get('list-vacancies/{categories}', [MainController::class, 'list_vacancies'])->name('list-vacancies'); 404 Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies');
405 405
406 //Детальная страница вакансии - работодателя 406 //Детальная страница вакансии - работодателя
407 Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie'); 407 Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie');
408 408
409 //Судоходные компании 409 //Судоходные компании
410 Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies'); 410 Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies');
411 411
412 //Детальная инфа о компании 412 //Детальная инфа о компании
413 Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company'); 413 Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company');
414 414
415 //Образование 415 //Образование
416 Route::get('education', [MainController::class, 'education'])->name('education'); 416 Route::get('education', [MainController::class, 'education'])->name('education');
417 417
418 //Новости 418 //Новости
419 Route::get('news', [MainController::class, 'news'])->name('news'); 419 Route::get('news', [MainController::class, 'news'])->name('news');
420 Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new'); 420 Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new');
421 421
422 //Контакты 422 //Контакты
423 Route::get('contacts', [MainController::class, 'contacts'])->name('contacts'); 423 Route::get('contacts', [MainController::class, 'contacts'])->name('contacts');
424 424
425 //База резюме 425 //База резюме
426 Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume'); 426 Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume');
427 427
428 //Анкета соискателя 428 //Анкета соискателя
429 Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile'); 429 Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile');
430 430
431 //Скачать резюме 431 //Скачать резюме
432 Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download'); 432 Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download');
433 433
434 //Вход в кабинет 434 //Вход в кабинет
435 Route::get('login', [MainController::class, 'input_login'])->name('login'); 435 Route::get('login', [MainController::class, 'input_login'])->name('login');
436 436
437 // Выход из кабинета 437 // Выход из кабинета
438 Route::get('logout', [EmployerController::class, 'logout'])->name('logout'); 438 Route::get('logout', [EmployerController::class, 'logout'])->name('logout');
439 439
440 Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker'); 440 Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker');
441 Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer'); 441 Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer');
442 442
443 //восстановление пароля 443 //восстановление пароля
444 Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password'); 444 Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password');
445 // Звезда сообщения 445 // Звезда сообщения
446 Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer'); 446 Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer');
447 447
448 // Борьба 448 // Борьба
449 Route::get('clear_cookie', function() { 449 Route::get('clear_cookie', function() {
450 \App\Classes\Cookies_vacancy::clear_vacancy(); 450 \App\Classes\Cookies_vacancy::clear_vacancy();
451 return redirect()->route('index'); 451 return redirect()->route('index');
452 })->name('clear_cookie'); 452 })->name('clear_cookie');
453 453
454 // Личный кабинет работника 454 // Личный кабинет работника
455 Route::group([ 455 Route::group([
456 'as' => 'worker.', // имя маршрута, например auth.index 456 'as' => 'worker.', // имя маршрута, например auth.index
457 'prefix' => 'worker', // префикс маршрута, например auth/index 457 'prefix' => 'worker', // префикс маршрута, например auth/index
458 'middleware' => ['auth'], ['is_worker'], 458 'middleware' => ['auth'], ['is_worker'],
459 ], function() { 459 ], function() {
460 // 1 страница - Моя анкета 460 // 1 страница - Моя анкета
461 Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); 461 Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet');
462 Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); 462 Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save');
463 463
464 // 2 страница - Сообщения 464 // 2 страница - Сообщения
465 Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); 465 Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages');
466 Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog'); 466 Route::get('cabinet/dialog/{user1}/{user2}', [WorkerController::class, 'dialog'])->name('dialog');
467 // 3 страница - Избранные вакансии 467 // 3 страница - Избранные вакансии
468 Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); 468 Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite');
469 // Продолжение борьбы против колорадов - избранные вакансии 469 // Продолжение борьбы против колорадов - избранные вакансии
470 Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); 470 Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado');
471 471
472 // 4 страница - Сменить пароль 472 // 4 страница - Сменить пароль
473 Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); 473 Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password');
474 Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password'); 474 Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password');
475 475
476 // 5 страница - Удалить профиль 476 // 5 страница - Удалить профиль
477 Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); 477 Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile');
478 Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); 478 Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result');
479 479
480 // Резюме -pdf 480 // Резюме -pdf
481 Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); 481 Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download');
482 482
483 // Поднятие анкеты 483 // Поднятие анкеты
484 Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); 484 Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up');
485 485
486 // Добавление сертификата 486 // Добавление сертификата
487 Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); 487 Route::get('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate');
488 Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); 488 Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate');
489 489
490 // Добавление документа-диплома 490 // Добавление документа-диплома
491 Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); 491 Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom');
492 Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); 492 Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save');
493 493
494 // Добавление стандартного диплома 494 // Добавление стандартного диплома
495 Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); 495 Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document');
496 Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); 496 Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save');
497 Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); 497 Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document');
498 Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); 498 Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save');
499 Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); 499 Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document');
500 500
501 // Отправка сообщения работодателю от соискателя 501 // Отправка сообщения работодателю от соискателя
502 Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message'); 502 Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message');
503 }); 503 });
504 504
505 // Личный кабинет работодателя 505 // Личный кабинет работодателя
506 Route::group([ 506 Route::group([
507 'as' => 'employer.', // имя маршрута, например auth.index 507 'as' => 'employer.', // имя маршрута, например auth.index
508 'prefix' => 'employer', // префикс маршрута, например auth/index 508 'prefix' => 'employer', // префикс маршрута, например auth/index
509 'middleware' => ['auth'], !['is_worker'], 509 'middleware' => ['auth'], !['is_worker'],
510 ], function() { 510 ], function() {
511 // 1 страница - Профиль 511 // 1 страница - Профиль
512 Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); 512 Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet');
513 Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); 513 Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save');
514 Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); 514 Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot');
515 Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); 515 Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot');
516 516
517 // 2 страница - Добавление вакансий 517 // 2 страница - Добавление вакансий
518 Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); 518 Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie');
519 Route::post('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancy_save'])->name('vacancy_save'); 519 Route::post('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancy_save'])->name('vacancy_save');
520 Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); 520 Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save');
521 521
522 // 3 страница - Мои вакансии 522 // 3 страница - Мои вакансии
523 Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); 523 Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list');
524 Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); 524 Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit');
525 Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); 525 Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete');
526 Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); 526 Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up');
527 Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); 527 Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye');
528 Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); 528 Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit');
529 Route::post('cabinet/vacancy-edit/{ad_employer}/', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); 529 Route::post('cabinet/vacancy-edit/{ad_employer}/', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me');
530 530
531 // 4 страница - Отклики на вакансии 531 // 4 страница - Отклики на вакансии
532 Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); 532 Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers');
533 Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); 533 Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple');
534 Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); 534 Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg');
535 535
536 // 5 страница - Сообщения 536 // 5 страница - Сообщения
537 Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); 537 Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages');
538 Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog'); 538 Route::get('cabinet/dialog/{user1}/{user2}', [EmployerController::class, 'dialog'])->name('dialog');
539 Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); 539 Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message');
540 Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); 540 Route::post('test123', [EmployerController::class, 'test123'])->name('test123');
541 541
542 // 6 страница - Избранный 542 // 6 страница - Избранный
543 Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); 543 Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites');
544 544
545 //7 страница - База данных 545 //7 страница - База данных
546 Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); 546 Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd');
547 547
548 //8 страница - База резюме 548 //8 страница - База резюме
549 Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); 549 Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe');
550 550
551 // 9 рассылка сообщений 551 // 9 рассылка сообщений
552 Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); 552 Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages');
553 Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); 553 Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post');
554 554
555 // 10 страница FAQ вопросы 555 // 10 страница FAQ вопросы
556 Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq'); 556 Route::get('cabinet/faq', [EmployerController::class, 'faq'])->name('faq');
557 557
558 // 11 страница - Настройка уведомлений 558 // 11 страница - Настройка уведомлений
559 Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); 559 Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe');
560 Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); 560 Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe');
561 561
562 // 12 страница - Сменить пароль 562 // 12 страница - Сменить пароль
563 Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); 563 Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset');
564 Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); 564 Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password');
565 565
566 // 13 страница - Удаление профиля 566 // 13 страница - Удаление профиля
567 Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); 567 Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people');
568 Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); 568 Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user');
569 Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); 569 Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user');
570 570
571 // Отправил сообщение 571 // Отправил сообщение
572 Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); 572 Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message');
573 }); 573 });
574 574