Commit 01e6816d2631836a9ac4393558aefaa1d707a00f
1 parent
e4220ec543
Exists in
master
and in
1 other branch
Добавление модели образование, справочник образование, соискатели, работодатели
Showing 21 changed files with 366 additions and 43 deletions Side-by-side Diff
- app/Http/Controllers/Admin/EducationController.php
- app/Http/Requests/EducationRequest.php
- app/Models/Education.php
- database/migrations/2023_10_10_094144_alter_table_education.php
- html/public/modals.html
- resources/views/admin/ad_employers/index.blade.php
- resources/views/admin/education/add.blade.php
- resources/views/admin/education/edit.blade.php
- resources/views/admin/education/form.blade.php
- resources/views/admin/education/index.blade.php
- resources/views/admin/employer/index.blade.php
- resources/views/admin/employer/index_ajax.blade.php
- resources/views/admin/employer/modal.blade.php
- resources/views/admin/message/index.blade.php
- resources/views/admin/message/index_ajax.blade.php
- resources/views/admin/users/index.blade.php
- resources/views/admin/users/index_ajax.blade.php
- resources/views/admin/worker/index.blade.php
- resources/views/admin/worker/index_ajax.blade.php
- resources/views/layout/admin.blade.php
- routes/web.php
app/Http/Controllers/Admin/EducationController.php
... | ... | @@ -6,6 +6,7 @@ use App\Http\Controllers\Controller; |
6 | 6 | use App\Http\Requests\EducationRequest; |
7 | 7 | use App\Models\Education; |
8 | 8 | use Illuminate\Http\Request; |
9 | +use Illuminate\Support\Facades\Storage; | |
9 | 10 | |
10 | 11 | class EducationController extends Controller |
11 | 12 | { |
... | ... | @@ -38,7 +39,13 @@ class EducationController extends Controller |
38 | 39 | */ |
39 | 40 | public function store(EducationRequest $request) |
40 | 41 | { |
41 | - Education::create($request->all()); | |
42 | + $params = $request->all(); | |
43 | + if ($request->has('image')) { | |
44 | + $params['image'] = $request->file('image')->store("education", 'public'); | |
45 | + } | |
46 | + Education::create($params); | |
47 | + | |
48 | + | |
42 | 49 | return redirect()->route('admin.education.index'); |
43 | 50 | } |
44 | 51 | |
... | ... | @@ -61,6 +68,7 @@ class EducationController extends Controller |
61 | 68 | */ |
62 | 69 | public function edit(Education $education) |
63 | 70 | { |
71 | + | |
64 | 72 | return view('admin.education.edit', compact('education')); |
65 | 73 | } |
66 | 74 | |
... | ... | @@ -73,7 +81,15 @@ class EducationController extends Controller |
73 | 81 | */ |
74 | 82 | public function update(EducationRequest $request, Education $education) |
75 | 83 | { |
76 | - $education->update($request->all()); | |
84 | + $params = $request->all(); | |
85 | + if ($request->has('image')) { | |
86 | + if (!empty($education->image)) { | |
87 | + Storage::delete($education->image); | |
88 | + } | |
89 | + $params['image'] = $request->file('image')->store("education", 'public'); | |
90 | + } | |
91 | + | |
92 | + $education->update($params); | |
77 | 93 | return redirect()->route('admin.education.index'); |
78 | 94 | } |
79 | 95 |
app/Http/Requests/EducationRequest.php
... | ... | @@ -25,6 +25,11 @@ class EducationRequest extends FormRequest |
25 | 25 | { |
26 | 26 | return [ |
27 | 27 | 'name' => 'required|min:3|max:255', |
28 | + 'email' => 'required|email|min:5', | |
29 | + 'image' => [ | |
30 | + 'mimes:jpeg,jpg,png', | |
31 | + 'max:10000' | |
32 | + ], | |
28 | 33 | ]; |
29 | 34 | } |
30 | 35 | |
... | ... | @@ -39,6 +44,7 @@ class EducationRequest extends FormRequest |
39 | 44 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
40 | 45 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
41 | 46 | ], |
47 | + 'email' => 'Введите корректный емайл' | |
42 | 48 | |
43 | 49 | ]; |
44 | 50 | } |
app/Models/Education.php
database/migrations/2023_10_10_094144_alter_table_education.php
... | ... | @@ -0,0 +1,40 @@ |
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('education', function (Blueprint $table) { | |
17 | + $table->string('address', 255)->nullable(); | |
18 | + $table->string('telephone', 255)->nullable(); | |
19 | + $table->string('email', 255)->nullable(); | |
20 | + $table->text('text')->nullable(); | |
21 | + $table->string('image', 255)->nullable(); | |
22 | + }); | |
23 | + } | |
24 | + | |
25 | + /** | |
26 | + * Reverse the migrations. | |
27 | + * | |
28 | + * @return void | |
29 | + */ | |
30 | + public function down() | |
31 | + { | |
32 | + Schema::table('education', function (Blueprint $table) { | |
33 | + $table->dropColumn('address'); | |
34 | + $table->dropColumn('telephone'); | |
35 | + $table->dropColumn('email'); | |
36 | + $table->dropColumn('text'); | |
37 | + $table->dropColumn('image'); | |
38 | + }); | |
39 | + } | |
40 | +}; |
html/public/modals.html
... | ... | @@ -872,17 +872,43 @@ |
872 | 872 | </div> |
873 | 873 | |
874 | 874 | <div> |
875 | - <button | |
876 | - @click="openModal" | |
877 | - class="px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" | |
875 | + <button id="i1" | |
876 | + @click="openModal" data-employer="1" data-user="20" | |
877 | + class="btn px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" | |
878 | + > | |
879 | + Open Modal1 | |
880 | + </button> | |
881 | + <button id="i2" | |
882 | + @click="openModal" data-employer="2" data-user="25" | |
883 | + class="btn px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" | |
884 | + > | |
885 | + Open Modal2 | |
886 | + </button> | |
887 | + <button id="i3" | |
888 | + @click="openModal" data-employer="3" data-user="30" | |
889 | + class="btn px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" | |
878 | 890 | > |
879 | - Open Modal | |
891 | + Open Modal3 | |
880 | 892 | </button> |
881 | 893 | </div> |
882 | 894 | </div> |
883 | 895 | </main> |
884 | 896 | </div> |
885 | 897 | </div> |
898 | + <script> | |
899 | + const btns = document.querySelectorAll('.btn'); | |
900 | + btns.forEach(btn => { | |
901 | + btn.addEventListener('click', (e) => { | |
902 | + const id = e.target.id; | |
903 | + let form = document.getElementById("form1"); | |
904 | + form.action = "https://link.ru/"+e.target.getAttribute('data-employer')+'/'+e.target.getAttribute('data-user'); | |
905 | + //document.getElementById("title_modal").innerHTML = id; | |
906 | + console.log(e.target.getAttribute('data-employer')); | |
907 | + console.log(e.target.getAttribute('data-user')); | |
908 | + console.log(id); | |
909 | + }); | |
910 | + }); | |
911 | + </script> | |
886 | 912 | <!-- Modal backdrop. This what you want to place close to the closing body tag --> |
887 | 913 | <div |
888 | 914 | x-show="isModalOpen" |
... | ... | @@ -934,7 +960,7 @@ |
934 | 960 | <!-- Modal body --> |
935 | 961 | <div class="mt-4 mb-6"> |
936 | 962 | <!-- Modal title --> |
937 | - <p | |
963 | + <p name="title_modal" id="title_modal" | |
938 | 964 | class="mb-2 text-lg font-semibold text-gray-700 dark:text-gray-300" |
939 | 965 | > |
940 | 966 | Modal header |
... | ... | @@ -954,11 +980,13 @@ |
954 | 980 | > |
955 | 981 | Cancel |
956 | 982 | </button> |
983 | + <form id="form1" name="form1" action="" method="POST"> | |
957 | 984 | <button |
958 | 985 | class="w-full px-5 py-3 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg sm:w-auto sm:px-4 sm:py-2 active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" |
959 | 986 | > |
960 | 987 | Accept |
961 | 988 | </button> |
989 | + </form> | |
962 | 990 | </footer> |
963 | 991 | </div> |
964 | 992 | </div> |
resources/views/admin/ad_employers/index.blade.php
... | ... | @@ -87,10 +87,10 @@ |
87 | 87 | {{ $ad->status }} |
88 | 88 | </td> |
89 | 89 | <td class="px-4 py-3 text-sm"> |
90 | - {{ $ad->created_at }} | |
90 | + {{ date('d.m.Y', strtotime($ad->created_at)) }} | |
91 | 91 | </td> |
92 | 92 | <td class="px-4 py-3 text-sm"> |
93 | - {{ $ad->updated_at }} | |
93 | + {{ date('d.m.Y', strtotime($ad->updated_at)) }} | |
94 | 94 | </td> |
95 | 95 | <td class="px-4 py-3 text-sm"> |
96 | 96 | <a href="{{ route('admin.edit-ad-employers', ['ad_employer' => $ad->id]) }}"> |
resources/views/admin/education/add.blade.php
1 | 1 | @extends('layout.admin', ['title' => 'Админка - Добавление образования']) |
2 | 2 | |
3 | 3 | @section('content') |
4 | - <form method="POST" action="{{ route('admin.education.store') }}"> | |
4 | + <form method="POST" action="{{ route('admin.education.store') }}" enctype="multipart/form-data"> | |
5 | 5 | @include('admin.education.form') |
6 | 6 | </form> |
7 | 7 | @endsection |
resources/views/admin/education/edit.blade.php
1 | 1 | @extends('layout.admin', ['title' => 'Админка - Редактирование образования']) |
2 | 2 | |
3 | 3 | @section('content') |
4 | - <form method="POST" action="{{ route('admin.education.update', ['education' => $education->id]) }}"> | |
4 | + <form method="POST" action="{{ route('admin.education.update', ['education' => $education->id]) }}" enctype="multipart/form-data"> | |
5 | 5 | @include('admin.education.form') |
6 | 6 | </form> |
7 | 7 | @endsection |
resources/views/admin/education/form.blade.php
... | ... | @@ -6,10 +6,10 @@ |
6 | 6 | |
7 | 7 | <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> |
8 | 8 | <label class="block text-sm"> |
9 | - <span class="text-gray-700 dark:text-gray-400">Имя категории</span> | |
9 | + <span class="text-gray-700 dark:text-gray-400">Название учебного заведения</span> | |
10 | 10 | <input name="name" id="name" |
11 | 11 | 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" |
12 | - placeholder="Имя категории" value="{{ old('name') ?? $education->name ?? '' }}" | |
12 | + placeholder="Название учебного заведения" value="{{ old('name') ?? $education->name ?? '' }}" | |
13 | 13 | /> |
14 | 14 | @error('name') |
15 | 15 | <span class="text-xs text-red-600 dark:text-red-400"> |
... | ... | @@ -18,6 +18,72 @@ |
18 | 18 | @enderror |
19 | 19 | </label><br> |
20 | 20 | |
21 | + <label class="block text-sm"> | |
22 | + <span class="text-gray-700 dark:text-gray-400">Адрес</span> | |
23 | + <input name="address" id="address" | |
24 | + 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" | |
25 | + placeholder="Адрес" value="{{ old('address') ?? $education->address ?? '' }}" | |
26 | + /> | |
27 | + @error('address') | |
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 | + <span class="text-gray-700 dark:text-gray-400">Email</span> | |
36 | + <input name="email" id="email" | |
37 | + 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" | |
38 | + placeholder="Email" value="{{ old('email') ?? $education->email ?? '' }}" | |
39 | + /> | |
40 | + @error('email') | |
41 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
42 | + {{ $message }} | |
43 | + </span> | |
44 | + @enderror | |
45 | + </label><br> | |
46 | + | |
47 | + <label class="block text-sm"> | |
48 | + <span class="text-gray-700 dark:text-gray-400">Телефон</span> | |
49 | + <input name="telephone" id="telephone" | |
50 | + 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" | |
51 | + placeholder="Телефон" value="{{ old('telephone') ?? $education->telephone ?? '' }}" | |
52 | + /> | |
53 | + @error('telephone') | |
54 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
55 | + {{ $message }} | |
56 | + </span> | |
57 | + @enderror | |
58 | + </label><br> | |
59 | + | |
60 | + <label class="block text-sm"> | |
61 | + <span class="text-gray-700 dark:text-gray-400">Текст</span> | |
62 | + <textarea class="form-control ckeditor" name="text" placeholder="Текст (html)" required | |
63 | + rows="10">{{ old('text') ?? $education->text ?? '' }}</textarea> | |
64 | + @error('text') | |
65 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
66 | + {{ $message }} | |
67 | + </span> | |
68 | + @enderror | |
69 | + </label><br> | |
70 | + | |
71 | + <label class="block text-sm"> | |
72 | + <span class="text-gray-700 dark:text-gray-400">Картинка</span> | |
73 | + <input type="file" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 | |
74 | + focus:border-purple-400 focus:outline-none focus:shadow-outline-purple | |
75 | + dark:text-gray-300 dark:focus:shadow-outline-gray form-input" | |
76 | + id="image" name="image" accept="image/png, image/jpeg"> | |
77 | + @error('image') | |
78 | + <span class="text-xs text-red-600 dark:text-red-400"> | |
79 | + {{ $message }} | |
80 | + </span> | |
81 | + @enderror | |
82 | + @isset($education->image) | |
83 | + <img src="{{asset(Storage::url($education->image))}}" width="100px"/> | |
84 | + @endisset | |
85 | + </label><br> | |
86 | + | |
21 | 87 | <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> |
22 | 88 | <div> |
23 | 89 | <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"> |
... | ... | @@ -30,3 +96,11 @@ |
30 | 96 | </div> |
31 | 97 | </div> |
32 | 98 | </div> |
99 | +<script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script> | |
100 | +<script> | |
101 | + CKEDITOR.replace( 'text', { | |
102 | + filebrowserUploadUrl: "{{route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", | |
103 | + filebrowserImageUploadUrl: "{{ route('ckeditor.image-upload', ['_token' => csrf_token() ])}}", | |
104 | + filebrowserUploadMethod: 'form' | |
105 | + }); | |
106 | +</script> |
resources/views/admin/education/index.blade.php
... | ... | @@ -24,8 +24,8 @@ |
24 | 24 | > |
25 | 25 | <th class="px-4 py-3">№</th> |
26 | 26 | <th class="px-4 py-3">Название образования</th> |
27 | - <th class="px-4 py-3">Дата создания</th> | |
28 | 27 | <th class="px-4 py-3">Редактировать</th> |
28 | + <th class="px-4 py-3">Дата создания</th> | |
29 | 29 | </tr> |
30 | 30 | </thead> |
31 | 31 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> |
... | ... | @@ -37,9 +37,7 @@ |
37 | 37 | <td class="px-4 py-3"> |
38 | 38 | {{$cat->name}} |
39 | 39 | </td> |
40 | - <td class="px-4 py-3"> | |
41 | - {{$cat->created_at}} | |
42 | - </td> | |
40 | + | |
43 | 41 | <td class="px-4 py-3 text-sm_"> |
44 | 42 | <form action="{{ route('admin.education.destroy', ['education' => $cat->id]) }}" method="POST"> |
45 | 43 | <a href="{{ route('admin.education.edit', ['education' => $cat->id]) }}">Изменить</a> | |
... | ... | @@ -48,6 +46,9 @@ |
48 | 46 | <input class="btn btn-danger" type="submit" value="Удалить"/> |
49 | 47 | </form> |
50 | 48 | </td> |
49 | + <td class="px-4 py-3"> | |
50 | + {{ date('d.m.Y', strtotime($cat->created_at))}} | |
51 | + </td> | |
51 | 52 | </tr> |
52 | 53 | @endforeach |
53 | 54 | </tbody> |
resources/views/admin/employer/index.blade.php
... | ... | @@ -36,12 +36,31 @@ |
36 | 36 | |
37 | 37 | }); |
38 | 38 | </script> |
39 | + <script> | |
40 | + const btns = document.querySelectorAll('.btn_del'); | |
41 | + btns.forEach(btn => { | |
42 | + btn.addEventListener('click', (e) => { | |
43 | + console.log('click button'); | |
44 | + const id = e.target.id; | |
45 | + let form = document.getElementById("form_modal_del"); | |
46 | + form.action = "<?=$_SERVER['HTTP_REFERER']?>/delete/"+e.target.getAttribute('data-employer')+'/'+e.target.getAttribute('data-user'); | |
47 | + //document.getElementById("title_modal").innerHTML = id; | |
48 | + console.log(e.target.getAttribute('data-employer')); | |
49 | + console.log(e.target.getAttribute('data-user')); | |
50 | + | |
51 | + }); | |
52 | + }); | |
53 | + </script> | |
39 | 54 | @endsection |
40 | 55 | |
41 | 56 | @section('search') |
42 | 57 | @include('admin.find_employer', ['select_category' => $select_category]) |
43 | 58 | @endsection |
44 | 59 | |
60 | +@section('modal') | |
61 | + @include('admin.employer.modal') | |
62 | +@endsection | |
63 | + | |
45 | 64 | @section('content') |
46 | 65 | <div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-4"> |
47 | 66 | |
... | ... | @@ -62,7 +81,9 @@ |
62 | 81 | </div> |
63 | 82 | </div> |
64 | 83 | </div> |
65 | - | |
84 | + <pre> | |
85 | + <?//print_r($_SERVER);?> | |
86 | + </pre> | |
66 | 87 | |
67 | 88 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> |
68 | 89 | <div class="w-full overflow-x-auto"> |
... | ... | @@ -110,19 +131,19 @@ |
110 | 131 | {{ $user->category }} |
111 | 132 | </td> |
112 | 133 | <td class="px-4 py-3 text-sm"> |
113 | - {{ $user->comment_admin }} | |
134 | + @if (!empty($user->comment_admin)) | |
135 | + Есть | |
136 | + @else | |
137 | + Нет | |
138 | + @endif | |
114 | 139 | </td> |
115 | 140 | <td class="px-4 py-3 text-sm"> |
116 | - {{ $user->created_at }} | |
141 | + {{ date('d.m.Y', strtotime($user->created_at)) }} | |
117 | 142 | </td> |
118 | 143 | <td class="px-4 py-3 text-sm"> |
119 | 144 | @if (!empty($user->emp_id)) |
120 | - <form action="{{ route('admin.delete-employer', ['employer' => $user->emp_id, 'user' => $user->user_id]) }}" method="POST"> | |
121 | 145 | <a href="{{ route('admin.employer-profile', ['employer' => $user->emp_id]) }}">Изменить</a> | |
122 | - @csrf | |
123 | - @method('DELETE') | |
124 | - <input class="btn btn-danger" type="submit" value="Удалить"/> | |
125 | - </form> | |
146 | + <a @click="openModal" style="cursor: pointer;" data-employer="{{$user->emp_id}}" data-user="{{$user->user_id}}" class="btn_del btn btn-danger">Удалить</a> | |
126 | 147 | @endif |
127 | 148 | </td> |
128 | 149 | <!--<td class="px-4 py-3 text-sm"> |
resources/views/admin/employer/index_ajax.blade.php
... | ... | @@ -7,10 +7,10 @@ |
7 | 7 | <th class="px-4 py-3">№</th> |
8 | 8 | <th class="px-4 py-3">Название компании</th> |
9 | 9 | <th class="px-4 py-3">Email/Телефон</th> |
10 | - <th class="px-4 py-3">Имя</th> | |
10 | + <th class="px-4 py-3">Категория</th> | |
11 | + <th class="px-4 py-3">Комментарий</th> | |
11 | 12 | <th class="px-4 py-3">Дата регистрации</th> |
12 | - <th class="px-4 py-3">Изменить</th> | |
13 | - <th class="px-4 py-3">Бан</th> | |
13 | + <th class="px-4 py-3">Редакт.</th> | |
14 | 14 | </tr> |
15 | 15 | </thead> |
16 | 16 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> |
... | ... | @@ -43,18 +43,19 @@ |
43 | 43 | {{ $user->name_man }} ({{ $user->usr_id }}) |
44 | 44 | </td> |
45 | 45 | <td class="px-4 py-3 text-sm"> |
46 | - {{ $user->created_at }} | |
46 | + {{ date('d.m.Y', strtotime($user->created_at)) }} | |
47 | 47 | </td> |
48 | 48 | <td class="px-4 py-3 text-sm"> |
49 | 49 | @if (!empty($user->emp_id)) |
50 | - <a href="{{ route('admin.employer-profile', ['employer' => $user->emp_id]) }}">Изменить</a> | |
50 | + <a href="{{ route('admin.employer-profile', ['employer' => $user->emp_id]) }}">Изменить</a> | | |
51 | + <a @click="openModal" style="cursor: pointer;" data-employer="{{$user->emp_id}}" data-user="{{$user->user_id}}" class="btn_del btn btn-danger">Удалить</a> | |
51 | 52 | @endif |
52 | 53 | </td> |
53 | - <td class="px-4 py-3 text-sm"> | |
54 | + <!--<td class="px-4 py-3 text-sm"> | |
54 | 55 | @if ($user->usr_id > 1) |
55 | 56 | <input type="checkbox" class="checkban" value="{{$user->usr_id}}" name="ban_{{$user->usr_id}}" {{ ($user->is_ban) ? "checked" : "" }}/> |
56 | 57 | @endif |
57 | - </td> | |
58 | + </td>--> | |
58 | 59 | </tr> |
59 | 60 | @endforeach |
60 | 61 | </tbody> |
resources/views/admin/employer/modal.blade.php
... | ... | @@ -0,0 +1,87 @@ |
1 | +<!-- Modal backdrop. This what you want to place close to the closing body tag --> | |
2 | +<div | |
3 | + x-show="isModalOpen" | |
4 | + x-transition:enter="transition ease-out duration-150" | |
5 | + x-transition:enter-start="opacity-0" | |
6 | + x-transition:enter-end="opacity-100" | |
7 | + x-transition:leave="transition ease-in duration-150" | |
8 | + x-transition:leave-start="opacity-100" | |
9 | + x-transition:leave-end="opacity-0" | |
10 | + class="fixed inset-0 z-30 flex items-end bg-black bg-opacity-50 sm:items-center sm:justify-center" | |
11 | +> | |
12 | + <!-- Modal --> | |
13 | + <div | |
14 | + x-show="isModalOpen" | |
15 | + x-transition:enter="transition ease-out duration-150" | |
16 | + x-transition:enter-start="opacity-0 transform translate-y-1/2" | |
17 | + x-transition:enter-end="opacity-100" | |
18 | + x-transition:leave="transition ease-in duration-150" | |
19 | + x-transition:leave-start="opacity-100" | |
20 | + x-transition:leave-end="opacity-0 transform translate-y-1/2" | |
21 | + @click.away="closeModal" | |
22 | + @keydown.escape="closeModal" | |
23 | + class="w-full px-6 py-4 overflow-hidden bg-white rounded-t-lg dark:bg-gray-800 sm:rounded-lg sm:m-4 sm:max-w-xl" | |
24 | + role="dialog" | |
25 | + id="modal" | |
26 | + > | |
27 | + <!-- Remove header if you don't want a close icon. Use modal body to place modal tile. --> | |
28 | + <header class="flex justify-end"> | |
29 | + <button | |
30 | + class="inline-flex items-center justify-center w-6 h-6 text-gray-400 transition-colors duration-150 rounded dark:hover:text-gray-200 hover: hover:text-gray-700" | |
31 | + aria-label="close" | |
32 | + @click="closeModal" | |
33 | + > | |
34 | + <svg | |
35 | + class="w-4 h-4" | |
36 | + fill="currentColor" | |
37 | + viewBox="0 0 20 20" | |
38 | + role="img" | |
39 | + aria-hidden="true" | |
40 | + > | |
41 | + <path | |
42 | + d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" | |
43 | + clip-rule="evenodd" | |
44 | + fill-rule="evenodd" | |
45 | + ></path> | |
46 | + </svg> | |
47 | + </button> | |
48 | + </header> | |
49 | + <!-- Modal body --> | |
50 | + <div class="mt-4 mb-6"> | |
51 | + <!-- Modal title --> | |
52 | + <p | |
53 | + class="mb-2 text-lg font-semibold text-gray-700 dark:text-gray-300" | |
54 | + > | |
55 | + Вы действительно хотите удалить данного работодателя? | |
56 | + </p> | |
57 | + <!-- Modal description --> | |
58 | + <p class="text-sm text-gray-700 dark:text-gray-400"> | |
59 | + Это приведет к удалению всей информации о работодателе<br> | |
60 | + и его вакансиях на данном проекте. | |
61 | + </p> | |
62 | + </div> | |
63 | + <footer | |
64 | + class="flex flex-col items-center justify-end px-6 py-3 -mx-6 -mb-4 space-y-4 sm:space-y-0 sm:space-x-6 sm:flex-row bg-gray-50 dark:bg-gray-800" | |
65 | + > | |
66 | + <button | |
67 | + @click="closeModal" | |
68 | + class="w-full px-5 py-3 text-sm font-medium leading-5 text-white text-gray-700 transition-colors duration-150 border border-gray-300 rounded-lg dark:text-gray-400 sm:px-4 sm:py-2 sm:w-auto active:bg-transparent hover:border-gray-500 focus:border-gray-500 active:text-gray-500 focus:outline-none focus:shadow-outline-gray" | |
69 | + > | |
70 | + Отмена | |
71 | + </button> | |
72 | + <form id="form_modal_del" name="form_modal_del" action="/employer-profile/delete/{employer}/{user}" method="POST"> | |
73 | + @csrf | |
74 | + @method('DELETE') | |
75 | + | |
76 | + <button | |
77 | + type="submit" | |
78 | + class="w-full px-5 py-3 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg sm:w-auto sm:px-4 sm:py-2 active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" | |
79 | + > | |
80 | + Удалить | |
81 | + </button> | |
82 | + </form> | |
83 | + | |
84 | + </footer> | |
85 | + </div> | |
86 | +</div> | |
87 | +<!-- End of modal backdrop --> |
resources/views/admin/message/index.blade.php
resources/views/admin/message/index_ajax.blade.php
resources/views/admin/users/index.blade.php
resources/views/admin/users/index_ajax.blade.php
resources/views/admin/worker/index.blade.php
resources/views/admin/worker/index_ajax.blade.php
... | ... | @@ -58,7 +58,7 @@ |
58 | 58 | @endif |
59 | 59 | </td> |
60 | 60 | <td class="px-4 py-3 text-sm"> |
61 | - {{ $user->created_at }} | |
61 | + {{ date('d.m.Y h:i:s', strtotime($user->created_at)) }} | |
62 | 62 | </td> |
63 | 63 | <td class="px-4 py-3 text-sm"> |
64 | 64 | @if ($user->id > 1) |
... | ... | @@ -68,11 +68,11 @@ |
68 | 68 | @endif |
69 | 69 | @endif |
70 | 70 | </td> |
71 | - <td class="px-4 py-3 text-sm"> | |
71 | + <!--<td class="px-4 py-3 text-sm"> | |
72 | 72 | @if ($user->id > 1) |
73 | 73 | <input type="checkbox" class="checkban" value="{{$user->id}}" name="ban_{{$user->id}}" {{ ($user->is_ban) ? "checked" : "" }}/> |
74 | 74 | @endif |
75 | - </td> | |
75 | + </td>--> | |
76 | 76 | </tr> |
77 | 77 | @endforeach |
78 | 78 | </tbody> |
resources/views/layout/admin.blade.php
... | ... | @@ -88,6 +88,27 @@ |
88 | 88 | </li> |
89 | 89 | @endif |
90 | 90 | <li class="relative px-6 py-3"> |
91 | + <a | |
92 | + 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-users') ? 'dark:text-gray-100' : null }}" href="{{ route('admin.admin-users') }}" | |
93 | + > | |
94 | + <svg | |
95 | + class="w-5 h-5" | |
96 | + aria-hidden="true" | |
97 | + fill="none" | |
98 | + stroke-linecap="round" | |
99 | + stroke-linejoin="round" | |
100 | + stroke-width="2" | |
101 | + viewBox="0 0 24 24" | |
102 | + stroke="currentColor" | |
103 | + > | |
104 | + <path | |
105 | + d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" | |
106 | + ></path> | |
107 | + </svg> | |
108 | + <span class="ml-4">Администраторы</span> | |
109 | + </a> | |
110 | + </li> | |
111 | + <li class="relative px-6 py-3"> | |
91 | 112 | <a |
92 | 113 | 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.employers') ? 'dark:text-gray-100' : null }}" href="{{ route('admin.employers') }}" |
93 | 114 | > |
... | ... | @@ -110,7 +131,7 @@ |
110 | 131 | </li> |
111 | 132 | <li class="relative px-6 py-3"> |
112 | 133 | <a |
113 | - 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.workers') ? 'dark:text-gray-100' : null }}" href="{{ route('admin.workers') }}" | |
134 | + 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.workers') ? 'dark:text-gray-100' : null }}" href="{{ route('admin.workers') }}" | |
114 | 135 | > |
115 | 136 | <svg |
116 | 137 | class="w-5 h-5" |
... | ... | @@ -484,6 +505,28 @@ |
484 | 505 | </li> |
485 | 506 | @endif |
486 | 507 | <li class="relative px-6 py-3"> |
508 | + <a | |
509 | + 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-users') ? 'dark:text-gray-100' : null }}" href="{{ route('admin.admin-users') }}" | |
510 | + > | |
511 | + <svg | |
512 | + class="w-5 h-5" | |
513 | + aria-hidden="true" | |
514 | + fill="none" | |
515 | + stroke-linecap="round" | |
516 | + stroke-linejoin="round" | |
517 | + stroke-width="2" | |
518 | + viewBox="0 0 24 24" | |
519 | + stroke="currentColor" | |
520 | + > | |
521 | + <path | |
522 | + d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" | |
523 | + ></path> | |
524 | + </svg> | |
525 | + <span class="ml-4">Администраторы</span> | |
526 | + </a> | |
527 | + </li> | |
528 | + | |
529 | + <li class="relative px-6 py-3"> | |
487 | 530 | <a |
488 | 531 | 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.employers') ? 'dark:text-gray-100' : null }}" href="{{ route('admin.employers') }}" |
489 | 532 | > |
... | ... | @@ -1746,6 +1789,7 @@ |
1746 | 1789 | </main> |
1747 | 1790 | </div> |
1748 | 1791 | </div> |
1792 | +@yield('modal') | |
1749 | 1793 | </body> |
1750 | 1794 | @yield('script') |
1751 | 1795 | </html> |
routes/web.php
... | ... | @@ -161,7 +161,7 @@ Route::group([ |
161 | 161 | // кабинет профиль работодатель - сохранение формы |
162 | 162 | Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); |
163 | 163 | // кабинет удаление профиль работодателя и юзера |
164 | - Route::delete('employer-profile/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); | |
164 | + Route::delete('employers/delete/{employer}/{user}', [EmployersController::class, 'delete_employer'])->name('delete-employer'); | |
165 | 165 | |
166 | 166 | // кабинет профиль работник - форма |
167 | 167 | Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); |