info_company_new.blade.php 15.2 KB
@extends('layout.frontend', ['title' => 'Описание компании '.$title.'- РекаМоре'])

@section('scripts')
    <script>
        $(document).on('change', '#sort_ajax', function() {
            var this_ = $(this);
            var val_ = this_.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) {
                    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 !=='') {
                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;
                }

            }
        });

        $("#list_button").on('click', function () {
            $('#flot').removeClass('active');
            $('#flot_list').removeClass('showed');
            $('#vacancy').addClass('active');
            $('#vacancy_list').addClass('showed');
        })

        $(document).on('click', '#send_message_to_employer', function() {
            var this_ = $(this);

            console.log(this_.attr('data-uid'), this_.attr('data-tuid'), this_.attr('data-vacancy'))
            $('#worker_user_id').val(this_.attr('data-uid'));
            $('#worker_to_user_id').val(this_.attr('data-tuid'));
            $('#worker_vacancy').val(this_.attr('data-vacancy'));
        });
    </script>

    @include('js.favorite-vacancy-45')

@endsection

@section('content')
    <section class="thing">
        <div class="container">
            <div class="thing__body">
                <ul class="breadcrumbs thing__breadcrumbs">
                    <li><a href="{{ route('index') }}">Главная</a></li>
                    <li><a href="{{ route('shipping_companies') }}">Работодатели</a></li>
                    <li><b>@isset($title) {{ $title }} @else Не указано @endif</b></li>
                </ul>
                @if ($company[0]->oficial_status == 1)
                    <div class="thing__badge">
                        <svg>
                            <use xlink:href="{{ asset('images/sprite.svg#badge') }}"></use>
                        </svg>
                        Компания проверена
                    </div>
                @endif

                @if (!empty($company[0]->logo))
                    <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $company[0]->name_company }}" class="thing__pic">
                @else
                    <img src="{{ asset('images/logo_emp.png') }}" alt="{{ $company[0]->name_company }}" class="thing__pic">
                @endif

                <h1 class="thing__title">{{ $company[0]->name_company }}</h1>
                <div class="thing__buttons">
                    <a href="#vacancy" id="list_button">
                        <button  type="button" class="button">
                            <svg>
                                <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use>
                            </svg>
                            {{ $company[0]->ads->count() }} вакансии
                        </button>
                    </a>
                    @guest
                        <a
                            data-fancybox
                            data-src="#question"
                            data-options='{"touch":false,"autoFocus":false}'
                            class="button">
                            Написать сообщение
                        </a>
                    @else
                        @if (App\Classes\StatusUser::Status() == 1)
                            <a
                                id="send_message_to_employer"
                                data-fancybox
                                data-src="#send3"
                                data-vacancy="0"
                                data-uid="{{ $user_id }}"
                                data-tuid="{{ $company[0]->users->id }}"
                                data-options='{"touch":false,"autoFocus":false}'
                                class="button">
                                Написать сообщение
                            </a>
                        @endif
                    @endguest
                </div>
            </div>
        </div>
    </section>
    <main class="main">
        <div class="container">
            <div class="main__employer-page">
                <h2 class="main__employer-page-title">О компании</h2>
                <div class="main__employer-page-info">
                    <div class="main__employer-page-item">
                        <b>Адрес компании</b>
                        <span>
                             {{ $company[0]->address }}
                        </span>
                    </div>
                    <div class="main__employer-page-item">
                        <b>Сайт</b>
                        <span>
                            <a href="{{$company[0]->site}}" target="_blank">
                                {{$company[0]->site}}
                            </a>
                        </span>
                    </div>
                    <div class="main__employer-page-item">
                        <b>Почта</b>
                        <span>
                            {{ $company[0]->email }}
                        </span>
                    </div>
                    <div class="main__employer-page-item">
                        <b>Телефон</b>
                        <span>
                            {{ $company[0]->telephone }}
                        </span>
                    </div>
                </div>
                <div class="main__employer-page-info">
                    <div class="main__employer-page-item"></div>
                    <div class="main__employer-page-item"></div>
                    <div class="main__employer-page-item">
                        <b>Почта (alt)</b>
                        <span>
                             {{ $company[0]->email_2 }}
                        </span>
                    </div>
                    <div class="main__employer-page-item">
                        <b>Телефон (alt)</b>
                        <span>
                            {{ $company[0]->telephone_2 }}
                        </span>
                    </div>
                </div>

                <div class="main__employer-page-item main__employer-page-description">
                    <b>Описание</b>
                    <span>
                          {!! $company[0]->text !!}
                    </span>
                </div>

                <div>
                    <div class="main__employer-page-tabs">
                        <button id="flot" type="button" class="main__employer-page-tabs-item active" data-tab="1">Флот</button>
                        <button id="vacancy" type="button" class="main__employer-page-tabs-item" data-tab="2">Вакансии</button>
                    </div>

                    <div class="main__employer-page-body">
                        <div id="flot_list"  class="main__employer-page-body-item showed" data-body="1">
                            <div class="main__employer-page-one">
                                @if ($company[0]->flots->count())
                                    @foreach ($company[0]->flots as $flot)
                                        <div class="main__employer-page-one-item flot-one-ship">
                                            @if (!empty($flot->image))
                                                <a href="{{ asset(Storage::url($flot->image)) }}" data-fancybox="gallery" class="review-image-modal">
                                                    <img src="{{ asset(Storage::url($flot->image)) }}" alt="{{ $flot->name }}">
                                                </a>
                                            @else
                                                <a href="{{ asset('images/default_ship.jpg') }}" data-fancybox="gallery" class="review-image-modal">
                                                    <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $flot->name }}">
                                                </a>
                                            @endif

                                            <div class="flot-label"><div class="flot-label-name">Название:</div>{{ $flot->name }}</div>
                                            <div class="flot-label"><div class="flot-label-name">DWT:</div> {{ $flot->DWT }}</div>
                                            <div class="flot-label"><div class="flot-label-name">Мощность:</div> {{ $flot->POWER_GD }}</div>
                                            <div class="flot-label"><div class="flot-label-name">IMO:</div> {{ $flot->IMO }}</div>
                                        </div>
                                    @endforeach
                                @endif
                            </div>
                        </div>

                        <div id="vacancy_list"  class="main__employer-page-body-item" data-body="2">
                            <div class="main__employer-page-two">
                                @foreach ($ads as $job)
                                        <div class="main__employer-page-two-item">
                                            <div class="main__employer-page-two-item-toper">
                                                @if (!empty($company[0]->logo))
                                                    <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $job->name }}">
                                                @else
                                                    <img src="{{ asset('images/default_ship.jpg') }}" alt="{{ $job->name }}">
                                                @endif
                                                <span>{{ $company[0]->name_company }}</span>
                                            </div>
                                            <div class="main__employer-page-two-item-text-body">
                                                <h3>{{ $job->name }}</h3>
                                                <span>Описание:
                                                   {!!  $job->text !!}
                                                </span>
                                            </div>

                                            @if ((isset($job->jobs)) && ($job->jobs->count()))
                                            <div class="main__employer-page-two-item-tags">
                                                @foreach ($job->jobs as $item)
                                                    <span class="main__employer-page-two-item-tag">#{{ $item->name }}</span>
                                                @endforeach
                                            </div>
                                            @endif
                                            <div class="main__employer-page-two-item-buttons">
                                                <button type="button"
                                                    data-fancybox
                                                    data-src="#send3"
                                                    data-vacancy="{{ $job->id }}"
                                                    data-uid="{{ $user_id }}"
                                                    data-tuid="{{ $company[0]->users->id }}"
                                                    data-options='{"touch":false,"autoFocus":false}'
                                                    class="button main__employer-page-two-item-button js_send_it_button"
                                                >
                                                    Оставить отклик
                                                </button>
                                            </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($job->updated_at)) }}</div>
                                                <button type="button" id="like{{ $job->id }}" data-val="{{ $job->id }}"
                                                        class="like main__employer-page-two-item-bottom-like js-toggle js_vac_favorite {{ \App\Classes\LikesClass::get_status_vacancy($job) }}">
                                                    <svg>
                                                        <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
                                                    </svg>
                                                </button>
                                            </div>
                                        </div>
                            @endforeach

                            <div style="margin-top: 20px">
                                {{ $ads->onEachSide(0)->appends($_GET)->links('paginate') }}
                            </div>
                            <!--<button type="button" class="button button_light button_more main__employer-page-two-more js-toggle js-parent-toggle">
                                    <span>Показать ещё</span>
                                    <span>Скрыть</span>
                                </button>-->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>
@endsection