Changeset 9505 for trunk/MagicSoft/Mars/datacenter/db/builddatasets.php
- Timestamp:
- 09/08/09 17:54:13 (15 years ago)
- File:
-
- 1 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"]);
Note:
See TracChangeset
for help on using the changeset viewer.