From 0fc30621f713a8ce77202ac3bf923cf23f04d110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=20=D0=9B=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D0=BE=D0=BD=D0=BE=D0=B2?= Date: Fri, 26 Apr 2024 19:46:25 +0700 Subject: [PATCH] =?UTF-8?q?=D0=BA=D0=BE=D0=BC=D0=BC=D0=B8=D1=82=20=D0=BE=D1=82?= =?UTF-8?q?=20=D0=BF=D1=8F=D1=82=D0=BD=D0=B8=D1=86=D1=8B=2026=20=D1=87=D0=B8?= =?UTF-8?q?=D1=81=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/CompanyController.php | 2 +- app/Http/Controllers/EmployerController.php | 32 ++++-- app/Http/Controllers/WorkerController.php | 101 +++++++++-------- resources/views/ajax/resume_1.blade.php | 117 +++++++++++--------- .../views/employers/add_vacancy_danger.blade.php | 60 ++++++++++ .../views/employers/bd_resume_danger.blade.php | 60 ++++++++++ resources/views/employers/menu.blade.php | 22 ++++ resources/views/index.blade.php | 1 + resources/views/resume.blade.php | 36 +++++- routes/web.php | 5 + 10 files changed, 325 insertions(+), 111 deletions(-) create mode 100644 resources/views/employers/add_vacancy_danger.blade.php create mode 100644 resources/views/employers/bd_resume_danger.blade.php diff --git a/app/Http/Controllers/CompanyController.php b/app/Http/Controllers/CompanyController.php index e158da6..ad4da01 100644 --- a/app/Http/Controllers/CompanyController.php +++ b/app/Http/Controllers/CompanyController.php @@ -8,7 +8,7 @@ use Illuminate\Http\Request; class CompanyController extends Controller { public function shipping_companies(Request $request) { - $emps = Employer::query()->with('ads'); + $emps = Employer::query()->with('ads')->where('status_hidden', '=', '0'); if (($request->has('search')) && (!empty($request->get('search')))) { $search = $request->get('search'); $emps = $emps->where('name_company', 'LIKE', "%$search%"); diff --git a/app/Http/Controllers/EmployerController.php b/app/Http/Controllers/EmployerController.php index 2792d02..dfcd177 100644 --- a/app/Http/Controllers/EmployerController.php +++ b/app/Http/Controllers/EmployerController.php @@ -162,18 +162,26 @@ class EmployerController extends Controller public function cabinet_vacancie() { $id = Auth()->user()->id; - $categories = Category::query()->active()->get(); - //if ($categories->count()) { - // $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->Notbdif()->where('position_id', $categories[0]->id)->get(); - //} else { - // $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->Notbdif()->where('position_id', 0)->get(); - //} - $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->where('is_bd', '=' , '0')->get(); - $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> - WhereHas('users', - function (Builder $query) use ($id) {$query->Where('id', $id); - })->get(); - return view('employers.add_vacancy', compact('Employer', 'jobs' , 'categories')); + if (Auth()->user()->is_public) { + $categories = Category::query()->active()->get(); + + $jobs = Job_title::query()->OrderBy('name')->where('is_remove', '=', '0')->where('is_bd', '=', '0')->get(); + $Employer = Employer::query()->with('users')->with('ads')->with('flots')-> + + WhereHas('users', + function (Builder $query) use ($id) { + $query->Where('id', $id); + })->get(); + + return view('employers.add_vacancy', compact('Employer', 'jobs', 'categories')); + } else { + return redirect()->route('employer.cabinet_vacancie_danger'); + } + } + + // Форма предупреждения об оплате + public function cabinet_vacancie_danger() { + return view('employers.add_vacancy_danger'); } // Сохранение вакансии diff --git a/app/Http/Controllers/WorkerController.php b/app/Http/Controllers/WorkerController.php index 68e7bb1..d5f3c29 100644 --- a/app/Http/Controllers/WorkerController.php +++ b/app/Http/Controllers/WorkerController.php @@ -73,63 +73,76 @@ class WorkerController extends Controller // лист база резюме public function bd_resume(Request $request) { + $look = false; + $idiot = 0; if (isset(Auth()->user()->id)) { $idiot = Auth()->user()->id; - } else { - $idiot = 0; + if ((!Auth()->user()->is_worker) && (Auth()->user()->is_lookin)) + $look = true; } - $status_work = $this->status_work; - $resumes = Worker::query()->with('users')->with('job_titles'); - $resumes = $resumes->whereHas('users', function (Builder $query) { - $query->Where('is_worker', '=', '1') - ->Where('is_bd', '=', '0'); - }); - - //dd($request->get('job')); - if (($request->has('job')) && ($request->get('job') > 0)) { - $resumes = $resumes->whereHas('job_titles', function(Builder $query) use ($request) { - $query->Where('job_titles.id', $request->get('job')); + if ($look) { + $status_work = $this->status_work; + $resumes = Worker::query()->with('users')->with('job_titles'); + $resumes = $resumes->whereHas('users', function (Builder $query) { + $query->Where('is_worker', '=', '1') + ->Where('is_bd', '=', '0'); }); - } - $Job_title = Job_title::query()->get(); - - if ($request->get('sort')) { - $sort = $request->get('sort'); - switch ($sort) { - case 'name_up': - $resumes = $resumes->orderBy(User::select('surname') - ->whereColumn('Workers.user_id', 'users.id') - ); - break; - case 'name_down': - $resumes = $resumes->orderByDesc(User::select('surname') - ->whereColumn('Workers.user_id', 'users.id') - ); - break; - case 'created_at_up': $resumes = $resumes->OrderBy('created_at')->orderBy('id'); break; - case 'created_at_down': $resumes = $resumes->orderByDesc('created_at')->orderBy('id'); break; - case 'default': $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; - default: $resumes = $resumes->orderBy('id')->orderby('updated_at'); break; + //dd($request->get('job')); + if (($request->has('job')) && ($request->get('job') > 0)) { + $resumes = $resumes->whereHas('job_titles', function (Builder $query) use ($request) { + $query->Where('job_titles.id', $request->get('job')); + }); } - } - $res_count = $resumes->count(); - //$resumes = $resumes->get(); + $Job_title = Job_title::query()->get(); - $resumes = $resumes->paginate(4); - if ($request->ajax()) { - // Условия обставлены - if ($request->has('block') && ($request->get('block') == 1)) { - return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot')); + if ($request->get('sort')) { + $sort = $request->get('sort'); + switch ($sort) { + case 'name_up': + $resumes = $resumes->orderBy(User::select('surname') + ->whereColumn('Workers.user_id', 'users.id') + ); + break; + case 'name_down': + $resumes = $resumes->orderByDesc(User::select('surname') + ->whereColumn('Workers.user_id', 'users.id') + ); + break; + case 'created_at_up': + $resumes = $resumes->OrderBy('created_at')->orderBy('id'); + break; + case 'created_at_down': + $resumes = $resumes->orderByDesc('created_at')->orderBy('id'); + break; + case 'default': + $resumes = $resumes->orderBy('id')->orderby('updated_at'); + break; + default: + $resumes = $resumes->orderBy('id')->orderby('updated_at'); + break; + } } - if ($request->has('block') && ($request->get('block') == 2)) { - return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot')); + $res_count = $resumes->count(); + //$resumes = $resumes->get(); + $resumes = $resumes->paginate(4); + if ($request->ajax()) { + // Условия обставлены + if ($request->has('block') && ($request->get('block') == 1)) { + return view('ajax.resume_1', compact('resumes', 'status_work', 'res_count', 'idiot')); + } + + if ($request->has('block') && ($request->get('block') == 2)) { + return view('ajax.resume_2', compact('resumes', 'status_work', 'res_count', 'idiot')); + } + } else { + return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot', 'Job_title')); } } else { - return view('resume', compact('resumes', 'status_work', 'res_count', 'idiot', 'Job_title')); + return redirect()->route('index')->withErrors(['errors' => ['Вы не можете просматривать базу резюме. Подробнее в меню: "Условия размещения"']]); } } diff --git a/resources/views/ajax/resume_1.blade.php b/resources/views/ajax/resume_1.blade.php index 5e21cda..5cd9cb4 100644 --- a/resources/views/ajax/resume_1.blade.php +++ b/resources/views/ajax/resume_1.blade.php @@ -1,62 +1,79 @@ -@if ($resumes->count()) - @foreach ($resumes as $res) -
-
- - + @guest + + @else + @if (App\Classes\StatusUser::Status()==0) + @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message)) + + @endif + @else + + @endif + @endif +
+
+ +
+
+ Статус + {{ $status_work[$res->status_work] }}
-
- -
-
- Статус - {{ $status_work[$res->status_work] }} -
-
- Имя работника - @if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif -
-
- Номер телефона - {{ $res->telephone }} -
-
- Электронный адрес - {{ $res->email }} -
-
- Город проживания - {{ $res->city }} -
-
- Опыт работы - {{ $res->experience }} -
-
+
+ Имя работника + @if (isset($res->users)){{ $res->users->surname." ".$res->users->name_man." ".$res->users->surname2 }} @endif
-
- @if ($res->job_titles->count()) - @if (isset($res->job_titles)) - @foreach ($res->job_titles as $key => $j) - #{{ $j->name }} - @endforeach - @endif - @endif +
+ Номер телефона + {{ $res->telephone }} +
+
+ Электронный адрес + {{ $res->email }} +
+
+ Город проживания + {{ $res->city }} +
+
+ Опыт работы + {{ $res->experience }}
- Перейти в резюме
- @endforeach +
+
+ @if ($res->job_titles->count()) + @if (isset($res->job_titles)) + @foreach ($res->job_titles as $key => $j) + #{{ $j->name }} + @endforeach + @endif + @endif +
+ Перейти в резюме +
+@endforeach - {{ $resumes->appends($_GET)->links('paginate') }} +{{ $resumes->appends($_GET)->links('paginate') }} @else

По данному запросу ничего не найдено

@endif diff --git a/resources/views/employers/add_vacancy_danger.blade.php b/resources/views/employers/add_vacancy_danger.blade.php new file mode 100644 index 0000000..bcb6a36 --- /dev/null +++ b/resources/views/employers/add_vacancy_danger.blade.php @@ -0,0 +1,60 @@ +@extends('layout.frontend', ['title' => 'База данных - РекаМоре']) + +@section('scripts') + +@endsection + +@section('content') +
+
+ +
+
+
+ @include('employers.emblema') +
+ @include('employers.menu', ['item' => 2]) +
+
+
+

Добавление вакансии

+
+
+
+
+ Нельзя добавить вакансию, прочтите инструкцию для преодоления данной проблемы. + Условия размещения +
+
+
+
+
+
+@endsection diff --git a/resources/views/employers/bd_resume_danger.blade.php b/resources/views/employers/bd_resume_danger.blade.php new file mode 100644 index 0000000..367d46d --- /dev/null +++ b/resources/views/employers/bd_resume_danger.blade.php @@ -0,0 +1,60 @@ +@extends('layout.frontend', ['title' => 'База данных - РекаМоре']) + +@section('scripts') + +@endsection + +@section('content') +
+
+ +
+
+
+ @include('employers.emblema') +
+ @include('employers.menu', ['item' => 8]) +
+
+
+

База резюме

+
+
+
+
+ Данные нельзя просмотреть, прочтите инструкцию + Условия размещения +
+
+
+
+
+
+@endsection diff --git a/resources/views/employers/menu.blade.php b/resources/views/employers/menu.blade.php index be22ca7..780515a 100644 --- a/resources/views/employers/menu.blade.php +++ b/resources/views/employers/menu.blade.php @@ -33,6 +33,7 @@ Профиль + @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_public)) @@ -41,6 +42,16 @@ Разместить вакансию + @else + + + + + + + Разместить вакансию + + @endif @@ -81,6 +92,7 @@ База данных + @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_lookin)) @@ -89,6 +101,16 @@ База резюме + @else + + + + + + + База резюме + + @endif diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index 230b57a..623d519 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -5,6 +5,7 @@ @endsection @section('content') + @include('messages_error')
diff --git a/resources/views/resume.blade.php b/resources/views/resume.blade.php index ce2a220..0929fc4 100644 --- a/resources/views/resume.blade.php +++ b/resources/views/resume.blade.php @@ -340,18 +340,21 @@ @else @if (App\Classes\StatusUser::Status()==0) + @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message)) + @endif @else @endif + + @endif @endif
@@ -413,11 +416,36 @@ - + @else + @if (App\Classes\StatusUser::Status()==0) + @if ((!Auth()->user()->is_worker) && (Auth()->user()->is_message)) + + @endif + @else + + @endif + @endif
diff --git a/routes/web.php b/routes/web.php index e4f5fe1..bd3aefd 100644 --- a/routes/web.php +++ b/routes/web.php @@ -444,6 +444,9 @@ Route::get('contacts', [MainController::class, 'contacts'])->name('contacts'); //База резюме Route::get('bd-resume', [WorkerController::class, 'bd_resume'])->name('bd_resume'); +Route::get('bd_resume_danger', function(){ + return view('employers.bd_resume_danger'); +})->name('bd_resume_danger'); Route::get('like-resume', [MainController::class, 'like_worker'])->name('like_resume'); @@ -564,6 +567,8 @@ Route::group([ // 2 страница - Добавление вакансий Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie'); Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save'); + Route::get('cabinet/vacancie_danger', [EmployerController::class, 'cabinet_vacancie_danger'])->name('cabinet_vacancie_danger'); + Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people'); -- 1.7.10.4