Index: trunk/www/dch/lightcurves.php
===================================================================
--- trunk/www/dch/lightcurves.php	(revision 15313)
+++ trunk/www/dch/lightcurves.php	(revision 15404)
@@ -1,5 +1,14 @@
+<html>
+<head>
+  <meta name="Author" content="Daniela Dorner" />
+  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+  <title>QLA</title>
+  <link rel="StyleSheet" type="text/css" href="../style.css" />
+</head>
 <?php
 
-echo (file_get_contents("header.html"));
+//echo (file_get_contents("header.html"));
+
+include ("dates.php");
 
 if (!empty($_GET["bin"]))
@@ -7,5 +16,5 @@
 else
     $bin="1nights";
-$path="../lightcurves/".$_GET["source"]."/lightcurve".$bin;
+//$path="../lightcurves/".$_GET["source"]."/lightcurve".$bin;
 
 $sources=array(
@@ -18,58 +27,80 @@
 
 $ranges=array(
-              "005min" => " 5 min",
-              "010min" => "10 min",
-              "020min" => "20 min",
-              "040min" => "40 min",
-              "080min" => "80 min",
-              "160min" => "160 min",
-              "320min" => "320 min",
-              "0001nights" => "1 night",
-              "0002nights" => "2 nights",
-              "0004nights" => "4 nights",
-              "0008nights" => "8 nights",
-              "0016nights" => "16 nights",
+              "5min" => " 5 min",
+              "10min" => "10 min",
+              "20min" => "20 min",
+              "30min" => "30 min",
+              "40min" => "40 min",
+              "60min" => "60 min",
+              "80min" => "80 min",
+              "120min" => "120 min",
+              "180min" => "180 min",
+              "240min" => "240 min",
+              "300min" => "300 min",
+//              "0001nights" => "1 night",
+//              "0002nights" => "2 nights",
+//              "0004nights" => "4 nights",
+//              "0008nights" => "8 nights",
+//              "0016nights" => "16 nights",
               );
 
-echo "<body>";
-echo "<form action='lightcurves.php' METHOD='GET'>\n";
-echo "<input type='submit' value='Show'> excess rates for ";
-echo "source <select name='source' size='1'>";
+echo "<body>\n";
+echo "<form name='formular' action='lightcurves.php' METHOD='GET'>\n";
+echo "<input type='submit' value='Show'> result of Quick-Look-Analysis for ";
+
+echo "source <select name='source' size='1'>\n";
 foreach ($sources as $key => $name)
 {
     if ($_GET["source"] == $key)
-        printf("<option value='%s' selected>%s</option>", $key, $name);
+        printf("<option value='%s' selected>%s</option>\n", $key, $name);
     else
-        printf("<option value='%s'>%s</option>", $key, $name);
+        printf("<option value='%s'>%s</option>\n", $key, $name);
 }
-echo "</select>";
-echo " for <select name='bin' size='1'>";
+echo "</select>\n";
+echo " for <select name='bin' size='1'>\n";
 foreach ($ranges as $range => $name)
 {
     if ($_GET["bin"] == $range)
-        printf("<option value='%s' selected>%s</option>", $range, $name);
+        printf("<option value='%s' selected>%s</option>\n", $range, $name);
     else
-        printf("<option value='%s'>%s</option>", $range, $name);
+        printf("<option value='%s'>%s</option>\n", $range, $name);
 }
-echo "</select>";
-echo "</form>";
+echo "</select>\n<br>\n";
 
-$numplots=7;
+$date=GetDates($_GET["date"], "lightcurves");
+$date2=date("Ymd", strtotime($date));
+$path="../lightcurves/".date("Y/m/d", strtotime($date));
 
-if (file_exists($path."/lc.root"))
+echo "</form>\n";
+
+$numplots=8;
+
+$filename="lightcurve".$_GET["source"]."_".$_GET["bin"]."_all.root";
+$filename2="lightcurve".$_GET["source"]."_".$_GET["bin"]."_week.root";
+$filename3="lightcurve".$_GET["source"]."_".$_GET["bin"]."_".$date2.".root";
+$rootfile=$path."/".$filename2;
+//echo $filename;
+if (file_exists($rootfile))
 {
     printf("<a href='%s'>more files</a>", $path);
     echo "<table>";
+    printf("<tr><th>Night %s</th><th>Last Week</th><th>All Nights</th></tr>\n", $date);
     for ($i=1; $i<$numplots+1; $i++)
     {
         if (strpos($_GET["bin"], "night"))
-            printf("<tr><td><img src='%s/lc.root-%d.png' alt='%d'></td></tr>", $path, $i, $i);
+            printf("<tr><td><img src='%s/%s-%d.png' alt='%d'></td></tr>", $path, $filename, $i, $i);
         else
-            printf("<tr><td><img src='%s/lc.root-%d.png' alt='%d'></td><td><img src='%s/lc.root-%d.png' alt='%d'></td></tr>", $path, $i, $i, $path, $i+$numplots, $i+$numplots);
+        {
+            printf("<tr>\n");
+            printf("<td><img src='%s/%s-%d.png' alt='%d'></td>\n", $path, $filename3, $i, $i);
+            printf("<td><img src='%s/%s-%d.png' alt='%d'></td>\n", $path, $filename2, $i, $i);
+            printf("<td><img src='%s/%s-%d.png' alt='%d'></td>\n", $path, $filename, $i, $i);
+            printf("</tr>\n");
+        }
     }
     echo "</table>";
 }
 else
-    echo "<br> No files yet for " . $sources[$_GET["source"]] . " with " . $ranges[$_GET["bin"]]. ". <br>";
+    echo "<br> No files available for " . $sources[$_GET["source"]] . " with " . $ranges[$_GET["bin"]]. " for night ".$date.". <br>";
 
 echo "</body>";
