/**
 * void PMA_TableHeader([bool $db_is_information_schema = false])
 * display table header (<table><thead>...</thead><tbody>)
 *
 * @uses    PMA_showHint()
 * @uses    $GLOBALS['cfg']['PropertiesNumColumns']
 * @uses    $GLOBALS['is_show_stats']
 * @uses    $GLOBALS['strTable']
 * @uses    $GLOBALS['strAction']
 * @uses    $GLOBALS['strRecords']
 * @uses    $GLOBALS['strApproximateCount']
 * @uses    $GLOBALS['strType']
 * @uses    $GLOBALS['strCollation']
 * @uses    $GLOBALS['strSize']
 * @uses    $GLOBALS['strOverhead']
 * @uses    $GLOBALS['structure_tbl_col_cnt']
 * @uses    PMA_SortableTableHeader()
 * @param   boolean $db_is_information_schema
 * @param   boolean $replication
 */
function PMA_TableHeader($db_is_information_schema = false, $replication = false)
{
    $cnt = 0;
    // Let's count the columns...
    if ($db_is_information_schema) {
        $action_colspan = 3;
    } else {
        $action_colspan = 6;
    }
    echo '<table class="data" style="float: left;">' . "\n" . '<thead>' . "\n" . '<tr><th></th>' . "\n" . '    <th>' . PMA_SortableTableHeader($GLOBALS['strTable'], 'table') . '</th>' . "\n";
    if ($replication) {
        echo '    <th>' . "\n" . '        ' . $GLOBALS['strReplication'] . "\n" . '    </th>';
    }
    echo '    <th colspan="' . $action_colspan . '">' . "\n" . '        ' . $GLOBALS['strAction'] . "\n" . '    </th>' . '    <th>' . PMA_SortableTableHeader($GLOBALS['strRecords'], 'records', 'DESC') . PMA_showHint(PMA_sanitize($GLOBALS['strApproximateCount'])) . "\n" . '    </th>' . "\n";
    if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
        echo '    <th>' . PMA_SortableTableHeader($GLOBALS['strType'], 'type') . '</th>' . "\n";
        $cnt++;
        echo '    <th>' . PMA_SortableTableHeader($GLOBALS['strCollation'], 'collation') . '</th>' . "\n";
        $cnt++;
    }
    if ($GLOBALS['is_show_stats']) {
        // larger values are more interesting so default sort order is DESC
        echo '    <th>' . PMA_SortableTableHeader($GLOBALS['strSize'], 'size', 'DESC') . '</th>' . "\n" . '    <th>' . PMA_SortableTableHeader($GLOBALS['strOverhead'], 'overhead', 'DESC') . '</th>' . "\n";
        $cnt += 2;
    }
    echo '</tr>' . "\n";
    echo '</thead>' . "\n";
    echo '<tbody>' . "\n";
    $GLOBALS['structure_tbl_col_cnt'] = $cnt + $action_colspan + 3;
}
Beispiel #2
0
function PMA_generateEngineDetails($variables, $like = NULL, $indent = 0)
{
    global $cfg;
    $spaces = '';
    for ($i = 0; $i < $indent; $i++) {
        $spaces .= '    ';
    }
    /**
     * Get the variables!
     */
    if (!empty($variables)) {
        $sql_query = 'SHOW ' . (PMA_MYSQL_INT_VERSION >= 40102 ? 'GLOBAL ' : '') . 'VARIABLES' . (empty($like) ? '' : ' LIKE \'' . $like . '\'') . ';';
        $res = PMA_DBI_query($sql_query);
        $mysql_vars = array();
        while ($row = PMA_DBI_fetch_row($res)) {
            if (isset($variables[$row[0]])) {
                $mysql_vars[$row[0]] = $row[1];
            }
        }
        PMA_DBI_free_result($res);
        unset($res, $row, $sql_query);
    }
    if (empty($mysql_vars)) {
        return $spaces . '<p>' . "\n" . $spaces . '    ' . $GLOBALS['strNoDetailsForEngine'] . "\n" . $spaces . '</p>' . "\n";
    }
    $dt_table = $spaces . '<table>' . "\n";
    $useBgcolorOne = TRUE;
    $has_content = FALSE;
    foreach ($variables as $var => $details) {
        if (!isset($mysql_vars[$var])) {
            continue;
        }
        if (!isset($details['type'])) {
            $details['type'] = PMA_ENGINE_DETAILS_TYPE_PLAINTEXT;
        }
        $is_num = $details['type'] == PMA_ENGINE_DETAILS_TYPE_SIZE || $details['type'] == PMA_ENGINE_DETAILS_TYPE_NUMERIC;
        $bgcolor = $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo'];
        $dt_table .= $spaces . '    <tr>' . "\n" . $spaces . '        <td bgcolor="' . $bgcolor . '">' . "\n";
        if (!empty($variables[$var]['desc'])) {
            $dt_table .= $spaces . '            ' . PMA_showHint($details['desc']) . "\n";
        }
        $dt_table .= $spaces . '        </td>' . "\n" . $spaces . '        <td bgcolor="' . $bgcolor . '">' . "\n" . $spaces . '            &nbsp;' . $details['title'] . '&nbsp;' . "\n" . $spaces . '        </td>' . "\n" . $spaces . '        <td bgcolor="' . $bgcolor . '"' . ($is_num ? ' align="right"' : '') . '>' . "\n" . $spaces . '            &nbsp;';
        switch ($details['type']) {
            case PMA_ENGINE_DETAILS_TYPE_SIZE:
                $parsed_size = PMA_formatByteDown($mysql_vars[$var]);
                $dt_table .= $parsed_size[0] . '&nbsp;' . $parsed_size[1];
                unset($parsed_size);
                break;
            default:
                $dt_table .= htmlspecialchars($mysql_vars[$var]);
        }
        $dt_table .= '&nbsp;' . "\n" . $spaces . '        </td>' . "\n" . $spaces . '    </tr>' . "\n";
        $useBgcolorOne = !$useBgcolorOne;
        $has_content = TRUE;
    }
    if (!$has_content) {
        return '';
    }
    return $dt_table;
}
/**
 * void PMA_TableHeader([bool $db_is_information_schema = false])
 * display table header (<table><thead>...</thead><tbody>)
 *
 * @uses    PMA_showHint()
 * @uses    PMA_MYSQL_INT_VERSION
 * @uses    $GLOBALS['cfg']['PropertiesNumColumns']
 * @uses    $GLOBALS['is_show_stats']
 * @uses    $GLOBALS['strTable']
 * @uses    $GLOBALS['strAction']
 * @uses    $GLOBALS['strRecords']
 * @uses    $GLOBALS['strApproximateCount']
 * @uses    $GLOBALS['strType']
 * @uses    $GLOBALS['strCollation']
 * @uses    $GLOBALS['strSize']
 * @uses    $GLOBALS['strOverhead']
 * @uses    $GLOBALS['structure_tbl_col_cnt']
 * @param   boolean $db_is_information_schema
 */
function PMA_TableHeader($db_is_information_schema = false)
{
    $cnt = 0;
    // Let's count the columns...
    if ($db_is_information_schema) {
        $action_colspan = 3;
    } else {
        $action_colspan = 6;
    }
    echo '<table class="data" style="float: left;">' . "\n" . '<thead>' . "\n" . '<tr><td></td>' . "\n" . '    <th>' . $GLOBALS['strTable'] . '</th>' . "\n" . '    <th colspan="' . $action_colspan . '">' . "\n" . '        ' . $GLOBALS['strAction'] . "\n" . '    </th>' . '    <th>' . $GLOBALS['strRecords'] . PMA_showHint($GLOBALS['strApproximateCount']) . "\n" . '    </th>' . "\n";
    if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
        echo '    <th>' . $GLOBALS['strType'] . '</th>' . "\n";
        $cnt++;
        if (PMA_MYSQL_INT_VERSION >= 40100) {
            echo '    <th>' . $GLOBALS['strCollation'] . '</th>' . "\n";
            $cnt++;
        }
    }
    if ($GLOBALS['is_show_stats']) {
        echo '    <th>' . $GLOBALS['strSize'] . '</th>' . "\n" . '    <th>' . $GLOBALS['strOverhead'] . '</th>' . "\n";
        $cnt += 2;
    }
    echo '</tr>' . "\n";
    echo '</thead>' . "\n";
    echo '<tbody>' . "\n";
    $GLOBALS['structure_tbl_col_cnt'] = $cnt + $action_colspan + 3;
}
/**
 * void PMA_TableHeader([bool $db_is_information_schema = false])
 * display table header (<table><thead>...</thead><tbody>)
 *
 * @uses    PMA_showHint()
 * @uses    $GLOBALS['cfg']['PropertiesNumColumns']
 * @uses    $GLOBALS['is_show_stats']
 * @uses    $GLOBALS['colspan_for_structure']
 * @uses    PMA_SortableTableHeader()
 * @param   boolean $db_is_information_schema
 * @param   boolean $replication
 */
