Changeset 8598
- Timestamp:
- 06/23/07 18:48:19 (17 years ago)
- Location:
- trunk/MagicSoft/Mars/datacenter/db
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/db/showplots-ds.php
r8533 r8598 4 4 5 5 include("plotinclude.php"); 6 //print header 6 7 printf("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"); 7 8 printf("<html>\n<head>\n"); … … 12 13 printf("<body>\n"); 13 14 15 //init 14 16 $ds=0; 15 17 if (!empty($_GET["ds"])) … … 33 35 $numseq=0; 34 36 37 //check if dataset file is existing 35 38 if (!empty($ds)) 36 39 { 37 40 $num=sprintf("%08d",$ds); 38 41 $num2=substr($num,0,5); 39 $datasetfile="http://datacenter.astro.uni-wuerzburg.de/datasets/" . $num2 . "/dataset" . $num . ".txt"; 42 $datasetfile="../datasets/" . $num2 . "/dataset" . $num . ".txt"; 43 if (!file_exists($datasetfile)) 44 { 45 printf("Sorry, there's no file for dataset %s available.", $ds); 46 //set dataset and sequence numbers to 0 for next checks 47 $ds=0; 48 $seq=0; 49 } 50 } 51 52 //in case of a valid dataset 53 if (!empty($ds)) 54 { 55 //get sequences from dataset file 56 // alternative: query it from db 40 57 $dataset=file_get_contents($datasetfile); 41 58 $onpos=strpos($dataset, "SequencesOn:"); … … 53 70 if ($seq!=0 && !in_array($seq, $sequences)) 54 71 $seq=0; 72 73 //get next, current and previous sequence 55 74 foreach($sequences as $key => $sequ) 56 75 { … … 72 91 } 73 92 $numseq=count($sequences); 93 94 //in case a dataset consists of less than 3 sequences 74 95 if ($numseq==2) 75 96 $nextseq=$prevseq; 76 97 } 77 98 99 //get link for plot 78 100 $type=gettypename($type2); 79 101 $plot=getplotname($seq, $tabnum, $type, $type2); 80 102 103 //print form for choosing dataset and plots 81 104 printf("<form action='showplots-ds.php' method='GET'>\n"); 82 105 printf("<table width='100%%' border='0'>\n"); 83 printf("<tr><td align='center'>\n"); 106 printf("<tr><td valign='top'>\n"); 107 printf("<a href='http://db.astro.uni-wuerzburg.de'>home</a>\n</td><td align='center'>"); 84 108 if (!empty($prevseq)) 85 109 printf("%d ", $prevseq); … … 87 111 printf("<input type='submit' value='<< Prev Plot' name='prev'>\n"); 88 112 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);113 PrintType2PullDown($type2); 90 114 printf("<input type='text' name='tabnum' size='2' maxlenght='2' value='%s'>\n", $tabnum); 91 115 printf("<input type='hidden' name='prevseq' size='2' maxlenght='2' value='%s'>\n", $prevseq); … … 104 128 print(" ] \n"); 105 129 } 106 printf("</td>\n</tr>\n<tr>\n<td align='center'>\n"); 130 printf("</td><td align='right'>\n"); 131 printf("<input class='Width' type='button' value='Reset' onClick='self.location.href=\"showplots-ds.php\"'>\n"); 132 printf("</td>\n</tr>\n<tr>\n<td align='center' colspan='3'>\n"); 107 133 if (!empty($seq)) 108 134 { … … 114 140 } 115 141 else 116 printf("You have to insert a dataset number in the first field.");142 printf("You have to insert a dataset number into the first field."); 117 143 printf("</td>\n</tr>\n</table>\n"); 118 144 printf("</form>\n"); -
trunk/MagicSoft/Mars/datacenter/db/showplots.php
r8588 r8598 11 11 printf("<body>\n"); 12 12 13 //init 13 14 $seq=0; 14 15 if (!empty($_GET["seq"])) … … 25 26 if (!empty($seq)) 26 27 { 28 //decision whether next or previous plot has been chosen 27 29 if (!empty($_GET["next"])) 28 30 $tabnum=$tabnum+1; 29 31 if (!empty($_GET["prev"])) 30 32 $tabnum=$tabnum-1; 31 $type=gettypename($type2);32 $plot=getplotname($seq, $tabnum, $type, $type2);33 33 34 34 //be careful: this has to be adapted in case tabs are removed or new tabs are added … … 41 41 $startabs=18; 42 42 43 //in case the tab does not exist, because it's one the far 44 //go to next type 43 45 if (($type2=="calib" && $tabnum==($calibtabs+1)) 44 46 || ($type2=="signal" && $tabnum==($signaltabs+1)) … … 58 60 break; 59 61 } 60 $type=gettypename($type2);61 $plot=getplotname($seq, $tabnum, $type, $type2);62 62 } 63 //in case the tab does not exist, because it's 0 64 //go to previous type 63 65 if ($tabnum==0) 64 66 { … … 78 80 break; 79 81 } 80 $type=gettypename($type2);81 $plot=getplotname($seq, $tabnum, $type, $type2);82 82 } 83 //get link for plot 84 $type=gettypename($type2); 85 $plot=getplotname($seq, $tabnum, $type, $type2); 86 83 87 $next=$tabnum+1; 84 88 $prev=$tabnum-1; … … 86 90 printf("<form action='showplots.php' method='GET'>\n"); 87 91 printf("<table width='100%%' border='0'>\n"); 88 printf("<tr><td align='center'>\n"); 92 printf("<tr><td valign='top'>\n"); 93 printf("<a href='http://db.astro.uni-wuerzburg.de'>home</a>\n</td><td align='center'>"); 89 94 printf("<input type='text' name='seq' size='10' maxlength='10' value='%s'>\n", $seq); 90 printf("<input type='text' name='type2' size='10' maxlength='10' value='%s'>\n",$type2);95 PrintType2PullDown($type2); 91 96 printf("<input type='text' name='tabnum' size='2' maxlenght='2' value='%s'>\n", $tabnum); 92 97 printf("<input type='submit' value='Show Plot'><br>\n"); … … 97 102 printf("<input type='submit' value='Next Plot %d >>' name='next'>\n", $next); 98 103 } 99 printf("</td>\n</tr>\n<tr>\n<td align='center' >\n");104 printf("</td>\n</tr>\n<tr>\n<td align='center' colspan='2'>\n"); 100 105 if (!empty($seq)) 101 106 printf("<img src='%s'>", $plot); 102 107 else 103 printf("You have to select a sequence.");108 printf("You have to insert a sequence number into the first field."); 104 109 printf("</td>\n</tr>\n</table>\n"); 105 110 printf("</form>\n");
Note:
See TracChangeset
for help on using the changeset viewer.