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

Last change on this file since 8273 was 8273, checked in by Daniela Dorner, 18 years ago
*** empty log message ***
File size: 2.6 KB
Line 
1<?php
2
3function gettypename($type2)
4{
5 switch ($type2)
6 {
7 case "calib":
8 $type="callisto";
9 break;
10 case "signal":
11 $type="callisto";
12 break;
13 case "star":
14 $type="star";
15 break;
16 }
17 return $type;
18}
19
20function nexttype2($type2)
21{
22 switch ($type2)
23 {
24 case "calib":
25 $type2="signal";
26 break;
27 case "signal":
28 $type2="star";
29 break;
30 case "star":
31 $type2="calib";
32 break;
33 }
34 return $type2;
35}
36
37function getplotname($seq, $tabnum, $type, $type2)
38{
39 $seqlong=str_pad($seq, 8, "0", STR_PAD_LEFT);
40 $seqshort=substr($seqlong, 0, 4);
41 $plot = "http://vela.astro.uni-wuerzburg.de/datacenter/";
42 $plot .= $type . "/" . str_pad( $seqshort, 4, "0", STR_PAD_LEFT);
43 $plot .= "/" . $seqlong . "/" . $type2 . $seqlong . "-tab" . $tabnum . ".png";
44 return $plot;
45}
46
47printf("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
48printf("<html>\n<head>\n");
49printf("<meta http-equiv='content-type' content='text/html; charset=ISO-8859-1'>\n");
50printf("<title>show plots</title>\n");
51printf("<link rel='stylesheet' type='text/css' href='lamouette.css'>\n");
52printf("</head>\n");
53printf("<body>\n");
54
55$seq=0;
56if (!empty($_GET["seq"]))
57 $seq=$_GET["seq"];
58$tabnum=1;
59if (!empty($_GET["tabnum"]))
60 $tabnum=$_GET["tabnum"];
61$type2="calib";
62if (!empty($_GET["type2"]))
63 $type2=$_GET["type2"];
64
65if (!empty($seq))
66{
67 $type=gettypename($type2);
68 $plot=getplotname($seq, $tabnum, $type, $type2);
69
70 //be careful: this has to be adapted in case tabs are removed or new tabs are added
71 if (($type2=="calib" && $tabnum==12) || ($type2=="signal" && $tabnum==11) || ($type2=="star" && $tabnum==15))
72 {
73 $tabnum=1;
74 $type2=nexttype2($type2);
75 $type=gettypename($type2);
76 $plot=getplotname($seq, $tabnum, $type, $type2);
77 }
78 $tabnum=$tabnum+1;
79}
80printf("<form action='showplots.php' method='GET'>\n");
81printf("<table width='100%%' border='0'>\n");
82printf("<tr><td>\n");
83printf("<input type='text' name='seq' size='10' maxlength='10' value='%s'>\n", $seq);
84printf("<input type='text' name='type2' size='10' maxlength='10' value='%s'>\n", $type2);
85printf("<input type='text' name='tabnum' size='2' maxlenght='2' value='%s'>\n", $tabnum);
86printf("<input type='submit' value='Show Plot'>\n");
87printf("plot: %s<br>", $plot);
88printf("</td>\n</tr>\n<tr>\n<td>\n");
89if (!empty($seq))
90 printf("<img src='%s'>", $plot);
91else
92 printf("You have to select a sequence.");
93printf("</td>\n</tr>\n</table>\n");
94printf("</form>\n");
95printf("</body>\n");
96printf("</html>\n");
97
98?>
Note: See TracBrowser for help on using the repository browser.