|
|
@@ -14,16 +14,6 @@ require_once './libraries/Table.class.php';
|
|
|
|
* Set of functions used to display the records returned by a SQL query
|
|
|
|
* Set of functions used to display the records returned by a SQL query
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Avoids undefined variables
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (!isset($pos)) {
|
|
|
|
|
|
|
|
$pos = 0;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
/* We need this to be a integer */
|
|
|
|
|
|
|
|
$pos = (int)$pos;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Defines the display mode to use for the results of a SQL query
|
|
|
|
* Defines the display mode to use for the results of a SQL query
|
|
|
|
*
|
|
|
|
*
|
|
|
@@ -197,6 +187,10 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Displays a navigation bar to browse among the results of a SQL query
|
|
|
|
* Displays a navigation bar to browse among the results of a SQL query
|
|
|
|
*
|
|
|
|
*
|
|
|
|
|
|
|
|
* @uses $_SESSION['userconf']['disp_direction']
|
|
|
|
|
|
|
|
* @uses $_SESSION['userconf']['repeat_cells']
|
|
|
|
|
|
|
|
* @uses $_SESSION['userconf']['max_rows']
|
|
|
|
|
|
|
|
* @uses $_SESSION['userconf']['pos']
|
|
|
|
* @param integer the offset for the "next" page
|
|
|
|
* @param integer the offset for the "next" page
|
|
|
|
* @param integer the offset for the "previous" page
|
|
|
|
* @param integer the offset for the "previous" page
|
|
|
|
* @param string the URL-encoded query
|
|
|
|
* @param string the URL-encoded query
|
|
|
@@ -204,19 +198,10 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
|
|
|
|
* @global string $db the database name
|
|
|
|
* @global string $db the database name
|
|
|
|
* @global string $table the table name
|
|
|
|
* @global string $table the table name
|
|
|
|
* @global string $goto the URL to go back in case of errors
|
|
|
|
* @global string $goto the URL to go back in case of errors
|
|
|
|
* @global boolean $dontlimitchars whether to limit the number of displayed
|
|
|
|
|
|
|
|
* characters of text type fields or not
|
|
|
|
|
|
|
|
* @global integer $num_rows the total number of rows returned by the
|
|
|
|
* @global integer $num_rows the total number of rows returned by the
|
|
|
|
* SQL query
|
|
|
|
* SQL query
|
|
|
|
* @global integer $unlim_num_rows the total number of rows returned by the
|
|
|
|
* @global integer $unlim_num_rows the total number of rows returned by the
|
|
|
|
* SQL any programmatically appended "LIMIT" clause
|
|
|
|
* SQL any programmatically appended "LIMIT" clause
|
|
|
|
* @global integer $pos the current position in results
|
|
|
|
|
|
|
|
* @global mixed $session_max_rows the maximum number of rows per page
|
|
|
|
|
|
|
|
* ('all' = no limit)
|
|
|
|
|
|
|
|
* @global string $disp_direction the display mode
|
|
|
|
|
|
|
|
* (horizontal / vertical / horizontalflipped)
|
|
|
|
|
|
|
|
* @global integer $repeat_cells the number of row to display between two
|
|
|
|
|
|
|
|
* table headers
|
|
|
|
|
|
|
|
* @global boolean $is_innodb whether its InnoDB or not
|
|
|
|
* @global boolean $is_innodb whether its InnoDB or not
|
|
|
|
* @global array $showtable table definitions
|
|
|
|
* @global array $showtable table definitions
|
|
|
|
*
|
|
|
|
*
|
|
|
@@ -226,9 +211,8 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query)
|
|
|
|
function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
global $db, $table, $goto, $dontlimitchars;
|
|
|
|
global $db, $table, $goto;
|
|
|
|
global $num_rows, $unlim_num_rows, $pos, $session_max_rows;
|
|
|
|
global $num_rows, $unlim_num_rows;
|
|
|
|
global $disp_direction, $repeat_cells;
|
|
|
|
|
|
|
|
global $is_innodb;
|
|
|
|
global $is_innodb;
|
|
|
|
global $showtable;
|
|
|
|
global $showtable;
|
|
|
|
|
|
|
|
|
|
|
@@ -247,7 +231,7 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query)
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
// Move to the beginning or to the previous page
|
|
|
|
// Move to the beginning or to the previous page
|
|
|
|
if ($pos > 0 && $session_max_rows != 'all') {
|
|
|
|
if ($_SESSION['userconf']['pos'] && $_SESSION['userconf']['max_rows'] != 'all') {
|
|
|
|
// loic1: patch #474210 from Gosha Sakovich - part 1
|
|
|
|
// loic1: patch #474210 from Gosha Sakovich - part 1
|
|
|
|
if ($GLOBALS['cfg']['NavigationBarIconic']) {
|
|
|
|
if ($GLOBALS['cfg']['NavigationBarIconic']) {
|
|
|
|
$caption1 = '<<';
|
|
|
|
$caption1 = '<<';
|
|
|
@@ -266,11 +250,7 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query)
|
|
|
|
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
|
|
|
<?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="sql_query" value="<?php echo $html_sql_query; ?>" />
|
|
|
|
<input type="hidden" name="pos" value="0" />
|
|
|
|
<input type="hidden" name="pos" value="0" />
|
|
|
|
<input type="hidden" name="session_max_rows" value="<?php echo $session_max_rows; ?>" />
|
|
|
|
|
|
|
|
<input type="hidden" name="disp_direction" value="<?php echo $disp_direction; ?>" />
|
|
|
|
|
|
|
|
<input type="hidden" name="repeat_cells" value="<?php echo $repeat_cells; ?>" />
|
|
|
|
|
|
|
|
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
|
|
|
|
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
|
|
|
|
<input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
|
|
|
|
|
|
|
|
<input type="submit" name="navig" value="<?php echo $caption1; ?>"<?php echo $title1; ?> />
|
|
|
|
<input type="submit" name="navig" value="<?php echo $caption1; ?>"<?php echo $title1; ?> />
|
|
|
|
</form>
|
|
|
|
</form>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
@@ -279,11 +259,7 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query)
|
|
|
|
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
|
|
|
<?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="sql_query" value="<?php echo $html_sql_query; ?>" />
|
|
|
|
<input type="hidden" name="pos" value="<?php echo $pos_prev; ?>" />
|
|
|
|
<input type="hidden" name="pos" value="<?php echo $pos_prev; ?>" />
|
|
|
|
<input type="hidden" name="session_max_rows" value="<?php echo $session_max_rows; ?>" />
|
|
|
|
|
|
|
|
<input type="hidden" name="disp_direction" value="<?php echo $disp_direction; ?>" />
|
|
|
|
|
|
|
|
<input type="hidden" name="repeat_cells" value="<?php echo $repeat_cells; ?>" />
|
|
|
|
|
|
|
|
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
|
|
|
|
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
|
|
|
|
<input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
|
|
|
|
|
|
|
|
<input type="submit" name="navig" value="<?php echo $caption2; ?>"<?php echo $title2; ?> />
|
|
|
|
<input type="submit" name="navig" value="<?php echo $caption2; ?>"<?php echo $title2; ?> />
|
|
|
|
</form>
|
|
|
|
</form>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
@@ -299,21 +275,20 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query)
|
|
|
|
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
|
|
|
<?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="sql_query" value="<?php echo $html_sql_query; ?>" />
|
|
|
|
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
|
|
|
|
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
|
|
|
|
<input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
|
|
|
|
|
|
|
|
<input type="submit" name="navig" value="<?php echo $GLOBALS['strShow']; ?> :" />
|
|
|
|
<input type="submit" name="navig" value="<?php echo $GLOBALS['strShow']; ?> :" />
|
|
|
|
<input type="text" name="session_max_rows" size="3" value="<?php echo (($session_max_rows != 'all') ? $session_max_rows : $GLOBALS['cfg']['MaxRows']); ?>" class="textfield" onfocus="this.select()" />
|
|
|
|
<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"; ?>
|
|
|
|
<?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()" />
|
|
|
|
<input type="text" name="pos" size="6" value="<?php echo (($pos_next >= $unlim_num_rows) ? 0 : $pos_next); ?>" class="textfield" onfocus="this.select()" />
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
// Display mode (horizontal/vertical and repeat headers)
|
|
|
|
// Display mode (horizontal/vertical and repeat headers)
|
|
|
|
$param1 = ' <select name="disp_direction">' . "\n"
|
|
|
|
$param1 = ' <select name="disp_direction">' . "\n"
|
|
|
|
. ' <option value="horizontal"' . (($disp_direction == 'horizontal') ? ' selected="selected"': '') . '>' . $GLOBALS['strRowsModeHorizontal'] . '</option>' . "\n"
|
|
|
|
. ' <option value="horizontal"' . (($_SESSION['userconf']['disp_direction'] == 'horizontal') ? ' selected="selected"': '') . '>' . $GLOBALS['strRowsModeHorizontal'] . '</option>' . "\n"
|
|
|
|
. ' <option value="horizontalflipped"' . (($disp_direction == 'horizontalflipped') ? ' selected="selected"': '') . '>' . $GLOBALS['strRowsModeFlippedHorizontal'] . '</option>' . "\n"
|
|
|
|
. ' <option value="horizontalflipped"' . (($_SESSION['userconf']['disp_direction'] == 'horizontalflipped') ? ' selected="selected"': '') . '>' . $GLOBALS['strRowsModeFlippedHorizontal'] . '</option>' . "\n"
|
|
|
|
. ' <option value="vertical"' . (($disp_direction == 'vertical') ? ' selected="selected"': '') . '>' . $GLOBALS['strRowsModeVertical'] . '</option>' . "\n"
|
|
|
|
. ' <option value="vertical"' . (($_SESSION['userconf']['disp_direction'] == 'vertical') ? ' selected="selected"': '') . '>' . $GLOBALS['strRowsModeVertical'] . '</option>' . "\n"
|
|
|
|
. ' </select>' . "\n"
|
|
|
|
. ' </select>' . "\n"
|
|
|
|
. ' ';
|
|
|
|
. ' ';
|
|
|
|
$param2 = ' <input type="text" size="3" name="repeat_cells" value="' . $repeat_cells . '" class="textfield" />' . "\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";
|
|
|
|
echo ' ' . sprintf($GLOBALS['strRowsModeOptions'], "\n" . $param1, "\n" . $param2) . "\n";
|
|
|
|
?>
|
|
|
|
?>
|
|
|
@@ -324,8 +299,8 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query)
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
// Move to the next page or to the last one
|
|
|
|
// Move to the next page or to the last one
|
|
|
|
if (($pos + $session_max_rows < $unlim_num_rows) && $num_rows >= $session_max_rows
|
|
|
|
if (($_SESSION['userconf']['pos'] + $_SESSION['userconf']['max_rows'] < $unlim_num_rows) && $num_rows >= $_SESSION['userconf']['max_rows']
|
|
|
|
&& $session_max_rows != 'all') {
|
|
|
|
&& $_SESSION['userconf']['max_rows'] != 'all') {
|
|
|
|
// loic1: patch #474210 from Gosha Sakovich - part 2
|
|
|
|
// loic1: patch #474210 from Gosha Sakovich - part 2
|
|
|
|
if ($GLOBALS['cfg']['NavigationBarIconic']) {
|
|
|
|
if ($GLOBALS['cfg']['NavigationBarIconic']) {
|
|
|
|
$caption3 = ' > ';
|
|
|
|
$caption3 = ' > ';
|
|
|
@@ -345,20 +320,16 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query)
|
|
|
|
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
|
|
|
|
<?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="sql_query" value="<?php echo $html_sql_query; ?>" />
|
|
|
|
<input type="hidden" name="pos" value="<?php echo $pos_next; ?>" />
|
|
|
|
<input type="hidden" name="pos" value="<?php echo $pos_next; ?>" />
|
|
|
|
<input type="hidden" name="session_max_rows" value="<?php echo $session_max_rows; ?>" />
|
|
|
|
|
|
|
|
<input type="hidden" name="disp_direction" value="<?php echo $disp_direction; ?>" />
|
|
|
|
|
|
|
|
<input type="hidden" name="repeat_cells" value="<?php echo $repeat_cells; ?>" />
|
|
|
|
|
|
|
|
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
|
|
|
|
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
|
|
|
|
<input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
|
|
|
|
|
|
|
|
<input type="submit" name="navig" value="<?php echo $caption3; ?>"<?php echo $title3; ?> />
|
|
|
|
<input type="submit" name="navig" value="<?php echo $caption3; ?>"<?php echo $title3; ?> />
|
|
|
|
</form>
|
|
|
|
</form>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<td>
|
|
|
|
<form action="sql.php" method="post"
|
|
|
|
<form action="sql.php" method="post"
|
|
|
|
onsubmit="return <?php echo (($pos + $session_max_rows < $unlim_num_rows && $num_rows >= $session_max_rows) ? 'true' : 'false'); ?>">
|
|
|
|
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); ?>
|
|
|
|
<?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="sql_query" value="<?php echo $html_sql_query; ?>" />
|
|
|
|
<input type="hidden" name="pos" value="<?php echo @((ceil($unlim_num_rows / $session_max_rows)- 1) * $session_max_rows); ?>" />
|
|
|
|
<input type="hidden" name="pos" value="<?php echo @((ceil($unlim_num_rows / $_SESSION['userconf']['max_rows'])- 1) * $_SESSION['userconf']['max_rows']); ?>" />
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
if ($is_innodb && $unlim_num_rows > $GLOBALS['cfg']['MaxExactCount']) {
|
|
|
|
if ($is_innodb && $unlim_num_rows > $GLOBALS['cfg']['MaxExactCount']) {
|
|
|
|
echo '<input type="hidden" name="find_real_end" value="1" />' . "\n";
|
|
|
|
echo '<input type="hidden" name="find_real_end" value="1" />' . "\n";
|
|
|
@@ -366,11 +337,7 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query)
|
|
|
|
$onclick = ' onclick="return confirmAction(\'' . PMA_jsFormat($GLOBALS['strLongOperation'], false) . '\')"';
|
|
|
|
$onclick = ' onclick="return confirmAction(\'' . PMA_jsFormat($GLOBALS['strLongOperation'], false) . '\')"';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|
<input type="hidden" name="session_max_rows" value="<?php echo $session_max_rows; ?>" />
|
|
|
|
|
|
|
|
<input type="hidden" name="disp_direction" value="<?php echo $disp_direction; ?>" />
|
|
|
|
|
|
|
|
<input type="hidden" name="repeat_cells" value="<?php echo $repeat_cells; ?>" />
|
|
|
|
|
|
|
|
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
|
|
|
|
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
|
|
|
|
<input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
|
|
|
|
|
|
|
|
<input type="submit" name="navig" value="<?php echo $caption4; ?>"<?php echo $title4; ?> <?php echo (empty($onclick) ? '' : $onclick); ?>/>
|
|
|
|
<input type="submit" name="navig" value="<?php echo $caption4; ?>"<?php echo $title4; ?> <?php echo (empty($onclick) ? '' : $onclick); ?>/>
|
|
|
|
</form>
|
|
|
|
</form>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
@@ -379,8 +346,8 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//page redirection
|
|
|
|
//page redirection
|
|
|
|
$pageNow = @floor($pos / $session_max_rows) + 1;
|
|
|
|
$pageNow = @floor($_SESSION['userconf']['pos'] / $_SESSION['userconf']['max_rows']) + 1;
|
|
|
|
$nbTotalPage = @ceil($unlim_num_rows / $session_max_rows);
|
|
|
|
$nbTotalPage = @ceil($unlim_num_rows / $_SESSION['userconf']['max_rows']);
|
|
|
|
|
|
|
|
|
|
|
|
if ($nbTotalPage > 1){ //if1
|
|
|
|
if ($nbTotalPage > 1){ //if1
|
|
|
|
?>
|
|
|
|
?>
|
|
|
@@ -392,14 +359,10 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query)
|
|
|
|
<form action="none">
|
|
|
|
<form action="none">
|
|
|
|
<?php echo PMA_pageselector(
|
|
|
|
<?php echo PMA_pageselector(
|
|
|
|
'sql.php?sql_query=' . urlencode($sql_query) .
|
|
|
|
'sql.php?sql_query=' . urlencode($sql_query) .
|
|
|
|
'&session_max_rows=' . $session_max_rows .
|
|
|
|
'&goto=' . $goto .
|
|
|
|
'&disp_direction=' . $disp_direction .
|
|
|
|
'&' . PMA_generate_common_url($db, $table) .
|
|
|
|
'&repeat_cells=' . $repeat_cells .
|
|
|
|
|
|
|
|
'&goto=' . $goto .
|
|
|
|
|
|
|
|
'&dontlimitchars=' . $dontlimitchars .
|
|
|
|
|
|
|
|
'&' . PMA_generate_common_url($db, $table) .
|
|
|
|
|
|
|
|
'&',
|
|
|
|
'&',
|
|
|
|
$session_max_rows,
|
|
|
|
$_SESSION['userconf']['max_rows'],
|
|
|
|
$pageNow,
|
|
|
|
$pageNow,
|
|
|
|
$nbTotalPage
|
|
|
|
$nbTotalPage
|
|
|
|
);
|
|
|
|
);
|
|
|
@@ -423,10 +386,7 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query)
|
|
|
|
<input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
|
|
|
|
<input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
|
|
|
|
<input type="hidden" name="pos" value="0" />
|
|
|
|
<input type="hidden" name="pos" value="0" />
|
|
|
|
<input type="hidden" name="session_max_rows" value="all" />
|
|
|
|
<input type="hidden" name="session_max_rows" value="all" />
|
|
|
|
<input type="hidden" name="disp_direction" value="<?php echo $disp_direction; ?>" />
|
|
|
|
|
|
|
|
<input type="hidden" name="repeat_cells" value="<?php echo $repeat_cells; ?>" />
|
|
|
|
|
|
|
|
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
|
|
|
|
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
|
|
|
|
<input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
|
|
|
|
|
|
|
|
<input type="submit" name="navig" value="<?php echo $GLOBALS['strShowAll']; ?>" />
|
|
|
|
<input type="submit" name="navig" value="<?php echo $GLOBALS['strShowAll']; ?>" />
|
|
|
|
</form>
|
|
|
|
</form>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
@@ -444,6 +404,10 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query)
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Displays the headers of the results table
|
|
|
|
* 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']['dontlimitchars']
|
|
|
|
* @param array which elements to display
|
|
|
|
* @param array which elements to display
|
|
|
|
* @param array the list of fields properties
|
|
|
|
* @param array the list of fields properties
|
|
|
|
* @param integer the total number of fields returned by the SQL query
|
|
|
|
* @param integer the total number of fields returned by the SQL query
|
|
|
@@ -454,19 +418,11 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query)
|
|
|
|
* @global string $db the database name
|
|
|
|
* @global string $db the database name
|
|
|
|
* @global string $table the table name
|
|
|
|
* @global string $table the table name
|
|
|
|
* @global string $goto the URL to go back in case of errors
|
|
|
|
* @global string $goto the URL to go back in case of errors
|
|
|
|
* @global boolean $dontlimitchars whether to limit the number of displayed
|
|
|
|
* @global string $sql_query the SQL query
|
|
|
|
* characters of text type fields or not
|
|
|
|
|
|
|
|
* @global string $sql_query the sql query
|
|
|
|
|
|
|
|
* @global integer $num_rows the total number of rows returned by the
|
|
|
|
* @global integer $num_rows the total number of rows returned by the
|
|
|
|
* SQL query
|
|
|
|
* SQL query
|
|
|
|
* @global integer $pos the current position in results
|
|
|
|
|
|
|
|
* @global integer $session_max_rows the maximum number of rows per page
|
|
|
|
|
|
|
|
* @global array $vertical_display informations used with vertical display
|
|
|
|
* @global array $vertical_display informations used with vertical display
|
|
|
|
* mode
|
|
|
|
* mode
|
|
|
|
* @global string $disp_direction the display mode
|
|
|
|
|
|
|
|
* (horizontal/vertical/horizontalflipped)
|
|
|
|
|
|
|
|
* @global integer $repeat_cellsthe number of row to display between two
|
|
|
|
|
|
|
|
* table headers
|
|
|
|
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @access private
|
|
|
|
* @access private
|
|
|
|
*
|
|
|
|
*
|
|
|
@@ -474,9 +430,9 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $analyzed_sql = '')
|
|
|
|
function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $analyzed_sql = '')
|
|
|
|
{
|
|
|
|
{
|
|
|
|
global $db, $table, $goto, $dontlimitchars;
|
|
|
|
global $db, $table, $goto;
|
|
|
|
global $sql_query, $num_rows, $pos, $session_max_rows;
|
|
|
|
global $sql_query, $num_rows;
|
|
|
|
global $vertical_display, $disp_direction, $repeat_cells, $highlight_columns;
|
|
|
|
global $vertical_display, $highlight_columns;
|
|
|
|
|
|
|
|
|
|
|
|
if ($analyzed_sql == '') {
|
|
|
|
if ($analyzed_sql == '') {
|
|
|
|
$analyzed_sql = array();
|
|
|
|
$analyzed_sql = array();
|
|
|
@@ -544,7 +500,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|
|
|
// do we have any index?
|
|
|
|
// do we have any index?
|
|
|
|
if (isset($indexes_data)) {
|
|
|
|
if (isset($indexes_data)) {
|
|
|
|
|
|
|
|
|
|
|
|
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|
|
|
|
|
|
|
|
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
|
|
|
|
$span = $fields_cnt;
|
|
|
|
$span = $fields_cnt;
|
|
|
|
if ($is_display['edit_lnk'] != 'nn') {
|
|
|
|
if ($is_display['edit_lnk'] != 'nn') {
|
|
|
|
$span++;
|
|
|
|
$span++;
|
|
|
@@ -556,16 +513,11 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|
|
|
$span++;
|
|
|
|
$span++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$span = $num_rows + floor($num_rows/$repeat_cells) + 1;
|
|
|
|
$span = $num_rows + floor($num_rows/$_SESSION['userconf']['repeat_cells']) + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
echo '<form action="sql.php" method="post">' . "\n";
|
|
|
|
echo '<form action="sql.php" method="post">' . "\n";
|
|
|
|
echo PMA_generate_common_hidden_inputs($db, $table, 5);
|
|
|
|
echo PMA_generate_common_hidden_inputs($db, $table, 5);
|
|
|
|
echo '<input type="hidden" name="pos" value="' . $pos . '" />' . "\n";
|
|
|
|
|
|
|
|
echo '<input type="hidden" name="session_max_rows" value="' . $session_max_rows . '" />' . "\n";
|
|
|
|
|
|
|
|
echo '<input type="hidden" name="disp_direction" value="' . $disp_direction . '" />' . "\n";
|
|
|
|
|
|
|
|
echo '<input type="hidden" name="repeat_cells" value="' . $repeat_cells . '" />' . "\n";
|
|
|
|
|
|
|
|
echo '<input type="hidden" name="dontlimitchars" value="' . $dontlimitchars . '" />' . "\n";
|
|
|
|
|
|
|
|
echo $GLOBALS['strSortByKey'] . ': <select name="sql_query" onchange="this.form.submit();">' . "\n";
|
|
|
|
echo $GLOBALS['strSortByKey'] . ': <select name="sql_query" onchange="this.form.submit();">' . "\n";
|
|
|
|
$used_index = false;
|
|
|
|
$used_index = false;
|
|
|
|
$local_order = (isset($sort_expression) ? $sort_expression : '');
|
|
|
|
$local_order = (isset($sort_expression) ? $sort_expression : '');
|
|
|
@@ -605,21 +557,18 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|
|
|
if ($is_display['del_lnk'] == 'dr' || $is_display['del_lnk'] == 'kp') {
|
|
|
|
if ($is_display['del_lnk'] == 'dr' || $is_display['del_lnk'] == 'kp') {
|
|
|
|
echo '<form method="post" action="tbl_row_action.php" name="rowsDeleteForm" id="rowsDeleteForm">' . "\n";
|
|
|
|
echo '<form method="post" action="tbl_row_action.php" name="rowsDeleteForm" id="rowsDeleteForm">' . "\n";
|
|
|
|
echo PMA_generate_common_hidden_inputs($db, $table, 1);
|
|
|
|
echo PMA_generate_common_hidden_inputs($db, $table, 1);
|
|
|
|
echo '<input type="hidden" name="disp_direction" value="' . $disp_direction . '" />' . "\n";
|
|
|
|
|
|
|
|
echo '<input type="hidden" name="repeat_cells" value="' . $repeat_cells . '" />' . "\n";
|
|
|
|
|
|
|
|
echo '<input type="hidden" name="dontlimitchars" value="' . $dontlimitchars . '" />' . "\n";
|
|
|
|
|
|
|
|
echo '<input type="hidden" name="pos" value="' . $pos . '" />' . "\n";
|
|
|
|
|
|
|
|
echo '<input type="hidden" name="session_max_rows" value="' . $session_max_rows . '" />' . "\n";
|
|
|
|
|
|
|
|
echo '<input type="hidden" name="goto" value="sql.php" />' . "\n";
|
|
|
|
echo '<input type="hidden" name="goto" value="sql.php" />' . "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
echo '<table id="table_results" class="data">' . "\n";
|
|
|
|
echo '<table id="table_results" class="data">' . "\n";
|
|
|
|
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|
|
|
|
|
|
|
|
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
|
|
|
|
echo '<thead><tr>' . "\n";
|
|
|
|
echo '<thead><tr>' . "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 1. Displays the full/partial text button (part 1)...
|
|
|
|
// 1. Displays the full/partial text button (part 1)...
|
|
|
|
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|
|
|
|
|
|
|
|
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
|
|
|
|
$colspan = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn')
|
|
|
|
$colspan = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn')
|
|
|
|
? ' colspan="3"'
|
|
|
|
? ' colspan="3"'
|
|
|
|
: '';
|
|
|
|
: '';
|
|
|
@@ -631,20 +580,22 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|
|
|
$text_url = 'sql.php?'
|
|
|
|
$text_url = 'sql.php?'
|
|
|
|
. PMA_generate_common_url($db, $table)
|
|
|
|
. PMA_generate_common_url($db, $table)
|
|
|
|
. '&sql_query=' . urlencode($sql_query)
|
|
|
|
. '&sql_query=' . urlencode($sql_query)
|
|
|
|
. '&session_max_rows=' . $session_max_rows
|
|
|
|
. '&goto=' . $goto;
|
|
|
|
. '&pos=' . $pos
|
|
|
|
$text_message = '<img class="fulltext" src="' . $GLOBALS['pmaThemeImage']
|
|
|
|
. '&disp_direction=' . $disp_direction
|
|
|
|
. 's_'
|
|
|
|
. '&repeat_cells=' . $repeat_cells
|
|
|
|
. ($_SESSION['userconf']['dontlimitchars'] ? 'partialtext' : 'fulltext')
|
|
|
|
. '&goto=' . $goto
|
|
|
|
. '.png" width="50" height="20" alt="'
|
|
|
|
. '&dontlimitchars=' . (($dontlimitchars) ? 0 : 1);
|
|
|
|
. ($_SESSION['userconf']['dontlimitchars'] ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText'])
|
|
|
|
$text_message = '<img class="fulltext" src="' . $GLOBALS['pmaThemeImage'] . 's_'.($dontlimitchars ? 'partialtext' : 'fulltext') . '.png" width="50" height="20" alt="' . ($dontlimitchars ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']) . '" title="' . ($dontlimitchars ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']) . '" />';
|
|
|
|
. '" title="'
|
|
|
|
|
|
|
|
. ($_SESSION['userconf']['dontlimitchars'] ? $GLOBALS['strPartialText'] : $GLOBALS['strFullText']) . '" />';
|
|
|
|
$text_link = PMA_linkOrButton($text_url, $text_message, array(), false);
|
|
|
|
$text_link = PMA_linkOrButton($text_url, $text_message, array(), false);
|
|
|
|
|
|
|
|
|
|
|
|
// ... before the result table
|
|
|
|
// ... before the result table
|
|
|
|
if (($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')
|
|
|
|
if (($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')
|
|
|
|
&& $is_display['text_btn'] == '1') {
|
|
|
|
&& $is_display['text_btn'] == '1') {
|
|
|
|
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0;
|
|
|
|
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0;
|
|
|
|
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|
|
|
|
|
|
|
|
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|
<th colspan="<?php echo $fields_cnt; ?>"><?php echo $text_link; ?></th>
|
|
|
|
<th colspan="<?php echo $fields_cnt; ?>"><?php echo $text_link; ?></th>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
@@ -654,7 +605,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<th colspan="<?php echo $num_rows + floor($num_rows/$repeat_cells) + 1; ?>">
|
|
|
|
<th colspan="<?php echo $num_rows + floor($num_rows/$_SESSION['userconf']['repeat_cells']) + 1; ?>">
|
|
|
|
<?php echo $text_link; ?></th>
|
|
|
|
<?php echo $text_link; ?></th>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
@@ -665,7 +616,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|
|
|
// and required
|
|
|
|
// and required
|
|
|
|
elseif ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && $is_display['text_btn'] == '1') {
|
|
|
|
elseif ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && $is_display['text_btn'] == '1') {
|
|
|
|
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0;
|
|
|
|
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0;
|
|
|
|
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|
|
|
|
|
|
|
|
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|
<th <?php echo $colspan; ?>><?php echo $text_link; ?></th>
|
|
|
|
<th <?php echo $colspan; ?>><?php echo $text_link; ?></th>
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
@@ -681,7 +633,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|
|
|
elseif ($GLOBALS['cfg']['ModifyDeleteAtLeft']
|
|
|
|
elseif ($GLOBALS['cfg']['ModifyDeleteAtLeft']
|
|
|
|
&& ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')) {
|
|
|
|
&& ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')) {
|
|
|
|
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0;
|
|
|
|
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0;
|
|
|
|
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|
|
|
|
|
|
|
|
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|
<td<?php echo $colspan; ?>></td>
|
|
|
|
<td<?php echo $colspan; ?>></td>
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
@@ -697,7 +650,10 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|
|
|
|
|
|
|
|
|
|
|
// 2.0.1 Prepare Display column comments if enabled ($GLOBALS['cfg']['ShowBrowseComments']).
|
|
|
|
// 2.0.1 Prepare Display column comments if enabled ($GLOBALS['cfg']['ShowBrowseComments']).
|
|
|
|
// Do not show comments, if using horizontalflipped mode, because of space usage
|
|
|
|
// Do not show comments, if using horizontalflipped mode, because of space usage
|
|
|
|
if ($GLOBALS['cfg']['ShowBrowseComments'] && ($GLOBALS['cfgRelation']['commwork'] || PMA_MYSQL_INT_VERSION >= 40100) && $disp_direction != 'horizontalflipped') {
|
|
|
|
if ($GLOBALS['cfg']['ShowBrowseComments']
|
|
|
|
|
|
|
|
&& ($GLOBALS['cfgRelation']['commwork']
|
|
|
|
|
|
|
|
|| PMA_MYSQL_INT_VERSION >= 40100)
|
|
|
|
|
|
|
|
&& $_SESSION['userconf']['disp_direction'] != 'horizontalflipped') {
|
|
|
|
$comments_map = array();
|
|
|
|
$comments_map = array();
|
|
|
|
if (isset($analyzed_sql[0]) && is_array($analyzed_sql[0])) {
|
|
|
|
if (isset($analyzed_sql[0]) && is_array($analyzed_sql[0])) {
|
|
|
|
foreach ($analyzed_sql[0]['table_ref'] as $tbl) {
|
|
|
|
foreach ($analyzed_sql[0]['table_ref'] as $tbl) {
|
|
|
@@ -824,11 +780,6 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|
|
|
$sorted_sql_query = $unsorted_sql_query . $sort_order;
|
|
|
|
$sorted_sql_query = $unsorted_sql_query . $sort_order;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$url_query = PMA_generate_common_url($db, $table)
|
|
|
|
$url_query = PMA_generate_common_url($db, $table)
|
|
|
|
. '&pos=' . $pos
|
|
|
|
|
|
|
|
. '&session_max_rows=' . $session_max_rows
|
|
|
|
|
|
|
|
. '&disp_direction=' . $disp_direction
|
|
|
|
|
|
|
|
. '&repeat_cells=' . $repeat_cells
|
|
|
|
|
|
|
|
. '&dontlimitchars=' . $dontlimitchars
|
|
|
|
|
|
|
|
. '&sql_query=' . urlencode($sorted_sql_query);
|
|
|
|
. '&sql_query=' . urlencode($sorted_sql_query);
|
|
|
|
$order_url = 'sql.php?' . $url_query;
|
|
|
|
$order_url = 'sql.php?' . $url_query;
|
|
|
|
|
|
|
|
|
|
|
@@ -845,20 +796,21 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|
|
|
$order_link_params['onmouseout'] = 'if(document.getElementById(\'soimg' . $i . '\')){ document.getElementById(\'soimg' . $i . '\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_desc.png\'; }';
|
|
|
|
$order_link_params['onmouseout'] = 'if(document.getElementById(\'soimg' . $i . '\')){ document.getElementById(\'soimg' . $i . '\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_desc.png\'; }';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($disp_direction == 'horizontalflipped'
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'horizontalflipped'
|
|
|
|
&& $GLOBALS['cfg']['HeaderFlipType'] == 'css') {
|
|
|
|
&& $GLOBALS['cfg']['HeaderFlipType'] == 'css') {
|
|
|
|
$order_link_params['style'] = 'direction: ltr; writing-mode: tb-rl;';
|
|
|
|
$order_link_params['style'] = 'direction: ltr; writing-mode: tb-rl;';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$order_link_params['title'] = $GLOBALS['strSort'];
|
|
|
|
$order_link_params['title'] = $GLOBALS['strSort'];
|
|
|
|
$order_link_content = ($disp_direction == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'fake' ? PMA_flipstring(htmlspecialchars($fields_meta[$i]->name), "<br />\n") : htmlspecialchars($fields_meta[$i]->name));
|
|
|
|
$order_link_content = ($_SESSION['userconf']['disp_direction'] == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'fake' ? PMA_flipstring(htmlspecialchars($fields_meta[$i]->name), "<br />\n") : htmlspecialchars($fields_meta[$i]->name));
|
|
|
|
$order_link = PMA_linkOrButton($order_url, $order_link_content . $order_img, $order_link_params, false, true);
|
|
|
|
$order_link = PMA_linkOrButton($order_url, $order_link_content . $order_img, $order_link_params, false, true);
|
|
|
|
|
|
|
|
|
|
|
|
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|
|
|
|
|
|
|
|
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
|
|
|
|
echo '<th';
|
|
|
|
echo '<th';
|
|
|
|
if ($condition_field) {
|
|
|
|
if ($condition_field) {
|
|
|
|
echo ' class="condition"';
|
|
|
|
echo ' class="condition"';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($disp_direction == 'horizontalflipped') {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
|
|
|
|
echo ' valign="bottom"';
|
|
|
|
echo ' valign="bottom"';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo '>' . $order_link . $comments . '</th>';
|
|
|
|
echo '>' . $order_link . $comments . '</th>';
|
|
|
@@ -870,20 +822,21 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|
|
|
|
|
|
|
|
|
|
|
// 2.2 Results can't be sorted
|
|
|
|
// 2.2 Results can't be sorted
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|
|
|
|
|
|
|
|
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
|
|
|
|
echo '<th';
|
|
|
|
echo '<th';
|
|
|
|
if ($condition_field) {
|
|
|
|
if ($condition_field) {
|
|
|
|
echo ' class="condition"';
|
|
|
|
echo ' class="condition"';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($disp_direction == 'horizontalflipped') {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
|
|
|
|
echo ' valign="bottom"';
|
|
|
|
echo ' valign="bottom"';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($disp_direction == 'horizontalflipped'
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'horizontalflipped'
|
|
|
|
&& $GLOBALS['cfg']['HeaderFlipType'] == 'css') {
|
|
|
|
&& $GLOBALS['cfg']['HeaderFlipType'] == 'css') {
|
|
|
|
echo ' style="direction: ltr; writing-mode: tb-rl;"';
|
|
|
|
echo ' style="direction: ltr; writing-mode: tb-rl;"';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo '>';
|
|
|
|
echo '>';
|
|
|
|
if ($disp_direction == 'horizontalflipped'
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'horizontalflipped'
|
|
|
|
&& $GLOBALS['cfg']['HeaderFlipType'] == 'fake') {
|
|
|
|
&& $GLOBALS['cfg']['HeaderFlipType'] == 'fake') {
|
|
|
|
echo PMA_flipstring(htmlspecialchars($fields_meta[$i]->name), '<br />');
|
|
|
|
echo PMA_flipstring(htmlspecialchars($fields_meta[$i]->name), '<br />');
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@@ -904,7 +857,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|
|
|
&& ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')
|
|
|
|
&& ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')
|
|
|
|
&& $is_display['text_btn'] == '1') {
|
|
|
|
&& $is_display['text_btn'] == '1') {
|
|
|
|
$vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 1;
|
|
|
|
$vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 1;
|
|
|
|
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|
|
|
|
|
|
|
|
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
|
|
|
|
echo "\n";
|
|
|
|
echo "\n";
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|
<th <?php echo $colspan; ?>>
|
|
|
|
<th <?php echo $colspan; ?>>
|
|
|
@@ -925,7 +879,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|
|
|
&& ($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')
|
|
|
|
&& ($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')
|
|
|
|
&& (!$GLOBALS['is_header_sent'])) {
|
|
|
|
&& (!$GLOBALS['is_header_sent'])) {
|
|
|
|
$vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 1;
|
|
|
|
$vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 1;
|
|
|
|
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|
|
|
|
|
|
|
|
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
|
|
|
|
echo "\n";
|
|
|
|
echo "\n";
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|
<td<?php echo $colspan; ?>></td>
|
|
|
|
<td<?php echo $colspan; ?>></td>
|
|
|
@@ -936,7 +891,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|
|
|
} // end vertical mode
|
|
|
|
} // end vertical mode
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|
|
|
|
|
|
|
|
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
</thead>
|
|
|
@@ -951,6 +907,10 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Displays the body of the results table
|
|
|
|
* Displays the body of the results table
|
|
|
|
*
|
|
|
|
*
|
|
|
|
|
|
|
|
* @uses $_SESSION['userconf']['disp_direction']
|
|
|
|
|
|
|
|
* @uses $_SESSION['userconf']['repeat_cells']
|
|
|
|
|
|
|
|
* @uses $_SESSION['userconf']['max_rows']
|
|
|
|
|
|
|
|
* @uses $_SESSION['userconf']['dontlimitchars']
|
|
|
|
* @param integer the link id associated to the query which results have
|
|
|
|
* @param integer the link id associated to the query which results have
|
|
|
|
* to be displayed
|
|
|
|
* to be displayed
|
|
|
|
* @param array which elements to display
|
|
|
|
* @param array which elements to display
|
|
|
@@ -962,31 +922,23 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|
|
|
* @global string $db the database name
|
|
|
|
* @global string $db the database name
|
|
|
|
* @global string $table the table name
|
|
|
|
* @global string $table the table name
|
|
|
|
* @global string $goto the URL to go back in case of errors
|
|
|
|
* @global string $goto the URL to go back in case of errors
|
|
|
|
* @global boolean $dontlimitchars whether to limit the number of displayed
|
|
|
|
|
|
|
|
* characters of text type fields or not
|
|
|
|
|
|
|
|
* @global string $sql_query the SQL query
|
|
|
|
* @global string $sql_query the SQL query
|
|
|
|
* @global integer $pos the current position in results
|
|
|
|
|
|
|
|
* @global integer $session_max_rows the maximum number of rows per page
|
|
|
|
|
|
|
|
* @global array $fields_meta the list of fields properties
|
|
|
|
* @global array $fields_meta the list of fields properties
|
|
|
|
* @global integer $fields_cnt the total number of fields returned by
|
|
|
|
* @global integer $fields_cnt the total number of fields returned by
|
|
|
|
* the SQL query
|
|
|
|
* the SQL query
|
|
|
|
* @global array $vertical_display informations used with vertical display
|
|
|
|
* @global array $vertical_display informations used with vertical display
|
|
|
|
* mode
|
|
|
|
* mode
|
|
|
|
* @global string $disp_direction the display mode
|
|
|
|
* @global array $highlight_columns column names to highlight
|
|
|
|
* (horizontal/vertical/horizontalflipped)
|
|
|
|
* @global array $row current row data
|
|
|
|
* @global integer $repeat_cells the number of row to display between two
|
|
|
|
|
|
|
|
* table headers
|
|
|
|
|
|
|
|
* @global array $highlight_columns collumn names to highlight
|
|
|
|
|
|
|
|
* @gloabl array $row current row data
|
|
|
|
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @access private
|
|
|
|
* @access private
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @see PMA_displayTable()
|
|
|
|
* @see PMA_displayTable()
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
|
|
|
function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
|
|
|
global $db, $table, $goto, $dontlimitchars;
|
|
|
|
global $db, $table, $goto;
|
|
|
|
global $sql_query, $pos, $session_max_rows, $fields_meta, $fields_cnt;
|
|
|
|
global $sql_query, $fields_meta, $fields_cnt;
|
|
|
|
global $vertical_display, $disp_direction, $repeat_cells, $highlight_columns;
|
|
|
|
global $vertical_display, $highlight_columns;
|
|
|
|
global $row; // mostly because of browser transformations, to make the row-data accessible in a plugin
|
|
|
|
global $row; // mostly because of browser transformations, to make the row-data accessible in a plugin
|
|
|
|
|
|
|
|
|
|
|
|
$url_sql_query = $sql_query;
|
|
|
|
$url_sql_query = $sql_query;
|
|
|
@@ -1041,9 +993,9 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
|
|
|
$odd_row = true;
|
|
|
|
$odd_row = true;
|
|
|
|
while ($row = PMA_DBI_fetch_row($dt_result)) {
|
|
|
|
while ($row = PMA_DBI_fetch_row($dt_result)) {
|
|
|
|
// lem9: "vertical display" mode stuff
|
|
|
|
// lem9: "vertical display" mode stuff
|
|
|
|
if ($row_no != 0 && $repeat_cells != 0 && !($row_no % $repeat_cells)
|
|
|
|
if ($row_no != 0 && $_SESSION['userconf']['repeat_cells'] != 0 && !($row_no % $_SESSION['userconf']['repeat_cells'])
|
|
|
|
&& ($disp_direction == 'horizontal'
|
|
|
|
&& ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|
|
|
|
|| $disp_direction == 'horizontalflipped'))
|
|
|
|
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped'))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
echo '<tr>' . "\n";
|
|
|
|
echo '<tr>' . "\n";
|
|
|
|
if ($vertical_display['emptypre'] > 0) {
|
|
|
|
if ($vertical_display['emptypre'] > 0) {
|
|
|
@@ -1064,7 +1016,8 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
|
|
|
|
|
|
|
|
|
|
|
$class = $odd_row ? 'odd' : 'even';
|
|
|
|
$class = $odd_row ? 'odd' : 'even';
|
|
|
|
$odd_row = ! $odd_row;
|
|
|
|
$odd_row = ! $odd_row;
|
|
|
|
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|
|
|
|
|
|
|
|
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
|
|
|
|
// loic1: pointer code part
|
|
|
|
// loic1: pointer code part
|
|
|
|
echo ' <tr class="' . $class . '">' . "\n";
|
|
|
|
echo ' <tr class="' . $class . '">' . "\n";
|
|
|
|
$class = '';
|
|
|
|
$class = '';
|
|
|
@@ -1082,12 +1035,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
|
|
|
$unique_condition = urlencode(PMA_getUniqueCondition($dt_result, $fields_cnt, $fields_meta, $row));
|
|
|
|
$unique_condition = urlencode(PMA_getUniqueCondition($dt_result, $fields_cnt, $fields_meta, $row));
|
|
|
|
|
|
|
|
|
|
|
|
// 1.2 Defines the URLs for the modify/delete link(s)
|
|
|
|
// 1.2 Defines the URLs for the modify/delete link(s)
|
|
|
|
$url_query = PMA_generate_common_url($db, $table)
|
|
|
|
$url_query = PMA_generate_common_url($db, $table);
|
|
|
|
. '&pos=' . $pos
|
|
|
|
|
|
|
|
. '&session_max_rows=' . $session_max_rows
|
|
|
|
|
|
|
|
. '&disp_direction=' . $disp_direction
|
|
|
|
|
|
|
|
. '&repeat_cells=' . $repeat_cells
|
|
|
|
|
|
|
|
. '&dontlimitchars=' . $dontlimitchars;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn') {
|
|
|
|
if ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn') {
|
|
|
|
// We need to copy the value or else the == 'both' check will always return true
|
|
|
|
// We need to copy the value or else the == 'both' check will always return true
|
|
|
@@ -1187,7 +1135,8 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
|
|
|
|
|
|
|
|
|
|
|
// 1.3 Displays the links at left if required
|
|
|
|
// 1.3 Displays the links at left if required
|
|
|
|
if ($GLOBALS['cfg']['ModifyDeleteAtLeft']
|
|
|
|
if ($GLOBALS['cfg']['ModifyDeleteAtLeft']
|
|
|
|
&& ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped')) {
|
|
|
|
&& ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|
|
|
|
|
|
|
|
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped')) {
|
|
|
|
$doWriteModifyAt = 'left';
|
|
|
|
$doWriteModifyAt = 'left';
|
|
|
|
require './libraries/display_tbl_links.lib.php';
|
|
|
|
require './libraries/display_tbl_links.lib.php';
|
|
|
|
} // end if (1.3)
|
|
|
|
} // end if (1.3)
|
|
|
@@ -1209,7 +1158,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$mouse_events = '';
|
|
|
|
$mouse_events = '';
|
|
|
|
if ($disp_direction == 'vertical' && (!isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1'))) {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'vertical' && (!isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1'))) {
|
|
|
|
if ($GLOBALS['cfg']['BrowsePointerEnable'] == true) {
|
|
|
|
if ($GLOBALS['cfg']['BrowsePointerEnable'] == true) {
|
|
|
|
$mouse_events .= ' onmouseover="setVerticalPointer(this, ' . $row_no . ', \'over\', \'odd\', \'even\', \'hover\', \'marked\');"'
|
|
|
|
$mouse_events .= ' onmouseover="setVerticalPointer(this, ' . $row_no . ', \'over\', \'odd\', \'even\', \'hover\', \'marked\');"'
|
|
|
|
. ' onmouseout="setVerticalPointer(this, ' . $row_no . ', \'out\', \'odd\', \'even\', \'hover\', \'marked\');" ';
|
|
|
|
. ' onmouseout="setVerticalPointer(this, ' . $row_no . ', \'out\', \'odd\', \'even\', \'hover\', \'marked\');" ';
|
|
|
@@ -1310,7 +1259,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
|
|
|
|
|
|
|
|
|
|
|
$vertical_display['data'][$row_no][$i] .= '<a href="sql.php?'
|
|
|
|
$vertical_display['data'][$row_no][$i] .= '<a href="sql.php?'
|
|
|
|
. PMA_generate_common_url($map[$meta->name][3], $map[$meta->name][0])
|
|
|
|
. PMA_generate_common_url($map[$meta->name][3], $map[$meta->name][0])
|
|
|
|
. '&pos=0&session_max_rows=' . $session_max_rows . '&dontlimitchars=' . $dontlimitchars
|
|
|
|
. '&pos=0'
|
|
|
|
. '&sql_query=' . urlencode('SELECT * FROM ' . PMA_backquote($map[$meta->name][0]) . ' WHERE ' . PMA_backquote($map[$meta->name][1]) . ' = ' . $row[$i]) . '"' . $title . '>'
|
|
|
|
. '&sql_query=' . urlencode('SELECT * FROM ' . PMA_backquote($map[$meta->name][0]) . ' WHERE ' . PMA_backquote($map[$meta->name][1]) . ' = ' . $row[$i]) . '"' . $title . '>'
|
|
|
|
. ($transform_function != $default_function ? $transform_function($row[$i], $transform_options, $meta) : $transform_function($row[$i], array(), $meta)) . '</a>';
|
|
|
|
. ($transform_function != $default_function ? $transform_function($row[$i], $transform_options, $meta) : $transform_function($row[$i], array(), $meta)) . '</a>';
|
|
|
|
}
|
|
|
|
}
|
|
|
@@ -1357,7 +1306,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
|
|
|
$vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\n";
|
|
|
|
$vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\n";
|
|
|
|
} elseif ($row[$i] != '') {
|
|
|
|
} elseif ($row[$i] != '') {
|
|
|
|
// garvin: if a transform function for blob is set, none of these replacements will be made
|
|
|
|
// garvin: if a transform function for blob is set, none of these replacements will be made
|
|
|
|
if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && ($dontlimitchars != 1)) {
|
|
|
|
if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && ! $_SESSION['userconf']['dontlimitchars']) {
|
|
|
|
$row[$i] = PMA_substr($row[$i], 0, $GLOBALS['cfg']['LimitChars']) . '...';
|
|
|
|
$row[$i] = PMA_substr($row[$i], 0, $GLOBALS['cfg']['LimitChars']) . '...';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// loic1: displays all space characters, 4 space
|
|
|
|
// loic1: displays all space characters, 4 space
|
|
|
@@ -1378,7 +1327,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
|
|
|
|
|
|
|
|
|
|
|
// nijel: Cut all fields to $GLOBALS['cfg']['LimitChars']
|
|
|
|
// nijel: Cut all fields to $GLOBALS['cfg']['LimitChars']
|
|
|
|
// lem9: (unless it's a link-type transformation)
|
|
|
|
// lem9: (unless it's a link-type transformation)
|
|
|
|
if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && ($dontlimitchars != 1) && !strpos($transform_function, 'link') === true) {
|
|
|
|
if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && ! $_SESSION['userconf']['dontlimitchars'] && !strpos($transform_function, 'link') === true) {
|
|
|
|
$row[$i] = PMA_substr($row[$i], 0, $GLOBALS['cfg']['LimitChars']) . '...';
|
|
|
|
$row[$i] = PMA_substr($row[$i], 0, $GLOBALS['cfg']['LimitChars']) . '...';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@@ -1446,7 +1395,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
|
|
|
|
|
|
|
|
|
|
|
$vertical_display['data'][$row_no][$i] .= '<a href="sql.php?'
|
|
|
|
$vertical_display['data'][$row_no][$i] .= '<a href="sql.php?'
|
|
|
|
. PMA_generate_common_url($map[$meta->name][3], $map[$meta->name][0])
|
|
|
|
. PMA_generate_common_url($map[$meta->name][3], $map[$meta->name][0])
|
|
|
|
. '&pos=0&session_max_rows=' . $session_max_rows . '&dontlimitchars=' . $dontlimitchars
|
|
|
|
. '&pos=0'
|
|
|
|
. '&sql_query=' . urlencode('SELECT * FROM ' . PMA_backquote($map[$meta->name][0]) . ' WHERE ' . PMA_backquote($map[$meta->name][1]) . ' = \'' . PMA_sqlAddslashes($relation_id) . '\'') . '"' . $title . '>'
|
|
|
|
. '&sql_query=' . urlencode('SELECT * FROM ' . PMA_backquote($map[$meta->name][0]) . ' WHERE ' . PMA_backquote($map[$meta->name][1]) . ' = \'' . PMA_sqlAddslashes($relation_id) . '\'') . '"' . $title . '>'
|
|
|
|
. $row[$i] . '</a>';
|
|
|
|
. $row[$i] . '</a>';
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@@ -1459,7 +1408,8 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// lem9: output stored cell
|
|
|
|
// lem9: output stored cell
|
|
|
|
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|
|
|
|
|
|
|
|
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
|
|
|
|
echo $vertical_display['data'][$row_no][$i];
|
|
|
|
echo $vertical_display['data'][$row_no][$i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@@ -1472,12 +1422,14 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
|
|
|
|
|
|
|
|
|
|
|
// 3. Displays the modify/delete links on the right if required
|
|
|
|
// 3. Displays the modify/delete links on the right if required
|
|
|
|
if ($GLOBALS['cfg']['ModifyDeleteAtRight']
|
|
|
|
if ($GLOBALS['cfg']['ModifyDeleteAtRight']
|
|
|
|
&& ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped')) {
|
|
|
|
&& ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|
|
|
|
|
|
|
|
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped')) {
|
|
|
|
$doWriteModifyAt = 'right';
|
|
|
|
$doWriteModifyAt = 'right';
|
|
|
|
require './libraries/display_tbl_links.lib.php';
|
|
|
|
require './libraries/display_tbl_links.lib.php';
|
|
|
|
} // end if (3)
|
|
|
|
} // end if (3)
|
|
|
|
|
|
|
|
|
|
|
|
if ($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|
|
|
|
|
|
|
|
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
|
|
|
|
?>
|
|
|
|
?>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
@@ -1528,7 +1480,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
|
|
|
unset($vertical_display['delete'][$row_no]);
|
|
|
|
unset($vertical_display['delete'][$row_no]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
echo (($disp_direction == 'horizontal' || $disp_direction == 'horizontalflipped') ? "\n" : '');
|
|
|
|
echo (($_SESSION['userconf']['disp_direction'] == 'horizontal' || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') ? "\n" : '');
|
|
|
|
$row_no++;
|
|
|
|
$row_no++;
|
|
|
|
} // end while
|
|
|
|
} // end while
|
|
|
|
|
|
|
|
|
|
|
@@ -1546,9 +1498,8 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return boolean always true
|
|
|
|
* @return boolean always true
|
|
|
|
*
|
|
|
|
*
|
|
|
|
|
|
|
|
* @uses $_SESSION['userconf']['repeat_cells']
|
|
|
|
* @global array $vertical_display the information to display
|
|
|
|
* @global array $vertical_display the information to display
|
|
|
|
* @global integer $repeat_cells the number of row to display between two
|
|
|
|
|
|
|
|
* table headers
|
|
|
|
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @access private
|
|
|
|
* @access private
|
|
|
|
*
|
|
|
|
*
|
|
|
@@ -1556,7 +1507,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function PMA_displayVerticalTable()
|
|
|
|
function PMA_displayVerticalTable()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
global $vertical_display, $repeat_cells;
|
|
|
|
global $vertical_display;
|
|
|
|
|
|
|
|
|
|
|
|
// Displays "multi row delete" link at top if required
|
|
|
|
// Displays "multi row delete" link at top if required
|
|
|
|
if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && is_array($vertical_display['row_delete']) && (count($vertical_display['row_delete']) > 0 || !empty($vertical_display['textbtn']))) {
|
|
|
|
if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && is_array($vertical_display['row_delete']) && (count($vertical_display['row_delete']) > 0 || !empty($vertical_display['textbtn']))) {
|
|
|
@@ -1564,7 +1515,7 @@ function PMA_displayVerticalTable()
|
|
|
|
echo $vertical_display['textbtn'];
|
|
|
|
echo $vertical_display['textbtn'];
|
|
|
|
$foo_counter = 0;
|
|
|
|
$foo_counter = 0;
|
|
|
|
foreach ($vertical_display['row_delete'] as $val) {
|
|
|
|
foreach ($vertical_display['row_delete'] as $val) {
|
|
|
|
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
|
|
|
|
if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
|
|
|
|
echo '<th> </th>' . "\n";
|
|
|
|
echo '<th> </th>' . "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@@ -1582,7 +1533,7 @@ function PMA_displayVerticalTable()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$foo_counter = 0;
|
|
|
|
$foo_counter = 0;
|
|
|
|
foreach ($vertical_display['edit'] as $val) {
|
|
|
|
foreach ($vertical_display['edit'] as $val) {
|
|
|
|
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
|
|
|
|
if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
|
|
|
|
echo ' <th> </th>' . "\n";
|
|
|
|
echo ' <th> </th>' . "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@@ -1600,7 +1551,7 @@ function PMA_displayVerticalTable()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$foo_counter = 0;
|
|
|
|
$foo_counter = 0;
|
|
|
|
foreach ($vertical_display['delete'] as $val) {
|
|
|
|
foreach ($vertical_display['delete'] as $val) {
|
|
|
|
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
|
|
|
|
if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
|
|
|
|
echo '<th> </th>' . "\n";
|
|
|
|
echo '<th> </th>' . "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@@ -1618,7 +1569,7 @@ function PMA_displayVerticalTable()
|
|
|
|
|
|
|
|
|
|
|
|
$foo_counter = 0;
|
|
|
|
$foo_counter = 0;
|
|
|
|
foreach ($vertical_display['rowdata'][$key] as $subval) {
|
|
|
|
foreach ($vertical_display['rowdata'][$key] as $subval) {
|
|
|
|
if (($foo_counter != 0) && ($repeat_cells != 0) and !($foo_counter % $repeat_cells)) {
|
|
|
|
if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) and !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
|
|
|
|
echo $val;
|
|
|
|
echo $val;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@@ -1635,7 +1586,7 @@ function PMA_displayVerticalTable()
|
|
|
|
echo $vertical_display['textbtn'];
|
|
|
|
echo $vertical_display['textbtn'];
|
|
|
|
$foo_counter = 0;
|
|
|
|
$foo_counter = 0;
|
|
|
|
foreach ($vertical_display['row_delete'] as $val) {
|
|
|
|
foreach ($vertical_display['row_delete'] as $val) {
|
|
|
|
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
|
|
|
|
if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
|
|
|
|
echo '<th> </th>' . "\n";
|
|
|
|
echo '<th> </th>' . "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@@ -1653,7 +1604,7 @@ function PMA_displayVerticalTable()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$foo_counter = 0;
|
|
|
|
$foo_counter = 0;
|
|
|
|
foreach ($vertical_display['edit'] as $val) {
|
|
|
|
foreach ($vertical_display['edit'] as $val) {
|
|
|
|
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
|
|
|
|
if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
|
|
|
|
echo '<th> </th>' . "\n";
|
|
|
|
echo '<th> </th>' . "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@@ -1671,7 +1622,7 @@ function PMA_displayVerticalTable()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$foo_counter = 0;
|
|
|
|
$foo_counter = 0;
|
|
|
|
foreach ($vertical_display['delete'] as $val) {
|
|
|
|
foreach ($vertical_display['delete'] as $val) {
|
|
|
|
if (($foo_counter != 0) && ($repeat_cells != 0) && !($foo_counter % $repeat_cells)) {
|
|
|
|
if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
|
|
|
|
echo '<th> </th>' . "\n";
|
|
|
|
echo '<th> </th>' . "\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@@ -1684,6 +1635,96 @@ function PMA_displayVerticalTable()
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
} // end of the 'PMA_displayVerticalTable' function
|
|
|
|
} // end of the 'PMA_displayVerticalTable' function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @uses $_SESSION['userconf']['disp_direction']
|
|
|
|
|
|
|
|
* @uses $_REQUEST['disp_direction']
|
|
|
|
|
|
|
|
* @uses $GLOBALS['cfg']['DefaultDisplay']
|
|
|
|
|
|
|
|
* @uses $_SESSION['userconf']['repeat_cells']
|
|
|
|
|
|
|
|
* @uses $_REQUEST['repeat_cells']
|
|
|
|
|
|
|
|
* @uses $GLOBALS['cfg']['RepeatCells']
|
|
|
|
|
|
|
|
* @uses $_SESSION['userconf']['max_rows']
|
|
|
|
|
|
|
|
* @uses $_REQUEST['session_max_rows']
|
|
|
|
|
|
|
|
* @uses $GLOBALS['cfg']['MaxRows']
|
|
|
|
|
|
|
|
* @uses $_SESSION['userconf']['pos']
|
|
|
|
|
|
|
|
* @uses $_REQUEST['pos']
|
|
|
|
|
|
|
|
* @uses $_SESSION['userconf']['dontlimitchars']
|
|
|
|
|
|
|
|
* @uses $_REQUEST['dontlimitchars']
|
|
|
|
|
|
|
|
* @uses PMA_isValid()
|
|
|
|
|
|
|
|
* @uses $GLOBALS['sql_query']
|
|
|
|
|
|
|
|
* @todo make maximum remembered queries configurable
|
|
|
|
|
|
|
|
* @todo move/split into SQL class!?
|
|
|
|
|
|
|
|
* @todo currently this is called twice unnecessary
|
|
|
|
|
|
|
|
* @todo ignore LIMIT and ORDER in query!?
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
function PMA_displayTable_checkConfigParams()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$sql_key = md5($GLOBALS['sql_query']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$_SESSION['userconf']['query'][$sql_key]['sql'] = $GLOBALS['sql_query'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (PMA_isValid($_REQUEST['disp_direction'], array('horizontal', 'vertical', 'horizontalflipped'))) {
|
|
|
|
|
|
|
|
$_SESSION['userconf']['query'][$sql_key]['disp_direction'] = $_REQUEST['disp_direction'];
|
|
|
|
|
|
|
|
unset($_REQUEST['disp_direction']);
|
|
|
|
|
|
|
|
} elseif (empty($_SESSION['userconf']['query'][$sql_key]['disp_direction'])) {
|
|
|
|
|
|
|
|
$_SESSION['userconf']['query'][$sql_key]['disp_direction'] = $GLOBALS['cfg']['DefaultDisplay'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (PMA_isValid($_REQUEST['repeat_cells'], 'numeric')) {
|
|
|
|
|
|
|
|
$_SESSION['userconf']['query'][$sql_key]['repeat_cells'] = $_REQUEST['repeat_cells'];
|
|
|
|
|
|
|
|
unset($_REQUEST['repeat_cells']);
|
|
|
|
|
|
|
|
} elseif (empty($_SESSION['userconf']['query'][$sql_key]['repeat_cells'])) {
|
|
|
|
|
|
|
|
$_SESSION['userconf']['query'][$sql_key]['repeat_cells'] = $GLOBALS['cfg']['RepeatCells'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (PMA_isValid($_REQUEST['session_max_rows'], 'numeric')) {
|
|
|
|
|
|
|
|
$_SESSION['userconf']['query'][$sql_key]['max_rows'] = $_REQUEST['session_max_rows'];
|
|
|
|
|
|
|
|
unset($_REQUEST['session_max_rows']);
|
|
|
|
|
|
|
|
} elseif (empty($_SESSION['userconf']['query'][$sql_key]['max_rows'])) {
|
|
|
|
|
|
|
|
$_SESSION['userconf']['query'][$sql_key]['max_rows'] = $GLOBALS['cfg']['MaxRows'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (PMA_isValid($_REQUEST['pos'], 'numeric')) {
|
|
|
|
|
|
|
|
$_SESSION['userconf']['query'][$sql_key]['pos'] = $_REQUEST['pos'];
|
|
|
|
|
|
|
|
unset($_REQUEST['pos']);
|
|
|
|
|
|
|
|
} elseif (empty($_SESSION['userconf']['query'][$sql_key]['pos'])) {
|
|
|
|
|
|
|
|
$_SESSION['userconf']['query'][$sql_key]['pos'] = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (PMA_isValid($_REQUEST['dontlimitchars'], array('0', '1'))) {
|
|
|
|
|
|
|
|
$_SESSION['userconf']['query'][$sql_key]['dontlimitchars'] = (int) $_REQUEST['dontlimitchars'];
|
|
|
|
|
|
|
|
unset($_REQUEST['dontlimitchars']);
|
|
|
|
|
|
|
|
} elseif (empty($_SESSION['userconf']['query'][$sql_key]['dontlimitchars'])) {
|
|
|
|
|
|
|
|
$_SESSION['userconf']['query'][$sql_key]['dontlimitchars'] = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// move current query to the last position, to be removed last
|
|
|
|
|
|
|
|
// so only least executed query will be removed if maximum remembered queries
|
|
|
|
|
|
|
|
// limit is reached
|
|
|
|
|
|
|
|
$tmp = $_SESSION['userconf']['query'][$sql_key];
|
|
|
|
|
|
|
|
unset($_SESSION['userconf']['query'][$sql_key]);
|
|
|
|
|
|
|
|
$_SESSION['userconf']['query'][$sql_key] = $tmp;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// do not exceed a maximum number of queries to remember
|
|
|
|
|
|
|
|
if (count($_SESSION['userconf']['query']) > 10) {
|
|
|
|
|
|
|
|
array_shift($_SESSION['userconf']['query']);
|
|
|
|
|
|
|
|
echo 'deleting one element ...';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// populate query configuration
|
|
|
|
|
|
|
|
$_SESSION['userconf']['dontlimitchars'] = $_SESSION['userconf']['query'][$sql_key]['dontlimitchars'];
|
|
|
|
|
|
|
|
$_SESSION['userconf']['pos'] = $_SESSION['userconf']['query'][$sql_key]['pos'];
|
|
|
|
|
|
|
|
$_SESSION['userconf']['max_rows'] = $_SESSION['userconf']['query'][$sql_key]['max_rows'];
|
|
|
|
|
|
|
|
$_SESSION['userconf']['repeat_cells'] = $_SESSION['userconf']['query'][$sql_key]['repeat_cells'];
|
|
|
|
|
|
|
|
$_SESSION['userconf']['disp_direction'] = $_SESSION['userconf']['query'][$sql_key]['disp_direction'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
* debugging
|
|
|
|
|
|
|
|
echo '<pre>';
|
|
|
|
|
|
|
|
var_dump($_SESSION['userconf']);
|
|
|
|
|
|
|
|
echo '</pre>';
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Displays a table of results returned by a SQL query.
|
|
|
|
* Displays a table of results returned by a SQL query.
|
|
|
@@ -1694,29 +1735,22 @@ function PMA_displayVerticalTable()
|
|
|
|
* @param array the display mode
|
|
|
|
* @param array the display mode
|
|
|
|
* @param array the analyzed query
|
|
|
|
* @param array the analyzed query
|
|
|
|
*
|
|
|
|
*
|
|
|
|
|
|
|
|
* @uses $_SESSION['userconf']['pos']
|
|
|
|
* @global string $db the database name
|
|
|
|
* @global string $db the database name
|
|
|
|
* @global string $table the table name
|
|
|
|
* @global string $table the table name
|
|
|
|
* @global string $goto the URL to go back in case of errors
|
|
|
|
* @global string $goto the URL to go back in case of errors
|
|
|
|
* @global boolean $dontlimitchars whether to limit the number of displayed
|
|
|
|
* @global string $sql_query the current SQL query
|
|
|
|
* characters of text type fields or not
|
|
|
|
|
|
|
|
* @global string $sql_query the current sql query
|
|
|
|
|
|
|
|
* @global integer $num_rows the total number of rows returned by the
|
|
|
|
* @global integer $num_rows the total number of rows returned by the
|
|
|
|
* SQL query
|
|
|
|
* SQL query
|
|
|
|
* @global integer $unlim_num_rows the total number of rows returned by the
|
|
|
|
* @global integer $unlim_num_rows the total number of rows returned by the
|
|
|
|
* SQL query without any programmatically
|
|
|
|
* SQL query without any programmatically
|
|
|
|
* appended "LIMIT" clause
|
|
|
|
* appended "LIMIT" clause
|
|
|
|
* @global integer $pos the current postion of the first record
|
|
|
|
|
|
|
|
* to be displayed
|
|
|
|
|
|
|
|
* @global array $fields_meta the list of fields properties
|
|
|
|
* @global array $fields_meta the list of fields properties
|
|
|
|
* @global integer $fields_cnt the total number of fields returned by
|
|
|
|
* @global integer $fields_cnt the total number of fields returned by
|
|
|
|
* the SQL query
|
|
|
|
* the SQL query
|
|
|
|
* @global array $vertical_display informations used with vertical display
|
|
|
|
* @global array $vertical_display informations used with vertical display
|
|
|
|
* mode
|
|
|
|
* mode
|
|
|
|
* @global string $disp_direction the display mode
|
|
|
|
* @global array $highlight_columns column names to highlight
|
|
|
|
* (horizontal/vertical/horizontalflipped)
|
|
|
|
|
|
|
|
* @global integer $repeat_cells the number of row to display between two
|
|
|
|
|
|
|
|
* table headers
|
|
|
|
|
|
|
|
* @global array $highlight_columns collumn names to highlight
|
|
|
|
|
|
|
|
* @global array $cfgRelation the relation settings
|
|
|
|
* @global array $cfgRelation the relation settings
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @access private
|
|
|
|
* @access private
|
|
|
@@ -1727,12 +1761,14 @@ function PMA_displayVerticalTable()
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
|
|
|
|
function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
global $db, $table, $goto, $dontlimitchars;
|
|
|
|
global $db, $table, $goto;
|
|
|
|
global $sql_query, $num_rows, $unlim_num_rows, $pos, $fields_meta, $fields_cnt;
|
|
|
|
global $sql_query, $num_rows, $unlim_num_rows, $fields_meta, $fields_cnt;
|
|
|
|
global $vertical_display, $disp_direction, $repeat_cells, $highlight_columns;
|
|
|
|
global $vertical_display, $highlight_columns;
|
|
|
|
global $cfgRelation;
|
|
|
|
global $cfgRelation;
|
|
|
|
global $showtable;
|
|
|
|
global $showtable;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PMA_displayTable_checkConfigParams();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @todo move this to a central place
|
|
|
|
* @todo move this to a central place
|
|
|
|
* @todo for other future table types
|
|
|
|
* @todo for other future table types
|
|
|
@@ -1766,15 +1802,12 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
|
|
|
|
|
|
|
|
|
|
|
|
// 1.2 Defines offsets for the next and previous pages
|
|
|
|
// 1.2 Defines offsets for the next and previous pages
|
|
|
|
if ($is_display['nav_bar'] == '1') {
|
|
|
|
if ($is_display['nav_bar'] == '1') {
|
|
|
|
if (!isset($pos)) {
|
|
|
|
if ($_SESSION['userconf']['max_rows'] == 'all') {
|
|
|
|
$pos = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($GLOBALS['session_max_rows'] == 'all') {
|
|
|
|
|
|
|
|
$pos_next = 0;
|
|
|
|
$pos_next = 0;
|
|
|
|
$pos_prev = 0;
|
|
|
|
$pos_prev = 0;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$pos_next = $pos + $GLOBALS['cfg']['MaxRows'];
|
|
|
|
$pos_next = $_SESSION['userconf']['pos'] + $_SESSION['userconf']['max_rows'];
|
|
|
|
$pos_prev = $pos - $GLOBALS['cfg']['MaxRows'];
|
|
|
|
$pos_prev = $_SESSION['userconf']['pos'] - $_SESSION['userconf']['max_rows'];
|
|
|
|
if ($pos_prev < 0) {
|
|
|
|
if ($pos_prev < 0) {
|
|
|
|
$pos_prev = 0;
|
|
|
|
$pos_prev = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
@@ -1793,10 +1826,10 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$selectstring = '';
|
|
|
|
$selectstring = '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$last_shown_rec = ($GLOBALS['session_max_rows'] == 'all' || $pos_next > $total)
|
|
|
|
$last_shown_rec = ($_SESSION['userconf']['max_rows'] == 'all' || $pos_next > $total)
|
|
|
|
? $total - 1
|
|
|
|
? $total - 1
|
|
|
|
: $pos_next - 1;
|
|
|
|
: $pos_next - 1;
|
|
|
|
PMA_showMessage($GLOBALS['strShowingRecords'] . " $pos - $last_shown_rec (" . $pre_count . PMA_formatNumber($total, 0) . $after_count . ' ' . $GLOBALS['strTotal'] . $selectstring . ', ' . sprintf($GLOBALS['strQueryTime'], $GLOBALS['querytime']) . ')');
|
|
|
|
PMA_showMessage($GLOBALS['strShowingRecords'] . ' ' . $_SESSION['userconf']['pos'] . ' - ' . $last_shown_rec . ' (' . $pre_count . PMA_formatNumber($total, 0) . $after_count . ' ' . $GLOBALS['strTotal'] . $selectstring . ', ' . sprintf($GLOBALS['strQueryTime'], $GLOBALS['querytime']) . ')');
|
|
|
|
|
|
|
|
|
|
|
|
if (PMA_Table::isView($db, $table) && $total == $GLOBALS['cfg']['MaxExactCount']) {
|
|
|
|
if (PMA_Table::isView($db, $table) && $total == $GLOBALS['cfg']['MaxExactCount']) {
|
|
|
|
echo '<div class="notice">' . "\n";
|
|
|
|
echo '<div class="notice">' . "\n";
|
|
|
@@ -1876,7 +1909,7 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
|
|
|
|
PMA_displayTableBody($dt_result, $is_display, $map, $analyzed_sql);
|
|
|
|
PMA_displayTableBody($dt_result, $is_display, $map, $analyzed_sql);
|
|
|
|
echo '</tbody>' . "\n";
|
|
|
|
echo '</tbody>' . "\n";
|
|
|
|
// vertical output case
|
|
|
|
// vertical output case
|
|
|
|
if ($disp_direction == 'vertical') {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'vertical') {
|
|
|
|
PMA_displayVerticalTable();
|
|
|
|
PMA_displayVerticalTable();
|
|
|
|
} // end if
|
|
|
|
} // end if
|
|
|
|
unset($vertical_display);
|
|
|
|
unset($vertical_display);
|
|
|
@@ -1893,16 +1926,10 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
|
|
|
|
$uncheckall_url = 'sql.php?'
|
|
|
|
$uncheckall_url = 'sql.php?'
|
|
|
|
. PMA_generate_common_url($db, $table)
|
|
|
|
. PMA_generate_common_url($db, $table)
|
|
|
|
. '&sql_query=' . urlencode($sql_query)
|
|
|
|
. '&sql_query=' . urlencode($sql_query)
|
|
|
|
. '&pos=' . $pos
|
|
|
|
. '&goto=' . $goto;
|
|
|
|
. '&session_max_rows=' . $GLOBALS['session_max_rows']
|
|
|
|
|
|
|
|
. '&pos=' . $pos
|
|
|
|
|
|
|
|
. '&disp_direction=' . $disp_direction
|
|
|
|
|
|
|
|
. '&repeat_cells=' . $repeat_cells
|
|
|
|
|
|
|
|
. '&goto=' . $goto
|
|
|
|
|
|
|
|
. '&dontlimitchars=' . $dontlimitchars;
|
|
|
|
|
|
|
|
$checkall_url = $uncheckall_url . '&checkall=1';
|
|
|
|
$checkall_url = $uncheckall_url . '&checkall=1';
|
|
|
|
|
|
|
|
|
|
|
|
if ($disp_direction == 'vertical') {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] == 'vertical') {
|
|
|
|
$checkall_params['onclick'] = 'if (setCheckboxes(\'rowsDeleteForm\', true)) return false;';
|
|
|
|
$checkall_params['onclick'] = 'if (setCheckboxes(\'rowsDeleteForm\', true)) return false;';
|
|
|
|
$uncheckall_params['onclick'] = 'if (setCheckboxes(\'rowsDeleteForm\', false)) return false;';
|
|
|
|
$uncheckall_params['onclick'] = 'if (setCheckboxes(\'rowsDeleteForm\', false)) return false;';
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@@ -1911,7 +1938,7 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$checkall_link = PMA_linkOrButton($checkall_url, $GLOBALS['strCheckAll'], $checkall_params, false);
|
|
|
|
$checkall_link = PMA_linkOrButton($checkall_url, $GLOBALS['strCheckAll'], $checkall_params, false);
|
|
|
|
$uncheckall_link = PMA_linkOrButton($uncheckall_url, $GLOBALS['strUncheckAll'], $uncheckall_params, false);
|
|
|
|
$uncheckall_link = PMA_linkOrButton($uncheckall_url, $GLOBALS['strUncheckAll'], $uncheckall_params, false);
|
|
|
|
if ($disp_direction != 'vertical') {
|
|
|
|
if ($_SESSION['userconf']['disp_direction'] != 'vertical') {
|
|
|
|
echo '<img class="selectallarrow" width="38" height="22"'
|
|
|
|
echo '<img class="selectallarrow" width="38" height="22"'
|
|
|
|
.' src="' . $GLOBALS['pmaThemeImage'] . 'arrow_' . $GLOBALS['text_dir'] . '.png' . '"'
|
|
|
|
.' src="' . $GLOBALS['pmaThemeImage'] . 'arrow_' . $GLOBALS['text_dir'] . '.png' . '"'
|
|
|
|
.' alt="' . $GLOBALS['strWithChecked'] . '" />';
|
|
|
|
.' alt="' . $GLOBALS['strWithChecked'] . '" />';
|
|
|
@@ -1947,7 +1974,6 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo '<input type="hidden" name="sql_query"'
|
|
|
|
echo '<input type="hidden" name="sql_query"'
|
|
|
|
.' value="' . htmlspecialchars($sql_query) . '" />' . "\n";
|
|
|
|
.' value="' . htmlspecialchars($sql_query) . '" />' . "\n";
|
|
|
|
echo '<input type="hidden" name="pos" value="' . $pos . '" />' . "\n";
|
|
|
|
|
|
|
|
echo '<input type="hidden" name="url_query"'
|
|
|
|
echo '<input type="hidden" name="url_query"'
|
|
|
|
.' value="' . $GLOBALS['url_query'] . '" />' . "\n";
|
|
|
|
.' value="' . $GLOBALS['url_query'] . '" />' . "\n";
|
|
|
|
echo '</form>' . "\n";
|
|
|
|
echo '</form>' . "\n";
|
|
|
@@ -1978,20 +2004,14 @@ function default_function($buffer) {
|
|
|
|
* @param array the display mode
|
|
|
|
* @param array the display mode
|
|
|
|
* @param array the analyzed query
|
|
|
|
* @param array the analyzed query
|
|
|
|
*
|
|
|
|
*
|
|
|
|
|
|
|
|
* @uses $_SESSION['userconf']['pos']
|
|
|
|
|
|
|
|
* @uses $_SESSION['userconf']['dontlimitchars']
|
|
|
|
* @global string $db the database name
|
|
|
|
* @global string $db the database name
|
|
|
|
* @global string $table the table name
|
|
|
|
* @global string $table the table name
|
|
|
|
* @global boolean $dontlimitchars whether to limit the number of displayed
|
|
|
|
|
|
|
|
* characters of text type fields or not
|
|
|
|
|
|
|
|
* @global integer $pos the current postion of the first record
|
|
|
|
|
|
|
|
* to be displayed
|
|
|
|
|
|
|
|
* @global string $sql_query the current SQL query
|
|
|
|
* @global string $sql_query the current SQL query
|
|
|
|
* @global integer $unlim_num_rows the total number of rows returned by the
|
|
|
|
* @global integer $unlim_num_rows the total number of rows returned by the
|
|
|
|
* SQL query without any programmatically
|
|
|
|
* SQL query without any programmatically
|
|
|
|
* appended "LIMIT" clause
|
|
|
|
* appended "LIMIT" clause
|
|
|
|
* @global string $disp_direction the display mode
|
|
|
|
|
|
|
|
* (horizontal/vertical/horizontalflipped)
|
|
|
|
|
|
|
|
* @global integer $repeat_cells the number of row to display between two
|
|
|
|
|
|
|
|
* table headers
|
|
|
|
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @access private
|
|
|
|
* @access private
|
|
|
|
*
|
|
|
|
*
|
|
|
@@ -2000,7 +2020,7 @@ function default_function($buffer) {
|
|
|
|
* PMA_displayTableBody(), PMA_displayResultsOperations()
|
|
|
|
* PMA_displayTableBody(), PMA_displayResultsOperations()
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) {
|
|
|
|
function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) {
|
|
|
|
global $db, $table, $dontlimitchars, $pos, $sql_query, $unlim_num_rows, $disp_direction, $repeat_cells;
|
|
|
|
global $db, $table, $sql_query, $unlim_num_rows;
|
|
|
|
|
|
|
|
|
|
|
|
$header_shown = FALSE;
|
|
|
|
$header_shown = FALSE;
|
|
|
|
$header = '<fieldset><legend>' . $GLOBALS['strQueryResultsOperations'] . '</legend>';
|
|
|
|
$header = '<fieldset><legend>' . $GLOBALS['strQueryResultsOperations'] . '</legend>';
|
|
|
@@ -2016,19 +2036,15 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) {
|
|
|
|
|
|
|
|
|
|
|
|
$url_query = '?'
|
|
|
|
$url_query = '?'
|
|
|
|
. PMA_generate_common_url($db, $table)
|
|
|
|
. PMA_generate_common_url($db, $table)
|
|
|
|
. '&pos=' . $pos
|
|
|
|
|
|
|
|
. '&session_max_rows=' . $GLOBALS['session_max_rows']
|
|
|
|
|
|
|
|
. '&disp_direction=' . $disp_direction
|
|
|
|
|
|
|
|
. '&repeat_cells=' . $repeat_cells
|
|
|
|
|
|
|
|
. '&printview=1'
|
|
|
|
. '&printview=1'
|
|
|
|
. '&sql_query=' . urlencode($sql_query);
|
|
|
|
. '&sql_query=' . urlencode($sql_query);
|
|
|
|
echo ' <!-- Print view -->' . "\n";
|
|
|
|
echo ' <!-- Print view -->' . "\n";
|
|
|
|
echo PMA_linkOrButton(
|
|
|
|
echo PMA_linkOrButton(
|
|
|
|
'sql.php' . $url_query . ((isset($dontlimitchars) && $dontlimitchars == '1') ? '&dontlimitchars=1' : ''),
|
|
|
|
'sql.php' . $url_query,
|
|
|
|
($GLOBALS['cfg']['PropertiesIconic'] ? '<img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_print.png" height="16" width="16" alt="' . $GLOBALS['strPrintView'] . '"/>' : '') . $GLOBALS['strPrintView'],
|
|
|
|
($GLOBALS['cfg']['PropertiesIconic'] ? '<img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_print.png" height="16" width="16" alt="' . $GLOBALS['strPrintView'] . '"/>' : '') . $GLOBALS['strPrintView'],
|
|
|
|
'', true, true, 'print_view') . "\n";
|
|
|
|
'', true, true, 'print_view') . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
if (!$dontlimitchars) {
|
|
|
|
if (! $_SESSION['userconf']['dontlimitchars']) {
|
|
|
|
echo ' ' . "\n";
|
|
|
|
echo ' ' . "\n";
|
|
|
|
echo PMA_linkOrButton(
|
|
|
|
echo PMA_linkOrButton(
|
|
|
|
'sql.php' . $url_query . '&dontlimitchars=1',
|
|
|
|
'sql.php' . $url_query . '&dontlimitchars=1',
|
|
|
|