|
@@ -14,7 +14,7 @@
|
14
|
14
|
<i class="fa-solid fa-house text-[#BD8736] mr-1"></i>
|
15
|
15
|
<span>Dashboard <i class="fa-solid fa-chevron-right"></i> Lihat Projek</span>
|
16
|
16
|
</p>
|
17
|
|
- <div class="relative cursor-pointer">
|
|
17
|
+ <div class="relative cursor-pointer hidden md:block">
|
18
|
18
|
@if ($hasNotification)
|
19
|
19
|
<div class="absolute top-[2px] left-0 w-2 h-2 bg-[#E50A0A] rounded-full"></div>
|
20
|
20
|
@endif
|
|
@@ -23,8 +23,8 @@
|
23
|
23
|
</div>
|
24
|
24
|
</div>
|
25
|
25
|
|
26
|
|
- <div class="flex" style="gap:10px">
|
27
|
|
- <div class="relative w-fit">
|
|
26
|
+ <div class="flex flex-col lg:flex-row gap-2 w-full">
|
|
27
|
+ <div class="relative w-full lg:w-fit">
|
28
|
28
|
<input type="text" placeholder="Carian"
|
29
|
29
|
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" />
|
30
|
30
|
<div class="pointer-events-none absolute text-gray-500 text-xs"
|
|
@@ -33,7 +33,7 @@
|
33
|
33
|
</div>
|
34
|
34
|
</div>
|
35
|
35
|
|
36
|
|
- <div class="relative w-fit">
|
|
36
|
+ <div class="relative w-full lg:w-fit">
|
37
|
37
|
<select id="selectProjectType"
|
38
|
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
|
39
|
onchange="fetchAndRenderProjects()">
|
|
@@ -42,9 +42,8 @@
|
42
|
42
|
</select>
|
43
|
43
|
</div>
|
44
|
44
|
|
45
|
|
- <div class="relative w-fit">
|
46
|
|
- <select
|
47
|
|
- id="selectProjectStatus"
|
|
45
|
+ <div class="relative w-full lg:w-fit">
|
|
46
|
+ <select id="selectProjectStatus"
|
48
|
47
|
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"
|
49
|
48
|
onchange="renderFDITable()">
|
50
|
49
|
<option value="all" selected>Status</option>
|
|
@@ -53,9 +52,8 @@
|
53
|
52
|
</select>
|
54
|
53
|
</div>
|
55
|
54
|
|
56
|
|
- <div class="relative w-fit">
|
57
|
|
- <select
|
58
|
|
- id="selectProjectArea"
|
|
55
|
+ <div class="relative w-full lg:w-fit">
|
|
56
|
+ <select id="selectProjectArea"
|
59
|
57
|
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"
|
60
|
58
|
onchange="renderFDITable()">
|
61
|
59
|
<option value="all" selected>Daerah</option>
|
|
@@ -64,9 +62,8 @@
|
64
|
62
|
</select>
|
65
|
63
|
</div>
|
66
|
64
|
|
67
|
|
- <div class="relative w-fit">
|
68
|
|
- <select
|
69
|
|
- id="selectProjectYear"
|
|
65
|
+ <div class="relative w-full lg:w-fit">
|
|
66
|
+ <select id="selectProjectYear"
|
70
|
67
|
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"
|
71
|
68
|
onchange="renderFDITable()">
|
72
|
69
|
<option value="all" selected>Tahun</option>
|
|
@@ -76,12 +73,12 @@
|
76
|
73
|
</div>
|
77
|
74
|
|
78
|
75
|
<button
|
79
|
|
- 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 ml-auto">
|
|
76
|
+ class="bg-[#012961] hover:bg-blue-700 text-white font-semibold w-full lg:w-fit text-xs py-2 px-4 rounded-lg shadow-md transition duration-200">
|
80
|
77
|
<span><i class="fa-solid fa-file-excel text-white text-xs pe-3"></i> Eksport</span>
|
81
|
78
|
</button>
|
82
|
|
-
|
83
|
79
|
</div>
|
84
|
80
|
|
|
81
|
+
|
85
|
82
|
<div class="border rounded">
|
86
|
83
|
<h5 class="font-semibold m-5">Senarai Pelaburan Komited Perbadanan Kemajuan Negeri Pahang (PKNP) 2025</h5>
|
87
|
84
|
<div class="bg-[#012961] text-white p-5">
|
|
@@ -171,7 +168,7 @@
|
171
|
168
|
<th class="text-xs px-4 py-5">Keluasan (Ekar)</th>
|
172
|
169
|
</tr>
|
173
|
170
|
</thead>
|
174
|
|
- <tbody>
|
|
171
|
+ <tbody id="DDItableBody">
|
175
|
172
|
@foreach ($commitedDDIProject as $index => $project)
|
176
|
173
|
<tr>
|
177
|
174
|
<td class="px-4 py-2">{{ $index + 1 }}</td>
|
|
@@ -220,12 +217,6 @@
|
220
|
217
|
</div>
|
221
|
218
|
</div>
|
222
|
219
|
|
223
|
|
- <button
|
224
|
|
- 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 ml-auto">
|
225
|
|
- <i class="fa-solid fa-download text-white text-xs"></i>
|
226
|
|
- <span>Simpan</span>
|
227
|
|
- </button>
|
228
|
|
-
|
229
|
220
|
<div class="border rounded p-5">
|
230
|
221
|
|
231
|
222
|
<h5 class="font-semibold mb-4">Rekod Penetapan KPI Pelaburan</h5>
|
|
@@ -234,15 +225,19 @@
|
234
|
225
|
<p class="text-xs font-bold">15-04-2025 | Jumlah Pelaburan Komited telah dikemaskini berdasarkan data yang
|
235
|
226
|
diisi
|
236
|
227
|
oleh S-GLC. Jumlah pelaburan komited berjumlah RM 2,000,333.00.</p>
|
237
|
|
-
|
238
|
228
|
</div>
|
239
|
229
|
|
|
230
|
+ <button
|
|
231
|
+ 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 ml-auto">
|
|
232
|
+ <i class="fa-solid fa-edit text-white text-xs"></i>
|
|
233
|
+ <span>Kemaskini</span>
|
|
234
|
+ </button>
|
|
235
|
+
|
240
|
236
|
</div>
|
241
|
237
|
@endsection
|
242
|
238
|
|
243
|
239
|
@section('scripts')
|
244
|
240
|
<script>
|
245
|
|
-
|
246
|
241
|
var FDIProject = [];
|
247
|
242
|
var DDIProject = [];
|
248
|
243
|
|
|
@@ -258,7 +253,9 @@
|
258
|
253
|
if (!data.FDIProject || !data.DDIProject) return
|
259
|
254
|
|
260
|
255
|
FDIProject = data.FDIProject
|
|
256
|
+ DDIProject = data.DDIProject
|
261
|
257
|
renderFDITable()
|
|
258
|
+ renderDDITable()
|
262
|
259
|
|
263
|
260
|
} catch (error) {
|
264
|
261
|
console.error('Error fetching projects:', error);
|
|
@@ -307,7 +304,49 @@
|
307
|
304
|
|
308
|
305
|
}
|
309
|
306
|
|
310
|
|
- function filterData(data){
|
|
307
|
+ function renderDDITable() {
|
|
308
|
+
|
|
309
|
+ const tbody = document.getElementById('DDItableBody');
|
|
310
|
+ tbody.innerHTML = ''; // Clear existing content
|
|
311
|
+
|
|
312
|
+ data = filterData(DDIProject)
|
|
313
|
+
|
|
314
|
+ data.forEach((project, index) => {
|
|
315
|
+ const statusHTML = (() => {
|
|
316
|
+ switch (project.status) {
|
|
317
|
+ case 1:
|
|
318
|
+ return `<div class="px-3 py-1 text-xs rounded-lg border inline-block"
|
|
319
|
+ style="color:#E5A20A; background-color:#FFFBF4; border-color:#E5A20A;width:100%">
|
|
320
|
+ Perjanjian Muktamad</div>`;
|
|
321
|
+ case 0:
|
|
322
|
+ return `<div class="px-3 py-1 text-xs rounded-lg border inline-block"
|
|
323
|
+ style="color:#49B452; background-color:#F7FFF7; border-color:#49B452;width:100%">
|
|
324
|
+ Deraf Perjanjian</div>`;
|
|
325
|
+ default:
|
|
326
|
+ return `<div>-</div>`;
|
|
327
|
+ }
|
|
328
|
+ })();
|
|
329
|
+
|
|
330
|
+ const row = `
|
|
331
|
+ <tr>
|
|
332
|
+ <td class="px-4 py-2">${index + 1}</td>
|
|
333
|
+ <td class="px-4 py-2">${project.company_name}</td>
|
|
334
|
+ <td class="px-4 py-2">${project.type}</td>
|
|
335
|
+ <td class="px-4 py-2 text-center">${statusHTML}</td>
|
|
336
|
+ <td class="px-4 py-2 text-xs">${project.note}</td>
|
|
337
|
+ <td class="px-4 py-2 text-xs">${project.moa_date}</td>
|
|
338
|
+ <td class="px-4 py-2 text-xs">${project.area}</td>
|
|
339
|
+ <td class="px-4 py-2 text-xs">${Number(project.invesment_approx).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2})}</td>
|
|
340
|
+ <td class="px-4 py-2 text-xs">${project.labour_approx}</td>
|
|
341
|
+ <td class="px-4 py-2 text-xs">${project.land_area ? Number(project.land_area).toLocaleString() : '<span class="text-md font-bold">TBC</span>'}</td>
|
|
342
|
+ </tr>
|
|
343
|
+ `;
|
|
344
|
+ tbody.insertAdjacentHTML('beforeend', row);
|
|
345
|
+ });
|
|
346
|
+
|
|
347
|
+ }
|
|
348
|
+
|
|
349
|
+ function filterData(data) {
|
311
|
350
|
|
312
|
351
|
const status = document.getElementById("selectProjectStatus").value
|
313
|
352
|
const area = document.getElementById("selectProjectArea").value
|