\n");
printf("\n");
printf("show plots\n");
printf("\n");
printf("\n");
printf("\n");
//init
$source="";
if (!empty($_GET["source"]))
$source=$_GET["source"];
$from="";
if (!empty($_GET["from"]))
$from=$_GET["from"];
$to="";
if (!empty($_GET["to"]))
$to=$_GET["to"];
$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;
//$sequences=array(0,10,20);
//$sequences=array();
if (!empty($from) || !empty($to))
{
//get sequences from db
$query="SELECT fSequenceFirst FROM Sequences ";
if (!empty($from) && !empty($to))
$query.="WHERE fSequenceFirst BETWEEN " . $from . " AND " . $to;
else
{
if (!empty($from))
$query.="WHERE fSequenceFirst > " . $from;
if (!empty($to))
$query.="WHERE fSequenceFirst < " . $to;
}
// WHERE has to be there as $from is given by default
if (!empty($source))
$query.=" AND fSourceKEY=" . $source;
//connection to database
$db_id = mysql_pconnect($host, $user, $pw);
if ($db_id==FALSE)
{
printf("mysql_connect returned the following error: %s\n", mysql_error());
die("");
}
mysql_select_db($db);
$result=mysql_query($query, $db_id);
while ($row = mysql_fetch_row($result))
$sequences[] = $row[0];
mysql_free_result($result);
mysql_close($db_id);
if (isset($sequences))
{
//get next, current and previous sequence
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);
//in case a dataset consists of less than 3 sequences
if ($numseq==2)
$nextseq=$prevseq;
}
}
$type=gettypename($type2);
$plot=getplotname($seq, $tabnum, $type, $type2);
printf("\n");
printf("\n");
printf("\n");
ini_set("display_errors", "Off");
?>