appId; //check for admin privs if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isMaintainer($aClean['iVersionId']) && !$_SESSION['current']->isSuperMaintainer($aClean['iAppId'])) { util_show_error_page_and_exit("Insufficient Privileges!"); } //set link for version if(is_numeric($aClean['iVersionId']) and !empty($aClean['iVersionId'])) { $sVersionLink = "iVersionId={$aClean['iVersionId']}"; } else exit; $oNote = new Note(); $oNote->GetOutputEditorValues($_REQUEST); if($aClean['sSub'] == "Submit") { $oNote->create(); util_redirect_and_exit(apidb_fullurl("appview.php?".$sVersionLink)); } else if($aClean['sSub'] == 'Preview' OR empty($aClean['sSubmit'])) { // show form apidb_header("Application Note"); if($aClean['sSub'] == 'Preview') $oNote->show(true); echo "