addScriptFiles(['makegrid.js', 'vendor/jquery/jquery.uitablefilter.js', 'sql.js']); $pageSettings = new PageSettings('Sql'); $this->response->addHTML($pageSettings->getErrorHTML()); $this->response->addHTML($pageSettings->getHTML()); $this->checkParameters(['db', 'table']); $urlParams = ['db' => $GLOBALS['db'], 'table' => $GLOBALS['table']]; $GLOBALS['errorUrl'] = Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabTable'], 'table'); $GLOBALS['errorUrl'] .= Url::getCommon($urlParams, '&'); DbTableExists::check($GLOBALS['db'], $GLOBALS['table']); /** * After a syntax error, we return to this script * with the typed query in the textarea. */ $GLOBALS['goto'] = Url::getFromRoute('/table/sql'); $GLOBALS['back'] = Url::getFromRoute('/table/sql'); $this->response->addHTML($this->sqlQueryForm->getHtml( $GLOBALS['db'], $GLOBALS['table'], $_GET['sql_query'] ?? true, false, isset($_POST['delimiter']) ? htmlspecialchars($_POST['delimiter']) : ';', )); } }