Commit ccfcc0cbb395fab7e67d51a60244eddb405e79dd

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

Merge branch 'master' of http://gitlab.nologostudio.ru/alarionov/rekamore-su

Showing 25 changed files Side-by-side Diff

app/Http/Controllers/Admin/AdminController.php
... ... @@ -179,8 +179,8 @@ class AdminController extends Controller
179 179 if($user->is_worker) {
180 180 $caption = "Карточка работника";
181 181 if (isset($user->workers[0]->id)) {
182   - $link = route('admin.worker-profile', ['worker' => $user->workers[0]->id]);
183   - //$visible = true;
  182 + $link = route('admin.worker-profile-edit', ['worker' => $user->workers[0]->id]);
  183 + $visible = true;
184 184 } else {
185 185 $link = "";
186 186 }
... ... @@ -190,7 +190,7 @@ class AdminController extends Controller
190 190 if (isset($user->employers[0]->id)) {
191 191  
192 192 $link = route('admin.employer-profile', ['employer' => $user->employers[0]->id]);
193   - //$visible = true;
  193 + $visible = true;
194 194 } else {
195 195 $link = "";
196 196 }
app/Http/Controllers/Admin/WorkersController.php
... ... @@ -3,10 +3,14 @@
3 3 namespace App\Http\Controllers\Admin;
4 4  
5 5 use App\Http\Controllers\Controller;
  6 +use App\Models\Company;
  7 +use App\Models\Job_title;
6 8 use App\Models\Static_worker;
7 9 use App\Models\User;
8 10 use App\Models\Worker;
9 11 use Illuminate\Http\Request;
  12 +use Illuminate\Support\Facades\Storage;
  13 +use Illuminate\Support\Facades\Validator;
10 14  
11 15 class WorkersController extends Controller
12 16 {
... ... @@ -37,8 +41,57 @@ class WorkersController extends Controller
37 41 }
38 42 }
39 43  
40   - public function form_update_worker(Worker $worker) {
41   - return view('admin.worker.edit');
  44 + public function form_edit_worker(Worker $worker) {
  45 + $job_titles = Job_title::query()->active()->orderBy('name')->get();
  46 +
  47 + $time_end_anketa = 'Бессрочно';
  48 + if (!empty($worker->updated_at)) {
  49 + $long_days = Company::find(1)->time_resume;
  50 + $time_end_anketa = date("d.m.Y H:i:s", strtotime($worker->updated_at . "+$long_days days"));
  51 + }
  52 + return view('admin.worker.edit', compact('worker', 'job_titles', 'time_end_anketa'));
  53 + }
  54 +
  55 + public function form_update_worker(Request $request, Worker $worker)
  56 + {
  57 + $params = $request->all();
  58 +
  59 + $rules = [
  60 + 'email' => 'email|string|max:255',
  61 + //'photo' => 'mimes:jpeg,jpg,png|max:15000',
  62 + ];
  63 +
  64 + $messages = [
  65 + 'required' => 'Укажите обязательное поле «:attribute»',
  66 + 'confirmed' => 'Пароли не совпадают',
  67 + 'email' => 'Введите корректный email',
  68 + 'min' => [
  69 + 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
  70 + 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
  71 + ],
  72 + 'max' => [
  73 + 'string' => 'Поле «:attribute» должно быть не больше :max символов',
  74 + 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
  75 + ],
  76 + ];
  77 +
  78 + $validator = Validator::make($params, $rules, $messages);
  79 +
  80 + if ($validator->fails()) {
  81 + return back()->withErrors($validator)->withInput();
  82 + } else {
  83 + $user_id = $worker->user_id;
  84 + if ($request->has('photo')) {
  85 + if (!empty($worker->photo)) {
  86 + Storage::delete($worker->photo);
  87 + }
  88 + if (!empty($request->photo))
  89 + $params['photo'] = $request->file('photo')->store("workers/$user_id", 'public');
  90 + }
  91 + $worker->update($params);
  92 +
  93 + return redirect()->route('admin.workers');
  94 + }
42 95 }
43 96  
44 97 // кабинет - статистика работников
app/Http/Requests/CompanyRequest.php
... ... @@ -34,19 +34,24 @@ class CompanyRequest extends FormRequest
34 34 'mimes:jpeg,jpg,png',
35 35 'max:10000'
36 36 ],
  37 + 'time_mess' => 'required|numeric|min:0|max:365',
  38 + 'time_resume' => 'required|numeric|min:0|max:365',
