Ignore:
Timestamp:
04/28/07 18:22:16 (17 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r8464 r8466  
    11<?php
    22{
     3    function GetSequencesFromDataSet($onoff)
     4    {
     5        include("db.php");
     6        $db_id = mysql_pconnect($host, $user, $pw);
     7        if ($db_id==FALSE)
     8        {
     9            printf("mysql_connect returned the following error: %s\n", mysql_error());
     10            die("");
     11        }
     12        mysql_select_db($db);
     13        $query="SELECT fSequenceFirst FROM DataSetSequenceMapping WHERE fDataSetNumber IN (";
     14        $query .= str_replace(" ", ",", trim($_GET["Set"])) . ") AND fOnOff=" . $onoff;
     15//        printf("Q: %s<br>", $query);
     16        $result=mysql_query($query, $db_id);
     17
     18        $sequences="";
     19        while ($row = mysql_fetch_row($result))
     20            $sequences.= $row[0] . " ";
     21
     22        mysql_free_result($result);
     23        mysql_close($db_id);
     24
     25        $text="";
     26        if (!empty($sequences))
     27            $text.= str_replace(" ", "+", trim($sequences));
     28        return $text;
     29    }
     30 
    331    function PrintDiv($host, $user, $pw, $db, $column, $tables, $num)
    432    {
     
    81109    if (empty($_GET["Set2"]))
    82110        $_GET["Set2"]="";
     111    if (empty($_GET["set"]))
     112        $_GET["set"]="";
    83113
    84114    printf("<center>\n<table cellpadding='0'>\n");
     
    139169
    140170    printf("</table>\n");
    141 
    142     printf("<br>Set1: <input name='Set' type='text' size='20' maxlength='100' value='%s'>\n", $_GET["Set"]);
    143     printf("<br>Set2: <input name='Set2' type='text' size='20' maxlength='100' value='%s'>\n", $_GET["Set2"]);
    144 
    145     printf("<br><br><input class='Width' type='submit' value='Query Plot'><br>\n");
     171    printf("<br>\n");
     172
     173    printf("&nbsp;<input type='radio' name='set' value='sequences' onclick='showset2()' %s> sequences &nbsp;\n", $_GET["set"]=="sequences" ? "checked" : "");
     174    printf("&nbsp;<input type='radio' name='set' value='datasets' onclick='hideset2()' %s> datasets <br>\n", $_GET["set"]=="datasets" ? "checked" : "");
     175
     176    printf("<div id='set1' style='display:inline'>Set1: <input name='Set' type='text' size='20' maxlength='100' value='%s'>\n</div>\n<br>\n", $_GET["Set"]);
     177    if (empty($_GET["set"]) || $_GET["set"]=="sequences")
     178        printf("<div id='set2' style='display:inline'>Set2: <input name='Set2' type='text' size='20' maxlength='100' value='%s'>\n</div>\n<br>\n", $_GET["Set2"]);
     179    else
     180        printf("<div id='set2' style='display:none'>Set2: <input name='Set2' type='text' size='20' maxlength='100' value='%s'>\n</div>\n<br>\n", $_GET["Set2"]);
     181
     182    printf("<br><input class='Width' type='submit' value='Query Plot'><br>\n");
    146183    printf("<input class='Width' type='button' value='Reset' onClick='self.location.href=\"plotdb.php\"'><br>\n");
    147184
     
    154191        $img="plot.php?par=hallo";
    155192        foreach($_GET as $var => $val)
     193        {
     194            if ($var=="Set2" && $_GET["set"]=="datasets")
     195                continue;
     196            if ($var=="Set" && $_GET["set"]=="datasets" && !empty($val))
     197            {
     198                $img.= "&amp;Set=" . GetSequencesFromDataSet("1");
     199                $img.= "&amp;Set2=" . GetSequencesFromDataSet("2");
     200                continue;
     201            }
    156202            $img.="&amp;".$var ."=".$val;
     203        }
    157204//        printf("link: %s<br>", $img);
    158205        printf("<img src='%s' alt='plot'>", $img);
     
    161208    printf("<tr><td colspan='2'>\n");
    162209    printf("some remarks:\n<ul>");
    163     printf("<li>For Runs plotting the whole range (i.e. without giving a range or when giving a too large range) ");
     210    printf("<li>For Runs plotting the whole range (i.e. without giving a range or when giving a too large range) \n");
    164211    printf("doesn't work with ChartDirector.</li>\n");
    165     printf("<li>In Set1 and Set2 Sets can be given (e.g. on sequences in Set1 and off sequences in Set2) - they ");
    166     printf("are displayed in colour (Set: blue, Set2: red). Please give the numbers with space as separator (e.g. 40004 40022).</<li>\n");
    167     printf("<li>0 is not accepted in the ranges fields, please write .0 or 00</li>");
    168     printf("<li>Be aware, that plotting timestamps, e.g. fRunStart, doesn't work. </li>");
    169     printf("</ul></td></tr>\n");
     212    printf("<li>In Set1 and Set2 Sets can be given: <br>\n ");
     213    printf("If 'sequences' is selected e.g. on sequences in Set1 (displayed in blue) and off sequences in Set2 \n");
     214    printf("(diplayed in red). <br>\n ");
     215    printf("If 'datasets' is selected you can enter a dataset number as Set1. The on data is displayed in blue, \n");
     216    printf("the off data in red. <br>\n");
     217    printf("&nbsp;&nbsp;&nbsp;Please give the numbers with space as separator (e.g. 40004 40022).<br>\n</<li>\n");
     218    printf("<li>0 is not accepted in the ranges fields, please write .0 or 00</li>\n");
     219    printf("<li>Be aware, that plotting timestamps, e.g. fRunStart, and strings, e.g. fComment doesn't work. </li>\n");
     220    printf("</ul>\n</td>\n</tr>\n");
    170221
    171222    /*
    172     printf("<tr><td>\n");
     223    printf("<tr><td colspan='2'>\n");
    173224    $query=GetQuery($tables, $joins, "");
    174     printf("Q: %s</td></tr>", $query);
     225    printf("Q: %s<br>", $query);
     226    if (!empty($_GET["Set"]))
     227    {
     228        $query=GetQuery($tables, $joins, "Set");
     229        printf("Q: %s<br>", $query);
     230    }
     231    if (!empty($_GET["Set2"]))
     232    {
     233        $query=GetQuery($tables, $joins, "Set2");
     234        printf("Q: %s<br>", $query);
     235    }
     236    printf("</td></tr>");
    175237    */
    176238
Note: See TracChangeset for help on using the changeset viewer.