Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

home.blade.php 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. @extends('layouts.main')
  2. @php
  3. $totalTargetAmount = 0;
  4. $totalTargetAmountYB = 0;
  5. $chartLabel = [];
  6. $chartPercent = [];
  7. $hasNotification = true;
  8. foreach ($status as $data) {
  9. $chartLabel[] = $data['name'];
  10. $chartPercent[] = $data['percent'];
  11. }
  12. foreach ($rekodKPIPelaburan as $index => $data) {
  13. $totalTargetAmount += $data['investment_target'];
  14. $totalTargetAmountYB += $data['investment_target_setting'];
  15. }
  16. @endphp
  17. @section('content')
  18. <div class="flex flex-col gap-4 bg-white rounded p-10 min-h-screen">
  19. <div class="flex justify-between items-center">
  20. <p class="flex items-center text-xs">
  21. <i class="fa-solid fa-house text-[#BD8736] mr-1"></i>
  22. <span>Dashboard</span>
  23. </p>
  24. <div class="relative cursor-pointer hidden md:block">
  25. @if ($hasNotification)
  26. <div class="absolute top-[2px] left-0 w-2 h-2 bg-[#E50A0A] rounded-full"></div>
  27. @endif
  28. <i class="fa-regular fa-bell text-md hover:text-[#BD8736]"></i>
  29. </div>
  30. </div>
  31. <div class="border rounded p-5">
  32. <h6 class="font-semibold mb-4">Senarai Agensi Mengikut Status</h6>
  33. <div class="mx-auto text-center" style="width:25%">
  34. <canvas id="agencyPieChart"></canvas>
  35. <h5 class="font-bold my-2">Status</h5>
  36. </div>
  37. </div>
  38. <div class="border rounded">
  39. <h5 class="font-semibold m-5">Rekod Penetapan KPI Pelaburan</h5>
  40. <div class="overflow-x-auto overflow-hidden rounded-[10px]">
  41. <table class="w-full text-sm text-left text-gray-700 border-collapse">
  42. <thead>
  43. <tr>
  44. <th class="text-xs px-4 py-2 text-center">Bil</th>
  45. <th class="text-xs px-4 py-2 text-center">S-GLC</th>
  46. <th class="text-xs px-4 py-2 text-center">Sasaran Pelaburan 2025 (RM)</th>
  47. <th class="text-xs px-4 py-2 text-center">Penetapan Sasaran Pelaburan (RM) oleh YB Dato’
  48. Pengerusi
  49. </th>
  50. </tr>
  51. </thead>
  52. <tbody>
  53. @foreach ($rekodKPIPelaburan as $index => $data)
  54. <tr>
  55. <td class="px-4 py-2 border text-center">{{ $index + 1 }}</td>
  56. <td class="px-4 py-2 border ">
  57. <a href="/project" class="text-blue-800 underline">{{ $data['name'] }}</a>
  58. </td>
  59. <td class="px-4 py-2 border text-center">{{ number_format($data['investment_target'], 2) }}
  60. </td>
  61. <td class="px-4 py-2 border text-center">
  62. {{ number_format($data['investment_target_setting'], 2) }}</td>
  63. </tr>
  64. @endforeach
  65. <tr class="bg-[#012961]">
  66. <td class="px-4 py-2 text-white" colspan="2">Jumlah</td>
  67. <td class="px-4 py-2 text-white text-center">{{ number_format($totalTargetAmount, 2) }}</td>
  68. <td class="px-4 py-2 text-white text-center">{{ number_format($totalTargetAmountYB, 2) }}</td>
  69. </tr>
  70. </tbody>
  71. </table>
  72. </div>
  73. </div>
  74. <div x-data="{ editNote: false }">
  75. <div x-show="!editNote" class="border rounded p-5 space-y-4 mb-3">
  76. <h5 class="font-semibold mb-4">Rekod Penetapan KPI Pelaburan</h5>
  77. <p class="text-xs font-bold">
  78. YB Dato’ Pengerusi memohon agar sasaran adalah melebihi sasaran tahun 2024:
  79. <span class="text-[#BD8736]">DEADLINE, 2 WEEK from JPPP MEETING.</span>
  80. </p>
  81. <p class="text-xs font-bold">
  82. 15-04-2025 | Jumlah Pelaburan Komited telah dikemaskini berdasarkan data yang diisi
  83. oleh S-GLC. Jumlah pelaburan komited berjumlah RM 2,000,333.00.
  84. </p>
  85. </div>
  86. <!-- Edit mode -->
  87. <div x-show="editNote" class="border rounded p-5 space-y-4 mb-3">
  88. <label for="note" class="text-sm font-semibold text-gray-700 block">Kemaskini Nota:</label>
  89. <textarea id="textNote" x-model="noteText" placeholder="Masukkan nota baru di sini..."
  90. class="w-full h-32 p-3 border border-gray-300 rounded-lg text-sm text-gray-800 resize-none focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white"></textarea>
  91. </div>
  92. <!-- Buttons -->
  93. <div class="flex justify-end gap-2">
  94. <!-- Show when not editing -->
  95. <button @click="editNote = true" x-show="!editNote"
  96. class="bg-[#012961] hover:bg-blue-700 text-white font-semibold w-fit text-xs py-2 px-4 rounded-lg shadow-md transition duration-200">
  97. <i class="fa-solid fa-edit text-white text-xs"></i>
  98. <span>Kemaskini</span>
  99. </button>
  100. <!-- Show when editing -->
  101. <button onclick="updateNote()" @click="editNote = false" x-show="editNote"
  102. class="bg-[#012961] hover:bg-blue-700 text-white font-semibold w-fit text-xs py-2 px-4 rounded-lg shadow-md transition duration-200">
  103. <i class="fa-solid fa-save text-white text-xs"></i>
  104. <span>Simpan</span>
  105. </button>
  106. </div>
  107. <script>
  108. function updateNote(){
  109. console.log("update note")
  110. }
  111. </script>
  112. </div>
  113. </div>
  114. @endsection
  115. @section('scripts')
  116. <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
  117. <script>
  118. const ctx = document.getElementById('agencyPieChart').getContext('2d');
  119. const chartLabels = @json($chartLabel);
  120. const chartData = @json($chartPercent);
  121. new Chart(ctx, {
  122. type: 'pie',
  123. data: {
  124. labels: chartLabels,
  125. datasets: [{
  126. label: 'Status',
  127. data: chartData,
  128. backgroundColor: [
  129. '#F9DFF2 ',
  130. '#F9DFC0 ',
  131. '#E0C7FB',
  132. '#CDF6DE',
  133. '#FAEAB7',
  134. '#E0EEFE'
  135. ],
  136. borderWidth: 1
  137. }]
  138. },
  139. options: {
  140. responsive: true,
  141. plugins: {
  142. legend: false,
  143. tooltip: {
  144. callbacks: {
  145. label: function(context) {
  146. let label = context.label || '';
  147. let value = context.parsed;
  148. return `(${value}%)`;
  149. }
  150. }
  151. }
  152. }
  153. }
  154. });
  155. </script>
  156. @endsection