index.blade.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. <div class="row pt-3 px-3">
  22. <div class="col-12 pagination">
  23. {{ $imports->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('import.create') }}" method="post" enctype="multipart/form-data">
  36. @csrf
  37. @include('partials.select', ['title' => 'Вкладка', 'name' => 'type', 'options' => ['orders' => 'Площадки', 'reclamations' => 'Рекламации']])
  38. @include('partials.input', ['title' => 'XLSX файл', 'name' => 'import_file', 'type' => 'file', 'required' => true])
  39. @include('partials.submit', ['name' => 'Импорт'])
  40. </form>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. @if($errors->any())
  46. @dump($errors)
  47. @endif
  48. @endsection