37 39 ];
38 40 }
39 41  
40 42 public function messages() {
41 43 return [
42 44 'required' => 'Поле :attribute обязательно для ввода',
  45 + 'numeric' => 'Поле :attribute должно быть целым числом',
43 46 'min' => [
44 47 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
45   - 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
  48 + 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт',
  49 + 'numeric' => 'Поле «:attribute» должно быть не меньше :min',
46 50 ],
47 51 'max' => [
48 52 'string' => 'Поле «:attribute» должно быть не больше :max символов',
49   - 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
  53 + 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт',
  54 + 'numeric' => 'Поле «:attribute» должно быть не больше :max',
50 55 ],
51 56 'email' => 'Это поле должно быть формата email',
52 57 ];
app/Models/Company.php
... ... @@ -22,5 +22,7 @@ class Company extends Model
22 22 'image',
23 23 'map',
24 24 'text',
  25 + 'time_mess',
  26 + 'time_resume'
25 27 ];
26 28 }
app/Models/Worker.php
... ... @@ -42,6 +42,8 @@ class Worker extends Model
42 42 'coord',
43 43 'file',
44 44 'is_remove',
  45 + 'favorite_user',
  46 + 'sroch_user'
45 47 ];
46 48  
47 49 /*
database/migrations/2023_09_21_112115_alter_workers_table.php
... ... @@ -0,0 +1,35 @@
  1 +<?php
  2 +
  3 +use Illuminate\Database\Migrations\Migration;
  4 +use Illuminate\Database\Schema\Blueprint;
  5 +use Illuminate\Support\Facades\Schema;
  6 +
  7 +return new class extends Migration
  8 +{
  9 + /**
  10 + * Run the migrations.
  11 + *
  12 + * @return void
  13 + */
  14 + public function up()
  15 + {
  16 + Schema::table('workers', function (Blueprint $table) {
  17 + $table->boolean('favorite_user')->default(false);
  18 + $table->boolean('sroch_user')->default(false);
  19 +
  20 + });
  21 + }
  22 +
  23 + /**
  24 + * Reverse the migrations.
  25 + *
  26 + * @return void
  27 + */
  28 + public function down()
  29 + {
  30 + Schema::table('workers', function (Blueprint $table) {
  31 + $table->dropColumn('favorite_user');
  32 + $table->dropColumn('sroch_user');
  33 + });
  34 + }
  35 +};
resources/views/admin/category/form.blade.php
... ... @@ -23,6 +23,10 @@
23 23 <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
24 24 Сохранить
25 25 </button>
  26 + <a href="{{ route('admin.categories.index') }}"
  27 + class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"
  28 + style="display: -webkit-inline-box; height: 30px!important;"
  29 + >Назад</a>
26 30 </div>
27 31 </div>
28 32 </div>
resources/views/admin/config.blade.php
... ... @@ -177,6 +177,32 @@
177 177 @enderror
178 178 </label><br>
179 179  
  180 + <label class="block text-sm">
  181 + <span class="text-gray-700 dark:text-gray-400">Время повторного отклика для соискателя (в днях)</span>
  182 + <input name="time_mess" id="time_mess"
  183 + class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
  184 + placeholder="Время отклика" value="{{ old('time_mess') ?? $config->time_mess ?? '' }}"
  185 + />
  186 + @error('time_mess')
  187 + <span class="text-xs text-red-600 dark:text-red-400">
  188 + {{ $message }}
  189 + </span>
  190 + @enderror
  191 + </label><br>
  192 +
  193 + <label class="block text-sm">
  194 + <span class="text-gray-700 dark:text-gray-400">Время действия резюме (в днях)</span>
  195 + <input name="time_resume" id="time_resume"
  196 + class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
  197 + placeholder="Время резюме" value="{{ old('time_resume') ?? $config->time_resume ?? '' }}"
  198 + />
  199 + @error('time_resume')
  200 + <span class="text-xs text-red-600 dark:text-red-400">
  201 + {{ $message }}
  202 + </span>
  203 + @enderror
  204 + </label><br>
  205 +
