index.blade.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="row mb-3">
  4. <div class="col-6">
  5. <h3>Каталог</h3>
  6. </div>
  7. <div class="col-6 text-end">
  8. <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#importModal">
  9. Импорт
  10. </button>
  11. </div>
  12. </div>
  13. @include('partials.table', [
  14. 'id' => $id,
  15. 'header' => $header,
  16. 'data' => $products
  17. ])
  18. <div class="row pt-3 px-3">
  19. <div class="col-12 pagination">
  20. {{ $products->links() }}
  21. </div>
  22. </div>
  23. <!-- Модальное окно импорта-->
  24. <div class="modal fade" id="importModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  25. <div class="modal-dialog modal-fullscreen-sm-down">
  26. <div class="modal-content">
  27. <div class="modal-header">
  28. <h1 class="modal-title fs-5" id="exampleModalLabel">Выберите год и файл для импорта</h1>
  29. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
  30. </div>
  31. <div class="modal-body">
  32. <form action="{{ route('catalog.import') }}" method="post" enctype="multipart/form-data">
  33. @csrf
  34. @include('partials.input', ['title' => 'Год', 'name' => 'year', 'type' => 'number', 'min' => 2000, 'max' => (int) date('Y') + 1, 'value' => date('Y')])
  35. @include('partials.input', ['title' => 'XLSX файл', 'name' => 'import_file', 'type' => 'file'])
  36. @include('partials.submit', ['name' => 'Импорт'])
  37. </form>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. @if($errors->count())
  43. @dump($errors)
  44. @endif
  45. @endsection