Changeset 8464 for trunk/MagicSoft/Mars/datacenter
- Timestamp:
- 04/27/07 23:39:10 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/datacenter/db
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/db/menu.js
r8420 r8464 85 85 { 86 86 if (primaries[i]==id2) 87 continue; 88 var el2 = document.getElementById(primaries[i]); 89 el2.style.display="none"; 90 var el3 = document.getElementById(primaries[i]+"2"); 91 if (el3.style.display=='inline') 92 var add=id2; 93 el3.style.display="none"; 87 { 88 var el2 = document.getElementById(primaries[i]); 89 el2.style.display="inline"; 90 var el4 = document.getElementById(primaries[i]+"3"); 91 el4.style.display="inline"; 92 var el6 = document.getElementById(primaries[i]+"4"); 93 el6.style.display="inline"; 94 } 95 else 96 { 97 var el2 = document.getElementById(primaries[i]); 98 el2.style.display="none"; 99 var el3 = document.getElementById(primaries[i]+"2"); 100 if (el3.style.display=='inline') 101 var add=id2; 102 el3.style.display="none"; 103 var el4 = document.getElementById(primaries[i]+"3"); 104 el4.style.display="none"; 105 var el5 = document.getElementById(primaries[i]+"4"); 106 el5.style.display="none"; 107 } 94 108 } 95 109 if (add) 96 110 { 97 var el 4= document.getElementById(id2+"2");98 el 4.style.display="inline";111 var el5 = document.getElementById(id2+"2"); 112 el5.style.display="inline"; 99 113 } 100 114 } … … 120 134 el2.style.display="inline"; 121 135 } 136 137 var el3 = document.getElementById("Range2"); 138 el3.style.display="inline"; 122 139 } 123 140 … … 129 146 el2.style.display="none"; 130 147 } 148 var el3 = document.getElementById("Range2"); 149 el3.style.display="none"; 131 150 } 132 151 -
trunk/MagicSoft/Mars/datacenter/db/plotdb.php
r8402 r8464 1 1 <?php 2 2 { 3 function PrintDiv($ column, $list, $num)3 function PrintDiv($host, $user, $pw, $db, $column, $tables, $num) 4 4 { 5 if (($_GET["prim"]==$column && empty($num)) || ($_GET["prim"]==$column && $_GET["plot"]=="val" && $num==2)) 5 $list=GetList($host, $user, $pw, $db, $column, $tables); 6 7 if (($_GET["prim"]==$column && empty($num)) 8 || ($_GET["prim"]==$column && $num==3) 9 || ($_GET["prim"]==$column && $num==4) 10 || ($_GET["prim"]==$column && $_GET["plot"]=="val" && $num==2)) 6 11 printf("<div id='%s%s' style='display:inline'>\n", $column, $num); 7 12 else 8 13 printf("<div id='%s%s' style='display:none'>\n", $column, $num); 9 14 10 if ( !empty($num))15 if ($num==2) 11 16 $vs="vs"; 12 17 … … 18 23 printf("<option value='%s'>%s %s</option>\n", $column2, $vs, $column2); 19 24 20 printf("</select>\n"); 21 22 if (empty($_GET[$_GET[$column."Col".$num]."Start".$num])) 23 $_GET[$_GET[$column."Col".$num]."Start".$num]=0; 24 if (empty($_GET[$_GET[$column."Col".$num]."Stop".$num])) 25 $_GET[$_GET[$column."Col".$num]."Stop".$num]=0; 26 27 printf(" from <input name='%sStart%s' type='text' size='6' maxlength='6' value='%s'>", $_GET[$column."Col".$num], $num, $_GET[$_GET[$column."Col".$num]."Start".$num]); 28 printf(" to <input name='%sStop%s' type='text' size='6' maxlength='6' value='%s'><br>\n", $_GET[$column."Col".$num], $num, $_GET[$_GET[$column."Col".$num]."Stop".$num]); 25 printf("</select>\n<br>\n"); 29 26 printf("</div>\n"); 30 27 } … … 39 36 //init 40 37 if (empty($_GET["plot"])) 41 $_GET["plot"]= 0;38 $_GET["plot"]=""; 42 39 if (empty($_GET["primstart"])) 43 $_GET["primstart"]= 0;40 $_GET["primstart"]=""; 44 41 if (empty($_GET["primstop"])) 45 $_GET["primstop"]= 0;42 $_GET["primstop"]=""; 46 43 if (empty($_GET["prim"])) 47 $_GET["prim"]= 0;44 $_GET["prim"]=""; 48 45 if (empty($_GET["fSequenceFirstCol"])) 49 $_GET["fSequenceFirstCol"]= 0;46 $_GET["fSequenceFirstCol"]=""; 50 47 if (empty($_GET["fSequenceFirstCol2"])) 51 $_GET["fSequenceFirstCol2"]=0; 48 $_GET["fSequenceFirstCol2"]=""; 49 if (empty($_GET["fSequenceFirstCol3"])) 50 $_GET["fSequenceFirstCol3"]=""; 52 51 if (empty($_GET["fRunNumberCol"])) 53 $_GET["fRunNumberCol"]= 0;52 $_GET["fRunNumberCol"]=""; 54 53 if (empty($_GET["fRunNumberCol2"])) 55 $_GET["fRunNumberCol2"]=0; 54 $_GET["fRunNumberCol2"]=""; 55 if (empty($_GET["fRunNumberCol3"])) 56 $_GET["fRunNumberCol3"]=""; 56 57 if (empty($_GET["fDataSetNumberCol"])) 57 $_GET["fDataSetNumberCol"]= 0;58 $_GET["fDataSetNumberCol"]=""; 58 59 if (empty($_GET["fDataSetNumberCol2"])) 59 $_GET["fDataSetNumberCol2"]=0; 60 if (empty($_GET["0Start"])) 61 $_GET["0Start"]=0; 62 if (empty($_GET["0Stop"])) 63 $_GET["0Stop"]=0; 64 if (empty($_GET["0Start2"])) 65 $_GET["0Start2"]=0; 66 if (empty($_GET["0Stop2"])) 67 $_GET["0Stop2"]=0; 60 $_GET["fDataSetNumberCol2"]=""; 61 if (empty($_GET["fDataSetNumberCol3"])) 62 $_GET["fDataSetNumberCol3"]=""; 63 if (empty($_GET["Start"])) 64 $_GET["Start"]=""; 65 if (empty($_GET["Stop"])) 66 $_GET["Stop"]=""; 67 if (empty($_GET["Start2"])) 68 $_GET["Start2"]=""; 69 if (empty($_GET["Stop2"])) 70 $_GET["Stop2"]=""; 71 if (empty($_GET["Start3"])) 72 $_GET["Start3"]=""; 73 if (empty($_GET["Stop3"])) 74 $_GET["Stop3"]=""; 75 if (empty($_GET["Start4"])) 76 $_GET["Start4"]=""; 77 if (empty($_GET["Stop4"])) 78 $_GET["Stop4"]=""; 68 79 if (empty($_GET["Set"])) 69 $_GET["Set"]= 0;80 $_GET["Set"]=""; 70 81 if (empty($_GET["Set2"])) 71 $_GET["Set2"]= 0;82 $_GET["Set2"]=""; 72 83 73 84 printf("<center>\n<table cellpadding='0'>\n"); … … 78 89 printf(" <input type='radio' name='plot' value='val' onclick='showpulldown2()' %s> vs value <br><br>", $_GET["plot"]=="val" ? "checked" : ""); 79 90 91 printf("<table>\n"); 92 printf("<tr><td>\n"); 80 93 printf("<select name='prim' size='1' class='Width'>\n"); 81 94 foreach($prims as $primary => $column) … … 85 98 printf("<option onclick=\"showpulldown('%s')\" value='%s'>%s</option>\n", $column, $column, $primary); 86 99 printf("</select>\n"); 100 printf(" </td><td valign='top'>\n "); 87 101 printf(" from <input name='primstart' type='text' size='6' maxlength='6' value='%s'>", $_GET["primstart"]); 88 printf(" to <input name='primstop' type='text' size='6' maxlength='6' value='%s'><br>\n", $_GET["primstop"]); 102 printf(" to <input name='primstop' type='text' size='6' maxlength='6' value='%s'>", $_GET["primstop"]); 103 printf("</td>\n</tr>\n"); 89 104 105 printf("<tr><td>\n"); 90 106 foreach($prims as $primary => $column) 91 { 92 $list=GetList($host, $user, $pw, $db, $column, $tables); 93 PrintDiv($column, $list, ""); 94 PrintDiv($column, $list, "2"); 95 } 107 PrintDiv($host, $user, $pw, $db, $column, $tables, ""); 108 printf(" </td><td valign='top'>\n <div id='Range' style='display:inline'>\n "); 109 printf(" from <input name='Start' type='text' size='6' maxlength='6' value='%s'>", $_GET["Start"]); 110 printf(" to <input name='Stop' type='text' size='6' maxlength='6' value='%s'>\n", $_GET["Stop"]); 111 printf("</div></td>\n</tr>\n"); 112 113 printf("<tr><td>\n"); 114 foreach($prims as $primary => $column) 115 PrintDiv($host, $user, $pw, $db, $column, $tables, "2"); 116 if ($_GET["plot"]=="val") 117 printf(" </td><td valign='top'>\n <div id='Range2' style='display:inline'>\n "); 118 else 119 printf(" </td><td valign='top'>\n <div id='Range2' style='display:none'>\n "); 120 printf(" from <input name='Start2' type='text' size='6' maxlength='6' value='%s'>", $_GET["Start2"]); 121 printf(" to <input name='Stop2' type='text' size='6' maxlength='6' value='%s'>\n", $_GET["Stop2"]); 122 printf("</div></td>\n</tr>\n"); 123 124 printf("<tr>\n<td colspan='2'>\nLimits</td>\n</tr>\n<tr>\n<td>\n"); 125 foreach($prims as $primary => $column) 126 PrintDiv($host, $user, $pw, $db, $column, $tables, "3"); 127 printf(" </td><td valign='top'>\n <div id='Range3' style='display:inline'>\n "); 128 printf(" from <input name='Start3' type='text' size='6' maxlength='6' value='%s'>", $_GET["Start3"]); 129 printf(" to <input name='Stop3' type='text' size='6' maxlength='6' value='%s'>\n", $_GET["Stop3"]); 130 printf("</div></td>\n</tr>\n"); 131 132 printf("<tr>\n<td>\n"); 133 foreach($prims as $primary => $column) 134 PrintDiv($host, $user, $pw, $db, $column, $tables, "4"); 135 printf(" </td><td valign='top'>\n <div id='Range4' style='display:inline'>\n "); 136 printf(" from <input name='Start4' type='text' size='6' maxlength='6' value='%s'>", $_GET["Start4"]); 137 printf(" to <input name='Stop4' type='text' size='6' maxlength='6' value='%s'>\n", $_GET["Stop4"]); 138 printf("</div></td>\n</tr>\n"); 139 140 printf("</table>\n"); 96 141 97 142 printf("<br>Set1: <input name='Set' type='text' size='20' maxlength='100' value='%s'>\n", $_GET["Set"]); 98 143 printf("<br>Set2: <input name='Set2' type='text' size='20' maxlength='100' value='%s'>\n", $_GET["Set2"]); 144 99 145 printf("<br><br><input class='Width' type='submit' value='Query Plot'><br>\n"); 100 146 printf("<input class='Width' type='button' value='Reset' onClick='self.location.href=\"plotdb.php\"'><br>\n"); -
trunk/MagicSoft/Mars/datacenter/db/plotinclude.php
r8421 r8464 41 41 } 42 42 43 function CheckQuery($query) 44 { 45 if (strpos($query, " WHERE ")==FALSE) 46 return " WHERE "; 47 else 48 return " AND "; 49 } 50 43 51 function GetQuery($tables, $joins, $set) 44 52 { … … 58 66 $_GET["primstop"]=""; 59 67 $primstop=$_GET["primstop"]; 60 if (empty($_GET[ $column."Start"]))61 $_GET[ $column."Start"]="";62 $start1=$_GET[ $column."Start"];63 if (empty($_GET[ $column."Stop"]))64 $_GET[ $column."Stop"]="";65 $stop1=$_GET[ $column."Stop"];68 if (empty($_GET["Start"])) 69 $_GET["Start"]=""; 70 $start1=$_GET["Start"]; 71 if (empty($_GET["Stop"])) 72 $_GET["Stop"]=""; 73 $stop1=$_GET["Stop"]; 66 74 67 75 $query="SELECT " . $table . "." . $primary . ", "; … … 76 84 $_GET[$primary."Col2"]=""; 77 85 $column2=$_GET[$primary."Col2"]; 78 if (empty($_GET[ $column2."Start2"]))79 $_GET[ $column2."Start2"]="";80 $start2=$_GET[ $column2."Start2"];81 if (empty($_GET[ $column2."Stop2"]))82 $_GET[ $column2."Stop2"]="";83 $stop2=$_GET[ $column2."Stop2"];86 if (empty($_GET["Start2"])) 87 $_GET["Start2"]=""; 88 $start2=$_GET["Start2"]; 89 if (empty($_GET["Stop2"])) 90 $_GET["Stop2"]=""; 91 $stop2=$_GET["Stop2"]; 84 92 85 93 if ($column2==$primary) … … 90 98 $query.=" FROM " . $table; 91 99 $query.=$joins[$primary]; 92 if (!empty($primstart) && !empty($primstop))93 $query.=" WHERE " . $table . "." . $primary . " BETWEEN " . $primstart . " AND " . $primstop;94 100 95 if (!empty($start1) && !empty($stop1)) 101 if (!empty($primstart)) 102 $query.= " WHERE " . $table . "." . $primary . " > " . $primstart; 103 104 if (!empty($primstop)) 105 $query.= CheckQuery($query) . $table . "." . $primary . " < " . $primstop; 106 107 if (!empty($start1)) 108 $query.= CheckQuery($query) . GetTable($table, $column) . " > " . $start1; 109 110 if (!empty($stop1)) 111 $query.= CheckQuery($query) . GetTable($table, $column) . " < " . $stop1; 112 113 if ($_GET["plot"]=="val") 96 114 { 97 if (strpos($query, " WHERE ")==FALSE) 98 $query.=" WHERE " . $column . " BETWEEN " . $start1 . " AND " . $stop1; 99 else 100 $query.=" AND " . $column . " BETWEEN " . $start1 . " AND " . $stop1; 101 } 115 if (!empty($start2)) 116 $query.= CheckQuery($query) . GetTable($table, $column2) . " > " . $start2; 102 117 103 if ($_GET["plot"]=="val" && !empty($start2) && !empty($stop2)) 104 { 105 if (strpos($query, " WHERE ")==FALSE) 106 $query.=" WHERE " . $column2 . " BETWEEN " . $start2 . " AND " . $stop2; 107 else 108 $query.=" AND " . $column2 . " BETWEEN " . $start2 . " AND " . $stop2; 118 if (!empty($stop2)) 119 $query.= CheckQuery($query) . GetTable($table, $column2) . " < " . $stop2; 109 120 } 110 121 111 122 if (!empty($set) && !empty($_GET[$set])) 112 { 113 if (strpos($query, " WHERE ")==FALSE) 114 $query .= " WHERE "; 115 else 116 $query.=" AND "; 117 $query.= $table . "." . $primary . " IN (" . str_replace(" ", ",", $_GET[$set]) . ") "; 118 } 123 $query.= CheckQuery($query) . $table . "." . $primary . " IN (" . str_replace(" ", ",", $_GET[$set]) . ") "; 124 125 if (empty($_GET[$primary."Col3"])) 126 $_GET[$primary."Col3"]=""; 127 $column3=$_GET[$primary."Col3"]; 128 if (empty($_GET["Start3"])) 129 $_GET["Start3"]=""; 130 $start3=$_GET["Start3"]; 131 if (empty($_GET["Stop3"])) 132 $_GET["Stop3"]=""; 133 $stop3=$_GET["Stop3"]; 134 135 if (!empty($start3)) 136 $query.= CheckQuery($query) . GetTable($table, $column3) . " > " . $start3; 137 138 if (!empty($stop3)) 139 $query.= CheckQuery($query) . GetTable($table, $column3) . " < " . $stop3; 140 141 if (empty($_GET[$primary."Col4"])) 142 $_GET[$primary."Col4"]=""; 143 $column4=$_GET[$primary."Col4"]; 144 if (empty($_GET["Start4"])) 145 $_GET["Start4"]=""; 146 $start4=$_GET["Start4"]; 147 if (empty($_GET["Stop4"])) 148 $_GET["Stop4"]=""; 149 $stop4=$_GET["Stop4"]; 150 151 if (!empty($start4)) 152 $query.= CheckQuery($query) . GetTable($table, $column4) . " > " . $start4; 153 154 if (!empty($stop4)) 155 $query.= CheckQuery($query) . GetTable($table, $column4) . " < " . $stop4; 119 156 120 157 return $query;
Note:
See TracChangeset
for help on using the changeset viewer.