function PMA_TableHeader($db_is_information_schema = false, $replication = false)
{
    $cnt = 0;
    // Let's count the columns...
    if ($db_is_information_schema) {
        $action_colspan = 3;
    } else {
        $action_colspan = 6;
    }
    echo '<table class="data">' . "\n" . '<thead>' . "\n" . '<tr><th></th>' . "\n" . '    <th>' . PMA_SortableTableHeader(__('Table'), 'table') . '</th>' . "\n";
    if ($replication) {
        echo '    <th>' . "\n" . '        ' . __('Replication') . "\n" . '    </th>';
    }
    echo '    <th colspan="' . $action_colspan . '">' . "\n" . '        ' . __('Action') . "\n" . '    </th>' . '    <th>' . PMA_SortableTableHeader(__('Rows'), 'records', 'DESC') . PMA_showHint(PMA_sanitize(__('May be approximate. See [a@./Documentation.html#faq3_11@Documentation]FAQ 3.11[/a]'))) . "\n" . '    </th>' . "\n";
    if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
        echo '    <th>' . PMA_SortableTableHeader(__('Type'), 'type') . '</th>' . "\n";
        $cnt++;
        echo '    <th>' . PMA_SortableTableHeader(__('Collation'), 'collation') . '</th>' . "\n";
        $cnt++;
    }
    if ($GLOBALS['is_show_stats']) {
        // larger values are more interesting so default sort order is DESC
        echo '    <th>' . PMA_SortableTableHeader(__('Size'), 'size', 'DESC') . '</th>' . "\n" . '    <th>' . PMA_SortableTableHeader(__('Overhead'), 'overhead', 'DESC') . '</th>' . "\n";
        $cnt += 2;
    }
    echo '</tr>' . "\n";
    echo '</thead>' . "\n";
    echo '<tbody>' . "\n";
    $GLOBALS['colspan_for_structure'] = $cnt + $action_colspan + 3;
}
function pma_TableHeader($alternate = FALSE, $record_count = TRUE)
{
    $cnt = 0;
    // Let's count the columns...
    echo '            <table border="' . $GLOBALS['cfg']['Border'] . '" cellpadding="2" cellspacing="1">' . "\n" . '            <tr>' . "\n" . '                <td></td>' . "\n" . '                <th>' . "\n" . '                    &nbsp;' . $GLOBALS['strTable'] . '&nbsp;' . "\n" . '                </th>' . "\n" . '                <th colspan="6">' . "\n" . '                    &nbsp;' . $GLOBALS['strAction'] . '&nbsp;' . "\n" . '                </th>' . "\n";
    $cnt += 3;
    if ($record_count) {
        echo '                <th>' . "\n" . '                    &nbsp;' . $GLOBALS['strRecords'] . PMA_showHint($GLOBALS['strApproximateCount']) . '&nbsp;' . "\n" . '                </th>' . "\n";
        $cnt++;
    }
    if (!$alternate) {
        if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
            echo '                <th>' . "\n" . '                    &nbsp;' . $GLOBALS['strType'] . '&nbsp;' . "\n" . '                </th>' . "\n";
            $cnt++;
            if (PMA_MYSQL_INT_VERSION >= 40100) {
                echo '                <th>' . "\n" . '                    &nbsp;' . $GLOBALS['strCollation'] . '&nbsp;' . "\n" . '                </th>' . "\n";
                $cnt++;
            }
        }
        if ($GLOBALS['cfg']['ShowStats']) {
            echo '                <th>' . "\n" . '                    &nbsp;' . $GLOBALS['strSize'] . '&nbsp;' . "\n" . '                </th>' . "\n" . '                <th>' . "\n" . '                    &nbsp;' . $GLOBALS['strOverhead'] . '&nbsp;' . "\n" . '                </th>' . "\n";
            $cnt += 2;
        }
        echo "\n";
    }
    echo '            </tr>' . "\n";
    $GLOBALS['structure_tbl_col_cnt'] = $cnt;
}
Beispiel #6
0
/**
 * Function for displaying the table of an engine's parameters
 *
 * @param   array   List of MySQL variables and corresponding localized descriptions.
 *                  The array elements should have the following format:
 *                      $variable => array('title' => $title, 'desc' => $description);
 * @param   string  Prefix for the SHOW VARIABLES query.
 * @return  string  The table that was generated based on the given information.
 */
function PMA_generateEngineDetails($variables, $like = null)
{
    /**
     * Get the variables!
     */
    if (!empty($variables)) {
        $sql_query = 'SHOW ' . (PMA_MYSQL_INT_VERSION >= 40102 ? 'GLOBAL ' : '') . 'VARIABLES' . (empty($like) ? '' : ' LIKE \'' . $like . '\'') . ';';
        $res = PMA_DBI_query($sql_query);
        $mysql_vars = array();
        while ($row = PMA_DBI_fetch_row($res)) {
            if (isset($variables[$row[0]])) {
                $mysql_vars[$row[0]] = $row[1];
            }
        }
        PMA_DBI_free_result($res);
        unset($res, $row, $sql_query);
    }
    if (empty($mysql_vars)) {
        return '<p>' . "\n" . '    ' . $GLOBALS['strNoDetailsForEngine'] . "\n" . '</p>' . "\n";
    }
    $dt_table = '<table class="data" cellspacing="1">' . "\n";
    $odd_row = false;
    $has_content = false;
    foreach ($variables as $var => $details) {
        if (!isset($mysql_vars[$var])) {
            continue;
        }
        if (!isset($details['type'])) {
            $details['type'] = PMA_ENGINE_DETAILS_TYPE_PLAINTEXT;
        }
        $is_num = $details['type'] == PMA_ENGINE_DETAILS_TYPE_SIZE || $details['type'] == PMA_ENGINE_DETAILS_TYPE_NUMERIC;
        $dt_table .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">' . "\n" . '    <td>' . "\n";
        if (!empty($variables[$var]['desc'])) {
            $dt_table .= '        ' . PMA_showHint($details['desc']) . "\n";
        }
        $dt_table .= '    </td>' . "\n" . '    <th>' . htmlspecialchars(empty($details['title']) ? $var : $details['title']) . "\n" . '    </th>' . "\n" . '    <td class="value">';
        switch ($details['type']) {
            case PMA_ENGINE_DETAILS_TYPE_SIZE:
                $parsed_size = PMA_formatByteDown($mysql_vars[$var]);
                $dt_table .= $parsed_size[0] . '&nbsp;' . $parsed_size[1];
                unset($parsed_size);
                break;
            case PMA_ENGINE_DETAILS_TYPE_NUMERIC:
                $dt_table .= PMA_formatNumber($mysql_vars[$var]) . ' ';
                break;
            default:
                $dt_table .= htmlspecialchars($mysql_vars[$var]) . '   ';
        }
        $dt_table .= '</td>' . "\n" . '</tr>' . "\n";
        $odd_row = !$odd_row;
        $has_content = true;
    }
    if (!$has_content) {
        return '';
    }
    $dt_table .= '</table>' . "\n";
    return $dt_table;
}
function pma_TableHeader($alternate = FALSE)
{
    echo '            <table border="' . $GLOBALS['cfg']['Border'] . '" cellpadding="2" cellspacing="1">' . "\n" . '            <tr>' . "\n" . '                <td></td>' . "\n" . '                <th>' . "\n" . '                    &nbsp;' . $GLOBALS['strTable'] . '&nbsp;' . "\n" . '                </th>' . "\n" . '                <th colspan="6">' . "\n" . '                    &nbsp;' . $GLOBALS['strAction'] . '&nbsp;' . "\n" . '                </th>' . "\n" . '                <th>' . "\n" . '                    &nbsp;' . $GLOBALS['strRecords'] . PMA_showHint($GLOBALS['strApproximateCount']) . '&nbsp;' . "\n" . '                </th>' . "\n";
    if (!$alternate) {
        if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
            echo '                <th>' . "\n" . '                    &nbsp;' . $GLOBALS['strType'] . '&nbsp;' . "\n" . '                </th>' . "\n";
            if (PMA_MYSQL_INT_VERSION >= 40100) {
                echo '                <th>' . "\n" . '                    &nbsp;' . $GLOBALS['strCollation'] . '&nbsp;' . "\n" . '                </th>' . "\n";
            }
        }
        if ($GLOBALS['cfg']['ShowStats']) {
            echo '                <th>' . "\n" . '                    &nbsp;' . $GLOBALS['strSize'] . '&nbsp;' . "\n" . '                </th>' . "\n" . '                <th>' . "\n" . '                    &nbsp;' . $GLOBALS['strOverhead'] . '&nbsp;' . "\n" . '                </th>' . "\n";
        }
        echo "\n";
    }
    echo '            </tr>' . "\n";
}
     * Displays the forms
     */
    $databases = PMA_DBI_get_databases_full(null, false, null, 'SCHEMA_NAME', 'ASC', 0, true);
    $databases_to_hide = array('information_schema', 'mysql');
    if ($GLOBALS['cfg']['AllowArbitraryServer'] === false) {
        $possibly_readonly = ' readonly="readonly"';
    } else {
        $possibly_readonly = '';
    }
    foreach ($cons as $type) {
        if ('src' == $type) {
            $database_header = __('Source database');
        } else {
            $database_header = __('Target database');
        }
        $database_header .= PMA_showHint(PMA_sanitize(sprintf('%sAllowArbitraryServer%s', '[a@./Documentation.html#AllowArbitraryServer@_blank]', '[/a]')));
        ?>
      <table id="serverconnection_<?php 
        echo $type;
        ?>
_remote" class="data">
      <caption class="tblHeaders"><?php 
        echo $database_header;
        ?>
</caption>
      <tr class="odd">
	  <td colspan="2" style="text-align: center">
	     <select name="<?php 
        echo $type;
        ?>
_type" id="<?php 
Beispiel #9
0
        ?>
</a></td>
    <?php 
    }
    // end if (! $db_is_information_schema)
    // there is a null value in the ENGINE
    // - when the table needs to be repaired, or
    // - when it's a view
    //  so ensure that we'll display "in use" below for a table
    //  that needs to be repaired
    if (isset($each_table['TABLE_ROWS']) && ($each_table['ENGINE'] != null || $table_is_view)) {
        if ($table_is_view) {
            if ($each_table['TABLE_ROWS'] >= $GLOBALS['cfg']['MaxExactCountViews']) {
                $row_count_pre = '~';
                $sum_row_count_pre = '~';
                $show_superscript = PMA_showHint(PMA_sanitize(sprintf(__('This view has at least this number of rows. Please refer to %sdocumentation%s.'), '[a@./Documentation.html#cfg_MaxExactCountViews@_blank]', '[/a]')));
            }
        } elseif ($each_table['ENGINE'] == 'InnoDB' && !$each_table['COUNTED']) {
            // InnoDB table: we did not get an accurate row count
            $row_count_pre = '~';
            $sum_row_count_pre = '~';
            $show_superscript = '';
        } else {
            $row_count_pre = '';
            $show_superscript = '';
        }
        ?>
    <td class="value tbl_rows"><?php 
        echo $row_count_pre . PMA_formatNumber($each_table['TABLE_ROWS'], 0) . $show_superscript;
        ?>
</td>
Beispiel #10
0
    </tr>
    <?php 
}
?>

    <tr><td><label for="continuous"><?php 
