Changeset 9249 for trunk/MagicSoft/Mars/datacenter/db/datasetinfo-aio.php
- Timestamp:
- 01/23/09 17:27:58 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/db/datasetinfo-aio.php
r9154 r9249 17 17 $query0 = "SELECT "; 18 18 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 28 36 if ($statusgroups>0) 29 37 { 30 38 foreach ($checkstatusgroup as $key => $element) 31 39 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] . "' "; 33 41 // $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', "; 34 42 35 $query0 .= " COUNT(*) as '# Datasets'";43 $query0 .= ", COUNT(*) as '# Datasets'"; 36 44 37 45 } 38 else 46 } 47 else 48 { 49 $query0 .= " " . $fromtable . ".fDataSetNumber as '" . $alias["fDataSetNumber"] . "' "; 50 if (!empty($_GET["fLinks"])) 39 51 { 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 .= ", ' <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 .= ", ' <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 .= ", ' <A&ws;HREF=\"tabs.php?t=ganymed&n=' , fDataSetNumber, '\">g</A>'"; 48 $query0 .= ", ' <A&ws;HREF=\"tabs.php?t=gplotdb&n=' , fDataSetNumber, '\">pdb</A>'"; 49 // $query0 .= ", ' <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 .= ", ' <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 .= ", ' <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 .= ", ' <A&ws;HREF=\"tabs.php?t=ganymed&n=' , fDataSetNumber, '\">g</A>'"; 57 $query0 .= ", ' <A&ws;HREF=\"tabs.php?t=gplotdb&n=' , fDataSetNumber, '\">pdb</A>'"; 58 //$query0 .= ", ' <A&ws;HREF=\"ganymed.php?fDataSetNo=', DataSets.fDataSetNumber, '\">i</A>' "; 59 $query0 .= ") as 'Links'"; 58 60 } 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] . "' "; 59 67 } 60 68 … … 120 128 if ($statusgroups>0) 121 129 { 122 $query0 .= " GROUP BY "; 130 if (strpos($query0, " GROUP BY ")==FALSE) 131 $query0 .= " GROUP BY "; 132 else 133 $query0 .= ", "; 123 134 $num = $statusgroups; 124 135 foreach ($checkstatusgroup as $key => $element)
Note:
See TracChangeset
for help on using the changeset viewer.