* * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. */ define('HORDE_BASE', dirname(__FILE__) . '/..'); require_once HORDE_BASE . '/lib/base.php'; require_once HORDE_LIBS . 'Horde/Menu.php'; require_once HORDE_LIBS . 'Horde/Help.php'; require_once 'DB.php'; if (!Auth::isAdmin()) { Horde::fatal('Forbidden.', __FILE__, __LINE__); } $title = _("SQL Shell"); require HORDE_TEMPLATES . '/common-header.inc'; require HORDE_TEMPLATES . '/admin/common-header.inc'; ?>
20) { array_pop($_SESSION['_sql_query_cache']); } echo '
' . _("SQL Query") . ':

'; echo '
' . htmlspecialchars($command) . '
'; echo '
' . _("Results") . ':

'; echo '
'; // Parse out the query results. $dbh = &DB::connect($conf['sql']); if (is_a($dbh, 'PEAR_Error')) { echo '
'; var_dump($dbh); echo '
'; } else { $result = $dbh->query(String::convertCharset($command, NLS::getCharset(), $conf['sql']['charset'])); if (is_a($result, 'PEAR_Error')) { echo '
'; var_dump($result); echo '
'; } else { if (is_object($result)) { echo ''; $first = true; $i = 0; while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) { if ($first) { echo ''; foreach ($row as $key => $val) { echo ''; } echo ''; $first = false; } echo ''; foreach ($row as $val) { echo ''; } echo ''; $i++; } echo '
' . (empty($key) ? ' ' : htmlspecialchars(String::convertCharset($key, $conf['sql']['charset']))) . '
' . (empty($val) ? ' ' : htmlspecialchars(String::convertCharset($val, $conf['sql']['charset']))) . '
'; } else { echo '' . _("Success") . ''; } } } echo '

'; } ?> " class="button" onclick="document.sqlshell.sql.value = document.sqlshell.query_cache[document.sqlshell.query_cache.selectedIndex].value;" /> " class="button" onclick="document.sqlshell.sql.value = document.sqlshell.query_cache[document.sqlshell.query_cache.selectedIndex].value; document.sqlshell.submit();" />

"> hasFeature('javascript')): ?>