source: trunk/MagicSoft/Mars/datacenter/db/showplots.php@ 8768

Last change on this file since 8768 was 8598, checked in by Daniela Dorner, 17 years ago
*** empty log message ***
File size: 3.1 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=$_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=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}
90printf("<form action='showplots.php' method='GET'>\n");
91printf("<table width='100%%' border='0'>\n");
92printf("<tr><td valign='top'>\n");
93printf("<a href='http://db.astro.uni-wuerzburg.de'>home</a>\n</td><td align='center'>");
94printf("<input type='text' name='seq' size='10' maxlength='10' value='%s'>\n", $seq);
95PrintType2PullDown($type2);
96printf("<input type='text' name='tabnum' size='2' maxlenght='2' value='%s'>\n", $tabnum);
97printf("<input type='submit' value='Show Plot'><br>\n");
98if (!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}
104printf("</td>\n</tr>\n<tr>\n<td align='center' colspan='2'>\n");
105if (!empty($seq))
106 printf("<img src='%s'>", $plot);
107else
108 printf("You have to insert a sequence number into the first field.");
109printf("</td>\n</tr>\n</table>\n");
110printf("</form>\n");
111printf("</body>\n");
112printf("</html>\n");
113
114?>
Note: See TracBrowser for help on using the repository browser.