Index: /trunk/Mars/datacenter/db/run_comment.php
===================================================================
--- /trunk/Mars/datacenter/db/run_comment.php	(revision 12694)
+++ /trunk/Mars/datacenter/db/run_comment.php	(revision 12695)
@@ -3,6 +3,4 @@
     ini_set("display_errors", "On");
     ini_set("mysql.trace_mode", "On");
-
-    echo (file_get_contents("index-header.html"));
 
     if (empty($_GET["fMode"]))
@@ -14,4 +12,7 @@
     if (empty($_GET["fRunNumber"]))
         $_GET["fRunNumber"]=date("Ymd", time()-(12*60*60));
+
+    if (strcmp($_GET["fMode"], "tooltip")!=0)
+        echo (file_get_contents("index-header.html"));
 
 
@@ -84,29 +85,32 @@
     //
     include("db.php");
-    printf("With this page, you can \n");
-    //view mode
-    if (strcmp($_GET["fMode"], "view")==0)
-        printf("view,\n");
-    else
-        printf("<a href='%s'>view</a>,\n", str_replace($_GET["fMode"], 'view', $_SERVER['REQUEST_URI']));
-    //update mode
-    if (strcmp($_GET["fMode"], "update")==0)
-        printf("update and\n");
-    else
-        printf("<a href='%s'>update</a> and \n", str_replace($_GET["fMode"], 'update', $_SERVER['REQUEST_URI']));
-    //insert mode
-    if (strcmp($_GET["fMode"], "insert")==0)
-        printf("insert\n");
-    else
-        printf("<a href='%s'>insert</a> \n", str_replace($_GET["fMode"], 'insert', $_SERVER['REQUEST_URI']));
-    printf("entries in the table <b>RunComment</b> from the DB <b>%s</b>.<br><br>\n", $db);
+    if (strcmp($_GET["fMode"], "tooltip")!=0)
+    {
+        printf("With this page, you can \n");
+        //view mode
+        if (strcmp($_GET["fMode"], "view")==0)
+            printf("view,\n");
+        else
+            printf("<a href='%s'>view</a>,\n", str_replace($_GET["fMode"], 'view', $_SERVER['REQUEST_URI']));
+        //update mode
+        if (strcmp($_GET["fMode"], "update")==0)
+            printf("update and\n");
+        else
+            printf("<a href='%s'>update</a> and \n", str_replace($_GET["fMode"], 'update', $_SERVER['REQUEST_URI']));
+        //insert mode
+        if (strcmp($_GET["fMode"], "insert")==0)
+            printf("insert\n");
+        else
+            printf("<a href='%s'>insert</a> \n", str_replace($_GET["fMode"], 'insert', $_SERVER['REQUEST_URI']));
+        printf("entries in the table <b>RunComment</b> from the DB <b>%s</b>.<br><br>\n", $db);
 
-    //insert field for run number
-    printf("<form action=\"run_comment.php\" METHOD=\"GET\">\n");
-    printf("Run#&nbsp;(YYYYMMDD_FFF)&nbsp;<input name=\"fRunNumber\" type=\"text\" size=\"8\" maxlength=\"8\" value=\"%s\">\n", $_GET["fRunNumber"]);
-    printf("_ <input name=\"fFileNumber\" type=\"text\" size=\"3\" maxlength=\"3\" value=\"%s\">\n", $_GET["fFileNumber"]);
-    printf("<input type='hidden' name='fMode' value='%s'>", $_GET["fMode"]);
-    printf("<input type='submit' value='Get Comments'><br><br>\n");
-    printf("</form>\n");
+        //insert field for run number
+        printf("<form action=\"run_comment.php\" METHOD=\"GET\">\n");
+        printf("Run#&nbsp;(YYYYMMDD_FFF)&nbsp;<input name=\"fRunNumber\" type=\"text\" size=\"8\" maxlength=\"8\" value=\"%s\">\n", $_GET["fRunNumber"]);
+        printf("_ <input name=\"fFileNumber\" type=\"text\" size=\"3\" maxlength=\"3\" value=\"%s\">\n", $_GET["fFileNumber"]);
+        printf("<input type='hidden' name='fMode' value='%s'>", $_GET["fMode"]);
+        printf("<input type='submit' value='Get Comments'><br><br>\n");
+        printf("</form>\n");
+    }
 
     $db_id = mysql_pconnect($host, $user, $pw);
@@ -121,34 +125,43 @@
     $query1 .= "WHERE fRunNumber=".$_GET["fRunNumber"]." AND fFileNumber=".$_GET["fFileNumber"];
     $result1=mysql_query($query1, $db_id);