echo __("Continuous image");
?>
</label></td>
        <td>
            <input type="checkbox" name="chartSettings[continuous]" id="continuous" <?php 
echo $chartSettings['continuous'] == 'on' ? 'checked="checked"' : '';
?>
>
        <?php 
echo PMA_showHint(PMA_sanitize(__('For compatibility reasons the chart image is segmented by default, select this to draw the whole chart in one image.')));
?>
        </td>
    </tr>

    <tr><td><label for="fontSize"><?php 
echo __("Font size");
?>
</label></td>
        <td><input type="text" name="chartSettings[fontSize]" id="fontSize" value="<?php 
echo isset($chartSettings['fontSize']) ? htmlspecialchars($chartSettings['fontSize']) : '';
?>
" /></td>
    </tr>

    <?php 
     // no database name was give, display select db
     if (!empty($found_rows)) {
         $pred_db_array = array_diff(PMA_DBI_fetch_result('SHOW DATABASES;'), $found_rows);
     } else {
         $pred_db_array = PMA_DBI_fetch_result('SHOW DATABASES;');
     }
     echo '    <label for="text_dbname">' . $GLOBALS['strAddPrivilegesOnDb'] . ':</label>' . "\n";
     if (!empty($pred_db_array)) {
         echo '    <select name="pred_dbname" onchange="this.form.submit();">' . "\n" . '        <option value="" selected="selected">' . $GLOBALS['strUseTextField'] . ':</option>' . "\n";
         foreach ($pred_db_array as $current_db) {
             $current_db = PMA_escape_mysql_wildcards($current_db);
             echo '        <option value="' . htmlspecialchars($current_db) . '">' . htmlspecialchars($current_db) . '</option>' . "\n";
         }
         echo '    </select>' . "\n";
     }
     echo '    <input type="text" id="text_dbname" name="dbname" />' . "\n" . PMA_showHint($GLOBALS['strEscapeWildcards']);
 } else {
     echo '    <input type="hidden" name="dbname" value="' . htmlspecialchars($dbname) . '"/>' . "\n" . '    <label for="text_tablename">' . $GLOBALS['strAddPrivilegesOnTbl'] . ':</label>' . "\n";
     if ($res = @PMA_DBI_try_query('SHOW TABLES FROM ' . PMA_backquote($dbname) . ';', NULL, PMA_DBI_QUERY_STORE)) {
         $pred_tbl_array = array();
         while ($row = PMA_DBI_fetch_row($res)) {
             if (!isset($found_rows) || !in_array($row[0], $found_rows)) {
                 $pred_tbl_array[] = $row[0];
             }
         }
         PMA_DBI_free_result($res);
         unset($res, $row);
         if (!empty($pred_tbl_array)) {
             echo '    <select name="pred_tablename" onchange="this.form.submit();">' . "\n" . '        <option value="" selected="selected">' . $GLOBALS['strUseTextField'] . ':</option>' . "\n";
             foreach ($pred_tbl_array as $current_table) {
                 echo '        <option value="' . htmlspecialchars($current_table) . '">' . htmlspecialchars($current_table) . '</option>' . "\n";
}
$header_cells[] = '<abbr title="AUTO_INCREMENT">' . ($display_type == 'horizontal' ? 'A_I' : 'AUTO_INCREMENT') . '</abbr>';
require_once './libraries/transformations.lib.php';
$cfgRelation = PMA_getRelationsParam();
$comments_map = array();
$mime_map = array();
$available_mime = array();
$comments_map = PMA_getComments($db, $table);
$header_cells[] = __('Comments');
if ($cfgRelation['mimework'] && $cfg['BrowseMIME']) {
    $mime_map = PMA_getMIME($db, $table);
    $available_mime = PMA_getAvailableMIMEtypes();
    $hint = '<br />' . sprintf(__('For a list of available transformation options and their MIME type transformations, click on %stransformation descriptions%s'), '<a href="transformation_overview.php?' . PMA_generate_common_url($db, $table) . '" target="_blank">', '</a>');
    $header_cells[] = __('MIME type');
    $header_cells[] = __('Browser transformation');
    $header_cells[] = __('Transformation options') . PMA_showHint(__('Please enter the values for transformation options using this format: \'a\', 100, b,\'c\'...<br />If you ever need to put a backslash ("\\") or a single quote ("\'") amongst those values, precede it with a backslash (for example \'\\\\xyz\' or \'a\\\'b\').') . $hint);
}
//  workaround for field_fulltext, because its submitted indizes contain
//  the index as a value, not a key. Inserted here for easier maintaineance
//  and less code to change in existing files.
if (isset($field_fulltext) && is_array($field_fulltext)) {
    foreach ($field_fulltext as $fulltext_nr => $fulltext_indexkey) {
        $submit_fulltext[$fulltext_indexkey] = $fulltext_indexkey;
    }
}
for ($i = 0; $i < $num_fields; $i++) {
    if (!empty($regenerate)) {
        // An error happened with previous inputs, so we will restore the data
        // to embed it once again in this form.
        $row['Field'] = isset($_REQUEST['field_name'][$i]) ? $_REQUEST['field_name'][$i] : false;
        $row['Type'] = isset($_REQUEST['field_type'][$i]) ? $_REQUEST['field_type'][$i] : false;
    <fieldset>
    <legend><?php 
    echo __('Relations');
    ?>
</legend>

    <table>
    <tr><th><?php 
    echo __('Column');
    ?>
</th>
    <?php 
    if ($cfgRelation['relwork']) {
        echo '<th>' . __('Internal relation');
        if (PMA_foreignkey_supported($tbl_type)) {
            echo PMA_showHint(__('An internal relation is not necessary when a corresponding FOREIGN KEY relation exists.'));
        }
        echo '</th>';
    }
    if (PMA_foreignkey_supported($tbl_type)) {
        // this does not have to be translated, it's part of the MySQL syntax
        echo '<th colspan="2">' . __('Foreign key constraint') . ' (' . $tbl_type . ')';
        echo '</th>';
    }
    ?>
    </tr>
    <?php 
    $odd_row = true;
    for ($i = 0; $i < $saved_row_cnt; $i++) {
        $myfield = $save_row[$i]['Field'];
        // Use an md5 as array index to avoid having special characters in the name atttibure (see bug #1746964 )
        echo '<a href="' . PMA_getenv('PHP_SELF') . '?' . PMA_generate_common_url() . '#' . $section_name . '">' . $section['title'] . '</a>' . "\n";
    }
}
?>
</div>

<h3><?php 
echo $strServerTrafficNotes;
?>
</h3>

<table id="serverstatustraffic" class="data">
<thead>
<tr>
    <th colspan="2"><?php 
echo $strTraffic . '&nbsp;' . PMA_showHint($strStatisticsOverrun);
?>
</th>
    <th>&oslash; <?php 
echo $strPerHour;
?>
</th>
</tr>
</thead>
<tbody>
<tr class="odd">
    <th class="name"><?php 
echo $strReceived;
?>
</th>
    <td class="value"><?php 
Beispiel #15
0
/**
 * Displays a lightbulb hint explaining a known external bug
 * that affects a functionality
 *
 * @param string $functionality   localized message explaining the func.
 * @param string $component       'mysql' (eventually, 'php')
 * @param string $minimum_version of this component
 * @param string $bugref          bug reference for this component
 */
function PMA_externalBug($functionality, $component, $minimum_version, $bugref)
{
    if ($component == 'mysql' && PMA_MYSQL_INT_VERSION < $minimum_version) {
        echo PMA_showHint(sprintf(__('The %s functionality is affected by a known bug, see %s'), $functionality, PMA_linkURL('http://bugs.mysql.com/') . $bugref));
    }
}
Beispiel #16
0
/**
 * Displays a lightbulb hint explaining a known external bug
 * that affects a functionality
 *
 * @uses    PMA_MYSQL_INT_VERSION
 * @uses    $GLOBALS['strKnownExternalBug']
 * @uses    PMA_showHint()
 * @uses    sprintf()
 * @param   string  $functionality localized message explaining the func.
 * @param   string  $component  'mysql' (eventually, 'php')
 * @param   string  $minimum_version of this component
 * @param   string  $bugref  bug reference for this component
 */
function PMA_externalBug($functionality, $component, $minimum_version, $bugref)
{
    if ($component == 'mysql' && PMA_MYSQL_INT_VERSION < $minimum_version) {
        echo PMA_showHint(sprintf($GLOBALS['strKnownExternalBug'], $functionality, 'http://bugs.mysql.com/' . $bugref));
    }
}
        ?>
</a></td>
    <?php 
    }
    // end if (! $db_is_information_schema)
    // there is a null value in the ENGINE
    // - when the table needs to be repaired, or
    // - when it's a view
    //  so ensure that we'll display "in use" below for a table
    //  that needs to be repaired
    if (isset($each_table['TABLE_ROWS']) && ($each_table['ENGINE'] != null || $table_is_view)) {
        if ($table_is_view) {
            if ($each_table['TABLE_ROWS'] >= $GLOBALS['cfg']['MaxExactCountViews']) {
                $row_count_pre = '~';
                $sum_row_count_pre = '~';
                $show_superscript = PMA_showHint(PMA_sanitize(sprintf($strViewHasAtLeast, '[a@./Documentation.html#cfg_MaxExactCountViews@_blank]', '[/a]')));
            }
        } elseif ($each_table['ENGINE'] == 'InnoDB' && !$each_table['COUNTED']) {
            // InnoDB table: we did not get an accurate row count
            $row_count_pre = '~';
            $sum_row_count_pre = '~';
            $show_superscript = '';
        } else {
            $row_count_pre = '';
            $show_superscript = '';
        }
        ?>
    <td class="value"><?php 
        echo $row_count_pre . PMA_formatNumber($each_table['TABLE_ROWS'], 0) . $show_superscript;
        ?>
</td>
echo $GLOBALS['strSearchNeedle'];
?>
</td>
        <td><input type="text" name="search_str" size="60"
                value="<?php 
echo $searched;
?>
" /></td>
    </tr>
    <tr><td align="right" valign="top">
            <?php 
echo $GLOBALS['strSearchType'];
?>
</td>
            <td><?php 
$choices = array('1' => $GLOBALS['strSearchOption1'] . PMA_showHint($GLOBALS['strSplitWordsWithSpace']), '2' => $GLOBALS['strSearchOption2'] . PMA_showHint($GLOBALS['strSplitWordsWithSpace']), '3' => $GLOBALS['strSearchOption3'], '4' => $GLOBALS['strSearchOption4'] . ' ' . PMA_showMySQLDocu('Regexp', 'Regexp'));
// 4th parameter set to true to add line breaks
// 5th parameter set to false to avoid htmlspecialchars() escaping in the label
//  since we have some HTML in some labels
PMA_display_html_radio('search_option', $choices, $search_option, true, false);
unset($choices);
?>
            </td>
    </tr>
    <tr><td align="right" valign="top">
            <?php 
echo $GLOBALS['strSearchInTables'];
?>
</td>
        <td rowspan="2">
<?php 
Beispiel #19
0
function printMonitor()
{
    global $server_status, $server_db_isLocal;
    ?>
    <div class="tabLinks" style="display:none;">
        <a href="#pauseCharts">
            <?php 
    echo PMA_getImage('play.png');
    ?>
            <?php 
    echo __('Start Monitor');
    ?>
        </a>
        <a href="#settingsPopup" rel="popupLink" style="display:none;">
            <?php 
    echo PMA_getImage('s_cog.png');
    ?>
            <?php 
    echo __('Settings');
    ?>
        </a>
        <?php 
    if (!PMA_DRIZZLE) {
        ?>
        <a href="#monitorInstructionsDialog">
            <?php 
        echo PMA_getImage('b_help.png');
        ?>
            <?php 
        echo __('Instructions/Setup');
        ?>
        </a>
        <?php 
    }
    ?>
        <a href="#endChartEditMode" style="display:none;">
            <?php 
    echo PMA_getImage('s_okay.png');
    ?>
            <?php 
    echo __('Done rearranging/editing charts');
    ?>
        </a>
    </div>

    <div class="popupContent settingsPopup">
        <a href="#addNewChart">
            <?php 
    echo PMA_getImage('b_chart.png');
    ?>
            <?php 
    echo __('Add chart');
    ?>
        </a>
        <a href="#rearrangeCharts"><?php 
    echo PMA_getImage('b_tblops.png');
    echo __('Rearrange/edit charts');
    ?>
</a>
        <div class="clearfloat paddingtop"></div>
        <div class="floatleft">
            <?php 
    echo __('Refresh rate') . '<br />';
    refreshList('gridChartRefresh', 5, array(2, 3, 4, 5, 10, 20, 40, 60, 120, 300, 600, 1200));
    ?>
<br />
        </div>
        <div class="floatleft">
            <?php 
    echo __('Chart columns');
    ?>
 <br />
            <select name="chartColumns">
                <option>1</option>
                <option>2</option>
                <option>3</option>
                <option>4</option>
                <option>5</option>
                <option>6</option>
                <option>7</option>
                <option>8</option>
                <option>9</option>
                <option>10</option>
            </select>
        </div>

        <div class="clearfloat paddingtop">
        <b><?php 
    echo __('Chart arrangement');
    ?>
</b> <?php 
    echo PMA_showHint(__('The arrangement of the charts is stored to the browsers local storage. You may want to export it if you have a complicated set up.'));
    ?>
<br/>
        <a href="#importMonitorConfig"><?php 
    echo __('Import');
    ?>
</a>&nbsp;&nbsp;<a href="#exportMonitorConfig"><?php 
    echo __('Export');
    ?>
</a>&nbsp;&nbsp;<a href="#clearMonitorConfig"><?php 
    echo __('Reset to default');
    ?>
</a>
        </div>
    </div>

    <div id="monitorInstructionsDialog" title="<?php 
    echo __('Monitor Instructions');
    ?>
" style="display:none;">
        <?php 
    echo __('The phpMyAdmin Monitor can assist you in optimizing the server configuration and track down time intensive queries. For the latter you will need to set log_output to \'TABLE\' and have either the slow_query_log or general_log enabled. Note however, that the general_log produces a lot of data and increases server load by up to 15%');
    ?>
    <?php 
    if (PMA_MYSQL_INT_VERSION < 50106) {
        ?>
        <p>
        <?php 
        echo PMA_getImage('s_attention.png');
        ?>
        <?php 
        echo __('Unfortunately your Database server does not support logging to table, which is a requirement for analyzing the database logs with phpMyAdmin. Logging to table is supported by MySQL 5.1.6 and onwards. You may still use the server charting features however.');
        ?>
        </p>
    <?php 
    } else {
        ?>
        <p></p>
        <img class="ajaxIcon" src="<?php 
        echo $GLOBALS['pmaThemeImage'];
        ?>
ajax_clock_small.gif" alt="Loading" />
        <div class="ajaxContent"></div>
        <div class="monitorUse" style="display:none;">
            <p></p>
            <?php 
        echo '<strong>';
        echo __('Using the monitor:');
        echo '</strong><p>';
        echo __('Your browser will refresh all displayed charts in a regular interval. You may add charts and change the refresh rate under \'Settings\', or remove any chart using the cog icon on each respective chart.');
        echo '</p><p>';
        echo __('To display queries from the logs, select the relevant time span on any chart by holding down the left mouse button and panning over the chart. Once confirmed, this will load a table of grouped queries, there you may click on any occuring SELECT statements to further analyze them.');
        echo '</p>';
        ?>
            <p>
            <?php 
        echo PMA_getImage('s_attention.png');
        ?>
            <?php 
        echo '<strong>';
        echo __('Please note:');
        echo '</strong><br />';
        echo __('Enabling the general_log may increase the server load by 5-15%. Also be aware that generating statistics from the logs is a load intensive task, so it is advisable to select only a small time span and to disable the general_log and empty its table once monitoring is not required any more.');
        ?>
            </p>
        </div>
    <?php 
    }
    ?>
    </div>

    <div id="addChartDialog" title="<?php 
    echo __('Add chart');
    ?>
" style="display:none;">
        <div id="tabGridVariables">
            <p><input type="text" name="chartTitle" value="<?php 
    echo __('Chart Title');
    ?>
" /></p>

            <input type="radio" name="chartType" value="preset" id="chartPreset" />
            <label for="chartPreset"><?php 
    echo __('Preset chart');
    ?>
</label>
            <select name="presetCharts"></select><br/>

            <input type="radio" name="chartType" value="variable" id="chartStatusVar" checked="checked" />
            <label for="chartStatusVar"><?php 
    echo __('Status variable(s)');
    ?>
</label><br/>
            <div id="chartVariableSettings">
                <label for="chartSeries"><?php 
    echo __('Select series:');
    ?>
</label><br />
                <select id="chartSeries" name="varChartList" size="1">
                    <option><?php 
    echo __('Commonly monitored');
    ?>
</option>
                    <option>Processes</option>
                    <option>Questions</option>
                    <option>Connections</option>
                    <option>Bytes_sent</option>
                    <option>Bytes_received</option>
                    <option>Threads_connected</option>
                    <option>Created_tmp_disk_tables</option>
                    <option>Handler_read_first</option>
                    <option>Innodb_buffer_pool_wait_free</option>
                    <option>Key_reads</option>
                    <option>Open_tables</option>
                    <option>Select_full_join</option>
                    <option>Slow_queries</option>
                </select><br />
                <label for="variableInput"><?php 
    echo __('or type variable name:');
    ?>
 </label>
                <input type="text" name="variableInput" id="variableInput" />
                <p></p>
                <input type="checkbox" name="differentialValue" id="differentialValue" value="differential" checked="checked" />
                <label for="differentialValue"><?php 
    echo __('Display as differential value');
    ?>
</label><br />
                <input type="checkbox" id="useDivisor" name="useDivisor" value="1" />
                <label for="useDivisor"><?php 
    echo __('Apply a divisor');
    ?>
</label>
                <span class="divisorInput" style="display:none;">
                    <input type="text" name="valueDivisor" size="4" value="1" />
                    (<a href="#kibDivisor"><?php 
    echo __('KiB');
    ?>
</a>, <a href="#mibDivisor"><?php 
    echo __('MiB');
    ?>
</a>)
                </span><br />

                <input type="checkbox" id="useUnit" name="useUnit" value="1" />
                <label for="useUnit"><?php 
    echo __('Append unit to data values');
    ?>
</label>

                <span class="unitInput" style="display:none;">
                    <input type="text" name="valueUnit" size="4" value="" />
                </span>
                <p>
                    <a href="#submitAddSeries"><b><?php 
    echo __('Add this series');
    ?>
</b></a>
                    <span id="clearSeriesLink" style="display:none;">
                       | <a href="#submitClearSeries"><?php 
    echo __('Clear series');
    ?>
</a>
                    </span>
                </p>
                <?php 
    echo __('Series in Chart:');
    ?>
<br/>
                <span id="seriesPreview">
                <i><?php 
    echo __('None');
    ?>
</i>
                </span>
            </div>
        </div>
    </div>

    <!-- For generic use -->
    <div id="emptyDialog" title="Dialog" style="display:none;">
    </div>

    <?php 
    if (!PMA_DRIZZLE) {
        ?>
    <div id="logAnalyseDialog" title="<?php 
        echo __('Log statistics');
        ?>
" style="display:none;">
        <p> <?php 
        echo __('Selected time range:');
        ?>
        <input type="text" name="dateStart" class="datetimefield" value="" /> -
        <input type="text" name="dateEnd" class="datetimefield" value="" /></p>
        <input type="checkbox" id="limitTypes" value="1" checked="checked" />
        <label for="limitTypes">
            <?php 
        echo __('Only retrieve SELECT,INSERT,UPDATE and DELETE Statements');
        ?>
        </label>
        <br/>
        <input type="checkbox" id="removeVariables" value="1" checked="checked" />
        <label for="removeVariables">
            <?php 
        echo __('Remove variable data in INSERT statements for better grouping');
        ?>
        </label>

        <?php 
        echo '<p>';
        echo __('Choose from which log you want the statistics to be generated from.');
        echo '</p><p>';
        echo __('Results are grouped by query text.');
        echo '</p>';
        ?>
    </div>

    <div id="queryAnalyzerDialog" title="<?php 
        echo __('Query analyzer');
        ?>
" style="display:none;">
        <textarea id="sqlquery"> </textarea>
        <p></p>
        <div class="placeHolder"></div>
    </div>
    <?php 
    }
    ?>

    <table border="0" class="clearfloat" id="chartGrid">

    </table>
    <div id="logTable">
        <br/>
    </div>

    <script type="text/javascript">
        variableNames = [ <?php 
    $i = 0;
    foreach ($server_status as $name => $value) {
        if (is_numeric($value)) {
            if ($i++ > 0) {
                echo ", ";
            }
            echo "'" . $name . "'";
        }
    }
    ?>
 ];
    </script>
<?php 
}
                    PMA_DBI_free_result($res);
                    unset($res);
                    unset($row);
                    if (!empty($pred_tbl_array)) {
                        echo '                        <select name="pred_tablename" onchange="this.form.submit();">' . "\n" . '                            <option value="" selected="selected">' . $strUseTextField . ':</option>' . "\n";
                        foreach ($pred_tbl_array as $current_table) {
                            echo '                            <option value="' . htmlspecialchars($current_table) . '">' . htmlspecialchars($current_table) . '</option>' . "\n";
                        }
                        echo '                        </select>' . "\n";
                    }
                } else {
                    unset($res);
                }
                echo '                        <input type="text" id="text_tablename" name="tablename" class="textfield" />' . "\n";
            }
            echo '                        <input type="submit" value="' . $strGo . '" />' . PMA_showHint($strEscapeWildcards) . "\n" . '                    </form>' . "\n" . '                </td>' . "\n" . '            </tr>' . "\n" . '        </table><br />' . "\n" . '    </li>' . "\n";
        }
        if (empty($dbname)) {
            echo '    <li>' . "\n" . '        <form action="server_privileges.php" method="post" onsubmit="return checkPassword(this);">' . "\n" . PMA_generate_common_hidden_inputs('', '', 3) . '            <input type="hidden" name="username" value="' . htmlspecialchars($username) . '" />' . "\n" . '            <input type="hidden" name="hostname" value="' . htmlspecialchars($hostname) . '" />' . "\n";
            echo '            <b>' . $strChangePassword . '</b><br />' . "\n" . '            <table border="0" cellpadding="2" cellspacing="1">' . "\n" . '                <tr>' . "\n" . '                    <td bgcolor="' . $cfg['BgcolorOne'] . '"><input type="radio" name="nopass" value="1" id="radio_nopass_1" onclick="pma_pw.value=\'\'; pma_pw2.value=\'\';" /></td>' . "\n" . '                    <td bgcolor="' . $cfg['BgcolorOne'] . '" colspan="2"><label for="radio_nopass_1">' . $strNoPassword . '</label></td>' . "\n" . '                </tr>' . "\n" . '                <tr>' . "\n" . '                    <td bgcolor="' . $cfg['BgcolorTwo'] . '"><input type="radio" name="nopass" value="0" id="radio_nopass_0" onclick="document.getElementById(\'pw_pma_pw\').focus();" /></td>' . "\n" . '                    <td bgcolor="' . $cfg['BgcolorTwo'] . '"><label for="radio_nopass_0">' . $strPassword . ':</label></td>' . "\n" . '                    <td bgcolor="' . $cfg['BgcolorTwo'] . '"><input type="password" name="pma_pw" id="pw_pma_pw" class="textfield" onchange="nopass[1].checked = true;" /></td>' . "\n" . '                </tr>' . "\n" . '                <tr>' . "\n" . '                    <td bgcolor="' . $cfg['BgcolorTwo'] . '">&nbsp;</td>' . "\n" . '                    <td bgcolor="' . $cfg['BgcolorTwo'] . '"><label for="pw_pma_pw2">' . $strReType . ':</label></td>' . "\n" . '                    <td bgcolor="' . $cfg['BgcolorTwo'] . '"><input type="password" name="pma_pw2" id="pw_pma_pw2" class="textfield" onchange="nopass[1].checked = true;" /></td>' . "\n" . '                </tr>' . "\n" . '                <tr>' . "\n" . '                    <td colspan="3" align="right">' . "\n" . '                        <input type="submit" name="change_pw" value="' . $strGo . '" />' . "\n" . '                    </td>' . "\n" . '                </tr>' . "\n" . '            </table>' . "\n" . '        </form>' . "\n" . '    </li>' . "\n" . '    <li>' . "\n" . '        <form action="server_privileges.php" method="post" onsubmit="return checkPassword(this);">' . "\n" . PMA_generate_common_hidden_inputs('', '', 3) . '            <input type="hidden" name="old_username" value="' . htmlspecialchars($username) . '" />' . "\n" . '            <input type="hidden" name="old_hostname" value="' . htmlspecialchars($hostname) . '" />' . "\n" . '            <b>' . $strChangeCopyUser . '</b><br />' . "\n" . '            <table border="0" cellpadding="2" cellspacing="1">' . "\n";
            PMA_displayLoginInformationFields('change', 3);
            echo '            </table>' . "\n" . '            ' . $strChangeCopyMode . '<br />' . "\n" . '            <input type="radio" name="mode" value="4" id="radio_mode_4" checked="checked" /><label for="radio_mode_4">' . "\n" . '                ' . $strChangeCopyModeCopy . "\n" . '            </label>' . "\n" . '            <br />' . "\n" . '            <input type="radio" name="mode" value="1" id="radio_mode_1" /><label for="radio_mode_1">' . "\n" . '                ' . $strChangeCopyModeJustDelete . "\n" . '            </label>' . "\n" . '            <br />' . "\n" . '            <input type="radio" name="mode" value="2" id="radio_mode_2" /><label for="radio_mode_2">' . "\n" . '                ' . $strChangeCopyModeRevoke . "\n" . '            </label>' . "\n" . '            <br />' . "\n" . '            <input type="radio" name="mode" value="3" id="radio_mode_3" /><label for="radio_mode_3">' . "\n" . '                ' . $strChangeCopyModeDeleteAndReload . "\n" . '            </label>' . "\n" . '            <br />' . "\n" . '            <input type="submit" name="change_copy" value="' . $strGo . '" />' . "\n" . '        </form>' . "\n" . '    </li>' . "\n";
        }
        echo '</ul>' . "\n";
    }
} else {
    if (!empty($adduser)) {
        // Add a new user
        $url_query .= '&amp;adduser=1';
        echo '<h2>' . "\n" . ($cfg['PropertiesIconic'] ? '<img src="' . $pmaThemeImage . 'b_usradd.png" width="16" height="16" border="0" hspace="2" align="middle" />' : '') . '    ' . $strAddUser . "\n" . '</h2>' . "\n" . '<form name="usersForm" action="server_privileges.php" method="post" onsubmit="return checkAddUser(this);">' . "\n" . PMA_generate_common_hidden_inputs('', '', 1) . '    <table border="0" cellpadding="2" cellspacing="1">' . "\n" . '        <tr>' . "\n" . '            <th colspan="3">' . "\n" . '                ' . $strLoginInformation . "\n" . '            </th>' . "\n" . '        </tr>' . "\n";
        PMA_displayLoginInformationFields('new', 2);
/**
 * Displays a table of results returned by a SQL query.
 * This function is called by the "sql.php" script.
 *
 * @param   integer the link id associated to the query which results have
 *                  to be displayed
 * @param   array   the display mode
 * @param   array   the analyzed query
 *
 * @uses    $_SESSION['tmp_user_values']['pos']
 * @global  string   $db                the database name
 * @global  string   $table             the table name
 * @global  string   $goto              the URL to go back in case of errors
 * @global  string   $sql_query         the current SQL query
 * @global  integer  $num_rows          the total number of rows returned by the
 *                                      SQL query
 * @global  integer  $unlim_num_rows    the total number of rows returned by the
 *                                      SQL query without any programmatically
 *                                      appended "LIMIT" clause
 * @global  array    $fields_meta       the list of fields properties
 * @global  integer  $fields_cnt        the total number of fields returned by
 *                                      the SQL query
 * @global  array    $vertical_display  informations used with vertical display
 *                                      mode
 * @global  array    $highlight_columns column names to highlight
 * @global  array    $cfgRelation       the relation settings
 *
 * @access  private
 *
 * @see     PMA_showMessage(), PMA_setDisplayMode(),
 *          PMA_displayTableNavigation(), PMA_displayTableHeaders(),
 *          PMA_displayTableBody(), PMA_displayResultsOperations()
 */
function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
{
    global $db, $table, $goto;
    global $sql_query, $num_rows, $unlim_num_rows, $fields_meta, $fields_cnt;
    global $vertical_display, $highlight_columns;
    global $cfgRelation;
    global $showtable;
    // why was this called here? (already called from sql.php)
    //PMA_displayTable_checkConfigParams();
    /**
     * @todo move this to a central place
     * @todo for other future table types
     */
    $is_innodb = isset($showtable['Type']) && $showtable['Type'] == 'InnoDB';
    if ($is_innodb && !isset($analyzed_sql[0]['queryflags']['union']) && !isset($analyzed_sql[0]['table_ref'][1]['table_name']) && (empty($analyzed_sql[0]['where_clause']) || $analyzed_sql[0]['where_clause'] == '1 ')) {
        // "j u s t   b r o w s i n g"
        $pre_count = '~';
        $after_count = PMA_showHint(PMA_sanitize($GLOBALS['strApproximateCount']), true);
    } else {
        $pre_count = '';
        $after_count = '';
    }
    // 1. ----- Prepares the work -----
    // 1.1 Gets the informations about which functionalities should be
    //     displayed
    $total = '';
    $is_display = PMA_setDisplayMode($the_disp_mode, $total);
    // 1.2 Defines offsets for the next and previous pages
    if ($is_display['nav_bar'] == '1') {
        if ($_SESSION['tmp_user_values']['max_rows'] == 'all') {
            $pos_next = 0;
            $pos_prev = 0;
        } else {
            $pos_next = $_SESSION['tmp_user_values']['pos'] + $_SESSION['tmp_user_values']['max_rows'];
            $pos_prev = $_SESSION['tmp_user_values']['pos'] - $_SESSION['tmp_user_values']['max_rows'];
            if ($pos_prev < 0) {
                $pos_prev = 0;
            }
        }
    }
    // end if
    // 1.3 Find the sort expression
    // we need $sort_expression and $sort_expression_nodirection
    // even if there are many table references
    if (!empty($analyzed_sql[0]['order_by_clause'])) {
        $sort_expression = trim(str_replace('  ', ' ', $analyzed_sql[0]['order_by_clause']));
        /**
         * Get rid of ASC|DESC
         */
        preg_match('@(.*)([[:space:]]*(ASC|DESC))@si', $sort_expression, $matches);
        $sort_expression_nodirection = isset($matches[1]) ? trim($matches[1]) : $sort_expression;
        $sort_direction = isset($matches[2]) ? trim($matches[2]) : '';
        unset($matches);
    } else {
        $sort_expression = $sort_expression_nodirection = $sort_direction = '';
    }
    // 1.4 Prepares display of first and last value of the sorted column
    if (!empty($sort_expression_nodirection)) {
        list($sort_table, $sort_column) = explode('.', $sort_expression_nodirection);
        $sort_table = PMA_unQuote($sort_table);
        $sort_column = PMA_unQuote($sort_column);
        // find the sorted column index in row result
        // (this might be a multi-table query)
        $sorted_column_index = false;
        foreach ($fields_meta as $key => $meta) {
            if ($meta->table == $sort_table && $meta->name == $sort_column) {
                $sorted_column_index = $key;
                break;
            }
        }
        if ($sorted_column_index !== false) {
            // fetch first row of the result set
            $row = PMA_DBI_fetch_row($dt_result);
            $column_for_first_row = substr($row[$sorted_column_index], 0, $GLOBALS['cfg']['LimitChars']);
            // fetch last row of the result set
            PMA_DBI_data_seek($dt_result, $num_rows - 1);
            $row = PMA_DBI_fetch_row($dt_result);
            $column_for_last_row = substr($row[$sorted_column_index], 0, $GLOBALS['cfg']['LimitChars']);
            // reset to first row for the loop in PMA_displayTableBody()
            PMA_DBI_data_seek($dt_result, 0);
            // we could also use here $sort_expression_nodirection
            $sorted_column_message = ' [' . htmlspecialchars($sort_column) . ': <strong>' . htmlspecialchars($column_for_first_row) . ' - ' . htmlspecialchars($column_for_last_row) . '</strong>]';
            unset($row, $column_for_first_row, $column_for_last_row);
        }
        unset($sorted_column_index, $sort_table, $sort_column);
    }
    // 2. ----- Displays the top of the page -----
    // 2.1 Displays a messages with position informations
    if ($is_display['nav_bar'] == '1' && isset($pos_next)) {
        if (isset($unlim_num_rows) && $unlim_num_rows != $total) {
            $selectstring = ', ' . $unlim_num_rows . ' ' . $GLOBALS['strSelectNumRows'];
        } else {
            $selectstring = '';
        }
        $last_shown_rec = $_SESSION['tmp_user_values']['max_rows'] == 'all' || $pos_next > $total ? $total - 1 : $pos_next - 1;
        if (PMA_Table::isView($db, $table) && $total == $GLOBALS['cfg']['MaxExactCountViews']) {
            $message = PMA_Message::notice('strViewHasAtLeast');
            $message->addParam('[a@./Documentation.html#cfg_MaxExactCount@_blank]');
            $message->addParam('[/a]');
            $message_view_warning = PMA_showHint($message);
        } else {
            $message_view_warning = false;
        }
        $message = PMA_Message::success('strShowingRecords');
        $message->addMessage($_SESSION['tmp_user_values']['pos']);
        if ($message_view_warning) {
            $message->addMessage('...', ' - ');
            $message->addMessage($message_view_warning);
            $message->addMessage('(');
        } else {
            $message->addMessage($last_shown_rec, ' - ');
            $message->addMessage($pre_count . PMA_formatNumber($total, 0) . $after_count, ' (');
            $message->addString('strTotal');
            $message->addMessage($selectstring, '');
            $message->addMessage(', ', '');
        }
        $messagge_qt = PMA_Message::notice('strQueryTime');
        $messagge_qt->addParam($GLOBALS['querytime']);
        $message->addMessage($messagge_qt, '');
        $message->addMessage(')', '');
        $message->addMessage(isset($sorted_column_message) ? $sorted_column_message : '', '');
        PMA_showMessage($message, $sql_query, 'success');
    } elseif (!isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
        PMA_showMessage($GLOBALS['strSuccess'], $sql_query, 'success');
    }
    // 2.3 Displays the navigation bars
    if (!strlen($table)) {
        if (isset($analyzed_sql[0]['query_type']) && $analyzed_sql[0]['query_type'] == 'SELECT') {
            // table does not always contain a real table name,
            // for example in MySQL 5.0.x, the query SHOW STATUS
            // returns STATUS as a table name
            $table = $fields_meta[0]->table;
        } else {
            $table = '';
        }
    }
    if ($is_display['nav_bar'] == '1') {
        PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, 'top_direction_dropdown');
        echo "\n";
    } elseif (!isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
        echo "\n" . '<br /><br />' . "\n";
    }
    // 2b ----- Get field references from Database -----
    // (see the 'relation' configuration variable)
    // loic1, 2002-03-02: extended to php3
    // initialize map
    $map = array();
    // find tables
    $target = array();
    if (isset($analyzed_sql[0]['table_ref']) && is_array($analyzed_sql[0]['table_ref'])) {
        foreach ($analyzed_sql[0]['table_ref'] as $table_ref_position => $table_ref) {
            $target[] = $analyzed_sql[0]['table_ref'][$table_ref_position]['table_true_name'];
        }
    }
    $tabs = '(\'' . join('\',\'', $target) . '\')';
    if ($cfgRelation['displaywork']) {
        if (!strlen($table)) {
            $exist_rel = false;
        } else {
            $exist_rel = PMA_getForeigners($db, $table, '', 'both');
            if ($exist_rel) {
                foreach ($exist_rel as $master_field => $rel) {
                    $display_field = PMA_getDisplayField($rel['foreign_db'], $rel['foreign_table']);
                    $map[$master_field] = array($rel['foreign_table'], $rel['foreign_field'], $display_field, $rel['foreign_db']);
                }
                // end while
            }
            // end if
        }
        // end if
    }
    // end if
    // end 2b
    // 3. ----- Displays the results table -----
    PMA_displayTableHeaders($is_display, $fields_meta, $fields_cnt, $analyzed_sql, $sort_expression, $sort_expression_nodirection, $sort_direction);
    $url_query = '';
    echo '<tbody>' . "\n";
    $clause_is_unique = PMA_displayTableBody($dt_result, $is_display, $map, $analyzed_sql);
    // vertical output case
    if ($_SESSION['tmp_user_values']['disp_direction'] == 'vertical') {
        PMA_displayVerticalTable();
    }
    // end if
    unset($vertical_display);
    echo '</tbody>' . "\n";
    ?>
</table>

    <?php 
    // 4. ----- Displays the link for multi-fields edit and delete
    if ($is_display['del_lnk'] == 'dr' && $is_display['del_lnk'] != 'kp') {
        $delete_text = $is_display['del_lnk'] == 'dr' ? $GLOBALS['strDelete'] : $GLOBALS['strKill'];
        $_url_params = array('db' => $db, 'table' => $table, 'sql_query' => $sql_query, 'goto' => $goto);
        $uncheckall_url = 'sql.php' . PMA_generate_common_url($_url_params);
        $_url_params['checkall'] = '1';
        $checkall_url = 'sql.php' . PMA_generate_common_url($_url_params);
        if ($_SESSION['tmp_user_values']['disp_direction'] == 'vertical') {
            $checkall_params['onclick'] = 'if (setCheckboxes(\'rowsDeleteForm\', true)) return false;';
            $uncheckall_params['onclick'] = 'if (setCheckboxes(\'rowsDeleteForm\', false)) return false;';
        } else {
            $checkall_params['onclick'] = 'if (markAllRows(\'rowsDeleteForm\')) return false;';
            $uncheckall_params['onclick'] = 'if (unMarkAllRows(\'rowsDeleteForm\')) return false;';
        }
        $checkall_link = PMA_linkOrButton($checkall_url, $GLOBALS['strCheckAll'], $checkall_params, false);
        $uncheckall_link = PMA_linkOrButton($uncheckall_url, $GLOBALS['strUncheckAll'], $uncheckall_params, false);
        if ($_SESSION['tmp_user_values']['disp_direction'] != 'vertical') {
            echo '<img class="selectallarrow" width="38" height="22"' . ' src="' . $GLOBALS['pmaThemeImage'] . 'arrow_' . $GLOBALS['text_dir'] . '.png' . '"' . ' alt="' . $GLOBALS['strWithChecked'] . '" />';
        }
        echo $checkall_link . "\n" . ' / ' . "\n" . $uncheckall_link . "\n" . '<i>' . $GLOBALS['strWithChecked'] . '</i>' . "\n";
        PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_change', $GLOBALS['strChange'], 'b_edit.png');
        PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_delete', $delete_text, 'b_drop.png');
        if ($analyzed_sql[0]['querytype'] == 'SELECT') {
            PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_export', $GLOBALS['strExport'], 'b_tblexport.png');
        }
        echo "\n";
        echo '<input type="hidden" name="sql_query"' . ' value="' . htmlspecialchars($sql_query) . '" />' . "\n";
        echo '<input type="hidden" name="url_query"' . ' value="' . $GLOBALS['url_query'] . '" />' . "\n";
        echo '<input type="hidden" name="clause_is_unique"' . ' value="' . $clause_is_unique . '" />' . "\n";
        echo '</form>' . "\n";
    }
    // 5. ----- Displays the navigation bar at the bottom if required -----
    if ($is_display['nav_bar'] == '1') {
        echo '<br />' . "\n";
        PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, 'bottom_direction_dropdown');
    } elseif (!isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
        echo "\n" . '<br /><br />' . "\n";
    }
    // 6. ----- Displays "Query results operations"
    if (!isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
        PMA_displayResultsOperations($the_disp_mode, $analyzed_sql);
    }
}
><?php 
        echo $strAfterInsertNext;
        ?>
