index.blade.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <x-app-layout>
  2. <div class="py-12">
  3. <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
  4. <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
  5. <div class="p-6 text-gray-900">
  6. <h1 class="text-xl font-medium">Мои заявки</h1>
  7. @if (session('success'))
  8. <span class="btn btn-success mt-4 mb-4">{{session('success')}}</span>
  9. @endif
  10. @if(count($applications) !== 0)
  11. <table class="w-full text-center mt-4">
  12. <thead>
  13. <tr>
  14. <th>
  15. </th>
  16. <th>
  17. Курс
  18. </th>
  19. <th>
  20. Дата начала обучения
  21. </th>
  22. <th>
  23. Способ оплаты
  24. </th>
  25. <th>
  26. Статус
  27. </th>
  28. </tr>
  29. <tr style="height: 15px;"></tr>
  30. </thead>
  31. <tbody>
  32. @foreach ($applications as $app)
  33. <tr style="height: 50px; border-block: 1px solid #6b7280;">
  34. <td>{{$app->id}}</td>
  35. <td>{{$app->course->name}}</td>
  36. <td>{{$app->date_start}}</td>
  37. <td>{{$app->payment_method}}</td>
  38. <td>
  39. @if ($app->status === 'Новая')
  40. <span style="background-color: lightblue; color: #ffffff; padding: 5px; border-radius: 6px;">
  41. {{$app->status}}
  42. </span>
  43. @endif
  44. @if ($app->status === 'Идет обучение')
  45. <span style="background-color: blue; color: #ffffff; padding: 5px; border-radius: 6px;">
  46. {{$app->status}}
  47. </span>
  48. @endif
  49. @if ($app->status === 'Обучение завершено')
  50. <span style="background-color: purple; color: #ffffff; padding: 5px; border-radius: 6px;">
  51. {{$app->status}}
  52. </span>
  53. @endif
  54. </td>
  55. @if ($app->status === 'Обучение завершено')
  56. <td>
  57. <x-primary-button type="button" data-bs-toggle="modal" data-bs-target="#reviewModal{{ $app->id }}"
  58. style="{{ empty($app->review) ? '' : 'background-color: #198754 ' }}"
  59. >Отзыв</x-primary-button>
  60. <form method="POST" action="{{ route('applications.set-review', $app->id) }}">
  61. @csrf
  62. <div class="modal fade" id="reviewModal{{ $app->id }}" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  63. <div class="modal-dialog">
  64. <div class="modal-content">
  65. <div class="modal-header">
  66. <h5 class="modal-title" id="exampleModalLabel">Ваш отзыв на курс</h5>
  67. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  68. </div>
  69. <div class="modal-body">
  70. <textarea
  71. name="review"
  72. class="border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm"
  73. style="resize: none; height: 200px; width: 100%;"
  74. {{ empty($app->review) ? '' : 'disabled' }}
  75. >{{$app->review}}</textarea>
  76. </div>
  77. <div class="modal-footer">
  78. <x-primary-button type="button" data-bs-dismiss="modal" style="background-color: #6b7280;">Закрыть</x-primary-button>
  79. @if (empty($app->review))
  80. <x-primary-button type="submit">Отправить</x-primary-button>
  81. @endif
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </form>
  87. </td>
  88. @endif
  89. </tr>
  90. @endforeach
  91. </tbody>
  92. </table>
  93. @else
  94. <span class="block mt-4">Пока здесь пусто, но вы можете <a style="color: lightblue;" href="{{ route('applications.create') }}">создать заявку</a></span>
  95. @endif
  96. </div>
  97. </div>
  98. </div>
  99. </div>
  100. </x-app-layout>