$id, 'from' => 0, 'status' => 'Not Updated']; $result = dbquery("SELECT error_status FROM ".DB_ERRORS." WHERE error_id='".intval($id)."'"); if (dbrows($result) > 0) { $data = dbarray($result); if ($type == 999) { // Delete Error $result = dbquery("DELETE FROM ".DB_ERRORS." WHERE error_id='".intval($id)."'"); if ($result) { $this_response = ['fusion_error_id' => $id, 'from' => $data['error_status'], 'to' => $type, 'status' => 'RMD']; } } else { // Update Error Status $result = dbquery("UPDATE ".DB_ERRORS." SET error_status='".intval($type)."' WHERE error_id='".intval($id)."'"); if ($result) { $this_response = ['fusion_error_id' => $id, 'from' => $data['error_status'], 'to' => $type, 'status' => 'OK']; } } } else { // Invalid error ID $this_response = ['fusion_error_id' => $id, 'from' => 0, 'status' => 'Invalid ID']; } } else { $this_response = ['fusion_error_id' => $id, 'from' => 0, 'status' => 'Invalid Token or Insufficient Rights']; } header('Content-Type: application/json'); echo json_encode($this_response);