Ignore:
Timestamp:
04/19/07 22:51:59 (18 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/db/showplots.php

    r8273 r8421  
    11<?php
    22
    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 }
     3include("plotinclude.php");
    464
    475printf("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
     
    6220if (!empty($_GET["type2"]))
    6321    $type2=$_GET["type2"];
     22$next=0;
     23$prev=0;
    6424
    6525if (!empty($seq))
    6626{
     27    if (!empty($_GET["next"]))
     28        $tabnum=$tabnum+1;
     29    if (!empty($_GET["prev"]))
     30        $tabnum=$tabnum-1;
    6731    $type=gettypename($type2);
    6832    $plot=getplotname($seq, $tabnum, $type, $type2);
    6933
    7034    //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==15))
     35    if (($type2=="calib" && $tabnum==12) || ($type2=="signal" && $tabnum==11) || ($type2=="star" && $tabnum==19))
    7236    {
    7337        $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        }
    7550        $type=gettypename($type2);
    7651        $plot=getplotname($seq, $tabnum, $type, $type2);
    7752    }
    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;
    7975}
    8076printf("<form action='showplots.php' method='GET'>\n");
    8177printf("<table width='100%%' border='0'>\n");
    82 printf("<tr><td>\n");
     78printf("<tr><td align='center'>\n");
    8379printf("<input type='text' name='seq' size='10' maxlength='10' value='%s'>\n", $seq);
    8480printf("<input type='text' name='type2' size='10' maxlength='10' value='%s'>\n", $type2);
    8581printf("<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");
     82printf("<input type='submit' value='Show Plot'><br>\n");
     83if (!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}
     89printf("</td>\n</tr>\n<tr>\n<td align='center'>\n");
    8990if (!empty($seq))
    9091    printf("<img src='%s'>", $plot);
Note: See TracChangeset for help on using the changeset viewer.