Get Badge count for alerts on top nav

This commit is contained in:
root 2019-04-19 16:12:59 -04:00
parent 2663ca5521
commit 261eb50b64
2 changed files with 6 additions and 1 deletions

View File

@ -26,4 +26,9 @@
$session_map_source = "google";
}
//Get unAcked Alert Count for the badge on the top nav
$row = mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT COUNT('alert_id') AS num FROM alerts WHERE alert_ack_date = 0"));
$num_alerts = $row['num'];
?>

View File

@ -23,7 +23,7 @@
<li class="nav-item dropdown no-arrow mx-2">
<a class="nav-link dropdown-toggle" href="#" id="alertsDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-bell fa-fw"></i>
<span class="badge badge-danger">9+</span>
<?php if($num_alerts > 0){ ?> <span class="badge badge-danger"><?php echo $num_alerts; ?></span> <?php } ?>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="alertsDropdown">
<a class="dropdown-item" href="alerts.php">New Alerts</a>