You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

agency_performance.blade.php 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. @extends('layouts.main')
  2. @php
  3. $hasNotification = true;
  4. @endphp
  5. @section('content')
  6. <div class="flex flex-col gap-4 bg-white rounded p-10 min-h-screen">
  7. <div class="flex justify-between items-center">
  8. <p class="flex items-center text-xs">
  9. <i class="fa-solid fa-house text-[#BD8736] mr-1"></i>
  10. <span>Dashboard <i class="fa-solid fa-chevron-right"></i> Senarai Agensi</span>
  11. </p>
  12. <div class="relative cursor-pointer hidden md:block">
  13. @if ($hasNotification)
  14. <div class="absolute top-[2px] left-0 w-2 h-2 bg-[#E50A0A] rounded-full"></div>
  15. @endif
  16. <i class="fa-regular fa-bell text-md hover:text-[#BD8736]"></i>
  17. </div>
  18. </div>
  19. <div class="flex" style="gap:10px">
  20. <div class="relative w-fit">
  21. <input type="text" placeholder="Carian"
  22. class="w-full pl-4 pr-10 py-1 px-5 border border-gray-300 rounded-lg text-sm text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500" />
  23. <div class="pointer-events-none absolute text-gray-500 text-xs"
  24. style="top: 50%; transform: translateY(-50%); right:10px">
  25. <i class="fas fa-search"></i>
  26. </div>
  27. </div>
  28. <div class="relative w-fit">
  29. <select
  30. class="appearance-none w-full pl-4 pr-10 py-1 px-5 border border-gray-300 rounded-lg text-sm text-gray-700 cursor-pointer bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500">
  31. <option value="all" selected>Agensi</option>
  32. <option value="pknp">PKNP</option>
  33. <option value="pkpp">PKPP</option>
  34. </select>
  35. </div>
  36. <div class="relative w-fit">
  37. <select
  38. class="appearance-none w-full pl-4 pr-10 py-1 px-5 border border-gray-300 rounded-lg text-sm text-gray-700 cursor-pointer bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500">
  39. <option value="all" selected>Status Prestasi</option>
  40. <option value="1">Lemah</option>
  41. <option value="2">Sederhana</option>
  42. <option value="3">Baik</option>
  43. </select>
  44. </div>
  45. </div>
  46. <div class="border rounded">
  47. <h5 class="font-semibold m-5">Senarai Agensi</h5>
  48. <div class="overflow-x-auto overflow-hidden rounded-[10px]">
  49. <table class="w-full text-sm text-left text-gray-700 border-collapse">
  50. <thead>
  51. <tr>
  52. <th class="text-xs px-4 py-2">Bil</th>
  53. <th class="text-xs px-4 py-2">S-GLC to Agensi</th>
  54. <th class="text-xs px-4 py-2 text-center">Nama Syarikat</th>
  55. <th class="text-xs px-4 py-2 text-center">Siap / Lambat (%)</th>
  56. </tr>
  57. </thead>
  58. <tbody>
  59. @foreach ($agencys as $index => $agency)
  60. <tr>
  61. <td class="px-4 py-2">{{ $index + 1 }}</td>
  62. <td class="px-4 py-2">{{ $agency['name'] }}</td>
  63. <td class="px-4 py-2 text-center">{{ $agency['company_name'] }}
  64. </td>
  65. <td class="px-4 py-2 text-center">
  66. <div class="flex items-center gap-2">
  67. <span class="font-bold text-xs">{{ $agency['percent'] }}</span>
  68. @php
  69. $percent = $agency['percent'];
  70. $barColor = match (true) {
  71. $percent < 30 => 'bg-[#CE4C4A]', // Red
  72. $percent < 66 => 'bg-[#E5A20A]', // Yellow
  73. default => 'bg-[#49B452]', // Green
  74. };
  75. @endphp
  76. <div class="w-full bg-gray-200 rounded-full h-2 overflow-hidden">
  77. <div class="{{ $barColor }} h-full rounded-full transition-all duration-500"
  78. style="width: {{ $percent }}%">
  79. </div>
  80. </div>
  81. </div>
  82. </td>
  83. </tr>
  84. @endforeach
  85. </tbody>
  86. </table>
  87. </div>
  88. </div>
  89. </div>
  90. @endsection
  91. @section('scripts')
  92. @endsection