| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- @extends('layouts.app')
- @section('content')
- <div class="row mb-3">
- <div class="col-6">
- <h3>Каталог</h3>
- </div>
- <div class="col-6 text-end">
- <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#importModal">
- Импорт
- </button>
- <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exportModal">
- Экспорт
- </button>
- </div>
- </div>
- @include('partials.table', [
- 'id' => $id,
- 'header' => $header,
- 'data' => $products
- ])
- <div class="row pt-3 px-3">
- <div class="col-12 pagination">
- {{ $products->links() }}
- </div>
- </div>
- <!-- Модальное окно импорта-->
- <div class="modal fade" id="importModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-fullscreen-sm-down">
- <div class="modal-content">
- <div class="modal-header">
- <h1 class="modal-title fs-5" id="exampleModalLabel">Выберите год и файл для импорта</h1>
- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
- </div>
- <div class="modal-body">
- <form action="{{ route('catalog.import') }}" method="post" enctype="multipart/form-data">
- @csrf
- @include('partials.input', ['title' => 'Год', 'name' => 'year', 'type' => 'number', 'min' => 2000, 'max' => (int) date('Y') + 1, 'value' => date('Y')])
- @include('partials.input', ['title' => 'XLSX файл', 'name' => 'import_file', 'type' => 'file'])
- @include('partials.submit', ['name' => 'Импорт'])
- </form>
- </div>
- </div>
- </div>
- </div>
- <!-- Модальное окно экспорта-->
- <div class="modal fade" id="exportModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-fullscreen-sm-down modal-lg">
- <div class="modal-content">
- <div class="modal-header">
- <h1 class="modal-title fs-5" id="exampleModalLabel">Экспорт</h1>
- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
- </div>
- <div class="modal-body">
- <form action="{{ route('catalog.export') }}" method="post" enctype="multipart/form-data">
- @csrf
- @include('partials.checkbox', ['title' => 'С учётом текущего фильтра и поиска', 'name' => 'withFilter', 'type' => 'checkbox', 'value' => 'yes', 'checked' => false])
- <div class="d-none">
- @if(request()->s)
- @include('partials.input', ['name' => 'filters[s]', 'title' => 'поиск', 'value' => request()->s])
- @endif
- @if(request()->filters)
- @foreach(request()->filters as $filterName => $filterValue)
- @include('partials.input', ['name' => 'filters[' . $filterName .']', 'title' => $filterName, 'value' => $filterValue])
- @endforeach
- @endif
- </div>
- @include('partials.submit', ['name' => 'Экспорт'])
- </form>
- </div>
- </div>
- </div>
- </div>
- @if($errors->count())
- @dump($errors)
- @endif
- @endsection
|