-    printf("Found %d comment(s).<br>", mysql_num_rows($result1));
-    printf("<table BORDER='0' style='margin-top:1ex'>");
-    $col   = FALSE;
-    printf("<tr BGCOLOR='#C0C0C0'><td>Run#</td><td>Comment</td></tr>");
+    printf("Found %d comment(s).\n\n", mysql_num_rows($result1));
+    if (strcmp($_GET["fMode"], "tooltip")!=0)
+    {
+        printf("<br>\n");
+        printf("<table BORDER='0' style='margin-top:1ex'>");
+        $col   = FALSE;
+        printf("<tr BGCOLOR='#C0C0C0'><td>Run#</td><td>Comment</td></tr>");
+    }
     while ($row1 = mysql_fetch_row($result1))
     {
-        if (!$col)
-            printf("<tr BGCOLOR='#E0E0E0'>\n");
-        else
-            printf("<tr BGCOLOR='#D0D0D0'>\n");
-        $col = !$col;
+        if (strcmp($_GET["fMode"], "tooltip")!=0)
+        {
+            if (!$col)
+                printf("<tr BGCOLOR='#E0E0E0'>\n");
+            else
+                printf("<tr BGCOLOR='#D0D0D0'>\n");
+            $col = !$col;
 
-        if (strcmp($_GET["fMode"], "update")==0)
-            printf("<form style='display:inline' action=\"run_comment.php\" METHOD=\"GET\">\n");
-        printf("<td>\n%s\n</td>\n", $row1[0]);
-        if (strcmp($_GET["fMode"], "update")==0)
-        {
-            printf("<td>\n");
-            printf("<input type='text' size='50' maxlength='255' name='fComment' value='%s'>\n", htmlspecialchars($row1[1],ENT_QUOTES));
-            printf("<input type='hidden' name='fOldComment' value='%s'>\n", htmlspecialchars($row1[1],ENT_QUOTES));
-            printf("<input type='hidden' name='fMode' value='%s'>\n", $_GET["fMode"]);
-            printf("<input type='hidden' name='fRunNumber' value='%s'>\n", $_GET["fRunNumber"]);
-            printf("<input type='hidden' name='fFileNumber' value='%s'>\n", $_GET["fFileNumber"]);
-            printf("<input type='submit' value='Update Comment'>\n");
-            printf("</td>\n");
-            printf("</form>\n");
+            if (strcmp($_GET["fMode"], "update")==0)
+                printf("<form style='display:inline' action=\"run_comment.php\" METHOD=\"GET\">\n");
+            printf("<td>\n%s\n</td>\n", $row1[0]);
+            if (strcmp($_GET["fMode"], "update")==0)
+            {
+                printf("<td>\n");
+                printf("<input type='text' size='50' maxlength='255' name='fComment' value='%s'>\n", htmlspecialchars($row1[1],ENT_QUOTES));
+                printf("<input type='hidden' name='fOldComment' value='%s'>\n", htmlspecialchars($row1[1],ENT_QUOTES));
+                printf("<input type='hidden' name='fMode' value='%s'>\n", $_GET["fMode"]);
+                printf("<input type='hidden' name='fRunNumber' value='%s'>\n", $_GET["fRunNumber"]);
+                printf("<input type='hidden' name='fFileNumber' value='%s'>\n", $_GET["fFileNumber"]);
+                printf("<input type='submit' value='Update Comment'>\n");
+                printf("</td>\n");
+                printf("</form>\n");
+            }
+            else
+                printf("<td>\n%s\n</td>\n", $row1[1]);
+            printf("</tr>\n");
         }
         else
-            printf("<td>\n%s\n</td>\n", $row1[1]);
-        printf("</tr>\n");
+            printf("%s_%s: %s\n", $_GET["fRunNumber"], $_GET["fFileNumber"], $row1[1]);
     }
     //insert mode
@@ -168,5 +181,6 @@
         printf("</tr>\n");
     }
-    printf("</table>");
+    if (strcmp($_GET["fMode"], "tooltip")!=0)
+        printf("</table>");
 
     if (strcmp($_GET["fMode"], "update")==0)
@@ -176,5 +190,6 @@
     mysql_close($db_id);
 
-    echo (file_get_contents("index-footer.html"));
+    if (strcmp($_GET["fMode"], "tooltip")!=0)
+        echo (file_get_contents("index-footer.html"));
 
     ini_set("display_errors", "Off");
