Index: trunk/Mars/datacenter/db/fact_runinfo.php
===================================================================
--- trunk/Mars/datacenter/db/fact_runinfo.php	(revision 12929)
+++ trunk/Mars/datacenter/db/fact_runinfo.php	(revision 12930)
@@ -19,9 +19,10 @@
             //don't put a '#' at the beginning of the alias, else SortBy won't work anymore
             $query0 .= " COUNT(*) as 'NumRuns', ";
-            $query0 .= " Round(Sum(TimeDiff(fRunStop,fRunStart))/60./60.,1) as 'Time [h]' ";
-        }
-        else
-        {
-            $query0 .= " Concat(fRunNumber,'_', LPAD(fFileNumber, 3, 0)) as 'Run' ";
+            //$query0 .= " Round(Sum(TimeDiff(fRunStop,fRunStart))/60./60.,2) as 'Time [h]' ";
+            $query0 .= " Sec_to_time(Sum(Time_to_sec(TimeDiff(fRunStop,fRunStart)))) as 'Time<br>[hh:mm:ss]' ";
+        }
+        else
+        {
+            $query0 .= " Concat(fNight,'_', LPAD(fRunID, 3, 0)) as 'Run' ";
 
             foreach ($_GET as $key => $element)
@@ -33,6 +34,6 @@
             if (!empty($_GET["fComments"]))
             {
-                $query0 .= ", if (Count(fComment)>0, Concat('<a&ws;id=\'commentcell', fRunNUmber, fFileNumber, '\'&ws;href=\'run_comment.php?fRunNumber=',fRunNumber,'&fFileNumber=', fFileNumber, '\'&ws;onmouseover=\'get_comments(', fRunNumber, ',', fFileNumber, ')\'>', Count(fComment), '</a>'), ' ') ";
-                //$query0 .= ", if (Count(fComment)>0, Concat('<a&ws;href=\'run_comment.php?fRunNumber=',fRunNumber,'&fFileNumber=', fFileNumber, '\'&ws;onmouseover=\'bla\'>', Count(fComment), '</a>'), ' ') ";
+                $query0 .= ", if (Count(fComment)>0, Concat('<a&ws;id=\'commentcell', fNight, fRunID, '\'&ws;href=\'run_comment.php?fNight=',fNight,'&fRunID=', fRunID, '\'&ws;onmouseover=\'get_comments(', fNight, ',', fRunID, ')\'>', Count(fComment), '</a>'), ' ') ";
+                //$query0 .= ", if (Count(fComment)>0, Concat('<a&ws;href=\'run_comment.php?fNight=',fNight,'&fRunID=', fRunID, '\'&ws;onmouseover=\'bla\'>', Count(fComment), '</a>'), ' ') ";
                 $query0 .= " as 'Comments'";
             }
@@ -45,5 +46,5 @@
             if (($_GET[$key]=="On" || $groups>0))// && !empty($joins[$key]))
                 $query0 .= GetJoin($fromtable, $key);
-        $query0 .= " LEFT JOIN RunComments USING (fRunNumber, fFileNumber) ";
+        $query0 .= " LEFT JOIN RunComments USING (fNight, fRunID) ";
 
         foreach ($checkwhere as $key => $element)
@@ -71,8 +72,8 @@
         {
             $startdate=substr($_GET["fStartDate"], 0, 10);
-            if ($startdate=="0000-00-00")
-                $query0 .=" fRunNumber >= " . $startdate . " ";
-            else
-                $query0 .= " fRunNumber >= " . $startdate . " - 1 ";
+//            if ($startdate=="0000-00-00")
+                $query0 .=" fNight >= " . $startdate . " ";
+//            else
+//                $query0 .= " fNight >= " . $startdate . " - 1 ";
         }
 
@@ -83,5 +84,5 @@
 
             $stopdate=substr($_GET["fStopDate"], 0, 10);
-            $query0 .= " AND fRunNumber <= " . $stopdate . "  ";
+            $query0 .= " AND fNight <= " . $stopdate . "  ";
         }
 
@@ -99,5 +100,5 @@
         }
         else
-            $query0 .= " GROUP BY fRunNumber, fFileNumber ";
+            $query0 .= " GROUP BY fNight, fRunID ";
 
 
@@ -128,5 +129,5 @@
 
         if (empty($_GET["fNumResults"]))
-            $_GET["fNumResults"]="20";
+            $_GET["fNumResults"]="200";
             
         if (empty($_GET["fNumEvents"]))
@@ -181,6 +182,12 @@
             $_GET["fFitsFileErrors"]=$first?"Off":"";
 
-        if (empty($_GET["fHasDrsFile"]))
-            $_GET["fHasDrsFile"]=$first?"Off":"";
+        if (empty($_GET["fCompileTime"]))
+            $_GET["fCompileTime"]=$first?"Off":"";
+
+        if (empty($_GET["fRevisionNumber"]))
+            $_GET["fRevisionNumber"]=$first?"Off":"";
+
+        if (empty($_GET["if(fHasDrsFile=0,\"N\",fDrsStep)"]))
+            $_GET["if(fHasDrsFile=0,\"N\",fDrsStep)"]=$first?"Off":"";
 
         if (empty($_GET["fMd5sumRaw"]))
@@ -197,5 +204,5 @@
 
         if (empty($_GET["fThresholdMedian"]))
-            $_GET["fThresholdMedian"]=$first?"Off":"";
+            $_GET["fThresholdMedian"]=$first?"On":"";
 
         if (empty($_GET["fBiasVoltageMedian"]))
@@ -207,4 +214,10 @@
         if (empty($_GET["fDeclination"]))
             $_GET["fDeclination"]=$first?"Off":"";
+
+        if (empty($_GET["fZenithDistanceMean"]))
+            $_GET["fZenithDistanceMean"]=$first?"On":"";
+
+        if (empty($_GET["fAzimuthMean"]))
+            $_GET["fAzimuthMean"]=$first?"On":"";
 
     }
@@ -255,5 +268,8 @@
         CheckBox("fROITimeMarker",    "roi-tm");
         CheckBox("fFitsFileErrors",   "file err");
-        CheckBox("fHasDrsFile",       "num drs");
+        CheckBox("fCompileTime",      "compiled");
+        CheckBox("fRevisionNumber",      "rev#");
+        //CheckBox("if(fHasDrsFile=0,\"N\",\"Y\")", "drs");
+        CheckBox("if(fHasDrsFile=0,\"N\",fDrsStep)", "drs");
         CheckBox("fMd5sumRaw",         "md5");
         CheckBox("fMd5sumRawZip",      "md5(gz)");
@@ -267,4 +283,6 @@
         CheckBox("fRightAscension",    "RA");
         CheckBox("fDeclination",    "Dec");
+        CheckBox("fZenithDistanceMean",    "ZdMean");
+        CheckBox("fAzimuthMean",    "AzMean");
 
         printf("  </tr>\n");
@@ -273,10 +291,10 @@
 
         if (empty($_GET["fStartDate"]))
-            $timemin = GetMin("fRunNumber", "RunInfo", $host, $user, $pw, $db);
+            $timemin = GetMin("fNight", "RunInfo", $host, $user, $pw, $db);
         else
             $timemin = $_GET["fStartDate"];
 
         if (empty($_GET["fStopDate"]))
-            $timemax = GetMax("fRunnumber", "RunInfo", $host, $user, $pw, $db);
+            $timemax = GetMax("fNight", "RunInfo", $host, $user, $pw, $db);
         else
             $timemax = $_GET["fStopDate"];
