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/statussbs.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 '#days'";
     
    4344            $query0 .= " AND ";
    4445
    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);
    4849
    4950        $query0 .= "fDate BETWEEN '" . $_GET["fRunMin"] . "' AND '" . $_GET["fRunMax"] . "' ";
     
    165166    }
    166167
    167     function PrintPage($html, $db, $alias, $rightalign, $checkstatusgroup, $checkwhere)
     168    function PrintPage($html, $db, $alias, $rightalign, $checkstatusgroup, $checkwhere, $needs)
    168169    {
    169170        $db_id = mysql_connect("hercules.astro.uni-wuerzburg.de", "MAGIC", "d99swMT!");
     
    175176        mysql_select_db($db);
    176177
    177         $query0 = CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere);
     178        $query0 = CreateQuery($_GET, $alias, $checkstatusgroup, $checkwhere, $needs);
    178179
    179180        $result0 = mysql_query($query0, $db_id);
     
    206207        header("Content-Disposition: attachment; filename=query-result.txt");
    207208
    208         PrintPage("0", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere);
     209        PrintPage("0", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere, $needs);
    209210    }
    210211    else
     
    220221            printf("No query submitted yet.<BR>");
    221222        else
    222             PrintPage("1", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere);
     223            PrintPage("1", $db, $alias, $rightalign, $checkstatusgroup, $checkwhere, $needs);
    223224
    224225        echo (file_get_contents("index-footer.html"));
Note: See TracChangeset for help on using the changeset viewer.