Index: trunk/ippMonitor/Makefile.in
===================================================================
--- trunk/ippMonitor/Makefile.in	(revision 28718)
+++ trunk/ippMonitor/Makefile.in	(revision 28724)
@@ -14,6 +14,4 @@
 PROGRAMS = \
 $(DESTBIN)/skyplot.dvo \
-$(DESTBIN)/czartool_getLabels.pl \
-$(DESTBIN)/czartool_checkServer.pl \
 $(DESTBIN)/czartool_getServerStatus.pl \
 $(DESTBIN)/czartool_revert.pl \
@@ -55,6 +53,5 @@
 $(DESTWWW)/ipp.czartool.dat \
 $(DESTWWW)/czartool_labels.php \
-$(DESTWWW)/czartool_servers.php \
-$(DESTWWW)/czartool_summit.php \
+$(DESTWWW)/czartool_getplot.php \
 $(DESTWWW)/histogram.php \
 $(DESTWWW)/show_and_delete_image.php \
Index: trunk/ippMonitor/raw/czartool_getplot.php
===================================================================
--- trunk/ippMonitor/raw/czartool_getplot.php	(revision 28724)
+++ trunk/ippMonitor/raw/czartool_getplot.php	(revision 28724)
@@ -0,0 +1,28 @@
+<?php
+
+$debug = 0;
+include 'site.php';
+
+### these need to be set to the correct locations!!
+$MISSING = "missing.png";
+
+### we must have been past arguments with GET:
+if ($_SERVER[REQUEST_METHOD] != 'GET') {
+    exit ();
+}
+
+$label  = $_GET[label];
+$type = $_GET[type];
+
+$filePath = "/home/panstarrs/rhenders/czarplot_".$label."_".$type.".png";
+
+$file = fopen ($filePath, "r");
+if ($file && !$debug) {
+    header ('Content-Type: image/png');
+    fpassthru ($file);
+}
+
+exit();
+
+?>
+~                                 
Index: trunk/ippMonitor/raw/czartool_labels.php
===================================================================
--- trunk/ippMonitor/raw/czartool_labels.php	(revision 28718)
+++ trunk/ippMonitor/raw/czartool_labels.php	(revision 28724)
@@ -28,14 +28,11 @@
 $menu = $ID['menu'];
 
-$userSelection = $_GET[selection];
+$selectedLabel = $_GET[label];
 $selectedServer = $_GET[server];
-
-if ($userSelection == "") {$userSelection = $_POST['state'];}
-if ($userSelection == "") {$userSelection = "new";}
-
-// anything to revert?
-$revertServer = $_GET[server];
-$revertStage = $_GET[stage];
+$revertServer = $_GET[revertserver];
+$revertStage = $_GET[revertstage];
 $revertMode = $_GET[revert];
+
+if ($selectedLabel == "") $selectedLabel = "all_labels";
 
 if ($revertStage != "" && $revertMode != "" && $revertServer != "" )
@@ -81,23 +78,38 @@
 echo "NOTE: This data is good as of: $lastUpdateTime </p>";
 
-createLabelsTable($pass, $proj, $czardb, $stdsLabels, $distLabels, $pubLabels, $stages, $states, "new");
-
 echo "<table>\n";
-echo "<tr>\n";
-echo "<td style=\"width: 50%;\">\n";
-
-$today = date("Y-m-d");                         // 03.10.01
-showSummitData($gpc1db, $today);
-
-echo "</td>\n";
-echo "<td> \n";
-
-createServersTable($pass, $proj,$czardb, $servers);
-
-echo "</td?\n";
-echo "</tr>\n";
+  echo "<tr>\n";
+
+    echo "<td> \n";
+      echo "<img src=\"czartool_getplot.php?type=t&label=$selectedLabel\"><br>\n";
+    echo "</td>\n";
+
+    echo "<td> \n";
+      createLabelsTable($pass, $proj, $czardb, $stdsLabels, $distLabels, $pubLabels, $stages, $states, "new", $selectedLabel);
+    echo "</td>\n";
+
+  echo "</tr>\n";
+  echo "<tr>\n";
+
+echo "<table>\n";
+  echo "<tr valign=top>\n";
+    echo "<td> \n";
+      echo "<img src=\"czartool_getplot.php?type=h&label=$selectedLabel\"><br>\n";
+    echo "</td>\n";
+    echo "<td> \n";
+      createServersTable($pass, $proj,$czardb, $servers);
+    echo "</td>\n";
+
+    echo "<td> \n";
+      $today = date("Y-m-d");                         // 03.10.01
+      showSummitData($gpc1db, $today);
+    echo "</td>\n";
+  echo "</tr>\n";
 echo "</table>\n";
-
 if ($selectedServer) showServerStatus($selectedServer);
+
+  echo "</tr>\n";
+echo "</table>\n";
+
 
 menu_end();
@@ -143,6 +155,6 @@
 
         if ($expType[0] == "OBJECT") {
-            if ($summit[0] == $mhpcc[0]) $msg = "All science exposures taken since $date have been registered at MHPCC";
-            else $msg = "Warning: Not all science exposures taken since $date have been registered at MHPCC";
+            if ($summit[0] == $mhpcc[0]) $msg = "All science exposures taken since $date<br>have been registered at MHPCC";
+            else $msg = "Warning: Not all science exposures taken since $date<br>have been registered at MHPCC";
         }
 
