$scripts .= "load_icon: '" . $misc->icon('Loading') . "',\n"; $scripts .= "server:'{$_REQUEST['server']}',\n"; $scripts .= "dbname:'{$_REQUEST['database']}',\n"; $scripts .= "action:'refresh_{$action}',\n"; $scripts .= "errmsg: '" . str_replace("'", "\\'", $lang['strconnectionfail']) . "'\n"; $scripts .= "};\n"; $scripts .= "</script>\n"; } $misc->printHeader($lang['strdatabase'], $scripts); $misc->printBody(); switch ($action) { case 'find': if (isset($_REQUEST['term'])) { doFind(false); } else { doFind(true); } break; case 'sql': doSQL(); break; case 'variables': doVariables(); break; case 'processes': doProcesses(); break; case 'locks': doLocks(); break; case 'export':
echo "<body onload=\"window.focus();\">\n"; $misc->printTabs($misc->getNavTabs('popup'), 'sql'); echo "<form action=\"sql.php\" method=\"post\" target=\"detail\">\n"; _printConnection(); echo "\n"; if (!isset($_REQUEST['search_path'])) { $_REQUEST['search_path'] = implode(',', $data->getSearchPath()); } echo "<p><label>"; $misc->printHelp($lang['strsearchpath'], 'pg.schema.search_path'); echo ": <input type=\"text\" name=\"search_path\" size=\"50\" value=\"", htmlspecialchars($_REQUEST['search_path']), "\" /></label></p>\n"; echo "<textarea style=\"width:98%;\" rows=\"10\" cols=\"50\" name=\"query\">", htmlspecialchars($_SESSION['sqlquery']), "</textarea>\n"; echo "<p><label for=\"paginate\"><input type=\"checkbox\" id=\"paginate\" name=\"paginate\"", isset($_REQUEST['paginate']) ? ' checked="checked"' : '', " /> {$lang['strpaginate']}</label> <span style='color: red'>Make sure this option is switched off for UPDATE queries</span></p>\n"; echo "<p><input type=\"submit\" value=\"{$lang['strexecute']}\" />\n"; echo "<input type=\"reset\" value=\"{$lang['strreset']}\" /></p>\n"; echo "</form>\n"; // Default focus $misc->setFocus('forms[0].query'); } switch ($action) { case 'find': doFind(); break; case 'sql': default: doDefault(); break; } // Set the name of the window $misc->setWindowName('sqledit'); $misc->printFooter();