Commit 4a6e91624fbd93276f2de6fe53c4568378de32be

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

Коммит по кабинету

Showing 12 changed files with 51 additions and 19 deletions Inline Diff

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