Changeset 8421 for trunk/MagicSoft/Mars/datacenter/db/showplots.php
- Timestamp:
- 04/19/07 22:51:59 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/db/showplots.php
r8273 r8421 1 1 <?php 2 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 } 3 include("plotinclude.php"); 46 4 47 5 printf("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"); … … 62 20 if (!empty($_GET["type2"])) 63 21 $type2=$_GET["type2"]; 22 $next=0; 23 $prev=0; 64 24 65 25 if (!empty($seq)) 66 26 { 27 if (!empty($_GET["next"])) 28 $tabnum=$tabnum+1; 29 if (!empty($_GET["prev"])) 30 $tabnum=$tabnum-1; 67 31 $type=gettypename($type2); 68 32 $plot=getplotname($seq, $tabnum, $type, $type2); 69 33 70 34 //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==1 5))35 if (($type2=="calib" && $tabnum==12) || ($type2=="signal" && $tabnum==11) || ($type2=="star" && $tabnum==19)) 72 36 { 73 37 $tabnum=1; 74 $type2=nexttype2($type2); 38 switch ($type2) 39 { 40 case "calib": 41 $type2="signal"; 42 break; 43 case "signal": 44 $type2="star"; 45 break; 46 case "star": 47 $type2="calib"; 48 break; 49 } 75 50 $type=gettypename($type2); 76 51 $plot=getplotname($seq, $tabnum, $type, $type2); 77 52 } 78 $tabnum=$tabnum+1; 53 if ($tabnum==0) 54 { 55 switch($type2) 56 { 57 case "calib": 58 $type2="star"; 59 $tabnum=18; 60 break; 61 case "signal": 62 $type2="calib"; 63 $tabnum=11; 64 break; 65 case "star": 66 $type2="signal"; 67 $tabnum=10; 68 break; 69 } 70 $type=gettypename($type2); 71 $plot=getplotname($seq, $tabnum, $type, $type2); 72 } 73 $next=$tabnum+1; 74 $prev=$tabnum-1; 79 75 } 80 76 printf("<form action='showplots.php' method='GET'>\n"); 81 77 printf("<table width='100%%' border='0'>\n"); 82 printf("<tr><td >\n");78 printf("<tr><td align='center'>\n"); 83 79 printf("<input type='text' name='seq' size='10' maxlength='10' value='%s'>\n", $seq); 84 80 printf("<input type='text' name='type2' size='10' maxlength='10' value='%s'>\n", $type2); 85 81 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"); 82 printf("<input type='submit' value='Show Plot'><br>\n"); 83 if (!empty($seq)) 84 { 85 printf("<input type='submit' value='<< %d Prev Plot' name='prev'>\n", $prev); 86 printf("%s \n", $plot); 87 printf("<input type='submit' value='Next Plot %d >>' name='next'>\n", $next); 88 } 89 printf("</td>\n</tr>\n<tr>\n<td align='center'>\n"); 89 90 if (!empty($seq)) 90 91 printf("<img src='%s'>", $plot);
Note:
See TracChangeset
for help on using the changeset viewer.