@@ -166,5 +178,6 @@
 function getLabels($db, $server) {
 
-    $sql = "SELECT label FROM current_labels WHERE server LIKE '$server'";
+    # order by descending priority as set in gpc1 database
+    $sql = "SELECT label FROM current_labels WHERE server LIKE '$server' ORDER BY priority DESC";
     if ($debug) {echo "$sql<br>";}
 
@@ -184,5 +197,5 @@
 #
 ###########################################################################
-function createLabelsTable($pass, $proj, $db, $stdsLabels, $distLabels, $pubLabels, $stages, $states, $selectedState) {
+function createLabelsTable($pass, $proj, $db, $stdsLabels, $distLabels, $pubLabels, $stages, $states, $selectedState, $selectedLabel) {
 
     // set up table columns
@@ -200,5 +213,5 @@
         else $server = "stdscience";
         $reverting = getRevertStatus($db, $stage);
-        $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&server=" . $server . "&stage=" . $stage . "&revert=";
+        $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&revertserver=" . $server . "&revertstage=" . $stage . "&revert=";
         if(!$reverting) {$label =  "Start";$link = $link . "on";}
         if($reverting) {$label = "Stop";$link = $link . "off";}
@@ -209,11 +222,13 @@
     echo "</tr>\n";
     echo "<tr><td></td>\n";
-    write_header_cell($class, "label");
-    write_header_cell($class, "distributing?");
-    write_header_cell($class, "publishing?");
+    write_header_cell($class, "Label (in order of priority)");
+    write_header_cell($class, "Distributing?");
+    write_header_cell($class, "Publishing?");
     foreach ($stages as &$stage) write_header_cell($class, $stage);
 
     echo "</tr>\n";
     echo "<tr><td></td>\n";
+
+    $defaultlink = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj;
 
     // write rows
@@ -232,7 +247,6 @@
 
         // create link to label summary page for each label
-        //$link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&selection=" . $stdsLabel;
-        $link = "";
-        $defaultlink = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj;
+        if ($stdsLabel == $selectedLabel) $link = "";
+        else $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=" . $stdsLabel;
 
         echo "<tr><td></td>\n";
@@ -283,9 +297,54 @@
     }
 
+    if ($selectedLabel == "all_labels") $link = "";
+    else  $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&label=all_labels";
+
+    echo "<tr><td></td>\n";
+    write_table_cell($class, '%s', $link, "All labels:");
+    write_table_cell($class, '%s', "", "-");
+    write_table_cell($class, '%s', "", "-");
+
+    $str = "";
+    $anyFaults = false; 
+
+    $link = "chipProcessedImfile_failure.php?pass=" . $pass . "&proj=" . $proj . "&chipRun.state=new";
+    getStateAndFaults($db, "all_labels", $selectedState, "chip", $str, $anyFaults);
+    write_table_cell($class, '%s', $anyFaults ? $link : "", $str);
+
+    $link = "camProcessedExp_failure.php?pass=" . $pass . "&proj=" . $proj . "&camRun.state=new";
+    getStateAndFaults($db, "all_labels", $selectedState, "cam", $str, $anyFaults);
+    write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
+
+    $link = $defaultlink;
+    getStateAndFaults($db, "all_labels", $selectedState, "fake", $str, $anyFaults);
+    write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
+
+    $link = "warpFailedSkyfiles.php?pass=" . $pass . "&proj=" . $proj . "&warpRun.state=new";
+    getStateAndFaults($db, "all_labels", $selectedState, "warp", $str, $anyFaults);
+    write_table_cell($class, '%s',  $anyFaults ? $link : "",  $str);
+
+    $link = "stackFailedSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&stackRun.state=new";
+    getStateAndFaults($db, "all_labels", $selectedState, "stack", $str, $anyFaults);
+    write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
+
+    $link = "diffFailedSkyfile.php?pass=" . $pass . "&proj=" . $proj . "&diffRun.state=new";
+    getStateAndFaults($db, "all_labels", $selectedState, "diff", $str, $anyFaults);
+    write_table_cell($class, '%s',  $anyFaults ? $link : "",  $str);
+
+    $link = $defaultlink;
+    getStateAndFaults($db, "all_labels", $selectedState, "magic", $str, $anyFaults);
+    write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
+
+    $link = $defaultlink;
+    getStateAndFaults($db, "all_labels", $selectedState, "magicDS", $str, $anyFaults);
+    write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
+
+    $link = $defaultlink;
+    getStateAndFaults($db, "all_labels", $selectedState, "dist", $str, $anyFaults);
+    write_table_cell($class, '%s',  $anyFaults ? $link : "", $str);
+
+
     echo "</tr>\n";
     echo "</table>\n";
-
-    echo "<p> - Click on a fault to find logfile<br>";
-    echo "- Click on column header to turn reverts on or off </p>";
 }
 
@@ -357,5 +416,5 @@
 
         $link = "czartool_labels.php?pass=" . $pass . "&proj=" . $proj . "&server=" . $server;
-  //      $link = "";
+        //      $link = "";
 
         getServerStatus($db, $server, $alive, $running);
