1 | <?php
|
---|
2 |
|
---|
3 | include("plotinclude.php");
|
---|
4 |
|
---|
5 | printf("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
|
---|
6 | printf("<html>\n<head>\n");
|
---|
7 | printf("<meta http-equiv='content-type' content='text/html; charset=ISO-8859-1'>\n");
|
---|
8 | printf("<title>show plots</title>\n");
|
---|
9 | printf("<link rel='stylesheet' type='text/css' href='lamouette.css'>\n");
|
---|
10 | printf("</head>\n");
|
---|
11 | printf("<body>\n");
|
---|
12 |
|
---|
13 | //init
|
---|
14 | $seq=0;
|
---|
15 | if (!empty($_GET["seq"]))
|
---|
16 | $seq=$_GET["seq"];
|
---|
17 | $tabnum=1;
|
---|
18 | if (!empty($_GET["tabnum"]))
|
---|
19 | $tabnum=$_GET["tabnum"];
|
---|
20 | $type2="calib";
|
---|
21 | if (!empty($_GET["type2"]))
|
---|
22 | $type2=$_GET["type2"];
|
---|
23 | $next=0;
|
---|
24 | $prev=0;
|
---|
25 |
|
---|
26 | if (!empty($seq))
|
---|
27 | {
|
---|
28 | //decision whether next or previous plot has been chosen
|
---|
29 | if (!empty($_GET["next"]))
|
---|
30 | $tabnum=$tabnum+1;
|
---|
31 | if (!empty($_GET["prev"]))
|
---|
32 | $tabnum=$tabnum-1;
|
---|
33 |
|
---|
34 | //be careful: this has to be adapted in case tabs are removed or new tabs are added
|
---|
35 | //number of tabs for calib*.root, signal*.root and star*.root
|
---|
36 | if ($seq > 200000)
|
---|
37 | $signaltabs=10;
|
---|
38 | else
|
---|
39 | $signaltabs=12;
|
---|
40 | $calibtabs=11;
|
---|
41 | $startabs=18;
|
---|
42 |
|
---|
43 | //in case the tab does not exist, because it's one the far
|
---|
44 | //go to next type
|
---|
45 | if (($type2=="calib" && $tabnum==($calibtabs+1))
|
---|
46 | || ($type2=="signal" && $tabnum==($signaltabs+1))
|
---|
47 | || ($type2=="star" && $tabnum==($startabs+1)))
|
---|
48 | {
|
---|
49 | $tabnum=1;
|
---|
50 | switch ($type2)
|
---|
51 | {
|
---|
52 | case "calib":
|
---|
53 | $type2="signal";
|
---|
54 | break;
|
---|
55 | case "signal":
|
---|
56 | $type2="star";
|
---|
57 | break;
|
---|
58 | case "star":
|
---|
59 | $type2="calib";
|
---|
60 | break;
|
---|
61 | }
|
---|
62 | }
|
---|
63 | //in case the tab does not exist, because it's 0
|
---|
64 | //go to previous type
|
---|
65 | if ($tabnum==0)
|
---|
66 | {
|
---|
67 | switch($type2)
|
---|
68 | {
|
---|
69 | case "calib":
|
---|
70 | $type2="star";
|
---|
71 | $tabnum=$startabs;
|
---|
72 | break;
|
---|
73 | case "signal":
|
---|
74 | $type2="calib";
|
---|
75 | $tabnum=$calibtabs;
|
---|
76 | break;
|
---|
77 | case "star":
|
---|
78 | $type2="signal";
|
---|
79 | $tabnum=$signaltabs;
|
---|
80 | break;
|
---|
81 | }
|
---|
82 | }
|
---|
83 | //get link for plot
|
---|
84 | $type=gettypename($type2);
|
---|
85 | $plot=getplotname($seq, $tabnum, $type, $type2);
|
---|
86 |
|
---|
87 | $next=$tabnum+1;
|
---|
88 | $prev=$tabnum-1;
|
---|
89 | }
|
---|
90 | printf("<form action='showplots.php' method='GET'>\n");
|
---|
91 | printf("<table width='100%%' border='0'>\n");
|
---|
92 | printf("<tr><td valign='top'>\n");
|
---|
93 | printf("<a href='http://db.astro.uni-wuerzburg.de'>home</a>\n</td><td align='center'>");
|
---|
94 | printf("<input type='text' name='seq' size='10' maxlength='10' value='%s'>\n", $seq);
|
---|
95 | PrintType2PullDown($type2);
|
---|
96 | printf("<input type='text' name='tabnum' size='2' maxlenght='2' value='%s'>\n", $tabnum);
|
---|
97 | printf("<input type='submit' value='Show Plot'><br>\n");
|
---|
98 | if (!empty($seq))
|
---|
99 | {
|
---|
100 | printf("<input type='submit' value='<< %d Prev Plot' name='prev'>\n", $prev);
|
---|
101 | printf("%s \n", $plot);
|
---|
102 | printf("<input type='submit' value='Next Plot %d >>' name='next'>\n", $next);
|
---|
103 | }
|
---|
104 | printf("</td>\n</tr>\n<tr>\n<td align='center' colspan='2'>\n");
|
---|
105 | if (!empty($seq))
|
---|
106 | printf("<img src='%s'>", $plot);
|
---|
107 | else
|
---|
108 | printf("You have to insert a sequence number into the first field.");
|
---|
109 | printf("</td>\n</tr>\n</table>\n");
|
---|
110 | printf("</form>\n");
|
---|
111 | printf("</body>\n");
|
---|
112 | printf("</html>\n");
|
---|
113 |
|
---|
114 | ?>
|
---|