Changeset 9505 for trunk/MagicSoft/Mars/datacenter
- Timestamp:
- 09/08/09 17:54:13 (15 years ago)
- Location:
- trunk/MagicSoft/Mars/datacenter/db
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/db/builddatasets.php
r9498 r9505 78 78 if ($_SESSION[$key]=="On") 79 79 if ($key!="fLinks" && $key!="fOff" && $key!="fOnlyOff") 80 if (!(ereg("^ [0-9]*ON$", $key) || ereg("^[0-9]*Off$", $key)))80 if (!(ereg("^DSSeq[0-9]*$", $key))) 81 81 if (empty($checkwhere[$key]) || $checkwhere[$key]==0) 82 82 $query0 .= ", " . $key . " as '" . $alias[$key] . "' "; … … 94 94 $query0 .= GetJoin($fromtable,$key); 95 95 96 if ($_SESSION["DisplaySelected"]!="yes" || ($_SESSION["sequon"]==" " && $_SESSION["sequoff"]==" ")) 96 if ($_SESSION["DisplaySelected"]!="yes" 97 || ($_SESSION["sequon"]==" " && $_SESSION["sequoff"]==" ")) 97 98 { 98 99 if ($_SESSION["fTest"]!="On") … … 199 200 $starstop=substr($_SESSION["fStarStop"], 0, 10); 200 201 $query0 .= " fStar < '" . $starstop . " 23:59:59' "; 202 } 203 204 if ($_SESSION["DisplaySelected"]=="inverse") 205 { 206 $displsequ=str_replace(" ", " ", $_SESSION["sequon"].$_SESSION["sequoff"]); 207 $displsequ=ereg_replace("^ ", "(", $displsequ); 208 $displsequ=ereg_replace("$", ")", $displsequ); 209 $displsequ=str_replace(" ", ",", $displsequ); 210 211 if (strpos(strrev($query0), " DNA ")!=0 || !strpos(strrev($query0), " DNA ")) 212 $query0 .= " AND "; 213 214 $query0 .= " fSequenceFirst NOT IN " . $displsequ; 201 215 } 202 216 … … 232 246 $displsequ=str_replace(" ", " ", $_SESSION["sequon"].$_SESSION["sequoff"]); 233 247 $displsequ=ereg_replace("^ ", "(", $displsequ); 234 $displsequ=ereg_replace(" 248 $displsequ=ereg_replace("$", ")", $displsequ); 235 249 $displsequ=str_replace(" ", ",", $displsequ); 236 250 … … 395 409 PrintMagicTable($result0, $alias, $rightalign, $limitsmean, $limitsmin, $limitsmax, $result1, "yes"); 396 410 397 if ( $_SESSION["sequon"]!=" " || $_SESSION["sequoff"]!=" ")411 if (!(empty($_SESSION["sequon"]) && empty($_SESSION["sequoff"]))) 398 412 { 399 413 printf("<div align='left'>\n"); 400 414 printf("Remark: To store your selection you have to press 'Update Data Set'<br> \n"); 401 if ($_SESSION["DisplaySelected"]!="yes" && ($_SESSION["sequon"]!=" " || $_SESSION["sequoff"]!=" "))402 {403 printf("Remark: To be able to remove sequence(s) from your selection you have to \n");404 printf("'Display Selected Sequences'");405 // printf("<input type='button' value='Display Selected Sequences' onClick='self.location.href=\"%s&DisplaySelected=yes\"'>\n", GetClearedURL("yes"));406 printf(" only.<br>\n");407 }408 415 printf("<br>\n"); 409 416 … … 412 419 $on=str_replace(" ", ",", trim($_SESSION["sequon"])); 413 420 $off=str_replace(" ", ",", trim($_SESSION["sequoff"])); 421 422 //set observation mode 423 if ($_SESSION["sequoff"]==" ") 424 $obsmode="Wobble"; 425 else 426 $obsmode="On"; 427 428 //get key from db for insert query 429 $query = "SELECT fObservationModeKEY FROM ObservationMode WHERE fObservationModeName='".$obsmode."'"; 430 $result = mysql_query($query); 431 $row = mysql_fetch_assoc($result); 432 $_SESSION["obsmode"] = $row["fObservationModeKEY"]; 433 mysql_free_result($result); 414 434 415 435 $values=array("Sum(fRunTime)/60" => $runtime, … … 555 575 556 576 if ($values["Min(fNumStarsCorMed)"][$val]<$numstarscorlimit) 557 printf("<li style='color:%s'>%s: One of your %s-sequences has less than %s correlated stars (%s). </li>\n",577 printf("<li style='color:%s'>%s: At least one of your %s-sequences has less than %s correlated stars (%s). </li>\n", 558 578 $color["WARN"], "WARN", $val, $numstarscorlimit, $values["Min(fNumStarsCorMed)"][$val]); 559 579 if ($values["Min(fNumStarsMed)"][$val]<$numstarslimit) 560 printf("<li style='color:%s'>%s: One of your %s-sequences has less than %s identified stars (%s). </li>\n",580 printf("<li style='color:%s'>%s: At least one of your %s-sequences has less than %s identified stars (%s). </li>\n", 561 581 $color["WARN"], "WARN", $val, $numstarslimit, $values["Min(fNumStarsMed)"][$val]); 562 582 if ($values["Min(fRunTime)/60"][$val]<$runtimelimit) 563 printf("<li style='color:%s'>%s: One of your %s-sequences is shorter than %s min (%s min). </li>\n",583 printf("<li style='color:%s'>%s: At least one of your %s-sequences is shorter than %s min (%s min). </li>\n", 564 584 $color["INFO"], "INFO", $val, $runtimelimit, $values["Min(fRunTime)/60"][$val]); 565 585 if ($values["Max(fInhomogeneity)"][$val]>$inhomlimit) 566 printf("<li style='color:%s'>%s: One of your %s-sequences has an inhomogeneity larger than %s (%s). </li>\n",586 printf("<li style='color:%s'>%s: At least one of your %s-sequences has an inhomogeneity larger than %s (%s). </li>\n", 567 587 $color["WARN"], "WARN", $val, $inhomlimit, $values["Max(fInhomogeneity)"][$val]); 568 588 if ($values["Max(fUnsuitableInner)"][$val]>$unsuitablemaxlimit) 569 printf("<li style='color:%s'>%s: One of your %s-sequences has more than %s unsuitable inner pixel (%s). </li>\n",589 printf("<li style='color:%s'>%s: At least one of your %s-sequences has more than %s unsuitable inner pixel (%s). </li>\n", 570 590 $color["WARN"], "WARN", $val, $unsuitablemaxlimit, $values["Max(fUnsuitableInner)"][$val]); 571 591 if ($values["Max(fIsolatedInner)"][$val]>$isolatedlimit) 572 printf("<li style='color:%s'>%s: One of your %s-sequences has more than %s isolated inner pixel (%s). </li>\n",573 $color["WARN"], "WARN", $val, $isolatedlimit, $values["Max(fIsolatedInner)"][$val]);592 printf("<li style='color:%s'>%s: At least one of your %s-sequences has more than %s isolated inner pixel (%s). </li>\n", 593 $color["WARN"], "WARN", $val, $isolatedlimit, $values["Max(fIsolatedInner)"][$val]); 574 594 if ($values["Max(fIsolatedMaxCluster)"][$val]>$imclimit) 575 printf("<li style='color:%s'>%s: One of your %s-sequences has more than %s isolated max cluster (%s). </li>\n",595 printf("<li style='color:%s'>%s: At least one of your %s-sequences has more than %s isolated max cluster (%s). </li>\n", 576 596 $color["WARN"], "WARN", $val, $imclimit, $values["Max(fIsolatedMaxCluster)"][$val]); 577 597 } 578 598 //check selected dataset for errors 579 599 if (!empty($on) && $values["Max(fMeanPedRmsInner)"]["on"]>$values["Avg(fMeanPedRmsInner)"]["on"]+$pedrmsrms) 580 printf("<li style='color:%s'>%s: One of your on-sequences has a PedRms larger than %s (%s).</li>\n",600 printf("<li style='color:%s'>%s: At least one of your on-sequences has a PedRms larger than %s (%s).</li>\n", 581 601 $color["WARN"], "WARN", $values["Avg(fMeanPedRmsInner)"]["on"]+$pedrmsrms, $values["Max(fMeanPedRmsInner)"]["on"]); 582 602 if (!empty($off) && $values["Max(fMeanPedRmsInner)"]["off"]>$values["Avg(fMeanPedRmsInner)"]["on"]+$pedrmsrms) 583 printf("<li style='color:%s'>%s: One of your off-sequences has a PedRms larger than %s (%s). </li>\n",603 printf("<li style='color:%s'>%s: At least one of your off-sequences has a PedRms larger than %s (%s). </li>\n", 584 604 $color["WARN"], "WARN", $values["Avg(fMeanPedRmsInner)"]["on"]+$pedrmsrms, $values["Max(fMeanPedRmsInner)"]["off"]); 585 605 if (!empty($off) && $values["Min(fMeanPedRmsInner)"]["off"]<$values["Avg(fMeanPedRmsInner)"]["on"]-$pedrmsrms) 586 printf("<li style='color:%s'>%s: One of your off-sequences has a PedRms smaller than %s (%s). </li>\n",606 printf("<li style='color:%s'>%s: At least one of your off-sequences has a PedRms smaller than %s (%s). </li>\n", 587 607 $color["WARN"], "WARN", $values["Avg(fMeanPedRmsInner)"]["on"]-$pedrmsrms, $values["Min(fMeanPedRmsInner)"]["off"]); 588 608 $scale=$values["Sum(fRunTime)/60"]["on"]/$values["Sum(fRunTime)/60"]["off"]; … … 598 618 if ($obskey!=$_SESSION["obsmode"]) 599 619 { 600 printf("<li style='color:%s'>%s: You have not selected any Off sequences. </li>\n",601 $color["ERROR"], "ERROR" , $doubleseq);620 printf("<li style='color:%s'>%s: You have a mistake in your observation mode. </li>\n", 621 $color["ERROR"], "ERROR"); 602 622 $numerr=$numerr+1; 603 623 } … … 659 679 printf("SequencesOff: %s<br>\n", $_SESSION["sequoff"]); 660 680 661 //set observation mode662 if ($_SESSION["sequoff"]==" ")663 $obsmode="Wobble";664 else665 $obsmode="On";666 //get key from db for insert query667 $query = "SELECT fObservationModeKEY FROM ObservationMode WHERE fObservationModeName='".$obsmode."'";668 $result = mysql_query($query);669 $row = mysql_fetch_assoc($result);670 $_SESSION["obsmode"] = $row["fObservationModeKEY"];671 mysql_free_result($result);672 681 printf("Observation mode: %s <br>\n", $obsmode); 673 682 printf("RunTime: %s min <br>\n", $_SESSION["runtime"]); … … 738 747 } 739 748 else 749 { 740 750 printf("<input type='submit' value='Get Data Set'><br><br>\n"); 751 printf("Remark: To store your selection you have to press 'Get Data Set'<br> \n"); 752 } 741 753 742 754 printf("</div>\n"); … … 789 801 $_SESSION[$element]=$value; 790 802 791 792 793 803 if ($debug) 794 804 print_r($_SESSION); 795 805 796 // remove sequence from selection797 if (!empty($_POST) && $_SESSION["DisplaySelected"]=="yes" && $_SESSION["DisplaySelectedOld"]=="yes")798 foreach ($_SESSION as $key => $element)799 if (($_SESSION[$key]=="On") //value is set800 && (ereg("^[0-9]*ON$", $key) || ereg("^[0-9]*Off$", $key)) // it is a sequence number801 && (!$_POST[$key]==On)) // the sequence is not given in $_POST any more802 unset($_SESSION[$key]);803 804 //store old value of $_SESSION["DisplaySelected"]805 806 if ($_SESSION["DisplaySelected"]=="yes") 806 807 { 807 808 unset($_SESSION["fNumStart"]); 808 809 $_GET["fNumStart"]=0; 809 $_SESSION["DisplaySelectedOld"]="yes"; 810 } 811 else 812 $_SESSION["DisplaySelectedOld"]="no"; 813 814 $_SESSION["sequon"]=" "; 815 $_SESSION["sequoff"]=" "; 810 } 811 812 $_SESSION["sequon"]=""; 813 $_SESSION["sequoff"]=""; 816 814 foreach($_SESSION as $key => $val) 817 if ($val=="On") 818 { 819 if (ereg("^[0-9]*ON$", $key)) 820 $_SESSION["sequon"].=str_replace("ON", " ", $key); 821 if (ereg("^[0-9]*Off$", $key)) 822 $_SESSION["sequoff"].=str_replace("Off", " ", $key); 823 } 824 if ($_SESSION["sequon"]==" " && $_SESSION["sequoff"]==" ") 825 { 826 $_SESSION["DisplaySelected"]="no"; 827 $_SESSION["DisplaySelectedOld"]="no"; 815 { 816 if ($val=="ON" && ereg("^DSSeq[0-9]*$", $key)) 817 $_SESSION["sequon"].=str_replace("DSSeq", " ", $key); 818 819 if ($val=="Off" && ereg("^DSSeq[0-9]*$", $key)) 820 $_SESSION["sequoff"].=str_replace("DSSeq", " ", $key); 821 822 if ($val=="Not" && ereg("^DSSeq[0-9]*$", $key)) 823 unset($_SESSION[$key]); 824 828 825 } 829 826 … … 855 852 { 856 853 // echo crypt($_SERVER['PHP_AUTH_PW']). "<br>"; 854 // echo "with crypt: " . crypt($_SERVER['PHP_AUTH_PW'], $userrow["fPassword"]) . " for user " . $userrow["fUserName"]. "<br>"; 857 855 if (crypt($_SERVER['PHP_AUTH_PW'], $userrow["fPassword"])==$userrow["fPassword"] 858 856 && $_SERVER['PHP_AUTH_USER']==$userrow["fUserName"]) … … 882 880 header("Content-Disposition: attachment; filename=dataset_".str_replace(" ", "_", $_SESSION["name"]).".txt"); 883 881 PrintDataSetFile(); 884 echo "hallo\n";885 882 } 886 883 unset($_SESSION["fSendTxt"]); -
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.