Commit 313a7a805990c406a66597fdada982544d6a4aa9
1 parent
251aff93ae
Exists in
master
and in
1 other branch
Работа с разделом база данных, экспорт в эксель
Showing 20 changed files with 1653 additions and 5 deletions Side-by-side Diff
- app/Http/Controllers/Admin/EmployersController.php
- app/Http/Controllers/Admin/UsersController.php
- app/Http/Controllers/Admin/WorkersController.php
- app/Http/Requests/BaseUserRequest.php
- app/Http/Requests/WorkerRequest.php
- app/Models/BaseUsers.php
- app/Models/User.php
- database/migrations/2023_10_11_085208_create_base_users_table.php
- public/books-25.xlsx
- resources/views/admin/groups/form.blade.php
- resources/views/admin/users/add.blade.php
- resources/views/admin/users/edit.blade.php
- resources/views/admin/users/form.blade.php
- resources/views/admin/users/index.blade.php
- resources/views/admin/users/index_bd.blade.php
- resources/views/admin/users/index_bd_ajax.blade.php
- resources/views/admin/worker/add.blade.php
- resources/views/admin/worker/edit_bd.blade.php
- resources/views/layout/admin.blade.php
- routes/web.php
app/Http/Controllers/Admin/EmployersController.php
... | ... | @@ -26,7 +26,7 @@ class EmployersController extends Controller |
26 | 26 | } |
27 | 27 | |
28 | 28 | $users = User::with('employers')->select(['users.*','users.id as usr_id', 'emp.id as emp_id', 'emp.*'])->join('employers as emp','emp.user_id','users.id') |
29 | - ->where('users.is_worker', '0'); | |
29 | + ->where('users.is_worker', '0')->Realuser(); | |
30 | 30 | $all_employer = $users->count(); |
31 | 31 | |
32 | 32 | $find_cat = ""; |
app/Http/Controllers/Admin/UsersController.php
... | ... | @@ -3,9 +3,15 @@ |
3 | 3 | namespace App\Http\Controllers\Admin; |
4 | 4 | |
5 | 5 | use App\Http\Controllers\Controller; |
6 | +use App\Http\Requests\BaseUserRequest; | |
6 | 7 | use App\Models\User; |
7 | 8 | use Illuminate\Http\Request; |
8 | 9 | use Illuminate\Support\Facades\Auth; |
10 | +use PhpOffice\PhpSpreadsheet\Spreadsheet; | |
11 | +use PhpOffice\PhpSpreadsheet\Style\Alignment; | |
12 | +use PhpOffice\PhpSpreadsheet\Style\Border; | |
13 | +use PhpOffice\PhpSpreadsheet\Style\Font; | |
14 | +use PhpOffice\PhpSpreadsheet\Writer\Xlsx; | |
9 | 15 | |
10 | 16 | class UsersController extends Controller |
11 | 17 | { |
... | ... | @@ -33,6 +39,52 @@ class UsersController extends Controller |
33 | 39 | } |
34 | 40 | } |
35 | 41 | |
42 | + public function index_bd(Request $request) { | |
43 | + $title = 'Админка - Пользователи базы данных'; | |
44 | + | |
45 | + $find_key = ""; | |
46 | + $users = User::query(); | |
47 | + if (isset($request->find)) { | |
48 | + $find_key = $request->find; | |
49 | + $users = $users->where('name', 'LIKE', "%$find_key%") | |
50 | + ->orWhere('email', 'LIKE', "%$find_key%") | |
51 | + ->orWhere('telephone', 'LIKE', "%$find_key%"); | |
52 | + } | |
53 | + | |
54 | + $users = $users->Baseuser()->paginate(15); | |
55 | + | |
56 | + if ($request->ajax()) { | |
57 | + return view('admin.users.index_bd_ajax', compact('users')); | |
58 | + } else { | |
59 | + return view('admin.users.index_bd', compact('users', 'title', 'find_key')); | |
60 | + } | |
61 | + } | |
62 | + | |
63 | + public function add_bd() { | |
64 | + return view('admin.users.add'); | |
65 | + } | |
66 | + | |
67 | + public function add_store_bd(BaseUserRequest $request) { | |
68 | + $params = $request->all(); | |
69 | + $user = User::create($params); | |
70 | + return redirect()->route('admin.worker-profile-add', ['user' => $user]); | |
71 | + } | |
72 | + | |
73 | + public function edit_bd(User $user) { | |
74 | + return view('admin.users.edit', compact('user')); | |
75 | + } | |
76 | + | |
77 | + public function update_bd(BaseUserRequest $request, User $user) { | |
78 | + $params = $request->all(); | |
79 | + $user->update($params); | |
80 | + return redirect()->route('admin.basedata'); | |
81 | + } | |
82 | + | |
83 | + public function destroy_bd(User $user) { | |
84 | + $user->delete(); | |
85 | + return redirect()->route('admin.basedata'); | |
86 | + } | |
87 | + | |
36 | 88 | public function roles(Request $request) { |
37 | 89 | if ($request->ajax()) { |
38 | 90 | $user = User::find($request->id); |
... | ... | @@ -40,7 +92,7 @@ class UsersController extends Controller |
40 | 92 | $user->update($request->all()); |
41 | 93 | } |
42 | 94 | |
43 | - $users = User::query()->paginate(15); | |
95 | + $users = User::query()->Realuser()->paginate(15); | |
44 | 96 | |
45 | 97 | if ($request->ajax()) { |
46 | 98 | return view('admin.users.roles.index_ajax', compact('users')); |
... | ... | @@ -48,4 +100,66 @@ class UsersController extends Controller |
48 | 100 | return view('admin.users.roles.index', compact('users')); |
49 | 101 | } |
50 | 102 | } |
103 | + | |
104 | + public function doc_bd(User $user) { | |
105 | + $id = $user->id; | |
106 | + $spreadsheet = new Spreadsheet(); | |
107 | + $activeWorksheet = $spreadsheet->getActiveSheet(); | |
108 | + $activeWorksheet->setCellValue('A1', 'Отчет по соискателю'); | |
109 | + $activeWorksheet->getStyle('A1')->applyFromArray([ | |
110 | + 'font' => [ | |
111 | + 'name' => 'Arial', | |
112 | + 'bold' => true, | |
113 | + 'italic' => false, | |
114 | + 'underline' => Font::UNDERLINE_DOUBLE, | |
115 | + 'strikethrough' => false, | |
116 | + 'color' => [ | |
117 | + 'rgb' => '808080' | |
118 | + ] | |
119 | + ], | |
120 | + 'borders' => [ | |
121 | + 'allBorders' => [ | |
122 | + 'borderStyle' => Border::BORDER_THIN, | |
123 | + 'color' => [ | |
124 | + 'rgb' => '808080' | |
125 | + ] | |
126 | + ], | |
127 | + ], | |
128 | + 'alignment' => [ | |
129 | + 'horizontal' => Alignment::HORIZONTAL_CENTER, | |
130 | + 'vertical' => Alignment::VERTICAL_CENTER, | |
131 | + 'wrapText' => true, | |
132 | + ] | |
133 | + ]); | |
134 | + | |
135 | + $activeWorksheet->setCellValue('A2', "Псевдоним/имя: ".$user->name); | |
136 | + $activeWorksheet->setCellValue('A3', "Фамилия: ".$user->surname); | |
137 | + $activeWorksheet->setCellValue('A4', "Имя: ".$user->name_man); | |
138 | + $activeWorksheet->setCellValue('A5', "Отчество: ".$user->surname2); | |
139 | + $activeWorksheet->setCellValue('A6', "Телефон: ".$user->telephone); | |
140 | + $activeWorksheet->setCellValue('A7', "Емайл: ".$user->email); | |
141 | + | |
142 | + if (isset($user->workers[0]->id)) { | |
143 | + $activeWorksheet->setCellValue('A9', "Анкета: "); | |
144 | + $activeWorksheet->setCellValue('A10', "Телефон: " . $user->workers[0]->telephone); | |
145 | + $activeWorksheet->setCellValue('A11', "Емайл: " . $user->workers[0]->email); | |
146 | + } | |
147 | + | |
148 | + if (isset($user->jobtitles[0]->id)) { | |
149 | + $activeWorksheet->setCellValue('A12', "Должность: " . $user->jobtitles[0]->name); | |
150 | + } | |
151 | + | |
152 | + $writer = new Xlsx($spreadsheet); | |
153 | + | |
154 | + header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); | |
155 | + header('Content-Disposition: attachment; filename="user'.$id.'.xlsx"'); | |
156 | + header('Cache-Control: no-cache'); | |
157 | + | |
158 | + $writer->save('php://output'); | |
159 | + $writer->save(storage_path("app/public/export/user$id.xlsx")); | |
160 | + | |
161 | + //$spreadsheet->disconnectWorksheets(); | |
162 | + return redirect()->route('admin.basedata'); | |
163 | + | |
164 | + } | |
51 | 165 | } |
app/Http/Controllers/Admin/WorkersController.php
... | ... | @@ -3,11 +3,13 @@ |
3 | 3 | namespace App\Http\Controllers\Admin; |
4 | 4 | |
5 | 5 | use App\Http\Controllers\Controller; |
6 | +use App\Http\Requests\WorkerRequest; | |
6 | 7 | use App\Models\Company; |
7 | 8 | use App\Models\Job_title; |
8 | 9 | use App\Models\Static_worker; |
9 | 10 | use App\Models\User; |
10 | 11 | use App\Models\Worker; |
12 | +use Carbon\Carbon; | |
11 | 13 | use Illuminate\Database\Eloquent\Builder; |
12 | 14 | use Illuminate\Http\Request; |
13 | 15 | use Illuminate\Support\Facades\DB; |
... | ... | @@ -70,7 +72,7 @@ class WorkersController extends Controller |
70 | 72 | }); |
71 | 73 | } |
72 | 74 | |
73 | - $users = $users->paginate(15); | |
75 | + $users = $users->Realuser()->paginate(15); | |
74 | 76 | |
75 | 77 | /* |
76 | 78 | $Arr = array(); |
... | ... | @@ -115,6 +117,22 @@ class WorkersController extends Controller |
115 | 117 | } |
116 | 118 | } |
117 | 119 | |
120 | + public function form_add_worker(User $user) { | |
121 | + $job_titles = Job_title::query()->active()->orderBy('name')->get(); | |
122 | + | |
123 | + $time_end_anketa = 'Создана только'; | |
124 | + $long_days = Company::find(1)->time_resume; | |
125 | + $time_end_anketa = date("d.m.Y H:i:s", strtotime(Carbon::now() . "+$long_days days")); | |
126 | + | |
127 | + return view('admin.worker.add', compact('user', 'job_titles', 'time_end_anketa')); | |
128 | + } | |
129 | + | |
130 | + public function form_store_worker(WorkerRequest $request, User $user) { | |
131 | + $params = $request->all(); | |
132 | + $worker = Worker::create($params); | |
133 | + return redirect()->route('admin.basedata'); | |
134 | + } | |
135 | + | |
118 | 136 | public function form_edit_worker(Worker $worker) { |
119 | 137 | $job_titles = Job_title::query()->active()->orderBy('name')->get(); |
120 | 138 |
app/Http/Requests/BaseUserRequest.php
... | ... | @@ -0,0 +1,49 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace App\Http\Requests; | |
4 | + | |
5 | +use Illuminate\Foundation\Http\FormRequest; | |
6 | + | |
7 | +class BaseUserRequest extends FormRequest | |
8 | +{ | |
9 | + /** | |
10 | + * Determine if the user is authorized to make this request. | |
11 | + * | |
12 | + * @return bool | |
13 | + */ | |
14 | + public function authorize() | |
15 | + { | |
16 | + return true; | |
17 | + } | |
18 | + | |
19 | + /** | |
20 | + * Get the validation rules that apply to the request. | |
21 | + * | |
22 | + * @return array<string, mixed> | |
23 | + */ | |
24 | + public function rules() | |
25 | + { | |
26 | + return [ | |
27 | + 'name' => 'required|min:3|max:255', | |
28 | + 'surname' => 'required|min:3|max:255', | |
29 | + 'name_man' => 'required|min:3|max:255', | |
30 | + 'email' => 'required|email|min:5', | |
31 | + ]; | |
32 | + } | |
33 | + | |
34 | + public function messages() { | |
35 | + return [ | |
36 | + 'required' => 'Поле :attribute обязательно для ввода', | |
37 | + 'min' => [ | |
38 | + 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | |
39 | + 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | |
40 | + ], | |
41 | + 'max' => [ | |
42 | + 'string' => 'Поле «:attribute» должно быть не больше :max символов', | |
43 | + 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | |
44 | + ], | |
45 | + 'email' => 'Введите корректный емайл' | |
46 | + | |
47 | + ]; | |
48 | + } | |
49 | +} |
app/Http/Requests/WorkerRequest.php
... | ... | @@ -0,0 +1,50 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace App\Http\Requests; | |
4 | + | |
5 | +use Illuminate\Foundation\Http\FormRequest; | |
6 | + | |
7 | +class WorkerRequest extends FormRequest | |
8 | +{ | |
9 | + /** | |
10 | + * Determine if the user is authorized to make this request. | |
11 | + * | |
12 | + * @return bool | |
13 | + */ | |
14 | + public function authorize() | |
15 | + { | |
16 | + return true; | |
17 | + } | |
18 | + | |
19 | + /** | |
20 | + * Get the validation rules that apply to the request. | |
21 | + * | |
22 | + * @return array<string, mixed> | |
23 | + */ | |
24 | + public function rules() | |
25 | + { | |
26 | + return [ | |
27 | + 'email' => 'email|string|max:255', | |
28 | + ]; | |
29 | + } | |
30 | + | |
31 | + public function messages() { | |
32 | + return [ | |
33 | + 'required' => 'Поле :attribute обязательно для ввода', | |
34 | + 'unique' => 'Поле :attribute должно быть уникальным', | |
35 | + 'mimes' => 'Допускаются файлы только с расширением jpeg,jpg,png', | |
36 | + 'min' => [ | |
37 | + 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | |
38 | + 'integer' => 'Поле «:attribute» должно быть :min или больше', | |
39 | + 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | |
40 | + ], | |
41 | + | |
42 | + 'max' => [ | |
43 | + 'string' => 'Поле «:attribute» должно быть не больше :max символов', | |
44 | + 'integer' => 'Поле «:attribute» должно быть :max или меньше', | |
45 | + 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | |
46 | + ], | |
47 | + | |
48 | + ]; | |
49 | + } | |
50 | +} |
app/Models/BaseUsers.php
app/Models/User.php
... | ... | @@ -33,9 +33,11 @@ class User extends Authenticatable |
33 | 33 | 'is_remove', |
34 | 34 | 'is_ban', |
35 | 35 | 'is_new', |
36 | + 'is_bd', | |
36 | 37 | 'email_verified_at', |
37 | 38 | 'created_at', |
38 | - 'updated_at' | |
39 | + 'updated_at', | |
40 | + 'birthday' | |
39 | 41 | ]; |
40 | 42 | |
41 | 43 | /** |
... | ... | @@ -127,4 +129,12 @@ class User extends Authenticatable |
127 | 129 | return $query->where('is_remove', '=', '0'); |
128 | 130 | } |
129 | 131 | |
132 | + public function scopeBaseuser($query) { | |
133 | + return $query->where('is_bd', '=', '1'); | |
134 | + } | |
135 | + | |
136 | + public function scopeRealuser($query) { | |
137 | + return $query->where('is_bd', '=', '0'); | |
138 | + } | |
139 | + | |
130 | 140 | } |
database/migrations/2023_10_11_085208_create_base_users_table.php
... | ... | @@ -0,0 +1,31 @@ |
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::create('base_users', function (Blueprint $table) { | |
17 | + $table->id(); | |
18 | + $table->timestamps(); | |
19 | + }); | |
20 | + } | |
21 | + | |
22 | + /** | |
23 | + * Reverse the migrations. | |
24 | + * | |
25 | + * @return void | |
26 | + */ | |
27 | + public function down() | |
28 | + { | |
29 | + Schema::dropIfExists('base_users'); | |
30 | + } | |
31 | +}; |
public/books-25.xlsx
No preview for this file type
resources/views/admin/groups/form.blade.php
... | ... | @@ -18,6 +18,10 @@ |
18 | 18 | <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"> |
19 | 19 | Сохранить |
20 | 20 | </button> |
21 | + <a href="{{ route('admin.groups') }}" | |
22 | + 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" | |
23 | + style="display: -webkit-inline-box; height: 30px!important;" | |
24 | + >Назад</a> | |
21 | 25 | </div> |
22 | 26 | </div> |
23 | 27 | |
... | ... | @@ -32,6 +36,7 @@ |
32 | 36 | > |
33 | 37 | <th class="px-4 py-3">№</th> |
34 | 38 | <th class="px-4 py-3">Имя пользователя</th> |
39 | + <th class="px-4 py-3">Статус пользователя</th> | |
35 | 40 | <th class="px-4 py-3">Добавленные в группу</th> |
36 | 41 | </tr> |
37 | 42 | </thead> |
... | ... | @@ -44,6 +49,25 @@ |
44 | 49 | <td class="px-4 py-3"> |
45 | 50 | {{$user->name}} |
46 | 51 | </td> |
52 | + <td class="px-4 py-3 text-xs"> | |
53 | + <span class="px-2 py-1 font-semibold leading-tight text-green-700 bg-green-100 rounded-full dark:bg-green-700 dark:text-green-100"> | |
54 | + @if ($user->is_worker) | |
55 | + Работник | |
56 | + @else | |
57 | + Работодатель | |
58 | + @endif | |
59 | + </span> | |
60 | + @if ($user->admin) | |
61 | + <span class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:text-white dark:bg-orange-600"> | |
62 | + Администратор | |
63 | + </span> | |
64 | + @endif | |
65 | + @if ($user->is_bd) | |
66 | + <span class="px-2 py-1 font-semibold leading-tight text-red-700 bg-red-100 rounded-full dark:text-red-100 dark:bg-red-700"> | |
67 | + База данных | |
68 | + </span> | |
69 | + @endif | |
70 | + </td> | |
47 | 71 | <td class="px-4 py-3"> |
48 | 72 | <input type="checkbox" id="user{{$user->id}}" name="usergroup[]" value="{{$user->id}}" @isset($group) <?php if ($user->ingroup->contains('id', $group->id)) {?>checked<? }?> @endisset/> |
49 | 73 | </td> |
resources/views/admin/users/add.blade.php
... | ... | @@ -0,0 +1,11 @@ |
1 | +@extends('layout.admin', ['title' => 'Админка - Добавление пользователя в базу данных']) | |
2 | + | |
3 | +@section('content') | |
4 | + <h4 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"> | |
5 | + Добавление пользователя в базу данных | |
6 | + </h4> | |
7 | + <form method="POST" action="{{ route('admin.add-store-basedata') }}"> | |
8 | + @csrf | |
9 | + @include('admin.users.form') | |
10 | + </form> | |
11 | +@endsection |
resources/views/admin/users/edit.blade.php
... | ... | @@ -0,0 +1,15 @@ |
1 | +@extends('layout.admin', ['title' => 'Админка - Редактирование пользователя в базу данных']) | |
2 | + | |
3 | +@section('content') | |
4 | + <h4 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"> | |
5 | + Редактирование пользователя в базу данных | |
6 | + </h4> | |
7 | + <form method="POST" action="{{ route('admin.update-basedata', ['user' => $user->id]) }}"> | |
8 | + @csrf | |
9 | + @isset($user) | |
10 | + @method('PUT') | |
11 | + @endisset | |
12 | + | |
13 | + @include('admin.users.form') | |
14 | + </form> | |
15 | +@endsection |
resources/views/admin/users/form.blade.php
... | ... | @@ -0,0 +1,106 @@ |
1 | +<div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> | |
2 | + <label class="block text-sm"> | |
3 | + <span class="text-gray-700 dark:text-gray-400">Имя/Псевдоним</span> | |
4 | + <input name="name" id="name" | |
5 | + 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" | |
6 | + placeholder="Имя/Псевдоним" value="{{ old('name') ?? $user->name ?? '' }}" | |
7 | + /> | |
8 | + @error('name') | |
9 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
10 | + {{ $message }} | |
11 | + </span> | |
12 | + @enderror | |
13 | + </label><br> | |
14 | + | |
15 | + <label class="block text-sm"> | |
16 | + <span class="text-gray-700 dark:text-gray-400">Фамилия</span> | |
17 | + <input name="surname" id="surname" | |
18 | + 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('surname') ?? $user->surname ?? '' }}" | |
20 | + /> | |
21 | + @error('surname') | |
22 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
23 | + {{ $message }} | |
24 | + </span> | |
25 | + @enderror | |
26 | + </label><br> | |
27 | + | |
28 | + <label class="block text-sm"> | |
29 | + <span class="text-gray-700 dark:text-gray-400">Имя</span> | |
30 | + <input name="name_man" id="name_man" | |
31 | + 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" | |
32 | + placeholder="Имя" value="{{ old('name_man') ?? $user->name_man ?? '' }}" | |
33 | + /> | |
34 | + @error('name_man') | |
35 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
36 | + {{ $message }} | |
37 | + </span> | |
38 | + @enderror | |
39 | + </label><br> | |
40 | + | |
41 | + <input type="hidden" name="is_worker" id="is_worker" value="1"/> | |
42 | + <input type="hidden" name="is_bd" id="is_bd" value="1"/> | |
43 | + <input type="hidden" name="admin" id="admin" value="0"/> | |
44 | + <input type="hidden" name="password" id="password" value="1234567890"/> | |
45 | + | |
46 | + <label class="block text-sm"> | |
47 | + <span class="text-gray-700 dark:text-gray-400">Отчество</span> | |
48 | + <input name="surname2" id="surname2" | |
49 | + 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" | |
50 | + placeholder="Отчество" value="{{ old('surname2') ?? $user->surname2 ?? '' }}" | |
51 | + /> | |
52 | + @error('surname2') | |
53 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
54 | + {{ $message }} | |
55 | + </span> | |
56 | + @enderror | |
57 | + </label><br> | |
58 | + | |
59 | + <label class="block text-sm"> | |
60 | + <span class="text-gray-700 dark:text-gray-400">Email</span> | |
61 | + <input name="email" id="email" | |
62 | + 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" | |
63 | + placeholder="Email" value="{{ old('email') ?? $user->email ?? '' }}" | |
64 | + /> | |
65 | + @error('email') | |
66 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
67 | + {{ $message }} | |
68 | + </span> | |
69 | + @enderror | |
70 | + </label><br> | |
71 | + | |
72 | + <label class="block text-sm"> | |
73 | + <span class="text-gray-700 dark:text-gray-400">Телефон</span> | |
74 | + <input name="telephone" id="telephone" | |
75 | + 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" | |
76 | + placeholder="Телефон" value="{{ old('telephone') ?? $user->telephone ?? '' }}" | |
77 | + /> | |
78 | + @error('telephone') | |
79 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
80 | + {{ $message }} | |
81 | + </span> | |
82 | + @enderror | |
83 | + </label><br> | |
84 | + | |
85 | + <!--<label class="block text-sm"> | |
86 | + | |
87 | + <input type="hidden" name="page_worker" value="0" /> | |
88 | + <input name="page_worker" @php if (isset($user->workers->id)) echo "checked"; @endphp | |
89 | + 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 " | |
90 | + placeholder="" style="float:left; margin-right: 5px" type="checkbox" value="1" | |
91 | + /><p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Анкета </p><br> | |
92 | + | |
93 | + </label><br>--> | |
94 | + | |
95 | + <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> | |
96 | + <div> | |
97 | + <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"> | |
98 | + Сохранить | |
99 | + </button> | |
100 | + <a href="{{ route('admin.basedata') }}" | |
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 | + >Назад</a> | |
104 | + </div> | |
105 | + </div> | |
106 | +</div> |
resources/views/admin/users/index.blade.php
... | ... | @@ -106,6 +106,11 @@ |
106 | 106 | Администратор |
107 | 107 | </span> |
108 | 108 | @endif |
109 | + @if ($user->is_bd) | |
110 | + <span class="px-2 py-1 font-semibold leading-tight text-red-700 bg-red-100 rounded-full dark:text-red-100 dark:bg-red-700"> | |
111 | + База данных | |
112 | + </span> | |
113 | + @endif | |
109 | 114 | </td> |
110 | 115 | <td class="px-4 py-3 text-sm"> |
111 | 116 | @if ($user->id > 1) |
resources/views/admin/users/index_bd.blade.php
... | ... | @@ -0,0 +1,263 @@ |
1 | +@extends('layout.admin', ['title' => $title]) | |
2 | + | |
3 | +@section('script') | |
4 | + <script> | |
5 | + $(document).ready(function() { | |
6 | + $(document).on('click', '.check_click', function () { | |
7 | + var this_ = $(this); | |
8 | + var value = this_.val(); | |
9 | + var field = this_.attr('data-field'); | |
10 | + var ajax_block = $('#ajax_block'); | |
11 | + var bool = 0; | |
12 | + var str_get = ''; | |
13 | + | |
14 | + if(this.checked){ | |
15 | + bool = 1; | |
16 | + } else { | |
17 | + bool = 0; | |
18 | + } | |
19 | + console.log(field); | |
20 | + str_get = "id=" + value + "&" + field + "=" + bool; | |
21 | + console.log(str_get); | |
22 | + | |
23 | + $.ajax({ | |
24 | + type: "GET", | |
25 | + url: "{{ url()->full()}}", | |
26 | + data: str_get, | |
27 | + success: function (data) { | |
28 | + console.log('Обновление таблицы пользователей '); | |
29 | + //data = JSON.parse(data); | |
30 | + //console.log(data); | |
31 | + ajax_block.html(data); | |
32 | + }, | |
33 | + headers: { | |
34 | + 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | |
35 | + }, | |
36 | + error: function (data) { | |
37 | + console.log('Error: ' + data); | |
38 | + } | |
39 | + }); | |
40 | + }); | |
41 | + }); | |
42 | + </script> | |
43 | +@endsection | |
44 | + | |
45 | +@section('search') | |
46 | + @include('admin.find') | |
47 | +@endsection | |
48 | + | |
49 | +@section('content') | |
50 | + <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> | |
51 | + <div class="w-full overflow-x-auto"> | |
52 | + <a 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" href="{{ route('admin.add-basedata') }}">Добавить пользователя</a><br><br> | |
53 | + <table class="w-full whitespace-no-wrap"> | |
54 | + <thead> | |
55 | + <tr | |
56 | + class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800" | |
57 | + > | |
58 | + <th class="px-4 py-3">№</th> | |
59 | + <th class="px-4 py-3">Имя</th> | |
60 | + <th class="px-4 py-3">Email/телефон</th> | |
61 | + <th class="px-4 py-3">Статус</th> | |
62 | + <th class="px-4 py-3">Анкета</th> | |
63 | + <th class="px-4 py-3">Дата регистрации</th> | |
64 | + <th class="px-4 py-3">Изменить</th> | |
65 | + </tr> | |
66 | + </thead> | |
67 | + <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> | |
68 | + @foreach($users as $user) | |
69 | + <tr class="text-gray-700 dark:text-gray-400"> | |
70 | + <td class="px-4 py-3"> | |
71 | + {{$user->id}} | |
72 | + </td> | |
73 | + <td class="px-4 py-3"> | |
74 | + <!--<div class="flex items-center text-sm"> | |
75 | + <div class="relative hidden w-8 h-8 mr-3 rounded-full md:block"> | |
76 | + <div | |
77 | + class="absolute inset-0 rounded-full shadow-inner" | |
78 | + aria-hidden="true" | |
79 | + ></div> | |
80 | + </div> | |
81 | + <div> | |
82 | + <p class="font-semibold"><a href="{{ route('admin.users') }}">Пользователи</a></p> | |
83 | + <p class="text-xs text-gray-600 dark:text-gray-400"> | |
84 | + Все пользователи сайта | |
85 | + </p> | |
86 | + </div> | |
87 | + </div> | |
88 | + --> | |
89 | + <!--<a style="text-decoration: underline;" href="{{ route('admin.user-profile', ['user' => $user->id]) }}"></a>--> | |
90 | + | |
91 | + {{ $user->name }} | |
92 | + </td> | |
93 | + | |
94 | + <td class="px-4 py-3"> | |
95 | + <div class="flex items-center text-sm"> | |
96 | + <!--<div class="relative hidden w-8 h-8 mr-3 rounded-full md:block"> | |
97 | + <div | |
98 | + class="absolute inset-0 rounded-full shadow-inner" | |
99 | + aria-hidden="true" | |
100 | + ></div> | |
101 | + </div>--> | |
102 | + <div> | |
103 | + <p class="font-semibold">{{ empty($user->employers->email) ? $user->email : $user->employers->email }}</p> | |
104 | + <p class="text-xs text-gray-600 dark:text-gray-400"> | |
105 | + {{ empty($user->employers->telephone) ? $user->telephone : $user->employers->telephone }} | |
106 | + </p> | |
107 | + </div> | |
108 | + </div> | |
109 | + </td> | |
110 | + | |
111 | + <td class="px-4 py-3 text-xs"> | |
112 | + <span class="px-2 py-1 font-semibold leading-tight text-green-700 bg-green-100 rounded-full dark:bg-green-700 dark:text-green-100"> | |
113 | + @if ($user->is_worker) | |
114 | + Работник | |
115 | + @else | |
116 | + Работодатель | |
117 | + @endif | |
118 | + </span> | |
119 | + @if ($user->admin) | |
120 | + <span class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:text-white dark:bg-orange-600"> | |
121 | + Администратор | |
122 | + </span> | |
123 | + @endif | |
124 | + @if ($user->is_bd) | |
125 | + <span class="px-2 py-1 font-semibold leading-tight text-red-700 bg-red-100 rounded-full dark:text-red-100 dark:bg-red-700"> | |
126 | + База данных | |
127 | + </span> | |
128 | + @endif | |
129 | + </td> | |
130 | + | |
131 | + <td class="px-4 py-3 text-sm"> | |
132 | + @if (isset($user->workers[0]->id)) | |
133 | + <a href="{{ route('admin.worker-profile-edit', ['worker' => $user->workers[0]->id]) }}">Править</a> | | |
134 | + <a href="{{ route('admin.doc-basedata', ['user' => $user->id]) }}">Скачать</a> | |
135 | + @endif | |
136 | + </td> | |
137 | + | |
138 | + <td class="px-4 py-3 text-sm"> | |
139 | + {{ date('d.m.Y', strtotime($user->created_at)) }} | |
140 | + </td> | |
141 | + | |
142 | + <td class="px-4 py-3 text-sm_"> | |
143 | + <form action="{{ route('admin.delete-basedata', ['user' => $user->id]) }}" method="POST"> | |
144 | + <a href="{{ route('admin.edit-basedata', ['user' => $user->id]) }}">Изменить</a> | | |
145 | + @csrf | |
146 | + @method('DELETE') | |
147 | + <input class="btn btn-danger" type="submit" value="Удалить"/> | |
148 | + </form> | |
149 | + </td> | |
150 | + </tr> | |
151 | + @endforeach | |
152 | + </tbody> | |
153 | + </table> | |
154 | + </div> | |
155 | + | |
156 | + <div class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800"> | |
157 | + <?//=$users->appends($_GET)->links('admin.pagginate'); ?> | |
158 | + <?=$users->links('admin.pagginate'); ?> | |
159 | + </div> | |
160 | + | |
161 | + | |
162 | + <!--<div | |
163 | + class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800" | |
164 | + > | |
165 | + <span class="flex items-center col-span-3"> | |
166 | + Showing 21-30 of 100 | |
167 | + </span> | |
168 | + <span class="col-span-2"></span> | |
169 | + | |
170 | + <span class="flex col-span-4 mt-2 sm:mt-auto sm:justify-end"> | |
171 | + <nav aria-label="Table navigation"> | |
172 | + <ul class="inline-flex items-center"> | |
173 | + <li> | |
174 | + <button | |
175 | + class="px-3 py-1 rounded-md rounded-l-lg focus:outline-none focus:shadow-outline-purple" | |
176 | + aria-label="Previous" | |
177 | + > | |
178 | + <svg | |
179 | + aria-hidden="true" | |
180 | + class="w-4 h-4 fill-current" | |
181 | + viewBox="0 0 20 20" | |
182 | + > | |
183 | + <path | |
184 | + d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" | |
185 | + clip-rule="evenodd" | |
186 | + fill-rule="evenodd" | |
187 | + ></path> | |
188 | + </svg> | |
189 | + </button> | |
190 | + </li> | |
191 | + <li> | |
192 | + <button | |
193 | + class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" | |
194 | + > | |
195 | + 1 | |
196 | + </button> | |
197 | + </li> | |
198 | + <li> | |
199 | + <button | |
200 | + class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" | |
201 | + > | |
202 | + 2 | |
203 | + </button> | |
204 | + </li> | |
205 | + <li> | |
206 | + <button | |
207 | + class="px-3 py-1 text-white transition-colors duration-150 bg-purple-600 border border-r-0 border-purple-600 rounded-md focus:outline-none focus:shadow-outline-purple" | |
208 | + > | |
209 | + 3 | |
210 | + </button> | |
211 | + </li> | |
212 | + <li> | |
213 | + <button | |
214 | + class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" | |
215 | + > | |
216 | + 4 | |
217 | + </button> | |
218 | + </li> | |
219 | + <li> | |
220 | + <span class="px-3 py-1">...</span> | |
221 | + </li> | |
222 | + <li> | |
223 | + <button | |
224 | + class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" | |
225 | + > | |
226 | + 8 | |
227 | + </button> | |
228 | + </li> | |
229 | + <li> | |
230 | + <button | |
231 | + class="px-3 py-1 rounded-md focus:outline-none focus:shadow-outline-purple" | |
232 | + > | |
233 | + 9 | |
234 | + </button> | |
235 | + </li> | |
236 | + <li> | |
237 | + <button | |
238 | + class="px-3 py-1 rounded-md rounded-r-lg focus:outline-none focus:shadow-outline-purple" | |
239 | + aria-label="Next" | |
240 | + > | |
241 | + <svg | |
242 | + class="w-4 h-4 fill-current" | |
243 | + aria-hidden="true" | |
244 | + viewBox="0 0 20 20" | |
245 | + > | |
246 | + <path | |
247 | + d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" | |
248 | + clip-rule="evenodd" | |
249 | + fill-rule="evenodd" | |
250 | + ></path> | |
251 | + </svg> | |
252 | + </button> | |
253 | + </li> | |
254 | + </ul> | |
255 | + </nav> | |
256 | + </span> | |
257 | + </div>--> | |
258 | + </div> | |
259 | + | |
260 | + <?//=$users->appends($_GET)->links('catalogs.paginate'); ?> | |
261 | + | |
262 | + | |
263 | +@endsection |
resources/views/admin/users/index_bd_ajax.blade.php
... | ... | @@ -0,0 +1,86 @@ |
1 | + <div class="w-full overflow-x-auto"> | |
2 | + <table class="w-full whitespace-no-wrap"> | |
3 | + <thead> | |
4 | + <tr | |
5 | + class="text-xs font-semibold tracking-wide text-left text-gray-500 uppercase border-b dark:border-gray-700 bg-gray-50 dark:text-gray-400 dark:bg-gray-800" | |
6 | + > | |
7 | + <th class="px-4 py-3">№</th> | |
8 | + <th class="px-4 py-3">Имя</th> | |
9 | + <th class="px-4 py-3">Email/логин</th> | |
10 | + <th class="px-4 py-3">Статус</th> | |
11 | + <th class="px-4 py-3">Дата регистрации</th> | |
12 | + </tr> | |
13 | + </thead> | |
14 | + <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> | |
15 | + @foreach($users as $user) | |
16 | + <tr class="text-gray-700 dark:text-gray-400"> | |
17 | + <td class="px-4 py-3"> | |
18 | + {{$user->id}} | |
19 | + </td> | |
20 | + <td class="px-4 py-3"> | |
21 | + <!--<div class="flex items-center text-sm"> | |
22 | + <div class="relative hidden w-8 h-8 mr-3 rounded-full md:block"> | |
23 | + <div | |
24 | + class="absolute inset-0 rounded-full shadow-inner" | |
25 | + aria-hidden="true" | |
26 | + ></div> | |
27 | + </div> | |
28 | + <div> | |
29 | + <p class="font-semibold"><a href="{{ route('admin.users') }}">Пользователи</a></p> | |
30 | + <p class="text-xs text-gray-600 dark:text-gray-400"> | |
31 | + Все пользователи сайта | |
32 | + </p> | |
33 | + </div> | |
34 | + </div> | |
35 | + --> | |
36 | + <a style="text-decoration: underline;" href="{{ route('admin.user-profile', ['user' => $user->id]) }}">{{ $user->name }}</a> | |
37 | + </td> | |
38 | + <td class="px-4 py-3"> | |
39 | + <div class="flex items-center text-sm"> | |
40 | + <!--<div class="relative hidden w-8 h-8 mr-3 rounded-full md:block"> | |
41 | + <div | |
42 | + class="absolute inset-0 rounded-full shadow-inner" | |
43 | + aria-hidden="true" | |
44 | + ></div> | |
45 | + </div>--> | |
46 | + <div> | |
47 | + <p class="font-semibold">{{ empty($user->employers->email) ? $user->email : $user->employers->email }}</p> | |
48 | + <p class="text-xs text-gray-600 dark:text-gray-400"> | |
49 | + {{ empty($user->employers->telephone) ? $user->telephone : $user->employers->telephone }} | |
50 | + </p> | |
51 | + </div> | |
52 | + </div> | |
53 | + </td> | |
54 | + <td class="px-4 py-3 text-xs"> | |
55 | + <span class="px-2 py-1 font-semibold leading-tight text-green-700 bg-green-100 rounded-full dark:bg-green-700 dark:text-green-100"> | |
56 | + @if ($user->is_worker) | |
57 | + Работник | |
58 | + @else | |
59 | + Работодатель | |
60 | + @endif | |
61 | + </span> | |
62 | + @if ($user->admin) | |
63 | + <span class="px-2 py-1 font-semibold leading-tight text-orange-700 bg-orange-100 rounded-full dark:text-white dark:bg-orange-600"> | |
64 | + Администратор | |
65 | + </span> | |
66 | + @endif | |
67 | + @if ($user->is_bd) | |
68 | + <span class="px-2 py-1 font-semibold leading-tight text-red-700 bg-red-100 rounded-full dark:text-red-100 dark:bg-red-700"> | |
69 | + База данных | |
70 | + </span> | |
71 | + @endif | |
72 | + </td> | |
73 | + | |
74 | + <td class="px-4 py-3 text-sm"> | |
75 | + {{ date('d.m.Y', strtotime($user->created_at)) }} | |
76 | + </td> | |
77 | + </tr> | |
78 | + @endforeach | |
79 | + </tbody> | |
80 | + </table> | |
81 | + </div> | |
82 | + | |
83 | + <div class="grid px-4 py-3 text-xs font-semibold tracking-wide text-gray-500 uppercase border-t dark:border-gray-700 bg-gray-50 sm:grid-cols-9 dark:text-gray-400 dark:bg-gray-800"> | |
84 | + <?//=$users->appends($_GET)->links('admin.pagginate'); ?> | |
85 | + <?=$users->links('admin.pagginate'); ?> | |
86 | + </div> |
resources/views/admin/worker/add.blade.php
... | ... | @@ -0,0 +1,369 @@ |
1 | +<?php | |
2 | +use Illuminate\Support\Facades\Storage; | |
3 | +?> | |
4 | +@extends('layout.admin', ['title' => 'Админка - Добавление резюме соискателя']) | |
5 | + | |
6 | +@section('content') | |
7 | + <form method="POST" action="{{ route('admin.worker-profile-store', ['user' => $user->id]) }}"> | |
8 | + @csrf | |
9 | + <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> | |
10 | + <div class="tabs"> | |
11 | + <input type="hidden" id="user_id" name="user_id" value="{{ $user->id }}"/> | |
12 | + <input type="radio" name="tab-btn" id="tab-btn-1" value="" checked> | |
13 | + <label for="tab-btn-1">Общие настройки</label> | |
14 | + <input type="radio" name="tab-btn" id="tab-btn-2" value=""> | |
15 | + <label for="tab-btn-2">Анкета</label> | |
16 | + <!--<input type="radio" name="tab-btn" id="tab-btn-3" value=""> | |
17 | + <label for="tab-btn-3">Вкладка 3</label>--> | |
18 | + <div id="content-1"> | |
19 | + <label class="block text-sm"> | |
20 | + <span class="text-gray-700 dark:text-gray-400">Должность соискателя</span> | |
21 | + <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"> | |
22 | + @foreach($job_titles as $job) | |
23 | + <option value="{{ $job->id }}" | |
24 | + >{{ $job->name }} ({{ $job->id }})</option> | |
25 | + @endforeach | |
26 | + </select> | |
27 | + @error('position_work') | |
28 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
29 | + {{ $message }} | |
30 | + </span> | |
31 | + @enderror | |
32 | + </label><br> | |
33 | + | |
34 | + <label class="block text-sm"> | |
35 | + <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Избранный кандидат </p> | |
36 | + <input type="hidden" name="favorite_user" value="0" /> | |
37 | + <input name="favorite_user" | |
38 | + 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 " | |
39 | + placeholder="" type="checkbox" value="1" | |
40 | + /><br> | |
41 | + | |
42 | + <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Срочный кандидат</p> | |
43 | + <input type="hidden" name="sroch_user" value="0" /> | |
44 | + <input name="sroch_user" id="sroch_user" | |
45 | + 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 " | |
46 | + placeholder="" type="checkbox" value="1" | |
47 | + /><br> | |
48 | + | |
49 | + </label> | |
50 | + | |
51 | + <label class="block text-sm"> | |
52 | + <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Анкета действительна до <span style="color:#333">{{ $time_end_anketa }}</span></p> | |
53 | + | |
54 | + </label><br> | |
55 | + </div> | |
56 | + <div id="content-2"> | |
57 | + <label class="block text-sm"> | |
58 | + <span class="text-gray-700 dark:text-gray-400">Email</span> | |
59 | + <input name="email" id="email" | |
60 | + 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" | |
61 | + placeholder="Почта" value="{{ old('email') ?? '' }}" | |
62 | + /> | |
63 | + @error('email') | |
64 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
65 | + {{ $message }} | |
66 | + </span> | |
67 | + @enderror | |
68 | + </label><br> | |
69 | + | |
70 | + <label class="block text-sm"> | |
71 | + <span class="text-gray-700 dark:text-gray-400">Телефон</span> | |
72 | + <input name="telephone" id="telephone" | |
73 | + 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" | |
74 | + placeholder="Телефон" value="{{ old('telephone') ?? '' }}" | |
75 | + /> | |
76 | + @error('telephone') | |
77 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
78 | + {{ $message }} | |
79 | + </span> | |
80 | + @enderror | |
81 | + </label><br> | |
82 | + | |
83 | + <label class="block text-sm"> | |
84 | + <span class="text-gray-700 dark:text-gray-400">Адрес</span> | |
85 | + <input name="address" id="address" | |
86 | + 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" | |
87 | + placeholder="Адрес" value="{{ old('address') ?? '' }}" | |
88 | + /> | |
89 | + @error('address') | |
90 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
91 | + {{ $message }} | |
92 | + </span> | |
93 | + @enderror | |
94 | + </label><br> | |
95 | + | |
96 | + <label class="block text-sm"> | |
97 | + <span class="text-gray-700 dark:text-gray-400">Город</span> | |
98 | + <input name="city" id="city" | |
99 | + 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" | |
100 | + placeholder="Город" value="{{ old('city') ?? '' }}" | |
101 | + /> | |
102 | + @error('city') | |
103 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
104 | + {{ $message }} | |
105 | + </span> | |
106 | + @enderror | |
107 | + </label><br> | |
108 | + | |
109 | + <label class="block text-sm"> | |
110 | + <span class="text-gray-700 dark:text-gray-400">Согласие на рассылку</span> | |
111 | + <input type="hidden" name="email_data" value="0" /> | |
112 | + <input name="email_data" id="email_data" checked | |
113 | + placeholder="" | |
114 | + type="checkbox" | |
115 | + value="1" | |
116 | + /> | |
117 | + </label> | |
118 | + | |
119 | + <label class="block mt-4 text-sm"> | |
120 | + <span class="text-gray-700 dark:text-gray-400">Об соискателе</span> | |
121 | + <textarea name="text" id="text" | |
122 | + 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" | |
123 | + rows="3" | |
124 | + placeholder="О соискателе" | |
125 | + >{{ old('text') ?? '' }}</textarea> | |
126 | + </label> | |
127 | + </div> | |
128 | + <div id="content-3"> | |
129 | + | |
130 | + </div> | |
131 | + </div><br> | |
132 | + | |
133 | + <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> | |
134 | + <div> | |
135 | + <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"> | |
136 | + Сохранить | |
137 | + </button> | |
138 | + <a href="{{ route('admin.basedata') }}" | |
139 | + 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" | |
140 | + style="display: -webkit-inline-box; height: 30px!important;" | |
141 | + >Назад</a> | |
142 | + </div> | |
143 | + </div> | |
144 | + </div> | |
145 | + </form> | |
146 | + <!-- | |
147 | + <label class="block mt-4 text-sm"> | |
148 | + <span class="text-gray-700 dark:text-gray-400"> | |
149 | + Requested Limit | |
150 | + </span> | |
151 | + <select | |
152 | + 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" | |
153 | + > | |
154 | + <option>$1,000</option> | |
155 | + <option>$5,000</option> | |
156 | + <option>$10,000</option> | |
157 | + <option>$25,000</option> | |
158 | + </select> | |
159 | + </label> | |
160 | + | |
161 | + <label class="block mt-4 text-sm"> | |
162 | + <span class="text-gray-700 dark:text-gray-400"> | |
163 | + Multiselect | |
164 | + </span> | |
165 | + <select | |
166 | + class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-multiselect focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" | |
167 | + multiple | |
168 | + > | |
169 | + <option>Option 1</option> | |
170 | + <option>Option 2</option> | |
171 | + <option>Option 3</option> | |
172 | + <option>Option 4</option> | |
173 | + <option>Option 5</option> | |
174 | + </select> | |
175 | + </label> | |
176 | + | |
177 | + <label class="block mt-4 text-sm"> | |
178 | + <span class="text-gray-700 dark:text-gray-400">Message</span> | |
179 | + <textarea | |
180 | + 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" | |
181 | + rows="3" | |
182 | + placeholder="Enter some long form content." | |
183 | + ></textarea> | |
184 | + </label> | |
185 | + | |
186 | + <div class="flex mt-6 text-sm"> | |
187 | + <label class="flex items-center dark:text-gray-400"> | |
188 | + <input | |
189 | + type="checkbox" | |
190 | + class="text-purple-600 form-checkbox focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" | |
191 | + /> | |
192 | + <span class="ml-2"> | |
193 | + I agree to the | |
194 | + <span class="underline">privacy policy</span> | |
195 | + </span> | |
196 | + </label> | |
197 | + </div> | |
198 | +</div> | |
199 | + | |
200 | +<!-- Validation inputs --> | |
201 | + <!--<h4 | |
202 | + class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300" | |
203 | + > | |
204 | + Validation | |
205 | + </h4> | |
206 | + <div | |
207 | + class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800" | |
208 | + > | |
209 | + <!-- Invalid input --> | |
210 | + <!--<label class="block text-sm"> | |
211 | + <span class="text-gray-700 dark:text-gray-400"> | |
212 | + Invalid input | |
213 | + </span> | |
214 | + <input | |
215 | + class="block w-full mt-1 text-sm border-red-600 dark:text-gray-300 dark:bg-gray-700 focus:border-red-400 focus:outline-none focus:shadow-outline-red form-input" | |
216 | + placeholder="Jane Doe" | |
217 | + /> | |
218 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
219 | + Your password is too short. | |
220 | + </span> | |
221 | + </label> | |
222 | + | |
223 | + <!-- Valid input --> | |
224 | + <!--<label class="block mt-4 text-sm"> | |
225 | + <span class="text-gray-700 dark:text-gray-400"> | |
226 | + Valid input | |
227 | + </span> | |
228 | + <input | |
229 | + class="block w-full mt-1 text-sm border-green-600 dark:text-gray-300 dark:bg-gray-700 focus:border-green-400 focus:outline-none focus:shadow-outline-green form-input" | |
230 | + placeholder="Jane Doe" | |
231 | + /> | |
232 | + <span class="text-xs text-green-600 dark:text-green-400"> | |
233 | + Your password is strong. | |
234 | + </span> | |
235 | + </label> | |
236 | + | |
237 | + <!-- Helper text --> | |
238 | + <!--<label class="block mt-4 text-sm"> | |
239 | + <span class="text-gray-700 dark:text-gray-400"> | |
240 | + Helper text | |
241 | + </span> | |
242 | + <input | |
243 | + class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input" | |
244 | + placeholder="Jane Doe" | |
245 | + /> | |
246 | + <span class="text-xs text-gray-600 dark:text-gray-400"> | |
247 | + Your password must be at least 6 characters long. | |
248 | + </span> | |
249 | + </label> | |
250 | +</div> | |
251 | + | |
252 | +<!-- Inputs with icons --> | |
253 | + <!--<h4 | |
254 | + class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300" | |
255 | + > | |
256 | + Icons | |
257 | + </h4> | |
258 | + <div | |
259 | + class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800" | |
260 | + > | |
261 | + <label class="block text-sm"> | |
262 | + <span class="text-gray-700 dark:text-gray-400">Icon left</span> | |
263 | + <!-- focus-within sets the color for the icon when input is focused --> | |
264 | + <!--<div | |
265 | + class="relative text-gray-500 focus-within:text-purple-600 dark:focus-within:text-purple-400" | |
266 | + > | |
267 | + <input | |
268 | + class="block w-full pl-10 mt-1 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input" | |
269 | + placeholder="Jane Doe" | |
270 | + /> | |
271 | + <div | |
272 | + class="absolute inset-y-0 flex items-center ml-3 pointer-events-none" | |
273 | + > | |
274 | + <svg | |
275 | + class="w-5 h-5" | |
276 | + aria-hidden="true" | |
277 | + fill="none" | |
278 | + stroke-linecap="round" | |
279 | + stroke-linejoin="round" | |
280 | + stroke-width="2" | |
281 | + viewBox="0 0 24 24" | |
282 | + stroke="currentColor" | |
283 | + > | |
284 | + <path | |
285 | + d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" | |
286 | + ></path> | |
287 | + </svg> | |
288 | + </div> | |
289 | + </div> | |
290 | +</label> | |
291 | + | |
292 | +<label class="block mt-4 text-sm"> | |
293 | + <span class="text-gray-700 dark:text-gray-400">Icon right</span> | |
294 | + <!-- focus-within sets the color for the icon when input is focused --> | |
295 | + <!--<div | |
296 | + class="relative text-gray-500 focus-within:text-purple-600 dark:focus-within:text-purple-400" | |
297 | + > | |
298 | + <input | |
299 | + class="block w-full pr-10 mt-1 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input" | |
300 | + placeholder="Jane Doe" | |
301 | + /> | |
302 | + <div | |
303 | + class="absolute inset-y-0 right-0 flex items-center mr-3 pointer-events-none" | |
304 | + > | |
305 | + <svg | |
306 | + class="w-5 h-5" | |
307 | + aria-hidden="true" | |
308 | + fill="none" | |
309 | + stroke-linecap="round" | |
310 | + stroke-linejoin="round" | |
311 | + stroke-width="2" | |
312 | + viewBox="0 0 24 24" | |
313 | + stroke="currentColor" | |
314 | + > | |
315 | + <path | |
316 | + d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" | |
317 | + ></path> | |
318 | + </svg> | |
319 | + </div> | |
320 | + </div> | |
321 | +</label> | |
322 | +</div> | |
323 | + | |
324 | +<!-- Inputs with buttons --> | |
325 | + <!--<h4 | |
326 | + class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300" | |
327 | + > | |
328 | + Buttons | |
329 | + </h4> | |
330 | + <div | |
331 | + class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800" | |
332 | + > | |
333 | + <label class="block text-sm"> | |
334 | + <span class="text-gray-700 dark:text-gray-400"> | |
335 | + Button left | |
336 | + </span> | |
337 | + <div class="relative"> | |
338 | + <input | |
339 | + class="block w-full pl-20 mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input" | |
340 | + placeholder="Jane Doe" | |
341 | + /> | |
342 | + <button | |
343 | + class="absolute inset-y-0 px-4 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-l-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" | |
344 | + > | |
345 | + Click | |
346 | + </button> | |
347 | + </div> | |
348 | + </label> | |
349 | + | |
350 | + <label class="block mt-4 text-sm"> | |
351 | + <span class="text-gray-700 dark:text-gray-400"> | |
352 | + Button right | |
353 | + </span> | |
354 | + <div | |
355 | + class="relative text-gray-500 focus-within:text-purple-600" | |
356 | + > | |
357 | + <input | |
358 | + class="block w-full pr-20 mt-1 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input" | |
359 | + placeholder="Jane Doe" | |
360 | + /> | |
361 | + <button | |
362 | + class="absolute inset-y-0 right-0 px-4 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-r-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" | |
363 | + > | |
364 | + Click | |
365 | + </button> | |
366 | + </div> | |
367 | + </label> | |
368 | + </div>--> | |
369 | +@endsection |
resources/views/admin/worker/edit_bd.blade.php
... | ... | @@ -0,0 +1,391 @@ |
1 | +<?php | |
2 | +use Illuminate\Support\Facades\Storage; | |
3 | +?> | |
4 | +@extends('layout.admin', ['title' => 'Админка - Редактирование соискателя']) | |
5 | + | |
6 | +@section('content') | |
7 | + <h4 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"> | |
8 | + Соискатель-пользователь: {{$worker->users->surname}} {{$worker->users->name_man}} {{$worker->users->surname2}} ({{$worker->user_id}})"</a> | |
9 | + </h4> | |
10 | + <form method="POST" action=""> | |
11 | + @csrf | |
12 | + <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> | |
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> | |
38 | + | |
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> | |
46 | + | |
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> | |
53 | + | |
54 | + </label> | |
55 | + | |
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> | |
58 | + | |
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> | |
74 | + | |
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> | |
87 | + | |
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> | |
113 | + | |
114 | + <label class="block text-sm"> | |
115 | + <span class="text-gray-700 dark:text-gray-400">Фото</span> | |
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> | |
154 | + | |
155 | + <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> | |
156 | + <div> | |
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"> | |
158 | + Сохранить | |
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> | |
164 | + </div> | |
165 | + </div> | |
166 | + </div> | |
167 | + </form> | |
168 | + <!-- | |
169 | + <label class="block mt-4 text-sm"> | |
170 | + <span class="text-gray-700 dark:text-gray-400"> | |
171 | + Requested Limit | |
172 | + </span> | |
173 | + <select | |
174 | + 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" | |
175 | + > | |
176 | + <option>$1,000</option> | |
177 | + <option>$5,000</option> | |
178 | + <option>$10,000</option> | |
179 | + <option>$25,000</option> | |
180 | + </select> | |
181 | + </label> | |
182 | + | |
183 | + <label class="block mt-4 text-sm"> | |
184 | + <span class="text-gray-700 dark:text-gray-400"> | |
185 | + Multiselect | |
186 | + </span> | |
187 | + <select | |
188 | + class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-multiselect focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" | |
189 | + multiple | |
190 | + > | |
191 | + <option>Option 1</option> | |
192 | + <option>Option 2</option> | |
193 | + <option>Option 3</option> | |
194 | + <option>Option 4</option> | |
195 | + <option>Option 5</option> | |
196 | + </select> | |
197 | + </label> | |
198 | + | |
199 | + <label class="block mt-4 text-sm"> | |
200 | + <span class="text-gray-700 dark:text-gray-400">Message</span> | |
201 | + <textarea | |
202 | + 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" | |
203 | + rows="3" | |
204 | + placeholder="Enter some long form content." | |
205 | + ></textarea> | |
206 | + </label> | |
207 | + | |
208 | + <div class="flex mt-6 text-sm"> | |
209 | + <label class="flex items-center dark:text-gray-400"> | |
210 | + <input | |
211 | + type="checkbox" | |
212 | + class="text-purple-600 form-checkbox focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" | |
213 | + /> | |
214 | + <span class="ml-2"> | |
215 | + I agree to the | |
216 | + <span class="underline">privacy policy</span> | |
217 | + </span> | |
218 | + </label> | |
219 | + </div> | |
220 | +</div> | |
221 | + | |
222 | +<!-- Validation inputs --> | |
223 | + <!--<h4 | |
224 | + class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300" | |
225 | + > | |
226 | + Validation | |
227 | + </h4> | |
228 | + <div | |
229 | + class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800" | |
230 | + > | |
231 | + <!-- Invalid input --> | |
232 | + <!--<label class="block text-sm"> | |
233 | + <span class="text-gray-700 dark:text-gray-400"> | |
234 | + Invalid input | |
235 | + </span> | |
236 | + <input | |
237 | + class="block w-full mt-1 text-sm border-red-600 dark:text-gray-300 dark:bg-gray-700 focus:border-red-400 focus:outline-none focus:shadow-outline-red form-input" | |
238 | + placeholder="Jane Doe" | |
239 | + /> | |
240 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
241 | + Your password is too short. | |
242 | + </span> | |
243 | + </label> | |
244 | + | |
245 | + <!-- Valid input --> | |
246 | + <!--<label class="block mt-4 text-sm"> | |
247 | + <span class="text-gray-700 dark:text-gray-400"> | |
248 | + Valid input | |
249 | + </span> | |
250 | + <input | |
251 | + class="block w-full mt-1 text-sm border-green-600 dark:text-gray-300 dark:bg-gray-700 focus:border-green-400 focus:outline-none focus:shadow-outline-green form-input" | |
252 | + placeholder="Jane Doe" | |
253 | + /> | |
254 | + <span class="text-xs text-green-600 dark:text-green-400"> | |
255 | + Your password is strong. | |
256 | + </span> | |
257 | + </label> | |
258 | + | |
259 | + <!-- Helper text --> | |
260 | + <!--<label class="block mt-4 text-sm"> | |
261 | + <span class="text-gray-700 dark:text-gray-400"> | |
262 | + Helper text | |
263 | + </span> | |
264 | + <input | |
265 | + class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input" | |
266 | + placeholder="Jane Doe" | |
267 | + /> | |
268 | + <span class="text-xs text-gray-600 dark:text-gray-400"> | |
269 | + Your password must be at least 6 characters long. | |
270 | + </span> | |
271 | + </label> | |
272 | +</div> | |
273 | + | |
274 | +<!-- Inputs with icons --> | |
275 | + <!--<h4 | |
276 | + class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300" | |
277 | + > | |
278 | + Icons | |
279 | + </h4> | |
280 | + <div | |
281 | + class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800" | |
282 | + > | |
283 | + <label class="block text-sm"> | |
284 | + <span class="text-gray-700 dark:text-gray-400">Icon left</span> | |
285 | + <!-- focus-within sets the color for the icon when input is focused --> | |
286 | + <!--<div | |
287 | + class="relative text-gray-500 focus-within:text-purple-600 dark:focus-within:text-purple-400" | |
288 | + > | |
289 | + <input | |
290 | + class="block w-full pl-10 mt-1 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input" | |
291 | + placeholder="Jane Doe" | |
292 | + /> | |
293 | + <div | |
294 | + class="absolute inset-y-0 flex items-center ml-3 pointer-events-none" | |
295 | + > | |
296 | + <svg | |
297 | + class="w-5 h-5" | |
298 | + aria-hidden="true" | |
299 | + fill="none" | |
300 | + stroke-linecap="round" | |
301 | + stroke-linejoin="round" | |
302 | + stroke-width="2" | |
303 | + viewBox="0 0 24 24" | |
304 | + stroke="currentColor" | |
305 | + > | |
306 | + <path | |
307 | + d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" | |
308 | + ></path> | |
309 | + </svg> | |
310 | + </div> | |
311 | + </div> | |
312 | +</label> | |
313 | + | |
314 | +<label class="block mt-4 text-sm"> | |
315 | + <span class="text-gray-700 dark:text-gray-400">Icon right</span> | |
316 | + <!-- focus-within sets the color for the icon when input is focused --> | |
317 | + <!--<div | |
318 | + class="relative text-gray-500 focus-within:text-purple-600 dark:focus-within:text-purple-400" | |
319 | + > | |
320 | + <input | |
321 | + class="block w-full pr-10 mt-1 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input" | |
322 | + placeholder="Jane Doe" | |
323 | + /> | |
324 | + <div | |
325 | + class="absolute inset-y-0 right-0 flex items-center mr-3 pointer-events-none" | |
326 | + > | |
327 | + <svg | |
328 | + class="w-5 h-5" | |
329 | + aria-hidden="true" | |
330 | + fill="none" | |
331 | + stroke-linecap="round" | |
332 | + stroke-linejoin="round" | |
333 | + stroke-width="2" | |
334 | + viewBox="0 0 24 24" | |
335 | + stroke="currentColor" | |
336 | + > | |
337 | + <path | |
338 | + d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" | |
339 | + ></path> | |
340 | + </svg> | |
341 | + </div> | |
342 | + </div> | |
343 | +</label> | |
344 | +</div> | |
345 | + | |
346 | +<!-- Inputs with buttons --> | |
347 | + <!--<h4 | |
348 | + class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300" | |
349 | + > | |
350 | + Buttons | |
351 | + </h4> | |
352 | + <div | |
353 | + class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800" | |
354 | + > | |
355 | + <label class="block text-sm"> | |
356 | + <span class="text-gray-700 dark:text-gray-400"> | |
357 | + Button left | |
358 | + </span> | |
359 | + <div class="relative"> | |
360 | + <input | |
361 | + class="block w-full pl-20 mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input" | |
362 | + placeholder="Jane Doe" | |
363 | + /> | |
364 | + <button | |
365 | + class="absolute inset-y-0 px-4 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-l-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" | |
366 | + > | |
367 | + Click | |
368 | + </button> | |
369 | + </div> | |
370 | + </label> | |
371 | + | |
372 | + <label class="block mt-4 text-sm"> | |
373 | + <span class="text-gray-700 dark:text-gray-400"> | |
374 | + Button right | |
375 | + </span> | |
376 | + <div | |
377 | + class="relative text-gray-500 focus-within:text-purple-600" | |
378 | + > | |
379 | + <input | |
380 | + class="block w-full pr-20 mt-1 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input" | |
381 | + placeholder="Jane Doe" | |
382 | + /> | |
383 | + <button | |
384 | + class="absolute inset-y-0 right-0 px-4 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-r-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" | |
385 | + > | |
386 | + Click | |
387 | + </button> | |
388 | + </div> | |
389 | + </label> | |
390 | + </div>--> | |
391 | +@endsection |
resources/views/layout/admin.blade.php
... | ... | @@ -192,6 +192,27 @@ |
192 | 192 | <span class="ml-4">Сообщения все</span> |
193 | 193 | </a> |
194 | 194 | </li> |
195 | + | |
196 | + <li class="relative px-6 py-3"> | |
197 | + <a | |
198 | + class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200 {{ Request::routeIs('admin.admin-messages') ? 'dark:text-gray-100' : null }}" href="{{ route('admin.admin-messages') }}" | |
199 | + > | |
200 | + <svg | |
201 | + class="w-5 h-5" | |
202 | + aria-hidden="true" | |
203 | + fill="none" | |
204 | + stroke-linecap="round" | |
205 | + stroke-linejoin="round" | |
206 | + stroke-width="2" | |
207 | + viewBox="0 0 24 24" | |
208 | + stroke="currentColor" | |
209 | + > | |
210 | + <path d="M4 6h16M4 10h16M4 14h16M4 18h16"></path> | |
211 | + </svg> | |
212 | + <span class="ml-4">Заявки на рассылку</span> | |
213 | + </a> | |
214 | + </li> | |
215 | + | |
195 | 216 | <li class="relative px-6 py-3"> |
196 | 217 | <a |
197 | 218 | class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200 {{ Request::routeIs('admin.groups') ? 'dark:text-gray-100' : null }}" href="{{ route('admin.groups') }}" |
... | ... | @@ -235,6 +256,26 @@ |
235 | 256 | </li> |
236 | 257 | @endif |
237 | 258 | <li class="relative px-6 py-3"> |
259 | + <a | |
260 | + class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200 {{ Request::routeIs('admin.basedata') ? 'dark:text-gray-100' : null }}" href="{{ route('admin.basedata') }}" | |
261 | + > | |
262 | + <svg | |
263 | + class="w-5 h-5" | |
264 | + aria-hidden="true" | |
265 | + fill="none" | |
266 | + stroke-linecap="round" | |
267 | + stroke-linejoin="round" | |
268 | + stroke-width="2" | |
269 | + viewBox="0 0 24 24" | |
270 | + stroke="currentColor" | |
271 | + > | |
272 | + <path d="M4 6h16M4 10h16M4 14h16M4 18h16"></path> | |
273 | + </svg> | |
274 | + <span class="ml-4">Базы данных</span> | |
275 | + </a> | |
276 | + </li> | |
277 | + | |
278 | + <li class="relative px-6 py-3"> | |
238 | 279 | <a |
239 | 280 | class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200 {{ Request::routeIs('admin.education.index') ? 'dark:text-gray-100' : null }}" href="{{ route('admin.education.index') }}" |
240 | 281 | > |
... | ... | @@ -255,6 +296,7 @@ |
255 | 296 | <span class="ml-4">Учебн.заведения</span> |
256 | 297 | </a> |
257 | 298 | </li> |
299 | + | |
258 | 300 | <li class="relative px-6 py-3"> |
259 | 301 | <a |
260 | 302 | class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200 {{ Request::routeIs('admin.statics') ? 'dark:text-gray-100' : null }}" href="{{ route('admin.statics') }}" |
... | ... | @@ -646,7 +688,29 @@ |
646 | 688 | <span class="ml-4">Сообщения все</span> |
647 | 689 | </a> |
648 | 690 | </li> |
691 | + | |
649 | 692 | <li class="relative px-6 py-3"> |
693 | + <a | |
694 | + class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200 {{ Request::routeIs('admin.admin-messages') ? 'dark:text-gray-100' : null }}" href="{{ route('admin.admin-messages') }}" | |
695 | + > | |
696 | + <svg | |
697 | + class="w-5 h-5" | |
698 | + aria-hidden="true" | |
699 | + fill="none" | |
700 | + stroke-linecap="round" | |
701 | + stroke-linejoin="round" | |
702 | + stroke-width="2" | |
703 | + viewBox="0 0 24 24" | |
704 | + stroke="currentColor" | |
705 | + > | |
706 | + <path d="M4 6h16M4 10h16M4 14h16M4 18h16"></path> | |
707 | + </svg> | |
708 | + <span class="ml-4">Заявки на рассылку</span> | |
709 | + </a> | |
710 | + </li> | |
711 | + | |
712 | + | |
713 | + <li class="relative px-6 py-3"> | |
650 | 714 | <a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200 {{ Request::routeIs('admin.groups') ? 'dark:text-gray-100' : null }}" href="{{ route('admin.groups') }}"> |
651 | 715 | <svg |
652 | 716 | class="w-5 h-5" |
... | ... | @@ -686,6 +750,27 @@ |
686 | 750 | </a> |
687 | 751 | </li> |
688 | 752 | @endif |
753 | + | |
754 | + <li class="relative px-6 py-3"> | |
755 | + <a | |
756 | + class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200 {{ Request::routeIs('admin.basedata') ? 'dark:text-gray-100' : null }}" href="{{ route('admin.basedata') }}" | |
757 | + > | |
758 | + <svg | |
759 | + class="w-5 h-5" | |
760 | + aria-hidden="true" | |
761 | + fill="none" | |
762 | + stroke-linecap="round" | |
763 | + stroke-linejoin="round" | |
764 | + stroke-width="2" | |
765 | + viewBox="0 0 24 24" | |
766 | + stroke="currentColor" | |
767 | + > | |
768 | + <path d="M4 6h16M4 10h16M4 14h16M4 18h16"></path> | |
769 | + </svg> | |
770 | + <span class="ml-4">Базы данных</span> | |
771 | + </a> | |
772 | + </li> | |
773 | + | |
689 | 774 | <li class="relative px-6 py-3"> |
690 | 775 | <a |
691 | 776 | class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200 {{ Request::routeIs('admin.education.index') ? 'dark:text-gray-100' : null }}" href="{{ route('admin.education.index') }}" |
... | ... | @@ -832,7 +917,6 @@ |
832 | 917 | </template> |
833 | 918 | </li> |
834 | 919 | |
835 | - | |
836 | 920 | <!-- Редактор --> |
837 | 921 | <li class="relative px-6 py-3"> |
838 | 922 | <button |
routes/web.php
... | ... | @@ -164,6 +164,8 @@ Route::group([ |
164 | 164 | Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); |
165 | 165 | |
166 | 166 | // кабинет профиль работник - форма |
167 | + Route::get('worker-profile/add/{user}', [WorkersController::class, 'form_add_worker'])->name('worker-profile-add'); | |
168 | + Route::post('worker-profile/add/{user}', [WorkersController::class, 'form_store_worker'])->name('worker-profile-store'); | |
167 | 169 | Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); |
168 | 170 | // кабинет профиль работник - сохранение формы |
169 | 171 | Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); |
... | ... | @@ -186,6 +188,15 @@ Route::group([ |
186 | 188 | // кабинет - соискатели |
187 | 189 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); |
188 | 190 | |
191 | + // кабинет - база данных | |
192 | + Route::get('basedata', [UsersController::class, 'index_bd'])->name('basedata'); | |
193 | + Route::get('basedata/add', [UsersController::class, 'add_bd'])->name('add-basedata'); | |
194 | + Route::post('basedata/add', [UsersController::class, 'add_store_bd'])->name('add-store-basedata'); | |
195 | + Route::get('basedata/edit/{user}', [UsersController::class, 'edit_bd'])->name('edit-basedata'); | |
196 | + Route::put('basedata/edit/{user}', [UsersController::class, 'update_bd'])->name('update-basedata'); | |
197 | + Route::delete('basedata/delete/{user}', [UsersController::class, 'destroy_bd'])->name('delete-basedata'); | |
198 | + Route::get('basedata/doc/{user}', [UsersController::class, 'doc_bd'])->name('doc-basedata'); | |
199 | + | |
189 | 200 | // кабинет - вакансии |
190 | 201 | Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); |
191 | 202 | Route::get('ad-employers/edit/{ad_employer}', [Ad_EmployersController::class, 'edit'])->name('edit-ad-employers'); |