Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 8420)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 8421)
@@ -19,4 +19,28 @@
                                                  -*-*- END OF LINE -*-*-
 
+ 2007/04/12 Daniela Dorner
+
+   * datacenter/db/showplots-ds.php:
+     - added (script to plot all plots of a data set)
+
+   * datacenter/db/showplots.php:
+     - added 'previous' and 'next' button
+
+   * datacenter/db/plotinclude.php, datacenter/db/showplots.php:
+     - moved two function from showplots.php to plotinclude.php, as they
+       are also used in showplots-ds.php
+
+   * datacenter/db/builddatasets.php, datacenter/db/datasetinfo-aio.php
+     datacenter/db/indes-header.html, datacenter/db/indes.html, 
+     datacenter/db/menu.js, datacenter/db/reference.html, 
+     datacenter/db/regexp.html, datacenter/db/runinfo-aio.html, 
+     datacenter/db/sequinfo-aio.html:
+     - adapted paths of images and mars.css
+
+   * datacenter/db/index.html:
+     - added link to showplots-ds.php
+
+
+
  2007/04/18 Thomas Bretz
 
Index: /trunk/MagicSoft/Mars/datacenter/db/index.html
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/db/index.html	(revision 8420)
+++ /trunk/MagicSoft/Mars/datacenter/db/index.html	(revision 8421)
@@ -52,4 +52,5 @@
 <li><A HREF="plotdb.php">Plots</A>: plot values from the database yourself online</li>
 <li><A HREF="showplots.php">All plots of one sequence</A>: click through all calib, signal and star plot of one sequence</li>
+<li><A HREF="showplots-ds.php">All plots of one dataset</A>: click through all sequences of one dataset (all plots of calib, signal and star can be viewed)</li>
 </ul>
 <p>
Index: /trunk/MagicSoft/Mars/datacenter/db/plotinclude.php
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/db/plotinclude.php	(revision 8420)
+++ /trunk/MagicSoft/Mars/datacenter/db/plotinclude.php	(revision 8421)
@@ -1,4 +1,5 @@
 <?php
 
+//arrays and functions for plot.php and plotdb.php
 include("include.php");
 include("magicdefs.php");
@@ -120,4 +121,31 @@
 }
 
+//functions for showplots.php and showplots2.php
+function gettypename($type2)
+{
+    switch ($type2)
+    {
+    case "calib":
+        $type="callisto";
+        break;
+    case "signal":
+        $type="callisto";
+        break;
+    case "star":
+        $type="star";
+        break;
+    }
+    return $type;
+}
+
+function getplotname($seq, $tabnum, $type, $type2)
+{
+    $seqlong=str_pad($seq, 8, "0", STR_PAD_LEFT);
+    $seqshort=substr($seqlong, 0, 4);
+    $plot  = "http://datacenter.astro.uni-wuerzburg.de/";
+    $plot .= $type . "/" . str_pad( $seqshort, 4, "0", STR_PAD_LEFT);
+    $plot .= "/" . $seqlong . "/" . $type2 . $seqlong . "-tab" . $tabnum . ".png";
+    return $plot;
+}
 
 ?>
Index: /trunk/MagicSoft/Mars/datacenter/db/runinfo-aio.php
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/db/runinfo-aio.php	(revision 8420)
+++ /trunk/MagicSoft/Mars/datacenter/db/runinfo-aio.php	(revision 8421)
@@ -236,8 +236,8 @@
             printf("1000000000");
         printf("'>\n");
-        printf("<img id='allbutton' src='../minus.png' alt='-' onclick=\"showhide('all')\"> <b>Menu</b>&nbsp;&nbsp;&nbsp;&nbsp;\n");
-        printf("&nbsp;&nbsp;<img id='infobutton'   src='../plus.png' alt='+' onClick=\"showhide('info');showhide('info2')\"> RunInfo    \n");
-        printf("&nbsp;&nbsp;<img id='statbutton'   src='../plus.png' alt='+' onClick=\"showhide('stat');showhide('fail')\">  StatusInfo \n");
-        printf("&nbsp;&nbsp;<img id='rangesbutton' src='../plus.png' alt='+' onClick=\"showhide('ranges')\">                 Ranges     \n");
+        printf("<img id='allbutton' src='minus.png' alt='-' onclick=\"showhide('all')\"> <b>Menu</b>&nbsp;&nbsp;&nbsp;&nbsp;\n");
+        printf("&nbsp;&nbsp;<img id='infobutton'   src='plus.png' alt='+' onClick=\"showhide('info');showhide('info2')\"> RunInfo    \n");
+        printf("&nbsp;&nbsp;<img id='statbutton'   src='plus.png' alt='+' onClick=\"showhide('stat');showhide('fail')\">  StatusInfo \n");
+        printf("&nbsp;&nbsp;<img id='rangesbutton' src='plus.png' alt='+' onClick=\"showhide('ranges')\">                 Ranges     \n");
 
         printf(" <div id='all' style='display:block'>");
