info_company.blade.php 14.2 KB
@extends('layout.frontend', ['title' => 'Описание компании '.$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;
                }

            }
        });

        //end
        $(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 = $('#send_user_id');
            var to_user_id = $('#send_to_user_id');
            var vacancy = $('#send_vacancy');

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

            user_id.val(code_user_id);
            to_user_id.val(code_to_user_id);
            vacancy.val(code_vacancy);
        });
    </script>
@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

                <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $company[0]->name_company }}" class="thing__pic">
                <h1 class="thing__title">{{ $company[0]->name_company }}</h1>
                <p class="thing__text">{{ $company[0]->text }}</p>
                <div class="thing__buttons">
                    <button type="button" class="button">
                        <svg>
                            <use xlink:href="{{ asset('images/sprite.svg#grid-1') }}"></use>
                        </svg>
                        {{ $company[0]->ads->count() }} вакансии
                    </button>
                    <a data-fancybox data-src="#send" data-vacancy="0" data-uid="{{ $user_id }}" data-tuid="{{ $company[0]->users->id }}"  data-options='{"touch":false,"autoFocus":false}' class="js_send_it_button button">
                        Написать сообщение
                    </a>
                </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 }}">{{ $company[0]->site }}</a>
                        </span>
                    </div>
                    <div class="main__employer-page-item">
                        <b>Почта</b>
                        <span>
                            <a href="mailto:">{{ $company[0]->email }}</a>
                        </span>
                    </div>
                    <div class="main__employer-page-item">
                        <b>Телефон</b>
                        <span>
                                <a href="tel:{{ $company[0]->telephone }}">{{ $company[0]->telephone }}</a>
                        </span>
                    </div>
                </div>
                <div class="main__employer-page-item">
                    <b>Описание</b>
                    <span>
                          {{ $company[0]->text }}
                    </span>
                </div>
                <div>
                    <div class="main__employer-page-tabs">
                        <button type="button" class="main__employer-page-tabs-item active"
                                data-tab="1">Флот</button>
                        <button type="button" class="main__employer-page-tabs-item" data-tab="2">Вакансии</button>
                    </div>
                    <div class="main__employer-page-body">
                        <div 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)
                                    <a href="" class="main__employer-page-one-item">
                                        <img src="{{ asset(Storage::url($flot->image)) }}" alt="{{ $flot->name }}">
                                        <b>{{ $flot->region }}</b>
                                        <span>{{ $flot->power }}</span>
                                    </a>
                                    @endforeach
                                @endif
                            </div>
                        </div>

                        <div class="main__employer-page-body-item" data-body="2">
                            <div class="main__employer-page-two">
                                    @foreach ($company[0]->ads as $job)
                                        @foreach ($job->ad_job as $item)
                                        <div class="main__employer-page-two-item">
                                            <div class="main__employer-page-two-item-toper">
                                                <!-- end -->
                                                <img src="{{ asset(Storage::url($company[0]->logo)) }}" alt="{{ $job->name }}">
                                                <span>{{ $job->name }}</span>
                                            </div>
                                            <div class="main__employer-page-two-item-title">{{ $item->flot }}</div>
                                            <div class="main__employer-page-two-item-text">
                                                <div class="main__employer-page-two-item-text-name">
                                                    {{ $item->job_title->name }}
                                                </div>
                                                <div class="main__employer-page-two-item-text-body">
                                                    <p>Зарплата:{{ $item->min_salary }} - {{ $item->max_salary }}р + {{ $item->sytki }} суточные.</p>
                                                    <p>Контракт: {{ $item->period }} мес.</p>
                                                </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">
                                                    <p>{{ $item->region }}</p>
                                                </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">
                                                    <p> {{ $item->start }}</p>
                                                    {!! $item->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">
                                                    <a href="tel:{{ $job->telephone }}">{{ $job->telephone }}</a>
                                                </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">
                                                    <a href="mailto: {{ $job->email }}">{{ $job->email }}</a>
                                                </div>
                                            </div>
                                            <div class="main__employer-page-two-item-tags">
                                                <span class="main__employer-page-two-item-tag">#{{ $item->job_title->name }}</span>
                                            </div>
                                            <div class="main__employer-page-two-item-buttons">
                                                <button type="button" data-fancybox data-src="#send" data-vacancy="{{ $item->job_title->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>
                                                <!--<a href="#"
                                                   class="button button_light main__employer-page-two-item-button">Подробнее</a>-->
                                            </div>
                                            <div class="main__employer-page-two-item-bottom">
                                                <div class="main__employer-page-two-item-bottom-date">{{ $job->updated_at }}</div>
                                                <button type="button"
                                                        class="like main__employer-page-two-item-bottom-like js-toggle">
                                                    <svg>
                                                        <use xlink:href="{{ asset('images/sprite.svg#heart') }}"></use>
                                                    </svg>
                                                </button>
                                            </div>
                                        </div>
                                    @endforeach
                                  @endforeach
                                <!--<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