mirror of
https://github.com/itflow-org/itflow
synced 2026-03-04 21:04:50 +00:00
Added Ack all Alerts and view alerts, you can now ack alerts now
This commit is contained in:
23
alerts.php
23
alerts.php
@@ -15,8 +15,7 @@
|
|||||||
<th>Date</th>
|
<th>Date</th>
|
||||||
<th>Type</th>
|
<th>Type</th>
|
||||||
<th>Alert</th>
|
<th>Alert</th>
|
||||||
<th>Ack</th>
|
<th class="text-center">Ack</th>
|
||||||
<th class="text-center">Actions</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -27,23 +26,19 @@
|
|||||||
$alert_type = $row['alert_type'];
|
$alert_type = $row['alert_type'];
|
||||||
$alert_message = $row['alert_message'];
|
$alert_message = $row['alert_message'];
|
||||||
$alert_date = $row['alert_date'];
|
$alert_date = $row['alert_date'];
|
||||||
$alert_read = $row['alert_read'];
|
$alert_ack_date = $row['alert_ack_date'];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr class="row-danger">
|
||||||
<td><?php echo $alert_date; ?></td>
|
<td><?php echo $alert_date; ?></td>
|
||||||
<td><?php echo $alert_type; ?></td>
|
<td><?php echo $alert_type; ?></td>
|
||||||
<td><?php echo $alert_message; ?></td>
|
<td><?php echo $alert_message; ?></td>
|
||||||
<td><?php echo $alert_read; ?></td>
|
<td class="text-center">
|
||||||
<td>
|
<?php if($alert_ack_date == 0){ ?>
|
||||||
<div class="dropdown dropleft text-center">
|
<a class="btn btn-success btn-sm" href="post.php?alert_ack=<?php echo $alert_id; ?>"><i class="fa fa-check"></i></a>
|
||||||
<button class="btn btn-secondary btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<?php }else{ ?>
|
||||||
<i class="fas fa-ellipsis-h"></i>
|
<?php echo $alert_ack_date; ?>
|
||||||
</button>
|
<?php } ?>
|
||||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
|
||||||
<a class="dropdown-item" href="post.php?delete_alert=<?php echo $client_id; ?>">Delete</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
31
post.php
31
post.php
@@ -347,6 +347,37 @@ if(isset($_GET['delete_category'])){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isset($_GET['alert_ack'])){
|
||||||
|
|
||||||
|
$alert_id = intval($_GET['alert_ack']);
|
||||||
|
|
||||||
|
mysqli_query($mysqli,"UPDATE alerts SET alert_ack_date = CURDATE() WHERE alert_id = $alert_id");
|
||||||
|
|
||||||
|
$_SESSION['alert_message'] = "Alert Acknowledged";
|
||||||
|
|
||||||
|
header("Location: alerts.php");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($_GET['ack_all_alerts'])){
|
||||||
|
|
||||||
|
$sql = mysqli_query($mysqli,"SELECT * FROM alerts ORDER BY alert_id DESC");
|
||||||
|
|
||||||
|
while($row = mysqli_fetch_array($sql)){
|
||||||
|
$alert_id = $row['alert_id'];
|
||||||
|
$alert_ack_date = $row['alert_ack_date'];
|
||||||
|
|
||||||
|
if($alert_ack_date = 0 ){
|
||||||
|
mysqli_query($mysqli,"UPDATE alerts SET alert_ack_date = CURDATE() WHERE alert_id = $alert_id");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$_SESSION['alert_message'] = "Alerts Acknowledged";
|
||||||
|
|
||||||
|
header("Location: alerts.php");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if(isset($_POST['add_expense'])){
|
if(isset($_POST['add_expense'])){
|
||||||
|
|
||||||
$date = strip_tags(mysqli_real_escape_string($mysqli,$_POST['date']));
|
$date = strip_tags(mysqli_real_escape_string($mysqli,$_POST['date']));
|
||||||
|
|||||||
@@ -26,10 +26,10 @@
|
|||||||
<span class="badge badge-danger">9+</span>
|
<span class="badge badge-danger">9+</span>
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="alertsDropdown">
|
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="alertsDropdown">
|
||||||
<a class="dropdown-item" href="#">Action</a>
|
<a class="dropdown-item" href="alerts.php">New Alerts</a>
|
||||||
<a class="dropdown-item" href="#">Another action</a>
|
<a class="dropdown-item" href="alerts.php">Acknowledged</a>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item" href="#">Something else here</a>
|
<a class="dropdown-item" href="post.php?ack_all_alerts">Acknowledge All</a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item dropdown no-arrow">
|
<li class="nav-item dropdown no-arrow">
|
||||||
|
|||||||
Reference in New Issue
Block a user