| 1 | <?php
|
|---|
| 2 |
|
|---|
| 3 | function 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 |
|
|---|
| 20 | function 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 |
|
|---|
| 37 | function 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 |
|
|---|
| 47 | printf("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
|
|---|
| 48 | printf("<html>\n<head>\n");
|
|---|
| 49 | printf("<meta http-equiv='content-type' content='text/html; charset=ISO-8859-1'>\n");
|
|---|
| 50 | printf("<title>show plots</title>\n");
|
|---|
| 51 | printf("<link rel='stylesheet' type='text/css' href='lamouette.css'>\n");
|
|---|
| 52 | printf("</head>\n");
|
|---|
| 53 | printf("<body>\n");
|
|---|
| 54 |
|
|---|
| 55 | $seq=0;
|
|---|
| 56 | if (!empty($_GET["seq"]))
|
|---|
| 57 | $seq=$_GET["seq"];
|
|---|
| 58 | $tabnum=1;
|
|---|
| 59 | if (!empty($_GET["tabnum"]))
|
|---|
| 60 | $tabnum=$_GET["tabnum"];
|
|---|
| 61 | $type2="calib";
|
|---|
| 62 | if (!empty($_GET["type2"]))
|
|---|
| 63 | $type2=$_GET["type2"];
|
|---|
| 64 |
|
|---|
| 65 | if (!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 | }
|
|---|
| 80 | printf("<form action='showplots.php' method='GET'>\n");
|
|---|
| 81 | printf("<table width='100%%' border='0'>\n");
|
|---|
| 82 | printf("<tr><td>\n");
|
|---|
| 83 | printf("<input type='text' name='seq' size='10' maxlength='10' value='%s'>\n", $seq);
|
|---|
| 84 | printf("<input type='text' name='type2' size='10' maxlength='10' value='%s'>\n", $type2);
|
|---|
| 85 | printf("<input type='text' name='tabnum' size='2' maxlenght='2' value='%s'>\n", $tabnum);
|
|---|
| 86 | printf("<input type='submit' value='Show Plot'>\n");
|
|---|
| 87 | printf("plot: %s<br>", $plot);
|
|---|
| 88 | printf("</td>\n</tr>\n<tr>\n<td>\n");
|
|---|
| 89 | if (!empty($seq))
|
|---|
| 90 | printf("<img src='%s'>", $plot);
|
|---|
| 91 | else
|
|---|
| 92 | printf("You have to select a sequence.");
|
|---|
| 93 | printf("</td>\n</tr>\n</table>\n");
|
|---|
| 94 | printf("</form>\n");
|
|---|
| 95 | printf("</body>\n");
|
|---|
| 96 | printf("</html>\n");
|
|---|
| 97 |
|
|---|
| 98 | ?>
|
|---|