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=str_replace(" ", "", $_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=12;
|
---|
38 | else
|
---|
39 | $signaltabs=14;
|
---|
40 | $calibtabs=11;
|
---|
41 | $startabs=20;
|
---|
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<tr>\n");
|
---|
92 | PrintHomeHelp();
|
---|
93 | printf("<td align='center'>\n");
|
---|
94 | if (!empty($seq))
|
---|
95 | printf("<input type='submit' value='<< %d Prev Plot' name='prev'>\n", $prev);
|
---|
96 | printf("<input type='text' name='seq' size='10' maxlength='10' value='%s'>\n", $seq);
|
---|
97 | PrintType2PullDown($type2);
|
---|
98 | printf("<input type='text' name='tabnum' size='2' maxlenght='2' value='%s'>\n", $tabnum);
|
---|
99 | printf("<input type='submit' value='Show Plot'>\n");
|
---|
100 | if (!empty($seq))
|
---|
101 | printf("<input type='submit' value='Next Plot %d >>' name='next'>\n", $next);
|
---|
102 |
|
---|
103 | printf("</td>\n</tr>\n<tr>\n<td align='center' colspan='2'>\n");
|
---|
104 | if (!empty($seq))
|
---|
105 | {
|
---|
106 | printf("<div onmouseover=\"this.innerHTML='%s'\" onmouseout=\"this.innerHTML='%s'\"> %s </div>", getinfofromdb($seq), $plot, $plot);
|
---|
107 | printf("<img src='%s'>", $plot);
|
---|
108 | }
|
---|
109 | else
|
---|
110 | printf("You have to insert a sequence number into the first field.");
|
---|
111 | printf("</td>\n</tr>\n</table>\n");
|
---|
112 | printf("</form>\n");
|
---|
113 | printf("</body>\n");
|
---|
114 | printf("</html>\n");
|
---|
115 |
|
---|
116 | ?>
|
---|