Commit 6ff65f10a76247e609957ace089f351b8fae67f0

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

Обновление

Showing 31 changed files Side-by-side Diff

app/Http/Controllers/Ad_jobsController.php
... ... @@ -0,0 +1,98 @@
  1 +<?php
  2 +
  3 +namespace App\Http\Controllers;
  4 +
  5 +use App\Classes\RusDate;
  6 +use App\Classes\Tools;
  7 +use App\Http\Requests\FlotRequest;
  8 +use App\Http\Requests\MessagesRequiest;
  9 +use App\Http\Requests\VacancyRequestEdit;
  10 +use App\Http\Requests\VacansiaRequiest;
  11 +use App\Mail\MailSotrudnichestvo;
  12 +use App\Mail\SendAllMessages;
  13 +use App\Models\Ad_employer;
  14 +use App\Models\Ad_jobs;
  15 +use App\Models\ad_response;
  16 +use App\Models\Category;
  17 +use App\Models\Education;
  18 +use App\Models\Employer;
  19 +use App\Models\employers_main;
  20 +use App\Models\Flot;
  21 +use App\Models\Job_title;
  22 +use App\Models\Like_vacancy;
  23 +use App\Models\Like_worker;
  24 +use App\Models\Message;
  25 +use App\Models\Positions;
  26 +use App\Models\Worker;
  27 +use Carbon\Carbon;
  28 +use Illuminate\Auth\Events\Registered;
  29 +use Illuminate\Database\Eloquent\Builder;
  30 +use Illuminate\Database\Eloquent\Model;
  31 +use Illuminate\Foundation\Auth\User;
  32 +use Illuminate\Http\Request;
  33 +use Illuminate\Support\Facades\Auth;
  34 +use Illuminate\Support\Facades\Hash;
  35 +use Illuminate\Support\Facades\Mail;
  36 +use Illuminate\Support\Facades\Storage;
  37 +use App\Models\User as User_Model;
  38 +use Illuminate\Support\Facades\Validator;
  39 +
  40 +class Ad_jobsController extends Controller
  41 +{
  42 +
  43 + public function add_job_in_vac(Request $request, Ad_employer $ad_employer) {
  44 + $id = Auth()->user()->id;
  45 +
  46 + $Positions = Positions::query()->get();
  47 + if ($Positions->count()) {
  48 + $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get();
  49 + } else {
  50 + $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get();
  51 + }
  52 + $categories = Category::query()->get();
  53 + $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
  54 + where('user_id', $id)->first();
  55 +
  56 + return view('employers.add_ad_jobs', compact('ad_employer',
  57 + 'Positions', 'categories', 'jobs',
  58 + 'Employer'));
  59 + }
  60 +
  61 + public function add_job_in_vac_save(Request $request) {
  62 + $params = $request->all();
  63 +
  64 + Ad_jobs::create($params);
  65 + return redirect()->route('employer.vacancy_list');
  66 + }
  67 +
  68 + public function edit_job_in_vac(Ad_jobs $ad_job, Ad_employer $ad_employer) {
  69 + $id = Auth()->user()->id;
  70 +
  71 + $Positions = Positions::query()->get();
  72 + if ($Positions->count()) {
  73 + $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get();
  74 + } else {
  75 + $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get();
  76 + }
  77 + $categories = Category::query()->get();
  78 + $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
  79 + where('user_id', $id)->first();
  80 +
  81 + return view('employers.edit_ad_jobs', compact('ad_job',
  82 + 'Positions', 'categories',
  83 + 'Employer','jobs', 'ad_employer'));
  84 + }
  85 +
  86 + public function edit_job_in_vac_save(Request $request, Ad_jobs $ad_job) {
  87 + $params = $request->all();
  88 +
  89 + $ad_job->update($params);
  90 +
  91 + return redirect()->route('employer.vacancy_list');
  92 + }
  93 +
  94 + public function delete_job_in_vac(Ad_jobs $ad_job) {
  95 + $ad_job->delete();
  96 + return redirect()->route('employer.vacancy_list');
  97 + }
  98 +}
app/Http/Controllers/Admin/JobTitlesController.php
... ... @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Admin;
5 5 use App\Http\Controllers\Controller;
6 6 use App\Http\Requests\JobTitlesRequest;
7 7 use App\Models\Job_title;
  8 +use App\Models\Positions;
8 9 use Illuminate\Http\Request;
9 10  
10 11 class JobTitlesController extends Controller
... ... @@ -32,8 +33,9 @@ class JobTitlesController extends Controller
32 33 orderBy('name')->
33 34 active()->
34 35 get();*/
  36 + $position = Positions::query()->get();
35 37  
36   - return view('admin.job_titles.add');
  38 + return view('admin.job_titles.add', compact('position'));
37 39 }
38 40  
39 41 /**
... ... @@ -67,7 +69,8 @@ class JobTitlesController extends Controller
67 69 */
68 70 public function edit(Job_title $job_title)
69 71 {
70   - return view('admin.job_titles.edit', compact('job_title'));
  72 + $position = Positions::query()->get();
  73 + return view('admin.job_titles.edit', compact('job_title', 'position'));
71 74 }
72 75  
73 76 /**
app/Http/Controllers/CompanyController.php
... ... @@ -30,6 +30,7 @@ class CompanyController extends Controller
30 30  
31 31 $emps = $emps->paginate(4);
32 32  
  33 +
33 34 if ($request->ajax()) {
34 35 if ($request->get('block') == '1')
35 36 return view('ajax.companies', compact('emps', 'count_emps'));
app/Http/Controllers/EmployerController.php
... ... @@ -114,9 +114,15 @@ class EmployerController extends Controller
114 114 // Форма добавления вакансий
115 115 public function cabinet_vacancie() {
116 116 $id = Auth()->user()->id;
117   - $jobs = Job_title::query()->OrderBy('name')->get();
  117 +
118 118 $categories = Category::query()->get();
119 119 $Positions = Positions::query()->get();
  120 + if ($Positions->count()) {
  121 + $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get();
  122 + } else {
  123 + $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get();
  124 + }
  125 +
120 126 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
121 127 WhereHas('users',
122 128 function (Builder $query) use ($id) {$query->Where('id', $id);
... ... @@ -128,27 +134,8 @@ class EmployerController extends Controller
128 134 // Сохранение вакансии
129 135 public function cabinet_vacancy_save1(VacancyRequestEdit $request) {
130 136 $params = $request->all();
131   - $jobs['min_salary'] = $params['min_salary'];
132   - $jobs['max_salary'] = $params['max_salary'];
133   - $jobs['flot'] = $params['flot'];
134   - $jobs['power'] = $params['power'];
135   - $jobs['sytki'] = $params['sytki'];
136   - $jobs['start'] = $params['start'];
137   - $jobs['job_title_id'] = $params['job_title_id'];
138   - $jobs['description'] = $params['description'];
139   - $jobs['region'] = $params['city'];
140   - $jobs['position_ship'] = $params['position_ship'];
141   - unset($params['min_salary']);
142   - unset($params['max_salary']);
143   - unset($params['flot']);
144   - unset($params['sytki']);
145   - unset($params['start']);
146   - unset($params['job_title_id']);
147   - unset($params['description']);
148   -
149   - $id = Ad_employer::create($params)->id;
150   - $jobs['ad_employer_id'] = $id;
151   - Ad_jobs::create($jobs);
  137 +
  138 + $ad_jobs = Ad_employer::create($params);
152 139 return redirect()->route('employer.vacancy_list');
153 140 }
154 141  
... ... @@ -156,7 +143,8 @@ class EmployerController extends Controller
156 143 public function vacancy_list(Request $request) {
157 144 $id = Auth()->user()->id;
158 145 $Employer = Employer::query()->where('user_id', $id)->first();
159   - $vacancy_list = Ad_employer::query()->where('employer_id', $Employer->id);
  146 + $vacancy_list = Ad_employer::query()->with('jobs')->with('jobs_code')->where('employer_id', $Employer->id);
  147 +
160 148  
161 149 if ($request->get('sort')) {
162 150 $sort = $request->get('sort');
... ... @@ -169,7 +157,7 @@ class EmployerController extends Controller
169 157 default: $vacancy_list = $vacancy_list->orderBy('id')->orderby('updated_at'); break;
170 158 }
171 159 }
172   - $vacancy_list = $vacancy_list->get();
  160 + $vacancy_list = $vacancy_list->paginate(4);
173 161  
174 162 //ajax
175 163 if ($request->ajax()) {
... ... @@ -182,19 +170,35 @@ class EmployerController extends Controller
182 170 // Карточка вакансии
183 171 public function vacancy_edit(Ad_employer $ad_employer) {
184 172 $id = Auth()->user()->id;
185   - $jobs = Job_title::query()->OrderBy('name')->get();
  173 +
  174 + $Positions = Positions::query()->get();
  175 + if ($Positions->count()) {
  176 + $jobs = Job_title::query()->OrderBy('name')->where('position_id', $Positions[0]->id)->get();
  177 + } else {
  178 + $jobs = Job_title::query()->OrderBy('name')->where('position_id', 0)->get();
  179 + }
186 180 $categories = Category::query()->get();
187 181 $Employer = Employer::query()->with('users')->with('ads')->with('flots')->
188 182 where('user_id', $id)->first();
189 183  
190   - return view('employers.edit_vacancy', compact('ad_employer', 'categories','Employer', 'jobs'));
  184 + return view('employers.edit_vacancy', compact('ad_employer', 'Positions', 'categories','Employer', 'jobs'));
191 185 }
192 186  
193 187 // Сохранение-редактирование записи
194 188 public function vacancy_save_me(VacancyRequestEdit $request, Ad_employer $ad_employer) {
195   - $all = $request->all();
  189 + $params = $request->all();
196 190  
197   - $ad_employer->update($all);
  191 + //$jobs['flot'] = $params['flot'];
  192 + //$jobs['job_title_id'] = $params['job_title_id'];
  193 + //$titles['position_id'] = $params['position_id'];
  194 + //unset($params['job_title_id']);
  195 +
  196 + $ad_employer->update($params);
  197 +
  198 + //$job_ = Ad_jobs::query()->where('job_title_id', $jobs['job_title_id'])->
  199 + // where('ad_employer_id', $ad_employer->id)->first();
  200 + //$data = Ad_jobs::find($job_->id);
  201 + //$ad_jobs = $data->update($jobs);
198 202  
199 203 return redirect()->route('employer.vacancy_list');
200 204 }
... ... @@ -680,7 +684,13 @@ class EmployerController extends Controller
680 684 // Восстановление пароля
681 685 public function repair_password(Request $request) {
682 686 $params = $request->get('email');
  687 + }
683 688  
  689 + // Избранные люди на корабль
  690 + public function selected_people(Request $request) {
  691 + $id = $request->get('id');
  692 + $favorite_people = Job_title::query()->where('position_id', $id)->get();
684 693  
  694 + return view('favorite_people', compact('favorite_people'));
685 695 }
686 696 }
app/Http/Controllers/MainController.php
... ... @@ -41,7 +41,7 @@ class MainController extends Controller
41 41  
42 42 $Position = Positions::query()->get();
43 43  
44   - $BigFlot = Array();
  44 + /*$BigFlot = Array();
45 45 foreach ($Position as $position) {
46 46 $BigFlot[] = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')->
47 47 orderBy('job_titles.sort')->
... ... @@ -51,6 +51,30 @@ class MainController extends Controller
51 51 get();
52 52 }
53 53  
  54 + $BigFlot = Array();
  55 +
  56 + foreach ($Position as $position) {
  57 +
  58 + $BigFlot[] = Ad_jobs::query()->with(['job_title' => function($query) {
  59 + $query->OrderBy('sort');
  60 + }])->whereHas('job_title', function ($query) use ($position) {
  61 + $query->where('position_id', $position->id);
  62 + })->
  63 + distinct('job_title_id')->
  64 + get();
  65 + }*/
  66 +
  67 + $BigFlot = Array();
  68 + foreach ($Position as $position) {
  69 + $BigFlot[] = DB::table('ad_jobs')->
  70 + selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')->
  71 + orderByDesc('job_titles.sort')->
  72 + join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
  73 + where('job_titles.position_id', $position->id)->
  74 + groupby('job_title_id')->
  75 + get();
  76 + }
  77 +
