display_tbl.lib.php

来自「phpMyAdmin图形界面化操作,我已经配置好了,只要把解要压缩后的文件放到站」· PHP 代码 · 共 1,349 行 · 第 1/5 页

PHP
1,349
字号
    ?><td>    &nbsp;&nbsp;&nbsp;</td><td align="center"><?php // if displaying a VIEW, $unlim_num_rows could be zero because      // of $cfg['MaxExactCountViews']; in this case, avoid passing      // the 5th parameter to checkFormElementInRange()      // (this means we can't validate the upper limit ?>    <form action="sql.php" method="post"onsubmit="return (checkFormElementInRange(this, 'session_max_rows', '<?php echo str_replace('\'', '\\\'', $GLOBALS['strInvalidRowNumber']); ?>', 1) &amp;&amp; checkFormElementInRange(this, 'pos', '<?php echo str_replace('\'', '\\\'', $GLOBALS['strInvalidRowNumber']); ?>', 0<?php echo $unlim_num_rows > 0 ? ',' . $unlim_num_rows - 1 : ''; ?>))">        <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>        <input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />        <input type="hidden" name="goto" value="<?php echo $goto; ?>" />        <input type="submit" name="navig" value="<?php echo $GLOBALS['strShow']; ?> :" />        <input type="text" name="session_max_rows" size="3" value="<?php echo (($_SESSION['userconf']['max_rows'] != 'all') ? $_SESSION['userconf']['max_rows'] : $GLOBALS['cfg']['MaxRows']); ?>" class="textfield" onfocus="this.select()" />        <?php echo $GLOBALS['strRowsFrom'] . "\n"; ?>        <input type="text" name="pos" size="6" value="<?php echo (($pos_next >= $unlim_num_rows) ? 0 : $pos_next); ?>" class="textfield" onfocus="this.select()" />        <br />    <?php    // Display mode (horizontal/vertical and repeat headers)    $param1 = '            <select name="disp_direction">' . "\n"            . '                <option value="horizontal"' . (($_SESSION['userconf']['disp_direction'] == 'horizontal') ? ' selected="selected"': '') . '>' . $GLOBALS['strRowsModeHorizontal'] . '</option>' . "\n"            . '                <option value="horizontalflipped"' . (($_SESSION['userconf']['disp_direction'] == 'horizontalflipped') ? ' selected="selected"': '') . '>' . $GLOBALS['strRowsModeFlippedHorizontal'] . '</option>' . "\n"            . '                <option value="vertical"' . (($_SESSION['userconf']['disp_direction'] == 'vertical') ? ' selected="selected"': '') . '>' . $GLOBALS['strRowsModeVertical'] . '</option>' . "\n"            . '            </select>' . "\n"            . '           ';    $param2 = '            <input type="text" size="3" name="repeat_cells" value="' . $_SESSION['userconf']['repeat_cells'] . '" class="textfield" />' . "\n"            . '           ';    echo '    ' . sprintf($GLOBALS['strRowsModeOptions'], "\n" . $param1, "\n" . $param2) . "\n";    ?>    </form></td><td>    &nbsp;&nbsp;&nbsp;</td>    <?php    // Move to the next page or to the last one    if (($_SESSION['userconf']['pos'] + $_SESSION['userconf']['max_rows'] < $unlim_num_rows) && $num_rows >= $_SESSION['userconf']['max_rows']        && $_SESSION['userconf']['max_rows'] != 'all') {        // loic1: patch #474210 from Gosha Sakovich - part 2        if ($GLOBALS['cfg']['NavigationBarIconic']) {            $caption3 = ' &gt; ';            $caption4 = '&gt;&gt;';            $title3   = ' title="' . $GLOBALS['strNext'] . '"';            $title4   = ' title="' . $GLOBALS['strEnd'] . '"';        } else {            $caption3 = '&gt; ' . $GLOBALS['strNext'];            $caption4 = '&gt;&gt; ' . $GLOBALS['strEnd'];            $title3   = '';            $title4   = '';        } // end if... else...        echo "\n";        ?><td>    <form action="sql.php" method="post">        <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>        <input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />        <input type="hidden" name="pos" value="<?php echo $pos_next; ?>" />        <input type="hidden" name="goto" value="<?php echo $goto; ?>" />        <input type="submit" name="navig" value="<?php echo $caption3; ?>"<?php echo $title3; ?> />    </form></td><td>    <form action="sql.php" method="post"        onsubmit="return <?php echo (($_SESSION['userconf']['pos'] + $_SESSION['userconf']['max_rows'] < $unlim_num_rows && $num_rows >= $_SESSION['userconf']['max_rows']) ? 'true' : 'false'); ?>">        <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>        <input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />        <input type="hidden" name="pos" value="<?php echo @((ceil($unlim_num_rows / $_SESSION['userconf']['max_rows'])- 1) * $_SESSION['userconf']['max_rows']); ?>" />        <?php        if ($is_innodb && $unlim_num_rows > $GLOBALS['cfg']['MaxExactCount']) {            echo '<input type="hidden" name="find_real_end" value="1" />' . "\n";            // no backquote around this message            $onclick = ' onclick="return confirmAction(\'' . PMA_jsFormat($GLOBALS['strLongOperation'], false) . '\')"';        }        ?>        <input type="hidden" name="goto" value="<?php echo $goto; ?>" />        <input type="submit" name="navig" value="<?php echo $caption4; ?>"<?php echo $title4; ?> <?php echo (empty($onclick) ? '' : $onclick); ?>/>    </form></td>        <?php    } // end move toward    //page redirection    // (unless we are showing all records)    if ('all' != $_SESSION['userconf']['max_rows']) { //if1        $pageNow = @floor($_SESSION['userconf']['pos'] / $_SESSION['userconf']['max_rows']) + 1;        $nbTotalPage = @ceil($unlim_num_rows / $_SESSION['userconf']['max_rows']);        if ($nbTotalPage > 1){ //if2       ?>   <td>       &nbsp;&nbsp;&nbsp;   </td>   <td>        <?php //<form> for keep the form alignment of button < and << ?>        <form action="none">        <?php            $_url_params = array(                'db'        => $db,                'table'     => $table,                'sql_query' => $sql_query,                'goto'      => $goto,            );            echo PMA_pageselector(                     'sql.php' . PMA_generate_common_url($_url_params) . PMA_get_arg_separator('js'),                     $_SESSION['userconf']['max_rows'],                    $pageNow,                    $nbTotalPage,                    200,                    5,                    5,                    20,                    10,                    $GLOBALS['strPageNumber']            );        ?>        </form>    </td>        <?php        } //_if2    } //_if1    // Display the "Show all" button if allowed    if ($GLOBALS['cfg']['ShowAll'] && ($num_rows < $unlim_num_rows)) {        echo "\n";        ?><td>    &nbsp;&nbsp;&nbsp;</td><td>    <form action="sql.php" method="post">        <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>        <input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />        <input type="hidden" name="pos" value="0" />        <input type="hidden" name="session_max_rows" value="all" />        <input type="hidden" name="goto" value="<?php echo $goto; ?>" />        <input type="submit" name="navig" value="<?php echo $GLOBALS['strShowAll']; ?>" />    </form></td>        <?php    } // end show all    echo "\n";    ?></tr></table>    <?php} // end of the 'PMA_displayTableNavigation()' function/** * Displays the headers of the results table * * @uses    $_SESSION['userconf']['disp_direction'] * @uses    $_SESSION['userconf']['repeat_cells'] * @uses    $_SESSION['userconf']['max_rows'] * @uses    $_SESSION['userconf']['display_text'] * @uses    $_SESSION['userconf']['display_binary'] * @param   array    which elements to display * @param   array    the list of fields properties * @param   integer  the total number of fields returned by the SQL query * @param   array    the analyzed query * * @return  boolean  always true * * @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 SQL query * @global  integer  $num_rows         the total number of rows returned by the *                                     SQL query * @global  array    $vertical_display informations used with vertical display *                                     mode * * @access  private * * @see     PMA_displayTable() */function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $analyzed_sql = '', $sort_expression, $sort_expression_nodirection, $sort_direction){    global $db, $table, $goto;    global $sql_query, $num_rows;    global $vertical_display, $highlight_columns;    if ($analyzed_sql == '') {        $analyzed_sql = array();    }    // can the result be sorted?    if ($is_display['sort_lnk'] == '1') {        // Just as fallback        $unsorted_sql_query     = $sql_query;        if (isset($analyzed_sql[0]['unsorted_query'])) {            $unsorted_sql_query = $analyzed_sql[0]['unsorted_query'];        }        // Handles the case of multiple clicks on a column's header        // which would add many spaces before "ORDER BY" in the         // generated query.        $unsorted_sql_query = trim($unsorted_sql_query);        // sorting by indexes, only if it makes sense (only one table ref)        if (isset($analyzed_sql) && isset($analyzed_sql[0]) &&            isset($analyzed_sql[0]['querytype']) && $analyzed_sql[0]['querytype'] == 'SELECT' &&            isset($analyzed_sql[0]['table_ref']) && count($analyzed_sql[0]['table_ref']) == 1) {            // grab indexes data:            $indexes = PMA_Index::getFromTable($table, $db);            // do we have any index?            if ($indexes) {                if ($_SESSION['userconf']['disp_direction'] == 'horizontal'                 || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {                    $span = $fields_cnt;                    if ($is_display['edit_lnk'] != 'nn') {                        $span++;                    }                    if ($is_display['del_lnk'] != 'nn') {                        $span++;                    }                    if ($is_display['del_lnk'] != 'kp' && $is_display['del_lnk'] != 'nn') {                        $span++;                    }                } else {                    $span = $num_rows + floor($num_rows/$_SESSION['userconf']['repeat_cells']) + 1;                }                echo '<form action="sql.php" method="post">' . "\n";                echo PMA_generate_common_hidden_inputs($db, $table);                echo $GLOBALS['strSortByKey'] . ': <select name="sql_query" onchange="this.form.submit();">' . "\n";                $used_index = false;                $local_order = (isset($sort_expression) ? $sort_expression : '');                foreach ($indexes as $index) {                    $asc_sort = '`' . implode('` ASC, `', array_keys($index->getColumns())) . '` ASC';                    $desc_sort = '`' . implode('` DESC, `', array_keys($index->getColumns())) . '` DESC';                    $used_index = $used_index || $local_order == $asc_sort || $local_order == $desc_sort;                    echo '<option value="'                         . htmlspecialchars($unsorted_sql_query  . ' ORDER BY ' . $asc_sort)                         . '"' . ($local_order == $asc_sort ? ' selected="selected"' : '')                         . '>' . htmlspecialchars($index->getName()) . ' ('                         . $GLOBALS['strAscending'] . ')</option>';                    echo '<option value="'                         . htmlspecialchars($unsorted_sql_query . ' ORDER BY ' . $desc_sort)                         . '"' . ($local_order == $desc_sort ? ' selected="selected"' : '')                         . '>' . htmlspecialchars($index->getName()) . ' ('                         . $GLOBALS['strDescending'] . ')</option>';                }                echo '<option value="' . htmlspecialchars($unsorted_sql_query) . '"' . ($used_index ? '' : ' selected="selected"') . '>' . $GLOBALS['strNone'] . '</option>';                echo '</select>' . "\n";                echo '<noscript><input type="submit" value="' . $GLOBALS['strGo'] . '" /></noscript>';                echo '</form>' . "\n";            }        }    }    $vertical_display['emptypre']   = 0;    $vertical_display['emptyafter'] = 0;    $vertical_display['textbtn']    = '';    // Display options (if we are not in print view)    if (! (isset($GLOBALS['printview']) && $GLOBALS['printview'] == '1')) {        echo '<form method="post" action="sql.php" name="displayOptionsForm" id="displayOptionsForm">';        $url_params = array(            'db' => $db,            'table' => $table,            'sql_query' => $sql_query,

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?