resume_autolift.blade.php 13 KB
@extends('layout.frontend', ['title' => 'Автоподнятие вакансий'])
@section('scripts')
    <script>
        $(document).on('click', '#submit', function () {
            let data = {};
            data.is_enabled = $('[name="is_enabled"]').val();
            data.times_per_day = $('[name="times_per_day"]').chosen().val();
            data.days_repeat = $('[name="days_repeat"]').chosen().val();
            data.time_send_first = $('[name="time_send_first"]').val();
            data.time_send_second = $('[name="time_send_second"]').val();
            data.time_send_third = $('[name="time_send_third"]').val();
            data.autolift_site = $('[name="autolift_site"]').val();

            $.ajax({
                url: '{{ route('worker.autolift_save') }}',
                type: 'POST',
                data: data,
                headers: {
                    'X-CSRF-TOKEN': '{{ csrf_token() }}'
                },
                success: function (result) {
                    location.reload();
                },
                error: function (result) {
                    //todo пульнуть какуюнить модалку
                },
            });
        })
    </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('workers.emblema')
                    </div>
                    @include('workers.menu', ['item' => 15])
                </div>
                <form class="cabinet__body">
                    @csrf
                    <div class="cabinet__body-item">
                        <h2 class="title cabinet__title">Автоподнятие вакансий</h2>
                        <div class="cabinet__inputs">
                            <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth">
                                <?php
                                    $createdAtClone = isset($options->created_at) ? clone($options->created_at) : now();
                                    $diff = $createdAtClone->addDays($options->days_repeat)->diffInDays($options->created_at);
                                ?>
                                <label class="toggle">
                                    <input name="is_enabled" type="checkbox" @if($options->is_enabled) checked disabled @endif class="toggle__input js_autoraise_toggle">
                                    <span class="toggle__icon"></span>
                                    <span class="toggle__text">Деактивировано</span>
                                    <span class="toggle__text">Активировано</span>
                                </label>
                                <p class="mod js_autoraise_prompt @if($options->is_enabled === 1) hidden @endif">Срок действия автоподнятия резюме истек. Желаете его возобновить?</p>
                                <p class="mod js_autoraise_prompt @if($options->is_enabled === 0) hidden @endif">Автоподнятие резюме продолжит действовать в течение следующих дней: <span>{{$diff}}</span></p>
                            </div>
                            <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth form-group">
                                <label class="form-group__label">Сколько раз в день необходимо обновлять
                                    вакансии?</label>
                                <div class="form-group__item">
                                    <div class="select">
                                        <select name="times_per_day" class="js-select2 js_autoraise_select">
                                            <option @if($options['times_per_day'] === null) selected @endif disabled>Выберите вариант из списка</option>
                                            <option @if($options['times_per_day'] === 1) selected @endif value="1">1 раз</option>
                                            <option @if($options['times_per_day'] === 2) selected @endif value="2">2 раза</option>
                                            <option @if($options['times_per_day'] === 3) selected @endif value="3">3 раза</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <label class="cabinet__inputs-item form-group">
                                <div class="form-group__label">Выберите первое время обновления (по
                                    МСК)</div>
                                <div class="form-group__item">
                                    <span class="form-group__item-icon">
                                        <svg>
                                            <use xlink:href="images/sprite.svg#date"></use>
                                        </svg>
                                    </span>
                                    <input
                                        name="time_send_first"
                                        type="text"
                                        class="input js-picker input-picker"
                                        placeholder="Время"
                                        value="{{ $options['time_send_first'] }}"
                                    >
                                </div>
                            </label>
                            <label class="cabinet__inputs-item form-group">
                                <div class="form-group__label">Выберите второе время обновления (по
                                    МСК)</div>
                                <div class="form-group__item">
                                    <span class="form-group__item-icon">
                                        <svg>
                                            <use xlink:href="images/sprite.svg#date"></use>
                                        </svg>
                                    </span>
                                    <input
                                        name="time_send_second"
                                        type="text"
                                        class="input js-picker input-picker"
                                        placeholder="Время"
                                        value="{{ $options['time_send_second'] }}"
                                        @if($options['times_per_day'] < 2) disabled @endif
                                    >
                                </div>
                            </label>
                            <label class="cabinet__inputs-item form-group">
                                <div class="form-group__label">Выберите третье время обновления (по МСК)</div>
                                <div class="form-group__item">
                                    <span class="form-group__item-icon">
                                        <svg>
                                            <use xlink:href="images/sprite.svg#date"></use>
                                        </svg>
                                    </span>
                                    <input
                                        name="time_send_third"
                                        type="text"
                                        class="input js-picker input-picker"
                                        placeholder="Время"
                                        value="{{ $options['time_send_third'] }}"
                                        @if($options['times_per_day'] < 3) disabled @endif
                                    >
                                </div>
                            </label>
                            <div class="cabinet__inputs-item form-group">
                                <label class="form-group__label">Выполнять это действие на протяжении</label>
                                <div class="form-group__item">
                                    <div class="select">
                                        <select name="days_repeat" class="js-select2">
                                            <option @if($options['days_repeat'] === null) selected @endif disabled>Выполнять это действие на протяжении</option>
                                            <option @if($options['days_repeat'] === 1) selected @endif value="1">1 день</option>
                                            <option @if($options['days_repeat'] === 3) selected @endif value="3">3 дня</option>
                                            <option @if($options['days_repeat'] === 5) selected @endif value="5">5 дней</option>
                                            <option @if($options['days_repeat'] === 7) selected @endif value="7">7 дней</option>
                                            <option @if($options['days_repeat'] === 10) selected @endif value="10">10 дней</option>
                                            <option @if($options['days_repeat'] === 15) selected @endif value="15">15 дней</option>
                                            <option @if($options['days_repeat'] === 30) selected @endif value="30">30 дней</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </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>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr name="resume_table_row" data-id="{{ $worker->id }}">
                                                <td>Резюме</td>
                                                <td >
                                                    <span class="checkbox-empty">
                                                        <label class="checkbox">
                                                            <input
                                                                type="checkbox"
                                                                class="checkbox__input"
                                                                @if($options->autolift_site) checked @endif
                                                                name="autolift_site"
                                                            >
                                                            <span class="checkbox__icon">
                                                                <svg>
                                                                    <use xlink:href="{{ asset('images/sprite.svg#v') }}"></use>
                                                                </svg>
                                                            </span>
                                                        </label>
                                                    </span>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="mrg-wrapper" style="display: flex; justify-content: center; clear: both;">
                                <ins class="mrg-tag" data-ad-client="ad-595528" data-ad-slot="595528" style="display: flex; align-items: center; justify-content: center; width: 300px; z-index: 1;">

                                </ins>
                            </div>
                        </div>
                        <div class="cabinet__inputs">
                            <div class="cabinet__inputs-item cabinet__inputs-item_fullwidth">
                                <button id="submit" type="button" class="button">Сохранить</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </section>
    </div>
@endsection