Changeset 9505 for trunk/MagicSoft/Mars/datacenter/db/include.php
- Timestamp:
- 09/08/09 17:54:13 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/db/include.php
r9498 r9505 301 301 } 302 302 303 function 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 303 313 function CheckWhere($column) 304 314 { … … 417 427 function PrintDisplaySequencesButtons() 418 428 { 419 if ($_SESSION["DisplaySelected"]!="yes" && ($_SESSION["sequon"]!=" " || $_SESSION["sequoff"]!=" ")) 429 if ((empty($_SESSION["DisplaySelected"]) || $_SESSION["DisplaySelected"]=="no") 430 && !(empty($_SESSION["sequon"]) && empty($_SESSION["sequoff"]))) 420 431 { 421 432 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(" <input type='button' value='Display Not-Selected Sequences' onClick='self.location.href=\"%s&DisplaySelected=inverse\"'>\n", GetClearedURL("yes")); 435 printf("<br><br>\n"); 423 436 } 424 437 … … 426 439 { 427 440 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(" <input type='button' value='Display All Sequences' onClick='self.location.href=\"%s&DisplaySelected=no\"'>\n", GetClearedURL("yes")); 429 443 printf(" <i>Currently only selected sequences are displayed.</i><br><br>\n"); 430 444 } 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(" <input type='button' value='Display All Sequences' onClick='self.location.href=\"%s&DisplaySelected=no\"'>\n", GetClearedURL("yes")); 451 printf(" <i>Currently only NOT selected sequences are displayed.</i><br><br>\n"); 452 } 453 } 454 455 456 function 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 436 464 $uri = htmlspecialchars($_SERVER["REQUEST_URI"]); 437 465 $pos = strpos($uri, "fNumStart"); … … 460 488 break; 461 489 case 3: 462 $row1 = mysql_fetch_assoc($result1); 463 $pos = $row1["FOUND_ROWS()"]-$rows+1; 490 $pos = $totalnumrows-$rows+1; 464 491 break; 465 492 } … … 487 514 } 488 515 489 function CreateMenu($rows, $ result1)516 function CreateMenu($rows, $totalnumrows) 490 517 { 491 518 $menu = ""; … … 510 537 { 511 538 $menu .= ReplaceInUri("fNumStart", $rows, 1); 512 $menu .= ReplaceInUri("fNumStart", $rows, 3, $ result1);539 $menu .= ReplaceInUri("fNumStart", $rows, 3, $totalnumrows); 513 540 } 514 541 return $menu; … … 517 544 function PrintMagicTable($result0, $alias, $rightalign, $limitsmean, $limitsmin, $limitsmax, $result1, $form="") 518 545 { 546 $row1 = mysql_fetch_assoc($result1); 547 $totalnumrows=$row1["FOUND_ROWS()"]; 548 // echo "res0: " . $row . " res1: " . $row1["FOUND_ROWS()"] . "<br>"; 549 519 550 $col = FALSE; 520 551 $first = TRUE; … … 530 561 531 562 532 $menu = CreateMenu(mysql_num_rows($result0), $ result1);563 $menu = CreateMenu(mysql_num_rows($result0), $totalnumrows); 533 564 534 565 if ($form) … … 550 581 $first = FALSE; 551 582 if ($form) 552 printf("<td>ON</td><td>Off</td> ");583 printf("<td>ON</td><td>Off</td><td>Not</td>"); 553 584 foreach ($row0 as $key => $element) 554 585 { … … 582 613 if ($form) 583 614 { 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", ""); 586 620 } 587 621 foreach ($row0 as $key => $element) … … 671 705 */ 672 706 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); 675 708 if (empty($_GET["fPrintTable"])) 676 709 printf("%s\n", $menu);
Note:
See TracChangeset
for help on using the changeset viewer.