Пример #1
0
 /**
  * Saves query in history
  *
  * @return void
  */
 private function _setHistory()
 {
     if (!PMA_isValid($_REQUEST['no_history']) && empty($GLOBALS['error_message']) && !empty($GLOBALS['sql_query'])) {
         PMA_setHistory(PMA_ifSetOr($GLOBALS['db'], ''), PMA_ifSetOr($GLOBALS['table'], ''), $GLOBALS['cfg']['Server']['user'], $GLOBALS['sql_query']);
     }
 }
Пример #2
0
            setTimeout("dbBoxSetup();",2000);
        }
    }
    <?php 
    }
    ?>

    function reload_querywindow () {
        if (parent.frames.queryframe && parent.frames.queryframe.querywindow && !parent.frames.queryframe.querywindow.closed && parent.frames.queryframe.querywindow.location) {
            <?php 
    if (!isset($no_history) && (!isset($error_message) || $error_message == '')) {
        if (isset($LockFromUpdate) && $LockFromUpdate == '1' && isset($sql_query)) {
            // When the button 'LockFromUpdate' was selected in the querywindow, it does not submit it's contents to
            // itself. So we create a SQL-history entry here.
            if ($cfg['QueryHistoryDB'] && $cfgRelation['historywork']) {
                PMA_setHistory(isset($db) ? $db : '', isset($table) ? $table : '', $cfg['Server']['user'], $sql_query);
            }
        }
        ?>
            if (!parent.frames.queryframe.querywindow.document.sqlform.LockFromUpdate || !parent.frames.queryframe.querywindow.document.sqlform.LockFromUpdate.checked) {
                parent.frames.queryframe.querywindow.document.querywindow.db.value = "<?php 
        echo isset($db) ? addslashes($db) : '';
        ?>
";
                parent.frames.queryframe.querywindow.document.querywindow.query_history_latest_db.value = "<?php 
        echo isset($db) ? addslashes($db) : '';
        ?>
";
                parent.frames.queryframe.querywindow.document.querywindow.table.value = "<?php 
        echo isset($table) ? addslashes($table) : '';
        ?>
Пример #3
0
 * @uses    PMA_ifSetOr()
 * @uses    PMA_escapeJsString()
 * @uses    PMA_getenv()
 * @uses    PMA_generate_common_url()
 * @uses    basename()
 * @uses    file_exists()
 * @package phpMyAdmin
 */
if (!defined('PHPMYADMIN')) {
    exit;
}
/**
 * for PMA_setHistory()
 */
if (!PMA_isValid($_REQUEST['no_history']) && empty($GLOBALS['error_message']) && !empty($GLOBALS['sql_query'])) {
    PMA_setHistory(PMA_ifSetOr($GLOBALS['db'], ''), PMA_ifSetOr($GLOBALS['table'], ''), $GLOBALS['cfg']['Server']['user'], $GLOBALS['sql_query']);
}
if ($GLOBALS['error_handler']->hasDisplayErrors()) {
    echo '<div>';
    $GLOBALS['error_handler']->dispErrors();
    echo '</div>';
}
if (count($GLOBALS['footnotes'])) {
    echo '<div class="footnotes">';
    foreach ($GLOBALS['footnotes'] as $footnote) {
        echo '<span id="footnote_' . $footnote['nr'] . '"><sup>' . $footnote['nr'] . '</sup> ' . $footnote['note'] . '</span><br />';
    }
    echo '</div>';
}
if (!empty($_SESSION['debug'])) {
    $sum_time = 0;
Пример #4
0
    }
    $titles['Change'] = $iconic_spacer . '<img hspace="2" width="16" height="16" src="' . $pmaThemeImage . 'b_edit.png" alt="' . $strChange . '" title="' . $strChange . '" border="0" />';
    if ($propicon == 'both') {
        $titles['Change'] .= '&nbsp;' . $strChange . '&nbsp;</div>';
    }
} 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 type="hidden" name="query_history[]" value="' . $query_history_latest . '" />';
        $input_query_history[] = '<input type="hidden" name="query_history_db[]" value="' . htmlspecialchars($query_history_latest_db) . '" />';
        $input_query_history[] = '<input type="hidden" name="query_history_table[]" value="' . (isset($query_history_latest_table) ? htmlspecialchars($query_history_latest_table) : '') . '" />';
        $sql_history[] = '<li>' . '<a href="#" onclick="document.querywindow.querydisplay_tab.value = \'' . (isset($querydisplay_tab) && $querydisplay_tab != 'full' ? 'sql' : 'full') . '\'; document.querywindow.query_history_latest.value = \'' . preg_replace('/(\\n)/i', ' ', addslashes(htmlspecialchars($query_history_latest))) . '\'; document.querywindow.auto_commit.value = \'false\'; document.querywindow.db.value = \'' . htmlspecialchars($query_history_latest_db) . '\'; document.querywindow.query_history_latest_db.value = \'' . htmlspecialchars($query_history_latest_db) . '\'; document.querywindow.table.value = \'' . (isset($query_history_latest_table) ? htmlspecialchars($query_history_latest_table) : '') . '\'; document.querywindow.query_history_latest_table.value = \'' . (isset($query_history_latest_table) ? htmlspecialchars($query_history_latest_table) : '') . '\'; document.querywindow.submit(); return false;">' . $titles['Change'] . '</a>' . '&nbsp;<a href="#" onclick="document.querywindow.querydisplay_tab.value = \'' . (isset($querydisplay_tab) && $querydisplay_tab != 'full' ? 'sql' : 'full') . '\'; document.querywindow.query_history_latest.value = \'' . preg_replace('/(\\n)/i', ' ', addslashes(htmlspecialchars($query_history_latest))) . '\'; document.querywindow.auto_commit.value = \'true\'; document.querywindow.db.value = \'' . htmlspecialchars($query_history_latest_db) . '\'; document.querywindow.query_history_latest_db.value = \'' . htmlspecialchars($query_history_latest_db) . '\'; document.querywindow.table.value = \'' . (isset($query_history_latest_table) ? htmlspecialchars($query_history_latest_table) : '') . '\'; document.querywindow.query_history_latest_table.value = \'' . (isset($query_history_latest_table) ? htmlspecialchars($query_history_latest_table) : '') . '\'; document.querywindow.submit(); return false;">[' . htmlspecialchars($query_history_latest_db) . '] ' . urldecode($query_history_latest) . '</a>' . '</li>' . "\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;
    }
Пример #5
0
// refresh navigation frame content
if (window.parent.refreshNavigation) {
    window.parent.refreshNavigation();
}
<?php 
}
?>

<?php 
if (!isset($GLOBALS['no_history']) && empty($GLOBALS['error_message'])) {
    if (isset($GLOBALS['LockFromUpdate']) && $GLOBALS['LockFromUpdate'] == '1' && isset($GLOBALS['sql_query'])) {
        // When the button 'LockFromUpdate' was selected in the querywindow,
        // it does not submit it's contents to
        // itself. So we create a SQL-history entry here.
        if ($GLOBALS['cfg']['QueryHistoryDB'] && $GLOBALS['cfgRelation']['historywork']) {
            PMA_setHistory(isset($GLOBALS['db']) ? $GLOBALS['db'] : '', isset($GLOBALS['table']) ? $GLOBALS['table'] : '', $GLOBALS['cfg']['Server']['user'], $GLOBALS['sql_query']);
        }
    }
    ?>
// set current db, table and sql query in the querywindow
if (window.parent.refreshNavigation) {
    window.parent.reload_querywindow(
        '<?php 
    echo isset($GLOBALS['db']) ? PMA_escapeJsString($GLOBALS['db']) : '';
    ?>
',
        '<?php 
    echo isset($GLOBALS['table']) ? PMA_escapeJsString($GLOBALS['table']) : '';
    ?>
',
        '<?php