Ignore:
Timestamp:
06/23/07 18:48:19 (17 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 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");
Note: See TracChangeset for help on using the changeset viewer.