From bb2fb443df87d6bf5b48028cd49c1f0e78c45768 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: Tue, 5 Sep 2023 21:27:11 +0700 Subject: [PATCH] =?UTF-8?q?=D0=90=D1=80=D1=85=D0=B8=D1=82=D0=B5=D0=BA=D1=82=D1?= =?UTF-8?q?=83=D1=80=D0=BD=D0=BE=D0=B5=20=D0=B4=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=91=D0=94,=20=D0=BC=D0=BE=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D0=B5=D0=B9,=20=D0=BA=D0=BE=D0=BD=D1=82=D1=80=D0=BE=D0=BB=D0?= =?UTF-8?q?=BB=D0=B5=D1=80=D0=BE=D0=B2=20=D0=B8=20=D0=B2=D1=8C=D1=8E=D1=88=D0?= =?UTF-8?q?=B5=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Admin/Ad_EmployersController.php | 92 ++++++++ app/Http/Controllers/Admin/AdminController.php | 42 +--- app/Http/Controllers/Admin/CompanyController.php | 35 ++- app/Http/Controllers/Admin/EmployersController.php | 12 + app/Http/Controllers/Admin/UsersController.php | 10 +- app/Http/Controllers/Admin/WorkersController.php | 10 + app/Models/Ad_employer.php | 7 + public/assets/js/init-alpine.js | 4 + resources/views/admin/ad_employers/index.blade.php | 87 +++++++ resources/views/admin/category/index.blade.php | 29 +++ resources/views/admin/employer/index.blade.php | 31 ++- .../views/admin/employer/index_ajax.blade.php | 10 +- resources/views/admin/index.blade.php | 108 ++++++++- resources/views/admin/users/index.blade.php | 88 ++++--- resources/views/admin/users/index_ajax.blade.php | 18 +- resources/views/admin/worker/index.blade.php | 33 ++- resources/views/admin/worker/index_ajax.blade.php | 243 ++++++-------------- resources/views/layout/admin.blade.php | 232 ++++++++++++++----- routes/web.php | 37 ++- 19 files changed, 798 insertions(+), 330 deletions(-) create mode 100644 app/Http/Controllers/Admin/Ad_EmployersController.php create mode 100644 resources/views/admin/ad_employers/index.blade.php create mode 100644 resources/views/admin/static/index.blade.php diff --git a/app/Http/Controllers/Admin/Ad_EmployersController.php b/app/Http/Controllers/Admin/Ad_EmployersController.php new file mode 100644 index 0000000..1c77cb7 --- /dev/null +++ b/app/Http/Controllers/Admin/Ad_EmployersController.php @@ -0,0 +1,92 @@ +paginate(15); + + return view('admin.ad_employers.index', compact('ad_employers', 'title')); + + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + // + } + + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function store(Request $request) + { + // + } + + /** + * Display the specified resource. + * + * @param \App\Models\Ad_employer $ad_employer + * @return \Illuminate\Http\Response + */ + public function show(Ad_employer $ad_employer) + { + // + } + + /** + * Show the form for editing the specified resource. + * + * @param \App\Models\Ad_employer $ad_employer + * @return \Illuminate\Http\Response + */ + public function edit(Ad_employer $ad_employer) + { + // + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param \App\Models\Ad_employer $ad_employer + * @return \Illuminate\Http\Response + */ + public function update(Request $request, Ad_employer $ad_employer) + { + // + } + + /** + * Remove the specified resource from storage. + * + * @param \App\Models\Ad_employer $ad_employer + * @return \Illuminate\Http\Response + */ + public function destroy(Ad_employer $ad_employer) + { + // + } +} diff --git a/app/Http/Controllers/Admin/AdminController.php b/app/Http/Controllers/Admin/AdminController.php index 9b0d1cd..e184976 100644 --- a/app/Http/Controllers/Admin/AdminController.php +++ b/app/Http/Controllers/Admin/AdminController.php @@ -148,6 +148,7 @@ class AdminController extends Controller public function index_admin(Request $request) { $title = 'Админка - Администраторы системы'; + $id_admin = Auth::user()->id; if ($request->ajax()) { $user = User::find($request->id); @@ -158,9 +159,9 @@ class AdminController extends Controller $users = User::where('admin', '1')->paginate(15); if ($request->ajax()) { - return view('admin.users.index_ajax', compact('users')); + return view('admin.users.index_ajax', compact('users', 'id_admin')); } else { - return view('admin.users.index', compact('users', 'title')); + return view('admin.users.index', compact('users', 'title', 'id_admin')); } } @@ -171,7 +172,7 @@ class AdminController extends Controller $caption = "Карточка работника"; if (isset($user->workers[0]->id)) { $link = route('admin.worker-profile', ['worker' => $user->workers[0]->id]); - $visible = true; + //$visible = true; } else { $link = ""; } @@ -181,7 +182,7 @@ class AdminController extends Controller if (isset($user->employers[0]->id)) { $link = route('admin.employer-profile', ['employer' => $user->employers[0]->id]); - $visible = true; + //$visible = true; } else { $link = ""; } @@ -322,38 +323,5 @@ class AdminController extends Controller return redirect()->route('admin.config'); } - // кабинет - редактор сайта - public function editor() { - return; - } - - // кабинет - редактор шапки-футера сайта - public function editblocks() { - return; - } - - // кабинет - редактор должности на главной - public function job_titles_main() { - return; - } - - // кабинет - редактор работодатели на главной - public function employers_main() { - return; - } - - // кабинет - редактор seo-сайта - public function editor_seo() { - return; - } - // кабинет - редактор страниц - public function editor_pages() { - return; - } - - // кабинет - реклама сайта - public function reclames() { - return; - } } diff --git a/app/Http/Controllers/Admin/CompanyController.php b/app/Http/Controllers/Admin/CompanyController.php index da215ff..d72a119 100644 --- a/app/Http/Controllers/Admin/CompanyController.php +++ b/app/Http/Controllers/Admin/CompanyController.php @@ -7,5 +7,38 @@ use Illuminate\Http\Request; class CompanyController extends Controller { - // + // кабинет - редактор сайта + public function editor() { + return; + } + + // кабинет - редактор шапки-футера сайта + public function editblocks() { + return; + } + + // кабинет - редактор должности на главной + public function job_titles_main() { + return; + } + + // кабинет - редактор работодатели на главной + public function employers_main() { + return; + } + + // кабинет - редактор seo-сайта + public function editor_seo() { + return; + } + + // кабинет - редактор страниц + public function editor_pages() { + return; + } + + // кабинет - реклама сайта + public function reclames() { + return; + } } diff --git a/app/Http/Controllers/Admin/EmployersController.php b/app/Http/Controllers/Admin/EmployersController.php index 005d67a..edb589f 100644 --- a/app/Http/Controllers/Admin/EmployersController.php +++ b/app/Http/Controllers/Admin/EmployersController.php @@ -87,4 +87,16 @@ class EmployersController extends Controller ->with('success', 'Данные были успешно сохранены'); } } + + // кабинет - отзывы о работодателе для модерации + public function answers() { + return; + } + + // кабинет - статистика вакансий работодателя + public function static_ads() { + return; + } + + } diff --git a/app/Http/Controllers/Admin/UsersController.php b/app/Http/Controllers/Admin/UsersController.php index 6006242..14e0782 100644 --- a/app/Http/Controllers/Admin/UsersController.php +++ b/app/Http/Controllers/Admin/UsersController.php @@ -5,12 +5,13 @@ namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Models\User; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Auth; class UsersController extends Controller { public function index(Request $request) { $title = 'Админка - Пользователи системы'; - + $id_admin = Auth::user()->id; if ($request->ajax()) { $user = User::find($request->id); $request->offsetUnset('id'); @@ -20,10 +21,13 @@ class UsersController extends Controller $users = User::query()->paginate(15); if ($request->ajax()) { - return view('admin.users.index_ajax', compact('users')); + return view('admin.users.index_ajax', compact('users', 'id_admin')); } else { - return view('admin.users.index', compact('users', 'title')); + return view('admin.users.index', compact('users', 'title', 'id_admin')); } } + public function roles() { + return; + } } diff --git a/app/Http/Controllers/Admin/WorkersController.php b/app/Http/Controllers/Admin/WorkersController.php index dcc857f..afd74b1 100644 --- a/app/Http/Controllers/Admin/WorkersController.php +++ b/app/Http/Controllers/Admin/WorkersController.php @@ -28,4 +28,14 @@ class WorkersController extends Controller public function form_update_worker(Worker $worker) { return view('admin.worker.edit'); } + + // кабинет - статистика работников + public function static_workers() { + return; + } + + // кабинет - справочник - блоки информации для резюме работника + public function infobloks() { + return; + } } diff --git a/app/Models/Ad_employer.php b/app/Models/Ad_employer.php index 3441aee..8a0025a 100644 --- a/app/Models/Ad_employer.php +++ b/app/Models/Ad_employer.php @@ -8,4 +8,11 @@ use Illuminate\Database\Eloquent\Model; class Ad_employer extends Model { use HasFactory; + + /* + * Связь таблицы employers с таблицей ad_employers + */ + public function employer() { + return $this->belongsTo(Employer::class, 'employer_id'); + } } diff --git a/public/assets/js/init-alpine.js b/public/assets/js/init-alpine.js index 46a3cd4..1730c49 100644 --- a/public/assets/js/init-alpine.js +++ b/public/assets/js/init-alpine.js @@ -47,6 +47,10 @@ function data() { togglePagesMenu() { this.isPagesMenuOpen = !this.isPagesMenuOpen }, + open1: false, + open1() { + this.open1 = !this.open1 + }, // Modal isModalOpen: false, trapCleanup: null, diff --git a/resources/views/admin/ad_employers/index.blade.php b/resources/views/admin/ad_employers/index.blade.php new file mode 100644 index 0000000..fe7b5d0 --- /dev/null +++ b/resources/views/admin/ad_employers/index.blade.php @@ -0,0 +1,87 @@ +@extends('layout.admin', ['title' => 'Админка - Работодатели']) + +@section('script') +@endsection + +@section('search') +
+ +
+
+
+
+ +
+
+@endsection + +@section('content') +
+
+ + + + + + + + + + + + @foreach($ad_employers as $ad) + + + + + + + + @endforeach + +
Название компанииВакансииГородДата
+ {{$ad->id}} + + {{$ad->employers->name_company}} + +
+
+ +

