index.blade.php 6.1 KB

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