diff --git a/main/reports/reports.php b/main/reports/reports.php index e1e4576df4..8fde7f1c7b 100644 --- a/main/reports/reports.php +++ b/main/reports/reports.php @@ -65,13 +65,19 @@ if ($_REQUEST['format'] == 'html') { echo ''; // FIXME style $nfields = mysql_num_fields($result); echo ''; - for ($i=0; $i < $nfields; $i++) - echo ''; + for ($i=0; $i < $nfields; $i++) + if (substr(mysql_field_name($result, $i), -5, 5) != '_link') + echo ''; echo ''; - while ($row = Database::fetch_row($result)) { + while ($row = Database::fetch_assoc($result)) { echo ''; - foreach ($row as $col) - echo ''; + foreach ($row as $colName => $colValue) + if (substr($colName, -5, 5) != '_link'){ // ignore links + if (array_key_exists($colName.'_link', $row)) // link is defined + echo ''; + else + echo ''; + } echo "\n"; } echo '
'.mysql_field_name($result, $i).''.mysql_field_name($result, $i).'
'.$col.''.$colValue.''.$colValue.'
'; @@ -81,8 +87,9 @@ if ($_REQUEST['format'] == 'html') { echo mysql_field_name($result, $i).','; echo "\n"; while ($row = Database::fetch_row($result)) { - foreach ($row as $col) - echo $col.','; // fixme + foreach ($row as $colName => $colValue) + if (substr($colName, -5, 5) != '_link') // ignore links + echo $colValue.','; // fixme echo "\n"; } } else die('format unknown');