Changeset 7527 for trunk/MagicSoft/Mars
- Timestamp:
- 02/24/06 19:12:49 (19 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7526 r7527 24 24 (P31 - P39, without P36!(problems with spline)) 25 25 26 27 26 28 2006/02/24 Daniela Dorner 29 30 * datacenter/db/datacheck.php, datasetinfo.php, dbstatus.php, 31 findoffdata.php, include.php, magicdefs.php, runinfo.php, 32 sequinfo.php, statusrps.php, statussbs.php, statussps.php: 33 - included failure handling columns 27 34 28 35 * datacenter/db/findoffdata.php: 29 36 - added DT 37 38 * datacenter/db/statusrps.php: 39 - fixed bug 30 40 31 41 * datacenter/db/sequinfo.php: -
trunk/MagicSoft/Mars/datacenter/db/datacheck.php
r7484 r7527 1 1 <?php 2 2 { 3 function CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $checkenumgroup )3 function CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $checkenumgroup, $needs) 4 4 { 5 5 $fromtable="RunData"; … … 35 35 foreach ($checkstatusgroup as $key => $element) 36 36 if ($element==-1) 37 $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', "; 37 $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] . "', "; 38 // $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', "; 38 39 39 40 $query0 .= " count(*) as 'Runs'"; … … 100 101 $query0 .= " AND "; 101 102 102 $query0 .= StatusQuery("fRawFileAvail" );103 $query0 .= StatusQuery("fDataCheckDone" );103 $query0 .= StatusQuery("fRawFileAvail", $needs); 104 $query0 .= StatusQuery("fDataCheckDone", $needs); 104 105 105 106 $query0 .= EnumQuery("fHasSignal"); … … 379 380 } 380 381 381 function PrintPage($html, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $checkenumgroup )382 function PrintPage($html, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $checkenumgroup, $needs) 382 383 { 383 384 $db_id = mysql_connect("hercules.astro.uni-wuerzburg.de", "MAGIC", "d99swMT!"); … … 389 390 mysql_select_db($db); 390 391 391 $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $checkenumgroup );392 $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $checkenumgroup, $needs); 392 393 393 394 $result0 = mysql_query($query0, $db_id); … … 420 421 header("Content-Disposition: attachment; filename=query-result.txt"); 421 422 422 PrintPage("0", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $checkenumgroup );423 PrintPage("0", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $checkenumgroup, $needs); 423 424 } 424 425 else … … 437 438 { 438 439 if (empty($_GET["fPrintTable"])) 439 PrintPage("1", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $checkenumgroup );440 PrintPage("1", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $checkenumgroup, $needs); 440 441 else 441 PrintPage("2", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $checkenumgroup );442 PrintPage("2", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $checkenumgroup, $needs); 442 443 } 443 444 -
trunk/MagicSoft/Mars/datacenter/db/datasetinfo.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="DataSets"; … … 30 30 foreach ($checkstatusgroup as $key => $element) 31 31 if ($element==-1) 32 $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', "; 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] . "', "; 33 // $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', "; 33 34 34 35 $query0 .= " count(*) as 'DataSet#'"; … … 83 84 $query0 .= " AND "; 84 85 85 $query0 .= StatusQuery("fDataSetInserted" );86 $query0 .= StatusQuery("fStarFilesAvail" );87 $query0 .= StatusQuery("fGanymed" );88 $query0 .= StatusQuery("fFillGanymed" );86 $query0 .= StatusQuery("fDataSetInserted", $needs); 87 $query0 .= StatusQuery("fStarFilesAvail", $needs); 88 $query0 .= StatusQuery("fGanymed", $needs); 89 $query0 .= StatusQuery("fFillGanymed", $needs); 89 90 90 91 if (!empty($_GET["fRunMin"]) && !empty($_GET["fRunMax"])) … … 332 333 } 333 334 334 function PrintPage($html, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup )335 function PrintPage($html, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs) 335 336 { 336 337 $db_id = mysql_connect("hercules.astro.uni-wuerzburg.de", "MAGIC", "d99swMT!"); … … 342 343 mysql_select_db($db); 343 344 344 $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup );345 $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $needs); 345 346 346 347 $result0 = mysql_query($query0, $db_id); … … 390 391 { 391 392 if (empty($_GET["fPrintTable"])) 392 PrintPage("1", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup );393 PrintPage("1", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs); 393 394 else 394 PrintPage("2", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup );395 PrintPage("2", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs); 395 396 } 396 397 -
trunk/MagicSoft/Mars/datacenter/db/dbstatus.php
r7484 r7527 1 1 <?php 2 2 { 3 function CreateQuery($_GET, $alias )3 function CreateQuery($_GET, $alias, $needs) 4 4 { 5 5 $joins = array … … 72 72 foreach ($checkstatusgroup as $key => $element) 73 73 if ($element==-1) 74 $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', "; 74 $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] . "', "; 75 // $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', "; 75 76 76 77 $query0 .= " count(*) as 'Sequence#'"; … … 125 126 $query0 .= " AND "; 126 127 127 $query0 .= StatusQuery("fSequenceFileWritten" );128 $query0 .= StatusQuery("fAllFilesAvail" );129 $query0 .= StatusQuery("fCallisto" );130 $query0 .= StatusQuery("fFillCallisto" );131 $query0 .= StatusQuery("fStar" );132 $query0 .= StatusQuery("fFillStar" );128 $query0 .= StatusQuery("fSequenceFileWritten", $needs); 129 $query0 .= StatusQuery("fAllFilesAvail", $needs); 130 $query0 .= StatusQuery("fCallisto", $needs); 131 $query0 .= StatusQuery("fFillCallisto", $needs); 132 $query0 .= StatusQuery("fStar", $needs); 133 $query0 .= StatusQuery("fFillStar", $needs); 133 134 134 135 if (!empty($_GET["fRunMin"]) && !empty($_GET["fRunMax"])) … … 330 331 } 331 332 332 function PrintPage($html, $db )333 function PrintPage($html, $db, $needs) 333 334 { 334 335 $db_id = mysql_connect("hercules.astro.uni-wuerzburg.de", "MAGIC", "d99swMT!"); … … 353 354 ); 354 355 355 $query0 = CreateQuery($_GET, $alias );356 $query0 = CreateQuery($_GET, $alias, $needs); 356 357 357 358 $result0 = mysql_query($query0, $db_id); … … 400 401 { 401 402 if (empty($_GET["fPrintTable"])) 402 PrintPage("1", $db );403 PrintPage("1", $db, $needs); 403 404 else 404 PrintPage("2", $db );405 PrintPage("2", $db, $needs); 405 406 } 406 407 -
trunk/MagicSoft/Mars/datacenter/db/findoffdata.php
r7523 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'"; … … 119 120 $query0 .= " AND "; 120 121 121 $query0 .= StatusQuery("fStar" );122 $query0 .= StatusQuery("fStar", $needs); 122 123 123 124 if (!empty($_GET["fRunMin"]) && !empty($_GET["fRunMax"])) … … 603 604 } 604 605 605 function PrintPage($html, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $limits, $rms )606 function PrintPage($html, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $limits, $rms, $needs) 606 607 { 607 608 $db_id = mysql_connect("hercules.astro.uni-wuerzburg.de", "MAGIC", "d99swMT!"); … … 613 614 mysql_select_db($db); 614 615 615 $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup );616 $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $needs); 616 617 617 618 $result0 = mysql_query($query0, $db_id); … … 644 645 header("Content-Disposition: attachment; filename=query-result.txt"); 645 646 646 PrintPage("0", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $limits, $rms );647 PrintPage("0", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $limits, $rms, $needs); 647 648 } 648 649 else … … 661 662 { 662 663 if (empty($_GET["fPrintTable"])) 663 PrintPage("1", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $limits, $rms );664 else 665 PrintPage("2", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $limits, $rms );664 PrintPage("1", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $limits, $rms, $needs); 665 else 666 PrintPage("2", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $limits, $rms, $needs); 666 667 } 667 668 -
trunk/MagicSoft/Mars/datacenter/db/include.php
r7484 r7527 104 104 } 105 105 106 function StatusQuery($name )106 function StatusQuery($name, $needs) 107 107 { 108 108 $var = $name . "Status"; … … 112 112 case 0: $txt .= ""; break; 113 113 case 1: $txt .= "NOT (IsNull(" . $name . ") OR " . $name . "='1970-01-01 00:00:00') AND "; break; 114 case 2: $txt .= "IsNull(" . $name . ") AND "; break;114 case 2: $txt .= "IsNull(" . $name . ") AND IsNull(fStartTime) AND IsNull(fFailedTime) AND NOT IsNull(" . $needs[$name] . ") AND "; break; 115 115 case 3: $txt .= $name ."='1970-01-01 00:00:00' AND "; break; 116 case 4: $txt .= ""; break; 116 case 4: $txt .= " (IsNull(" . $name . ") AND IsNull(fFailedTime) AND NOT IsNull(fStartTime) AND date_sub(Now(),interval 12 hour) < fStartTime AND NOT IsNull(" . $needs[$name] . ")) AND "; break; 117 case 5: $txt .= " (IsNull(" . $name . ") AND NOT IsNull(fFailedTime) AND NOT IsNull(fStartTime) AND NOT IsNull(" . $needs[$name] . ")) AND "; break; 118 case 6: $txt .= " (IsNull(" . $name . ") AND IsNull(fFailedTime) AND NOT IsNull(fStartTime) AND date_sub(Now(),interval 12 hour) > fStartTime AND NOT IsNull(" . $needs[$name] . ")) AND "; break; 119 // case 6: $txt .= "crashed"; break; 120 case 7: $txt .= ""; break; 117 121 } 118 122 return $txt; … … 138 142 2 => "not done", 139 143 3 => "not to be done", 140 4 => "group by" 144 4 => "running", 145 5 => "failed", 146 6 => "crashed", 147 7 => "group by", 141 148 ); 142 149 143 150 $stat=$_GET[$var]; 144 for ($i=0; $i< 5; $i++)151 for ($i=0; $i<8; $i++) 145 152 { 146 153 if ($stat==$i) … … 399 406 foreach ($_GET as $key => $element) 400 407 if ($key==$column) 401 if ($element== 4)408 if ($element==7) 402 409 return -1; 403 410 return 0; -
trunk/MagicSoft/Mars/datacenter/db/magicdefs.php
r7521 r7527 1 1 <?php 2 3 $needs = array 4 ( 5 "fCCFilled" => "SequenceBuildStatus.fDate", 6 "fExclusionsDone" => "fCCFilled", 7 "fSequenceEntriesBuilt" => "fExclusionsDone", 8 "fCCFileAvail" => "RunProcessStatus.fRunNumber", 9 "fCaCoFileAvail" => "RunProcessStatus.fRunNumber", 10 "fCaCoFileFound" => "RunProcessStatus.fRunNumber", 11 "fRawFileAvail" => "RunProcessStatus.fRunNumber", 12 "fDataCheckDone" => "fRawFileAvail", 13 "fTimingCorrection" => "fRawFileAvail", 14 "fSequenceFileWritten" => "SequenceProcessStatus.fSequenceFirst", 15 "fAllFilesAvail" => "fSequenceFileWritten", 16 "fCallisto" => "fAllFilesAvail", 17 "fStar" => "fCallisto", 18 "fFillCallisto" => "fCallisto", 19 "fFillStar" => "fStar", 20 "fDataSetInserted" => "DataSetProcessStatus.fDataSetNumber", 21 "fStarFilesAvail" => "fDataSetInserted", 22 "fGanymed" => "fStarFilesAvail", 23 "fFillGanymed" => "fGanymed", 24 ); 25 2 26 3 27 $limits = array … … 70 94 "fCaCoFileAvail" => CheckStatusGroup("fCaCoFileAvailStatus", $_GET), 71 95 "fCaCoFileFound" => CheckStatusGroup("fCaCoFileFoundStatus", $_GET), 72 "fRawFileAvail" => CheckStatusGroup("fRawFileAvailStatu ",$_GET),96 "fRawFileAvail" => CheckStatusGroup("fRawFileAvailStatus", $_GET), 73 97 "fTimingCorrection" => CheckStatusGroup("fTimingCorrectionStatus", $_GET), 74 98 "fDataCheckDone" => CheckStatusGroup("fDataCheckDoneStatus", $_GET), … … 145 169 "fCaCoFileAvail" => "CaCoFile", 146 170 "fCaCoFileFound" => "CaCoRun", 147 "fRawFileAvail" => "Raw file",171 "fRawFileAvail" => "RawFile", 148 172 "fTimingCorrection" => "TimingCorr", 149 173 "fDataCheckDone" => "Datacheck", … … 236 260 "fEMin" => "Emin", 237 261 "fEMax" => "Emax", 262 "fStartTime" => "Process", 263 "fFailedTime" => "Failed", 264 "fReturnCode" => "Ret<br>Code", 265 "fFailedCode" => "Err<br>Code", 266 "fFailedCodeAdd" => "Code<br>Add", 238 267 ); 239 268 … … 309 338 $alias["fPositionAsymInterlaced"] => "1", 310 339 $alias["fHeightAsymInterlaced"] => "1", 340 $alias["fReturnCode"] => "1", 341 $alias["fFailedCode"] => "1", 342 $alias["fFailedCodeAdd"] => "1", 311 343 "Time" => "1", 312 344 // "Time [h]" => "1", … … 468 500 "Max(fZenithDistance)" => "'ZdMax'", 469 501 // "COUNT(*)" => "'Sequ'", 502 "fStartTime" => "fStartTime", 503 "fFailedTime" => "fFailedTime", 504 "fReturnCode" => "fReturnCode", 505 "fFailedCode" => "fFailedCode", 506 "fFailedCodeAdd" => "fFailedCodeAdd", 470 507 ); 471 508 -
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 -
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 -
trunk/MagicSoft/Mars/datacenter/db/statusrps.php
r7484 r7527 1 1 <?php 2 2 { 3 function CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere )3 function CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere, $needs) 4 4 { 5 5 $query0 = "SELECT "; … … 14 14 foreach ($checkstatusgroup as $key => $element) 15 15 if ($element==-1) 16 $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $key . "', "; 16 $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] . "', "; 17 // $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $key . "', "; 17 18 18 19 $query0 .= " count(*) as 'Run#'"; … … 36 37 $query0 .= " AND "; 37 38 38 $query0 .= StatusQuery("fCCFileAvail" );39 $query0 .= StatusQuery("fCaCoFileAvail" );40 $query0 .= StatusQuery("fCaCoFileFound" );41 $query0 .= StatusQuery("fRawFileAvail" );42 $query0 .= StatusQuery("fDataCheckDone" );43 $query0 .= StatusQuery("fTimingCorrection" );39 $query0 .= StatusQuery("fCCFileAvail", $needs); 40 $query0 .= StatusQuery("fCaCoFileAvail", $needs); 41 $query0 .= StatusQuery("fCaCoFileFound", $needs); 42 $query0 .= StatusQuery("fRawFileAvail", $needs); 43 $query0 .= StatusQuery("fDataCheckDone", $needs); 44 $query0 .= StatusQuery("fTimingCorrection", $needs); 44 45 45 46 $query0 .= "fRunNumber BETWEEN " . $_GET["fRunMin"] . " AND " . $_GET["fRunMax"] . " "; … … 52 53 if ($element==-1) 53 54 { 54 $query0 .= $ key;55 $query0 .= $alias[$key]; 55 56 if ($num-->1) 56 57 $query0 .= ", "; … … 189 190 } 190 191 191 function PrintPage($html, $db, $alias, $rightalign, $checkstatusgroup, $checkwhere )192 function PrintPage($html, $db, $alias, $rightalign, $checkstatusgroup, $checkwhere, $needs) 192 193 { 193 194 $db_id = mysql_connect("hercules.astro.uni-wuerzburg.de", "MAGIC", "d99swMT!"); … … 199 200 mysql_select_db($db); 200 201 201 $query0 = CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere );202 $query0 = CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere, $needs); 202 203 203 204 $result0 = mysql_query($query0, $db_id); … … 230 231 header("Content-Disposition: attachment; filename=query-result.txt"); 231 232 232 PrintPage("0", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere );233 PrintPage("0", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere, $needs); 233 234 } 234 235 else … … 244 245 printf("No query submitted yet.<BR>"); 245 246 else 246 PrintPage("1", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere );247 PrintPage("1", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere, $needs); 247 248 248 249 echo (file_get_contents("index-footer.html")); -
trunk/MagicSoft/Mars/datacenter/db/statussbs.php
r7484 r7527 1 1 <?php 2 2 { 3 function CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere )3 function CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere, $needs) 4 4 { 5 5 $statusgroups = 0; … … 14 14 foreach ($checkstatusgroup as $key => $element) 15 15 if ($element==-1) 16 $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', "; 16 $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] . "', "; 17 // $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', "; 17 18 18 19 $query0 .= " count(*) as '#days'"; … … 43 44 $query0 .= " AND "; 44 45 45 $query0 .= StatusQuery("fCCFilled" );46 $query0 .= StatusQuery("fExclusionsDone" );47 $query0 .= StatusQuery("fSequenceEntriesBuilt" );46 $query0 .= StatusQuery("fCCFilled", $needs); 47 $query0 .= StatusQuery("fExclusionsDone", $needs); 48 $query0 .= StatusQuery("fSequenceEntriesBuilt", $needs); 48 49 49 50 $query0 .= "fDate BETWEEN '" . $_GET["fRunMin"] . "' AND '" . $_GET["fRunMax"] . "' "; … … 165 166 } 166 167 167 function PrintPage($html, $db, $alias, $rightalign, $checkstatusgroup, $checkwhere )168 function PrintPage($html, $db, $alias, $rightalign, $checkstatusgroup, $checkwhere, $needs) 168 169 { 169 170 $db_id = mysql_connect("hercules.astro.uni-wuerzburg.de", "MAGIC", "d99swMT!"); … … 175 176 mysql_select_db($db); 176 177 177 $query0 = CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere );178 $query0 = CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere, $needs); 178 179 179 180 $result0 = mysql_query($query0, $db_id); … … 206 207 header("Content-Disposition: attachment; filename=query-result.txt"); 207 208 208 PrintPage("0", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere );209 PrintPage("0", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere, $needs); 209 210 } 210 211 else … … 220 221 printf("No query submitted yet.<BR>"); 221 222 else 222 PrintPage("1", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere );223 PrintPage("1", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere, $needs); 223 224 224 225 echo (file_get_contents("index-footer.html")); -
trunk/MagicSoft/Mars/datacenter/db/statussps.php
r7484 r7527 1 1 <?php 2 2 { 3 function CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere )3 function CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere, $needs) 4 4 { 5 5 $statusgroups = 0; … … 14 14 foreach ($checkstatusgroup as $key => $element) 15 15 if ($element==-1) 16 $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', "; 16 $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] . "', "; 17 // $query0 .= " (if(IsNull(" . $key . "), 'not done' ,if(" . $key . "='1970-01-01 00:00:00','dont do','done'))) as '" . $alias[$key] . "', "; 17 18 18 19 $query0 .= " count(*) as 'Sequence#'"; … … 40 41 $query0 .= " AND "; 41 42 42 $query0 .= StatusQuery("fSequenceFileWritten" );43 $query0 .= StatusQuery("fAllFilesAvail" );44 $query0 .= StatusQuery("fCallisto" );45 $query0 .= StatusQuery("fFillCallisto" );46 $query0 .= StatusQuery("fStar" );47 $query0 .= StatusQuery("fFillStar" );43 $query0 .= StatusQuery("fSequenceFileWritten", $needs); 44 $query0 .= StatusQuery("fAllFilesAvail", $needs); 45 $query0 .= StatusQuery("fCallisto", $needs); 46 $query0 .= StatusQuery("fFillCallisto", $needs); 47 $query0 .= StatusQuery("fStar", $needs); 48 $query0 .= StatusQuery("fFillStar", $needs); 48 49 49 50 $query0 .= "fSequenceFirst BETWEEN " . $_GET["fRunMin"] . " AND " . $_GET["fRunMax"] . " "; … … 178 179 } 179 180 180 function PrintPage($html, $db, $alias, $rightalign, $checkstatusgroup, $checkwhere )181 function PrintPage($html, $db, $alias, $rightalign, $checkstatusgroup, $checkwhere, $needs) 181 182 { 182 183 $db_id = mysql_connect("hercules.astro.uni-wuerzburg.de", "MAGIC", "d99swMT!"); … … 188 189 mysql_select_db($db); 189 190 190 $query0 = CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere );191 $query0 = CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere, $needs); 191 192 192 193 $result0 = mysql_query($query0, $db_id); … … 219 220 header("Content-Disposition: attachment; filename=query-result.txt"); 220 221 221 PrintPage("0", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere );222 PrintPage("0", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere, $needs); 222 223 } 223 224 else … … 233 234 printf("No query submitted yet.<BR>"); 234 235 else 235 PrintPage("1", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere );236 PrintPage("1", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere, $needs); 236 237 237 238 echo (file_get_contents("index-footer.html"));
Note:
See TracChangeset
for help on using the changeset viewer.