index.blade.php 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exportModal">
  12. Экспорт
  13. </button>
  14. </div>
  15. </div>
  16. @include('partials.table', [
  17. 'id' => $id,
  18. 'header' => $header,
  19. 'strings' => $products
  20. ])
  21. <div class="row pt-3 px-3">
  22. <div class="col-12 pagination">
  23. {{ $products->links() }}
  24. </div>
  25. </div>
  26. <!-- Модальное окно импорта-->
  27. <div class="modal fade" id="importModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  28. <div class="modal-dialog modal-fullscreen-sm-down">
  29. <div class="modal-content">
  30. <div class="modal-header">
  31. <h1 class="modal-title fs-5" id="exampleModalLabel">Выберите год и файл для импорта</h1>
  32. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
  33. </div>
  34. <div class="modal-body">
  35. <form action="{{ route('catalog.import') }}" method="post" enctype="multipart/form-data">
  36. @csrf
  37. @include('partials.input', ['title' => 'XLSX файл', 'name' => 'import_file', 'type' => 'file'])
  38. @include('partials.submit', ['name' => 'Импорт'])
  39. </form>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. <!-- Модальное окно экспорта-->
  45. <div class="modal fade" id="exportModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  46. <div class="modal-dialog modal-fullscreen-sm-down modal-lg">
  47. <div class="modal-content">
  48. <div class="modal-header">
  49. <h1 class="modal-title fs-5" id="exampleModalLabel">Экспорт</h1>
  50. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
  51. </div>
  52. <div class="modal-body">
  53. <form action="{{ route('catalog.export') }}" method="post" enctype="multipart/form-data">
  54. @csrf
  55. @include('partials.checkbox', ['title' => 'С учётом текущего фильтра и поиска', 'name' => 'withFilter', 'type' => 'checkbox', 'value' => 'yes', 'checked' => false])
  56. <div class="d-none">
  57. @if(request()->s)
  58. @include('partials.input', ['name' => 'filters[s]', 'title' => 'поиск', 'value' => request()->s])
  59. @endif
  60. @if(request()->filters)
  61. @foreach(request()->filters as $filterName => $filterValue)
  62. @include('partials.input', ['name' => 'filters[' . $filterName .']', 'title' => $filterName, 'value' => $filterValue])
  63. @endforeach
  64. @endif
  65. </div>
  66. @include('partials.submit', ['name' => 'Экспорт'])
  67. </form>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. @if($errors->count())
  73. @dump($errors)
  74. @endif
  75. @endsection