Index: /trunk/ippMonitor/raw/czartool_labels.php
===================================================================
--- /trunk/ippMonitor/raw/czartool_labels.php	(revision 30938)
+++ /trunk/ippMonitor/raw/czartool_labels.php	(revision 30939)
@@ -73,4 +73,5 @@
 echo "<tr><td>ippMonitor SVN version</td><td>"; include 'version.php'; echo "</td></tr>"; 
 echo "<tr><td>Current nightly science status</td><td>$nsStatus</td></tr>"; 
+echo "<tr><td>Postage stamp server status</td><td><a href=\"http://pstamp.ipp.ifa.hawaii.edu/status.php\"><font color=\"blue\">here</font></a></td></tr>";
 echo "<tr><td>Documentation</td><td><a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Processing\"><font color=\"blue\">here</font></a></td></tr>";
 echo "<tr><td>Cluster load</td><td><a href=\"http://ganglia.pan-starrs.ifa.hawaii.edu/?r=hour&s=descending&c=IPP%2520Production\"><font color=\"blue\">here</font></a></td></tr>";
@@ -290,9 +291,9 @@
 
             if ($expType[0] == "OBJECT") $msg = "All science exposures taken since $date<br>have been registered at MHPCC";
-            $color = "";
+            $error = 0;
         }
         else {
             if ($expType[0] == "OBJECT") $msg = "<font color=\"red\">Warning: Not all science exposures taken since $date<br>have been registered at MHPCC</a>";
-            $color = "red";
+            $error = 1;
         }
 
@@ -300,5 +301,8 @@
         echo "<td>$summit[0]</td>";
         
-        echo "<td bgcolor=\"$color\">$mhpcc[0]</td>";
+
+
+        #echo "<td bgcolor=\"$color\">$mhpcc[0]</td>";
+        createFormattedTableCell("", "", $mhpcc[0], $error);
 
         echo "</tr>";
@@ -416,5 +420,5 @@
             ."&plottype=".$plotType;
 
-        createLabelTableCell($showLink, $link, $stage, "blue");
+        createFormattedTableCell($showLink, $link, $stage, 0);
     }
 
@@ -461,5 +465,5 @@
             ."&stage=".$selectedStage
             ."&plottype=".$plotType;
-        createLabelTableCell($showLink, $link, $thisLabel, "blue");
+        createFormattedTableCell($showLink, $link, $thisLabel, 0);
 
         $str = "";
@@ -468,45 +472,45 @@
         $link = $defaultlink;
         getStateAndFaults($db, $thisLabel, $selectedState, "burntool", $str, $anyFaults);
-        createLabelTableCell($anyFaults, $link, $str, "red");
+        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
 
         $link = "failedChipProcessedImfile.php?pass=" . $pass . "&proj=" . $proj . "&chipRun.label=" . $thisLabel . "&chipRun.state=".$searchState;
         getStateAndFaults($db, $thisLabel, $selectedState, "chip", $str, $anyFaults);
-        createLabelTableCell($anyFaults, $link, $str, "red");
+        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
 
         $link = "failedCamProcessedExp.php?pass=" . $pass . "&proj=" . $proj . "&camRun.label=" . $thisLabel . "&camRun.state=".$searchState;
         getStateAndFaults($db, $thisLabel, $selectedState, "cam", $str, $anyFaults);
-        createLabelTableCell($anyFaults, $link, $str, "red");
+        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
 
         $link =  "failedFakeProcessedImfile.php?pass=" . $pass . "&proj=" . $proj . "&fakeRun.label=" . $thisLabel . "&fakeRun.state=".$searchState;
         getStateAndFaults($db, $thisLabel, $selectedState, "fake", $str, $anyFaults);
-        createLabelTableCell($anyFaults, $link, $str, "red");
+        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
 
         $link = "failedWarpSkyfiles.php?pass=" . $pass . "&proj=" . $proj . "&warpRun.label=" . $thisLabel . "&warpRun.state=".$searchState;
         getStateAndFaults($db, $thisLabel, $selectedState, "warp", $str, $anyFaults);
-        createLabelTableCell($anyFaults, $link, $str, "red");
+        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
 
         $link = "failedStackSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&stackRun.label=" . $thisLabel . "&stackRun.state=".$searchState;
         getStateAndFaults($db, $thisLabel, $selectedState, "stack", $str, $anyFaults);
-        createLabelTableCell($anyFaults, $link, $str, "red");
+        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
 
         $link = "failedDiffSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&diffRun.label=" . $thisLabel . "&diffRun.state=".$searchState;
         getStateAndFaults($db, $thisLabel, $selectedState, "diff", $str, $anyFaults);
-        createLabelTableCell($anyFaults, $link, $str, "red");
+        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
 
         $link = $defaultlink;
         getStateAndFaults($db, $thisLabel, $selectedState, "magic", $str, $anyFaults);
-        createLabelTableCell($anyFaults, $link, $str, "red");
+        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
 
         $link = $defaultlink;
         getStateAndFaults($db, $thisLabel, $selectedState, "magicDS", $str, $anyFaults);
-        createLabelTableCell($anyFaults, $link, $str, "red");
+        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
 
         $link = $defaultlink;
         getStateAndFaults($db, $thisLabel, $selectedState, "dist", $str, $anyFaults);
-        createLabelTableCell($anyFaults, $link, $str, "red");
+        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
 
         $link = "publishDone.php?pass=" . $pass . "&proj=" . $proj . "&publishRun.label=" . $thisLabel . "&publishRun.state=".$searchState;
         getStateAndFaults($db, $thisLabel, $selectedState, "pub", $str, $anyFaults);
-        createLabelTableCell($anyFaults, $link, $str, "red");
+        createFormattedTableCell($anyFaults, $link, $str, $anyFaults);
 
         echo "</tr>\n";
@@ -524,12 +528,16 @@
 ###########################################################################
 #
-# Creates table cell for lable table
-#
-###########################################################################
-function createLabelTableCell($showLink, $link, $str, $color) {
-
-    if ($showLink) echo "<td><a href=\"$link\"><font color=\"$color\">$str</font></td>";
-    else if ($str) echo "<td>$str</td>";
-    else echo "<td>&nbsp;</td>";
+# Creates table cell with a red background if an error
+#
+###########################################################################
+function createFormattedTableCell($showLink, $link, $str, $error) {
+
+    $fontColor = $error ? "black" : "blue";
+
+    if ($error) echo "<td bgcolor=\"red\">";
+    else  echo "<td>";
+    if ($showLink) echo "<a href=\"$link\"><font color=\"$fontColor\">$str</font></td>";
+    else if ($str) echo "$str</td>";
+    else echo "&nbsp;</td>";
 }
 
@@ -739,10 +747,6 @@
         //write_table_cell($class, '%s', "", $alive ? "yes" : "NO");
         echo "<td>$server</td>";
-        $yesNo = $alive ? "yes" : "NO";
-        $color = $alive ? "" : "red";
-        echo  "<td bgcolor=\"$color\">$yesNo</td>";
-        $yesNo = $running ? "yes" : "NO";
-        $color = $running ? "" : "red";
-        echo  "<td bgcolor=\"$color\">$yesNo</td>";
+        createFormattedTableCell(0, "", $alive ? "yes" : "NO", !$alive);
+        createFormattedTableCell(0, "", $running ? "yes" : "NO", !$running);
 
         //if ($alive) {
