Index: /trunk/ippMonitor/raw/czartool_labels.php
===================================================================
--- /trunk/ippMonitor/raw/czartool_labels.php	(revision 30950)
+++ /trunk/ippMonitor/raw/czartool_labels.php	(revision 30951)
@@ -59,9 +59,68 @@
 if ($plotType == "") { $plotType = "linear"; }
 
-
-// header block
-echo "<head>";
+// deal with reverts: turn on or off if requested and pass current revert state for this stage onto labels table later
+if ($selectedRevertStage && $selectedRevertMode) turnRevertsOnOff($czardb, $selectedRevertStage, $selectedRevertMode);
+
+// tell selected server to stop or run
+if ($selectedServer && $serverCmd) serverStopRun($czardb, $selectedServer,  $serverCmd);
+
+// tell all servers to stop or run
+if ($allServerCmd) {
+
+    foreach ($servers as &$server) serverStopRun($czardb, $server,  $allServerCmd);
+}
+
+
+$debug = 0;
+
+$stdsLabels = getLabels($czardb, "stdscience");
+$distLabels = getLabels($czardb, "distribution");
+$pubLabels = getLabels($czardb, "publishing");
+$updateLabels = getLabels($czardb, "update");
+
+if ($debug) {
+    echo "prog returned $status, and output:<br>";
+    for ($i = 0; $i < count($distLabels); $i++) {
+        echo "$distLabels[$i]<br>";
+    }
+}
+
+
+// set up the form
+echo "<form action=\"czartool_labels.php\" method=\"POST\">\n";
+
+echo "<input type=\"hidden\" name=\"pass\" value=\"$pass\">\n";
+echo "<input type=\"hidden\" name=\"proj\" value=\"$proj\">\n";
+echo "<input type=\"hidden\" name=\"menu\" value=\"$menu\">\n";
+echo "</form>\n";
+
+echo "<table border=\"0\">";
+
+echo "<tr>";
+echo "<td colspan=\"2\" style=\"background-color:#0080c0;\">";
 echo "<h1 align=\"middle\">Czartool</h1>";
-echo "</head>";
+echo "</td>";
+echo "</tr>";
+
+echo "<tr valign=\"top\">";
+echo "<td style=\"background-color:#EEEEEE;width:100px;text-align:top;\">";
+ # time series plot
+ echo "<img src=\"czartool_getplot.php?type=t&label=$selectedLabel&stage=$selectedStage&plottype=$plotType\"><br>";
+ # rate time series plot
+ echo "<img src=\"czartool_getplot.php?type=rt&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>";
+ # rate stacked histo plot
+ echo "<img src=\"czartool_getplot.php?type=rh&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>";
+ # histogram plot
+ echo "<img src=\"czartool_getplot.php?type=h&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>";
+ # storage timeseries
+ echo "<img src=\"czartool_getplot.php?type=st\"><br>";
+ # storage plot
+ echo "<img src=\"czartool_getplot.php?type=s\"><br>";
+ # pantasks server status, if requested
+ if ($selectedServer && !$serverCmd) showServerStatus($selectedServer);
+echo "</td>";
+echo "<td style=\"background-color:#EEEEEE;height:200px;width:400px;text-align:top;\">";
+
+echo "<br><br>";
 
 // status table at top
@@ -83,68 +142,6 @@
 echo "</table>\n";
 
