Commit f0b6d25e98632aa5b60c0ddb0e55effc81d4319f
1 parent
32cbe77364
Exists in
master
and in
1 other branch
Баг с id юзеров в блоке работодатели и redis коннектор
Showing 5 changed files with 24 additions and 9 deletions Inline Diff
app/Http/Controllers/Admin/EmployersController.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Http\Controllers\Admin; | 3 | namespace App\Http\Controllers\Admin; |
4 | 4 | ||
5 | use App\Http\Controllers\Controller; | 5 | use App\Http\Controllers\Controller; |
6 | use App\Models\Ad_employer; | 6 | use App\Models\Ad_employer; |
7 | use App\Models\Answer; | 7 | use App\Models\Answer; |
8 | use App\Models\Employer; | 8 | use App\Models\Employer; |
9 | use App\Models\Static_ad; | 9 | use App\Models\Static_ad; |
10 | use App\Models\User; | 10 | use App\Models\User; |
11 | use Illuminate\Http\Request; | 11 | use Illuminate\Http\Request; |
12 | use Illuminate\Support\Facades\DB; | 12 | use Illuminate\Support\Facades\DB; |
13 | use Illuminate\Support\Facades\Storage; | 13 | use Illuminate\Support\Facades\Storage; |
14 | use Illuminate\Support\Facades\Validator; | 14 | use Illuminate\Support\Facades\Validator; |
15 | 15 | ||
16 | class EmployersController extends Controller | 16 | class EmployersController extends Controller |
17 | { | 17 | { |
18 | public function index(Request $request) { | 18 | public function index(Request $request) { |
19 | if ($request->ajax()) { | 19 | if ($request->ajax()) { |
20 | $user = User::find($request->id); | 20 | $user = User::find($request->id); |
21 | $request->offsetUnset('id'); | 21 | $request->offsetUnset('id'); |
22 | $user->update($request->all()); | 22 | $user->update($request->all()); |
23 | } | 23 | } |
24 | 24 | ||
25 | /*$users = User::with('employers')->where('is_worker', '0'); | 25 | /*$users = User::with('employers')->where('is_worker', '0'); |
26 | $find_key = ""; | 26 | $find_key = ""; |
27 | if (isset($request->find)) { | 27 | if (isset($request->find)) { |
28 | $find_key = $request->find; | 28 | $find_key = $request->find; |
29 | $users = $users->where(function($query) use($find_key) { | 29 | $users = $users->where(function($query) use($find_key) { |
30 | $query->Where('name', 'LIKE', "%$find_key%") | 30 | $query->Where('name', 'LIKE', "%$find_key%") |
31 | ->orWhere('email', 'LIKE', "%$find_key%") | 31 | ->orWhere('email', 'LIKE', "%$find_key%") |
32 | ->orWhere('telephone', 'LIKE', "%$find_key%"); | 32 | ->orWhere('telephone', 'LIKE', "%$find_key%"); |
33 | }); | 33 | }); |
34 | }*/ | 34 | }*/ |
35 | 35 | ||
36 | $users = User::select(['users.*', 'emp.id as emp_id', 'emp.*'])->join('employers as emp','emp.user_id','users.id') | 36 | $users = User::select(['users.*','users.id as usr_id', 'emp.id as emp_id', 'emp.*'])->join('employers as emp','emp.user_id','users.id') |
37 | ->where('users.is_worker', '0'); | 37 | ->where('users.is_worker', '0'); |
38 | $find_key = ""; | 38 | $find_key = ""; |
39 | if (isset($request->find)) { | 39 | if (isset($request->find)) { |
40 | $find_key = $request->find; | 40 | $find_key = $request->find; |
41 | $users = $users->where(function($query) use($find_key) { | 41 | $users = $users->where(function($query) use($find_key) { |
42 | $query->Where('users.name', 'LIKE', "%$find_key%") | 42 | $query->Where('users.name', 'LIKE', "%$find_key%") |
43 | ->orWhere('emp.email', 'LIKE', "%$find_key%") | 43 | ->orWhere('emp.email', 'LIKE', "%$find_key%") |
44 | ->orWhere('emp.telephone', 'LIKE', "%$find_key%"); | 44 | ->orWhere('emp.telephone', 'LIKE', "%$find_key%"); |
45 | }); | 45 | }); |
46 | } | 46 | } |
47 | 47 | ||
48 | //DB::enableQueryLog(); | 48 | //DB::enableQueryLog(); |
49 | $users = $users->paginate(15); | 49 | $users = $users->paginate(15); |
50 | //dd(DB::getQueryLog()); | 50 | //dd(DB::getQueryLog()); |
51 | 51 | ||
52 | if ($request->ajax()) { | 52 | if ($request->ajax()) { |
53 | return view('admin.employer.index_ajax', compact('users')); | 53 | return view('admin.employer.index_ajax', compact('users')); |
54 | } else { | 54 | } else { |
55 | return view('admin.employer.index', compact('users', 'find_key')); | 55 | return view('admin.employer.index', compact('users', 'find_key')); |
56 | } | 56 | } |
57 | } | 57 | } |
58 | 58 | ||
59 | public function form_update_employer(Employer $employer) { | 59 | public function form_update_employer(Employer $employer) { |
60 | return view('admin.employer.edit', compact('employer')); | 60 | return view('admin.employer.edit', compact('employer')); |
61 | } | 61 | } |
62 | 62 | ||
63 | public function update_employer(Employer $employer, Request $request) | 63 | public function update_employer(Employer $employer, Request $request) |
64 | { | 64 | { |
65 | $params = $request->all(); | 65 | $params = $request->all(); |
66 | unset($params['logo']); | 66 | unset($params['logo']); |
67 | unset($params['telephone']); | 67 | unset($params['telephone']); |
68 | unset($params['email']); | 68 | unset($params['email']); |
69 | unset($params['address']); | 69 | unset($params['address']); |
70 | unset($params['site']); | 70 | unset($params['site']); |
71 | unset($params['status_hidden']); | 71 | unset($params['status_hidden']); |
72 | unset($params['oficial_status']); | 72 | unset($params['oficial_status']); |
73 | unset($params['social_is']); | 73 | unset($params['social_is']); |
74 | unset($params['sending_is']); | 74 | unset($params['sending_is']); |
75 | 75 | ||
76 | $rules = [ | 76 | $rules = [ |
77 | 'name' => 'required|string|max:255', | 77 | 'name' => 'required|string|max:255', |
78 | ]; | 78 | ]; |
79 | 79 | ||
80 | $messages = [ | 80 | $messages = [ |
81 | 'required' => 'Укажите обязательное поле «:attribute»', | 81 | 'required' => 'Укажите обязательное поле «:attribute»', |
82 | 'confirmed' => 'Пароли не совпадают', | 82 | 'confirmed' => 'Пароли не совпадают', |
83 | 'email' => 'Введите корректный email', | 83 | 'email' => 'Введите корректный email', |
84 | 'min' => [ | 84 | 'min' => [ |
85 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 85 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
86 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 86 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
87 | ], | 87 | ], |
88 | 'max' => [ | 88 | 'max' => [ |
89 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 89 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
90 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 90 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
91 | ], | 91 | ], |
92 | ]; | 92 | ]; |
93 | 93 | ||
94 | $validator = Validator::make($params, $rules, $messages); | 94 | $validator = Validator::make($params, $rules, $messages); |
95 | 95 | ||
96 | if ($validator->fails()) { | 96 | if ($validator->fails()) { |
97 | return back()->withErrors($validator)->withInput(); //->route('admin.register') | 97 | return back()->withErrors($validator)->withInput(); //->route('admin.register') |
98 | 98 | ||
99 | } else { | 99 | } else { |
100 | 100 | ||
101 | //$user = User::find($employer->user_id); | 101 | //$user = User::find($employer->user_id); |
102 | $user_id = $employer->user_id; | 102 | $user_id = $employer->user_id; |
103 | $employer->telephone = $request->telephone; | 103 | $employer->telephone = $request->telephone; |
104 | $employer->email = $request->email; | 104 | $employer->email = $request->email; |
105 | $employer->address = $request->address; | 105 | $employer->address = $request->address; |
106 | $employer->site = $request->site; | 106 | $employer->site = $request->site; |
107 | $employer->text = $request->text; | 107 | $employer->text = $request->text; |
108 | $employer->status_hidden = $request->status_hidden; | 108 | $employer->status_hidden = $request->status_hidden; |
109 | $employer->oficial_status = $request->oficial_status; | 109 | $employer->oficial_status = $request->oficial_status; |
110 | $employer->social_is = $request->social_is; | 110 | $employer->social_is = $request->social_is; |
111 | $employer->sending_is = $request->sending_is; | 111 | $employer->sending_is = $request->sending_is; |
112 | 112 | ||
113 | if ($request->has('logo')) { | 113 | if ($request->has('logo')) { |
114 | if (!empty($employer->logo)) { | 114 | if (!empty($employer->logo)) { |
115 | Storage::delete($employer->logo); | 115 | Storage::delete($employer->logo); |
116 | } | 116 | } |
117 | $employer->logo = $request->file('logo')->store("employer/$user_id", 'public'); | 117 | $employer->logo = $request->file('logo')->store("employer/$user_id", 'public'); |
118 | } | 118 | } |
119 | $employer->save(); | 119 | $employer->save(); |
120 | 120 | ||
121 | $user = User::find($user_id); | 121 | $user = User::find($user_id); |
122 | $user->update($params); | 122 | $user->update($params); |
123 | 123 | ||
124 | return redirect()->route('admin.employer-profile', ['employer' => $employer->id]) | 124 | return redirect()->route('admin.employer-profile', ['employer' => $employer->id]) |
125 | ->with('success', 'Данные были успешно сохранены'); | 125 | ->with('success', 'Данные были успешно сохранены'); |
126 | } | 126 | } |
127 | } | 127 | } |
128 | 128 | ||
129 | // кабинет - отзывы о работодателе для модерации | 129 | // кабинет - отзывы о работодателе для модерации |
130 | public function answers(Request $request) { | 130 | public function answers(Request $request) { |
131 | if ($request->ajax()) { | 131 | if ($request->ajax()) { |
132 | $user = Answer::find($request->id); | 132 | $user = Answer::find($request->id); |
133 | $request->offsetUnset('id'); | 133 | $request->offsetUnset('id'); |
134 | $user->update($request->all()); | 134 | $user->update($request->all()); |
135 | } | 135 | } |
136 | 136 | ||
137 | $answers = Answer::query()->orderByDesc('id')->paginate(15); | 137 | $answers = Answer::query()->orderByDesc('id')->paginate(15); |
138 | 138 | ||
139 | if ($request->ajax()) { | 139 | if ($request->ajax()) { |
140 | return view('admin.answers.index_ajax', compact('answers')); | 140 | return view('admin.answers.index_ajax', compact('answers')); |
141 | } else { | 141 | } else { |
142 | return view('admin.answers.index', compact('answers')); | 142 | return view('admin.answers.index', compact('answers')); |
143 | } | 143 | } |
144 | } | 144 | } |
145 | 145 | ||
146 | // кабинет - статистика вакансий работодателя | 146 | // кабинет - статистика вакансий работодателя |
147 | public function static_ads(Request $request) { | 147 | public function static_ads(Request $request) { |
148 | $stat = Static_ad::with('ads'); | 148 | $stat = Static_ad::with('ads'); |
149 | $ads = Ad_employer::query()->active()->OrderBy('id')->get(); | 149 | $ads = Ad_employer::query()->active()->OrderBy('id')->get(); |
150 | $periods = Static_ad::query()->distinct('year_month')->select('year_month')->get(); | 150 | $periods = Static_ad::query()->distinct('year_month')->select('year_month')->get(); |
151 | if ($request->ajax()) { | 151 | if ($request->ajax()) { |
152 | if (isset($request->ad_employer_id)) | 152 | if (isset($request->ad_employer_id)) |
153 | if (!$request->ad_employer_id == "0") | 153 | if (!$request->ad_employer_id == "0") |
154 | $stat = $stat->Where('ad_employer_id', '=', $request->ad_employer_id); | 154 | $stat = $stat->Where('ad_employer_id', '=', $request->ad_employer_id); |
155 | if (isset($request->year_month)) { | 155 | if (isset($request->year_month)) { |
156 | if (!$request->year_month == "0") | 156 | if (!$request->year_month == "0") |
157 | $stat = $stat->Where('year_month', '=', $request->year_month); | 157 | $stat = $stat->Where('year_month', '=', $request->year_month); |
158 | } | 158 | } |
159 | } | 159 | } |
160 | 160 | ||
161 | $stat = $stat->OrderByDesc('year_month'); | 161 | $stat = $stat->OrderByDesc('year_month'); |
162 | $stat = $stat->paginate(15); | 162 | $stat = $stat->paginate(15); |
163 | 163 | ||
164 | if ($request->ajax()) | 164 | if ($request->ajax()) |
165 | return view('admin.static.index_ads_ajax', compact('stat')); | 165 | return view('admin.static.index_ads_ajax', compact('stat')); |
166 | else | 166 | else |
167 | return view('admin.static.index_ads', compact('stat', 'ads', 'periods')); | 167 | return view('admin.static.index_ads', compact('stat', 'ads', 'periods')); |
168 | 168 | ||
169 | } | 169 | } |
170 | 170 | ||
171 | 171 | ||
172 | } | 172 | } |
173 | 173 |
app/Http/Controllers/PagesController.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace App\Http\Controllers; | 3 | namespace App\Http\Controllers; |
4 | 4 | ||
5 | use App\Models\pages; | 5 | use App\Models\pages; |
6 | use Illuminate\Http\Request; | 6 | use Illuminate\Http\Request; |
7 | use Illuminate\Support\Facades\Redis; | ||
7 | 8 | ||
8 | class PagesController extends Controller | 9 | class PagesController extends Controller |
9 | { | 10 | { |
10 | public function pages(pages $pages) { | 11 | public function pages(pages $pages) { |
11 | $page = pages::query()->where('slug', $pages->slug)->first(); | 12 | $page = pages::query()->where('slug', $pages->slug)->first(); |
12 | print_r($page); | 13 | print_r($page); |
13 | } | 14 | } |
15 | |||
16 | public function redis() { | ||
17 | $redis = Redis::connection(); | ||
18 | $redis->set('User:CompanyName', 'РЕКАМОРЕ'); | ||
19 | $id = 1; | ||
20 | //dd(Redis::get('MyVar')); | ||
21 | $redis->command('rpush', array("Сообщение1")); | ||
22 | $redis->command('rpush', array("Сообщение2")); | ||
23 | $values = $redis->command('lrange', array("mylist", 0, 1)); | ||
24 | dd($values); | ||
25 | |||
26 | } | ||
14 | } | 27 | } |
15 | 28 |
resources/views/admin/employer/index.blade.php
1 | @extends('layout.admin', ['title' => 'Админка - Работодатели']) | 1 | @extends('layout.admin', ['title' => 'Админка - Работодатели']) |
2 | 2 | ||
3 | @section('script') | 3 | @section('script') |
4 | <script> | 4 | <script> |
5 | $(document).ready(function() { | 5 | $(document).ready(function() { |
6 | $(document).on('click', '.checkban', function () { | 6 | $(document).on('click', '.checkban', function () { |
7 | var this_ = $(this); | 7 | var this_ = $(this); |
8 | var value = this_.val(); | 8 | var value = this_.val(); |
9 | var ajax_block = $('#ajax_block'); | 9 | var ajax_block = $('#ajax_block'); |
10 | var bool = 0; | 10 | var bool = 0; |
11 | 11 | ||
12 | if(this.checked){ | 12 | if(this.checked){ |
13 | bool = 1; | 13 | bool = 1; |
14 | } else { | 14 | } else { |
15 | bool = 0; | 15 | bool = 0; |
16 | } | 16 | } |
17 | 17 | ||
18 | $.ajax({ | 18 | $.ajax({ |
19 | type: "GET", | 19 | type: "GET", |
20 | url: "{{ url()->full()}}", | 20 | url: "{{ url()->full()}}", |
21 | data: "id=" + value + "&is_ban=" + bool, | 21 | data: "id=" + value + "&is_ban=" + bool, |
22 | success: function (data) { | 22 | success: function (data) { |
23 | console.log('Обновление таблицы пользователей '); | 23 | console.log('Обновление таблицы пользователей '); |
24 | //data = JSON.parse(data); | 24 | //data = JSON.parse(data); |
25 | //console.log(data); | 25 | //console.log(data); |
26 | ajax_block.html(data); | 26 | ajax_block.html(data); |
27 | }, | 27 | }, |
28 | headers: { | 28 | headers: { |
29 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | 29 | 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') |
30 | }, | 30 | }, |
31 | error: function (data) { | 31 | error: function (data) { |
32 | console.log('Error: ' + data); | 32 | console.log('Error: ' + data); |
33 | } | 33 | } |
34 | }); | 34 | }); |
35 | }); | 35 | }); |
36 | 36 | ||
37 | }); | 37 | }); |
38 | </script> | 38 | </script> |
39 | @endsection | 39 | @endsection |
40 | 40 | ||
41 | @section('search') | 41 | @section('search') |
42 | @include('admin.find') | 42 | @include('admin.find') |
43 | @endsection | 43 | @endsection |
44 | 44 | ||
45 | @section('content') | 45 | @section('content') |
46 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> | 46 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> |
47 | <div class="w-full overflow-x-auto"> | 47 | <div class="w-full overflow-x-auto"> |
48 | <table class="w-full whitespace-no-wrap"> | 48 | <table class="w-full whitespace-no-wrap"> |
49 | <thead> | 49 | <thead> |
50 | <tr | 50 | <tr |
51 | 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" | 51 | 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" |
52 | > | 52 | > |
53 | <th class="px-4 py-3">№</th> | 53 | <th class="px-4 py-3">№</th> |
54 | <th class="px-4 py-3">Название компании</th> | 54 | <th class="px-4 py-3">Название компании</th> |
55 | <th class="px-4 py-3">Email/Телефон</th> | 55 | <th class="px-4 py-3">Email/Телефон</th> |
56 | <th class="px-4 py-3">Имя</th> | 56 | <th class="px-4 py-3">Имя</th> |
57 | <th class="px-4 py-3">Дата регистрации</th> | 57 | <th class="px-4 py-3">Дата регистрации</th> |
58 | <th class="px-4 py-3">Изменить</th> | 58 | <th class="px-4 py-3">Изменить</th> |
59 | <th class="px-4 py-3">Бан</th> | 59 | <th class="px-4 py-3">Бан</th> |
60 | </tr> | 60 | </tr> |
61 | </thead> | 61 | </thead> |
62 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> | 62 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> |
63 | @foreach($users as $user) | 63 | @foreach($users as $user) |
64 | <tr class="text-gray-700 dark:text-gray-400"> | 64 | <tr class="text-gray-700 dark:text-gray-400"> |
65 | <td class="px-4 py-3"> | 65 | <td class="px-4 py-3"> |
66 | {{$user->id}} | 66 | {{$user->id}} |
67 | </td> | 67 | </td> |
68 | <td class="px-4 py-3"> | 68 | <td class="px-4 py-3"> |
69 | {{$user->name}} | 69 | {{$user->name}} |
70 | </td> | 70 | </td> |
71 | <td class="px-4 py-3"> | 71 | <td class="px-4 py-3"> |
72 | <div class="flex items-center text-sm"> | 72 | <div class="flex items-center text-sm"> |
73 | <!--<div class="relative hidden w-8 h-8 mr-3 rounded-full md:block"> | 73 | <!--<div class="relative hidden w-8 h-8 mr-3 rounded-full md:block"> |
74 | <div | 74 | <div |
75 | class="absolute inset-0 rounded-full shadow-inner" | 75 | class="absolute inset-0 rounded-full shadow-inner" |
76 | aria-hidden="true" | 76 | aria-hidden="true" |
77 | ></div> | 77 | ></div> |
78 | </div>--> | 78 | </div>--> |
79 | <div> | 79 | <div> |
80 | <p class="font-semibold">{{ empty($user->employers->email) ? $user->email : $user->employers->email }}</p> | 80 | <p class="font-semibold">{{ empty($user->employers->email) ? $user->email : $user->employers->email }}</p> |
81 | <p class="text-xs text-gray-600 dark:text-gray-400"> | 81 | <p class="text-xs text-gray-600 dark:text-gray-400"> |
82 | {{ empty($user->employers->telephone) ? $user->telephone : $user->employers->telephone }} | 82 | {{ empty($user->employers->telephone) ? $user->telephone : $user->employers->telephone }} |
83 | </p> | 83 | </p> |
84 | </div> | 84 | </div> |
85 | </div> | 85 | </div> |
86 | 86 | ||
87 | </td> | 87 | </td> |
88 | <td class="px-4 py-3 text-sm"> | 88 | <td class="px-4 py-3 text-sm"> |
89 | {{ $user->name_man }} ({{ $user->emp_id }}) | 89 | {{ $user->name_man }} ({{ $user->usr_id }}) |
90 | </td> | 90 | </td> |
91 | <td class="px-4 py-3 text-sm"> | 91 | <td class="px-4 py-3 text-sm"> |
92 | {{ $user->created_at }} | 92 | {{ $user->created_at }} |
93 | </td> | 93 | </td> |
94 | <td class="px-4 py-3 text-sm"> | 94 | <td class="px-4 py-3 text-sm"> |
95 | @if (!empty($user->emp_id)) | 95 | @if (!empty($user->emp_id)) |
96 | <a href="{{ route('admin.employer-profile', ['employer' => $user->emp_id]) }}">Изменить</a> | 96 | <a href="{{ route('admin.employer-profile', ['employer' => $user->emp_id]) }}">Изменить</a> |
97 | @endif | 97 | @endif |
98 | </td> | 98 | </td> |
99 | <td class="px-4 py-3 text-sm"> | 99 | <td class="px-4 py-3 text-sm"> |
100 | @if ($user->id > 1) | 100 | @if ($user->usr_id > 1) |
101 | <input type="checkbox" class="checkban" value="{{$user->id}}" name="ban_{{$user->id}}" {{ ($user->is_ban) ? "checked" : "" }}/> | 101 | <input type="checkbox" class="checkban" value="{{$user->usr_id}}" name="ban_{{$user->usr_id}}" {{ ($user->is_ban) ? "checked" : "" }}/> |
102 | @endif | 102 | @endif |
103 | </td> | 103 | </td> |
104 | </tr> | 104 | </tr> |
105 | @endforeach | 105 | @endforeach |
106 | </tbody> | 106 | </tbody> |
107 | </table> | 107 | </table> |
108 | </div> | 108 | </div> |
109 | 109 | ||
110 | <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"> | 110 | <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"> |
111 | <?=$users->appends($_GET)->links('admin.pagginate'); ?> | 111 | <?=$users->appends($_GET)->links('admin.pagginate'); ?> |
112 | </div> | 112 | </div> |
113 | </div> | 113 | </div> |
114 | @endsection | 114 | @endsection |
115 | 115 |
resources/views/admin/employer/index_ajax.blade.php
1 | <div class="w-full overflow-x-auto"> | 1 | <div class="w-full overflow-x-auto"> |
2 | <table class="w-full whitespace-no-wrap"> | 2 | <table class="w-full whitespace-no-wrap"> |
3 | <thead> | 3 | <thead> |
4 | <tr | 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" | 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 | > | 6 | > |
7 | <th class="px-4 py-3">№</th> | 7 | <th class="px-4 py-3">№</th> |
8 | <th class="px-4 py-3">Название компании</th> | 8 | <th class="px-4 py-3">Название компании</th> |
9 | <th class="px-4 py-3">Email/Телефон</th> | 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 | <th class="px-4 py-3">Дата регистрации</th> |
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 | </tr> | 14 | </tr> |
15 | </thead> | 15 | </thead> |
16 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> | 16 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> |
17 | @foreach($users as $user) | 17 | @foreach($users as $user) |
18 | <tr class="text-gray-700 dark:text-gray-400"> | 18 | <tr class="text-gray-700 dark:text-gray-400"> |
19 | <td class="px-4 py-3"> | 19 | <td class="px-4 py-3"> |
20 | {{$user->id}} | 20 | {{$user->id}} |
21 | </td> | 21 | </td> |
22 | <td class="px-4 py-3"> | 22 | <td class="px-4 py-3"> |
23 | {{$user->name}} | 23 | {{$user->name}} |
24 | </td> | 24 | </td> |
25 | <td class="px-4 py-3"> | 25 | <td class="px-4 py-3"> |
26 | <div class="flex items-center text-sm"> | 26 | <div class="flex items-center text-sm"> |
27 | <!--<div class="relative hidden w-8 h-8 mr-3 rounded-full md:block"> | 27 | <!--<div class="relative hidden w-8 h-8 mr-3 rounded-full md:block"> |
28 | <div | 28 | <div |
29 | class="absolute inset-0 rounded-full shadow-inner" | 29 | class="absolute inset-0 rounded-full shadow-inner" |
30 | aria-hidden="true" | 30 | aria-hidden="true" |
31 | ></div> | 31 | ></div> |
32 | </div>--> | 32 | </div>--> |
33 | <div> | 33 | <div> |
34 | <p class="font-semibold">{{ empty($user->employers->email) ? $user->email : $user->employers->email }}</p> | 34 | <p class="font-semibold">{{ empty($user->employers->email) ? $user->email : $user->employers->email }}</p> |
35 | <p class="text-xs text-gray-600 dark:text-gray-400"> | 35 | <p class="text-xs text-gray-600 dark:text-gray-400"> |
36 | {{ empty($user->employers->telephone) ? $user->telephone : $user->employers->telephone }} | 36 | {{ empty($user->employers->telephone) ? $user->telephone : $user->employers->telephone }} |
37 | </p> | 37 | </p> |
38 | </div> | 38 | </div> |
39 | </div> | 39 | </div> |
40 | 40 | ||
41 | </td> | 41 | </td> |
42 | <td class="px-4 py-3 text-sm"> | 42 | <td class="px-4 py-3 text-sm"> |
43 | {{ $user->name_man }} | 43 | {{ $user->name_man }} ({{ $user->usr_id }}) |
44 | </td> | 44 | </td> |
45 | <td class="px-4 py-3 text-sm"> | 45 | <td class="px-4 py-3 text-sm"> |
46 | {{ $user->created_at }} | 46 | {{ $user->created_at }} |
47 | </td> | 47 | </td> |
48 | <td class="px-4 py-3 text-sm"> | 48 | <td class="px-4 py-3 text-sm"> |
49 | @if ($user->id > 1) | 49 | @if (!empty($user->emp_id)) |
50 | <a href="{{ route('admin.user-profile', ['user' => $user->id]) }}">Изменить</a> | 50 | <a href="{{ route('admin.employer-profile', ['employer' => $user->emp_id]) }}">Изменить</a> |
51 | @endif | 51 | @endif |
52 | </td> | 52 | </td> |
53 | <td class="px-4 py-3 text-sm"> | 53 | <td class="px-4 py-3 text-sm"> |
54 | @if ($user->id > 1) | 54 | @if ($user->usr_id > 1) |
55 | <input type="checkbox" class="checkban" value="{{$user->id}}" name="ban_{{$user->id}}" {{ ($user->is_ban) ? "checked" : "" }}/> | 55 | <input type="checkbox" class="checkban" value="{{$user->usr_id}}" name="ban_{{$user->usr_id}}" {{ ($user->is_ban) ? "checked" : "" }}/> |
56 | @endif | 56 | @endif |
57 | </td> | 57 | </td> |
58 | </tr> | 58 | </tr> |
59 | @endforeach | 59 | @endforeach |
60 | </tbody> | 60 | </tbody> |
61 | </table> | 61 | </table> |
62 | </div> | 62 | </div> |
63 | 63 | ||
64 | <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"> | 64 | <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"> |
65 | <?//=$users->appends($_GET)->links('admin.pagginate'); ?> | 65 | <?//=$users->appends($_GET)->links('admin.pagginate'); ?> |
66 | <?=$users->links('admin.pagginate'); ?> | 66 | <?=$users->links('admin.pagginate'); ?> |
67 | </div> | 67 | </div> |
68 | 68 | ||
69 | 69 |
routes/web.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | use App\Http\Controllers\Admin\AdminController; | 3 | use App\Http\Controllers\Admin\AdminController; |
4 | use App\Http\Controllers\Admin\CategoryController; | 4 | use App\Http\Controllers\Admin\CategoryController; |
5 | use App\Http\Controllers\Admin\EmployersController; | 5 | use App\Http\Controllers\Admin\EmployersController; |
6 | use App\Http\Controllers\Admin\InfoBloksController; | 6 | use App\Http\Controllers\Admin\InfoBloksController; |
7 | use App\Http\Controllers\Admin\JobTitlesController; | 7 | use App\Http\Controllers\Admin\JobTitlesController; |
8 | use App\Http\Controllers\Admin\UsersController; | 8 | use App\Http\Controllers\Admin\UsersController; |
9 | use App\Http\Controllers\Admin\WorkersController; | 9 | use App\Http\Controllers\Admin\WorkersController; |
10 | use App\Http\Controllers\Auth\LoginController; | 10 | use App\Http\Controllers\Auth\LoginController; |
11 | use App\Http\Controllers\Auth\RegisterController; | 11 | use App\Http\Controllers\Auth\RegisterController; |
12 | use App\Http\Controllers\CKEditorController; | 12 | use App\Http\Controllers\CKEditorController; |
13 | use App\Models\User; | 13 | use App\Models\User; |
14 | use App\Http\Controllers\MainController; | 14 | use App\Http\Controllers\MainController; |
15 | use App\Http\Controllers\HomeController; | 15 | use App\Http\Controllers\HomeController; |
16 | use Illuminate\Support\Facades\Route; | 16 | use Illuminate\Support\Facades\Route; |
17 | use App\Http\Controllers\Admin\CompanyController; | 17 | use App\Http\Controllers\Admin\CompanyController; |
18 | use App\Http\Controllers\Admin\Ad_EmployersController; | 18 | use App\Http\Controllers\Admin\Ad_EmployersController; |
19 | use App\Http\Controllers\Admin\MsgAnswersController; | 19 | use App\Http\Controllers\Admin\MsgAnswersController; |
20 | use App\Http\Controllers\Admin\GroupsController; | 20 | use App\Http\Controllers\Admin\GroupsController; |
21 | use App\Http\Controllers\PagesController; | 21 | use App\Http\Controllers\PagesController; |
22 | use Illuminate\Support\Facades\Storage; | 22 | use Illuminate\Support\Facades\Storage; |
23 | 23 | ||
24 | 24 | ||
25 | /* | 25 | /* |
26 | |-------------------------------------------------------------------------- | 26 | |-------------------------------------------------------------------------- |
27 | | Web Routes | 27 | | Web Routes |
28 | |-------------------------------------------------------------------------- | 28 | |-------------------------------------------------------------------------- |
29 | | | 29 | | |
30 | | Here is where you can register web routes for your application. These | 30 | | Here is where you can register web routes for your application. These |
31 | | routes are loaded by the RouteServiceProvider within a group which | 31 | | routes are loaded by the RouteServiceProvider within a group which |
32 | | contains the "web" middleware group. Now create something great! | 32 | | contains the "web" middleware group. Now create something great! |
33 | | | 33 | | |
34 | */ | 34 | */ |
35 | /* | 35 | /* |
36 | Route::get('/', function () { | 36 | Route::get('/', function () { |
37 | return view('welcome'); | 37 | return view('welcome'); |
38 | })->name('index'); | 38 | })->name('index'); |
39 | */ | 39 | */ |
40 | Route::get('/', [MainController::class, 'index'])->name('index'); | 40 | Route::get('/', [MainController::class, 'index'])->name('index'); |
41 | 41 | ||
42 | //Роуты авторизации, регистрации, восстановления, аутентификации | 42 | //Роуты авторизации, регистрации, восстановления, аутентификации |
43 | Auth::routes(['verify' => true]); | 43 | Auth::routes(['verify' => true]); |
44 | //Личный кабинет пользователя | 44 | //Личный кабинет пользователя |
45 | Route::get('/home', [HomeController::class, 'index'])->name('home'); | 45 | Route::get('/home', [HomeController::class, 'index'])->name('home'); |
46 | 46 | ||
47 | /* | 47 | /* |
48 | Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { | 48 | Route::post('resend/verification-email', function (\Illuminate\Http\Request $request) { |
49 | $user = User::where('email',$request->input('email'))->first(); | 49 | $user = User::where('email',$request->input('email'))->first(); |
50 | 50 | ||
51 | $user->sendEmailVerificationNotification(); | 51 | $user->sendEmailVerificationNotification(); |
52 | 52 | ||
53 | return 'your response'; | 53 | return 'your response'; |
54 | })->middleware('throttle:6,1')->name('verification.resend'); | 54 | })->middleware('throttle:6,1')->name('verification.resend'); |
55 | */ | 55 | */ |
56 | 56 | ||
57 | // Авторизация, регистрация в админку | 57 | // Авторизация, регистрация в админку |
58 | Route::group([ | 58 | Route::group([ |
59 | 'as' => 'admin.', // имя маршрута, например auth.index | 59 | 'as' => 'admin.', // имя маршрута, например auth.index |
60 | 'prefix' => 'admin', // префикс маршрута, например auth/index | 60 | 'prefix' => 'admin', // префикс маршрута, например auth/index |
61 | 'middleware' => ['guest'], | 61 | 'middleware' => ['guest'], |
62 | ], function () { | 62 | ], function () { |
63 | // Форма регистрации | 63 | // Форма регистрации |
64 | Route::get('register', [AdminController::class, 'register'])->name('register'); | 64 | Route::get('register', [AdminController::class, 'register'])->name('register'); |
65 | 65 | ||
66 | // Создание пользователя | 66 | // Создание пользователя |
67 | Route::post('register', [AdminController::class, 'create'])->name('create'); | 67 | Route::post('register', [AdminController::class, 'create'])->name('create'); |
68 | //Форма входа | 68 | //Форма входа |
69 | Route::get('login', [AdminController::class, 'login'])->name('login'); | 69 | Route::get('login', [AdminController::class, 'login'])->name('login'); |
70 | 70 | ||
71 | // аутентификация | 71 | // аутентификация |
72 | Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); | 72 | Route::post('login', [AdminController::class, 'autenticate'])->name('auth'); |
73 | 73 | ||
74 | }); | 74 | }); |
75 | 75 | ||
76 | // Личный кабинет админки | 76 | // Личный кабинет админки |
77 | Route::group([ | 77 | Route::group([ |
78 | 'as' => 'admin.', // имя маршрута, например auth.index | 78 | 'as' => 'admin.', // имя маршрута, например auth.index |
79 | 'prefix' => 'admin', // префикс маршрута, например auth/index | 79 | 'prefix' => 'admin', // префикс маршрута, например auth/index |
80 | 'middleware' => ['auth'], ['admin'], | 80 | 'middleware' => ['auth'], ['admin'], |
81 | ], function() { | 81 | ], function() { |
82 | 82 | ||
83 | // выход | 83 | // выход |
84 | Route::get('logout', [AdminController::class, 'logout'])->name('logout'); | 84 | Route::get('logout', [AdminController::class, 'logout'])->name('logout'); |
85 | 85 | ||
86 | // кабинет главная страница | 86 | // кабинет главная страница |
87 | Route::get('cabinet', [AdminController::class, 'index'])->name('index'); | 87 | Route::get('cabinet', [AdminController::class, 'index'])->name('index'); |
88 | 88 | ||
89 | // кабинет профиль админа - форма | 89 | // кабинет профиль админа - форма |
90 | Route::get('profile', [AdminController::class, 'profile'])->name('profile'); | 90 | Route::get('profile', [AdminController::class, 'profile'])->name('profile'); |
91 | // кабинет профиль админа - сохранение формы | 91 | // кабинет профиль админа - сохранение формы |
92 | Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); | 92 | Route::post('profile', [AdminController::class, 'store_profile'])->name('store_profile'); |
93 | 93 | ||
94 | //кабинет сообщения админа | 94 | //кабинет сообщения админа |
95 | //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); | 95 | //Route::get('messages', [AdminController::class, 'profile'])->name('profile'); |
96 | 96 | ||
97 | 97 | ||
98 | // кабинет профиль - форма пароли | 98 | // кабинет профиль - форма пароли |
99 | Route::get('password', [AdminController::class, 'profile_password'])->name('password'); | 99 | Route::get('password', [AdminController::class, 'profile_password'])->name('password'); |
100 | // кабинет профиль - сохранение формы пароля | 100 | // кабинет профиль - сохранение формы пароля |
101 | Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); | 101 | Route::post('password', [AdminController::class, 'profile_password_new'])->name('password'); |
102 | 102 | ||
103 | 103 | ||
104 | // кабинет профиль пользователя - форма | 104 | // кабинет профиль пользователя - форма |
105 | Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); | 105 | Route::get('user-profile/{user}', [AdminController::class, 'profile_user'])->name('user-profile'); |
106 | // кабинет профиль пользователя - сохранение формы | 106 | // кабинет профиль пользователя - сохранение формы |
107 | Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); | 107 | Route::post('user-profile/{user}', [AdminController::class, 'store_profile_user'])->name('user-store_profile'); |
108 | 108 | ||
109 | // кабинет профиль работодатель - форма | 109 | // кабинет профиль работодатель - форма |
110 | Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); | 110 | Route::get('employer-profile/{employer}', [EmployersController::class, 'form_update_employer'])->name('employer-profile'); |
111 | // кабинет профиль работодатель - сохранение формы | 111 | // кабинет профиль работодатель - сохранение формы |
112 | Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); | 112 | Route::post('employer-profile/{employer}', [EmployersController::class, 'update_employer'])->name('update-employer-profile'); |
113 | 113 | ||
114 | // кабинет профиль работник - форма | 114 | // кабинет профиль работник - форма |
115 | Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); | 115 | Route::get('worker-profile/{worker}', [WorkersController::class, 'form_edit_worker'])->name('worker-profile-edit'); |
116 | // кабинет профиль работник - сохранение формы | 116 | // кабинет профиль работник - сохранение формы |
117 | Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); | 117 | Route::post('worker-profile/{worker}', [WorkersController::class, 'form_update_worker'])->name('worker-profile-update'); |
118 | 118 | ||
119 | 119 | ||
120 | // кабинет настройки сайта - форма | 120 | // кабинет настройки сайта - форма |
121 | Route::get('config', [AdminController::class, 'config_form'])->name('config'); | 121 | Route::get('config', [AdminController::class, 'config_form'])->name('config'); |
122 | // кабинет настройки сайта сохранение формы | 122 | // кабинет настройки сайта сохранение формы |
123 | Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); | 123 | Route::post('config', [AdminController::class, 'store_config'])->name('store_config'); |
124 | 124 | ||
125 | // кабинет - пользователи | 125 | // кабинет - пользователи |
126 | Route::get('users', [UsersController::class, 'index'])->name('users'); | 126 | Route::get('users', [UsersController::class, 'index'])->name('users'); |
127 | 127 | ||
128 | // кабинет - пользователи | 128 | // кабинет - пользователи |
129 | Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); | 129 | Route::get('admin-users', [AdminController::class, 'index_admin'])->name('admin-users'); |
130 | 130 | ||
131 | // кабинет - работодатели | 131 | // кабинет - работодатели |
132 | Route::get('employers', [EmployersController::class, 'index'])->name('employers'); | 132 | Route::get('employers', [EmployersController::class, 'index'])->name('employers'); |
133 | 133 | ||
134 | // кабинет - соискатели | 134 | // кабинет - соискатели |
135 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); | 135 | Route::get('workers', [WorkersController::class, 'index'])->name('workers'); |
136 | 136 | ||
137 | // кабинет - вакансии | 137 | // кабинет - вакансии |
138 | Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); | 138 | Route::get('ad-employers', [Ad_EmployersController::class, 'index'])->name('ad-employers'); |
139 | 139 | ||
140 | // кабинет - категории | 140 | // кабинет - категории |
141 | //Route::get('categories', [AdminController::class, 'index'])->name('categories'); | 141 | //Route::get('categories', [AdminController::class, 'index'])->name('categories'); |
142 | /* | 142 | /* |
143 | * CRUD-операции над Справочником Категории | 143 | * CRUD-операции над Справочником Категории |
144 | */ | 144 | */ |
145 | Route::resource('categories', CategoryController::class, ['except' => ['show']]); | 145 | Route::resource('categories', CategoryController::class, ['except' => ['show']]); |
146 | 146 | ||
147 | 147 | ||
148 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); | 148 | //Route::get('job-titles', [AdminController::class, 'index'])->name('job-titles'); |
149 | /* | 149 | /* |
150 | * кабинет - CRUD-операции по справочнику должности | 150 | * кабинет - CRUD-операции по справочнику должности |
151 | * | 151 | * |
152 | */ | 152 | */ |
153 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); | 153 | Route::resource('job-titles', JobTitlesController::class, ['except' => ['show']]); |
154 | 154 | ||
155 | // кабинет - сообщения (чтение чужих) | 155 | // кабинет - сообщения (чтение чужих) |
156 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); | 156 | Route::get('messages', [MsgAnswersController::class, 'messages'])->name('messages'); |
157 | // кабинет - сообщения (админские) | 157 | // кабинет - сообщения (админские) |
158 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); | 158 | Route::get('admin-messages', [MsgAnswersController::class, 'admin_messages'])->name('admin-messages'); |
159 | // кабинет - сообщения (админские) | 159 | // кабинет - сообщения (админские) |
160 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); | 160 | Route::post('admin-messages', [MsgAnswersController::class, 'admin_messages_post'])->name('admin-messages-post'); |
161 | // кабинет - sql - конструкция запросов | 161 | // кабинет - sql - конструкция запросов |
162 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); | 162 | Route::get('messages-sql', [MsgAnswersController::class, 'messages_sql'])->name('messages-sql'); |
163 | 163 | ||
164 | /* | 164 | /* |
165 | * Расписанный подход в описании каждой директорий групп пользователей. | 165 | * Расписанный подход в описании каждой директорий групп пользователей. |
166 | */ | 166 | */ |
167 | // кабинет - группы пользователей | 167 | // кабинет - группы пользователей |
168 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); | 168 | Route::get('groups', [GroupsController::class, 'index'])->name('groups'); |
169 | // кабинет - добавление форма группы пользователей | 169 | // кабинет - добавление форма группы пользователей |
170 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); | 170 | Route::get('groups/add', [GroupsController::class, 'add'])->name('add-group'); |
171 | // кабинет - сохранение формы группы пользователей | 171 | // кабинет - сохранение формы группы пользователей |
172 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); | 172 | Route::post('groups/add', [GroupsController::class, 'store'])->name('add-group-store'); |
173 | // кабинет - редактирование форма группы пользователей | 173 | // кабинет - редактирование форма группы пользователей |
174 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); | 174 | Route::get('groups/edit/{group}', [GroupsController::class, 'edit'])->name('edit-group'); |
175 | // кабинет - сохранение редактированной формы группы пользователей | 175 | // кабинет - сохранение редактированной формы группы пользователей |
176 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); | 176 | Route::post('groups/edit/{group}', [GroupsController::class, 'update'])->name('update-group'); |
177 | // кабинет - удаление группы пользователей | 177 | // кабинет - удаление группы пользователей |
178 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); | 178 | Route::delete('groups/delete/{group}', [GroupsController::class, 'destroy'])->name('delete-group'); |
179 | 179 | ||
180 | 180 | ||
181 | // кабинет - список админов | 181 | // кабинет - список админов |
182 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); | 182 | Route::get('group-admin', [AdminController::class, 'index'])->name('group-admin'); |
183 | 183 | ||
184 | 184 | ||
185 | /////редактор////// кабинет - редактор сайта//////////////////////// | 185 | /////редактор////// кабинет - редактор сайта//////////////////////// |
186 | Route::get('editor-site', function() { | 186 | Route::get('editor-site', function() { |
187 | return view('admin.editor.index'); | 187 | return view('admin.editor.index'); |
188 | })->name('editor-site'); | 188 | })->name('editor-site'); |
189 | 189 | ||
190 | 190 | ||
191 | // кабинет - редактор шапки-футера сайта | 191 | // кабинет - редактор шапки-футера сайта |
192 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); | 192 | Route::get('edit-blocks', [CompanyController::class, 'editblocks'])->name('edit-blocks'); |
193 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); | 193 | Route::get('edit-bloks/add', [CompanyController::class, 'editblock_add'])->name('add-block'); |
194 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); | 194 | Route::post('edit-bloks/add', [CompanyController::class, 'editblock_store'])->name('add-block-store'); |
195 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); | 195 | Route::get('edit-bloks/ajax', [CompanyController::class, 'editblock_ajax'])->name('ajax.block'); |
196 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); | 196 | Route::get('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_edit'])->name('edit-block'); |
197 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); | 197 | Route::put('edit-bloks/edit/{block}', [CompanyController::class, 'editblock_update'])->name('update-block'); |
198 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); | 198 | Route::delete('edit-bloks/delete/{block}', [CompanyController::class, 'editblock_destroy'])->name('delete-block'); |
199 | 199 | ||
200 | 200 | ||
201 | // кабинет - редактор должности на главной | 201 | // кабинет - редактор должности на главной |
202 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); | 202 | Route::get('job-titles-main', [CompanyController::class, 'job_titles_main'])->name('job-titles-main'); |
203 | 203 | ||
204 | // кабинет - редактор работодатели на главной | 204 | // кабинет - редактор работодатели на главной |
205 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); | 205 | Route::get('employers-main', [CompanyController::class, 'employers_main'])->name('employers-main'); |
206 | 206 | ||
207 | 207 | ||
208 | // кабинет - редактор seo-сайта | 208 | // кабинет - редактор seo-сайта |
209 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); | 209 | Route::get('editor-seo', [CompanyController::class, 'editor_seo'])->name('editor-seo'); |
210 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); | 210 | Route::get('editor-seo/add', [CompanyController::class, 'editor_seo_add'])->name('add-seo'); |
211 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); | 211 | Route::post('editor-seo/add', [CompanyController::class, 'editor_seo_store'])->name('add-seo-store'); |
212 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); | 212 | Route::get('editor-seo/ajax', [CompanyController::class, 'editor_seo_ajax'])->name('ajax.seo'); |
213 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); | 213 | Route::get('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_edit'])->name('edit-seo'); |
214 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); | 214 | Route::put('editor-seo/edit/{page}', [CompanyController::class, 'editor_seo_update'])->name('update-seo'); |
215 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); | 215 | Route::delete('editor-seo/delete/{page}', [CompanyController::class, 'editor_seo_destroy'])->name('delete-seo'); |
216 | 216 | ||
217 | 217 | ||
218 | // кабинет - редактор страниц | 218 | // кабинет - редактор страниц |
219 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); | 219 | Route::get('editor-pages', [CompanyController::class, 'editor_pages'])->name('editor-pages'); |
220 | // кабинет - добавление страницы | 220 | // кабинет - добавление страницы |
221 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); | 221 | Route::get('editor-pages/add', [CompanyController::class, 'editor_pages_add'])->name('add-page'); |
222 | // кабинет - сохранение формы страницы | 222 | // кабинет - сохранение формы страницы |
223 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); | 223 | Route::post('editor-page/add', [CompanyController::class, 'editor_pages_store'])->name('add-page-store'); |
224 | // кабинет - редактирование форма страницы | 224 | // кабинет - редактирование форма страницы |
225 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); | 225 | Route::get('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_edit'])->name('edit-page'); |
226 | // кабинет - сохранение редактированной формы страницы | 226 | // кабинет - сохранение редактированной формы страницы |
227 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); | 227 | Route::put('editor-pages/edit/{page}', [CompanyController::class, 'editor_pages_update'])->name('update-page'); |
228 | // кабинет - удаление страницы | 228 | // кабинет - удаление страницы |
229 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); | 229 | Route::delete('editor-pages/delete/{page}', [CompanyController::class, 'editor_pages_destroy'])->name('delete-page'); |
230 | 230 | ||
231 | 231 | ||
232 | // кабинет - реклама сайта | 232 | // кабинет - реклама сайта |
233 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); | 233 | Route::get('reclames', [CompanyController::class, 'reclames'])->name('reclames'); |
234 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); | 234 | Route::get('reclames/add', [CompanyController::class, 'reclames_add'])->name('add-reclames'); |
235 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); | 235 | Route::post('reclames/add', [CompanyController::class, 'reclames_store'])->name('add-reclames-store'); |
236 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); | 236 | Route::get('reclames/edit/{reclame}', [CompanyController::class, 'reclames_edit'])->name('edit-reclames'); |
237 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); | 237 | Route::put('reclames/edit/{reclame}', [CompanyController::class, 'reclames_update'])->name('update-reclames'); |
238 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); | 238 | Route::delete('reclames/delete/{reclame}', [CompanyController::class, 'reclames_destroy'])->name('delete-reclames'); |
239 | //////////////////////////////////////////////////////////////////////// | 239 | //////////////////////////////////////////////////////////////////////// |
240 | 240 | ||
241 | 241 | ||
242 | // кабинет - отзывы о работодателе для модерации | 242 | // кабинет - отзывы о работодателе для модерации |
243 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); | 243 | Route::get('answers', [EmployersController::class, 'answers'])->name('answers'); |
244 | 244 | ||
245 | // Общая страница статистики | 245 | // Общая страница статистики |
246 | Route::get('statics', function () { | 246 | Route::get('statics', function () { |
247 | return view('admin.static.index'); | 247 | return view('admin.static.index'); |
248 | })->name('statics'); | 248 | })->name('statics'); |
249 | 249 | ||
250 | // кабинет - статистика работников | 250 | // кабинет - статистика работников |
251 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); | 251 | Route::get('static-workers', [WorkersController::class, 'static_workers'])->name('static-workers'); |
252 | 252 | ||
253 | // кабинет - статистика вакансий работодателя | 253 | // кабинет - статистика вакансий работодателя |
254 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); | 254 | Route::get('static-ads', [EmployersController::class, 'static_ads'])->name('static-ads'); |
255 | 255 | ||
256 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника | 256 | // кабинет - справочник - блоки информации (дипломы и документы) для резюме работника |
257 | /* | 257 | /* |
258 | * CRUD-операции над справочником дипломы и документы | 258 | * CRUD-операции над справочником дипломы и документы |
259 | */ | 259 | */ |
260 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); | 260 | //Route::get('infobloks', [WorkersController::class, 'infobloks'])->name('infobloks'); |
261 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); | 261 | Route::resource('infobloks', InfoBloksController::class, ['except' => ['show']]); |
262 | 262 | ||
263 | // кабинет - роли пользователя | 263 | // кабинет - роли пользователя |
264 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); | 264 | Route::get('roles', [UsersController::class, 'roles'])->name('roles'); |
265 | 265 | ||
266 | Route::get('logs', function() { | 266 | Route::get('logs', function() { |
267 | $files = Storage::files('logs/laravel.log'); | 267 | $files = Storage::files('logs/laravel.log'); |
268 | print_r($files); | 268 | print_r($files); |
269 | })->name('logs'); | 269 | })->name('logs'); |
270 | 270 | ||
271 | }); | 271 | }); |
272 | 272 | ||
273 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); | 273 | Route::post('ckeditor/upload', [CKEditorController::class, 'upload'])->name('ckeditor.image-upload'); |
274 | 274 | ||
275 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); | 275 | Route::get('pages/{pages:slug}', [PagesController::class, 'pages'])->name('page'); |
276 | |||
277 | Route::get('redis/', [PagesController::class, 'redis'])->name('redis'); | ||
276 | 278 |