Index: trunk/MagicSoft/Mars/datacenter/db/plotinclude.php
===================================================================
--- trunk/MagicSoft/Mars/datacenter/db/plotinclude.php	(revision 9458)
+++ trunk/MagicSoft/Mars/datacenter/db/plotinclude.php	(revision 9466)
@@ -197,4 +197,47 @@
 }
 
+function getinfofromdb($seq)
+{
+    include("db.php");
+
+    $db_id = mysql_pconnect($host, $user, $pw);
+    if ($db_id==FALSE)
+    {
+        printf("mysql_connect returned the following error: %s\n", mysql_error());
+        die("");
+    }
+    mysql_select_db($db);
+
+    $query0  = "SELECT fSequenceFirst ";
+    $query0 .= ", DATE_FORMAT(ADDDATE(fRunStart,Interval 12 hour), '%Y-%m-%d') as 'ObsNight'";
+    $query0 .= ", fSourceName ";
+    $query0 .= ", fZenithDistanceMin ";
+    $query0 .= ", fZenithDistanceMax ";
+    $query0 .= ", fMeanPedRmsInner ";
+    $query0 .= ", fRunTime/60 as 'UpTime' ";
+    $query0 .= ", if(isnull(fStar), 'N/A', if(isnull(fRateSumEvts), 'no', CONCAT('yes (',fRateSumEvts, ')'))) as 'Sum' ";
+    $query0 .= "FROM Sequences ";
+    $query0 .= "LEFT JOIN Source USING(fSourceKEY) ";
+    $query0 .= "LEFT JOIN Calibration USING(fSequenceFirst) ";
+    $query0 .= "LEFT JOIN Star USING(fSequenceFirst) ";
+    $query0 .= "LEFT JOIN SequenceProcessStatus USING(fSequenceFirst) ";
+    $query0 .= "WHERE fSequenceFirst=".$seq;
+
+//    echo $query0;
+
+    $result0 = mysql_query($query0, $db_id);
+    while ($row0 = mysql_fetch_assoc($result0))
+        $info="<b>".$row0["fSourceName"]."</b> ".$row0["ObsNight"]
+            ." (".$row0["UpTime"]."min)"
+            ." Zd: ".$row0["fZenithDistanceMin"]."-".$row0["fZenithDistanceMax"]
+            ." PedRmsIn: ".$row0["fMeanPedRmsInner"]
+            ." SumTrigger: ".$row0["Sum"];
+
+    mysql_free_result($result0);
+    mysql_close($db_id);
+
+    return $info;
+}
+
 function PrintType2Pulldown($type2)
 {
