function delete_process($proc_id) { global $conn; $error = false; $resp = new xajaxResponse(); $sql = "DELETE FROM bp_process_asset_reference WHERE process_id=?"; if (!$conn->Execute($sql, array($proc_id))) { $resp->AddAssign("form_errors", "innerHTML", $conn->ErrorMsg()); $error = true; } $sql = "DELETE FROM bp_process WHERE id=?"; if (!$conn->Execute($sql, array($proc_id))) { $resp->AddAssign("form_errors", "innerHTML", $conn->ErrorMsg()); $error = true; } if ($error) { return $resp; } $resp->AddRedirect($_SERVER['SCRIPT_NAME']); return $resp; }