Changeset 8598


Ignore:
Timestamp:
06/23/07 18:48:19 (17 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/datacenter/db
Files:
2 edited

Legend:

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

    r8533 r8598  
    44
    55include("plotinclude.php");
     6//print header
    67printf("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
    78printf("<html>\n<head>\n");
     
    1213printf("<body>\n");
    1314
     15//init
    1416$ds=0;
    1517if (!empty($_GET["ds"]))
     
    3335$numseq=0;
    3436
     37//check if dataset file is existing
    3538if (!empty($ds))
    3639{
    3740    $num=sprintf("%08d",$ds);
    3841    $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
     53if (!empty($ds))
     54{
     55    //get sequences from dataset file
     56    // alternative: query it from db
    4057    $dataset=file_get_contents($datasetfile);
    4158    $onpos=strpos($dataset, "SequencesOn:");
     
    5370    if ($seq!=0 && !in_array($seq, $sequences))
    5471        $seq=0;
     72
     73    //get next, current and previous sequence
    5574    foreach($sequences as $key => $sequ)
    5675    {
     
    7291    }
    7392    $numseq=count($sequences);
     93
     94    //in case a dataset consists of less than 3 sequences
    7495    if ($numseq==2)
    7596        $nextseq=$prevseq;
    7697}
    7798
     99//get link for plot
    78100$type=gettypename($type2);
    79101$plot=getplotname($seq, $tabnum, $type, $type2);
    80102
     103//print form for choosing dataset and plots
    81104printf("<form action='showplots-ds.php' method='GET'>\n");
    82105printf("<table width='100%%' border='0'>\n");
    83 printf("<tr><td align='center'>\n");
     106printf("<tr><td valign='top'>\n");
     107printf("<a href='http://db.astro.uni-wuerzburg.de'>home</a>\n</td><td align='center'>");
    84108if (!empty($prevseq))
    85109    printf("%d &nbsp;", $prevseq);
     
    87111    printf("<input type='submit' value='<< Prev Plot' name='prev'>\n");
    88112printf("<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);
     113PrintType2PullDown($type2);
    90114printf("<input type='text' name='tabnum' size='2' maxlenght='2' value='%s'>\n", $tabnum);
    91115printf("<input type='hidden' name='prevseq' size='2' maxlenght='2' value='%s'>\n", $prevseq);
     
    104128    print(" ] \n");
    105129}
    106 printf("</td>\n</tr>\n<tr>\n<td align='center'>\n");
     130printf("</td><td align='right'>\n");
     131printf("<input class='Width' type='button' value='Reset' onClick='self.location.href=\"showplots-ds.php\"'>\n");
     132printf("</td>\n</tr>\n<tr>\n<td align='center' colspan='3'>\n");
    107133if (!empty($seq))
    108134{
     
    114140}
    115141else
    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.");
    117143printf("</td>\n</tr>\n</table>\n");
    118144printf("</form>\n");
  • trunk/MagicSoft/Mars/datacenter/db/showplots.php

    r8588 r8598  
    1111printf("<body>\n");
    1212
     13//init
    1314$seq=0;
    1415if (!empty($_GET["seq"]))
     
    2526if (!empty($seq))
    2627{
     28    //decision whether next or previous plot has been chosen
    2729    if (!empty($_GET["next"]))
    2830        $tabnum=$tabnum+1;
    2931    if (!empty($_GET["prev"]))
    3032        $tabnum=$tabnum-1;
    31     $type=gettypename($type2);
    32     $plot=getplotname($seq, $tabnum, $type, $type2);
    3333
    3434    //be careful: this has to be adapted in case tabs are removed or new tabs are added
     
    4141    $startabs=18;
    4242
     43    //in case the tab does not exist, because it's one the far
     44    //go to next type
    4345    if (($type2=="calib" && $tabnum==($calibtabs+1))
    4446        || ($type2=="signal" && $tabnum==($signaltabs+1))
     
    5860            break;
    5961        }
    60         $type=gettypename($type2);
    61         $plot=getplotname($seq, $tabnum, $type, $type2);
    6262    }
     63    //in case the tab does not exist, because it's 0
     64    //go to previous type
    6365    if ($tabnum==0)
    6466    {
     
    7880            break;
    7981        }
    80         $type=gettypename($type2);
    81         $plot=getplotname($seq, $tabnum, $type, $type2);
    8282    }
     83    //get link for plot
     84    $type=gettypename($type2);
     85    $plot=getplotname($seq, $tabnum, $type, $type2);
     86
    8387    $next=$tabnum+1;
    8488    $prev=$tabnum-1;
     
    8690printf("<form action='showplots.php' method='GET'>\n");
    8791printf("<table width='100%%' border='0'>\n");
    88 printf("<tr><td align='center'>\n");
     92printf("<tr><td valign='top'>\n");
     93printf("<a href='http://db.astro.uni-wuerzburg.de'>home</a>\n</td><td align='center'>");
    8994printf("<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);
     95PrintType2PullDown($type2);
    9196printf("<input type='text' name='tabnum' size='2' maxlenght='2' value='%s'>\n", $tabnum);
    9297printf("<input type='submit' value='Show Plot'><br>\n");
     
    97102    printf("<input type='submit' value='Next Plot %d >>' name='next'>\n", $next);
    98103}
    99 printf("</td>\n</tr>\n<tr>\n<td align='center'>\n");
     104printf("</td>\n</tr>\n<tr>\n<td align='center' colspan='2'>\n");
    100105if (!empty($seq))
    101106    printf("<img src='%s'>", $plot);
    102107else
    103     printf("You have to select a sequence.");
     108    printf("You have to insert a sequence number into the first field.");
    104109printf("</td>\n</tr>\n</table>\n");
    105110printf("</form>\n");
Note: See TracChangeset for help on using the changeset viewer.