\n"); printf("\n\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\n"); PrintHomeHelp(); printf("\n\n\n\n\n
\n"); if (!empty($prevseq)) printf("%d  ", $prevseq); if ($numseq>1) printf("\n"); if (empty($from)) $from=34099;//21.8.2004 $db_id = mysql_connect($host, $user, $pw); if ($db_id==FALSE) { printf("mysql_connect returned the following error:
"); printf("%s
", mysql_error()); die(""); } mysql_select_db($db); $query="SELECT fSourceKEY, fSourceName FROM Source ORDER BY fSourceName"; $result=mysql_query($query); if (!$result) printf("-N/A-"); printf(" \n"); mysql_free_result($result); mysql_close($db_id); printf("from \n", $from); printf(" to \n", $to); PrintType2PullDown($type2); printf("\n", $tabnum); printf("\n", $prevseq); printf("\n", $nextseq); if ($numseq>1) printf("\n"); else printf("\n"); if (!empty($nextseq)) printf(" %d ", $nextseq); if ($numseq>0) { printf("  [ %d sequence", $numseq); if ($numseq>1) printf("s"); print(" ] \n"); } printf("
\n"); printf("\n"); printf("
\n"); if (!empty($seq)) { printf("
%s
", getinfofromdb($seq), $plot, $plot); printf("", $plot); } else printf("Choose a source and/or a range of sequences or just click 'Plot' for going through all sequences."); printf("
\n"); printf("
\n"); printf("\n"); printf("\n"); ini_set("display_errors", "Off"); ?>