Blame view

resources/views/workers/form_additional_documents.blade.php 3.06 KB
d4632b7a2   Сергей П   Анкета работника
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
  @extends('workers.cabinet_layout', ['title' => 'Дополнительные документы - РекаМоре'])
  
  @section('scripts')
  <script>
      $(function () {
          $('.sertificates_js').change(function(){
              var this_btn = $(this);
              var wrap = this_btn.closest('.cabinet__inputs-item');
              var infoblock_id = this_btn.attr('data-info');
              var val = this_btn.val();
  
              $.ajax({
                  type: "GET",
                  url: "{{ route('worker.delete_add_diplom', ['worker' => $worker->id]) }}",
                  data: "&infoblok_id=" + infoblock_id+"&val="+val,
                  success: function (data) {
                      wrap.find('.form-group__label').append('<span class="success font12 ml-10 green">Сохранено</span>');
                      setTimeout(function(){
                          wrap.find('.form-group__label .success').fadeOut(300, function(){
                              wrap.find('.form-group__label .success').remove();
                          });
                      }, 2000);
                  },
                  headers: {
                      'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                  },
                  error: function (data) {
                      data = JSON.stringify(data);
                      console.log('Error: ' + data);
                  }
              });
          });
      });
  </script>
  @endsection
  
  @section('cabinet_content')
  <div class="mb-40" name="ajax_dop_diplomi" id="ajax_dop_diplomi">
      @csrf
  
      <div class="cabinet__body-item">
          <div class="cabinet__anketa">
              <h2 class="title cabinet__title">Дополнительные документы</h2>
          </div>
      </div>
  
      <div class="cabinet__body-item">
          <div class="cabinet__inputs">
              @if ($info_blocks->count())
              @foreach ($info_blocks as $info_block)
              <div class="cabinet__inputs-item form-group">
                  <label class="form-group__label">{{ $info_block->name }}:</label>
  
                  <div class="form-group__item">
                      @php $status = 0; @endphp
                      @if (!empty($worker->dop_info[$info_block->id]) && $worker->dop_info[$info_block->id]['status'])
                          @php $status = $worker->dop_info[$info_block->id]['status']; @endphp
                      @endif
  
                      <select data-info="{{ $info_block->id }}" class="js-select2 sertificates_js">
                      @foreach($additional_document_statuses as $key => $value)
                          <option value="{{ $key }}" @if ($status == $key) selected @endif>{{ $value }}</option>
                      @endforeach
                      </select>
                  </div>
              </div>
              @endforeach
              @endif
  
              <div class="cabinet__body-item cabinet__inputs-item-full-row">
                  <div class="cabinet__buttons_flex">
                      <a href="{{ route('worker.cabinet') }}" class="button button_light active">Назад</a>
                  </div>
              </div>
          </div>
      </div>
  </div>
  @endsection