Index: /trunk/MagicSoft/Mars/datacenter/db/sequinfo-aio.php
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/db/sequinfo-aio.php	(revision 8420)
+++ /trunk/MagicSoft/Mars/datacenter/db/sequinfo-aio.php	(revision 8421)
@@ -285,11 +285,11 @@
             printf("1000000000");
         printf("'>\n");
-        printf("<img id='allbutton' src='../minus.png' alt='-' onclick='showhide(\"all\")'> <b>Menu</b>&nbsp;&nbsp;&nbsp;&nbsp; \n");
-        printf("&nbsp;&nbsp;<img id='infobutton'   src='../plus.png' alt='+' onClick='showhide(\"info\");showhide(\"info2\")'> SequInfo   \n");
-        printf("&nbsp;&nbsp;<img id='statbutton'   src='../plus.png' alt='+' onClick='showhide(\"stat\");showhide(\"fail\")'>  StatusInfo \n");
-        printf("&nbsp;&nbsp;<img id='calbutton'    src='../plus.png' alt='+' onClick='showhide(\"cal\")'>                      CalInfo    \n");
-        printf("&nbsp;&nbsp;<img id='starbutton'   src='../plus.png' alt='+' onClick='showhide(\"star\")'>                     StarInfo   \n");
-        printf("&nbsp;&nbsp;<img id='limitsbutton' src='../plus.png' alt='+' onClick='showhide(\"limits\")'>                   Limits     \n");
-        printf("&nbsp;&nbsp;<img id='rangesbutton' src='../plus.png' alt='+' onClick='showhide(\"ranges\")'>                   Ranges     \n");
+        printf("<img id='allbutton' src='minus.png' alt='-' onclick='showhide(\"all\")'> <b>Menu</b>&nbsp;&nbsp;&nbsp;&nbsp; \n");
+        printf("&nbsp;&nbsp;<img id='infobutton'   src='plus.png' alt='+' onClick='showhide(\"info\");showhide(\"info2\")'> SequInfo   \n");
+        printf("&nbsp;&nbsp;<img id='statbutton'   src='plus.png' alt='+' onClick='showhide(\"stat\");showhide(\"fail\")'>  StatusInfo \n");
+        printf("&nbsp;&nbsp;<img id='calbutton'    src='plus.png' alt='+' onClick='showhide(\"cal\")'>                      CalInfo    \n");
+        printf("&nbsp;&nbsp;<img id='starbutton'   src='plus.png' alt='+' onClick='showhide(\"star\")'>                     StarInfo   \n");
+        printf("&nbsp;&nbsp;<img id='limitsbutton' src='plus.png' alt='+' onClick='showhide(\"limits\")'>                   Limits     \n");
+        printf("&nbsp;&nbsp;<img id='rangesbutton' src='plus.png' alt='+' onClick='showhide(\"ranges\")'>                   Ranges     \n");
 
         printf(" <div id='all' style='display:block'>");
