From 6d37bf110d40e3e8f006a1bfca62b771e2315c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Sat, 30 Jun 2001 16:05:29 +0000 Subject: [PATCH] Merged patches #437127 and #437129 --- lib.inc.php3 | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/lib.inc.php3 b/lib.inc.php3 index c435852c5..3b885f555 100755 --- a/lib.inc.php3 +++ b/lib.inc.php3 @@ -338,7 +338,9 @@ function display_table ($dt_result, $is_simple = false) { table; + if (strlen(trim($table))==0) { + $table = $field->table; + } mysql_field_seek($dt_result, 0); if (!$is_simple) { show_table_navigation($pos_next, $pos_prev, $dt_result); @@ -361,7 +363,15 @@ function display_table ($dt_result, $is_simple = false) { { if(@mysql_num_rows($dt_result)>1 && !$is_simple) { - $sort_order=urlencode(" order by $field->name $cfgOrder"); + if (empty($sql_order)) { + $sort_order=urlencode(" order by $field->name $cfgOrder"); + } + else if (substr($sql_order, -3) == 'ASC') { + $sort_order=urlencode(" order by $field->name DESC"); + } + else if (substr($sql_order, -4) == 'DESC') { + $sort_order=urlencode(" order by $field->name ASC"); + } echo ""; echo ""; echo $field->name; @@ -372,7 +382,9 @@ function display_table ($dt_result, $is_simple = false) { { echo "$field->name"; } - $table = $field->table; + if (strlen(trim($table))==0) { + $table = $field->table; + } } echo "\n"; $foo = 0; @@ -637,16 +649,15 @@ function get_table_content_old($db, $table, $handler) else $schema_insert = "INSERT INTO $table VALUES ("; - for($j=0; $j