From 622420a678ad3ad0772755f7ecd929da84a5153c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=20=D0=9B=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D0=BE=D0=BD=D0=BE=D0=B2?= Date: Wed, 20 Sep 2023 21:16:12 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B0=D1=81=D1=88=D0=B8=D1=80=D0=B5=D0=BD=D0?= =?UTF-8?q?=B8=D0=B5=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=BE=D0=BD=D0=B0?= =?UTF-8?q?=D0=BB=D0=B0=20=D0=B0=D0=B4=D0=BC=D0=B8=D0=BD=D0=BA=D0=B8=20(=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D0=BE=D0=B4=D0=B0=D1=82=D0=B5=D0=BB=D0=B8?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Admin/EmployersController.php | 26 +- public/assets/css/tabs.css | 47 ++++ resources/views/admin/employer/edit.blade.php | 292 ++++++++++++-------- resources/views/admin/employer/index.blade.php | 6 +- resources/views/layout/admin.blade.php | 1 + 5 files changed, 248 insertions(+), 124 deletions(-) create mode 100644 public/assets/css/tabs.css diff --git a/app/Http/Controllers/Admin/EmployersController.php b/app/Http/Controllers/Admin/EmployersController.php index d407b63..b75c168 100644 --- a/app/Http/Controllers/Admin/EmployersController.php +++ b/app/Http/Controllers/Admin/EmployersController.php @@ -9,6 +9,7 @@ use App\Models\Employer; use App\Models\Static_ad; use App\Models\User; use Illuminate\Http\Request; +use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Validator; @@ -21,7 +22,7 @@ class EmployersController extends Controller $user->update($request->all()); } - $users = User::where('is_worker', '0'); + /*$users = User::with('employers')->where('is_worker', '0'); $find_key = ""; if (isset($request->find)) { $find_key = $request->find; @@ -30,8 +31,23 @@ class EmployersController extends Controller ->orWhere('email', 'LIKE', "%$find_key%") ->orWhere('telephone', 'LIKE', "%$find_key%"); }); + }*/ + + $users = User::select(['users.*', 'emp.id as emp_id', 'emp.*'])->join('employers as emp','emp.user_id','users.id') + ->where('users.is_worker', '0'); + $find_key = ""; + if (isset($request->find)) { + $find_key = $request->find; + $users = $users->where(function($query) use($find_key) { + $query->Where('users.name', 'LIKE', "%$find_key%") + ->orWhere('emp.email', 'LIKE', "%$find_key%") + ->orWhere('emp.telephone', 'LIKE', "%$find_key%"); + }); } + + //DB::enableQueryLog(); $users = $users->paginate(15); + //dd(DB::getQueryLog()); if ($request->ajax()) { return view('admin.employer.index_ajax', compact('users')); @@ -52,6 +68,10 @@ class EmployersController extends Controller unset($params['email']); unset($params['address']); unset($params['site']); + unset($params['status_hidden']); + unset($params['oficial_status']); + unset($params['social_is']); + unset($params['sending_is']); $rules = [ 'name' => 'required|string|max:255', @@ -85,6 +105,10 @@ class EmployersController extends Controller $employer->address = $request->address; $employer->site = $request->site; $employer->text = $request->text; + $employer->status_hidden = $request->status_hidden; + $employer->oficial_status = $request->oficial_status; + $employer->social_is = $request->social_is; + $employer->sending_is = $request->sending_is; if ($request->has('logo')) { if (!empty($employer->logo)) { diff --git a/public/assets/css/tabs.css b/public/assets/css/tabs.css new file mode 100644 index 0000000..ebd683f --- /dev/null +++ b/public/assets/css/tabs.css @@ -0,0 +1,47 @@ +.tabs { + font-size: 0; +} + +.tabs>input[type="radio"] { + display: none; +} + +.tabs>div { + /* скрыть контент по умолчанию */ + display: none; + border: 1px solid #e0e0e0; + padding: 10px 15px; + font-size: 16px; +} + +/* отобразить контент, связанный с вабранной радиокнопкой (input type="radio") */ +#tab-btn-1:checked~#content-1, +#tab-btn-2:checked~#content-2, +#tab-btn-3:checked~#content-3 { + display: block; +} + +.tabs>label { + display: inline-block; + text-align: center; + vertical-align: middle; + user-select: none; + background-color: #f5f5f5; + border: 1px solid #e0e0e0; + padding: 2px 8px; + font-size: 16px; + line-height: 1.5; + transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out; + cursor: pointer; + position: relative; + top: 1px; +} + +.tabs>label:not(:first-of-type) { + border-left: none; +} + +.tabs>input[type="radio"]:checked+label { + background-color: #fff; + border-bottom: 1px solid #fff; +} diff --git a/resources/views/admin/employer/edit.blade.php b/resources/views/admin/employer/edit.blade.php index 0504525..d3c7eaf 100644 --- a/resources/views/admin/employer/edit.blade.php +++ b/resources/views/admin/employer/edit.blade.php @@ -5,143 +5,195 @@ Работодатель-пользователь: "{{$employer->users->name_man}} ({{$employer->user_id}})"
- @csrf
-
+ @csrf +
+ + + + + +
+ +
-
+ /> + @error('email') + + {{ $message }} + + @enderror +
-
+
-
+
-
+
- +
+
+ + +
+ +
- +
+
-
-
- -
-
- Флот -
- -
+
+ Содержимое 3... +
+
+
+
+
+ +
+ +