Changeset 9509 for trunk/MagicSoft/Mars
- Timestamp:
- 09/11/09 16:51:28 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/db/include.php
r9505 r9509 288 288 $checked = ""; 289 289 290 printf(" <td><input type='checkbox' name='%s' value='On' %s>%s</td>\n", $value, $checked, $text); 291 } 292 293 function Checkbox2($value, $text) 294 { 295 if ($_SESSION[$value]=="On") 296 $checked = "checked"; 297 else 298 $checked = ""; 299 300 printf(" <td><input type='checkbox' name='%s' value='On' %s>%s</td>\n", $value, $checked, $text); 290 printf("<td><input type='checkbox' name='%s' value='On' %s>%s</td>\n", $value, $checked, $text); 301 291 } 302 292 … … 308 298 $checked = ""; 309 299 310 printf(" 300 printf("<td><input type='radio' name='%s' value='%s' %s>%s</td>\n", $name, $value, $checked, $text); 311 301 } 312 302 … … 397 387 function GetClearedURL($all) 398 388 { 399 // $url=htmlspecialchars($_SERVER["REQUEST_URI"]);400 389 $url=$_SERVER["REQUEST_URI"]; 401 // echo "before:".$url."<br>";402 390 if ($all=="yes") 403 391 { 404 // echo "replace <br>"; 405 // $url=str_replace("&DisplaySelected", "halo", $url); 406 $url=str_replace("&DisplaySelected=yes", "", $url); 407 $url=str_replace("&DisplaySelected=no", "", $url); 392 $url=str_replace("&DisplaySelected=yes", "", $url); 393 $url=str_replace("&DisplaySelected=no", "", $url); 394 $url=str_replace("&DisplaySelected=inverse", "", $url); 395 //reset fNumStart 396 $url=preg_replace("/&fNumStart[=][0-9]*/", "", $url); 408 397 } 409 398 $url=str_replace("&insert=yes", "", $url); 410 399 $url=str_replace("&fSendTxt=2", "", $url); 411 400 $url=str_replace("&fSendTxt=1", "", $url); 412 // echo "after:".$url."<br>";413 401 $url=htmlspecialchars($url); 414 402 return $url; … … 418 406 { 419 407 if (empty($_SESSION["insert"])) 420 printf("<input type='submit' value='Update Data Set'> \n");408 printf("<input type='submit' value='Update Selection'> \n"); 421 409 else 422 410 printf("<input type='button' value='Continue' onClick='self.location.href=\"%s\"'> \n", GetClearedURL()); … … 427 415 function PrintDisplaySequencesButtons() 428 416 { 417 if (!empty($_SESSION["DataSetSelection"]) && empty($_SESSION["DataSetAcknowledged"])) 418 return; 419 429 420 if ((empty($_SESSION["DisplaySelected"]) || $_SESSION["DisplaySelected"]=="no") 430 421 && !(empty($_SESSION["sequon"]) && empty($_SESSION["sequoff"]))) … … 436 427 } 437 428 438 if ($_SESSION["DisplaySelected"]=="yes") 429 if ($_SESSION["DisplaySelected"]=="yes" 430 && !(empty($_SESSION["sequon"]) && empty($_SESSION["sequoff"]))) 439 431 { 440 432 PrintUpdateDataSetButton(); … … 444 436 } 445 437 446 if ($_SESSION["DisplaySelected"]=="inverse") 438 if ($_SESSION["DisplaySelected"]=="inverse" 439 && !(empty($_SESSION["sequon"]) && empty($_SESSION["sequoff"]))) 447 440 { 448 441 PrintUpdateDataSetButton(); … … 463 456 464 457 $uri = htmlspecialchars($_SERVER["REQUEST_URI"]); 465 $pos = strpos($uri, "fNumStart"); 466 $amp3=FALSE; 467 if ($pos!=FALSE) 468 { 469 $amp1 = substr($uri, 0, $pos-1); 470 $amp2 = substr($uri, $pos); 471 $amp3 = strchr($amp2, "&"); 472 473 $uri = $amp1; 474 } 458 //append string in case it is not in url 459 if (!preg_match("/&fNumStart[=][0-9]*/", $uri)) 460 $uri.="&fNumStart="; 475 461 476 462 switch($direction) … … 480 466 if ($pos<0) 481 467 $pos=0; 468 $link .= " <A HREF='" . preg_replace("/&fNumStart[=][0-9]*/", "&fNumStart=".$pos, $uri) . "'>< Prev</A> \n"; 482 469 break; 483 470 case 1: 471 //display link only if more results available 472 if ($_GET["fNumStart"]+$rows==$totalnumrows) 473 break; 484 474 $pos = $_GET["fNumStart"]+$rows; 475 $link .= " <A HREF='" . preg_replace("/&fNumStart[=][0-9]*/", "&fNumStart=".$pos, $uri) . "'>Next ></A> \n"; 485 476 break; 486 477 case 2: 487 478 $pos = 0; 479 $link .= " <A HREF='" . preg_replace("/&fNumStart[=][0-9]*/", "&fNumStart=".$pos, $uri) . "'><< First</A> \n"; 488 480 break; 489 481 case 3: 482 //display link only if more results available 483 if ($_GET["fNumStart"]+$rows==$totalnumrows) 484 break; 490 485 $pos = $totalnumrows-$rows+1; 486 $link .= " <A HREF='" . preg_replace("/&fNumStart[=][0-9]*/", "&fNumStart=".$pos, $uri) . "'>Last >></A> \n"; 491 487 break; 492 488 } 493 489 494 $uri .= "&fNumStart=" . $pos;495 if ($amp3!=FALSE)496 $uri .= $amp3;497 498 switch($direction)499 {500 case 0:501 $link .= " <A HREF='" . $uri . "'>< Prev</A> \n";502 break;503 case 1:504 $link .= " <A HREF='" . $uri . "'>Next ></A> \n";505 break;506 case 2:507 $link .= " <A HREF='" . $uri . "'><< First</A> \n";508 break;509 case 3:510 $link .= " <A HREF='" . $uri . "'>Last >></A> \n";511 break;512 }513 490 return $link; 514 491 } … … 523 500 if ($_GET["fNumStart"]!=0) 524 501 { 525 $menu .= ReplaceInUri("fNumStart", $rows, 2 );526 $menu .= ReplaceInUri("fNumStart", $rows, 0 );502 $menu .= ReplaceInUri("fNumStart", $rows, 2, $totalnumrows); 503 $menu .= ReplaceInUri("fNumStart", $rows, 0, $totalnumrows); 527 504 } 528 505 … … 536 513 if ($rows==$_GET["fNumResults"]) 537 514 { 538 $menu .= ReplaceInUri("fNumStart", $rows, 1 );515 $menu .= ReplaceInUri("fNumStart", $rows, 1, $totalnumrows); 539 516 $menu .= ReplaceInUri("fNumStart", $rows, 3, $totalnumrows); 540 517 } … … 546 523 $row1 = mysql_fetch_assoc($result1); 547 524 $totalnumrows=$row1["FOUND_ROWS()"]; 548 // echo "res0: " . $row . " res1: " . $row1["FOUND_ROWS()"] . "<br>";549 525 550 526 $col = FALSE; … … 581 557 $first = FALSE; 582 558 if ($form) 583 printf("<td>ON</td><td>Off</td><td>Not</td>"); 559 { 560 printf("<td>ON<br><input type='radio' name='SelectAllSequForDS' value='ON' onclick='selectallsequences(\"ON\");' %s></td>\n", 561 $_SESSION["SelectAllSequForDS"]=="ON"?"checked":""); 562 printf("<td>Off<br><input type='radio' name='SelectAllSequForDS' value='Off' onclick='selectallsequences(\"Off\");' %s></td>\n", 563 $_SESSION["SelectAllSequForDS"]=="Off"?"checked":""); 564 printf("<td>Not<br><input type='radio' name='SelectAllSequForDS' value='Not' onclick='selectallsequences(\"Not\");' %s></td>\n", 565 $_SESSION["SelectAllSequForDS"]=="Not"?"checked":""); 566 } 584 567 foreach ($row0 as $key => $element) 585 568 { … … 613 596 if ($form) 614 597 { 615 // CheckBox2($row0["Sequ"]."ON","");616 // CheckBox2($row0["Sequ"]."Off","");617 598 RadioButton("DSSeq".$row0["Sequ"], "ON", ""); 618 599 RadioButton("DSSeq".$row0["Sequ"], "Off", "");
Note:
See TracChangeset
for help on using the changeset viewer.