companies.blade.php
8.91 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
@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('shipping_companies') }}",
data: "sort="+val_+"&block=1",
success: function (data) {
console.log('Выбор сортировки');
console.log(data);
$('#block_1').html(data);
},
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
error: function (data) {
data = JSON.stringify(data);
console.log('Error: ' + data);
}
});
$.ajax({
type: "GET",
url: "{{ route('shipping_companies') }}",
data: "sort="+val_+"&block=2",
success: function (data) {
console.log('Выбор сортировки2');
console.log(data);
history.pushState({}, '', "{{ route('shipping_companies') }}?sort="+val_+"@if (isset($_GET['page']))&page={{ $_GET['page'] }}@endif");
$('#block_2').html(data);
},
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
error: function (data) {
data = JSON.stringify(data);
console.log('Error: ' + data);
}
});
});
$(document).ready(function(){
var sel = $('#select2-sort_ajax-container');
var key = getUrlParameter('sort');
if (key !=='') {
console.log(key);
switch (key) {
case "default": sel.html('Сортировка (по умолчанию)'); break;
case "name_up": sel.html('По имени (возрастание)'); break;
case "name_down": sel.html('По дате (убывание)'); break;
case "created_at_up": sel.html('По дате (возрастание)'); break;
case "created_at_down": sel.html('По дате (убывание)'); break;
}
}
});
</script>
@endsection
@section('content')
<section class="thing">
<div class="container">
<form class="thing__body">
@csrf
<ul class="breadcrumbs thing__breadcrumbs">
<li><a href="{{ route('index') }}">Главная</a></li>
<li><b>Работодатели</b></li>
</ul>
<h1 class="thing__title">Работодатели</h1>
<p class="thing__text">С другой стороны, социально-экономическое развитие не оставляет шанса для
существующих финансовых и административных условий.</p>
<div class="search thing__search">
<input type="search" id="search" name="search" class="input" value="{{ (isset($_GET['search'])) ? $_GET['search'] : '' }}" placeholder="Введите наименование работодателя" required>
<button type="submit" class="button">Найти</button>
<span>
<svg>
<use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
</svg>
</span>
</div>
</form>
</div>
</section>
<main class="main">
<div class="container">
<div class="main__employers">
<div class="filters">
<div class="filters__label">Показано @if ($count_emps < 4) 1 - {{ $count_emps }} @else 1 – 4 @endif из {{ $count_emps }} результатов поиска</div>
<div class="filters__body">
<div class="select filters__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>
<button type="button" class="filters__item active" data-tab="1">
<svg>
<use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use>
</svg>
</button>
<button type="button" class="filters__item" data-tab="2">
<svg>
<use xlink:href="{{ asset('images/sprite.svg#grid-2') }}"></use>
</svg>
</button>
</div>
</div>
<div class="main__employers-body showed" data-body="1" id="block_1" name="block_1">
<div class="main__employers-one">
@if ($emps->count())
@foreach($emps as $emp)
<div class="main__employers-item">
<span class="main__employers-item-inner">
<img src="{{ asset(Storage::url($emp->logo)) }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic">
<span class="main__employers-item-body">
<b>{{ $emp->name_company }}</b>
<i>{{ $emp->ads->count() }} вакансия(ий)</i>
</span>
</span>
<a href="{{ route('info_company', ['company' => $emp->id]) }}" class="button button_light main__employers-item-more">Подробнее</a>
@if ($emp->oficial_status == 1)
<span class="main__employers-item-label">
<svg>
<use xlink:href="images/sprite.svg#v"></use>
</svg>
<span>Компания одобрена сервисом rekamore.su</span>
</span>
@endif
</div>
@endforeach
</div>
{{ $emps->appends($_GET)->links('paginate') }}
@else
<H2>Нет данных</H2>
@endif
</div>
<div class="main__employers-body" data-body="2" id="block_2" name="block_2">
@if ($emps->count())
<div class="main__employers-two">
@foreach($emps as $emp)
<div class="main__employers-item">
<span class="main__employers-item-inner">
<img src="{{ asset(Storage::url($emp->logo)) }}" alt="{{ $emp->name_company }}" class="main__employers-item-pic">
<span class="main__employers-item-body">
<b>{{ $emp->name_company }}</b>
<i>{{ $emp->ads->count() }} вакансия(ий)</i>
</span>
</span>
<a href="{{ route('info_company', ['company' => $emp->id]) }}" class="button button_light main__employers-item-more">Подробнее</a>
@if ($emp->oficial_status == 1)
<span class="main__employers-item-label">
<svg>
<use xlink:href="{{ asset('images/sprite.svg#v') }}"></use>
</svg>
<span>Компания одобрена сервисом rekamore.su</span>
</span>
@endif
</div>
@endforeach
</div>
{{ $emps->appends($_GET)->links('paginate') }}
@else
<H2>Нет данных</H2>
@endif
</div>
</div>
</div>
</main>
@endsection