this and that

This commit is contained in:
Michael Clemens 2009-05-18 15:34:04 +00:00
parent 9fc372d337
commit 45983ec077
2 changed files with 14 additions and 10 deletions

View File

@ -880,10 +880,12 @@ class TSMMonitor {
*/ */
function renderZebraTableRow ($row, $shade , $alarmcol, $color, $cellproperties) { function renderZebraTableRow ($row, $shade , $alarmcol, $color, $cellproperties) {
$isNotEmpty = FALSE;
$colorsarray = $this->configarray["colorsarray"]; $colorsarray = $this->configarray["colorsarray"];
$outp = $outp."<tr class='d".$shade."'>"; $outp = $outp."<tr class='d".$shade."'>";
while(list($keycell, $valcell) = each($row)) { while(list($keycell, $valcell) = each($row)) {
if (isset($cellproperties) && $cellproperties[$keycell] != "") { if (isset($cellproperties) && $cellproperties[$keycell] != "") {
$cellproperty = " ".$cellproperties[$keycell]." "; $cellproperty = " ".$cellproperties[$keycell]." ";
} else { } else {
@ -900,10 +902,15 @@ class TSMMonitor {
} else { } else {
$outp = $outp."<td".$cellproperty.">".$valcell."</td>"; $outp = $outp."<td".$cellproperty.">".$valcell."</td>";
} }
if ($valcell != "") $isNotEmpty = TRUE;
} }
$outp = $outp."</tr>\n"; $outp = $outp."</tr>\n";
return $outp; if ($isNotEmpty) {
return $outp;
} else {
return "";
}
} }

View File

@ -110,14 +110,11 @@ include_once "includes/page_head.php";
echo "<tr><th>Key</th><th>Value</th></tr>"; echo "<tr><th>Key</th><th>Value</th></tr>";
foreach ($tablearray as $row) { foreach ($tablearray as $row) {
while(list($keycell, $valcell) = each($row)) { while(list($keycell, $valcell) = each($row)) {
if ($i == 0) { $vertrow = array();
echo "<tr class='d0'>"; $vertrow["key"] = $keycell;
$i = 1; $vertrow["value"] = $valcell;
} else { echo $tsmmonitor->renderZebraTableRow($vertrow, $i%2, "", "", "");
echo "<tr class='d1'>"; $i++;
$i = 0;
}
echo "<td><b>".$keycell."</b></td><td>".$valcell."</td></tr>";
} }
} }