';
} else {
$iconic_spacer = '';
}
// 1.2.1 Modify link(s)
if ($is_display['edit_lnk'] == 'ur') { // update row case
$_url_params = array(
'db' => $db,
'table' => $table,
'where_clause' => $where_clause,
'clause_is_unique' => $clause_is_unique,
'sql_query' => $url_sql_query,
'goto' => 'sql.php',
);
$edit_url = 'tbl_change.php' . PMA_generate_common_url($_url_params);
$edit_str = PMA_getIcon('b_edit.png', $GLOBALS['strEdit'], true);
} // end if (1.2.1)
if (isset($GLOBALS['cfg']['Bookmark']['table']) && isset($GLOBALS['cfg']['Bookmark']['db']) && $table == $GLOBALS['cfg']['Bookmark']['table'] && $db == $GLOBALS['cfg']['Bookmark']['db'] && isset($row[1]) && isset($row[0])) {
$_url_params = array(
'db' => $row[1],
'id_bookmark' => $row[0],
'action_bookmark' => '0',
'action_bookmark_all' => '1',
'SQL' => $GLOBALS['strExecuteBookmarked'],
);
$bookmark_go = '
';
$bookmark_go .= PMA_getIcon('b_bookmark.png', $GLOBALS['strExecuteBookmarked'], true);
$bookmark_go .= '';
} else {
$bookmark_go = '';
}
// 1.2.2 Delete/Kill link(s)
if ($is_display['del_lnk'] == 'dr') { // delete row case
$_url_params = array(
'db' => $db,
'table' => $table,
'sql_query' => $url_sql_query,
'zero_rows' => $GLOBALS['strDeleted'],
'goto' => (empty($goto) ? 'tbl_sql.php' : $goto),
);
$lnk_goto = 'sql.php' . PMA_generate_common_url($_url_params, 'text');
$del_query = 'DELETE FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table)
. ' WHERE ' . $where_clause . ($clause_is_unique ? '' : ' LIMIT 1');
$_url_params = array(
'db' => $db,
'table' => $table,
'sql_query' => $del_query,
'zero_rows' => $GLOBALS['strDeleted'],
'goto' => $lnk_goto,
);
$del_url = 'sql.php' . PMA_generate_common_url($_url_params);
$js_conf = 'DELETE FROM ' . PMA_jsFormat($db) . '.' . PMA_jsFormat($table)
. ' WHERE ' . PMA_jsFormat($where_clause, false)
. ($clause_is_unique ? '' : ' LIMIT 1');
$del_str = PMA_getIcon('b_drop.png', $GLOBALS['strDelete'], true);
} elseif ($is_display['del_lnk'] == 'kp') { // kill process case
$_url_params = array(
'db' => $db,
'table' => $table,
'sql_query' => $url_sql_query,
'goto' => 'main.php',
);
$lnk_goto = 'sql.php' . PMA_generate_common_url($_url_params, 'text');
$_url_params = array(
'db' => 'mysql',
'sql_query' => 'KILL ' . $row[0],
'goto' => $lnk_goto,
);
$del_url = 'sql.php' . PMA_generate_common_url($_url_params);
$del_query = 'KILL ' . $row[0];
$js_conf = 'KILL ' . $row[0];
$del_str = PMA_getIcon('b_drop.png', $GLOBALS['strKill'], true);
} // end if (1.2.2)
// 1.3 Displays the links at left if required
if ($GLOBALS['cfg']['ModifyDeleteAtLeft']
&& ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')) {
$doWriteModifyAt = 'left';
require './libraries/display_tbl_links.lib.php';
} // end if (1.3)
} // end if (1)
// 2. Displays the rows' values
for ($i = 0; $i < $fields_cnt; ++$i) {
$meta = $fields_meta[$i];
$pointer = $i;
// garvin: See if this column should get highlight because it's used in the
// where-query.
if (isset($highlight_columns) && (isset($highlight_columns[$meta->name]) || isset($highlight_columns[PMA_backquote($meta->name)]))) {
$condition_field = true;
} else {
$condition_field = false;
}
$mouse_events = '';
if ($_SESSION['tmp_user_values']['disp_direction'] == 'vertical' && (!isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1'))) {
if ($GLOBALS['cfg']['BrowsePointerEnable'] == true) {
$mouse_events .= ' onmouseover="setVerticalPointer(this, ' . $row_no . ', \'over\', \'odd\', \'even\', \'hover\', \'marked\');"'
. ' onmouseout="setVerticalPointer(this, ' . $row_no . ', \'out\', \'odd\', \'even\', \'hover\', \'marked\');" ';
}
if ($GLOBALS['cfg']['BrowseMarkerEnable'] == true) {
$mouse_events .= ' onmousedown="setVerticalPointer(this, ' . $row_no . ', \'click\', \'odd\', \'even\', \'hover\', \'marked\'); setCheckboxColumn(\'id_rows_to_delete' . $row_no . '\');" ';
} else {
$mouse_events .= ' onmousedown="setCheckboxColumn(\'id_rows_to_delete' . $row_no . '\');" ';
}
}// end if
// garvin: Wrap MIME-transformations. [MIME]
$default_function = 'default_function'; // default_function
$transform_function = $default_function;
$transform_options = array();
if ($GLOBALS['cfgRelation']['mimework'] && $GLOBALS['cfg']['BrowseMIME']) {
if (isset($GLOBALS['mime_map'][$meta->name]['mimetype']) && isset($GLOBALS['mime_map'][$meta->name]['transformation']) && !empty($GLOBALS['mime_map'][$meta->name]['transformation'])) {
$include_file = PMA_securePath($GLOBALS['mime_map'][$meta->name]['transformation']);
if (file_exists('./libraries/transformations/' . $include_file)) {
$transformfunction_name = str_replace('.inc.php', '', $GLOBALS['mime_map'][$meta->name]['transformation']);
require_once './libraries/transformations/' . $include_file;
if (function_exists('PMA_transformation_' . $transformfunction_name)) {
$transform_function = 'PMA_transformation_' . $transformfunction_name;
$transform_options = PMA_transformation_getOptions((isset($GLOBALS['mime_map'][$meta->name]['transformation_options']) ? $GLOBALS['mime_map'][$meta->name]['transformation_options'] : ''));
$meta->mimetype = str_replace('_', '/', $GLOBALS['mime_map'][$meta->name]['mimetype']);
}
} // end if file_exists
} // end if transformation is set
} // end if mime/transformation works.
$_url_params = array(
'db' => $db,
'table' => $table,
'where_clause' => $where_clause,
'transform_key' => $meta->name,
);
if (! empty($sql_query)) {
$_url_params['sql_query'] = $url_sql_query;
}
$transform_options['wrapper_link'] = PMA_generate_common_url($_url_params);
// n u m e r i c
if ($meta->numeric == 1) {
// lem9: if two fields have the same name (this is possible
// with self-join queries, for example), using $meta->name
// will show both fields NULL even if only one is NULL,
// so use the $pointer
if (!isset($row[$i]) || is_null($row[$i])) {
$vertical_display['data'][$row_no][$i] = '
NULL | ' . "\n";
} elseif ($row[$i] != '') {
$nowrap = ' nowrap';
$where_comparison = ' = ' . $row[$i];
$vertical_display['data'][$row_no][$i] = '
| ' . "\n";
}
// b l o b
} elseif (stristr($meta->type, 'BLOB')) {
// loic1 : PMA_mysql_fetch_fields returns BLOB in place of
// TEXT fields type so we have to ensure it's really a BLOB
$field_flags = PMA_DBI_field_flags($dt_result, $i);
if (stristr($field_flags, 'BINARY')) {
// rajk - for blobstreaming
$bs_reference_exists = $allBSTablesExist = FALSE;
// load PMA configuration
$PMA_Config = $_SESSION['PMA_Config'];
// if PMA configuration exists
if ($PMA_Config) {
// load BS variables
$pluginsExist = $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST');
// if BS plugins exist
if ($pluginsExist) {
// load BS databases
$bs_tables = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');
// if BS db array and specified db string not empty and valid
if (!empty($bs_tables) && strlen($db) > 0) {
$bs_tables = $bs_tables[$db];
if (isset($bs_tables)) {
$allBSTablesExist = TRUE;
// check if BS tables exist for given database
foreach ($bs_tables as $table_key=>$bs_tbl)
if (!$bs_tables[$table_key]['Exists']) {
$allBSTablesExist = FALSE;
break;
}
}
}
}
}
// if necessary BS tables exist
if ($allBSTablesExist) {
$bs_reference_exists = PMA_BS_ReferenceExists($row[$i], $db);
}
// if valid BS reference exists
if ($bs_reference_exists) {
$blobtext = PMA_BS_CreateReferenceLink($row[$i], $db);
} else {
$blobtext = PMA_handle_non_printable_contents('BLOB', (isset($row[$i]) ? $row[$i] : ''), $transform_function, $transform_options, $default_function, $meta);
}
$vertical_display['data'][$row_no][$i] = '
' . $blobtext . ' | ';
unset($blobtext);
// not binary:
} else {
if (!isset($row[$i]) || is_null($row[$i])) {
$vertical_display['data'][$row_no][$i] = '
NULL | ' . "\n";
} elseif ($row[$i] != '') {
// garvin: if a transform function for blob is set, none of these replacements will be made
if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && $_SESSION['tmp_user_values']['display_text'] == 'P') {
$row[$i] = PMA_substr($row[$i], 0, $GLOBALS['cfg']['LimitChars']) . '...';
}
// loic1: displays all space characters, 4 space
// characters for tabulations and
/
$row[$i] = ($default_function != $transform_function ? $transform_function($row[$i], $transform_options, $meta) : $default_function($row[$i], array(), $meta));
$vertical_display['data'][$row_no][$i] = ' ' . $row[$i] . ' | ' . "\n";
} else {
$vertical_display['data'][$row_no][$i] = ' | ' . "\n";
}
}
// n o t n u m e r i c a n d n o t B L O B
} else {
if (!isset($row[$i]) || is_null($row[$i])) {
$vertical_display['data'][$row_no][$i] = ' NULL | ' . "\n";
} elseif ($row[$i] != '') {
// loic1: support blanks in the key
$relation_id = $row[$i];
// nijel: Cut all fields to $GLOBALS['cfg']['LimitChars']
// lem9: (unless it's a link-type transformation)
if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && $_SESSION['tmp_user_values']['display_text'] == 'P' && !strpos($transform_function, 'link') === true) {
$row[$i] = PMA_substr($row[$i], 0, $GLOBALS['cfg']['LimitChars']) . '...';
}
// loic1: displays special characters from binaries
$field_flags = PMA_DBI_field_flags($dt_result, $i);
if (isset($meta->_type) && $meta->_type === MYSQLI_TYPE_BIT) {
$row[$i] = PMA_printable_bit_value($row[$i], $meta->length);
// some results of PROCEDURE ANALYSE() are reported as
// being BINARY but they are quite readable,
// so don't treat them as BINARY
} elseif (stristr($field_flags, 'BINARY') && $meta->type == 'string' && !(isset($GLOBALS['is_analyse']) && $GLOBALS['is_analyse'])) {
if ($_SESSION['tmp_user_values']['display_binary']) {
// user asked to see the real contents of BINARY
// fields
if ($_SESSION['tmp_user_values']['display_binary_as_hex'] && PMA_contains_nonprintable_ascii($row[$i])) {
$row[$i] = bin2hex($row[$i]);
}
else {
$row[$i] = htmlspecialchars(PMA_replace_binary_contents($row[$i]));
}
} else {
// we show the BINARY message and field's size
// (or maybe use a transformation)
$row[$i] = PMA_handle_non_printable_contents('BINARY', $row[$i], $transform_function, $transform_options, $default_function, $meta);
}
}
// garvin: transform functions may enable no-wrapping:
$function_nowrap = $transform_function . '_nowrap';
$bool_nowrap = (($default_function != $transform_function && function_exists($function_nowrap)) ? $function_nowrap($transform_options) : false);
// loic1: do not wrap if date field type
$nowrap = ((preg_match('@DATE|TIME@i', $meta->type) || $bool_nowrap) ? ' nowrap' : '');
$where_comparison = ' = \'' . PMA_sqlAddslashes($row[$i]) . '\'';
$vertical_display['data'][$row_no][$i] = ' | ' . "\n";
}
}
// lem9: output stored cell
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
echo $vertical_display['data'][$row_no][$i];
}
if (isset($vertical_display['rowdata'][$i][$row_no])) {
$vertical_display['rowdata'][$i][$row_no] .= $vertical_display['data'][$row_no][$i];
} else {
$vertical_display['rowdata'][$i][$row_no] = $vertical_display['data'][$row_no][$i];
}
} // end for (2)
// 3. Displays the modify/delete links on the right if required
if ($GLOBALS['cfg']['ModifyDeleteAtRight']
&& ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')) {
$doWriteModifyAt = 'right';
require './libraries/display_tbl_links.lib.php';
} // end if (3)
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
?>