Changeset 7527 for trunk/MagicSoft/Mars/datacenter/db/runinfo.php
- Timestamp:
- 02/24/06 19:12:49 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/db/runinfo.php
r7484 r7527 1 1 <?php 2 2 { 3 function CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup )3 function CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $needs) 4 4 { 5 5 $fromtable="RunData"; … … 40 40 foreach ($checkstatusgroup as $key => $element) 41 41 if ($element==-1) 42 $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', "; 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] . "', "; 43 // $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', "; 43 44 44 45 $query0 .= " count(*) as 'Run#'"; … … 92 93 $query0 .= " AND "; 93 94 94 $query0 .= StatusQuery("fCCFileAvail" );95 $query0 .= StatusQuery("fCaCoFileAvail" );96 $query0 .= StatusQuery("fCaCoFileFound" );97 $query0 .= StatusQuery("fRawFileAvail" );98 $query0 .= StatusQuery("fDataCheckDone" );99 $query0 .= StatusQuery("fTimingCorrection" );95 $query0 .= StatusQuery("fCCFileAvail", $needs); 96 $query0 .= StatusQuery("fCaCoFileAvail", $needs); 97 $query0 .= StatusQuery("fCaCoFileFound", $needs); 98 $query0 .= StatusQuery("fRawFileAvail", $needs); 99 $query0 .= StatusQuery("fDataCheckDone", $needs); 100 $query0 .= StatusQuery("fTimingCorrection", $needs); 100 101 101 102 if (!empty($_GET["fRunMin"]) && !empty($_GET["fRunMax"])) … … 476 477 } 477 478 478 function PrintPage($html, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup )479 function PrintPage($html, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs) 479 480 { 480 481 $db_id = mysql_connect("hercules.astro.uni-wuerzburg.de", "MAGIC", "d99swMT!"); … … 487 488 mysql_query("SET BIG_TABLES=1"); // necessary for mySQL <= 4 488 489 489 $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup );490 $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $needs); 490 491 491 492 $result0 = mysql_query($query0, $db_id); … … 518 519 header("Content-Disposition: attachment; filename=query-result.txt"); 519 520 520 PrintPage("0", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup );521 PrintPage("0", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs); 521 522 } 522 523 else … … 535 536 { 536 537 if (empty($_GET["fPrintTable"])) 537 PrintPage("1", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup );538 PrintPage("1", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs); 538 539 else 539 PrintPage("2", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup );540 PrintPage("2", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs); 540 541 } 541 542
Note:
See TracChangeset
for help on using the changeset viewer.