Commit e20c428e580828101514a2432c34f14df3f71465

Authored by Андрей Ларионов
1 parent 5faf37074a

Коммит по 20 числу

Showing 9 changed files with 66 additions and 43 deletions Side-by-side Diff

app/Http/Controllers/EmployerController.php
... ... @@ -372,7 +372,7 @@ class EmployerController extends Controller
372 372 //'name_man' => ['required', 'string', 'max:255'],
373 373 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
374 374 'name_company' => ['required', 'string', 'max:255'],
375   - 'password' => ['required', 'string', 'min:8'],
  375 + 'password' => ['required', 'string', 'min:6'],
376 376 ];
377 377  
378 378  
... ... @@ -399,10 +399,10 @@ class EmployerController extends Controller
399 399 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
400 400 }
401 401  
402   - if (strlen($request->get('password')) < 8) {
  402 + if (strlen($request->get('password')) < 6) {
403 403 return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
404 404 }
405   -
  405 + /*
406 406 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?');
407 407 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z',
408 408 'X', 'C', 'V', 'B', 'N', 'M');
... ... @@ -425,7 +425,7 @@ class EmployerController extends Controller
425 425  
426 426 if ((!$spec_bool) || (!$alpha_bool)) {
427 427 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?"));
428   - }
  428 + }*/
429 429  
430 430 if (empty($request->get('surname'))) {
431 431 $params['surname'] = 'Неизвестно';
... ... @@ -592,11 +592,12 @@ class EmployerController extends Controller
592 592  
593 593 // Данные
594 594 $users = $users->Baseuser()->
595   - orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id'))->
596   - paginate(5);
  595 + orderBy(Worker::select('position_work')->whereColumn('Workers.user_id', 'users.id'));
  596 + $count_users = $users;
  597 + $users = $users->paginate(5);
597 598  
598 599  
599   - return view('employers.bd', compact('users'));
  600 + return view('employers.bd', compact('users', 'count_users'));
600 601 }
601 602  
602 603 //Настройка уведомлений
app/Http/Controllers/WorkerController.php
... ... @@ -188,6 +188,7 @@ class WorkerController extends Controller
188 188  
189 189 view()->share('Query',$Query);
190 190  
  191 +
191 192 $pdf = PDF::loadView('layout.pdf', $Query); //->setPaper('a4', 'landscape');
192 193  
193 194 return $pdf->stream();
... ... @@ -197,7 +198,11 @@ class WorkerController extends Controller
197 198 $status_work = $this->status_work;
198 199 $Query = Worker::query()->with('users')->with('job_titles')
199 200 ->with('place_worker')->with('sertificate')->with('prev_company')
200   - ->with('infobloks');
  201 + ->with('infobloks')->
  202 + whereHas('users', function (Builder $query) {
  203 + $query->Where('is_worker', '=', '1')
  204 + ->Where('is_bd', '=', '1');
  205 + });
201 206 //$Query = $Query->where('id', '=', $worker->id);
202 207 $Query = $Query->get()->toArray();
203 208  
... ... @@ -471,7 +476,7 @@ class WorkerController extends Controller
471 476 'surname' => ['required', 'string', 'max:255'],
472 477 'name_man' => ['required', 'string', 'max:255'],
473 478 'email' => ['required', 'email', 'max:255', 'unique:users'],
474   - 'password' => ['required', 'string', 'min:8']
  479 + 'password' => ['required', 'string', 'min:6']
475 480 ];
476 481  
477 482 $messages = [
... ... @@ -497,7 +502,11 @@ class WorkerController extends Controller
497 502 return json_encode(Array("ERROR" => "Error: Не совпадают пароль и подтверждение пароля"));
498 503 }
499 504  
500   - $haystack = $request->get('password');
  505 + if (strlen($request->get('password')) < 6) {
  506 + return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
  507 + }
  508 +
  509 + /*$haystack = $request->get('password');
501 510  
502 511 $specsumbol = Array('!','~', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', ';', ':', '<', '>', '?');
503 512 $alpha = Array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z',
... ... @@ -520,13 +529,9 @@ class WorkerController extends Controller
520 529 }
521 530 }
522 531  
523   - if (!$lenpwd_bool) {
524   - return json_encode(Array("ERROR" => "Error: Недостаточная длина пароля! Увеличьте себе длину пароля!"));
525   - }
526   -
527 532 if ((!$spec_bool) || (!$alpha_bool)) {
528 533 return json_encode(Array("ERROR" => "Error: Нет спецсимволов в пароле, латинские буквы заглавные, а также один из символов: !~#$%^&*()-=;,:<>?"));
529   - }
  534 + }*/
