mirror of https://github.com/itflow-org/itflow
added client to dismissed notifications
This commit is contained in:
parent
2e55aceda1
commit
8376b5c6a2
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM notifications WHERE notification_dismissed_at IS NULL AND company_id = $session_company_id ORDER BY notification_id DESC");
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM notifications LEFT JOIN clients ON notification_client_id = client_id WHERE notification_dismissed_at IS NULL AND notifications.company_id = $session_company_id ORDER BY notification_id DESC");
|
||||
|
||||
?>
|
||||
|
||||
|
|
@ -25,6 +25,7 @@ $sql = mysqli_query($mysqli,"SELECT * FROM notifications WHERE notification_dism
|
|||
<th>Timestamp</th>
|
||||
<th>Type</th>
|
||||
<th>Notification</th>
|
||||
<th>Client</th>
|
||||
<th class="text-center">Dismiss</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -36,12 +37,20 @@ $sql = mysqli_query($mysqli,"SELECT * FROM notifications WHERE notification_dism
|
|||
$notification_type = $row['notification_type'];
|
||||
$notification = $row['notification'];
|
||||
$notification_timestamp = $row['notification_timestamp'];
|
||||
$client_name = $row['client_name'];
|
||||
$client_id = $row['client_id'];
|
||||
if(empty($client_name)){
|
||||
$client_name_display = "-";
|
||||
}else{
|
||||
$client_name_display = "<a href='client.php?client_id=$client_id&tab=notifications'>$client_name</a>";
|
||||
}
|
||||
|
||||
?>
|
||||
<tr class="row-danger">
|
||||
<td><?php echo $notification_timestamp; ?></td>
|
||||
<td><?php echo $notification_type; ?></td>
|
||||
<td><?php echo $notification; ?></td>
|
||||
<td><?php echo $client_name_display; ?></td>
|
||||
<td class="text-center"><a class="btn btn-info btn-sm" href="post.php?dismiss_notification=<?php echo $notification_id; ?>"><i class="fa fa-check"></a></td>
|
||||
</tr>
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,10 @@ if(!empty($_GET['dtf'])){
|
|||
|
||||
$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o)));
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM notifications LEFT JOIN users ON notification_dismissed_by = user_id WHERE (notification_type LIKE '%$q%' OR notification LIKE '%$q%' OR user_name LIKE '%$q%') AND DATE(notification_timestamp) BETWEEN '$dtf' AND '$dtt' AND company_id = $session_company_id AND notification_dismissed_at IS NOT NULL ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM notifications
|
||||
LEFT JOIN users ON notification_dismissed_by = user_id
|
||||
LEFT JOIN clients ON notification_client_id = client_id
|
||||
WHERE (notification_type LIKE '%$q%' OR notification LIKE '%$q%' OR user_name LIKE '%$q%' OR client_name LIKE '%$q%') AND DATE(notification_timestamp) BETWEEN '$dtf' AND '$dtt' AND notifications.company_id = $session_company_id AND notification_dismissed_at IS NOT NULL ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
|
||||
|
|
@ -101,8 +104,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=notification_timestamp&o=<?php echo $disp; ?>">Timestamp <i class="fa fa-sort-numeric<?php if($disp=='ASC'){ echo "-up"; }else{ echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=notification_type&o=<?php echo $disp; ?>">Type <i class="fa fa-sort-alpha<?php if($disp=='ASC'){ echo "-up"; }else{ echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=notification&o=<?php echo $disp; ?>">Notification <i class="fa fa-sort-alpha<?php if($disp=='ASC'){ echo "-up"; }else{ echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=client_name&o=<?php echo $disp; ?>">Client <i class="fa fa-sort-numeric<?php if($disp=='ASC'){ echo "-up"; }else{ echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=notification_dismissed_at&o=<?php echo $disp; ?>">Dismissed At <i class="fa fa-sort-numeric<?php if($disp=='ASC'){ echo "-up"; }else{ echo "-down"; }?>"></i></a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=user_name&o=<?php echo $disp; ?>">Dismissed By <i class="fa fa-sort-numeric<?php if($disp=='ASC'){ echo "-up"; }else{ echo "-down"; }?>"></i></a></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -115,12 +120,20 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||
$notification = $row['notification'];
|
||||
$notification_dismissed_at = $row['notification_dismissed_at'];
|
||||
$user_name = $row['user_name'];
|
||||
$client_name = $row['client_name'];
|
||||
$client_id = $row['client_id'];
|
||||
if(empty($client_name)){
|
||||
$client_name_display = "-";
|
||||
}else{
|
||||
$client_name_display = "<a href='client.php?client_id=$client_id&tab=notifications'>$client_name</a>";
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $notification_timestamp; ?></td>
|
||||
<td><?php echo $notification_type; ?></td>
|
||||
<td><?php echo $notification; ?></td>
|
||||
<td><?php echo $client_name_display; ?></td>
|
||||
<td><?php echo $notification_dismissed_at; ?></td>
|
||||
<td><?php echo $user_name; ?></td>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue