vacance-item.blade.php 9.68 KB
@php
    use App\Classes\StatusUser;
@endphp

@extends('layout.frontend', ['title' => $title])

@section('scripts')
    <!--include('js.favorite-vacancy')-->
    <script>
        $(document).on('click', '.js_send_it_button', function() {
            var this_ = $(this);
            var code_user_id = this_.attr('data-uid');
            var code_to_user_id = this_.attr('data-tuid');
            var code_vacancy = this_.attr('data-vacancy');
            var user_id = $('#_user_id');
            var to_user_id = $('#_to_user_id');
            var vacancy = $('#_vacancy');

            console.log('Клик на кнопки...');

            user_id.val(code_user_id);
            to_user_id.val(code_to_user_id);
            vacancy.val(code_vacancy);
        });
    </script>
    <script>
        $(document).on('click', '.js_send_for_emp', function() {
            var this_ = $(this);
            var code_user_id = this_.attr('data-uid');
            var code_to_user_id = this_.attr('data-tuid');
            var code_vacancy = this_.attr('data-vacancy');
            var user_id = $('#send_user_id');
            var to_user_id = $('#send_to_user_id');
            var vacancy = $('#send_vacancy');

            console.log('code_to_user_id='+code_to_user_id);
            console.log('code_user_id='+code_user_id);
            console.log('code_vacancy='+code_vacancy);
            console.log('Клик на кнопке...');

            user_id.val(code_user_id);
            to_user_id.val(code_to_user_id);
            vacancy.val(code_vacancy);
        });
    </script>
    @include('js.favorite-vacancy-45')
@endsection

