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

@section('scripts')
    <script>
        $(document).ready(function(){
            $('[name="job_title_list[]"]').chosen({
                width: '100%'
            })
            $('[name="job_titles__name"]').change(function(){
                if ($(this).is(':checked')){
                    $(".job-title-list-wrap").css("display", "block");
                } else {
                    $(".job-title-list-wrap").css("display", "none");
                }
            });
            $('.cabinet__export-button-wrap button').click(function(){
                $('.cabinet__export-error').parent().remove();
            });

            $('.search-reset-button').click(function(){
                var wrap = $(this).closest('.cabinet__filters');
                wrap.find('[name="search"]').val('');
                wrap.find('button').click();
            });
        });


        $(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" style="display: flex;flex-direction: unset;justify-content: left;align-items: center;">
                            <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>
                            <a href="javascript:void(0)" class="search-reset-button bold font18" style="color: #377d87;">Сбросить поиск</a>
                        </div>
                        <div class="cabinet__filters">
                            <div class="cabinet__export-wrap">
                                <form action="{{ route('resume_download_all') }}" method="GET" target="_blank">
                                    <div class="cabinet__export-button-wrap">
                                        <button type="submit" class="button">
                                            <svg>
                                                <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
                                            </svg>
                                            Экспорт
                                        </button>
                                    </div>
                                    <div class="cabinet__export-options-wrap">
                                        @foreach ($export_options as $key => $value)
                                            <label class="checkbox">
                                                <input type="checkbox" value="1" name="{{$key}}" class="checkbox__input" checked="">
                                                <span class="checkbox__icon">
                                                <svg>
                                                    <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use>
                                                </svg>
                                                </span>
                                                <span class="checkbox__text">
                                                    <span>{{$value}}</span>
                                                </span>
                                            </label>
                                        @endforeach
                                    </div>
                                    <div class="job-title-list-wrap">
                                        <select  name="job_title_list[]" data-placeholder="Выберите должности" multiple >
                                            @foreach($jobs_titles as $job_title)
                                                <option hover="background-color: #377d87;" value="{{$job_title['id']}}">{{$job_title['name']}}</option>
                                            @endforeach
                                        </select>
                                    </div>
                                </form>
                            </div>
                        </div>
                        @if(session('error'))
                            <div class="cabinet__filters">
                                <p class="cabinet__export-error">{{ session('error') }}</p>
                            </div>
                        @endif

                    </div>

                    <div class="cabinet__body-item">
                        <div class="cabinet__table-header">
                            <div>
                                Позиции работников
                            </div>
                            <span>
                                    Пользователей найдено:
                                    <b>{{ $count_users->count() }}</b>
                            </span>
                        </div>
                        <div class="table table_spoiler">

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

                    @endphp

                    @if ($users->count())
                        @foreach ($users as $key => $it)
                            <tr>
                                <td>{{ $it->surname." ".$it->name_man }}<br>{{ $it->surname2 }}</td>

                                <td>
                                @if($it->workers[0]->positions_work)
                                    @foreach($it->workers[0]->jobs as $job)
                                        {{ $job->name }}
                                        @if(!$loop->last)
                                            <br>
                                        @endif
                                    @endforeach
                                @endif
                                </td>

                                <td>
                                    @if ($it->file !== null)
                                    <a href="{{ asset(Storage::url($it->file)) }}" class="table__link">
                                        <svg>
                                            <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
                                        </svg>
                                        Скачать
                                    </a>
                                    @endif
                                </td>
                            </tr>
                        @endforeach
                    @endif
                         </tbody>
                    </table>
                </div>

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