better variable names;

minor code formating;
This commit is contained in:
Sebastian Mendel
2007-09-06 14:38:58 +00:00
parent 914855c176
commit ef9d09a1d1

View File

@@ -272,19 +272,19 @@ if (! $cfg['ShowFunctionFields']) {
echo $strShow . ' : <a href="tbl_change.php' . PMA_generate_common_url($this_url_params) . '">' . $strFunction . '</a>' . "\n"; echo $strShow . ' : <a href="tbl_change.php' . PMA_generate_common_url($this_url_params) . '">' . $strFunction . '</a>' . "\n";
} }
foreach ($rows as $vrowcount => $vrow) { foreach ($rows as $row_id => $vrow) {
if ($vrow === false) { if ($vrow === false) {
unset($vrow); unset($vrow);
} }
$jsvkey = $vrowcount; $jsvkey = $row_id;
$browse_foreigners_uri = '&amp;pk=' . $vrowcount; $browse_foreigners_uri = '&amp;pk=' . $row_id;
$vkey = '[multi_edit][' . $jsvkey . ']'; $vkey = '[multi_edit][' . $jsvkey . ']';
$vresult = (isset($result) && is_array($result) && isset($result[$vrowcount]) ? $result[$vrowcount] : $result); $vresult = (isset($result) && is_array($result) && isset($result[$row_id]) ? $result[$row_id] : $result);
if ($insert_mode && $vrowcount > 0) { if ($insert_mode && $row_id > 0) {
echo '<input type="checkbox" checked="checked" name="insert_ignore_' . $vrowcount . '" id="insert_ignore_check_' . $vrowcount . '" />'; echo '<input type="checkbox" checked="checked" name="insert_ignore_' . $row_id . '" id="insert_ignore_check_' . $row_id . '" />';
echo '<label for="insert_ignore_check_' . $vrowcount . '">' . $strIgnore . '</label><br />' . "\n"; echo '<label for="insert_ignore_check_' . $row_id . '">' . $strIgnore . '</label><br />' . "\n";
} }
?> ?>
<table> <table>
@@ -345,22 +345,18 @@ foreach ($rows as $vrowcount => $vrow) {
// to have an empty default value for DATETIME) // to have an empty default value for DATETIME)
// then, the "if" after this one will work // then, the "if" after this one will work
if ($table_field['Type'] == 'datetime' if ($table_field['Type'] == 'datetime'
&& !isset($table_field['Default']) && ! isset($table_field['Default'])
&& isset($table_field['Null']) && isset($table_field['Null'])
&& $table_field['Null'] == 'YES') { && $table_field['Null'] == 'YES') {
$table_field['Default'] = null; $table_field['Default'] = null;
} }
if ($table_field['Type'] == 'datetime' if ($table_field['Type'] == 'datetime'
&& (!isset($table_field['Default'])) && ! isset($table_field['Default'])
&& (!is_null($table_field['Default']))) { && ! is_null($table_field['Default'])) {
// INSERT case // INSERT case
if ($insert_mode) { if ($insert_mode) {
if (isset($vrow)) {
$vrow[$field] = date('Y-m-d H:i:s', time()); $vrow[$field] = date('Y-m-d H:i:s', time());
} else {
$vrow = array($field => date('Y-m-d H:i:s', time()));
}
} }
// UPDATE case with an empty and not NULL value under PHP4 // UPDATE case with an empty and not NULL value under PHP4
elseif (empty($vrow[$field]) && is_null($vrow[$field])) { elseif (empty($vrow[$field]) && is_null($vrow[$field])) {
@@ -420,8 +416,8 @@ foreach ($rows as $vrowcount => $vrow) {
// Prepares the field value // Prepares the field value
$real_null_value = FALSE; $real_null_value = FALSE;
if (isset($vrow)) { if (isset($vrow)) {
if (!isset($vrow[$field]) if (! isset($vrow[$field])
|| (function_exists('is_null') && is_null($vrow[$field]))) { || is_null($vrow[$field])) {
$real_null_value = TRUE; $real_null_value = TRUE;
$vrow[$field] = ''; $vrow[$field] = '';
$special_chars = ''; $special_chars = '';