index.blade.php 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="container-fluid">
  4. <form class="" action="" method="get">
  5. <div class="row my-2 justify-content-center">
  6. <div class="col">
  7. <label class="form-label" for="s">Поиск</label>
  8. <input class="form-control form-control-sm" type="text" id="s" name="s" placeholder="Поиск">
  9. </div>
  10. <div class="col">
  11. <label class="form-label " for="series">Серия</label>
  12. <select class="form-select form-select-sm" name="s_series" id="series">
  13. @foreach($series as $ser)
  14. <option>{{ $ser->series }}</option>
  15. @endforeach
  16. </select>
  17. </div>
  18. <div class="col">
  19. <label class="form-label " for="price_min">Цена от</label>
  20. <input class="form-control form-control-sm" type="number" id="s_price_min" name="price_min">
  21. </div>
  22. <div class="col">
  23. <label class="form-label " for="price_max">Цена до</label>
  24. <input class="form-control form-control-sm" type="number" id="s_price_max" name="price_max">
  25. </div>
  26. <div class="col-1">
  27. <button id="sb" class="btn btn-primary mt-4" type="submit">Поиск</button>
  28. </div>
  29. </div>
  30. </form>
  31. <div class="row">
  32. <div class="col-12">
  33. <div class="d-flex">
  34. {{ $products->links() }}
  35. </div>
  36. <table class="table">
  37. <thead>
  38. <tr class="align-middle">
  39. <th>Артикул</th>
  40. <th>Серия</th>
  41. <th>Группа <br> Наименование <br> Наименование под образец формы</th>
  42. <th>Цена</th>
  43. <th>Характеристики</th>
  44. <th>Техническое описание</th>
  45. <th>Создан / Изменён</th>
  46. <th>Изображение</th>
  47. </thead>
  48. </tr>
  49. <tbody>
  50. @foreach($products as $product)
  51. <tr class="align-middle">
  52. <td class="text-center">
  53. <label>
  54. <input type="checkbox" class="form-check-inline me-0" name="prd_{{ $product->id }}"><br>
  55. {{ $product->article }}
  56. </label>
  57. </td>
  58. <td>{{ $product->series }}</td>
  59. <td><strong>Группа:</strong> {{ $product->product_group }}<br>
  60. <strong>Наименование:</strong> {{ $product->name }}<br>
  61. <strong>Наименование под образец формы:</strong> {{ $product->name_for_form }}</td>
  62. <td>{!! number_format($product->price, 2, ',', '&nbsp') !!}</td>
  63. <td>{!! nl2br($product->characteristics) !!}</td>
  64. <td>{!! Str::words(nl2br($product->tech_description), 50) !!}</td>
  65. <td>{!! date('d.m.Y_H:i', strtotime($product->created_at)) . '<br>' .date('d.m.Y_H:i', strtotime($product->updated_at)) !!}</td>
  66. <td class="text-center align-middle">
  67. @empty($product->image_path)
  68. Нет изображения
  69. @else
  70. <img style="max-width: 400px"
  71. src="{{ '/' . env('IMAGES_PATH', '/fill_images_path_in_env') . '/' . $product->image_path }}"
  72. alt="{{ $product->article }}">
  73. @endempty
  74. </td>
  75. </tr>
  76. @endforeach
  77. </tbody>
  78. </table>
  79. <div class="d-flex">
  80. {{ $products->links() }}
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. @endsection