Ignore:
Timestamp:
09/08/09 17:54:13 (15 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r9498 r9505  
    301301}
    302302
     303function RadioButton($name, $value, $text)
     304{
     305    if ($_SESSION[$name]==$value)
     306        $checked = "checked";
     307    else
     308        $checked = "";
     309
     310    printf("    <td><input type='radio' name='%s' value='%s' %s>%s</td>\n", $name, $value, $checked, $text);
     311}
     312
    303313function CheckWhere($column)
    304314{
     
    417427function PrintDisplaySequencesButtons()
    418428{
    419     if ($_SESSION["DisplaySelected"]!="yes" && ($_SESSION["sequon"]!=" " || $_SESSION["sequoff"]!=" "))
     429    if ((empty($_SESSION["DisplaySelected"]) || $_SESSION["DisplaySelected"]=="no")
     430        && !(empty($_SESSION["sequon"]) && empty($_SESSION["sequoff"])))
    420431    {
    421432        PrintUpdateDataSetButton();
    422         printf("<input type='button' value='Display Selected Sequences' onClick='self.location.href=\"%s&DisplaySelected=yes\"'><br><br>\n", GetClearedURL("yes"));
     433        printf("<input type='button' value='Display Selected Sequences' onClick='self.location.href=\"%s&DisplaySelected=yes\"'>\n", GetClearedURL("yes"));
     434        printf("&nbsp;&nbsp;&nbsp;<input type='button' value='Display Not-Selected Sequences' onClick='self.location.href=\"%s&DisplaySelected=inverse\"'>\n", GetClearedURL("yes"));
     435        printf("<br><br>\n");
    423436    }
    424437
     
    426439    {
    427440        PrintUpdateDataSetButton();
    428         printf("<input type='button' value='Display All Sequences' onClick='self.location.href=\"%s&DisplaySelected=no\"'>\n", GetClearedURL("yes"));
     441        printf("<input type='button' value='Display Not-Selected Sequences' onClick='self.location.href=\"%s&DisplaySelected=inverse\"'>\n", GetClearedURL("yes"));
     442        printf("&nbsp;&nbsp;&nbsp;<input type='button' value='Display All Sequences' onClick='self.location.href=\"%s&DisplaySelected=no\"'>\n", GetClearedURL("yes"));
    429443        printf("&nbsp;&nbsp;&nbsp;<i>Currently only selected sequences are displayed.</i><br><br>\n");
    430444    }
    431 }
    432 
    433 
    434 function ReplaceInUri($name, $rows, $direction, $result1=0)
    435 {
     445
     446    if ($_SESSION["DisplaySelected"]=="inverse")
     447    {
     448        PrintUpdateDataSetButton();
     449        printf("<input type='button' value='Display Selected Sequences' onClick='self.location.href=\"%s&DisplaySelected=yes\"'>\n", GetClearedURL("yes"));
     450        printf("&nbsp;&nbsp;&nbsp;<input type='button' value='Display All Sequences' onClick='self.location.href=\"%s&DisplaySelected=no\"'>\n", GetClearedURL("yes"));
     451        printf("&nbsp;&nbsp;&nbsp;<i>Currently only NOT selected sequences are displayed.</i><br><br>\n");
     452    }
     453}
     454
     455
     456function ReplaceInUri($name, $rows, $direction, $totalnumrows=0)
     457{
     458    //direction:
     459    // 0: Prev Link
     460    // 1: Next Link
     461    // 2: First Link
     462    // 3: Last Link
     463
    436464    $uri = htmlspecialchars($_SERVER["REQUEST_URI"]);
    437465    $pos = strpos($uri, "fNumStart");
     
    460488        break;
    461489    case 3:
    462         $row1 = mysql_fetch_assoc($result1);
    463         $pos = $row1["FOUND_ROWS()"]-$rows+1;
     490        $pos = $totalnumrows-$rows+1;
    464491        break;
    465492    }
     
    487514}
    488515
    489 function CreateMenu($rows, $result1)
     516function CreateMenu($rows, $totalnumrows)
    490517{
    491518    $menu = "";
     
    510537    {
    511538        $menu .= ReplaceInUri("fNumStart", $rows, 1);
    512         $menu .= ReplaceInUri("fNumStart", $rows, 3, $result1);
     539        $menu .= ReplaceInUri("fNumStart", $rows, 3, $totalnumrows);
    513540    }
    514541    return $menu;
     
    517544function PrintMagicTable($result0, $alias, $rightalign, $limitsmean, $limitsmin, $limitsmax, $result1, $form="")
    518545{
     546    $row1 = mysql_fetch_assoc($result1);
     547    $totalnumrows=$row1["FOUND_ROWS()"];
     548//    echo "res0: " . $row . " res1: " . $row1["FOUND_ROWS()"] . "<br>";
     549
    519550    $col   = FALSE;
    520551    $first = TRUE;
     
    530561
    531562
    532     $menu = CreateMenu(mysql_num_rows($result0), $result1);
     563    $menu = CreateMenu(mysql_num_rows($result0), $totalnumrows);
    533564
    534565    if ($form)
     
    550581            $first = FALSE;
    551582            if ($form)
    552                 printf("<td>ON</td><td>Off</td>");
     583                printf("<td>ON</td><td>Off</td><td>Not</td>");
    553584            foreach ($row0 as $key => $element)
    554585            {
     
    582613        if ($form)
    583614        {
    584             CheckBox2($row0["Sequ"]."ON","");
    585             CheckBox2($row0["Sequ"]."Off","");
     615//            CheckBox2($row0["Sequ"]."ON","");
     616//            CheckBox2($row0["Sequ"]."Off","");
     617            RadioButton("DSSeq".$row0["Sequ"],  "ON", "");
     618            RadioButton("DSSeq".$row0["Sequ"], "Off", "");
     619            RadioButton("DSSeq".$row0["Sequ"], "Not", "");
    586620        }
    587621        foreach ($row0 as $key => $element)
     
    671705     */
    672706
    673     $row1 = mysql_fetch_assoc($result1);
    674     printf("<P><B>Number of displayed results: %d of %s in total</B><P><P>\n", mysql_num_rows($result0), $row1["FOUND_ROWS()"]);
     707    printf("<P><B>Number of displayed results: %d of %s in total</B><P><P>\n", mysql_num_rows($result0), $totalnumrows);
    675708    if (empty($_GET["fPrintTable"]))
    676709        printf("%s\n", $menu);
Note: See TracChangeset for help on using the changeset viewer.