Commit 09dcec17a0c7536292cf989f3cf98448e0b7f18f

Authored by Hayk Nazaryan
1 parent 880c0e9109
Exists in master

fixes

Showing 6 changed files with 83 additions and 24 deletions Side-by-side Diff

app/Http/Controllers/Admin/EmployersController.php
... ... @@ -31,7 +31,7 @@ class EmployersController extends Controller
31 31 ->where('users.is_worker', '0')
32 32 ->orderByDesc('emp.id')
33 33 ->Realuser();
34   - $all_employer = $users->count();
  34 + $all_employer = Employer::all()->count();
35 35  
36 36 $all_public = Employer::where('status_hidden', '=', '0')->
37 37 count();
... ... @@ -83,6 +83,7 @@ class EmployersController extends Controller
83 83 // Форма обновления
84 84 public function form_update_employer(Employer $employer) {
85 85 // данные
  86 +
86 87 $select_category = CategoryEmp::query()->active()->get();
87 88 $flots = Flot::query()->where('employer_id', '=', $employer->id)->get();
88 89 return view('admin.employer.edit', compact('employer', 'select_category', 'flots'));
... ... @@ -172,6 +173,7 @@ class EmployersController extends Controller
172 173  
173 174 //$user = User::find($employer->user_id);
174 175 $user_id = $employer->user_id;
  176 + $employer->name_company = $request->name;
175 177 $employer->telephone = $request->telephone;
176 178 $employer->email = $request->email;
177 179 $employer->address = $request->address;
... ... @@ -192,9 +194,6 @@ class EmployersController extends Controller
192 194 }
193 195 $employer->save();
194 196  
195   - $user = User::find($user_id);
196   - $user->update($params);
197   -
198 197 return redirect()->route('admin.employer-profile', ['employer' => $employer->id])
199 198 ->with('success', 'Данные были успешно сохранены');
200 199 }
app/Http/Controllers/EducationController.php
... ... @@ -11,6 +11,7 @@ class EducationController extends Controller
11 11 // Образование
12 12 public function index(Request $request) {
13 13 $educations = Education::query()->active();
  14 +
14 15 if (($request->has('search')) && (!empty($request->get('search')))) {
15 16 $search = trim($request->get('search'));
16 17 $educations = $educations->where('name', 'LIKE', "%$search%");
app/Http/Requests/FlotRequest.php
... ... @@ -26,12 +26,15 @@ class FlotRequest extends FormRequest
26 26 return [
27 27 'name' => 'required|min:3|max:255',
28 28 'text' => 'required|min:5',
29   - //'image' => [
30   - // 'mimes:jpeg,jpg,png',
31   - // 'max:20000'
32   - //],
33   - 'region' => 'required|min:3|max:255',
34   - 'power' => 'required|min:3|max:255'
  29 + 'image' => [
  30 + 'mimes:jpeg,jpg,png',
  31 + 'max:20000'
  32 + ],
  33 + 'region' => 'nullable|min:3|max:255',
  34 + 'power' => 'nullable|min:3|max:255',
  35 + 'DWT' => 'nullable|max:255',
  36 + 'POWER_GD' => 'nullable|max:255',
  37 + 'IMO' => 'nullable|max:255',
35 38 ];
36 39 }
37 40  
resources/views/admin/employer/edit.blade.php
... ... @@ -20,7 +20,7 @@
20 20 <span class="text-gray-700 dark:text-gray-400">Имя компании</span>
21 21 <input name="name" id="name"
22 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->name_company ?? '' }}"
24 24 />
25 25 @error('name')
26 26 <span class="text-xs text-red-600 dark:text-red-400">
resources/views/admin/flot/test.blade.php
... ... @@ -29,6 +29,66 @@
29 29 </span>
30 30 @enderror
31 31 </label><br>
  32 + <div class="form-group" style="display:none">
  33 + <label class="form-group__label">Описание</label>
  34 + <div class="form-group__item">
  35 + <input type="text" name="text" id="flot_text" class="input" placeholder="Это судно находится..." value="True info">
  36 + @error('text')
  37 + <span class="text-xs text-red-600">
  38 + {{ $message }}
  39 + </span>
  40 + @enderror
  41 + </div>
  42 + </div>
  43 + <div class="form-group" style="display:none">
  44 + <label class="form-group__label">Регион</label>
  45 + <div class="form-group__item">
  46 + <input type="text" name="region" id="region" class="input" placeholder="Мурманск" value="True Region">
  47 + @error('region')
  48 + <span class="text-xs text-red-600">
  49 + {{ $message }}
  50 + </span>
  51 + @enderror
  52 + </div>
  53 + </div>
  54 + <label class="block text-sm">
  55 + <span class="text-gray-700 dark:text-gray-400">DWT</span>
  56 + <input name="DWT" id="DWT"
  57 + 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"
  58 + placeholder="4000 т" value="{{ old('DWT') ?? $flot->DWT ?? '' }}"
  59 + />
  60 + @error('DWT')
  61 + <span class="text-xs text-red-600 dark:text-red-400">
  62 + {{ $message }}
  63 + </span>
  64 + @enderror
  65 + </label><br>
  66 +
  67 + <label class="block text-sm">
  68 + <span class="text-gray-700 dark:text-gray-400">Мощность ГД (кВт)</span>
  69 + <input name="POWER_GD" id="POWER_GD"
  70 + 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"
  71 + placeholder="14000 кВт" value="{{ old('POWER_GD') ?? $flot->POWER_GD ?? '' }}"
  72 + />
  73 + @error('POWER_GD')
  74 + <span class="text-xs text-red-600 dark:text-red-400">
  75 + {{ $message }}
  76 + </span>
  77 + @enderror
  78 + </label><br>
  79 +
  80 + <label class="block text-sm">
  81 + <span class="text-gray-700 dark:text-gray-400">IMO</span>
  82 + <input name="IMO" id="name"
  83 + 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"
  84 + placeholder="8814275" value="{{ old('IMO') ?? $flot->IMO ?? '' }}"
  85 + />
  86 + @error('IMO')
  87 + <span class="text-xs text-red-600 dark:text-red-400">
  88 + {{ $message }}
  89 + </span>
  90 + @enderror
  91 + </label><br>
