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/runinfo.php

    r7484 r7527  
    11<?php
    22{
    3     function CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup)
     3    function CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $needs)
    44    {
    55        $fromtable="RunData";
     
    4040                foreach ($checkstatusgroup as $key => $element)
    4141                    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] . "', ";
    4344
    4445                $query0 .= " count(*) as 'Run#'";
     
    9293            $query0 .= " AND ";
    9394
    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);
    100101
    101102        if (!empty($_GET["fRunMin"]) && !empty($_GET["fRunMax"]))
     
    476477    }
    477478
    478     function PrintPage($html, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup)
     479    function PrintPage($html, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs)
    479480    {
    480481        $db_id = mysql_connect("hercules.astro.uni-wuerzburg.de", "MAGIC", "d99swMT!");
     
    487488        mysql_query("SET BIG_TABLES=1"); // necessary for mySQL <= 4
    488489
    489         $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup);
     490        $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $needs);
    490491
    491492        $result0 = mysql_query($query0, $db_id);
     
    518519        header("Content-Disposition: attachment; filename=query-result.txt");
    519520
    520         PrintPage("0", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup);
     521        PrintPage("0", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs);
    521522    }
    522523    else
     
    535536        {
    536537            if (empty($_GET["fPrintTable"]))
    537                 PrintPage("1", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup);
     538                PrintPage("1", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs);
    538539            else
    539                 PrintPage("2", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup);
     540                PrintPage("2", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs);
    540541        }
    541542
Note: See TracChangeset for help on using the changeset viewer.