Index: trunk/www/dch/scheduling.php
===================================================================
--- trunk/www/dch/scheduling.php	(revision 15315)
+++ trunk/www/dch/scheduling.php	(revision 15316)
@@ -1,5 +1,10 @@
+<html>
+<head>
+  <meta name="Author" content="Daniela Dorner" />
+  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+  <title>FACT Project</title>
+  <link rel="StyleSheet" type="text/css" href="../style.css" />
+</head>
 <?php
-
-echo (file_get_contents("header.html"));
 
 if (!empty($_GET["date"]))
@@ -7,5 +12,5 @@
     $date=date("Y-m-d", strtotime($_GET["date"]));
     $date2=date("Ymd", strtotime($_GET["date"]));
-    $path="../scheduling/".date("Y/m/d", strtotime($_GET["date"]));
+    //$path="../scheduling/".date("Y/m/d", strtotime($_GET["date"]));
 }
 else
@@ -13,35 +18,67 @@
     $date=date("Y-m-d");
     $date2=date("Ymd");
-    $path="../scheduling/".date("Y/m/d");
+    //$path="../scheduling/".date("Y/m/d");
 }
+
+$path="../scheduling/".date("Y/m/d", strtotime($date));
+
+$plusoneday=date("Y-m-d", strtotime($date." +1 day"));
+$minusoneday=date("Y-m-d", strtotime($date." -1 day"));
+$plusoneweek=date("Y-m-d", strtotime($date." +1 week"));
+$minusoneweek=date("Y-m-d", strtotime($date." -1 week"));
+$plustwoweeks=date("Y-m-d", strtotime($date." +2 week"));
+$minustwoweeks=date("Y-m-d", strtotime($date." -2 week"));
+$plusonemonth=date("Y-m-d", strtotime($date." +1 month"));
+$minusonemonth=date("Y-m-d", strtotime($date." -1 month"));
+$plusoneyear=date("Y-m-d", strtotime($date." +1 year"));
+$minusoneyear=date("Y-m-d", strtotime($date." -1 year"));
+$today=date("Y-m-d",mktime(0,0,0,date("m"), date("d"), date("Y")));
+
 
 
 echo "<body>";
 echo "<form action='scheduling.php' METHOD='GET'>\n";
-echo "<input type='submit' value='Show'> scheduling plots for ";
+echo "scheduling plots for ";
 printf("<input name='date' type='text' size='10' maxlength='10' value='%s'>\n", $date);
+echo "<input type='submit' value='Show'>\n";
+printf("<input type='button' value='Today' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $today);
+printf("<input type='button' value='+1Day' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $plusoneday);
+printf("<input type='button' value='-1Day' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $minusoneday);
+printf("<input type='button' value='+1Week' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $plusoneweek);
+printf("<input type='button' value='-1Week' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $minusoneweek);
+printf("<input type='button' value='+2Weeks' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $plustwoweeks);
+printf("<input type='button' value='-2Weeks' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $minustwoweeks);
+printf("<input type='button' value='+1Month' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $plusonemonth);
+printf("<input type='button' value='-1Month' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $minusonemonth);
+printf("<input type='button' value='+1Year' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $plusoneyear);
+printf("<input type='button' value='-1Year' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $minusoneyear);
 echo "</form>";
-printf("<a href='%s'>more files</a>",$path);
-echo "<table>";
-echo "<tr>";
-//printf("<td><img src='%s/visibility%s.png' alt='visibility'></td>", $path, $date);
-//printf("<td valign='top'><img src='%s/legend%s.png' alt='legend'></td>", $path, $date);
-printf("<td><img src='%s/%s-ZenithDistance.png' alt='visibility'></td>", $path, $date2);
-printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>", $path, $date2);
-echo "</tr>";
-echo "<tr>";
-//printf("<td><img src='%s/currents%s.png' alt='currents'></td>", $path, $date);
-//printf("<td valign='top'><img src='%s/legend%s.png' alt='legend'></td>", $path, $date);
-printf("<td><img src='%s/%s-PredictedCurrent.png' alt='currents'></td>", $path, $date2);
-printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>", $path, $date2);
-echo "<tr>";
-printf("<td><img src='%s/%s-MoonDist.png' alt='moondist'></td>", $path, $date2);
-printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>", $path, $date2);
-echo "</tr>";
-echo "<tr>";
-printf("<td><img src='%s/%s-RelativeThreshold.png' alt='threshold'></td>", $path, $date2);
-printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>", $path, $date2);
-echo "</tr>";
-echo "</table>";
+if (is_dir($path))
+{
+    printf("<a href='%s'>more files</a>",$path);
+    echo "<table>";
+    echo "<tr>";
+    //printf("<td><img src='%s/visibility%s.png' alt='visibility'></td>", $path, $date);
+    //printf("<td valign='top'><img src='%s/legend%s.png' alt='legend'></td>", $path, $date);
+    printf("<td><img src='%s/%s-ZenithDistance.png' alt='visibility'></td>", $path, $date2);
+    printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>", $path, $date2);
+    echo "</tr>";
+    echo "<tr>";
+    //printf("<td><img src='%s/currents%s.png' alt='currents'></td>", $path, $date);
+    //printf("<td valign='top'><img src='%s/legend%s.png' alt='legend'></td>", $path, $date);
+    printf("<td><img src='%s/%s-PredictedCurrent.png' alt='currents'></td>", $path, $date2);
+    printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>", $path, $date2);
+    echo "<tr>";
+    printf("<td><img src='%s/%s-MoonDist.png' alt='moondist'></td>", $path, $date2);
+    printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>", $path, $date2);
+    echo "</tr>";
+    echo "<tr>";
+    printf("<td><img src='%s/%s-RelativeThreshold.png' alt='threshold'></td>", $path, $date2);
+    printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>", $path, $date2);
+    echo "</tr>";
+    echo "</table>";
+}
+else
+    echo "No files available for ".$date.".\n";
 
 
