\n"); printf("
\n"); printf("DataSet#    \n"); if (empty($_GET["fRunMin"])) $min = "100"; // $min = GetMin("fDataSetNumber", "DataSets", $host, $user, $pw, $db); else $min = $_GET["fRunMin"]; if (empty($_GET["fRunMax"])) $max = GetMax("fDataSetNumber", "DataSets", $host, $user, $pw, $db); else $max = $_GET["fRunMax"]; printf("DataSets from \n", $min); printf("to    \n", $max); if ($_GET["fAll"]=="On") $checked = "checked"; else $checked = ""; printf("plots\n", $checked); if ($_GET["fSequ"]=="On") $checked = "checked"; else $checked = ""; printf("sequences\n", $checked); printf("

\n"); printf("Source (regexp   \n"); ini_set("mysql.trace_mode", "Off"); ini_set("display_errors", "Off"); printf("   \n"); printf("   \n"); if (strchr($_SERVER["REQUEST_URI"], '?')!=FALSE) printf("   \n", $_SERVER["REQUEST_URI"]); printf("

\n"); printf("\n"); printf("\n"); printf("\n"); printf("\n"); printf("\n"); } function GetStatus($step) { if (is_null($step)) return "not done"; else { if (strpos($step, "1970-01-01 00:00:00")==FALSE) return "done"; else return "not to be done"; } return "there is an error -> tell Dani"; } function GetRanges($db_id, $sequences) { $query="SELECT Min(fZenithDistanceMin), Max(fZenithDistanceMax), Min(fRunStart), Max(fRunStart) FROM Sequences WHERE fSequenceFirst IN ("; $sequlist=str_replace(" ", ",", trim($sequences)); // printf("sequ-after: %s", $sequlist); $query .= $sequlist . ")"; $result = mysql_query($query, $db_id); // printf("query: %s", $query); $zdmin=mysql_result($result, $i, 0); $zdmax=mysql_result($result, $i, 1); $starttime=str_replace("-", "/",substr(mysql_result($result, $i, 2),0,10)); $stoptime=str_replace("-", "/",substr(mysql_result($result, $i, 3),0,10)); printf("
Zd: %s - %s degree
Observationperiod: %s - %s ", $zdmin, $zdmax, $starttime, $stoptime); } function PrintDataSetInfo($db_id, $result0, $ganymedtabsw, $ganymedtabs) { $numres = mysql_num_rows($result0); printf("
"); printf("\n"); printf(""); for ($i=0 ; $i<$numres ; $i++) { $datasetno=mysql_result($result0, $i, 0); $wobble=mysql_result($result0, $i, 1); $comment=mysql_result($result0, $i, 2); $source=mysql_result($result0, $i, 3); $inserted=mysql_result($result0, $i, 4); $filesavail=mysql_result($result0, $i, 5); $ganymed=mysql_result($result0, $i, 6); $fillganymed=mysql_result($result0, $i, 7); $excess=mysql_result($result0, $i, 8); $bg=mysql_result($result0, $i, 9); $signal=mysql_result($result0, $i, 10); $signif=mysql_result($result0, $i, 11); $scale=mysql_result($result0, $i, 12); $effontime=mysql_result($result0, $i, 13); $num=sprintf("%08d",$datasetno); $num2=substr($num,0,5); $datasetfile="http://www.astro.uni-wuerzburg.de/datacenter/datasets/" . $num2 . "/dataset" . $num . ".txt"; printf(""); } printf("
"); printf("# of DataSets: %d ", $numres); printf("
"); printf(" "); printf(" \n"); printf(" ", $datasetfile, $datasetno); printf(" \n"); printf(" \n"); printf(" "); if (!is_null($fillganymed)) { printf("\n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" \n"); printf(" "); printf(" \n", $excess); printf(" \n", $bg); printf(" \n", $signal); printf(" \n", $signif); printf(" \n", $scale); printf(" \n", $effontime); } if ($_GET["fSequ"]=="On") { $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)); if (!empty($sequon)) { printf(""); if (!empty($sequoff)) { printf(""); } } } printf(""); if ($_GET["fAll"]=="On" && !is_null($ganymed)) { printf(""); } printf("
Source: %s (DataSet#:", $source, $datasetno); printf(" %s)
%s ", $comment); printf("
Wobble: %s", $wobble); if (!is_null($ganymed)) printf(", ganymed done "); printf("
results "); printf(" (plots)", $num2, $num); printf("
excess eventsbackground eventssignal eventssignificancescale factoreffective ontime
%s%s%s%s%s%s h
\n SequencesOn: "); $sequences=split(" ", trim($sequon)); foreach($sequences as $key => $sequ) printf("%s ", $sequ, $sequ); GetRanges($db_id, $sequon); printf("
\n SequencesOff: "); $sequences=split(" ", trim($sequoff)); foreach($sequences as $key => $sequ) printf("%s ", $sequ, $sequ); GetRanges($db_id, $sequoff); printf("
\n Plots: "); if ($wobble=='Y') $tabs=$ganymedtabsw; else $tabs=$ganymedtabs; foreach($tabs as $key => $element) if (!$key==0) printf("%s ", $num2, $num, $num, $key, $element); printf("
\n"); printf(" ", $num2, $num, $num); printf(" ", $num2, $num, $num); printf("
"); printf("

\n"); printf("
\n"); printf("\n"); } function PrintPage($html, $host, $user, $pw, $db, $ganymedtabsw, $ganymedtabs) { $db_id = mysql_connect($host, $user, $pw); if ($db_id==FALSE) { printf("mysql_connect returned the following error: %s\n", mysql_error()); die(""); } mysql_select_db($db); $query0 = CreateQuery($_GET); $result0 = mysql_query($query0, $db_id); if ($result0) { if ($html=="1" || $html=="2") PrintDataSetInfo($db_id, $result0, $ganymedtabsw, $ganymedtabs); else PrintText($result0); mysql_free_result($result0); } mysql_close($db_id); if ($html=="1") printf("submitted query:
%s
", htmlspecialchars($query0)); } include ("include.php"); include ("db.php"); include ("tabs.php"); ini_set("display_errors", "On"); ini_set("mysql.trace_mode", "On"); if (!empty($_GET["fSendTxt"])) { header("Content-type: application/octet"); header("Content-Disposition: attachment; filename=query-result.txt"); PrintPage("0", $host, $user, $pw, $db, $ganymedtabsw, $ganymedtabs); } else { echo (file_get_contents("index-header.html")); $environment = sizeof($_GET); InitGet($_GET); if (empty($_GET["fPrintTable"])) PrintForm($_GET, $host, $user, $pw, $db); if ($environment==0) printf("No query submitted yet.
"); else { if (empty($_GET["fPrintTable"])) PrintPage("1", $host, $user, $pw, $db, $ganymedtabsw, $ganymedtabs); else PrintPage("2", $host, $user, $pw, $db, $ganymedtabsw, $ganymedtabs); } echo (file_get_contents("index-footer.html")); } ini_set("display_errors", "Off"); ini_set("mysql.trace_mode", "Off"); } ?>