source: trunk/MagicSoft/Mars/datacenter/db/plotdb.php@ 8420

Last change on this file since 8420 was 8402, checked in by Daniela Dorner, 18 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 5.7 KB
Line 
1<?php
2{
3 function PrintDiv($column, $list, $num)
4 {
5 if (($_GET["prim"]==$column && empty($num)) || ($_GET["prim"]==$column && $_GET["plot"]=="val" && $num==2))
6 printf("<div id='%s%s' style='display:inline'>\n", $column, $num);
7 else
8 printf("<div id='%s%s' style='display:none'>\n", $column, $num);
9
10 if (!empty($num))
11 $vs="vs";
12
13 printf("<select name='%sCol%s' size='1' class='Width'>\n", $column, $num);
14 foreach($list as $column2)
15 if ($_GET[$column."Col".$num]==$column2)
16 printf("<option value='%s' selected>%s %s</option>\n", $column2, $vs, $column2);
17 else
18 printf("<option value='%s'>%s %s</option>\n", $column2, $vs, $column2);
19
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&nbsp;<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&nbsp;<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]);
29 printf("</div>\n");
30 }
31
32 ini_set("display_errors", "On");
33 ini_set("mysql.trace_mode", "On");
34
35 echo (file_get_contents("index-header.html"));
36
37 include("plotinclude.php");
38
39 //init
40 if (empty($_GET["plot"]))
41 $_GET["plot"]=0;
42 if (empty($_GET["primstart"]))
43 $_GET["primstart"]=0;
44 if (empty($_GET["primstop"]))
45 $_GET["primstop"]=0;
46 if (empty($_GET["prim"]))
47 $_GET["prim"]=0;
48 if (empty($_GET["fSequenceFirstCol"]))
49 $_GET["fSequenceFirstCol"]=0;
50 if (empty($_GET["fSequenceFirstCol2"]))
51 $_GET["fSequenceFirstCol2"]=0;
52 if (empty($_GET["fRunNumberCol"]))
53 $_GET["fRunNumberCol"]=0;
54 if (empty($_GET["fRunNumberCol2"]))
55 $_GET["fRunNumberCol2"]=0;
56 if (empty($_GET["fDataSetNumberCol"]))
57 $_GET["fDataSetNumberCol"]=0;
58 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;
68 if (empty($_GET["Set"]))
69 $_GET["Set"]=0;
70 if (empty($_GET["Set2"]))
71 $_GET["Set2"]=0;
72
73 printf("<center>\n<table cellpadding='0'>\n");
74 printf("<tr><td align='left'>\n");
75 printf("<form style='margin-bottom:0;' action='plotdb.php' METHOD='GET'>\n");
76
77 printf("&nbsp;<input type='radio' name='plot' value='prim' onclick='hidepulldown2()' %s> vs primary &nbsp;", $_GET["plot"]=="prim" ? "checked" : "");
78 printf("&nbsp;<input type='radio' name='plot' value='val' onclick='showpulldown2()' %s> vs value <br><br>", $_GET["plot"]=="val" ? "checked" : "");
79
80 printf("<select name='prim' size='1' class='Width'>\n");
81 foreach($prims as $primary => $column)
82 if ($_GET["prim"]==$column)
83 printf("<option onclick=\"showpulldown('%s')\" value='%s' selected>%s</option>\n", $column, $column, $primary);
84 else
85 printf("<option onclick=\"showpulldown('%s')\" value='%s'>%s</option>\n", $column, $column, $primary);
86 printf("</select>\n");
87 printf(" from&nbsp;<input name='primstart' type='text' size='6' maxlength='6' value='%s'>", $_GET["primstart"]);
88 printf(" to&nbsp;<input name='primstop' type='text' size='6' maxlength='6' value='%s'><br>\n", $_GET["primstop"]);
89
90 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 }
96
97 printf("<br>Set1: <input name='Set' type='text' size='20' maxlength='100' value='%s'>\n", $_GET["Set"]);
98 printf("<br>Set2: <input name='Set2' type='text' size='20' maxlength='100' value='%s'>\n", $_GET["Set2"]);
99 printf("<br><br><input class='Width' type='submit' value='Query Plot'><br>\n");
100 printf("<input class='Width' type='button' value='Reset' onClick='self.location.href=\"plotdb.php\"'><br>\n");
101
102 printf("</form>");
103 printf("</td>\n");
104
105 printf("<td align='right' width='640px' height='400px'>\n");
106 if (!empty($_GET))
107 {
108 $img="plot.php?par=hallo";
109 foreach($_GET as $var => $val)
110 $img.="&amp;".$var ."=".$val;
111// printf("link: %s<br>", $img);
112 printf("<img src='%s' alt='plot'>", $img);
113 }
114 printf("</td></tr>\n");
115 printf("<tr><td colspan='2'>\n");
116 printf("some remarks:\n<ul>");
117 printf("<li>For Runs plotting the whole range (i.e. without giving a range or when giving a too large range) ");
118 printf("doesn't work with ChartDirector.</li>\n");
119 printf("<li>In Set1 and Set2 Sets can be given (e.g. on sequences in Set1 and off sequences in Set2) - they ");
120 printf("are displayed in colour (Set: blue, Set2: red). Please give the numbers with space as separator (e.g. 40004 40022).</<li>\n");
121 printf("<li>0 is not accepted in the ranges fields, please write .0 or 00</li>");
122 printf("<li>Be aware, that plotting timestamps, e.g. fRunStart, doesn't work. </li>");
123 printf("</ul></td></tr>\n");
124
125 /*
126 printf("<tr><td>\n");
127 $query=GetQuery($tables, $joins, "");
128 printf("Q: %s</td></tr>", $query);
129 */
130
131 printf("</table>\n");
132 printf("</center>\n");
133
134 echo (file_get_contents("index-footer.html"));
135
136 ini_set("display_errors", "Off");
137 ini_set("mysql.trace_mode", "Off");
138}
139?>
Note: See TracBrowser for help on using the repository browser.