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
  • TabularUnified trunk/MagicSoft/Mars/datacenter/db/sequinfo.php

    r7524 r7527  
    11<?php
    22{
    3     function CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup)
     3    function CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $needs)
    44    {
    55        $fromtable="Sequences";
     
    3636                foreach ($checkstatusgroup as $key => $element)
    3737                    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] . "', ";
    3940
    4041                $query0 .= " count(*) as 'Sequence'";
     
    110111            $query0 .= " AND ";
    111112
    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);
    118119
    119120        if (!empty($_GET["fRunMin"]) && !empty($_GET["fRunMax"]))
     
    385386            $_GET["fMaxHumidity"]="Off";
    386387
     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
    387403    }
    388404
     
    426442        printf("</td></tr> </table>\n");
    427443        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
    428458        printf(" <table>\n");
    429459        printf("  <tr>\n");
     
    584614    }
    585615
    586     function PrintPage($html, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup)
     616    function PrintPage($html, $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs)
    587617    {
    588618        $db_id = mysql_connect("hercules.astro.uni-wuerzburg.de", "MAGIC", "d99swMT!");
     
    594624        mysql_select_db($db);
    595625
    596         $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup);
     626        $query0 = CreateQuery($_GET, $alias, $checkwhere, $checkgroup, $checkstatusgroup, $needs);
    597627
    598628        $result0 = mysql_query($query0, $db_id);
     
    625655        header("Content-Disposition: attachment; filename=query-result.txt");
    626656
    627         PrintPage("0", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup);
     657        PrintPage("0", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs);
    628658    }
    629659    else
     
    642672        {
    643673            if (empty($_GET["fPrintTable"]))
    644                 PrintPage("1", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup);
     674                PrintPage("1", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs);
    645675            else
    646                 PrintPage("2", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup);
     676                PrintPage("2", $db, $alias, $rightalign, $checkwhere, $checkgroup, $checkstatusgroup, $needs);
    647677        }
    648678
Note: See TracChangeset for help on using the changeset viewer.