-// deal with reverts: turn on or off if requested and pass current revert state for this stage onto labels table later
-if ($selectedRevertStage && $selectedRevertMode) turnRevertsOnOff($czardb, $selectedRevertStage, $selectedRevertMode);
-
-// tell selected server to stop or run
-if ($selectedServer && $serverCmd) serverStopRun($czardb, $selectedServer,  $serverCmd);
-
-// tell all servers to stop or run
-if ($allServerCmd) {
-
-    foreach ($servers as &$server) serverStopRun($czardb, $server,  $allServerCmd);
-}
-
-
-$debug = 0;
-
-$stdsLabels = getLabels($czardb, "stdscience");
-$distLabels = getLabels($czardb, "distribution");
-$pubLabels = getLabels($czardb, "publishing");
-$updateLabels = getLabels($czardb, "update");
-
-if ($debug) {
-    echo "prog returned $status, and output:<br>";
-    for ($i = 0; $i < count($distLabels); $i++) {
-        echo "$distLabels[$i]<br>";
-    }
-}
-
-
-// set up the form
-echo "<form action=\"czartool_labels.php\" method=\"POST\">\n";
-
-echo "<input type=\"hidden\" name=\"pass\" value=\"$pass\">\n";
-echo "<input type=\"hidden\" name=\"proj\" value=\"$proj\">\n";
-echo "<input type=\"hidden\" name=\"menu\" value=\"$menu\">\n";
-echo "</form>\n";
-
-echo "<table border="0">";
-
-echo "<tr>";
-echo "<td colspan=\"2\" style=\"background-color:#FFA500;\">";
-echo "<h1>Main Title of Web Page</h1>";
-echo "</td>";
-echo "</tr>";
-
-echo "<tr valign=\"top\">";
-echo "<td style=\"background-color:#FFD700;width:100px;text-align:top;\">";
-echo "<b>Menu</b><br />";
-echo "HTML<br/>";
-echo "CSS<br/>";
-echo "JavaScript";
-echo "</td>";
-echo "<td style=\"background-color:#EEEEEE;height:200px;width:400px;text-align:top;\">";
-echo "<table>\n";
-
- # 1st row
-  echo "<tr>\n";
-   echo "<td> \n";
-    echo "<table>\n";
-     echo "<tr valign=center>\n";
-      echo "<td> \n";
-       # timeseries plot
-       echo "<img src=\"czartool_getplot.php?type=t&label=$selectedLabel&stage=$selectedStage&plottype=$plotType\"><br>";
-      echo "</td>\n";
-      echo "<td>\n";
+echo "<br><br>";
+
        createLabelsTable($pass, 
          $proj, 
@@ -160,20 +157,6 @@
          $selectedStage, 
          $plotType);
-      echo "</td>\n";
-    echo "</tr>\n";
-   echo "</table>\n";
-  echo "</td> \n";
- echo "</tr>\n";
-
- # 2nd row
- echo "<tr>\n";
-  echo "<td> \n";
-   echo "<table>\n";
-    echo "<tr valign=center>\n";
-     echo "<td> \n";
-      # rate plot
-      echo "<img src=\"czartool_getplot.php?type=rt&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>";
-     echo "</td>\n";
-     echo "<td>\n";
+
+echo "<br><br>";
       createLabelsTable($pass, 
          $proj, 
@@ -189,92 +172,25 @@
          $selectedStage, 
          $plotType);
-     echo "</td>\n";
-    echo "</tr>\n";
-   echo "</table>\n";
-  echo "</td> \n";
- echo "</tr>\n";
- 
-
- # 3rd row
- echo "<tr>\n";
-  echo "<td> \n";
-   echo "<table>\n";
-    echo "<tr valign=top>\n";
-     echo "<td> \n";
-      # histogram plot
-      echo "<img src=\"czartool_getplot.php?type=h&label=$selectedLabel&stage=$selectedStage&plottype=linear\"><br>";
-     echo "</td>\n";
-     echo "<td>\n";
+echo "<br><br>";
       createServersTable($pass, $proj,$czardb, $servers, $selectedLabel, $selectedStage, $plotType);