+

+

+ +
+
+ +
+ {{ $ad->city }} + + {{ $ad->created_at }} +
+
+ +
+ appends($_GET)->links('admin.pagginate'); ?> +
+
+@endsection diff --git a/resources/views/admin/category/index.blade.php b/resources/views/admin/category/index.blade.php index a4cb91c..22ae1cc 100644 --- a/resources/views/admin/category/index.blade.php +++ b/resources/views/admin/category/index.blade.php @@ -38,6 +38,35 @@ @endsection +@section('search') +
+ +
+
+
+
+ +
+
+@endsection + @section('content') diff --git a/resources/views/admin/employer/index.blade.php b/resources/views/admin/employer/index.blade.php index d273c3b..5471ebb 100644 --- a/resources/views/admin/employer/index.blade.php +++ b/resources/views/admin/employer/index.blade.php @@ -22,7 +22,7 @@ success: function (data) { console.log('Обновление таблицы пользователей '); //data = JSON.parse(data); - console.log(data); + //console.log(data); ajax_block.html(data); }, headers: { @@ -38,6 +38,35 @@ @endsection +@section('search') +
+ +
+
+
+
+ +
+
+@endsection + @section('content')
diff --git a/resources/views/admin/employer/index_ajax.blade.php b/resources/views/admin/employer/index_ajax.blade.php index dbfcf90..4b39960 100644 --- a/resources/views/admin/employer/index_ajax.blade.php +++ b/resources/views/admin/employer/index_ajax.blade.php @@ -10,7 +10,7 @@ Имя Дата регистрации Изменить - Блокировать + Бан @@ -46,10 +46,14 @@ {{ $user->created_at }} - Изменить + @if ($user->id > 1) + Изменить + @endif - is_ban) ? "checked" : "" }}/> + @if ($user->id > 1) + is_ban) ? "checked" : "" }}/> + @endif @endforeach diff --git a/resources/views/admin/index.blade.php b/resources/views/admin/index.blade.php index 98578fb..646087c 100644 --- a/resources/views/admin/index.blade.php +++ b/resources/views/admin/index.blade.php @@ -243,7 +243,7 @@

