Changeset 8333 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
02/26/07 12:59:57 (18 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/datacenter/db
Files:
6 edited

Legend:

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

    r8273 r8333  
    451451        printf("<p>");
    452452        PrintSourceMenu($host,$user,$pw,$db);
    453         PrintNightRangeMenu($host,$user,$pw,$db);
     453        PrintNightRangeMenu($host,$user,$pw,$db, "Sequences");
    454454        PrintStarRangeMenu($host,$user,$pw,$db);
    455455        printf("<p>");
     
    930930    $siteuser="dcdb";
    931931
     932
    932933    if (!isset($_SERVER['PHP_AUTH_USER']) || crypt($_SERVER['PHP_AUTH_PW'], $sitepw)!=$sitepw || $_SERVER['PHP_AUTH_USER']!=$siteuser)
    933934    {
  • trunk/MagicSoft/Mars/datacenter/db/findoffdata.php

    r8249 r8333  
    349349        PrintSourceMenu($host,$user,$pw,$db);
    350350        printf("<p>\n");
    351         PrintNightRangeMenu($host,$user,$pw,$db);
     351        PrintNightRangeMenu($host,$user,$pw,$db, "Sequences");
    352352        printf("<p>\n");
    353353
  • trunk/MagicSoft/Mars/datacenter/db/include.php

    r8199 r8333  
    223223
    224224    return $max;
     225}
     226
     227function GetMaxDate($field, $table, $host, $user, $pw, $db)
     228{
     229    $db_id = mysql_connect($host, $user, $pw);
     230    if ($db_id==FALSE)
     231    {
     232            printf("mysql_connect returned the following error:<br>");
     233            printf("%s<br>", mysql_error());
     234            die("");
     235    }
     236
     237    $query  = "SELECT DATE_FORMAT(if(MAX(" . $field . ")<'13:00:00', MAX(" . $field . "), ADDDATE(MAX(" . $field . "), INTERVAL +1 DAY)), '%Y-%m-%d') FROM " . $db . "." . $table;
     238    $result = mysql_query($query);
     239    if (!$result)
     240        return "0";
     241
     242    $row = mysql_fetch_row($result);
     243
     244    $maxdate = $row[0];
     245
     246    mysql_free_result($result);
     247    mysql_close($db_id);
     248
     249    return $maxdate;
    225250}
    226251
  • trunk/MagicSoft/Mars/datacenter/db/menu.php

    r8252 r8333  
    483483}
    484484
    485 function PrintNightRangeMenu($host,$user,$pw,$db)
     485function PrintNightRangeMenu($host,$user,$pw,$db, $table)
    486486{
    487487    if (empty($_GET["fStartDate"]))
    488         $timemin = GetMin("fRunStart", "Sequences", $host, $user, $pw, $db);
     488        $timemin = GetMin("fRunStart", $table, $host, $user, $pw, $db);
    489489    else
    490490        $timemin = $_GET["fStartDate"];
    491491
    492492    if (empty($_GET["fStopDate"]))
    493         $timemax = GetMax("fRunStart", "Sequences", $host, $user, $pw, $db);
     493        $timemax = GetMaxDate("fRunStart", $table, $host, $user, $pw, $db);
    494494    else
    495             $timemax = $_GET["fStopDate"];
     495        $timemax = $_GET["fStopDate"];
    496496
    497497    printf("Night&nbsp;(yyyy-mm-dd)&nbsp;from&nbsp;<input name=\"fStartDate\" type=\"text\" size=\"10\" maxlength=\"10\" value=\"%s\">\n", $timemin);
  • trunk/MagicSoft/Mars/datacenter/db/runinfo-aio.php

    r8249 r8333  
    248248        printf(" <div id='ranges' style='display:none'>");
    249249        PrintSequMenu($host,$user,$pw,$db);
    250         PrintNightRangeMenu($host,$user,$pw,$db);
     250        PrintNightRangeMenu($host,$user,$pw,$db, "RunData");
    251251        printf("<p>");
    252252        PrintZdRangeMenu($host,$user,$pw,$db);
  • trunk/MagicSoft/Mars/datacenter/db/sequinfo-aio.php

    r8249 r8333  
    308308        printf("<p>");
    309309        PrintSourceMenu($host,$user,$pw,$db);
    310         PrintNightRangeMenu($host,$user,$pw,$db);
     310        PrintNightRangeMenu($host,$user,$pw,$db, "Sequences");
    311311        printf("<p>");
    312312        printf("</div>");
Note: See TracChangeset for help on using the changeset viewer.