-     echo "</td>\n";
- 
-     echo "<td> \n";
-      $today = date("Y-m-d");
-      createSummitDataTable($gpc1db, $today);
-     echo "</td>\n";
-    echo "</tr>\n";
-   echo "</table>\n";
-  echo "</td> \n";
- echo "</tr>\n";
-
- # 4th row
- echo "<tr>\n";
-  echo "<td> \n";
-   echo "<table>\n";
-    echo "<tr valign=top>\n";
-     echo "<td> \n";
-      # storage plot
-      echo "<img src=\"czartool_getplot.php?type=s\"><br>";
-     echo "</td>\n";
-     echo "<td>\n";
-
-      echo "<table>\n";
-       echo "<tr>\n";
-         echo "<td>\n";
-          createDatesTable($czardb);
-         echo "</td>\n";
-       echo "</tr>\n";
-       echo "<tr>\n";
-         echo "<td>\n";
-          createPStampDataTable();
-         echo "</td>\n";
-       echo "</tr>\n";
-       echo "<tr>\n";
-         echo "<td>\n";
-               if ($selectedServer && !$serverCmd) showServerStatus($selectedServer);
-         echo "</td>\n";
-       echo "</tr>\n";
-       echo "<tr>\n";
-         echo "<td>\n";
-          # This is awful
-          echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
-          echo "<tr>";
-          echo "<th colspan=\"2\">Database replication status (update fix log <a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Replication_Issues\">here</a>)</th>";
-          echo "<tr>";
-          echo "<th>Database</th>";
-          echo "<th>Status</th>";
-          showReplicationsStatus($REPL_HOST_GPC1, $REPL_USER_GPC1, $REPL_PASSWORD_GPC1, $REPL_DBNAME_GPC1);
-          showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_DBNAME_NEBULOUS);
-          showReplicationsStatus($REPL_HOST_PSTAMP, $REPL_USER_PSTAMP, $REPL_PASSWORD_PSTAMP, $REPL_DBNAME_PSTAMP);
-          echo "</table>";
-         echo "</td>\n";
-       echo "</tr>\n";
-      echo "</table>\n";
-
-     echo "</td>\n";
-    echo "</tr>\n";
-   echo "</table>\n";
-  echo "</td> \n";
- echo "</tr>\n";
-
-echo "</td>";
-echo "</tr>";
-
-echo "<tr>";
-echo "<td colspan=\"2\" style=\"background-color:#FFA500;text-align:center;\">";
-echo "Copyright Â© 2011 W3Schools.com</td>";
-echo "</tr>";
-
-echo "</table>";
+echo "<br><br>";
+      createSummitDataTable($gpc1db);
+echo "<br><br>";
+      createDatesTable($czardb);
+echo "<br><br>";
+      createPStampDataTable();
+echo "<br><br>";
+      # This is awful
+      echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
+      echo "<tr>";
+      echo "<th colspan=\"2\">Database replication status (update fix log <a href=\"http://svn.pan-starrs.ifa.hawaii.edu/trac/ipp/wiki/Replication_Issues\">here</a>)</th>";
+      echo "<tr>";
+      echo "<th>Database</th>";
+      echo "<th>Status</th>";
+      showReplicationsStatus($REPL_HOST_GPC1, $REPL_USER_GPC1, $REPL_PASSWORD_GPC1, $REPL_DBNAME_GPC1);
+      showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_DBNAME_NEBULOUS);
+      showReplicationsStatus($REPL_HOST_PSTAMP, $REPL_USER_PSTAMP, $REPL_PASSWORD_PSTAMP, $REPL_DBNAME_PSTAMP);
+      echo "</table>";
+
 echo "</table>";
 
@@ -300,5 +216,5 @@
 
     // set up the table
-    echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
+    echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     echo "<tr>";
     echo "<th colspan=\"3\">Postage stamp requests</th>";
@@ -329,6 +245,7 @@
 #
 ###########################################################################
-function createSummitDataTable($gpc1db, $date) {
-
+function createSummitDataTable($gpc1db) {
+
+    $date = date("Y-m-d");
     $sql = "SELECT DISTINCT exp_type FROM summitExp WHERE dateobs > '$date'";
 
@@ -341,5 +258,5 @@
 
     // set up the table
-    echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
+    echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     echo "<tr>";
     echo "<th colspan=\"3\">Status of last night's data</th>";
@@ -429,5 +346,5 @@
 
     // setup table
-    echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
+    echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     echo "<tr>\n";
     echo "<th colspan=\"13\">";
@@ -722,5 +639,5 @@
 function createDatesTable($db) {
 
-    echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
+    echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     echo "<tr>\n";
     echo "<th colspan=\"3\">Current dates for selected pantasks servers</th>";
@@ -776,5 +693,5 @@
 
     // set up table columns
-    echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
+    echo "<table align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     echo "<tr>";
     echo "<th colspan=\"3\">Pantasks server status</th>";