180 206 <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4">
181 207 <div>
182 208 <button class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
resources/views/admin/editbloks/form.blade.php
... ... @@ -56,6 +56,10 @@
56 56 <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
57 57 Сохранить
58 58 </button>
  59 + <a href="{{ route('admin.edit-blocks') }}"
  60 + class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"
  61 + style="display: -webkit-inline-box; height: 30px!important;"
  62 + >Назад</a>
59 63 </div>
60 64 </div>
61 65 </div>
resources/views/admin/employer/edit.blade.php
... ... @@ -183,6 +183,11 @@
183 183 <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
184 184 Сохранить
185 185 </button>
  186 + <a href="{{ route('admin.employers') }}"
  187 + class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"
  188 + style="display: -webkit-inline-box; height: 30px!important;"
  189 + >Назад</a>
  190 +
186 191 </div>
187 192 <!--<div>
188 193 <a href="">Флот</a>
resources/views/admin/infobloks/form.blade.php
... ... @@ -17,6 +17,10 @@
17 17 <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
18 18 Сохранить
19 19 </button>
  20 + <a href="{{ route('admin.infobloks.index') }}"
  21 + class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"
  22 + style="display: -webkit-inline-box; height: 30px!important;"
  23 + >Назад</a>
20 24 </div>
21 25 </div>
22 26 </div>
resources/views/admin/job_titles/form.blade.php
... ... @@ -30,6 +30,11 @@
30 30 <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
31 31 Сохранить
32 32 </button>
  33 +
  34 + <a href="{{ route('admin.job-titles.index') }}"
  35 + class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"
  36 + style="display: -webkit-inline-box; height: 30px!important;"
  37 + >Назад</a>
33 38 </div>
34 39 </div>
35 40 </div>
resources/views/admin/pages/form.blade.php
... ... @@ -129,6 +129,10 @@
129 129 <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
130 130 Сохранить
131 131 </button>
  132 + <a href="{{ route('admin.editor-pages') }}"
  133 + class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"
  134 + style="display: -webkit-inline-box; height: 30px!important;"
  135 + >Назад</a>
132 136 </div>
133 137 </div>
134 138 </div>
resources/views/admin/profile.blade.php
... ... @@ -118,8 +118,9 @@
118 118 <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
119 119 Сохранить
120 120 </button>
121   - <a href="{{ route('admin.password') }}" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
122   - Сменить пароль
  121 + <a href="{{ route('admin.password') }}" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"
  122 + style="display: -webkit-inline-box; height: 30px!important;">
  123 + Сменить пароль
123 124 </a>
124 125 </div>
125 126 </div>
resources/views/admin/reclames/add.blade.php
... ... @@ -2,6 +2,7 @@
2 2  
3 3 @section('content')
4 4 <form method="POST" action="{{ route('admin.add-reclames-store') }}" enctype="multipart/form-data">
  5 + @csrf
5 6 @include('admin.reclames.form')
6 7 </form>
7 8 @endsection
resources/views/admin/reclames/edit.blade.php
... ... @@ -2,6 +2,10 @@
2 2  
3 3 @section('content')
4 4 <form method="POST" action="{{ route('admin.update-reclames', ['reclame' => $reclame->id]) }}" enctype="multipart/form-data">
  5 + @csrf
  6 + @isset($reclame)
  7 + @method('PUT')
  8 + @endisset
