\n"; echo "alert(\"".$text."\")\n"; echo "\n"; } $maintenance=0; $maintenance=1; if ($maintenance) { echo "
\n

MAINTENANCE ONGOING

\n"; echo "

check again later...

\n

\n


\n

\n

\n"; } $tables=array( "AnalysisResultsRunLP" => "QLA", "AnalysisResultsRunISDC" => "ISDC", "AnalysisResultsRunCutsLC" => "CutsLC", ); $times=array( "timestamp" => "timestamp [YYYY-MM-DD HH:MM:SS]", "unix" => "unix-timestamp [seconds]", "mjd" => "modified julian date [days]", ); $zdcuts=array( "all" => "all data", "75" => "zd<75", "45" => "zd<45", "35" => "zd<35", "30" => "zd<30", ); $thcuts=array( "all" => "all data", "550" => "th<550", "350" => "th<350", ); $lights=array( "all" => "all data", "nomoon" => "no moon", "dark" => "only dark night", ); $dchs=array( "no" => "all data", "yes" => "apply data check (R750)", ); $rmemptyrows=array( "no" => "all data", "yes" => "remove rows with empty columns", ); $dusts=array( "all" => "all data", "20" => "dust<20", "10" => "dust<10", "1.0" => "dust<1", ); $factorcuts=array( "all" => "all data", "0.1" => "zdfactor * thfactor > 0.1", "0.2" => "zdfactor * thfactor > 0.2", "0.3" => "zdfactor * thfactor > 0.3", "0.4" => "zdfactor * thfactor > 0.4", "0.5" => "zdfactor * thfactor > 0.5", "0.6" => "zdfactor * thfactor > 0.6", "0.7" => "zdfactor * thfactor > 0.7", "0.8" => "zdfactor * thfactor > 0.8", "0.9" => "zdfactor * thfactor > 0.9", ); $timebins=array( "5" => "5 minutes", "10" => "10 minutes", "20" => "20 minutes", "30" => "30 minutes", "40" => "40 minutes", "60" => "1 hour", "90" => "1.5 hours", "120" => "2 hours", "180" => "3 hours", "240" => "4 hours", "300" => "5 hours", "360" => "6 hours", "-1" => "1 night", "-2" => "2 nights", "-3" => "3 nights", "-4" => "4 nights", "-5" => "5 nights", "-6" => "6 nights", "-7" => "7 nights", "-10" => "10 nights", "00" => "period", ); $timebinsext=array( "20" => "20 minutes", "-1" => "1 night", ); // get/define initial values if (!empty($_POST["start"])) $start=$_POST["start"]; if (!empty($_POST["stop"])) $stop=$_POST["stop"]; if (!empty($_POST["dch"])) $dch=$_POST["dch"]; else $dch="novalue"; if (!empty($_POST["dust"])) $dust=$_POST["dust"]; else $dust="novalue"; if (!empty($_GET["expert"])) $_POST["expert"]=$_GET["expert"]; if (!empty($_POST["expert"])) $expert=$_POST["expert"]; else $expert="no"; if (!empty($_POST["email"])) $email=$_POST["email"]; else $email=""; if (!empty($_POST["light"])) $light=$_POST["light"]; else $light="novalue"; if (!empty($_POST["source"])) $source=$_POST["source"]; else $source=-1; if (!empty($_POST["timebin"])) $timebin=$_POST["timebin"]; else $timebin="novalue"; if (!empty($_POST["time"])) $time=$_POST["time"]; else $time="novalue"; if (!empty($_POST["factorcut"])) $factorcut=$_POST["factorcut"]; else $factorcut="novalue"; if (!empty($_POST["table"])) $table=$_POST["table"]; else $table="AnalysisResultsRunLP"; if (!empty($_POST["rmemptyrow"])) $rmemptyrow=$_POST["rmemptyrow"]; else $rmemptyrow="no"; if (!empty($_POST["th"])) $th=$_POST["th"]; else $th="novalue"; if (!empty($_POST["zd"])) $zd=$_POST["zd"]; else $zd="novalue"; //variable for non-combinable date/source $warn=""; include ("db.php"); $db_id = mysql_connect($host, $user, $pw); mysql_select_db($db); ini_set("display_errors", "On"); ini_set("mysql.trace_mode", "On"); echo "

FACT Quick Look Analysis - Download Area

\n"; //echo "
\n"; echo "

Data Usage Policy

\n"; if ($expert=="yes") { echo "As a member or associated member of the FACT Collaboration, you have access to internal information.
\n"; echo "Any publication using FACT internal information has to have the full FACT author list.

\n"; } else { echo "Using data from the FACT Quick Look Analysis, you agree to cite the FACT design paper (H. Anderhub et al. JINST 8 P6008) "; // echo "FACT design paper\n "; echo "and the quick look analysis (https://fact-project.org/monitoring).\n"; echo "

\n \n "; echo "References:\n"; echo "\n"; } echo "If you intend to use data or information from this website, please let us know for reference.
\n"; //echo "
\n"; echo "
\n"; //$query="SELECT fSourceKey, fSourceName, (SELECT COUNT(*) FROM ".$_POST["table"]." LEFT JOIN RunInfo USING(fNight, fRunID) WHERE fRunTypeKey=1 AND RunInfo.fSourceKey=Source.fSourceKey) AS num FROM Source WHERE fSourceTypeKey=1"; $query="SELECT fSourceKey, fSourceName, COUNT(*) AS num FROM RunInfo LEFT JOIN Source USING(fSourceKey) WHERE fSourceTypeKey=1 AND fRunTypeKey=1 GROUP BY fSourceKey ORDER BY num DESC"; //echo $query."
"; $sources=array(); $result=mysql_query($query); while ($row = mysql_fetch_row($result)) $sources[$row[0]]=$row[1]; mysql_free_result($result); //$query="SELECT Min(fNight), Max(fNight) FROM ".$_POST["table"]; $query="SELECT Min(fNight), Max(fNight) FROM RunInfo"; //echo $query."
"; $result=mysql_query($query); while ($row = mysql_fetch_row($result)) { if (empty($start)) $start=$row[0]; if (empty($stop)) $stop=$row[1]; } mysql_free_result($result); if (strpos($email, "@")!= false && $source<0) print_popup("Please select a source."); if (strpos($email, "@")!= false && $time=="novalue") print_popup("Please select a time format."); if (strpos($email, "@")!= false && $timebin=="novalue") print_popup("Please select a time binning."); if (empty($email) && $time!="novalue" && $timebin!="novalue" && $source>0) print_popup("Please provide an email address."); if (strpos($email, "@")!= false && empty($_POST["emailcopy"])) print_popup("Please agree that a copy of the email is stored."); if (strpos($email, "@")!= false && $source>0 && !empty($_POST["emailcopy"])) { //echo "

Sending data...

\n"; //print_popup("Sent email to ".$email." containing the data of ".$sources[$source]." from ".$start." till ".$stop." for ".$timebins[$timebin]." binning."); print_popup("Email with data sent to ".$email); if ($maintenance) echo $start." ".$stop." ".$source." ".$timebin." ".$email." ".$table." ".$time." ".$expert." ".$dch." ".$zd." ".$th." ".$light." ".$dust." ".$rmemptyrow." ".$factorcut."
\n"; $sent=shell_exec("/users/fact/SW.automatic.processing/DataCheck/Tools/get_data.sh ".$start." ".$stop." ".$source." ".$timebin." ".$email." ".$table." ".$time." ".$expert." ".$dch." ".$zd." ".$th." ".$light." ".$dust." ".$rmemptyrow." ".$factorcut); echo $sent; if (!empty($_POST["newsletter"])) { $query_interested="SELECT * FROM memberlist.interested WHERE email='".$email."'"; $result_interested=mysql_query($query_interested); //echo "num rows: ".mysql_num_rows($result_interested)."
\n"; //while ($row = mysql_fetch_row($result_interested)) // echo $row[0]." ".$row[1]." ".$row[2]." ".$row[3]."
\n"; if (mysql_num_rows($result_interested)>0) $query_interested="UPDATE "; else $query_interested="INSERT "; $query_interested.=" memberlist.interested SET date=NOW(), email='".$email."'"; if (mysql_num_rows($result_interested)>0) $query_interested.=" WHERE email='".$email."'"; //echo $query_interested; mysql_free_result($result_interested); $result_interested=mysql_query($query_interested); if ($maintenance) echo "num affected rows: ".mysql_affected_rows()."
\n"; } } //#DFE6FA #CDD7F4 echo "
\n
\n"; echo "

Select here the settings for your data sample:

\n"; // SOURCE echo "*\n"; // Time Format echo "*\n "; // Binning echo "*\n"; echo "
\n"; printf("Time Range: from \n", $start); printf("to \n ", $stop); //echo "
\n"; echo "
\n"; if ($expert == "yes") { echo "

Further settings for internal use:

\n"; echo "\n"; echo "Select Analysis:
\n"; echo "Cuts: \n"; //DATACHECK echo "\n "; //DUST echo "\n "; //ZD echo "\n "; //TH echo "\n "; echo "\n"; echo "\n"; echo "\n
\n"; } echo "

Get data:

\n"; echo "Provide your email address to receive the data: \n"; printf("*\n
\n", $email); if (empty($_POST["emailcopy"])) echo "* I agree that a copy of the email is stored for the statistical evaluation of data requests.
\n"; else echo "* I agree that a copy of the email is stored for the statistical evaluation of data requests.
\n"; if (empty($_POST["newsletter"])) echo " I would like to receive updates on the data and agree that my email address is stored for this purpose.

\n"; else echo " I would like to receive updates on the data and agree that my email address is stored for this purpose.

\n"; echo "Clicking on the button, you agree to the data usage policy:

\n"; //echo "Clicking on the button, you agree to the data usage policy and that a copy of my email is stored:

\n"; echo "
\n"; //border: 3px solid #394979; border-radius: 10px echo "* required
\n"; echo "\n"; echo "
\n"; //echo "         * required
\n"; echo "

Remarks:

"; if ($expert=="yes") { echo ""; } else { echo "\n"; echo "In case you are interested in more than the public data, please contact us.\n"; } echo "

Contact

"; echo "qla<at>fact-project.org
"; //echo "You acknowledge these regulations by clicking on the 'Show' button.


"; /* $ranges=array( // "5min" => " 5 min", // "10min" => "10 min", "20min" => "20 min", "30min" => "30 min", "40min" => "40 min", "60min" => "60 min", "90min" => "90 min", "120min" => "120 min", "180min" => "180 min", "240min" => "240 min", "300min" => "300 min", "360min" => "360 min", // "0001nights" => "1 night", // "0002nights" => "2 nights", // "0004nights" => "4 nights", // "0008nights" => "8 nights", // "0016nights" => "16 nights", ); echo ""; echo ""; */ //$dom = new DOMDocument(); //$dom->loadHTML("download.php"); //echo $dom->getElementById("logged"); ?>