add status approval anggota for operasi

This commit is contained in:
nurafrinaalimi16
2025-11-11 22:38:02 +08:00
parent 173ce892b9
commit d6b4685f54
@@ -29,7 +29,7 @@
<th>Cawangan</th> <th>Cawangan</th>
<th>No Kad Pengenalan</th> <th>No Kad Pengenalan</th>
<th>Nama Anggota</th> <th>Nama Anggota</th>
<th>Komen</th> <th>Status</th>
<th>Tarikh/Masa</th> <th>Tarikh/Masa</th>
<th>Tindakan</th> <th>Tindakan</th>
</tr> </tr>
@@ -37,12 +37,44 @@
<tbody> <tbody>
@foreach ($arraykelulusan as $index => $k) @foreach ($arraykelulusan as $index => $k)
@foreach ($k['kelulusanall'] as $indexapp => $approval) @foreach ($k['kelulusanall'] as $indexapp => $approval)
@php
$status = strtolower($approval['status'] ?? '');
$statusLabel = $approval['status'] ?? '—';
// Gunakan strpos() supaya compatible dengan PHP 7.x juga
if (
strpos($status, 'lulus') !== false ||
strpos($status, 'diluluskan') !== false ||
strpos($status, 'selesai') !== false
) {
$statusStyle = 'background-color:#7ee4b8; color:white;';
} elseif (
strpos($status, 'tolak') !== false ||
strpos($status, 'batal') !== false
) {
$statusStyle = 'background-color:#f58c8c; color:white;';
} elseif (
strpos($status, 'menunggu') !== false ||
strpos($status, 'pending') !== false
) {
$statusStyle = 'background-color:#ffd166; color:#333;';
} else {
$statusStyle = 'background-color:#d1d5db; color:#333;';
}
@endphp
<tr> <tr>
<td>{{ $k['cawangan'] }}</td> <td>{{ $k['cawangan'] }}</td>
<td>{{ $approval['nokp'] }}</td> <td>{{ $approval['nokp'] }}</td>
<td>{{ $approval['nama'] ?? '-' }}</td> <td>{{ $approval['nama'] ?? '-' }}</td>
<td>{{ $approval['komen'] ?? '—' }}</td> <td>
<td>{{ \Carbon\Carbon::parse($approval['created_at'])->timezone('Asia/Kuala_Lumpur')->format('d/m/Y h:i A') }}</td> <span class="px-3 py-2 d-inline-block text-center fw-bold"
style="{{ $statusStyle }} border-radius:8px; min-width:130px; display:inline-block;">
{{ $statusLabel }}
</span>
</td>
<td>{{ \Carbon\Carbon::parse($approval['created_at'])->timezone('Asia/Kuala_Lumpur')->format('d/m/Y h:i A') }}
</td>
<td> <td>
<!-- Lulus --> <!-- Lulus -->
<button class="btn btn-success btn-sm me-2" <button class="btn btn-success btn-sm me-2"