Changeset 9249 for trunk


Ignore:
Timestamp:
01/23/09 17:27:58 (16 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9243 r9249  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21
     22 2009/01/23 Daniela Dorner
     23
     24   * datacenter/db/showplots-ds.php, datacenter/db/tabs.php,
     25     datacenter/db/plot.php:
     26     - adapted path to new web file structure
     27
     28   * datacenter/db/sequinfo-aio.php, datacenter/db/runinfo-aio.php:
     29     - added option to group by date (year, month, night): pulldown in
     30       menu and adapted query
     31
     32   * datacenter/db/sequinfo-aio.php, datacenter/db/runinfo-aio.php
     33     datacenter/db/datasetinfo-aio.php:
     34     - enabled possibility to combine all group-bys
     35
     36   * datacenter/db/datasetinfo-aio.php:
     37     - enhances information printed in table in case of group-by
     38
     39   * datacenter/db/include.php:
     40     - adapted pulldown of status-group-by
     41
     42   * datacenter/db/menu.php:
     43     - added pulldown for sumtrigger-flag to sequinfo-menu
     44     - added function to print pulldown for group-by date
     45
    2046
    2147
  • trunk/MagicSoft/Mars/NEWS

    r9239 r9249  
    4848   * Websites: added option to query only sequences containing sumtrigger
    4949     events
     50
     51   * Websites: added option to group by date (year, month, night) for runs
     52     and sequences and enabled that combining of different group-bys,
     53     e.g. status, date and source is possible
    5054
    5155 ;automatic analyis
  • trunk/MagicSoft/Mars/datacenter/db/datasetinfo-aio.php

    r9154 r9249  
    1717        $query0 = "SELECT ";
    1818
    19         if ($groups>0)
    20         {
    21             foreach ($checkgroup as $key => $element)
    22                 if ($element==-1)
    23                     $query0 .=  $key . " as '" . $alias[$key] . "' " . ", ";
    24             $query0 .= " COUNT(*) as '# Datasets' ";
    25         }
    26         else
    27         {
     19        if ($groups>0 || $statusgroups>0)
     20        {
     21            if ($groups>0)
     22            {
     23                foreach ($checkgroup as $key => $element)
     24                    if ($element==-1)
     25                        $query0 .=  $key . " as '" . $alias[$key] . "' " . ", ";
     26                $query0 .= " COUNT(*) as '# Datasets', ";
     27            }
     28
     29            //--------------------------------------------------
     30            $query0 .= "SUM(fRunTime)/3600 as '" . $alias["SUM(fRunTime)/3600"] . "', ";
     31            //--------------------------------------------------
     32            $query0 .= " Min(fZenithDistanceMin) as '" . $alias["Min(fZenithDistanceMin)"] . "', ";
     33            $query0 .= " Max(fZenithDistanceMax) as '" . $alias["Max(fZenithDistanceMax)"] . "', ";
     34            $query0 .= " COUNT(*) as '# Sequ' ";
     35
    2836            if ($statusgroups>0)
    2937            {
    3038                foreach ($checkstatusgroup as $key => $element)
    3139                    if ($element==-1)
    32                         $query0 .= " (if(IsNull(" . $key . "), if(isnull(fStartTime), 'not done', if(isnull(fFailedTime),if(isnull(" . $needs[$key] . "),'not done',if(date_sub(Now(),interval 12 hour) < fStartTime,'running','crashed')),if(isnull(" . $needs[$key] . "),'not done','failed'))) ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', ";
     40                        $query0 .= ", (if(IsNull(" . $key . "), if(isnull(fStartTime), 'not done', if(isnull(fFailedTime),if(isnull(" . $needs[$key] . "),'not done',if(date_sub(Now(),interval 12 hour) < fStartTime,'running','crashed')),if(isnull(" . $needs[$key] . "),'not done','failed'))) ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "' ";
    3341//                        $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', ";
    3442
    35                 $query0 .= " COUNT(*) as '# Datasets'";
     43                $query0 .= ", COUNT(*) as '# Datasets'";
    3644
    3745            }
    38             else
     46        }
     47        else
     48        {
     49            $query0 .= " " . $fromtable . ".fDataSetNumber as '" . $alias["fDataSetNumber"] . "' ";
     50            if (!empty($_GET["fLinks"]))
    3951            {
    40                 $query0 .= " " . $fromtable . ".fDataSetNumber as '" . $alias["fDataSetNumber"] . "' ";
    41                 if (!empty($_GET["fLinks"]))
    42                 {
    43 //                    $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>'";
    45 //                    $query0 .= ", '&nbsp;<A&ws;HREF=\"ganymed.php?fDataSetNo=', DataSets.fDataSetNumber, '\">i</A>') ";
    46                     $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>' ";
    47                     $query0 .= ", '&nbsp;<A&ws;HREF=\"tabs.php?t=ganymed&n=' , fDataSetNumber, '\">g</A>'";
    48                     $query0 .= ", '&nbsp;<A&ws;HREF=\"tabs.php?t=gplotdb&n=' , fDataSetNumber, '\">pdb</A>'";
    49 //                    $query0 .= ", '&nbsp;<A&ws;HREF=\"ganymed.php?fDataSetNo=', DataSets.fDataSetNumber, '\">i</A>' ";
    50                     $query0 .= ") as 'Links'";
    51                 }
    52 
    53                 foreach ($_GET as $key => $element)
    54                     if ($_GET[$key]=="On")
    55                         if ($key!="fLinks")
    56                             if (empty($checkwhere[$key]) || $checkwhere[$key]==0)
    57                                 $query0 .= ", " . $key . " as '" . $alias[$key] . "' ";
     52                //$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>' ";
     53                //$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>'";
     54                //$query0 .= ", '&nbsp;<A&ws;HREF=\"ganymed.php?fDataSetNo=', DataSets.fDataSetNumber, '\">i</A>') ";
     55                $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>' ";
     56                $query0 .= ", '&nbsp;<A&ws;HREF=\"tabs.php?t=ganymed&n=' , fDataSetNumber, '\">g</A>'";
     57                $query0 .= ", '&nbsp;<A&ws;HREF=\"tabs.php?t=gplotdb&n=' , fDataSetNumber, '\">pdb</A>'";
     58                //$query0 .= ", '&nbsp;<A&ws;HREF=\"ganymed.php?fDataSetNo=', DataSets.fDataSetNumber, '\">i</A>' ";
     59                $query0 .= ") as 'Links'";
    5860            }
     61
     62            foreach ($_GET as $key => $element)
     63                if ($_GET[$key]=="On")
     64                    if ($key!="fLinks")
     65                        if (empty($checkwhere[$key]) || $checkwhere[$key]==0)
     66                            $query0 .= ", " . $key . " as '" . $alias[$key] . "' ";
    5967        }
    6068
     
    120128        if ($statusgroups>0)
    121129        {
    122             $query0 .= " GROUP BY ";
     130            if (strpos($query0, " GROUP BY ")==FALSE)
     131                $query0 .= " GROUP BY  ";
     132            else
     133                $query0 .= ",  ";
    123134            $num = $statusgroups;
    124135            foreach ($checkstatusgroup as $key => $element)
  • trunk/MagicSoft/Mars/datacenter/db/include.php

    r9184 r9249  
    8484
    8585    $status = array
    86         ( 0 => "all",
     86        ( 0 => "ALL",
    8787          1 => "done",
    8888          2 => "not done",
     
    9191          5 => "failed",
    9292          6 => "crashed",
    93           7 => "group by",
     93          7 => "GROUP BY",
    9494        );
    9595
  • trunk/MagicSoft/Mars/datacenter/db/menu.php

    r9218 r9249  
    161161    printf("  </td><td>\n");
    162162    printf("  </td><td>\n");
    163     PrintPullDown($host, $user, $pw, $db, "SumTriggerFlag",              "fSumTriggerFlagName",                  "fSumTriggerFlagKEY",              "SumTrigger Flag");
     163    PrintPullDown($host, $user, $pw, $db, "SumTriggerFlag",              "fSumTriggerFlagName",              "fSumTriggerFlagKEY",              "SumTrigger Flag");
    164164//    printf("  </td><td>\n");
    165165//    PrintPullDown($host, $user, $pw, $db, "ManuallyChanged",             "fManuallyChangedName",             "fManuallyChangedKEY",             "Manually changed");
     
    564564}
    565565
     566function PrintGroupByDateMenu()
     567{
     568    printf("Group by Date ");
     569    printf("<select name='fGroupByDate' size='1' class='Width'>\n");
     570    if (empty($_GET["fGroupByDate"]) || $_GET["fGroupByDate"]==0)
     571        printf("    <option value='0' selected>--- NO GROUP BY ---</option>\n");
     572    else
     573        printf("    <option value='0'>--- NO GROUP BY ---</option>\n");
     574    $dates=array("Year", "Month","Night");
     575    foreach ($dates as $date)
     576    {
     577        if ($_GET["fGroupByDate"]==$date)
     578            printf("    <option value='%s' selected> %s </option>\n", $date, $date);
     579        else
     580            printf("    <option value='%s'> %s </option>\n", $date, $date);
     581    }
     582    printf("   </select>\n");
     583}
     584
    566585function PrintSourceMenu($host,$user,$pw,$db)
    567586{
  • trunk/MagicSoft/Mars/datacenter/db/plot.php

    r8466 r9249  
    11<?php
    2     require_once("../phpchartdir.php");
     2    require_once("./phpchartdir.php");
    33
    44include("plotinclude.php");
  • trunk/MagicSoft/Mars/datacenter/db/runinfo-aio.php

    r9150 r9249  
    1717        $query0 = "SELECT ";
    1818
    19         if ($groups>0)
     19        if ($groups>0 || ((!empty($_GET["fGroupByDate"])) && !$_GET["fGroupByDate"]==0) || $statusgroups>0)
    2020        {
    2121            foreach ($checkgroup as $key => $element)
    2222                if ($element==-1)
    2323                    $query0 .=  $key . " as '" . $alias[$key] . "' " . ", ";
     24
     25            if ((!empty($_GET["fGroupByDate"])) && !$_GET["fGroupByDate"]==0)
     26            {
     27                $query0 .= " DATE_FORMAT(ADDDATE(fRunStart,Interval 12 hour), '";
     28                switch($_GET["fGroupByDate"])
     29                {
     30                case "Year":
     31                    $query0 .= "%Y ";
     32                    break;
     33                case "Month":
     34                    $query0 .= "%Y-%m ";
     35                    break;
     36                case "Night":
     37                    $query0 .= "%Y-%m-%d ";
     38                    break;
     39                }
     40                $query0 .= "')  AS GroupByDate, ";
     41            }
     42
    2443            //--------------------------------------------------
    2544            //$query0 .= " TIMEDIFF(fRunStop, fRunStart), ";
     
    3352            $query0 .= " Max(fZenithDistance) as '" . $alias["Max(fZenithDistance)"] . "', ";
    3453            $query0 .= " COUNT(*) as '# Runs' ";
    35         }
    36         else
    37         {
     54
    3855            if ($statusgroups>0)
    3956            {
    4057                foreach ($checkstatusgroup as $key => $element)
    4158                    if ($element==-1)
    42                         $query0 .= " (if(IsNull(" . $key . "), if(isnull(fStartTime), 'not done', if(isnull(fFailedTime),if(isnull(" . $needs[$key] . "),'not done',if(date_sub(Now(),interval 12 hour) < fStartTime,'running','crashed')),if(isnull(" . $needs[$key] . "),'not done','failed'))) ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', ";
     59                        $query0 .= ", (if(IsNull(" . $key . "), if(isnull(fStartTime), 'not done', if(isnull(fFailedTime),if(isnull(" . $needs[$key] . "),'not done',if(date_sub(Now(),interval 12 hour) < fStartTime,'running','crashed')),if(isnull(" . $needs[$key] . "),'not done','failed'))) ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "' ";
    4360//                        $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', ";
    4461
    45                 $query0 .= " count(*) as '# Runs'";
     62                $query0 .= ", COUNT(*) AS '# Runs'";
    4663
    4764            }
    48             else
     65        }
     66        else
     67        {
     68            //$query0 .= " RunData.fRunNumber as 'Run#' ";
     69            //$query0 .= " Concat(RunData.fTelescopeNumber,':', RunData.fRunNumber,':', RunData.fFileNumber) as 'Run' ";
     70            $query0 .= " Concat('M', RunData.fTelescopeNumber,':', LPAD(RunData.fRunNumber,8, ' '),'/', LPAD(RunData.fFileNumber, 3, ' ')) as 'Tel:Run/File' ";
     71
     72            if (empty($_GET["fSendTxt"]) && !empty($_GET["fLinks"]))
    4973            {
    50 //                $query0 .= " RunData.fRunNumber as 'Run#' ";
    51 //                $query0 .= " Concat(RunData.fTelescopeNumber,':', RunData.fRunNumber,':', RunData.fFileNumber) as 'Run' ";
    52                 $query0 .= " Concat('M', RunData.fTelescopeNumber,':', LPAD(RunData.fRunNumber,8, ' '),'/', LPAD(RunData.fFileNumber, 3, ' ')) as 'Tel:Run/File' ";
    53 
    54                 if (empty($_GET["fSendTxt"]) && !empty($_GET["fLinks"]))
    55                 {
    56                     $query0 .= ", CONCAT('<A&ws;HREF=\"queryrbk.php?fNight=', date_format(adddate(fRunStart, interval +13 HOUR), '%Y-%m-%d') , '&amp;fDate=2\">rbk</A>') ";
    57                     $query0 .= " as 'Links'";
    58                 }
    59 
    60                 foreach ($_GET as $key => $element)
    61                     if ($key!="fLinks" && $_GET[$key]=="On" && $key!="fTest")
    62                         if (empty($checkwhere[$key]) || $checkwhere[$key]==0)
    63                             $query0 .= ", " . $key . " as '" . $alias[$key] . "' ";
     74                $query0 .= ", CONCAT('<A&ws;HREF=\"queryrbk.php?fNight=', date_format(adddate(fRunStart, interval +13 HOUR), '%Y-%m-%d') , '&amp;fDate=2\">rbk</A>') ";
     75                $query0 .= " as 'Links'";
    6476            }
     77
     78            foreach ($_GET as $key => $element)
     79                if ($key!="fLinks" && $_GET[$key]=="On" && $key!="fTest")
     80                    if (empty($checkwhere[$key]) || $checkwhere[$key]==0)
     81                        $query0 .= ", " . $key . " as '" . $alias[$key] . "' ";
    6582        }
    6683
     
    165182        }
    166183
     184        if ((!empty($_GET["fGroupByDate"])) && !$_GET["fGroupByDate"]==0)
     185            if (strpos($query0, " GROUP BY ")==FALSE)
     186                $query0 .= " GROUP BY GroupByDate ";
     187            else
     188                $query0 .= ", GroupByDate ";
     189
    167190        if ($statusgroups>0)
    168191        {
    169             $query0 .= " GROUP BY ";
     192            if (strpos($query0, " GROUP BY ")==FALSE)
     193                $query0 .= " GROUP BY  ";
     194            else
     195                $query0 .= ",  ";
    170196            $num = $statusgroups;
    171197            foreach ($checkstatusgroup as $key => $element)
     
    264290        printf(" <P>\n");
    265291        PrintSourceMenu($host,$user,$pw,$db);
     292        PrintGroupByDateMenu();
    266293        printf("<p>");
    267294        printf("</div>");
  • trunk/MagicSoft/Mars/datacenter/db/sequinfo-aio.php

    r9175 r9249  
    1717        $query0 = "SELECT ";
    1818
    19         if ($groups>0)
    20         {
    21             foreach ($checkgroup as $key => $element)
    22                 if ($element==-1)
    23                     $query0 .=  $key . " as '" . $alias[$key] . "' " . ", ";
     19        if ($groups>0 || ((!empty($_GET["fGroupByDate"])) && !$_GET["fGroupByDate"]==0) || $statusgroups>0)
     20        {
     21            if ($groups>0)
     22                foreach ($checkgroup as $key => $element)
     23                    if ($element==-1)
     24                        $query0 .=  $key . " as '" . $alias[$key] . "' " . ", ";
     25
     26            if ((!empty($_GET["fGroupByDate"])) && !$_GET["fGroupByDate"]==0)
     27            {
     28                $query0 .= " DATE_FORMAT(ADDDATE(fRunStart,Interval 12 hour), '";
     29                switch($_GET["fGroupByDate"])
     30                {
     31                case "Year":
     32                    $query0 .= "%Y ";
     33                    break;
     34                case "Month":
     35                    $query0 .= "%Y-%m ";
     36                    break;
     37                case "Night":
     38                    $query0 .= "%Y-%m-%d ";
     39                    break;
     40                }
     41                $query0 .= "')  AS GroupByDate, ";
     42            }
     43
    2444            //--------------------------------------------------
    2545            $query0 .= "SUM(fRunTime)/3600 as '" . $alias["SUM(fRunTime)/3600"] . "', ";
     
    2949            $query0 .= " Max(fZenithDistanceMax) as '" . $alias["Max(fZenithDistanceMax)"] . "', ";
    3050            $query0 .= " COUNT(*) as '# Sequ' ";
    31         }
    32         else
    33         {
     51
    3452            if ($statusgroups>0)
    3553            {
    3654                foreach ($checkstatusgroup as $key => $element)
    3755                    if ($element==-1)
    38                         $query0 .= " (if(IsNull(" . $key . "), if(isnull(fStartTime), 'not done', if(isnull(fFailedTime),if(isnull(" . $needs[$key] . "),'not done',if(date_sub(Now(),interval 12 hour) < fStartTime,'running','crashed')),if(isnull(" . $needs[$key] . "),'not done','failed'))) ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', ";
     56                        $query0 .= ", (if(IsNull(" . $key . "), if(isnull(fStartTime), 'not done', if(isnull(fFailedTime),if(isnull(" . $needs[$key] . "),'not done',if(date_sub(Now(),interval 12 hour) < fStartTime,'running','crashed')),if(isnull(" . $needs[$key] . "),'not done','failed'))) ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "' ";
    3957//                        $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', ";
    4058
    41                 $query0 .= " COUNT(*) as '# Sequ'";
     59                $query0 .= ", COUNT(*) as '# Sequ'";
    4260
    4361            }
     62        }
     63        else
     64        {
     65            if (!empty($_GET["fSendTxt"]))
     66                $query0 .= " " . $fromtable . ".fSequenceFirst as '" . $alias["fSequenceFirst"] . "' ";
    4467            else
    4568            {
    46                 if (!empty($_GET["fSendTxt"]))
    47                     $query0 .= " " . $fromtable . ".fSequenceFirst as '" . $alias["fSequenceFirst"] . "' ";
    48                 else
     69                //old version using fRunMin, fRunMax
     70                //$query0 .= " CONCAT('<A&ws;HREF=\"runinfo-aio.php?',  'fRunStart=On', '&amp;fZenithDistance=On', '&amp;fRunMin=', Sequences.fSequenceFirst, '&amp;fMeanTriggerRate=On', '&amp;fTest=On', '&amp;fRunTypeName=On', '&amp;fRunMax=', fSequenceLast, '&amp;fNumEvents=On', '&amp;fSourceName=On&amp;', 'fExcludedFDAKEY=1', '&amp;fSequenceFirst=On', '&amp;fRawFileAvail=On', '&amp;fCCFileAvail=On', '&amp;fCaCoFileAvail=On', '&amp;fNumResults=500\">', Sequences.fSequenceFirst, '</A>') ";
     71                //new version using fSequenceNo
     72                $query0 .= " CONCAT('<A&ws;HREF=\"runinfo-aio.php?',  'fRunStart=On', '&amp;fZenithDistance=On', '&amp;fSequenceNo=', Sequences.fSequenceFirst, '&amp;fMeanTriggerRate=On', '&amp;fTest=On', '&amp;fRunTypeName=On', '&amp;fNumEvents=On', '&amp;fSourceName=On&amp;', 'fExcludedFDAKEY=1', '&amp;fSequenceFirst=On', '&amp;fRawFileAvail=On', '&amp;fCCFileAvail=On', '&amp;fCaCoFileAvail=On', '&amp;fNumResults=500\">', 'M', Sequences.fTelescopeNumber, ':', LPAD(Sequences.fSequenceFirst, 8, ' '), '</A>') ";
     73                //$query0 .= " as " . $alias["fSequenceFirst"];
     74                $query0 .= " as 'Tel:Sequ'";
     75                if (!empty($_GET["fLinks"]))
    4976                {
    50                     //old version using fRunMin, fRunMax
    51                     //$query0 .= " CONCAT('<A&ws;HREF=\"runinfo-aio.php?',  'fRunStart=On', '&amp;fZenithDistance=On', '&amp;fRunMin=', Sequences.fSequenceFirst, '&amp;fMeanTriggerRate=On', '&amp;fTest=On', '&amp;fRunTypeName=On', '&amp;fRunMax=', fSequenceLast, '&amp;fNumEvents=On', '&amp;fSourceName=On&amp;', 'fExcludedFDAKEY=1', '&amp;fSequenceFirst=On', '&amp;fRawFileAvail=On', '&amp;fCCFileAvail=On', '&amp;fCaCoFileAvail=On', '&amp;fNumResults=500\">', Sequences.fSequenceFirst, '</A>') ";
    52                     //new version using fSequenceNo
    53                     $query0 .= " CONCAT('<A&ws;HREF=\"runinfo-aio.php?',  'fRunStart=On', '&amp;fZenithDistance=On', '&amp;fSequenceNo=', Sequences.fSequenceFirst, '&amp;fMeanTriggerRate=On', '&amp;fTest=On', '&amp;fRunTypeName=On', '&amp;fNumEvents=On', '&amp;fSourceName=On&amp;', 'fExcludedFDAKEY=1', '&amp;fSequenceFirst=On', '&amp;fRawFileAvail=On', '&amp;fCCFileAvail=On', '&amp;fCaCoFileAvail=On', '&amp;fNumResults=500\">', 'M', Sequences.fTelescopeNumber, ':', LPAD(Sequences.fSequenceFirst, 8, ' '), '</A>') ";
    54 //                    $query0 .= " as " . $alias["fSequenceFirst"];
    55                     $query0 .= " as 'Tel:Sequ'";
    56                     if (!empty($_GET["fLinks"]))
    57                     {
    58                         $query0 .= ", CONCAT('<A&ws;HREF=\"tabs.php?t=calib&n=', fSequenceFirst, '\">cal</A>'";
    59                         $query0 .= ", '&nbsp;<A&ws;HREF=\"tabs.php?t=signal&n=', fSequenceFirst, '\">sig</A>'";
    60                         $query0 .= ", '&nbsp;<A&ws;HREF=\"tabs.php?t=star&n=', fSequenceFirst, '\">star</A>'";
    61                         $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>' ";
    62 //                        $query0 .= ", '&nbsp;<A&ws;HREF=\"sequence.php?fSequenceNo=', Sequences.fSequenceFirst , '&amp;fAll=On\">i</A>'";
    63                         $query0 .= ", '&nbsp;<A&ws;HREF=\"queryrbk.php?fNight=', date_format(adddate(fRunStart, interval +13 HOUR), '%Y-%m-%d') , '&amp;fDate=2\">rbk</A>') ";
    64 //                        $query0 .= ", CONCAT('<A&ws;HREF=\"http://www.astro.uni-wuerzburg.de/datacenter/callisto/' , LEFT(LPAD(CONCAT(Sequences.fSequenceFirst, '.'), 9,'0'),4), '/', LPAD(CONCAT(Sequences.fSequenceFirst, '/'), 9,'0'), 'callisto', LPAD(CONCAT(Sequences.fSequenceFirst , '.html'), 13,'0') , '\">cl</A>'";
    65 //                        $query0 .= ", '&nbsp;<A&ws;HREF=\"http://www.astro.uni-wuerzburg.de/datacenter/callisto/' , LEFT(LPAD(CONCAT(Sequences.fSequenceFirst, '.'), 9,'0'),4), '/', LPAD(CONCAT(Sequences.fSequenceFirst, '/'), 9,'0'), '\">c</A>'";
    66 //                        $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>'";
    67 //                        $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>'";
    68 //                        $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>' ";
    69 //                        $query0 .= ", '&nbsp;<A&ws;HREF=\"sequence.php?fSequenceNo=', Sequences.fSequenceFirst , '&amp;fAll=On\">i</A>'";
    70 //                        $query0 .= ", '&nbsp;<A&ws;HREF=\"queryrbk.php?fNight=', date_format(adddate(fRunStart, interval +13 HOUR), '%Y-%m-%d') , '&amp;fDate=2\">rbk</A>') ";
    71                         $query0 .= " as 'Links'";
    72                     }
     77                    $query0 .= ", CONCAT('<A&ws;HREF=\"tabs.php?t=calib&n=', fSequenceFirst, '\">cal</A>'";
     78                    $query0 .= ", '&nbsp;<A&ws;HREF=\"tabs.php?t=signal&n=', fSequenceFirst, '\">sig</A>'";
     79                    $query0 .= ", '&nbsp;<A&ws;HREF=\"tabs.php?t=star&n=', fSequenceFirst, '\">star</A>'";
     80                    $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>' ";
     81                    //$query0 .= ", '&nbsp;<A&ws;HREF=\"sequence.php?fSequenceNo=', Sequences.fSequenceFirst , '&amp;fAll=On\">i</A>'";
     82                    $query0 .= ", '&nbsp;<A&ws;HREF=\"queryrbk.php?fNight=', date_format(adddate(fRunStart, interval +13 HOUR), '%Y-%m-%d') , '&amp;fDate=2\">rbk</A>') ";
     83                    //$query0 .= ", CONCAT('<A&ws;HREF=\"http://www.astro.uni-wuerzburg.de/datacenter/callisto/' , LEFT(LPAD(CONCAT(Sequences.fSequenceFirst, '.'), 9,'0'),4), '/', LPAD(CONCAT(Sequences.fSequenceFirst, '/'), 9,'0'), 'callisto', LPAD(CONCAT(Sequences.fSequenceFirst , '.html'), 13,'0') , '\">cl</A>'";
     84                    //$query0 .= ", '&nbsp;<A&ws;HREF=\"http://www.astro.uni-wuerzburg.de/datacenter/callisto/' , LEFT(LPAD(CONCAT(Sequences.fSequenceFirst, '.'), 9,'0'),4), '/', LPAD(CONCAT(Sequences.fSequenceFirst, '/'), 9,'0'), '\">c</A>'";
     85                    //$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>'";
     86                    //$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>'";
     87                    //$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>' ";
     88                    //$query0 .= ", '&nbsp;<A&ws;HREF=\"sequence.php?fSequenceNo=', Sequences.fSequenceFirst , '&amp;fAll=On\">i</A>'";
     89                    //$query0 .= ", '&nbsp;<A&ws;HREF=\"queryrbk.php?fNight=', date_format(adddate(fRunStart, interval +13 HOUR), '%Y-%m-%d') , '&amp;fDate=2\">rbk</A>') ";
     90                    $query0 .= " as 'Links'";
    7391                }
    74 
    75                 foreach ($_GET as $key => $element)
    76                     if ($_GET[$key]=="On")
    77                         if ($key!="fLinks" && $key!="fOff" && $key!="fOnlyOff" && $key!="fOnlySum")
    78                             if (empty($checkwhere[$key]) || $checkwhere[$key]==0)
    79                                 $query0 .= ", " . $key . " as '" . $alias[$key] . "' ";
    8092            }
     93
     94            foreach ($_GET as $key => $element)
     95                if ($_GET[$key]=="On")
     96                    if ($key!="fLinks" && $key!="fOff" && $key!="fOnlyOff" && $key!="fOnlySum")
     97                        if (empty($checkwhere[$key]) || $checkwhere[$key]==0)
     98                            $query0 .= ", " . $key . " as '" . $alias[$key] . "' ";
    8199        }
    82100
     
    219237        }
    220238
     239        if ((!empty($_GET["fGroupByDate"])) && !$_GET["fGroupByDate"]==0)
     240            if (strpos($query0, " GROUP BY ")==FALSE)
     241                $query0 .= " GROUP BY GroupByDate ";
     242            else
     243                $query0 .= ", GroupByDate ";
     244
    221245        if ($statusgroups>0)
    222246        {
    223             $query0 .= " GROUP BY ";
     247//            $query0 .= " GROUP BY ";
     248            if (strpos($query0, " GROUP BY ")==FALSE)
     249                $query0 .= " GROUP BY ";
     250            else
     251                $query0 .= ", ";
    224252            $num = $statusgroups;
    225253            foreach ($checkstatusgroup as $key => $element)
     
    332360        printf("<p>");
    333361        PrintSourceMenu($host,$user,$pw,$db);
     362        PrintGroupByDateMenu();
     363        printf("<p>");
    334364        PrintNightRangeMenu($host,$user,$pw,$db, "Sequences");
    335365        printf("<p>");
Note: See TracChangeset for help on using the changeset viewer.