Ignore:
Timestamp:
01/23/09 17:27:58 (16 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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)
Note: See TracChangeset for help on using the changeset viewer.