bd.blade.php 8.18 KB
@extends('layout.frontend', ['title' => 'База данных - РекаМоре'])

@section('scripts')
    <script>
        console.log('Test system');
        $(document).on('click', '.die_black', function() {
            var this_ = $(this);
            var ajax_ = $('#ajax_flot_div');
            var id_ = this_.attr('data-test');
            var url_ = this_.attr('data-link');

            console.log(url_);
            $.ajax({
                type: "GET",
                url: url_,
                success: function (data) {
                    console.log('Ответка');
                    ajax_.html(data);
                },
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                },
                error: function (data) {
                    console.log('Error: ' + data);
                }
            });

        });
    </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' => 7])
                </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.bd') }}">
                                    <input type="search" name="search" id="search" class="input" placeholder="Поиск&hellip;" value="@if (isset($_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 class="cabinet__filters-item">
                                <a href="{{ route('resume_download_all') }}" class="button">
                                    <svg>
                                        <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
                                    </svg>
                                    Экспорт
                                </a>
                            </div>
                        </div>
                    </div>

                    <div class="cabinet__body-item">
                        <div class="cabinet__table-header">
                            <div><!--_if (isset($it->workers[0]->job_titles[0]->name)) _ $it->workers[0]->job_titles[0]->name }}_else Не указано _endif-->
                                Позиции работников
                            </div>
                            <span>
                                    Всего вакансий найдено:
                                    <b>{{ $count_users->count() }}</b>
                            </span>
                        </div>
                        <div class="table table_spoiler">
                            <!--<button type="button" class="table__button js-toggle js-parent-toggle button button_light button_more">
                                <span>Показать ещё</span>
                                <span>Свернуть</span>
                            </button>-->

                            <div class="table__scroll">
                                <div class="table__body table__body_min-width">
                                    <table>
                                        <thead>
                                        <tr>
                                            <th>ФИО соискателя</th>
                                            <th>Номер телефона</th>
                                            <th>Электронная<br>почта</th>
                                            <th>Наличие<br>анкеты</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                    @php
                         $categories = 0;

                    @endphp
                    @if ($users->count())
                        @foreach ($users as $key => $it)
                          @if (isset($it->workers[0]->position_work))
                                @if ($categories !== $it->workers[0]->position_work)
                                       @php
                                           $categories = $it->workers[0]->position_work;
                                           $i = 0;
                                       @endphp
                                @endif

                                @if ($i == 0)

                                @endif
                                    <tr>
                                        <td>{{ $it->surname." ".$it->name_man }}<br>{{ $it->surname2 }}</td>

                                        <td>

                                            @if (!empty($it->workers[0]->telephone))
                                            <a href="tel:{{ $it->workers[0]->telephone }}">
                                                {{ $it->workers[0]->telephone }}
                                            </a>
                                            @else
                                                -
                                            @endif

                                            @if (!empty($it->workers[0]->telephone2))
                                            <br><a href="tel:{{ $it->workers[0]->telephone2 }}">
                                                {{ $it->workers[0]->telephone2 }}
                                            </a>
                                            @endif
                                        </td>

                                        <td>
                                            @if (!empty($it->workers[0]->email))
                                                <a href="emailto:{{ $it->workers[0]->email }}">{{ $it->workers[0]->email }}</a>
                                            @else
                                                -
                                            @endif
                                        </td>

                                        <td>
                                            @if (isset($it->workers[0]->id))
                                            <a href="{{ route('resume_download', ['worker' => $it->workers[0]->id]) }}" class="table__link">
                                                <svg>
                                                    <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
                                                </svg>
                                                Скачать
                                            </a>
                                            @endif
                                        </td>
                                    </tr>
                                @php $i++ @endphp


                          @endif
                        @endforeach
                    @endif
                         </tbody>
                    </table>
                </div>

            </div>
        </div>
          {{ $users->onEachSide(0)->appends($_GET)->links('paginate')  }}
        </div>
                </div>
            </div>
        </div>
    </section>
    </div>
@endsection