echo "error###" . $error; exit; } } //DB connection $db = new ossim_db(); $conn = $db->connect(); $ids = explode(",", $selected_incidents); $ids_updated = array(); $size = count($ids); if (is_array($ids) && $size > 0) { for ($i = 0; $i < $size; $i++) { $incident_id = $ids[$i]; if ($incident_id != "" && Incident::user_incident_perms($conn, $incident_id, 'show')) { if ($action == 'apply_tags') { $res = Incident::insert_incident_tag($conn, $incident_id, $tag); } else { $res = Incident::delete_incident_tags($conn, $incident_id); } if ($res === TRUE) { $ids_updated[$incident_id] = $incident_id; } } } if ($action == 'apply_tags') { $incident_tag = new Incident_tag($conn); if (count($ids) != count($ids_updated)) { echo "OK###DB Error###" . implode(",", $ids_updated) . "###"; } else { echo "OK###Tag added###"; }