本文整理汇总了PHP中PMA_printable_bit_value函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_printable_bit_value函数的具体用法?PHP PMA_printable_bit_value怎么用?PHP PMA_printable_bit_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_printable_bit_value函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
echo $field['pma_type'];
?>
</td>
<?php
// Prepares the field value
$real_null_value = FALSE;
$special_chars_encoded = '';
if (isset($vrow)) {
if (is_null($vrow[$field['Field']])) {
$real_null_value = TRUE;
$vrow[$field['Field']] = '';
$special_chars = '';
$data = $vrow[$field['Field']];
} elseif ($field['True_Type'] == 'bit') {
$special_chars = PMA_printable_bit_value($vrow[$field['Field']], $extracted_fieldspec['spec_in_brackets']);
} else {
// loic1: special binary "characters"
if ($field['is_binary'] || $field['is_blob'] && !$cfg['ProtectBinary']) {
if ($_SESSION['tmp_user_values']['display_binary_as_hex'] && $cfg['ShowFunctionFields']) {
$vrow[$field['Field']] = bin2hex($vrow[$field['Field']]);
$field['display_binary_as_hex'] = true;
} else {
$vrow[$field['Field']] = PMA_replace_binary_contents($vrow[$field['Field']]);
}
}
// end if
$special_chars = htmlspecialchars($vrow[$field['Field']]);
//We need to duplicate the first \n or otherwise we will lose the first newline entered in a VARCHAR or TEXT column
$special_chars_encoded = PMA_duplicateFirstNewline($special_chars);
$data = $vrow[$field['Field']];
示例2: PMA_displayTableBody
//.........这里部分代码省略.........
unset($blobtext);
// not binary:
} else {
if (!isset($row[$i]) || is_null($row[$i])) {
$vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\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 <cr>/<lf>
$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] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '">' . $row[$i] . '</td>' . "\n";
} else {
$vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"> </td>' . "\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] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\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);
} elseif (stristr($field_flags, 'BINARY') && $meta->type == 'string') {
if ($_SESSION['tmp_user_values']['display_binary'] || isset($GLOBALS['is_analyse']) && $GLOBALS['is_analyse']) {
// user asked to see the real contents of BINARY
// fields, or we detected a PROCEDURE ANALYSE in
// the query (results are reported as being
// binary strings)
if ($_SESSION['tmp_user_values']['display_binary_as_hex']) {
$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] = '<td ' . PMA_prepare_row_data($mouse_events, $class, $condition_field, $analyzed_sql, $meta, $map, $row[$i], $transform_function, $default_function, $nowrap, $where_comparison, $transform_options);
} else {
$vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"> </td>' . "\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];
}
示例3: PMA_getUniqueCondition
/**
* Function to generate unique condition for specified row.
*
* @param resource $handle current query result
* @param integer $fields_cnt number of fields
* @param array $fields_meta meta information about fields
* @param array $row current row
* @param boolean $force_unique generate condition only on pk or unique
*
* @access public
*
* @return array the calculated condition and whether condition is unique
*/
function PMA_getUniqueCondition($handle, $fields_cnt, $fields_meta, $row, $force_unique = false)
{
$primary_key = '';
$unique_key = '';
$nonprimary_condition = '';
$preferred_condition = '';
$primary_key_array = array();
$unique_key_array = array();
$nonprimary_condition_array = array();
$condition_array = array();
for ($i = 0; $i < $fields_cnt; ++$i) {
$condition = '';
$con_key = '';
$con_val = '';
$field_flags = PMA_DBI_field_flags($handle, $i);
$meta = $fields_meta[$i];
// do not use a column alias in a condition
if (!isset($meta->orgname) || !strlen($meta->orgname)) {
$meta->orgname = $meta->name;
if (isset($GLOBALS['analyzed_sql'][0]['select_expr']) && is_array($GLOBALS['analyzed_sql'][0]['select_expr'])) {
foreach ($GLOBALS['analyzed_sql'][0]['select_expr'] as $select_expr) {
// need (string) === (string)
// '' !== 0 but '' == 0
if ((string) $select_expr['alias'] === (string) $meta->name) {
$meta->orgname = $select_expr['column'];
break;
}
// end if
}
// end foreach
}
}
// Do not use a table alias in a condition.
// Test case is:
// select * from galerie x WHERE
//(select count(*) from galerie y where y.datum=x.datum)>1
//
// But orgtable is present only with mysqli extension so the
// fix is only for mysqli.
// Also, do not use the original table name if we are dealing with
// a view because this view might be updatable.
// (The isView() verification should not be costly in most cases
// because there is some caching in the function).
if (isset($meta->orgtable) && $meta->table != $meta->orgtable && !PMA_Table::isView($GLOBALS['db'], $meta->table)) {
$meta->table = $meta->orgtable;
}
// to fix the bug where float fields (primary or not)
// can't be matched because of the imprecision of
// floating comparison, use CONCAT
// (also, the syntax "CONCAT(field) IS NULL"
// that we need on the next "if" will work)
if ($meta->type == 'real') {
$con_key = 'CONCAT(' . PMA_backquote($meta->table) . '.' . PMA_backquote($meta->orgname) . ')';
} else {
$con_key = PMA_backquote($meta->table) . '.' . PMA_backquote($meta->orgname);
}
// end if... else...
$condition = ' ' . $con_key . ' ';
if (!isset($row[$i]) || is_null($row[$i])) {
$con_val = 'IS NULL';
} else {
// timestamp is numeric on some MySQL 4.1
// for real we use CONCAT above and it should compare to string
if ($meta->numeric && $meta->type != 'timestamp' && $meta->type != 'real') {
$con_val = '= ' . $row[$i];
} elseif (($meta->type == 'blob' || $meta->type == 'string') && stristr($field_flags, 'BINARY') && !empty($row[$i])) {
// do not waste memory building a too big condition
if (strlen($row[$i]) < 1000) {
// use a CAST if possible, to avoid problems
// if the field contains wildcard characters % or _
$con_val = '= CAST(0x' . bin2hex($row[$i]) . ' AS BINARY)';
} else {
// this blob won't be part of the final condition
$con_val = null;
}
} elseif (in_array($meta->type, PMA_getGISDatatypes()) && !empty($row[$i])) {
// do not build a too big condition
if (strlen($row[$i]) < 5000) {
$condition .= '=0x' . bin2hex($row[$i]) . ' AND';
} else {
$condition = '';
}
} elseif ($meta->type == 'bit') {
$con_val = "= b'" . PMA_printable_bit_value($row[$i], $meta->length) . "'";
} else {
$con_val = '= \'' . PMA_sqlAddSlashes($row[$i], false, true) . '\'';
}
//.........这里部分代码省略.........
示例4: PMA_exportData
//.........这里部分代码省略.........
$current_row = 0;
$query_size = 0;
if (($GLOBALS['sql_insert_syntax'] == 'extended' || $GLOBALS['sql_insert_syntax'] == 'both') && (!isset($GLOBALS['sql_type']) || $GLOBALS['sql_type'] != 'UPDATE')) {
$separator = ',';
$schema_insert .= $crlf;
} else {
$separator = ';';
}
while ($row = PMA_DBI_fetch_row($result)) {
if ($current_row == 0) {
$head = PMA_possibleCRLF() . PMA_exportComment() . PMA_exportComment(__('Dumping data for table') . ' ' . $formatted_table_name) . PMA_exportComment() . $crlf;
if (!PMA_exportOutputHandler($head)) {
return false;
}
}
$current_row++;
for ($j = 0; $j < $fields_cnt; $j++) {
// NULL
if (!isset($row[$j]) || is_null($row[$j])) {
$values[] = 'NULL';
// a number
// timestamp is numeric on some MySQL 4.1, BLOBs are sometimes numeric
} elseif ($fields_meta[$j]->numeric && $fields_meta[$j]->type != 'timestamp' && !$fields_meta[$j]->blob) {
$values[] = $row[$j];
// a true BLOB
// - mysqldump only generates hex data when the --hex-blob
// option is used, for fields having the binary attribute
// no hex is generated
// - a TEXT field returns type blob but a real blob
// returns also the 'binary' flag
} elseif (stristr($field_flags[$j], 'BINARY') && $fields_meta[$j]->blob && isset($GLOBALS['sql_hex_for_blob'])) {
// empty blobs need to be different, but '0' is also empty :-(
if (empty($row[$j]) && $row[$j] != '0') {
$values[] = '\'\'';
} else {
$values[] = '0x' . bin2hex($row[$j]);
}
// detection of 'bit' works only on mysqli extension
} elseif ($fields_meta[$j]->type == 'bit') {
$values[] = "b'" . PMA_sqlAddSlashes(PMA_printable_bit_value($row[$j], $fields_meta[$j]->length)) . "'";
// something else -> treat as a string
} else {
$values[] = '\'' . str_replace($search, $replace, PMA_sqlAddSlashes($row[$j])) . '\'';
}
// end if
}
// end for
// should we make update?
if (isset($GLOBALS['sql_type']) && $GLOBALS['sql_type'] == 'UPDATE') {
$insert_line = $schema_insert;
for ($i = 0; $i < $fields_cnt; $i++) {
if (0 == $i) {
$insert_line .= ' ';
}
if ($i > 0) {
// avoid EOL blank
$insert_line .= ',';
}
$insert_line .= $field_set[$i] . ' = ' . $values[$i];
}
list($tmp_unique_condition, $tmp_clause_is_unique) = PMA_getUniqueCondition($result, $fields_cnt, $fields_meta, $row);
$insert_line .= ' WHERE ' . $tmp_unique_condition;
unset($tmp_unique_condition, $tmp_clause_is_unique);
} else {
// Extended inserts case
if ($GLOBALS['sql_insert_syntax'] == 'extended' || $GLOBALS['sql_insert_syntax'] == 'both') {
if ($current_row == 1) {
$insert_line = $schema_insert . '(' . implode(', ', $values) . ')';
} else {
$insert_line = '(' . implode(', ', $values) . ')';
if (isset($GLOBALS['sql_max_query_size']) && $GLOBALS['sql_max_query_size'] > 0 && $query_size + strlen($insert_line) > $GLOBALS['sql_max_query_size']) {
if (!PMA_exportOutputHandler(';' . $crlf)) {
return false;
}
$query_size = 0;
$current_row = 1;
$insert_line = $schema_insert . $insert_line;
}
}
$query_size += strlen($insert_line);
} else {
$insert_line = $schema_insert . '(' . implode(', ', $values) . ')';
}
}
unset($values);
if (!PMA_exportOutputHandler(($current_row == 1 ? '' : $separator . $crlf) . $insert_line)) {
return false;
}
}
// end while
if ($current_row > 0) {
if (!PMA_exportOutputHandler(';' . $crlf)) {
return false;
}
}
}
// end if ($result != false)
PMA_DBI_free_result($result);
return true;
}
示例5: PMA_displayTableBody
//.........这里部分代码省略.........
}
unset($blob_size);
$vertical_display['data'][$row_no][$i] = ' <td align="left"' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '">' . $blobtext . '</td>';
} else {
if (!isset($row[$i]) || is_null($row[$i])) {
$vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\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['userconf']['dontlimitchars']) {
$row[$i] = PMA_substr($row[$i], 0, $GLOBALS['cfg']['LimitChars']) . '...';
}
// loic1: displays all space characters, 4 space
// characters for tabulations and <cr>/<lf>
$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] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '">' . $row[$i] . '</td>' . "\n";
} else {
$vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"> </td>' . "\n";
}
}
} else {
if (!isset($row[$i]) || is_null($row[$i])) {
$vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\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['userconf']['dontlimitchars'] && !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);
} elseif (stristr($field_flags, 'BINARY')) {
$row[$i] = str_replace("", '\\0', $row[$i]);
$row[$i] = str_replace("", '\\b', $row[$i]);
$row[$i] = str_replace("\n", '\\n', $row[$i]);
$row[$i] = str_replace("\r", '\\r', $row[$i]);
$row[$i] = str_replace("", '\\Z', $row[$i]);
$row[$i] = $default_function != $transform_function ? $transform_function($row[$i], $transform_options, $meta) : $default_function($row[$i], array(), $meta);
} else {
$row[$i] = $default_function != $transform_function ? $transform_function($row[$i], $transform_options, $meta) : $default_function($row[$i], array(), $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' : '';
$vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . $nowrap . ($condition_field ? ' condition' : '') . '">';
if (isset($analyzed_sql[0]['select_expr']) && is_array($analyzed_sql[0]['select_expr'])) {
foreach ($analyzed_sql[0]['select_expr'] as $select_expr_position => $select_expr) {
$alias = $analyzed_sql[0]['select_expr'][$select_expr_position]['alias'];
if (isset($alias) && strlen($alias)) {
$true_column = $analyzed_sql[0]['select_expr'][$select_expr_position]['column'];
if ($alias == $meta->name) {
$meta->name = $true_column;
}
// end if
}
// end if
}
// end while
}
if (isset($map[$meta->name])) {
// Field to display from the foreign table?
示例6: empty
<td><?php
echo empty($field_charset) ? '' : '<dfn title="' . PMA_getCollationDescr($field_charset) . '">' . $field_charset . '</dfn>';
?>
</td>
<td nowrap="nowrap" style="font-size: 70%"><?php
echo $attribute;
?>
</td>
<td><?php
echo $row['Null'] == 'YES' ? $strYes : $strNo;
?>
</td>
<td nowrap="nowrap"><?php
if (isset($row['Default'])) {
if ($extracted_fieldspec['type'] == 'bit') {
echo PMA_printable_bit_value($row['Default'], $extracted_fieldspec['spec_in_brackets']);
} else {
echo $row['Default'];
}
} else {
echo '<i>' . $strNone . '</i>';
}
?>
</td>
<td nowrap="nowrap"><?php
echo $row['Extra'];
?>
</td>
<td align="center">
<a href="sql.php?<?php
echo $url_query;
示例7: PMA_displayTableBody
//.........这里部分代码省略.........
}
// displays all space characters, 4 space
// characters for tabulations and <cr>/<lf>
$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] = PMA_buildValueDisplay($class, $condition_field, $row[$i]);
} else {
$vertical_display['data'][$row_no][$i] = PMA_buildEmptyDisplay($class, $condition_field, $meta);
}
}
// g e o m e t r y
} elseif ($meta->type == 'geometry') {
$geometry_text = PMA_handle_non_printable_contents('GEOMETRY', isset($row[$i]) ? $row[$i] : '', $transform_function, $transform_options, $default_function, $meta);
// remove 'inline_edit' from $class as we can't edit geometry data.
$class = str_replace('inline_edit', '', $class);
$vertical_display['data'][$row_no][$i] = PMA_buildValueDisplay($class, $condition_field, $geometry_text);
unset($geometry_text);
// 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] = PMA_buildNullDisplay($class, $condition_field, $meta);
} elseif ($row[$i] != '') {
// support blanks in the key
$relation_id = $row[$i];
// Cut all fields to $GLOBALS['cfg']['LimitChars']
// (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']) . '...';
$is_field_truncated = true;
}
// displays special characters from binaries
$field_flags = PMA_DBI_field_flags($dt_result, $i);
$is_html = false;
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, $_url_params);
$is_html = true;
}
}
if ($is_html) {
$vertical_display['data'][$row_no][$i] = PMA_buildValueDisplay($class, $condition_field, $row[$i]);
} else {
// 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;
// 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] = '<td ' . PMA_prepare_row_data($class, $condition_field, $analyzed_sql, $meta, $map, $row[$i], $transform_function, $default_function, $nowrap, $where_comparison, $transform_options, $is_field_truncated);
}
} else {
$vertical_display['data'][$row_no][$i] = PMA_buildEmptyDisplay($class, $condition_field, $meta);
示例8: array
$GLOBALS['js_include'][] = 'jquery/timepicker.js';
/**
* Handle AJAX request for data row on point select
* @var post_params Object containing parameters for the POST request
*/
if (isset($_REQUEST['get_data_row']) && $_REQUEST['get_data_row'] == true) {
$extra_data = array();
$row_info_query = 'SELECT * FROM `' . $_REQUEST['db'] . '`.`' . $_REQUEST['table'] . '` WHERE ' . $_REQUEST['where_clause'];
$result = PMA_DBI_query($row_info_query . ";", null, PMA_DBI_QUERY_STORE);
$fields_meta = PMA_DBI_get_fields_meta($result);
while ($row = PMA_DBI_fetch_assoc($result)) {
// for bit fields we need to convert them to printable form
$i = 0;
foreach ($row as $col => $val) {
if ($fields_meta[$i]->type == 'bit') {
$row[$col] = PMA_printable_bit_value($val, $fields_meta[$i]->length);
}
$i++;
}
$extra_data['row_info'] = $row;
}
PMA_ajaxResponse(null, true, $extra_data);
}
$titles['Browse'] = PMA_getIcon('b_browse.png', __('Browse foreign values'));
/**
* Not selection yet required -> displays the selection form
*/
// Gets some core libraries
require_once './libraries/tbl_common.php';
$url_query .= '&goto=tbl_select.php&back=tbl_select.php';
/**
示例9: elseif
if (isset($field_mimetype) && isset($field_mimetype[$i])) {
$mime_map[$row['Field']]['mimetype'] = $field_mimetype[$i];
}
if (isset($field_transformation) && isset($field_transformation[$i])) {
$mime_map[$row['Field']]['transformation'] = $field_transformation[$i];
}
if (isset($field_transformation_options) && isset($field_transformation_options[$i])) {
$mime_map[$row['Field']]['transformation_options'] = $field_transformation_options[$i];
}
} elseif (isset($fields_meta) && isset($fields_meta[$i])) {
$row = $fields_meta[$i];
}
if (isset($row) && isset($row['Type'])) {
$type_and_length = PMA_extract_type_length($row['Type']);
if ($type_and_length['type'] == 'bit') {
$row['Default'] = PMA_printable_bit_value($row['Default'], $type_and_length['length']);
}
}
// Cell index: If certain fields get left out, the counter shouldn't chage.
$ci = 0;
// Everytime a cell shall be left out the STRG-jumping feature, $ci_offset
// has to be incremented ($ci_offset++)
$ci_offset = -1;
if ($is_backup) {
$backup_field = isset($true_selected) && isset($true_selected[$i]) && $true_selected[$i] ? $true_selected[$i] : (isset($row) && isset($row['Field']) ? urlencode($row['Field']) : '');
$content_cells[$i][$ci] = "\n" . '<input type="hidden" name="field_orig[]" value="' . $backup_field . '" />' . "\n";
} else {
$content_cells[$i][$ci] = '';
}
$content_cells[$i][$ci] .= "\n" . '<input id="field_' . $i . '_' . ($ci - $ci_offset) . '" type="text" name="field_name[]" size="10" maxlength="64" value="' . (isset($row) && isset($row['Field']) ? str_replace('"', '"', $row['Field']) : '') . '" class="textfield" title="' . $strField . '" />';
$ci++;
示例10: htmlspecialchars
// loic1: if a timestamp field value is not included in an update
// statement MySQL auto-update it to the current timestamp
// lem9: however, things have changed since MySQL 4.1, so
// it's better to set a fields_prev in this situation
$backup_field = '<input type="hidden" name="fields_prev' . $field_name_appendix . '" value="' . htmlspecialchars($vrow[$field['Field']]) . '" />';
} else {
// loic1: display default values
if (!isset($field['Default'])) {
$field['Default'] = '';
$real_null_value = TRUE;
$data = '';
} else {
$data = $field['Default'];
}
if ($field['True_Type'] == 'bit') {
$special_chars = PMA_printable_bit_value($field['Default'], $extracted_fieldspec['spec_in_brackets']);
} else {
$special_chars = htmlspecialchars($field['Default']);
}
$backup_field = '';
$special_chars_encoded = PMA_duplicateFirstNewline($special_chars);
}
$idindex = $o_rows * $fields_cnt + $i + 1;
$tabindex = ($idindex - 1) * 3 + 1;
// The function column
// -------------------
// Change by Bernard M. Piller <bernard@bmpsystems.com>
// We don't want binary data to be destroyed
// Note: from the MySQL manual: "BINARY doesn't affect how the column is
// stored or retrieved" so it does not mean that the contents is
// binary
示例11: htmlspecialchars
// loic1: if a timestamp field value is not included in an update
// statement MySQL auto-update it to the current timestamp
// lem9: however, things have changed since MySQL 4.1, so
// it's better to set a fields_prev in this situation
$backup_field = PMA_MYSQL_INT_VERSION < 40100 && $row_table_def['True_Type'] == 'timestamp' ? '' : '<input type="hidden" name="fields_prev' . $field_name_appendix . '" value="' . htmlspecialchars($vrow[$field]) . '" />';
} else {
// loic1: display default values
if (!isset($row_table_def['Default'])) {
$row_table_def['Default'] = '';
$real_null_value = TRUE;
$data = '';
} else {
$data = $row_table_def['Default'];
}
if ($row_table_def['True_Type'] == 'bit') {
$special_chars = PMA_printable_bit_value($row_table_def['Default'], $len);
} else {
$special_chars = htmlspecialchars($row_table_def['Default']);
}
$backup_field = '';
}
$idindex = $o_rows * $fields_cnt + $i + 1;
$tabindex = ($idindex - 1) * 3 + 1;
// The function column
// -------------------
// Change by Bernard M. Piller <bernard@bmpsystems.com>
// We don't want binary data to be destroyed
// Note: from the MySQL manual: "BINARY doesn't affect how the column is
// stored or retrieved" so it does not mean that the contents is
// binary
if ($cfg['ShowFunctionFields']) {
示例12: testPrintableBitValue
/**
* test for generating string contains printable bit value of selected data
* @dataProvider printableBitValueDataProvider
*/
public function testPrintableBitValue($a, $b, $e)
{
$this->assertEquals($e, PMA_printable_bit_value($a, $b));
}