* Fixed an error when $cfg['Server']['table_info'] is not valid;

* Removed an "onchange" js handler to lower server charge.
This commit is contained in:
Loïc Chapeaux
2002-05-25 09:53:13 +00:00
parent ddd8747429
commit 9609d89829
2 changed files with 31 additions and 25 deletions

View File

@@ -10,6 +10,9 @@ $Source$
standards. standards.
* lang/english.inc.php3; lang/french.inc.php3: sorted. * lang/english.inc.php3; lang/french.inc.php3: sorted.
* header.inc.php3: enforce relative url in CSS. * header.inc.php3: enforce relative url in CSS.
* tbl_relation.php3:
- fixed an error when $cfg['Server']['table_info'] is not valid;
- removed an "onchange" js handler to lower server charge.
2002-05-25 Alexander M. Turek <rabus@users.sourceforge.net> 2002-05-25 Alexander M. Turek <rabus@users.sourceforge.net>
* lang/italian.inc.php3: Updates, thanks again to * lang/italian.inc.php3: Updates, thanks again to

View File

@@ -148,7 +148,7 @@ if ($col_rs && mysql_num_rows($col_rs) > 0) {
<th><?php echo $row[0]; ?></th> <th><?php echo $row[0]; ?></th>
<td> <td>
<input type="hidden" name="src_field" value="<?php echo $row['Field']; ?>" /> <input type="hidden" name="src_field" value="<?php echo $row['Field']; ?>" />
<select name="destination[<?php echo htmlspecialchars($row['Field']); ?>]" onchange="this.form.submit(); "> <select name="destination[<?php echo htmlspecialchars($row['Field']); ?>]">
<?php <?php
echo "\n"; echo "\n";
reset($selectboxall); reset($selectboxall);
@@ -160,7 +160,7 @@ if ($col_rs && mysql_num_rows($col_rs) > 0) {
echo ' selected="selected"'; echo ' selected="selected"';
} }
echo '>' . $value . '</option>'. "\n"; echo '>' . $value . '</option>'. "\n";
} } // end while
?> ?>
</select> </select>
</td> </td>
@@ -181,20 +181,7 @@ if ($col_rs && mysql_num_rows($col_rs) > 0) {
} // end if } // end if
if (!empty($cfg['Server']['table_info'])) { if (!empty($cfg['Server']['table_info'])) {
echo "\n"; // Get "display_filed" infos
?>
<form method="post" action="tbl_relation.php3">
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="hidden" name="server" value="<?php echo $server; ?>" />
<input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
<input type="hidden" name="submit_show" value="true" />
<p><?php echo $strChangeDisplay; ?></P>
<select name="display_field" onchange="this.form.submit(); ">
<?php
echo "\n";
$disp_query = 'SELECT display_field FROM ' . PMA_backquote($cfg['Server']['table_info']) $disp_query = 'SELECT display_field FROM ' . PMA_backquote($cfg['Server']['table_info'])
. ' WHERE table_name = \'' . PMA_sqlAddslashes($table) . '\''; . ' WHERE table_name = \'' . PMA_sqlAddslashes($table) . '\'';
$disp_rs = mysql_query($disp_query) or PMA_mysqlDie('', $disp_query, '', $err_url_0); $disp_rs = mysql_query($disp_query) or PMA_mysqlDie('', $disp_query, '', $err_url_0);
@@ -204,18 +191,34 @@ if (!empty($cfg['Server']['table_info'])) {
} }
$col_query = 'SHOW COLUMNS FROM ' . PMA_backquote($table); $col_query = 'SHOW COLUMNS FROM ' . PMA_backquote($table);
$col_rs = mysql_query($col_query) or PMA_mysqlDie('', $col_query, '', $err_url_0); $col_rs = mysql_query($col_query) or PMA_mysqlDie('', $col_query, '', $err_url_0);
while ($row = @mysql_fetch_array($col_rs)) {
echo ' <option value="' . htmlspecialchars($row['Field']) . '"'; if ($col_rs && mysql_num_rows($col_rs) > 0) {
if (isset($disp) && $row['Field'] == $disp) { echo "\n";
echo ' selected="selected"'; ?>
} <form method="post" action="tbl_relation.php3" onchange="this.form.submit();">
echo '>' . htmlspecialchars($row['Field']) . '</option>'. "\n"; <input type="hidden" name="lang" value="<?php echo $lang; ?>" />
} // end while <input type="hidden" name="server" value="<?php echo $server; ?>" />
?> <input type="hidden" name="db" value="<?php echo $db; ?>" />
<input type="hidden" name="table" value="<?php echo $table; ?>" />
<input type="hidden" name="submit_show" value="true" />
<p><?php echo $strChangeDisplay; ?></P>
<select name="display_field">
<?php
echo "\n";
while ($row = @mysql_fetch_array($col_rs)) {
echo ' <option value="' . htmlspecialchars($row['Field']) . '"';
if (isset($disp) && $row['Field'] == $disp) {
echo ' selected="selected"';
}
echo '>' . htmlspecialchars($row['Field']) . '</option>'. "\n";
} // end while
?>
</select> </select>
<input type="submit" value="<?php echo $strGo; ?>" /> <input type="submit" value="<?php echo $strGo; ?>" />
</form> </form>
<?php <?php
} // end if
} // end if } // end if