Commit eae6b80f5e37e6189f28730d708fd22e457ae9b1

Authored by Андрей Ларионов
1 parent 50aa60b601

Работодатель лого

Showing 3 changed files with 10 additions and 8 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
22 if ($request->ajax()) { 22 if ($request->ajax()) {
23 $user = User::find($request->id); 23 $user = User::find($request->id);
24 $request->offsetUnset('id'); 24 $request->offsetUnset('id');
25 $user->update($request->all()); 25 $user->update($request->all());
26 } 26 }
27 27
28 $users = User::with('employers')->select(['users.*','users.id as usr_id', 'emp.id as emp_id', 'emp.*'])->join('employers as emp','emp.user_id','users.id') 28 $users = User::with('employers')->select(['users.*','users.id as usr_id', 'emp.id as emp_id', 'emp.logo as emp_logo', 'emp.*'])
29 ->join('employers as emp','emp.user_id','users.id')
29 ->where('users.is_worker', '0')->Realuser(); 30 ->where('users.is_worker', '0')->Realuser();
30 $all_employer = $users->count(); 31 $all_employer = $users->count();
31 32
32 $find_cat = ""; 33 $find_cat = "";
33 if (isset($request->category)) { 34 if (isset($request->category)) {
34 if ($request->category != 'Все категории') { 35 if ($request->category != 'Все категории') {
35 $users = $users->where('category', '=', $request->category); 36 $users = $users->where('category', '=', $request->category);
36 $find_cat = $request->category; 37 $find_cat = $request->category;
37 } 38 }
38 } 39 }
39 $find_key = ""; 40 $find_key = "";
40 41
41 if (isset($request->find)) { 42 if (isset($request->find)) {
42 $find_key = $request->find; 43 $find_key = $request->find;
43 $users = $users->where(function($query) use($find_key) { 44 $users = $users->where(function($query) use($find_key) {
44 $query->Where('users.name', 'LIKE', "%$find_key%") 45 $query->Where('users.name', 'LIKE', "%$find_key%")
45 ->orWhere('emp.email', 'LIKE', "%$find_key%") 46 ->orWhere('emp.email', 'LIKE', "%$find_key%")
46 ->orWhere('emp.telephone', 'LIKE', "%$find_key%"); 47 ->orWhere('emp.telephone', 'LIKE', "%$find_key%");
47 }); 48 });
48 } 49 }
49 50
50 //DB::enableQueryLog(); 51 //DB::enableQueryLog();
51 $users = $users->paginate(15); 52 $users = $users->paginate(15);
52 //dd(DB::getQueryLog()); 53 //dd(DB::getQueryLog());
53 54
54 $select_category = CategoryEmp::query()->active()->get(); 55 $select_category = CategoryEmp::query()->active()->get();
55 56
56 if ($request->ajax()) { 57 if ($request->ajax()) {
57 return view('admin.employer.index_ajax', compact('users')); 58 return view('admin.employer.index_ajax', compact('users'));
58 } else { 59 } else {
59 return view('admin.employer.index', compact('users', 'find_key', 'find_cat', 'all_employer', 'select_category')); 60 return view('admin.employer.index', compact('users', 'find_key', 'find_cat', 'all_employer', 'select_category'));
60 } 61 }
61 } 62 }
62 63
63 public function comment_read(Employer $employer) { 64 public function comment_read(Employer $employer) {
64 return view('admin.employer.comment', compact('employer')); 65 return view('admin.employer.comment', compact('employer'));
65 } 66 }
66 67
67 public function form_update_employer(Employer $employer) { 68 public function form_update_employer(Employer $employer) {
68 $select_category = CategoryEmp::query()->active()->get(); 69 $select_category = CategoryEmp::query()->active()->get();
69 return view('admin.employer.edit', compact('employer', 'select_category')); 70 return view('admin.employer.edit', compact('employer', 'select_category'));
70 } 71 }
71 72
72 public function update_employer(Employer $employer, Request $request) 73 public function update_employer(Employer $employer, Request $request)
73 { 74 {
74 $params = $request->all(); 75 $params = $request->all();
75 unset($params['logo']); 76 unset($params['logo']);
76 unset($params['telephone']); 77 unset($params['telephone']);
77 unset($params['email']); 78 unset($params['email']);
78 unset($params['address']); 79 unset($params['address']);
79 unset($params['site']); 80 unset($params['site']);
80 unset($params['status_hidden']); 81 unset($params['status_hidden']);
81 unset($params['oficial_status']); 82 unset($params['oficial_status']);
82 unset($params['social_is']); 83 unset($params['social_is']);
83 unset($params['sending_is']); 84 unset($params['sending_is']);
84 unset($params['category']); 85 unset($params['category']);
85 unset($params['comment_admin']); 86 unset($params['comment_admin']);
86 87
87 $rules = [ 88 $rules = [
88 'name' => 'required|string|max:255', 89 'name' => 'required|string|max:255',
89 ]; 90 ];
90 91
91 $messages = [ 92 $messages = [
92 'required' => 'Укажите обязательное поле «:attribute»', 93 'required' => 'Укажите обязательное поле «:attribute»',
93 'confirmed' => 'Пароли не совпадают', 94 'confirmed' => 'Пароли не совпадают',
94 'email' => 'Введите корректный email', 95 'email' => 'Введите корректный email',
95 'min' => [ 96 'min' => [
96 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 97 'string' => 'Поле «:attribute» должно быть не меньше :min символов',
97 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' 98 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт'
98 ], 99 ],
99 'max' => [ 100 'max' => [
100 'string' => 'Поле «:attribute» должно быть не больше :max символов', 101 'string' => 'Поле «:attribute» должно быть не больше :max символов',
101 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт' 102 'file' => 'Файл «:attribute» должен быть не больше :max Кбайт'
102 ], 103 ],
103 ]; 104 ];
104 105
105 $validator = Validator::make($params, $rules, $messages); 106 $validator = Validator::make($params, $rules, $messages);
106 107
107 if ($validator->fails()) { 108 if ($validator->fails()) {
108 return back()->withErrors($validator)->withInput(); //->route('admin.register') 109 return back()->withErrors($validator)->withInput(); //->route('admin.register')
109 110
110 } else { 111 } else {
111 112
112 //$user = User::find($employer->user_id); 113 //$user = User::find($employer->user_id);
113 $user_id = $employer->user_id; 114 $user_id = $employer->user_id;
114 $employer->telephone = $request->telephone; 115 $employer->telephone = $request->telephone;
115 $employer->email = $request->email; 116 $employer->email = $request->email;
116 $employer->address = $request->address; 117 $employer->address = $request->address;
117 $employer->site = $request->site; 118 $employer->site = $request->site;
118 $employer->text = $request->text; 119 $employer->text = $request->text;
119 $employer->status_hidden = $request->status_hidden; 120 $employer->status_hidden = $request->status_hidden;
120 $employer->oficial_status = $request->oficial_status; 121 $employer->oficial_status = $request->oficial_status;
121 $employer->social_is = $request->social_is; 122 $employer->social_is = $request->social_is;
122 $employer->sending_is = $request->sending_is; 123 $employer->sending_is = $request->sending_is;
123 $employer->category = $request->category; 124 $employer->category = $request->category;
124 $employer->comment_admin = $request->comment_admin; 125 $employer->comment_admin = $request->comment_admin;
125 126
126 if ($request->has('logo')) { 127 if ($request->has('logo')) {
127 if (!empty($employer->logo)) { 128 if (!empty($employer->logo)) {
128 Storage::delete($employer->logo); 129 Storage::delete($employer->logo);
129 } 130 }
130 $employer->logo = $request->file('logo')->store("employer/$user_id", 'public'); 131 $employer->logo = $request->file('logo')->store("employer/$user_id", 'public');
131 } 132 }
132 $employer->save(); 133 $employer->save();
133 134
134 $user = User::find($user_id); 135 $user = User::find($user_id);
135 $user->update($params); 136 $user->update($params);
136 137
137 return redirect()->route('admin.employer-profile', ['employer' => $employer->id]) 138 return redirect()->route('admin.employer-profile', ['employer' => $employer->id])
138 ->with('success', 'Данные были успешно сохранены'); 139 ->with('success', 'Данные были успешно сохранены');
139 } 140 }
140 } 141 }
141 142
142 // Удаление работодателя, вакансий и профиля юзера 143 // Удаление работодателя, вакансий и профиля юзера
143 public function delete_employer(Employer $employer, User $user) { 144 public function delete_employer(Employer $employer, User $user) {
144 try { 145 try {
145 if (!empty($employer)) { 146 if (!empty($employer)) {
146 $employer->ads()->delete(); 147 $employer->ads()->delete();
147 if (!empty($employer->logo)) { 148 if (!empty($employer->logo)) {
148 Storage::delete($employer->logo); 149 Storage::delete($employer->logo);
149 } 150 }
150 $employer->delete(); 151 $employer->delete();
151 } 152 }
152 } finally { 153 } finally {
153 $user->delete(); 154 $user->delete();
154 } 155 }
155 156
156 return redirect()->route('admin.employers')->with('success', 'Данные были удалены о работодателе'); 157 return redirect()->route('admin.employers')->with('success', 'Данные были удалены о работодателе');
157 } 158 }
158 159
159 // кабинет - отзывы о работодателе для модерации 160 // кабинет - отзывы о работодателе для модерации
160 public function answers(Request $request) { 161 public function answers(Request $request) {
161 if ($request->ajax()) { 162 if ($request->ajax()) {
162 $user = Answer::find($request->id); 163 $user = Answer::find($request->id);
163 $request->offsetUnset('id'); 164 $request->offsetUnset('id');
164 $user->update($request->all()); 165 $user->update($request->all());
165 } 166 }
166 167
167 $answers = Answer::query()->orderByDesc('id')->paginate(15); 168 $answers = Answer::query()->orderByDesc('id')->paginate(15);
168 169
169 if ($request->ajax()) { 170 if ($request->ajax()) {
170 return view('admin.answers.index_ajax', compact('answers')); 171 return view('admin.answers.index_ajax', compact('answers'));
171 } else { 172 } else {
172 return view('admin.answers.index', compact('answers')); 173 return view('admin.answers.index', compact('answers'));
173 } 174 }
174 } 175 }
175 176
176 // кабинет - статистика вакансий работодателя 177 // кабинет - статистика вакансий работодателя
177 public function static_ads(Request $request) { 178 public function static_ads(Request $request) {
178 $stat = Static_ad::with('ads'); 179 $stat = Static_ad::with('ads');
179 $ads = Ad_employer::query()->active()->OrderBy('id')->get(); 180 $ads = Ad_employer::query()->active()->OrderBy('id')->get();
180 $periods = Static_ad::query()->distinct('year_month')->select('year_month')->get(); 181 $periods = Static_ad::query()->distinct('year_month')->select('year_month')->get();
181 if ($request->ajax()) { 182 if ($request->ajax()) {
182 if (isset($request->ad_employer_id)) 183 if (isset($request->ad_employer_id))
183 if (!$request->ad_employer_id == "0") 184 if (!$request->ad_employer_id == "0")
184 $stat = $stat->Where('ad_employer_id', '=', $request->ad_employer_id); 185 $stat = $stat->Where('ad_employer_id', '=', $request->ad_employer_id);
185 if (isset($request->year_month)) { 186 if (isset($request->year_month)) {
186 if (!$request->year_month == "0") 187 if (!$request->year_month == "0")
187 $stat = $stat->Where('year_month', '=', $request->year_month); 188 $stat = $stat->Where('year_month', '=', $request->year_month);
188 } 189 }
189 } 190 }
190 191
191 $stat = $stat->OrderByDesc('year_month'); 192 $stat = $stat->OrderByDesc('year_month');
192 $stat = $stat->paginate(15); 193 $stat = $stat->paginate(15);
193 194
194 if ($request->ajax()) 195 if ($request->ajax())
195 return view('admin.static.index_ads_ajax', compact('stat')); 196 return view('admin.static.index_ads_ajax', compact('stat'));
196 else 197 else
197 return view('admin.static.index_ads', compact('stat', 'ads', 'periods')); 198 return view('admin.static.index_ads', compact('stat', 'ads', 'periods'));
198 199
199 } 200 }
200 201
201 202
202 } 203 }
203 204
resources/views/admin/employer/edit.blade.php
1 @extends('layout.admin', ['title' => 'Админка - Редактирование работодателя']) 1 @extends('layout.admin', ['title' => 'Админка - Редактирование работодателя'])
2 2
3 @section('content') 3 @section('content')
4 <h4 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"> 4 <h4 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300">
5 Работодатель-пользователь: "{{$employer->users->name_man}} ({{$employer->user_id}})" 5 Работодатель-пользователь: "{{$employer->users->name_man}} ({{$employer->user_id}})"
6 </h4> 6 </h4>
7 <form method="POST" action="" enctype="multipart/form-data"> 7 <form method="POST" action="" enctype="multipart/form-data">
8 <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"> 8 <div class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800">
9 @csrf 9 @csrf
10 <div class="tabs"> 10 <div class="tabs">
11 <input type="radio" name="tab-btn" id="tab-btn-1" value="" checked> 11 <input type="radio" name="tab-btn" id="tab-btn-1" value="" checked>
12 <label for="tab-btn-1">Персональная информация</label> 12 <label for="tab-btn-1">Персональная информация</label>
13 <input type="radio" name="tab-btn" id="tab-btn-2" value=""> 13 <input type="radio" name="tab-btn" id="tab-btn-2" value="">
14 <label for="tab-btn-2">Настройки</label> 14 <label for="tab-btn-2">Настройки</label>
15 <!--<input type="radio" name="tab-btn" id="tab-btn-3" value=""> 15 <!--<input type="radio" name="tab-btn" id="tab-btn-3" value="">
16 <label for="tab-btn-3">Вкладка 3</label>--> 16 <label for="tab-btn-3">Вкладка 3</label>-->
17 <div id="content-1"> 17 <div id="content-1">
18 18
19 <label class="block text-sm"> 19 <label class="block text-sm">
20 <span class="text-gray-700 dark:text-gray-400">Имя компании</span> 20 <span class="text-gray-700 dark:text-gray-400">Имя компании</span>
21 <input name="name" id="name" 21 <input name="name" id="name"
22 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" 22 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"
23 placeholder="Имя компании" value="{{ old('name') ?? $employer->users->name ?? '' }}" 23 placeholder="Имя компании" value="{{ old('name') ?? $employer->users->name ?? '' }}"
24 /> 24 />
25 @error('name') 25 @error('name')
26 <span class="text-xs text-red-600 dark:text-red-400"> 26 <span class="text-xs text-red-600 dark:text-red-400">
27 {{ $message }} 27 {{ $message }}
28 </span> 28 </span>
29 @enderror 29 @enderror
30 </label><br> 30 </label><br>
31 31
32 <label class="block text-sm"> 32 <label class="block text-sm">
33 <span class="text-gray-700 dark:text-gray-400">Email</span> 33 <span class="text-gray-700 dark:text-gray-400">Email</span>
34 <input name="email" id="email" 34 <input name="email" id="email"
35 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" 35 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"
36 placeholder="Почта" value="{{ old('email') ?? $employer->email ?? '' }}" 36 placeholder="Почта" value="{{ old('email') ?? $employer->email ?? '' }}"
37 /> 37 />
38 @error('email') 38 @error('email')
39 <span class="text-xs text-red-600 dark:text-red-400"> 39 <span class="text-xs text-red-600 dark:text-red-400">
40 {{ $message }} 40 {{ $message }}
41 </span> 41 </span>
42 @enderror 42 @enderror
43 </label><br> 43 </label><br>
44 44
45 <label class="block text-sm"> 45 <label class="block text-sm">
46 <span class="text-gray-700 dark:text-gray-400">Телефон</span> 46 <span class="text-gray-700 dark:text-gray-400">Телефон</span>
47 <input name="telephone" id="telephone" 47 <input name="telephone" id="telephone"
48 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" 48 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"
49 placeholder="Телефон" value="{{ old('telephone') ?? $employer->telephone ?? '' }}" 49 placeholder="Телефон" value="{{ old('telephone') ?? $employer->telephone ?? '' }}"
50 /> 50 />
51 @error('telephone') 51 @error('telephone')
52 <span class="text-xs text-red-600 dark:text-red-400"> 52 <span class="text-xs text-red-600 dark:text-red-400">
53 {{ $message }} 53 {{ $message }}
54 </span> 54 </span>
55 @enderror 55 @enderror
56 </label><br> 56 </label><br>
57 57
58 <label class="block text-sm"> 58 <label class="block text-sm">
59 <span class="text-gray-700 dark:text-gray-400">Адрес</span> 59 <span class="text-gray-700 dark:text-gray-400">Адрес</span>
60 <input name="address" id="address" 60 <input name="address" id="address"
61 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 61 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"
62 placeholder="Адрес" value="{{ old('address') ?? $employer->address ?? '' }}" 62 placeholder="Адрес" value="{{ old('address') ?? $employer->address ?? '' }}"
63 /> 63 />
64 @error('address') 64 @error('address')
65 <span class="text-xs text-red-600 dark:text-red-400"> 65 <span class="text-xs text-red-600 dark:text-red-400">
66 {{ $message }} 66 {{ $message }}
67 </span> 67 </span>
68 @enderror 68 @enderror
69 </label><br> 69 </label><br>
70 70
71 <label class="block text-sm"> 71 <label class="block text-sm">
72 <span class="text-gray-700 dark:text-gray-400">Сайт</span> 72 <span class="text-gray-700 dark:text-gray-400">Сайт</span>
73 <input name="site" id="site" 73 <input name="site" id="site"
74 class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input" 74 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"
75 placeholder="Сайт" value="{{ old('site') ?? $employer->site ?? '' }}" 75 placeholder="Сайт" value="{{ old('site') ?? $employer->site ?? '' }}"
76 /> 76 />
77 @error('site') 77 @error('site')
78 <span class="text-xs text-red-600 dark:text-red-400"> 78 <span class="text-xs text-red-600 dark:text-red-400">
79 {{ $message }} 79 {{ $message }}
80 </span> 80 </span>
81 @enderror 81 @enderror
82 </label><br> 82 </label><br>
83 83
84 <label class="block text-sm"> 84 <label class="block text-sm">
85 <span class="text-gray-700 dark:text-gray-400">Лого</span> 85 <span class="text-gray-700 dark:text-gray-400">Лого</span>
86 86
87 <input name="logo" id="logo" type="file" 87 <input name="logo" id="logo" type="file"
88 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" 88 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"
89 placeholder="Лого" value="" 89 placeholder="Лого" value=""
90 /> 90 />
91 @isset($employer->logo) 91 @isset($employer->logo)
92 <img src="<?=asset(Storage::url($employer->logo))?>" width="150"/> 92 <img src="<?=asset(Storage::url($employer->logo))?>" width="150"/>
93 @endisset 93 @endisset
94 @error('logo') 94 @error('logo')
95 <span class="text-xs text-red-600 dark:text-red-400"> 95 <span class="text-xs text-red-600 dark:text-red-400">
96 {{ $message }} 96 {{ $message }}
97 </span> 97 </span>
98 @enderror 98 @enderror
99 </label><br> 99 </label><br>
100 100
101 <label class="block mt-4 text-sm"> 101 <label class="block mt-4 text-sm">
102 <span class="text-gray-700 dark:text-gray-400">Описание</span> 102 <span class="text-gray-700 dark:text-gray-400">Описание</span>
103 <textarea name="text" id="text" 103 <textarea name="text" id="text"
104 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" 104 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"
105 rows="3" 105 rows="3"
106 placeholder="Описание компании" 106 placeholder="Описание компании"
107 >{{ old('text') ?? $employer->text ?? '' }}</textarea> 107 >{{ old('text') ?? $employer->text ?? '' }}</textarea>
108 </label> 108 </label>
109 109
110 <hr> 110 <hr>
111 111
112 <label class="block mt-4 text-sm"> 112 <label class="block mt-4 text-sm">
113 <span class="text-gray-700 dark:text-gray-400">Категории</span> 113 <span class="text-gray-700 dark:text-gray-400">Категории</span>
114 114
115 <select name="category" id="category" class="form-control"> 115 <select name="category" id="category" class="form-control">
116 @foreach($select_category as $cat) 116 @foreach($select_category as $cat)
117 <option value="{{ $cat->name }}" 117 <option value="{{ $cat->name }}"
118 @isset($employer) 118 @isset($employer)
119 @if($cat->name == $employer->category) 119 @if($cat->name == $employer->category)
120 selected 120 selected
121 @endif 121 @endif
122 @endisset 122 @endisset
123 >{{ $cat->name }}</option> 123 >{{ $cat->name }}</option>
124 @endforeach 124 @endforeach
125 </select> 125 </select>
126 126
127 @error('category') 127 @error('category')
128 <div class="alert alert-danger">{{ $message }}</div> 128 <div class="alert alert-danger">{{ $message }}</div>
129 @enderror 129 @enderror
130 </label> 130 </label>
131 131
132 <label class="block mt-4 text-sm"> 132 <label class="block mt-4 text-sm">
133 <span class="text-gray-700 dark:text-gray-400">Комментарий админа</span> 133 <span class="text-gray-700 dark:text-gray-400">Комментарий админа</span>
134 <textarea name="comment_admin" id="comment_admin" 134 <textarea name="comment_admin" id="comment_admin"
135 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" 135 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"
136 rows="3" 136 rows="3"
137 placeholder="Комментарий админа" 137 placeholder="Комментарий админа"
138 >{{ old('comment_admin') ?? $employer->comment_admin ?? '' }}</textarea> 138 >{{ old('comment_admin') ?? $employer->comment_admin ?? '' }}</textarea>
139 </label> 139 </label>
140 140
141 </div> 141 </div>
142 <div id="content-2"> 142 <div id="content-2">
143 <label class="block text-sm"> 143 <label class="block text-sm">
144 <h4 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"> 144 <h4 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300">
145 Права работодателя: 145 Права работодателя:
146 </h4> 146 </h4>
147 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Просмотр базы резюме </p> 147 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Просмотр базы резюме </p>
148 <input type="hidden" name="is_lookin" value="0" /> 148 <input type="hidden" name="is_lookin" value="0" />
149 <input name="is_lookin" <? if ($employer->users->is_lookin) echo "checked";?> 149 <input name="is_lookin" <? if ($employer->users->is_lookin) echo "checked";?>
150 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray " 150 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray "
151 placeholder="" type="checkbox" value="1" 151 placeholder="" type="checkbox" value="1"
152 /><br> 152 /><br>
153 153
154 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Отправка сообщений</p> 154 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Отправка сообщений</p>
155 <input type="hidden" name="is_message" value="0" /> 155 <input type="hidden" name="is_message" value="0" />
156 <input name="is_message" id="is_message" <? if ($employer->users->is_message) echo "checked";?> 156 <input name="is_message" id="is_message" <? if ($employer->users->is_message) echo "checked";?>
157 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray " 157 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray "
158 placeholder="" type="checkbox" value="1" 158 placeholder="" type="checkbox" value="1"
159 /><br> 159 /><br>
160 160
161 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Публикация вакансий</p> 161 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Публикация вакансий</p>
162 <input type="hidden" name="is_public" value="0" /> 162 <input type="hidden" name="is_public" value="0" />
163 <input name="is_public" id="is_public" <? if ($employer->users->is_public) echo "checked";?> 163 <input name="is_public" id="is_public" <? if ($employer->users->is_public) echo "checked";?>
164 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray " 164 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray "
165 placeholder="" type="checkbox" value="1" 165 placeholder="" type="checkbox" value="1"
166 /><br> 166 /><br>
167 167
168 </label> 168 </label>
169 169
170 <label class="block text-sm"> 170 <label class="block text-sm">
171 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Работодатель скрыт </p> 171 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Работодатель скрыт </p>
172 <input type="hidden" name="status_hidden" value="0" /> 172 <input type="hidden" name="status_hidden" value="0" />
173 <input name="status_hidden" <? if ($employer->status_hidden) echo "checked";?> 173 <input name="status_hidden" <? if ($employer->status_hidden) echo "checked";?>
174 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray " 174 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray "
175 placeholder="" type="checkbox" value="1" 175 placeholder="" type="checkbox" value="1"
176 /> 176 />
177 </label><br> 177 </label><br>
178 178
179 <label class="block text-sm"> 179 <label class="block text-sm">
180 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Компания подтверждена </p> 180 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Компания подтверждена </p>
181 <input type="hidden" name="oficial_status" value="0" /> 181 <input type="hidden" name="oficial_status" value="0" />
182 <input name="oficial_status" <? if ($employer->oficial_status) echo "checked";?> 182 <input name="oficial_status" <? if ($employer->oficial_status) echo "checked";?>
183 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray " 183 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray "
184 placeholder="" type="checkbox" value="1" 184 placeholder="" type="checkbox" value="1"
185 /> 185 />
186 </label><br> 186 </label><br>
187 187
188 <label class="block text-sm"> 188 <label class="block text-sm">
189 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Разрешение публикации в соц.сетях </p> 189 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Разрешение публикации в соц.сетях </p>
190 <input type="hidden" name="social_is" value="0" /> 190 <input type="hidden" name="social_is" value="0" />
191 <input name="social_is" <? if ($employer->social_is) echo "checked";?> 191 <input name="social_is" <? if ($employer->social_is) echo "checked";?>
192 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray " 192 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray "
193 placeholder="" type="checkbox" value="1" 193 placeholder="" type="checkbox" value="1"
194 /> 194 />
195 </label><br> 195 </label><br>
196 196
197 <label class="block text-sm"> 197 <label class="block text-sm">
198 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Рассылка </p> 198 <p class="text-gray-700 dark:text-gray-400" style="float:left; margin-right: 10px">Рассылка </p>
199 <input type="hidden" name="sending_is" value="0" /> 199 <input type="hidden" name="sending_is" value="0" />
200 <input name="sending_is" <? if ($employer->sending_is) echo "checked";?> 200 <input name="sending_is" <? if ($employer->sending_is) echo "checked";?>
201 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray " 201 class="block mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray "
202 placeholder="" type="checkbox" value="1" 202 placeholder="" type="checkbox" value="1"
203 /> 203 />
204 </label><br> 204 </label><br>
205 205
206 </div> 206 </div>
207 <div id="content-3"> 207 <div id="content-3">
208 Содержимое 3... 208 Содержимое 3...
209 </div> 209 </div>
210 </div> 210 </div>
211 <br> 211 <br>
212 <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4"> 212 <div class="flex flex-col flex-wrap mb-4 space-y-4 md:flex-row md:items-end md:space-x-4">
213 <div> 213 <div>
214 <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"> 214 <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">
215 Сохранить 215 Сохранить
216 </button> 216 </button>
217 <a href="{{ route('admin.employers') }}" 217 <a href="{{ route('admin.employers') }}"
218 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" 218 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"
219 style="display: -webkit-inline-box; height: 30px!important;" 219 style="display: -webkit-inline-box; height: 30px!important;"
220 >Назад</a> 220 >Назад</a>
221 221
222 </div> 222 </div>
223 <!--<div> 223 <!--<div>
224 <a href="">Флот</a> 224 <a href="">Флот</a>
225 </div> 225 </div>
226 <div> 226 <div>
227 <a href="">Вакансии</a> 227 <a href="">Вакансии</a>
228 </div> 228 </div>
229 <div> 229 <div>
230 <a href="">Контакты</a> 230 <a href="">Контакты</a>
231 </div>--> 231 </div>-->
232 </div> 232 </div>
233 </div> 233 </div>
234 </form> 234 </form>
235 <!-- 235 <!--
236 <label class="block mt-4 text-sm"> 236 <label class="block mt-4 text-sm">
237 <span class="text-gray-700 dark:text-gray-400"> 237 <span class="text-gray-700 dark:text-gray-400">
238 Requested Limit 238 Requested Limit
239 </span> 239 </span>
240 <select 240 <select
241 class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-select focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" 241 class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-select focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
242 > 242 >
243 <option>$1,000</option> 243 <option>$1,000</option>
244 <option>$5,000</option> 244 <option>$5,000</option>
245 <option>$10,000</option> 245 <option>$10,000</option>
246 <option>$25,000</option> 246 <option>$25,000</option>
247 </select> 247 </select>
248 </label> 248 </label>
249 249
250 <label class="block mt-4 text-sm"> 250 <label class="block mt-4 text-sm">
251 <span class="text-gray-700 dark:text-gray-400"> 251 <span class="text-gray-700 dark:text-gray-400">
252 Multiselect 252 Multiselect
253 </span> 253 </span>
254 <select 254 <select
255 class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-multiselect focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" 255 class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 form-multiselect focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
256 multiple 256 multiple
257 > 257 >
258 <option>Option 1</option> 258 <option>Option 1</option>
259 <option>Option 2</option> 259 <option>Option 2</option>
260 <option>Option 3</option> 260 <option>Option 3</option>
261 <option>Option 4</option> 261 <option>Option 4</option>
262 <option>Option 5</option> 262 <option>Option 5</option>
263 </select> 263 </select>
264 </label> 264 </label>
265 265
266 <label class="block mt-4 text-sm"> 266 <label class="block mt-4 text-sm">
267 <span class="text-gray-700 dark:text-gray-400">Message</span> 267 <span class="text-gray-700 dark:text-gray-400">Message</span>
268 <textarea 268 <textarea
269 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" 269 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"
270 rows="3" 270 rows="3"
271 placeholder="Enter some long form content." 271 placeholder="Enter some long form content."
272 ></textarea> 272 ></textarea>
273 </label> 273 </label>
274 274
275 <div class="flex mt-6 text-sm"> 275 <div class="flex mt-6 text-sm">
276 <label class="flex items-center dark:text-gray-400"> 276 <label class="flex items-center dark:text-gray-400">
277 <input 277 <input
278 type="checkbox" 278 type="checkbox"
279 class="text-purple-600 form-checkbox focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" 279 class="text-purple-600 form-checkbox focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
280 /> 280 />
281 <span class="ml-2"> 281 <span class="ml-2">
282 I agree to the 282 I agree to the
283 <span class="underline">privacy policy</span> 283 <span class="underline">privacy policy</span>
284 </span> 284 </span>
285 </label> 285 </label>
286 </div> 286 </div>
287 </div> 287 </div>
288 288
289 <!-- Validation inputs --> 289 <!-- Validation inputs -->
290 <!--<h4 290 <!--<h4
291 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300" 291 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"
292 > 292 >
293 Validation 293 Validation
294 </h4> 294 </h4>
295 <div 295 <div
296 class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800" 296 class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"
297 > 297 >
298 <!-- Invalid input --> 298 <!-- Invalid input -->
299 <!--<label class="block text-sm"> 299 <!--<label class="block text-sm">
300 <span class="text-gray-700 dark:text-gray-400"> 300 <span class="text-gray-700 dark:text-gray-400">
301 Invalid input 301 Invalid input
302 </span> 302 </span>
303 <input 303 <input
304 class="block w-full mt-1 text-sm border-red-600 dark:text-gray-300 dark:bg-gray-700 focus:border-red-400 focus:outline-none focus:shadow-outline-red form-input" 304 class="block w-full mt-1 text-sm border-red-600 dark:text-gray-300 dark:bg-gray-700 focus:border-red-400 focus:outline-none focus:shadow-outline-red form-input"
305 placeholder="Jane Doe" 305 placeholder="Jane Doe"
306 /> 306 />
307 <span class="text-xs text-red-600 dark:text-red-400"> 307 <span class="text-xs text-red-600 dark:text-red-400">
308 Your password is too short. 308 Your password is too short.
309 </span> 309 </span>
310 </label> 310 </label>
311 311
312 <!-- Valid input --> 312 <!-- Valid input -->
313 <!--<label class="block mt-4 text-sm"> 313 <!--<label class="block mt-4 text-sm">
314 <span class="text-gray-700 dark:text-gray-400"> 314 <span class="text-gray-700 dark:text-gray-400">
315 Valid input 315 Valid input
316 </span> 316 </span>
317 <input 317 <input
318 class="block w-full mt-1 text-sm border-green-600 dark:text-gray-300 dark:bg-gray-700 focus:border-green-400 focus:outline-none focus:shadow-outline-green form-input" 318 class="block w-full mt-1 text-sm border-green-600 dark:text-gray-300 dark:bg-gray-700 focus:border-green-400 focus:outline-none focus:shadow-outline-green form-input"
319 placeholder="Jane Doe" 319 placeholder="Jane Doe"
320 /> 320 />
321 <span class="text-xs text-green-600 dark:text-green-400"> 321 <span class="text-xs text-green-600 dark:text-green-400">
322 Your password is strong. 322 Your password is strong.
323 </span> 323 </span>
324 </label> 324 </label>
325 325
326 <!-- Helper text --> 326 <!-- Helper text -->
327 <!--<label class="block mt-4 text-sm"> 327 <!--<label class="block mt-4 text-sm">
328 <span class="text-gray-700 dark:text-gray-400"> 328 <span class="text-gray-700 dark:text-gray-400">
329 Helper text 329 Helper text
330 </span> 330 </span>
331 <input 331 <input
332 class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input" 332 class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input"
333 placeholder="Jane Doe" 333 placeholder="Jane Doe"
334 /> 334 />
335 <span class="text-xs text-gray-600 dark:text-gray-400"> 335 <span class="text-xs text-gray-600 dark:text-gray-400">
336 Your password must be at least 6 characters long. 336 Your password must be at least 6 characters long.
337 </span> 337 </span>
338 </label> 338 </label>
339 </div> 339 </div>
340 340
341 <!-- Inputs with icons --> 341 <!-- Inputs with icons -->
342 <!--<h4 342 <!--<h4
343 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300" 343 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"
344 > 344 >
345 Icons 345 Icons
346 </h4> 346 </h4>
347 <div 347 <div
348 class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800" 348 class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"
349 > 349 >
350 <label class="block text-sm"> 350 <label class="block text-sm">
351 <span class="text-gray-700 dark:text-gray-400">Icon left</span> 351 <span class="text-gray-700 dark:text-gray-400">Icon left</span>
352 <!-- focus-within sets the color for the icon when input is focused --> 352 <!-- focus-within sets the color for the icon when input is focused -->
353 <!--<div 353 <!--<div
354 class="relative text-gray-500 focus-within:text-purple-600 dark:focus-within:text-purple-400" 354 class="relative text-gray-500 focus-within:text-purple-600 dark:focus-within:text-purple-400"
355 > 355 >
356 <input 356 <input
357 class="block w-full pl-10 mt-1 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input" 357 class="block w-full pl-10 mt-1 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input"
358 placeholder="Jane Doe" 358 placeholder="Jane Doe"
359 /> 359 />
360 <div 360 <div
361 class="absolute inset-y-0 flex items-center ml-3 pointer-events-none" 361 class="absolute inset-y-0 flex items-center ml-3 pointer-events-none"
362 > 362 >
363 <svg 363 <svg
364 class="w-5 h-5" 364 class="w-5 h-5"
365 aria-hidden="true" 365 aria-hidden="true"
366 fill="none" 366 fill="none"
367 stroke-linecap="round" 367 stroke-linecap="round"
368 stroke-linejoin="round" 368 stroke-linejoin="round"
369 stroke-width="2" 369 stroke-width="2"
370 viewBox="0 0 24 24" 370 viewBox="0 0 24 24"
371 stroke="currentColor" 371 stroke="currentColor"
372 > 372 >
373 <path 373 <path
374 d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" 374 d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
375 ></path> 375 ></path>
376 </svg> 376 </svg>
377 </div> 377 </div>
378 </div> 378 </div>
379 </label> 379 </label>
380 380
381 <label class="block mt-4 text-sm"> 381 <label class="block mt-4 text-sm">
382 <span class="text-gray-700 dark:text-gray-400">Icon right</span> 382 <span class="text-gray-700 dark:text-gray-400">Icon right</span>
383 <!-- focus-within sets the color for the icon when input is focused --> 383 <!-- focus-within sets the color for the icon when input is focused -->
384 <!--<div 384 <!--<div
385 class="relative text-gray-500 focus-within:text-purple-600 dark:focus-within:text-purple-400" 385 class="relative text-gray-500 focus-within:text-purple-600 dark:focus-within:text-purple-400"
386 > 386 >
387 <input 387 <input
388 class="block w-full pr-10 mt-1 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input" 388 class="block w-full pr-10 mt-1 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input"
389 placeholder="Jane Doe" 389 placeholder="Jane Doe"
390 /> 390 />
391 <div 391 <div
392 class="absolute inset-y-0 right-0 flex items-center mr-3 pointer-events-none" 392 class="absolute inset-y-0 right-0 flex items-center mr-3 pointer-events-none"
393 > 393 >
394 <svg 394 <svg
395 class="w-5 h-5" 395 class="w-5 h-5"
396 aria-hidden="true" 396 aria-hidden="true"
397 fill="none" 397 fill="none"
398 stroke-linecap="round" 398 stroke-linecap="round"
399 stroke-linejoin="round" 399 stroke-linejoin="round"
400 stroke-width="2" 400 stroke-width="2"
401 viewBox="0 0 24 24" 401 viewBox="0 0 24 24"
402 stroke="currentColor" 402 stroke="currentColor"
403 > 403 >
404 <path 404 <path
405 d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" 405 d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
406 ></path> 406 ></path>
407 </svg> 407 </svg>
408 </div> 408 </div>
409 </div> 409 </div>
410 </label> 410 </label>
411 </div> 411 </div>
412 412
413 <!-- Inputs with buttons --> 413 <!-- Inputs with buttons -->
414 <!--<h4 414 <!--<h4
415 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300" 415 class="mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300"
416 > 416 >
417 Buttons 417 Buttons
418 </h4> 418 </h4>
419 <div 419 <div
420 class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800" 420 class="px-4 py-3 mb-8 bg-white rounded-lg shadow-md dark:bg-gray-800"
421 > 421 >
422 <label class="block text-sm"> 422 <label class="block text-sm">
423 <span class="text-gray-700 dark:text-gray-400"> 423 <span class="text-gray-700 dark:text-gray-400">
424 Button left 424 Button left
425 </span> 425 </span>
426 <div class="relative"> 426 <div class="relative">
427 <input 427 <input
428 class="block w-full pl-20 mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input" 428 class="block w-full pl-20 mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input"
429 placeholder="Jane Doe" 429 placeholder="Jane Doe"
430 /> 430 />
431 <button 431 <button
432 class="absolute inset-y-0 px-4 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-l-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray" 432 class="absolute inset-y-0 px-4 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-l-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray"
433 > 433 >
434 Click 434 Click
435 </button> 435 </button>
436 </div> 436 </div>
437 </label> 437 </label>
438 438
439 <label class="block mt-4 text-sm"> 439 <label class="block mt-4 text-sm">
440 <span class="text-gray-700 dark:text-gray-400"> 440 <span class="text-gray-700 dark:text-gray-400">
441 Button right 441 Button right
442 </span> 442 </span>
443 <div 443 <div
444 class="relative text-gray-500 focus-within:text-purple-600" 444 class="relative text-gray-500 focus-within:text-purple-600"
445 > 445 >
446 <input 446 <input
447 class="block w-full pr-20 mt-1 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input" 447 class="block w-full pr-20 mt-1 text-sm text-black dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input"
448 placeholder="Jane Doe" 448 placeholder="Jane Doe"
449 /> 449 />
450 <button 450 <button
451 class="absolute inset-y-0 right-0 px-4 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-r-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple" 451 class="absolute inset-y-0 right-0 px-4 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-r-md active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"
452 > 452 >
453 Click 453 Click
454 </button> 454 </button>
455 </div> 455 </div>
456 </label> 456 </label>
457 </div>--> 457 </div>-->
458 @endsection 458 @endsection
459 459
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 const 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['HTTP_REFERER']?>/delete/"+e.target.getAttribute('data-employer')+'/'+e.target.getAttribute('data-user'); 46 form.action = "<?=$_SERVER['HTTP_REFERER']?>/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 </div> 83 </div>
84 <pre> 84 <pre>
85 <?//print_r($_SERVER);?> 85 <?//print_r($_SERVER);?>
86 </pre> 86 </pre>
87 87
88 <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block"> 88 <div class="w-full overflow-hidden rounded-lg shadow-xs" id="ajax_block">
89 <div class="w-full overflow-x-auto"> 89 <div class="w-full overflow-x-auto">
90 <table class="w-full whitespace-no-wrap"> 90 <table class="w-full whitespace-no-wrap">
91 <thead> 91 <thead>
92 <tr 92 <tr
93 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" 93 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"
94 > 94 >
95 <th class="px-4 py-3">№</th> 95 <th class="px-4 py-3">№</th>
96 <th class="px-4 py-3">Название компании</th> 96 <th class="px-4 py-3">Название компании</th>
97 <th class="px-4 py-3">Лого</th> 97 <th class="px-4 py-3">Лого</th>
98 <th class="px-4 py-3">Email/Телефон</th> 98 <th class="px-4 py-3">Email/Телефон</th>
99 <th class="px-4 py-3">Категория</th> 99 <th class="px-4 py-3">Категория</th>
100 <th class="px-4 py-3">Комментарий</th> 100 <th class="px-4 py-3">Комментарий</th>
101 <th class="px-4 py-3">Дата регистрации</th> 101 <th class="px-4 py-3">Дата регистрации</th>
102 <th class="px-4 py-3">Редакт.</th> 102 <th class="px-4 py-3">Редакт.</th>
103 </tr> 103 </tr>
104 </thead> 104 </thead>
105 <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800"> 105 <tbody class="bg-white divide-y dark:divide-gray-700 dark:bg-gray-800">
106 @foreach($users as $user) 106 @foreach($users as $user)
107 <tr class="text-gray-700 dark:text-gray-400"> 107 <tr class="text-gray-700 dark:text-gray-400">
108 <td class="px-4 py-3"> 108 <td class="px-4 py-3">
109 {{$user->id}} 109 {{$user->id}}
110 </td> 110 </td>
111 <td class="px-4 py-3"> 111 <td class="px-4 py-3">
112 {{$user->name}} 112 {{$user->name}}
113 </td> 113 </td>
114 <td class="px-4 py-3"> 114 <td class="px-4 py-3">
115 @if (isset($user->employers[0]->logo) && ($user->employers[0]->logo)) 115
116 <img src="{{ asset(Storage::url($user->employers[0]->logo)) }}" style="width:50px"/> 116 @if (isset($user->emp_logo) && ($user->emp_logo))
117 <img src="{{ asset(Storage::url($user->emp_logo)) }}" style="width:50px"/>
117 @else 118 @else
118 - 119 -
119 @endif 120 @endif
120 </td> 121 </td>
121 <td class="px-4 py-3"> 122 <td class="px-4 py-3">
122 <div class="flex items-center text-sm"> 123 <div class="flex items-center text-sm">
123 <!--<div class="relative hidden w-8 h-8 mr-3 rounded-full md:block"> 124 <!--<div class="relative hidden w-8 h-8 mr-3 rounded-full md:block">
124 <div 125 <div
125 class="absolute inset-0 rounded-full shadow-inner" 126 class="absolute inset-0 rounded-full shadow-inner"
126 aria-hidden="true" 127 aria-hidden="true"
127 ></div> 128 ></div>
128 </div>--> 129 </div>-->
129 <div> 130 <div>
130 <p class="font-semibold">{{ empty($user->employers->email) ? $user->email : $user->employers->email }}</p> 131 <p class="font-semibold">{{ empty($user->employers->email) ? $user->email : $user->employers->email }}</p>
131 <p class="text-xs text-gray-600 dark:text-gray-400"> 132 <p class="text-xs text-gray-600 dark:text-gray-400">
132 {{ empty($user->employers->telephone) ? $user->telephone : $user->employers->telephone }} 133 {{ empty($user->employers->telephone) ? $user->telephone : $user->employers->telephone }}
133 </p> 134 </p>
134 </div> 135 </div>
135 </div> 136 </div>
136 137
137 </td> 138 </td>
138 <td class="px-4 py-3 text-sm"> 139 <td class="px-4 py-3 text-sm">
139 {{ $user->category }} 140 {{ $user->category }}
140 </td> 141 </td>
141 <td class="px-4 py-3 text-sm"> 142 <td class="px-4 py-3 text-sm">
142 @if (!empty($user->comment_admin)) 143 @if (!empty($user->comment_admin))
143 144
144 <a style="text-decoration: underline;" href="{{ route('admin.comment-employer', ['employer' => $user->id]) }}">Есть</a> 145 <a style="text-decoration: underline;" href="{{ route('admin.comment-employer', ['employer' => $user->emp_id]) }}">Есть</a>
145 @else 146 @else
146 Нет 147 Нет
147 @endif 148 @endif
148 </td> 149 </td>
149 <td class="px-4 py-3 text-sm"> 150 <td class="px-4 py-3 text-sm">
150 {{ date('d.m.Y', strtotime($user->created_at)) }} 151 {{ date('d.m.Y', strtotime($user->created_at)) }}
151 </td> 152 </td>
152 <td class="px-4 py-3 text-sm"> 153 <td class="px-4 py-3 text-sm">
153 @if (!empty($user->emp_id)) 154 @if (!empty($user->emp_id))
154 <a href="{{ route('admin.employer-profile', ['employer' => $user->emp_id]) }}">Изменить</a> | 155 <a href="{{ route('admin.employer-profile', ['employer' => $user->emp_id]) }}">Изменить</a> |
155 <a @click="openModal" style="cursor: pointer;" data-employer="{{$user->emp_id}}" data-user="{{$user->user_id}}" class="btn_del btn btn-danger">Удалить</a> 156 <a @click="openModal" style="cursor: pointer;" data-employer="{{$user->emp_id}}" data-user="{{$user->user_id}}" class="btn_del btn btn-danger">Удалить</a>
156 @endif 157 @endif
157 </td> 158 </td>
158 <!--<td class="px-4 py-3 text-sm"> 159 <!--<td class="px-4 py-3 text-sm">
159 @if ($user->usr_id > 1) 160 @if ($user->usr_id > 1)
160 <input type="checkbox" class="checkban" value="{{$user->usr_id}}" name="ban_{{$user->usr_id}}" {{ ($user->is_ban) ? "checked" : "" }}/> 161 <input type="checkbox" class="checkban" value="{{$user->usr_id}}" name="ban_{{$user->usr_id}}" {{ ($user->is_ban) ? "checked" : "" }}/>
161 @endif 162 @endif
162 </td>--> 163 </td>-->
163 </tr> 164 </tr>
164 @endforeach 165 @endforeach
165 </tbody> 166 </tbody>
166 </table> 167 </table>
167 </div> 168 </div>
168 169
169 <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"> 170 <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">
170 <?=$users->appends($_GET)->links('admin.pagginate'); ?> 171 <?=$users->appends($_GET)->links('admin.pagginate'); ?>
171 </div> 172 </div>
172 </div> 173 </div>
173 @endsection 174 @endsection
174 175