</option>
        <?php 
    }
}
?>
            </select>
        </td>
    </tr>

    <tr>
        <td>
<?php 
echo PMA_showHint($strUseTabKey);
?>
        </td>
        <td colspan="3" align="right" valign="middle">
            <input type="submit" value="<?php 
echo $strGo;
?>
" tabindex="<?php 
echo $tabindex + $tabindex_for_value + 6;
?>
" id="buttonYes" />
            <input type="reset" value="<?php 
echo $strReset;
?>
" tabindex="<?php 
echo $tabindex + $tabindex_for_value + 7;
$trans = new PMA_Message();
$trans->addMessage('__SERVER__/');
$trans->addString('strFileNameTemplateDescriptionServer');
if ($export_type == 'database' || $export_type == 'table') {
    $trans->addMessage('__DB__/');
    $trans->addString('strFileNameTemplateDescriptionDatabase');
    if ($export_type == 'table') {
        $trans->addMessage('__TABLE__/');
        $trans->addString('strFileNameTemplateDescriptionTable');
    }
}
$message = new PMA_Message('strFileNameTemplateDescription');
$message->addParam('<a href="http://php.net/strftime" target="documentation" title="' . $strDocu . '">', false);
$message->addParam('</a>', false);
$message->addParam($trans);
echo PMA_showHint($message);
?>
        </label>:
    <input type="text" name="filename_template" id="filename_template"
    <?php 
