favorite.blade.php 15.5 KB
@extends('layout.frontend', ['title' => 'Избраннные соискатели - РекаМоре'])

@section('scripts')
    <script>
        $(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() {
            $(document).on('click', '.js_box_favorit', function () {
                var id_worker = $(this).attr('data-val');
                var data = {code_record: id_worker};

                if ($(this).hasClass('active')){
                    data.delete = 1;
                }

                $.ajax({
                    type: "GET",
                    url: "{{ route('like_resume') }}",
                    data: data,
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    success: function (data) {
                        if (data.deleted){
                            $('#elem_'+data.id).removeClass('active');
                        } else {
                            $('#elem_'+data.id).addClass('active');
                        }
                    },
                    error: function (data) {
                        data = JSON.stringify(data);
                        console.log('Error: ' + data);
                    }
                });
            });
        });
        $(document).on('click', '.chat', function() {
            var this_ = $(this);

            $('#_user_id').val(this_.attr('data-uid'));
            $('#_to_user_id').val(this_.attr('data-tuid'));
            $('#_vacancy').val(this_.attr('data-vacancy'));
        });
    </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' => 6])

                </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" action="{{ route('employer.favorites') }}">
                                    <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;" value="@if ((isset($_GET['search'])) && (!empty($_GET['search']))) {{ $_GET['search'] }} @endif">
                                    <button type="submit" class="button">Найти</button>
                                    <span>
                                            <svg>
                                                <use xlink:href="{{ asset('images/sprite.svg#search') }}"></use>
                                            </svg>
                                        </span>
                                </form>
                            </div>
                        </div>
                        <div class="cvs">
                        @if ((isset($Workers) && ($Workers->count())))
                            @foreach ($Workers as $it)
                                <div class="cvs__body">
                                    <div class="cvs__item">

                                        <div class="cvs__item-header">
                                            <div class="cvs__item-photo">
                                                <svg>
                                                    <use xlink:href="{{ asset('images/sprite.svg#pic') }}"></use>
                                                </svg>
                                                @if (!empty($it->photo))
                                                <img src="{{ asset(\Illuminate\Support\Facades\Storage::url($it->photo)) }}" alt="">
                                                @else
                                                <img src="{{ asset('images/default_man.jpg') }}" alt="">
                                                @endif
                                            </div>

                                            <div class="cvs__item-buttons">
                                                <button type="button"
                                                        id="elem_{{ $it->id }}"
                                                        data-val="{{ $it->id }}"
                                                        class="like cvs__item-like js_box_favorit {{ \App\Classes\LikesClass::get_status_worker($it) }}">
                                                    <svg class="mr-10">
                                                        <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
                                                    </svg>
                                                    <span class="to-favorites">Добавить в избранное</span>
                                                    <span class="in-favorites">Убрать из избранного</span>
                                                </button>

                                                <button type="button"
                                                        class="chat"
                                                        data-fancybox
                                                        data-src="#send2"
                                                        data-vacancy="0"
                                                        data-uid="{{ Auth()->user()->id }}"
                                                        data-tuid="{{ $it->users ? $it->users->id : '' }}"
                                                        data-options='{"touch":false,"autoFocus":false}'>
                                                    <svg class="mr-10">
                                                        <use xlink:href="{{ asset('images/sprite.svg#chat') }}"></use>
                                                    </svg>
                                                    <span>Написать</span>
                                                </button>

                                                <a href="{{ route('resume_profile', ['worker' => $it->id]) }}" class="button">Подробнее</a>
                                            </div>
                                        </div>
                                        <div class="cvs__item-text">
                                            <div class="cvs__item-text-row">
                                                <div class="flex" style="align-items: start;">
                                                    <div class="cvs__item-text-status @if ($it->status_work == 0) looking-for-job @endif">
                                                        @php
                                                            $worker_statuses = App\Enums\WorkerStatuses::getWorkerStatuses();
                                                        @endphp
                                                        {{ $worker_statuses[$it->status_work]  }}
                                                    </div>
                                                    <div class="cvs__item-text-updated-at">
                                                        Обновлено: {{ date('d.m.Y', strtotime($it->updated_at)) }}
                                                    </div>
                                                </div>
                                                <div>
                                                    <b>Предпочтение по типу судна:</b>
                                                    <div>{{ $it->boart_type_preference ?? '-' }}</div>
                                                </div>
                                            </div>

                                            <div class="cvs__item-text-row">
                                                <div>
                                                    <b>ФИО:</b>
                                                    <div>@if (isset($it->users)){{ $it->users->surname." ".$it->users->name_man." ".$it->users->surname2 }} @endif</div>
                                                </div>
                                                <div>
                                                    <b>Наличие визы:</b>
                                                    <div>{{ $it->visa_available ?? '-' }}</div>
                                                </div>
                                            </div>

                                            <div class="cvs__item-text-row">
                                                <div>
                                                    <b>Возраст:</b>
                                                    <div>{{ $it->old_year ?? '-' }}</div>
                                                </div>
                                                <div>
                                                    <b>Наличие танкерных документов:</b>
                                                    <div>{{ $it->tanker_documents_available ?? '-' }}</div>
                                                </div>
                                            </div>

                                            <div class="cvs__item-text-row">
                                                <div>
                                                    <b>Желаемые вакансии:</b>
                                                    <div>
                                                        @if ($it->job_titles->count())
                                                            @foreach ($it->job_titles as $job_title)
                                                                {{ $job_title->name }}
                                                                @if (!$loop->last) / @endif
                                                            @endforeach
                                                        @else
                                                        -
                                                        @endif
                                                    </div>
                                                </div>
                                                <div>
                                                    <b>Наличие подтверждения для работы на ВВП:</b>
                                                    <div>{{ $it->confirmation_work_for_vvp ?? '-' }}</div>
                                                </div>
                                            </div>

                                            <div class="cvs__item-text-row">
                                                <div>
                                                    <b>Пожелание к З/П:</b>
                                                    <div>{{ $it->salary_expectations ?? '-' }}</div>
                                                </div>
                                                <div>
                                                    <b>Город проживания</b>
                                                    <div>{{ $it->city ?? "-" }}</div>
                                                </div>
                                            </div>

                                            <div class="cvs__item-text-row">
                                                <div>
                                                    <b>Уровень английского:</b>
                                                    <div>{{ $it->english_level ?? '-' }}</div>
                                                </div>
                                                <div>
                                                    <b>Телефон:</b>
                                                    <div><a href="tel:{{ $it->telephone }}">{{ $it->telephone ?? '-' }}</a></div>
                                                </div>
                                            </div>

                                            <div class="cvs__item-text-row">
                                                <div>
                                                    <b>Дата готовности к посадке:</b>
                                                    <div>{{ $it->ready_boart_date ?? '-' }}</div>
                                                </div>
                                                <div>
                                                    <b>E-mail:</b>
                                                    <div><a href="mailto:{{ $it->email }}">{{ $it->email }}</a></div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    </div>
                            @endforeach
                         </div>
                        @else
                        <div class="notify">
                            <svg>
                                <use xlink:href="{{ asset('images/sprite.svg#i') }}"></use>
                            </svg>
                            <span>Нет избранных кандидатов</span>
                        </div>
                        @endif
                    </div>
                </div>
            </div>
        </div>

    </section>
    </div>
@endsection