Commit 5aa39cb9 authored by Leigh Stoller's avatar Leigh Stoller

Deal with having <= 3 types of pcs (as in ElabinElab), which messes up

the table.
parent a4048a5d
......@@ -118,11 +118,12 @@ function SHOWFREENODES()
bgcolor='#E1EAEA' align=center>
<font size=-1>Free PCs</font></td></tr>\n";
$newrow = 1;
$pccount = count($freecounts);
$newrow = 1;
foreach($freecounts as $key => $value) {
$freecount = $freecounts[$key];
if ($newrow)
if ($newrow || $pccount <= 3)
echo "<tr>\n";
$newrow = ($newrow ? 0 : 1);
......@@ -131,13 +132,20 @@ function SHOWFREENODES()
$key</a></td>
<td class=menuoptusage align=left>${freecount}</td>\n";
if ($newrow) {
if ($newrow || $pccount <= 3) {
echo "</tr>\n";
}
}
if (! $newrow) {
if (! $newrow && $pccount > 3) {
echo "<td></td><td></td></tr>\n";
}
# Fill in up to 3 rows.
if ($pccount < 3) {
for ($i = $pccount + 1; $i <= 3; $i++) {
echo "<tr><td class=menuoptusage>&nbsp</td>
<td class=menuoptusage>&nbsp</td></tr>\n";
}
}
$freepcs = TBFreePCs();
echo "<tr>
<td class=menuoptusage colspan=4 align=center>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment