Commit 567d6161f9a1a6c8a9ddd98a05e170253105b502
1 parent
22d3318a03
Exists in
master
and in
1 other branch
Редакция работодателей и образования
Showing 4 changed files with 109 additions and 47 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\CategoryEmp; | 8 | use App\Models\CategoryEmp; |
9 | use App\Models\Employer; | 9 | use App\Models\Employer; |
10 | use App\Models\Static_ad; | 10 | use App\Models\Static_ad; |
11 | use App\Models\User; | 11 | use App\Models\User; |
12 | use Illuminate\Http\Request; | 12 | use Illuminate\Http\Request; |
13 | use Illuminate\Support\Facades\DB; | 13 | use Illuminate\Support\Facades\DB; |
14 | use Illuminate\Support\Facades\Storage; | 14 | use Illuminate\Support\Facades\Storage; |
15 | use Illuminate\Support\Facades\Validator; | 15 | use Illuminate\Support\Facades\Validator; |
16 | 16 | ||
17 | class EmployersController extends Controller | 17 | class EmployersController extends Controller |
18 | { | 18 | { |
19 | public function index(Request $request) { | 19 | public function index(Request $request) { |
20 | //$all_employer = User::where('is_worker', '0')->count(); | 20 | //$all_employer = User::where('is_worker', '0')->count(); |
21 | 21 | $all_public = -1; | |
22 | $all_status = -1; | ||
22 | if ($request->ajax()) { | 23 | if ($request->ajax()) { |
23 | $user = User::find($request->id); | 24 | $user = User::find($request->id); |
24 | $request->offsetUnset('id'); | 25 | $request->offsetUnset('id'); |
25 | $user->update($request->all()); | 26 | $user->update($request->all()); |
26 | } | 27 | } |
27 | 28 | ||
28 | $users = User::with('employers')->select(['users.*','users.id as usr_id', 'emp.id as emp_id', 'emp.logo as emp_logo', 'emp.*']) | 29 | $users = User::with('employers')->select(['users.*','users.id as usr_id', 'emp.id as emp_id', 'emp.code as code_id', 'emp.logo as emp_logo', 'emp.*']) |
29 | ->join('employers as emp','emp.user_id','users.id') | 30 | ->join('employers as emp','emp.user_id','users.id') |
30 | ->where('users.is_worker', '0')->Realuser()->Notadmin(); | 31 | ->where('users.is_worker', '0')->Realuser(); //->Notadmin(); |
31 | $all_employer = $users->count(); | 32 | $all_employer = $users->count(); |
32 | 33 | ||
34 | $all_public = Employer::where('status_hidden', '=', '0')-> | ||
35 | count(); | ||
36 | |||
37 | $all_status = Employer::where(function($query) { | ||
38 | $query->Where('category', '=', 'Не оплачен') | ||
39 | ->orWhere('category', '=', 'Не определен') | ||
40 | ->orWhere('category', '=', 'Согласование'); | ||
41 | })->count(); | ||
42 | |||
33 | $find_cat = ""; | 43 | $find_cat = ""; |
34 | if (isset($request->category)) { | 44 | if (isset($request->category)) { |
35 | if ($request->category != 'Все категории') { | 45 | if ($request->category != 'Все категории') { |
36 | $users = $users->where('category', '=', $request->category); | 46 | $users = $users->where('category', '=', $request->category); |
37 | $find_cat = $request->category; | 47 | $find_cat = $request->category; |
38 | } | 48 | } |
39 | } | 49 | } |
40 | $find_key = ""; | 50 | $find_key = ""; |
41 | 51 | ||
42 | if (isset($request->find)) { | 52 | if (isset($request->find)) { |
43 | $find_key = $request->find; | 53 | $find_key = $request->find; |
44 | $users = $users->where(function($query) use($find_key) { | 54 | $users = $users->where(function($query) use($find_key) { |
45 | $query->Where('users.name', 'LIKE', "%$find_key%") | 55 | $query->Where('users.name', 'LIKE', "%$find_key%") |
46 | ->orWhere('emp.email', 'LIKE', "%$find_key%") | 56 | ->orWhere('emp.email', 'LIKE', "%$find_key%") |
47 | ->orWhere('emp.telephone', 'LIKE', "%$find_key%"); | 57 | ->orWhere('emp.telephone', 'LIKE', "%$find_key%"); |
48 | }); | 58 | }); |
49 | } | 59 | } |
50 | 60 | ||
51 | //DB::enableQueryLog(); | 61 | //DB::enableQueryLog(); |
52 | $users = $users->paginate(15); | 62 | $users = $users->paginate(15); |
53 | //dd(DB::getQueryLog()); | 63 | //dd(DB::getQueryLog()); |
54 | 64 | ||
55 | $select_category = CategoryEmp::query()->active()->get(); | 65 | $select_category = CategoryEmp::query()->active()->get(); |
56 | 66 | ||
57 | if ($request->ajax()) { | 67 | if ($request->ajax()) { |
58 | return view('admin.employer.index_ajax', compact('users')); | 68 | return view('admin.employer.index_ajax', compact('users')); |
59 | } else { | 69 | } else { |
60 | return view('admin.employer.index', compact('users', | 70 | return view('admin.employer.index', compact('users', |
61 | 'find_key', | 71 | 'find_key', |
62 | 'find_cat', | 72 | 'find_cat', |
63 | 'all_employer', | 73 | 'all_employer', |
74 | 'all_public', | ||
75 | 'all_status', | ||
64 | 'select_category')); | 76 | 'select_category')); |
65 | } | 77 | } |
66 | } | 78 | } |
67 | 79 | ||
68 | public function comment_read(Employer $employer) { | 80 | public function comment_read(Employer $employer) { |
69 | return view('admin.employer.comment', compact('employer')); | 81 | return view('admin.employer.comment', compact('employer')); |
70 | } | 82 | } |
71 | 83 | ||
72 | public function form_update_employer(Employer $employer) { | 84 | public function form_update_employer(Employer $employer) { |
73 | $select_category = CategoryEmp::query()->active()->get(); | 85 | $select_category = CategoryEmp::query()->active()->get(); |
74 | return view('admin.employer.edit', compact('employer', 'select_category')); | 86 | return view('admin.employer.edit', compact('employer', 'select_category')); |
75 | } | 87 | } |
76 | 88 | ||
77 | public function update_employer(Employer $employer, Request $request) | 89 | public function update_employer(Employer $employer, Request $request) |
78 | { | 90 | { |
79 | $params = $request->all(); | 91 | $params = $request->all(); |
80 | unset($params['logo']); | 92 | unset($params['logo']); |
81 | unset($params['telephone']); | 93 | unset($params['telephone']); |
82 | unset($params['email']); | 94 | unset($params['email']); |
83 | unset($params['address']); | 95 | unset($params['address']); |
84 | unset($params['site']); | 96 | unset($params['site']); |
85 | unset($params['status_hidden']); | 97 | unset($params['status_hidden']); |
86 | unset($params['oficial_status']); | 98 | unset($params['oficial_status']); |
87 | unset($params['social_is']); | 99 | unset($params['social_is']); |
88 | unset($params['sending_is']); | 100 | unset($params['sending_is']); |
89 | unset($params['category']); | 101 | unset($params['category']); |
90 | unset($params['comment_admin']); | 102 | unset($params['comment_admin']); |
91 | 103 | ||
92 | $rules = [ | 104 | $rules = [ |
93 | 'name' => 'required|string|max:255', | 105 | 'name' => 'required|string|max:255', |
94 | ]; | 106 | ]; |
95 | 107 | ||
96 | $messages = [ | 108 | $messages = [ |
97 | 'required' => 'Укажите обязательное поле «:attribute»', | 109 | 'required' => 'Укажите обязательное поле «:attribute»', |
98 | 'confirmed' => 'Пароли не совпадают', | 110 | 'confirmed' => 'Пароли не совпадают', |
99 | 'email' => 'Введите корректный email', | 111 | 'email' => 'Введите корректный email', |
100 | 'min' => [ | 112 | 'min' => [ |
101 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', | 113 | 'string' => 'Поле «:attribute» должно быть не меньше :min символов', |
102 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' | 114 | 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' |
103 | ], | 115 | ], |
104 | 'max' => [ | 116 | 'max' => [ |
105 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', | 117 | 'string' => 'Поле «:attribute» должно быть не больше :max символов', |
106 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' | 118 | 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' |
107 | ], | 119 | ], |
108 | ]; | 120 | ]; |
109 | 121 | ||
110 | $validator = Validator::make($params, $rules, $messages); | 122 | $validator = Validator::make($params, $rules, $messages); |
111 | 123 | ||
112 | if ($validator->fails()) { | 124 | if ($validator->fails()) { |
113 | return back()->withErrors($validator)->withInput(); //->route('admin.register') | 125 | return back()->withErrors($validator)->withInput(); //->route('admin.register') |
114 | 126 | ||
115 | } else { | 127 | } else { |
116 | 128 | ||
117 | //$user = User::find($employer->user_id); | 129 | //$user = User::find($employer->user_id); |
118 | $user_id = $employer->user_id; | 130 | $user_id = $employer->user_id; |
119 | $employer->telephone = $request->telephone; | 131 | $employer->telephone = $request->telephone; |
120 | $employer->email = $request->email; | 132 | $employer->email = $request->email; |
121 | $employer->address = $request->address; | 133 | $employer->address = $request->address; |
122 | $employer->site = $request->site; | 134 | $employer->site = $request->site; |
123 | $employer->text = $request->text; | 135 | $employer->text = $request->text; |
124 | $employer->status_hidden = $request->status_hidden; | 136 | $employer->status_hidden = $request->status_hidden; |
125 | $employer->oficial_status = $request->oficial_status; | 137 | $employer->oficial_status = $request->oficial_status; |
126 | $employer->social_is = $request->social_is; | 138 | $employer->social_is = $request->social_is; |
127 | $employer->sending_is = $request->sending_is; | 139 | $employer->sending_is = $request->sending_is; |
128 | $employer->category = $request->category; | 140 | $employer->category = $request->category; |
129 | $employer->comment_admin = $request->comment_admin; | 141 | $employer->comment_admin = $request->comment_admin; |
130 | 142 | ||
131 | if ($request->has('logo')) { | 143 | if ($request->has('logo')) { |
132 | if (!empty($employer->logo)) { | 144 | if (!empty($employer->logo)) { |
133 | Storage::delete($employer->logo); | 145 | Storage::delete($employer->logo); |
134 | } | 146 | } |
135 | $employer->logo = $request->file('logo')->store("employer/$user_id", 'public'); | 147 | $employer->logo = $request->file('logo')->store("employer/$user_id", 'public'); |
136 | } | 148 | } |
137 | $employer->save(); | 149 | $employer->save(); |
138 | 150 | ||
139 | $user = User::find($user_id); | 151 | $user = User::find($user_id); |
140 | $user->update($params); | 152 | $user->update($params); |
141 | 153 | ||
142 | return redirect()->route('admin.employer-profile', ['employer' => $employer->id]) | 154 | return redirect()->route('admin.employer-profile', ['employer' => $employer->id]) |
143 | ->with('success', 'Данные были успешно сохранены'); | 155 | ->with('success', 'Данные были успешно сохранены'); |
144 | } | 156 | } |
145 | } | 157 | } |
146 | 158 | ||
147 | // Удаление работодателя, вакансий и профиля юзера | 159 | // Удаление работодателя, вакансий и профиля юзера |
148 | public function delete_employer(Employer $employer, User $user) { | 160 | public function delete_employer(Employer $employer, User $user) { |
149 | try { | 161 | try { |
150 | if (!empty($employer)) { | 162 | if (!empty($employer)) { |
151 | if (!empty($employer->logo)) { | 163 | if (!empty($employer->logo)) { |
152 | Storage::delete($employer->logo); | 164 | Storage::delete($employer->logo); |
153 | } | 165 | } |
154 | 166 | ||
155 | foreach($employer->ads as $ad) { | 167 | foreach($employer->ads as $ad) { |
156 | $ads = Ad_employer::find($ad->id); | 168 | $ads = Ad_employer::find($ad->id); |
157 | $ads->employer_id = 2; | 169 | $ads->employer_id = 2; |
158 | $ads->is_remove = 1; | 170 | $ads->is_remove = 1; |
159 | $ads->save(); | 171 | $ads->save(); |
160 | } | 172 | } |
161 | 173 | ||
162 | $employer->delete(); | 174 | $employer->delete(); |
163 | } | 175 | } |
164 | } finally { | 176 | } finally { |
165 | $user->delete(); | 177 | $user->delete(); |
166 | } | 178 | } |
167 | 179 | ||
168 | return redirect()->route('admin.employers')->with('success', 'Данные были удалены о работодателе'); | 180 | return redirect()->route('admin.employers')->with('success', 'Данные были удалены о работодателе'); |
169 | } | 181 | } |
170 | 182 | ||
171 | // кабинет - отзывы о работодателе для модерации | 183 | // кабинет - отзывы о работодателе для модерации |
172 | public function answers(Request $request) { | 184 | public function answers(Request $request) { |
173 | if ($request->ajax()) { | 185 | if ($request->ajax()) { |
174 | $user = Answer::find($request->id); | 186 | $user = Answer::find($request->id); |
175 | $request->offsetUnset('id'); | 187 | $request->offsetUnset('id'); |
176 | $user->update($request->all()); | 188 | $user->update($request->all()); |
177 | } | 189 | } |
178 | 190 | ||
179 | $answers = Answer::query()->orderByDesc('id')->paginate(15); | 191 | $answers = Answer::query()->orderByDesc('id')->paginate(15); |
180 | 192 | ||
181 | if ($request->ajax()) { | 193 | if ($request->ajax()) { |
182 | return view('admin.answers.index_ajax', compact('answers')); | 194 | return view('admin.answers.index_ajax', compact('answers')); |
183 | } else { | 195 | } else { |
184 | return view('admin.answers.index', compact('answers')); | 196 | return view('admin.answers.index', compact('answers')); |
185 | } | 197 | } |
186 | } | 198 | } |
187 | 199 | ||
188 | // кабинет - статистика вакансий работодателя | 200 | // кабинет - статистика вакансий работодателя |
189 | public function static_ads(Request $request) { | 201 | public function static_ads(Request $request) { |
190 | $stat = Static_ad::with('ads'); | 202 | $stat = Static_ad::with('ads'); |
191 | $ads = Ad_employer::query()->active()->OrderBy('id')->get(); | 203 | $ads = Ad_employer::query()->active()->OrderBy('id')->get(); |
192 | $periods = Static_ad::query()->distinct('year_month')->select('year_month')->get(); | 204 | $periods = Static_ad::query()->distinct('year_month')->select('year_month')->get(); |
193 | if ($request->ajax()) { | 205 | if ($request->ajax()) { |
194 | if (isset($request->ad_employer_id)) | 206 | if (isset($request->ad_employer_id)) |
195 | if (!$request->ad_employer_id == "0") | 207 | if (!$request->ad_employer_id == "0") |
196 | $stat = $stat->Where('ad_employer_id', '=', $request->ad_employer_id); | 208 | $stat = $stat->Where('ad_employer_id', '=', $request->ad_employer_id); |
197 | if (isset($request->year_month)) { | 209 | if (isset($request->year_month)) { |
198 | if (!$request->year_month == "0") | 210 | if (!$request->year_month == "0") |
199 | $stat = $stat->Where('year_month', '=', $request->year_month); | 211 | $stat = $stat->Where('year_month', '=', $request->year_month); |
200 | } | 212 | } |
201 | } | 213 | } |
202 | 214 | ||
203 | $stat = $stat->OrderByDesc('year_month'); | 215 | $stat = $stat->OrderByDesc('year_month'); |
204 | $stat = $stat->paginate(15); | 216 | $stat = $stat->paginate(15); |
205 | 217 | ||
206 | if ($request->ajax()) | 218 | if ($request->ajax()) |
207 | return view('admin.static.index_ads_ajax', compact('stat')); | 219 | return view('admin.static.index_ads_ajax', compact('stat')); |
208 | else | 220 | else |
209 | return view('admin.static.index_ads', compact('stat', 'ads', 'periods')); | 221 | return view('admin.static.index_ads', compact('stat', 'ads', 'periods')); |
210 | 222 | ||
211 | } | 223 | } |
212 | 224 | ||
213 | 225 | ||
214 | } | 226 | } |
215 | 227 |
resources/views/admin/education/form.blade.php
1 | @csrf | 1 | @csrf |
2 | 2 | ||
3 | @isset($education) | 3 | @isset($education) |
4 | @method('PUT') | 4 | @method('PUT') |
5 | @endisset | 5 | @endisset |
6 | 6 | ||
7 | <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> | 7 | <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> |
8 | <form method="POST" action="{{ route('admin.education.update', ['education' => $education->id]) }}" enctype="multipart/form-data"> | 8 | <form method="POST" action="{{ route('admin.education.update', ['education' => $education->id]) }}" enctype="multipart/form-data"> |
9 | <label class="block text-sm"> | 9 | <label class="block text-sm"> |
10 | <span class="text-gray-700 dark:text-gray-400">Название учебного заведения</span> | 10 | <span class="text-gray-700 dark:text-gray-400">Название учебного заведения</span> |
11 | <input name="name" id="name" | 11 | <input name="name" id="name" |
12 | class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" | 12 | class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" |
13 | placeholder="Название учебного заведения" value="{{ old('name') ?? $education->name ?? '' }}" | 13 | placeholder="Название учебного заведения" value="{{ old('name') ?? $education->name ?? '' }}" |
14 | /> | 14 | /> |
15 | @error('name') | 15 | @error('name') |
16 | <span class="text-xs text-red-600 dark:text-red-400"> | 16 | <span class="text-xs text-red-600 dark:text-red-400"> |
17 | {{ $message }} | 17 | {{ $message }} |
18 | </span> | 18 | </span> |
19 | @enderror | 19 | @enderror |
20 | </label><br> | 20 | </label><br> |
21 | 21 | ||
22 | <label class="block text-sm"> | 22 | <label class="block text-sm"> |
23 | <span class="text-gray-700 dark:text-gray-400">Адрес</span> | ||
24 | <input name="address" id="address" | ||
25 | 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" | ||
26 | placeholder="Адрес" value="{{ old('address') ?? $education->address ?? '' }}" | ||
27 | /> | ||
28 | @error('address') | ||
29 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
30 | {{ $message }} | ||
31 | </span> | ||
32 | @enderror | ||
33 | </label><br> | ||
34 | |||
35 | <label class="block text-sm"> | ||
36 | <span class="text-gray-700 dark:text-gray-400">Email</span> | ||
37 | <input name="email" id="email" | ||
38 | 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" | ||
39 | placeholder="Email" value="{{ old('email') ?? $education->email ?? '' }}" | ||
40 | /> | ||
41 | @error('email') | ||
42 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
43 | {{ $message }} | ||
44 | </span> | ||
45 | @enderror | ||
46 | </label><br> | ||
47 | |||
48 | <label class="block text-sm"> | ||
49 | <span class="text-gray-700 dark:text-gray-400">Телефон</span> | ||
50 | <input name="telephone" id="telephone" | ||
51 | 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" | ||
52 | placeholder="Телефон" value="{{ old('telephone') ?? $education->telephone ?? '' }}" | ||
53 | /> | ||
54 | @error('telephone') | ||
55 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
56 | {{ $message }} | ||
57 | </span> | ||
58 | @enderror | ||
59 | </label><br> | ||
60 | |||
61 | <label class="block text-sm"> | ||
62 | <span class="text-gray-700 dark:text-gray-400">Текст</span> | 23 | <span class="text-gray-700 dark:text-gray-400">Текст</span> |
63 | <textarea 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 ckeditor_" name="text" placeholder="Текст (html)" required | 24 | <textarea 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 ckeditor_" name="text" placeholder="Текст (html)" required |
64 | rows="10">{{ old('text') ?? $education->text ?? '' }}</textarea> | 25 | rows="10">{{ old('text') ?? $education->text ?? '' }}</textarea> |
65 | @error('text') | 26 | @error('text') |
66 | <span class="text-xs text-red-600 dark:text-red-400"> | 27 | <span class="text-xs text-red-600 dark:text-red-400"> |
67 | {{ $message }} | 28 | {{ $message }} |
68 | </span> | 29 | </span> |
69 | @enderror | 30 | @enderror |
70 | </label><br> | 31 | </label><br> |
71 | 32 | ||
72 | <label class="block text-sm"> | 33 | <label class="block text-sm"> |
73 | <span class="text-gray-700 dark:text-gray-400">Картинка</span> | 34 | <span class="text-gray-700 dark:text-gray-400">Картинка</span> |
74 | <input type="file" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 | 35 | <input type="file" class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 |
75 | focus:border-purple-400 focus:outline-none focus:shadow-outline-purple | 36 | focus:border-purple-400 focus:outline-none focus:shadow-outline-purple |
76 | dark:text-gray-300 dark:focus:shadow-outline-gray form-input" | 37 | dark:text-gray-300 dark:focus:shadow-outline-gray form-input" |
77 | id="image" name="image" accept="image/png, image/jpeg"> | 38 | id="image" name="image" accept="image/png, image/jpeg"> |
78 | @error('image') | 39 | @error('image') |
79 | <span class="text-xs text-red-600 dark:text-red-400"> | 40 | <span class="text-xs text-red-600 dark:text-red-400"> |
80 | {{ $message }} | 41 | {{ $message }} |
81 | </span> | 42 | </span> |
82 | @enderror | 43 | @enderror |
83 | @isset($education->image) | 44 | @isset($education->image) |
84 | <img src="{{asset(Storage::url($education->image))}}" width="100px"/> | 45 | <img src="{{asset(Storage::url($education->image))}}" width="100px"/> |
85 | @endisset | 46 | @endisset |
86 | </label><br> | 47 | </label><br> |
87 | 48 | ||
49 | <hr> | ||
50 | <h5 class="text-gray-700 dark:text-gray-400">Контакты: </h5> | ||
51 | <label class="block text-sm"> | ||
52 | <span class="text-gray-700 dark:text-gray-400">Адрес</span> | ||
53 | <input name="address" id="address" | ||
54 | 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" | ||
55 | placeholder="Адрес" value="{{ old('address') ?? $education->address ?? '' }}" | ||
56 | /> | ||
57 | @error('address') | ||
58 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
59 | {{ $message }} | ||
60 | </span> | ||
61 | @enderror | ||
62 | </label><br> | ||
63 | |||
64 | <label class="block text-sm"> | ||
65 | <span class="text-gray-700 dark:text-gray-400">Email</span> | ||
66 | <input name="email" id="email" | ||
67 | 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" | ||
68 | placeholder="Email" value="{{ old('email') ?? $education->email ?? '' }}" | ||
69 | /> | ||
70 | @error('email') | ||
71 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
72 | {{ $message }} | ||
73 | </span> | ||
74 | @enderror | ||
75 | </label><br> | ||
76 | |||
77 | <label class="block text-sm"> | ||
78 | <span class="text-gray-700 dark:text-gray-400">Телефон</span> | ||
79 | <input name="telephone" id="telephone" | ||
80 | 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" | ||
81 | placeholder="Телефон" value="{{ old('telephone') ?? $education->telephone ?? '' }}" | ||
82 | /> | ||
83 | @error('telephone') | ||
84 | <span class="text-xs text-red-600 dark:text-red-400"> | ||
85 | {{ $message }} | ||
86 | </span> | ||
87 | @enderror | ||
88 | </label><br> | ||
89 | |||
88 | <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> | 90 | <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> |
89 | <div> | 91 | <div> |
90 | <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"> | 92 | <button type="submit" class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"> |
91 | Сохранить | 93 | Сохранить |
92 | </button> | 94 | </button> |
93 | <a href="{{ route('admin.education.index') }}" | 95 | <a href="{{ route('admin.education.index') }}" |
94 | class="px-3 py-1 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" | 96 | 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" |
95 | style="display: -webkit-inline-box; height: 30px!important;" | 97 | style="display: -webkit-inline-box; height: 30px!important;" |
96 | >Назад</a> | 98 | >Назад</a> |
97 | </div> | 99 | </div> |
98 | </div> | 100 | </div> |
99 | </form> | 101 | </form> |
100 | 102 | ||
101 | @isset($education) | 103 | @isset($education) |
102 | <hr> | 104 | <hr> |
105 | <h5 class="text-gray-700 dark:text-gray-400">Специалитеты и категории:</h5> | ||
103 | <form method="GET" action="{{ route('admin.add-program-education') }}"> | 106 | <form method="GET" action="{{ route('admin.add-program-education') }}"> |
104 | <label class="block text-sm"> | 107 | <label class="block text-sm"> |
105 | <span class="text-gray-700 dark:text-gray-400">Категория образования</span> | 108 | <span class="text-gray-700 dark:text-gray-400">Категория образования</span> |
106 | <input type="hidden" name="id" value="{{ $education->id }}"/> | 109 | <input type="hidden" name="id" value="{{ $education->id }}"/> |
107 | <input name="level" id="level" | 110 | <input name="level" id="level" |
108 | 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" | 111 | 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" |
109 | placeholder="Новое образование" value="" | 112 | placeholder="Новое образование" value="" |
110 | /><br> | 113 | /><br> |
111 | <button type="submit" id="btn_education" name="btn_education" 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"> | 114 | <button type="submit" id="btn_education" name="btn_education" 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"> |
112 | Добавить | 115 | Добавить |
113 | </button> | 116 | </button> |
114 | </label><br> | 117 | </label><br> |
115 | </form> | 118 | </form> |
116 | <hr> | 119 | <hr> |
117 | @if ($program->count()) | 120 | @if ($program->count()) |
118 | @php $bool = true; | 121 | @php $bool = true; |
119 | $i = 1; | 122 | $i = 1; |
120 | $level = ""; | 123 | $level = ""; |
121 | @endphp | 124 | @endphp |
122 | 125 | ||
123 | @foreach ($program as $pro) | 126 | @foreach ($program as $pro) |
124 | @if ((!empty($level)) && ($level <> $pro->level )) | 127 | @if ((!empty($level)) && ($level <> $pro->level )) |
resources/views/admin/education/index.blade.php
1 | @extends('layout.admin', ['title' => 'Админка - Справочник образование']) | 1 | @extends('layout.admin', ['title' => 'Админка - Справочник образование']) |
2 | 2 | ||
3 | @section('script') | 3 | @section('script') |
4 | 4 | ||
5 | @endsection | 5 | @endsection |
6 | 6 | ||
7 | @section('search') | 7 | @section('search') |
8 | 8 | ||
9 | @endsection | 9 | @endsection |
10 | 10 | ||
11 | @section('content') | 11 | @section('content') |
12 | 12 | ||
13 | <a href="{{ route('admin.education.create') }}" style="width: 195px" 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"> | 13 | <a href="{{ route('admin.education.create') }}" style="width: 195px" 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"> |
14 | Добавить образование | 14 | Добавить образование |
15 | </a> | 15 | </a> |
16 | <br> | 16 | <br> |
17 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> | 17 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> |
18 | 18 | ||
19 | <div class="w-full overflow-x-auto"> | 19 | <div class="w-full overflow-x-auto"> |
20 | <table class="w-full whitespace-no-wrap"> | 20 | <table class="w-full whitespace-no-wrap"> |
21 | <thead> | 21 | <thead> |
22 | <tr | 22 | <tr |
23 | 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" | 23 | 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" |
24 | > | 24 | > |
25 | <th class="px-4 py-3">№</th> | 25 | <th class="px-4 py-3">№</th> |
26 | <th class="px-4 py-3">Название образования</th> | 26 | <th class="px-4 py-3">Название образования</th> |
27 | <th class="px-4 py-3">Редактировать</th> | 27 | <th class="px-4 py-3">Редактировать</th> |
28 | <th class="px-4 py-3">Дата создания</th> | 28 | <th class="px-4 py-3">Дата создан/изменен</th> |
29 | </tr> | 29 | </tr> |
30 | </thead> | 30 | </thead> |
31 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> | 31 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> |
32 | @foreach($education as $cat) | 32 | @foreach($education as $cat) |
33 | <tr class="text-gray-700 dark:text-gray-400"> | 33 | <tr class="text-gray-700 dark:text-gray-400"> |
34 | <td class="px-4 py-3"> | 34 | <td class="px-4 py-3"> |
35 | {{$cat->id}} | 35 | {{$cat->id}} |
36 | </td> | 36 | </td> |
37 | <td class="px-4 py-3"> | 37 | <td class="px-4 py-3"> |
38 | {{ mb_strimwidth($cat->name, 0, 50, "...") }} | 38 | {{ mb_strimwidth($cat->name, 0, 50, "...") }} |
39 | </td> | 39 | </td> |
40 | 40 | ||
41 | <td class="px-4 py-3 text-sm_"> | 41 | <td class="px-4 py-3 text-sm_"> |
42 | <form action="{{ route('admin.education.destroy', ['education' => $cat->id]) }}" method="POST"> | 42 | <form action="{{ route('admin.education.destroy', ['education' => $cat->id]) }}" method="POST"> |
43 | <a href="{{ route('admin.education.edit', ['education' => $cat->id]) }}">Изменить</a> | | 43 | <a href="{{ route('admin.education.edit', ['education' => $cat->id]) }}">Изменить</a> | |
44 | @csrf | 44 | @csrf |
45 | @method('DELETE') | 45 | @method('DELETE') |
46 | <input class="btn btn-danger" type="submit" value="Удалить"/> | 46 | <input class="btn btn-danger" type="submit" value="Удалить"/> |
47 | </form> | 47 | </form> |
48 | </td> | 48 | </td> |
49 | <td class="px-4 py-3"> | 49 | <td class="px-4 py-3"> |
50 | {{ date('d.m.Y', strtotime($cat->created_at))}} | 50 | <div class="flex items-center text-sm"> |
51 | <div> | ||
52 | <p class="font-semibold">{{ date('d.m.Y', strtotime($cat->created_at)) }}</p> | ||
53 | <p class="text-xs text-gray-600 dark:text-gray-400"> | ||
54 | {{ date('d.m.Y', strtotime($cat->updated_at)) }} | ||
55 | </p> | ||
56 | </div> | ||
57 | </div> | ||
51 | </td> | 58 | </td> |
52 | </tr> | 59 | </tr> |
53 | @endforeach | 60 | @endforeach |
54 | </tbody> | 61 | </tbody> |
55 | </table> | 62 | </table> |
56 | </div> | 63 | </div> |
57 | 64 | ||
58 | <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 | <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"> |
59 | <?=$education->appends($_GET)->links('admin.pagginate'); ?> | 66 | <?=$education->appends($_GET)->links('admin.pagginate'); ?> |
60 | </div> | 67 | </div> |
61 | </div> | 68 | </div> |
62 | @endsection | 69 | @endsection |
63 | 70 |
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 | <script> | 39 | <script> |
40 | const btns = document.querySelectorAll('.btn_del'); | 40 | const btns = document.querySelectorAll('.btn_del'); |
41 | btns.forEach(btn => { | 41 | btns.forEach(btn => { |
42 | btn.addEventListener('click', (e) => { | 42 | btn.addEventListener('click', (e) => { |
43 | console.log('click button'); | 43 | console.log('click button'); |
44 | let id = e.target.id; | 44 | let id = e.target.id; |
45 | let form = document.getElementById("form_modal_del"); | 45 | let form = document.getElementById("form_modal_del"); |
46 | form.action = "<?=$_SERVER['APP_URL']?>public/admin/employers/delete/"+e.target.getAttribute('data-employer')+'/'+e.target.getAttribute('data-user'); | 46 | form.action = "<?=$_SERVER['APP_URL']?>public/admin/employers/delete/"+e.target.getAttribute('data-employer')+'/'+e.target.getAttribute('data-user'); |
47 | //document.getElementById("title_modal").innerHTML = id; | 47 | //document.getElementById("title_modal").innerHTML = id; |
48 | console.log(e.target.getAttribute('data-employer')); | 48 | console.log(e.target.getAttribute('data-employer')); |
49 | console.log(e.target.getAttribute('data-user')); | 49 | console.log(e.target.getAttribute('data-user')); |
50 | 50 | ||
51 | }); | 51 | }); |
52 | }); | 52 | }); |
53 | </script> | 53 | </script> |
54 | @endsection | 54 | @endsection |
55 | 55 | ||
56 | @section('search') | 56 | @section('search') |
57 | @include('admin.find_employer', ['select_category' => $select_category]) | 57 | @include('admin.find_employer', ['select_category' => $select_category]) |
58 | @endsection | 58 | @endsection |
59 | 59 | ||
60 | @section('modal') | 60 | @section('modal') |
61 | @include('admin.employer.modal') | 61 | @include('admin.employer.modal') |
62 | @endsection | 62 | @endsection |
63 | 63 | ||
64 | @section('content') | 64 | @section('content') |
65 | <div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-4"> | 65 | <div class="grid gap-6 mb-8 md:grid-cols-2 xl:grid-cols-4"> |
66 | 66 | ||
67 | <div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800"> | 67 | <div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800"> |
68 | <div class="p-3 mr-4 text-orange-500 bg-orange-100 rounded-full dark:text-orange-100 dark:bg-orange-500"> | 68 | <div class="p-3 mr-4 text-orange-500 bg-orange-100 rounded-full dark:text-orange-100 dark:bg-orange-500"> |
69 | <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> | 69 | <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> |
70 | <path | 70 | <path |
71 | d="M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z"></path> | 71 | d="M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z"></path> |
72 | </svg> | 72 | </svg> |
73 | </div> | 73 | </div> |
74 | <div> | 74 | <div> |
75 | <p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400"> | 75 | <p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400"> |
76 | Всего работодателей | 76 | Всего работодателей |
77 | </p> | 77 | </p> |
78 | <p class="text-lg font-semibold text-gray-700 dark:text-gray-200"> | 78 | <p class="text-lg font-semibold text-gray-700 dark:text-gray-200"> |
79 | {{ $all_employer }} | 79 | {{ $all_employer }} |
80 | </p> | 80 | </p> |
81 | </div> | 81 | </div> |
82 | </div> | 82 | </div> |
83 | |||
84 | <div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800"> | ||
85 | <div class="p-3 mr-4 text-orange-500 bg-orange-100 rounded-full dark:text-orange-100 dark:bg-orange-500"> | ||
86 | <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> | ||
87 | <path | ||
88 | d="M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z"></path> | ||
89 | </svg> | ||
90 | </div> | ||
91 | <div> | ||
92 | <p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400"> | ||
93 | Опубликованых | ||
94 | </p> | ||
95 | <p class="text-lg font-semibold text-gray-700 dark:text-gray-200"> | ||
96 | {{ $all_public }} | ||
97 | </p> | ||
98 | </div> | ||
99 | </div> | ||
100 | |||
101 | <div class="flex items-center p-4 bg-white rounded-lg shadow-xs dark:bg-gray-800"> | ||
102 | <div class="p-3 mr-4 text-orange-500 bg-orange-100 rounded-full dark:text-orange-100 dark:bg-orange-500"> | ||
103 | <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> | ||
104 | <path | ||
105 | d="M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z"></path> | ||
106 | </svg> | ||
107 | </div> | ||
108 | <div> | ||
109 | <p class="mb-2 text-sm font-medium text-gray-600 dark:text-gray-400"> | ||
110 | На рассмотрении | ||
111 | </p> | ||
112 | <p class="text-lg font-semibold text-gray-700 dark:text-gray-200"> | ||
113 | {{ $all_status }} | ||
114 | </p> | ||
115 | </div> | ||
116 | </div> | ||
83 | </div> | 117 | </div> |
84 | 118 | ||
85 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> | 119 | <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> |
86 | <div class="w-full overflow-x-auto"> | 120 | <div class="w-full overflow-x-auto"> |
87 | <table class="w-full whitespace-no-wrap"> | 121 | <table class="w-full whitespace-no-wrap"> |
88 | <thead> | 122 | <thead> |
89 | <tr | 123 | <tr |
90 | 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" | 124 | 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" |
91 | > | 125 | > |
92 | <th class="px-4 py-3">№</th> | 126 | <th class="px-4 py-3">№</th> |
127 | <th class="px-4 py-3">ID</th> | ||
93 | <th class="px-4 py-3">Лого</th> | 128 | <th class="px-4 py-3">Лого</th> |
94 | <th class="px-4 py-3">Название компании/Email/Тел/Пароль</th> | 129 | <th class="px-4 py-3">Компания/Email/Тел/Пароль</th> |
95 | <th class="px-4 py-3">Категория</th> | 130 | <th class="px-4 py-3">Категория</th> |
96 | <th class="px-4 py-3">Комментарий</th> | 131 | <th class="px-4 py-3">Коммент.</th> |
97 | <th class="px-4 py-3">Дата регистрации</th> | 132 | <th class="px-4 py-3">Дата регист.</th> |
98 | <th class="px-4 py-3">Редакт.</th> | 133 | <th class="px-4 py-3">Редакт.</th> |
99 | </tr> | 134 | </tr> |
100 | </thead> | 135 | </thead> |
101 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> | 136 | <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> |
102 | @foreach($users as $user) | 137 | @foreach($users as $user) |
103 | <tr class="text-gray-700 dark:text-gray-400"> | 138 | <tr class="text-gray-700 dark:text-gray-400"> |
104 | <td class="px-4 py-3"> | 139 | <td class="px-4 py-3"> |
105 | {{$user->id}} | 140 | {{$user->id}} |
106 | </td> | 141 | </td> |
107 | <td class="px-4 py-3"> | 142 | <td class="px-4 py-3"> |
143 | @if (isset($user->code_id)) | ||
144 | {{$user->code_id}} | ||
145 | @endif | ||
146 | </td> | ||
147 | <td class="px-4 py-3"> | ||
108 | @if (isset($user->emp_logo) && ($user->emp_logo)) | 148 | @if (isset($user->emp_logo) && ($user->emp_logo)) |
109 | <div class="flex items-center text-sm"> | 149 | <div class="flex items-center text-sm"> |
110 | <div | 150 | <div |
111 | class="relative hidden w-8 h-8 mr-3 rounded-full md:block" | 151 | class="relative hidden w-8 h-8 mr-3 rounded-full md:block" |
112 | > | 152 | > |
113 | <img | 153 | <img |
114 | class="object-cover w-full h-full rounded-full" | 154 | class="object-cover w-full h-full rounded-full" |
115 | src="{{ asset(Storage::url($user->emp_logo)) }}" | 155 | src="{{ asset(Storage::url($user->emp_logo)) }}" |
116 | alt="" | 156 | alt="" |
117 | loading="lazy" | 157 | loading="lazy" |
118 | /> | 158 | /> |
119 | <div | 159 | <div |
120 | class="absolute inset-0 rounded-full shadow-inner" | 160 | class="absolute inset-0 rounded-full shadow-inner" |
121 | aria-hidden="true" | 161 | aria-hidden="true" |
122 | ></div> | 162 | ></div> |
123 | </div> | 163 | </div> |
124 | </div> | 164 | </div> |
125 | @else | 165 | @else |
126 | - | 166 | - |
127 | @endif | 167 | @endif |
128 | </td> | 168 | </td> |
129 | 169 | ||
130 | <td class="px-4 py-3"> | 170 | <td class="px-4 py-3"> |
131 | <div class="flex items-center text-sm"> | 171 | <div class="flex items-center text-sm"> |
132 | <div> | 172 | <div> |
133 | <p class="font-semibold">{{$user->name}}</p> | 173 | <p class="font-semibold">{{$user->name}}</p> |
134 | <p class="font-semibold">{{ empty($user->employers->email) ? $user->email : $user->employers->email }}</p> | 174 | <p class="font-semibold">{{ empty($user->employers->email) ? $user->email : $user->employers->email }}</p> |
135 | <p class="text-xs text-gray-600 dark:text-gray-400"> | 175 | <p class="text-xs text-gray-600 dark:text-gray-400"> |
136 | {{ empty($user->employers->telephone) ? $user->telephone : $user->employers->telephone }} | 176 | {{ empty($user->employers->telephone) ? $user->telephone : $user->employers->telephone }} |
137 | </p> | 177 | </p> |
138 | <p class="text-xs text-gray-600 dark:text-gray-400"> | 178 | <p class="text-xs text-gray-600 dark:text-gray-400"> |
139 | @if (!empty($user->pubpassword)) | 179 | @if (!empty($user->pubpassword)) |
140 | {{ base64_decode($user->pubpassword) }} | 180 | {{ base64_decode($user->pubpassword) }} |
141 | @endif | 181 | @endif |
142 | </p> | 182 | </p> |
143 | </div> | 183 | </div> |
144 | </div> | 184 | </div> |
145 | 185 | ||
146 | </td> | 186 | </td> |
147 | <td class="px-4 py-3 text-sm"> | 187 | <td class="px-4 py-3 text-sm"> |
148 | {{ $user->category }} | 188 | {{ $user->category }} |
149 | </td> | 189 | </td> |
150 | <td class="px-4 py-3 text-sm"> | 190 | <td class="px-4 py-3 text-sm"> |
151 | @if (!empty($user->comment_admin)) | 191 | @if (!empty($user->comment_admin)) |
152 | 192 | ||
153 | <a style="text-decoration: underline;" href="{{ route('admin.comment-employer', ['employer' => $user->emp_id]) }}">Есть</a> | 193 | <a style="text-decoration: underline;" href="{{ route('admin.comment-employer', ['employer' => $user->emp_id]) }}">Есть</a> |
154 | @else | 194 | @else |
155 | Нет | 195 | Нет |
156 | @endif | 196 | @endif |
157 | </td> | 197 | </td> |
158 | <td class="px-4 py-3 text-sm"> | 198 | <td class="px-4 py-3 text-sm"> |
159 | {{ date('d.m.Y', strtotime($user->created_at)) }} | 199 | {{ date('d.m.Y', strtotime($user->created_at)) }} |
160 | </td> | 200 | </td> |
161 | <td class="px-4 py-3 text-sm"> | 201 | <td class="px-4 py-3 text-sm"> |
162 | @if (!empty($user->emp_id)) | 202 | @if (!empty($user->emp_id)) |
163 | <a href="{{ route('admin.employer-profile', ['employer' => $user->emp_id]) }}">Изменить</a> | 203 | <a href="{{ route('admin.employer-profile', ['employer' => $user->emp_id]) }}">Изменить</a> |
164 | @if ($user->emp_id > 2) | <a @click="openModal" style="cursor: pointer;" data-employer="{{$user->emp_id}}" data-user="{{$user->user_id}}" class="btn_del btn btn-danger">Удалить</a> | 204 | @if ($user->emp_id > 2) | <a @click="openModal" style="cursor: pointer;" data-employer="{{$user->emp_id}}" data-user="{{$user->user_id}}" class="btn_del btn btn-danger">Удалить</a> |
165 | @endif | 205 | @endif |
166 | @endif | 206 | @endif |
167 | </td> | 207 | </td> |
168 | <!--<td class="px-4 py-3 text-sm"> | 208 | <!--<td class="px-4 py-3 text-sm"> |
169 | @if ($user->usr_id > 1) | 209 | @if ($user->usr_id > 1) |
170 | <input type="checkbox" class="checkban" value="{{$user->usr_id}}" name="ban_{{$user->usr_id}}" {{ ($user->is_ban) ? "checked" : "" }}/> | 210 | <input type="checkbox" class="checkban" value="{{$user->usr_id}}" name="ban_{{$user->usr_id}}" {{ ($user->is_ban) ? "checked" : "" }}/> |
171 | @endif | 211 | @endif |
172 | </td>--> | 212 | </td>--> |
173 | </tr> | 213 | </tr> |
174 | @endforeach | 214 | @endforeach |
175 | </tbody> | 215 | </tbody> |
176 | </table> | 216 | </table> |
177 | </div> | 217 | </div> |
178 | 218 | ||
179 | <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"> | 219 | <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"> |
180 | <?=$users->appends($_GET)->links('admin.pagginate'); ?> | 220 | <?=$users->appends($_GET)->links('admin.pagginate'); ?> |
181 | </div> | 221 | </div> |
182 | </div> | 222 | </div> |
183 | @endsection | 223 | @endsection |
184 | 224 |