5 9 @include('admin.reclames.form')
6 10 </form>
7 11 @endsection
resources/views/admin/reclames/form.blade.php
1   -@csrf
2   -
3   -@isset($reclame)
4   - @method('PUT')
5   -@endisset
6   -
7 1 <script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>
8 2 <script>
9 3 CKEDITOR.replace( 'text', {
... ... @@ -16,7 +10,7 @@
16 10 <span class="text-gray-700 dark:text-gray-400">Заголовок рекламы</span>
17 11 <input name="title" id="title"
18 12 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
19   - placeholder="Заголовок рекламы" value="{{ old('title') ?? $reclame->title ?? '' }}"
  13 + placeholder="Заголовок рекламы" value="{{ old('title') ?? (isset($reclame->title)) ? $reclame->title : '' }}"
20 14 />
21 15 @error('title')
22 16 <span class="text-xs text-red-600 dark:text-red-400">
... ... @@ -28,7 +22,7 @@
28 22 <label class="block text-sm">
29 23 <span class="text-gray-700 dark:text-gray-400">
30 24 <input type="hidden" name="is_hidden" value="0" />
31   - <input type="checkbox" value="1" name="is_hidden" id="is_hidden" {{ ($reclame->is_hidden) ? "checked" : "" }} />
  25 + <input type="checkbox" value="1" name="is_hidden" id="is_hidden" {{ isset($reclame->is_hidden) ? ($reclame->is_hidden) ? "checked" : "" : "" }} />
32 26 Скрыть рекламу</span>
33 27 </label><br>
34 28  
... ... @@ -93,6 +87,10 @@
93 87 <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
94 88 Сохранить
95 89 </button>
  90 + <a href="{{ route('admin.reclames') }}"
  91 + class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"
  92 + style="display: -webkit-inline-box; height: 30px!important;"
  93 + >Назад</a>
96 94 </div>
97 95 </div>
98 96 </div>
resources/views/admin/seo/form.blade.php
... ... @@ -95,6 +95,10 @@ window.onload = function() {
95 95 <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
96 96 Сохранить
97 97 </button>
  98 + <a href="{{ route('admin.editor-seo') }}"
  99 + class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"
  100 + style="display: -webkit-inline-box; height: 30px!important;"
  101 + >Назад</a>
98 102 </div>
99 103 </div>
100 104 </div>
resources/views/admin/users/index.blade.php
... ... @@ -88,7 +88,7 @@
88 88 </div>
89 89 </div>
90 90 -->
91   - {{ $user->name }}
  91 + <a style="text-decoration: underline;" href="{{ route('admin.user-profile', ['user' => $user->id]) }}">{{ $user->name }}</a>
92 92 </td>
93 93 <td class="px-4 py-3 text-sm">
94 94 {{ $user->email }}
resources/views/admin/users/profile.blade.php
... ... @@ -92,12 +92,16 @@
92 92 <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
93 93 Сохранить
94 94 </button>
95   - </div>
96   - <div>
  95 + <a href="{{ route('admin.users') }}"
  96 + class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"
  97 + style="display: -webkit-inline-box; height: 30px!important;"
  98 + >Назад</a>
97 99 @if ($visible==true)
98   - <a href="{{$link}}" style="padding-bottom: 15px">
99   - {{ $caption }}
100   - </a>
  100 + <a href="{{$link}}"
  101 + class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"
  102 + style="display: -webkit-inline-box; height: 30px!important;">
  103 + {{ $caption }}
  104 + </a>
101 105 @endif
102 106 </div>
103 107 </div>
resources/views/admin/worker/edit.blade.php
  1 +<?php
  2 +use Illuminate\Support\Facades\Storage;
  3 +?>
1 4 @extends('layout.admin', ['title' => 'Админка - Редактирование соискателя'])
2 5  
3 6 @section('content')
4 7 <h4 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300">
5   - Соискатель-пользователь: "{{$worker->users->name_man}} ({{$worker->user_id}})"
  8 + Соискатель-пользователь: "{{$worker->users->surname}} {{$worker->users->name_man}} {{$worker->users->surname2}} ({{$worker->user_id}})"
6 9 </h4>
7 10 <form method="POST" action="">
8 11 @csrf
9 12 <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800">
10   - <label class="block text-sm">
11   - <span class="text-gray-700 dark:text-gray-400">Имя компании</span>
12   - <input name="name_company" id="name_company"
13   - class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
14   - placeholder="Имя компании" value="{{ old('name_company') ?? $employer->name_company ?? '' }}"
15   - />
16   - @error('name_company')
17   - <span class="text-xs text-red-600 dark:text-red-400">
18   - {{ $message }}
19   - </span>
20   - @enderror
21   - </label><br>
  13 + <div class="tabs">
  14 + <input type="radio" name="tab-btn" id="tab-btn-1" value="" checked>
  15 + <label for="tab-btn-1">Общие настройки</label>
  16 + <input type="radio" name="tab-btn" id="tab-btn-2" value="">
  17 + <label for="tab-btn-2">Анкета</label>
  18 + <!--<input type="radio" name="tab-btn" id="tab-btn-3" value="">
  19 + <label for="tab-btn-3">Вкладка 3</label>-->
  20 + <div id="content-1">
  21 + <label class="block text-sm">
  22 + <span class="text-gray-700 dark:text-gray-400">Должность соискателя</span>
  23 + <select name="position_work" id="position_work" 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">
  24 + @foreach($job_titles as $job)
  25 + <option value="{{ $job->id }}"
  26 + @if($worker->position_work == $job->id)
  27 + selected
  28 + @endif
  29 + >{{ $job->name }} ({{ $job->id }})</option>
  30 + @endforeach
  31 + </select>
  32 + @error('position_work')
  33 + <span class="text-xs text-red-600 dark:text-red-400">
  34 + {{ $message }}
  35 + </span>
  36 + @enderror
  37 + </label><br>
22 38  
23   - <label class="block text-sm">
24   - <span class="text-gray-700 dark:text-gray-400">Email</span>
25   - <input name="email" id="email"
26   - class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
27   - placeholder="Почта" value="{{ old('email') ?? $worker->email ?? '' }}"
28   - />
29   - @error('email')
30   - <span class="text-xs text-red-600 dark:text-red-400">
31   - {{ $message }}
32   - </span>
33   - @enderror
34   - </label><br>
  39 + <label class="block text-sm">
  40 + <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Избранный кандидат </p>
  41 + <input type="hidden" name="favorite_user" value="0" />
  42 + <input name="favorite_user" <? if ($worker->favorite_user) echo "checked";?>
  43 + class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray "
  44 + placeholder="" type="checkbox" value="1"
  45 + /><br>
35 46  
36   - <label class="block text-sm">
37   - <span class="text-gray-700 dark:text-gray-400">Телефон</span>
38   - <input name="telephone" id="telephone"
39   - class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
40   - placeholder="Телефон" value="{{ old('telephone') ?? $worker->telephone ?? '' }}"
41   - />
42   - @error('telephone')
43   - <span class="text-xs text-red-600 dark:text-red-400">
44   - {{ $message }}
45   - </span>
46   - @enderror
47   - </label><br>
  47 + <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Срочный кандидат</p>
  48 + <input type="hidden" name="sroch_user" value="0" />
  49 + <input name="sroch_user" id="sroch_user" <? if ($worker->sroch_user) echo "checked";?>
  50 + class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray "
  51 + placeholder="" type="checkbox" value="1"
  52 + /><br>
48 53  
49   - <label class="block text-sm">
50   - <span class="text-gray-700 dark:text-gray-400">Адрес</span>
51   - <input name="address" id="address"
52   - class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
53   - placeholder="Адрес" value="{{ old('address') ?? $worker->address ?? '' }}"
54   - />
55   - @error('address')
56   - <span class="text-xs text-red-600 dark:text-red-400">
57   - {{ $message }}
58   - </span>
59   - @enderror
60   - </label><br>
  54 + </label>
61 55  
62   - <label class="block text-sm">
63   - <span class="text-gray-700 dark:text-gray-400">Город</span>
64   - <input name="city" id="city"
65   - class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
66   - placeholder="Город" value="{{ old('city') ?? $worker->site ?? '' }}"
67   - />
68   - @error('city')
69   - <span class="text-xs text-red-600 dark:text-red-400">
70   - {{ $message }}
71   - </span>
72   - @enderror
73   - </label><br>
  56 + <label class="block text-sm">
  57 + <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Анкета действительна до <span style="color:#333">{{ $time_end_anketa }}</span></p>
74 58  
75   - <label class="block text-sm">
76   - <span class="text-gray-700 dark:text-gray-400">Фото</span>
  59 + </label><br>
  60 + </div>
  61 + <div id="content-2">
  62 + <label class="block text-sm">
  63 + <span class="text-gray-700 dark:text-gray-400">Email</span>
  64 + <input name="email" id="email"
  65 + class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
  66 + placeholder="Почта" value="{{ old('email') ?? $worker->email ?? '' }}"
  67 + />
  68 + @error('email')
  69 + <span class="text-xs text-red-600 dark:text-red-400">
  70 + {{ $message }}
  71 + </span>
  72 + @enderror
  73 + </label><br>
77 74  
78   - <input name="photo" id="photo" type="file"
79   - class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
80   - placeholder="Фото" value=""
81   - />
82   - @isset('photo')
83   - <img src="<?=asset(Storage::url($worker->photo))?>" width="150"/>
84   - @endisset
85   - @error('logo')
86   - <span class="text-xs text-red-600 dark:text-red-400">
87   - {{ $message }}
88   - </span>
89   - @enderror
90   - </label><br>
  75 + <label class="block text-sm">
  76 + <span class="text-gray-700 dark:text-gray-400">Телефон</span>
  77 + <input name="telephone" id="telephone"
  78 + class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
  79 + placeholder="Телефон" value="{{ old('telephone') ?? $worker->telephone ?? '' }}"
  80 + />
  81 + @error('telephone')
  82 + <span class="text-xs text-red-600 dark:text-red-400">
  83 + {{ $message }}
  84 + </span>
  85 + @enderror
  86 + </label><br>
91 87  
92   - <label class="block text-sm">
93   - <span class="text-gray-700 dark:text-gray-400">Согласие на обработку данных</span>
94   - <input name="email_data" id="email_data" <? if ($worker->email_data) echo "checked"; ?>
95   - class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
96   - placeholder=""
97   - />
98   - @error('email_data')
99   - <span class="text-xs text-red-600 dark:text-red-400">
100   - {{ $message }}
101   - </span>
102   - @enderror
103   - </label><br>
  88 + <label class="block text-sm">
  89 + <span class="text-gray-700 dark:text-gray-400">Адрес</span>
  90 + <input name="address" id="address"
  91 + class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
  92 + placeholder="Адрес" value="{{ old('address') ?? $worker->address ?? '' }}"
  93 + />
  94 + @error('address')
  95 + <span class="text-xs text-red-600 dark:text-red-400">
  96 + {{ $message }}
  97 + </span>
  98 + @enderror
  99 + </label><br>
  100 +
  101 + <label class="block text-sm">
  102 + <span class="text-gray-700 dark:text-gray-400">Город</span>
  103 + <input name="city" id="city"
  104 + class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
  105 + placeholder="Город" value="{{ old('city') ?? $worker->city ?? '' }}"
  106 + />
  107 + @error('city')
  108 + <span class="text-xs text-red-600 dark:text-red-400">
  109 + {{ $message }}
  110 + </span>
  111 + @enderror
  112 + </label><br>
104 113  
105   - <label class="block mt-4 text-sm">
106   - <span class="text-gray-700 dark:text-gray-400">Описание</span>
107   - <textarea name="text" id="text"
108   - class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-textarea focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
109   - rows="3"
110   - placeholder="Описание компании"
111   - >{{ old('text') ?? $worker->text ?? '' }}</textarea>
112   - </label>
  114 + <label class="block text-sm">
  115 + <span class="text-gray-700 dark:text-gray-400">Фото</span>
113 116  
  117 + <input name="photo" id="photo" type="file"
  118 + class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input"
  119 + placeholder="Фото" value=""
  120 + />
  121 + @isset($worker->photo)
  122 + <img src="<?=asset(Storage::url($worker->photo))?>" width="150"/>
  123 + @endisset
  124 + @error('logo')
  125 + <span class="text-xs text-red-600 dark:text-red-400">
  126 + {{ $message }}
  127 + </span>
  128 + @enderror
  129 + </label><br>
  130 +
  131 + <label class="block text-sm">
  132 + <span class="text-gray-700 dark:text-gray-400">Согласие на рассылку</span>
  133 + <input type="hidden" name="email_data" value="0" />
  134 + <input name="email_data" id="email_data" @php if ($worker->email_data) echo "checked"; @endphp
  135 + placeholder=""
  136 + type="checkbox"
  137 + value="1"
  138 + />
  139 + </label>
  140 +
  141 + <label class="block mt-4 text-sm">
  142 + <span class="text-gray-700 dark:text-gray-400">Об соискателе</span>
  143 + <textarea name="text" id="text"
  144 + class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-textarea focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
  145 + rows="3"
  146 + placeholder="О соискателе"
  147 + >{{ old('text') ?? $worker->text ?? '' }}</textarea>
  148 + </label>
  149 + </div>
  150 + <div id="content-3">
  151 +
  152 + </div>
  153 + </div><br>
114 154  
115 155 <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4">
116 156 <div>
117 157 <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple">
118 158 Сохранить
119 159 </button>
  160 + <a href="{{ route('admin.workers') }}"
  161 + class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"
  162 + style="display: -webkit-inline-box; height: 30px!important;"
  163 + >Назад</a>
120 164 </div>
121 165 </div>
122 166 </div>
resources/views/admin/worker/index.blade.php
... ... @@ -100,7 +100,7 @@
100 100 </td>
101 101 <td class="px-4 py-3 text-sm">
102 102 @if ($user->id > 1)
103   - <a href="{{ route('admin.user-profile', ['user' => $user->id]) }}">Изменить</a>
  103 + <a href="{{ route('admin.worker-profile-edit', ['worker' => $user->workers[0]->id]) }}">Изменить</a>
104 104 @endif
105 105 </td>
106 106 <td class="px-4 py-3 text-sm">
resources/views/admin/worker/index_ajax.blade.php
... ... @@ -54,7 +54,7 @@
54 54 </td>
55 55 <td class="px-4 py-3 text-sm">
56 56 @if ($user->id > 1)
57   - <a href="{{ route('admin.user-profile', ['user' => $user->id]) }}">Изменить</a>
  57 + <a href="{{ route('admin.worker-profile-edit', ['worker' => $user->workers[0]->id]) }}">Изменить</a>
58 58 @endif
59 59 </td>
60 60 <td class="px-4 py-3 text-sm">
resources/views/layout/admin.blade.php
... ... @@ -1043,7 +1043,7 @@
1043 1043 d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
1044 1044 ></path>
1045 1045 </svg>
1046   - <span>Вход в админку только для пользователей-админов</span>
  1046 + <span>Контент для админов</span>
1047 1047 </div>
1048 1048 <span>Список админов &RightArrow;</span>
1049 1049 </a>
... ... @@ -112,7 +112,10 @@ Route::group([
112 112 Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile');
113 113  
114 114 // кабинет профиль работник - форма
115   - Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile');
  115 + Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit');
  116 + // кабинет профиль работник - сохранение формы
  117 + Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update');
  118 +
116 119  
117 120 // кабинет настройки сайта - форма
118 121 Route::get('config', [AdminController::class, 'config_form'])->name('config');