1 | <?php
|
---|
2 |
|
---|
3 | ini_set("display_errors", "On");
|
---|
4 |
|
---|
5 | include("plotinclude.php");
|
---|
6 | printf("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
|
---|
7 | printf("<html>\n<head>\n");
|
---|
8 | printf("<meta http-equiv='content-type' content='text/html; charset=ISO-8859-1'>\n");
|
---|
9 | printf("<title>show plots</title>\n");
|
---|
10 | printf("<link rel='stylesheet' type='text/css' href='lamouette.css'>\n");
|
---|
11 | printf("</head>\n");
|
---|
12 | printf("<body>\n");
|
---|
13 |
|
---|
14 | $ds=0;
|
---|
15 | if (!empty($_GET["ds"]))
|
---|
16 | $ds=$_GET["ds"];
|
---|
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 | $plot="";
|
---|
24 | $nextseq=0;
|
---|
25 | $prevseq=0;
|
---|
26 | $seq=0;
|
---|
27 | if (!empty($_GET["prevseq"]) && !empty($_GET["prev"]))
|
---|
28 | $seq=$_GET["prevseq"];
|
---|
29 | if (!empty($_GET["nextseq"]) && !empty($_GET["next"]))
|
---|
30 | $seq=$_GET["nextseq"];
|
---|
31 | $next=0;
|
---|
32 | $prev=0;
|
---|
33 | $numseq=0;
|
---|
34 |
|
---|
35 | if (!empty($ds))
|
---|
36 | {
|
---|
37 | $num=sprintf("%08d",$ds);
|
---|
38 | $num2=substr($num,0,5);
|
---|
39 | $datasetfile="http://datacenter.astro.uni-wuerzburg.de/datasets/" . $num2 . "/dataset" . $num . ".txt";
|
---|
40 | $dataset=file_get_contents($datasetfile);
|
---|
41 | $onpos=strpos($dataset, "SequencesOn:");
|
---|
42 | $offpos=strpos($dataset, "SequencesOff:");
|
---|
43 | $possource=strpos($dataset, "SourceName:");
|
---|
44 | $sequoff="";
|
---|
45 | if (!empty($offpos))
|
---|
46 | $sequoff=substr($dataset, $offpos+13, $possource-($offpos+13));
|
---|
47 | if (empty($offpos))
|
---|
48 | $offpos=$possource;
|
---|
49 | $sequon=substr($dataset, $onpos+12, $offpos-($onpos+12));
|
---|
50 | $sequences=split(" ", trim($sequon));
|
---|
51 | if ($seq!=0 && !in_array($seq, $sequences))
|
---|
52 | $seq=0;
|
---|
53 | foreach($sequences as $key => $sequ)
|
---|
54 | {
|
---|
55 | if ($seq==0)
|
---|
56 | $seq=$sequ;
|
---|
57 | if ($next==1)
|
---|
58 | {
|
---|
59 | $nextseq=$sequ;
|
---|
60 | if ($prevseq!=0)
|
---|
61 | break;
|
---|
62 | $next=0;
|
---|
63 | }
|
---|
64 | if ($sequ==$seq)
|
---|
65 | {
|
---|
66 | $next=1;
|
---|
67 | continue;
|
---|
68 | }
|
---|
69 | $prevseq=$sequ;
|
---|
70 | }
|
---|
71 | $numseq=count($sequences);
|
---|
72 | if ($numseq==2)
|
---|
73 | $nextseq=$prevseq;
|
---|
74 | }
|
---|
75 |
|
---|
76 | $type=gettypename($type2);
|
---|
77 | $plot=getplotname($seq, $tabnum, $type, $type2);
|
---|
78 |
|
---|
79 | printf("<form action='showplots-ds.php' method='GET'>\n");
|
---|
80 | printf("<table width='100%%' border='0'>\n");
|
---|
81 | printf("<tr><td align='center'>\n");
|
---|
82 | if (!empty($prevseq))
|
---|
83 | printf("%d ", $prevseq);
|
---|
84 | if ($numseq>1)
|
---|
85 | printf("<input type='submit' value='<< Prev Plot' name='prev'>\n");
|
---|
86 | printf("<input type='text' name='ds' size='5' maxlength='5' value='%s'>\n", $ds);
|
---|
87 | printf("<input type='text' name='type2' size='6' maxlength='6' value='%s'>\n", $type2);
|
---|
88 | printf("<input type='text' name='tabnum' size='2' maxlenght='2' value='%s'>\n", $tabnum);
|
---|
89 | printf("<input type='hidden' name='prevseq' size='2' maxlenght='2' value='%s'>\n", $prevseq);
|
---|
90 | printf("<input type='hidden' name='nextseq' size='2' maxlenght='2' value='%s'>\n", $nextseq);
|
---|
91 | if ($numseq>1)
|
---|
92 | printf("<input type='submit' value='Next Plot >>' name='next'>\n");
|
---|
93 | else
|
---|
94 | printf("<input type='submit' value='Plot' name='next'>\n");
|
---|
95 | if (!empty($nextseq))
|
---|
96 | printf(" %d ", $nextseq);
|
---|
97 | if ($numseq>0)
|
---|
98 | {
|
---|
99 | printf(" [ %d sequence", $numseq);
|
---|
100 | if ($numseq>1)
|
---|
101 | printf("s");
|
---|
102 | print(" ] \n");
|
---|
103 | }
|
---|
104 | printf("</td>\n</tr>\n<tr>\n<td align='center'>\n");
|
---|
105 | if (!empty($seq))
|
---|
106 | printf("%s <img src='%s'>", $plot, $plot);
|
---|
107 | else
|
---|
108 | printf("You have to insert a dataset number in the first field.");
|
---|
109 | printf("</td>\n</tr>\n</table>\n");
|
---|
110 | printf("</form>\n");
|
---|
111 | printf("</body>\n");
|
---|
112 | printf("</html>\n");
|
---|
113 |
|
---|
114 | ini_set("display_errors", "Off");
|
---|
115 |
|
---|
116 | ?>
|
---|