Ignore:
Timestamp:
07/28/10 14:38:30 (15 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r9610 r9617  
    8585                        $query0 .= " CONCAT('running (since ', " . $key . "Status.fStartTime, ')'), ";
    8686                        $query0 .= " IF (NOT ISNULL(" . $key . "Status.fReturnCode), ";
    87                         $query0 .= " CONCAT('failed (', " . $key . "Status.fReturnCode, ')'), ";
     87                        $query0 .= " CONCAT('failed (', " . $key . "Status.fReturnCode, ', ', " . $key . "Status.fStopTime, ')'), ";
    8888                        $query0 .= " CONCAT('done (', " . $key . "Status.fStopTime, ";
    8989                        $query0 .= " ', ', TIMEDIFF(" . $key . "Status.fStopTime, " . $key . "Status.fStartTime), ')')))) ";
     
    103103
    104104        foreach ($_GET as $key => $element)
    105             if (($_GET[$key]=="On" || $groups>0 || $statusgroups>0))// && !empty($joins[$key]))
    106                 $query0 .= GetJoin($fromtable,$key);
     105            if ($_GET[$key]=="On" || $_GET[$key]!=0)
     106                if (strpos($query0, GetJoin($fromtable,$key))==FALSE)
     107                    $query0 .= GetJoin($fromtable,$key);
    107108
    108109        foreach ($checkwhere as $key => $element)
     
    123124
    124125        if (strpos($query0, " WHERE ")==FALSE)
    125             $query0 .= " WHERE ";
     126            $query0 .= " WHERE";
    126127        else
    127128            $query0 .= " AND ";
     
    138139
    139140        //remove WHERE or AND in the end of the query
    140         $query0=ereg_replace(" WHERE \$", " ", $query0);
    141         $query0=ereg_replace(" AND \$", " ", $query0);
     141        $query0=preg_replace("/ WHERE\s+$/", " ", $query0);
     142        $query0=preg_replace("/ AND\s+$/", " ", $query0);
    142143
    143144        if ($groups>0)
Note: See TracChangeset for help on using the changeset viewer.