54 78 $employers = employers_main::query()->with('employer')->orderBy('id')->limit(8)->get();
55 79 $vacancy = Ad_jobs::query()->with('job_title')->orderBy('position_ship')->get();
56 80 return view('index', compact('news', 'categories', 'employers', 'vacancy', 'BigFlot', 'Position'));
... ... @@ -127,7 +151,7 @@ class MainController extends Controller
127 151  
128 152 $Position = Positions::query()->get();
129 153  
130   - $BigFlot = Array();
  154 + /*$BigFlot = Array();
131 155 foreach ($Position as $position) {
132 156 $War_flot = DB::table('ad_jobs')->selectRaw('name, job_titles.id as id_title, count(`ad_jobs`.`id`) as cnt, ad_jobs.position_ship')->
133 157 orderBy('job_titles.sort')->
... ... @@ -138,6 +162,20 @@ class MainController extends Controller
138 162 }
139 163 $War_flot = $War_flot->groupby('job_title_id','position_ship')->get();
140 164 $BigFlot[] = $War_flot;
  165 + }*/
  166 +
  167 + $BigFlot = Array();
  168 + foreach ($Position as $position) {
  169 + $WarFlot = DB::table('ad_jobs')->
  170 + selectRaw('name, count(`ad_jobs`.`id`) as cnt, job_title_id, job_titles.name')->
  171 + orderByDesc('job_titles.sort')->
  172 + join('job_titles', 'job_titles.id', '=', 'ad_jobs.job_title_id')->
  173 + where('job_titles.position_id', $position->id);
  174 + if (($request->has('job')) && ($request->get('job') > 0)) {
  175 + $WarFlot = $WarFlot->where('job_title_id', $request->get('job'));
  176 + }
  177 + $WarFlot = $WarFlot->groupby('job_title_id')->get();
  178 + $BigFlot[] = $WarFlot;
141 179 }
142 180  
143 181 if ($request->ajax()) {
app/Http/Controllers/WorkerController.php
... ... @@ -103,7 +103,7 @@ class WorkerController extends Controller
103 103 }
104 104  
105 105 $res_count = $resumes->count();
106   - $resumes = $resumes->paginate(6);
  106 + $resumes = $resumes->paginate(4);
