source: branches/AddingGoogleTestEnvironment/datacenter/db/showplots.php@ 19779

Last change on this file since 19779 was 9466, checked in by aparavac, 16 years ago
*** empty log message ***
File size: 3.2 KB
Line 
1<?php
2
3include("plotinclude.php");
4
5printf("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
6printf("<html>\n<head>\n");
7printf("<meta http-equiv='content-type' content='text/html; charset=ISO-8859-1'>\n");
8printf("<title>show plots</title>\n");
9printf("<link rel='stylesheet' type='text/css' href='lamouette.css'>\n");
10printf("</head>\n");
11printf("<body>\n");
12
13//init
14$seq=0;
15if (!empty($_GET["seq"]))
16 $seq=str_replace(" ", "", $_GET["seq"]);
17$tabnum=1;
18if (!empty($_GET["tabnum"]))
19 $tabnum=$_GET["tabnum"];
20$type2="calib";
21if (!empty($_GET["type2"]))
22 $type2=$_GET["type2"];
23$next=0;
24$prev=0;
25
26if (!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}
90printf("<form action='showplots.php' method='GET'>\n");
91printf("<table width='100%%' border='0'>\n<tr>\n");
92PrintHomeHelp();
93printf("<td align='center'>\n");
94if (!empty($seq))
95 printf("<input type='submit' value='<< %d Prev Plot' name='prev'>\n", $prev);
96printf("<input type='text' name='seq' size='10' maxlength='10' value='%s'>\n", $seq);
97PrintType2PullDown($type2);
98printf("<input type='text' name='tabnum' size='2' maxlenght='2' value='%s'>\n", $tabnum);
99printf("<input type='submit' value='Show Plot'>\n");
100if (!empty($seq))
101 printf("<input type='submit' value='Next Plot %d >>' name='next'>\n", $next);
102
103printf("</td>\n</tr>\n<tr>\n<td align='center' colspan='2'>\n");
104if (!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}
109else
110 printf("You have to insert a sequence number into the first field.");
111printf("</td>\n</tr>\n</table>\n");
112printf("</form>\n");
113printf("</body>\n");
114printf("</html>\n");
115
116?>
Note: See TracBrowser for help on using the repository browser.