Index: /trunk/ippMonitor/raw/czartool_exposures.php
===================================================================
--- /trunk/ippMonitor/raw/czartool_exposures.php	(revision 30557)
+++ /trunk/ippMonitor/raw/czartool_exposures.php	(revision 30558)
@@ -101,33 +101,35 @@
 
     $class = "list";
-    echo "<table class=$class >\n";
+    //echo "<table class=$class >\n";
+        echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"4\" >\n";
+
     echo "<tr><td></td>\n";
-    write_header_cell($class, "");
-    write_header_cell($class, "");
-    write_header_cell($class, "");
-    write_header_cell($class, "");
-    write_header_cell($class, "Raw");
-    write_header_cell($class, "Chip");
-    write_header_cell($class, "Camera");
-    write_header_cell($class, "Warp");
-    write_header_cell($class, "Stack");
-    write_header_cell($class, "Warp-Stack Diff");
-    write_header_cell($class, "Warp-Warp1 Diff");
-    write_header_cell($class, "Warp-Warp2 Diff");
-    write_header_cell($class, "Stack-Stack Diff");
+    echo "<th></th>";
+    echo "<th></th>";
+    echo "<th></th>";
+    echo "<th></th>";
+    echo "<th>Raw</th>";
+    echo "<th>Chip</th>";
+    echo "<th>Camera</th>";
+    echo "<th>Warp</th>";
+    echo "<th>Stack</th>";
+    echo "<th>Warp-Stack Diff</th>";
+    echo "<th>Warp-Warp1 Diff</th>";
+    echo "<th>Warp-Warp2 Diff</th>";
+    echo "<th>Stack-Stack Diff</th>";
     echo "<tr><td></td>\n";
-    write_header_cell($class, "Exp ID");
-    write_header_cell($class, "Exp Name");
-    write_header_cell($class, "Filter");
-    write_header_cell($class, "Comment");
-    write_header_cell($class, "state");
-    write_header_cell($class, "state/dist?");
-    write_header_cell($class, "state/dist?");
-    write_header_cell($class, "state/dist?");
-    write_header_cell($class, "total/dist");
-    write_header_cell($class, "total/dist");
-    write_header_cell($class, "total/dist");
-    write_header_cell($class, "total/dist");
-    write_header_cell($class, "total/dist");
+    echo "<th>Exp ID</th>";
+    echo "<th>Exp Name</th>";
+    echo "<th>Filter</th>";
+    echo "<th>Comment</th>";
+    echo "<th>state</th>";
+    echo "<th>state/dist?</th>";
+    echo "<th>state/dist?</th>";
+    echo "<th>state/dist?</th>";
+    echo "<th>total/dist</th>";
+    echo "<th>total/dist</th>";
+    echo "<th>total/dist</th>";
+    echo "<th>total/dist</th>";
+    echo "<th>total/dist</th>";
 
     $sql = 
@@ -164,49 +166,58 @@
         echo "<tr><td></td>\n";
 
+        echo "<TD>$exp_id</td>";
+        echo "<TD>$exp_name</td>";
+        echo "<TD>$filter</td>";
+        echo "<TD>$comment</td>";
+        echo "<TD>$rawExp</td>";
+
         // chip
         if (!$chipDist[$exp_id]) $chipDistStr = "N";
         else $chipDistStr = $chipDist[$exp_id];
 
+        if ($chipDistStr == "N") $color = "red"; else $color = "";
+        echo "<TD bgcolor=\"$color\" >$chipState/$chipDistStr</td>";
+
         // cam
         if (!$camDist[$exp_id]) $camDistStr = "N";
         else $camDistStr = $camDist[$exp_id];
+        if ($camDistStr == "N") $color = "red"; else $color = "";
+        echo "<TD bgcolor=\"$color\" >$camState/$camDistStr</td>";
 
         // warp
         if (!$warpDist[$exp_id]) $warpDistStr = "N";
         else $warpDistStr = $warpDist[$exp_id];
+        if ($warpDistStr == "N") $color = "red"; else $color = "";
+        echo "<TD bgcolor=\"$color\" >$warpState/$warpDistStr</td>";
 
         // stack