Index: /trunk/MagicSoft/Mars/datacenter/db/showplots-ds.php
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/db/showplots-ds.php	(revision 8421)
+++ /trunk/MagicSoft/Mars/datacenter/db/showplots-ds.php	(revision 8421)
@@ -0,0 +1,116 @@
+<?php
+
+ini_set("display_errors", "On");
+
+include("plotinclude.php");
+printf("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
+printf("<html>\n<head>\n");
+printf("<meta http-equiv='content-type' content='text/html; charset=ISO-8859-1'>\n");
+printf("<title>show plots</title>\n");
+printf("<link rel='stylesheet' type='text/css' href='lamouette.css'>\n");
+printf("</head>\n");
+printf("<body>\n");
+
+$ds=0;
+if (!empty($_GET["ds"]))
+    $ds=$_GET["ds"];
+$tabnum=1;
+if (!empty($_GET["tabnum"]))
+    $tabnum=$_GET["tabnum"];
+$type2="calib";
+if (!empty($_GET["type2"]))
+    $type2=$_GET["type2"];
+$plot="";
+$nextseq=0;
+$prevseq=0;
+$seq=0;
+if (!empty($_GET["prevseq"]) && !empty($_GET["prev"]))
+    $seq=$_GET["prevseq"];
+if (!empty($_GET["nextseq"]) && !empty($_GET["next"]))
+    $seq=$_GET["nextseq"];
+$next=0;
+$prev=0;
+$numseq=0;
+
+if (!empty($ds))
+{
+    $num=sprintf("%08d",$ds);
+    $num2=substr($num,0,5);
+    $datasetfile="http://datacenter.astro.uni-wuerzburg.de/datasets/" . $num2 . "/dataset" . $num . ".txt";
+    $dataset=file_get_contents($datasetfile);
+    $onpos=strpos($dataset, "SequencesOn:");
+    $offpos=strpos($dataset, "SequencesOff:");
+    $possource=strpos($dataset, "SourceName:");
+    $sequoff="";
+    if (!empty($offpos))
+        $sequoff=substr($dataset, $offpos+13, $possource-($offpos+13));
+    if (empty($offpos))
+        $offpos=$possource;
+    $sequon=substr($dataset, $onpos+12, $offpos-($onpos+12));
+    $sequences=split(" ", trim($sequon));
+    if ($seq!=0 && !in_array($seq, $sequences))
+        $seq=0;
+    foreach($sequences as $key => $sequ)
+    {
+        if ($seq==0)
+            $seq=$sequ;
+        if ($next==1)
+        {
+            $nextseq=$sequ;
+            if ($prevseq!=0)
+                break;
+            $next=0;
+        }
+        if ($sequ==$seq)
+        {
+            $next=1;
+            continue;
+        }
+        $prevseq=$sequ;
+    }
+    $numseq=count($sequences);
+    if ($numseq==2)
+        $nextseq=$prevseq;
+}
+
+$type=gettypename($type2);
+$plot=getplotname($seq, $tabnum, $type, $type2);
+
+printf("<form action='showplots3.php' method='GET'>\n");
+printf("<table width='100%%' border='0'>\n");
+printf("<tr><td align='center'>\n");
+if (!empty($prevseq))
+    printf("%d &nbsp;", $prevseq);
+if ($numseq>1)
+    printf("<input type='submit' value='<< Prev Plot' name='prev'>\n");
+printf("<input type='text' name='ds' size='5' maxlength='5' value='%s'>\n", $ds);
+printf("<input type='text' name='type2' size='5' maxlength='5' value='%s'>\n", $type2);
+printf("<input type='text' name='tabnum' size='2' maxlenght='2' value='%s'>\n", $tabnum);
+printf("<input type='hidden' name='prevseq' size='2' maxlenght='2' value='%s'>\n", $prevseq);
+printf("<input type='hidden' name='nextseq' size='2' maxlenght='2' value='%s'>\n", $nextseq);
+if ($numseq>1)
+    printf("<input type='submit' value='Next Plot >>' name='next'>\n");
+else
+    printf("<input type='submit' value='Plot' name='next'>\n");
+if (!empty($nextseq))
+    printf("&nbsp;%d ", $nextseq);
+if ($numseq>0)
+{
+    printf("&nbsp; [ %d sequence", $numseq);
+    if ($numseq>1)
+        printf("s");
+    print(" ] \n");
+}
+printf("</td>\n</tr>\n<tr>\n<td align='center'>\n");
+if (!empty($seq))
+    printf("%s <img src='%s'>", $plot, $plot);
+else
+    printf("You have to insert a dataset number in the first field.");
+printf("</td>\n</tr>\n</table>\n");
+printf("</form>\n");
+printf("</body>\n");
+printf("</html>\n");
+
+ini_set("display_errors", "Off");
+
+?>
Index: /trunk/MagicSoft/Mars/datacenter/db/showplots.php
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/db/showplots.php	(revision 8420)
+++ /trunk/MagicSoft/Mars/datacenter/db/showplots.php	(revision 8421)
@@ -1,47 +1,5 @@
 <?php
 
-function gettypename($type2)
-{
-    switch ($type2)
-    {
-    case "calib":
-        $type="callisto";
-        break;
-    case "signal":
-        $type="callisto";
-        break;
-    case "star":
-        $type="star";
-        break;
-    }
-    return $type;
-}
-
-function nexttype2($type2)
-{
-    switch ($type2)
-    {
-    case "calib":
-        $type2="signal";
-        break;
-    case "signal":
-        $type2="star";
-        break;
-    case "star":
-        $type2="calib";
-        break;
-    }
-    return $type2;
-}
-
-function getplotname($seq, $tabnum, $type, $type2)
-{
-    $seqlong=str_pad($seq, 8, "0", STR_PAD_LEFT);
-    $seqshort=substr($seqlong, 0, 4);
-    $plot  = "http://vela.astro.uni-wuerzburg.de/datacenter/";
-    $plot .= $type . "/" . str_pad( $seqshort, 4, "0", STR_PAD_LEFT);
-    $plot .= "/" . $seqlong . "/" . $type2 . $seqlong . "-tab" . $tabnum . ".png";
-    return $plot;
-}
+include("plotinclude.php");
 
 printf("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
@@ -62,29 +20,72 @@
 if (!empty($_GET["type2"]))
     $type2=$_GET["type2"];
+$next=0;
+$prev=0;
 
 if (!empty($seq))
 {
+    if (!empty($_GET["next"]))
+        $tabnum=$tabnum+1;
+    if (!empty($_GET["prev"]))
+        $tabnum=$tabnum-1;
     $type=gettypename($type2);
     $plot=getplotname($seq, $tabnum, $type, $type2);
 
     //be careful: this has to be adapted in case tabs are removed or new tabs are added
-    if (($type2=="calib" && $tabnum==12) || ($type2=="signal" && $tabnum==11) || ($type2=="star" && $tabnum==15))
+    if (($type2=="calib" && $tabnum==12) || ($type2=="signal" && $tabnum==11) || ($type2=="star" && $tabnum==19))
     {
         $tabnum=1;
-        $type2=nexttype2($type2);
+        switch ($type2)
+        {
+        case "calib":
+            $type2="signal";
+            break;
+        case "signal":
+            $type2="star";
+            break;
+        case "star":
+            $type2="calib";
+            break;
+        }
         $type=gettypename($type2);
         $plot=getplotname($seq, $tabnum, $type, $type2);
     }
-    $tabnum=$tabnum+1;
+    if ($tabnum==0)
+    {
+        switch($type2)
+        {
+        case "calib":
+            $type2="star";
+            $tabnum=18;
+            break;
+        case "signal":
+            $type2="calib";
+            $tabnum=11;
+            break;
+        case "star":
+            $type2="signal";
+            $tabnum=10;
+            break;
+        }
+        $type=gettypename($type2);
+        $plot=getplotname($seq, $tabnum, $type, $type2);
+    }
+    $next=$tabnum+1;
+    $prev=$tabnum-1;
 }
 printf("<form action='showplots.php' method='GET'>\n");
 printf("<table width='100%%' border='0'>\n");
-printf("<tr><td>\n");
+printf("<tr><td align='center'>\n");
 printf("<input type='text' name='seq' size='10' maxlength='10' value='%s'>\n", $seq);
 printf("<input type='text' name='type2' size='10' maxlength='10' value='%s'>\n", $type2);
 printf("<input type='text' name='tabnum' size='2' maxlenght='2' value='%s'>\n", $tabnum);
-printf("<input type='submit' value='Show Plot'>\n");
-printf("plot: %s<br>", $plot);
-printf("</td>\n</tr>\n<tr>\n<td>\n");
+printf("<input type='submit' value='Show Plot'><br>\n");
+if (!empty($seq))
+{
+    printf("<input type='submit' value='<< %d Prev Plot' name='prev'>\n", $prev);
+    printf("%s \n", $plot);
+    printf("<input type='submit' value='Next Plot %d >>' name='next'>\n", $next);
+}
+printf("</td>\n</tr>\n<tr>\n<td align='center'>\n");
 if (!empty($seq))
     printf("<img src='%s'>", $plot);
