list_vacancy.blade.php
11.5 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
@extends('layout.frontend', ['title' => 'Список вакансий - РекаМоре'])
@section('scripts')
<script>
console.log('Test system');
$(document).on('change', '#sort_ajax', function() {
var this_ = $(this);
var val_ = this_.val();
console.log('sort items '+val_);
$.ajax({
type: "GET",
url: "{{ route('employer.vacancy_list') }}",
data: "sort="+val_,
success: function (data) {
console.log('Выбор сортировки');
console.log(data);
history.pushState({}, '', "{{ route('employer.vacancy_list') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
$('#main_ockar').html(data);
},
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
error: function (data) {
data = JSON.stringify(data);
console.log('Error: ' + data);
}
});
});
</script>
@endsection
@section('content')
<section class="cabinet">
<div class="container">
<ul class="breadcrumbs cabinet__breadcrumbs">
<li><a href="{{ route('index') }}">Главная</a></li>
<li><b>Личный кабинет</b></li>
</ul>
<div class="cabinet__wrapper">
<div class="cabinet__side">
<div class="cabinet__side-toper">
@include('employers.emblema')
</div>
@include('employers.menu', ['item' => 3])
</div>
<div class="cabinet__body">
<div class="cabinet__body-item">
<h2 class="title cabinet__title">Мои вакансии</h2>
</div>
<div class="cabinet__body-item">
<div class="cabinet__filters">
<div class="cabinet__filters-item">
<form class="search">
<input type="search" class="input" placeholder="Поиск…" required>
<button type="submit" class="button">Найти</button>
<span>
<svg>
<use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
</svg>
</span>
</form>
</div>
<div class="cabinet__filters-item">
<div class="select">
<select class="js-select2" id="sort_ajax" name="sort_ajax">
<option value="default">Сортировка (по умолчанию)</option>
<option value="name_up">По имени (возрастание)</option>
<option value="name_down">По имени (убывание)</option>
<option value="created_at_up">По дате (возрастание)</option>
<option value="created_at_down">По дате (убывание)</option>
</select>
</div>
</div>
</div>
<div class="table table_spoiler" id="main_ockar" name="main_oskar">
@if ($vacancy_list->count())
<div class="table__scroll">
<div class="table__body table__body_min-width">
<table>
<thead>
<tr>
<th>№</th>
<th>Название</th>
<th>Дата добавления<br>/ обновления</th>
<th>Должности</th>
<th>Статус</th>
<th>Действия</th>
</tr>
</thead>
<tbody>
@foreach($vacancy_list as $it)
<tr>
<td>{{ $it->id }}</td>
<td>{{ $it->name }}</td>
<td>{{ date('d.m.Y H:i:s', strtotime($it->created_at)) }} <br>/ {{ date('d.m.Y H:i:s', strtotime($it->updated_at)) }}</td>
<td> <a href="{{ route('employer.add_job_in_vac', ['ad_employer' => $it->id]) }}" class="button">Добавить</a>
@if ($it->jobs->count())
@foreach ($it->jobs as $key => $it_um)
<p>@if (isset($it->jobs_code[$key]))
<a href="{{ route('employer.edit_job_in_vac', ['ad_job' => $it->jobs_code[$key]->id, 'ad_employer' => $it->id, 'job_title_id' => $it_um->id]) }}" style="text-decoration: underline">{{$it_um->name}}</a>
<a href="{{ route('employer.delete_job_in_vac', ['ad_job' => $it->jobs_code[$key]->id]) }}" style="text-decoration: underline">(Del)</a>
@endif
</p>
@endforeach
@else
Нет связанных <br> с вакансией должностей
@endif
</td>
<td>
@if ($it->active_is)
<span class="table__status green"><i></i>Опубликовано</span>
@else
<span class="table__status"><i></i>Не опубликовано</span>
@endif
</td>
<td>
<span class="table__controls">
<a class="table__controls-item up-it" href="{{ route('employer.vacancy_up', ['ad_employer' => $it->id]) }}">
<svg>
<use xlink:href="{{ asset('images/sprite.svg#arrow-radius') }}"></use>
</svg>
</a>
<a href="{{ route('employer.vacancy_edit', ['ad_employer' => $it->id]) }}" class="table__controls-item">
<svg>
<use xlink:href="{{ asset('images/sprite.svg#pencil') }}"></use>
</svg>
</a>
<a class="table__controls-item" href="{{ route('employer.vacancy_delete', ['ad_employer' => $it->id]) }}">
<svg>
<use xlink:href="{{ asset('images/sprite.svg#cross') }}"></use>
</svg>
</a>
@if ($it->active_is)
<a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 0]) }}" class="table__controls-item">
<svg>
<use xlink:href="{{ asset('images/sprite.svg#eye') }}"></use>
</svg>
</a>
@else
<a href="{{ route('employer.vacancy_eye', ['ad_employer' => $it->id, 'status' => 1]) }}" class="table__controls-item">
<svg>
<use xlink:href="{{ asset('images/sprite.svg#eye-3') }}"></use>
</svg>
</a>
@endif
<!--<button type="button" class="table__controls-item">
<svg>
<use xlink:href=" asset('images/sprite.svg#tg') }}"></use>
</svg>
</button>
-->
</span>
</td>
</tr>
@endforeach
</tbody>
</table>
</div><br>
{{ $vacancy_list->appends($_GET)->links('paginate') }}
</div>
@else
<div class="notify">
<svg>
<use xlink:href="{{ asset('images/sprite.svg#i') }}"></use>
</svg>
<span>Вы ещё не разместили ни одной вакансии</span>
</div>
@endif
</div>
</div>
</div>
</div>
</div>
</section>
</div>
@endsection