source: trunk/MagicSoft/Mars/datacenter/db/showplots-ds.php@ 8422

Last change on this file since 8422 was 8422, checked in by Daniela Dorner, 18 years ago
*** empty log message ***
File size: 3.4 KB
Line 
1<?php
2
3ini_set("display_errors", "On");
4
5include("plotinclude.php");
6printf("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
7printf("<html>\n<head>\n");
8printf("<meta http-equiv='content-type' content='text/html; charset=ISO-8859-1'>\n");
9printf("<title>show plots</title>\n");
10printf("<link rel='stylesheet' type='text/css' href='lamouette.css'>\n");
11printf("</head>\n");
12printf("<body>\n");
13
14$ds=0;
15if (!empty($_GET["ds"]))
16 $ds=$_GET["ds"];
17$tabnum=1;
18if (!empty($_GET["tabnum"]))
19 $tabnum=$_GET["tabnum"];
20$type2="calib";
21if (!empty($_GET["type2"]))
22 $type2=$_GET["type2"];
23$plot="";
24$nextseq=0;
25$prevseq=0;
26$seq=0;
27if (!empty($_GET["prevseq"]) && !empty($_GET["prev"]))
28 $seq=$_GET["prevseq"];
29if (!empty($_GET["nextseq"]) && !empty($_GET["next"]))
30 $seq=$_GET["nextseq"];
31$next=0;
32$prev=0;
33$numseq=0;
34
35if (!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
79printf("<form action='showplots-ds.php' method='GET'>\n");
80printf("<table width='100%%' border='0'>\n");
81printf("<tr><td align='center'>\n");
82if (!empty($prevseq))
83 printf("%d &nbsp;", $prevseq);
84if ($numseq>1)
85 printf("<input type='submit' value='<< Prev Plot' name='prev'>\n");
86printf("<input type='text' name='ds' size='5' maxlength='5' value='%s'>\n", $ds);
87printf("<input type='text' name='type2' size='5' maxlength='5' value='%s'>\n", $type2);
88printf("<input type='text' name='tabnum' size='2' maxlenght='2' value='%s'>\n", $tabnum);
89printf("<input type='hidden' name='prevseq' size='2' maxlenght='2' value='%s'>\n", $prevseq);
90printf("<input type='hidden' name='nextseq' size='2' maxlenght='2' value='%s'>\n", $nextseq);
91if ($numseq>1)
92 printf("<input type='submit' value='Next Plot >>' name='next'>\n");
93else
94 printf("<input type='submit' value='Plot' name='next'>\n");
95if (!empty($nextseq))
96 printf("&nbsp;%d ", $nextseq);
97if ($numseq>0)
98{
99 printf("&nbsp; [ %d sequence", $numseq);
100 if ($numseq>1)
101 printf("s");
102 print(" ] \n");
103}
104printf("</td>\n</tr>\n<tr>\n<td align='center'>\n");
105if (!empty($seq))
106 printf("%s <img src='%s'>", $plot, $plot);
107else
108 printf("You have to insert a dataset number in the first field.");
109printf("</td>\n</tr>\n</table>\n");
110printf("</form>\n");
111printf("</body>\n");
112printf("</html>\n");
113
114ini_set("display_errors", "Off");
115
116?>
Note: See TracBrowser for help on using the repository browser.