Commit ad0b69c97b88a3c01fe1b4b8c9a75a1f4ebdddfb

Authored by Fedor
1 parent 088323a407
Exists in master

task-132687 tasks 73.3 73.4 73.6 90 91 94 95 96 97 98 99 100, half of 82

Showing 30 changed files with 499 additions and 465 deletions Inline Diff

app/Classes/LikesClass.php
1 <?php 1 <?php
2 2
3 3
4 namespace App\Classes; 4 namespace App\Classes;
5 5
6 6
7 use App\Models\Ad_employer; 7 use App\Models\Ad_employer;
8 use App\Models\Like_vacancy; 8 use App\Models\Like_vacancy;
9 use App\Models\Like_worker; 9 use App\Models\Like_worker;
10 use App\Models\Worker; 10 use App\Models\Worker;
11 use Illuminate\Support\Facades\Auth;
11 12
12 class LikesClass 13 class LikesClass
13 { 14 {
14 // Вывод всех избранных вакансий у пользователя
15 public static function ListVacancy(Ad_employer $ad_employer) { 15 public static function ListVacancy(Ad_employer $ad_employer) {
16 $ListVacancy = Like_vacancy::query()->where('code_record', '=', $ad_employer->id)->get(); 16 $ListVacancy = Like_vacancy::query()
17 ->where('code_record', '=', $ad_employer->id)
18 ->where('user_id', Auth::user()?->id)
19 ->get();
20
17 return $ListVacancy; 21 return $ListVacancy;
18 } 22 }
19 23
20 // Вывод всех избранных работников у пользователя
21 public static function ListWorkers(Worker $worker) { 24 public static function ListWorkers(Worker $worker) {
22 $ListWorker = Like_worker::query()->where('code_record', '=', $worker->id)->get(); 25 $ListWorker = Like_worker::query()
26 ->where('code_record', '=', $worker->id)
27 ->where('user_id', Auth::user()?->id)
28 ->get();
29
30 return $ListWorker;
23 } 31 }
24 32
25 // Возвращение кода вакансии
26 public static function get_status_vacancy(Ad_employer $ad_employer) { 33 public static function get_status_vacancy(Ad_employer $ad_employer) {
27 if (Like_vacancy::query()->where('code_record', '=', $ad_employer->id)->count() > 0) 34 $isVacancyLiked = Like_worker::query()
28 $IdVacancy = " active "; 35 ->where('code_record', $ad_employer->id)
29 else 36 ->where('user_id', Auth::user()?->id)
30 $IdVacancy = ""; 37 ->exists();
31 38
32 return $IdVacancy; 39 if ($isVacancyLiked) {
40 return 'active';
41 }
42
43 return '';
33 } 44 }
34 45
35 public static function get_status_worker(Worker $worker) { 46 public static function get_status_worker(Worker $worker) {
36 if (Like_worker::query()->where('code_record', '=', $worker->id)->count() > 0) 47 $isWorkerLiked = Like_worker::query()
37 { $IdWorker = " active"; } else { $IdWorker = "123"; } 48 ->where('code_record', $worker->id)
49 ->where('user_id', Auth::user()?->id)
50 ->exists();
51
52 if ($isWorkerLiked) {
53 return 'active';
54 }
38 55
39 return $IdWorker; 56 return '';
app/Classes/Tools.php
1 <?php 1 <?php
2 2
3 3
4 namespace App\Classes; 4 namespace App\Classes;
5 5
6 6
7 use App\Models\Worker;
8
7 class Tools 9 class Tools
8 { 10 {
9 static function generator_id($length = 6) 11 static function generator_id($length = 6)
10 { 12 {
11 $word = ''; 13 $word = '';
12 $arr = array( 14 $arr = array(
13 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 15 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
14 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 16 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
15 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 17 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
16 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 18 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
17 '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' 19 '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'
18 ); 20 );
19 21
20 for ($i = 0; $i < $length; $i++) { 22 for ($i = 0; $i < $length; $i++) {
21 $word .= $arr[random_int(0, count($arr) - 1)]; 23 $word .= $arr[random_int(0, count($arr) - 1)];
22 } 24 }
23 return $word; 25 return $word;
24 } 26 }
27
28 public static function getWorkerProfilePercent(Worker $Worker): int
29 {
30 $persent = 10;
31
32 if ((!empty($Worker->telephone)) &&
33 (!empty($Worker->email)) && (!empty($Worker->experience)) &&
34 (!empty($Worker->city)) && (!empty($Worker->old_year))) {
35 $persent = $persent + 40;
36 }
37
38 if ($Worker->sertificate->count() > 0) {
39 $persent = $persent + 15;
40 }
41
42 if ($Worker->infobloks->count() > 0) {
43 $persent = $persent + 20;
44 }
45
46 if ($Worker->prev_company->count() > 0) {
47 $persent = $persent + 10;
48 }
49
50 if (!empty($Worker->photo)) {
51 $persent = $persent + 5;
52 }
53
54 return $persent;
55 }
25 } 56 }
26 57
app/Http/Controllers/AdEmployerController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Models\Ad_employer; 5 use App\Models\Ad_employer;
6 use App\Models\Employer; 6 use App\Models\Employer;
7 use App\Models\Static_ad; 7 use App\Models\Static_ad;
8 use App\Models\Static_worker; 8 use App\Models\Static_worker;
9 use Illuminate\Database\Eloquent\Model; 9 use Illuminate\Database\Eloquent\Model;
10 use Illuminate\Http\Request; 10 use Illuminate\Http\Request;
11 11
12 class AdEmployerController extends Controller 12 class AdEmployerController extends Controller
13 { 13 {
14 public function Ad_employer(Ad_employer $ad_employer) { 14 public function Ad_employer(Ad_employer $ad_employer) {
15 15
16 $get_date = date('Y.m'); 16 $get_date = date('Y.m');
17 17
18 $c = Static_ad::query()->where('year_month', '=', $get_date) 18 $c = Static_ad::query()->where('year_month', '=', $get_date)
19 ->where('ad_employer_id', '=', $ad_employer->id) 19 ->where('ad_employer_id', '=', $ad_employer->id)
20 ->get(); 20 ->get();
21 21
22 if ($c->count() > 0) { 22 if ($c->count() > 0) {
23 $upd = Static_ad::find($c[0]->id); 23 $upd = Static_ad::find($c[0]->id);
24 $upd->lookin = $upd->lookin + 1; 24 $upd->lookin = $upd->lookin + 1;
25 $upd->save(); 25 $upd->save();
26 } else { 26 } else {
27 $crt = new Static_ad(); 27 $crt = new Static_ad();
28 $crt->lookin = 1; 28 $crt->lookin = 1;
29 $crt->year_month = $get_date; 29 $crt->year_month = $get_date;
30 $crt->ad_employer_id = $ad_employer->id; 30 $crt->ad_employer_id = $ad_employer->id;
31 $crt->save(); 31 $crt->save();
32 } 32 }
33 33
34 $stat = Static_ad::query()-> 34 $stat = Static_ad::query()->
35 where('year_month', '=', $get_date)-> 35 where('year_month', '=', $get_date)->
36 where('ad_employer_id', '=', $ad_employer->id) 36 where('ad_employer_id', '=', $ad_employer->id)
37 ->get(); 37 ->get();
38 38
39 return view('public.ad.profile', compact('ad_employer', 'stat')); 39 return view('public.ad.profile', compact('ad_employer', 'stat'));
40 } 40 }
41
42 public function getById(Ad_employer $vacancy)
43 {
44 return $vacancy;
45 }
41 } 46 }
42 47
app/Http/Controllers/Admin/JobTitlesController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers\Admin; 3 namespace App\Http\Controllers\Admin;
4 4
5 use App\Http\Controllers\Controller; 5 use App\Http\Controllers\Controller;
6 use App\Http\Requests\JobTitlesRequest; 6 use App\Http\Requests\JobTitlesRequest;
7 use App\Models\Category; 7 use App\Models\Category;
8 use App\Models\Job_title; 8 use App\Models\Job_title;
9 use App\Models\Positions; 9 use App\Models\Positions;
10 use Illuminate\Http\Request; 10 use Illuminate\Http\Request;
11 11
12 class JobTitlesController extends Controller 12 class JobTitlesController extends Controller
13 { 13 {
14 /** 14 /**
15 * Display a listing of the resource. 15 * Display a listing of the resource.
16 * 16 *
17 * @return \Illuminate\Http\Response 17 * @return \Illuminate\Http\Response
18 */ 18 */
19 public function index(Request $request) 19 public function index(Request $request)
20 { 20 {
21 if ($request->has('sort')) { 21 if ($request->has('sort')) {
22 $Jobs = Job_title::query()->where('is_remove', '=', '0'); 22 $Jobs = Job_title::query()
23 if ($request->get('sort') == 'up') 23 ->where('is_remove', '0');
24
25 if ($request->get('sort') == 'up') {
24 $Jobs = $Jobs->orderBy('sort')->orderBy('name')->paginate(15); 26 $Jobs = $Jobs->orderBy('sort')->orderBy('name')->paginate(15);
25 else 27 } else {
26 $Jobs = $Jobs->orderByDesc('sort')->orderBy('name')->paginate(15); 28 $Jobs = $Jobs->orderByDesc('sort')->orderBy('name')->paginate(15);
29 }
27 } else { 30 } else {
28 $Jobs = Job_title::query()->where('is_remove', '=', '0')-> 31 $Jobs = Job_title::query()->where('is_remove', '0')->
29 orderByDesc('sort')->orderBy('name')->paginate(15); 32 orderByDesc('sort')->orderBy('name')->paginate(15);
30 } 33 }
31 34
32 return view('admin.job_titles.index', compact('Jobs')); 35 return view('admin.job_titles.index', compact('Jobs'));
33 } 36 }
34 37
35 /** 38 /**
36 * Show the form for creating a new resource. 39 * Show the form for creating a new resource.
37 * 40 *
38 * @return \Illuminate\Http\Response 41 * @return \Illuminate\Http\Response
39 */ 42 */
40 public function create() 43 public function create()
41 { 44 {
42 /*$items = Job_title::query()-> 45 /*$items = Job_title::query()->
43 orderByDesc('sort')-> 46 orderByDesc('sort')->
44 orderBy('name')-> 47 orderBy('name')->
45 active()-> 48 active()->
46 get();*/ 49 get();*/
47 $category = Category::query()->active()->get(); 50 $category = Category::query()->active()->get();
48 51
49 return view('admin.job_titles.add', compact('category')); 52 return view('admin.job_titles.add', compact('category'));
50 } 53 }
51 54
52 /** 55 /**
53 * Store a newly created resource in storage. 56 * Store a newly created resource in storage.
54 * 57 *
55 * @param \Illuminate\Http\Request $request 58 * @param \Illuminate\Http\Request $request
56 * @return \Illuminate\Http\Response 59 * @return \Illuminate\Http\Response
57 */ 60 */
58 public function store(JobTitlesRequest $request) 61 public function store(JobTitlesRequest $request)
59 { 62 {
60 Job_title::create($request->all()); 63 Job_title::create($request->all());
61 return redirect()->route('admin.job-titles.index'); 64 return redirect()->route('admin.job-titles.index');
62 } 65 }
63 66
64 /** 67 /**
65 * Display the specified resource. 68 * Display the specified resource.
66 * 69 *
67 * @param \App\Models\Job_title $job_title 70 * @param \App\Models\Job_title $job_title
68 * @return \Illuminate\Http\Response 71 * @return \Illuminate\Http\Response
69 */ 72 */
70 public function show(Job_title $job_title) 73 public function show(Job_title $job_title)
71 { 74 {
72 // 75 //
73 } 76 }
74 77
75 /** 78 /**
76 * Show the form for editing the specified resource. 79 * Show the form for editing the specified resource.
77 * 80 *
78 * @param \App\Models\Job_title $job_title 81 * @param \App\Models\Job_title $job_title
79 * @return \Illuminate\Http\Response 82 * @return \Illuminate\Http\Response
80 */ 83 */
81 public function edit(Job_title $job_title) 84 public function edit(Job_title $job_title)
82 { 85 {
83 $category = Category::query()->active()->get(); 86 $category = Category::query()->active()->get();
84 return view('admin.job_titles.edit', compact('job_title', 'category')); 87 return view('admin.job_titles.edit', compact('job_title', 'category'));
85 } 88 }
86 89
87 /** 90 /**
88 * Update the specified resource in storage. 91 * Update the specified resource in storage.
89 * 92 *
90 * @param \Illuminate\Http\Request $request 93 * @param \Illuminate\Http\Request $request
91 * @param \App\Models\Job_title $job_title 94 * @param \App\Models\Job_title $job_title
92 * @return \Illuminate\Http\Response 95 * @return \Illuminate\Http\Response
93 */ 96 */
94 public function update(JobTitlesRequest $request, Job_title $job_title) 97 public function update(JobTitlesRequest $request, Job_title $job_title)
95 { 98 {
96 $job_title->update($request->all()); 99 $job_title->update($request->all());
97 return redirect()->route('admin.job-titles.index'); 100 return redirect()->route('admin.job-titles.index');
98 } 101 }
99 102
100 /** 103 /**
101 * Remove the specified resource from storage. 104 * Remove the specified resource from storage.
102 * 105 *
103 * @param \App\Models\Job_title $job_title 106 * @param \App\Models\Job_title $job_title
104 * @return \Illuminate\Http\Response 107 * @return \Illuminate\Http\Response
105 */ 108 */
106 public function destroy(Job_title $job_title) 109 public function destroy(Job_title $job_title)
107 { 110 {
108 $job_title->update(['is_remove' => 1]); 111 $job_title->update(['is_remove' => 1]);
109 return redirect()->route('admin.job-titles.index'); 112 return redirect()->route('admin.job-titles.index');
110 } 113 }
111 } 114 }
112 115
app/Http/Controllers/CompanyController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Models\Ad_employer; 5 use App\Models\Ad_employer;
6 use App\Models\Employer; 6 use App\Models\Employer;
7 use Illuminate\Http\Request; 7 use Illuminate\Http\Request;
8 8
9 class CompanyController extends Controller 9 class CompanyController extends Controller
10 { 10 {
11 public function shipping_companies(Request $request) { 11 public function shipping_companies(Request $request) {
12 $emps = Employer::query()->with('ads')->where('status_hidden', '=', '0'); 12 $emps = Employer::query()->with('ads')->where('status_hidden', '=', '0');
13 if (($request->has('search')) && (!empty($request->get('search')))) { 13 if (($request->has('search')) && (!empty($request->get('search')))) {
14 $search = $request->get('search'); 14 $search = $request->get('search');
15 $emps = $emps->where('name_company', 'LIKE', "%$search%"); 15 $emps = $emps->where('name_company', 'LIKE', "%$search%");
16 } 16 }
17 17
18 $count_emps = $emps->count(); 18 $count_emps = $emps->count();
19 19
20 if ($request->get('sort')) { 20 if ($request->get('sort')) {
21 $sort = $request->get('sort'); 21 $sort = $request->get('sort');
22 switch ($sort) { 22 switch ($sort) {
23 case 'name_up': $emps = $emps->orderBy('name_company')->orderBy('id'); break; 23 case 'name_up': $emps = $emps->orderBy('name_company')->orderBy('id'); break;
24 case 'name_down': $emps = $emps->orderByDesc('name_company')->orderby('id'); break; 24 case 'name_down': $emps = $emps->orderByDesc('name_company')->orderby('id'); break;
25 case 'created_at_up': $emps = $emps->OrderBy('created_at')->orderBy('id'); break; 25 case 'created_at_up': $emps = $emps->OrderBy('created_at')->orderBy('id'); break;
26 case 'created_at_down': $emps = $emps->orderByDesc('created_at')->orderBy('id'); break; 26 case 'created_at_down': $emps = $emps->orderByDesc('created_at')->orderBy('id'); break;
27 case 'default': $emps = $emps->orderBy('id')->orderby('updated_at'); break; 27 case 'default': $emps = $emps->orderBy('id')->orderby('updated_at'); break;
28 default: $emps = $emps->orderBy('id')->orderby('updated_at'); break; 28 default: $emps = $emps->orderBy('id')->orderby('updated_at'); break;
29 } 29 }
30 } 30 }
31 31
32 $emps = $emps->paginate(4); 32 $emps = $emps->paginate(4);
33 33
34 34
35 if ($request->ajax()) { 35 if ($request->ajax()) {
36 if ($request->get('block') == '1') 36 if ($request->get('block') == '1')
37 return view('ajax.companies', compact('emps', 'count_emps')); 37 return view('ajax.companies', compact('emps', 'count_emps'));
38 else 38 else
39 return view('ajax.companies2', compact('emps', 'count_emps')); 39 return view('ajax.companies2', compact('emps', 'count_emps'));
40 } else { 40 } else {
41 return view('companies', compact('emps', 'count_emps')); 41 return view('companies', compact('emps', 'count_emps'));
42 } 42 }
43 } 43 }
44 44
45 public function info_company(Employer $company) { 45 public function info_company(Employer $company) {
46 if (isset(Auth()->user()->id)) { 46 if (isset(Auth()->user()->id)) {
47 $user_id = Auth()->user()->id; 47 $user_id = Auth()->user()->id;
48 } else { 48 } else {
49 $user_id = 0; 49 $user_id = 0;
50 } 50 }
51 51
52 $company = Employer::with('ads')->with('flots')->with('users') 52 $company = Employer::with('ads')->with('flots')->with('users')
53 ->where('id', '=', $company->id)->get(); 53 ->where('id', '=', $company->id)->get();
54 54
55 $title = $company[0]->name_company; 55 $title = $company[0]->name_company;
56 56
57 $ads = Ad_employer::query()->with('jobs')->with('jobs_code') 57 $ads = Ad_employer::query()->with('jobs')->with('jobs_code')
58 ->where('employer_id', '=', $company[0]->id) 58 ->where('employer_id', '=', $company[0]->id)
59 ->where('is_remove', '=', '0') 59 ->where('is_remove', '=', '0')
60 ->where('active_is', 1)
60 ->OrderByDesc('id') 61 ->OrderByDesc('id')
61 ->paginate(50) 62 ->paginate(50)
62 ; 63 ;
63 64
64 return view('info_company_new', compact('company', 'user_id', 'title', 'ads')); 65 return view('info_company_new', compact('company', 'user_id', 'title', 'ads'));
65 } 66 }
66 } 67 }
67 68
app/Http/Controllers/EmployerController.php
1 <?php 1 <?php
2 2
3 namespace App\Http\Controllers; 3 namespace App\Http\Controllers;
4 4
5 use App\Classes\RusDate; 5 use App\Classes\RusDate;
6 use App\Classes\Tools; 6 use App\Classes\Tools;
7 use App\Http\Requests\BaseUser_min_Request; 7 use App\Http\Requests\BaseUser_min_Request;
8 use App\Http\Requests\FlotRequest; 8 use App\Http\Requests\FlotRequest;
9 use App\Http\Requests\MessagesRequiest; 9 use App\Http\Requests\MessagesRequiest;
10 use App\Http\Requests\VacancyRequestEdit; 10 use App\Http\Requests\VacancyRequestEdit;
11 use App\Mail\MailCreateEmployer; 11 use App\Mail\MailCreateEmployer;
12 use App\Mail\MailSotrudnichestvo; 12 use App\Mail\MailSotrudnichestvo;
13 use App\Mail\MassSendingMessages; 13 use App\Mail\MassSendingMessages;
14 use App\Mail\SendAllMessages; 14 use App\Mail\SendAllMessages;
15 use App\Models\Ad_employer; 15 use App\Models\Ad_employer;
16 use App\Models\ad_response; 16 use App\Models\ad_response;
17 use App\Models\Category; 17 use App\Models\Category;
18 use App\Models\Chat; 18 use App\Models\Chat;
19 use App\Models\Employer; 19 use App\Models\Employer;
20 use App\Models\Flot; 20 use App\Models\Flot;
21 use App\Models\Job_title; 21 use App\Models\Job_title;
22 use App\Models\Like_worker; 22 use App\Models\Like_worker;
23 use App\Models\Message; 23 use App\Models\Message;
24 use App\Models\Worker; 24 use App\Models\Worker;
25 use App\Models\MessagesRequests; 25 use App\Models\MessagesRequests;
26 use Carbon\Carbon; 26 use Carbon\Carbon;
27 use Illuminate\Auth\Events\Registered; 27 use Illuminate\Auth\Events\Registered;
28 use Illuminate\Database\Eloquent\Builder; 28 use Illuminate\Database\Eloquent\Builder;
29 use Illuminate\Http\Request; 29 use Illuminate\Http\Request;
30 use Illuminate\Support\Facades\Auth; 30 use Illuminate\Support\Facades\Auth;
31 use Illuminate\Support\Facades\Hash; 31 use Illuminate\Support\Facades\Hash;
32 use Illuminate\Support\Facades\Log; 32 use Illuminate\Support\Facades\Log;
33 use Illuminate\Support\Facades\Mail; 33 use Illuminate\Support\Facades\Mail;
34 use Illuminate\Support\Facades\Storage; 34 use Illuminate\Support\Facades\Storage;
35 use App\Models\User as User_Model; 35 use App\Models\User as User_Model;
36 use Illuminate\Support\Facades\Validator; 36 use Illuminate\Support\Facades\Validator;
37 use App\Enums\DbExportColumns; 37 use App\Enums\DbExportColumns;
38 use Throwable; 38 use Throwable;
39 39
40 class EmployerController extends Controller 40 class EmployerController extends Controller
41 { 41 {
42 public function vacancie($vacancy, Request $request) { 42 public function vacancie($vacancy, Request $request) {
43 $title = 'Заголовок вакансии'; 43 $title = 'Заголовок вакансии';
44 $Query = Ad_employer::with('jobs')-> 44 $Query = Ad_employer::with('jobs')->
45 with('cat')-> 45 with('cat')->
46 with('employer')-> 46 with('employer')->
47 with('jobs_code')-> 47 with('jobs_code')->
48 select('ad_employers.*')-> 48 select('ad_employers.*')->
49 where('id', '=', $vacancy)->get(); 49 where('id', '=', $vacancy)->get();
50 50
51 if (isset(Auth()->user()->id)) 51 if (isset(Auth()->user()->id))
52 $uid = Auth()->user()->id; 52 $uid = Auth()->user()->id;
53 else 53 else
54 $uid = 0; 54 $uid = 0;
55 $title = $Query[0]->name; 55 $title = $Query[0]->name;
56 if ($request->ajax()) { 56 if ($request->ajax()) {
57 return view('ajax.vacance-item', compact('Query','uid')); 57 return view('ajax.vacance-item', compact('Query','uid'));
58 } else { 58 } else {
59 return view('vacance-item', compact('title', 'Query', 'uid')); 59 return view('vacance-item', compact('title', 'Query', 'uid'));
60 } 60 }
61 } 61 }
62 62
63 public function logout() { 63 public function logout() {
64 Auth::logout(); 64 Auth::logout();
65 return redirect()->route('index') 65 return redirect()->route('index')
66 ->with('success', 'Вы вышли из личного кабинета'); 66 ->with('success', 'Вы вышли из личного кабинета');
67 } 67 }
68 68
69 public function employer_info() { 69 public function employer_info() {
70 // код юзера 70 // код юзера
71 $user_info = Auth()->user(); 71 $user_info = Auth()->user();
72 // вьюшка для вывода данных 72 // вьюшка для вывода данных
73 return view('employers.info', compact('user_info')); 73 return view('employers.info', compact('user_info'));
74 } 74 }
75 75
76 public function employer_info_save(User_Model $user, BaseUser_min_Request $request) { 76 public function employer_info_save(User_Model $user, BaseUser_min_Request $request) {
77 // Все данные через реквест 77 // Все данные через реквест
78 $all = $request->all(); 78 $all = $request->all();
79 unset($all['_token']); 79 unset($all['_token']);
80 // обновление 80 // обновление
81 $user->update($all); 81 $user->update($all);
82 return redirect()->route('employer.employer_info'); 82 return redirect()->route('employer.employer_info');
83 } 83 }
84 84
85 public function cabinet() { 85 public function cabinet() {
86 $id = Auth()->user()->id; 86 $id = Auth()->user()->id;
87 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 87 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
88 WhereHas('users', 88 WhereHas('users',
89 function (Builder $query) use ($id) {$query->Where('id', $id); 89 function (Builder $query) use ($id) {$query->Where('id', $id);
90 })->get(); 90 })->get();
91 return view('employers.cabinet45', compact('Employer')); 91 return view('employers.cabinet45', compact('Employer'));
92 } 92 }
93 93
94 public function slider_flot() { 94 public function slider_flot() {
95 $id = Auth()->user()->id; 95 $id = Auth()->user()->id;
96 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 96 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
97 WhereHas('users', 97 WhereHas('users',
98 function (Builder $query) use ($id) {$query->Where('id', $id); 98 function (Builder $query) use ($id) {$query->Where('id', $id);
99 })->get(); 99 })->get();
100 return view('employers.fly-flot', compact('Employer')); 100 return view('employers.fly-flot', compact('Employer'));
101 } 101 }
102 102
103 public function cabinet_save(Employer $Employer, Request $request) { 103 public function cabinet_save(Employer $Employer, Request $request) {
104 $params = $request->all(); 104 $params = $request->all();
105 $params['user_id'] = Auth()->user()->id; 105 $params['user_id'] = Auth()->user()->id;
106 $id = $Employer->id; 106 $id = $Employer->id;
107 107
108 if ($request->has('logo')) { 108 if ($request->has('logo')) {
109 if (!empty($Employer->logo)) { 109 if (!empty($Employer->logo)) {
110 Storage::delete($Employer->logo); 110 Storage::delete($Employer->logo);
111 } 111 }
112 $params['logo'] = $request->file('logo')->store("employer/$id", 'public'); 112 $params['logo'] = $request->file('logo')->store("employer/$id", 'public');
113 } 113 }
114 114
115 $Employer->update($params); 115 $Employer->update($params);
116 116
117 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены'); 117 return redirect()->route('employer.cabinet')->with('success', 'Данные были успешно сохранены');
118 } 118 }
119 119
120 public function save_add_flot(FlotRequest $request) { 120 public function save_add_flot(FlotRequest $request) {
121 // отмена 121 // отмена
122 $params = $request->all(); 122 $params = $request->all();
123 123
124 if ($request->has('image')) { 124 if ($request->has('image')) {
125 $params['image'] = $request->file('image')->store("flot", 'public'); 125 $params['image'] = $request->file('image')->store("flot", 'public');
126 } 126 }
127 Flot::create($params); 127 Flot::create($params);
128 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get(); 128 $data_flots = Flot::query()->where('employer_id', $request->get('employer_if'))->get();
129 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); 129 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен');
130 } 130 }
131 131
132 public function edit_flot(Flot $Flot, Employer $Employer) { 132 public function edit_flot(Flot $Flot, Employer $Employer) {
133 return view('employers.edit-flot', compact('Flot', 'Employer')); 133 return view('employers.edit-flot', compact('Flot', 'Employer'));
134 } 134 }
135 135
136 public function update_flot(FlotRequest $request, Flot $Flot) { 136 public function update_flot(FlotRequest $request, Flot $Flot) {
137 $params = $request->all(); 137 $params = $request->all();
138 138
139 if ($request->has('image')) { 139 if ($request->has('image')) {
140 if (!empty($flot->image)) { 140 if (!empty($flot->image)) {
141 Storage::delete($flot->image); 141 Storage::delete($flot->image);
142 } 142 }
143 $params['image'] = $request->file('image')->store("flot", 'public'); 143 $params['image'] = $request->file('image')->store("flot", 'public');
144 } else { 144 } else {
145 if (!empty($flot->image)) $params['image'] = $flot->image; 145 if (!empty($flot->image)) $params['image'] = $flot->image;
146 } 146 }
147 147
148 $Flot->update($params); 148 $Flot->update($params);
149 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен'); 149 return redirect()->route('employer.slider_flot')->with('success', 'Новый корабль был добавлен');
150 } 150 }
151 151
152 public function delete_flot(Flot $Flot) { 152 public function delete_flot(Flot $Flot) {
153 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get(); 153 $data_flots = Flot::query()->where('employer_id', $Flot->employer_id)->get();
154 154
155 if (isset($Flot->id)) $Flot->delete(); 155 if (isset($Flot->id)) $Flot->delete();
156 return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален'); 156 return redirect()->route('employer.slider_flot')->with('success', 'Корабль был удален');
157 } 157 }
158 158
159 // Форма добавления вакансий 159 // Форма добавления вакансий
160 public function cabinet_vacancie() { 160 public function cabinet_vacancie() {
161 $id = Auth()->user()->id; 161 $id = Auth()->user()->id;
162 162
163 if (Auth()->user()->is_public) { 163 if (Auth()->user()->is_public) {
164 $categories = Category::query()->active()->get(); 164 $categories = Category::query()->active()->get();
165 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 165 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
166 where('is_remove', '=', '0')-> 166 where('is_remove', '=', '0')->
167 where('is_bd', '=', '0')-> 167 where('is_bd', '=', '0')->
168 get(); 168 get();
169 $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> 169 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
170 WhereHas('users', 170 WhereHas('users',
171 function (Builder $query) use ($id) { 171 function (Builder $query) use ($id) {
172 $query->Where('id', $id); 172 $query->Where('id', $id);
173 })->get(); 173 })->get();
174 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories')); 174 return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories'));
175 } else { 175 } else {
176 return redirect()->route('employer.cabinet_vacancie_danger'); 176 return redirect()->route('employer.cabinet_vacancie_danger');
177 } 177 }
178 } 178 }
179 179
180 // Форма предупреждения об оплате 180 // Форма предупреждения об оплате
181 public function cabinet_vacancie_danger() { 181 public function cabinet_vacancie_danger() {
182 return view('employers.add_vacancy_danger'); 182 return view('employers.add_vacancy_danger');
183 } 183 }
184 184
185 // Сохранение вакансии 185 // Сохранение вакансии
186 public function cabinet_vacancy_save1(VacancyRequestEdit $request) { 186 public function cabinet_vacancy_save1(VacancyRequestEdit $request) {
187 $params_emp = $request->all(); 187 $params_emp = $request->all();
188 188
189 $params_job["job_title_id"] = $params_emp['job_title_id']; 189 $params_job["job_title_id"] = $params_emp['job_title_id'];
190 //$params_job["min_salary"] = $params_emp['min_salary']; 190 //$params_job["min_salary"] = $params_emp['min_salary'];
191 //$params_job["max_salary"] = $params_emp['max_salary']; 191 //$params_job["max_salary"] = $params_emp['max_salary'];
192 //$params_job["region"] = $params_emp['region']; 192 //$params_job["region"] = $params_emp['region'];
193 //$params_job["power"] = $params_emp['power']; 193 //$params_job["power"] = $params_emp['power'];
194 //$params_job["sytki"] = $params_emp['sytki']; 194 //$params_job["sytki"] = $params_emp['sytki'];
195 //$params_job["start"] = $params_emp['start']; 195 //$params_job["start"] = $params_emp['start'];
196 //$params_job["flot"] = $params_emp['flot']; 196 //$params_job["flot"] = $params_emp['flot'];
197 //$params_job["description"] = $params_emp['description']; 197 //$params_job["description"] = $params_emp['description'];
198 198
199 $ad_jobs = Ad_employer::create($params_emp); 199 $ad_jobs = Ad_employer::create($params_emp);
200 //$params_job['ad_employer_id'] = $ad_jobs->id; 200 //$params_job['ad_employer_id'] = $ad_jobs->id;
201 //Ad_jobs::create($params_job); 201 //Ad_jobs::create($params_job);
202 $ad_jobs->jobs()->sync($request->get('job_title_id')); 202 $ad_jobs->jobs()->sync($request->get('job_title_id'));
203 203
204 return redirect()->route('employer.vacancy_list'); 204 return redirect()->route('employer.vacancy_list');
205 } 205 }
206 206
207 // Список вакансий 207 // Список вакансий
208 public function vacancy_list(Request $request) { 208 public function vacancy_list(Request $request) {
209 $id = Auth()->user()->id; 209 $id = Auth()->user()->id;
210 210
211 //dd($request->all()); 211 //dd($request->all());
212 $Employer = Employer::query()->where('user_id', $id)->first(); 212 $Employer = Employer::query()->where('user_id', $id)->first();
213 $vacancy_list = Ad_employer::query() 213 $vacancy_list = Ad_employer::query()
214 ->with('jobs') 214 ->with('jobs')
215 ->with('jobs_code') 215 ->with('jobs_code')
216 ->where('employer_id', $Employer->id) 216 ->where('employer_id', $Employer->id)
217 ->where('is_remove', 0) 217 ->where('is_remove', 0)
218 ->orderbyDesc('updated_at') 218 ->orderbyDesc('updated_at')
219 ; 219 ;
220 220
221 if (($request->has('search')) && (!empty($request->get('search')))) { 221 if (($request->has('search')) && (!empty($request->get('search')))) {
222 $search = $request->get('search'); 222 $search = $request->get('search');
223 $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%"); 223 $vacancy_list = $vacancy_list->where('name', 'LIKE', "%$search%");
224 } 224 }
225 225
226 if ($request->get('sort')) { 226 if ($request->get('sort')) {
227 $sort = $request->get('sort'); 227 $sort = $request->get('sort');
228 switch ($sort) { 228 switch ($sort) {
229 case 'nopublic': $vacancy_list->where('active_is', '=', 0);break; 229 case 'nopublic': $vacancy_list->where('active_is', '=', 0);break;
230 case 'public':$vacancy_list->where('active_is', '=', 1);break; 230 case 'public':$vacancy_list->where('active_is', '=', 1);break;
231 default: $vacancy_list = $vacancy_list->orderByDesc('id'); break; 231 default: $vacancy_list = $vacancy_list->orderByDesc('id'); break;
232 } 232 }
233 } else { 233 } else {
234 $vacancy_list = $vacancy_list->orderByDesc('updated_at')->orderBy('id'); 234 $vacancy_list = $vacancy_list->orderByDesc('updated_at')->orderBy('id');
235 } 235 }
236 236
237 $vacancy_list = $vacancy_list->paginate(10); 237 $vacancy_list = $vacancy_list->paginate(10);
238 238
239 //ajax 239 //ajax
240 if ($request->ajax()) { 240 if ($request->ajax()) {
241 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer')); 241 return view('employers.ajax.list_vacancy', compact('vacancy_list', 'Employer'));
242 } else { 242 } else {
243 return view('employers.list_vacancy', compact('vacancy_list', 'Employer')); 243 return view('employers.list_vacancy', compact('vacancy_list', 'Employer'));
244 } 244 }
245 } 245 }
246 246
247 // Карточка вакансии 247 // Карточка вакансии
248 public function vacancy_edit(Ad_employer $ad_employer) { 248 public function vacancy_edit(Ad_employer $ad_employer) {
249 $id = Auth()->user()->id; 249 $id = Auth()->user()->id;
250 $Positions = Category::query()->where('is_remove', '=', '0')->get(); 250 $Positions = Category::query()->where('is_remove', '=', '0')->get();
251 251
252 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 252 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
253 where('is_remove', '=', '0')-> 253 where('is_remove', '=', '0')->
254 where('is_bd', '=', '0')->get(); 254 where('is_bd', '=', '0')->get();
255 255
256 $Employer = Employer::query()->with('users')->with('ads')-> 256 $Employer = Employer::query()->with('users')->with('ads')->
257 with('flots')->where('user_id', $id)->first(); 257 with('flots')->where('user_id', $id)->first();
258 258
259 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); 259 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs'));
260 } 260 }
261 261
262 // Сохранение-редактирование записи 262 // Сохранение-редактирование записи
263 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) { 263 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) {
264 $params = $request->all(); 264 $params = $request->all();
265 $params_job["job_title_id"] = $params['job_title_id']; 265 $params_job["job_title_id"] = $params['job_title_id'];
266 266
267 $ad_employer->update($params); 267 $ad_employer->update($params);
268 $ad_employer->jobs()->sync($request->get('job_title_id')); 268 $ad_employer->jobs()->sync($request->get('job_title_id'));
269 269
270 $id = Auth()->user()->id; 270 $id = Auth()->user()->id;
271 $Positions = Category::query()->where('is_remove', '=', '0')->get(); 271 $Positions = Category::query()->where('is_remove', '=', '0')->get();
272 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name') 272 $jobs = Job_title::query()->orderByDesc('sort')->OrderBy('name')
273 ->where('is_remove', '=', '0') 273 ->where('is_remove', '=', '0')
274 ->where('is_bd', '=', '0') 274 ->where('is_bd', '=', '0')
275 ->get(); 275 ->get();
276 276
277 $Employer = Employer::query() 277 $Employer = Employer::query()
278 ->with('users')->with('ads')->with('flots')->where('user_id', $id)->first(); 278 ->with('users')->with('ads')->with('flots')->where('user_id', $id)->first();
279 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs')); 279 return view('employers.edit_vacancy', compact('ad_employer', 'Positions','Employer', 'jobs'));
280 } 280 }
281 281
282 // Сохранение карточки вакансии 282 // Сохранение карточки вакансии
283 public function vacancy_save(Request $request, Ad_employer $ad_employer) { 283 public function vacancy_save(Request $request, Ad_employer $ad_employer) {
284 $all = $request->all(); 284 $all = $request->all();
285 $ad_employer->update($all); 285 $ad_employer->update($all);
286 return redirect()->route('employer.cabinet_vacancie'); 286 return redirect()->route('employer.cabinet_vacancie');
287 } 287 }
288 288
289 // Удаление карточки вакансии 289 // Удаление карточки вакансии
290 public function vacancy_delete(Ad_employer $ad_employer) { 290 public function vacancy_delete(Ad_employer $ad_employer) {
291 $ad_employer->delete(); 291 $ad_employer->delete();
292 292
293 return redirect()->route('employer.vacancy_list') 293 return redirect()->route('employer.vacancy_list')
294 ->with('success', 'Данные были успешно сохранены'); 294 ->with('success', 'Данные были успешно сохранены');
295 } 295 }
296 296
297 // Обновление даты 297 // Обновление даты
298 public function vacancy_up(Ad_employer $ad_employer) { 298 public function vacancy_up(Ad_employer $ad_employer) {
299 $up = date('m/d/Y h:i:s', time());; 299 $up = date('m/d/Y h:i:s', time());;
300 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 300 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
301 $vac_emp->updated_at = $up; 301 $vac_emp->updated_at = $up;
302 $vac_emp->save(); 302 $vac_emp->save();
303 303
304 return redirect()->back(); //route('employer.vacancy_list'); 304 return redirect()->back(); //route('employer.vacancy_list');
305 // начало конца 305 // начало конца
306 } 306 }
307 307
308 //Видимость вакансии 308 //Видимость вакансии
309 public function vacancy_eye(Ad_employer $ad_employer, $status) { 309 public function vacancy_eye(Ad_employer $ad_employer, $status) {
310 $vac_emp = Ad_employer::findOrFail($ad_employer->id); 310 $vac_emp = Ad_employer::findOrFail($ad_employer->id);
311 $vac_emp->active_is = $status; 311 $vac_emp->active_is = $status;
312 $vac_emp->save(); 312 $vac_emp->save();
313 313
314 return redirect()->route('employer.vacancy_list'); 314 return redirect()->route('employer.vacancy_list');
315 } 315 }
316 316
317 //Вакансия редактирования (шаблон) 317 //Вакансия редактирования (шаблон)
318 public function vacancy_update(Ad_employer $id) { 318 public function vacancy_update(Ad_employer $id) {
319 319
320 } 320 }
321 321
322 //Отклики на вакансию - лист 322 //Отклики на вакансию - лист
323 public function answers(Employer $employer, Request $request) { 323 public function answers(Employer $employer, Request $request) {
324 $user_id = Auth()->user()->id; 324 $user_id = Auth()->user()->id;
325 $answer = Ad_employer::query()->where('employer_id', $employer->id); 325 $answer = Ad_employer::query()->where('employer_id', $employer->id);
326 if ($request->has('search')) { 326 if ($request->has('search')) {
327 $search = trim($request->get('search')); 327 $search = trim($request->get('search'));
328 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%"); 328 if (!empty($search)) $answer = $answer->where('name', 'LIKE', "%$search%");
329 } 329 }
330 330
331 $answer = $answer->with('response')->OrderByDESC('id')->get(); 331 $answer = $answer->with('response')->OrderByDESC('id')->get();
332 332
333 return view('employers.list_answer', compact('answer', 'user_id', 'employer')); 333 return view('employers.list_answer', compact('answer', 'user_id', 'employer'));
334 } 334 }
335 335
336 //Обновление статуса 336 //Обновление статуса
337 public function supple_status(employer $employer, ad_response $ad_response, $flag) { 337 public function supple_status(employer $employer, ad_response $ad_response, $flag) {
338 $ad_response->update(Array('flag' => $flag)); 338 $ad_response->update(Array('flag' => $flag));
339 return redirect()->route('employer.answers', ['employer' => $employer->id]); 339 return redirect()->route('employer.answers', ['employer' => $employer->id]);
340 } 340 }
341 341
342 //Страницы сообщений список 342 //Страницы сообщений список
343 public function messages($type_message) { 343 public function messages($type_message) {
344 $user_id = Auth()->user()->id; 344 $user_id = Auth()->user()->id;
345 345
346 $chats = Chat::get_user_chats($user_id); 346 $chats = Chat::get_user_chats($user_id);
347 $user_type = 'employer'; 347 $user_type = 'employer';
348 $admin_chat = false; 348 $admin_chat = false;
349 349
350 return view('employers.messages', compact('chats', 'admin_chat', 'user_id', 'user_type')); 350 return view('employers.messages', compact('chats', 'admin_chat', 'user_id', 'user_type'));
351 } 351 }
352 352
353 // Диалог между пользователями 353 // Диалог между пользователями
354 public function dialog(Chat $chat, Request $request) { 354 public function dialog(Chat $chat, Request $request) {
355 // Получение параметров. 355 // Получение параметров.
356 if ($request->has('ad_employer')){ 356 if ($request->has('ad_employer')){
357 $ad_employer = $request->get('ad_employer'); 357 $ad_employer = $request->get('ad_employer');
358 } else { 358 } else {
359 $ad_employer = 0; 359 $ad_employer = 0;
360 } 360 }
361 361
362 $sender = User_Model::query()->with('workers')->with('employers')->where('id', $chat->user_id)->first(); 362 $sender = User_Model::query()->with('workers')->with('employers')->where('id', $chat->user_id)->first();
363 $companion = User_Model::query()->with('workers')->with('employers')->where('id', $chat->to_user_id)->first(); 363 $companion = User_Model::query()->with('workers')->with('employers')->where('id', $chat->to_user_id)->first();
364 364
365 $Messages = Chat::get_chat_messages($chat); 365 $Messages = Chat::get_chat_messages($chat);
366 366
367 Message::where('user_id', '=', $chat->to_user_id)->where('to_user_id', '=', $chat->user_id)->update(['flag_new' => 0]); 367 Message::where('user_id', '=', $chat->to_user_id)->where('to_user_id', '=', $chat->user_id)->update(['flag_new' => 0]);
368 368
369 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages')); 369 return view('employers.dialog', compact('companion', 'sender', 'ad_employer', 'Messages'));
370 } 370 }
371 371
372 public function pin_chat(Request $request){ 372 public function pin_chat(Request $request){
373 $chat_id = $request->get('id'); 373 $chat_id = $request->get('id');
374 $is_fixed = $request->get('is_fixed'); 374 $is_fixed = $request->get('is_fixed');
375 375
376 Chat::pin_chat($chat_id, $is_fixed); 376 Chat::pin_chat($chat_id, $is_fixed);
377 } 377 }
378 378
379 public function remove_chat(Request $request){ 379 public function remove_chat(Request $request){
380 $chat_id = $request->get('id'); 380 $chat_id = $request->get('id');
381 Chat::remove_chat($chat_id); 381 Chat::remove_chat($chat_id);
382 } 382 }
383 383
384 // Регистрация работодателя 384 // Регистрация работодателя
385 public function register_employer(Request $request) { 385 public function register_employer(Request $request) {
386 $params = $request->all(); 386 $params = $request->all();
387 387
388 $rules = [ 388 $rules = [
389 //'surname' => ['required', 'string', 'max:255'], 389 //'surname' => ['required', 'string', 'max:255'],
390 //'name_man' => ['required', 'string', 'max:255'], 390 //'name_man' => ['required', 'string', 'max:255'],
391 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 391 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
392 'name_company' => ['required', 'string', 'max:255'], 392 'name_company' => ['required', 'string', 'max:255'],
393 'password' => ['required', 'string', 'min:6'], 393 'password' => ['required', 'string', 'min:6'],
394 ]; 394 ];
395 395
396
397 $messages = [ 396 $messages = [
398 'required' => 'Укажите обязательное поле', 397 'required' => 'Укажите обязательное поле',
399 'min' => [ 398 'min' => [
400 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 399 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
401 'integer' => 'Поле «:attribute» должно быть :min или больше', 400 'integer' => 'Поле «:attribute» должно быть :min или больше',
402 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 401 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
403 ], 402 ],
404 'max' => [ 403 'max' => [
405 'string' => 'Поле «:attribute» должно быть не больше :max символов', 404 'string' => 'Поле «:attribute» должно быть не больше :max символов',
406 'integer' => 'Поле «:attribute» должно быть :max или меньше', 405 'integer' => 'Поле «:attribute» должно быть :max или меньше',
407 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 406 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
408 ] 407 ]
409 ]; 408 ];
410 409
411 $email = $request->get('email'); 410 $email = $request->get('email');
412 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { 411 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) {
413 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); 412 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл"));
414 } 413 }
415 414
416 if ($request->get('password') !== $request->get('confirmed')){ 415 if ($request->get('password') !== $request->get('confirmed')){
417 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 416 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
418 } 417 }
419 418
420 if (strlen($request->get('password')) < 6) { 419 if (strlen($request->get('password')) < 6) {
421 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); 420 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
422 } 421 }
423 422
424 if (empty($request->get('surname'))) { 423 if (empty($request->get('surname'))) {
425 $params['surname'] = 'Неизвестно'; 424 $params['surname'] = 'Неизвестно';
426 } 425 }
427 if (empty($request->get('name_man'))) { 426 if (empty($request->get('name_man'))) {
428 $params['name_man'] = 'Неизвестно'; 427 $params['name_man'] = 'Неизвестно';
429 } 428 }
430 $validator = Validator::make($params, $rules, $messages); 429 $validator = Validator::make($params, $rules, $messages);
431 430
432 if ($validator->fails()) { 431 if ($validator->fails()) {
433 return json_encode(Array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 432 return json_encode(Array("ERROR" => "Error: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
434 } else { 433 } else {
435 $user = $this->create($params); 434 $user = $this->create($params);
436 event(new Registered($user)); 435 event(new Registered($user));
437 436
438 Mail::to(env('EMAIL_ADMIN'))->send(new MailCreateEmployer($params)); 437 try {
438 Mail::to(env('EMAIL_ADMIN'))->send(new MailCreateEmployer($params));
439 } catch (Throwable $e) {
440 Log::error($e);
441 }
439 442
440 Auth::guard()->login($user); 443 Auth::guard()->login($user);
441 } 444 }
442 445
443 if ($user) { 446 if ($user) {
444 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));; 447 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));;
445 } else { 448 } else {
446 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 449 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
447 } 450 }
448 } 451 }
449 452
450 // Создание пользователя 453 // Создание пользователя
451 protected function create(array $data) 454 protected function create(array $data)
452 { 455 {
453 $Use = new User_Model(); 456 $Use = new User_Model();
454 $Code_user = $Use->create([ 457 $Code_user = $Use->create([
455 'name' => $data['surname']." ".$data['name_man'], 458 'name' => $data['surname']." ".$data['name_man'],
456 'name_man' => $data['name_man'], 459 'name_man' => $data['name_man'],
457 'surname' => $data['surname'], 460 'surname' => $data['surname'],
458 'surname2' => $data['surname2'], 461 'surname2' => $data['surname2'],
459 'subscribe_email' => $data['email'], 462 'subscribe_email' => $data['email'],
460 'email' => $data['email'], 463 'email' => $data['email'],
461 'telephone' => $data['telephone'], 464 'telephone' => $data['telephone'],
462 'is_worker' => 0, 465 'is_worker' => 0,
463 'password' => Hash::make($data['password']), 466 'password' => Hash::make($data['password']),
464 'pubpassword' => base64_encode($data['password']), 467 'pubpassword' => base64_encode($data['password']),
465 'email_verified_at' => Carbon::now() 468 'email_verified_at' => Carbon::now()
466 ]); 469 ]);
467 470
468 if ($Code_user->id > 0) { 471 if ($Code_user->id > 0) {
469 $Employer = new Employer(); 472 $Employer = new Employer();
470 $Employer->user_id = $Code_user->id; 473 $Employer->user_id = $Code_user->id;
471 $Employer->name_company = $data['name_company']; 474 $Employer->name_company = $data['name_company'];
472 $Employer->email = $data['email']; 475 $Employer->email = $data['email'];
473 $Employer->telephone = $data['telephone']; 476 $Employer->telephone = $data['telephone'];
474 $Employer->code = Tools::generator_id(10); 477 $Employer->code = Tools::generator_id(10);
475 $Employer->save(); 478 $Employer->save();
476 479
477 return $Code_user; 480 return $Code_user;
478 } 481 }
479 } 482 }
480 483
481 // Отправка сообщения от работодателя 484 // Отправка сообщения от работодателя
482 public function send_message(MessagesRequiest $request) { 485 public function send_message(MessagesRequiest $request) {
483 $params = $request->all(); 486 $params = $request->all();
484 dd($params); 487 dd($params);
485 $user1 = $params['user_id']; 488 $user1 = $params['user_id'];
486 $user2 = $params['to_user_id']; 489 $user2 = $params['to_user_id'];
487 490
488 if ($request->has('file')) { 491 if ($request->has('file')) {
489 $params['file'] = $request->file('file')->store("messages", 'public'); 492 $params['file'] = $request->file('file')->store("messages", 'public');
490 } 493 }
491 Message::create($params); 494 Message::create($params);
492 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]); 495 return redirect()->route('employer.dialog', ['user1' => $user1, 'user2' => $user2]);
493 } 496 }
494 497
495 public function test123(Request $request) { 498 public function test123(Request $request) {
496 $params = $request->all(); 499 $params = $request->all();
497 $user1 = $params['user_id']; 500 $user1 = $params['user_id'];
498 $user2 = $params['to_user_id']; 501 $user2 = $params['to_user_id'];
499 502
500 $rules = [ 503 $rules = [
501 'text' => 'nullable|required_without:file|min:1|max:150000', 504 'text' => 'nullable|required_without:file|min:1|max:150000',
502 'file' => 'nullable|file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' 505 'file' => 'nullable|file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000'
503 ]; 506 ];
504 $messages = [ 507 $messages = [
505 'required_without' => 'Поле «:attribute» обязательно, если файл не прикреплен', 508 'required_without' => 'Поле «:attribute» обязательно, если файл не прикреплен',
506 'min' => [ 509 'min' => [
507 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 510 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
508 'integer' => 'Поле «:attribute» должно быть :min или больше', 511 'integer' => 'Поле «:attribute» должно быть :min или больше',
509 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 512 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
510 ], 513 ],
511 'max' => [ 514 'max' => [
512 'string' => 'Поле «:attribute» должно быть не больше :max символов', 515 'string' => 'Поле «:attribute» должно быть не больше :max символов',
513 'integer' => 'Поле «:attribute» должно быть :max или меньше', 516 'integer' => 'Поле «:attribute» должно быть :max или меньше',
514 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 517 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
515 ] 518 ]
516 ]; 519 ];
517 520
518 $validator = Validator::make($request->all(), $rules, $messages); 521 $validator = Validator::make($request->all(), $rules, $messages);
519 522
520 if ($validator->fails()) { 523 if ($validator->fails()) {
521 $chat = Chat::where('user_id', $user1) 524 $chat = Chat::where('user_id', $user1)
522 ->where('to_user_id', $user2) 525 ->where('to_user_id', $user2)
523 ->where('is_removed', 0) 526 ->where('is_removed', 0)
524 ->first() 527 ->first()
525 ; 528 ;
526 if ($chat->id){ 529 if ($chat->id){
527 return redirect()->route('employer.dialog', ['chat' => $chat->id])->withErrors($validator); 530 return redirect()->route('employer.dialog', ['chat' => $chat->id])->withErrors($validator);
528 } else { 531 } else {
529 return redirect()->route('cabinet.messages', ['type_message' => 'input'])->withErrors($validator); 532 return redirect()->route('cabinet.messages', ['type_message' => 'input'])->withErrors($validator);
530 } 533 }
531 534
532 } else { 535 } else {
533 $new_message = Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages'); 536 $new_message = Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages');
534 537
535 return redirect()->route('employer.dialog', ['chat' => $new_message->chat_id_from]); 538 return redirect()->route('employer.dialog', ['chat' => $new_message->chat_id_from]);
536 539
537 } 540 }
538 } 541 }
539 542
540 //Избранные люди 543 //Избранные люди
541 public function favorites(Request $request) { 544 public function favorites(Request $request)
542 $IP_address = RusDate::ip_addr_client(); 545 {
543 $Arr = Like_worker::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); 546 $likedWorkersIds = Like_worker::query()
544 547 ->where('user_id', Auth::user()->id)
545 if ($Arr->count()) { 548 ->get()
546 $A = Array(); 549 ->pluck('code_record')
547 foreach ($Arr as $it) { 550 ->toArray();
548 $A[] = $it->code_record;
549 }
550 551
551 $Workers = Worker::query()->whereIn('id', $A); 552 $workerBuilder = Worker::query()
552 } else { 553 ->whereIn('id', $likedWorkersIds);
553 $Workers = Worker::query()->where('id', '=', '0');
554 }
555 554
556 if (($request->has('search')) && (!empty($request->get('search')))) { 555 if (($request->has('search')) && (!empty($request->get('search')))) {
557 $search = $request->get('search'); 556 $search = $request->get('search');
558 557
559 $Workers = $Workers->WhereHas('users', 558 $workerBuilder->whereHas('users', function (Builder $query) use ($search) {
560 function (Builder $query) use ($search) { 559 $query->where('surname', 'LIKE', "%$search%")
561 $query->Where('surname', 'LIKE', "%$search%") 560 ->oWhere('name_man', 'LIKE', "%$search%")
562 ->orWhere('name_man', 'LIKE', "%$search%") 561 ->orWhere('surname2', 'LIKE', "%$search%");
563 ->orWhere('surname2', 'LIKE', "%$search%"); 562 });
564 });
565 } else {
566 $Workers = $Workers->with('users');
567 } 563 }
568 564
569 $Workers = $Workers->get(); 565 $Workers = $workerBuilder->get();
570
571 566
572 return view('employers.favorite', compact('Workers')); 567 return view('employers.favorite', compact('Workers'));
573 } 568 }
574 569
575 // База данных 570 // База данных
576 public function bd(Request $request) { 571 public function bd(Request $request) {
577 $users = User_Model::query()->with('workers')->with('jobtitles'); 572 $users = User_Model::query()->with('workers')->with('jobtitles');
578 573
579 if ($request->has('search')) { 574 if ($request->has('search')) {
580 $find_key = $request->get('search'); 575 $find_key = $request->get('search');
581 $users = $users->where('name', 'LIKE', "%$find_key%") 576 $users = $users->where('name', 'LIKE', "%$find_key%")
582 ->orWhere('surname', 'LIKE', "%$find_key%") 577 ->orWhere('surname', 'LIKE', "%$find_key%")
583 ->orWhere('name_man', 'LIKE', "%$find_key%") 578 ->orWhere('name_man', 'LIKE', "%$find_key%")
584 ->orWhere('email', 'LIKE', "%$find_key%") 579 ->orWhere('email', 'LIKE', "%$find_key%")
585 ->orWhere('telephone', 'LIKE', "%$find_key%"); 580 ->orWhere('telephone', 'LIKE', "%$find_key%");
586 } 581 }
587 582
588 // Данные 583 // Данные
589 $users = $users->Baseuser()-> 584 $users = $users->Baseuser()->
590 orderByDesc(Worker::select('created_at')->whereColumn('workers.user_id', 'users.id')); 585 orderByDesc(Worker::select('created_at')->whereColumn('workers.user_id', 'users.id'));
591 $count_users = $users; 586 $count_users = $users;
592 $users = $users->paginate(5); 587 $users = $users->paginate(5);
593 588
594 $export_options = DbExportColumns::toArray(); 589 $export_options = DbExportColumns::toArray();
595 590
596 $jobs_titles = Job_title::select('id', 'name') 591 $jobs_titles = Job_title::select('id', 'name')
597 ->where('is_remove', '=', 0) 592 ->where('is_remove', '=', 0)
598 ->where('is_bd', '=', 2) 593 ->where('is_bd', '=', 2)
599 ->orderByDesc('sort') 594 ->orderByDesc('sort')
600 ->orderBy('name', 'asc') 595 ->orderBy('name', 'asc')
601 ->get() 596 ->get()
602 ->toArray() 597 ->toArray()
603 ; 598 ;
604 599
605 return view('employers.bd', compact('users', 'count_users', 'export_options', 'jobs_titles')); 600 return view('employers.bd', compact('users', 'count_users', 'export_options', 'jobs_titles'));
606 } 601 }
607 602
608 //Настройка уведомлений 603 //Настройка уведомлений
609 public function subscribe() { 604 public function subscribe() {
610 return view('employers.subcribe'); 605 return view('employers.subcribe');
611 } 606 }
612 607
613 //Установка уведомлений сохранение 608 //Установка уведомлений сохранение
614 public function save_subscribe(Request $request) { 609 public function save_subscribe(Request $request) {
615 dd($request->all()); 610 dd($request->all());
616 $msg = $request->validate([ 611 $msg = $request->validate([
617 'subscribe_email' => 'required|email|min:5|max:255', 612 'subscribe_email' => 'required|email|min:5|max:255',
618 ]); 613 ]);
619 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку'); 614 return redirect()->route('employer.subscribe')->with('Вы успешно подписались на рассылку');
620 } 615 }
621 616
622 //Сбросить форму с паролем 617 //Сбросить форму с паролем
623 public function password_reset() { 618 public function password_reset() {
624 $email = Auth()->user()->email; 619 $email = Auth()->user()->email;
625 return view('employers.password-reset', compact('email')); 620 return view('employers.password-reset', compact('email'));
626 } 621 }
627 622
628 //Обновление пароля 623 //Обновление пароля
629 public function new_password(Request $request) { 624 public function new_password(Request $request) {
630 $use = Auth()->user(); 625 $use = Auth()->user();
631 $request->validate([ 626 $request->validate([
632 'password' => 'required|string', 627 'password' => 'required|string',
633 'new_password' => 'required|string', 628 'new_password' => 'required|string',
634 'new_password2' => 'required|string' 629 'new_password2' => 'required|string'
635 ]); 630 ]);
636 631
637 if ($request->get('new_password') == $request->get('new_password2')) 632 if ($request->get('new_password') == $request->get('new_password2'))
638 if ($request->get('password') !== $request->get('new_password')) { 633 if ($request->get('password') !== $request->get('new_password')) {
639 $credentials = $request->only('email', 'password'); 634 $credentials = $request->only('email', 'password');
640 if (Auth::attempt($credentials)) { 635 if (Auth::attempt($credentials)) {
641 636
642 if (!is_null($use->email_verified_at)){ 637 if (!is_null($use->email_verified_at)){
643 638
644 $user_data = User_Model::find($use->id); 639 $user_data = User_Model::find($use->id);
645 $user_data->update([ 640 $user_data->update([
646 'password' => Hash::make($request->get('new_password')), 641 'password' => Hash::make($request->get('new_password')),
647 'pubpassword' => base64_encode($request->get('new_password')), 642 'pubpassword' => base64_encode($request->get('new_password')),
648 ]); 643 ]);
649 return redirect() 644 return redirect()
650 ->route('employer.password_reset') 645 ->route('employer.password_reset')
651 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 646 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
652 } 647 }
653 648
654 return redirect() 649 return redirect()
655 ->route('employer.password_reset') 650 ->route('employer.password_reset')
656 ->withError('Данная учетная запись не было верифицированна!'); 651 ->withError('Данная учетная запись не было верифицированна!');
657 } 652 }
658 } 653 }
659 654
660 return redirect() 655 return redirect()
661 ->route('employer.password_reset') 656 ->route('employer.password_reset')
662 ->withErrors('Не совпадение данных, обновите пароли!'); 657 ->withErrors('Не совпадение данных, обновите пароли!');
663 } 658 }
664 659
665 660
666 661
667 // Форма Удаление пипла 662 // Форма Удаление пипла
668 public function delete_people() { 663 public function delete_people() {
669 $login = Auth()->user()->email; 664 $login = Auth()->user()->email;
670 return view('employers.delete_people', compact('login')); 665 return view('employers.delete_people', compact('login'));
671 } 666 }
672 667
673 // Удаление аккаунта 668 // Удаление аккаунта
674 public function action_delete_user(Request $request) { 669 public function action_delete_user(Request $request) {
675 $Answer = $request->all(); 670 $Answer = $request->all();
676 $user_id = Auth()->user()->id; 671 $user_id = Auth()->user()->id;
677 $request->validate([ 672 $request->validate([
678 'password' => 'required|string', 673 'password' => 'required|string',
679 ]); 674 ]);
680 675
681 $credentials = $request->only('email', 'password'); 676 $credentials = $request->only('email', 'password');
682 if (Auth::attempt($credentials)) { 677 if (Auth::attempt($credentials)) {
683 Auth::logout(); 678 Auth::logout();
684 $it = User_Model::find($user_id); 679 $it = User_Model::find($user_id);
685 $it->delete(); 680 $it->delete();
686 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 681 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
687 } else { 682 } else {
688 return redirect()->route('employer.delete_people') 683 return redirect()->route('employer.delete_people')
689 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 684 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
690 } 685 }
691 } 686 }
692 687
693 public function ajax_delete_user(Request $request) { 688 public function ajax_delete_user(Request $request) {
694 $Answer = $request->all(); 689 $Answer = $request->all();
695 $user_id = Auth()->user()->id; 690 $user_id = Auth()->user()->id;
696 $request->validate([ 691 $request->validate([
697 'password' => 'required|string', 692 'password' => 'required|string',
698 ]); 693 ]);
699 $credentials = $request->only('email', 'password'); 694 $credentials = $request->only('email', 'password');
700 if (Auth::attempt($credentials)) { 695 if (Auth::attempt($credentials)) {
701 696
702 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт', 697 return json_encode(Array('SUCCESS' => 'Вы успешно удалили свой аккаунт',
703 'email' => $request->get('email'), 698 'email' => $request->get('email'),
704 'password' => $request->get('password'))); 699 'password' => $request->get('password')));
705 } else { 700 } else {
706 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль')); 701 return json_encode(Array('ERROR' => 'Неверный пароль! Нужен корректный пароль'));
707 } 702 }
708 } 703 }
709 704
710 // Рассылка сообщений 705 // Рассылка сообщений
711 public function send_all_messages() { 706 public function send_all_messages() {
712 $id = Auth()->user()->id; 707 $id = Auth()->user()->id;
713 $sending = Employer::query()->where('user_id', '=', "$id")->first(); 708 $sending = Employer::query()->where('user_id', '=', "$id")->first();
714 709
715 $job_titles = Job_title::query() 710 $job_titles = Job_title::query()
716 ->where('is_remove', '=', 0) 711 ->where('is_remove', '=', 0)
717 //->where('is_bd', '=', 1) 712 ->where('is_bd', '=', 1)
718 ->orderByDesc('sort') 713 ->orderByDesc('sort')
719 ->get(); 714 ->get();
720 715
721 if ($sending->sending_is) 716 if ($sending->sending_is)
722 return view('employers.send_all', compact('job_titles')); 717 return view('employers.send_all', compact('job_titles'));
723 else 718 else
724 return view('employers.send_all_danger'); 719 return view('employers.send_all_danger');
725 } 720 }
726 721
727 // Отправка сообщений для информации 722 // Отправка сообщений для информации
728 public function send_all_post(Request $request) { 723 public function send_all_post(Request $request) {
729 $data = $request->all(); 724 $data = $request->all();
730 $data['user'] = Auth()->user(); 725 $data['user'] = Auth()->user();
731 726
732 $id = MessagesRequests::create([ 727 $id = MessagesRequests::create([
733 'user_id' => $data['user']->id, 728 'user_id' => $data['user']->id,
734 'job_titles' => isset($data['job_title_ids']) ? json_encode($data['job_title_ids']) : null, 729 'job_titles' => isset($data['job_title_ids']) ? json_encode($data['job_title_ids']) : null,
735 'text' => $data['message_text'], 730 'text' => $data['message_text'],
736 ]); 731 ]);
737 732
738 try { 733 try {
739 if (!empty($id)) { 734 if (!empty($id)) {
740 Mail::to(env('EMAIL_ADMIN'))->send(new MassSendingMessages($data)); 735 Mail::to(env('EMAIL_ADMIN'))->send(new MassSendingMessages($data));
741 } 736 }
742 } catch (Throwable $e) { 737 } catch (Throwable $e) {
743 Log::error($e); 738 Log::error($e);
744 return redirect()->route('employer.send_all_messages')->with('error', 'Ошибка почтового сервера, пожалуйста, повторите рассылку позднее'); 739 return redirect()->route('employer.send_all_messages')->with('error', 'Ошибка почтового сервера, пожалуйста, повторите рассылку позднее');
745 } 740 }
746 741
747 return redirect()->route('employer.send_all_messages')->with('success', 'Запрос на рассылку был успешно отправлен.'); 742 return redirect()->route('employer.send_all_messages')->with('success', 'Запрос на рассылку был успешно отправлен.');
748 } 743 }
749 744
750 // База резюме 745 // База резюме
751 public function bd_tupe(Request $request) { 746 public function bd_tupe(Request $request) {
752 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get(); 747 $Resume = User_Model::query()->with('workers')->where('is_bd', '=', '1')->get();
753 748
754 return view('employers.bd_tupe', compact('Resume')); 749 return view('employers.bd_tupe', compact('Resume'));
755 } 750 }
756 751
757 ////////////////////////////////////////////////////////////////// 752 //////////////////////////////////////////////////////////////////
758 // Отправил сообщение 753 // Отправил сообщение
759 ////////////////////////////////////////////////////////////////// 754 //////////////////////////////////////////////////////////////////
760 public function new_message(Request $request) { 755 public function new_message(Request $request)
756 {
761 $params = $request->all(); 757 $params = $request->all();
762 758
763 $id = $params['_user_id']; 759 $id = $params['_user_id'];
764 $message_params = [ 760 $message_params = [
765 'title' => $params['title'], 761 'title' => $params['title'],
766 'text' => $params['text'], 762 'text' => $params['text'],
767 'ad_employer_id' => $params['_vacancy'], 763 'ad_employer_id' => $params['_vacancy'],
768 'flag_new' => 1 764 'flag_new' => 1
769 ]; 765 ];
770 766
767 dd($params);
768
771 Message::add_message( 769 Message::add_message(
772 $request, 770 $request,
773 $params['_user_id'], 771 $params['_user_id'],
774 $params['_to_user_id'], 772 $params['_to_user_id'],
775 $message_params, 773 $message_params,
776 file_store_path: "worker/$id" 774 file_store_path: "worker/$id"
777 ); 775 );
778 776
779 return redirect()->route('employer.messages', ['type_message' => 'output']); 777 return redirect()->route('employer.messages', ['type_message' => 'output']);
780 } 778 }
781 779
782 // Восстановление пароля 780 // Восстановление пароля
783 public function repair_password(Request $request) { 781 public function repair_password(Request $request) {
784 $params = $request->get('email'); 782 $params = $request->get('email');
785 } 783 }
786 784
787 // Избранные люди на корабль 785 // Избранные люди на корабль
788 public function selected_people(Request $request) { 786 public function selected_people(Request $request) {
789 $id = $request->get('id'); 787 $id = $request->get('id');
790 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')-> 788 $favorite_people = Job_title::query()->orderByDesc('sort')->OrderBy('name')->
791 where('is_remove', '=', '0')-> 789 where('is_remove', '=', '0')->
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\employers_main; 13 use App\Models\employers_main;
14 use App\Models\Job_title; 14 use App\Models\Job_title;
15 use App\Models\Like_vacancy; 15 use App\Models\Like_vacancy;
16 use App\Models\Like_worker; 16 use App\Models\Like_worker;
17 use App\Models\News; 17 use App\Models\News;
18 use App\Models\Positions; 18 use App\Models\Positions;
19 use App\Models\reclame; 19 use App\Models\reclame;
20 use App\Models\User; 20 use App\Models\User;
21 use Illuminate\Http\Request; 21 use Illuminate\Http\Request;
22 use Illuminate\Support\Facades\Auth; 22 use Illuminate\Support\Facades\Auth;
23 use Illuminate\Support\Facades\DB; 23 use Illuminate\Support\Facades\DB;
24 use Illuminate\Support\Facades\Hash; 24 use Illuminate\Support\Facades\Hash;
25 use Illuminate\Support\Facades\Mail; 25 use Illuminate\Support\Facades\Mail;
26 use Illuminate\Support\Facades\Validator; 26 use Illuminate\Support\Facades\Validator;
27 use App\Models\PageContent; 27 use App\Models\PageContent;
28 use App\Enums\MainPageCounters; 28 use App\Enums\MainPageCounters;
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 $Job_title = Job_title::query()->where('is_remove', '=', '0')-> 42 $Job_title = Job_title::query()->where('is_remove', '=', '0')->
43 where('is_bd', '=', '0')->orderByDesc('sort')->get(); 43 where('is_bd', '=', '0')->orderByDesc('sort')->get();
44 44
45 $Data = DB::table('job_titles')-> 45 $Data = DB::table('job_titles')->
46 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')-> 46 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')->
47 where('categories.is_remove', '=', '0')-> 47 where('categories.is_remove', '=', '0')->
48 where('job_titles.is_remove', '=', '0')-> 48 where('job_titles.is_remove', '=', '0')->
49 where('job_titles.is_bd', '=' , '0')-> 49 where('job_titles.is_bd', '=' , '0')->
50 leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')-> 50 leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')->
51 join('categories', 'categories.id', '=', 'job_titles.position_id')-> 51 join('categories', 'categories.id', '=', 'job_titles.position_id')->
52 groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')-> 52 groupBy('job_titles.id')->orderBy('categories.id')->orderByDesc('job_titles.position_id')->
53 orderByDesc('job_titles.sort')->get()->toArray(); 53 orderByDesc('job_titles.sort')->get()->toArray();
54 54
55 $Main_Job = array(); 55 $Main_Job = array();
56 $name_cat = ''; 56 $name_cat = '';
57 foreach ($Data as $it) { 57 foreach ($Data as $it) {
58 $it_arr = (array)$it; 58 $it_arr = (array)$it;
59 if ($name_cat != $it_arr['catname']) $name_cat = $it_arr['catname']; 59 if ($name_cat != $it_arr['catname']) $name_cat = $it_arr['catname'];
60 $Main_Job[$name_cat][] = $it_arr; 60 $Main_Job[$name_cat][] = $it_arr;
61 } 61 }
62 62
63 $employers = employers_main::query()->with('employer')-> 63 $employers = employers_main::query()->with('employer')->
64 whereHas('employer', function ($query) { 64 whereHas('employer', function ($query) {
65 $query->where('status_hidden', '=', '0'); 65 $query->where('status_hidden', '=', '0');
66 })-> 66 })->
67 orderBy('sort')->get(); 67 orderBy('sort')->get();
68 $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get(); 68 $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get();
69 69
70 $block_names = MainPageCounters::values();; 70 $block_names = MainPageCounters::values();;
71 $blocks_counters = PageContent::select('name', 'title', 'description', 'extra') 71 $blocks_counters = PageContent::select('name', 'title', 'description', 'extra')
72 ->whereIn('name', $block_names) 72 ->whereIn('name', $block_names)
73 ->orderBy('name', 'asc') 73 ->orderBy('name', 'asc')
74 ->get() 74 ->get()
75 ->keyBy('name') 75 ->keyBy('name')
76 ->toArray(); 76 ->toArray();
77 77
78 return view('index', compact('news', 'Job_title', 'categories', 'employers', 'vacancy', 'Main_Job', 'blocks_counters')); 78 return view('index', compact('news', 'Job_title', 'categories', 'employers', 'vacancy', 'Main_Job', 'blocks_counters'));
79 } 79 }
80 80
81 public function search_vacancies(Request $request) { 81 public function search_vacancies(Request $request) {
82 if ($request->has('search')) { 82 if ($request->has('search')) {
83 $search = $request->get('search'); 83 $search = $request->get('search');
84 $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first(); 84 $job_titles = Job_title::query()->where('name', 'LIKE', "%$search%")->first();
85 if (isset($job_titles->id)) 85 if (isset($job_titles->id))
86 if ($job_titles->id > 0) 86 if ($job_titles->id > 0)
87 return redirect()->route('vacancies', ['job' => $job_titles->id]); 87 return redirect()->route('vacancies', ['job' => $job_titles->id]);
88 } 88 }
89 } 89 }
90 90
91 // Лайк вакансии 91 // Лайк вакансии
92 public function like_vacancy(Request $request) { 92 public function like_vacancy(Request $request)
93 $IP_address = RusDate::ip_addr_client(); 93 {
94 if(Auth::user() === null) {
95 return;//todo unauthenticated behavior
96 }
94 97
95 if ($request->has('code_record')) { 98 if ($request->has('code_record')) {
96 if ($request->has('delete')) { 99 if ($request->has('delete')) {
97 $code = $request->get('code_record'); 100 DB::table('like_vacancy')
98 $atomic_era = Like_vacancy::select('id')-> 101 ->where('code_record', $request->get('code_record'))
99 where('code_record', '=', $code)->toSql(); 102 ->where('user_id', Auth::user()->id)
100 DB::table('like_vacancy')->where('code_record', $request->get('code_record'))->delete(); 103 ->delete();
101 104
102 } else { 105 } else {
103 $params = $request->all(); 106 $params = $request->all();
104 $params['ip_address'] = $IP_address; 107 $params['user_id'] = Auth::user()->id;
105 Like_vacancy::create($params); 108 Like_vacancy::create($params);
106 }
107 } 109 }
110 }
108 } 111 }
109 112
110 // Лайк соискателю. 113 // Лайк соискателю.
111 public function like_worker(Request $request) { 114 public function like_worker(Request $request)
112 $IP_address = RusDate::ip_addr_client(); 115 {
116 if(Auth::user() === null) {
117 return;//todo unauthenticated behavior
118 }
113 119
114 if ($request->has('code_record')) { 120 if ($request->has('code_record')) {//fixme make non-absurd validation
115 if ($request->has('delete')) { 121 if ($request->has('delete')) {
116 $atomic_era = Like_worker::select('id')-> 122 DB::table('like_worker')
117 where('code_record', '=', $request-> 123 ->where('code_record', $request->get('code_record'))
118 get('code_record'))->first(); 124 ->where('user_id', Auth::user()->id)
119 125 ->delete();
120 DB::table('like_worker')->where('code_record', $request->get('code_record'))->delete();
121 126
122 return "Вот и результат удаления!"; 127 return "Вот и результат удаления!";
123 128
124 } else { 129 } else {
125 $params = $request->all(); 130 $params = $request->all();
126 $params['ip_address'] = $IP_address; 131 $params['user_id'] = Auth::user()->id;
127 Like_worker::create($params); 132 Like_worker::create($params);
128 } 133 }
129 } 134 }
130 } 135 }
131 136
132 public function vacancies(Request $request) { 137 public function vacancies(Request $request) {
133 //должности 138 //должности
134 $Job_title = Job_title::query()->where('is_remove', '=', '0')-> 139 $Job_title = Job_title::query()->where('is_remove', '=', '0')->
135 where('is_bd', '=', '0')->orderByDesc('sort')-> 140 where('is_bd', '=', '0')->orderByDesc('sort')->
136 orderBy('name')->get(); 141 orderBy('name')->get();
137 142
138 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*') 143 $categories = Category::query()->selectRaw('count(ad_employers.id) as cnt, categories.*')
139 ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary') 144 ->selectRaw('min(ad_employers.salary) as min_salary, max(ad_employers.salary) as max_salary')
140 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id') 145 ->join('ad_employers', 'ad_employers.category_id', '=', 'categories.id')
141 ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id'); 146 ->join('ad_jobs', 'ad_jobs.ad_employer_id', '=', 'ad_employers.id');
142 147
143 //категории и вакансии 148 //категории и вакансии
144 if (($request->has('job')) && ($request->get('job') > 0)) { 149 if (($request->has('job')) && ($request->get('job') > 0)) {
145 $categories = $categories->Where('job_title_id', '=', $request->get('job')); 150 $categories = $categories->Where('job_title_id', '=', $request->get('job'));
146 } 151 }
147 152
148 $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get(); 153 $categories = $categories->OrderByDesc('created_at')->GroupBy('categories.id')->get();
149 154
150 $Data = DB::table('job_titles')-> 155 $Data = DB::table('job_titles')->
151 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')-> 156 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')->
152 where('categories.is_remove', '=', '0')-> 157 where('categories.is_remove', '=', '0')->
153 where('job_titles.is_bd', '=' , '0')-> 158 where('job_titles.is_bd', '=' , '0')->
154 where('job_titles.is_remove', '=', '0'); 159 where('job_titles.is_remove', '=', '0');
155 160
156 if (($request->has('job')) && ($request->get('job') > 0)) { 161 if (($request->has('job')) && ($request->get('job') > 0)) {
157 $Data->where('job_title_id', $request->get('job')); 162 $Data->where('job_title_id', $request->get('job'));
158 } 163 }
159 164
160 $Data = $Data->leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id') 165 $Data = $Data->leftJoin('ad_jobs', 'ad_jobs.job_title_id', '=', 'job_titles.id')
161 ->join('categories', 'categories.id', '=', 'job_titles.position_id') 166 ->join('categories', 'categories.id', '=', 'job_titles.position_id')
162 ->groupBy('job_titles.id') 167 ->groupBy('job_titles.id')
163 ->orderBy('categories.id') 168 ->orderBy('categories.id')
164 ->orderByDesc('job_titles.position_id') 169 ->orderByDesc('job_titles.position_id')
165 ->orderByDesc('job_titles.sort') 170 ->orderByDesc('job_titles.sort')
166 ->get() 171 ->get()
167 ->toArray(); 172 ->toArray();
168 173
169 $Main_Job = array(); 174 $Main_Job = array();
170 $name_cat = ''; 175 $name_cat = '';
171 foreach ($Data as $it) { 176 foreach ($Data as $it) {
172 $it_arr = (array)$it; 177 $it_arr = (array)$it;
173 if ($name_cat != $it_arr['catname']) { 178 if ($name_cat != $it_arr['catname']) {
174 $name_cat = $it_arr['catname']; 179 $name_cat = $it_arr['catname'];
175 } 180 }
176 $Main_Job[$name_cat][] = $it_arr; 181 $Main_Job[$name_cat][] = $it_arr;
177 } 182 }
178 183
179 if ($request->ajax()) { 184 if ($request->ajax()) {
180 return view('ajax.new_sky', compact('categories', 'Main_Job')); 185 return view('ajax.new_sky', compact('categories', 'Main_Job'));
181 } else { 186 } else {
182 return view('new_sky', compact('Job_title', 'categories', 'Main_Job')); 187 return view('new_sky', compact('Job_title', 'categories', 'Main_Job'));
183 } 188 }
184 } 189 }
185 190
186 //Вакансии категория детальная 191 //Вакансии категория детальная
187 public function list_vacancies(Category $categories, Request $request) { 192 public function list_vacancies(Category $categories, Request $request) {
188 if (isset(Auth()->user()->id)) 193 if (isset(Auth()->user()->id))
189 $uid = Auth()->user()->id; 194 $uid = Auth()->user()->id;
190 else 195 else
191 $uid = 0; 196 $uid = 0;
192 197
193 if ($request->get('job') == 0) 198 if ($request->get('job') == 0)
194 $job_search = ''; 199 $job_search = '';
195 else 200 else
196 $job_search = $request->get('job'); 201 $job_search = $request->get('job');
197 202
198 $Query = Ad_employer::with('jobs') 203 $Query = Ad_employer::with('jobs')
199 ->with('cat') 204 ->with('cat')
200 ->with('employer') 205 ->with('employer')
201 ->where('is_remove', 0) 206 ->where('is_remove', 0)
202 ->whereHas('jobs_code', function ($query) use ($job_search) { 207 ->whereHas('jobs_code', function ($query) use ($job_search) {
203 if (!empty($job_search)) { 208 if (!empty($job_search)) {
204 $query->where('job_title_id', $job_search); 209 $query->where('job_title_id', $job_search);
205 } 210 }
206 }) 211 })
207 ->select('ad_employers.*'); 212 ->select('ad_employers.*');
208 213
209 if (isset($categories->id) && ($categories->id > 0)) { 214 if (isset($categories->id) && ($categories->id > 0)) {
210 $Query = $Query->where('category_id', '=', $categories->id); 215 $Query = $Query->where('category_id', '=', $categories->id);
211 $Name_categori = Category::query()->where('id', '=', $categories->id)->get(); 216 $Name_categori = Category::query()->where('id', '=', $categories->id)->get();
212 } else { 217 } else {
213 $Name_categori = ''; 218 $Name_categori = '';
214 } 219 }
215 220
216 if ($request->get('sort')) { 221 if ($request->get('sort')) {
217 $sort = $request->get('sort'); 222 $sort = $request->get('sort');
218 switch ($sort) { 223 switch ($sort) {
219 case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break; 224 case 'name_up': $Query = $Query->orderBy('name')->orderBy('id'); break;
220 case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break; 225 case 'name_down': $Query = $Query->orderByDesc('name')->orderby('id'); break;
221 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; 226 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
222 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; 227 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
223 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; 228 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
224 default: $Query = $Query->orderbyDesc('updated_at')->orderBy('id'); break; 229 default: $Query = $Query->orderbyDesc('updated_at')->orderBy('id'); break;
225 } 230 }
226 } 231 }
227 232
228 $Job_title = Job_title::query()->where('is_remove', '=', '0')-> 233 $Job_title = Job_title::query()->where('is_remove', '=', '0')->
229 where('is_bd', '=', '0')->orderByDesc('sort')-> 234 where('is_bd', '=', '0')->orderByDesc('sort')->
230 orderBy('name')->get(); 235 orderBy('name')->get();
231 236
232 $Query_count = $Query->count(); 237 $Query_count = $Query->count();
233 238
234 $Query = $Query->OrderByDesc('updated_at')->paginate(10); 239 $Query = $Query->OrderByDesc('updated_at')->paginate(10);
235 240
236 $Reclama = reclame::query()->get(); 241 $Reclama = reclame::query()->get();
237 242
238 if ($request->ajax()) { 243 if ($request->ajax()) {
239 if ($request->has('title')) { 244 if ($request->has('title')) {
240 return view('ajax.list_category', compact( 245 return view('ajax.list_category', compact(
241 'Name_categori' 246 'Name_categori'
242 )); 247 ));
243 } else { 248 } else {
244 return view('ajax.list_vacancies', compact('Query', 249 return view('ajax.list_vacancies', compact('Query',
245 'Query_count', 250 'Query_count',
246 'Name_categori', 251 'Name_categori',
247 'Reclama', 252 'Reclama',
248 'categories', 253 'categories',
249 'Job_title', 254 'Job_title',
250 'uid')); 255 'uid'));
251 } 256 }
252 } else { 257 } else {
253 //Вернуть все 258 //Вернуть все
254 return view('list_vacancies', compact('Query', 259 return view('list_vacancies', compact('Query',
255 'Query_count', 260 'Query_count',
256 'Reclama', 261 'Reclama',
257 'Name_categori', 262 'Name_categori',
258 'categories', 263 'categories',
259 'Job_title', 264 'Job_title',
260 'uid')); 265 'uid'));
261 } 266 }
262 } 267 }
263 268
264 // Контакты 269 // Контакты
265 public function contacts() { 270 public function contacts() {
266 return view('contacts'); 271 return view('contacts');
267 } 272 }
268 273
269 // Вход в личный кабинет 274 // Вход в личный кабинет
270 public function input_login(Request $request) 275 public function input_login(Request $request)
271 { 276 {
272 $params = $request->all(); 277 $params = $request->all();
273 278
274 279
275 $rules = [ 280 $rules = [
276 'email' => 'required|string|email', 281 'email' => 'required|string|email',
277 'password' => 'required|string|min:3|max:25', 282 'password' => 'required|string|min:3|max:25',
278 ]; 283 ];
279 284
280 $messages = [ 285 $messages = [
281 'required' => 'Укажите обязательное поле «:attribute»', 286 'required' => 'Укажите обязательное поле «:attribute»',
282 'email' => 'Введите корректный email', 287 'email' => 'Введите корректный email',
283 'min' => [ 288 'min' => [
284 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 289 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
285 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 290 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
286 ], 291 ],
287 'max' => [ 292 'max' => [
288 'string' => 'Поле «:attribute» должно быть не больше :max символов', 293 'string' => 'Поле «:attribute» должно быть не больше :max символов',
289 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 294 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
290 ], 295 ],
291 ]; 296 ];
292 $validator = Validator::make($request->all(), $rules, $messages); 297 $validator = Validator::make($request->all(), $rules, $messages);
293 if ($validator->fails()) { 298 if ($validator->fails()) {
294 if (Auth::check()) 299 if (Auth::check())
295 $user_id = $request->user()->id; 300 $user_id = $request->user()->id;
296 else 301 else
297 $user_id = 0; 302 $user_id = 0;
298 303
299 if ($user_id > 0) 304 if ($user_id > 0)
300 return json_encode(Array("ERROR" => "Email или пароль невалидный!")); 305 return json_encode(Array("ERROR" => "Email или пароль невалидный!"));
301 else 306 else
302 return redirect()->route('index')->with('Error', "Email или пароль невалидный"); 307 return redirect()->route('index')->with('Error', "Email или пароль невалидный");
303 } else { 308 } else {
304 $credentials = $request->only('email', 'password'); 309 $credentials = $request->only('email', 'password');
305 310
306 if (Auth::attempt($credentials, $request->has('remember'))) { 311 if (Auth::attempt($credentials, $request->has('remember'))) {
307 312
308 if (is_null(Auth::user()->email_verified_at)) { 313 if (is_null(Auth::user()->email_verified_at)) {
309 Auth::logout(); 314 Auth::logout();
310 return json_encode(Array("ERROR" => "Адрес почты не подтвержден")); 315 return json_encode(Array("ERROR" => "Адрес почты не подтвержден"));
311 } 316 }
312 317
313 if (Auth::user()->is_worker) { 318 if (Auth::user()->is_worker) {
314 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl())); 319 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));
315 } else { 320 } else {
316 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl())); 321 return json_encode(Array("REDIRECT" => redirect()->route('employer.cabinet')->getTargetUrl()));
317 } 322 }
318 323
319 return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет")); 324 return json_encode(Array("SUCCESS" => "Вы успешно вошли в личный кабинет"));
320 //->route('index') 325 //->route('index')
321 //->with('success', 'Вы вошли в личный кабинет.'); 326 //->with('success', 'Вы вошли в личный кабинет.');
322 } else { 327 } else {
323 return json_encode(Array("ERROR" => "Неверный логин или пароль!")); 328 return json_encode(Array("ERROR" => "Неверный логин или пароль!"));
324 } 329 }
325 } 330 }
326 } 331 }
327 332
328 // Восстановление пароля 333 // Восстановление пароля
329 public function repair_password(Request $request) { 334 public function repair_password(Request $request) {
330 $rules = [ 335 $rules = [
331 'email' => 'required|string|email', 336 'email' => 'required|string|email',
332 ]; 337 ];
333 338
334 $messages = [ 339 $messages = [
335 'required' => 'Укажите обязательное поле «:attribute»', 340 'required' => 'Укажите обязательное поле «:attribute»',
336 'email' => 'Введите корректный email', 341 'email' => 'Введите корректный email',
337 'min' => [ 342 'min' => [
338 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 343 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
339 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 344 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
340 ], 345 ],
341 'max' => [ 346 'max' => [
342 'string' => 'Поле «:attribute» должно быть не больше :max символов', 347 'string' => 'Поле «:attribute» должно быть не больше :max символов',
343 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 348 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
344 ], 349 ],
345 ]; 350 ];
346 351
347 $validator = Validator::make($request->all(), $rules, $messages); 352 $validator = Validator::make($request->all(), $rules, $messages);
348 353
349 if ($validator->fails()) { 354 if ($validator->fails()) {
350 return redirect()->back()->with('Error', "Email невалидный"); 355 return redirect()->back()->with('Error', "Email невалидный");
351 } else { 356 } else {
352 $new_password = Tools::generator_id(10); 357 $new_password = Tools::generator_id(10);
353 $hash_password = Hash::make($new_password); 358 $hash_password = Hash::make($new_password);
354 $user = User::query()->where('email', $request->get('email'))->first(); 359 $user = User::query()->where('email', $request->get('email'))->first();
355 $EditRec = User::find($user->id); 360 $EditRec = User::find($user->id);
356 $EditRec->password = $hash_password; 361 $EditRec->password = $hash_password;
357 $EditRec->save(); 362 $EditRec->save();
358 363
359 foreach ([$request->get('email')] as $recipient) { 364 foreach ([$request->get('email')] as $recipient) {
360 Mail::to($recipient)->send(new MailRepair($new_password)); 365 Mail::to($recipient)->send(new MailRepair($new_password));
361 } 366 }
362 return redirect()->route('index'); 367 return redirect()->route('index');
363 368
364 } 369 }
365 370
366 } 371 }
367 372
368 // Вывод новостей 373 // Вывод новостей
369 public function news(Request $request) { 374 public function news(Request $request) {
370 $Query = News::query(); 375 $Query = News::query();
371 if ($request->has('search')) { 376 if ($request->has('search')) {
372 $search = $request->get('search'); 377 $search = $request->get('search');
373 $Query = $Query->where('title', 'LIKE', "%$search%")-> 378 $Query = $Query->where('title', 'LIKE', "%$search%")->
374 orWhere('text', 'LIKE', "%$search%"); 379 orWhere('text', 'LIKE', "%$search%");
375 } 380 }
376 381
377 if ($request->ajax()) { 382 if ($request->ajax()) {
378 if ($request->get('sort')) { 383 if ($request->get('sort')) {
379 $sort = $request->get('sort'); 384 $sort = $request->get('sort');
380 switch ($sort) { 385 switch ($sort) {
381 case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break; 386 case 'name_up': $Query = $Query->orderBy('title')->orderBy('id'); break;
382 case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break; 387 case 'name_down': $Query = $Query->orderByDesc('title')->orderby('id'); break;
383 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break; 388 case 'created_at_up': $Query = $Query->OrderBy('created_at')->orderBy('id'); break;
384 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break; 389 case 'created_at_down': $Query = $Query->orderByDesc('created_at')->orderBy('id'); break;
385 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break; 390 case 'default': $Query = $Query->orderBy('id')->orderby('updated_at'); break;
386 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break; 391 default: $Query = $Query->orderBy('id')->orderby('updated_at'); break;
387 } 392 }
388 } 393 }
389 } 394 }
390 $Query_count = $Query->count(); 395 $Query_count = $Query->count();
391 $Query = $Query->paginate(6); 396 $Query = $Query->paginate(6);
392 397
393 if ($request->ajax()) { 398 if ($request->ajax()) {
394 return view('ajax.news-list', compact('Query', 'Query_count')); 399 return view('ajax.news-list', compact('Query', 'Query_count'));
395 } else { 400 } else {
396 return view('news-list', compact('Query', 'Query_count')); 401 return view('news-list', compact('Query', 'Query_count'));
397 } 402 }
398 } 403 }
399 404
400 //Детальная новость 405 //Детальная новость
401 public function detail_new(News $new) { 406 public function detail_new(News $new) {
402 // Наборка 407 // Наборка
403 $Query = News::query()->where('id', $new->id)->get(); 408 $Query = News::query()->where('id', $new->id)->get();
404 $title = $Query[0]->title; 409 $title = $Query[0]->title;
405 $All_Query = News::query()->paginate(8); 410 $All_Query = News::query()->paginate(8);
406 return view('detail_new', compact('Query', 'All_Query', 'title')); 411 return view('detail_new', compact('Query', 'All_Query', 'title'));
407 } 412 }
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\Classes\Tools;
6 use App\Http\Requests\DocumentsRequest; 7 use App\Http\Requests\DocumentsRequest;
7 use App\Http\Requests\PrevCompanyRequest; 8 use App\Http\Requests\PrevCompanyRequest;
8 use App\Http\Requests\SertificationRequest; 9 use App\Http\Requests\SertificationRequest;
9 use App\Models\Ad_employer; 10 use App\Models\Ad_employer;
10 use App\Models\ad_response; 11 use App\Models\ad_response;
11 use App\Models\Chat; 12 use App\Models\Chat;
12 use App\Models\Dop_info; 13 use App\Models\Dop_info;
13 use App\Models\infobloks; 14 use App\Models\infobloks;
14 use App\Models\Job_title; 15 use App\Models\Job_title;
15 use App\Models\Like_vacancy; 16 use App\Models\Like_vacancy;
16 use App\Models\Message; 17 use App\Models\Message;
17 use App\Models\place_works; 18 use App\Models\place_works;
18 use App\Models\PrevCompany; 19 use App\Models\PrevCompany;
19 use App\Models\ResponseWork; 20 use App\Models\ResponseWork;
20 use App\Models\sertification; 21 use App\Models\sertification;
21 use App\Models\Static_worker; 22 use App\Models\Static_worker;
22 use App\Models\Title_worker; 23 use App\Models\Title_worker;
23 use App\Models\User; 24 use App\Models\User;
24 use App\Models\User as User_Model; 25 use App\Models\User as User_Model;
25 use App\Models\Worker; 26 use App\Models\Worker;
26 use Barryvdh\DomPDF\Facade\Pdf; 27 use Barryvdh\DomPDF\Facade\Pdf;
27 use Carbon\Carbon; 28 use Carbon\Carbon;
28 use Illuminate\Auth\Events\Registered; 29 use Illuminate\Auth\Events\Registered;
29 use Illuminate\Database\Eloquent\Builder; 30 use Illuminate\Database\Eloquent\Builder;
30 use Illuminate\Http\Request; 31 use Illuminate\Http\Request;
31 use Illuminate\Support\Facades\Auth; 32 use Illuminate\Support\Facades\Auth;
32 use Illuminate\Support\Facades\Hash; 33 use Illuminate\Support\Facades\Hash;
33 use Illuminate\Support\Facades\Storage; 34 use Illuminate\Support\Facades\Storage;
34 use Illuminate\Support\Facades\Validator; 35 use Illuminate\Support\Facades\Validator;
35 use PhpOffice\PhpSpreadsheet\Spreadsheet; 36 use PhpOffice\PhpSpreadsheet\Spreadsheet;
36 use PhpOffice\PhpSpreadsheet\Writer\Xlsx; 37 use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
37 use Symfony\Component\HttpFoundation\StreamedResponse; 38 use Symfony\Component\HttpFoundation\StreamedResponse;
38 use App\Enums\DbExportColumns; 39 use App\Enums\DbExportColumns;
39 use App\Enums\WorkerStatuses; 40 use App\Enums\WorkerStatuses;
40 use DateTime; 41 use DateTime;
41 42
42 class WorkerController extends Controller 43 class WorkerController extends Controller
43 { 44 {
44 //профиль 45 //профиль
45 public function profile(Worker $worker) 46 public function profile(Worker $worker)
46 { 47 {
47 $get_date = date('Y.m'); 48 $get_date = date('Y.m');
48 49
49 $c = Static_worker::query()->where('year_month', '=', $get_date) 50 $c = Static_worker::query()->where('year_month', '=', $get_date)
50 ->where('user_id', '=', $worker->users->id) 51 ->where('user_id', '=', $worker->users->id)
51 ->get(); 52 ->get();
52 53
53 if ($c->count() > 0) { 54 if ($c->count() > 0) {
54 $upd = Static_worker::find($c[0]->id); 55 $upd = Static_worker::find($c[0]->id);
55 $upd->lookin = $upd->lookin + 1; 56 $upd->lookin = $upd->lookin + 1;
56 $upd->save(); 57 $upd->save();
57 } else { 58 } else {
58 $crt = new Static_worker(); 59 $crt = new Static_worker();
59 $crt->lookin = 1; 60 $crt->lookin = 1;
60 $crt->year_month = $get_date; 61 $crt->year_month = $get_date;
61 $crt->user_id = $worker->user_id; 62 $crt->user_id = $worker->user_id;
62 $crt->save(); 63 $crt->save();
63 } 64 }
64 65
65 $stat = Static_worker::query()->where('year_month', '=', $get_date) 66 $stat = Static_worker::query()->where('year_month', '=', $get_date)
66 ->where('user_id', '=', $worker->users->id) 67 ->where('user_id', '=', $worker->users->id)
67 ->get(); 68 ->get();
68 69
69 return view('public.workers.profile', compact('worker', 'stat')); 70 return view('public.workers.profile', compact('worker', 'stat'));
70 } 71 }
71 72
72 // лист база резюме 73 // лист база резюме
73 public function bd_resume(Request $request) 74 public function bd_resume(Request $request)
74 { 75 {
75 $look = false;
76 $idiot = 0;
77 if (isset(Auth()->user()->id)) { 76 if (isset(Auth()->user()->id)) {
78 $idiot = Auth()->user()->id; 77 if ((Auth()->user()->is_worker) || (!Auth()->user()->is_lookin))
79 if ((!Auth()->user()->is_worker) && (Auth()->user()->is_lookin)) 78 return redirect()->route('index')->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]);
80 $look = true;
81 } 79 }
82 80
83 if ($look) { 81 $status_work = WorkerStatuses::getWorkerStatuses();
84 $status_work = WorkerStatuses::getWorkerStatuses();
85 $resumes = Worker::query()->with('users')->with('job_titles')->orderByDesc('updated_at');;
86 $resumes = $resumes->whereHas('users', function (Builder $query) {
87 $query->Where('is_worker', '=', '1')
88 ->Where('is_bd', '=', '0');
89 });
90 82
91 //dd($request->get('job')); 83 $resumes = Worker::query()->with('users')->with('job_titles')->orderByDesc('updated_at');
92 if (($request->has('job')) && ($request->get('job') > 0)) { 84 $resumes = $resumes->whereHas('users', function (Builder $query) {
93 $resumes = $resumes->whereHas('job_titles', function (Builder $query) use ($request) { 85 $query->Where('is_worker', '=', '1')
94 $query->Where('job_titles.id', $request->get('job')); 86 ->Where('is_bd', '=', '0');
95 }); 87 });
96 }
97 88
98 $Job_title = Job_title::query() 89 if (($request->has('job')) && ($request->get('job') > 0)) {
99 ->where('is_remove', '=', '0') 90 $resumes = $resumes->whereHas('job_titles', function (Builder $query) use ($request) {
100 ->where('is_bd', '=' , '1') 91 $query->Where('job_titles.id', $request->get('job'));
101 ->orderByDesc('sort') 92 });
102 ->get() 93 }
103 ;
104 94
105 if ($request->get('sort')) { 95 $Job_title = Job_title::query()
106 $sort = $request->get('sort'); 96 ->where('is_remove', '=', '0')
107 switch ($sort) { 97 ->where('is_bd', '=' , '1')
108 case 'looking_for_work': 98 ->orderByDesc('sort')
109 $resumes->where('status_work', '=', WorkerStatuses::LookingForWork->value); 99 ->get();
110 break; 100
111 case 'considering_offers': 101 if ($request->get('sort')) {
112 $resumes->where('status_work', '=', WorkerStatuses::ConsideringOffers->value); 102 $sort = $request->get('sort');
113 break; 103 switch ($sort) {
114 case 'not_looking_for_work': 104 case 'looking_for_work':
115 $resumes->where('status_work', '=', WorkerStatuses::NotLookingForWork->value); 105 $resumes->where('status_work', '=', WorkerStatuses::LookingForWork->value);
116 break; 106 break;
117 } 107 case 'considering_offers':
108 $resumes->where('status_work', '=', WorkerStatuses::ConsideringOffers->value);
109 break;
110 case 'not_looking_for_work':
111 $resumes->where('status_work', '=', WorkerStatuses::NotLookingForWork->value);
112 break;
118 } 113 }
114 }
119 115
120 $res_count = $resumes->count(); 116 $resumes->where(function (Builder $query) {
121 //$resumes = $resumes->get(); 117 $query->whereNotNull('telephone')
122 $resumes = $resumes->paginate(4); 118 ->whereNotNull('email')
123 if ($request->ajax()) { 119 ->whereNotNull('city')
124 // Условия обставлены 120 ->whereNotNull('experience')
125 if ($request->has('block') && ($request->get('block') == 1)) { 121 ->whereNotNull('old_year');
126 return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot')); 122 //fixme костыль, переделать
127 } 123 });
128 } else { 124
129 return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot', 'Job_title')); 125 $res_count = $resumes->count();
126 $resumes = $resumes->paginate(4);
127 if ($request->ajax()) {
128 // Условия обставлены
129 if ($request->has('block') && ($request->get('block') == 1)) {
130 return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count'));
130 } 131 }
131 } else { 132 } else {
132 return redirect()->route('index')->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]); 133 return view('resume', compact('resumes', 'status_work', 'res_count', 'Job_title'));
133 } 134 }
134 } 135 }
135 136
136 public function basic_information(){ 137 public function basic_information(){
137 if (!isset(Auth()->user()->id)) { 138 if (!isset(Auth()->user()->id)) {
138 abort(404); 139 abort(404);
139 } 140 }
140 141
141 $user_id = Auth()->user()->id; 142 $user_id = Auth()->user()->id;
142 143
143 $user = User::query() 144 $user = User::query()
144 ->with('workers') 145 ->with('workers')
145 ->with(['jobtitles' => function ($query) { 146 ->with(['jobtitles' => function ($query) {
146 $query->select('job_titles.id'); 147 $query->select('job_titles.id');
147 }]) 148 }])
148 ->where('id', '=', $user_id) 149 ->where('id', '=', $user_id)
149 ->first(); 150 ->first();
150 $user->workers[0]->job_titles = $user->workers[0]->job_titles->pluck('id')->toArray(); 151 $user->workers[0]->job_titles = $user->workers[0]->job_titles->pluck('id')->toArray();
151 152
152 $job_titles = Job_title::query() 153 $job_titles = Job_title::query()
153 ->where('is_remove', '=', 0) 154 ->where('is_remove', '=', 0)
154 ->where('is_bd', '=', 1) 155 ->where('is_bd', '=', 1)
155 ->orderByDesc('sort') 156 ->orderByDesc('sort')
156 ->get() 157 ->get()
157 ; 158 ;
158 159
159 return view('workers.form_basic_information', compact('user', 'job_titles')); 160 return view('workers.form_basic_information', compact('user', 'job_titles'));
160 } 161 }
161 162
162 public function additional_documents(){ 163 public function additional_documents(){
163 if (!isset(Auth()->user()->id)) { 164 if (!isset(Auth()->user()->id)) {
164 abort(404); 165 abort(404);
165 } 166 }
166 167
167 $user_id = Auth()->user()->id; 168 $user_id = Auth()->user()->id;
168 169
169 $info_blocks = infobloks::query()->OrderBy('name')->get(); 170 $info_blocks = infobloks::query()->OrderBy('name')->get();
170 $additional_document_statuses = [0 => 'Не указано', 1 => 'В наличии', 2 => 'Отсутствует']; 171 $additional_document_statuses = [0 => 'Не указано', 1 => 'В наличии', 2 => 'Отсутствует'];
171 172
172 $worker = Worker::query() 173 $worker = Worker::query()
173 ->with('users') 174 ->with('users')
174 ->with('infobloks') 175 ->with('infobloks')
175 ->WhereHas('users', function (Builder $query) use ($user_id) { 176 ->WhereHas('users', function (Builder $query) use ($user_id) {
176 $query->Where('id', $user_id); 177 $query->Where('id', $user_id);
177 }) 178 })
178 ->first(); 179 ->first();
179 if ($worker->dop_info->count()){ 180 if ($worker->dop_info->count()){
180 $worker->dop_info = $worker->dop_info->keyBy('infoblok_id')->toArray(); 181 $worker->dop_info = $worker->dop_info->keyBy('infoblok_id')->toArray();
181 } 182 }
182 183
183 return view('workers.form_additional_documents', compact('worker', 'info_blocks', 'additional_document_statuses')); 184 return view('workers.form_additional_documents', compact('worker', 'info_blocks', 'additional_document_statuses'));
184 } 185 }
185 186
186 //Лайк резюме 187 //Лайк резюме
187 public function like_controller() { 188 public function like_controller() {
188 189
189 } 190 }
190 191
191 // анкета соискателя 192 // анкета соискателя
192 public function resume_profile(Worker $worker) 193 public function resume_profile(Worker $worker)
193 { 194 {
194 if (isset(Auth()->user()->id)) { 195 if (isset(Auth()->user()->id)) {
195 $idiot = Auth()->user()->id; 196 $idiot = Auth()->user()->id;
196 } else { 197 } else {
197 $idiot = 0; 198 $idiot = 0;
198 } 199 }
199 200
200 $status_work = WorkerStatuses::getWorkerStatuses(); 201 $status_work = WorkerStatuses::getWorkerStatuses();
201 $Query = Worker::query()->with('users')->with('job_titles') 202 $Query = Worker::query()->with('users')->with('job_titles')
202 ->with('place_worker')->with('sertificate')->with('prev_company') 203 ->with('place_worker')->with('sertificate')->with('prev_company')
203 ->with('infobloks')->with('response'); 204 ->with('infobloks')->with('response');
204 $Query = $Query->where('id', '=', $worker->id); 205 $Query = $Query->where('id', '=', $worker->id);
205 $Query = $Query->get(); 206 $Query = $Query->get();
206 207
207 $get_date = date('Y.m'); 208 $get_date = date('Y.m');
208 209
209 $infoblocks = infobloks::query()->get(); 210 $infoblocks = infobloks::query()->get();
210 211
211 $c = Static_worker::query()->where('year_month', '=', $get_date) 212 $c = Static_worker::query()->where('year_month', '=', $get_date)
212 ->where('user_id', '=', $worker->user_id) 213 ->where('user_id', '=', $worker->user_id)
213 ->get(); 214 ->get();
214 215
215 if ($c->count() > 0) { 216 if ($c->count() > 0) {
216 $upd = Static_worker::find($c[0]->id); 217 $upd = Static_worker::find($c[0]->id);
217 $upd->lookin = $upd->lookin + 1; 218 $upd->lookin = $upd->lookin + 1;
218 $upd->save(); 219 $upd->save();
219 } else { 220 } else {
220 $crt = new Static_worker(); 221 $crt = new Static_worker();
221 $crt->lookin = 1; 222 $crt->lookin = 1;
222 $crt->year_month = $get_date; 223 $crt->year_month = $get_date;
223 $crt->user_id = $worker->user_id; 224 $crt->user_id = $worker->user_id;
224 $status = $crt->save(); 225 $status = $crt->save();
225 } 226 }
226 227
227 $stat = Static_worker::query()->where('year_month', '=', $get_date) 228 $stat = Static_worker::query()->where('year_month', '=', $get_date)
228 ->where('user_id', '=', $worker->user_id) 229 ->where('user_id', '=', $worker->user_id)
229 ->get(); 230 ->get();
230 231
231 return view('worker', compact('Query', 'infoblocks', 'status_work', 'idiot', 'stat')); 232 return view('worker', compact('Query', 'infoblocks', 'status_work', 'idiot', 'stat'));
232 } 233 }
233 234
234 // скачать анкету соискателя 235 // скачать анкету соискателя
235 public function resume_download(Worker $worker) 236 public function resume_download(Worker $worker)
236 { 237 {
237 $status_work = WorkerStatuses::getWorkerStatuses(); 238 $status_work = WorkerStatuses::getWorkerStatuses();
238 $Query = Worker::query()->with('users')->with('job_titles') 239 $Query = Worker::query()->with('users')->with('job_titles')
239 ->with('place_worker')->with('sertificate')->with('prev_company') 240 ->with('place_worker')->with('sertificate')->with('prev_company')
240 ->with('infobloks'); 241 ->with('infobloks');
241 $Query = $Query->where('id', '=', $worker->id); 242 $Query = $Query->where('id', '=', $worker->id);
242 $Query = $Query->get(); 243 $Query = $Query->get();
243 244
244 view()->share('Query',$Query); 245 view()->share('Query',$Query);
245 246
246 $status_work = WorkerStatuses::getWorkerStatuses(); 247 $status_work = WorkerStatuses::getWorkerStatuses();
247 $infoblocks = infobloks::query()->get(); 248 $infoblocks = infobloks::query()->get();
248 249
249 //return view('layout.pdf', compact('Query', 'status_work', 'infoblocks')); 250 //return view('layout.pdf', compact('Query', 'status_work', 'infoblocks'));
250 $pdf = PDF::loadView('layout.pdf', [ 251 $pdf = PDF::loadView('layout.pdf', [
251 'Query' => $Query, 252 'Query' => $Query,
252 'status_work' => $status_work, 253 'status_work' => $status_work,
253 'infoblocks' => $infoblocks 254 'infoblocks' => $infoblocks
254 ])->setPaper('a4', 'landscape'); 255 ])->setPaper('a4', 'landscape');
255 256
256 return $pdf->stream(); 257 return $pdf->stream();
257 } 258 }
258 259
259 public function resume_download_all(Request $request) { 260 public function resume_download_all(Request $request) {
260 $spreadsheet = new Spreadsheet(); 261 $spreadsheet = new Spreadsheet();
261 $sheet = $spreadsheet->getActiveSheet(); 262 $sheet = $spreadsheet->getActiveSheet();
262 263
263 $columnMap = range('A', 'Z'); 264 $columnMap = range('A', 'Z');
264 $columns = []; 265 $columns = [];
265 266
266 foreach (DbExportColumns::toArray() as $key => $value){ 267 foreach (DbExportColumns::toArray() as $key => $value){
267 if ($request->input($key, 0)){ 268 if ($request->input($key, 0)){
268 $sheet->setCellValue("{$columnMap[count($columns)]}1", ucfirst($value)); 269 $sheet->setCellValue("{$columnMap[count($columns)]}1", ucfirst($value));
269 $columns[] = str_replace('__', '.', $key); 270 $columns[] = str_replace('__', '.', $key);
270 } 271 }
271 } 272 }
272 273
273 if (empty($columns)) { 274 if (empty($columns)) {
274 return redirect()->back()->with('error', 'Пожалуйста выберите хотя бы 1 колонку для экспорта.'); 275 return redirect()->back()->with('error', 'Пожалуйста выберите хотя бы 1 колонку для экспорта.');
275 } 276 }
276 277
277 $query = User::select($columns) 278 $query = User::select($columns)
278 ->leftJoin('workers', 'users.id', '=', 'workers.user_id') 279 ->leftJoin('workers', 'users.id', '=', 'workers.user_id')
279 ->leftJoin('job_titles', 'workers.position_work', '=', 'job_titles.id') 280 ->leftJoin('job_titles', 'workers.position_work', '=', 'job_titles.id')
280 ->where('users.is_bd', '=', 1); 281 ->where('users.is_bd', '=', 1);
281 282
282 $job_title_list = $request->input('job_title_list', []); 283 $job_title_list = $request->input('job_title_list', []);
283 if (!empty($job_title_list)){ 284 if (!empty($job_title_list)){
284 $query->whereIn('job_titles.id', $job_title_list); 285 $query->whereIn('job_titles.id', $job_title_list);
285 } 286 }
286 287
287 $users = $query->get(); 288 $users = $query->get();
288 if ($users->count()){ 289 if ($users->count()){
289 $i = 2; 290 $i = 2;
290 foreach ($users->toArray() as $user){ 291 foreach ($users->toArray() as $user){
291 $j = 0; 292 $j = 0;
292 foreach ($user as $field){ 293 foreach ($user as $field){
293 $sheet->setCellValue("{$columnMap[$j++]}$i", $field); 294 $sheet->setCellValue("{$columnMap[$j++]}$i", $field);
294 } 295 }
295 $i++; 296 $i++;
296 } 297 }
297 } 298 }
298 $writer = new Xlsx($spreadsheet); 299 $writer = new Xlsx($spreadsheet);
299 $fileName = 'DB.xlsx'; 300 $fileName = 'DB.xlsx';
300 301
301 $response = new StreamedResponse(function() use ($writer) { 302 $response = new StreamedResponse(function() use ($writer) {
302 $writer->save('php://output'); 303 $writer->save('php://output');
303 }); 304 });
304 305
305 $response->headers->set('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); 306 $response->headers->set('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
306 $response->headers->set('Content-Disposition', 'attachment;filename="' . $fileName . '"'); 307 $response->headers->set('Content-Disposition', 'attachment;filename="' . $fileName . '"');
307 $response->headers->set('Cache-Control', 'max-age=0'); 308 $response->headers->set('Cache-Control', 'max-age=0');
308 309
309 return $response; 310 return $response;
310 } 311 }
311 312
312 // Кабинет работника 313 // Кабинет работника
313 public function cabinet(Request $request) 314 public function cabinet(Request $request)
314 { 315 {
315 // дата год и месяц 316 // дата год и месяц
316 $get_date = date('Y.m'); 317 $get_date = date('Y.m');
317 318
318 $id = Auth()->user()->id; 319 $id = Auth()->user()->id;
319 320
320 $Infobloks = infobloks::query()->get(); 321 $Infobloks = infobloks::query()->get();
321 322
322 $Worker = Worker::query() 323 $Worker = Worker::query()
323 ->with(['users', 'sertificate', 'prev_company', 'infobloks', 'place_worker']) 324 ->with(['users', 'sertificate', 'prev_company', 'infobloks', 'place_worker'])
324 ->WhereHas('users', function (Builder $query) use ($id) { 325 ->WhereHas('users', function (Builder $query) use ($id) {
325 $query->Where('id', $id); 326 $query->Where('id', $id);
326 })->get(); 327 })->first();
327 328
328 $Job_titles = Job_title::query()->where('is_remove', '=', '0') 329 $Job_titles = Job_title::query()->where('is_remove', '=', '0')
329 ->where('is_bd', '=' , '1') 330 ->where('is_bd', '=' , '1')
330 ->OrderByDesc('sort')->OrderBy('name') 331 ->OrderByDesc('sort')->OrderBy('name')
331 ->get(); 332 ->get();
332 333
333 $stat = Static_worker::query()->where('year_month', '=', $get_date) 334 $stat = Static_worker::query()->where('year_month', '=', $get_date)
334 ->where('user_id', '=', $id) 335 ->where('user_id', '=', $id)
335 ->get(); 336 ->get();
336 337
337 338 $persent = Tools::getWorkerProfilePercent($Worker);
338 // 10%
339
340 $persent = 10;
341 $persent1 = 0;
342 $persent2 = 0;
343 $persent3 = 0;
344 $persent4 = 0;
345 $persent5 = 0;
346
347 if ((!empty($Worker[0]->telephone)) &&
348 (!empty($Worker[0]->email)) && (!empty($Worker[0]->experience)) &&
349 (!empty($Worker[0]->city)) && (!empty($Worker[0]->old_year))) {
350 // 40%
351 $persent = $persent + 40;
352 $persent1 = 40;
353 }
354
355 //dd($Worker[0]->status_work, $Worker[0]->telephone, $Worker[0]->email, $Worker[0]->experience, $Worker[0]->city, $Worker[0]->old_year);
356
357 if ($Worker[0]->sertificate->count() > 0) {
358 // 15%
359 $persent = $persent + 15;
360 $persent2 = 15;
361 }
362
363 if ($Worker[0]->infobloks->count() > 0) {
364 // 20%
365 $persent = $persent + 20;
366 $persent3 = 20;
367 }
368
369 if ($Worker[0]->prev_company->count() > 0) {
370 // 10%
371 $persent = $persent + 10;
372 $persent4 = 10;
373 }
374
375 if (!empty($Worker[0]->photo)) {
376 // 5%
377 $persent = $persent + 5;
378 $persent5 = 5;
379 }
380 339
381 $status_work = WorkerStatuses::getWorkerStatuses(); 340 $status_work = WorkerStatuses::getWorkerStatuses();
382 $additional_document_statuses = [0 => 'Не указано', 1 => 'В наличии', 2 => 'Отсутствует']; 341 $additional_document_statuses = [0 => 'Не указано', 1 => 'В наличии', 2 => 'Отсутствует'];
383 $info_blocks = infobloks::query()->OrderBy('name')->get(); 342 $info_blocks = infobloks::query()->OrderBy('name')->get();
384 343
385 $worker = Worker::query() 344 $worker = Worker::query()
386 ->with('users') 345 ->with('users')
387 ->with('sertificate') 346 ->with('sertificate')
388 ->with('prev_company') 347 ->with('prev_company')
389 ->with('infobloks') 348 ->with('infobloks')
390 ->with('place_worker') 349 ->with('place_worker')
391 ->with('job_titles') 350 ->with('job_titles')
392 ->WhereHas('users', function (Builder $query) use ($id) { 351 ->WhereHas('users', function (Builder $query) use ($id) {
393 $query->Where('id', $id); 352 $query->Where('id', $id);
394 }) 353 })
395 ->first(); 354 ->first();
396 if ($worker->dop_info->count()){ 355 if ($worker->dop_info->count()){
397 $worker->dop_info = $worker->dop_info->keyBy('infoblok_id')->toArray(); 356 $worker->dop_info = $worker->dop_info->keyBy('infoblok_id')->toArray();
398 } 357 }
399 358
400 //dd($worker->dop_info); 359 //dd($worker->dop_info);
401 360
402 if ($request->has('print')) { 361 if ($request->has('print')) {
403 dd($Worker); 362 dd($Worker);
404 } else { 363 } else {
405 return view('workers.cabinet', compact( 'persent', 'Job_titles', 'stat', 364 return view('workers.cabinet', compact( 'persent', 'Job_titles', 'stat',
406 'worker', 'info_blocks', 'status_work', 'additional_document_statuses' 365 'worker', 'info_blocks', 'status_work', 'additional_document_statuses'
407 )); 366 ));
408 } 367 }
409 } 368 }
410 369
411 // Сохранение данных 370 // Сохранение данных
412 public function cabinet_save(Worker $worker, Request $request) 371 public function cabinet_save(Worker $worker, Request $request)
413 { 372 {
414 $id = $worker->id; 373 $id = $worker->id;
415 $params = $request->all(); 374 $params = $request->all();
416 $job_title_id = $request->get('job_title_id'); 375 $job_title_id = $request->get('job_title_id');
417 376
418 $rules = [ 377 $rules = [
419 'surname' => ['required', 'string', 'max:255'], 378 'surname' => ['required', 'string', 'max:255'],
420 'name_man' => ['required', 'string', 'max:255'], 379 'name_man' => ['required', 'string', 'max:255'],
421 'email' => ['required', 'string', 'email', 'max:255'], 380 'email' => ['required', 'string', 'email', 'max:255'],
422 381
423 ]; 382 ];
424 383
425 $messages = [ 384 $messages = [
426 'required' => 'Укажите обязательное поле', 385 'required' => 'Укажите обязательное поле',
427 'min' => [ 386 'min' => [
428 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 387 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
429 'integer' => 'Поле «:attribute» должно быть :min или больше', 388 'integer' => 'Поле «:attribute» должно быть :min или больше',
430 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 389 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
431 ], 390 ],
432 'max' => [ 391 'max' => [
433 'string' => 'Поле «:attribute» должно быть не больше :max символов', 392 'string' => 'Поле «:attribute» должно быть не больше :max символов',
434 'integer' => 'Поле «:attribute» должно быть :max или меньше', 393 'integer' => 'Поле «:attribute» должно быть :max или меньше',
435 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 394 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
436 ] 395 ]
437 ]; 396 ];
438 397
439 $validator = Validator::make($params, $rules, $messages); 398 $validator = Validator::make($params, $rules, $messages);
440 399
441 if ($validator->fails()) { 400 if ($validator->fails()) {
442 return redirect()->route('worker.cabinet')->withErrors($validator); 401 return redirect()->route('worker.cabinet')->withErrors($validator);
443 } else { 402 } else {
444 403
445 if ($request->has('photo')) { 404 if ($request->has('photo')) {
446 if (!empty($worker->photo)) { 405 if (!empty($worker->photo)) {
447 Storage::delete($worker->photo); 406 Storage::delete($worker->photo);
448 } 407 }
449 $params['photo'] = $request->file('photo')->store("worker/$id", 'public'); 408 $params['photo'] = $request->file('photo')->store("worker/$id", 'public');
450 } 409 }
451 410
452 if ($request->has('file')) { 411 if ($request->has('file')) {
453 if (!empty($worker->file)) { 412 if (!empty($worker->file)) {
454 Storage::delete($worker->file); 413 Storage::delete($worker->file);
455 } 414 }
456 $params['file'] = $request->file('file')->store("worker/$id", 'public'); 415 $params['file'] = $request->file('file')->store("worker/$id", 'public');
457 } 416 }
458 417
459 $worker->update($params); 418 $worker->update($params);
460 $use = User::find($worker->user_id); 419 $use = User::find($worker->user_id);
461 $use->surname = $request->get('surname'); 420 $use->surname = $request->get('surname');
462 $use->name_man = $request->get('name_man'); 421 $use->name_man = $request->get('name_man');
463 $use->surname2 = $request->get('surname2'); 422 $use->surname2 = $request->get('surname2');
464 423
465 $use->save(); 424 $use->save();
466 $worker->job_titles()->sync($job_title_id); 425 $worker->job_titles()->sync($job_title_id);
467 426
468 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены'); 427 return redirect()->route('worker.cabinet')->with('success', 'Данные были успешно сохранены');
469 } 428 }
470 } 429 }
471 430
472 public function cabinet_save_foto(Worker $worker, Request $request){ 431 public function cabinet_save_foto(Worker $worker, Request $request){
473 $params = ['photo' => null]; 432 $params = ['photo' => null];
474 433
475 if ($request->has('photo')) { 434 if ($request->has('photo')) {
476 if (!empty($worker->photo)) { 435 if (!empty($worker->photo)) {
477 Storage::delete($worker->photo); 436 Storage::delete($worker->photo);
478 } 437 }
479 $params['photo'] = $request->file('photo')->store("worker/$worker->id", 'public'); 438 $params['photo'] = $request->file('photo')->store("worker/$worker->id", 'public');
480 } 439 }
481 440
482 if ($request->has('file')) { 441 if ($request->has('file')) {
483 if (!empty($worker->file)) { 442 if (!empty($worker->file)) {
484 Storage::delete($worker->file); 443 Storage::delete($worker->file);
485 } 444 }
486 $params['file'] = $request->file('file')->store("worker/$worker->id", 'public'); 445 $params['file'] = $request->file('file')->store("worker/$worker->id", 'public');
487 } 446 }
488 447
489 $worker->update($params); 448 $worker->update($params);
490 449
491 return redirect()->route('worker.cabinet'); 450 return redirect()->route('worker.cabinet');
492 } 451 }
493 452
494 // Сообщения данные 453 // Сообщения данные
495 public function messages($type_message) 454 public function messages($type_message)
496 { 455 {
497 $user_id = Auth()->user()->id; 456 $user_id = Auth()->user()->id;
498 457
499 $chats = Chat::get_user_chats($user_id); 458 $chats = Chat::get_user_chats($user_id);
500 $admin_chat = Chat::get_user_admin_chat($user_id); 459 $admin_chat = Chat::get_user_admin_chat($user_id);
501 $user_type = 'worker'; 460 $user_type = 'worker';
502 461
503 return view('workers.messages', compact('chats', 'admin_chat','user_id', 'user_type')); 462 return view('workers.messages', compact('chats', 'admin_chat','user_id', 'user_type'));
504 } 463 }
505 464
506 // Избранный 465 // Избранный
507 public function favorite() 466 public function favorite()
508 { 467 {
509 return view('workers.favorite'); 468 return view('workers.favorite');
510 } 469 }
511 470
512 // Сменить пароль 471 // Сменить пароль
513 public function new_password() 472 public function new_password()
514 { 473 {
515 $email = Auth()->user()->email; 474 $email = Auth()->user()->email;
516 return view('workers.new_password', compact('email')); 475 return view('workers.new_password', compact('email'));
517 } 476 }
518 477
519 // Обновление пароля 478 // Обновление пароля
520 public function save_new_password(Request $request) { 479 public function save_new_password(Request $request) {
521 $use = Auth()->user(); 480 $use = Auth()->user();
522 $request->validate([ 481 $request->validate([
523 'password' => 'required|string', 482 'password' => 'required|string',
524 'new_password' => 'required|string', 483 'new_password' => 'required|string',
525 'new_password2' => 'required|string' 484 'new_password2' => 'required|string'
526 ]); 485 ]);
527 486
528 if ($request->get('new_password') == $request->get('new_password2')) 487 if ($request->get('new_password') == $request->get('new_password2'))
529 if ($request->get('password') !== $request->get('new_password')) { 488 if ($request->get('password') !== $request->get('new_password')) {
530 $credentials = $request->only('email', 'password'); 489 $credentials = $request->only('email', 'password');
531 if (Auth::attempt($credentials, $request->has('save_me'))) { 490 if (Auth::attempt($credentials, $request->has('save_me'))) {
532 491
533 if (!is_null($use->email_verified_at)){ 492 if (!is_null($use->email_verified_at)){
534 493
535 $user_data = User_Model::find($use->id); 494 $user_data = User_Model::find($use->id);
536 $user_data->update([ 495 $user_data->update([
537 'password' => Hash::make($request->get('new_password')), 496 'password' => Hash::make($request->get('new_password')),
538 'pubpassword' => base64_encode($request->get('new_password')), 497 'pubpassword' => base64_encode($request->get('new_password')),
539 ]); 498 ]);
540 return redirect() 499 return redirect()
541 ->route('worker.new_password') 500 ->route('worker.new_password')
542 ->with('success', 'Поздравляю! Вы обновили свой пароль!'); 501 ->with('success', 'Поздравляю! Вы обновили свой пароль!');
543 } 502 }
544 503
545 return redirect() 504 return redirect()
546 ->route('worker.new_password') 505 ->route('worker.new_password')
547 ->withError('Данная учетная запись не было верифицированна!'); 506 ->withError('Данная учетная запись не было верифицированна!');
548 } 507 }
549 } 508 }
550 509
551 return redirect() 510 return redirect()
552 ->route('worker.new_password') 511 ->route('worker.new_password')
553 ->withErrors('Не совпадение данных, обновите пароли!'); 512 ->withErrors('Не совпадение данных, обновите пароли!');
554 } 513 }
555 514
556 // Удаление профиля форма 515 // Удаление профиля форма
557 public function delete_profile() 516 public function delete_profile()
558 { 517 {
559 $login = Auth()->user()->email; 518 $login = Auth()->user()->email;
560 return view('workers.delete_profile', compact('login')); 519 return view('workers.delete_profile', compact('login'));
561 } 520 }
562 521
563 // Удаление профиля код 522 // Удаление профиля код
564 public function delete_profile_result(Request $request) { 523 public function delete_profile_result(Request $request) {
565 $Answer = $request->all(); 524 $Answer = $request->all();
566 $user_id = Auth()->user()->id; 525 $user_id = Auth()->user()->id;
567 $request->validate([ 526 $request->validate([
568 'password' => 'required|string', 527 'password' => 'required|string',
569 ]); 528 ]);
570 529
571 $credentials = $request->only('email', 'password'); 530 $credentials = $request->only('email', 'password');
572 if (Auth::attempt($credentials)) { 531 if (Auth::attempt($credentials)) {
573 Auth::logout(); 532 Auth::logout();
574 $it = User_Model::find($user_id); 533 $it = User_Model::find($user_id);
575 $it->delete(); 534 $it->delete();
576 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт'); 535 return redirect()->route('index')->with('success', 'Вы успешно удалили свой аккаунт');
577 } else { 536 } else {
578 return redirect()->route('worker.delete_profile') 537 return redirect()->route('worker.delete_profile')
579 ->withErrors( 'Неверный пароль! Нужен корректный пароль'); 538 ->withErrors( 'Неверный пароль! Нужен корректный пароль');
580 } 539 }
581 } 540 }
582 541
583 // Регистрация соискателя 542 // Регистрация соискателя
584 public function register_worker(Request $request) 543 public function register_worker(Request $request)
585 { 544 {
586 $params = $request->all(); 545 $params = $request->all();
587 $params['is_worker'] = 1; 546 $params['is_worker'] = 1;
588 547
589 $rules = [ 548 $rules = [
590 'surname' => ['required', 'string', 'max:255'], 549 'surname' => ['required', 'string', 'max:255'],
591 'name_man' => ['required', 'string', 'max:255'], 550 'name_man' => ['required', 'string', 'max:255'],
592 'email' => ['required', 'email', 'max:255', 'unique:users'], 551 'email' => ['required', 'email', 'max:255', 'unique:users'],
593 'password' => ['required', 'string', 'min:6'] 552 'password' => ['required', 'string', 'min:6']
594 ]; 553 ];
595 554
596 $messages = [ 555 $messages = [
597 'required' => 'Укажите обязательное поле', 556 'required' => 'Укажите обязательное поле',
598 'min' => [ 557 'min' => [
599 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 558 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
600 'integer' => 'Поле «:attribute» должно быть :min или больше', 559 'integer' => 'Поле «:attribute» должно быть :min или больше',
601 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 560 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
602 ], 561 ],
603 'max' => [ 562 'max' => [
604 'string' => 'Поле «:attribute» должно быть не больше :max символов', 563 'string' => 'Поле «:attribute» должно быть не больше :max символов',
605 'integer' => 'Поле «:attribute» должно быть :max или меньше', 564 'integer' => 'Поле «:attribute» должно быть :max или меньше',
606 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 565 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
607 ] 566 ]
608 ]; 567 ];
609 568
610 $email = $request->get('email'); 569 $email = $request->get('email');
611 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) { 570 if (!preg_match("/^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/", $email)) {
612 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл")); 571 return json_encode(Array("ERROR" => "Error: Отсутствует емайл или некорректный емайл"));
613 } 572 }
614 573
615 if ($request->get('password') !== $request->get('confirmed')){ 574 if ($request->get('password') !== $request->get('confirmed')){
616 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля")); 575 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
617 } 576 }
618 577
619 if (strlen($request->get('password')) < 6) { 578 if (strlen($request->get('password')) < 6) {
620 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!")); 579 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
621 } 580 }
622 581
623 /*$haystack = $request->get('password'); 582 /*$haystack = $request->get('password');
624 583
625 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?'); 584 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?');
626 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 585 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z',
627 'X', 'C', 'V', 'B', 'N', 'M'); 586 'X', 'C', 'V', 'B', 'N', 'M');
628 $lenpwd_bool = true; 587 $lenpwd_bool = true;
629 $spec_bool = false; 588 $spec_bool = false;
630 $alpha_bool = false; 589 $alpha_bool = false;
631 590
632 if (strlen($haystack) < 8) $lenpwd_bool = false; 591 if (strlen($haystack) < 8) $lenpwd_bool = false;
633 592
634 foreach ($specsumbol as $it) { 593 foreach ($specsumbol as $it) {
635 if (strpos($haystack, $it) !== false) { 594 if (strpos($haystack, $it) !== false) {
636 $spec_bool = true; 595 $spec_bool = true;
637 } 596 }
638 } 597 }
639 598
640 foreach ($alpha as $it) { 599 foreach ($alpha as $it) {
641 if (strpos($haystack, $it) !== false) { 600 if (strpos($haystack, $it) !== false) {
642 $alpha_bool = true; 601 $alpha_bool = true;
643 } 602 }
644 } 603 }
645 604
646 if ((!$spec_bool) || (!$alpha_bool)) { 605 if ((!$spec_bool) || (!$alpha_bool)) {
647 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?")); 606 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?"));
648 }*/ 607 }*/
649 608
650 if (($request->has('politik')) && ($request->get('politik') == 1)) { 609 if (($request->has('politik')) && ($request->get('politik') == 1)) {
651 $validator = Validator::make($params, $rules, $messages); 610 $validator = Validator::make($params, $rules, $messages);
652 611
653 if ($validator->fails()) { 612 if ($validator->fails()) {
654 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе.")); 613 return json_encode(array("ERROR" => "Error1: Регистрация оборвалась ошибкой! Не все обязательные поля заполнены. Либо вы уже были зарегистрированы в системе."));
655 } else { 614 } else {
656 //dd($params); 615 //dd($params);
657 $user = $this->create($params); 616 $user = $this->create($params);
658 event(new Registered($user)); 617 event(new Registered($user));
659 Auth::guard()->login($user); 618 Auth::guard()->login($user);
660 } 619 }
661 if ($user) { 620 if ($user) {
662 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));; 621 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));;
663 } else { 622 } else {
664 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!")); 623 return json_encode(Array("ERROR" => "Error2: Данные были утеряны!"));
665 } 624 }
666 625
667 } else { 626 } else {
668 return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!")); 627 return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!"));
669 } 628 }
670 } 629 }
671 630
672 // Звездная оценка и ответ 631 // Звездная оценка и ответ
673 public function stars_answer(Request $request) { 632 public function stars_answer(Request $request) {
674 $params = $request->all(); 633 $params = $request->all();
675 $rules = [ 634 $rules = [
676 'message' => ['required', 'string', 'max:255'], 635 'message' => ['required', 'string', 'max:255'],
677 ]; 636 ];
678 637
679 $messages = [ 638 $messages = [
680 'required' => 'Укажите обязательное поле', 639 'required' => 'Укажите обязательное поле',
681 'min' => [ 640 'min' => [
682 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 641 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
683 'integer' => 'Поле «:attribute» должно быть :min или больше', 642 'integer' => 'Поле «:attribute» должно быть :min или больше',
684 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 643 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
685 ], 644 ],
686 'max' => [ 645 'max' => [
687 'string' => 'Поле «:attribute» должно быть не больше :max символов', 646 'string' => 'Поле «:attribute» должно быть не больше :max символов',
688 'integer' => 'Поле «:attribute» должно быть :max или меньше', 647 'integer' => 'Поле «:attribute» должно быть :max или меньше',
689 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 648 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
690 ] 649 ]
691 ]; 650 ];
692 $response_worker = ResponseWork::create($params); 651 $response_worker = ResponseWork::create($params);
693 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!'); 652 return redirect()->route('resume_profile', ['worker' => $request->get('worker_id')])->with('success', 'Ваше сообщение было отправлено!');
694 } 653 }
695 654
696 public function TestWorker() 655 public function TestWorker()
697 { 656 {
698 $Use = new User(); 657 $Use = new User();
699 658
700 $Code_user = $Use->create([ 659 $Code_user = $Use->create([
701 'name' => 'surname name_man', 660 'name' => 'surname name_man',
702 'name_man' => 'name_man', 661 'name_man' => 'name_man',
703 'surname' => 'surname', 662 'surname' => 'surname',
704 'surname2' => 'surname2', 663 'surname2' => 'surname2',
705 'subscribe_email' => '1', 664 'subscribe_email' => '1',
706 'email' => 'email@mail.com', 665 'email' => 'email@mail.com',
707 'telephone' => '1234567890', 666 'telephone' => '1234567890',
708 'password' => Hash::make('password'), 667 'password' => Hash::make('password'),
709 'pubpassword' => base64_encode('password'), 668 'pubpassword' => base64_encode('password'),
710 'email_verified_at' => Carbon::now(), 669 'email_verified_at' => Carbon::now(),
711 'is_worker' => 1, 670 'is_worker' => 1,
712 ]); 671 ]);
713 672
714 if ($Code_user->id > 0) { 673 if ($Code_user->id > 0) {
715 $Worker = new Worker(); 674 $Worker = new Worker();
716 $Worker->user_id = $Code_user->id; 675 $Worker->user_id = $Code_user->id;
717 $Worker->position_work = 1; //'job_titles'; 676 $Worker->position_work = 1; //'job_titles';
718 $Worker->email = 'email@email.com'; 677 $Worker->email = 'email@email.com';
719 $Worker->telephone = '1234567890'; 678 $Worker->telephone = '1234567890';
720 $status = $Worker->save(); 679 $status = $Worker->save();
721 680
722 $Title_Worker = new Title_worker(); 681 $Title_Worker = new Title_worker();
723 $Title_Worker->worker_id = $Worker->id; 682 $Title_Worker->worker_id = $Worker->id;
724 $Title_Worker->job_title_id = 1; 683 $Title_Worker->job_title_id = 1;
725 $Title_Worker->save(); 684 $Title_Worker->save();
726 } 685 }
727 } 686 }
728 687
729 // Создание пользователя 688 // Создание пользователя
730 protected function create(array $data) 689 protected function create(array $data)
731 { 690 {
732 $Use = new User(); 691 $Use = new User();
733 692
734 $Code_user = $Use->create([ 693 $Code_user = $Use->create([
735 'name' => $data['surname']." ".$data['name_man'], 694 'name' => $data['surname']." ".$data['name_man'],
736 'name_man' => $data['name_man'], 695 'name_man' => $data['name_man'],
737 'surname' => $data['surname'], 696 'surname' => $data['surname'],
738 'surname2' => $data['surname2'], 697 'surname2' => $data['surname2'],
739 'subscribe_email' => $data['email'], 698 'subscribe_email' => $data['email'],
740 'email' => $data['email'], 699 'email' => $data['email'],
741 'telephone' => $data['telephone'], 700 'telephone' => $data['telephone'],
742 'password' => Hash::make($data['password']), 701 'password' => Hash::make($data['password']),
743 'pubpassword' => base64_encode($data['password']), 702 'pubpassword' => base64_encode($data['password']),
744 'email_verified_at' => Carbon::now(), 703 'email_verified_at' => Carbon::now(),
745 'is_worker' => $data['is_worker'], 704 'is_worker' => $data['is_worker'],
746 ]); 705 ]);
747 706
748 if ($Code_user->id > 0) { 707 if ($Code_user->id > 0) {
749 $Worker = new Worker(); 708 $Worker = new Worker();
750 $Worker->user_id = $Code_user->id; 709 $Worker->user_id = $Code_user->id;
751 $Worker->position_work = $data['job_titles']; 710 $Worker->position_work = $data['job_titles'];
752 $Worker->email = $data['email']; 711 $Worker->email = $data['email'];
753 $Worker->telephone = $data['telephone']; 712 $Worker->telephone = $data['telephone'];
754 $Worker->save(); 713 $Worker->save();
755 714
756 if (isset($Worker->id)) { 715 if (isset($Worker->id)) {
757 $Title_Worker = new Title_worker(); 716 $Title_Worker = new Title_worker();
758 $Title_Worker->worker_id = $Worker->id; 717 $Title_Worker->worker_id = $Worker->id;
759 $Title_Worker->job_title_id = $data['job_titles']; 718 $Title_Worker->job_title_id = $data['job_titles'];
760 $Title_Worker->save(); 719 $Title_Worker->save();
761 } 720 }
762 721
763 return $Code_user; 722 return $Code_user;
764 } 723 }
765 } 724 }
766 725
767 // Вакансии избранные 726 // Вакансии избранные
768 public function colorado(Request $request) { 727 public function colorado(Request $request) {
769 $IP_address = RusDate::ip_addr_client(); 728 $IP_address = RusDate::ip_addr_client();
770 $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get(); 729 $Arr = Like_vacancy::Query()->select('code_record')->where('ip_address', '=', $IP_address)->get();
771 730
772 if ($Arr->count()) { 731 if ($Arr->count()) {
773 $A = Array(); 732 $A = Array();
774 foreach ($Arr as $it) { 733 foreach ($Arr as $it) {
775 $A[] = $it->code_record; 734 $A[] = $it->code_record;
776 } 735 }
777 736
778 $Query = Ad_employer::query()->whereIn('id', $A); 737 $Query = Ad_employer::query()->whereIn('id', $A);
779 } else { 738 } else {
780 $Query = Ad_employer::query()->where('id', '=', '0'); 739 $Query = Ad_employer::query()->where('id', '=', '0');
781 } 740 }
782 741
783 $Query = $Query->with(['jobs', 'cat', 'employer']) 742 $Query = $Query->with(['jobs', 'cat', 'employer'])
784 ->whereHas('jobs_code', function ($query) use ($request) { 743 ->whereHas('jobs_code', function ($query) use ($request) {
785 if ($request->ajax()) { 744 if ($request->ajax()) {
786 if (null !== ($request->get('job'))) { 745 if (null !== ($request->get('job'))) {
787 $query->where('job_title_id', $request->get('job')); 746 $query->where('job_title_id', $request->get('job'));
788 } 747 }
789 } 748 }
790 }) 749 })
791 ->select('ad_employers.*'); 750 ->select('ad_employers.*');
792 751
793 if ($request->get('search') !== null) { 752 if ($request->get('search') !== null) {
794 $search = $request->get('search'); 753 $search = $request->get('search');
795 $Query->where('name', 'LIKE', "%$search%"); 754 $Query->where('name', 'LIKE', "%$search%");
796 } 755 }
797 756
798 //dd($Query->get()); 757 //dd($Query->get());
799 758
800 $Job_title = Job_title::query()->OrderBy('name')->get(); 759 $Job_title = Job_title::query()->OrderBy('name')->get();
801 760
802 $Query_count = $Query->count(); 761 $Query_count = $Query->count();
803 762
804 $Query = $Query->OrderBy('updated_at')->paginate(3); 763 $Query = $Query->OrderBy('updated_at')->paginate(3);
805 764
806 return view('workers.favorite', compact('Query', 765 return view('workers.favorite', compact('Query',
807 'Query_count', 766 'Query_count',
808 'Job_title')); 767 'Job_title'));
809 768
810 } 769 }
811 770
812 //Переписка 771 //Переписка
813 public function dialog(Chat $chat, Request $request) { 772 public function dialog(Chat $chat, Request $request) {
814 // Получение параметров. 773 // Получение параметров.
815 if ($request->has('ad_employer')){ 774 if ($request->has('ad_employer')){
816 $ad_employer = $request->get('ad_employer'); 775 $ad_employer = $request->get('ad_employer');
817 } else { 776 } else {
818 $ad_employer = 0; 777 $ad_employer = 0;
819 } 778 }
820 779
821 $sender = User_Model::query()->with('workers')->with('employers')->where('id', $chat->user_id)->first(); 780 $sender = User_Model::query()->with('workers')->with('employers')->where('id', $chat->user_id)->first();
822 $companion = User_Model::query()->with('workers')->with('employers')->where('id', $chat->to_user_id)->first(); 781 $companion = User_Model::query()->with('workers')->with('employers')->where('id', $chat->to_user_id)->first();
823 782
824 $Messages = Chat::get_chat_messages($chat); 783 $Messages = Chat::get_chat_messages($chat);
825 784
826 Message::where('chat_id_to', '=', $chat->id)->update(['flag_new' => 0]); 785 Message::where('chat_id_to', '=', $chat->id)->update(['flag_new' => 0]);
827 786
828 return view('workers.dialog', compact('companion', 'sender', 'chat', 'Messages', 'ad_employer')); 787 return view('workers.dialog', compact('companion', 'sender', 'chat', 'Messages', 'ad_employer'));
829 } 788 }
830 789
831 // Даунылоады 790 // Даунылоады
832 public function download(Worker $worker) { 791 public function download(Worker $worker) {
833 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...']; 792 $arr_house = ['0' => 'Проверка, проверка, проверка, проверка, проверка...'];
834 view()->share('house',$arr_house); 793 view()->share('house',$arr_house);
835 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape'); 794 $pdf = PDF::loadView('layout.pdf', $arr_house)->setPaper('a4', 'landscape');
836 return $pdf->stream(); 795 return $pdf->stream();
837 } 796 }
838 797
839 // Поднятие анкеты 798 // Поднятие анкеты
840 public function up(Worker $worker) { 799 public function up(Worker $worker) {
841 $worker->updated_at = Carbon::now(); 800 $worker->updated_at = Carbon::now();
842 $worker->save(); 801 $worker->save();
843 // 0 802 // 0
844 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных'); 803 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных');
845 } 804 }
846 805
847 // Форма сертификате 806 // Форма сертификате
848 public function new_sertificate(Worker $worker) { 807 public function new_sertificate(Worker $worker) {
849 return view('workers.sertificate_add', compact('worker')); 808 return view('workers.sertificate_add', compact('worker'));
850 } 809 }
851 810
852 // Добавление сертификата 811 // Добавление сертификата
853 public function add_serificate(SertificationRequest $request) { 812 public function add_serificate(SertificationRequest $request) {
854 $request->validate([ 813 $request->validate([
855 'name' => 'required|string|max:255', 814 'name' => 'required|string|max:255',
856 'end_begin' => 'required|date|date_format:d.m.Y' 815 'end_begin' => 'required|date|date_format:d.m.Y'
857 ], 816 ],
858 [ 817 [
859 'name' => 'Навание сертификата обязательно для заполнения.', 818 'name' => 'Навание сертификата обязательно для заполнения.',
860 'end_begin' => 'Формат даты должен соответствовать дд.мм.гггг' 819 'end_begin' => 'Формат даты должен соответствовать дд.мм.гггг'
861 ]); 820 ]);
862 821
863 $params = $request->all(); 822 $params = $request->all();
864 823
865 $end_begin = DateTime::createFromFormat('d.m.Y', $params['end_begin']); 824 $end_begin = DateTime::createFromFormat('d.m.Y', $params['end_begin']);
866 $params['end_begin'] = $end_begin->format('Y-m-d'); 825 $params['end_begin'] = $end_begin->format('Y-m-d');
867 826
868 $Sertificate = new sertification(); 827 $Sertificate = new sertification();
869 $Sertificate->create($params); 828 $Sertificate->create($params);
870 829
871 return response()->json([ 830 return response()->json([
872 'success' => true 831 'success' => true
873 ]); 832 ]);
874 } 833 }
875 834
876 // Удалить сертификат 835 // Удалить сертификат
877 public function delete_sertificate(sertification $doc) { 836 public function delete_sertificate(sertification $doc) {
878 $doc->delete(); 837 $doc->delete();
879 838
880 return redirect()->route('worker.cabinet'); 839 return redirect()->route('worker.cabinet');
881 } 840 }
882 841
883 // Редактирование сертификата 842 // Редактирование сертификата
884 public function edit_sertificate(Worker $worker, sertification $doc) { 843 public function edit_sertificate(Worker $worker, sertification $doc) {
885 return view('workers.sertificate_edit', compact('doc', 'worker')); 844 return view('workers.sertificate_edit', compact('doc', 'worker'));
886 } 845 }
887 846
888 // Редактирование обновление сертификата 847 // Редактирование обновление сертификата
889 public function update_serificate(SertificationRequest $request, sertification $doc) { 848 public function update_serificate(SertificationRequest $request, sertification $doc) {
890 $request->validate([ 849 $request->validate([
891 'name' => 'required|string|max:255', 850 'name' => 'required|string|max:255',
892 'end_begin' => 'required|date|date_format:d.m.Y' 851 'end_begin' => 'required|date|date_format:d.m.Y'
893 ], 852 ],
894 [ 853 [
895 'name' => 'Навание сертификата обязательно для заполнения.', 854 'name' => 'Навание сертификата обязательно для заполнения.',
896 'end_begin' => 'Формат даты должен соответствовать дд.мм.гггг' 855 'end_begin' => 'Формат даты должен соответствовать дд.мм.гггг'
897 ]); 856 ]);
898 857
899 $all = $request->all(); 858 $all = $request->all();
900 859
901 $end_begin = DateTime::createFromFormat('d.m.Y', $all['end_begin']); 860 $end_begin = DateTime::createFromFormat('d.m.Y', $all['end_begin']);
902 $all['end_begin'] = $end_begin->format('Y-m-d'); 861 $all['end_begin'] = $end_begin->format('Y-m-d');
903 862
904 $doc->worker_id = $all['worker_id']; 863 $doc->worker_id = $all['worker_id'];
905 $doc->name = $all['name']; 864 $doc->name = $all['name'];
906 $doc->end_begin = $all['end_begin']; 865 $doc->end_begin = $all['end_begin'];
907 $doc->save(); 866 $doc->save();
908 867
909 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); 868 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!');
910 } 869 }
911 870
912 public function edit_diploms(Request $request, Worker $worker) { 871 public function edit_diploms(Request $request, Worker $worker) {
913 $dop_info_data = $request->input('diploms'); 872 $dop_info_data = $request->input('diploms');
914 873
915 if (empty($dop_info_data)) { 874 if (empty($dop_info_data)) {
916 return redirect()->route('worker.additional_documents')->with('error', 'Данные не предоставлены!'); 875 return redirect()->route('worker.additional_documents')->with('error', 'Данные не предоставлены!');
917 } 876 }
918 877
919 foreach ($dop_info_data as $infoblok_id => $status) { 878 foreach ($dop_info_data as $infoblok_id => $status) {
920 Dop_info::updateOrCreate( 879 Dop_info::updateOrCreate(
921 ['worker_id' => $worker->id, 'infoblok_id' => $infoblok_id], 880 ['worker_id' => $worker->id, 'infoblok_id' => $infoblok_id],
922 ['status' => $status] 881 ['status' => $status]
923 ); 882 );
924 } 883 }
925 884
926 return redirect()->route('worker.additional_documents')->with('success', 'Успешно сохранено!'); 885 return redirect()->route('worker.additional_documents')->with('success', 'Успешно сохранено!');
927 } 886 }
928 887
929 public function delete_add_diplom(Request $request, Worker $worker) { 888 public function delete_add_diplom(Request $request, Worker $worker) {
930 $infoblok_id = $request->get('infoblok_id'); 889 $infoblok_id = $request->get('infoblok_id');
931 890
932 if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0) 891 if (Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->count() > 0)
933 $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete(); 892 $id = Dop_info::query()->where('worker_id', $worker->id)->where('infoblok_id', $infoblok_id)->delete();
934 else { 893 else {
935 $params['infoblok_id'] = $infoblok_id; 894 $params['infoblok_id'] = $infoblok_id;
936 $params['worker_id'] = $worker->id; 895 $params['worker_id'] = $worker->id;
937 $params['status'] = $request->get('val'); 896 $params['status'] = $request->get('val');
938 $id = Dop_info::create($params); 897 $id = Dop_info::create($params);
939 //$id = $worker->infobloks()->sync([$infoblok_id]); 898 //$id = $worker->infobloks()->sync([$infoblok_id]);
940 } 899 }
941 900
942 //$Infoblocks = infobloks::query()->get(); 901 //$Infoblocks = infobloks::query()->get();
943 return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks')); 902 return $id; //redirect()->route('worker.cabinet')->getTargetUrl(); //view('workers.ajax.diploms_dop', compact('worker', 'Infoblocks'));
944 } 903 }
945 904
946 905
947 906
948 // Добавление диплома 907 // Добавление диплома
949 public function add_diplom_ajax(Request $request) { 908 public function add_diplom_ajax(Request $request) {
950 // конец 909 // конец
951 $params = $request->all(); 910 $params = $request->all();
952 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 911 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
953 912
954 if ($count == 0) $dop_info = Dop_info::create($params); 913 if ($count == 0) $dop_info = Dop_info::create($params);
955 $Infoblocks = infobloks::query()->get(); 914 $Infoblocks = infobloks::query()->get();
956 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get(); 915 $Worker = Worker::query()->where('id', $request->get('worker_id'))->get();
957 $data = Dop_info::query()->where('worker_id', $request->has('worker_id')); 916 $data = Dop_info::query()->where('worker_id', $request->has('worker_id'));
958 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker')); 917 return view('ajax.dop_info', compact('data', 'Infoblocks', 'Worker'));
959 } 918 }
960 919
961 // Добавление диплома без ajax 920 // Добавление диплома без ajax
962 public function add_diplom(Worker $worker) { 921 public function add_diplom(Worker $worker) {
963 $worker_id = $worker->id; 922 $worker_id = $worker->id;
964 $Infoblocks = infobloks::query()->get(); 923 $Infoblocks = infobloks::query()->get();
965 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks')); 924 return view('workers.dop_info', compact('worker_id', 'worker', 'Infoblocks'));
966 } 925 }
967 // Сохранить 926 // Сохранить
968 // Сохраняю диплом 927 // Сохраняю диплом
969 public function add_diplom_save(Request $request) { 928 public function add_diplom_save(Request $request) {
970 $params = $request->all(); 929 $params = $request->all();
971 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count(); 930 $count = Dop_info::query()->where('worker_id', $request->get('worker_id'))->where('infoblok_id', $request->get('infoblok_id'))->count();
972 if ($count == 0) $dop_info = Dop_info::create($params); 931 if ($count == 0) $dop_info = Dop_info::create($params);
973 return redirect()->route('worker.cabinet'); 932 return redirect()->route('worker.cabinet');
974 } 933 }
975 934
976 // Добавление стандартного документа 935 // Добавление стандартного документа
977 public function add_document(Worker $worker) { 936 public function add_document(Worker $worker) {
978 return view('workers.docs', compact('worker')); 937 return view('workers.docs', compact('worker'));
979 } 938 }
980 939
981 //Сохранение стандартого документа 940 //Сохранение стандартого документа
982 public function add_document_save(DocumentsRequest $request) { 941 public function add_document_save(DocumentsRequest $request) {
983 $params = $request->all(); 942 $params = $request->all();
984 place_works::create($params); 943 place_works::create($params);
985 return response()->json(['success' => true]); 944 return response()->json(['success' => true]);
986 } 945 }
987 946
988 // Редактирование документа 947 // Редактирование документа
989 public function edit_document(place_works $doc, Worker $worker) { 948 public function edit_document(place_works $doc, Worker $worker) {
990 return view('workers.docs-edit', compact('doc', 'worker')); 949 return view('workers.docs-edit', compact('doc', 'worker'));
991 } 950 }
992 951
993 //Сохранение отредактированного документа 952 //Сохранение отредактированного документа
994 public function edit_document_save(DocumentsRequest $request, place_works $doc) { 953 public function edit_document_save(DocumentsRequest $request, place_works $doc) {
995 $params = $request->all(); 954 $params = $request->all();
996 $doc->update($params); 955 $doc->update($params);
997 956
998 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!'); 957 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно отредактировали запись!');
999 } 958 }
1000 959
1001 // Удаление документа 960 // Удаление документа
1002 public function delete_document(place_works $doc) { 961 public function delete_document(place_works $doc) {
1003 $doc->delete(); 962 $doc->delete();
1004 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!'); 963 return redirect()->route('worker.cabinet')->with('success', 'Вы успешно удалили запись!');
1005 } 964 }
1006 965
1007 //Отправка нового сообщения 966 //Отправка нового сообщения
1008 public function new_message(Request $request) { 967 public function new_message(Request $request) {
1009 $params = $request->all(); 968 $params = $request->all();
1010 969
1011 $id = $params['send_user_id']; 970 $id = $params['send_user_id'];
1012 $message_params = [ 971 $message_params = [
1013 'title' => $params['send_title'], 972 'title' => $params['send_title'],
1014 'text' => $params['send_text'], 973 'text' => $params['send_text'],
1015 'ad_employer_id' => $params['send_vacancy'], 974 'ad_employer_id' => $params['send_vacancy'],
1016 'flag_new' => 1 975 'flag_new' => 1
1017 ]; 976 ];
1018 977
1019 $message = Message::add_message( 978 $message = Message::add_message(
1020 $request, 979 $request,
1021 $params['send_user_id'], 980 $params['send_user_id'],
1022 $params['send_to_user_id'], 981 $params['send_to_user_id'],
1023 $message_params, 982 $message_params,
1024 file_store_path: "worker/$id" 983 file_store_path: "worker/$id"
1025 ); 984 );
1026 985
1027 $data['message_id'] = $message->id; 986 $data['message_id'] = $message->id;
1028 $data['ad_employer_id'] = $params['send_vacancy']; 987 $data['ad_employer_id'] = $params['send_vacancy'];
1029 $data['job_title_id'] = $params['send_job_title_id']; 988 $data['job_title_id'] = $params['send_job_title_id'];
1030 $data['flag'] = 1; 989 $data['flag'] = 1;
1031 $ad_responce = ad_response::create($data); 990 $ad_responce = ad_response::create($data);
1032 return redirect()->route('worker.messages', ['type_message' => 'output']); 991 return redirect()->route('worker.messages', ['type_message' => 'output']);
1033 } 992 }
1034 993
1035 994
1036 public function test123(Request $request) { 995 public function test123(Request $request) {
1037 $params = $request->all(); 996 $params = $request->all();
1038 $user1 = $params['user_id']; 997 $user1 = $params['user_id'];
1039 $user2 = $params['to_user_id']; 998 $user2 = $params['to_user_id'];
1040 999
1041 $rules = [ 1000 $rules = [
1042 'text' => 'nullable|required_without:file|min:1|max:150000', 1001 'text' => 'nullable|required_without:file|min:1|max:150000',
1043 'file' => 'nullable|file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000' 1002 'file' => 'nullable|file|mimes:doc,docx,xlsx,csv,txt,xlx,xls,pdf|max:150000'
1044 ]; 1003 ];
1045 $messages = [ 1004 $messages = [
1046 'required_without' => 'Поле «:attribute» обязательно, если файл не прикреплен', 1005 'required_without' => 'Поле «:attribute» обязательно, если файл не прикреплен',
1047 'min' => [ 1006 'min' => [
1048 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 1007 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
1049 'integer' => 'Поле «:attribute» должно быть :min или больше', 1008 'integer' => 'Поле «:attribute» должно быть :min или больше',
1050 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 1009 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
1051 ], 1010 ],
1052 'max' => [ 1011 'max' => [
1053 'string' => 'Поле «:attribute» должно быть не больше :max символов', 1012 'string' => 'Поле «:attribute» должно быть не больше :max символов',
1054 'integer' => 'Поле «:attribute» должно быть :max или меньше', 1013 'integer' => 'Поле «:attribute» должно быть :max или меньше',
1055 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 1014 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
1056 ] 1015 ]
1057 ]; 1016 ];
1058 1017
1059 $validator = Validator::make($request->all(), $rules, $messages); 1018 $validator = Validator::make($request->all(), $rules, $messages);
1060 1019
1061 if ($validator->fails()) { 1020 if ($validator->fails()) {
1062 $chat = Chat::where('user_id', $user1) 1021 $chat = Chat::where('user_id', $user1)
1063 ->where('to_user_id', $user2) 1022 ->where('to_user_id', $user2)
1064 ->where('is_removed', 0) 1023 ->where('is_removed', 0)
1065 ->first() 1024 ->first()
1066 ; 1025 ;
1067 1026
1068 if ($chat->id){ 1027 if ($chat->id){
1069 return redirect()->route('worker.dialog', ['chat' => $chat->id])->withErrors($validator); 1028 return redirect()->route('worker.dialog', ['chat' => $chat->id])->withErrors($validator);
1070 } else { 1029 } else {
1071 return redirect()->route('cabinet.messages', ['type_message' => 'input'])->withErrors($validator); 1030 return redirect()->route('cabinet.messages', ['type_message' => 'input'])->withErrors($validator);
1072 } 1031 }
1073 } else { 1032 } else {
1074 $new_message = Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages'); 1033 $new_message = Message::add_message($request, $user1, $user2, $request->all(), file_store_path: 'messages');
1075 1034
1076 return redirect()->route('worker.dialog', ['chat' => $new_message->chat_id_from]); 1035 return redirect()->route('worker.dialog', ['chat' => $new_message->chat_id_from]);
1077 1036
1078 } 1037 }
1079 } 1038 }
1080 1039
1081 // Информация о предыдущих компаниях 1040 // Информация о предыдущих компаниях
1082 public function new_prev_company(Worker $worker) { 1041 public function new_prev_company(Worker $worker) {
1083 return view('workers.prev_company_form', compact('worker')); 1042 return view('workers.prev_company_form', compact('worker'));
1084 } 1043 }
1085 1044
1086 // Добавление контакта компании 1045 // Добавление контакта компании
1087 public function add_prev_company(PrevCompanyRequest $request) { 1046 public function add_prev_company(PrevCompanyRequest $request) {
1088 // Возвращение параметров 1047 // Возвращение параметров
1089 $all = $request->all(); 1048 $all = $request->all();
1090 PrevCompany::create($all); 1049 PrevCompany::create($all);
1091 1050
1092 return response()->json(['success' => true]); 1051 return response()->json(['success' => true]);
1093 } 1052 }
1094 1053
1095 // Редактирование контакта компании 1054 // Редактирование контакта компании
1096 public function edit_prev_company(PrevCompany $doc, Worker $worker) { 1055 public function edit_prev_company(PrevCompany $doc, Worker $worker) {
1097 return view('workers.prev_company_edit_form', compact('doc', 'worker')); 1056 return view('workers.prev_company_edit_form', compact('doc', 'worker'));
1098 } 1057 }
1099 1058
1100 //Сохранение редактирования контакта компании 1059 //Сохранение редактирования контакта компании
1101 public function update_prev_company(PrevCompany $doc, Request $request){ 1060 public function update_prev_company(PrevCompany $doc, Request $request){
1102 $all = $request->all(); 1061 $all = $request->all();
1103 $doc->update($all); 1062 $doc->update($all);
app/Models/Like_vacancy.php
1 <?php 1 <?php
2 2
3 namespace App\Models; 3 namespace App\Models;
4 4
5 use Illuminate\Database\Eloquent\Factories\HasFactory;
6 use Illuminate\Database\Eloquent\Model; 5 use Illuminate\Database\Eloquent\Model;
6 use Illuminate\Database\Eloquent\Relations\BelongsTo;
7 7
8 class Like_vacancy extends Model 8 class Like_vacancy extends Model
9 { 9 {
10 use HasFactory;
11
12 public $table = 'like_vacancy'; 10 public $table = 'like_vacancy';
13 11
14 public $fillable = [ 12 public $fillable = [
15 'code_record', 13 'code_record',
16 'ip_address' 14 'user_id'
17 ]; 15 ];
16
17 public function user(): BelongsTo
18 {
19 return $this->belongsTo(User::class);
20 }
21
22 public function vacancy(): BelongsTo
23 {
24 return $this->belongsTo(Ad_employer::class);
app/Models/Like_worker.php
1 <?php 1 <?php
2 2
3 namespace App\Models; 3 namespace App\Models;
4 4
5 use Illuminate\Database\Eloquent\Factories\HasFactory;
6 use Illuminate\Database\Eloquent\Model; 5 use Illuminate\Database\Eloquent\Model;
6 use Illuminate\Database\Eloquent\Relations\BelongsTo;
7 7
8 class Like_worker extends Model 8 class Like_worker extends Model
9 { 9 {
10 use HasFactory;
11
12 public $table = 'like_worker'; 10 public $table = 'like_worker';
13 11
14 public $fillable = [ 12 public $fillable = [
15 'code_record', 13 'code_record',
16 'ip_address' 14 'user_id'
17 ]; 15 ];
18 16
19 /*
20 один-ко-многим
21 */
22 public function worker() { 17 public function worker() {
23 return $this->hasMany(Worker::class); 18 return $this->hasMany(Worker::class);
24 } 19 }
20
21 public function user(): BelongsTo
app/Models/Message.php
1 <?php 1 <?php
2 2
3 namespace App\Models; 3 namespace App\Models;
4 4
5 use Illuminate\Database\Eloquent\Factories\HasFactory; 5 use Illuminate\Database\Eloquent\Factories\HasFactory;
6 use Illuminate\Database\Eloquent\Model; 6 use Illuminate\Database\Eloquent\Model;
7 use Illuminate\Http\Request; 7 use Illuminate\Http\Request;
8 use Illuminate\Support\Facades\Validator; 8 use Illuminate\Support\Facades\Validator;
9 use mysql_xdevapi\Collection; 9 use mysql_xdevapi\Collection;
10 10
11 class Message extends Model 11 class Message extends Model
12 { 12 {
13 use HasFactory; 13 use HasFactory;
14 14
15 protected $fillable = [ 15 protected $fillable = [
16 'user_id', 16 'user_id',
17 'to_user_id', 17 'to_user_id',
18 'title', 18 'title',
19 'text', 19 'text',
20 'file', 20 'file',
21 'flag_new', 21 'flag_new',
22 'ad_employer_id', 22 'ad_employer_id',
23 'job_title_id', 23 'job_title_id',
24 'chat_id_from', 24 'chat_id_from',
25 'chat_id_to', 25 'chat_id_to',
26 'reply_message_id', 26 'reply_message_id',
27 'original_file_name', 27 'original_file_name',
28 ]; 28 ];
29 29
30 30
31 /* 31 /*
32 * Связь таблицы Message с таблицей User (Отправитель) 32 * Связь таблицы Message с таблицей User (Отправитель)
33 */ 33 */
34 public function user_from() { 34 public function user_from() {
35 return $this->belongsTo(User::class, 'user_id'); 35 return $this->belongsTo(User::class, 'user_id');
36 } 36 }
37 37
38 /* 38 /*
39 * Связь таблицы Message с таблицей User (Получатель) 39 * Связь таблицы Message с таблицей User (Получатель)
40 */ 40 */
41 public function user_to() { 41 public function user_to() {
42 return $this->belongsTo(User::class, 'to_user_id'); 42 return $this->belongsTo(User::class, 'to_user_id');
43 } 43 }
44 44
45 // Связь модели Сообщения (Message) с моделью Вакансии (Ad_employer) 45 // Связь модели Сообщения (Message) с моделью Вакансии (Ad_employer)
46 public function vacancies() { 46 public function vacancies() {
47 return $this->belongsTo(Ad_employer::class, 'ad_employer_id', 'id'); 47 return $this->belongsTo(Ad_employer::class, 'ad_employer_id', 'id');
48 } 48 }
49 49
50 public static function add_message( 50 public static function add_message(
51 ?Request $request, 51 ?Request $request,
52 int $user_id, 52 int $user_id,
53 int $to_user_id, 53 int $to_user_id,
54 array $message_params, 54 array $message_params,
55 string $file_store_path = '/', 55 string $file_store_path = '/',
56 bool $is_admin_chat = false 56 bool $is_admin_chat = false
57 ) { 57 ) {
58 dd($request->all());
58 $message_params['user_id'] = $user_id; 59 $message_params['user_id'] = $user_id;
59 $message_params['to_user_id'] = $to_user_id; 60 $message_params['to_user_id'] = $to_user_id;
60 if ($request && $request->has('file')) { 61 if ($request && $request->has('file')) {
61 $file = $request->file('file'); 62 $file = $request->file('file');
62 $message_params['file'] = $file->store($file_store_path, 'public'); 63 $message_params['file'] = $file->store($file_store_path, 'public');
63 $message_params['original_file_name'] = $file->getClientOriginalName(); 64 $message_params['original_file_name'] = $file->getClientOriginalName();
64 } 65 }
65 66
66 $chat_form = Chat::firstOrCreate([ 67 $chat_form = Chat::firstOrCreate([
67 'user_id' => $is_admin_chat ? 0 : $user_id, 68 'user_id' => $is_admin_chat ? 0 : $user_id,
68 'to_user_id' => $to_user_id, 69 'to_user_id' => $to_user_id,
69 'is_removed' => 0, 70 'is_removed' => 0,
70 'is_admin_chat' => $is_admin_chat ? 1 : 0, 71 'is_admin_chat' => $is_admin_chat ? 1 : 0,
71 ]); 72 ]);
72 $message_params[$is_admin_chat ? 'chat_id_to' : 'chat_id_from'] = $chat_form->id; 73 $message_params[$is_admin_chat ? 'chat_id_to' : 'chat_id_from'] = $chat_form->id;
73 74
74 if (!$is_admin_chat) { 75 if (!$is_admin_chat) {
75 $chat_to = Chat::firstOrCreate([ 76 $chat_to = Chat::firstOrCreate([
76 'user_id' => $to_user_id, 77 'user_id' => $to_user_id,
77 'to_user_id' => $user_id, 78 'to_user_id' => $user_id,
78 'is_removed' => 0 79 'is_removed' => 0
79 ]); 80 ]);
80 $message_params['chat_id_to'] = $chat_to->id; 81 $message_params['chat_id_to'] = $chat_to->id;
81 } 82 }
82 83
83 $new_message = Message::create($message_params); 84 $new_message = Message::create($message_params);
84 85
85 if (!empty($new_message->id)) { 86 if (!empty($new_message->id)) {
86 $chat_form->update(['last_message_date' => date("Y-m-d H:i:s"), 'last_message_id' => $new_message->id]); 87 $chat_form->update(['last_message_date' => date("Y-m-d H:i:s"), 'last_message_id' => $new_message->id]);
87 88
88 if (!$is_admin_chat) { 89 if (!$is_admin_chat) {
89 $chat_to->update(['last_message_date' => date("Y-m-d H:i:s"), 'last_message_id' => $new_message->id]); 90 $chat_to->update(['last_message_date' => date("Y-m-d H:i:s"), 'last_message_id' => $new_message->id]);
90 } 91 }
91 } 92 }
92 93
93 return $new_message ?? false; 94 return $new_message ?? false;
94 } 95 }
95 96
96 public function getReplyMessageAttribute() 97 public function getReplyMessageAttribute()
97 { 98 {
98 $reply_message = false; 99 $reply_message = false;
99 if ($this->attributes['reply_message_id']){ 100 if ($this->attributes['reply_message_id']){
100 $reply_message = self::find($this->attributes['reply_message_id']); 101 $reply_message = self::find($this->attributes['reply_message_id']);
101 } 102 }
102 103
103 return $reply_message; 104 return $reply_message;
104 } 105 }
105 106
106 } 107 }
107 108
app/Models/Worker.php
1 <?php 1 <?php
2 2
3 namespace App\Models; 3 namespace App\Models;
4 4
5 use Illuminate\Database\Eloquent\Builder;
5 use Illuminate\Database\Eloquent\Factories\HasFactory; 6 use Illuminate\Database\Eloquent\Factories\HasFactory;
6 use Illuminate\Database\Eloquent\Model; 7 use Illuminate\Database\Eloquent\Model;
7 8
8 class Worker extends Model 9 class Worker extends Model
9 { 10 {
10 use HasFactory; 11 use HasFactory;
11 12
12 protected $table = 'workers'; 13 protected $table = 'workers';
13 14
14 protected $fillable = [ 15 protected $fillable = [
15 'user_id', 16 'user_id',
16 'status_work', 17 'status_work',
17 'position_work', 18 'position_work',
18 'positions_work', 19 'positions_work',
19 'telephone', 20 'telephone',
20 'telephone2', 21 'telephone2',
21 'persent_anketa', 22 'persent_anketa',
22 'photo', 23 'photo',
23 'email_data', 24 'email_data',
24 'status_profile', 25 'status_profile',
25 'old_year', 26 'old_year',
26 'experience', 27 'experience',
27 'en_is', 28 'en_is',
28 'education', 29 'education',
29 'email', 30 'email',
30 'interpassport', 31 'interpassport',
31 'mk', 32 'mk',
32 'vvp', 33 'vvp',
33 'vlm', 34 'vlm',
34 'reka_diplom', 35 'reka_diplom',
35 'more_diplom', 36 'more_diplom',
36 'mpss', 37 'mpss',
37 'tanker', 38 'tanker',
38 'gmssb', 39 'gmssb',
39 'resume', 40 'resume',
40 'sort', 41 'sort',
41 'updated_at', 42 'updated_at',
42 'text', 43 'text',
43 'address', 44 'address',
44 'city', 45 'city',
45 'coord', 46 'coord',
46 'file', 47 'file',
47 'is_remove', 48 'is_remove',
48 'favorite_user', 49 'favorite_user',
49 'sroch_user', 50 'sroch_user',
50 'salary_expectations', 51 'salary_expectations',
51 'english_level', 52 'english_level',
52 'ready_boart_date', 53 'ready_boart_date',
53 'boart_type_preference', 54 'boart_type_preference',
54 'visa_available', 55 'visa_available',
55 'tanker_documents_available', 56 'tanker_documents_available',
56 'confirmation_work_for_vvp', 57 'confirmation_work_for_vvp',
57 'military_id_available' 58 'military_id_available'
58 ]; 59 ];
59 60
60 /** 61 /**
61 * Получить значение поля positions_work как массив. 62 * Получить значение поля positions_work как массив.
62 * 63 *
63 * @param string $value 64 * @param string $value
64 * @return array 65 * @return array
65 */ 66 */
66 public function getPositionsWorkAttribute($value) 67 public function getPositionsWorkAttribute($value)
67 { 68 {
68 return json_decode($value, true); 69 return json_decode($value, true);
69 } 70 }
70 71
71 /** 72 /**
72 * Установить значение поля positions_work как JSON. 73 * Установить значение поля positions_work как JSON.
73 * 74 *
74 * @param array|string $value 75 * @param array|string $value
75 * @return void 76 * @return void
76 */ 77 */
77 public function setPositionsWorkAttribute($value) 78 public function setPositionsWorkAttribute($value)
78 { 79 {
79 $this->attributes['positions_work'] = is_array($value) ? json_encode($value) : $value; 80 $this->attributes['positions_work'] = is_array($value) ? json_encode($value) : $value;
80 } 81 }
81 82
82 /* 83 /*
83 * Связь таблицы users с таблицей workers 84 * Связь таблицы users с таблицей workers
84 */ 85 */
85 public function users() { 86 public function users() {
86 return $this->belongsTo(User::class, 'user_id'); 87 return $this->belongsTo(User::class, 'user_id');
87 } 88 }
88 89
89 // Связь Работника с сертификами (0-0 - 1) 90 // Связь Работника с сертификами (0-0 - 1)
90 public function sertificate() { 91 public function sertificate() {
91 return $this->hasMany(sertification::class); 92 return $this->hasMany(sertification::class);
92 } 93 }
93 94
94 // Связь Работника с должностями (0-0 - 1) 95 // Связь Работника с должностями (0-0 - 1)
95 public function job_titles() { 96 public function job_titles() {
96 return $this->belongsToMany(Job_title::class, 'title_workers'); 97 return $this->belongsToMany(Job_title::class, 'title_workers');
97 } 98 }
98 99
99 //Связь Работника с опытом работы (1 - 0-0) 100 //Связь Работника с опытом работы (1 - 0-0)
100 public function place_worker() { 101 public function place_worker() {
101 return $this->hasMany(place_works::class); 102 return $this->hasMany(place_works::class);
102 } 103 }
103 104
104 public function scopeActive($query) { 105 public function scopeActive($query) {
105 return $query->where('is_remove', '=', '0'); 106 return $query->where('is_remove', '=', '0');
106 } 107 }
107 108
108 //Связь Работника с предыдущими компаниями 109 //Связь Работника с предыдущими компаниями
109 public function prev_company() { 110 public function prev_company() {
110 return $this->hasMany(PrevCompany::class); 111 return $this->hasMany(PrevCompany::class);
111 } 112 }
112 113
113 //Связь Работника с инфоблоками (0-0 - 0-0) 114 //Связь Работника с инфоблоками (0-0 - 0-0)
114 public function infobloks() { 115 public function infobloks() {
115 return $this->belongsToMany(infobloks::class,'dop_info', 'worker_id', 'infoblok_id'); 116 return $this->belongsToMany(infobloks::class,'dop_info', 'worker_id', 'infoblok_id');
116 } 117 }
117 118
118 //Связи Работника с дополнительными 119 //Связи Работника с дополнительными
119 public function dop_info() { 120 public function dop_info() {
120 return $this->hasMany(Dop_info::class, 'worker_id'); 121 return $this->hasMany(Dop_info::class, 'worker_id');
121 } 122 }
122 123
123 public function response() { 124 public function response() {
124 return $this->hasMany(ResponseWork::class); 125 return $this->hasMany(ResponseWork::class);
125 } 126 }
126 127
127 public function getJobsAttribute() 128 public function getJobsAttribute()
128 { 129 {
129 $job_titles_ids = json_decode($this->attributes['positions_work'], true); 130 $job_titles_ids = json_decode($this->attributes['positions_work'], true);
130 return Job_title::whereIn('id', $job_titles_ids)->get(); 131 return Job_title::whereIn('id', $job_titles_ids)->get();
131 } 132 }
132
133 } 133 }
database/migrations/2024_09_18_104034_change_ip_to_id_in_likes_tables.php
File was created 1 <?php
2
3 use Illuminate\Database\Migrations\Migration;
4 use Illuminate\Database\Schema\Blueprint;
5 use Illuminate\Support\Facades\Schema;
6
7 return new class extends Migration
8 {
9 /**
10 * Run the migrations.
11 *
12 * @return void
13 */
14 public function up()
15 {
16 Schema::table('like_worker', function (Blueprint $table) {
17 $table->renameColumn('ip_address', 'user_id');
18 });
19 Schema::table('like_vacancy', function (Blueprint $table) {
20 $table->renameColumn('ip_address', 'user_id');
21 });
22 }
23
24 /**
25 * Reverse the migrations.
26 *
27 * @return void
28 */
29 public function down()
30 {
31 // Schema::table('id_in_likes_tables', function (Blueprint $table) {
32 // //
33 // });
34 }
35 };
36
resources/views/admin/worker/index.blade.php
1 @extends('layout.admin', ['title' => 'Админка - Работники']) 1 @extends('layout.admin', ['title' => 'Админка - Работники'])
2 2
3 @section('script') 3 @section('script')
4 <script> 4 <script>
5 $(document).ready(function() { 5 $(document).ready(function() {
6 $(document).on('click', '.checkban', function () { 6 $(document).on('click', '.checkban', function () {
7 var this_ = $(this); 7 var this_ = $(this);
8 var value = this_.val(); 8 var value = this_.val();
9 var ajax_block = $('#ajax_block'); 9 var ajax_block = $('#ajax_block');
10 var bool = 0; 10 var bool = 0;
11 11
12 if(this.checked){ 12 if(this.checked){
13 bool = 1; 13 bool = 1;
14 } else { 14 } else {
15 bool = 0; 15 bool = 0;
16 } 16 }
17 17
18 $.ajax({ 18 $.ajax({
19 type: "GET", 19 type: "GET",
20 url: "{{ url()->full()}}", 20 url: "{{ url()->full()}}",
21 data: "id=" + value + "&is_ban=" + bool, 21 data: "id=" + value + "&is_ban=" + bool,
22 success: function (data) { 22 success: function (data) {
23 console.log('Обновление таблицы работников '); 23 console.log('Обновление таблицы работников ');
24 //data = JSON.parse(data); 24 //data = JSON.parse(data);
25 console.log(data); 25 console.log(data);
26 ajax_block.html(data); 26 ajax_block.html(data);
27 }, 27 },
28 headers: { 28 headers: {
29 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 29 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
30 }, 30 },
31 error: function (data) { 31 error: function (data) {
32 console.log('Error: ' + data); 32 console.log('Error: ' + data);
33 } 33 }
34 }); 34 });
35 }); 35 });
36 36
37 }); 37 });
38 </script> 38 </script>
39 @endsection 39 @endsection
40 40
41 @section('search') 41 @section('search')
42 @include('admin.find_worker', ['find_status_work' => $find_status_work]) 42 @include('admin.find_worker', ['find_status_work' => $find_status_work])
43 @endsection 43 @endsection
44 44
45 @section('content') 45 @section('content')
46 <div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-4"> 46 <div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-4">
47 47
48 <div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800"> 48 <div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800">
49 <div class="p-3 mr-4 text-orange-500 bg-orange-100 rounded-full dark:text-orange-100 dark:bg-orange-500"> 49 <div class="p-3 mr-4 text-orange-500 bg-orange-100 rounded-full dark:text-orange-100 dark:bg-orange-500">
50 <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> 50 <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
51 <path 51 <path
52 d="M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z"></path> 52 d="M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z"></path>
53 </svg> 53 </svg>
54 </div> 54 </div>
55 <div> 55 <div>
56 <p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400"> 56 <p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400">
57 Всего соискателей 57 Всего соискателей
58 </p> 58 </p>
59 <p class="text-lg font-semibold text-gray-700 dark:text-gray-200"> 59 <p class="text-lg font-semibold text-gray-700 dark:text-gray-200">
60 {{ $all_worker }} 60 {{ $all_worker }}
61 </p> 61 </p>
62 </div> 62 </div>
63 </div> 63 </div>
64 </div> 64 </div>
65 65
66 <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> 66 <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block">
67 <div class="w-full overflow-x-auto"> 67 <div class="w-full overflow-x-auto">
68 <table class="w-full whitespace-no-wrap"> 68 <table class="w-full whitespace-no-wrap">
69 <thead> 69 <thead>
70 <tr 70 <tr
71 class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800" 71 class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800"
72 > 72 >
73 <th class="px-4 py-3">№</th> 73 <th class="px-4 py-3">№</th>
74 <th class="px-4 py-3">Лого</th> 74 <th class="px-4 py-3">Лого</th>
75 <th class="px-4 py-3">ФИО/Email/Телефон</th> 75 <th class="px-4 py-3">ФИО/Email/Телефон</th>
76 <th class="px-4 py-3">Статус</th> 76 <th class="px-4 py-3">Статус</th>
77 <th class="px-4 py-3">% анкеты</th> 77 <th class="px-4 py-3">% анкеты</th>
78 <th class="px-4 py-3">Должность</th> 78 <th class="px-4 py-3">Должность</th>
79 <th class="px-4 py-3">Дата регистрации</th> 79 <th class="px-4 py-3">Дата регистрации</th>
80 <th class="px-4 py-3">Изменить</th> 80 <th class="px-4 py-3">Изменить</th>
81 </tr> 81 </tr>
82 </thead> 82 </thead>
83 <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> 83 <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800">
84 @foreach($users as $user) 84 @foreach($users as $user)
85 <tr class="text-gray-700 dark:text-gray-400"> 85 <tr class="text-gray-700 dark:text-gray-400">
86 <td class="px-4 py-3 text-xs"> 86 <td class="px-4 py-3 text-xs">
87 {{$user->id}} 87 {{$user->id}}
88 </td> 88 </td>
89 <td class="px-4 py-3 text-xs"> 89 <td class="px-4 py-3 text-xs">
90 @if (isset($user->workers[0]->photo)) 90 @if (isset($user->workers[0]->photo))
91 <div class="flex items-center text-sm"> 91 <div class="flex items-center text-sm">
92 <div 92 <div
93 class="relative hidden w-8 h-8 mr-3 rounded-full md:block" 93 class="relative hidden w-8 h-8 mr-3 rounded-full md:block"
94 > 94 >
95 <img 95 <img
96 class="object-cover w-full h-full rounded-full" 96 class="object-cover w-full h-full rounded-full"
97 src="{{ asset(Storage::url($user->workers[0]->photo)) }}" 97 src="{{ asset(Storage::url($user->workers[0]->photo)) }}"
98 alt="" 98 alt=""
99 loading="lazy" 99 loading="lazy"
100 /> 100 />
101 <div 101 <div
102 class="absolute inset-0 rounded-full shadow-inner" 102 class="absolute inset-0 rounded-full shadow-inner"
103 aria-hidden="true" 103 aria-hidden="true"
104 ></div> 104 ></div>
105 </div> 105 </div>
106 </div> 106 </div>
107 @else 107 @else
108 - 108 -
109 @endif 109 @endif
110 </td> 110 </td>
111 111
112 <td class="px-4 py-3 text-xs"> 112 <td class="px-4 py-3 text-xs">
113 <div class="flex items-center text-sm"> 113 <div class="flex items-center text-sm">
114 <div> 114 <div>
115 <p class="font-semibold"> 115 <p class="font-semibold">
116 @if (isset($user->id)) 116 @if (isset($user->id))
117 <a style="text-decoration: underline;" href="{{ route('admin.user-profile', ['user' => $user->id]) }}}">{{ $user->surname }} {{ !empty($user->name_man) ? $user->name_man : $user->name }} {{ $user->surname2 }}</a> 117 <a style="text-decoration: underline;" href="{{ route('admin.user-profile', ['user' => $user->id]) }}}">{{ $user->surname }} {{ !empty($user->name_man) ? $user->name_man : $user->name }} {{ $user->surname2 }}</a>
118 @else 118 @else
119 {{ $user->surname }} {{ !empty($user->name_man) ? $user->name_man : $user->name }} {{ $user->surname2 }} 119 {{ $user->surname }} {{ !empty($user->name_man) ? $user->name_man : $user->name }} {{ $user->surname2 }}
120 @endif 120 @endif
121 </p> 121 </p>
122 <p class="font-semibold">{{ empty($user->workers->email) ? $user->email : $user->workers->email }}</p> 122 <p class="font-semibold">{{ empty($user->workers->email) ? $user->email : $user->workers->email }}</p>
123 <p class="text-xs text-gray-600 dark:text-gray-400"> 123 <p class="text-xs text-gray-600 dark:text-gray-400">
124 {{ empty($user->workers->telephone) ? $user->telephone : $user->workers->telephone }} 124 {{ empty($user->workers->telephone) ? $user->telephone : $user->workers->telephone }}
125 </p> 125 </p>
126 </div> 126 </div>
127 </div> 127 </div>
128 </td> 128 </td>
129 129
130 <td class="px-4 py-3 text-xs"> 130 <td class="px-4 py-3 text-xs">
131 @if (isset($user->workers[0]->status_work)) 131 @if (isset($user->workers[0]->status_work))
132 {{ $status_wor[$user->workers[0]->status_work] }} 132 {{ $status_wor[$user->workers[0]->status_work] }}
133 @else 133 @else
134 - 134 -
135 @endif 135 @endif
136 </td> 136 </td>
137 137
138 <td class="px-4 py-3 text-xs"> 138 <td class="px-4 py-3 text-xs">
139 @if (isset($user->workers[0]->persent_anketa)) 139 @if (isset($user->workers[0]->persent_anketa))
140 @if ($user->workers[0]->persent_anketa > 40) 140 @if ($user->workers[0]->persent_anketa > 40)
141 <span class="px-2 py-1 font-semibold leading-tight text-green-700 bg-green-100 rounded-full dark:bg-green-700 dark:text-green-100"> 141 <span class="px-2 py-1 font-semibold leading-tight text-green-700 bg-green-100 rounded-full dark:bg-green-700 dark:text-green-100">
142 {{$user->workers[0]->persent_anketa}}% 142 {{$user->workers[0]->persent_anketa}}%
143 </span> 143 </span>
144 @else 144 @else
145 <span class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:text-white dark:bg-orange-600"> 145 <span class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:text-white dark:bg-orange-600">
146 {{$user->workers[0]->persent_anketa}}% 146 {{ \App\Classes\Tools::getWorkerProfilePercent($user->workers[0]) }}%
147 </span> 147 </span>
148 @endif 148 @endif
149 @else 149 @else
150 <span class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:text-white dark:bg-orange-600"> 150 <span class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:text-white dark:bg-orange-600">
151 0% 151 0%
152 </span> 152 </span>
153 @endif 153 @endif
154 </td> 154 </td>
155 <td class="px-4 py-3 text-xs"> 155 <td class="px-4 py-3 text-xs">
156 @if (isset($user->jobtitles[0]->name)) 156 @if (isset($user->jobtitles[0]->name))
157 {{ $user->jobtitles[0]->name }} 157 {{ $user->jobtitles[0]->name }}
158 @else 158 @else
159 Не задана 159 Не задана
160 @endif 160 @endif
161 </td> 161 </td>
162 <td class="px-4 py-3 text-xs"> 162 <td class="px-4 py-3 text-xs">
163 {{ date('d.m.Y h:i:s', strtotime($user->created_at)) }} 163 {{ date('d.m.Y h:i:s', strtotime($user->created_at)) }}
164 </td> 164 </td>
165 <td class="px-4 py-3 text-xs"> 165 <td class="px-4 py-3 text-xs">
166 <!--if ($user->id > 1)--> 166 <!--if ($user->id > 1)-->
167 @if (isset($user->workers[0]->id)) 167 @if (isset($user->workers[0]->id))
168 <a href="{{ route('admin.worker-profile-edit', ['worker' => $user->workers[0]->id]) }}">Изменить</a> 168 <a href="{{ route('admin.worker-profile-edit', ['worker' => $user->workers[0]->id]) }}">Изменить</a>
169 169
170 @endif 170 @endif
171 <!--endif--> 171 <!--endif-->
172 </td> 172 </td>
173 <!--<td class="px-4 py-3 text-sm"> 173 <!--<td class="px-4 py-3 text-sm">
174 @if ($user->id > 1) 174 @if ($user->id > 1)
175 <input type="checkbox" class="checkban" value="{{$user->id}}" name="ban_{{$user->id}}" {{ ($user->is_ban) ? "checked" : "" }}/> 175 <input type="checkbox" class="checkban" value="{{$user->id}}" name="ban_{{$user->id}}" {{ ($user->is_ban) ? "checked" : "" }}/>
176 @endif 176 @endif
177 </td>--> 177 </td>-->
178 </tr> 178 </tr>
179 @endforeach 179 @endforeach
180 </tbody> 180 </tbody>
181 </table> 181 </table>
182 </div> 182 </div>
183 183
184 <div class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800"> 184 <div class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800">
185 <?=$users->appends($_GET)->links('admin.pagginate'); ?> 185 <?=$users->appends($_GET)->links('admin.pagginate'); ?>
186 </div> 186 </div>
187 187
188 188
189 <!--<div 189 <!--<div
190 class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800" 190 class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800"
191 > 191 >
192 <span class="flex items-center col-span-3"> 192 <span class="flex items-center col-span-3">
193 Showing 21-30 of 100 193 Showing 21-30 of 100
194 </span> 194 </span>
195 <span class="col-span-2"></span> 195 <span class="col-span-2"></span>
196 196
197 <span class="flex col-span-4 mt-2 sm:mt-auto sm:justify-end"> 197 <span class="flex col-span-4 mt-2 sm:mt-auto sm:justify-end">
198 <nav aria-label="Table navigation"> 198 <nav aria-label="Table navigation">
199 <ul class="inline-flex items-center"> 199 <ul class="inline-flex items-center">
200 <li> 200 <li>
201 <button 201 <button
202 class="px-3 py-1 rounded-md rounded-l-lg focus:outline-none focus:shadow-outline-purple" 202 class="px-3 py-1 rounded-md rounded-l-lg focus:outline-none focus:shadow-outline-purple"
203 aria-label="Previous" 203 aria-label="Previous"
204 > 204 >
205 <svg 205 <svg
206 aria-hidden="true" 206 aria-hidden="true"
207 class="w-4 h-4 fill-current" 207 class="w-4 h-4 fill-current"
208 viewBox="0 0 20 20" 208 viewBox="0 0 20 20"
209 > 209 >
210 <path 210 <path
211 d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" 211 d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"
212 clip-rule="evenodd" 212 clip-rule="evenodd"
213 fill-rule="evenodd" 213 fill-rule="evenodd"
214 ></path> 214 ></path>
215 </svg> 215 </svg>
216 </button> 216 </button>
217 </li> 217 </li>
218 <li> 218 <li>
219 <button 219 <button
220 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" 220 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
221 > 221 >
222 1 222 1
223 </button> 223 </button>
224 </li> 224 </li>
225 <li> 225 <li>
226 <button 226 <button
227 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" 227 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
228 > 228 >
229 2 229 2
230 </button> 230 </button>
231 </li> 231 </li>
232 <li> 232 <li>
233 <button 233 <button
234 class="px-3 py-1 text-white transition-colors duration-150 bg-purple-600 border border-r-0 border-purple-600 rounded-md focus:outline-none focus:shadow-outline-purple" 234 class="px-3 py-1 text-white transition-colors duration-150 bg-purple-600 border border-r-0 border-purple-600 rounded-md focus:outline-none focus:shadow-outline-purple"
235 > 235 >
236 3 236 3
237 </button> 237 </button>
238 </li> 238 </li>
239 <li> 239 <li>
240 <button 240 <button
241 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" 241 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
242 > 242 >
243 4 243 4
244 </button> 244 </button>
245 </li> 245 </li>
246 <li> 246 <li>
247 <span class="px-3 py-1">...</span> 247 <span class="px-3 py-1">...</span>
248 </li> 248 </li>
249 <li> 249 <li>
250 <button 250 <button
251 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" 251 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
252 > 252 >
253 8 253 8
254 </button> 254 </button>
255 </li> 255 </li>
256 <li> 256 <li>
257 <button 257 <button
258 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" 258 class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple"
259 > 259 >
260 9 260 9
261 </button> 261 </button>
262 </li> 262 </li>
263 <li> 263 <li>
264 <button 264 <button
265 class="px-3 py-1 rounded-md rounded-r-lg focus:outline-none focus:shadow-outline-purple" 265 class="px-3 py-1 rounded-md rounded-r-lg focus:outline-none focus:shadow-outline-purple"
266 aria-label="Next" 266 aria-label="Next"
267 > 267 >
268 <svg 268 <svg
269 class="w-4 h-4 fill-current" 269 class="w-4 h-4 fill-current"
270 aria-hidden="true" 270 aria-hidden="true"
271 viewBox="0 0 20 20" 271 viewBox="0 0 20 20"
272 > 272 >
273 <path 273 <path
274 d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" 274 d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
275 clip-rule="evenodd" 275 clip-rule="evenodd"
276 fill-rule="evenodd" 276 fill-rule="evenodd"
277 ></path> 277 ></path>
278 </svg> 278 </svg>
279 </button> 279 </button>
280 </li> 280 </li>
281 </ul> 281 </ul>
282 </nav> 282 </nav>
283 </span> 283 </span>
284 </div>--> 284 </div>-->
285 </div> 285 </div>
286 286
287 <?//=$users->appends($_GET)->links('catalogs.paginate'); ?> 287 <?//=$users->appends($_GET)->links('catalogs.paginate'); ?>
288 288
289 289
290 @endsection 290 @endsection
291 291
resources/views/ajax/list_vacancies.blade.php
1 @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp 1 @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp
2 2
3 @foreach ($Query as $Q) 3 @foreach ($Query as $Q)
4 @foreach ($Reclama as $Rec) 4 @foreach ($Reclama as $Rec)
5 @if ($Rec->position == $i) 5 @if ($Rec->position == $i)
6 <div class="main__vacancies-thing"> 6 <div class="main__vacancies-thing">
7 @if (!empty($Rec->image)) 7 @if (!empty($Rec->image))
8 <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 8 <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
9 @else 9 @else
10 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 10 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
11 @endif 11 @endif
12 <div class="main__vacancies-thing-body"> 12 <div class="main__vacancies-thing-body">
13 <h2>{{ $Rec->title }}</h2> 13 <h2>{{ $Rec->title }}</h2>
14 <div class="main__vacancies-thing-scroll"> 14 <div class="main__vacancies-thing-scroll">
15 {!! $Rec->text !!} 15 {!! $Rec->text !!}
16 </div> 16 </div>
17 <a href="{{ $Rec->link }}" class="button">Узнать больше</a> 17 <a href="{{ $Rec->link }}" class="button">Узнать больше</a>
18 </div> 18 </div>
19 </div> 19 </div>
20 @endif 20 @endif
21 @endforeach 21 @endforeach
22 <div class="main__vacancies-item main__employer-page-two-item"> 22 <div class="main__vacancies-item main__employer-page-two-item">
23 23
24 <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" class="back main__employer-page-two-item-back"> 24 <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" class="back main__employer-page-two-item-back">
25 <svg> 25 <svg>
26 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use> 26 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
27 </svg> 27 </svg>
28 <span> 28 <span> Вернуться к списку вакансий </span>
29 Вернуться к списку вакансий
30 </span>
31 </a> 29 </a>
32 30
33 <div class="main__employer-page-two-item-toper"> 31 <div class="main__employer-page-two-item-toper">
34 @if (!empty($Q->employer->logo)) 32 @if (!empty($Q->employer->logo))
35 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}"> 33 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}">
36 @else 34 @else
37 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 35 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
38 @endif 36 @endif
39 <span>@if (isset($Q->employer->name_company)) {{ $Q->employer->name_company }} @else Не определена @endif</span> 37 <span>@if (isset($Q->employer->name_company)) {{ $Q->employer->name_company }} @else Не определена @endif</span>
40 </div> 38 </div>
41 39
42 <div class="main__employer-page-two-item-text"> 40 <div class="main__employer-page-two-item-text">
43 <div class="main__employer-page-two-item-text-name"> 41 <div class="main__employer-page-two-item-text-name">
44 <h3>@if (!empty($Q->name)) {{ $Q->name }}@else Не указано @endif </h3> 42 <h3>@if (!empty($Q->name)) {{ $Q->name }}@else Не указано @endif </h3>
45 </div> 43 </div>
46 <!--Судоходная компания ведет набор
47 специалистов на следующие должности:</div>
48 <div class="main__employer-page-two-item-text-links">
49 if (isset($Q->jobs))
50 foreach ($Q->jobs as $key => $j)
51 <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 рублей (на руки)-->
52 <!-- </a>
53 endforeach
54 endif
55 </div>-->
56 </div> 44 </div>
57 45
58 <div class="main__employer-page-two-item-text"> 46 <div class="main__employer-page-two-item-text">
59 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 47 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
60 <div class="main__employer-page-two-item-text-body"> 48 <div class="main__employer-page-two-item-text-body">
61 {!! $Q->text !!} 49 {!! $Q->text !!}
62 </div> 50 </div>
63 </div> 51 </div>
64 <!--<div class="main__employer-page-two-item-text">
65 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div>
66 <div class="main__employer-page-two-item-text-body">
67 !! $Q->description !!}
68 </div>
69 </div>
70 <div class="main__employer-page-two-item-text">
71 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div>
72 <div class="main__employer-page-two-item-text-body">
73 !! $Q->contacts_emails !!}
74 </div>
75 </div>
76 <div class="main__employer-page-two-item-text">
77 <div class="main__employer-page-two-item-text-name">Или звоните:</div>
78 <div class="main__employer-page-two-item-text-body">
79 !! $Q->contacts_telephones !!}
80 </div>
81 </div>
82 -->
83 52
84 <div class="main__employer-page-two-item-tags"> 53 <div class="main__employer-page-two-item-tags">
85 @if (!empty($Q->jobs_code[0]->position_ship)) 54 @if (!empty($Q->jobs_code[0]->position_ship))
86 <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span> 55 <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span>
87 @else 56 @else
88 @if (isset($Q->jobs)) 57 @if (isset($Q->jobs))
89 @foreach ($Q->jobs as $key => $j) 58 @foreach ($Q->jobs as $key => $j)
90 <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span> 59 <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span>
91 @endforeach 60 @endforeach
92 @endif 61 @endif
93 @endif 62 @endif
94 </div> 63 </div>
95 64
96 <div class="main__employer-page-two-item-buttons"> 65 <div class="main__employer-page-two-item-buttons">
97 @guest 66 @guest
98 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' 67 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
99 class="button main__employer-page-two-item-button">Откликнуться</button> 68 class="button main__employer-page-two-item-button">Откликнуться</button>
100 @else 69 @else
101 @if (App\Classes\StatusUser::Status()==1) 70 @if (App\Classes\StatusUser::Status()==1)
102 <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}' 71 <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}'
103 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> 72 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
104 @else 73 @else
105 <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}' 74 <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}'
106 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> 75 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
107 @endif 76 @endif
108 @endguest 77 @endguest
109 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a> 78 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a>
110 </div> 79 </div>
111 <div class="main__employer-page-two-item-bottom"> 80 <div class="main__employer-page-two-item-bottom">
112 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y', strtotime($Q->updated_at)) }}</div> 81 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y', strtotime($Q->updated_at)) }}</div>
113 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vacancy_favorites <?=App\Classes\Cookies_vacancy::selected_vacancy($Q->id);?>"> 82 <button type="button" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js-toggle js_vacancy_favorites <?=App\Classes\Cookies_vacancy::selected_vacancy($Q->id);?>">
114 <svg> 83 <svg>
115 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 84 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
116 </svg> 85 </svg>
117 </button> 86 </button>
118 </div> 87 </div>
119 </div> 88 </div>
120 @php $i++ @endphp 89 @php $i++ @endphp
121 @endforeach 90 @endforeach
122 <div style="margin-top: 20px"> 91 <div style="margin-top: 20px">
123 {{ $Query->appends($_GET)->links('paginate') }} 92 {{ $Query->appends($_GET)->links('paginate') }}
124 </div><!-- конец --> 93 </div>
125 94
resources/views/companies.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 $(document).on('change', '#sort_ajax', function() { 5 $(document).on('change', '#sort_ajax', function() {
6 var this_ = $(this); 6 var this_ = $(this);
7 var val_ = this_.val(); 7 var val_ = this_.val();
8 console.log('sort items '+val_); 8 console.log('sort items '+val_);
9 9
10 $.ajax({ 10 $.ajax({
11 type: "GET", 11 type: "GET",
12 url: "{{ route('shipping_companies') }}", 12 url: "{{ route('shipping_companies') }}",
13 data: "sort="+val_+"&block=1", 13 data: "sort="+val_+"&block=1",
14 success: function (data) { 14 success: function (data) {
15 console.log('Выбор сортировки'); 15 console.log('Выбор сортировки');
16 console.log(data); 16 console.log(data);
17 $('#block_1').html(data); 17 $('#block_1').html(data);
18 }, 18 },
19 headers: { 19 headers: {
20 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 20 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
21 }, 21 },
22 error: function (data) { 22 error: function (data) {
23 data = JSON.stringify(data); 23 data = JSON.stringify(data);
24 console.log('Error: ' + data); 24 console.log('Error: ' + data);
25 } 25 }
26 }); 26 });
27 27
28 $.ajax({ 28 $.ajax({
29 type: "GET", 29 type: "GET",
30 url: "{{ route('shipping_companies') }}", 30 url: "{{ route('shipping_companies') }}",
31 data: "sort="+val_+"&block=2", 31 data: "sort="+val_+"&block=2",
32 success: function (data) { 32 success: function (data) {
33 console.log('Выбор сортировки2'); 33 console.log('Выбор сортировки2');
34 console.log(data); 34 console.log(data);
35 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 35 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
36 $('#block_2').html(data); 36 $('#block_2').html(data);
37 }, 37 },
38 headers: { 38 headers: {
39 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 39 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
40 }, 40 },
41 error: function (data) { 41 error: function (data) {
42 data = JSON.stringify(data); 42 data = JSON.stringify(data);
43 console.log('Error: ' + data); 43 console.log('Error: ' + data);
44 } 44 }
45 }); 45 });
46 }); 46 });
47 47
48 $(document).ready(function(){ 48 $(document).ready(function(){
49 var sel = $('#select2-sort_ajax-container'); 49 var sel = $('#select2-sort_ajax-container');
50 var key = getUrlParameter('sort'); 50 var key = getUrlParameter('sort');
51 51
52 if (key !=='') { 52 if (key !=='') {
53 console.log(key); 53 console.log(key);
54 switch (key) { 54 switch (key) {
55 case "default": sel.html('Сортировка (по умолчанию)'); break; 55 case "default": sel.html('Сортировка (по умолчанию)'); break;
56 case "name_up": sel.html('По имени (возрастание)'); break; 56 case "name_up": sel.html('По имени (возрастание)'); break;
57 case "name_down": sel.html('По дате (убывание)'); break; 57 case "name_down": sel.html('По дате (убывание)'); break;
58 case "created_at_up": sel.html('По дате (возрастание)'); break; 58 case "created_at_up": sel.html('По дате (возрастание)'); break;
59 case "created_at_down": sel.html('По дате (убывание)'); break; 59 case "created_at_down": sel.html('По дате (убывание)'); break;
60 } 60 }
61 61
62 } 62 }
63 }); 63 });
64 </script> 64 </script>
65 @endsection 65 @endsection
66 66
67 @section('content') 67 @section('content')
68 <section class="thing"> 68 <section class="thing">
69 <div class="container"> 69 <div class="container">
70 <form class="thing__body"> 70 <form class="thing__body">
71 @csrf 71 @csrf
72 <ul class="breadcrumbs thing__breadcrumbs"> 72 <ul class="breadcrumbs thing__breadcrumbs">
73 <li><a href="{{ route('index') }}">Главная</a></li> 73 <li><a href="{{ route('index') }}">Главная</a></li>
74 <li><b>Работодатели</b></li> 74 <li><b>Судоходные компании</b></li>
75 </ul> 75 </ul>
76 <h1 class="thing__title">Работодатели</h1> 76 <h1 class="thing__title">Судоходные компании</h1>
77 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для 77 <p class="thing__text">
78 существующих финансовых и административных условий.</p> 78 В данном разделе представлены компании объявления от которых Вы можете увидеть на сайте
79
80 Галочка "Компания одобрена сервисом rekamore.su" выдается компании в чьей репутации мы уверены, компания работает не первый год и у нее нет задержек по заработной плате
81
82 Компании без галочки не стоит игнорировать, возможно она находится на проверке и в скором времени галочка будет выдана
83
84 Мы очень дорожим нашей репутацией и стараемся оградить моряков от недобросовестных работодателей
85 </p>
79 <div class="search thing__search"> 86 <div class="search thing__search">
80 <input type="search" id="search" name="search" class="input" value="{{ (isset($_GET['search'])) ? $_GET['search'] : '' }}" placeholder="Введите наименование работодателя"> 87 <input type="search" id="search" name="search" class="input" value="{{ (isset($_GET['search'])) ? $_GET['search'] : '' }}" placeholder="Введите наименование работодателя">
81 <button type="submit" class="button">Найти</button> 88 <button type="submit" class="button">Найти</button>
82 <span> 89 <span>
83 <svg> 90 <svg>
84 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 91 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
85 </svg> 92 </svg>
86 </span> 93 </span>
87 </div> 94 </div>
88 </form> 95 </form>
89 </div> 96 </div>
90 </section> 97 </section>
91 <main class="main"> 98 <main class="main">
92 <div class="container"> 99 <div class="container">
93 <div class="main__employers"> 100 <div class="main__employers">
94 <div class="filters"> 101 <div class="filters">
95 <div class="filters__label">Показано {{ $emps->firstItem() }} – {{ $emps->lastItem() }} из {{ $count_emps }} результатов поиска</div> 102 <div class="filters__label">Показано {{ $emps->firstItem() }} – {{ $emps->lastItem() }} из {{ $count_emps }} результатов поиска</div>
96 <div class="filters__body"> 103 <div class="filters__body">
97 <div class="select filters__select"> 104 <div class="select filters__select">
98 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 105 <select class="js-select2" id="sort_ajax" name="sort_ajax">
99 <option value="default">Сортировка (по умолчанию)</option> 106 <option value="default">Сортировка (по умолчанию)</option>
100 <option value="name_up">По имени (возрастание)</option> 107 <option value="name_up">По имени (возрастание)</option>
101 <option value="name_down">По имени (убывание)</option> 108 <option value="name_down">По имени (убывание)</option>
102 <option value="created_at_up">По дате (возрастание)</option> 109 <option value="created_at_up">По дате (возрастание)</option>
103 <option value="created_at_down">По дате (убывание)</option> 110 <option value="created_at_down">По дате (убывание)</option>
104 </select> 111 </select>
105 </div> 112 </div>
106 <button type="button" class="filters__item active" data-tab="1"> 113 <button type="button" class="filters__item active" data-tab="1">
107 <svg> 114 <svg>
108 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use> 115 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use>
109 </svg> 116 </svg>
110 </button> 117 </button>
111 <button type="button" class="filters__item" data-tab="2"> 118 <button type="button" class="filters__item" data-tab="2">
112 <svg> 119 <svg>
113 <use xlink:href="{{ asset('images/sprite.svg#grid-2') }}"></use> 120 <use xlink:href="{{ asset('images/sprite.svg#grid-2') }}"></use>
114 </svg> 121 </svg>
115 </button> 122 </button>
116 </div> 123 </div>
117 </div> 124 </div>
118 <div class="main__employers-body showed" data-body="1" id="block_1" name="block_1"> 125 <div class="main__employers-body showed" data-body="1" id="block_1" name="block_1">
119 <div class="main__employers-one"> 126 <div class="main__employers-one">
120 @if ($emps->count()) 127 @if ($emps->count())
121 @foreach($emps as $emp) 128 @foreach($emps as $emp)
122 <div class="main__employers-item"> 129 <div class="main__employers-item">
123 <span class="main__employers-item-inner"> 130 <span class="main__employers-item-inner">
124 @if (!empty($emp->logo)) 131 @if (!empty($emp->logo))
125 <a href="{{ route('info_company', ['company' => $emp->id]) }}"> 132 <a href="{{ route('info_company', ['company' => $emp->id]) }}">
126 <img src="{{ asset(Storage::url($emp->logo)) }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic"> 133 <img src="{{ asset(Storage::url($emp->logo)) }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic">
127 </a> 134 </a>
128 @else 135 @else
129 <a href="{{ route('info_company', ['company' => $emp->id]) }}"> 136 <a href="{{ route('info_company', ['company' => $emp->id]) }}">
130 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic"> 137 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic">
131 </a> 138 </a>
132 @endif 139 @endif
133 <span class="main__employers-item-body"> 140 <span class="main__employers-item-body">
134 <b>{{ $emp->name_company }}</b> 141 <b>{{ $emp->name_company }}</b>
135 <i>{{ $emp->ads->count() }} вакансия(ий)</i> 142 <i>{{ $emp->ads->count() }} вакансия(ий)</i>
136 </span> 143 </span>
137 </span> 144 </span>
138 <a href="{{ route('info_company', ['company' => $emp->id]) }}" class="button button_light main__employers-item-more">Подробнее</a> 145 <a href="{{ route('info_company', ['company' => $emp->id]) }}" class="button button_light main__employers-item-more">Подробнее</a>
139 146
140 @if ($emp->oficial_status == 1) 147 @if ($emp->oficial_status == 1)
141 <span class="main__employers-item-label"> 148 <span class="main__employers-item-label">
142 <svg> 149 <svg>
143 <use xlink:href="images/sprite.svg#v"></use> 150 <use xlink:href="images/sprite.svg#v"></use>
144 </svg> 151 </svg>
145 <span>Компания одобрена сервисом rekamore.su</span> 152 <span>Компания одобрена сервисом rekamore.su</span>
146 </span> 153 </span>
147 @endif 154 @endif
148 </div> 155 </div>
149 @endforeach 156 @endforeach
150 </div> 157 </div>
151 158
152 {{ $emps->appends($_GET)->links('paginate') }} 159 {{ $emps->appends($_GET)->links('paginate') }}
153 160
154 @else 161 @else
155 <H2>Нет данных</H2> 162 <H2>Нет данных</H2>
156 @endif 163 @endif
157 164
158 </div> 165 </div>
159 <div class="main__employers-body" data-body="2" id="block_2" name="block_2"> 166 <div class="main__employers-body" data-body="2" id="block_2" name="block_2">
160 @if ($emps->count()) 167 @if ($emps->count())
161 <div class="main__employers-two"> 168 <div class="main__employers-two">
162 @foreach($emps as $emp) 169 @foreach($emps as $emp)
163 <div class="main__employers-item"> 170 <div class="main__employers-item">
164 <span class="main__employers-item-inner"> 171 <span class="main__employers-item-inner">
165 @if (!empty($emp->logo)) 172 @if (!empty($emp->logo))
166 <img src="{{ asset(Storage::url($emp->logo)) }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic"> 173 <img src="{{ asset(Storage::url($emp->logo)) }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic">
167 @else 174 @else
168 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic"> 175 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic">
169 @endif 176 @endif
170 <span class="main__employers-item-body"> 177 <span class="main__employers-item-body">
171 <b>{{ $emp->name_company }}</b> 178 <b>{{ $emp->name_company }}</b>
172 <i>{{ $emp->ads->count() }} вакансия(ий)</i> 179 <i>{{ $emp->ads->count() }} вакансия(ий)</i>
173 </span> 180 </span>
174 </span> 181 </span>
175 <a href="{{ route('info_company', ['company' => $emp->id]) }}" class="button button_light main__employers-item-more">Подробнее</a> 182 <a href="{{ route('info_company', ['company' => $emp->id]) }}" class="button button_light main__employers-item-more">Подробнее</a>
176 @if ($emp->oficial_status == 1) 183 @if ($emp->oficial_status == 1)
177 <span class="main__employers-item-label"> 184 <span class="main__employers-item-label">
178 <svg> 185 <svg>
179 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use> 186 <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use>
180 </svg> 187 </svg>
181 <span>Компания одобрена сервисом rekamore.su</span> 188 <span>Компания одобрена сервисом rekamore.su</span>
182 </span> 189 </span>
183 @endif 190 @endif
184 </div> 191 </div>
185 @endforeach 192 @endforeach
186 </div> 193 </div>
187 {{ $emps->appends($_GET)->onEachSide(0)->links('paginate') }} 194 {{ $emps->appends($_GET)->onEachSide(0)->links('paginate') }}
188 @else 195 @else
189 <H2>Нет данных</H2> 196 <H2>Нет данных</H2>
190 @endif 197 @endif
191 </div> 198 </div>
192 </div> 199 </div>
193 </div> 200 </div>
194 </main> 201 </main>
195 @endsection 202 @endsection
196 203
resources/views/education/index.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 $(document).on('change', '#sort_ajax', function() { 5 $(document).on('change', '#sort_ajax', function() {
6 var this_ = $(this); 6 var this_ = $(this);
7 var val_ = this_.val(); 7 var val_ = this_.val();
8 console.log('sort items '+val_); 8 console.log('sort items '+val_);
9 9
10 $.ajax({ 10 $.ajax({
11 type: "GET", 11 type: "GET",
12 url: "{{ route('education') }}", 12 url: "{{ route('education') }}",
13 data: "sort="+val_+"&block=1", 13 data: "sort="+val_+"&block=1",
14 success: function (data) { 14 success: function (data) {
15 console.log('Выбор сортировки'); 15 console.log('Выбор сортировки');
16 console.log(data); 16 console.log(data);
17 $('#block').html(data); 17 $('#block').html(data);
18 history.pushState({}, '', "{{ route('education') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 18 history.pushState({}, '', "{{ route('education') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
19 }, 19 },
20 headers: { 20 headers: {
21 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 21 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
22 }, 22 },
23 error: function (data) { 23 error: function (data) {
24 data = JSON.stringify(data); 24 data = JSON.stringify(data);
25 console.log('Error: ' + data); 25 console.log('Error: ' + data);
26 } 26 }
27 }); 27 });
28 }); 28 });
29 29
30 $(document).ready(function(){ 30 $(document).ready(function(){
31 var sel = $('#select2-sort_ajax-container'); 31 var sel = $('#select2-sort_ajax-container');
32 var key = getUrlParameter('sort'); 32 var key = getUrlParameter('sort');
33 33
34 if (key !=='') { 34 if (key !=='') {
35 switch (key) { 35 switch (key) {
36 case "default": sel.html('Сортировка (по умолчанию)'); break; 36 case "default": sel.html('Сортировка (по умолчанию)'); break;
37 case "name_up": sel.html('По имени (возрастание)'); break; 37 case "name_up": sel.html('По имени (возрастание)'); break;
38 case "name_down": sel.html('По дате (убывание)'); break; 38 case "name_down": sel.html('По дате (убывание)'); break;
39 case "created_at_up": sel.html('По дате (возрастание)'); break; 39 case "created_at_up": sel.html('По дате (возрастание)'); break;
40 case "created_at_down": sel.html('По дате (убывание)'); break; 40 case "created_at_down": sel.html('По дате (убывание)'); break;
41 } 41 }
42 42
43 } 43 }
44 }); 44 });
45 </script> 45 </script>
46 @endsection 46 @endsection
47 47
48 @section('content') 48 @section('content')
49 <section class="thing"> 49 <section class="thing">
50 <div class="container"> 50 <div class="container">
51 <form class="thing__body" active="{{ route('education') }}"> 51 <form class="thing__body" active="{{ route('education') }}">
52 <ul class="breadcrumbs thing__breadcrumbs"> 52 <ul class="breadcrumbs thing__breadcrumbs">
53 <li><a href="{{ route('index') }}">Главная</a></li> 53 <li><a href="{{ route('index') }}">Главная</a></li>
54 <li><b>Образование</b></li> 54 <li><b>Образование</b></li>
55 </ul> 55 </ul>
56 <h1 class="thing__title">Образование</h1> 56 <h1 class="thing__title">Образование</h1>
57 <p class="thing__text">Прежде всего, современная методология разработки представляет собой интересный эксперимент проверки направлений прогрессивного развития.</p> 57 <p class="thing__text">
58 В данном разделе представлены образовательные учреждения (ОУ) и учебно-тренажерные центры (УТЦ)
59
60 С услугами и ценами Вы можете ознакомиться перейдя в профиль ОУ или УТЦ
61 </p>
58 <div class="search thing__search"> 62 <div class="search thing__search">
59 <input type="search" class="input" id="search" name="search" placeholder="Введите наименование работодателя" value="@if (!empty($_GET['search'])) {{ $_GET['search'] }} @endif"> 63 <input type="search" class="input" id="search" name="search" placeholder="Введите наименование работодателя" value="@if (!empty($_GET['search'])) {{ $_GET['search'] }} @endif">
60 <button type="submit" class="button">Найти</button> 64 <button type="submit" class="button">Найти</button>
61 <span> 65 <span>
62 <svg> 66 <svg>
63 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 67 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
64 </svg> 68 </svg>
65 </span> 69 </span>
66 </div> 70 </div>
67 </form> 71 </form>
68 </div> 72 </div>
69 </section> 73 </section>
70 <main class="main"> 74 <main class="main">
71 <div class="container"> 75 <div class="container">
72 <div class="filters"> 76 <div class="filters">
73 <div class="filters__label">Показано {{ $educations->firstItem() }} – {{ $educations->lastItem() }} из {{ $count_edu }} результатов поиска</div> 77 <div class="filters__label">Показано {{ $educations->firstItem() }} – {{ $educations->lastItem() }} из {{ $count_edu }} результатов поиска</div>
74 <div class="filters__body"> 78 <div class="filters__body">
75 <div class="select filters__select"> 79 <div class="select filters__select">
76 <select class="js-select2" id="sort_ajax" name="sort_ajax"> 80 <select class="js-select2" id="sort_ajax" name="sort_ajax">
77 <option value="default">Сортировка (по умолчанию)</option> 81 <option value="default">Сортировка (по умолчанию)</option>
78 <option value="name_up">По имени (возрастание)</option> 82 <option value="name_up">По имени (возрастание)</option>
79 <option value="name_down">По имени (убывание)</option> 83 <option value="name_down">По имени (убывание)</option>
80 <option value="created_at_up">По дате (возрастание)</option> 84 <option value="created_at_up">По дате (возрастание)</option>
81 <option value="created_at_down">По дате (убывание)</option> 85 <option value="created_at_down">По дате (убывание)</option>
82 </select> 86 </select>
83 </div> 87 </div>
84 </div> 88 </div>
85 </div> 89 </div>
86 90
87 <div class="main__ads" id="block" name="block"> 91 <div class="main__ads" id="block" name="block">
88 @if ($educations->count()) 92 @if ($educations->count())
89 @foreach($educations as $edu) 93 @foreach($educations as $edu)
90 <div class="main__ads-item"> 94 <div class="main__ads-item">
91 <div class="main__ads-item-pic"> 95 <div class="main__ads-item-pic">
92 <img src="@if (!empty($edu->image)) {{ asset(Storage::url($edu->image)) }} @else {{ asset('images/education.jpg') }} @endif" alt="{{ $edu->name }}"> 96 <img src="@if (!empty($edu->image)) {{ asset(Storage::url($edu->image)) }} @else {{ asset('images/education.jpg') }} @endif" alt="{{ $edu->name }}">
93 </div> 97 </div>
94 <div class="main__ads-item-body"> 98 <div class="main__ads-item-body">
95 <b>{{ $edu->name }}</b> 99 <b>{{ $edu->name }}</b>
96 <span>{{ $edu->program_education->count() }} учебных направлений</span> 100 <span>{{ $edu->program_education->count() }} учебных направлений</span>
97 <a href="{{ route('show_education', ['education' => $edu->id]) }}" class="button button_light">Читать далее</a> 101 <a href="{{ route('show_education', ['education' => $edu->id]) }}" class="button button_light">Читать далее</a>
98 </div> 102 </div>
99 </div> 103 </div>
100 @endforeach 104 @endforeach
101 105
102 {{ $educations->appends($_GET)->links('paginate') }} 106 {{ $educations->appends($_GET)->links('paginate') }}
103 @else 107 @else
104 <H2>Нет данных</H2> 108 <H2>Нет данных</H2>
105 @endif 109 @endif
106 </div> 110 </div>
107 111
108 <!--<div class="pagination"> 112 <!--<div class="pagination">
109 <a href="#" class="pagination__nav pagination__nav_prev"> 113 <a href="#" class="pagination__nav pagination__nav_prev">
110 <svg> 114 <svg>
111 <use xlink:href="images/sprite.svg#arrow-bold"></use> 115 <use xlink:href="images/sprite.svg#arrow-bold"></use>
112 </svg> 116 </svg>
113 </a> 117 </a>
114 <span class="pagination__item active">1</span> 118 <span class="pagination__item active">1</span>
115 <a href="#" class="pagination__item">2</a> 119 <a href="#" class="pagination__item">2</a>
116 <a href="#" class="pagination__item">3</a> 120 <a href="#" class="pagination__item">3</a>
117 <a href="#" class="pagination__item">4</a> 121 <a href="#" class="pagination__item">4</a>
118 <a href="#" class="pagination__item">5</a> 122 <a href="#" class="pagination__item">5</a>
119 <span class="pagination__dots"> 123 <span class="pagination__dots">
120 <svg> 124 <svg>
121 <use xlink:href="images/sprite.svg#dots"></use> 125 <use xlink:href="images/sprite.svg#dots"></use>
122 </svg> 126 </svg>
123 </span> 127 </span>
124 <a href="#" class="pagination__item">25</a> 128 <a href="#" class="pagination__item">25</a>
125 <a href="#" class="pagination__nav pagination__nav_next"> 129 <a href="#" class="pagination__nav pagination__nav_next">
126 <svg> 130 <svg>
127 <use xlink:href="images/sprite.svg#arrow-bold"></use> 131 <use xlink:href="images/sprite.svg#arrow-bold"></use>
128 </svg> 132 </svg>
129 </a> 133 </a>
130 </div>--> 134 </div>-->
131 </div> 135 </div>
132 </main> 136 </main>
133 </div> 137 </div>
134 @endsection 138 @endsection
135 139
resources/views/index.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 @include('messages_error') 8 @include('messages_error')
9 <section class="work"> 9 <section class="work">
10 <div class="container"> 10 <div class="container">
11 <img src="{{ asset('images/1.png') }}" alt="" class="work__pic"> 11 <img src="{{ asset('images/1.png') }}" alt="" class="work__pic">
12 <div class="work__body"> 12 <div class="work__body">
13 <div class="work__title"> 13 <div class="work__title">
14 <h4>Работа в море / 14 <h4>Работа в море /
15 <span class="br">Работа на реке</span></h4> 15 <span class="br">Работа на реке</span></h4>
16 </div> 16 </div>
17 <div class="work__text">Профессиональная сеть морского сообщества «RekaMore.su» приветствует вас — 17 <div class="work__text">Информационный портал rekamore.su - место где работники морского и речного флота могут найти для себя хорошую работу,
18 тех, кто не представляет себе жизнь без моря, тех, кто готов связать свою жизнь с работой в 18 а работодатели отличных специалистов
19 сложных, но очень интересных условиях. </div> 19 </div>
20 <div class="work__list"> 20 <div class="work__list">
21 <div>Тысячи соискателей увидят Ваше объявление</div> 21 <div>Тысячи соискателей увидят Ваше объявление</div>
22 <div>Десятки компаний выкладывают объявления каждый день</div> 22 <div>Десятки компаний выкладывают объявления каждый день</div>
23 </div> 23 </div>
24 <form class="work__form width100 flex" action="{{ route('vacancies') }}" method="GET"> 24 <form class="work__form width100 flex" style="" action="{{ route('vacancies') }}" method="GET">
25 25
26 <div class="select select_search width100"> 26 <div class="select select_search" style="max-width: 60%">
27 <div class="select__icon"> 27 <div class="select__icon">
28 <svg> 28 <svg>
29 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 29 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
30 </svg> 30 </svg>
31 </div> 31 </div>
32 <select class="js-select2 jobs" id="job" name="job"> 32 <select class="js-select2 jobs" id="job" name="job">
33 <option value="0">Выберите должность</option> 33 <option value="0">Выберите должность</option>
34 @if ($Job_title->count()) 34 @if ($Job_title->count())
35 @foreach($Job_title as $JT) 35 @foreach($Job_title as $JT)
36 <option value="{{ $JT->id }}" @if ((isset($_GET['job'])) && ($_GET['job'] == $JT->id)) selected @endif>{{ $JT->name }}</option> 36 <option value="{{ $JT->id }}" @if ((isset($_GET['job'])) && ($_GET['job'] == $JT->id)) selected @endif>{{ $JT->name }}</option>
37 @endforeach 37 @endforeach
38 @endif 38 @endif
39 </select> 39 </select>
40 </div> 40 </div>
41 41
42 <button type="submit" class="button button_light" style="height: auto;">Посмотреть&nbsp;вакансии</button> 42 <button type="submit" class="button button_light" style="height: auto;">Посмотреть&nbsp;вакансии</button>
43 </form> 43 </form>
44 @guest 44 @guest
45 <a data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' class="button work__search">Я ищу сотрудника</a> 45 <a data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' class="button work__search">Я ищу сотрудника</a>
46 @else 46 @else
47 @if (Auth()->user()->is_lookin) 47 @if (Auth()->user()->is_lookin)
48 <a href="{{ route('bd_resume') }}" class="button work__search">Я ищу сотрудника</a> 48 <a href="{{ route('bd_resume') }}" class="button work__search">Я ищу сотрудника</a>
49 @else 49 @else
50 <a data-fancybox data-src="#question3" data-options='{"touch":false,"autoFocus":false}' class="button work__search">Я ищу сотрудника</a> 50 <a data-fancybox data-src="#question3" data-options='{"touch":false,"autoFocus":false}' class="button work__search">Я ищу сотрудника</a>
51 @endif 51 @endif
52 @endguest 52 @endguest
53 <div class="work__get"> 53 <div class="work__get">
54 <b>Скачать приложение</b> 54 <b>Скачать приложение</b>
55 <a href=""> 55 <a href="">
56 <img src="{{ asset('images/google.svg') }}" alt=""> 56 <img src="{{ asset('images/google.svg') }}" alt="">
57 </a> 57 </a>
58 <a href=""> 58 <a href="">
59 <img src="{{ asset('images/apple.svg') }}" alt=""> 59 <img src="{{ asset('images/apple.svg') }}" alt="">
60 </a> 60 </a>
61 </div> 61 </div>
62 </div> 62 </div>
63 </div> 63 </div>
64 </section> 64 </section>
65 65
66 @if ($blocks_counters) 66 @if ($blocks_counters)
67 <section class="numbers"> 67 <section class="numbers">
68 <div class="container"> 68 <div class="container">
69 <div class="numbers__body"> 69 <div class="numbers__body">
70 @foreach($blocks_counters as $block_counter) 70 @foreach($blocks_counters as $block_counter)
71 <div class="numbers__item"> 71 <div class="numbers__item">
72 <b>{{$block_counter['extra']}}</b> 72 <b>{{$block_counter['extra']}}</b>
73 <span>{{$block_counter['title']}}</span> 73 <span>{{$block_counter['title']}}</span>
74 {{$block_counter['description']}} 74 {{$block_counter['description']}}
75 </div> 75 </div>
76 @endforeach 76 @endforeach
77 </div> 77 </div>
78 </div> 78 </div>
79 </section> 79 </section>
80 @endif 80 @endif
81 81
82 <main class="main"> 82 <main class="main">
83 <div class="container"> 83 <div class="container">
84 <div class="main__vacancies"> 84 <div class="main__vacancies">
85 <h2 class="main__vacancies-title">Категории вакансий</h2> 85 <h2 class="main__vacancies-title">Категории вакансий</h2>
86 <div class="vacancies__body"> 86 <div class="vacancies__body">
87 <div class="vacancies__list" id="block_ajax" name="block_ajax"> 87 <div class="vacancies__list" id="block_ajax" name="block_ajax">
88 @foreach($Main_Job as $key => $it_main) 88 @foreach($Main_Job as $key => $it_main)
89 <div class="vacancies__list-col"> 89 <div class="vacancies__list-col">
90 @include('block_real_new', ['it_main' => $it_main, 'category' => $key]) 90 @include('block_real_new', ['it_main' => $it_main, 'category' => $key])
91 </div> 91 </div>
92 @endforeach 92 @endforeach
93 <!--_include('block_real', ['flot' => $flot, 'position' => $Position[$flot->position_id]])--> 93 <!--_include('block_real', ['flot' => $flot, 'position' => $Position[$flot->position_id]])-->
94 </div> 94 </div>
95 </div> 95 </div>
96 </div> 96 </div>
97 </div> 97 </div>
98 </main> 98 </main>
99 99
100 <section class="employer"> 100 <section class="employer">
101 <div class="container"> 101 <div class="container">
102 <div class="title"><h4>Работодатели</h4></div> 102 <div class="title"><h4>Работодатели</h4></div>
103 103
104 <div class="employer__body"> 104 <div class="employer__body">
105 @if ($employers->count()) 105 @if ($employers->count())
106 @foreach($employers as $emp) 106 @foreach($employers as $emp)
107 @if (!empty($emp->employer->logo)) 107 @if (!empty($emp->employer->logo))
108 <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}"> 108 <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}">
109 <img src="{{ asset(Storage::url($emp->employer->logo)) }}" alt="{{ $emp->employer->name_company }}"> 109 <img src="{{ asset(Storage::url($emp->employer->logo)) }}" alt="{{ $emp->employer->name_company }}">
110 </a> 110 </a>
111 @else 111 @else
112 <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}"> 112 <a href="{{ route('info_company', ['company' => $emp->employer->id]) }}">
113 <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $emp->employer->name_company }}"> 113 <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $emp->employer->name_company }}">
114 </a> 114 </a>
115 @endif 115 @endif
116 @endforeach 116 @endforeach
117 @else 117 @else
118 <h5>Тут нет никаких записей</h5> 118 <h5>Тут нет никаких записей</h5>
119 @endif 119 @endif
120 </div> 120 </div>
121 121
122 <div class="swiper-pagination"></div> 122 <div class="swiper-pagination"></div>
123 </div> 123 </div>
124 <a href="{{ route('shipping_companies') }}" class="employer__more button button_light">Все работодатели</a> 124 <a href="{{ route('shipping_companies') }}" class="employer__more button button_light">Все работодатели</a>
125 125
126 </section> 126 </section>
127 <section class="about"> 127 <section class="about">
128 <div class="container"> 128 <div class="container">
129 <div class="about__wrapper"> 129 <div class="about__wrapper">
130 <div class="title about__title"><h4>О нас</h4></div> 130 <div class="title about__title"><h4>О нас</h4></div>
131 <div class="about__body"> 131 <div class="about__body">
132 <div class="about__line"></div> 132 <div class="about__line"></div>
133 <div class="about__item"> 133 <div class="about__item">
134 <b>Для работодателей</b> 134 <b>Для работодателей</b>
135 <span>Наш ресурс позволит Вам за демократичную цену найти нужных специалистов в кратчайшие 135 <span>
136 сроки, подробнее об условиях можно узнать <a href="{{ route('page', ['pages' => 'Stoimost-razmescheniya']) }}">здесь</a>.</span> 136 Нашим ресурсом пользуются более 150 судоходных компаний России и СНГ, в настоящее время мы самая эффективная площадка.
137 Подробности о работе сервиса и стоимости обслуживания можно получить перейдя по ссылке
138 <a href="{{ route('page', ['pages' => 'Stoimost-razmescheniya']) }}">здесь</a>.
139 </span>
137 <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('bd_resume') }}">Поиск сотрудников</a> 140 <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('bd_resume') }}">Поиск сотрудников</a>
138 </div> 141 </div>
139 <div class="about__item"> 142 <div class="about__item">
140 <b>Для сотрудников</b> 143 <b>Для сотрудников</b>
141 <span>Наше преимущество — это большой объем вакансий, более 70 судоходных компаний России и 144 <span>
142 СНГ ищут сотрудников через наши ресурсы</span> 145 Работа найдется для каждого, а удобная фильтрация вакансий по должностям сделает поиск приятным
146 </span>
143 <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('vacancies') }}">Ищу работу</a> 147 <a class="about__button button button_whited" style="text-decoration: none" href="{{ route('vacancies') }}">Ищу работу</a>
144 </div> 148 </div>
145 </div> 149 </div>
146 </div> 150 </div>
147 </div> 151 </div>
148 </section> 152 </section>
149 153
150 @if ($news->count()) 154 @if ($news->count())
151 <section class="news"> 155 <section class="news">
152 <div class="container"> 156 <div class="container">
153 <div class="news__toper"> 157 <div class="news__toper">
154 <div class="title"><h4>Новости и статьи</h4></div> 158 <div class="title"><h4>Новости и статьи</h4></div>
155 <div class="navs"> 159 <div class="navs">
156 <button class="js-news-swiper-button-prev"> 160 <button class="js-news-swiper-button-prev">
157 <svg class="rotate180"> 161 <svg class="rotate180">
158 <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> 162 <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use>
159 </svg> 163 </svg>
160 </button> 164 </button>
161 <button class="js-news-swiper-button-next"> 165 <button class="js-news-swiper-button-next">
162 <svg> 166 <svg>
163 <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use> 167 <use xlink:href="{{ asset('images/sprite.svg#arrow') }}"></use>
164 </svg> 168 </svg>
165 </button> 169 </button>
166 </div> 170 </div>
167 </div> 171 </div>
168 172
169 <div class="swiper js-news-swiper"> 173 <div class="swiper js-news-swiper">
170 <div class="swiper-wrapper"> 174 <div class="swiper-wrapper">
171 175
172 @foreach ($news as $new) 176 @foreach ($news as $new)
173 <div class="swiper-slide"> 177 <div class="swiper-slide">
174 <div class="news__item"> 178 <div class="news__item">
175 @if (empty($new->image)) 179 @if (empty($new->image))
176 <img src="{{ asset('/images/default_ship.jpg') }}" alt="" class="news__item-pic"> 180 <img src="{{ asset('/images/default_ship.jpg') }}" alt="" class="news__item-pic">
177 @else 181 @else
178 <img src="{{ asset(Storage::url($new->image)) }}" alt="" class="news__item-pic"> 182 <img src="{{ asset(Storage::url($new->image)) }}" alt="" class="news__item-pic">
179 @endif 183 @endif
180 <div class="news__item-body"> 184 <div class="news__item-body">
181 <time datetime="{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}" class="news__item-date">{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}</time> 185 <time datetime="{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}" class="news__item-date">{{ date('d.m.Y H:i:s', strtotime($new->created_at)) }}</time>
182 <span class="news__item-title">{{ $new->title }}</span> 186 <span class="news__item-title">{{ $new->title }}</span>
183 <span class="news__item-text">{!! mb_strimwidth($new->text, 0, 100) !!}</span> 187 <span class="news__item-text">{!! mb_strimwidth($new->text, 0, 100) !!}</span>
184 <a href="{{ route('detail_new', ['new' => $new->id]) }}" class="news__item-more button button_light">Читать далее</a> 188 <a href="{{ route('detail_new', ['new' => $new->id]) }}" class="news__item-more button button_light">Читать далее</a>
185 </div> 189 </div>
186 </div> 190 </div>
187 </div> 191 </div>
188 @endforeach 192 @endforeach
189 193
190 </div> 194 </div>
191 <div class="swiper-pagination"></div> 195 <div class="swiper-pagination"></div>
192 </div> 196 </div>
193 <a href="{{ route('news') }}" class="news__all button button_light">Все новости</a> 197 <a href="{{ route('news') }}" class="news__all button button_light">Все новости</a>
194 198
195 </div> 199 </div>
196 </section> 200 </section>
197 @endif 201 @endif
198 202
199 <section class="info"> 203 <section class="info">
200 <div class="container"> 204 <div class="container">
201 <img src="images/5.png" alt="" class="info__pic"> 205 <img src="images/5.png" alt="" class="info__pic">
202 <div class="info__body"> 206 <div class="info__body">
203 <div class="title info__title"><h4>Мы в социальных сетях</h4></div> 207 <div class="title info__title"><h4>Мы в социальных сетях</h4></div>
204 <div class="info__item"> 208 <div class="info__item">
205 <div class="info__text">Телеграм — Подпишитесь на наш телеграм канал и получайте уведомления о 209 <div class="info__text">
206 новых вакансиях прямо на свой смартфон</div> 210 Телеграм — Подпишитесь на наш телеграм канал и получайте уведомления о новых вакансиях прямо на свой смартфон
211 </div>
207 <a href="{{ $companies[0]->telegram }}" class="info__link" style="background:#20A0E1"> 212 <a href="{{ $companies[0]->telegram }}" class="info__link" style="background:#20A0E1">
208 <svg> 213 <svg>
209 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> 214 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use>
210 </svg> 215 </svg>
211 Телеграм 216 Телеграм
212 </a> 217 </a>
213 </div> 218 </div>
214 <div class="info__item"> 219 <div class="info__item">
215 <div class="info__text">ВКонтакте — Лучшие вакансии за неделю выкладываем именно тут, информация 220 <div class="info__text">
216 о судоходных компаниях, инструкции по работе с сайтом, конкурсы и многое другое</div> 221 Вконтакте — Сообщество работников морского и речного флота, актуальная подборка вакансий
222 </div>
217 <a href="{{ $companies[0]->vkontact }}" class="info__link" style="background:#2787F5"> 223 <a href="{{ $companies[0]->vkontact }}" class="info__link" style="background:#2787F5">
218 <svg> 224 <svg>
219 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> 225 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use>
220 </svg> 226 </svg>
221 ВКонтакте 227 ВКонтакте
222 </a> 228 </a>
223 </div> 229 </div>
224 </div> 230 </div>
225 </div> 231 </div>
226 </section> 232 </section>
227 @endsection 233 @endsection
228 234
resources/views/info_company_new.blade.php
1 @extends('layout.frontend', ['title' => 'Описание компании '.$title.'- РекаМоре']) 1 @extends('layout.frontend', ['title' => 'Описание компании '.$title.'- РекаМоре'])
2 2
3 @section('scripts') 3 @section('scripts')
4 <script> 4 <script>
5 $(document).on('change', '#sort_ajax', function() { 5 $(document).on('change', '#sort_ajax', function() {
6 var this_ = $(this); 6 var this_ = $(this);
7 var val_ = this_.val(); 7 var val_ = this_.val();
8 console.log('sort items '+val_); 8 console.log('sort items '+val_);
9 9
10 $.ajax({ 10 $.ajax({
11 type: "GET", 11 type: "GET",
12 url: "{{ route('shipping_companies') }}", 12 url: "{{ route('shipping_companies') }}",
13 data: "sort="+val_+"&block=1", 13 data: "sort="+val_+"&block=1",
14 success: function (data) { 14 success: function (data) {
15 console.log('Выбор сортировки'); 15 console.log('Выбор сортировки');
16 console.log(data); 16 console.log(data);
17 $('#block_1').html(data); 17 $('#block_1').html(data);
18 }, 18 },
19 headers: { 19 headers: {
20 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 20 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
21 }, 21 },
22 error: function (data) { 22 error: function (data) {
23 data = JSON.stringify(data); 23 data = JSON.stringify(data);
24 console.log('Error: ' + data); 24 console.log('Error: ' + data);
25 } 25 }
26 }); 26 });
27 27
28 $.ajax({ 28 $.ajax({
29 type: "GET", 29 type: "GET",
30 url: "{{ route('shipping_companies') }}", 30 url: "{{ route('shipping_companies') }}",
31 data: "sort="+val_+"&block=2", 31 data: "sort="+val_+"&block=2",
32 success: function (data) { 32 success: function (data) {
33 console.log('Выбор сортировки2'); 33 console.log('Выбор сортировки2');
34 console.log(data); 34 console.log(data);
35 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 35 history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
36 $('#block_2').html(data); 36 $('#block_2').html(data);
37 }, 37 },
38 headers: { 38 headers: {
39 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 39 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
40 }, 40 },
41 error: function (data) { 41 error: function (data) {
42 data = JSON.stringify(data); 42 data = JSON.stringify(data);
43 console.log('Error: ' + data); 43 console.log('Error: ' + data);
44 } 44 }
45 }); 45 });
46 }); 46 });
47 47
48 $(document).ready(function(){ 48 $(document).ready(function(){
49 var sel = $('#select2-sort_ajax-container'); 49 var sel = $('#select2-sort_ajax-container');
50 var key = getUrlParameter('sort'); 50 var key = getUrlParameter('sort');
51 if (key !=='') { 51 if (key !=='') {
52 console.log(key); 52 console.log(key);
53 switch (key) { 53 switch (key) {
54 case "default": sel.html('Сортировка (по умолчанию)'); break; 54 case "default": sel.html('Сортировка (по умолчанию)'); break;
55 case "name_up": sel.html('По имени (возрастание)'); break; 55 case "name_up": sel.html('По имени (возрастание)'); break;
56 case "name_down": sel.html('По дате (убывание)'); break; 56 case "name_down": sel.html('По дате (убывание)'); break;
57 case "created_at_up": sel.html('По дате (возрастание)'); break; 57 case "created_at_up": sel.html('По дате (возрастание)'); break;
58 case "created_at_down": sel.html('По дате (убывание)'); break; 58 case "created_at_down": sel.html('По дате (убывание)'); break;
59 } 59 }
60 60
61 } 61 }
62 }); 62 });
63 63
64 //end 64 //end
65 $(document).on('click', '.js_send_it_button', function() { 65 $(document).on('click', '.js_send_it_button', function() {
66 var this_ = $(this); 66 var this_ = $(this);
67 var code_user_id = this_.attr('data-uid'); 67 var code_user_id = this_.attr('data-uid');
68 var code_to_user_id = this_.attr('data-tuid'); 68 var code_to_user_id = this_.attr('data-tuid');
69 var code_vacancy = this_.attr('data-vacancy'); 69 var code_vacancy = this_.attr('data-vacancy');
70 var user_id = $('#send_user_id'); 70 var user_id = $('#send_user_id');
71 var to_user_id = $('#send_to_user_id'); 71 var to_user_id = $('#send_to_user_id');
72 var vacancy = $('#send_vacancy'); 72 var vacancy = $('#send_vacancy');
73 73
74 console.log('Клик на кнопки...'); 74 console.log('Клик на кнопки...');
75 75
76 user_id.val(code_user_id); 76 user_id.val(code_user_id);
77 to_user_id.val(code_to_user_id); 77 to_user_id.val(code_to_user_id);
78 vacancy.val(code_vacancy); 78 vacancy.val(code_vacancy);
79 }); 79 });
80 80
81 $("#list_button").on('click', function () { 81 $("#list_button").on('click', function () {
82 $('#flot').removeClass('active'); 82 $('#flot').removeClass('active');
83 $('#flot_list').removeClass('showed'); 83 $('#flot_list').removeClass('showed');
84 $('#vacancy').addClass('active'); 84 $('#vacancy').addClass('active');
85 $('#vacancy_list').addClass('showed'); 85 $('#vacancy_list').addClass('showed');
86 }) 86 })
87 </script> 87 </script>
88 @include('js.favorite-vacancy-45') 88 @include('js.favorite-vacancy-45')
89 @endsection 89 @endsection
90 90
91 @section('content') 91 @section('content')
92 <section class="thing"> 92 <section class="thing">
93 <div class="container"> 93 <div class="container">
94 <div class="thing__body"> 94 <div class="thing__body">
95 <ul class="breadcrumbs thing__breadcrumbs"> 95 <ul class="breadcrumbs thing__breadcrumbs">
96 <li><a href="{{ route('index') }}">Главная</a></li> 96 <li><a href="{{ route('index') }}">Главная</a></li>
97 <li><a href="{{ route('shipping_companies') }}">Работодатели</a></li> 97 <li><a href="{{ route('shipping_companies') }}">Работодатели</a></li>
98 <li><b>@isset($title) {{ $title }} @else Не указано @endif</b></li> 98 <li><b>@isset($title) {{ $title }} @else Не указано @endif</b></li>
99 </ul> 99 </ul>
100 @if ($company[0]->oficial_status == 1) 100 @if ($company[0]->oficial_status == 1)
101 <div class="thing__badge"> 101 <div class="thing__badge">
102 <svg> 102 <svg>
103 <use xlink:href="{{ asset('images/sprite.svg#badge') }}"></use> 103 <use xlink:href="{{ asset('images/sprite.svg#badge') }}"></use>
104 </svg> 104 </svg>
105 Компания проверена 105 Компания проверена
106 </div> 106 </div>
107 @endif 107 @endif
108 108
109 @if (!empty($company[0]->logo)) 109 @if (!empty($company[0]->logo))
110 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $company[0]->name_company }}" class="thing__pic"> 110 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $company[0]->name_company }}" class="thing__pic">
111 @else 111 @else
112 <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $company[0]->name_company }}" class="thing__pic"> 112 <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $company[0]->name_company }}" class="thing__pic">
113 @endif 113 @endif
114 114
115 <h1 class="thing__title">{{ $company[0]->name_company }}</h1> 115 <h1 class="thing__title">{{ $company[0]->name_company }}</h1>
116 <!--<p class="thing__text"> $company[0]->text !!}</p>--> 116 <!--<p class="thing__text"> $company[0]->text !!}</p>-->
117 <div class="thing__buttons"> 117 <div class="thing__buttons">
118 <a href="#vacancy" id="list_button"> 118 <a href="#vacancy" id="list_button">
119 <button type="button" class="button"> 119 <button type="button" class="button">
120 <svg> 120 <svg>
121 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use> 121 <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use>
122 </svg> 122 </svg>
123 {{ $company[0]->ads->count() }} вакансии 123 {{ $company[0]->ads->count() }} вакансии
124 </button> 124 </button>
125 </a> 125 </a>
126 @if ($user_id == 0) 126 @if ($user_id == 0)
127 <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button"> 127 <a data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button">
128 Написать сообщение 128 Написать сообщение
129 </a> 129 </a>
130 @else 130 @else
131 <button type="button" data-fancybox data-src="#send" data-vacancy="0" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}' 131 <button type="button" data-fancybox data-src="#send" data-vacancy="0" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}'
132 class="button js_send_it_button"> 132 class="button js_send_it_button">
133 Написать сообщение 133 Написать сообщение
134 </button> 134 </button>
135 @endif 135 @endif
136 </div> 136 </div>
137 </div> 137 </div>
138 </div> 138 </div>
139 </section> 139 </section>
140 <main class="main"> 140 <main class="main">
141 <div class="container"> 141 <div class="container">
142 <div class="main__employer-page"> 142 <div class="main__employer-page">
143 <h2 class="main__employer-page-title">О компании</h2> 143 <h2 class="main__employer-page-title">О компании</h2>
144 <div class="main__employer-page-info"> 144 <div class="main__employer-page-info">
145 <div class="main__employer-page-item"> 145 <div class="main__employer-page-item">
146 <b>Адрес компании</b> 146 <b>Адрес компании</b>
147 <span> 147 <span>
148 {{ $company[0]->address }} 148 {{ $company[0]->address }}
149 </span> 149 </span>
150 </div> 150 </div>
151 <div class="main__employer-page-item"> 151 <div class="main__employer-page-item">
152 <b>Сайт</b> 152 <b>Сайт</b>
153 <span> 153 <span>
154 <a href="{{ $company[0]->site }}">{{ $company[0]->site }}</a> 154 {{ $company[0]->site }}
155 </span> 155 </span>
156 </div> 156 </div>
157 <div class="main__employer-page-item"> 157 <div class="main__employer-page-item">
158 <b>Почта</b> 158 <b>Почта</b>
159 <span> 159 <span>
160 <a href="mailto:">{{ $company[0]->email }}</a> 160 {{ $company[0]->email }}
161 </span> 161 </span>
162 </div> 162 </div>
163 <div class="main__employer-page-item"> 163 <div class="main__employer-page-item">
164 <b>Телефон</b> 164 <b>Телефон</b>
165 <span> 165 <span>
166 <a href="tel:{{ $company[0]->telephone }}">{{ $company[0]->telephone }}</a> 166 {{ $company[0]->telephone }}
167 </span> 167 </span>
168 </div> 168 </div>
169 </div> 169 </div>
170 <div class="main__employer-page-info"> 170 <div class="main__employer-page-info">
171 <div class="main__employer-page-item"></div> 171 <div class="main__employer-page-item"></div>
172 <div class="main__employer-page-item"></div> 172 <div class="main__employer-page-item"></div>
173 <div class="main__employer-page-item"> 173 <div class="main__employer-page-item">
174 <b>Почта (alt)</b> 174 <b>Почта (alt)</b>
175 <span> 175 <span>
176 {{ $company[0]->email_2 }} 176 {{ $company[0]->email_2 }}
177 </span> 177 </span>
178 </div> 178 </div>
179 <div class="main__employer-page-item"> 179 <div class="main__employer-page-item">
180 <b>Телефон (alt)</b> 180 <b>Телефон (alt)</b>
181 <span> 181 <span>
182 <a href="{{ $company[0]->site }}">{{ $company[0]->telephone_2 }}</a> 182 {{ $company[0]->telephone_2 }}
183 </span> 183 </span>
184 </div> 184 </div>
185 </div> 185 </div>
186 186
187 <div class="main__employer-page-item main__employer-page-description"> 187 <div class="main__employer-page-item main__employer-page-description">
188 <b>Описание</b> 188 <b>Описание</b>
189 <span> 189 <span>
190 {!! $company[0]->text !!} 190 {!! $company[0]->text !!}
191 </span> 191 </span>
192 </div> 192 </div>
193 193
194 <div> 194 <div>
195
196 <div class="main__employer-page-tabs"> 195 <div class="main__employer-page-tabs">
197 <button id="flot" type="button" class="main__employer-page-tabs-item active" data-tab="1">Флот</button> 196 <button id="flot" type="button" class="main__employer-page-tabs-item active" data-tab="1">Флот</button>
198 <button id="vacancy" type="button" class="main__employer-page-tabs-item" data-tab="2">Вакансии</button> 197 <button id="vacancy" type="button" class="main__employer-page-tabs-item" data-tab="2">Вакансии</button>
199 </div> 198 </div>
200 199
201 <div class="main__employer-page-body"> 200 <div class="main__employer-page-body">
202 <div id="flot_list" class="main__employer-page-body-item showed" data-body="1"> 201 <div id="flot_list" class="main__employer-page-body-item showed" data-body="1">
203 <div class="main__employer-page-one"> 202 <div class="main__employer-page-one">
204 @if ($company[0]->flots->count()) 203 @if ($company[0]->flots->count())
205 @foreach ($company[0]->flots as $flot) 204 @foreach ($company[0]->flots as $flot)
206 <div class="main__employer-page-one-item flot-one-ship"> 205 <div class="main__employer-page-one-item flot-one-ship">
207 @if (!empty($flot->image)) 206 @if (!empty($flot->image))
208 <a href="{{ asset(Storage::url($flot->image)) }}" data-fancybox="gallery" class="review-image-modal"> 207 <a href="{{ asset(Storage::url($flot->image)) }}" data-fancybox="gallery" class="review-image-modal">
209 <img src="{{ asset(Storage::url($flot->image)) }}" alt="{{ $flot->name }}"> 208 <img src="{{ asset(Storage::url($flot->image)) }}" alt="{{ $flot->name }}">
210 </a> 209 </a>
211 @else 210 @else
212 <a href="{{ asset('images/default_ship.jpg') }}" data-fancybox="gallery" class="review-image-modal"> 211 <a href="{{ asset('images/default_ship.jpg') }}" data-fancybox="gallery" class="review-image-modal">
213 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $flot->name }}"> 212 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $flot->name }}">
214 </a> 213 </a>
215 @endif 214 @endif
216 215
217 <div class="flot-label"><div class="flot-label-name">Название:</div>{{ $flot->name }}</div> 216 <div class="flot-label"><div class="flot-label-name">Название:</div>{{ $flot->name }}</div>
218 <div class="flot-label"><div class="flot-label-name">DWT:</div> {{ $flot->DWT }}</div> 217 <div class="flot-label"><div class="flot-label-name">DWT:</div> {{ $flot->DWT }}</div>
219 <div class="flot-label"><div class="flot-label-name">Мощность:</div> {{ $flot->POWER_GD }}</div> 218 <div class="flot-label"><div class="flot-label-name">Мощность:</div> {{ $flot->POWER_GD }}</div>
220 <div class="flot-label"><div class="flot-label-name">IMO:</div> {{ $flot->IMO }}</div> 219 <div class="flot-label"><div class="flot-label-name">IMO:</div> {{ $flot->IMO }}</div>
221 </div> 220 </div>
222 @endforeach 221 @endforeach
223 @endif 222 @endif
224 </div> 223 </div>
225 </div> 224 </div>
226 225
227 <div id="vacancy_list" class="main__employer-page-body-item" data-body="2"> 226 <div id="vacancy_list" class="main__employer-page-body-item" data-body="2">
228 <div class="main__employer-page-two"> 227 <div class="main__employer-page-two">
229 @foreach ($ads as $job) 228 @foreach ($ads as $job)
230 <div class="main__employer-page-two-item"> 229 <div class="main__employer-page-two-item">
231 <div class="main__employer-page-two-item-toper"> 230 <div class="main__employer-page-two-item-toper">
232 @if (!empty($company[0]->logo)) 231 @if (!empty($company[0]->logo))
233 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $job->name }}"> 232 <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $job->name }}">
234 @else 233 @else
235 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $job->name }}"> 234 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $job->name }}">
236 @endif 235 @endif
237 <span>{{ $company[0]->name_company }}</span> 236 <span>{{ $company[0]->name_company }}</span>
238 </div> 237 </div>
239 <div class="main__employer-page-two-item-text-body"> 238 <div class="main__employer-page-two-item-text-body">
240 <h3>{{ $job->name }}</h3> 239 <h3>{{ $job->name }}</h3>
241 <span>Описание: 240 <span>Описание:
242 {!! $job->text !!} 241 {!! $job->text !!}
243 </span> 242 </span>
244 </div> 243 </div>
245 244
246 @if ((isset($job->jobs)) && ($job->jobs->count())) 245 @if ((isset($job->jobs)) && ($job->jobs->count()))
247 <div class="main__employer-page-two-item-tags"> 246 <div class="main__employer-page-two-item-tags">
248 @foreach ($job->jobs as $item) 247 @foreach ($job->jobs as $item)
249 <span class="main__employer-page-two-item-tag">#{{ $item->name }}</span> 248 <span class="main__employer-page-two-item-tag">#{{ $item->name }}</span>
250 @endforeach 249 @endforeach
251 </div> 250 </div>
252 @endif 251 @endif
253 <div class="main__employer-page-two-item-buttons"> 252 <div class="main__employer-page-two-item-buttons">
254 253
255 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $job->id }}" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}' 254 <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $job->id }}" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}" data-options='{"touch":false,"autoFocus":false}'
256 class="button main__employer-page-two-item-button js_send_it_button">Оставить 255 class="button main__employer-page-two-item-button js_send_it_button">Оставить
257 отклик...</button> 256 отклик...</button>
258 257
259 <!--<a href="#" 258 <!--<a href="#"
260 class="button button_light main__employer-page-two-item-button">Подробнее</a>--> 259 class="button button_light main__employer-page-two-item-button">Подробнее</a>-->
261 </div> 260 </div>
262 <div class="main__employer-page-two-item-bottom"> 261 <div class="main__employer-page-two-item-bottom">
263 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($job->updated_at)) }}</div> 262 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($job->updated_at)) }}</div>
264 <button type="button" id="like{{ $job->id }}" data-val="{{ $job->id }}" 263 <button type="button" id="like{{ $job->id }}" data-val="{{ $job->id }}"
265 class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($job) }}"> 264 class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($job) }}">
266 <svg> 265 <svg>
267 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 266 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
268 </svg> 267 </svg>
269 </button> 268 </button>
270 </div> 269 </div>
271 </div> 270 </div>
272 @endforeach 271 @endforeach
273 272
274 <div style="margin-top: 20px"> 273 <div style="margin-top: 20px">
275 {{ $ads->onEachSide(0)->appends($_GET)->links('paginate') }} 274 {{ $ads->onEachSide(0)->appends($_GET)->links('paginate') }}
276 </div> 275 </div>
277 <!--<button type="button" class="button button_light button_more main__employer-page-two-more js-toggle js-parent-toggle"> 276 <!--<button type="button" class="button button_light button_more main__employer-page-two-more js-toggle js-parent-toggle">
278 <span>Показать ещё</span> 277 <span>Показать ещё</span>
279 <span>Скрыть</span> 278 <span>Скрыть</span>
280 </button>--> 279 </button>-->
281 </div> 280 </div>
282 </div> 281 </div>
283 </div> 282 </div>
284 </div> 283 </div>
285 </div> 284 </div>
286 </div> 285 </div>
287 </main> 286 </main>
288 @endsection 287 @endsection
289 288
resources/views/js/favorite-vacancy-45.blade.php
1 <script> 1 <script>
2 $(document).ready(function() { 2 $(document).ready(function() {
3 $(document).on('click', '.js_vac_favorite', function () { 3 $(document).on('click', '.js_vac_favorite', function () {
4 var _this = $(this); 4 var _this = $(this);
5 var id = _this.attr('id'); 5 var id = _this.attr('id');
6 var id_vacancy = _this.attr('data-val'); 6 var id_vacancy = _this.attr('data-val');
7 console.log('active='+id);
8 7
9 if ($( "#"+id ).hasClass( "active" )) { 8 if ($( "#"+id ).hasClass( "active" )) {
10 $.ajax({ 9 $.ajax({
11 type: "GET", 10 type: "GET",
12 url: "{{ route('like-vacancy') }}", 11 url: "{{ route('like-vacancy') }}",
13 data: "code_record=" + id_vacancy, 12 data: "code_record=" + id_vacancy,
14 success: function (data) { 13 success: function (data) {
15 console.log('Выбор сортировки'); 14 ///
16 console.log(data);
17
18 }, 15 },
19 headers: { 16 headers: {
20 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 17 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
21 }, 18 },
22 error: function (data) { 19 error: function (data) {
23 data = JSON.stringify(data); 20 data = JSON.stringify(data);
24 console.log('Error: ' + data); 21 console.log('Error: ' + data);
25 } 22 }
26 }); 23 });
27 } else { 24 } else {
28 $.ajax({ 25 $.ajax({
29 type: "GET", 26 type: "GET",
30 url: "{{ route('like-vacancy') }}", 27 url: "{{ route('like-vacancy') }}",
31 data: "code_record=" + id_vacancy + "&delete=1", 28 data: "code_record=" + id_vacancy + "&delete=1",
32 success: function (data) { 29 success: function (data) {
33 console.log('Выбор сортировки'); 30 ///
34 console.log(data);
35 }, 31 },
36 headers: { 32 headers: {
37 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 33 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
38 }, 34 },
39 error: function (data) { 35 error: function (data) {
40 data = JSON.stringify(data); 36 data = JSON.stringify(data);
41 console.log('Error: ' + data); 37 console.log('Error: ' + data);
42 } 38 }
43 }); 39 });
44 } 40 }
45 }); 41 });
46 }); 42 });
47 </script> 43 </script>
48 44
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 src="{{ asset('js/jquery-ui.js') }}"></script> 10 <script src="{{ asset('js/jquery-ui.js') }}"></script>
11 <script src="{{ asset('js/func.js') }}"></script> 11 <script src="{{ asset('js/func.js') }}"></script>
12 <link rel="stylesheet" href="{{ asset('js/chosen/chosen.min.css') }}"> 12 <link rel="stylesheet" href="{{ asset('js/chosen/chosen.min.css') }}">
13 <script src="{{ asset('js/chosen/chosen.jquery.min.js') }}"></script> 13 <script src="{{ asset('js/chosen/chosen.jquery.min.js') }}"></script>
14 <!--<script type="text/javascript" src=" asset('js/jquery.cookie.js') }}"></script>--> 14 <!--<script type="text/javascript" src=" asset('js/jquery.cookie.js') }}"></script>-->
15 <link rel="stylesheet" href="{{ asset('css/telegram.css') }}"> 15 <link rel="stylesheet" href="{{ asset('css/telegram.css') }}">
16 <link rel="stylesheet" href="{{ asset('css/star-rating.min.css') }}"> 16 <link rel="stylesheet" href="{{ asset('css/star-rating.min.css') }}">
17 <link rel="stylesheet" href="{{ asset('css/style_may2024.css') }}"> 17 <link rel="stylesheet" href="{{ asset('css/style_may2024.css') }}">
18 <link rel="stylesheet" href="{{ asset('css/helpers.css') }}"> 18 <link rel="stylesheet" href="{{ asset('css/helpers.css') }}">
19 <style> 19 <style>
20 .err_red { 20 .err_red {
21 border: red 2px solid; 21 border: red 2px solid;
22 } 22 }
23 23
24 .input[disabled] { 24 .input[disabled] {
25 /* color: #9c9d9d; */ 25 /* color: #9c9d9d; */
26 background: #FFFFFF; 26 background: #FFFFFF;
27 } 27 }
28 </style> 28 </style>
29 </head> 29 </head>
30 30
31 <body id="body" onload="createCaptcha()"> 31 <body id="body" onload="createCaptcha()">
32 <a href="#body" class="to-top js-scroll-to"> 32 <a href="#body" class="to-top js-scroll-to">
33 <svg> 33 <svg>
34 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> 34 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use>
35 </svg> 35 </svg>
36 </a> 36 </a>
37 37
38 <div> <!-- BEGIN TOP WRAPPER --> 38 <div> <!-- BEGIN TOP WRAPPER -->
39 <header class="header"> 39 <header class="header">
40 <div class="container"> 40 <div class="container">
41 <div class="header__body"> 41 <div class="header__body">
42 <div class="header__left"> 42 <div class="header__left">
43 <a href="{{ route('index') }}" class="header__logo"> 43 <a href="{{ route('index') }}" class="header__logo">
44 <svg> 44 <svg>
45 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> 45 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use>
46 </svg> 46 </svg>
47 </a> 47 </a>
48 <nav class="header__menu"> 48 <nav class="header__menu">
49 <a href="{{ route('vacancies') }}" class="header__menu-item">Вакансии</a> 49 <a href="{{ route('vacancies') }}" class="header__menu-item">Вакансии</a>
50 <a href="{{ route('shipping_companies') }}" class="header__menu-item">Судоходные компании</a> 50 <a href="{{ route('shipping_companies') }}" class="header__menu-item">Судоходные компании</a>
51 <a href="{{ route('education') }}" class="header__menu-item">Образование</a> 51 <a href="{{ route('education') }}" class="header__menu-item">Образование</a>
52 </nav> 52 </nav>
53 </div> 53 </div>
54 <div class="header__right"> 54 <div class="header__right">
55 @guest 55 @guest
56 56
57 @else 57 @else
58 <a href="@if ($UserId->is_worker) {{ route('worker.cabinet') }} @else {{ route('employer.cabinet') }} @endif" class="header__notifs header__notifs_actived"> 58 <a href="@if ($UserId->is_worker) {{ route('worker.cabinet') }} @else {{ route('employer.cabinet') }} @endif" class="header__notifs header__notifs_actived">
59 <svg> 59 <svg>
60 <use xlink:href="{{ asset('images/sprite.svg#ring') }}"></use> 60 <use xlink:href="{{ asset('images/sprite.svg#ring') }}"></use>
61 </svg> 61 </svg>
62 <span>Уведомления</span> 62 <span>Уведомления</span>
63 </a> 63 </a>
64 64
65 @endguest 65 @endguest
66 <div class="header__right-line"></div> 66 <div class="header__right-line"></div>
67 <button class="header__burger"> 67 <button class="header__burger">
68 <svg> 68 <svg>
69 <use xlink:href="{{ asset('images/sprite.svg#burger') }}"></use> 69 <use xlink:href="{{ asset('images/sprite.svg#burger') }}"></use>
70 </svg> 70 </svg>
71 </button> 71 </button>
72 @guest 72 @guest
73 <a class="button header__sign" data-fancybox data-src="#sign" data-options='{"touch":false,"autoFocus":false}'>Войти</a> 73 <a class="button header__sign" data-fancybox data-src="#sign" data-options='{"touch":false,"autoFocus":false}'>Войти</a>
74 @else 74 @else
75 <a class="button header__sign" href="{{ route('logout') }}">Выйти</a> 75 <a class="button header__sign" href="{{ route('logout') }}">Выйти</a>
76 @endguest 76 @endguest
77 </div> 77 </div>
78 </div> 78 </div>
79 </div> 79 </div>
80 </header> 80 </header>
81 81
82 @yield('content') 82 @yield('content')
83 </div> <!-- END TOP WRAPPER --> 83 </div> <!-- END TOP WRAPPER -->
84 84
85 <div> <!-- BEGIN BOTTOM WRAPPER --> 85 <div> <!-- BEGIN BOTTOM WRAPPER -->
86 <footer class="footer"> 86 <footer class="footer">
87 <div class="container"> 87 <div class="container">
88 <div class="footer__mobile"> 88 <div class="footer__mobile">
89 89
90 <button class="footer__mobile-toper js-toggle active"> 90 <button class="footer__mobile-toper js-toggle active">
91 <a href="{{ route('index') }}"> 91 <a href="{{ route('index') }}">
92 <svg> 92 <svg>
93 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> 93 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use>
94 </svg> 94 </svg>
95 </a> 95 </a>
96 <span> 96 <span>
97 <svg> 97 <svg>
98 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> 98 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use>
99 </svg> 99 </svg>
100 </span> 100 </span>
101 </button> 101 </button>
102 <div class="footer__mobile-menu"> 102 <div class="footer__mobile-menu">
103 <div class="footer__mobile-menu-item"> 103 <div class="footer__mobile-menu-item">
104 <button class="js-toggle"> 104 <button class="js-toggle">
105 <b>Соискателям</b> 105 <b>Соискателям</b>
106 <span><svg> 106 <span><svg>
107 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use> 107 <use xlink:href="{{ asset('images/sprite.svg#arrow-top') }}"></use>
108 </svg></span> 108 </svg></span>
109 </button> 109 </button>
110 <div> 110 <div>
111 @if (\Illuminate\Support\Facades\Auth::user() === null) 111 @if (\Illuminate\Support\Facades\Auth::user() === null)
112 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a> 112 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a>
113 @endif 113 @endif
114 <a href="{{ route('vacancies') }}">Вакансии</a> 114 <a href="{{ route('vacancies') }}">Вакансии</a>
115 <!--<a href=" route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>--> 115 <!--<a href=" route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>-->
116 <a href="{{ route('education') }}">Образование</a> 116 <a href="{{ route('education') }}">Образование</a>
117 <a href="{{ route('news') }}">Новости</a> 117 <a href="{{ route('news') }}">Новости</a>
118 <a href="{{ $companies[0]->telegram }}">Телеграм</a> 118 <a href="{{ $companies[0]->telegram }}">Телеграм</a>
119 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a> 119 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a>
120 <!--<a href=" route('contacts') }}">Контакты</a>--> 120 <!--<a href=" route('contacts') }}">Контакты</a>-->
121 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a> 121 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a>
122 </div> 122 </div>
123 </div> 123 </div>
124 <div class="footer__mobile-menu-item"> 124 <div class="footer__mobile-menu-item">
125 <button class="js-toggle"> 125 <button class="js-toggle">
126 <b>Работодателям</b> 126 <b>Работодателям</b>
127 <span><svg> 127 <span><svg>
128 <use xlink:href="{{asset('images/sprite.svg#arrow-top') }}"></use> 128 <use xlink:href="{{asset('images/sprite.svg#arrow-top') }}"></use>
129 </svg></span> 129 </svg></span>
130 </button> 130 </button>
131 <div> 131 <div>
132 @if (\Illuminate\Support\Facades\Auth::user() === null) 132 @if (\Illuminate\Support\Facades\Auth::user() === null)
133 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a> 133 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a>
134 @endif 134 @endif
135 <!--<a href=" route('register') }}">Регистрация</a>--> 135 <!--<a href=" route('register') }}">Регистрация</a>-->
136 <a href="{{ route('bd_resume') }}">База резюме</a> 136 <a href="{{ route('bd_resume') }}">База резюме</a>
137 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a> 137 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>
138 <!--<a href=" route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a>--> 138 <!--<a href=" route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a>-->
139 <!--<a href=" route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a>--> 139 <!--<a href=" route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a>-->
140 <!--<a href=" route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a>--> 140 <!--<a href=" route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a>-->
141 <a href="{{ $companies[0]->telegram }}">Телеграм</a> 141 <a href="{{ $companies[0]->telegram }}">Телеграм</a>
142 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a> 142 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a>
143 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a> 143 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a>
144 </div> 144 </div>
145 </div> 145 </div>
146 </div> 146 </div>
147 <div class="footer__mobile-contacts"> 147 <div class="footer__mobile-contacts">
148 <b>Контакты</b> 148 <b>Контакты</b>
149 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a> 149 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a>
150 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a> 150 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a>
151 </div> 151 </div>
152 <div class="footer__mobile-bottom"> 152 <div class="footer__mobile-bottom">
153 <div class="socials"> 153 <div class="socials">
154 <a href="{{ $companies[0]->vkontact }}" target="_blank"> 154 <a href="{{ $companies[0]->vkontact }}" target="_blank">
155 <svg> 155 <svg>
156 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> 156 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use>
157 </svg> 157 </svg>
158 </a> 158 </a>
159 <a href="{{ $companies[0]->telegram }}" target="_blank"> 159 <a href="{{ $companies[0]->telegram }}" target="_blank">
160 <svg> 160 <svg>
161 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> 161 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use>
162 </svg> 162 </svg>
163 </a> 163 </a>
164 </div> 164 </div>
165 <nav class="footer__mobile-links"> 165 <nav class="footer__mobile-links">
166 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a> 166 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a>
167 <span></span> 167 <span></span>
168 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a> 168 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a>
169 </nav> 169 </nav>
170 &copy; 2023 &mdash; RekaMore.su 170 &copy; 2023 &mdash; RekaMore.su
171 <a href="{{ route('index') }}" class="nls" target="_blank"> 171 <a href="{{ route('index') }}" class="nls" target="_blank">
172 <svg> 172 <svg>
173 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use> 173 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use>
174 </svg> 174 </svg>
175 <span> 175 <span>
176 Дизайн и разработка: 176 Дизайн и разработка:
177 <b>NoLogoStudio.ru</b> 177 <b>NoLogoStudio.ru</b>
178 </span> 178 </span>
179 </a> 179 </a>
180 </div> 180 </div>
181 </div> 181 </div>
182 <div class="footer__main"> 182 <div class="footer__main">
183 <div class="footer__main-body"> 183 <div class="footer__main-body">
184 184
185 <a href="" class="footer__main-logo"> 185 <a href="" class="footer__main-logo">
186 <svg> 186 <svg>
187 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use> 187 <use xlink:href="{{ asset('images/sprite.svg#logo') }}"></use>
188 </svg> 188 </svg>
189 </a> 189 </a>
190 <div class="footer__main-col"> 190 <div class="footer__main-col">
191 <div class="footer__main-title">Соискателям</div> 191 <div class="footer__main-title">Соискателям</div>
192 <nav> 192 <nav>
193 @if (\Illuminate\Support\Facades\Auth::user() === null) 193 @if (\Illuminate\Support\Facades\Auth::user() === null)
194 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a> 194 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a>
195 @endif 195 @endif
196 <a href="{{ route('vacancies') }}">Вакансии</a> 196 <a href="{{ route('vacancies') }}">Вакансии</a>
197 <!--<a href=" route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>--> 197 <!--<a href=" route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>-->
198 <a href="{{ route('education') }}">Образование</a> 198 <a href="{{ route('education') }}">Образование</a>
199 <a href="{{ route('news') }}">Новости</a> 199 <a href="{{ route('news') }}">Новости</a>
200 <!--<a href=" route('contacts') }}">Контакты</a>--> 200 <!--<a href=" route('contacts') }}">Контакты</a>-->
201 <a href="{{ $companies[0]->telegram }}">Телеграм</a> 201 <a href="{{ $companies[0]->telegram }}">Телеграм</a>
202 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a> 202 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a>
203 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a> 203 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-soiskatelyam"]) }}">Публичная оферта</a>
204 </nav> 204 </nav>
205 </div> 205 </div>
206 <div class="footer__main-col"> 206 <div class="footer__main-col">
207 <div class="footer__main-title">Работодателям</div> 207 <div class="footer__main-title">Работодателям</div>
208 <nav> 208 <nav>
209 @if (\Illuminate\Support\Facades\Auth::user() === null) 209 @if (\Illuminate\Support\Facades\Auth::user() === null)
210 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a> 210 <a data-fancybox data-src="#reg" data-options='{"touch":false,"autoFocus":false}'>Регистрация</a>
211 @endif 211 @endif
212 <!--<a href=" route('register') }}">Регистрация</a>--> 212 <!--<a href=" route('register') }}">Регистрация</a>-->
213 <a href="{{ route('bd_resume') }}">База резюме</a> 213 <a href="{{ route('bd_resume') }}">База резюме</a>
214 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a> 214 <a href="{{ route('page', ['pages' => "Usloviya-razmescheniya"]) }}">Условия размещения</a>
215 <!--<a href=" route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a>--> 215 <!--<a href=" route('page', ['pages' => "Stoimost-razmescheniya"]) }}">Стоимость размещения</a>-->
216 <!--<a href=" route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a>--> 216 <!--<a href=" route('page', ['pages' => "Instrukcii"]) }}">Инструкции</a>-->
217 <!--<a href=" route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a>--> 217 <!--<a href=" route('page', ['pages' => "Effektivnost-obyavleniya"]) }}">Эффективность объявления</a>-->
218 <a href="{{ $companies[0]->telegram }}">Телеграм</a> 218 <a href="{{ $companies[0]->telegram }}">Телеграм</a>
219 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a> 219 <a href="{{ $companies[0]->vkontact }}">ВКонтакте</a>
220 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a> 220 <a href="{{ route('page', ['pages' => "Publichnaya-oferta-rabotodatelyam"]) }}">Публичная оферта</a>
221 </nav> 221 </nav>
222 </div> 222 </div>
223 223
224 <div class="footer__main-col"> 224 <div class="footer__main-col">
225 <div class="footer__main-title">Контакты</div> 225 <div class="footer__main-title">Контакты</div>
226 <div class="footer__main-contacts"> 226 <div class="footer__main-contacts">
227 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a> 227 <a href="tel:{{ $companies[0]->telephone }}">{{ $companies[0]->telephone }}</a>
228 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a> 228 <a href="mailto:{{ $companies[0]->email }}">{{ $companies[0]->email }}</a>
229 </div> 229 </div>
230 <div class="socials"> 230 <div class="socials">
231 <a href="{{ $companies[0]->vkontact }}" target="_blank"> 231 <a href="{{ $companies[0]->vkontact }}" target="_blank">
232 <svg> 232 <svg>
233 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use> 233 <use xlink:href="{{ asset('images/sprite.svg#vk') }}"></use>
234 </svg> 234 </svg>
235 </a> 235 </a>
236 <a href="{{ $companies[0]->telegram }}" target="_blank"> 236 <a href="{{ $companies[0]->telegram }}" target="_blank">
237 <svg> 237 <svg>
238 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use> 238 <use xlink:href="{{ asset('images/sprite.svg#tg') }}"></use>
239 </svg> 239 </svg>
240 </a> 240 </a>
241 </div> 241 </div>
242 </div> 242 </div>
243 </div> 243 </div>
244 244
245 <div class="footer__main-copy"> 245 <div class="footer__main-copy">
246 <div>&copy; 2023 &mdash; RekaMore.su</div> 246 <div>&copy; 2023 &mdash; RekaMore.su</div>
247 <nav> 247 <nav>
248 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a> 248 <a href="{{ route('page', ['pages' => "Politika-konfidencialnosti"]) }}">Политика конфиденциальности</a>
249 <span></span> 249 <span></span>
250 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a> 250 <a href="{{ route('page', ['pages' => "Polzovatelskoe-soglashenie"]) }}">Пользовательское соглашение</a>
251 </nav> 251 </nav>
252 <div> @if (isset($_COOKIE['favorite_vacancy'])) Куки вакансий: {{ print_r($_COOKIE['favorite_vacancy']) }} @endif</div> 252 <div> @if (isset($_COOKIE['favorite_vacancy'])) Куки вакансий: {{ print_r($_COOKIE['favorite_vacancy']) }} @endif</div>
253 <a href="{{ route('index') }}" class="nls" target="_blank"> 253 <a href="{{ route('index') }}" class="nls" target="_blank">
254 <svg> 254 <svg>
255 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use> 255 <use xlink:href="{{ asset('images/sprite.svg#nls') }}"></use>
256 </svg> 256 </svg>
257 <span> 257 <span>
258 Дизайн и разработка: 258 Дизайн и разработка:
259 <b>NoLogoStudio.ru</b> 259 <b>NoLogoStudio.ru</b>
260 </span> 260 </span>
261 </a> 261 </a>
262 </div> 262 </div>
263 </div> 263 </div>
264 </div> 264 </div>
265 </footer> 265 </footer>
266 </div> <!-- END BOTTOM WRAPPER --> 266 </div> <!-- END BOTTOM WRAPPER -->
267 267
268 <div hidden> <!-- BEGIN MODALS WRAPPER --> 268 <div hidden> <!-- BEGIN MODALS WRAPPER -->
269 <!-- Соискатель отправляет сообщение работодателю --> 269 <!-- Соискатель отправляет сообщение работодателю -->
270 @include('modals.send_worker_new') 270 @include('modals.send_worker_new')
271 271
272 <!-- Работодатель отправляет сообщение соискателю --> 272 <!-- Работодатель отправляет сообщение соискателю -->
273 @include('modals.send_employer') 273 @include('modals.send_employer')
274 274
275 <!-- Сообщение-предупреждение о том, что сообщения только можно отправить авторизованным пользователям --> 275 <!-- Сообщение-предупреждение о том, что сообщения только можно отправить авторизованным пользователям -->
276 @include('modals.send_message_noaut') 276 @include('modals.send_message_noaut')
277 277
278 @include('modals.send_message_noaut2') 278 @include('modals.send_message_noaut2')
279 279
280 <!-- Форма авторизации --> 280 <!-- Форма авторизации -->
281 @include('modals.send_login') 281 @include('modals.send_login')
282 282
283 <!-- Сбросить пароль --> 283 <!-- Сбросить пароль -->
284 @include('modals.reset_password') 284 @include('modals.reset_password')
285 285
286 <!-- Регистрация --> 286 <!-- Регистрация -->
287 @include('modals.register') 287 @include('modals.register')
288 288
289 <!-- Благодарность по отправке сообщения работодателю --> 289 <!-- Благодарность по отправке сообщения работодателю -->
290 @include('modals.thank_you_send_employer') 290 @include('modals.thank_you_send_employer')
291 291
292 <!-- Благодарность по отправке сообщения менеджеру --> 292 <!-- Благодарность по отправке сообщения менеджеру -->
293 @include('modals.thank_you_send_manager') 293 @include('modals.thank_you_send_manager')
294 294
295 <!-- Благодарность после регистрации --> 295 <!-- Благодарность после регистрации -->
296 @include('modals.thank_you_send_for_employer') 296 @include('modals.thank_you_send_for_employer')
297 297
298 <!-- Благодарность после регистрации для работника --> 298 <!-- Благодарность после регистрации для работника -->
299 @include('modals.thank_you_send_for_worker') 299 @include('modals.thank_you_send_for_worker')
300 300
301 <!-- Подтверждение удаления профиля --> 301 <!-- Подтверждение удаления профиля -->
302 @include('modals.delete_profile') 302 @include('modals.delete_profile')
303 303
304 <!-- Подверждение об удалении профиля --> 304 <!-- Подверждение об удалении профиля -->
305 @include('modals.success_delete_profile') 305 @include('modals.success_delete_profile')
306 306
307 @include('modals.send_message_low_profile_percent')
308
307 </div> <!-- END MODALS WRAPPER --> 309 </div> <!-- END MODALS WRAPPER -->
308 310
309 311
310 <script src="{{ asset('js/jquery.maskedinput.js') }}"></script> 312 <script src="{{ asset('js/jquery.maskedinput.js') }}"></script>
311 <script src="{{ asset('js/jquery.fancybox.js') }}"></script> 313 <script src="{{ asset('js/jquery.fancybox.js') }}"></script>
312 <script src="{{ asset('js/jquery.select2.js') }}"></script> 314 <script src="{{ asset('js/jquery.select2.js') }}"></script>
313 <script src="{{ asset('js/swiper.js') }}"></script> 315 <script src="{{ asset('js/swiper.js') }}"></script>
314 <script src="{{ asset('js/script-vc.js') }}"></script> 316 <script src="{{ asset('js/script-vc.js') }}"></script>
315 <script src="{{ asset('js/star-rating.min.js') }}"></script> 317 <script src="{{ asset('js/star-rating.min.js') }}"></script>
316 <script> 318 <script>
317 var getUrlParameter = function getUrlParameter(sParam) { 319 var getUrlParameter = function getUrlParameter(sParam) {
318 var sPageURL = decodeURIComponent(window.location.search.substring(1)), 320 var sPageURL = decodeURIComponent(window.location.search.substring(1)),
319 sURLVariables = sPageURL.split('&'), 321 sURLVariables = sPageURL.split('&'),
320 sParameterName, 322 sParameterName,
321 i; 323 i;
322 for (i = 0; i < sURLVariables.length; i++) { 324 for (i = 0; i < sURLVariables.length; i++) {
323 sParameterName = sURLVariables[i].split('='); 325 sParameterName = sURLVariables[i].split('=');
324 if (sParameterName[0] === sParam) { 326 if (sParameterName[0] === sParam) {
325 return sParameterName[1] === undefined ? true : sParameterName[1]; 327 return sParameterName[1] === undefined ? true : sParameterName[1];
326 } 328 }
327 } 329 }
328 }; 330 };
329 331
330 $(function() { 332 $(function() {
331 var style_link = "{{ asset('css/cke_wysiwyg_frame_style.css') }}"; 333 var style_link = "{{ asset('css/cke_wysiwyg_frame_style.css') }}";
332 var iterator = 0; 334 var iterator = 0;
333 var wysiwyg_style_interval = window.setInterval(function(){ 335 var wysiwyg_style_interval = window.setInterval(function(){
334 var frame = $('.cke_wysiwyg_frame'); 336 var frame = $('.cke_wysiwyg_frame');
335 frame.contents().find('head').append( 337 frame.contents().find('head').append(
336 $('<link rel="stylesheet" type="text/css" href="' + style_link + '">') 338 $('<link rel="stylesheet" type="text/css" href="' + style_link + '">')
337 ); 339 );
338 if (frame.length || (++iterator == 6)){ 340 if (frame.length || (++iterator == 6)){
339 clearInterval(wysiwyg_style_interval); 341 clearInterval(wysiwyg_style_interval);
340 } 342 }
341 }, 500); 343 }, 500);
342 }); 344 });
343 </script> 345 </script>
344 @include('js.modals') 346 @include('js.modals')
345 @include('js.captha') 347 @include('js.captha')
346 @yield('scripts') 348 @yield('scripts')
347 </body> 349 </body>
348 </html> 350 </html>
349 351
resources/views/list_vacancies.blade.php
1 @php 1 @php
2 use App\Classes\StatusUser; 2 use App\Classes\StatusUser;
3 @endphp 3 @endphp
4 4
5 @extends('layout.frontend', ['title' => 'Вакансии РекаМоре']) 5 @extends('layout.frontend', ['title' => 'Вакансии РекаМоре'])
6 6
7 @section('scripts') 7 @section('scripts')
8 <script> 8 <script>
9 $(document).on('change', '#jobs', function() { 9 $(document).on('change', '#jobs', function() {
10 var val = $(this).val(); 10 var val = $(this).val();
11 var main_oskar = $('#main_ockar'); 11 var main_oskar = $('#main_ockar');
12 var ti_head = $('#title_head'); 12 var ti_head = $('#title_head');
13
14 console.log('Code='+val);
15 console.log('Click change...');
16 $.ajax({ 13 $.ajax({
17 type: "GET", 14 type: "GET",
18 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", 15 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}",
19 data: "job="+val, 16 data: "job="+val,
20 success: function (data) { 17 success: function (data) {
21 console.log('Выбор сделан!');
22
23 main_oskar.html(data); 18 main_oskar.html(data);
24 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?job="+val+"@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 19 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?job="+val+"@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
25 }, 20 },
26 headers: { 21 headers: {
27 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 22 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
28 }, 23 },
29 error: function (data) { 24 error: function (data) {
30 data = JSON.stringify(data); 25 data = JSON.stringify(data);
31 console.log('Error: ' + data); 26 console.log('Error: ' + data);
32 } 27 }
33 }); 28 });
34 29
35 if ((val == '') || (val == '0')) { 30 if ((val == '') || (val == '0')) {
36 title_head.html('Все категории'); 31 title_head.html('Все категории');
37 } else { 32 } else {
38 $.ajax({ 33 $.ajax({
39 type: "GET", 34 type: "GET",
40 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}?@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif", 35 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}?@if (isset($_GET['sort']))&sort={{ $_GET['sort'] }}@endif",
41 data: "job=" + val +"&title=1", 36 data: "job=" + val +"&title=1",
42 success: function (data) { 37 success: function (data) {
43
44 console.log(data);
45 }, 38 },
46 39
47 headers: { 40 headers: {
48 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 41 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
49 }, 42 },
50 43
51 error: function (data) { 44 error: function (data) {
52 data = JSON.stringify(data); 45 data = JSON.stringify(data);
53 console.log('Error: ' + data); 46 console.log('Error: ' + data);
54 } 47 }
55 }); 48 });
56
57 } 49 }
58 }); 50 });
59 51
60 $(document).on('click', '.js_send_it_button', function() { 52 $(document).on('click', '.js_send_it_button', function() {
61 var this_ = $(this); 53 var this_ = $(this);
62 var code_user_id = this_.attr('data-uid'); 54 var code_user_id = this_.attr('data-uid');
63 var code_to_user_id = this_.attr('data-tuid'); 55 var code_to_user_id = this_.attr('data-tuid');
64 var code_vacancy = this_.attr('data-vacancy'); 56 var code_vacancy = this_.attr('data-vacancy');
65 var user_id = $('#_user_id'); 57 var user_id = $('#_user_id');
66 var to_user_id = $('#_to_user_id'); 58 var to_user_id = $('#_to_user_id');
67 var vacancy = $('#_vacancy'); 59 var vacancy = $('#_vacancy');
68 60
69 console.log('Клик на кнопки...');
70
71 user_id.val(code_user_id); 61 user_id.val(code_user_id);
72 to_user_id.val(code_to_user_id); 62 to_user_id.val(code_to_user_id);
73 vacancy.val(code_vacancy); 63 vacancy.val(code_vacancy);
74 }); 64 });
75 65
76 $(document).on('click', '.js_send_for_emp', function() { 66 $(document).on('click', '.js_send_for_emp', function() {
77 var this_ = $(this); 67 var this_ = $(this);
78 var code_user_id = this_.attr('data-uid'); 68 var code_user_id = this_.attr('data-uid');
79 var code_to_user_id = this_.attr('data-tuid'); 69 var code_to_user_id = this_.attr('data-tuid');
80 var code_vacancy = this_.attr('data-vacancy'); 70 var code_vacancy = this_.attr('data-vacancy');
81 var user_id = $('#send_user_id'); 71 var user_id = $('#send_user_id');
82 var to_user_id = $('#send_to_user_id'); 72 var to_user_id = $('#send_to_user_id');
83 var vacancy = $('#send_vacancy'); 73 var vacancy = $('#send_vacancy');
84 74
85 console.log('code_to_user_id='+code_to_user_id); 75 user_id.val(code_user_id);
86 console.log('code_user_id='+code_user_id); 76 to_user_id.val(code_to_user_id);
87 console.log('code_vacancy='+code_vacancy); 77 vacancy.val(code_vacancy);
88 console.log('Клик на кнопке...'); 78 });
79
80 $(document).on('click', '.js_ask_percent', function() {
81 var this_ = $(this);
82 var code_user_id = this_.attr('data-uid');
83 var code_to_user_id = this_.attr('data-tuid');
84 var code_vacancy = this_.attr('data-vacancy');
85 var user_id = $('#modal_user_id');
86 var to_user_id = $('#modal_to_user_id');
87 var vacancy = $('#modal_vacancy');
89 88
90 user_id.val(code_user_id); 89 user_id.val(code_user_id);
91 to_user_id.val(code_to_user_id); 90 to_user_id.val(code_to_user_id);
92 vacancy.val(code_vacancy); 91 vacancy.val(code_vacancy);
92
93 user_id.trigger('change');
94 to_user_id.trigger('change');
95 vacancy.trigger('change');
93 }); 96 });
94 97
95 $(document).on('change', '#sort_ajax', function() { 98 $(document).on('change', '#sort_ajax', function() {
96 var this_ = $(this); 99 var this_ = $(this);
97 var val_ = this_.val(); 100 var val_ = this_.val();
98 console.log('sort items '+val_);
99 101
100 $.ajax({ 102 $.ajax({
101 type: "GET", 103 type: "GET",
102 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}", 104 url: "{{ route('list-vacancies', ['categories' => $categories->id]) }}",
103 data: "sort="+val_+"&block=1", 105 data: "sort="+val_+"&block=1",
104 success: function (data) { 106 success: function (data) {
105 console.log('Выбор сортировки');
106 console.log(data);
107 $('#main_ockar').html(data); 107 $('#main_ockar').html(data);
108 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?sort="+val_+"@if (isset($_GET['job']))&job={{ $_GET['job'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif"); 108 history.pushState({}, '', "{{ route('list-vacancies', ['categories' => $categories->id]) }}?sort="+val_+"@if (isset($_GET['job']))&job={{ $_GET['job'] }}@endif"+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
109 }, 109 },
110 headers: { 110 headers: {
111 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 111 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
112 }, 112 },
113 error: function (data) { 113 error: function (data) {
114 data = JSON.stringify(data); 114 data = JSON.stringify(data);
115 console.log('Error: ' + data); 115 console.log('Error: ' + data);
116 } 116 }
117 }); 117 });
118 }); 118 });
119 119
120
121
122 $(document).ready(function(){ 120 $(document).ready(function(){
123 var sel = $('#select2-sort_ajax-container'); 121 var sel = $('#select2-sort_ajax-container');
124 var key = getUrlParameter('sort'); 122 var key = getUrlParameter('sort');
125 console.log(sel);
126 console.log(key);
127 123
128 if (key !=='') { 124 if (key !=='') {
129 console.log(key);
130 switch (key) { 125 switch (key) {
131 case "default": sel.html('Сортировка (по умолчанию)'); break; 126 case "default": sel.html('Сортировка (по умолчанию)'); break;
132 case "name_up": sel.html('По имени (возрастание)'); break; 127 case "name_up": sel.html('По имени (возрастание)'); break;
133 case "name_down": sel.html('По дате (убывание)'); break; 128 case "name_down": sel.html('По дате (убывание)'); break;
134 case "created_at_up": sel.html('По дате (возрастание)'); break; 129 case "created_at_up": sel.html('По дате (возрастание)'); break;
135 case "created_at_down": sel.html('По дате (убывание)'); break; 130 case "created_at_down": sel.html('По дате (убывание)'); break;
136 } 131 }
137 132
138 } 133 }
139 }); 134 });
140 </script> 135 </script>
141 @include('js.favorite-vacancy-45') 136 @include('js.favorite-vacancy-45')
142 @endsection 137 @endsection
143 @section('content') 138 @section('content')
144 <section class="thing"> 139 <section class="thing">
145 <div class="container"> 140 <div class="container">
146 <form class="thing__body" action="{{ route('list-vacancies', ['categories' => (!empty($Name_categori)) ? $Name_categori[0]->id : '0']) }}" method="POST"> 141 <form class="thing__body" action="{{ route('list-vacancies', ['categories' => (!empty($Name_categori)) ? $Name_categori[0]->id : '0']) }}" method="POST">
147 <ul class="breadcrumbs thing__breadcrumbs"> 142 <ul class="breadcrumbs thing__breadcrumbs">
148 <li><a href="{{ route('index') }}">Главная</a></li> 143 <li><a href="{{ route('index') }}">Главная</a></li>
149 <li><a href="{{ route('vacancies') }}">Вакансии</a></li> 144 <li><a href="{{ route('vacancies') }}">Вакансии</a></li>
150 <li><b>{{ isset($Name_categori[0]) ? $Name_categori[0]->name : 'Все категории' }}</b></li> 145 <li><b>{{ isset($Name_categori[0]) ? $Name_categori[0]->name : 'Все категории' }}</b></li>
151 </ul> 146 </ul>
152 <h1 class="thing__title">Вакансии</h1> 147 <h1 class="thing__title">Вакансии</h1>
153 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для 148 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для
154 существующих финансовых и административных условий.</p> 149 существующих финансовых и административных условий.</p>
155 <div class="select select_search thing__select"> 150 <div class="select select_search thing__select">
156 <div class="select__icon"> 151 <div class="select__icon">
157 <svg> 152 <svg>
158 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 153 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
159 </svg> 154 </svg>
160 </div> 155 </div>
161 <select class="js-select2" id="jobs" name="jobs"> 156 <select class="js-select2" id="jobs" name="jobs">
162 <option value="0" selected>Выберите должность</option> 157 <option value="0" selected>Выберите должность</option>
163 @if ($Job_title->count()) 158 @if ($Job_title->count())
164 @foreach($Job_title as $JT) 159 @foreach($Job_title as $JT)
165 <option value="{{ $JT->id }}" @if(isset($_GET['job']) && ($_GET['job'] == $JT->id)) selected @endif>{{ $JT->name }}</option> 160 <option value="{{ $JT->id }}" @if(isset($_GET['job']) && ($_GET['job'] == $JT->id)) selected @endif>{{ $JT->name }}</option>
166 @endforeach 161 @endforeach
167 @endif 162 @endif
168 </select> 163 </select>
169 </div> 164 </div>
170 </form> 165 </form>
171 </div> 166 </div>
172 </section> 167 </section>
173 <main class="main"> 168 <main class="main">
174 <div class="container"> 169 <div class="container">
175 <div class="main__vacancies" > 170 <div class="main__vacancies" >
176 @if (isset($Name_categori[0]->name)) 171 @if (isset($Name_categori[0]->name))
177 <h2 class="main__vacancies-title">Категория вакансий {{ $Name_categori[0]->name }}</h2> 172 <h2 class="main__vacancies-title">Категория вакансий {{ $Name_categori[0]->name }}</h2>
178 @else 173 @else
179 <h2 class="main__vacancies-title" id="title_head" name="title_head">Все категории</h2> 174 <h2 class="main__vacancies-title" id="title_head" name="title_head">Все категории</h2>
180 @endif 175 @endif
181 <div class="filters main__vacancies-filters"> 176 <div class="filters main__vacancies-filters">
182 <div class="filters__label" id="col-vo" name="col-vo">Показано {{ $Query->firstItem() }} – {{ $Query->lastItem() }} из @isset($Query_count) {{ $Query_count }} @else 0 @endisset результатов поиска</div> 177 <div class="filters__label" id="col-vo" name="col-vo">Показано {{ $Query->firstItem() }} – {{ $Query->lastItem() }} из @isset($Query_count) {{ $Query_count }} @else 0 @endisset результатов поиска</div>
183 </div> 178 </div>
184 179
185 <div class="main__vacancies" style="width:100%;" id="main_ockar" name="main_oskar"> 180 <div class="main__vacancies" style="width:100%;" id="main_ockar" name="main_oskar">
186 @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp 181 @php $i = ($Query->currentPage() * $Query->perPage() - $Query->count() - 1) @endphp
187 182
188 @foreach ($Query as $Q) 183 @foreach ($Query as $Q)
189 @foreach ($Reclama as $Rec) 184 @foreach ($Reclama as $Rec)
190 @if ($Rec->position == $i) 185 @if ($Rec->position == $i)
191 <div class="main__vacancies-thing"> 186 <div class="main__vacancies-thing">
192 @if (!empty($Rec->image)) 187 @if (!empty($Rec->image))
193 <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 188 <img src="{{ asset(Storage::url($Rec->image)) }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
194 @else 189 @else
195 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 190 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
196 @endif 191 @endif
197 <div class="main__vacancies-thing-body"> 192 <div class="main__vacancies-thing-body">
198 <h2>{{ $Rec->title }}</h2> 193 <h2>{{ $Rec->title }}</h2>
199 <div class="main__vacancies-thing-scroll"> 194 <div class="main__vacancies-thing-scroll">
200 {!! $Rec->text !!} 195 {!! $Rec->text !!}
201 </div> 196 </div>
202 <a href="{{ $Rec->link }}" class="button">Узнать больше</a> 197 <a href="{{ $Rec->link }}" class="button">Узнать больше</a>
203 </div> 198 </div>
204 </div> 199 </div>
205 @endif 200 @endif
206 @endforeach 201 @endforeach
207 <div class="main__vacancies-item main__employer-page-two-item" data-id="{{ $Q->id }}"> 202 <div class="main__vacancies-item main__employer-page-two-item" data-id="{{ $Q->id }}">
208
209 <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" class="back main__employer-page-two-item-back">
210 <svg>
211 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
212 </svg>
213 <span>
214 Вернуться к списку вакансий
215 </span>
216 </a>
217 203
218 <div class="main__employer-page-two-item-toper"> 204 <a href="{{ route('list-vacancies', ['categories' => $categories->id]) }}" class="back main__employer-page-two-item-back">
219 @if (!empty($Q->employer->logo)) 205 <svg>
220 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}"> 206 <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
221 @else 207 </svg>
222 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic"> 208 <span>
223 @endif 209 Вернуться к списку вакансий
224 <span>@if (isset($Q->employer->name_company)) {{ $Q->employer->name_company }} @else Не определена @endif</span> 210 </span>
225 </div> 211 </a>
226 212
227 <div class="main__employer-page-two-item-text"> 213 <div class="main__employer-page-two-item-toper">
228 <div class="main__employer-page-two-item-text-name"> 214 @if (!empty($Q->employer->logo))
229 <h3>@if (!empty($Q->name)) {{ $Q->name }}@else Не указано @endif </h3> 215 <img src="{{ asset(Storage::url($Q->employer->logo)) }}" alt="{{ $Q->employer->name }}">
216 @else
217 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Rec->title }}" class="main__vacancies-thing-pic">
218 @endif
219 <span>@if (isset($Q->employer->name_company)) {{ $Q->employer->name_company }} @else Не определена @endif</span>
230 </div> 220 </div>
231 <!--Судоходная компания ведет набор
232 специалистов на следующие должности:</div>
233 <div class="main__employer-page-two-item-text-links">
234 if (isset($Q->jobs))
235 foreach ($Q->jobs as $key => $j)
236 <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 рублей (на руки)-->
237 <!-- </a>
238 endforeach
239 endif
240 </div>-->
241 </div>
242 221
243 <div class="main__employer-page-two-item-text"> 222 <div class="main__employer-page-two-item-text">
244 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 223 <div class="main__employer-page-two-item-text-name">
245 <div class="main__employer-page-two-item-text-body"> 224 <h3>@if (!empty($Q->name)) {{ $Q->name }}@else Не указано @endif </h3>
246 {!! $Q->text !!} 225 </div>
247 </div>
248 </div>
249 <!--<div class="main__employer-page-two-item-text">
250 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div>
251 <div class="main__employer-page-two-item-text-body">
252 !! $Q->description !!}
253 </div>
254 </div>
255 <div class="main__employer-page-two-item-text">
256 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div>
257 <div class="main__employer-page-two-item-text-body">
258 !! $Q->contacts_emails !!}
259 </div> 226 </div>
260 </div> 227
261 <div class="main__employer-page-two-item-text"> 228 <div class="main__employer-page-two-item-text">
262 <div class="main__employer-page-two-item-text-name">Или звоните:</div> 229 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
263 <div class="main__employer-page-two-item-text-body"> 230 <div class="main__employer-page-two-item-text-body">
264 !! $Q->contacts_telephones !!} 231 {!! $Q->text !!}
232 </div>
265 </div> 233 </div>
266 </div>-->
267 234
268 <div class="main__employer-page-two-item-tags"> 235 <div class="main__employer-page-two-item-tags">
269 @if (!empty($Q->jobs_code[0]->position_ship)) 236 @if (!empty($Q->jobs_code[0]->position_ship))
270 <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span> 237 <span class="main__employer-page-two-item-tag"> #{{ $Q->jobs_code[0]->position_ship }}</span>
271 @else
272 @if (isset($Q->jobs))
273 @foreach ($Q->jobs as $key => $j)
274 <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span>
275 @endforeach
276 @endif
277 @endif
278 </div>
279 <div class="main__employer-page-two-item-buttons">
280 @guest
281 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
282 class="button main__employer-page-two-item-button">Откликнуться</button>
283 @else
284 @if (App\Classes\StatusUser::Status()==1)
285 <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}'
286 class="button main__employer-page-two-item-button js_send_for_emp">Откликнуться</button>
287 @else 238 @else
288 <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}' 239 @if (isset($Q->jobs))
289 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button> 240 @foreach ($Q->jobs as $key => $j)
241 <span class="main__employer-page-two-item-tag"> #{{ $j->name }}</span>
242 @endforeach
243 @endif
290 @endif 244 @endif
291 @endguest 245 </div>
292 <a href="{{ route('vacancie', ['vacancy' => $Q->id]) }}" class="button button_light main__employer-page-two-item-button">Подробнее</a> 246 <div class="main__employer-page-two-item-buttons">
293 </div> 247 @guest
resources/views/modals/chats/remove_chat.blade.php
1 <div class="hide"> 1 <div class="hide">
2 <div id="remove_chat" class="modal-dialog"> 2 <div id="remove_chat" class="modal-dialog">
3 <div class="modal-dialog-title"> 3 <div class="modal-dialog-title">
4 <h2>Удалить чат</h2> 4 <h2>Удалить чат</h2>
5 </div> 5 </div>
6 <div class="modal-dialog-body"> 6 <div class="modal-dialog-body">
7 <p>Вы действительно хотите удалить час с "<b><span class="target-chat"></span></b>"?</p> 7 <p>Вы действительно хотите удалить чат с "<b><span class="target-chat"></span></b>"?</p>
8 </div> 8 </div>
9 <div class="modal-dialog-footer"> 9 <div class="modal-dialog-footer">
10 <button type="button" class="button remove-chat-button">Удалить</button> 10 <button type="button" class="button remove-chat-button">Удалить</button>
11 <button type="button" class="button button_light" onclick="$.fancybox.close();">Закрыть</button> 11 <button type="button" class="button button_light" onclick="$.fancybox.close();">Закрыть</button>
12 </div> 12 </div>
13 </div> 13 </div>
14 </div> 14 </div>
15 15
16 <script> 16 <script>
17 $(function(){ 17 $(function(){
18 $('.remove-chat-button').click(function(){ 18 $('.remove-chat-button').click(function(){
19 spinStart($(this)); 19 spinStart($(this));
20 var wrap = $(this).closest('#remove_chat'); 20 var wrap = $(this).closest('#remove_chat');
21 var chat_id = wrap.data('chat-id'); 21 var chat_id = wrap.data('chat-id');
22 22
23 $.ajax({ 23 $.ajax({
24 type: "POST", 24 type: "POST",
25 url: "{{ route('employer.remove_chat') }}", 25 url: "{{ route('employer.remove_chat') }}",
26 data: { 26 data: {
27 id: chat_id 27 id: chat_id
28 }, 28 },
29 headers: { 29 headers: {
30 'X-CSRF-TOKEN': $('[name="_token"]').val() 30 'X-CSRF-TOKEN': $('[name="_token"]').val()
31 }, 31 },
32 success: function(){ 32 success: function(){
33 location.reload(); 33 location.reload();
34 } 34 }
35 }); 35 });
36 }); 36 });
37 }); 37 });
38 </script> 38 </script>
39 39
resources/views/modals/send_message_low_profile_percent.blade.php
File was created 1 <div id="ask_percent" class="modal modal_bg">
2 <div style="display:none">
3 <!-- Отправитель сообщения: -->
4 <input type="hidden" id="modal_user_id" name="_user_id" class="input" placeholder="user_id" value="">
5 <!-- Получатель сообщения: -->
6 <input type="hidden" id="modal_to_user_id" name="_to_user_id" class="input" placeholder="to_user_id" value="">
7 <!-- Вакансия: -->
8 <input type="hidden" id="modal_vacancy" name="_vacancy" class="input" placeholder="vacancy" value="">
9 </div>
10
11 <div class="modal__body">
12 <div class="modal__title">Вы откликнулись на вакансию <span id="vac_name"></span></div>
13 <div class="modal__text">Ваше резюме заполнено менее чем на 50%</div>
14 <div class="modal__text">Вы хотите дополнить ваше резюме?</div>
15 <div class="modal__buttons">
16 <a href="{{ route('worker.cabinet') }}" class="button main__employer-page-two-item-button">Да</a>
17 <button type="button"
18 data-fancybox
19 data-src="#send2"
20 {{--data-vacancy="{{ $Q->id }}"
21 data-uid="{{ $uid }}"
22 data-tuid="{{ $Q->employer->user_id }}"--}}
23 data-options='{"touch":false,"autoFocus":false}'
24 class="button main__employer-page-two-item-button js_send_wp_button">Нет</button>
25 </div>
26 </div>
27 </div>
28
29 <script>
30 $(document).on('change', '#modal_user_id', function () {
31 $('.js_send_wp_button').data('uid', $('#modal_user_id').val());
32 })
33 $(document).on('change', '#modal_to_user_id', function () {
34 $('.js_send_wp_button').data('tuid', $('#modal_to_user_id').val());
35 })
36 $(document).on('change', '#modal_vacancy', function () {
37 $('.js_send_wp_button').data('vacancy', $('#modal_vacancy').val());
38 $.ajax({
39 url: 'vacancy/'+$('#modal_vacancy').val(),
40 type: 'GET',
41 dataType: "json",
42 success: function (data) {
43 $('#vac_name').html(data.name)
44 }
45 })
46 })
47
48 $(document).on('click', '.js_send_wp_button', function() {
49 $('#_to_user_id').val($(this).data('tuid'));
50 $('#_vacancy').val($(this).data('vacancy'));
51 $('#_user_id').val($(this).data('uid'));
52
53 console.log($(this).data('uid'), $('#_user_id'))
54 //console.log($('#_to_user_id'))
55 //console.log($('#_vacancy'))
56 });
57
58 </script>
59
resources/views/modals/send_worker_new.blade.php
1 <script> 1 <script>
2 $("#form_worker" ).submit(function(event) { 2 $("#form_worker" ).submit(function(event) {
3 var val = $(this).val(); 3 var val = $(this).val();
4 var send_title = $('#send_title'); 4 var send_title = $('#send_title');
5 var send_title_val = send_title.val(); 5 var send_title_val = send_title.val();
6 6
7 console.log('Click form.'); 7 console.log('Click form.');
8 }); 8 });
9 9
10 $(document).on('change', '#btn_send_file', function() { 10 $(document).on('change', '#btn_send_file', function() {
11 11
12 var send_name = $('#send_name'); 12 var send_name = $('#send_name');
13 var send_name_val = send_name.val(); 13 var send_name_val = send_name.val();
14 var send_name_file = $('#send_name_file'); 14 var send_name_file = $('#send_name_file');
15 15
16 console.log(send_name_val); 16 console.log(send_name_val);
17 send_name_file.html(send_name_val); 17 send_name_file.html(send_name_val);
18 18
19 }); 19 });
20 </script> 20 </script>
21 <div id="send" class="modal"> 21 <div id="send" class="modal">
22 <div class="modal__body"> 22 <div class="modal__body">
23 <div class="modal__title">Отправить сообщение работодателю</div> 23 <div class="modal__title">Отправить сообщение работодателю</div>
24 <form class="modal__form" id="form_worker" name="form_worker" enctype="multipart/form-data" action="{{ route('worker.new_message') }}" method="POST"> 24 <form class="modal__form" id="form_worker" name="form_worker" enctype="multipart/form-data" action="{{ route('worker.new_message') }}" method="POST">
25 @csrf 25 @csrf
26 <div class="modal__form-item" style="display: none"> 26 <div class="modal__form-item" style="display: none">
27 Отправитель сообщения: 27 Отправитель сообщения:
28 <input type="text" id="send_user_id" name="send_user_id" class="input" placeholder="user_id" value=""> 28 <input type="text" id="send_user_id" name="send_user_id" class="input" placeholder="user_id" value="">
29 Получатель сообщения: 29 Получатель сообщения:
30 <input type="text" id="send_to_user_id" name="send_to_user_id" class="input" placeholder="to_user_id" value=""> 30 <input type="text" id="send_to_user_id" name="send_to_user_id" class="input" placeholder="to_user_id" value="">
31 Вакансия: 31 Вакансия:
32 <input type="text" id="send_vacancy" name="send_vacancy" class="input" placeholder="vacancy" value=""> 32 <input type="text" id="send_vacancy" name="send_vacancy" class="input" placeholder="vacancy" value="">
33 Должность: 33 Должность:
34 <input type="text" id="send_job_title_id" name="send_job_title_id" class="input" placeholder="vacancy" value="0"> 34 <input type="text" id="send_job_title_id" name="send_job_title_id" class="input" placeholder="vacancy" value="0">
35
36 </div> 35 </div>
37 <div class="modal__form-item send_title_div error_"> 36 <div class="modal__form-item send_title_div error_">
38 <input id="send_title" name="send_title" type="text" class="input" placeholder="Тема" required> 37 <input id="send_title" name="send_title" type="text" class="input" placeholder="Тема" required>
39 <label for="title">Не заполнено поле</label> 38 <label for="title">Не заполнено поле</label>
40 </div> 39 </div>
41 <div class="modal__form-item send_text_div"> 40 <div class="modal__form-item send_text_div">
42 <textarea id="i2" class="textarea" id="send_text" name="send_text" placeholder="Напишите текст с предложением о работе" required></textarea> 41 <textarea id="i2" class="textarea" id="send_text" name="send_text" placeholder="Напишите текст с предложением о работе" required></textarea>
43 <label for="i2">Не заполнено поле</label> 42 <label for="i2">Не заполнено поле</label>
44 </div> 43 </div>
45 <div class="modal__form-item"> 44 <div class="modal__form-item">
46 <div class="file"> 45 <div class="file">
47 <label class="file__input" id="btn_send_file" name="btn_send_file"> 46 <label class="file__input" id="btn_send_file" name="btn_send_file">
48 <input type="file" name="send_file" id="send_name"> 47 <input type="file" name="send_file" id="send_name">
49 <span class="button button_light"> 48 <span class="button button_light">
50 <svg> 49 <svg>
51 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> 50 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
52 </svg> 51 </svg>
53 Прикрепить файл-документ 52 Прикрепить файл-документ
54 </span> 53 </span>
55 </label> 54 </label>
56 55
57 <div class="file__list" id="div_file" name="div_file"> 56 <div class="file__list" id="div_file" name="div_file">
58 <div class="file__list-item"> 57 <div class="file__list-item">
59 <div class="file__list-item-left"> 58 <div class="file__list-item-left">
60 <svg> 59 <svg>
61 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use> 60 <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use>
62 </svg> 61 </svg>
63 <span id="send_name_file" name="send_name_file"></span> 62 <span id="send_name_file" name="send_name_file"></span>
64 </div> 63 </div>
65 <button type="button" class="file__list-item-right js-parent-remove"> 64 <button type="button" class="file__list-item-right js-parent-remove">
66 <svg> 65 <svg>
67 <use xlink:href="{{ asset('images/sprite.svg#cross-bold') }}"></use> 66 <use xlink:href="{{ asset('images/sprite.svg#cross-bold') }}"></use>
68 </svg> 67 </svg>
69 </button> 68 </button>
70 </div> 69 </div>
71 </div> 70 </div>
72 </div> 71 </div>
73 </div> 72 </div>
74 <div class="modal__form-item"> 73 <div class="modal__form-item">
75 <button type="submit" id="submit_form_worker" name="submit_form_worker" class="button">Отправить</button> 74 <button type="submit" id="submit_form_worker" name="submit_form_worker" class="button">Отправить</button>
76 </div> 75 </div>
77 </form> 76 </form>
78 </div> 77 </div>
79 </div> 78 </div>
80 79
81 80
resources/views/new_sky.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 $(document).on('change', '.jobs', function() { 5 $(document).on('change', '.jobs', function() {
6 var val = $(this).val(); 6 var val = $(this).val();
7 7
8 console.log('Click change...'); 8 console.log('Click change...');
9 $.ajax({ 9 $.ajax({
10 type: "GET", 10 type: "GET",
11 url: "{{ route('vacancies') }}", 11 url: "{{ route('vacancies') }}",
12 data: "job="+val, 12 data: "job="+val,
13 success: function (data) { 13 success: function (data) {
14 console.log('Выбор должности'); 14 console.log('Выбор должности');
15 console.log(data); 15 console.log(data);
16 $('#block_ajax').html(data); 16 $('#block_ajax').html(data);
17 }, 17 },
18 headers: { 18 headers: {
19 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 19 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
20 }, 20 },
21 error: function (data) { 21 error: function (data) {
22 data = JSON.stringify(data); 22 data = JSON.stringify(data);
23 console.log('Error: ' + data); 23 console.log('Error: ' + data);
24 } 24 }
25 }); 25 });
26 }); 26 });
27 </script> 27 </script>
28 @endsection 28 @endsection
29 29
30 @section('content') 30 @section('content')
31 <section class="thing"> 31 <section class="thing">
32 <div class="container"> 32 <div class="container">
33 <form class="thing__body"> 33 <form class="thing__body">
34 <ul class="breadcrumbs thing__breadcrumbs"> 34 <ul class="breadcrumbs thing__breadcrumbs">
35 <li><a href="{{ route('index') }}">Главная</a></li> 35 <li><a href="{{ route('index') }}">Главная</a></li>
36 <li><b>Вакансии</b></li> 36 <li><b>Вакансии</b></li>
37 </ul> 37 </ul>
38 <h1 class="thing__title">Вакансии</h1> 38 <h1 class="thing__title">Вакансии</h1>
39 <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для 39 <p class="thing__text">
40 существующих финансовых и административных условий.</p> 40 Для удобного и быстрого поиска по определенной должности воспользуйтесь фильтром. В выпадающем списке выберите должность.
41 Если Вы хотите просмотреть общий список вакансий выберете "Все должности"
42 </p>
41 <div class="select select_search thing__select"> 43 <div class="select select_search thing__select">
42 <div class="select__icon"> 44 <div class="select__icon">
43 <svg> 45 <svg>
44 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use> 46 <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
45 </svg> 47 </svg>
46 </div> 48 </div>
47 <select class="js-select2 jobs" id="jobs" name="jobs"> 49 <select class="js-select2 jobs" id="jobs" name="jobs">
48 <option value="0">Выберите должность</option> 50 <option value="0">Выберите должность</option>
49 @if ($Job_title->count()) 51 @if ($Job_title->count())
50 @foreach($Job_title as $JT) 52 @foreach($Job_title as $JT)
51 <option value="{{ $JT->id }}" @if ((isset($_GET['job'])) && ($_GET['job'] == $JT->id)) selected @endif>{{ $JT->name }}</option> 53 <option value="{{ $JT->id }}" @if ((isset($_GET['job'])) && ($_GET['job'] == $JT->id)) selected @endif>{{ $JT->name }}</option>
52 @endforeach 54 @endforeach
53 @endif 55 @endif
54 </select> 56 </select>
55 </div> 57 </div>
56 </form> 58 </form>
57 </div> 59 </div>
58 </section> 60 </section>
59 61
60 62
61 <main class="main"> 63 <main class="main">
62 <div class="container"> 64 <div class="container">
63 <div class="main__vacancies"> 65 <div class="main__vacancies">
64 <h2 class="main__vacancies-title">Категории вакансий</h2> 66 <h2 class="main__vacancies-title">Категории вакансий</h2>
65 <div class="vacancies__body"> 67 <div class="vacancies__body">
66 <!--<button class="vacancies__more button button_more button_light js-toggle js-parent-toggle"> 68 <!--<button class="vacancies__more button button_more button_light js-toggle js-parent-toggle">
67 <span>Показать ещё</span> 69 <span>Показать ещё</span>
68 <span>Скрыть</span> 70 <span>Скрыть</span>
69 </button>--> 71 </button>-->
70 <div class="vacancies__list" id="block_ajax" name="block_ajax"> 72 <div class="vacancies__list" id="block_ajax" name="block_ajax">
71 @foreach($Main_Job as $key => $it_main) 73 @foreach($Main_Job as $key => $it_main)
72 <div class="vacancies__list-col"> 74 <div class="vacancies__list-col">
73 @include('block_real_new', ['it_main' => $it_main, 'category' => $key]) 75 @include('block_real_new', ['it_main' => $it_main, 'category' => $key])
74 </div> 76 </div>
75 @endforeach 77 @endforeach
76 <!--_foreach (BigFlot as $key => $flot) 78 <!--_foreach (BigFlot as $key => $flot)
77 <div class="vacancies__list-col"> 79 <div class="vacancies__list-col">
78 _include('block_real', ['flot' => $flot, 'position' => $Position[$key]]) 80 _include('block_real', ['flot' => $flot, 'position' => $Position[$key]])
79 </div> 81 </div>
80 _endforeach--> 82 _endforeach-->
81 </div> 83 </div>
82 </div> 84 </div>
83 </div> 85 </div>
84 </div> 86 </div>
85 </main> 87 </main>
86 88
87 </div> 89 </div>
88 @endsection 90 @endsection
89 91
resources/views/resume/resume_blocks.blade.php
1 @if ($resumes->count()) 1 @if ($resumes->count())
2 @foreach ($resumes as $res) 2 @foreach ($resumes as $res)
3 <div class="main__resume-base-body-item"> 3 <div class="main__resume-base-body-item">
4 <div class="main__resume-base-body-item-wrapper"> 4 <div class="main__resume-base-body-item-wrapper">
5 <div> 5 <div>
6 <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"> 6 <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">
7 <div> 7 <div>
8 <div class="main__resume-base-body-item-buttons"> 8 <div class="main__resume-base-body-item-buttons">
9 <button type="button" data-id="{{ $res->id }}" id="elem{{ $res->id }}" class="like js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($res) }}" data-val="{{ $res->id }}"> 9 <button type="button"
10 data-id="{{ $res->id }}"
11 id="elem{{ $res->id }}"
12 class="like js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($res) }}"
13 data-val="{{ $res->id }}"
14 >
10 <svg> 15 <svg>
11 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use> 16 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
12 </svg> 17 </svg>
13 <span class="to-favorites">В избранное</span> 18 <span class="to-favorites">В избранное</span>
14 <span class="in-favorites">В избранном</span> 19 <span class="in-favorites">В избранном</span>
15 </button> 20 </button>
16 21
17 @guest 22 @guest
18 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}' 23 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
19 class="chat js-toggle js_it_button"> 24 class="chat js-toggle js_it_button">
20 <svg> 25 <svg>
21 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> 26 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
22 </svg> 27 </svg>
23 <span>Написать</span> 28 <span>Написать</span>
24 </button> 29 </button>
25 @else 30 @else
26 @if (App\Classes\StatusUser::Status()==0) 31 @if (App\Classes\StatusUser::Status()==0)
27 @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message)) 32 @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message))
28 <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}'> 33 <button type="button" class="chat js-toggle js_it_button" data-fancybox data-src="#send2" data-vacancy="0" data-uid="{{ Auth::user()->id }}" data-tuid="{{ $res->users->id }}" data-options='{"touch":false,"autoFocus":false}'>
29 <svg> 34 <svg>
30 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> 35 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
31 </svg> 36 </svg>
32 <span>Написать</span> 37 <span>Написать</span>
33 </button> 38 </button>
34 @endif 39 @endif
35 @else 40 @else
36 <button type="button" data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}' 41 <button type="button" data-fancybox data-src="#question2" data-options='{"touch":false,"autoFocus":false}'
37 class="chat js-toggle js_it_button"> 42 class="chat js-toggle js_it_button">
38 <svg> 43 <svg>
39 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use> 44 <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
40 </svg> 45 </svg>
41 <span>Написать</span> 46 <span>Написать</span>
42 </button> 47 </button>
43 @endif 48 @endif
44 @endif 49 @endif
45 50
46 <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Подробнее</a> 51 <a href="{{ route('resume_profile', ['worker' => $res->id]) }}" class="button button_light main__resume-base-body-item-link">Подробнее</a>
47 </div> 52 </div>
48 </div> 53 </div>
49 </div> 54 </div>
50 <div class="main__resume-base-body-item-inner"> 55 <div class="main__resume-base-body-item-inner">
51 <div class="horizontal"> 56 <div class="horizontal">
52 <div class="main__resume-base-item-status @if ($res->status_work == 0) looking-for-job @endif"> 57 <div class="main__resume-base-item-status @if ($res->status_work == 0) looking-for-job @endif">
53 {{ $status_work[$res->status_work] }} 58 {{ $status_work[$res->status_work] }}
54 </div> 59 </div>
55 <div class="main__resume-base-item-updated-at"> 60 <div class="main__resume-base-item-updated-at">
56 Обновлено: {{ date('d.m.Y', strtotime($res->updated_at)) }} 61 Обновлено: {{ date('d.m.Y', strtotime($res->updated_at)) }}
57 </div> 62 </div>
58 </div> 63 </div>
59 <div> 64 <div>
60 <b>Предпочтение по типу судна:</b> 65 <b>Предпочтение по типу судна:</b>
61 <span>{{ $res->boart_type_preference ?? '-' }}</span> 66 <span>{{ $res->boart_type_preference ?? '-' }}</span>
62 </div> 67 </div>
63 <div> 68 <div>
64 <b>ФИО:</b> 69 <b>ФИО:</b>
65 <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span> 70 <span>@if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif</span>
66 </div> 71 </div>
67 <div> 72 <div>
68 <b>Наличие визы:</b> 73 <b>Наличие визы:</b>
69 <span>{{ $res->visa_available ?? '-' }}</span> 74 <span>{{ $res->visa_available ?? '-' }}</span>
70 </div> 75 </div>
71 <div> 76 <div>
72 <b>Возраст:</b> 77 <b>Возраст:</b>
73 <span>{{ $res->old_year ?? '-' }}</span> 78 <span>{{ $res->old_year ?? '-' }}</span>
74 </div> 79 </div>
75 <div> 80 <div>
76 <b>Наличие танкерных документов:</b> 81 <b>Наличие танкерных документов:</b>
77 <span>{{ $res->tanker_documents_available ?? '-' }}</span> 82 <span>{{ $res->tanker_documents_available ?? '-' }}</span>
78 </div> 83 </div>
79 <div> 84 <div>
80 <b>Желаемые вакансии:</b> 85 <b>Желаемые вакансии:</b>
81 <span> 86 <span>
82 @if ($res->job_titles->count()) 87 @if ($res->job_titles->count())
83 @foreach ($res->job_titles as $job_title) 88 @foreach ($res->job_titles as $job_title)
84 {{ $job_title->name }} 89 {{ $job_title->name }}
85 @if (!$loop->last) / @endif 90 @if (!$loop->last) / @endif
86 @endforeach 91 @endforeach
87 @else 92 @else
88 - 93 -
89 @endif 94 @endif
90 </span> 95 </span>
91 </div> 96 </div>
92 <div> 97 <div>
93 <b>Наличие подтверждения для работы на ВВП:</b> 98 <b>Наличие подтверждения для работы на ВВП:</b>
94 <span>{{ $res->confirmation_work_for_vvp ?? '-' }}</span> 99 <span>{{ $res->confirmation_work_for_vvp ?? '-' }}</span>
95 </div> 100 </div>
96 <div> 101 <div>
97 <b>Пожелание к З/П:</b> 102 <b>Пожелание к З/П:</b>
98 <span>{{ $res->salary_expectations ?? '-' }}</span> 103 <span>{{ $res->salary_expectations ?? '-' }}</span>
99 </div> 104 </div>
100 <div> 105 <div>
101 <b>Город проживания</b> 106 <b>Город проживания</b>
102 <span>{{ $res->city ?? "-" }}</span> 107 <span>{{ $res->city ?? "-" }}</span>
103 </div> 108 </div>
104 <div> 109 <div>
105 <b>Уровень английского:</b> 110 <b>Уровень английского:</b>
106 <span>{{ $res->english_level ?? '-' }}</span> 111 <span>{{ $res->english_level ?? '-' }}</span>
107 </div> 112 </div>
108 <div> 113 <div>
109 <b>Номер телефона:</b> 114 <b>Номер телефона:</b>
110 <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone ?? '-' }}</a></span> 115 <span><a href="tel:{{ $res->telephone }}">{{ $res->telephone ?? '-' }}</a></span>
111 </div> 116 </div>
112 <div> 117 <div>
113 <b>Дата готовности к посадке:</b> 118 <b>Дата готовности к посадке:</b>
114 <span>{{ $res->ready_boart_date ?? '-' }}</span> 119 <span>{{ $res->ready_boart_date ?? '-' }}</span>
115 </div> 120 </div>
116 <div> 121 <div>
117 <b>E-mail:</b> 122 <b>E-mail:</b>
118 <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span> 123 <span><a href="mailto:{{ $res->email }}">{{ $res->email }}</a></span>
119 </div> 124 </div>
120 </div> 125 </div>
121 </div> 126 </div>
122 </div> 127 </div>
123 @endforeach 128 @endforeach
124 129
125 {{ $resumes->appends($_GET)->links('paginate') }} 130 {{ $resumes->appends($_GET)->links('paginate') }}
126 @else 131 @else
127 <p>По данному запросу ничего не найдено</p> 132 <p>По данному запросу ничего не найдено</p>
128 @endif 133 @endif
129 134
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')-->
9 <script> 8 <script>
10 $(document).on('click', '.js_send_it_button', function() { 9 $(document).on('click', '.js_send_it_button', function() {
11 var this_ = $(this); 10 var this_ = $(this);
12 var code_user_id = this_.attr('data-uid'); 11 var code_user_id = this_.attr('data-uid');
13 var code_to_user_id = this_.attr('data-tuid'); 12 var code_to_user_id = this_.attr('data-tuid');
14 var code_vacancy = this_.attr('data-vacancy'); 13 var code_vacancy = this_.attr('data-vacancy');
15 var user_id = $('#_user_id'); 14 var user_id = $('#_user_id');
16 var to_user_id = $('#_to_user_id'); 15 var to_user_id = $('#_to_user_id');
17 var vacancy = $('#_vacancy'); 16 var vacancy = $('#_vacancy');
18 17
19 console.log('Клик на кнопки...');
20
21 user_id.val(code_user_id); 18 user_id.val(code_user_id);
22 to_user_id.val(code_to_user_id); 19 to_user_id.val(code_to_user_id);
23 vacancy.val(code_vacancy); 20 vacancy.val(code_vacancy);
24 }); 21 });
25 </script> 22 </script>
26 <script> 23 <script>
27 $(document).on('click', '.js_send_for_emp', function() { 24 $(document).on('click', '.js_send_for_emp', function() {
28 var this_ = $(this); 25 var this_ = $(this);
29 var code_user_id = this_.attr('data-uid'); 26 var code_user_id = this_.attr('data-uid');
30 var code_to_user_id = this_.attr('data-tuid'); 27 var code_to_user_id = this_.attr('data-tuid');
31 var code_vacancy = this_.attr('data-vacancy'); 28 var code_vacancy = this_.attr('data-vacancy');
32 var user_id = $('#send_user_id'); 29 var user_id = $('#send_user_id');
33 var to_user_id = $('#send_to_user_id'); 30 var to_user_id = $('#send_to_user_id');
34 var vacancy = $('#send_vacancy'); 31 var vacancy = $('#send_vacancy');
35 32
36 console.log('code_to_user_id='+code_to_user_id);
37 console.log('code_user_id='+code_user_id);
38 console.log('code_vacancy='+code_vacancy);
39 console.log('Клик на кнопке...');
40
41 user_id.val(code_user_id); 33 user_id.val(code_user_id);
42 to_user_id.val(code_to_user_id); 34 to_user_id.val(code_to_user_id);
43 vacancy.val(code_vacancy); 35 vacancy.val(code_vacancy);
44 }); 36 });
45 </script> 37 </script>
46 @include('js.favorite-vacancy-45') 38 @include('js.favorite-vacancy-45')
47 @endsection 39 @endsection
48 40
49 @section('content') 41 @section('content')
50 <main class="main"> 42 <main class="main">
51 <div class="container"> 43 <div class="container">
52 <ul class="breadcrumbs main__breadcrumbs"> 44 <ul class="breadcrumbs main__breadcrumbs">
53 <li><a href="{{ route('index') }}">Главная</a></li> 45 <li><a href="{{ route('index') }}">Главная</a></li>
54 <li><a href="{{ route('vacancies') }}">Вакансии</a></li> 46 <li><a href="{{ route('vacancies') }}">Вакансии</a></li>
55 <li><b>{{ $title }}</b></li> 47 <li><b>{{ $title }}</b></li>
56 </ul> 48 </ul>
57 <div class="main__employer-page"> 49 <div class="main__employer-page">
58 50
59 @if (isset($Query[0]->employer)) 51 @if (isset($Query[0]->employer))
60 <h2 class="main__employer-page-title">О компании</h2> 52 <h2 class="main__employer-page-title">О компании</h2>
61 <div class="main__employer-page-two-item-toper"> 53 <div class="main__employer-page-two-item-toper">
62 @if (!empty($Query[0]->employer->logo)) 54 @if (!empty($Query[0]->employer->logo))
63 <img src="{{ asset(Storage::url($Query[0]->employer->logo)) }}" alt="{{ $Query[0]->employer->name }}"> 55 <img src="{{ asset(Storage::url($Query[0]->employer->logo)) }}" alt="{{ $Query[0]->employer->name }}">
64 @else 56 @else
65 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Query[0]->employer->name }}"> 57 <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Query[0]->employer->name }}">
66 @endif 58 @endif
67 <span>{{ $Query[0]->employer->name_company }}</span> 59 <span>{{ $Query[0]->employer->name_company }}</span>
68 </div> 60 </div>
69 61
70 <div class="main__employer-page-info"> 62 <div class="main__employer-page-info">
71 <div class="main__employer-page-item"> 63 <div class="main__employer-page-item">
72 <b> Адрес компании</b> 64 <b> Адрес компании</b>
73 <span> 65 <span>
74 {{ $Query[0]->employer->address }} 66 {{ $Query[0]->employer->address }}
75 </span> 67 </span>
76 </div> 68 </div>
77 <div class="main__employer-page-item"> 69 <div class="main__employer-page-item">
78 <b>Сайт</b> 70 <b>Сайт</b>
79 <span> 71 <span>
80 <a href="{{ $Query[0]->employer->site }}">{{ $Query[0]->employer->site }}</a> 72 <a href="{{ $Query[0]->employer->site }}">{{ $Query[0]->employer->site }}</a>
81 </span> 73 </span>
82 </div> 74 </div>
83 <div class="main__employer-page-item"> 75 <div class="main__employer-page-item">
84 <b>Почта</b> 76 <b>Почта</b>
85 <span> 77 <span>
86 <a href="{{ $Query[0]->employer->email }}">{{ $Query[0]->employer->email }}</a> 78 <a href="{{ $Query[0]->employer->email }}">{{ $Query[0]->employer->email }}</a>
87 </span> 79 </span>
88 </div> 80 </div>
89 <div class="main__employer-page-item"> 81 <div class="main__employer-page-item">
90 <b>Телефон</b> 82 <b>Телефон</b>
91 <span> 83 <span>
92 <a href="tel:{{ $Query[0]->employer->telephone }}">{{ $Query[0]->employer->telephone }}</a> 84 <a href="tel:{{ $Query[0]->employer->telephone }}">{{ $Query[0]->employer->telephone }}</a>
93 </span> 85 </span>
94 </div> 86 </div>
95 </div> 87 </div>
96 @else 88 @else
97 <div class="main__employer-page-info"> 89 <div class="main__employer-page-info">
98 <div class="main__employer-page-item"> 90 <div class="main__employer-page-item">
99 <b>Ничего не найдено</b> 91 <b>Ничего не найдено</b>
100 <span> 92 <span>
101 Нет данных о компании 93 Нет данных о компании
102 </span> 94 </span>
103 </div> 95 </div>
104 </div> 96 </div>
105 @endif 97 @endif
106 <h2 class="main__employer-page-title">{{ $Query[0]->name }}</h2> 98 <h2 class="main__employer-page-title">{{ $Query[0]->name }}</h2>
107 <h3 class="main__employer-page-title_">Описание вакансии</h3> 99 <h3 class="main__employer-page-title_">Описание вакансии</h3>
108 100
109 </div> 101 </div>
110 102
111 @foreach ($Query as $Q) 103 @foreach ($Query as $Q)
112 <div class="main__vacancies-item-page main__employer-page-two-item"> 104 <div class="main__vacancies-item-page main__employer-page-two-item">
113 <!--<div class="main__employer-page-two-item-text"> 105 <div class="main__employer-page-two-item-text">
114 <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор 106 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
115 специалистов на следующие должности:</div> 107 <div class="main__employer-page-two-item-text-body">
116 <div class="main__employer-page-two-item-text-links"> 108 {!! $Q->text !!}
117 if (isset($Q->jobs)) 109 </div>
118 foreach ($Q->jobs as $key => $j)
119 <a>“{ $j->name }}”
120 <!-- з/п от 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 рублей (на руки)-->
121 <!--</a>
122 endforeach
123 endif
124 </div> 110 </div>
125 </div>--> 111 <div class="main__employer-page-two-item-tags">
126 <div class="main__employer-page-two-item-text"> 112 @if (!empty($Q->jobs_code[0]->position_ship))
127 <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div> 113 <span class="main__employer-page-two-item-tag">#{{ $Q->jobs_code[0]->position_ship }}</span>
128 <div class="main__employer-page-two-item-text-body"> 114 @else
129 {!! $Q->text !!} 115 @if (isset($Q->jobs))
116 @foreach ($Q->jobs as $key => $j)
117 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span>
118 @endforeach
119 @endif
120 @endif
130 </div> 121 </div>
131 </div> 122 <br>
132 <!--<div class="main__employer-page-two-item-text"> 123 <div class="main__employer-page-two-item-buttons">
133 <div class="main__employer-page-two-item-text-name">Наши ожидания:</div> 124 @guest
134 <div class="main__employer-page-two-item-text-body"> 125 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
135 !! $Q->description !!} 126 class="button main__employer-page-two-item-button">Откликнуться</button>
127 @else
128 @if (App\Classes\StatusUser::Status()==1)
129 <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}'
130 class="button main__employer-page-two-item-button js_send_for_emp">Откликнуться</button>
131 @else
132 <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}'
133 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
134 @endif
135 @endguest
136 </div> 136 </div>
137 </div> 137 <div class="main__employer-page-two-item-bottom">
138 <div class="main__employer-page-two-item-text"> 138 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y', strtotime($Q->updated_at)) }}</div>
139 <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div> 139 <button type="button" id="like{{ $Q->id }}" 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) }}">
140 <div class="main__employer-page-two-item-text-body"> 140 <svg>
141 !! $Q->contacts_emails !!} 141 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
142 </div> 142 </svg>
143 <div class="main__employer-page-two-item-text"> 143 </button>
144 <div class="main__employer-page-two-item-text-name">Или звоните:</div>
145 <div class="main__employer-page-two-item-text-body">
146 !! $Q->contacts_telephones !!}
147 </div> 144 </div>
148 </div>-->
149
150 <div class="main__employer-page-two-item-tags">
151 @if (!empty($Q->jobs_code[0]->position_ship))
152 <span class="main__employer-page-two-item-tag">#{{ $Q->jobs_code[0]->position_ship }}</span>
153 @else
154 @if (isset($Q->jobs))
155 @foreach ($Q->jobs as $key => $j)
156 <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span>
157 @endforeach
158 @endif
159 @endif
160 </div>
161 <br>
162 <div class="main__employer-page-two-item-buttons">
163 @guest
164 <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
165 class="button main__employer-page-two-item-button">Откликнуться</button>
166 @else
167 @if (App\Classes\StatusUser::Status()==1)
168 <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}'
169 class="button main__employer-page-two-item-button js_send_for_emp">Откликнуться</button>
170 @else
171 <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}'
172 class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
173 @endif
174 @endguest
175 </div>
176 <div class="main__employer-page-two-item-bottom">
177 <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y', strtotime($Q->updated_at)) }}</div>
178 <button type="button" id="like{{ $Q->id }}" 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) }}">
179 <svg>
180 <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
181 </svg>
182 </button>
183 </div> 145 </div>
184
185 </div>
186
187 @endforeach 146 @endforeach
resources/views/workers/cabinet.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 $(function() { 5 $(function() {
6 $('.cabinet__avatar-form [type="file"][name="photo"]').change(function (event) { 6 $('.cabinet__avatar-form [type="file"][name="photo"]').change(function (event) {
7 var form = $(this).closest('form'); 7 var form = $(this).closest('form');
8 const file = event.target.files[0]; 8 const file = event.target.files[0];
9 9
10 if (file) { 10 if (file) {
11 var img_wrap = $('.cabinet__avatar-pic'); 11 var img_wrap = $('.cabinet__avatar-pic');
12 var img = $('<img src="#"/>'); 12 var img = $('<img src="#"/>');
13 const reader = new FileReader(); 13 const reader = new FileReader();
14 14
15 reader.onload = function(e) { 15 reader.onload = function(e) {
16 img.attr('src', e.target.result); 16 img.attr('src', e.target.result);
17 img_wrap.find('svg, img').remove(); 17 img_wrap.find('svg, img').remove();
18 img_wrap.append(img); 18 img_wrap.append(img);
19 19
20 setTimeout(function () { 20 setTimeout(function () {
21 form.submit(); 21 form.submit();
22 }, 1000); 22 }, 1000);
23 }; 23 };
24 24
25 reader.readAsDataURL(file); 25 reader.readAsDataURL(file);
26 } 26 }
27 }); 27 });
28 }); 28 });
29 29
30 $(document).on('click', '#old_year', function() { 30 $(document).on('click', '#old_year', function() {
31 var this_ = $(this); 31 var this_ = $(this);
32 var val = this_.val(); 32 var val = this_.val();
33 33
34 if (val < 0) 34 if (val < 0)
35 $('#old_year').val(0); 35 $('#old_year').val(0);
36 }); 36 });
37 </script> 37 </script>
38 @endsection 38 @endsection
39 39
40 @section('content') 40 @section('content')
41 @php 41 @php
42 $user = $worker->users 42 $user = $worker->users
43 @endphp 43 @endphp
44 <section class="cabinet"> 44 <section class="cabinet">
45 <div class="container"> 45 <div class="container">
46 <ul class="breadcrumbs cabinet__breadcrumbs"> 46 <ul class="breadcrumbs cabinet__breadcrumbs">
47 <li><a href="{{ route('index') }}">Главная</a></li> 47 <li><a href="{{ route('index') }}">Главная</a></li>
48 <li><b>Личный кабинет</b></li> 48 <li><b>Личный кабинет</b></li>
49 </ul> 49 </ul>
50 <div class="cabinet__wrapper"> 50 <div class="cabinet__wrapper">
51 <div class="cabinet__side"> 51 <div class="cabinet__side">
52 <div class="cabinet__side-toper"> 52 <div class="cabinet__side-toper">
53 @include('workers.emblema') 53 @include('workers.emblema')
54 54
55 </div> 55 </div>
56 56
57 @include('workers.menu', ['item' => 1]) 57 @include('workers.menu', ['item' => 1])
58 </div> 58 </div>
59 <div class="cabinet__body"> 59 <div class="cabinet__body">
60 <div class="cabinet__body-item"> 60 <div class="cabinet__body-item">
61 <div class="cabinet__anketa"> 61 <div class="cabinet__anketa">
62 <h2 class="title cabinet__title">Моя анкета</h2> 62 <h2 class="title cabinet__title">Моя анкета</h2>
63 <div class="cabinet__anketa-buttons"> 63 <div class="cabinet__anketa-buttons">
64 <a href="{{ route('worker.up', ['worker' => $worker->id]) }}" class="button">Поднять резюме</a> 64 <a href="{{ route('worker.up', ['worker' => $worker->id]) }}" class="button">Поднять резюме</a>
65 <a href="{{ route('resume_download', ['worker' => $worker->id]) }}" target="_blank" class="button"> 65 <a href="{{ route('resume_download', ['worker' => $worker->id]) }}" target="_blank" class="button">
66 <svg> 66 <svg>
67 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use> 67 <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
68 </svg> 68 </svg>
69 Скачать резюме 69 Скачать резюме
70 </a> 70 </a>
71 </div> 71 </div>
72 </div> 72 </div>
73 </div> 73 </div>
74 74
75 <div class="cabinet__body-item"> 75 <div class="cabinet__body-item">
76 <div class="cabinet__stats"> 76 <div class="cabinet__stats">
77 <h3 class="cabinet__subtitle cabinet__stats-title">Статистика</h3> 77 <h3 class="cabinet__subtitle cabinet__stats-title">Статистика</h3>
78 <div class="cabinet__stats-body"> 78 <div class="cabinet__stats-body">
79 <div class="cabinet__stats-item"> 79 <div class="cabinet__stats-item">
80 <svg> 80 <svg>
81 <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use> 81 <use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use>
82 </svg> 82 </svg>
83 <span>Просмотров:</span> 83 <span>Просмотров:</span>
84 <b>@if (isset($stat[0]->lookin)) {{ $stat[0]->lookin }} @else 0 @endif</b> 84 <b>@if (isset($stat[0]->lookin)) {{ $stat[0]->lookin }} @else 0 @endif</b>
85 </div> 85 </div>
86 <div class="cabinet__stats-item"> 86 <div class="cabinet__stats-item">
87 <svg> 87 <svg>
88 <use xlink:href="{{ asset('images/sprite.svg#warning') }}"></use> 88 <use xlink:href="{{ asset('images/sprite.svg#warning') }}"></use>
89 </svg> 89 </svg>
90 <span>Отзывов:</span> 90 <span>Отзывов:</span>
91 <b>@if(isset($worker->response)) {{ $worker->response->count() }} @else 0 @endif</b> 91 <b>@if(isset($worker->response)) {{ $worker->response->count() }} @else 0 @endif</b>
92 </div> 92 </div>
93 </div> 93 </div>
94 <div class="cabinet__stats-subtitle">Анкета заполнена на {{ $persent }}%</div> 94 <div class="cabinet__stats-subtitle">Анкета заполнена на {{ $persent }}%</div>
95 <div class="cabinet__stats-line"> 95 <div class="cabinet__stats-line">
96 <span style="width:{{ $persent }}%"></span> 96 <span style="width:{{ $persent }}%"></span>
97 </div> 97 </div>
98 <div class="cabinet__stats-bottom">Заполните профиль, чтобы повысить процент анкеты на 80%</div> 98 <div class="cabinet__stats-bottom">Заполните профиль, чтобы повысить процент анкеты на 80%</div>
99 </div> 99 </div>
100 </div> 100 </div>
101 101
102 <form class="" action="{{ route('worker.cabinet_save_foto', ['worker' => $worker->id]) }}" enctype="multipart/form-data" method="POST"> 102 <form class="" action="{{ route('worker.cabinet_save_foto', ['worker' => $worker->id]) }}" enctype="multipart/form-data" method="POST">
103 @csrf 103 @csrf
104 @include('messages_error') 104 @include('messages_error')
105 105
106 <div class="cabinet__body-item"> 106 <div class="cabinet__body-item">
107 <h3 class="cabinet__subtitle">Профиль</h3> 107 <h3 class="cabinet__subtitle">Профиль</h3>
108 <div class="cabinet__avatar"> 108 <div class="cabinet__avatar">
109 <div class="cabinet__avatar-pic"> 109 <div class="cabinet__avatar-pic">
110 110
111 @if (!empty($worker->photo)) 111 @if (!empty($worker->photo))
112 <img src="{{ asset(Storage::url($worker->photo)) }}"/> 112 <img src="{{ asset(Storage::url($worker->photo)) }}"/>
113 @else 113 @else
114 <svg> 114 <svg>
115 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use> 115 <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
116 </svg> 116 </svg>
117 @endif 117 @endif
118 </div> 118 </div>
119 <div class="cabinet__avatar-form"> 119 <div class="cabinet__avatar-form">
120 <label class="file"> 120 <label class="file">
121 <span class="file__input flex"> 121 <span class="file__input flex">
122 <input type="file" name="photo" id="photo"> 122 <input type="file" name="photo" id="photo">
123 123
124 <span class="button mr-20"> 124 <span class="button mr-20">
125 <svg> 125 <svg>
126 <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use> 126 <use xlink:href="{{ asset('images/sprite.svg#plus') }}"></use>
127 </svg> 127 </svg>
128 Загрузить 128 Загрузить
129 </span> 129 </span>
130 @if (!empty($worker->photo)) 130 @if (!empty($worker->photo))
131 <button type="submit" class="button">Удалить фото</button> 131 <button type="submit" class="button">Удалить фото</button>
132 @endif 132 @endif
133 </span> 133 </span>
134 </label> 134 </label>
135 <p class="cabinet__text">Загрузите фотографию в формате svg., jpg., jpeg., png.</p> 135 <p class="cabinet__text">Загрузите фотографию в формате svg., jpg., jpeg., png.</p>
136 </div> 136 </div>
137 </div> 137 </div>
138 </div> 138 </div>
139 </form> 139 </form>
140 140
141 <div class="cabinet__body-item mb-40"> 141 <div class="cabinet__body-item mb-40">
142 <h3 class="cabinet__subtitle font30">Основная информация</h3> 142 <h3 class="cabinet__subtitle font30">Основная информация</h3>
143 143
144 <div class="cabinet__inputs"> 144 <div class="cabinet__inputs">
145 <div class="cabinet__inputs_to_columns_wrap"> 145 <div class="cabinet__inputs_to_columns_wrap">
146 <div class="cabinet__inputs_to_column cabinet__inputs_to_columns_left"> 146 <div class="cabinet__inputs_to_column cabinet__inputs_to_columns_left">
147 <div class="cabinet__inputs-item form-group"> 147 <div class="cabinet__inputs-item form-group">
148 <label class="form-group__label">Фамилия:</label> 148 <label class="form-group__label">Фамилия:</label>
149 <div class="form-group__item"> 149 <div class="form-group__item">
150 {{ $user->surname }} 150 {{ $user->surname }}
151 </div> 151 </div>
152 </div> 152 </div>
153 <div class="cabinet__inputs-item form-group"> 153 <div class="cabinet__inputs-item form-group">
154 <label class="form-group__label">Имя:</label> 154 <label class="form-group__label">Имя:</label>
155 <div class="form-group__item"> 155 <div class="form-group__item">
156 {{ $user->name_man }} 156 {{ $user->name_man }}
157 </div> 157 </div>
158 </div> 158 </div>
159 <div class="cabinet__inputs-item form-group"> 159 <div class="cabinet__inputs-item form-group">
160 <label class="form-group__label">Отчество:</label> 160 <label class="form-group__label">Отчество:</label>
161 <div class="form-group__item"> 161 <div class="form-group__item">
162 {{ $user->surname2 }} 162 {{ $user->surname2 }}
163 </div> 163 </div>
164 </div> 164 </div>
165 <div class="cabinet__inputs-item form-group"> 165 <div class="cabinet__inputs-item form-group">
166 <label class="form-group__label">Возраст:</label> 166 <label class="form-group__label">Возраст:</label>
167 <div class="form-group__item"> 167 <div class="form-group__item">
168 {{ $worker->old_year ?? '-' }} 168 {{ $worker->old_year ?? '-' }}
169 </div> 169 </div>
170 </div> 170 </div>
171 <div class="cabinet__inputs-item form-group"> 171 <div class="cabinet__inputs-item form-group">
172 <label class="form-group__label">Статус:</label> 172 <label class="form-group__label">Статус:</label>
173 <div class="form-group__item"> 173 <div class="form-group__item">
174 {{ $status_work[$worker->status_work] ?? '-' }} 174 {{ $status_work[$worker->status_work] ?? '-' }}
175 </div> 175 </div>
176 </div> 176 </div>
177 <div class="cabinet__inputs-item form-group"> 177 <div class="cabinet__inputs-item form-group">
178 <label class="form-group__label">Желаемые вакансии:</label> 178 <label class="form-group__label">Желаемые вакансии:</label>
179 <div class="form-group__item"> 179 <div class="form-group__item">
180 @if ($worker->job_titles->count()) 180 @if ($worker->job_titles->count())
181 @foreach($worker->job_titles as $job_title) 181 @foreach($worker->job_titles as $job_title)
182 {{ $job_title->name }} 182 {{ $job_title->name }}
183 @if (!$loop->last) / @endif 183 @if (!$loop->last) / @endif
184 @endforeach 184 @endforeach
185 @endif 185 @endif
186 </div> 186 </div>
187 </div> 187 </div>
188 <div class="cabinet__inputs-item form-group"> 188 <div class="cabinet__inputs-item form-group">
189 <label class="form-group__label">Пожелания к З/П:</label> 189 <label class="form-group__label">Пожелания к З/П:</label>
190 <div class="form-group__item"> 190 <div class="form-group__item">
191 {{ $worker->salary_expectations ?? '-' }} 191 {{ $worker->salary_expectations ?? '-' }}
192 </div> 192 </div>
193 </div> 193 </div>
194 <div class="cabinet__inputs-item form-group"> 194 <div class="cabinet__inputs-item form-group">
195 <label class="form-group__label">Уровень английского:</label> 195 <label class="form-group__label">Уровень английского:</label>
196 <div class="form-group__item"> 196 <div class="form-group__item">
197 {{ $worker->english_level ?? '-' }} 197 {{ $worker->english_level ?? '-' }}
198 </div> 198 </div>
199 </div> 199 </div>
200 <div class="cabinet__inputs-item form-group"> 200 <div class="cabinet__inputs-item form-group">
201 <label class="form-group__label">Дата готовности к посадке:</label> 201 <label class="form-group__label">Дата готовности к посадке:</label>
202 <div class="form-group__item"> 202 <div class="form-group__item">
203 {{ $worker->ready_boart_date ?? '-' }} 203 {{ $worker->ready_boart_date ?? '-' }}
204 </div> 204 </div>
205 </div> 205 </div>
206 <div class="cabinet__inputs-item form-group"> 206 <div class="cabinet__inputs-item form-group">
207 <label class="form-group__label">Предпочтение по типу судна:</label> 207 <label class="form-group__label">Предпочтение по типу судна:</label>
208 <div class="form-group__item"> 208 <div class="form-group__item">
209 {{ $worker->boart_type_preference ?? '-' }} 209 {{ $worker->boart_type_preference ?? '-' }}
210 </div> 210 </div>
211 </div> 211 </div>
212 </div> 212 </div>
213 213
214 <div class="cabinet__inputs_to_column cabinet__inputs_to_columns_right"> 214 <div class="cabinet__inputs_to_column cabinet__inputs_to_columns_right">
215 <div class="cabinet__inputs-item form-group"> 215 <div class="cabinet__inputs-item form-group">
216 <label class="form-group__label">Наличие визы:</label> 216 <label class="form-group__label">Наличие визы:</label>
217 <div class="form-group__item"> 217 <div class="form-group__item">
218 {{ $worker->visa_available }} 218 {{ $worker->visa_available }}
219 </div> 219 </div>
220 </div> 220 </div>
221 221
222 222
223 <div class="cabinet__inputs-item form-group"> 223 <div class="cabinet__inputs-item form-group">
224 <label class="form-group__label">Наличие танкерных документов:</label> 224 <label class="form-group__label">Наличие танкерных документов:</label>
225 <div class="form-group__item"> 225 <div class="form-group__item">
226 {{ $worker->tanker_documents_available ?? '-' }} 226 {{ $worker->tanker_documents_available ?? '-' }}
227 </div> 227 </div>
228 </div> 228 </div>
229 229
230 230
231 <div class="cabinet__inputs-item form-group"> 231 <div class="cabinet__inputs-item form-group">
232 <label class="form-group__label">Наличие подтверждения для работы на ВВП:</label> 232 <label class="form-group__label">Наличие подтверждения для работы на ВВП:</label>
233 <div class="form-group__item"> 233 <div class="form-group__item">
234 {{ $worker->confirmation_work_for_vvp ?? '-' }} 234 {{ $worker->confirmation_work_for_vvp ?? '-' }}
235 </div> 235 </div>
236 </div> 236 </div>
237 237
238 238
239 <div class="cabinet__inputs-item form-group"> 239 <div class="cabinet__inputs-item form-group">
240 <label class="form-group__label">Наличие военного билета / приписного свидетельства:</label> 240 <label class="form-group__label">Наличие военного билета / приписного свидетельства:</label>
241 <div class="form-group__item"> 241 <div class="form-group__item">
242 {{ $worker->military_id_available ?? '-' }} 242 {{ $worker->military_id_available ?? '-' }}
243 </div> 243 </div>
244 </div> 244 </div>
245 245
246 246
247 <div class="cabinet__inputs-item form-group"> 247 <div class="cabinet__inputs-item form-group">
248 <label class="form-group__label">Город проживания:</label> 248 <label class="form-group__label">Город проживания:</label>
249 <div class="form-group__item"> 249 <div class="form-group__item">
250 {{ $worker->city ?? '-' }} 250 {{ $worker->city ?? '-' }}
251 </div> 251 </div>
252 </div> 252 </div>
253 253
254 254
255 <div class="cabinet__inputs-item form-group"> 255 <div class="cabinet__inputs-item form-group">
256 <label class="form-group__label">Телефон:</label> 256 <label class="form-group__label">Телефон:</label>
257 <div class="form-group__item"> 257 <div class="form-group__item">
258 {{ $worker->telephone ?? '-' }} 258 {{ $worker->telephone ?? '-' }}
259 </div> 259 </div>
260 </div> 260 </div>
261 261
262 262
263 <div class="cabinet__inputs-item form-group"> 263 <div class="cabinet__inputs-item form-group">
264 <label class="form-group__label">E-mail:</label> 264 <label class="form-group__label">E-mail:</label>
265 <div class="form-group__item"> 265 <div class="form-group__item">
266 {{ $worker->email ?? '-' }} 266 {{ $worker->email ?? '-' }}
267 </div> 267 </div>
268 </div> 268 </div>
269 269
270 270
271 <div class="cabinet__inputs-item form-group"> 271 <div class="cabinet__inputs-item form-group">
272 <label class="form-group__label">Контакты родственников:</label> 272 <label class="form-group__label">Контакты родственников:</label>
273 <div class="form-group__item"> 273 <div class="form-group__item">
274 {{ $worker->telephone2 ?? '-' }} 274 {{ $worker->telephone2 ?? '-' }}
275 </div> 275 </div>
276 </div> 276 </div>
277 </div> 277 </div>
278 </div> 278 </div>
279
280 <<<<<<< HEAD
281 <div class="width100">
282 <h4 class="cabinet__h4 mb-10">О себе</h4>
283 <div>{{ $worker->text }}</div>
284 </div>
285 =======
286 <div class="width100"> 279 <div class="width100">
287 <h4 class="cabinet__h4 mb-10">О себе</h4> 280 <h4 class="cabinet__h4 mb-10">О себе</h4>
288 <div style="white-space:break-spaces; word-break: break-word;">{{ $worker->text }}</div> 281 <div style="white-space:break-spaces; word-break: break-word;">{{ $worker->text }}</div>
289 </div> 282 </div>
290 >>>>>>> c40f2b065cea930f5629b64a4516523032e7b56f
291
292 <div class=""> 283 <div class="">
293 <a href="{{ route('worker.basic_information') }}" class="button active">Редактировать основную информацию</a> 284 <a href="{{ route('worker.basic_information') }}" class="button active">Редактировать основную информацию</a>
294 </div> 285 </div>
295 </div> 286 </div>
296 </div> 287 </div>
297 288
298 <div class="mb-40" id="sertificate" name="sertificate"> 289 <div class="mb-40" id="sertificate" name="sertificate">
299 <h3 class="cabinet__subtitle font30 mb-20">Сертификаты / документы</h3> 290 <h3 class="cabinet__subtitle font30 mb-20">Сертификаты / документы</h3>
300 291
301 @if($worker->sertificate->count()) 292 @if($worker->sertificate->count())
302 @foreach($worker->sertificate as $sertificate) 293 @foreach($worker->sertificate as $sertificate)
303 <div class="one-sertificate"> 294 <div class="one-sertificate">
304 <div class="sertificate-field sertificate-name"> 295 <div class="sertificate-field sertificate-name">
305 <label class="bold">Название сертификата:</label> 296 <label class="bold">Название сертификата:</label>
306 <div>{{ $sertificate->name }}</div> 297 <div>{{ $sertificate->name }}</div>
307 </div> 298 </div>
308 <div class="sertificate-field"> 299 <div class="sertificate-field">
309 <label class="bold">Действителен до:</label> 300 <label class="bold">Действителен до:</label>
310 <div>{{ date('d.m.Y', strtotime($sertificate->end_begin)) }}</div> 301 <div>{{ date('d.m.Y', strtotime($sertificate->end_begin)) }}</div>
311 </div> 302 </div>
312 <div class="sertificate-field sertificate-buttons"> 303 <div class="sertificate-field sertificate-buttons">
313 <a href="{{ route('worker.edit_sertificate', ['worker' => $worker->id, 'doc' => $sertificate->id ]) }}" class="button button_light mr-10"> 304 <a href="{{ route('worker.edit_sertificate', ['worker' => $worker->id, 'doc' => $sertificate->id ]) }}" class="button button_light mr-10">
314 <svg><use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use></svg> 305 <svg><use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use></svg>
315 </a> 306 </a>
316 <a href="{{ route('worker.delete_sertificate', ['doc' => $sertificate->id]) }}" class="button button_light"> 307 <a href="{{ route('worker.delete_sertificate', ['doc' => $sertificate->id]) }}" class="button button_light">
317 <svg><use xlink:href="{{ asset('images/sprite.svg#del') }}"></use></svg> 308 <svg><use xlink:href="{{ asset('images/sprite.svg#del') }}"></use></svg>
318 </a> 309 </a>
319 </div> 310 </div>
320 </div> 311 </div>
321 @endforeach 312 @endforeach
322 @endif 313 @endif
323 314
324 <a class="button fit-content" href="{{ route('worker.new_sertificate',['worker' => $worker->id]) }}" id="button_new_doc" name="button_new_doc"> 315 <a class="button fit-content" href="{{ route('worker.new_sertificate',['worker' => $worker->id]) }}" id="button_new_doc" name="button_new_doc">
325 Добавить сертификат / документ 316 Добавить сертификат / документ
326 </a> 317 </a>
327 </div> 318 </div>
328 319
329 <div class="cabinet__body-item mb-40" name="ajax_dop_diplomi" id="ajax_dop_diplomi"> 320 <div class="cabinet__body-item mb-40" name="ajax_dop_diplomi" id="ajax_dop_diplomi">
330 <h3 class="cabinet__subtitle font30">Дополнительные документы</h3> 321 <h3 class="cabinet__subtitle font30">Дополнительные документы</h3>
331 322
332 <div class="cabinet__inputs" id="block_sertificate"> 323 <div class="cabinet__inputs" id="block_sertificate">
333 @if ($info_blocks->count()) 324 @if ($info_blocks->count())
334 @foreach ($info_blocks as $info_block) 325 @foreach ($info_blocks as $info_block)
335 <div class="cabinet__inputs-item column-count-3 form-group"> 326 <div class="cabinet__inputs-item column-count-3 form-group">
336 <label class="form-group__label">{{ $info_block->name }}:</label> 327 <label class="form-group__label">{{ $info_block->name }}:</label>
337 328
338 <div class="form-group__item"> 329 <div class="form-group__item">
339 @php $status = 0; @endphp 330 @php $status = 0; @endphp
340 @if (!empty($worker->dop_info[$info_block->id]) && $worker->dop_info[$info_block->id]['status']) 331 @if (!empty($worker->dop_info[$info_block->id]) && $worker->dop_info[$info_block->id]['status'])
341 @php $status = $worker->dop_info[$info_block->id]['status']; @endphp 332 @php $status = $worker->dop_info[$info_block->id]['status']; @endphp
342 @endif 333 @endif
343 {{ $additional_document_statuses[$status] }} 334 {{ $additional_document_statuses[$status] }}
344 </div> 335 </div>
345 </div> 336 </div>
346 @endforeach 337 @endforeach
347 @endif 338 @endif
348 </div> 339 </div>
349 340
350 <a class="button fit-content" href="{{ route('worker.additional_documents') }}"> 341 <a class="button fit-content" href="{{ route('worker.additional_documents') }}">
351 Редактировать дополнительные документы 342 Редактировать дополнительные документы
352 </a> 343 </a>
353 </div> 344 </div>
354 345
355 <div class="cabinet__body-item mb-20"> 346 <div class="cabinet__body-item mb-20">
356 <div> 347 <div>
357 <h3 class="cabinet__subtitle font30">Опыт работы</h3> 348 <h3 class="cabinet__subtitle font30">Опыт работы</h3>
358 <div class="">Начните заполнение анкеты с указания последнего места работы</div> 349 <div class="">Начните заполнение анкеты с указания последнего места работы</div>
359 </div> 350 </div>
360 351
361 <div class="cabinet__works"> 352 <div class="cabinet__works">
362 @if (isset($worker->place_worker)) 353 @if (isset($worker->place_worker))
363 @foreach($worker->place_worker as $company) 354 @foreach($worker->place_worker as $company)
364 <div class="cabinet__works-item"> 355 <div class="cabinet__works-item">
365 <div class="cabinet__works-spoiler active"> 356 <div class="cabinet__works-spoiler active">
366 <div class="cabinet__works-spoiler-left"> 357 <div class="cabinet__works-spoiler-left">
367 <div class="cabinet__works-spoiler-text">Место работы {{ $loop->iteration }}</div> 358 <div class="cabinet__works-spoiler-text">Место работы {{ $loop->iteration }}</div>
368 </div> 359 </div>
369 <div class="cabinet__works-spoiler-buttons"> 360 <div class="cabinet__works-spoiler-buttons">
370 <a href="{{ route('worker.edit_document', ['doc' => $company->id, 'worker' => $worker->id]) }}" type="button" class="button button_light mr-10 js-works-edit"> 361 <a href="{{ route('worker.edit_document', ['doc' => $company->id, 'worker' => $worker->id]) }}" type="button" class="button button_light mr-10 js-works-edit">
371 <svg> 362 <svg>
372 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> 363 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use>
373 </svg> 364 </svg>
374 </a> 365 </a>
375 <a href="{{ route('worker.delete_document', ['doc' => $company->id]) }}" class="button button_light js-works-remove"> 366 <a href="{{ route('worker.delete_document', ['doc' => $company->id]) }}" class="button button_light js-works-remove">
376 <svg> 367 <svg>
377 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> 368 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use>
378 </svg> 369 </svg>
379 </a> 370 </a>
380 </div> 371 </div>
381 </div> 372 </div>
382 373
383 <div class="cabinet__works-body"> 374 <div class="cabinet__works-body">
384 <div class="cabinet__inputs"> 375 <div class="cabinet__inputs">
385 <div class="cabinet__inputs-item column-count-3 form-group"> 376 <div class="cabinet__inputs-item column-count-3 form-group">
386 <label class="form-group__label">Должность:</label> 377 <label class="form-group__label">Должность:</label>
387 <div class="form-group__item"> 378 <div class="form-group__item">
388 {{ $company->job_title ?? '-' }} 379 {{ $company->job_title ?? '-' }}
389 </div> 380 </div>
390 </div> 381 </div>
391 382
392 <div class="cabinet__inputs-item column-count-3 form-group"> 383 <div class="cabinet__inputs-item column-count-3 form-group">
393 <label class="form-group__label">Название т/х:</label> 384 <label class="form-group__label">Название т/х:</label>
394 <div class="form-group__item"> 385 <div class="form-group__item">
395 {{ $company->teplohod ?? '-' }} 386 {{ $company->teplohod ?? '-' }}
396 </div> 387 </div>
397 </div> 388 </div>
398 <div class="cabinet__inputs-item column-count-3 form-group"> 389 <div class="cabinet__inputs-item column-count-3 form-group">
399 <label class="form-group__label">Тип суда:</label> 390 <label class="form-group__label">Тип суда:</label>
400 <div class="form-group__item"> 391 <div class="form-group__item">
401 {{ $company->GWT ?? '-' }} 392 {{ $company->GWT ?? '-' }}
402 </div> 393 </div>
403 </div> 394 </div>
404 <div class="cabinet__inputs-item column-count-3 form-group"> 395 <div class="cabinet__inputs-item column-count-3 form-group">
405 <label class="form-group__label">Марка ГД:</label> 396 <label class="form-group__label">Марка ГД:</label>
406 <div class="form-group__item"> 397 <div class="form-group__item">
407 {{ $company->Marka_GD ?? '-' }} 398 {{ $company->Marka_GD ?? '-' }}
408 </div> 399 </div>
409 </div> 400 </div>
410 <div class="cabinet__inputs-item column-count-3 form-group"> 401 <div class="cabinet__inputs-item column-count-3 form-group">
411 <label class="form-group__label">Мощность ГД (кВТ):</label> 402 <label class="form-group__label">Мощность ГД (кВТ):</label>
412 <div class="form-group__item"> 403 <div class="form-group__item">
413 {{ $company->KBT ?? '-' }} 404 {{ $company->KBT ?? '-' }}
414 </div> 405 </div>
415 </div> 406 </div>
416 <div class="cabinet__inputs-item column-count-3 form-group"> 407 <div class="cabinet__inputs-item column-count-3 form-group">
417 <label class="form-group__label">Водоизмещение (DWT):</label> 408 <label class="form-group__label">Водоизмещение (DWT):</label>
418 <div class="form-group__item"> 409 <div class="form-group__item">
419 {{ $company->GRT ?? '-' }} 410 {{ $company->GRT ?? '-' }}
420 </div> 411 </div>
421 </div> 412 </div>
422 <div class="cabinet__inputs-item column-count-3 form-group"> 413 <div class="cabinet__inputs-item column-count-3 form-group">
423 <label class="form-group__label">Название компании:</label> 414 <label class="form-group__label">Название компании:</label>
424 <div class="form-group__item"> 415 <div class="form-group__item">
425 {{ $company->name_company ?? '-' }} 416 {{ $company->name_company ?? '-' }}
426 </div> 417 </div>
427 </div> 418 </div>
428 <div class="cabinet__inputs-item column-count-3 form-group"> 419 <div class="cabinet__inputs-item column-count-3 form-group">
429 <label class="form-group__label">Начало контракта:</label> 420 <label class="form-group__label">Начало контракта:</label>
430 <div class="form-group__item"> 421 <div class="form-group__item">
431 {{ $company->begin_work ?? '-' }} 422 {{ $company->begin_work ?? '-' }}
432 </div> 423 </div>
433 </div> 424 </div>
434 <div class="cabinet__inputs-item column-count-3 form-group"> 425 <div class="cabinet__inputs-item column-count-3 form-group">
435 <label class="form-group__label">Окончание контракта:</label> 426 <label class="form-group__label">Окончание контракта:</label>
436 <div class="form-group__item"> 427 <div class="form-group__item">
437 {{ $company->end_work ?? '-' }} 428 {{ $company->end_work ?? '-' }}
438 </div> 429 </div>
439 </div> 430 </div>
440 431
441 </div> 432 </div>
442 </div> 433 </div>
443 </div> 434 </div>
444 @endforeach 435 @endforeach
445 @endif 436 @endif
446 </div> 437 </div>
447 438
448 <a href="{{ route('worker.add_document', ['worker' => $worker->id]) }}" id="new_work" name="new_work" class="button fit-content"> 439 <a href="{{ route('worker.add_document', ['worker' => $worker->id]) }}" id="new_work" name="new_work" class="button fit-content">
449 Добавить место работы 440 Добавить место работы
450 </a> 441 </a>
451 </div> 442 </div>
452 443
453 <div id="prev_worker" name="prev_worker"> 444 <div id="prev_worker" name="prev_worker">
454 <div> 445 <div>
455 <h3 class="cabinet__subtitle font30">Рекомендации</h3> 446 <h3 class="cabinet__subtitle font30">Рекомендации</h3>
456 <div class="">Укажите контакты компаний, которые могут дать рекомендации</div> 447 <div class="">Укажите контакты компаний, которые могут дать рекомендации</div>
457 </div> 448 </div>
458 449
459 @if ((isset($worker->prev_company)) && ($worker->prev_company->count() > 0)) 450 @if ((isset($worker->prev_company)) && ($worker->prev_company->count() > 0))
460 @foreach($worker->prev_company as $it) 451 @foreach($worker->prev_company as $it)
461 <div class="cabinet__body-item"> 452 <div class="cabinet__body-item">
462 <div class="cabinet__inputs mt-30"> 453 <div class="cabinet__inputs mt-30">
463 <div class="cabinet__inputs-item column-count-3 form-group"> 454 <div class="cabinet__inputs-item column-count-3 form-group">
464 <label class="form-group__label">Название компании:</label> 455 <label class="form-group__label">Название компании:</label>
465 <div class="form-group__item"> 456 <div class="form-group__item">
466 {{ $it->name_company }} 457 {{ $it->name_company }}
467 </div> 458 </div>
468 </div> 459 </div>
469 <div class="cabinet__inputs-item column-count-3 form-group"> 460 <div class="cabinet__inputs-item column-count-3 form-group">
470 <label class="form-group__label">ФИО сотрудника:</label> 461 <label class="form-group__label">ФИО сотрудника:</label>
471 <div class="form-group__item"> 462 <div class="form-group__item">
472 {{ $it->direct }} 463 {{ $it->direct }}
473 </div> 464 </div>
474 </div> 465 </div>
475 <div class="cabinet__inputs-item column-count-3 form-group cabinet__inputs-item-buttons"> 466 <div class="cabinet__inputs-item column-count-3 form-group cabinet__inputs-item-buttons">
476 <div class="flex"> 467 <div class="flex">
477 <a href="{{ route('worker.edit_prev_company', ['worker' => $worker->id, 'doc' => $it->id ]) }}" class="button button_light mr-10"> 468 <a href="{{ route('worker.edit_prev_company', ['worker' => $worker->id, 'doc' => $it->id ]) }}" class="button button_light mr-10">
478 <svg> 469 <svg>
479 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use> 470 <use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use>
480 </svg> 471 </svg>
481 </a> 472 </a>
482 <a href="{{ route('worker.delete_prev_company', ['doc' => $it->id]) }}" class="button button_light"> 473 <a href="{{ route('worker.delete_prev_company', ['doc' => $it->id]) }}" class="button button_light">
483 <svg> 474 <svg>
484 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use> 475 <use xlink:href="{{ asset('images/sprite.svg#del') }}"></use>
485 </svg> 476 </svg>
486 </a> 477 </a>
487 </div> 478 </div>
488 </div> 479 </div>
489 <div class="cabinet__inputs-item column-count-3 form-group"> 480 <div class="cabinet__inputs-item column-count-3 form-group">
490 <label class="form-group__label">Должность сотрудника:</label> 481 <label class="form-group__label">Должность сотрудника:</label>
491 <div class="form-group__item"> 482 <div class="form-group__item">
492 {{ $it->telephone }} 483 {{ $it->telephone }}
493 </div> 484 </div>
494 </div> 485 </div>
495 <div class="cabinet__inputs-item column-count-3 form-group"> 486 <div class="cabinet__inputs-item column-count-3 form-group">
496 <label class="form-group__label">Телефон сотрудника:</label> 487 <label class="form-group__label">Телефон сотрудника:</label>
497 <div class="form-group__item"> 488 <div class="form-group__item">
498 {{ $it->telephone2 }} 489 {{ $it->telephone2 }}
499 </div> 490 </div>
500 </div> 491 </div>
501 <div class="cabinet__inputs-item column-count-3 form-group cabinet__inputs-item-buttons"></div> 492 <div class="cabinet__inputs-item column-count-3 form-group cabinet__inputs-item-buttons"></div>
502 </div> 493 </div>
503 </div> 494 </div>
504 @endforeach 495 @endforeach
505 @endif 496 @endif
506 </div> 497 </div>
507 498
508 <div class="cabinet__body-item"> 499 <div class="cabinet__body-item">
509 <a class="button fit-content" href="{{ route('worker.new_prev_company',['worker' => $worker->id]) }}"> 500 <a class="button fit-content" href="{{ route('worker.new_prev_company',['worker' => $worker->id]) }}">
510 Добавить контакт для рекомендации 501 Добавить контакт для рекомендации
511 </a> 502 </a>
512 </div> 503 </div>
513 </div> 504 </div>
514 </div> 505 </div>
515 </div> 506 </div>
516 </section> 507 </section>
517 @endsection 508 @endsection
518 509
1 <?php 1 <?php
2 2
3 use App\Http\Controllers\Ad_jobsController; 3 use App\Http\Controllers\Ad_jobsController;
4 use App\Http\Controllers\AdEmployerController; 4 use App\Http\Controllers\AdEmployerController;
5 use App\Http\Controllers\Admin\AdminController; 5 use App\Http\Controllers\Admin\AdminController;
6 use App\Http\Controllers\Admin\CategoryController; 6 use App\Http\Controllers\Admin\CategoryController;
7 use App\Http\Controllers\Admin\CategoryEmpController; 7 use App\Http\Controllers\Admin\CategoryEmpController;
8 use App\Http\Controllers\Admin\EducationController; 8 use App\Http\Controllers\Admin\EducationController;
9 use App\Http\Controllers\EducationController as EducationFrontController; 9 use App\Http\Controllers\EducationController as EducationFrontController;
10 use App\Http\Controllers\Admin\EmployersController; 10 use App\Http\Controllers\Admin\EmployersController;
11 use App\Http\Controllers\EmployerController as FrontEmployersController; 11 use App\Http\Controllers\EmployerController as FrontEmployersController;
12 use App\Http\Controllers\Admin\InfoBloksController; 12 use App\Http\Controllers\Admin\InfoBloksController;
13 use App\Http\Controllers\Admin\JobTitlesController; 13 use App\Http\Controllers\Admin\JobTitlesController;
14 use App\Http\Controllers\Admin\UsersController; 14 use App\Http\Controllers\Admin\UsersController;
15 use App\Http\Controllers\Admin\WorkersController; 15 use App\Http\Controllers\Admin\WorkersController;
16 use App\Http\Controllers\Auth\ForgotPasswordController; 16 use App\Http\Controllers\Auth\ForgotPasswordController;
17 use App\Http\Controllers\Auth\LoginController; 17 use App\Http\Controllers\Auth\LoginController;
18 use App\Http\Controllers\Auth\RegisterController; 18 use App\Http\Controllers\Auth\RegisterController;
19 use App\Http\Controllers\CKEditorController; 19 use App\Http\Controllers\CKEditorController;
20 use App\Http\Controllers\FaqController; 20 use App\Http\Controllers\FaqController;
21 use App\Http\Controllers\MediaController; 21 use App\Http\Controllers\MediaController;
22 use App\Http\Controllers\WorkerController; 22 use App\Http\Controllers\WorkerController;
23 use App\Models\Ad_jobs; 23 use App\Models\Ad_jobs;
24 use App\Models\User; 24 use App\Models\User;
25 use App\Http\Controllers\MainController; 25 use App\Http\Controllers\MainController;
26 use App\Http\Controllers\HomeController; 26 use App\Http\Controllers\HomeController;
27 use Illuminate\Support\Facades\Route; 27 use Illuminate\Support\Facades\Route;
28 use App\Http\Controllers\Admin\CompanyController; 28 use App\Http\Controllers\Admin\CompanyController;
29 use App\Http\Controllers\Admin\Ad_EmployersController; 29 use App\Http\Controllers\Admin\Ad_EmployersController;
30 use App\Http\Controllers\Admin\MsgAnswersController; 30 use App\Http\Controllers\Admin\MsgAnswersController;
31 use App\Http\Controllers\Admin\GroupsController; 31 use App\Http\Controllers\Admin\GroupsController;
32 use App\Http\Controllers\PagesController; 32 use App\Http\Controllers\PagesController;
33 use Illuminate\Support\Facades\Storage; 33 use Illuminate\Support\Facades\Storage;
34 use App\Http\Controllers\EmployerController; 34 use App\Http\Controllers\EmployerController;
35 use App\Http\Controllers\CompanyController as FrontCompanyController; 35 use App\Http\Controllers\CompanyController as FrontCompanyController;
36 36
37 37
38 /* 38 /*
39 |-------------------------------------------------------------------------- 39 |--------------------------------------------------------------------------
40 | Web Routes 40 | Web Routes
41 |-------------------------------------------------------------------------- 41 |--------------------------------------------------------------------------
42 | 42 |
43 | Here is where you can register web routes for your application. These 43 | Here is where you can register web routes for your application. These
44 | routes are loaded by the RouteServiceProvider within a group which 44 | routes are loaded by the RouteServiceProvider within a group which
45 | contains the "web" middleware group. Now create something great! 45 | contains the "web" middleware group. Now create something great!
46 | 46 |
47 */ 47 */
48 /* 48 /*
49 Route::get('/', function () { 49 Route::get('/', function () {
50 return view('welcome'); 50 return view('welcome');
51 })->name('index'); 51 })->name('index');
52 */ 52 */
53 53
54 Route::get('/', [MainController::class, 'index'])->name('index'); 54 Route::get('/', [MainController::class, 'index'])->name('index');
55 55
56 //Роуты авторизации, регистрации, восстановления, аутентификации 56 //Роуты авторизации, регистрации, восстановления, аутентификации
57 Auth::routes(['verify' => true]); 57 Auth::routes(['verify' => true]);
58 58
59 // роуты регистрации, авторизации, восстановления пароля, верификации почты 59 // роуты регистрации, авторизации, восстановления пароля, верификации почты
60 /*Route::group([ 60 /*Route::group([
61 'as' => 'auth.', //имя маршрута, например auth.index 61 'as' => 'auth.', //имя маршрута, например auth.index
62 'prefix' => 'auth', // префикс маршрута, например, auth/index 62 'prefix' => 'auth', // префикс маршрута, например, auth/index
63 ], function () { 63 ], function () {
64 //форма регистрации 64 //форма регистрации
65 Route::get('register', [RegisterController::class, 'register'])->name('register'); 65 Route::get('register', [RegisterController::class, 'register'])->name('register');
66 66
67 //создание пользователя 67 //создание пользователя
68 Route::post('register', [RegisterController::class, 'create'])->name('create'); 68 Route::post('register', [RegisterController::class, 'create'])->name('create');
69 69
70 //форма входа авторизации 70 //форма входа авторизации
71 Route::get('login', [LoginController::class, 'login'])->name('login'); 71 Route::get('login', [LoginController::class, 'login'])->name('login');
72 72
73 //аутентификация 73 //аутентификация
74 Route::post('login', [LoginController::class, 'authenticate'])->name('auth'); 74 Route::post('login', [LoginController::class, 'authenticate'])->name('auth');
75 75
76 //выход 76 //выход
77 Route::get('logout', [LoginController::class, 'logout'])->name('logout'); 77 Route::get('logout', [LoginController::class, 'logout'])->name('logout');
78 78
79 //форма ввода адреса почты 79 //форма ввода адреса почты
80 Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form'); 80 Route::get('forgot-password', [ForgotPasswordController::class, 'form'])->name('forgot-form');
81 81
82 //письмо на почту 82 //письмо на почту
83 Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail'); 83 Route::post('forgot-password', [ForgotPasswordController::class, 'mail'])->name('forgot-mail');
84 84
85 //форма восстановления пароля 85 //форма восстановления пароля
86 Route::get('reset-password/token/{token}/email/{email}', 86 Route::get('reset-password/token/{token}/email/{email}',
87 [ResetPasswordController::class, 'form'] 87 [ResetPasswordController::class, 'form']
88 )->name('reset-form'); 88 )->name('reset-form');
89 89
90 //восстановление пароля 90 //восстановление пароля
91 Route::post('reset-password', 91 Route::post('reset-password',
92 [ResetPasswordController::class, 'reset'] 92 [ResetPasswordController::class, 'reset']
93 )->name('reset-password'); 93 )->name('reset-password');
94 94
95 //сообщение о необходимости проверки адреса почты 95 //сообщение о необходимости проверки адреса почты
96 Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message'); 96 Route::get('verify-message', [VerifyEmailController::class, 'message'])->name('verify-message');
97 97
98 //подтверждение адреса почты нового пользователя 98 //подтверждение адреса почты нового пользователя
99 Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify']) 99 Route::get('verify-email/token/{token}/id/{id}', [VerifyEmailController::class, 'verify'])
100 ->where('token', '[a-f0-9]{32}') 100 ->where('token', '[a-f0-9]{32}')
101 ->where('id', '[0-9]+') 101 ->where('id', '[0-9]+')
102 ->name('verify-email'); 102 ->name('verify-email');
103 });*/ 103 });*/
104 104
105 //Личный кабинет пользователя 105 //Личный кабинет пользователя
106 Route::get('/home', [HomeController::class, 'index'])->name('home'); 106 Route::get('/home', [HomeController::class, 'index'])->name('home');
107 107
108 /* 108 /*
109 Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { 109 Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) {
110 $user = User::where('email',$request->input('email'))->first(); 110 $user = User::where('email',$request->input('email'))->first();
111 111
112 $user->sendEmailVerificationNotification(); 112 $user->sendEmailVerificationNotification();
113 113
114 return 'your response'; 114 return 'your response';
115 })->middleware('throttle:6,1')->name('verification.resend'); 115 })->middleware('throttle:6,1')->name('verification.resend');
116 */ 116 */
117 117
118 // Авторизация, регистрация в админку 118 // Авторизация, регистрация в админку
119 Route::group([ 119 Route::group([
120 'as' => 'admin.', // имя маршрута, например auth.index 120 'as' => 'admin.', // имя маршрута, например auth.index
121 'prefix' => 'admin', // префикс маршрута, например auth/index 121 'prefix' => 'admin', // префикс маршрута, например auth/index
122 'middleware' => ['guest'], 122 'middleware' => ['guest'],
123 ], function () { 123 ], function () {
124 // Форма регистрации 124 // Форма регистрации
125 Route::get('register', [AdminController::class, 'register'])->name('register'); 125 Route::get('register', [AdminController::class, 'register'])->name('register');
126 // Создание пользователя 126 // Создание пользователя
127 Route::post('register', [AdminController::class, 'create'])->name('create'); 127 Route::post('register', [AdminController::class, 'create'])->name('create');
128 128
129 //Форма входа 129 //Форма входа
130 Route::get('login', [AdminController::class, 'login'])->name('login'); 130 Route::get('login', [AdminController::class, 'login'])->name('login');
131 131
132 // аутентификация 132 // аутентификация
133 Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); 133 Route::post('login', [AdminController::class, 'autenticate'])->name('auth');
134 134
135 }); 135 });
136 136
137 // Личный кабинет админки 137 // Личный кабинет админки
138 Route::group([ 138 Route::group([
139 'as' => 'admin.', // имя маршрута, например auth.index 139 'as' => 'admin.', // имя маршрута, например auth.index
140 'prefix' => 'admin', // префикс маршрута, например auth/index 140 'prefix' => 'admin', // префикс маршрута, например auth/index
141 'middleware' => ['auth', 'admin'], 141 'middleware' => ['auth', 'admin'],
142 ], function() { 142 ], function() {
143 143
144 // выход 144 // выход
145 Route::get('logout', [AdminController::class, 'logout'])->name('logout'); 145 Route::get('logout', [AdminController::class, 'logout'])->name('logout');
146 146
147 // кабинет главная страница 147 // кабинет главная страница
148 Route::get('cabinet', [AdminController::class, 'index'])->name('index'); 148 Route::get('cabinet', [AdminController::class, 'index'])->name('index');
149 Route::get('/', function () { 149 Route::get('/', function () {
150 return redirect()->route('admin.index'); 150 return redirect()->route('admin.index');
151 }); 151 });
152 152
153 // кабинет профиль админа - форма 153 // кабинет профиль админа - форма
154 Route::get('profile', [AdminController::class, 'profile'])->name('profile'); 154 Route::get('profile', [AdminController::class, 'profile'])->name('profile');
155 // кабинет профиль админа - сохранение формы 155 // кабинет профиль админа - сохранение формы
156 Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); 156 Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile');
157 157
158 //кабинет сообщения админа 158 //кабинет сообщения админа
159 //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); 159 //Route::get('messages', [AdminController::class, 'profile'])->name('profile');
160 160
161 161
162 // кабинет профиль - форма пароли 162 // кабинет профиль - форма пароли
163 Route::get('password', [AdminController::class, 'profile_password'])->name('password'); 163 Route::get('password', [AdminController::class, 'profile_password'])->name('password');
164 // кабинет профиль - сохранение формы пароля 164 // кабинет профиль - сохранение формы пароля
165 Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); 165 Route::post('password', [AdminController::class, 'profile_password_new'])->name('password');
166 166
167 167
168 // кабинет профиль пользователя - форма 168 // кабинет профиль пользователя - форма
169 Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); 169 Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile');
170 // кабинет профиль пользователя - сохранение формы 170 // кабинет профиль пользователя - сохранение формы
171 Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); 171 Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile');
172 172
173 // кабинет профиль работодатель - форма 173 // кабинет профиль работодатель - форма
174 Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); 174 Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile');
175 // кабинет профиль работодатель - сохранение формы 175 // кабинет профиль работодатель - сохранение формы
176 Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); 176 Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile');
177 // кабинет удаление профиль работодателя и юзера 177 // кабинет удаление профиль работодателя и юзера
178 Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); 178 Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer');
179 179
180 // кабинет профиль работник - форма 180 // кабинет профиль работник - форма
181 Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); 181 Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add');
182 Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); 182 Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store');
183 Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); 183 Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit');
184 // кабинет профиль работник - сохранение формы 184 // кабинет профиль работник - сохранение формы
185 Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); 185 Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update');
186 186
187 // Медиа 187 // Медиа
188 Route::get('media', [MediaController::class, 'index'])->name('media'); 188 Route::get('media', [MediaController::class, 'index'])->name('media');
189 Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media'); 189 Route::delete('media/{media}', [MediaController::class, 'delete'])->name('delete-media');
190 190
191 // кабинет настройки сайта - форма 191 // кабинет настройки сайта - форма
192 Route::get('config', [AdminController::class, 'config_form'])->name('config'); 192 Route::get('config', [AdminController::class, 'config_form'])->name('config');
193 // кабинет настройки сайта сохранение формы 193 // кабинет настройки сайта сохранение формы
194 Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); 194 Route::post('config', [AdminController::class, 'store_config'])->name('store_config');
195 195
196 // кабинет - новости 196 // кабинет - новости
197 Route::get('news-list', [AdminController::class, 'news_admin'])->name('news_admin'); 197 Route::get('news-list', [AdminController::class, 'news_admin'])->name('news_admin');
198 Route::get('news/add', [AdminController::class, 'new_admin_add'])->name('new_admin_add'); 198 Route::get('news/add', [AdminController::class, 'new_admin_add'])->name('new_admin_add');
199 Route::post('news/add', [AdminController::class, 'new_admin_add_save'])->name('new_admin_save_add'); 199 Route::post('news/add', [AdminController::class, 'new_admin_add_save'])->name('new_admin_save_add');
200 Route::get('news/edit/{new}', [AdminController::class, 'new_admin_edit'])->name('new_admin_edit'); 200 Route::get('news/edit/{new}', [AdminController::class, 'new_admin_edit'])->name('new_admin_edit');
201 Route::post('news/edit/{new}', [AdminController::class, 'new_admin_update_save'])->name('new_admin_update'); 201 Route::post('news/edit/{new}', [AdminController::class, 'new_admin_update_save'])->name('new_admin_update');
202 Route::get('news/delete/{new}', [AdminController::class, 'new_admin_delete'])->name('new_admin_delete'); 202 Route::get('news/delete/{new}', [AdminController::class, 'new_admin_delete'])->name('new_admin_delete');
203 203
204 // кабинет - пользователи 204 // кабинет - пользователи
205 Route::get('users', [UsersController::class, 'index'])->name('users'); 205 Route::get('users', [UsersController::class, 'index'])->name('users');
206 Route::get('user-delete/{user}', [UsersController::class, 'user_delete'])->name('user_delete'); 206 Route::get('user-delete/{user}', [UsersController::class, 'user_delete'])->name('user_delete');
207 207
208 // кабинет - пользователи 208 // кабинет - пользователи
209 Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); 209 Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users');
210 210
211 // кабинет - работодатели 211 // кабинет - работодатели
212 Route::get('employers', [EmployersController::class, 'index'])->name('employers'); 212 Route::get('employers', [EmployersController::class, 'index'])->name('employers');
213 213
214 Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer'); 214 Route::get('employers/comment/{employer}', [EmployersController::class, 'comment_read'])->name('comment-employer');
215 215
216 Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add'); 216 Route::get('flot/add/{employer}', [EmployersController::class, 'add_flot'])->name('flot_add');
217 Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save'); 217 Route::post('flot/add', [EmployersController::class, 'save_add_flot'])->name('flot_add_save');
218 Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot'); 218 Route::get('flot/{flot}/{employer}', [EmployersController::class, 'edit_flot'])->name('flot');
219 Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit'); 219 Route::put('flot/{flot}', [EmployersController::class, 'edit_save_flot'])->name('flot_edit');
220 Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete'); 220 Route::get('flot/{flot}/{employer_id}/delete', [EmployersController::class, 'delete_flot'])->name('flot_delete');
221 221
222 // кабинет - соискатели 222 // кабинет - соискатели
223 Route::get('workers', [WorkersController::class, 'index'])->name('workers'); 223 Route::get('workers', [WorkersController::class, 'index'])->name('workers');
224 224
225 // кабинет - база данных 225 // кабинет - база данных
226 Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); 226 Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata');
227 Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); 227 Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata');
228 Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); 228 Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata');
229 Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); 229 Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata');
230 Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); 230 Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata');
231 Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); 231 Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata');
232 Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); 232 Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata');
233 233
234 // кабинет - вакансии 234 // кабинет - вакансии
235 Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); 235 Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers');
236 Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers'); 236 Route::get('ad-employers/add', [Ad_EmployersController::class, 'create'])->name('add-ad-employers');
237 Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers'); 237 Route::post('ad-employers/add', [Ad_EmployersController::class, 'store'])->name('store-ad-employers');
238 Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); 238 Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers');
239 Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers'); 239 Route::post('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'update'])->name('update-ad-employers');
240 Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer'); 240 Route::delete('ad-employers/delete/{ad_employer}', [Ad_EmployersController::class, 'destroy'])->name('delete-ad-employer');
241 241
242 // Редактирование должности в вакансии 242 // Редактирование должности в вакансии
243 Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs'); 243 Route::put('update-jobs/{ad_jobs}', [Ad_EmployersController::class, 'update_ad_jobs'])->name('update_jobs');
244 Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs'); 244 Route::get('edit-jobs/{ad_jobs}', [Ad_EmployersController::class, 'edit_jobs'])->name('edit_jobs');
245 245
246 246
247 // кабинет - категории 247 // кабинет - категории
248 //Route::get('categories', [AdminController::class, 'index'])->name('categories'); 248 //Route::get('categories', [AdminController::class, 'index'])->name('categories');
249 249
250 // СRUD-операции над Справочником Категории 250 // СRUD-операции над Справочником Категории
251 251
252 Route::resource('categories', CategoryController::class, ['except' => ['show']]); 252 Route::resource('categories', CategoryController::class, ['except' => ['show']]);
253 253
254 // CRUD-операции над справочником Категории для работодателей 254 // CRUD-операции над справочником Категории для работодателей
255 Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]); 255 Route::resource('category-emp', CategoryEmpController::class, ['except' => ['show']]);
256 256
257 // CRUD-операции над справочником Образование 257 // CRUD-операции над справочником Образование
258 Route::resource('education', EducationController::class, ['except' => ['show']]); 258 Route::resource('education', EducationController::class, ['except' => ['show']]);
259 259
260 Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education'); 260 Route::get('rename-program-education', [EducationController::class, 'rename_program'])->name('rename-program-education');
261 Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education'); 261 Route::get('program-education', [EducationController::class, 'add_program'])->name('add-program-education');
262 Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education'); 262 Route::post('program-education', [EducationController::class, 'store_program'])->name('store-program-education');
263 263
264 Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education'); 264 Route::get('program-education/edit/{program}/{education}', [EducationController::class, 'edit_program'])->name('edit-program-education');
265 Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education'); 265 Route::post('program-education/edit/{program}/{education}', [EducationController::class, 'update_program'])->name('update-program-education');
266 266
267 Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education'); 267 Route::get('program-education/delete/{program}/{education}', [EducationController::class, 'delete_program'])->name('delete-program-education');
268 268
269 //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles');
270 /* 269 /*
271 * кабинет - CRUD-операции по справочнику должности 270 * кабинет - CRUD-операции по справочнику должности
272 * 271 *
273 */ 272 */
274 Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); 273 Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]);
275 274
276 // кабинет - сообщения (чтение чужих) 275 // кабинет - сообщения (чтение чужих)
277 Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); 276 Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages');
278 // кабинет - просмотр сообщения чужого (чтение) 277 // кабинет - просмотр сообщения чужого (чтение)
279 Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message'); 278 Route::get('messages/{message}', [MsgAnswersController::class, 'read_message'])->name('read-message');
280 279
281 // кабинет - сообщения (админские) 280 // кабинет - сообщения (админские)
282 Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); 281 Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages');
283 // кабинет - сообщения (админские) 282 // кабинет - сообщения (админские)
284 Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); 283 Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post');
285 // кабинет - sql - конструкция запросов 284 // кабинет - sql - конструкция запросов
286 Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); 285 Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql');
287 286
288 Route::post('admin-reject-message', [MsgAnswersController::class, 'reject_message'])->name('reject_message'); 287 Route::post('admin-reject-message', [MsgAnswersController::class, 'reject_message'])->name('reject_message');
289 Route::post('admin-send-message', [MsgAnswersController::class, 'send_message'])->name('send_message'); 288 Route::post('admin-send-message', [MsgAnswersController::class, 'send_message'])->name('send_message');
290 289
291 /* 290 /*
292 * Расписанный подход в описании каждой директорий групп пользователей. 291 * Расписанный подход в описании каждой директорий групп пользователей.
293 */ 292 */
294 // кабинет - группы пользователей 293 // кабинет - группы пользователей
295 Route::get('groups', [GroupsController::class, 'index'])->name('groups'); 294 Route::get('groups', [GroupsController::class, 'index'])->name('groups');
296 // кабинет - добавление форма группы пользователей 295 // кабинет - добавление форма группы пользователей
297 Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); 296 Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group');
298 // кабинет - сохранение формы группы пользователей 297 // кабинет - сохранение формы группы пользователей
299 Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); 298 Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store');
300 // кабинет - редактирование форма группы пользователей 299 // кабинет - редактирование форма группы пользователей
301 Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); 300 Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group');
302 // кабинет - сохранение редактированной формы группы пользователей 301 // кабинет - сохранение редактированной формы группы пользователей
303 Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); 302 Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group');
304 // кабинет - удаление группы пользователей 303 // кабинет - удаление группы пользователей
305 Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); 304 Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group');
306 305
307 306
308 // кабинет - список админов 307 // кабинет - список админов
309 Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); 308 Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin');
310 309
311 // справочник Позиции 310 // справочник Позиции
312 Route::get('positions', [AdminController::class, 'position'])->name('position'); 311 Route::get('positions', [AdminController::class, 'position'])->name('position');
313 Route::get('positions/add', [AdminController::class, 'position_add'])->name('add-position'); 312 Route::get('positions/add', [AdminController::class, 'position_add'])->name('add-position');
314 Route::post('positions/add', [AdminController::class, 'position_add_save'])->name('add-save-position'); 313 Route::post('positions/add', [AdminController::class, 'position_add_save'])->name('add-save-position');
315 Route::get('positions/edit/{position}', [AdminController::class, 'position_edit'])->name('edit-position'); 314 Route::get('positions/edit/{position}', [AdminController::class, 'position_edit'])->name('edit-position');
316 Route::post('position/edit/{position}', [AdminController::class, 'position_update'])->name('update-position'); 315 Route::post('position/edit/{position}', [AdminController::class, 'position_update'])->name('update-position');
317 Route::get('position/delete/{position}', [AdminController::class, 'position_delete'])->name('delete-position'); 316 Route::get('position/delete/{position}', [AdminController::class, 'position_delete'])->name('delete-position');
318 317
319 /////редактор////// кабинет - редактор сайта//////////////////////// 318 /////редактор////// кабинет - редактор сайта////////////////////////
320 Route::get('editor-site', function() { 319 Route::get('editor-site', function() {
321 return view('admin.editor.index'); 320 return view('admin.editor.index');
322 })->name('editor-site'); 321 })->name('editor-site');
323 322
324 323
325 // кабинет - редактор шапки-футера сайта 324 // кабинет - редактор шапки-футера сайта
326 Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); 325 Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks');
327 Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); 326 Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block');
328 Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); 327 Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store');
329 Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); 328 Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block');
330 Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); 329 Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block');
331 Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); 330 Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block');
332 Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); 331 Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block');
333 332
334 333
335 // кабинет - редактор должности на главной 334 // кабинет - редактор должности на главной
336 Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); 335 Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main');
337 336
338 // кабинет - счетчики на главной 337 // кабинет - счетчики на главной
339 Route::get('counters-main', [CompanyController::class, 'counters_main'])->name('counters-main'); 338 Route::get('counters-main', [CompanyController::class, 'counters_main'])->name('counters-main');
340 Route::post('counters-main/edit/{name}', [CompanyController::class, 'counters_main_update'])->name('counters-main-update'); 339 Route::post('counters-main/edit/{name}', [CompanyController::class, 'counters_main_update'])->name('counters-main-update');
341 340
342 // кабинет - редактор работодатели на главной 341 // кабинет - редактор работодатели на главной
343 Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); 342 Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main');
344 Route::post('employers-main-add', [CompanyController::class, 'employers_main_add'])->name('employers-main-add'); 343 Route::post('employers-main-add', [CompanyController::class, 'employers_main_add'])->name('employers-main-add');
345 Route::post('employers-main-remove', [CompanyController::class, 'employers_main_remove'])->name('employers-main-remove'); 344 Route::post('employers-main-remove', [CompanyController::class, 'employers_main_remove'])->name('employers-main-remove');
346 345
347 346
348 // кабинет - редактор seo-сайта 347 // кабинет - редактор seo-сайта
349 Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); 348 Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo');
350 Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); 349 Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo');
351 Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); 350 Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store');
352 Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); 351 Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo');
353 Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); 352 Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo');
354 Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); 353 Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo');
355 Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); 354 Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo');
356 355
357 356
358 // кабинет - редактор страниц 357 // кабинет - редактор страниц
359 Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); 358 Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages');
360 // кабинет - добавление страницы 359 // кабинет - добавление страницы
361 Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); 360 Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page');
362 // кабинет - сохранение формы страницы 361 // кабинет - сохранение формы страницы
363 Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); 362 Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store');
364 // кабинет - редактирование форма страницы 363 // кабинет - редактирование форма страницы
365 Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); 364 Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page');
366 // кабинет - сохранение редактированной формы страницы 365 // кабинет - сохранение редактированной формы страницы
367 Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); 366 Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page');
368 // кабинет - удаление страницы 367 // кабинет - удаление страницы
369 Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); 368 Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page');
370 369
371 370
372 // кабинет - реклама сайта 371 // кабинет - реклама сайта
373 Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); 372 Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames');
374 Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); 373 Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames');
375 Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); 374 Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store');
376 Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); 375 Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames');
377 Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); 376 Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames');
378 Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); 377 Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames');
379 //////////////////////////////////////////////////////////////////////// 378 ////////////////////////////////////////////////////////////////////////
380 379
381 380
382 // кабинет - отзывы о работодателе для модерации 381 // кабинет - отзывы о работодателе для модерации
383 Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); 382 Route::get('answers', [EmployersController::class, 'answers'])->name('answers');
384 383
385 // Общая страница статистики 384 // Общая страница статистики
386 Route::get('statics', function () { 385 Route::get('statics', function () {
387 return view('admin.static.index'); 386 return view('admin.static.index');
388 })->name('statics'); 387 })->name('statics');
389 388
390 // кабинет - статистика работников 389 // кабинет - статистика работников
391 Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); 390 Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers');
392 391
393 // кабинет - статистика вакансий работодателя 392 // кабинет - статистика вакансий работодателя
394 Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); 393 Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads');
395 394
396 // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника 395 // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника
397 /* 396 /*
398 * CRUD-операции над справочником дипломы и документы 397 * CRUD-операции над справочником дипломы и документы
399 */ 398 */
400 //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); 399 //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks');
401 Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); 400 Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]);
402 401
403 // кабинет - роли пользователя 402 // кабинет - роли пользователя
404 Route::get('roles', [UsersController::class, 'roles'])->name('roles'); 403 Route::get('roles', [UsersController::class, 'roles'])->name('roles');
405 404
406 Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles'); 405 Route::get('admin_roles', [UsersController::class, 'admin_roles'])->name('admin_roles');
407 406
408 Route::get('logs', function() { 407 Route::get('logs', function() {
409 $files = Storage::files('logs/laravel.log'); 408 $files = Storage::files('logs/laravel.log');
410 })->name('logs'); 409 })->name('logs');
411 410
412 Route::prefix('faq')->as('faq.')->group(function () { 411 Route::prefix('faq')->as('faq.')->group(function () {
413 Route::middleware('admin')->group(function () { 412 Route::middleware('admin')->group(function () {
414 Route::get('/', [FaqController::class, 'showListForAdmin'])->name('list'); 413 Route::get('/', [FaqController::class, 'showListForAdmin'])->name('list');
415 Route::get('/create', [FaqController::class, 'create'])->name('create'); 414 Route::get('/create', [FaqController::class, 'create'])->name('create');
416 Route::post('/create', [FaqController::class, 'store'])->name('store'); 415 Route::post('/create', [FaqController::class, 'store'])->name('store');
417 Route::get('/edit/{id}', [FaqController::class, 'edit'])->name('edit'); 416 Route::get('/edit/{id}', [FaqController::class, 'edit'])->name('edit');
418 Route::put('/edit/{id}', [FaqController::class, 'update'])->name('update'); 417 Route::put('/edit/{id}', [FaqController::class, 'update'])->name('update');
419 Route::get('/destroy/{id}', [FaqController::class, 'destroy'])->name('destroy'); 418 Route::get('/destroy/{id}', [FaqController::class, 'destroy'])->name('destroy');
420 }); 419 });
421 }); 420 });
422 }); 421 });
423 422
424 // Инструментальные страницы 423 // Инструментальные страницы
425 Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); 424 Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload');
426 425
427 Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); 426 Route::get('redis/', [PagesController::class, 'redis'])->name('redis');
428 427
429 Route::get('excel/', [PagesController::class, 'excel'])->name('excel'); 428 Route::get('excel/', [PagesController::class, 'excel'])->name('excel');
430 429
431 // Страницы с произвольным контентом 430 // Страницы с произвольным контентом
432 Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); 431 Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page');
433 432
434 // Форма обратной связи 433 // Форма обратной связи
435 Route::post('form_feedback', [PagesController::class, 'form_feedback'])->name('form_feedback'); 434 Route::post('form_feedback', [PagesController::class, 'form_feedback'])->name('form_feedback');
436 435
437 // Публичные страницы соискателя 436 // Публичные страницы соискателя
438 Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page'); 437 Route::get('workers/profile/{worker}', [WorkerController::class, 'profile'])->name('worker_page');
439 438
440 //Страница вакансии 439 //Страница вакансии
441 Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer'); 440 Route::get('employer/ad/{ad_employer}', [AdEmployerController::class, 'ad_employer'])->name('ad-employer');
442 441
443 //Вакансии 442 //Вакансии
444 Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies'); 443 Route::get('vacancies', [MainController::class, 'vacancies'])->name('vacancies');
445 444
446 //Вакансии поиск на главной 445 //Вакансии поиск на главной
447 Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies'); 446 Route::get('search-vacancies', [MainController::class, 'search_vacancies'])->name('search_vacancies');
448 447
449 //Вакансии категория детальная 448 //Вакансии категория детальная
450 Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies'); 449 Route::get('list-vacancies/{categories?}', [MainController::class, 'list_vacancies'])->name('list-vacancies');
451 450
452 // Лайк вакансии 451 // Лайк вакансии
453 Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy'); 452 Route::get('like-vacancy', [MainController::class, 'like_vacancy'])->name('like-vacancy');
454 453
455 //Детальная страница вакансии - работодателя 454 //Детальная страница вакансии - работодателя
456 Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie'); 455 Route::get('vacancie/{vacancy}', [FrontEmployersController::class, 'vacancie'])->name('vacancie');
457 456
457 Route::get('vacancy/{vacancy}', [AdEmployerController::class, 'getById'])->name('get-vacancy-by-id');
458
458 //Судоходные компании 459 //Судоходные компании
459 Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies'); 460 Route::get('shipping-companies', [FrontCompanyController::class, 'shipping_companies'])->name('shipping_companies');
460 461
461 //Детальная инфа о компании 462 //Детальная инфа о компании
462 Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company'); 463 Route::get('info-company/{company}', [FrontCompanyController::class, 'info_company'])->name('info_company');
463 464
464 //Образование 465 //Образование
465 Route::get('education', [EducationFrontController::class, 'index'])->name('education'); 466 Route::get('education', [EducationFrontController::class, 'index'])->name('education');
466 Route::get('education/{education}', [EducationFrontController::class, 'show'])->name('show_education')->where('education', '[0-9]+');; 467 Route::get('education/{education}', [EducationFrontController::class, 'show'])->name('show_education')->where('education', '[0-9]+');;
467 468
468 //Новости 469 //Новости
469 Route::get('news', [MainController::class, 'news'])->name('news'); 470 Route::get('news', [MainController::class, 'news'])->name('news');
470 Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new'); 471 Route::get('detail-new/{new}', [MainController::class, 'detail_new'])->name('detail_new');
471 472
472 //Контакты 473 //Контакты
473 Route::get('contacts', [MainController::class, 'contacts'])->name('contacts'); 474 Route::get('contacts', [MainController::class, 'contacts'])->name('contacts');
474 475
475 //База резюме 476 //База резюме
476 Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume'); 477 Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume');
477 Route::get('bd_resume_danger', function(){ 478 Route::get('bd_resume_danger', function(){
478 return view('employers.bd_resume_danger'); 479 return view('employers.bd_resume_danger');
479 })->name('bd_resume_danger'); 480 })->name('bd_resume_danger');
480 481
481 Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume'); 482 Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume');
482 483
483 //Анкета соискателя 484 //Анкета соискателя
484 Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile'); 485 Route::get('resume-profile/{worker}', [WorkerController::class, 'resume_profile'])->name('resume_profile');
485 486
486 //Скачать резюме 487 //Скачать резюме
487 Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download'); 488 Route::get('resume-download/{worker}', [WorkerController::class, 'resume_download'])->name('resume_download');
488 Route::get('resume-download/all', [WorkerController::class, 'resume_download_all'])->name('resume_download_all2'); 489 Route::get('resume-download/all', [WorkerController::class, 'resume_download_all'])->name('resume_download_all2');
489 Route::get('resume-download', [WorkerController::class, 'resume_download_all'])->name('resume_download_all'); 490 Route::get('resume-download', [WorkerController::class, 'resume_download_all'])->name('resume_download_all');
490 491
491 492
492 //Вход в кабинет 493 //Вход в кабинет
493 Route::get('login', [MainController::class, 'input_login'])->name('login'); 494 Route::get('login', [MainController::class, 'input_login'])->name('login');
494 495
495 // Выход из кабинета 496 // Выход из кабинета
496 Route::get('logout', [EmployerController::class, 'logout'])->name('logout'); 497 Route::get('logout', [EmployerController::class, 'logout'])->name('logout');
497 498
498 Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker'); 499 Route::get( 'register_worker', [WorkerController::class, 'register_worker'])->name('register_worker');
499 Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer'); 500 Route::get('register_employer', [EmployerController::class, 'register_employer'])->name('register_employer');
500 501
501 //восстановление пароля 502 //восстановление пароля
502 Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password'); 503 Route::get('repair-password', [MainController::class, 'repair_password'])->name('repair_password');
503 // Звезда сообщения 504 // Звезда сообщения
504 Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer'); 505 Route::post('stars-answer', [WorkerController::class, 'stars_answer'])->name('stars_answer');
505 506
506 // Борьба 507 // Борьба
507 Route::get('clear_cookie', function() { 508 Route::get('clear_cookie', function() {
508 \App\Classes\Cookies_vacancy::clear_vacancy(); 509 \App\Classes\Cookies_vacancy::clear_vacancy();
509 return redirect()->route('index'); 510 return redirect()->route('index');
510 })->name('clear_cookie'); 511 })->name('clear_cookie');
511 512
512 Route::get('cookies', function() { 513 Route::get('cookies', function() {
513 return view('cookies'); 514 return view('cookies');
514 })->name('cookies'); 515 })->name('cookies');
515 516
516 // Личный кабинет работник 517 // Личный кабинет работник
517 Route::group([ 518 Route::group([
518 'as' => 'worker.', // имя маршрута, например auth.index 519 'as' => 'worker.', // имя маршрута, например auth.index
519 'prefix' => 'worker', // префикс маршрута, например auth/index 520 'prefix' => 'worker', // префикс маршрута, например auth/index
520 'middleware' => ['auth', 'is_worker'], 521 'middleware' => ['auth', 'is_worker'],
521 ], function() { 522 ], function() {
522 // Формы редактирования 523 // Формы редактирования
523 Route::get('cabinet/basic_information', [WorkerController::class, 'basic_information'])->name('basic_information'); 524 Route::get('cabinet/basic_information', [WorkerController::class, 'basic_information'])->name('basic_information');
524 Route::get('cabinet/additional_documents', [WorkerController::class, 'additional_documents'])->name('additional_documents'); 525 Route::get('cabinet/additional_documents', [WorkerController::class, 'additional_documents'])->name('additional_documents');
525 526
526 // 1 страница - Моя анкета 527 // 1 страница - Моя анкета
527 Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet'); 528 Route::get('cabinet', [WorkerController::class, 'cabinet'])->name('cabinet');
528 Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save'); 529 Route::post('cabinet/{worker}', [WorkerController::class, 'cabinet_save'])->name('cabinet_save');
529 Route::post('cabinet/cabinet_save_foto/{worker}', [WorkerController::class, 'cabinet_save_foto'])->name('cabinet_save_foto'); 530 Route::post('cabinet/cabinet_save_foto/{worker}', [WorkerController::class, 'cabinet_save_foto'])->name('cabinet_save_foto');
530 531
531 532
532 // 2 страница - Сообщения 533 // 2 страница - Сообщения
533 Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages'); 534 Route::get('cabinet/messages/{type_message}', [WorkerController::class, 'messages'])->name('messages');
534 Route::get('cabinet/dialog/{chat}', [WorkerController::class, 'dialog'])->name('dialog'); 535 Route::get('cabinet/dialog/{chat}', [WorkerController::class, 'dialog'])->name('dialog');
535 // 3 страница - Избранные вакансии 536 // 3 страница - Избранные вакансии
536 Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite'); 537 Route::get('cabinet/favorite', [WorkerController::class, 'favorite'])->name('favorite');
537 // Продолжение борьбы против колорадов - избранные вакансии 538 // Продолжение борьбы против колорадов - избранные вакансии
538 Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado'); 539 Route::get('кабинет/favorite', [WorkerController::class, 'colorado'])->name('colorado');
539 540
540 // 4 страница - Сменить пароль 541 // 4 страница - Сменить пароль
541 Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password'); 542 Route::get('кабинет/new_password', [WorkerController::class, 'new_password'])->name('new_password');
542 Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password'); 543 Route::post('кабинет/new_password/save', [WorkerController::class, 'save_new_password'])->name('save_new_password');
543 544
544 // 5 страница - Удалить профиль 545 // 5 страница - Удалить профиль
545 Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile'); 546 Route::get('кабинет/delete_profile', [WorkerController::class, 'delete_profile'])->name('delete_profile');
546 Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result'); 547 Route::post('кабинет/delete_profile/delete', [WorkerController::class, 'delete_profile_result'])->name('deleteprofile_result');
547 548
548 // Резюме -pdf 549 // Резюме -pdf
549 Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download'); 550 Route::get('кабинет/download/{worker}', [WorkerController::class, 'download'])->name('download');
550 551
551 // Поднятие анкеты 552 // Поднятие анкеты
552 Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up'); 553 Route::get('кабинет/up/{worker}', [WorkerController::class, 'up'])->name('up');
553 554
554 Route::post('test123', [WorkerController::class, 'test123'])->name('test123'); 555 Route::post('test123', [WorkerController::class, 'test123'])->name('test123');
555 556
556 // Добавление сертификата 557 // Добавление сертификата
557 Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate'); 558 Route::get('кабинет/new_sertificate/{worker}', [WorkerController::class, 'new_sertificate'])->name('new_sertificate');
558 Route::post('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate'); 559 Route::post('кабинет/add_sertificate', [WorkerController::class, 'add_serificate'])->name('add_serificate');
559 Route::get('кабинет/edit_sertificate/{worker}/{doc}', [WorkerController::class, 'edit_sertificate'])->name('edit_sertificate'); 560 Route::get('кабинет/edit_sertificate/{worker}/{doc}', [WorkerController::class, 'edit_sertificate'])->name('edit_sertificate');
560 Route::get('кабинет/edit_sertificate/{doc}', [WorkerController::class, 'update_serificate'])->name('update_serificate'); 561 Route::get('кабинет/edit_sertificate/{doc}', [WorkerController::class, 'update_serificate'])->name('update_serificate');
561 Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate'); 562 Route::get('кабинет/delete_sertificate/{doc}', [WorkerController::class, 'delete_sertificate'])->name('delete_sertificate');
562 563
563 // Добавление предыдущих контактов компании 564 // Добавление предыдущих контактов компании
564 Route::get('кабинет/prev_company/{worker}', [WorkerController::class, 'new_prev_company'])->name('new_prev_company'); 565 Route::get('кабинет/prev_company/{worker}', [WorkerController::class, 'new_prev_company'])->name('new_prev_company');
565 Route::post('кабинет/add_prev_company', [WorkerController::class, 'add_prev_company'])->name('add_prev_company'); 566 Route::post('кабинет/add_prev_company', [WorkerController::class, 'add_prev_company'])->name('add_prev_company');
566 Route::get('кабинет/edit_prev_company/{doc}/{worker}', [WorkerController::class, 'edit_prev_company'])->name('edit_prev_company'); 567 Route::get('кабинет/edit_prev_company/{doc}/{worker}', [WorkerController::class, 'edit_prev_company'])->name('edit_prev_company');
567 Route::post('кабинет/update_prev_company/{doc}', [WorkerController::class, 'update_prev_company'])->name('update_prev_company'); 568 Route::post('кабинет/update_prev_company/{doc}', [WorkerController::class, 'update_prev_company'])->name('update_prev_company');
568 Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company'); 569 Route::get('кабинет/delete_prev_company/{doc}', [WorkerController::class, 'delete_prev_company'])->name('delete_prev_company');
569 570
570 // Добавление документа-диплома 571 // Добавление документа-диплома
571 Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom'); 572 Route::get('кабинет/add_diplom/{worker}', [WorkerController::class, 'add_diplom'])->name('add_diplom');
572 Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save'); 573 Route::post('кабинет/add_diplom', [WorkerController::class, 'add_diplom_save'])->name('dop_info_save');
573 Route::put('кабинет/edit_diploms/{worker}', [WorkerController::class, 'edit_diploms'])->name('edit_diploms'); 574 Route::put('кабинет/edit_diploms/{worker}', [WorkerController::class, 'edit_diploms'])->name('edit_diploms');
574 Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom'); 575 Route::get('кабинет/delete_ad_diplom/{worker}', [WorkerController::class, 'delete_add_diplom'])->name('delete_add_diplom');
575 576
576 // Добавление стандартного диплома 577 // Добавление стандартного диплома
577 Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document'); 578 Route::get('кабинет/add_document/{worker}', [WorkerController::class, 'add_document'])->name('add_document');
578 Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save'); 579 Route::post('кабинет/add_document/', [WorkerController::class, 'add_document_save'])->name('add_document_save');
579 Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document'); 580 Route::get('кабинет/edit_document/{doc}/{worker}', [WorkerController::class, 'edit_document'])->name('edit_document');
580 Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save'); 581 Route::post('кабинет/edit_document/{doc}', [WorkerController::class, 'edit_document_save'])->name('edit_document_save');
581 Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document'); 582 Route::get('кабинет/delete_document/{doc}', [WorkerController::class, 'delete_document'])->name('delete_document');
582 583
583 // Отправка сообщения работодателю от соискателя 584 // Отправка сообщения работодателю от соискателя
584 Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message'); 585 Route::post('сообщение/', [WorkerController::class, 'new_message'])->name('new_message');
585 }); 586 });
586 587
587 // Личный кабинет работодателя 588 // Личный кабинет работодателя
588 Route::group([ 589 Route::group([
589 'as' => 'employer.', // имя маршрута, например auth.index 590 'as' => 'employer.', // имя маршрута, например auth.index
590 'prefix' => 'employer', // префикс маршрута, например auth/index 591 'prefix' => 'employer', // префикс маршрута, например auth/index
591 'middleware' => ['auth', 'is_employer'], 592 'middleware' => ['auth', 'is_employer'],
592 ], function() { 593 ], function() {
593 // 0 страница - Личные данные работодателя 594 // 0 страница - Личные данные работодателя
594 Route::get('cabinet/employer_info', [EmployerController::class, 'employer_info'])->name('employer_info'); 595 Route::get('cabinet/employer_info', [EmployerController::class, 'employer_info'])->name('employer_info');
595 Route::post('cabinet/employer_info/{user}', [EmployerController::class, 'employer_info_save'])->name('employer_info_save'); 596 Route::post('cabinet/employer_info/{user}', [EmployerController::class, 'employer_info_save'])->name('employer_info_save');
596 597
597 // 1 страница - Профиль 598 // 1 страница - Профиль
598 Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet'); 599 Route::get('cabinet', [EmployerController::class, 'cabinet'])->name('cabinet');
599 Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save'); 600 Route::post('cabinet/{Employer}', [EmployerController::class, 'cabinet_save'])->name('cabinet_save');
600 Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot'); 601 Route::post('flot_add_ajax', [EmployerController::class, 'save_add_flot'])->name('save_add_flot');
601 Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot'); 602 Route::get('flot_delete_ajax/{Flot}', [EmployerController::class, 'delete_flot'])->name('delete_flot');
602 Route::get('cabinet/flot_edit/{Flot}/{Employer}', [EmployerController::class, 'edit_flot'])->name('edit_flot'); 603 Route::get('cabinet/flot_edit/{Flot}/{Employer}', [EmployerController::class, 'edit_flot'])->name('edit_flot');
603 Route::post('cabinet/flot_edit/{Flot}', [EmployerController::class, 'update_flot'])->name('update_flot_save'); 604 Route::post('cabinet/flot_edit/{Flot}', [EmployerController::class, 'update_flot'])->name('update_flot_save');
604 Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot'); 605 Route::get('cabinet/flot', [EmployerController::class, 'slider_flot'])->name('slider_flot');
605 606
606 Route::get('social/{social}/{vacancy}', [Ad_jobsController::class, 'sendVacancyToSocial']) 607 Route::get('social/{social}/{vacancy}', [Ad_jobsController::class, 'sendVacancyToSocial'])
607 ->name('send-vacancy-to-social'); 608 ->name('send-vacancy-to-social');
608 609
609 // 2 страница - Добавление вакансий 610 // 2 страница - Добавление вакансий
610 Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); 611 Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie');
611 Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); 612 Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save');
612 //Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); 613 //Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people');
613 614
614 Route::get('cabinet/vacancie_danger', [EmployerController::class, 'cabinet_vacancie_danger'])->name('cabinet_vacancie_danger'); 615 Route::get('cabinet/vacancie_danger', [EmployerController::class, 'cabinet_vacancie_danger'])->name('cabinet_vacancie_danger');
615 616
616 617
617 618
618 Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); 619 Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people');
619 620
620 // 3 страница - Мои вакансии 621 // 3 страница - Мои вакансии
621 Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list'); 622 Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list');
622 Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); 623 Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit');
623 Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete'); 624 Route::get('cabinet/vacancy-delete/{ad_employer}', [EmployerController::class, 'vacancy_delete'])->name('vacancy_delete');
624 Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up'); 625 Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up');
625 Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye'); 626 Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye');
626 Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit'); 627 Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit');
627 Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me'); 628 Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me');
628 629
629 // 4.1Ю. 630 // 4.1Ю.
630 Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac'); 631 Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac');
631 Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save'); 632 Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save');
632 Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac'); 633 Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac');
633 Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save'); 634 Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save');
634 Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac'); 635 Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac');
635 636
636 // 4 страница - Отклики на вакансии 637 // 4 страница - Отклики на вакансии
637 Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers'); 638 Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers');
638 Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple'); 639 Route::get('cabinet/status/{employer}', [EmployerController::class, 'supple_status2'])->name('supple');
639 Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg'); 640 Route::get('status/{employer}/{ad_response}/{flag}', [EmployerController::class, 'supple_status'])->name('status_msg');
640 641
641 // 5 страница - Сообщения 642 // 5 страница - Сообщения
642 Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages'); 643 Route::get('cabinet/messages/{type_message}', [EmployerController::class, 'messages'])->name('messages');
643 Route::get('cabinet/dialog/{chat}', [EmployerController::class, 'dialog'])->name('dialog'); 644 Route::get('cabinet/dialog/{chat}', [EmployerController::class, 'dialog'])->name('dialog');
644 Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message'); 645 Route::post('cabinet/send-message', [EmployerController::class, 'send_message'])->name('send_message');
645 Route::post('test123', [EmployerController::class, 'test123'])->name('test123'); 646 Route::post('test123', [EmployerController::class, 'test123'])->name('test123');
646 647
647 // 6 страница - Избранный 648 // 6 страница - Избранный
648 Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites'); 649 Route::get('cabinet/favorites', [EmployerController::class, 'favorites'])->name('favorites');
649 650
650 //7 страница - База данных 651 //7 страница - База данных
651 Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd'); 652 Route::get('cabinet/bd', [EmployerController::class, 'bd'])->name('bd');
652 653
653 //8 страница - База резюме 654 //8 страница - База резюме
654 Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe'); 655 Route::get('cabinet/bd-tupe', [EmployerController::class, 'bd_tupe'])->name('bd-tupe');
655 656
656 // 9 рассылка сообщений 657 // 9 рассылка сообщений
657 Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages'); 658 Route::get('cabinet/send-all-messages', [EmployerController::class, 'send_all_messages'])->name('send_all_messages');
658 Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post'); 659 Route::post('cabinet/send-all-messages/send', [EmployerController::class, 'send_all_post'])->name('send_all_post');
659 660
660 // 10 страница FAQ вопрос 661 // 10 страница FAQ вопрос
661 Route::get('cabinet/faq', [FaqController::class, 'showListForUser'])->name('faq'); 662 Route::get('cabinet/faq', [FaqController::class, 'showListForUser'])->name('faq');
662 663
663 // 11 страница - Настройка уведомлений 664 // 11 страница - Настройка уведомлений
664 Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe'); 665 Route::get('cabinet/subscribe', [EmployerController::class, 'subscribe'])->name('subscribe');
665 Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe'); 666 Route::get('cabinet/subscribe/save', [EmployerController::class, 'save_subscribe'])->name('save_subscribe');
666 667
667 // 12 страница - Сменить пароль 668 // 12 страница - Сменить пароль
668 Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset'); 669 Route::get('cabinet/password-reset', [EmployerController::class, 'password_reset'])->name('password_reset');
669 Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password'); 670 Route::get('cabinet/password-reset/new', [EmployerController::class, 'new_password'])->name('new_password');
670 671
671 // 13 страница - Удаление профиля 672 // 13 страница - Удаление профиля
672 Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people'); 673 Route::get('cabinet/delete-people', [EmployerController::class, 'delete_people'])->name('delete_people');
673 Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user'); 674 Route::get('cabinet/action-delete-people', [EmployerController::class, 'action_delete_user'])->name('action_delete_user');
674 Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user'); 675 Route::get('cabinet/action-ajax-delete-people', [EmployerController::class, 'ajax_delete_user'])->name('ajax_delete_user');
675 676
676 // Отправил сообщение 677 // Отправил сообщение
677 Route::post('сообщение/', [EmployerController::class, 'new_message'])->name('new_message'); 678 Route::post('сообщение/', [EmployerController::class, 'new_message'])
679 ->withoutMiddleware('is_employer')
680 ->name('new_message');
678 681
679 Route::post('pin_chat/', [EmployerController::class, 'pin_chat'])->name('pin_chat'); 682 Route::post('pin_chat/', [EmployerController::class, 'pin_chat'])->name('pin_chat');
680 Route::post('remove_chat/', [EmployerController::class, 'remove_chat'])->name('remove_chat'); 683 Route::post('remove_chat/', [EmployerController::class, 'remove_chat'])->name('remove_chat');
681 }); 684 });
682 685
683 Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker'); 686 Route::get('TestWorker', [WorkerController::class, 'TestWorker'])->name('TestWorker');
684 687
685 Route::post('send_message', [HomeController::class, 'send_message'])->name('send_message'); 688 Route::post('send_message', [HomeController::class, 'send_message'])->name('send_message');
686 689