Changeset 7527 for trunk/MagicSoft/Mars/datacenter/db/sequinfo.php
- Timestamp:
- 02/24/06 19:12:49 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/MagicSoft/Mars/datacenter/db/sequinfo.php ¶
r7524 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="Sequences"; … … 36 36 foreach ($checkstatusgroup as $key => $element) 37 37 if ($element==-1) 38 $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', "; 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] . "', "; 39 // $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', "; 39 40 40 41 $query0 .= " count(*) as 'Sequence'"; … … 110 111 $query0 .= " AND "; 111 112 112 $query0 .= StatusQuery("fSequenceFileWritten" );113 $query0 .= StatusQuery("fAllFilesAvail" );114 $query0 .= StatusQuery("fCallisto" );115 $query0 .= StatusQuery("fFillCallisto" );116 $query0 .= StatusQuery("fStar" );117 $query0 .= StatusQuery("fFillStar" );113 $query0 .= StatusQuery("fSequenceFileWritten", $needs); 114 $query0 .= StatusQuery("fAllFilesAvail", $needs); 115 $query0 .= StatusQuery("fCallisto", $needs); 116 $query0 .= StatusQuery("fFillCallisto", $needs); 117 $query0 .= StatusQuery("fStar", $needs); 118 $query0 .= StatusQuery("fFillStar", $needs); 118 119 119 120 if (!empty($_GET["fRunMin"]) && !empty($_GET["fRunMax"])) … … 385 386 $_GET["fMaxHumidity"]="Off"; 386 387 388 if (empty($_GET["fStartTime"])) 389 $_GET["fStartTime"]="Off"; 390 391 if (empty($_GET["fFailedTime"])) 392 $_GET["fFailedTime"]="Off"; 393 394 if (empty($_GET["fReturnCode"])) 395 $_GET["fReturnCode"]="Off"; 396 397 if (empty($_GET["fFailedCode"])) 398 $_GET["fFailedCode"]="Off"; 399 400 if (empty($_GET["fFailedCodeAdd"])) 401 $_GET["fFailedCodeAdd"]="Off"; 402 387 403 } 388 404 … … 426 442 printf("</td></tr> </table>\n"); 427 443 printf(" <p>\n"); 444 445 printf(" <table>\n"); 446 printf(" <tr>\n"); 447 448 CheckBox("fStartTime", "StartTime"); 449 CheckBox("fFailedTime", "FailedTime"); 450 CheckBox("fReturnCode", "ErrCode"); 451 CheckBox("fFailedCode", "RetCode"); 452 CheckBox("fFailedCodeAdd", "CodeAdd"); 453 454 printf(" </tr>\n"); 455 printf(" </table>\n"); 456 printf(" <p>\n"); 457 428 458 printf(" <table>\n"); 429 459 printf(" <tr>\n"); … … 584 614 } 585 615 586 function PrintPage($html, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup )616 function PrintPage($html, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs) 587 617 { 588 618 $db_id = mysql_connect("hercules.astro.uni-wuerzburg.de", "MAGIC", "d99swMT!"); … … 594 624 mysql_select_db($db); 595 625 596 $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup );626 $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $needs); 597 627 598 628 $result0 = mysql_query($query0, $db_id); … … 625 655 header("Content-Disposition: attachment; filename=query-result.txt"); 626 656 627 PrintPage("0", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup );657 PrintPage("0", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs); 628 658 } 629 659 else … … 642 672 { 643 673 if (empty($_GET["fPrintTable"])) 644 PrintPage("1", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup );674 PrintPage("1", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs); 645 675 else 646 PrintPage("2", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup );676 PrintPage("2", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs); 647 677 } 648 678
Note:
See TracChangeset
for help on using the changeset viewer.