32 92  
33 93 <label class="block text-sm">
34 94 <span class="text-gray-700 dark:text-gray-400">Картинка</span>
resources/views/education/show.blade.php
... ... @@ -75,19 +75,15 @@
75 75 @section('content')
76 76 <section class="thing">
77 77 <div class="container">
78   - <div class="flex-middle-sm row">
79   - <div class="col-xs-12 col-sm-12">
80   - <div class="candidate-top-wrapper">
81   - <div class="candidate-thumbnail">
82   - @if($education->image)
83   - <img width="150" height="150" src="{{ asset(Storage::url($education->image)) }}" alt="">
84   - @endif
85   - </div>
86   - <div class="candidate-information">
87   - <h1 class="candidate-title">{{$education->name}}</h1>
88   - </div>
89   - </div>
90   - </div>
  78 + <div class="thing__body">
  79 + <ul class="breadcrumbs thing__breadcrumbs">
  80 + <li><a href="{{ route('index') }}">Главная</a></li>
  81 + <li><a href="{{ route('education') }}">Образование</a></li>
  82 + <li><b>@isset($education->name) {{ $education->name }} @else Не указано @endif</b></li>
  83 + </ul>
  84 + <img src="@if (!empty($education->image)) {{ asset(Storage::url($education->image)) }} @else {{ asset('images/education.jpg') }} @endif" class="thing__pic" alt="{{ $education->name }}">
  85 +
  86 + <h1 class="thing__title">{{ $education->name }}</h1>
91 87 </div>
92 88 </div>
93 89 </section>