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=split(" ", trim(substr($dataset, $offpos+13, $possource-($offpos+13))));
|
---|
47 | if (empty($offpos))
|
---|
48 | $offpos=$possource;
|
---|
49 | $sequon=split(" ", trim(substr($dataset, $onpos+12, $offpos-($onpos+12))));
|
---|
50 | $sequences=$sequon;
|
---|
51 | if (!empty($sequoff))
|
---|
52 | $sequences=array_merge($sequences,$sequoff);
|
---|
53 | if ($seq!=0 && !in_array($seq, $sequences))
|
---|
54 | $seq=0;
|
---|
55 | foreach($sequences as $key => $sequ)
|
---|
56 | {
|
---|
57 | if ($seq==0)
|
---|
58 | $seq=$sequ;
|
---|
59 | if ($next==1)
|
---|
60 | {
|
---|
61 | $nextseq=$sequ;
|
---|
62 | if ($prevseq!=0)
|
---|
63 | break;
|
---|
64 | $next=0;
|
---|
65 | }
|
---|
66 | if ($sequ==$seq)
|
---|
67 | {
|
---|
68 | $next=1;
|
---|
69 | continue;
|
---|
70 | }
|
---|
71 | $prevseq=$sequ;
|
---|
72 | }
|
---|
73 | $numseq=count($sequences);
|
---|
74 | if ($numseq==2)
|
---|
75 | $nextseq=$prevseq;
|
---|
76 | }
|
---|
77 |
|
---|
78 | $type=gettypename($type2);
|
---|
79 | $plot=getplotname($seq, $tabnum, $type, $type2);
|
---|
80 |
|
---|
81 | printf("<form action='showplots-ds.php' method='GET'>\n");
|
---|
82 | printf("<table width='100%%' border='0'>\n");
|
---|
83 | printf("<tr><td align='center'>\n");
|
---|
84 | if (!empty($prevseq))
|
---|
85 | printf("%d ", $prevseq);
|
---|
86 | if ($numseq>1)
|
---|
87 | printf("<input type='submit' value='<< Prev Plot' name='prev'>\n");
|
---|
88 | printf("<input type='text' name='ds' size='5' maxlength='5' value='%s'>\n", $ds);
|
---|
89 | printf("<input type='text' name='type2' size='6' maxlength='6' value='%s'>\n", $type2);
|
---|
90 | printf("<input type='text' name='tabnum' size='2' maxlenght='2' value='%s'>\n", $tabnum);
|
---|
91 | printf("<input type='hidden' name='prevseq' size='2' maxlenght='2' value='%s'>\n", $prevseq);
|
---|
92 | printf("<input type='hidden' name='nextseq' size='2' maxlenght='2' value='%s'>\n", $nextseq);
|
---|
93 | if ($numseq>1)
|
---|
94 | printf("<input type='submit' value='Next Plot >>' name='next'>\n");
|
---|
95 | else
|
---|
96 | printf("<input type='submit' value='Plot' name='next'>\n");
|
---|
97 | if (!empty($nextseq))
|
---|
98 | printf(" %d ", $nextseq);
|
---|
99 | if ($numseq>0)
|
---|
100 | {
|
---|
101 | printf(" [ %d sequence", $numseq);
|
---|
102 | if ($numseq>1)
|
---|
103 | printf("s");
|
---|
104 | print(" ] \n");
|
---|
105 | }
|
---|
106 | printf("</td>\n</tr>\n<tr>\n<td align='center'>\n");
|
---|
107 | if (!empty($seq))
|
---|
108 | {
|
---|
109 | if (in_array($seq, $sequon))
|
---|
110 | printf("<font color='green'>\n");
|
---|
111 | else
|
---|
112 | printf("<font color='red'>\n");
|
---|
113 | printf("%s <img src='%s'>", $plot, $plot);
|
---|
114 | }
|
---|
115 | else
|
---|
116 | printf("You have to insert a dataset number in the first field.");
|
---|
117 | printf("</td>\n</tr>\n</table>\n");
|
---|
118 | printf("</form>\n");
|
---|
119 | printf("</body>\n");
|
---|
120 | printf("</html>\n");
|
---|
121 |
|
---|
122 | ini_set("display_errors", "Off");
|
---|
123 |
|
---|
124 | ?>
|
---|