0) {
PMA_availableDatabases(); // this function is defined in "common.lib.php"
} else {
$num_dbs = 0;
}
// garvin: For re-usability, moved http-headers and stylesheets
// to a seperate file. It can now be included by header.inc.php,
// queryframe.php, querywindow.php.
require_once('./libraries/header_http.inc.php');
require_once('./libraries/header_meta_style.inc.php');
?>
';
}
echo "\n";
echo PMA_printTab($strSQL, '#', '', 'onClick="javascript:query_tab_commit(\'sql\');return false;"', '', (isset($querydisplay_tab) && $querydisplay_tab == 'sql' ? TRUE : FALSE));
echo PMA_printTab($strImportFiles, '#', '', 'onClick="javascript:query_tab_commit(\'files\');return false;"', '', (isset($querydisplay_tab) && $querydisplay_tab == 'files' ? TRUE : FALSE));
echo PMA_printTab($strQuerySQLHistory, '#', '', 'onClick="javascript:query_tab_commit(\'history\');return false;"', '', (isset($querydisplay_tab) && $querydisplay_tab == 'history' ? TRUE : FALSE));
if ($cfg['QueryWindowDefTab'] == 'full') {
echo PMA_printTab($strAll, '#', '', 'onClick="javascript:query_tab_commit(\'full\');return false;"', '', (isset($querydisplay_tab) && $querydisplay_tab == 'full' ? TRUE : FALSE));
}
if (!$cfg['LightTabs']) {
echo ' ';
} else {
echo ' ';
}
} else {
$querydisplay_tab = 'full';
}
?>
';
} else {
$iconic_spacer = '';
}
$titles['Change'] = $iconic_spacer . ' ';
if ($propicon == 'both') {
$titles['Change'] .= ' ' . $strChange . ' ';
}
} else {
$titles['Change'] = $strChange;
}
// Hidden forms and query frame interaction stuff
if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
$input_query_history = array();
$sql_history = array();
$dup_sql = array();
if (isset($query_history_latest) && isset($query_history_latest_db) && $query_history_latest != '' && $query_history_latest_db != '') {
if ($cfg['QueryHistoryDB'] && $cfgRelation['historywork']) {
PMA_setHistory((isset($query_history_latest_db) ? $query_history_latest_db : ''), (isset($query_history_latest_table) ? $query_history_latest_table : ''), $cfg['Server']['user'], $query_history_latest);
}
$input_query_history[] = ' ';
$input_query_history[] = ' ';
$input_query_history[] = ' ';
$sql_history[] = ''
. '' . $titles['Change'] . ' '
. '[' . htmlspecialchars($query_history_latest_db) . '] ' . urldecode($query_history_latest) . ' '
. ' ' . "\n";
$sql_query = urldecode($query_history_latest);
$db = $query_history_latest_db;
$table = $query_history_latest_table;
$dup_sql[$query_history_latest] = true;
} elseif (isset($query_history_latest) && $query_history_latest != '') {
$sql_query = urldecode($query_history_latest);
}
if (isset($sql_query)) {
$show_query = 1;
}
if ($cfg['QueryHistoryDB'] && $cfgRelation['historywork']) {
$temp_history = PMA_getHistory($cfg['Server']['user']);
if (is_array($temp_history) && count($temp_history) > 0) {
foreach($temp_history AS $history_nr => $history_array) {
if (!isset($dup_sql[$history_array['sqlquery']])) {
$sql_history[] = ''
. '' . $titles['Change'] . ' '
. '[' . htmlspecialchars($history_array['db']) . '] ' . urldecode($history_array['sqlquery']) . ' '
. ' ' . "\n";
$dup_sql[$history_array['sqlquery']] = true;
}
}
}
} else {
if (isset($query_history) && is_array($query_history)) {
$current_index = count($query_history);
foreach($query_history AS $query_no => $query_sql) {
if (!isset($dup_sql[$query_sql])) {
$input_query_history[] = ' ';
$input_query_history[] = ' ';
$input_query_history[] = ' ';
$sql_history[] = ''
. '' . $titles['Change'] . ' '
. '[' . htmlspecialchars($query_history_db[$query_no]) . '] ' . urldecode($query_sql) . ' '
. ' ' . "\n";
$dup_sql[$query_sql] = true;
} // end if check if this item exists
} // end while print history
} // end if history exists
} // end if DB-based history
}
$url_query = PMA_generate_common_url(isset($db) ? $db : '', isset($table) ? $table : '');
if (!isset($goto)) {
$goto = '';
}
require_once './libraries/bookmark.lib.php';
$is_inside_querywindow = TRUE;
require './tbl_query_box.php';
// Hidden forms and query frame interaction stuff
if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
if (isset($auto_commit) && $auto_commit == 'true') {
?>
0) {
?>
' . implode('', $sql_history) . ' '; ?>