1 | <?php
|
---|
2 | {
|
---|
3 | function PrintDiv($host, $user, $pw, $db, $column, $tables, $num)
|
---|
4 | {
|
---|
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))
|
---|
11 | printf("<div id='%s%s' style='display:inline'>\n", $column, $num);
|
---|
12 | else
|
---|
13 | printf("<div id='%s%s' style='display:none'>\n", $column, $num);
|
---|
14 |
|
---|
15 | if ($num==2)
|
---|
16 | $vs="vs";
|
---|
17 |
|
---|
18 | printf("<select name='%sCol%s' size='1' class='Width'>\n", $column, $num);
|
---|
19 | foreach($list as $column2)
|
---|
20 | if ($_GET[$column."Col".$num]==$column2)
|
---|
21 | printf("<option value='%s' selected>%s %s</option>\n", $column2, $vs, $column2);
|
---|
22 | else
|
---|
23 | printf("<option value='%s'>%s %s</option>\n", $column2, $vs, $column2);
|
---|
24 |
|
---|
25 | printf("</select>\n<br>\n");
|
---|
26 | printf("</div>\n");
|
---|
27 | }
|
---|
28 |
|
---|
29 | ini_set("display_errors", "On");
|
---|
30 | ini_set("mysql.trace_mode", "On");
|
---|
31 |
|
---|
32 | echo (file_get_contents("index-header.html"));
|
---|
33 |
|
---|
34 | include("plotinclude.php");
|
---|
35 |
|
---|
36 | //init
|
---|
37 | if (empty($_GET["plot"]))
|
---|
38 | $_GET["plot"]="";
|
---|
39 | if (empty($_GET["primstart"]))
|
---|
40 | $_GET["primstart"]="";
|
---|
41 | if (empty($_GET["primstop"]))
|
---|
42 | $_GET["primstop"]="";
|
---|
43 | if (empty($_GET["prim"]))
|
---|
44 | $_GET["prim"]="";
|
---|
45 | if (empty($_GET["fSequenceFirstCol"]))
|
---|
46 | $_GET["fSequenceFirstCol"]="";
|
---|
47 | if (empty($_GET["fSequenceFirstCol2"]))
|
---|
48 | $_GET["fSequenceFirstCol2"]="";
|
---|
49 | if (empty($_GET["fSequenceFirstCol3"]))
|
---|
50 | $_GET["fSequenceFirstCol3"]="";
|
---|
51 | if (empty($_GET["fRunNumberCol"]))
|
---|
52 | $_GET["fRunNumberCol"]="";
|
---|
53 | if (empty($_GET["fRunNumberCol2"]))
|
---|
54 | $_GET["fRunNumberCol2"]="";
|
---|
55 | if (empty($_GET["fRunNumberCol3"]))
|
---|
56 | $_GET["fRunNumberCol3"]="";
|
---|
57 | if (empty($_GET["fDataSetNumberCol"]))
|
---|
58 | $_GET["fDataSetNumberCol"]="";
|
---|
59 | if (empty($_GET["fDataSetNumberCol2"]))
|
---|
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"]="";
|
---|
79 | if (empty($_GET["Set"]))
|
---|
80 | $_GET["Set"]="";
|
---|
81 | if (empty($_GET["Set2"]))
|
---|
82 | $_GET["Set2"]="";
|
---|
83 |
|
---|
84 | printf("<center>\n<table cellpadding='0'>\n");
|
---|
85 | printf("<tr><td align='left'>\n");
|
---|
86 | printf("<form style='margin-bottom:0;' action='plotdb.php' METHOD='GET'>\n");
|
---|
87 |
|
---|
88 | printf(" <input type='radio' name='plot' value='prim' onclick='hidepulldown2()' %s> vs primary ", $_GET["plot"]=="prim" ? "checked" : "");
|
---|
89 | printf(" <input type='radio' name='plot' value='val' onclick='showpulldown2()' %s> vs value <br><br>", $_GET["plot"]=="val" ? "checked" : "");
|
---|
90 |
|
---|
91 | printf("<table>\n");
|
---|
92 | printf("<tr><td>\n");
|
---|
93 | printf("<select name='prim' size='1' class='Width'>\n");
|
---|
94 | foreach($prims as $primary => $column)
|
---|
95 | if ($_GET["prim"]==$column)
|
---|
96 | printf("<option onclick=\"showpulldown('%s')\" value='%s' selected>%s</option>\n", $column, $column, $primary);
|
---|
97 | else
|
---|
98 | printf("<option onclick=\"showpulldown('%s')\" value='%s'>%s</option>\n", $column, $column, $primary);
|
---|
99 | printf("</select>\n");
|
---|
100 | printf(" </td><td valign='top'>\n ");
|
---|
101 | printf(" from <input name='primstart' type='text' size='6' maxlength='6' value='%s'>", $_GET["primstart"]);
|
---|
102 | printf(" to <input name='primstop' type='text' size='6' maxlength='6' value='%s'>", $_GET["primstop"]);
|
---|
103 | printf("</td>\n</tr>\n");
|
---|
104 |
|
---|
105 | printf("<tr><td>\n");
|
---|
106 | foreach($prims as $primary => $column)
|
---|
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");
|
---|
141 |
|
---|
142 | printf("<br>Set1: <input name='Set' type='text' size='20' maxlength='100' value='%s'>\n", $_GET["Set"]);
|
---|
143 | printf("<br>Set2: <input name='Set2' type='text' size='20' maxlength='100' value='%s'>\n", $_GET["Set2"]);
|
---|
144 |
|
---|
145 | printf("<br><br><input class='Width' type='submit' value='Query Plot'><br>\n");
|
---|
146 | printf("<input class='Width' type='button' value='Reset' onClick='self.location.href=\"plotdb.php\"'><br>\n");
|
---|
147 |
|
---|
148 | printf("</form>");
|
---|
149 | printf("</td>\n");
|
---|
150 |
|
---|
151 | printf("<td align='right' width='640px' height='400px'>\n");
|
---|
152 | if (!empty($_GET))
|
---|
153 | {
|
---|
154 | $img="plot.php?par=hallo";
|
---|
155 | foreach($_GET as $var => $val)
|
---|
156 | $img.="&".$var ."=".$val;
|
---|
157 | // printf("link: %s<br>", $img);
|
---|
158 | printf("<img src='%s' alt='plot'>", $img);
|
---|
159 | }
|
---|
160 | printf("</td></tr>\n");
|
---|
161 | printf("<tr><td colspan='2'>\n");
|
---|
162 | printf("some remarks:\n<ul>");
|
---|
163 | printf("<li>For Runs plotting the whole range (i.e. without giving a range or when giving a too large range) ");
|
---|
164 | printf("doesn't work with ChartDirector.</li>\n");
|
---|
165 | printf("<li>In Set1 and Set2 Sets can be given (e.g. on sequences in Set1 and off sequences in Set2) - they ");
|
---|
166 | printf("are displayed in colour (Set: blue, Set2: red). Please give the numbers with space as separator (e.g. 40004 40022).</<li>\n");
|
---|
167 | printf("<li>0 is not accepted in the ranges fields, please write .0 or 00</li>");
|
---|
168 | printf("<li>Be aware, that plotting timestamps, e.g. fRunStart, doesn't work. </li>");
|
---|
169 | printf("</ul></td></tr>\n");
|
---|
170 |
|
---|
171 | /*
|
---|
172 | printf("<tr><td>\n");
|
---|
173 | $query=GetQuery($tables, $joins, "");
|
---|
174 | printf("Q: %s</td></tr>", $query);
|
---|
175 | */
|
---|
176 |
|
---|
177 | printf("</table>\n");
|
---|
178 | printf("</center>\n");
|
---|
179 |
|
---|
180 | echo (file_get_contents("index-footer.html"));
|
---|
181 |
|
---|
182 | ini_set("display_errors", "Off");
|
---|
183 | ini_set("mysql.trace_mode", "Off");
|
---|
184 | }
|
---|
185 | ?>
|
---|