107 107 if ($request->ajax()) {
108 108 // Условия обставлены
109 109 if ($request->has('block') && ($request->get('block') == 1)) {
... ... @@ -412,9 +412,7 @@ class WorkerController extends Controller
412 412 public function register_worker(Request $request)
413 413 {
414 414 $params = $request->all();
415   -
416   -
417   - dd($params);
  415 + $params['is_worker'] = 1;
418 416  
419 417 $rules = [
420 418 'surname' => ['required', 'string', 'max:255'],
... ... @@ -441,6 +439,30 @@ class WorkerController extends Controller
441 439 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
442 440 }
443 441  
  442 + $haystack = $request->get('password');
  443 +
  444 + $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?');
  445 + $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z',
  446 + 'X', 'C', 'V', 'B', 'N', 'M');
  447 + $spec_bool = false;
  448 + $alpha_bool = false;
  449 +
  450 + foreach ($specsumbol as $it) {
  451 + if (strpos($haystack, $it) !== false) {
  452 + $spec_bool = true;
  453 + }
  454 + }
  455 +
  456 + foreach ($alpha as $it) {
  457 + if (strpos($haystack, $it) !== false) {
  458 + $alpha_bool = true;
  459 + }
  460 + }
  461 +
  462 + if ((!$spec_bool) || (!$alpha_bool)) {
  463 + return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?"));
  464 + }
  465 +
444 466 if (($request->has('politik')) && ($request->get('politik') == 1)) {
445 467 $validator = Validator::make($request->all(), $rules, $messages);
446 468  
... ... @@ -449,10 +471,8 @@ class WorkerController extends Controller
449 471 } else {
450 472 $user = $this->create($params);
451 473 event(new Registered($user));
452   -
453 474 Auth::guard()->login($user);
454 475 }
455   -
456 476 if ($user) {
457 477 return json_encode(Array("REDIRECT" => redirect()->route('worker.cabinet')->getTargetUrl()));;
458 478 } else {
... ... @@ -462,11 +482,8 @@ class WorkerController extends Controller
462 482 } else {
463 483 return json_encode(Array("ERROR" => "Error3: Вы не согласились с политикой конфидициальности!"));
464 484 }
465   -
466   -
467 485 }
468 486  
469   -
470 487 // Звездная оценка и ответ
471 488 public function stars_answer(Request $request) {
472 489 $params = $request->all();
... ... @@ -604,6 +621,7 @@ class WorkerController extends Controller
604 621 public function up(Worker $worker) {
605 622 $worker->updated_at = Carbon::now();
606 623 $worker->save();
  624 + // 0
607 625 return redirect()->route('worker.cabinet')->with('success', 'Ваша анкета была поднята выше остальных');
608 626 }
609 627  
app/Models/Ad_jobs.php
... ... @@ -2,6 +2,7 @@
2 2  
3 3 namespace App\Models;
4 4  
  5 +use Filament\Tables\Actions\Position;
5 6 use Illuminate\Database\Eloquent\Factories\HasFactory;
6 7 use Illuminate\Database\Eloquent\Model;
7 8  
... ... @@ -27,4 +28,8 @@ class Ad_jobs extends Model
27 28 public function job_title() {
28 29 return $this->belongsTo(Job_title::class, 'job_title_id');
29 30 }
  31 +
  32 + public function positions() {
  33 + return $this->belongsToMany(Positions::class, 'job_titles');
  34 + }
30 35 }
app/Models/Job_title.php
... ... @@ -13,7 +13,8 @@ class Job_title extends Model
13 13 'name',
14 14 'is_remove',
15 15 'parent_id',
16   - 'sort'
  16 + 'sort',
  17 + 'position_id'
17 18 ];
18 19 /*
19 20 * Связь модели Вакансии (Ad_employer) с моделью Должности (Job_title)
database/migrations/2023_09_08_084707_alter_job_titles3_table.php
... ... @@ -15,6 +15,7 @@ return new class extends Migration
15 15 {
16 16 Schema::table('job_titles', function (Blueprint $table) {
17 17 $table->integer('sort')->default(100);
  18 + $table->integer('position_id')->nullable(false);
18 19 });
19 20 }
20 21  
... ... @@ -27,6 +28,7 @@ return new class extends Migration
27 28 {
28 29 Schema::table('job_titles', function (Blueprint $table) {
29 30 $table->dropColumn('sort');
  31 + $table->dropColumn('position_id');
30 32 });
31 33 }
32 34 };
public/js/script-vc.js
... ... @@ -0,0 +1,164 @@
  1 +let scripts = function () {
  2 +
  3 + $('.js-toggle').on('click', function () {
  4 + $(this).toggleClass('active');
  5 + });
  6 + $('.js-parent-toggle').on('click', function () {
  7 + $(this).parent().toggleClass('active');
  8 + });
  9 + $('.js-parent-remove').on('click', function () {
  10 + $(this).parent().remove();
  11 + });
  12 + $('.js-menu-toggle').on('click', function () {
  13 + window.scrollTo(0, 0);
  14 + $('#body').toggleClass('menu-is-actived');
  15 + });
  16 + $('.js-cookies-close').on('click', function () {
  17 + $('#body').removeClass('cookies-is-actived');
  18 + });
  19 + $('.js-works-edit').on('click', function () {
  20 + $(this).parent().parent().parent().addClass('active');
  21 + });
  22 + $('.js-works-remove').on('click', function () {
  23 + $(this).parent().parent().parent().parent().remove();
  24 + });
  25 +
  26 + $('[data-tab]').on('click', function () {
  27 + $('[data-tab]').removeClass('active');
  28 + $('[data-body]').removeClass('showed');
  29 + $(this).addClass('active');
  30 + var id = $(this).data('tab');
  31 + $('[data-body=' + id + ']').addClass('showed');
  32 + });
  33 +
  34 + $('.js-password-show').on('click', function () {
  35 + $(this).parent().addClass('active');
  36 + $(this).parent().parent().find('input').attr('type', 'text');
  37 + });
  38 +
  39 + $('.js-password-hide').on('click', function () {
  40 + $(this).parent().removeClass('active');
  41 + $(this).parent().parent().find('input').attr('type', 'password');
  42 + });
  43 +
  44 + let checkScrollTop = function () {
  45 + if ($(document).scrollTop() == 0) {
  46 + $('#body').removeClass('begin');
  47 + } else {
  48 + $('#body').addClass('begin');
  49 + }
  50 + }
  51 + checkScrollTop();
  52 + $(document).on('scroll', function () {
  53 + checkScrollTop();
  54 + });
  55 +
  56 + let closeAll = function () {
  57 + $('.js-toggle').removeClass('active');
  58 + $('.js-parent-toggle').parent().removeClass('active');
  59 + $('#body').removeClass('menu-is-actived');
  60 + $('#body').removeClass('cookies-is-actived');
  61 + }
  62 +
  63 + $(document).keyup(function (e) {
  64 + if (e.key === "Escape") {
  65 + closeAll();
  66 + }
  67 + });
  68 +
  69 + $('.js-scroll-to').bind('click', function (e) {
  70 + let anchor = $(this);
  71 + $('html,body').stop().animate({
  72 + scrollTop: $(anchor.attr('href')).offset().top
  73 + }, 300);
  74 + e.preventDefault();
  75 + });
  76 +
  77 + if ($('[type=tel]').is('[type=tel]')) {
  78 + $('[type=tel]').mask('+7 (999) 999-99-99');
  79 + }
  80 +
  81 + if ($('.js-select2').is('.js-select2')) {
  82 + $('.js-select2').select2();
  83 + }
  84 +
  85 + const starRating = document.querySelectorAll(".js-stars");
  86 + if (starRating.length) {
  87 + starRating.forEach(item => {
  88 + new StarRating(item);
  89 + });
  90 + }
  91 +
  92 + const checkboxes = document.querySelectorAll(".checkbox");
  93 + if (checkboxes.length) {
  94 + checkboxes.forEach(checkbox => {
  95 + const input = checkbox.querySelector("input");
  96 + checkbox.addEventListener("input", () => {
  97 + if (input.checked) {
  98 + input.setAttribute("checked", "");
  99 + } else {
  100 + input.removeAttribute("checked");
  101 + }
  102 + });
  103 + });
  104 + }
  105 +
  106 +};
  107 +
  108 +let swipers = function () {
  109 +
  110 + if ($('.js-employer-swiper').is('.js-employer-swiper')) {
  111 + let slider = new Swiper('.js-employer-swiper', {
  112 + autoplay: {
  113 + delay: 5000,
  114 + },
  115 + pagination: {
  116 + el: '.swiper-pagination',
  117 + clickable: true
  118 + },
  119 + breakpoints: {
  120 + 768: {
  121 + slidesPerView: 2,
  122 + },
  123 + 992: {
  124 + slidesPerView: 3,
  125 + },
  126 + 1280: {
  127 + slidesPerView: 4,
  128 + },
  129 + }
  130 + });
  131 + }
  132 +
  133 + if ($('.js-news-swiper').is('.js-news-swiper')) {
  134 + let slider = new Swiper('.js-news-swiper', {
  135 + spaceBetween: 20,
  136 + pagination: {
  137 + el: '.swiper-pagination',
  138 + clickable: true
  139 + },
  140 + navigation: {
  141 + prevEl: '.js-news-swiper-button-prev',
  142 + nextEl: '.js-news-swiper-button-next',
  143 + },
  144 + breakpoints: {
  145 + 768: {
  146 + slidesPerView: 2,
  147 + },
  148 + 992: {
  149 + slidesPerView: 3,
  150 + },
  151 + }
  152 + });
  153 + }
  154 +
  155 +};
  156 +
  157 +document.addEventListener("DOMContentLoaded", () => {
  158 + scripts();
  159 + swipers();
  160 +});
  161 +
  162 +$(window).resize(function () {
  163 + swipers();
  164 +});
public/js/script0.js
... ... @@ -0,0 +1,173 @@
  1 +let scripts = function () {
  2 +
  3 + $('.js-toggle').on('click', function () {
  4 + $(this).toggleClass('active');
  5 + });
  6 + $('.js-parent-toggle').on('click', function () {
  7 + $(this).parent().toggleClass('active');
  8 + });
  9 + $('.js-parent-remove').on('click', function () {
  10 + $(this).parent().remove();
  11 + });
  12 + $('.js-menu-toggle').on('click', function () {
  13 + window.scrollTo(0, 0);
  14 + $('#body').toggleClass('menu-is-actived');
  15 + });
  16 + $('.js-cookies-close').on('click', function () {
  17 + $('#body').removeClass('cookies-is-actived');
  18 + });
  19 + $('.js-works-edit').on('click', function () {
  20 + $(this).parent().parent().parent().addClass('active');
  21 + });
  22 + $('.js-works-remove').on('click', function () {
  23 + $(this).parent().parent().parent().parent().remove();
  24 + });
  25 +
  26 + $('[data-tab]').on('click', function () {
  27 + $('[data-tab]').removeClass('active');
  28 + $('[data-body]').removeClass('showed');
  29 + $(this).addClass('active');
  30 + var id = $(this).data('tab');
  31 + $('[data-body=' + id + ']').addClass('showed');
  32 + });
  33 +
  34 + $('.js-password-show').on('click', function () {
  35 + $(this).parent().addClass('active');
  36 + $(this).parent().parent().find('input').attr('type', 'text');
  37 + });
  38 +
  39 + $('.js-password-hide').on('click', function () {
  40 + $(this).parent().removeClass('active');
  41 + $(this).parent().parent().find('input').attr('type', 'password');
  42 + });
  43 +
  44 + let checkScrollTop = function () {
  45 + if ($(document).scrollTop() == 0) {
  46 + $('#body').removeClass('begin');
  47 + } else {
  48 + $('#body').addClass('begin');
  49 + }
  50 + }
  51 + checkScrollTop();
  52 + $(document).on('scroll', function () {
  53 + checkScrollTop();
  54 + });
  55 +
  56 + let closeAll = function () {
  57 + $('.js-toggle').removeClass('active');
  58 + $('.js-parent-toggle').parent().removeClass('active');
  59 + $('#body').removeClass('menu-is-actived');
  60 + $('#body').removeClass('cookies-is-actived');
  61 + }
  62 +
  63 + $(document).keyup(function (e) {
  64 + if (e.key === "Escape") {
  65 + closeAll();
  66 + }
  67 + });
  68 +
  69 + $('.js-scroll-to').bind('click', function (e) {
  70 + let anchor = $(this);
  71 + $('html,body').stop().animate({
  72 + scrollTop: $(anchor.attr('href')).offset().top
  73 + }, 300);
  74 + e.preventDefault();
  75 + });
  76 +
  77 + if ($('[type=tel]').is('[type=tel]')) {
  78 + $('[type=tel]').mask('+7 (999) 999-99-99');
  79 + }
  80 +
  81 + if ($('.js-select2').is('.js-select2')) {
  82 + $('.js-select2').select2();
  83 + }
  84 +
  85 + const starRating = document.querySelectorAll(".js-stars");
  86 + if (starRating.length) {
  87 + starRating.forEach(item => {
  88 + new StarRating(item);
  89 + });
  90 + }
  91 +
  92 + // cookies
  93 + const cookieItems = document.querySelectorAll(".js-ck");
  94 + if (cookieItems.length) {
  95 + cookieItems.forEach(item => {
  96 + const id = item.dataset.id;
  97 + const like = item.querySelector(".like");
  98 + const checkLike = function () {
  99 + if (like.classList.contains("active")) {
  100 + Cookies.set('favor_vacan-'+id, id);
  101 + } else {
  102 + Cookies.remove(id);
  103 + }
  104 + }
  105 + like.addEventListener("click", () => {
  106 + checkLike();
  107 + });
  108 + if (Cookies.get('favor_vacan-'+id) == id) {
  109 + like.classList.add("active");
  110 + }
  111 + });
  112 + }
  113 + console.log(Cookies.get());
  114 +
  115 +};
  116 +
  117 +let swipers = function () {
  118 +
  119 + if ($('.js-employer-swiper').is('.js-employer-swiper')) {
  120 + let slider = new Swiper('.js-employer-swiper', {
  121 + autoplay: {
  122 + delay: 5000,
  123 + },
  124 + pagination: {
  125 + el: '.swiper-pagination',
  126 + clickable: true
  127 + },
  128 + breakpoints: {
  129 + 768: {
  130 + slidesPerView: 2,
  131 + },
  132 + 992: {
  133 + slidesPerView: 3,
  134 + },
  135 + 1280: {
  136 + slidesPerView: 4,
  137 + },
  138 + }
  139 + });
  140 + }
  141 +
  142 + if ($('.js-news-swiper').is('.js-news-swiper')) {
  143 + let slider = new Swiper('.js-news-swiper', {
  144 + spaceBetween: 20,
  145 + pagination: {
  146 + el: '.swiper-pagination',
  147 + clickable: true
  148 + },
  149 + navigation: {
  150 + prevEl: '.js-news-swiper-button-prev',
  151 + nextEl: '.js-news-swiper-button-next',
  152 + },
  153 + breakpoints: {
  154 + 768: {
  155 + slidesPerView: 2,
  156 + },
  157 + 992: {
  158 + slidesPerView: 3,
  159 + },
  160 + }
  161 + });
  162 + }
  163 +
  164 +};
  165 +
  166 +document.addEventListener("DOMContentLoaded", () => {
  167 + scripts();
  168 + swipers();
  169 +});
  170 +
  171 +$(window).resize(function () {
  172 + swipers();
  173 +});
resources/views/admin/job_titles/form.blade.php
... ... @@ -26,6 +26,21 @@
26 26 </label><br>
27 27  
28 28 <label class="block text-sm">
  29 + <span class="text-gray-700 dark:text-gray-400">Папка</span>
  30 +
  31 + @php
  32 + $position_id = old('position_id') ?? $job_title->position_id ?? 0;
  33 + @endphp
  34 + <select name="position_id" class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-select focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
  35 + title="Родитель">
  36 + <option value="">Без родителя</option>
  37 + @foreach ($position as $it)
  38 + <option value="{{ $it->id }}" @if ($it->id == $position_id) selected @endif>{{ $it->name }}</option>
  39 + @endforeach
  40 + </select>
  41 + </label><br>
  42 +
  43 + <label class="block text-sm">
29 44 <span class="text-gray-700 dark:text-gray-400">Сортировка</span>
30 45 @php
31 46 $sort_num = 100;
resources/views/admin/positions/position.blade.php
1   -@extends('layout.admin', ['title' => 'Админка - Работники'])
  1 +@extends('layout.admin', ['title' => 'Админка - Позиции'])
2 2 @section('script')
3 3 <script>
4 4 $(document).ready(function() {
resources/views/block_real.blade.php
... ... @@ -5,14 +5,15 @@
5 5 @if ($flot->count())
6 6 @foreach ($flot as $key => $cat)
7 7 @if ($k == 0)
8   - <div class="vacancies__list-label">{{ $cat->position_ship }}</div>
  8 + <div class="vacancies__list-label">{{ $position->name }}</div>
9 9 @endif
10   - <a href="{{ route('list-vacancies', ['job' => $cat->id_title]) }}" class="vacancies__item">
11   - <span style="border-color:{{$colors[$i]}}">
12   - <b>{{ $cat->name }}</b>
13   - <i>Вакансий: <span>{{ $cat->cnt }}</span></i>
14   - </span>
15   - </a>
  10 +
  11 + <a href="{{ route('list-vacancies', ['job' => $cat->job_title_id]) }}" class="vacancies__item">
  12 + <span style="border-color:{{$colors[$i]}}">
  13 + <b>{{ $cat->name }}</b>
  14 + <i>Вакансий: <span>{{ $cat->cnt }}</span></i>
  15 + </span>
  16 + </a>
16 17  
17 18 @php
18 19 $i++;
resources/views/companies.blade.php
... ... @@ -93,7 +93,7 @@
93 93 <div class="container">
94 94 <div class="main__employers">
95 95 <div class="filters">
96   - <div class="filters__label">Показано @if ($count_emps < 4) 1 - {{ $count_emps }} @else 1 – 4 @endif из {{ $count_emps }} результатов поиска</div>
  96 + <div class="filters__label">Показано {{ $emps->firstItem() }} – {{ $emps->lastItem() }} из {{ $count_emps }} результатов поиска</div>
97 97 <div class="filters__body">
98 98 <div class="select filters__select">
99 99 <select class="js-select2" id="sort_ajax" name="sort_ajax">
... ... @@ -151,9 +151,11 @@
151 151 </div>
152 152  
153 153 {{ $emps->appends($_GET)->links('paginate') }}
  154 +
154 155 @else
155 156 <H2>Нет данных</H2>
156 157 @endif
  158 +
157 159 </div>
158 160 <div class="main__employers-body" data-body="2" id="block_2" name="block_2">
159 161 @if ($emps->count())
resources/views/education.blade.php
... ... @@ -74,7 +74,7 @@
74 74 <main class="main">
75 75 <div class="container">
76 76 <div class="filters">
77   - <div class="filters__label">Показано 1 – @if($count_edu < 6) {{ $count_edu }}@else 6 @endif из {{ $count_edu }} результатов поиска</div>
  77 + <div class="filters__label">Показано {{ $educations->firstItem() }} – {{ $educations->lastItem() }} из {{ $count_edu }} результатов поиска</div>
78 78 <div class="filters__body">
79 79 <div class="select filters__select">
80 80 <select class="js-select2" id="sort_ajax" name="sort_ajax">
... ... @@ -88,7 +88,6 @@
88 88 </div>
89 89 </div>
90 90  
91   -
92 91 <div class="main__ads" id="block" name="block">
93 92 @if ($educations->count())
94 93 @foreach($educations as $edu)
resources/views/employers/add_ad_jobs.blade.php
... ... @@ -0,0 +1,241 @@
  1 +@extends('layout.frontend', ['title' => 'Добавление вакансии РекаМоре'])
  2 +
  3 +@section('scripts')
  4 + <script>
  5 + console.log('Приближаемся к системе, нас рой тут...');
  6 + $(document).on('change', '#position_id', function() {
  7 + var this_ = $(this);
  8 + var val_ = this_.val();
  9 + var ajax_ = $('#job_title_id');
  10 +
  11 + console.log('Создания списка людей, которые поднимутся на корабль...');
  12 +
  13 + $.ajax({
  14 + type: "GET",
  15 + url: "{{ route('employer.selected_people') }}",
  16 + data: "id="+val_,
  17 + success: function (data) {
  18 + console.log('Ответка пришла');
  19 + console.log('Список избранных людей создан');
  20 + ajax_.html(data);
  21 + },
  22 + headers: {
  23 + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  24 + },
  25 + error: function (data) {
  26 + console.log('Обрыв связи');
  27 + console.log('Error: ' + data);
  28 + }
  29 + });
  30 + });
  31 + </script>
  32 +@endsection
  33 +@section('content')
  34 + <section class="cabinet">
  35 + <div class="container">
  36 + <ul class="breadcrumbs cabinet__breadcrumbs">
  37 + <li><a href="{{ route('index') }}">Главная</a></li>
  38 + <li><b>Личный кабинет</b></li>
  39 + </ul>
  40 + <div class="cabinet__wrapper">
  41 + <div class="cabinet__side">
  42 + <div class="cabinet__side-toper">
  43 +
  44 + @include('employers.emblema')
  45 +
  46 + </div>
  47 +
  48 + @include('employers.menu', ['item' => 2])
  49 +
  50 + </div>
  51 +
  52 + <form class="cabinet__body" action="{{ route('employer.add_job_in_vac_save') }}" method="POST">
  53 + @csrf
  54 + <input type="hidden" name="ad_employer_id" value="{{ $ad_employer->id }}"/>
  55 + <div class="cabinet__body-item">
  56 + <div class="cabinet__descr">
  57 + <h2 class="title cabinet__title">Разместить должность в вакансии</h2>
  58 + <p class="cabinet__text"><b>Вакансия {{ $ad_employer->name }}</b></p>
  59 + </div>
  60 + </div>
  61 +
  62 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  63 + <label class="form-group__label">Позиция на корабле</label>
  64 + <div class="form-group__item">
  65 + <div class="select">
  66 + <select class="js-select2" name="position_id" id="position_id">
  67 + @foreach ($Positions as $it)
  68 + <option value="{{ $it->id }}">{{ $it->name }}</option>
  69 + @endforeach
  70 + </select>
  71 + @error('postion_id')
  72 + <span class="text-xs text-red-600 dark:text-red-400">
  73 + {{ $message }}
  74 + </span>
  75 + @enderror
  76 + </div>
  77 + </div>
  78 + </div>
  79 +
  80 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  81 + <label class="form-group__label">Должность соискателя</label>
  82 + <div class="form-group__item">
  83 + <div class="select">
  84 + <select class="js-select2" name="job_title_id" id="job_title_id">
  85 + @php $i = 1 @endphp
  86 + @if ($jobs->count())
  87 + @foreach($jobs as $j)
  88 + @if ($i == 1) <option selected> Выберите должность из списка</option>
  89 + @else
  90 + <option value="{{ $j->id }}">{{ $j->name }}</option>
  91 + @endif
  92 + @php $i++ @endphp
  93 + @endforeach
  94 + @endif
  95 + </select>
  96 + @error('job_title_id')
  97 + <span class="text-xs text-red-600 dark:text-red-400">
  98 + {{ $message }}
  99 + </span>
  100 + @enderror
  101 + </div>
  102 + </div>
  103 + </div>
  104 +
  105 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  106 + <label class="form-group__label">Категория (локация)</label>
  107 + <div class="form-group__item">
  108 + <div class="select">
  109 + <select class="js-select2" name="category_id" id="category_id">
  110 + @php $i = 1 @endphp
  111 + @if ($categories->count())
  112 + @foreach($categories as $j)
  113 + @if ($i == 1) <option selected> Выберите категорию из списка</option>
  114 + @else
  115 + <option value="{{ $j->id }}">{{ $j->name }}</option>
  116 + @endif
  117 + @php $i++ @endphp
  118 + @endforeach
  119 + @endif
  120 + </select>
  121 + @error('category_id')
  122 + <span class="text-xs text-red-600 dark:text-red-400">
  123 + {{ $message }}
  124 + </span>
  125 + @enderror
  126 + </div>
  127 + </div>
  128 + </div>
  129 +
  130 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  131 + <label class="form-group__label">Минимальная зарплата</label>
  132 + <div class="form-group__item">
  133 + <input type="text" class="input" name="min_salary" id="min_salary" value="{{ old('min_salary') ?? '' }}" placeholder="Минимальная зарплата">
  134 + @error('min_salary')
  135 + <span class="text-xs text-red-600">
  136 + {{ $message }}
  137 + </span>
  138 + @enderror
  139 + </div>
  140 + </div>
  141 +
  142 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  143 + <label class="form-group__label">Максимальная зарплата</label>
  144 + <div class="form-group__item">
  145 + <input type="text" class="input" name="max_salary" id="max_salary" value="{{ old('max_salary') ?? '' }}" placeholder="Максимальная зарплата">
  146 + @error('salary')
  147 + <span class="text-xs text-red-600 dark:text-red-400">
  148 + {{ $message }}
  149 + </span>
  150 + @enderror
  151 + </div>
  152 + </div>
  153 +
  154 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  155 + <label class="form-group__label">Регион отплытия</label>
  156 + <div class="form-group__item">
  157 + <input type="text" class="input" name="region" id="region" value="{{ old('region') ?? $Employer->city ?? '' }}" placeholder="Севастополь">
  158 + @error('region')
  159 + <span class="text-xs text-red-600">
  160 + {{ $message }}
  161 + </span>
  162 + @enderror
  163 + </div>
  164 + </div>
  165 +
  166 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  167 + <label class="form-group__label">Мощность</label>
  168 + <div class="form-group__item">
  169 + <input type="text" class="input" name="power" id="power" value="{{ old('power') ?? '' }}" placeholder="POWER-45">
  170 + @error('power')
  171 + <span class="text-xs text-red-600">
  172 + {{ $message }}
  173 + </span>
  174 + @enderror
  175 + </div>
  176 + </div>
  177 +
  178 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  179 + <label class="form-group__label">Суточные выплаты</label>
  180 + <div class="form-group__item">
  181 + <input type="text" class="input" name="sytki" id="sytki" value="{{ old('sytki') ?? '' }}" placeholder="2000">
  182 + @error('power')
  183 + <span class="text-xs text-red-600">
  184 + {{ $message }}
  185 + </span>
  186 + @enderror
  187 + </div>
  188 + </div>
  189 +
  190 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  191 + <label class="form-group__label">Начало отплытия</label>
  192 + <div class="form-group__item">
  193 + <input type="text" class="input" name="start" id="start" value="{{ old('start') ?? '' }}" placeholder="20 сентября 2024">
  194 + @error('power')
  195 + <span class="text-xs text-red-600">
  196 + {{ $message }}
  197 + </span>
  198 + @enderror
  199 + </div>
  200 + </div>
  201 +
  202 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  203 + <label class="form-group__label">Корабль для посадки</label>
  204 + <div class="form-group__item">
  205 + <div class="select">
  206 + <select class="js-select2" name="flot" id="flot">
  207 + <option value="" selected> Не указан корабль</option>
  208 + @if ($Employer->flots->count())
  209 + @foreach($Employer->flots as $j)
  210 + <option value="{{ $j->name }}">{{ $j->name }} ({{ $j->id }})</option>
  211 + @endforeach
  212 + @endif
  213 + </select>
  214 + @error('flot')
  215 + <span class="text-xs text-red-600">
  216 + {{ $message }}
  217 + </span>
  218 + @enderror
  219 + </div>
  220 + </div>
  221 + </div>
  222 +
  223 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  224 + <label class="form-group__label">Дополнительная информация</label>
  225 + <div class="form-group__item">
  226 + <textarea class="textarea" name="description" id="description">{{ old('description') ?? '' }}</textarea>
  227 + @error('description')
  228 + <span class="text-xs text-red-600">
  229 + {{ $message }}
  230 + </span>
  231 + @enderror
  232 + </div>
  233 + </div>
  234 +
  235 + <button type="submit" class="button cabinet__submit">Опубликовать</button>
  236 + </form>
  237 + </div>
  238 + </div>
  239 + </section>
  240 + </div>
  241 +@endsection
resources/views/employers/add_vacancy.blade.php
1 1 @extends('layout.frontend', ['title' => 'Добавление вакансии РекаМоре'])
2 2  
3 3 @section('scripts')
  4 + <script>
  5 + console.log('Приближаемся к системе, нас рой тут...');
  6 + $(document).on('change', '#position_id', function() {
  7 + var this_ = $(this);
  8 + var val_ = this_.val();
  9 + var ajax_ = $('#job_title_id');
  10 +
  11 + console.log('Создания списка людей, которые поднимутся на корабль...');
  12 +
  13 + $.ajax({
  14 + type: "GET",
  15 + url: "{{ route('employer.selected_people') }}",
  16 + data: "id="+val_,
  17 + success: function (data) {
  18 + console.log('Ответка пришла');
  19 + console.log('Список избранных людей создан');
  20 + ajax_.html(data);
  21 + },
  22 + headers: {
  23 + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  24 + },
  25 + error: function (data) {
  26 + console.log('Обрыв связи');
  27 + console.log('Error: ' + data);
  28 + }
  29 + });
  30 + });
  31 + </script>
4 32 @endsection
5 33 @section('content')
6 34 <section class="cabinet">
... ... @@ -31,7 +59,9 @@
31 59 <p class="cabinet__text">Все поля обязательны для заполнения *</p>
32 60 </div>
33 61 </div>
  62 +
34 63 <div class="cabinet__body-item">
  64 + <h4>Поля для вакансии</h4>
35 65 <div class="cabinet__inputs">
36 66 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
37 67 <label class="form-group__label">Название вакансии</label>
... ... @@ -44,73 +74,6 @@
44 74 @enderror
45 75 </div>
46 76 </div>
47   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
48   - <label class="form-group__label">Должность соискателя</label>
49   - <div class="form-group__item">
50   - <div class="select">
51   - <select class="js-select2" name="job_title_id" id="job_title_id">
52   - @php $i = 1 @endphp
53   - @if ($jobs->count())
54   - @foreach($jobs as $j)
55   - @if ($i == 1) <option selected> Выберите должность из списка</option>
56   - @else
57   - <option value="{{ $j->id }}">{{ $j->name }}</option>
58   - @endif
59   - @php $i++ @endphp
60   - @endforeach
61   - @endif
62   - </select>
63   - @error('job_title_id')
64   - <span class="text-xs text-red-600 dark:text-red-400">
65   - {{ $message }}
66   - </span>
67   - @enderror
68   - </div>
69   - </div>
70   - </div>
71   -
72   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
73   - <label class="form-group__label">Категория (локация)</label>
74   - <div class="form-group__item">
75   - <div class="select">
76   - <select class="js-select2" name="category_id" id="category_id">
77   - @php $i = 1 @endphp
78   - @if ($categories->count())
79   - @foreach($categories as $j)
80   - @if ($i == 1) <option selected> Выберите категорию из списка</option>
81   - @else
82   - <option value="{{ $j->id }}">{{ $j->name }}</option>
83   - @endif
84   - @php $i++ @endphp
85   - @endforeach
86   - @endif
87   - </select>
88   - @error('category_id')
89   - <span class="text-xs text-red-600 dark:text-red-400">
90   - {{ $message }}
91   - </span>
92   - @enderror
93   - </div>
94   - </div>
95   - </div>
96   -
97   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
98   - <label class="form-group__label">Позиция на корабле</label>
99   - <div class="form-group__item">
100   - <div class="select">
101   - <select class="js-select2" name="position_ship" id="position_ship">
102   - @foreach ($Positions as $it)
103   - <option value="{{ $it->name }}">{{ $it->name }}</option>
104   - @endforeach
105   - </select>
106   - @error('postion_ship')
107   - <span class="text-xs text-red-600 dark:text-red-400">
108   - {{ $message }}
109   - </span>
110   - @enderror
111   - </div>
112   - </div>
113   - </div>
114 77  
115 78 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
116 79 <label class="form-group__label">Телефон</label>
... ... @@ -137,7 +100,7 @@
137 100 </div>
138 101  
139 102 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
140   - <label class="form-group__label">Зарплата среднестатистическая</label>
  103 + <label class="form-group__label">Зарплата среднестатистическая для вакансии</label>
141 104 <div class="form-group__item">
142 105 <input type="text" class="input" name="salary" id="salary" value="{{ old('salary') ?? '' }}" placeholder="Среднестатистическая зарплата">
143 106 @error('salary')
... ... @@ -149,31 +112,7 @@
149 112 </div>
150 113  
151 114 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
152   - <label class="form-group__label">Минимальная зарплата</label>
153   - <div class="form-group__item">
154   - <input type="text" class="input" name="min_salary" id="min_salary" value="{{ old('min_salary') ?? '' }}" placeholder="Минимальная зарплата">
155   - @error('min_salary')
156   - <span class="text-xs text-red-600">
157   - {{ $message }}
158   - </span>
159   - @enderror
160   - </div>
161   - </div>
162   -
163   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
164   - <label class="form-group__label">Максимальная зарплата</label>
165   - <div class="form-group__item">
166   - <input type="text" class="input" name="max_salary" id="max_salary" value="{{ old('max_salary') ?? '' }}" placeholder="Максимальная зарплата">
167   - @error('salary')
168   - <span class="text-xs text-red-600 dark:text-red-400">
169   - {{ $message }}
170   - </span>
171   - @enderror
172   - </div>
173   - </div>
174   -
175   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
176   - <label class="form-group__label">Город-регион</label>
  115 + <label class="form-group__label">Город посадки</label>
177 116 <div class="form-group__item">
178 117 <input type="text" class="input" name="city" id="city" value="{{ old('city') ?? $Employer[0]->city ?? '' }}" placeholder="Севастополь">
179 118 @error('city')
... ... @@ -185,55 +124,23 @@
185 124 </div>
186 125  
187 126 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
188   - <label class="form-group__label">Мощность</label>
189   - <div class="form-group__item">
190   - <input type="text" class="input" name="power" id="power" value="{{ old('power') ?? '' }}" placeholder="POWER-45">
191   - @error('power')
192   - <span class="text-xs text-red-600">
193   - {{ $message }}
194   - </span>
195   - @enderror
196   - </div>
197   - </div>
198   -
199   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
200   - <label class="form-group__label">Суточные выплаты</label>
201   - <div class="form-group__item">
202   - <input type="text" class="input" name="sytki" id="sytki" value="{{ old('sytki') ?? '' }}" placeholder="2000">
203   - @error('power')
204   - <span class="text-xs text-red-600">
205   - {{ $message }}
206   - </span>
207   - @enderror
208   - </div>
209   - </div>
210   -
211   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
212   - <label class="form-group__label">Начало отплытия</label>
213   - <div class="form-group__item">
214   - <input type="text" class="input" name="start" id="start" value="{{ old('start') ?? '' }}" placeholder="20 сентября 2024">
215   - @error('power')
216   - <span class="text-xs text-red-600">
217   - {{ $message }}
218   - </span>
219   - @enderror
220   - </div>
221   - </div>
222   -
223   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
224   - <label class="form-group__label">Корабль для посадки</label>
  127 + <label class="form-group__label">Категория (локация)</label>
225 128 <div class="form-group__item">
226 129 <div class="select">
227   - <select class="js-select2" name="flot" id="flot">
228   - <option value="" selected> Не указан корабль</option>
229   - @if ($Employer[0]->flots->count())
230   - @foreach($Employer[0]->flots as $j)
231   - <option value="{{ $j->name }}">{{ $j->name }} ({{ $j->id }})</option>
  130 + <select class="js-select2" name="category_id" id="category_id">
  131 + @php $i = 1 @endphp
  132 + @if ($categories->count())
  133 + @foreach($categories as $j)
  134 + @if ($i == 1) <option selected> Выберите категорию из списка</option>
  135 + @else
  136 + <option value="{{ $j->id }}">{{ $j->name }}</option>
  137 + @endif
  138 + @php $i++ @endphp
232 139 @endforeach
233 140 @endif
234 141 </select>
235   - @error('flot')
236   - <span class="text-xs text-red-600">
  142 + @error('category_id')
  143 + <span class="text-xs text-red-600 dark:text-red-400">
237 144 {{ $message }}
238 145 </span>
239 146 @enderror
... ... @@ -252,18 +159,6 @@
252 159 @enderror
253 160 </div>
254 161 </div>
255   -
256   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
257   - <label class="form-group__label">Дополнительная информация</label>
258   - <div class="form-group__item">
259   - <textarea class="textarea" name="description" id="description">{{ old('description') ?? '' }}</textarea>
260   - @error('description')
261   - <span class="text-xs text-red-600">
262   - {{ $message }}
263   - </span>
264   - @enderror
265   - </div>
266   - </div>
267 162 </div>
268 163 <button type="submit" class="button cabinet__submit">Опубликовать</button>
269 164 </div>
resources/views/employers/ajax/list_vacancy.blade.php
... ... @@ -63,7 +63,8 @@
63 63 @endforeach
64 64 </tbody>
65 65 </table>
66   - </div>
  66 + </div><br>
  67 + {{ $vacancy_list->appends($_GET)->links('paginate') }}
67 68 </div>
68 69 @else
69 70  
resources/views/employers/edit_ad_jobs.blade.php
... ... @@ -0,0 +1,216 @@
  1 +@extends('layout.frontend', ['title' => 'Добавление вакансии РекаМоре'])
  2 +
  3 +@section('scripts')
  4 + <script>
  5 + console.log('Приближаемся к системе, нас рой тут...');
  6 + $(document).on('change', '#position_id', function() {
  7 + var this_ = $(this);
  8 + var val_ = this_.val();
  9 + var ajax_ = $('#job_title_id');
  10 +
  11 + console.log('Создания списка людей, которые поднимутся на корабль...');
  12 +
  13 + $.ajax({
  14 + type: "GET",
  15 + url: "{{ route('employer.selected_people') }}",
  16 + data: "id="+val_,
  17 + success: function (data) {
  18 + console.log('Ответка пришла');
  19 + console.log('Список избранных людей создан');
  20 + ajax_.html(data);
  21 + },
  22 + headers: {
  23 + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  24 + },
  25 + error: function (data) {
  26 + console.log('Обрыв связи');
  27 + console.log('Error: ' + data);
  28 + }
  29 + });
  30 + });
  31 + </script>
  32 +@endsection
  33 +@section('content')
  34 + <section class="cabinet">
  35 + <div class="container">
  36 + <ul class="breadcrumbs cabinet__breadcrumbs">
  37 + <li><a href="{{ route('index') }}">Главная</a></li>
  38 + <li><b>Личный кабинет</b></li>
  39 + </ul>
  40 + <div class="cabinet__wrapper">
  41 + <div class="cabinet__side">
  42 + <div class="cabinet__side-toper">
  43 +
  44 + @include('employers.emblema')
  45 +
  46 + </div>
  47 +
  48 + @include('employers.menu', ['item' => 2])
  49 +
  50 + </div>
  51 +
  52 + <form class="cabinet__body" action="{{ route('employer.edit_job_in_vac_save', ['ad_job' => $ad_job->id]) }}" method="POST">
  53 + @csrf
  54 + <input type="hidden" name="ad_employer_id" value="{{ $ad_employer->id }}"/>
  55 + <div class="cabinet__body-item">
  56 + <div class="cabinet__descr">
  57 + <h2 class="title cabinet__title">Редактировать должность в вакансии</h2>
  58 + <p class="cabinet__text"><b>Вакансия {{ $ad_employer->name }}</b></p>
  59 + </div>
  60 + </div>
  61 +
  62 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  63 + <label class="form-group__label">Позиция на корабле</label>
  64 + <div class="form-group__item">
  65 + <div class="select">
  66 + <select class="js-select2" name="position_id" id="position_id">
  67 + @foreach ($Positions as $it)
  68 + <option value="{{ $it->id }}">{{ $it->name }}</option>
  69 + @endforeach
  70 + </select>
  71 + @error('postion_id')
  72 + <span class="text-xs text-red-600 dark:text-red-400">
  73 + {{ $message }}
  74 + </span>
  75 + @enderror
  76 + </div>
  77 + </div>
  78 + </div>
  79 +
  80 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  81 + <label class="form-group__label">Должность соискателя</label>
  82 + <div class="form-group__item">
  83 + <div class="select">
  84 + <select class="js-select2" name="job_title_id" id="job_title_id">
  85 + @php $i = 1 @endphp
  86 + @if ($jobs->count())
  87 + @foreach($jobs as $j)
  88 + @if ($i == 1) <option selected> Выберите должность из списка</option>
  89 + @else
  90 + <option value="{{ $j->id }}">{{ $j->name }}</option>
  91 + @endif
  92 + @php $i++ @endphp
  93 + @endforeach
  94 + @endif
  95 + </select>
  96 + @error('job_title_id')
  97 + <span class="text-xs text-red-600 dark:text-red-400">
  98 + {{ $message }}
  99 + </span>
  100 + @enderror
  101 + </div>
  102 + </div>
  103 + </div>
  104 +
  105 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  106 + <label class="form-group__label">Минимальная зарплата</label>
  107 + <div class="form-group__item">
  108 + <input type="text" class="input" name="min_salary" id="min_salary" value="{{ old('min_salary') ?? $ad_job->min_salary ?? '' }}" placeholder="Минимальная зарплата">
  109 + @error('min_salary')
  110 + <span class="text-xs text-red-600">
  111 + {{ $message }}
  112 + </span>
  113 + @enderror
  114 + </div>
  115 + </div>
  116 +
  117 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  118 + <label class="form-group__label">Максимальная зарплата</label>
  119 + <div class="form-group__item">
  120 + <input type="text" class="input" name="max_salary" id="max_salary" value="{{ old('max_salary') ?? $ad_job->max_salary ?? '' }}" placeholder="Максимальная зарплата">
  121 + @error('salary')
  122 + <span class="text-xs text-red-600 dark:text-red-400">
  123 + {{ $message }}
  124 + </span>
  125 + @enderror
  126 + </div>
  127 + </div>
  128 +
  129 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  130 + <label class="form-group__label">Регион отплытия</label>
  131 + <div class="form-group__item">
  132 + <input type="text" class="input" name="region" id="region" value="{{ old('region') ?? $ad_job->region ?? '' }}" placeholder="Севастополь">
  133 + @error('region')
  134 + <span class="text-xs text-red-600">
  135 + {{ $message }}
  136 + </span>
  137 + @enderror
  138 + </div>
  139 + </div>
  140 +
  141 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  142 + <label class="form-group__label">Мощность</label>
  143 + <div class="form-group__item">
  144 + <input type="text" class="input" name="power" id="power" value="{{ old('power') ?? $ad_job->power ?? '' }}" placeholder="POWER-45">
  145 + @error('power')
  146 + <span class="text-xs text-red-600">
  147 + {{ $message }}
  148 + </span>
  149 + @enderror
  150 + </div>
  151 + </div>
  152 +
  153 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  154 + <label class="form-group__label">Суточные выплаты</label>
  155 + <div class="form-group__item">
  156 + <input type="text" class="input" name="sytki" id="sytki" value="{{ old('sytki') ?? $ad_job->sytki ??'' }}" placeholder="2000">
  157 + @error('power')
  158 + <span class="text-xs text-red-600">
  159 + {{ $message }}
  160 + </span>
  161 + @enderror
  162 + </div>
  163 + </div>
  164 +
  165 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  166 + <label class="form-group__label">Начало отплытия</label>
  167 + <div class="form-group__item">
  168 + <input type="text" class="input" name="start" id="start" value="{{ old('start') ?? $ad_job->start ??'' }}" placeholder="20 сентября 2024">
  169 + @error('power')
  170 + <span class="text-xs text-red-600">
  171 + {{ $message }}
  172 + </span>
  173 + @enderror
  174 + </div>
  175 + </div>
  176 +
  177 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  178 + <label class="form-group__label">Корабль для посадки</label>
  179 + <div class="form-group__item">
  180 + <div class="select">
  181 + <select class="js-select2" name="flot" id="flot">
  182 + <option value=""> Не указан корабль</option>
  183 + @if ($Employer->flots->count())
  184 + @foreach($Employer->flots as $j)
  185 + <option value="{{ $j->name }}" @if ($ad_job->flot == $j->name) selected @endif>{{ $j->name }} ({{ $j->id }})</option>
  186 + @endforeach
  187 + @endif
  188 + </select>
  189 + @error('flot')
  190 + <span class="text-xs text-red-600">
  191 + {{ $message }}
  192 + </span>
  193 + @enderror
  194 + </div>
  195 + </div>
  196 + </div>
  197 +
  198 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  199 + <label class="form-group__label">Дополнительная информация</label>
  200 + <div class="form-group__item">
  201 + <textarea class="textarea" name="description" id="description">{{ old('description') ??$ad_job->description ?? '' }}</textarea>
  202 + @error('description')
  203 + <span class="text-xs text-red-600">
  204 + {{ $message }}
  205 + </span>
  206 + @enderror
  207 + </div>
  208 + </div>
  209 +
  210 + <button type="submit" class="button cabinet__submit">Опубликовать</button>
  211 + </form>
  212 + </div>
  213 + </div>
  214 + </section>
  215 + </div>
  216 +@endsection
resources/views/employers/edit_vacancy.blade.php
1 1 @extends('layout.frontend', ['title' => 'Редактирование вакансии РекаМоре'])
2 2  
3 3 @section('scripts')
4   -
  4 + <script>
  5 + console.log('Приближаемся к системе, нас рой тут...');
  6 + $(document).on('change', '#position_id', function() {
  7 + var this_ = $(this);
  8 + var val_ = this_.val();
  9 + var ajax_ = $('#job_title_id');
  10 +
  11 + console.log('Создания списка людей, которые поднимутся на корабль...');
  12 +
  13 + $.ajax({
  14 + type: "GET",
  15 + url: "{{ route('employer.selected_people') }}",
  16 + data: "id="+val_,
  17 + success: function (data) {
  18 + console.log('Ответка пришла');
  19 + console.log('Список избранных людей создан');
  20 + ajax_.html(data);
  21 + },
  22 + headers: {
  23 + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  24 + },
  25 + error: function (data) {
  26 + console.log('Обрыв связи');
  27 + console.log('Error: ' + data);
  28 + }
  29 + });
  30 + });
  31 + </script>
5 32 @endsection
6 33 @section('content')
7 34 <section class="cabinet">
... ... @@ -22,7 +49,7 @@
22 49  
23 50 </div>
24 51  
25   - <form class="cabinet__body" action="{{ route('employer.vacancy_save_me', ['ad_employer' => $ad_employer]) }}" method="POST">
  52 + <form class="cabinet__body" action="{{ route('employer.vacancy_save_me', ['ad_employer' => $Employer->id]) }}" method="POST">
26 53 @csrf
27 54 <input type="hidden" name="employer_id" value="{{ $Employer->id }}"/>
28 55 <div class="cabinet__body-item">
... ... @@ -33,219 +60,107 @@
33 60 </div>
34 61 </div>
35 62 <div class="cabinet__body-item">
36   - <div class="cabinet__inputs">
37   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
38   - <label class="form-group__label">Название вакансии</label>
39   - <div class="form-group__item">
40   - <input type="text" class="input" name="name" id="name" placeholder="Работа в море" value="{{ old('name') ?? $ad_employer->name ?? '' }}" required>
41   - @error('name')
42   - <span class="text-xs text-red-600">
  63 + <h4>Поля для вакансии</h4>
  64 + <div class="cabinet__inputs">
  65 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  66 + <label class="form-group__label">Название вакансии</label>
  67 + <div class="form-group__item">
  68 + <input type="text" class="input" name="name" id="name" placeholder="Работа в море" value="{{ old('name') ?? $ad_employer->name ?? '' }}" required>
  69 + @error('name')
  70 + <span class="text-xs text-red-600 dark:text-red-400">
43 71 {{ $message }}
44 72 </span>
45   - @enderror
46   - </div>
47   - </div>
48   -
49   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
50   - <label class="form-group__label">Должность соискателя</label>
51   - <div class="form-group__item">
52   - <div class="select">
53   - <select class="js-select2" name="job_title_id" id="job_title_id">
54   - <option value="0"> Выберите должность из списка</option>
55   -
56   - @if ($jobs->count())
57   - @foreach($jobs as $j)
58   - <option value="{{ $j->id }}" @if ($j->id == $ad_employer->id) selected @endif>{{ $j->name }}</option>
59   - @endforeach
60   - @endif
61   - </select>
62   - @error('job_title_id')
63   - <span class="text-xs text-red-600">
64   - {{ $message }}
65   - </span>
66 73 @enderror
67 74 </div>
68 75 </div>
69   - </div>
70 76  
71   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
72   - <label class="form-group__label">Категория (локация)</label>
73   - <div class="form-group__item">
74   - <div class="select">
75   - <select class="js-select2" name="category_id" id="category_id">
76   - @php $i = 1 @endphp
77   - @if ($categories->count())
78   - @foreach($categories as $j)
79   - @if ($i == 1) <option selected> Выберите категорию из списка</option>
80   - @else
81   - <option value="{{ $j->id }}">{{ $j->name }}</option>
82   - @endif
83   - @php $i++ @endphp
84   - @endforeach
85   - @endif
86   - </select>
87   - @error('category_id')
  77 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  78 + <label class="form-group__label">Телефон</label>
  79 + <div class="form-group__item">
  80 + <input type="text" class="input" name="telephone" id="telephone" value="{{ old('telephone') ?? $ad_employer->telephone ?? '' }}" placeholder="Свой телефон">
  81 + @error('telephone')
88 82 <span class="text-xs text-red-600 dark:text-red-400">
89   - {{ $message }}
90   - </span>
91   - @enderror
92   - </div>
93   - </div>
94   - </div>
95   -
96   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
97   - <label class="form-group__label">Телефон</label>
98   - <div class="form-group__item">
99   - <input type="text" class="input" name="telephone" id="telephone" value="{{ old('telephone') ?? $Employer->telephone ?? '' }}" placeholder="Свой телефон">
100   - @error('telephone')
101   - <span class="text-xs text-red-600">
102   - {{ $message }}
103   - </span>
104   - @enderror
105   - </div>
106   - </div>
107   -
108   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
109   - <label class="form-group__label">Емайл</label>
110   - <div class="form-group__item">
111   - <input type="text" class="input" name="email" id="email" value="{{ old('email') ?? $Employer->email ?? '' }}" placeholder="Своя почту">
112   - @error('email')
113   - <span class="text-xs text-red-600">
114   - {{ $message }}
115   - </span>
116   - @enderror
117   - </div>
118   - </div>
119   -
120   - <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
121   - <label class="form-group__label">Зарплата среднестатистическая</label>
122   - <div class="form-group__item">
123   - <input type="text" class="input" name="salary" id="salary" value="old('salary') ?? '' }}" placeholder="Среднестатистическая зарплата">
124   - @error('salary')
125   - <span class="text-xs text-red-600">
126   - {{ $message }}
127   - </span>
128   - @enderror
129   - </div>
130   - </div>
131   -
132   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
133   - <label class="form-group__label">Минимальная зарплата</label>
134   - <div class="form-group__item">
135   - <input type="text" class="input" name="min_salary" id="min_salary" value=" old('min_salary') ?? '' }}" placeholder="Минимальная зарплата">
136   - @error('min_salary')
137   - <span class="text-xs text-red-600">
138   - {{ $message }}
139   - </span>
140   - @enderror
141   - </div>
142   - </div>
143   -
144   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
145   - <label class="form-group__label">Максимальная зарплата</label>
146   - <div class="form-group__item">
147   - <input type="text" class="input" name="max_salary" id="max_salary" value=" old('max_salary') ?? '' }}" placeholder="Максимальная зарплата">
148   - @error('salary')
149   - <span class="text-xs text-red-600 dark:text-red-400">
150 83 {{ $message }}
151 84 </span>
152   - @enderror
153   - </div>
154   - </div>
155   -
156   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
157   - <label class="form-group__label">Город-регион</label>
158   - <div class="form-group__item">
159   - <input type="text" class="input" name="city" id="city" value=" old('city') ?? $Employer[0]->city ?? '' }}" placeholder="Севастополь">
160   - @error('city')
161   - <span class="text-xs text-red-600">
162   - {{ $message }}
163   - </span>
164   - @enderror
  85 + @enderror
  86 + </div>
165 87 </div>
166   - </div>
167 88  
168   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
169   - <label class="form-group__label">Мощность</label>
170   - <div class="form-group__item">
171   - <input type="text" class="input" name="power" id="power" value=" old('power') ?? '' }}" placeholder="POWER-45">
172   - @error('power')
173   - <span class="text-xs text-red-600">
  89 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  90 + <label class="form-group__label">Емайл</label>
  91 + <div class="form-group__item">
  92 + <input type="text" class="input" name="email" id="email" value="{{ old('email') ?? $ad_employer->email ?? '' }}" placeholder="Своя почту">
  93 + @error('email')
  94 + <span class="text-xs text-red-600 dark:text-red-400">
174 95 {{ $message }}
175 96 </span>
176   - @enderror
  97 + @enderror
  98 + </div>
177 99 </div>
178   - </div>
179 100  
180   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
181   - <label class="form-group__label">Суточные выплаты</label>
182   - <div class="form-group__item">
183   - <input type="text" class="input" name="sytki" id="sytki" value=" old('sytki') ?? '' }}" placeholder="2000">
184   - @error('power')
185   - <span class="text-xs text-red-600">
  101 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  102 + <label class="form-group__label">Зарплата среднестатистическая для вакансии</label>
  103 + <div class="form-group__item">
  104 + <input type="text" class="input" name="salary" id="salary" value="{{ old('salary') ?? $ad_employer->salary ??'' }}" placeholder="Среднестатистическая зарплата">
  105 + @error('salary')
  106 + <span class="text-xs text-red-600 dark:text-red-400">
186 107 {{ $message }}
187 108 </span>
188   - @enderror
  109 + @enderror
  110 + </div>
189 111 </div>
190   - </div>
191 112  
192   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
193   - <label class="form-group__label">Начало отплытия</label>
194   - <div class="form-group__item">
195   - <input type="text" class="input" name="start" id="start" value=" old('start') ?? $Employer->ads->start ?? '' }}" placeholder="20 сентября 2024">
196   - @error('power')
197   - <span class="text-xs text-red-600">
  113 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  114 + <label class="form-group__label">Город посадки</label>
  115 + <div class="form-group__item">
  116 + <input type="text" class="input" name="city" id="city" value="{{ old('city') ?? $ad_employer->city ?? '' }}" placeholder="Севастополь">
  117 + @error('city')
  118 + <span class="text-xs text-red-600">
198 119 {{ $message }}
199 120 </span>
200   - @enderror
  121 + @enderror
  122 + </div>
201 123 </div>
202   - </div>-->
203 124  
204   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
205   - <label class="form-group__label">Корабль для посадки</label>
206   - <div class="form-group__item">
207   - <div class="select">
208   - <select class="js-select2" name="flot" id="flot">
209   -
210   - @if ($Employer->flots->count())
211   - @foreach($Employer->flots as $j)
212   - <option value="{{ $j->name }}">{{ $j->name }} ({{ $j->id }})</option>
213   - @endforeach
214   - @endif
215   - </select>
216   - @error('flot')
217   - <span class="text-xs text-red-600">
  125 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  126 + <label class="form-group__label">Категория (локация)</label>
  127 + <div class="form-group__item">
  128 + <div class="select">
  129 + <select class="js-select2" name="category_id" id="category_id">
  130 + @php $i = 1 @endphp
  131 + @if ($categories->count())
  132 + @foreach($categories as $j)
  133 + @if ($i == 1) <option> Выберите категорию из списка</option>
  134 + @else
  135 + <option value="{{ $j->id }}" @if ($ad_employer->category_id == $j->id) selected @endif>{{ $j->name }}</option>
  136 + @endif
  137 + @php $i++ @endphp
  138 + @endforeach
  139 + @endif
  140 + </select>
  141 + @error('category_id')
  142 + <span class="text-xs text-red-600 dark:text-red-400">
218 143 {{ $message }}
219 144 </span>
220   - @enderror
  145 + @enderror
  146 + </div>
221 147 </div>
222 148 </div>
223   - </div>
224 149  
225   - <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
226   - <label class="form-group__label">Описание вакансии</label>
227   - <div class="form-group__item">
228   - <textarea class="textarea" name="text" id="text">{{ old('text') ?? $Employer[0]->text ?? '' }}</textarea>
229   - @error('text')
230   - <span class="text-xs text-red-600">
  150 +
  151 + <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
  152 + <label class="form-group__label">Описание вакансии</label>
  153 + <div class="form-group__item">
  154 + <textarea class="textarea" name="text" id="text">{{ old('text') ?? $ad_employer->text ?? '' }}</textarea>
  155 + @error('text')
  156 + <span class="text-xs text-red-600">
231 157 {{ $message }}
232 158 </span>
233   - @enderror
  159 + @enderror
  160 + </div>
234 161 </div>
235 162 </div>
236 163  
237   - <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
238   - <label class="form-group__label">Дополнительная информация</label>
239   - <div class="form-group__item">
240   - <textarea class="textarea" name="description" id="description"> old('description') ?? '' }}</textarea>
241   - @error('description')
242   - <span class="text-xs text-red-600">
243   - {{ $message }}
244   - </span>
245   - @enderror
246   - </div>
247   - </div>-->
248   - </div>
249 164 <a class="button cabinet__submit" href="{{ route('employer.vacancy_list') }}">Назад</a>
250 165 <button type="submit" class="button cabinet__submit">Опубликовать</button>
251 166 </div>
resources/views/employers/list_vacancy.blade.php
... ... @@ -79,17 +79,15 @@
79 79  
80 80 <div class="table table_spoiler" id="main_ockar" name="main_oskar">
81 81 @if ($vacancy_list->count())
82   - <!--<button type="button" class="table__button js-toggle js-parent-toggle button button_light button_more">
83   - <span>Показать ещё</span>
84   - <span>Свернуть</span>
85   - </button>-->
86 82 <div class="table__scroll">
87 83 <div class="table__body table__body_min-width">
88 84 <table>
89 85 <thead>
90 86 <tr>
  87 + <th>№</th>
91 88 <th>Название</th>
92 89 <th>Дата добавления<br>/&nbsp;обновления</th>
  90 + <th>Должности</th>
93 91 <th>Статус</th>
94 92 <th>Действия</th>
95 93 </tr>
... ... @@ -97,8 +95,23 @@
97 95 <tbody>
98 96 @foreach($vacancy_list as $it)
99 97 <tr>
  98 + <td>{{ $it->id }}</td>
100 99 <td>{{ $it->name }}</td>
101   - <td>{{ date('d.m.Y H:i:s', strtotime($it->created_at)) }} / {{ date('d.m.Y H:i:s', strtotime($it->updated_at)) }}</td>
  100 + <td>{{ date('d.m.Y H:i:s', strtotime($it->created_at)) }} <br>/ {{ date('d.m.Y H:i:s', strtotime($it->updated_at)) }}</td>
  101 + <td> <a href="{{ route('employer.add_job_in_vac', ['ad_employer' => $it->id]) }}" class="button">Добавить</a>
  102 + @if ($it->jobs->count())
  103 +
  104 + @foreach ($it->jobs as $key => $it_um)
  105 + <p><a href="{{ route('employer.edit_job_in_vac', ['ad_job' => $it_um->id, 'ad_employer' => $it->id]) }}" style="text-decoration: underline">{{$it_um->name}}</a>
  106 + @if (isset($it->jobs_code[$key]))
  107 + <a href="{{ route('employer.delete_job_in_vac', ['ad_job' => $it->jobs_code[$key]->id]) }}" style="text-decoration: underline">(Del)</a>
  108 + @endif
  109 + </p>
  110 + @endforeach
  111 + @else
  112 + Нет связанных <br> с вакансией должностей
  113 + @endif
  114 + </td>
102 115 <td>
103 116 @if ($it->active_is)
104 117 <span class="table__status green"><i></i>Опубликовано</span>
... ... @@ -149,8 +162,11 @@
149 162 @endforeach
150 163 </tbody>
151 164 </table>
152   - </div>
  165 + </div><br>
  166 + {{ $vacancy_list->appends($_GET)->links('paginate') }}
153 167 </div>
  168 +
  169 +
154 170 @else
155 171  
156 172 <div class="notify">
resources/views/favorite_people.blade.php
... ... @@ -0,0 +1,3 @@
  1 +@foreach ($favorite_people as $it)
  2 + <option value="{{ $it->id }}">{{ $it->name }}</option>
  3 +@endforeach
resources/views/index.blade.php
... ... @@ -103,10 +103,8 @@
103 103 <span>Скрыть</span>
104 104 </button>-->
105 105 <div class="vacancies__list" id="block_ajax" name="block_ajax">
106   -
107 106 @foreach ($BigFlot as $key => $flot)
108 107 <div class="vacancies__list-col">
109   -
110 108 @include('block_real', ['flot' => $flot, 'position' => $Position[$key]])
111 109 </div>
112 110 @endforeach
resources/views/js/modals.blade.php
... ... @@ -41,7 +41,7 @@
41 41 var field_login = $('#email_worker');
42 42 var field_pwd = $('#password_worker');
43 43 var field_confirm_pwd = $('#password_confirmation_worker');
44   - var field_politik_worker = $('#politik_worker');
  44 + var field_politik_worker = $('#politik');
45 45 var field_telephone_worker = $('#telephone_worker');
46 46 var field_job_titles_worker = $('#job_titles_worker');
47 47 var field_surname_worker = $('#surname_worker');
... ... @@ -59,6 +59,14 @@
59 59 var surname2 = field_surname2_worker.val();
60 60  
61 61  
  62 + if (field_politik_worker.attr('checked')) {
  63 + console.log('politik=1');
  64 + politik = 1;
  65 + } else {
  66 + politik = 0;
  67 + console.log('politik=0');
  68 + }
  69 +
62 70 console.log('login: '+login+' password: '+pwd);
63 71  
64 72 $.ajax({
... ... @@ -118,7 +126,13 @@
118 126  
119 127 console.log('login: '+login+' password: '+pwd);
120 128  
121   -
  129 + if (field_politik_employer.attr('checked')) {
  130 + console.log('politik=1');
  131 + politik = 1;
  132 + } else {
  133 + politik = 0;
  134 + console.log('politik=0');
  135 + }
122 136 $.ajax({
123 137 type: "GET",
124 138 url: "{{ route('register_employer') }}",
... ... @@ -138,7 +152,6 @@
138 152 $('#messages_error_reg').html(d['ERROR']);
139 153 }
140 154 console.log(d['REDIRECT']);
141   -
142 155 },
143 156 headers: {
144 157 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
resources/views/layout/frontend.blade.php
... ... @@ -277,7 +277,7 @@
277 277 <script src="{{ asset('js/jquery.fancybox.js') }}"></script>
278 278 <script src="{{ asset('js/jquery.select2.js') }}"></script>
279 279 <script src="{{ asset('js/swiper.js') }}"></script>
280   -<script src="{{ asset('js/script145.js') }}"></script>
  280 +<script src="{{ asset('js/script-vc.js') }}"></script>
281 281 <script src="{{ asset('js/star-rating.min.js') }}"></script>
282 282 <script>
283 283 var getUrlParameter = function getUrlParameter(sParam) {
resources/views/list_vacancies.blade.php
... ... @@ -161,7 +161,7 @@
161 161 <h2 class="main__vacancies-title" id="title_head" name="title_head">Все категории</h2>
162 162 @endif
163 163 <div class="filters main__vacancies-filters">
164   - <div class="filters__label" id="col-vo" name="col-vo">Показано @if ($Query_count < 3) {{$Query_count}} @else 3 @endif из @isset($Query_count) {{ $Query_count }} @else 0 @endisset результатов поиска</div>
  164 + <div class="filters__label" id="col-vo" name="col-vo">Показано {{ $Query->firstItem() }} – {{ $Query->lastItem() }} из @isset($Query_count) {{ $Query_count }} @else 0 @endisset результатов поиска</div>
165 165 <div class="filters__body">
166 166 <div class="select filters__select">
167 167 <select class="js-select2" id="sort_ajax" name="sort_ajax">
resources/views/news-list.blade.php
... ... @@ -97,12 +97,10 @@
97 97 <form class="thing__body" action="{{ route('news') }}" method="GET">
98 98 <ul class="breadcrumbs thing__breadcrumbs">
99 99 <li><a href="{{ route('index') }}">Главная</a></li>
100   - <li><a href="{{ route('vacancies') }}">Вакансии</a></li>
101   - <li><b>{{ isset($Name_categori[0]) ? $Name_categori[0]->name : 'Все категории' }}</b></li>
  100 + <li><b>Новости</b></li>
102 101 </ul>
103   - <h1 class="thing__title">Вакансии</h1>
104   - <p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для
105   - существующих финансовых и административных условий.</p>
  102 + <h1 class="thing__title">Новости</h1>
  103 + <p class="thing__text">Информационные блоки и новости о компании и событиях в мире</p>
106 104 <div class="search thing__search">
107 105 <input type="search" id="search" name="search" class="input" placeholder="Введите наименование статьи" value="@if (!empty($_GET['search'])) {{ $_GET['search'] }} @endif">
108 106 <button type="submit" class="button">Найти</button>
... ... @@ -115,11 +113,11 @@
115 113 </form>
116 114 </div>
117 115 </section>
118   - <main class="main">
  116 + <main class="main rus">
119 117 <div class="container">
120 118 <div class="main__employers">
121 119 <div class="filters">
122   - <div class="filters__label" id="col-vo" name="col-vo">Показано @if ($Query_count < 3) {{$Query_count}} @else 6 @endif из @isset($Query_count) {{ $Query_count }} @else 0 @endisset результатов поиска</div>
  120 + <div class="filters__label" id="col-vo" name="col-vo">Показано {{ $Query->firstItem() }} – {{ $Query->lastItem() }} из @isset($Query_count) {{ $Query_count }} @else 0 @endisset результатов поиска</div>
123 121 <div class="filters__body">
124 122 <div class="select filters__select">
125 123 <select class="js-select2" id="sort_ajax" name="sort_ajax">
... ... @@ -155,7 +153,7 @@
155 153 {{ $Query->appends($_GET)->links('paginate') }}
156 154 @else
157 155 <div class="news__items">
158   -
  156 + Нет никакой информации
159 157 </div>
160 158 @endif
161 159 </div>
... ... @@ -164,4 +162,5 @@
164 162 </div>
165 163 </main>
166 164 </div>
  165 +
167 166 @endsection
resources/views/resume.blade.php
... ... @@ -235,7 +235,7 @@
235 235 <div class="main__resume-base">
236 236 <h2>Резюме работников</h2>
237 237 <div class="filters">
238   - <div class="filters__label">Показано @if ($res_count > 0) 1 @else 0 @endif – @if($res_count < 5) {{ $res_count }} @else 5 @endif из {{ $res_count }} результатов поиска</div>
  238 + <div class="filters__label">Показано {{ $resumes->firstItem() }} – {{ $resumes->lastItem() }} из {{ $res_count }} результатов поиска</div>
239 239 <div class="filters__body">
240 240 <div class="select filters__select">
241 241 <select class="js-select2" id="sort_ajax" name="sort_ajax">
1 1 <?php
2 2  
  3 +use App\Http\Controllers\Ad_jobsController;
3 4 use App\Http\Controllers\AdEmployerController;
4 5 use App\Http\Controllers\Admin\AdminController;
5 6 use App\Http\Controllers\Admin\CategoryController;
... ... @@ -17,6 +18,7 @@ use App\Http\Controllers\Auth\RegisterController;
17 18 use App\Http\Controllers\CKEditorController;
18 19 use App\Http\Controllers\MediaController;
19 20 use App\Http\Controllers\WorkerController;
  21 +use App\Models\Ad_jobs;
20 22 use App\Models\User;
21 23 use App\Http\Controllers\MainController;
22 24 use App\Http\Controllers\HomeController;
... ... @@ -535,9 +537,12 @@ Route::group([
535 537  
536 538 // 2 страница - Добавление вакансий
537 539 Route::get('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancie'])->name('cabinet_vacancie');
538   - Route::post('cabinet/vacancie', [EmployerController::class, 'cabinet_vacancy_save'])->name('vacancy_save');
539 540 Route::post('vacancie', [EmployerController::class, 'cabinet_vacancy_save1'])->name('vac_save');
540 541  
  542 +
  543 + Route::get('selected_people', [EmployerController::class, 'selected_people'])->name('selected_people');
  544 +
  545 +
541 546 // 3 страница - Мои вакансии
542 547 Route::get('cabinet/vacancy_list', [EmployerController::class, 'vacancy_list'])->name('vacancy_list');
543 548 Route::get('cabinet/vacancy/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit');
... ... @@ -545,7 +550,14 @@ Route::group([
545 550 Route::get('cabinet/vacancy-up/{ad_employer}', [EmployerController::class, 'vacancy_up'])->name('vacancy_up');
546 551 Route::get('cabinet/vacancy-eye/{ad_employer}/{status}', [EmployerController::class, 'vacancy_eye'])->name('vacancy_eye');
547 552 Route::get('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_edit'])->name('vacancy_edit');
548   - Route::post('cabinet/vacancy-edit/{ad_employer}/', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me');
  553 + Route::post('cabinet/vacancy-edit/{ad_employer}', [EmployerController::class, 'vacancy_save_me'])->name('vacancy_save_me');
  554 +
  555 + // 4.1Ю.
  556 + Route::get('cabinet/ad_jobs/create/{ad_employer}', [Ad_jobsController::class, 'add_job_in_vac'])->name('add_job_in_vac');
  557 + Route::post('cabinet/ad_jobs/create', [Ad_jobsController::class, 'add_job_in_vac_save'])->name('add_job_in_vac_save');
  558 + Route::get('cabinet/ad_jobs/edit/{ad_job}/{ad_employer}', [Ad_jobsController::class, 'edit_job_in_vac'])->name('edit_job_in_vac');
  559 + Route::post('cabinet/ad_jobs/edit/{ad_job}', [Ad_jobsController::class, 'edit_job_in_vac_save'])->name('edit_job_in_vac_save');
  560 + Route::get('cabinet/ad_jobs/delete/{ad_job}', [Ad_jobsController::class, 'delete_job_in_vac'])->name('delete_job_in_vac');
549 561  
550 562 // 4 страница - Отклики на вакансии
551 563 Route::get('cabinet/answers/{employer}', [EmployerController::class, 'answers'])->name('answers');