only go through the columns if there are columns to go through

This commit is contained in:
james 2007-11-19 21:14:56 +00:00
parent 8a0a3dbc74
commit 25de3ace41

View File

@ -304,16 +304,18 @@ function reportChange()
echo "<h4>Report Data</h4>"; echo "<h4>Report Data</h4>";
echo "<table>"; echo "<table>";
$x=0; $x=0;
foreach($report['col'] as $o=>$d) { //only go through the columns if there are columns to go through
echo "<tr><td>Column ".($x + 1).": </td>"; if(count($report['col'])) {
echo "<td>"; foreach($report['col'] as $o=>$d) {
if(intval($x) != intval($o)) { echo "<tr><td>Column ".($x + 1).": </td>";
echo ("WARNING, out of order!"); echo "<td>";
} if(intval($x) != intval($o)) {
field_selector("col[$o][field]", "col$o", $d['field']); echo ("WARNING, out of order!");
echo "</td></tr>"; }
$x++; field_selector("col[$o][field]", "col$o", $d['field']);
echo "</td></tr>";
$x++;
}
} }
for(;$x<$n_columns;$x++) { for(;$x<$n_columns;$x++) {
echo "<tr><td>Column ".($x + 1).": </td>"; echo "<tr><td>Column ".($x + 1).": </td>";