-        if (!$stack_hash[$exp_id] && !$stackDist[$exp_id]) $stackDistStr = "";
+        if (!$stack_hash[$exp_id] && !$stackDist[$exp_id]) $stackDistStr = "&nbsp;";
         else $stackDistStr = $stack_hash[$exp_id] . "/" . $stackDist[$exp_id];
+        $color = getColour($stack_hash[$exp_id], $stackDist[$exp_id]);
+        echo "<TD bgcolor=\"$color\" >$stackDistStr</td>";
 
         // WS diff
-        if (!$wsDiffProduced[$exp_id] && !$wsDiffDist[$exp_id]) $wsDistStr = "";
+        if (!$wsDiffProduced[$exp_id] && !$wsDiffDist[$exp_id]) $wsDistStr = "&nbsp;";
         else $wsDistStr = $wsDiffProduced[$exp_id] . "/" . $wsDiffDist[$exp_id];
+        $color = getColour($wsDiffProduced[$exp_id], $wsDiffDist[$exp_id]);
+        echo "<TD bgcolor=\"$color\" >$wsDistStr</td>";
 
         // WW1 diff
-        if (!$ww1DiffProduced[$exp_id] && !$ww1DiffDist[$exp_id]) $ww1DistStr = "";
+        if (!$ww1DiffProduced[$exp_id] && !$ww1DiffDist[$exp_id]) $ww1DistStr = "&nbsp;";
         else $ww1DistStr = $ww1DiffProduced[$exp_id] . "/" . $ww1DiffDist[$exp_id];
+        $color = getColour($ww1DiffProduced[$exp_id], $ww1DiffDist[$exp_id]);
+        echo "<TD bgcolor=\"$color\" >$ww1DistStr</td>";
 
         // WW2 dist
-        if (!$ww2DiffProduced[$exp_id] && !$ww2DiffDist[$exp_id]) $ww2DistStr = "";
+        if (!$ww2DiffProduced[$exp_id] && !$ww2DiffDist[$exp_id]) $ww2DistStr = "&nbsp;";
         else $ww2DistStr =  $ww2DiffProduced[$exp_id] . "/" . $ww2DiffDist[$exp_id];
+        $color = getColour($ww2DiffProduced[$exp_id], $ww2DiffDist[$exp_id]);
+        echo "<TD bgcolor=\"$color\" >$ww2DistStr</td>";
 
         // SS dist
-        if (!$ssDiffProduced[$exp_id] && !$ssDiffDist[$exp_id]) $ssDistStr = "";
+        if (!$ssDiffProduced[$exp_id] && !$ssDiffDist[$exp_id]) $ssDistStr = "&nbsp;";
         else $ssDistStr = $ssDiffProduced[$exp_id] . "/" . $ssDiffDist[$exp_id];
-
-        write_table_cell($class, '%s', "", $exp_id);
-        write_table_cell($class, '%s', "", $exp_name);
-        write_table_cell($class, '%s', "", $filter);
-        write_table_cell($class, '%s', "", $comment);
-        write_table_cell($class, '%s', "", $rawExp);
-        write_table_cell($class, '%s', "", "$chipState/$chipDistStr");
-        write_table_cell($class, '%s', "", "$camState/$camDistStr");
-        write_table_cell($class, '%s', "", "$warpState/$warpDistStr");
-        write_table_cell($class, '%s', "", $stackDistStr);
-        write_table_cell($class, '%s', "", $wsDistStr);
-        write_table_cell($class, '%s', "", $ww1DistStr);
-        write_table_cell($class, '%s', "", $ww2DistStr);
-        write_table_cell($class, '%s', "", $ssDistStr);
+        $color = getColour($ssDiffProduced[$exp_id], $ssDiffDist[$exp_id]);
+        echo "<TD bgcolor=\"$color\" >$ssDistStr</td>";
 
         echo "</tr>\n";
@@ -216,4 +227,14 @@
 }
 
+###########################################################################
+#
+# Gets the right cell colour provided number created and distributed 
+#
+###########################################################################
+function getColour($created, $distributed) {
+
+    if ($distributed > 0 && $created > 0 && $distributed % $created != 0) return "red";
+    return "";
+}
 
 ###########################################################################