echo ' value="';
if ($export_type == 'database') {
    if (isset($_COOKIE) && !empty($_COOKIE['pma_db_filename_template'])) {
        echo htmlspecialchars($_COOKIE['pma_db_filename_template']);
    } else {
        echo $GLOBALS['cfg']['Export']['file_template_database'];
    }
} elseif ($export_type == 'table') {
    if (isset($_COOKIE) && !empty($_COOKIE['pma_table_filename_template'])) {
        echo htmlspecialchars($_COOKIE['pma_table_filename_template']);
    } else {
foreach ($sections as $section_name => $section) {
    if (! empty($section['vars']) && ! empty($section['title'])) {
        echo '<a href="' . $PMA_PHP_SELF . '?' .
             PMA_generate_common_url() . '#' . $section_name . '">' .
             $section['title'] . '</a>' . "\n";
    }
}
?>
</div>

<h3><?php echo $strServerTrafficNotes; ?></h3>

<table id="serverstatustraffic" class="data">
<thead>
<tr>
    <th colspan="2"><?php echo $strTraffic . '&nbsp;' . PMA_showHint($strStatisticsOverrun); ?></th>
    <th>&oslash; <?php echo $strPerHour; ?></th>
</tr>
</thead>
<tbody>
<tr class="odd">
    <th class="name"><?php echo $strReceived; ?></th>
    <td class="value"><?php echo
        implode(' ',
            PMA_formatByteDown($server_status['Bytes_received'], 4)); ?></td>
    <td class="value"><?php echo
        implode(' ',
            PMA_formatByteDown(
                $server_status['Bytes_received'] * $hour_factor, 4)); ?></td>
</tr>
<tr class="even">
$header_cells[] = '<abbr title="AUTO_INCREMENT">' . ($display_type == 'horizontal' ? 'A_I' : 'AUTO_INCREMENT') . '</abbr>';
require_once './libraries/relation.lib.php';
require_once './libraries/transformations.lib.php';
$cfgRelation = PMA_getRelationsParam();
$comments_map = array();
$mime_map = array();
$available_mime = array();
$comments_map = PMA_getComments($db, $table);
$header_cells[] = $strComments;
if ($cfgRelation['mimework'] && $cfg['BrowseMIME']) {
    $mime_map = PMA_getMIME($db, $table);
    $available_mime = PMA_getAvailableMIMEtypes();
    $hint = '<br />' . sprintf($strMIME_transformation_note, '<a href="transformation_overview.php?' . PMA_generate_common_url($db, $table) . '" target="_blank">', '</a>');
    $header_cells[] = $strMIME_MIMEtype;
    $header_cells[] = $strMIME_transformation;
    $header_cells[] = $strMIME_transformation_options . PMA_showHint($strMIME_transformation_options_note . $hint);
}
// garvin: workaround for field_fulltext, because its submitted indizes contain
//         the index as a value, not a key. Inserted here for easier maintaineance
//         and less code to change in existing files.
if (isset($field_fulltext) && is_array($field_fulltext)) {
    foreach ($field_fulltext as $fulltext_nr => $fulltext_indexkey) {
        $submit_fulltext[$fulltext_indexkey] = $fulltext_indexkey;
    }
}
for ($i = 0; $i < $num_fields; $i++) {
    if (!empty($regenerate)) {
        // An error happened with previous inputs, so we will restore the data
        // to embed it once again in this form.
        $row['Field'] = isset($_REQUEST['field_name'][$i]) ? $_REQUEST['field_name'][$i] : false;
        $row['Type'] = isset($_REQUEST['field_type'][$i]) ? $_REQUEST['field_type'][$i] : false;
    }
    $saved_row_cnt = count($save_row);
    ?>
    <fieldset>
    <legend><?php 
    echo $strLinksTo;
    ?>
</legend>

    <table>
    <tr><th></th>
    <?php 
    if ($cfgRelation['relwork']) {
        echo '<th>' . $strInternalRelations;
        if (PMA_foreignkey_supported($tbl_type)) {
            echo PMA_showHint($strInternalAndForeign);
        }
        echo '</th>';
    }
    if (PMA_foreignkey_supported($tbl_type)) {
        // this does not have to be translated, it's part of the MySQL syntax
        echo '<th colspan="2">FOREIGN KEY (' . $tbl_type . ')';
        echo '</th>';
    }
    ?>
    </tr>
    <?php 
    $odd_row = true;
    for ($i = 0; $i < $saved_row_cnt; $i++) {
        $myfield = $save_row[$i]['Field'];
        // Use an md5 as array index to avoid having special characters in the name atttibure (see bug #1746964 )
Beispiel #27
0
echo __('Words or values to search for (wildcard: "%"):');
?>
</td>
        <td><input type="text" name="search_str" size="60"
                value="<?php 
echo $searched;
?>
" /></td>
    </tr>
    <tr><td class="right vtop">
            <?php 
echo __('Find:');
?>
</td>
            <td><?php 
$choices = array('1' => __('at least one of the words') . PMA_showHint(__('Words are separated by a space character (" ").')), '2' => __('all words') . PMA_showHint(__('Words are separated by a space character (" ").')), '3' => __('the exact phrase'), '4' => __('as regular expression') . ' ' . PMA_showMySQLDocu('Regexp', 'Regexp'));
// 4th parameter set to true to add line breaks
// 5th parameter set to false to avoid htmlspecialchars() escaping in the label
//  since we have some HTML in some labels
PMA_display_html_radio('search_option', $choices, $search_option, true, false);
unset($choices);
?>
            </td>
    </tr>
    <tr><td class="right vtop">
            <?php 
echo __('Inside tables:');
?>
</td>
        <td rowspan="2">
<?php 
Beispiel #28
0
><?php 
        echo __('Edit next row');
        ?>
</option>
        <?php 
    }
}
?>
            </select>
        </td>
    </tr>

    <tr>
        <td>
<?php 
echo PMA_showHint(__('Use TAB key to move from value to value, or CTRL+arrows to move anywhere'));
?>
        </td>
        <td colspan="3" align="right" valign="middle">
            <input type="submit" class="control_at_footer" value="<?php 
echo __('Go');
?>
" tabindex="<?php 
echo $tabindex + $tabindex_for_value + 6;
?>
" id="buttonYes" />
            <input type="reset" class="control_at_footer" value="<?php 
echo __('Reset');
?>
" tabindex="<?php 
echo $tabindex + $tabindex_for_value + 7;
/**
 * Displays the fields used by the "new user" form as well as the
 * "change login information / copy user" form.
 *
 * @param string $mode are we creating a new user or are we just
 *                     changing  one? (allowed values: 'new', 'change')
 *
 * @global  array      $cfg     the phpMyAdmin configuration
 * @global  ressource  $user_link the database connection
 *
 * @return void
 */
function PMA_displayLoginInformationFields($mode = 'new')
{
    // Get user/host name lengths
    $fields_info = PMA_DBI_get_columns('mysql', 'user', null, true);
    $username_length = 16;
    $hostname_length = 41;
    foreach ($fields_info as $val) {
        if ($val['Field'] == 'User') {
            strtok($val['Type'], '()');
            $v = strtok('()');
            if (is_int($v)) {
                $username_length = $v;
            }
        } elseif ($val['Field'] == 'Host') {
            strtok($val['Type'], '()');
            $v = strtok('()');
            if (is_int($v)) {
                $hostname_length = $v;
            }
        }
    }
    unset($fields_info);

    if (isset($GLOBALS['username']) && strlen($GLOBALS['username']) === 0) {
        $GLOBALS['pred_username'] = '******';
    }
    echo '<fieldset id="fieldset_add_user_login">' . "\n"
       . '<legend>' . __('Login Information') . '</legend>' . "\n"
       . '<div class="item">' . "\n"
       . '<label for="select_pred_username">' . "\n"
       . '    ' . __('User name') . ':' . "\n"
       . '</label>' . "\n"
       . '<span class="options">' . "\n"
       . '    <select name="pred_username" id="select_pred_username" title="' . __('User name') . '"' . "\n"
       . '        onchange="if (this.value == \'any\') { username.value = \'\'; } else if (this.value == \'userdefined\') { username.focus(); username.select(); }">' . "\n"
       . '        <option value="any"' . ((isset($GLOBALS['pred_username']) && $GLOBALS['pred_username'] == 'any') ? ' selected="selected"' : '') . '>' . __('Any user') . '</option>' . "\n"
       . '        <option value="userdefined"' . ((! isset($GLOBALS['pred_username']) || $GLOBALS['pred_username'] == 'userdefined') ? ' selected="selected"' : '') . '>' . __('Use text field') . ':</option>' . "\n"
       . '    </select>' . "\n"
       . '</span>' . "\n"
       . '<input type="text" name="username" maxlength="'
       . $username_length . '" title="' . __('User name') . '"'
       . (empty($GLOBALS['username'])
           ? ''
           : ' value="' . htmlspecialchars(
               isset($GLOBALS['new_username'])
               ? $GLOBALS['new_username']
               : $GLOBALS['username']
           ) . '"'
       )
       . ' onchange="pred_username.value = \'userdefined\';" autofocus="autofocus" />' . "\n"
       . '</div>' . "\n"
       . '<div class="item">' . "\n"
       . '<label for="select_pred_hostname">' . "\n"
       . '    ' . __('Host') . ':' . "\n"
       . '</label>' . "\n"
       . '<span class="options">' . "\n"
       . '    <select name="pred_hostname" id="select_pred_hostname" title="' . __('Host') . '"' . "\n";
    $_current_user = PMA_DBI_fetch_value('SELECT USER();');
    if (! empty($_current_user)) {
        $thishost = str_replace("'", '', substr($_current_user, (strrpos($_current_user, '@') + 1)));
        if ($thishost == 'localhost' || $thishost == '127.0.0.1') {
            unset($thishost);
        }
    }
    echo '    onchange="if (this.value == \'any\') { hostname.value = \'%\'; } else if (this.value == \'localhost\') { hostname.value = \'localhost\'; } '
       . (empty($thishost) ? '' : 'else if (this.value == \'thishost\') { hostname.value = \'' . addslashes(htmlspecialchars($thishost)) . '\'; } ')
       . 'else if (this.value == \'hosttable\') { hostname.value = \'\'; } else if (this.value == \'userdefined\') { hostname.focus(); hostname.select(); }">' . "\n";
    unset($_current_user);

    // when we start editing a user, $GLOBALS['pred_hostname'] is not defined
    if (! isset($GLOBALS['pred_hostname']) && isset($GLOBALS['hostname'])) {
        switch (strtolower($GLOBALS['hostname'])) {
        case 'localhost':
        case '127.0.0.1':
            $GLOBALS['pred_hostname'] = 'localhost';
            break;
        case '%':
            $GLOBALS['pred_hostname'] = 'any';
            break;
        default:
            $GLOBALS['pred_hostname'] = 'userdefined';
            break;
        }
    }
    echo '        <option value="any"'
        . ((isset($GLOBALS['pred_hostname']) && $GLOBALS['pred_hostname'] == 'any')
            ? ' selected="selected"' : '') . '>' . __('Any host')
        . '</option>' . "\n"
       . '        <option value="localhost"'
        . ((isset($GLOBALS['pred_hostname']) && $GLOBALS['pred_hostname'] == 'localhost')
            ? ' selected="selected"' : '') . '>' . __('Local')
        . '</option>' . "\n";
    if (! empty($thishost)) {
        echo '        <option value="thishost"'
            . ((isset($GLOBALS['pred_hostname']) && $GLOBALS['pred_hostname'] == 'thishost')
                ? ' selected="selected"' : '') . '>' . __('This Host')
            . '</option>' . "\n";
    }
    unset($thishost);
    echo '        <option value="hosttable"'
        . ((isset($GLOBALS['pred_hostname']) && $GLOBALS['pred_hostname'] == 'hosttable')
            ? ' selected="selected"' : '') . '>' . __('Use Host Table')
        . '</option>' . "\n"
       . '        <option value="userdefined"'
        . ((isset($GLOBALS['pred_hostname']) && $GLOBALS['pred_hostname'] == 'userdefined')
            ? ' selected="selected"' : '')
        . '>' . __('Use text field') . ':</option>' . "\n"
       . '    </select>' . "\n"
       . '</span>' . "\n"
       . '<input type="text" name="hostname" maxlength="'
        . $hostname_length . '" value="'
        . htmlspecialchars(isset($GLOBALS['hostname']) ? $GLOBALS['hostname'] : '')
        . '" title="' . __('Host')
        . '" onchange="pred_hostname.value = \'userdefined\';" />' . "\n"
       . PMA_showHint(__('When Host table is used, this field is ignored and values stored in Host table are used instead.'))
       . '</div>' . "\n"
       . '<div class="item">' . "\n"
       . '<label for="select_pred_password">' . "\n"
       . '    ' . __('Password') . ':' . "\n"
       . '</label>' . "\n"
       . '<span class="options">' . "\n"
       . '    <select name="pred_password" id="select_pred_password" title="'
        . __('Password') . '"' . "\n"
       . '            onchange="if (this.value == \'none\') { pma_pw.value = \'\'; pma_pw2.value = \'\'; } else if (this.value == \'userdefined\') { pma_pw.focus(); pma_pw.select(); }">' . "\n"
       . ($mode == 'change' ? '            <option value="keep" selected="selected">' . __('Do not change the password') . '</option>' . "\n" : '')
       . '        <option value="none"';
    if (isset($GLOBALS['username']) && $mode != 'change') {
        echo '  selected="selected"';
    }
    echo '>' . __('No Password') . '</option>' . "\n"
       . '        <option value="userdefined"' . (isset($GLOBALS['username']) ? '' : ' selected="selected"') . '>' . __('Use text field') . ':</option>' . "\n"
       . '    </select>' . "\n"
       . '</span>' . "\n"
       . '<input type="password" id="text_pma_pw" name="pma_pw" title="' . __('Password') . '" onchange="pred_password.value = \'userdefined\';" />' . "\n"
       . '</div>' . "\n"
       . '<div class="item" id="div_element_before_generate_password">' . "\n"
       . '<label for="text_pma_pw2">' . "\n"
       . '    ' . __('Re-type') . ':' . "\n"
       . '</label>' . "\n"
       . '<span class="options">&nbsp;</span>' . "\n"
       . '<input type="password" name="pma_pw2" id="text_pma_pw2" title="' . __('Re-type') . '" onchange="pred_password.value = \'userdefined\';" />' . "\n"
       . '</div>' . "\n"
       // Generate password added here via jQuery
       . '</fieldset>' . "\n";
} // end of the 'PMA_displayUserAndHostFields()' function
Beispiel #30
0
    }
    $saved_row_cnt = count($save_row);
    ?>
    <fieldset>
    <legend><?php 
    echo $strLinksTo;
    ?>
</legend>

    <table>
    <tr><th></th>
    <?php 
    if ($cfgRelation['relwork']) {
        echo '<th>' . $strInternalRelations;
        if ($tbl_type == 'INNODB') {
            echo PMA_showHint($strInternalNotNecessary);
        }
        echo '</th>';
    }
    if ($tbl_type == 'INNODB') {
        echo '<th colspan="2">InnoDB';
        if (PMA_MYSQL_INT_VERSION < 40013) {
            echo '(**)';
        }
        echo '</th>';
    }
    ?>
    </tr>
    <?php 
    $odd_row = true;
    for ($i = 0; $i < $saved_row_cnt; $i++) {