@section('content')
    <main class="main">
        <div class="container">
            <ul class="breadcrumbs main__breadcrumbs">
                <li><a href="{{ route('index') }}">Главная</a></li>
                <li><a href="{{ route('vacancies') }}">Вакансии</a></li>
                <li><b>{{ $title }}</b></li>
            </ul>
            <div class="main__employer-page">

                @if (isset($Query[0]->employer))
                <h2 class="main__employer-page-title">О компании</h2>
                <div class="main__employer-page-two-item-toper">
                    @if (!empty($Query[0]->employer->logo))
                        <img src="{{ asset(Storage::url($Query[0]->employer->logo)) }}" alt="{{ $Query[0]->employer->name }}">
                    @else
                        <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $Query[0]->employer->name }}">
                    @endif
                    <span>{{ $Query[0]->employer->name_company }}</span>
                </div>

                <div class="main__employer-page-info">
                    <div class="main__employer-page-item">
                        <b>  Адрес компании</b>
                        <span>
                                {{ $Query[0]->employer->address }}
                        </span>
                    </div>
                    <div class="main__employer-page-item">
                        <b>Сайт</b>
                        <span>
                             <a href="{{ $Query[0]->employer->site }}">{{ $Query[0]->employer->site }}</a>
                        </span>
                    </div>
                    <div class="main__employer-page-item">
                        <b>Почта</b>
                        <span>
                           <a href="{{ $Query[0]->employer->email }}">{{ $Query[0]->employer->email }}</a>
                        </span>
                    </div>
                    <div class="main__employer-page-item">
                        <b>Телефон</b>
                        <span>
                                <a href="tel:{{ $Query[0]->employer->telephone }}">{{ $Query[0]->employer->telephone }}</a>
                        </span>
                    </div>
                </div>
                @else
                    <div class="main__employer-page-info">
                        <div class="main__employer-page-item">
                            <b>Ничего не найдено</b>
                            <span>
                               Нет данных о компании
                            </span>
                        </div>
                    </div>
                @endif
                <h2 class="main__employer-page-title">{{ $Query[0]->name }}</h2>
                <h3 class="main__employer-page-title_">Описание вакансии</h3>

            </div>

            @foreach ($Query as $Q)
            <div class="main__vacancies-item-page main__employer-page-two-item">
                <div class="main__employer-page-two-item-text">
                    <div class="main__employer-page-two-item-text-name">Судоходная компания ведет набор
                        специалистов на следующие должности:</div>
                    <div class="main__employer-page-two-item-text-links">
                        @if (isset($Q->jobs))
                            @foreach ($Q->jobs as $key => $j)
                                <a>“{{ $j->name }}” – з/п от @if (isset($Q->jobs_code[$key]->min_salary)) {{ $Q->jobs_code[$key]->min_salary }} @endif - @if (isset($Q->jobs_code[$key]->max_salary)) {{ $Q->jobs_code[$key]->max_salary }} @endif рублей (на руки)</a>
                            @endforeach
                        @endif
                    </div>
                </div>
                <div class="main__employer-page-two-item-text">
                    <div class="main__employer-page-two-item-text-name">Мы предлагаем:</div>
                    <div class="main__employer-page-two-item-text-body">
                        {!! $Q->text !!}
                    </div>
                </div>
                <div class="main__employer-page-two-item-text">
                    <div class="main__employer-page-two-item-text-name">Наши ожидания:</div>
                    <div class="main__employer-page-two-item-text-body">
                        {!! $Q->description !!}
                    </div>
                </div>
                <div class="main__employer-page-two-item-text">
                    <div class="main__employer-page-two-item-text-name">Резюме направляйте на почту:</div>
                    <div class="main__employer-page-two-item-text-body">
                        {!! $Q->contacts_emails !!}
                </div>
                <div class="main__employer-page-two-item-text">
                    <div class="main__employer-page-two-item-text-name">Или звоните:</div>
                    <div class="main__employer-page-two-item-text-body">
                        {!! $Q->contacts_telephones !!}
                    </div>
                </div>

                <div class="main__employer-page-two-item-tags">
                    @if (!empty($Q->jobs_code[0]->position_ship))
                        <span class="main__employer-page-two-item-tag">#{{ $Q->jobs_code[0]->position_ship }}</span>
                    @else
                        @if (isset($Q->jobs))
                            @foreach ($Q->jobs as $key => $j)
                                <span class="main__employer-page-two-item-tag">#{{ $j->name }}</span>
                            @endforeach
                        @endif
                    @endif
                </div>
                <br>
                <div class="main__employer-page-two-item-buttons">
                    @guest
                        <button type="button" data-fancybox data-src="#question" data-options='{"touch":false,"autoFocus":false}'
                                class="button main__employer-page-two-item-button">Откликнуться</button>
                    @else
                        @if (App\Classes\StatusUser::Status()==1)
                            <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}"  data-options='{"touch":false,"autoFocus":false}'
                                    class="button main__employer-page-two-item-button js_send_for_emp">Откликнуться</button>
                        @else
                            <button type="button" data-fancybox data-src="#send2" data-vacancy="{{ $Q->id }}" data-uid="{{ $uid }}" data-tuid="{{ $Q->employer->user_id }}"  data-options='{"touch":false,"autoFocus":false}'
                                    class="button main__employer-page-two-item-button js_send_it_button">Откликнуться</button>
                        @endif
                    @endguest
                </div>
                <div class="main__employer-page-two-item-bottom">
                    <div class="main__employer-page-two-item-bottom-date">{{ date('d.m.Y H:i:s', strtotime($Q->created_at)) }}</div>
                    <button type="button"  id="like{{ $Q->id }}" data-val="{{ $Q->id }}" class="like main__employer-page-two-item-bottom-like js_vac_favorite js-toggle {{ \App\Classes\LikesClass::get_status_vacancy($Q)  }}">
                        <svg>
                            <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
                        </svg>
                    </button>
                </div>

            </div>

            @endforeach

        </div> <a href="{{ redirect()->back()->getTargetUrl() }}" class="back">
                    <svg>
                        <use xlink:href="{{ asset('images/sprite.svg#back') }}"></use>
                    </svg>
                    <span>
                        Вернуться к списку вакансий
                </span>
                </a>
    </main>
    </div>
@endsection