Ignore:
Timestamp:
03/08/06 04:26:20 (19 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/db/sequence.php

    r7546 r7578  
    5252        $query0 .= " LEFT JOIN Star ON Sequences.fSequenceFirst=Star.fSequenceFirst ";
    5353
    54         $query0 .= " WHERE Sequences.fSequenceFirst between " . $_GET["fRunMin"] . " and " . $_GET["fRunMax"] ;
     54
     55        if (!empty($_GET["fRunMin"]) && !empty($_GET["fRunMax"]))
     56            $query0 .= " WHERE Sequences.fSequenceFirst between " . $_GET["fRunMin"] . " and " . $_GET["fRunMax"] ;
    5557        if (!empty($_GET["fSequenceNo"]))
    56             $query0 .= " AND Sequences.fSequenceFirst='" . $_GET["fSequenceNo"] . "'";
    57         $query0 .= " AND fSourceName REGEXP \"^" . $_GET["fSourceN"] . "\" ";
     58        {
     59            if (strpos($query0, " WHERE ")==FALSE)
     60                $query0 .= " WHERE ";
     61            else
     62                $query0 .= " AND ";
     63            $query0 .= " Sequences.fSequenceFirst='" . $_GET["fSequenceNo"] . "'";
     64        }
     65        if (!empty($_GET["fSourceN"]))
     66        {
     67            if (strpos($query0, " WHERE ")==FALSE)
     68                $query0 .= " WHERE ";
     69            else
     70                $query0 .= " AND ";
     71            $query0 .= " fSourceName REGEXP \"^" . $_GET["fSourceN"] . "\" ";
     72        }
    5873        $query0 .= " ORDER BY Sequences.fSequenceFirst ";
    5974
     
    198213
    199214
    200     function PrintSequenceInfo($result0, $db_id, $db)
     215    function PrintSequenceInfo($result0, $db_id, $db, $calibtabs, $signaltabs, $startabs)
    201216    {
    202217        $numres = mysql_num_rows($result0);
     
    211226        {
    212227            $firstrun=mysql_result($result0, $i, 0);
     228            $num=sprintf("%08d",$firstrun);
     229            $num2=substr($num,0,4);
    213230            $lastrun=mysql_result($result0, $i, 1);
    214231            $source=mysql_result($result0, $i, 2);
     
    270287            printf(" <table BORDER=\"1\">");
    271288            printf(" <tr BGCOLOR='#C0C0C0'>\n");
    272             printf(" <th><u>Sequence#:</u> %s </th>", $firstrun);
     289            printf(" <th>Sequence#: <a href=\"http://www.astro.uni-wuerzburg.de/datacenter/sequences/%s/sequence%s.txt\">%s</a> </th>", $num2, $num, $firstrun);
    273290            printf(" </tr><tr BGCOLOR='#D0D0D0' ALIGN='left'>\n");
    274291            printf(" <th> %s, %s, zd: %s&deg;-%s&deg;, %.2fmin ",
     
    460477                    printf(" </tr>");
    461478                    printf(" </table>");
     479
     480                    printf("</td></tr><tr><td>");
    462481                }
     482
     483
     484                printf(" <table BORDER=\"1\">");
     485                printf(" <tr BGCOLOR='#C0C0C0'>");
     486                printf(" <th>plots</th>\n");
     487                printf(" <tr><td>calib: ");
     488                foreach($calibtabs as $key => $element)
     489                    if (!$key==0)
     490                        printf("<a href=\"http://www.astro.uni-wuerzburg.de/datacenter/callisto/%s/%s/calib%s-tab%s.png\">%s</a> ", $num2, $num, $num, $key, $element);
     491                printf("</td></tr>");
     492                printf(" <tr><td>signal: ");
     493                foreach($signaltabs as $key => $element)
     494                    if (!$key==0)
     495                        printf("<a href=\"http://www.astro.uni-wuerzburg.de/datacenter/callisto/%s/%s/signal%s-tab%s.png\">%s</a> ", $num2, $num, $num, $key, $element);
     496                printf("</td></tr>");
     497                printf(" <tr><td>star: ");
     498                foreach($startabs as $key => $element)
     499                    if (!$key==0)
     500                        printf("<a href=\"http://www.astro.uni-wuerzburg.de/datacenter/star/%s/%s/star%s-tab%s.png\">%s</a> ", $num2, $num, $num, $key, $element);
     501                printf("</td></tr>");
     502
     503                printf(" </tr>");
     504                printf(" </table>");
    463505
    464506                printf(" <table BORDER=\"1\">");
     
    510552    }
    511553
    512     function PrintPage($html, $host, $user, $pw, $db)
     554    function PrintPage($html, $host, $user, $pw, $db, $calibtabs, $signaltabs, $startabs)
    513555    {
    514556        $db_id = mysql_connect($host, $user, $pw);
     
    527569        {
    528570            if ($html=="1" || $html=="2")
    529                 PrintSequenceInfo($result0, $db_id, $db);
     571                PrintSequenceInfo($result0, $db_id, $db, $calibtabs, $signaltabs, $startabs);
    530572            else
    531573                PrintText($result0);
     
    541583    include ("include.php");
    542584    include ("db.php");
     585    include ("tabs.php");
    543586
    544587    ini_set("display_errors", "On");
     
    550593        header("Content-Disposition: attachment; filename=query-result.txt");
    551594
    552         PrintPage("0", $host, $user, $pw, $db);
     595        PrintPage("0", $host, $user, $pw, $db, $calibtabs, $signaltabs, $startabs);
    553596    }
    554597    else
     
    567610        {
    568611            if (empty($_GET["fPrintTable"]))
    569                 PrintPage("1", $host, $user, $pw, $db);
     612                PrintPage("1", $host, $user, $pw, $db, $calibtabs, $signaltabs, $startabs);
    570613            else
    571                 PrintPage("2", $host, $user, $pw, $db);
     614                PrintPage("2", $host, $user, $pw, $db, $calibtabs, $signaltabs, $startabs);
    572615        }
    573616
Note: See TracChangeset for help on using the changeset viewer.