index.blade.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="row mb-3">
  4. <div class="col-6">
  5. <h3>Импорт</h3>
  6. </div>
  7. @if(hasRole('admin'))
  8. <div class="col-6 text-end">
  9. <button type="button" class="btn btn-sm mb-1 btn-primary" data-bs-toggle="modal" data-bs-target="#importModal">
  10. Импорт
  11. </button>
  12. </div>
  13. @endif
  14. </div>
  15. @include('partials.table', [
  16. 'id' => $id,
  17. 'header' => $header,
  18. 'strings' => $imports,
  19. 'routeName' => 'import.show',
  20. ])
  21. @include('partials.pagination', ['items' => $imports])
  22. <!-- Модальное окно импорта-->
  23. <div class="modal fade" id="importModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  24. <div class="modal-dialog modal-fullscreen-sm-down">
  25. <div class="modal-content">
  26. <div class="modal-header">
  27. <h1 class="modal-title fs-5" id="exampleModalLabel">Выберите файл для импорта</h1>
  28. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
  29. </div>
  30. <div class="modal-body">
  31. <form action="{{ route('import.create') }}" method="post" enctype="multipart/form-data">
  32. @csrf
  33. @include('partials.select', ['title' => 'Вкладка', 'name' => 'type', 'options' => ['orders' => 'Площадки', 'reclamations' => 'Рекламации']])
  34. @include('partials.input', ['title' => 'XLSX файл', 'name' => 'import_file', 'type' => 'file', 'required' => true])
  35. @include('partials.submit', ['name' => 'Импорт'])
  36. </form>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. @if($errors->any())
  42. @dump($errors)
  43. @endif
  44. @endsection