Update badge color based on status.

This commit is contained in:
o-psi 2024-01-10 21:25:22 +00:00
parent 25c26cc2a6
commit 8dad54e450
1 changed files with 23 additions and 3 deletions

View File

@ -15,17 +15,37 @@
<tr>
<th>Ticket Number</th>
<th>Scope</th>
<th class="text-right">Add to Invoice</th>
<th>Add to Invoice</th>
</tr>
</thead>
<?php while ($row = mysqli_fetch_array($sql_tickets_billable)) {
$ticket_id = intval($row['ticket_id']);
$ticket_subject = nullable_htmlentities($row['ticket_subject']);
$ticket_number = intval($row['ticket_number']);
$ticket_prefix = nullable_htmlentities($row['ticket_prefix']);
$ticket_status = nullable_htmlentities($row['ticket_status']);
switch ($ticket_status) {
case 'Closed':
$ticket_status_class = 'badge-dark';
break;
case 'Auto Close':
$ticket_status_class = 'badge-warning';
break;
default:
$ticket_status_class = 'badge-secondary';
break;
}
?>
<tr>
<td><?php echo $ticket_id?></td>
<td>
<a href="ticket.php?ticket_id=<?php echo $ticket_id; ?>">
<span class="badge badge-pill <?php echo $ticket_status_class?> p-3"><?php echo "$ticket_prefix$ticket_number"; ?></span>
</a>
</td>
<td><?php echo $ticket_subject ?></td>
<td></td>
<td><a href='ticket.php?ticket_id=<?php echo $ticket_id?>&invoice_id=<?php echo $invoice_id?>#addInvoiceFromTicketModal'>
<i class="fas fa-fw fa-plus-circle"></i></td>
</tr>