diff --git a/app/Http/Controllers/EmployerController.php b/app/Http/Controllers/EmployerController.php index 2025c7c..863909e 100644 --- a/app/Http/Controllers/EmployerController.php +++ b/app/Http/Controllers/EmployerController.php @@ -52,6 +52,12 @@ class EmployerController extends Controller select('ad_employers.*')-> where('id', '=', $vacancy)->get(); + if ($Query[0]->active_is===0 || $Query[0]->is_remove!=0){ + + abort(404); + + } + if (isset(Auth()->user()->id)) $uid = Auth()->user()->id; else diff --git a/app/Http/Controllers/MainController.php b/app/Http/Controllers/MainController.php index 0e38130..fbfaae2 100644 --- a/app/Http/Controllers/MainController.php +++ b/app/Http/Controllers/MainController.php @@ -205,6 +205,7 @@ class MainController extends Controller ->with('cat') ->with('employer') ->where('is_remove', 0) + ->where('active_is', 1) ->whereHas('jobs_code', function ($query) use ($job_search) { if (!empty($job_search)) { $query->where('job_title_id', $job_search); diff --git a/app/Http/Controllers/WorkerController.php b/app/Http/Controllers/WorkerController.php index b2c2739..5cf3292 100644 --- a/app/Http/Controllers/WorkerController.php +++ b/app/Http/Controllers/WorkerController.php @@ -81,10 +81,15 @@ class WorkerController extends Controller // лист база резюме public function bd_resume(Request $request) { - if (isset(Auth()->user()->id)) { - if ((Auth()->user()->is_worker) || (!Auth()->user()->is_lookin)) - return redirect()->route('index')->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]); + + if (!Auth::check()) { + + return redirect()->route('page', ['pages' => "Usloviya-razmescheniya"])->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]); + } + if ((Auth::user()->is_worker) || (!Auth()->user()->is_lookin)) + return redirect()->route('page', ['pages' => "Usloviya-razmescheniya"])->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]); + $status_work = WorkerStatuses::getWorkerStatuses(); @@ -948,6 +953,7 @@ class WorkerController extends Controller // Редактирование документа public function edit_document(place_works $doc, Worker $worker) { + return view('workers.docs-edit', compact('doc', 'worker')); } diff --git a/app/Models/User.php b/app/Models/User.php index a49a67b..9bbd3ab 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -142,9 +142,12 @@ class User extends Authenticatable return $query->where('is_remove', '=', '0'); } - public function scopeWorker($query) { + public function scopeIsWorker($query) { return $query->where('is_worker', '=', '1'); } + public function scopeIsLookin($query) { + return $query->where('is_lookin', '=', '1'); + } public function scopeBaseuser($query) { return $query->where('is_bd', '=', '1'); diff --git a/public/css/style_may2024.css b/public/css/style_may2024.css index aea7f9a..063dbab 100644 --- a/public/css/style_may2024.css +++ b/public/css/style_may2024.css @@ -9360,9 +9360,10 @@ main + .news { } } .cabinet__works-body { - opacity: 0; - height: 0; - overflow: hidden; + opacity: 1; + height: auto; + overflow: visible; + transition: opacity 0.3s, height 0.3s; } .active + .cabinet__works-body { -webkit-transition: 0.3s; diff --git a/resources/views/js/modals.blade.php b/resources/views/js/modals.blade.php index cd4f3ab..e592ce2 100644 --- a/resources/views/js/modals.blade.php +++ b/resources/views/js/modals.blade.php @@ -123,6 +123,8 @@ }); $(document).on('click', '#button_reg_worker', function() { + $('#messages_error_reg').html(''); + var field_login = $('#email_worker'); var field_pwd = $('#password_worker'); var field_confirm_pwd = $('#password_confirmation_worker'); @@ -156,15 +158,14 @@ return false; } - if (field_politik_worker.attr('checked')) { - console.log('politik=1'); - politik = 1; - } else { - politik = 0; - console.log('politik=0'); - + if (!document.getElementById('politik').checked) { + event.preventDefault(); + $('#block-info').css({'display': 'block'}); + $('#messages_error_reg').html('ERROR: Вы не согласились с политикой конфидициальности!'); + return false; } + console.log('login: '+login+' password: '+pwd); $.ajax({ @@ -201,6 +202,9 @@ }); $(document).on('click', '#button_reg_employer', function() { + + $('#messages_error_reg').html(''); + var field_login = $('#email_employer'); var field_pwd = $('#password_employer'); var field_confirm_pwd = $('#password_confirmation_employer'); @@ -233,13 +237,11 @@ } console.log('login: '+login+' password: '+pwd); - - if (field_politik_employer.attr('checked')) { - console.log('politik=1'); - politik = 1; - } else { - politik = 0; - console.log('politik=0'); + if (!document.getElementById('politik_employer').checked) { + event.preventDefault(); + $('#block-info').css({'display': 'block'}); + $('#messages_error_reg').html('ERROR: Вы не согласились с политикой конфидициальности!'); + return false; } $.ajax({