Ignore:
Timestamp:
02/24/06 19:12:49 (19 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/db/statussps.php

    r7484 r7527  
    11<?php
    22{
    3     function CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere)
     3    function CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere, $needs)
    44    {
    55        $statusgroups = 0;
     
    1414            foreach ($checkstatusgroup as $key => $element)
    1515                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] . "', ";
    1718
    1819            $query0 .= " count(*) as 'Sequence#'";
     
    4041            $query0 .= " AND ";
    4142
    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);
    4849
    4950        $query0 .= "fSequenceFirst BETWEEN " . $_GET["fRunMin"] . " AND " . $_GET["fRunMax"] . " ";
     
    178179    }
    179180
    180     function PrintPage($html, $db, $alias, $rightalign, $checkstatusgroup, $checkwhere)
     181    function PrintPage($html, $db, $alias, $rightalign, $checkstatusgroup, $checkwhere, $needs)
    181182    {
    182183        $db_id = mysql_connect("hercules.astro.uni-wuerzburg.de", "MAGIC", "d99swMT!");
     
    188189        mysql_select_db($db);
    189190
    190         $query0 = CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere);
     191        $query0 = CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere, $needs);
    191192
    192193        $result0 = mysql_query($query0, $db_id);
     
    219220        header("Content-Disposition: attachment; filename=query-result.txt");
    220221
    221         PrintPage("0", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere);
     222        PrintPage("0", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere, $needs);
    222223    }
    223224    else
     
    233234            printf("No query submitted yet.<BR>");
    234235        else
    235             PrintPage("1", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere);
     236            PrintPage("1", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere, $needs);
    236237
    237238        echo (file_get_contents("index-footer.html"));
Note: See TracChangeset for help on using the changeset viewer.