530 535  
531 536 if (($request->has('politik')) && ($request->get('politik') == 1)) {
532 537 $validator = Validator::make($params, $rules, $messages);
public/css/style.css
... ... @@ -1058,7 +1058,7 @@ h1 {
1058 1058 }
1059 1059 .input[disabled] {
1060 1060 color: #9c9d9d;
1061   - background: #e7e7e7;
  1061 + /*background: #e7e7e7;*/
1062 1062 }
1063 1063 .input[type=date] {
1064 1064 text-transform: uppercase;
resources/views/employers/bd.blade.php
... ... @@ -80,7 +80,7 @@
80 80 </div>
81 81 <span>
82 82 Всего вакансий найдено:
83   - <b>{{ $users->count() }}</b>
  83 + <b>{{ $count_users->count() }}</b>
84 84 </span>
85 85 </div>
86 86 <div class="table table_spoiler">
resources/views/employers/fly-flot.blade.php
... ... @@ -57,7 +57,7 @@
57 57  
58 58 <div class="cabinet__add-body">
59 59 <div class="form-group">
60   - <label class="form-group__label">Название корабля</label>
  60 + <label class="form-group__label">Название</label>
61 61 <div class="form-group__item">
62 62 <input type="text" name="name" id="flot_name" class="input" placeholder="Корабль №000001" required>
63 63 @error('name')
... ... @@ -112,7 +112,7 @@
112 112 </div>
113 113 </div>
114 114 <div class="form-group">
115   - <label class="form-group__label">Мощность ГД</label>
  115 + <label class="form-group__label">Мощность ГД (кВт)</label>
116 116 <div class="form-group__item">
117 117 <input type="text" name="POWER_GD" id="flot_POWER_GD" class="input" placeholder="14000 кВт">
118 118 @error('POWER_GD')
... ... @@ -156,7 +156,7 @@
156 156 <b>{{ $it->name }}</b>
157 157 <!--<span> $it->region }}</span>-->
158 158 <span><i>DWT</i>{{ $it->DWT }}</span>
159   - <span><i>Мощность ГД</i>{{ $it->POWER_GD }}</span>
  159 + <span><i>Мощность ГД (кВт)</i>{{ $it->POWER_GD }}</span>
160 160 <span><i>IMO</i>{{ $it->IMO }}</span>
161 161 <!--<span> $it->power }}</span>-->
162 162 </div>
resources/views/layout/pdf-list-people.blade.php
... ... @@ -6,7 +6,7 @@
6 6 <title>Резюме соискателя</title>
7 7 <meta name="viewport" content="width=device-width,initial-scale=1">
8 8 <meta name="theme-color" content="#377D87">
9   - <link rel="stylesheet" href="{{ asset('css/style.css') }}">
  9 + <!--<link rel="stylesheet" href=" asset('css/style.css') }}">-->
