Changeset 7578


Ignore:
Timestamp:
03/08/06 04:26:20 (19 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7577 r7578  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
    20  2006/03/06 Daniela Dorner
     20 2006/03/08 Daniela Dorner
    2121
    2222   * datacenter/script/movingrawfiles:
    2323     - added moving of files, that are transferred via internet
    2424     - added removing of empty directories
     25
     26   * datacenter/db/ganymed.php:
     27     - added links to ganymedplots
     28     - added links to sequence.php (instead of links to starfiles)
     29     - fixed bug in query
     30
     31   * datacenter/db/sequence.php:
     32     - added links to plots from callisto and star
     33     - fixed bug in query
     34
     35   * datacenter/db/sequinfo.php:
     36     - added links to sequence.php
     37
     38   * datacenter/db/datasetinfo.php:
     39     - added links to ganymed.php
     40
     41   * datacenter/db/tabs.php:
     42     - added (includefile for names of tabs of statusdisplays)
     43
    2544
    2645
  • trunk/MagicSoft/Mars/datacenter/db/datasetinfo.php

    r7556 r7578  
    4242                {
    4343                    $query0 .= ", CONCAT('<A&ws;HREF=\"http://www.astro.uni-wuerzburg.de/datacenter/datasets/' , LEFT(LPAD(CONCAT(DataSets.fDataSetNumber, '.'), 9,'0'),5), '/dataset', LPAD(CONCAT(DataSets.fDataSetNumber , '.txt'), 12,'0') , '\">f</A>' ";
    44                     $query0 .= ", '&nbsp;<A&ws;HREF=\"http://www.astro.uni-wuerzburg.de/datacenter/ganymed/' , LEFT(LPAD(CONCAT(DataSets.fDataSetNumber, '.'), 9,'0'),5), '/', LEFT(LPAD(CONCAT(DataSets.fDataSetNumber, '.'), 9,'0'), 8), '\">g</A>')";
     44                    $query0 .= ", '&nbsp;<A&ws;HREF=\"http://www.astro.uni-wuerzburg.de/datacenter/ganymed/' , LEFT(LPAD(CONCAT(DataSets.fDataSetNumber, '.'), 9,'0'),5), '/', LEFT(LPAD(CONCAT(DataSets.fDataSetNumber, '.'), 9,'0'), 8), '\">g</A>'";
     45                    $query0 .= ", '&nbsp;<A&ws;HREF=\"ganymed.php?fDataSetNo=', DataSets.fDataSetNumber, '\">i</A>') ";
    4546                    $query0 .= " as 'Links'";
    4647                }
  • trunk/MagicSoft/Mars/datacenter/db/ganymed.php

    r7571 r7578  
    2020        $query0 .= " LEFT JOIN Ganymed ON DataSets.fDataSetNumber=Ganymed.fDataSetNumber ";
    2121
    22         $query0 .= " WHERE DataSets.fDataSetNumber between " . $_GET["fRunMin"] . " and " . $_GET["fRunMax"] ;
     22        if (!empty($_GET["fRunMin"]) && !empty($_GET["fRunMax"]))
     23            $query0 .= " WHERE DataSets.fDataSetNumber between " . $_GET["fRunMin"] . " and " . $_GET["fRunMax"] ;
    2324        if (!empty($_GET["fDataSetNo"]))
    24             $query0 .= " AND DataSets.fDataSetNumber='" . $_GET["fDataSetNo"] . "'";
    25         $query0 .= " AND fSourceName REGEXP \"^" . $_GET["fSourceN"] . "\" ";
     25        {
     26            if (strpos($query0, " WHERE ")==FALSE)
     27                $query0 .= " WHERE ";
     28            else
     29                $query0 .= " AND ";
     30            $query0 .= " DataSets.fDataSetNumber='" . $_GET["fDataSetNo"] . "'";
     31        }
     32        if (!empty($_GET["fSourceN"]))
     33        {
     34            if (strpos($query0, " WHERE ")==FALSE)
     35                $query0 .= " WHERE ";
     36            else
     37                $query0 .= " AND ";
     38            $query0 .= " fSourceName REGEXP \"^" . $_GET["fSourceN"] . "\" ";
     39        }
    2640        $query0 .= " ORDER BY DataSets.fDataSetNumber ";
    2741
     
    117131        return "there is an error -> tell Dani";
    118132    }
    119 /*
    120     function GetSequences($datasetfile)
    121 //    function QueryRuns($type, $sequ, $db_id, $db)
    122     {
    123         printf(" <td align='left'>");
    124         printf(" to be done");
    125         printf(" </td>\n");
    126         printf(" <td> to be done ");
    127         printf(" </td>\n");
    128      }
    129 
    130     function QueryMissingFiles($sequ, $db_id, $db)
    131     {
    132         $query2  = "SELECT fSequenceFirst FROM SequencesSequenceProcessStatus ";
    133         $query2 .= " WHERE fSequenceFirst=" . $sequ . " AND IsNull(fStar)";
    134 
    135         mysql_select_db($db);
    136         $files = mysql_query($query2, $db_id);
    137         $numfiles = mysql_num_rows($files);
    138         printf(" <td align='left'>");
    139         for ($i=0 ; $i<$numfiles ; $i++)
    140         {
    141             $file=mysql_result($files, $i, 0);
    142             if ($i!=0)
    143                 printf(", ");
    144             printf(" %s ", $file);
    145         }
    146         printf(" </td>\n");
    147      }
    148 */
    149 
    150     function PrintDataSetInfo($result0)
     133
     134    function PrintDataSetInfo($result0, $ganymedtabs)
    151135    {
    152136        $numres = mysql_num_rows($result0);
     
    234218                    $sequences=split(" ", trim($sequon));
    235219                    foreach($sequences as $key => $sequ)
    236                     {
    237                         $sequno=sprintf("%08d",$sequ);
    238                         $sequno2=substr($sequno,0,4);
    239                         printf("<a href=\"http://www.astro.uni-wuerzburg.de/datacenter/star/%s/%s/\">%s</a> ",
    240                                $sequno2, $sequno, $sequ);
    241                     }
     220                        printf("<a href=\"sequence.php?fSequenceNo=%s&fAll=On\">%s</a> ", $sequ, $sequ);
    242221                    printf("</td></tr>");
    243222
     
    247226                        $sequences=split(" ", trim($sequoff));
    248227                        foreach($sequences as $key => $sequ)
    249                         {
    250                             $sequno=sprintf("%08d",$sequ);
    251                             $sequno2=substr($sequno,0,4);
    252                             printf("<a href=\"http://www.astro.uni-wuerzburg.de/datacenter/star/%s/%s/\">%s</a> ",
    253                                    $sequno2, $sequno, $sequ);
    254                         }
     228                            printf("<a href=\"sequence.php?fSequenceNo=%s&fAll=On\">%s</a> ", $sequ, $sequ);
     229                        printf("</td></tr>");
    255230                    }
    256231                }
    257232            }
     233            printf("<tr><td colspan=\"6\">\n Plots: ");
     234            foreach($ganymedtabs as $key => $element)
     235                if (!$key==0)
     236                    printf("<a href=\"http://www.astro.uni-wuerzburg.de/datacenter/ganymed/%s/%s/ganymed%s-tab%s.png\">%s</a> ", $num2, $num, $num, $key, $element);
     237
     238            printf("</td></tr>");
    258239
    259240            if ($_GET["fAll"]=="On" && !is_null($ganymed))
     
    276257    }
    277258
    278     function PrintPage($html, $host, $user, $pw, $db)
     259    function PrintPage($html, $host, $user, $pw, $db, $ganymedtabs)
    279260    {
    280261        $db_id = mysql_connect($host, $user, $pw);
     
    293274        {
    294275            if ($html=="1" || $html=="2")
    295                 PrintDataSetInfo($result0);
     276                PrintDataSetInfo($result0, $ganymedtabs);
    296277            else
    297278                PrintText($result0);
     
    307288    include ("include.php");
    308289    include ("db.php");
     290    include ("tabs.php");
    309291
    310292    ini_set("display_errors", "On");
     
    316298        header("Content-Disposition: attachment; filename=query-result.txt");
    317299
    318         PrintPage("0", $host, $user, $pw, $db);
     300        PrintPage("0", $host, $user, $pw, $db, $ganymedtabs);
    319301    }
    320302    else
     
    333315        {
    334316            if (empty($_GET["fPrintTable"]))
    335                 PrintPage("1", $host, $user, $pw, $db);
    336             else
    337                 PrintPage("2", $host, $user, $pw, $db);
     317                PrintPage("1", $host, $user, $pw, $db, $ganymedtabs);
     318            else
     319                PrintPage("2", $host, $user, $pw, $db, $ganymedtabs);
    338320        }
    339321
  • 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
  • trunk/MagicSoft/Mars/datacenter/db/sequinfo.php

    r7556 r7578  
    5656                        $query0 .= ", '&nbsp;<A&ws;HREF=\"http://www.astro.uni-wuerzburg.de/datacenter/star/' , LEFT(LPAD(CONCAT(Sequences.fSequenceFirst, '.'), 9,'0'),4), '/', LPAD(CONCAT(Sequences.fSequenceFirst, '/'), 9,'0'), 'star', LPAD(CONCAT(Sequences.fSequenceFirst , '.html'), 13,'0') , '\">sl</A>'";
    5757                        $query0 .= ", '&nbsp;<A&ws;HREF=\"http://www.astro.uni-wuerzburg.de/datacenter/star/' , LEFT(LPAD(CONCAT(Sequences.fSequenceFirst, '.'), 9,'0'),4), '/', LPAD(CONCAT(Sequences.fSequenceFirst, '/'), 9,'0'), '\">s</A>'";
    58                         $query0 .= ", '&nbsp;<A&ws;HREF=\"http://www.astro.uni-wuerzburg.de/datacenter/sequences/' , LEFT(LPAD(CONCAT(Sequences.fSequenceFirst, '.'), 9,'0'),4), '/sequence', LPAD(CONCAT(Sequences.fSequenceFirst , '.txt'), 12,'0') , '\">', 'f </A>') ";
     58                        $query0 .= ", '&nbsp;<A&ws;HREF=\"http://www.astro.uni-wuerzburg.de/datacenter/sequences/' , LEFT(LPAD(CONCAT(Sequences.fSequenceFirst, '.'), 9,'0'),4), '/sequence', LPAD(CONCAT(Sequences.fSequenceFirst , '.txt'), 12,'0') , '\">', 'f </A>' ";
     59                        $query0 .= ", '&nbsp;<A&ws;HREF=\"sequence.php?fSequenceNo=', Sequences.fSequenceFirst , '&fAll=On\">i</A>') ";
    5960                        $query0 .= " as 'Links'";
    6061                    }
Note: See TracChangeset for help on using the changeset viewer.