Update cron to Create notification of tickets pending assignment

This commit is contained in:
johnnyq 2023-09-17 18:55:44 -04:00
parent 8fa76daf3a
commit 40aaddd09b
1 changed files with 16 additions and 0 deletions

View File

@ -202,6 +202,22 @@ foreach ($warranty_alert_array as $day) {
// Logging
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Cron', log_action = 'Task', log_description = 'Cron created notifications for asset warranties expiring'");
// Notify of Tickets Pending Assignment
// Get Ticket Pending Assignment
$sql_tickets_pending_assignment = mysqli_query($mysqli,"SELECT ticket_id FROM tickets
WHERE ticket_status = 'Pending-Assignment'"
);
$tickets_pending_assignment = mysqli_num_rows($sql_tickets_pending_assignment);
if($tickets_pending_assignment > 0){
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Ticket', notification = 'There are $ticket_pending_assignment Tickets pending Assignment', notification_action = 'tickets.php?status=Pending-Assignment'");
// Logging
mysqli_query($mysqli, "INSERT INTO logs SET log_type = 'Cron', log_action = 'Task', log_description = 'Cron created notifications for tickets that are pending assignment'");
}
// Scheduled tickets
// Get scheduled tickets for today