10 10 <style>
11 11 body {
12 12 font-family:'DejaVu Sans',sans-serif;
... ... @@ -181,15 +181,23 @@
181 181 <section class="thing thing_pdf">
182 182 <div class="container">
183 183 <div class="thing__profile">
184   - <img src="{{ asset(Storage::url($Q['photo'])) }}" alt="" class="thing__profile-photo">
  184 + @if (!empty($Q['photo']))
  185 + <img src="{{ asset(Storage::url($Q['photo'])) }}" alt="" class="thing__profile-photo">
  186 + @else
  187 + <img src="{{ asset('images/default_man.jpg') }}" alt="" class="thing__profile-photo">
  188 + @endif
185 189 <div class="thing__profile-body">
186 190 <h1 class="thing__title">@if (isset($Q['users']['surname'])) {{ $Q['users']['surname']." ".$Q['users']['name_man']." ".$Q['users']['surname2'] }} @endif</h1>
187 191 <div style="clear:both;"></div>
188 192 <p class="thing__text">{{ $Q['text'] }}</p>
189 193 </div>
190 194 </div>
  195 + @if (!empty($Q['users']['file']))
  196 + <a href="{{ asset(Storage::url($Q['users']['file'])) }}">Анкета-файл</a>
  197 + @endif
191 198 </div>
192 199 </section>
  200 +
193 201 <main class="main">
194 202 <div class="container">
195 203  
resources/views/layout/pdf.blade.php
... ... @@ -179,13 +179,20 @@
179 179 <section class="thing thing_pdf">
180 180 <div class="container">
181 181 <div class="thing__profile">
182   - <img src="{{ asset(Storage::url($Query[0]['photo'])) }}" alt="" class="thing__profile-photo">
  182 + @if (!empty($Query[0]['photo']))
  183 + <img src="{{ asset(Storage::url($Query[0]['photo'])) }}" alt="" class="thing__profile-photo">
  184 + @else
  185 + <img src="{{ asset('images/default_man.jpg') }}" alt="" class="thing__profile-photo">
  186 + @endif
183 187 <div class="thing__profile-body">
184 188 <h1 class="thing__title">{{ $Query[0]['users']['surname']." ".$Query[0]['users']['name_man']." ".$Query[0]['users']['surname2'] }}</h1>
185 189 <div style="clear:both;"></div>
186 190 <p class="thing__text">{{ $Query[0]['text'] }}</p>
187 191 </div>
188 192 </div>
  193 + @if (!empty($Query[0]['users']['file']))
  194 + <a href="{{ asset(Storage::url($Query[0]['users']['file'])) }}">Анкета-файл</a>
  195 + @endif
189 196 </div>
190 197 </section>
191 198 <main class="main">
resources/views/workers/cabinet.blade.php
... ... @@ -307,17 +307,17 @@
307 307 <select class="js-select2" name="job_title_id[]" id="job_title_id[]" multiple="multiple">
308 308 @if ($Job_titles->count())
309 309 @foreach($Job_titles as $it)
  310 + @php $selected = false; @endphp
310 311 @if (isset($Worker[0]->job_titles))
311 312 @if ($Worker[0]->job_titles->count())
312 313 @foreach($Worker[0]->job_titles as $select)
313   - <option value="{{ $it->id }}" @if ($it->id == $select->id) selected @endif>{{ $it->name }}</option>
  314 + @if ($it->id == $select->id)
  315 + @php $selected = true; @endphp
  316 + @endif
314 317 @endforeach
315   - @else
316   - <option value="{{ $it->id }}">{{ $it->name }} ({{ $it->id }})</option>
317 318 @endif
318   - @else
319   - <option value="{{ $it->id }}">{{ $it->name }} ({{ $it->id }})</option>
320 319 @endif
  320 + <option value="{{ $it->id }}" @if ($selected) selected @endif>{{ $it->name }}</option>
321 321 @endforeach
322 322 @endif
323 323 </select>
... ... @@ -389,7 +389,7 @@
389 389 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
390 390 <label class="form-group__label">Название сертификата:</label>
391 391 <div class="form-group__item">
392   - <input type="text" class="input" value="{{ $it->name }}" >
  392 + <input type="text" class="input" value="{{ $it->name }}" disabled>
393 393 </div>
394 394 </div>
395 395 <!--<div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
... ... @@ -401,7 +401,7 @@
401 401 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
402 402 <label class="form-group__label">Действителен до:</label>
403 403 <div class="form-group__item">
404   - <input type="text" class="input" value="{{ $it->end_begin }}">
  404 + <input type="text" class="input" value="{{ $it->end_begin }}" disabled>
405 405 </div>
406 406 </div>
407 407 <a href="{{ route('worker.delete_sertificate', ['doc' => $it->id]) }}" class="button button_light">
... ... @@ -530,7 +530,7 @@
530 530 <div class="cabinet__inputs-item form-group">
531 531 <label class="form-group__label">Должность</label>
532 532 <div class="form-group__item">
533   - <input type="text" class="input" value="{{ $company->job_title }}">
  533 + <input type="text" class="input" value="{{ $company->job_title }}" disabled>
534 534 </div>
535 535 </div>
536 536 <!--<div class="cabinet__inputs-item form-group">
... ... @@ -542,49 +542,49 @@
542 542 <div class="cabinet__inputs-item form-group">
543 543 <label class="form-group__label">Название т/х</label>
544 544 <div class="form-group__item">
545   - <input type="text" class="input" value="{{ $company->teplohod }}">
  545 + <input type="text" class="input" value="{{ $company->teplohod }}" disabled>
546 546 </div>
547 547 </div>
548 548 <div class="cabinet__inputs-item form-group">
549 549 <label class="form-group__label">Тип суда (GWT)</label>
550 550 <div class="form-group__item">
551   - <input type="text" class="input" value="{{ $company->GWT }}">
  551 + <input type="text" class="input" value="{{ $company->GWT }}" disabled>
552 552 </div>
553 553 </div>
554 554 <div class="cabinet__inputs-item form-group">
555 555 <label class="form-group__label">Марка ГД</label>
556 556 <div class="form-group__item">
557   - <input type="text" class="input" value="{{ $company->Marka_GD }}">
  557 + <input type="text" class="input" value="{{ $company->Marka_GD }}" disabled>
558 558 </div>
559 559 </div>
560 560 <div class="cabinet__inputs-item form-group">
561 561 <label class="form-group__label">Мощность ГД (кВТ)</label>
562 562 <div class="form-group__item">
563   - <input type="text" class="input" value="{{ $company->KBT }}">
  563 + <input type="text" class="input" value="{{ $company->KBT }}" disabled>
564 564 </div>
565 565 </div>
566 566 <div class="cabinet__inputs-item form-group">
567 567 <label class="form-group__label">Водоизмещение (GRT)</label>
568 568 <div class="form-group__item">
569   - <input type="text" class="input" value="{{ $company->GRT }}">
  569 + <input type="text" class="input" value="{{ $company->GRT }}" disabled>
570 570 </div>
571 571 </div>
572 572 <div class="cabinet__inputs-item form-group">
573 573 <label class="form-group__label">Название компании</label>
574 574 <div class="form-group__item">
575   - <input type="text" class="input" value="{{ $company->name_company }}">
  575 + <input type="text" class="input" value="{{ $company->name_company }}" disabled>
576 576 </div>
577 577 </div>
578 578 <div class="cabinet__inputs-item form-group">
579 579 <label class="form-group__label">Начало контракта</label>
580 580 <div class="form-group__item">
581   - <input type="text" class="input" value="{{ $company->begin_work }}">
  581 + <input type="text" class="input" value="{{ $company->begin_work }}" disabled>
582 582 </div>
583 583 </div>
584 584 <div class="cabinet__inputs-item form-group">
585 585 <label class="form-group__label">Окончание контракта</label>
586 586 <div class="form-group__item">
587   - <input type="text" class="input" value="{{ $company->end_work }}">
  587 + <input type="text" class="input" value="{{ $company->end_work }}" disabled>
588 588 </div>
589 589 </div>
590 590  
... ... @@ -613,25 +613,25 @@
613 613 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
614 614 <label class="form-group__label">Название компании</label>
615 615 <div class="form-group__item">
616   - <input type="text" class="input" value="{{ $it->name_company }}" >
  616 + <input type="text" class="input" value="{{ $it->name_company }}" disabled>
617 617 </div>
618 618 </div>
619 619 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
620 620 <label class="form-group__label">Директор</label>
621 621 <div class="form-group__item">
622   - <input type="text" class="input" value="{{ $it->direct }}" >
  622 + <input type="text" class="input" value="{{ $it->direct }}" disabled>
623 623 </div>
624 624 </div>
625 625 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
626 626 <label class="form-group__label">Телефон</label>
627 627 <div class="form-group__item">
628   - <input type="text" class="input" value="{{ $it->telephone }}" >
  628 + <input type="text" class="input" value="{{ $it->telephone }}" disabled>
629 629 </div>
630 630 </div>
631 631 <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
632 632 <label class="form-group__label">Телефон2</label>
633 633 <div class="form-group__item">
634   - <input type="text" class="input" value="{{ $it->telephone2 }}" >
  634 + <input type="text" class="input" value="{{ $it->telephone2 }}" disabled>
635 635 </div>
636 636 </div>
637 637 <a href="{{ route('worker.delete_prev_company', ['doc' => $it->id]) }}" class="button button_light">
resources/views/workers/prev_company_form.blade.php
... ... @@ -46,6 +46,8 @@
46 46  
47 47 <div class="cabinet__body">
48 48 <div class="cabinet__body-item">
  49 + @include('messages_error')
  50 +
49 51 <h4 class="cabinet__h4">Добавление контакта предыдущей компании</h4>
50 52 <form id="submit_form" name="submit_form" action="{{ route('worker.add_prev_company') }}" class="cabinet__inputs" method="GET">
51 53 @csrf