Должности

- Все должности + Справочник должности (все должности проекта)

@@ -268,6 +268,33 @@
+

Документы-Дипломы

+

+ Справочник документы-дипломы (все блоки-документы необходимые соискателю) +

+
+ + + + infobloks + + + + Доступно + + + + сентябрь 2023 + + + + + +
+ +

Сообщения

Все сообщения сайта @@ -315,7 +342,86 @@ + + +

+ +
+

Роли пользователей

+

+ Роли людей (запреты и доступы) в системе +

+
+
+ + + users + + + + Доступно + + + + сентябрь 2023 + + + + +
+ +
+

Статистика

+

+ Статистика соискателей и работодателей +

+
+
+ + + static_workers, static_ads + + + + Недоступно + + + + сентябрь 2023 + + + + + +
+ +
+

Редактор сайта

+

+ Все редакторы системы +

+
+
+ + + header_footer, job_titles_mains, employers_mains,
pages, seo, reclames, companies + + + + Доступно + + + + сентябрь 2023 + + - {{ $user->name }} - - - {{ $user->email }} - - - - @if ($user->is_worker) - Работник - @else - Работодатель - @endif - - @if ($user->admin) - - Администратор - - @endif - - - {{ $user->created_at }} - - - @endforeach - - -
- -
- appends($_GET)->links('admin.pagginate'); ?> -
- - - -
- - appends($_GET)->links('catalogs.paginate'); ?> - + № + Имя + Email/Телефон + % заполнения анкеты + Дата регистрации + Изменить + Бан + + + + @foreach($users as $user) + + + {{$user->id}} + + + {{ !empty($user->name_man) ? $user->name_man : $user->name }} + + +
+
+

{{ empty($user->workers->email) ? $user->email : $user->workers->email }}

+

+ {{ empty($user->workers->telephone) ? $user->telephone : $user->workers->telephone }} +

+
+
+ + + @if (!empty($user->workers->persent_anketa)) + @if ($user->workers->persent_anketa > 40) + + {{$user->workers->persent_anketa}}% + + @else + + {{$user->workers->persent_anketa}}% + + @endif + @else + + 10% + + @endif + + + {{ $user->created_at }} + + + @if ($user->id > 1) + Изменить + @endif + + + @if ($user->id > 1) + is_ban) ? "checked" : "" }}/> + @endif + + + @endforeach + + + -@endsection +
+ appends($_GET)->links('admin.pagginate'); ?> +
diff --git a/resources/views/layout/admin.blade.php b/resources/views/layout/admin.blade.php index 9da075f..f89aa03 100644 --- a/resources/views/layout/admin.blade.php +++ b/resources/views/layout/admin.blade.php @@ -149,10 +149,11 @@ Вакансии +
  • - + - Категории + Сообщения
  • - + - Должности + Группы пользователей
  • - + - Сообщения + Роли пользователей
  • + - Группы пользователей + Статистика
  • + +
  • + + +
  • + + +
  • + +
  • + + +
  • + + +