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/datasetinfo.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="DataSets";
     
    3030                foreach ($checkstatusgroup as $key => $element)
    3131                    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] . "', ";
    3334
    3435                $query0 .= " count(*) as 'DataSet#'";
     
    8384            $query0 .= " AND ";
    8485
    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);
    8990
    9091        if (!empty($_GET["fRunMin"]) && !empty($_GET["fRunMax"]))
     
    332333    }
    333334
    334     function PrintPage($html, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup)
     335    function PrintPage($html, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs)
    335336    {
    336337        $db_id = mysql_connect("hercules.astro.uni-wuerzburg.de", "MAGIC", "d99swMT!");
     
    342343        mysql_select_db($db);
    343344
    344         $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup);
     345        $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $needs);
    345346
    346347        $result0 = mysql_query($query0, $db_id);
     
    390391        {
    391392            if (empty($_GET["fPrintTable"]))
    392                 PrintPage("1", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup);
     393                PrintPage("1", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs);
    393394            else
    394                 PrintPage("2", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup);
     395                PrintPage("2", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs);
    395396        }
    396397
Note: See TracChangeset for help on using the changeset viewer.