admin.blade.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. @extends('layout')
  2. @section('content')
  3. <main class="container mx-auto px-5">
  4. <h1 class="text-4xl font-bold text-center my-4">Админ-панель</h1>
  5. <article class="overflow-x-scroll">
  6. @if($apps->isNotEmpty())
  7. <table class="w-full text-center xl:mb-64 lg:mb-48 mb-32">
  8. <thead>
  9. <tr>
  10. <th class="border border-gray-300">№ заявки</th>
  11. <th class="border border-gray-300">Логин</th>
  12. <th class="border border-gray-300">Почта</th>
  13. <th class="border border-gray-300">Телефон</th>
  14. <th class="border border-gray-300">Название курса</th>
  15. <th class="border border-gray-300">Дата</th>
  16. <th class="border border-gray-300">Способ оплаты</th>
  17. <th class="border border-gray-300">Изменить статус</th>
  18. <th class="border border-gray-300">Отзыв</th>
  19. </tr>
  20. </thead>
  21. <tbody>
  22. @foreach($apps as $app)
  23. <tr class="">
  24. <td class="border border-gray-300 py-3 px-2">{{ $app->id }}</td>
  25. <td class="border border-gray-300 py-3 px-2">{{ $app->user->login }}</td>
  26. <td class="border border-gray-300 py-3 px-2">{{ $app->user->email }}</td>
  27. <td class="border border-gray-300 py-3 px-2">{{ $app->user->phone }}</td>
  28. <td class="border border-gray-300 py-3 px-2">{{ $app->course_name }}</td>
  29. <td class="border border-gray-300 py-3 px-2">{{ $app->date }}</td>
  30. <td class="border border-gray-300 py-3 px-2">{{ $app->payment }}</td>
  31. <td class="border border-gray-300 py-3 px-2">
  32. @if($app->status != 'end')
  33. <form action="{{ route('admin.post', $app->id) }}" method="POST" class='flex gap-1'>
  34. @csrf
  35. <select name="status" id="" class="p-2 rounded-xl border border-gray-600">
  36. <option value="new" @selected($app->status == 'new')>Новая</option>
  37. <option value="continue" @selected($app->status == 'continue')>Обучение идет</option>
  38. <option value="end">Обучение завершено</option>
  39. </select>
  40. <button class="py-1 px-3 rounded-xl bg-yellow-500 text-white">Изменить</button>
  41. </form>
  42. @else
  43. Обучение завершено
  44. @endif
  45. </td>
  46. <td class="border border-gray-300 py-3 px-2">{{ $app->review }}</td>
  47. </tr>
  48. @endforeach
  49. </tbody>
  50. </table>
  51. @else
  52. <p>Еще никто не поадвал заявку!</p>
  53. @endif
  54. </article>
  55. </main>
  56. @endsection