Index: /trunk/www/dch/scheduling.php
===================================================================
--- /trunk/www/dch/scheduling.php	(revision 15402)
+++ /trunk/www/dch/scheduling.php	(revision 15403)
@@ -8,74 +8,41 @@
 <?php
 
-if (!empty($_GET["date"]))
-{
-    $date=date("Y-m-d", strtotime($_GET["date"]));
-    $date2=date("Ymd", strtotime($_GET["date"]));
-    //$path="../scheduling/".date("Y/m/d", strtotime($_GET["date"]));
-}
-else
-{
-    $date=date("Y-m-d");
-    $date2=date("Ymd");
-    //$path="../scheduling/".date("Y/m/d");
-}
+include ("dates.php");
 
+echo "<body>\n";
+echo "<form name='formular' action='scheduling.php' METHOD='GET'>\n";
+echo "scheduling plots for ";
+
+$date=GetDates($_GET["date"], "scheduling");
+$date2=date("Ymd", strtotime($date));
 $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 "</form>\n";
 
-
-
-echo "<body>";
-echo "<form action='scheduling.php' METHOD='GET'>\n";
-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>";
 if (is_dir($path))
 {
-    printf("<a href='%s'>more files</a>",$path);
-    echo "<table>";
-    echo "<tr>";
+    printf("<a href='%s'>more files</a>\n",$path);
+    echo "<table>\n";
+    echo "<tr>\n";
     //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/%s-ZenithDistance.png' alt='visibility'></td>\n", $path, $date2);
+    printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>\n", $path, $date2);
+    echo "</tr>\n";
+    echo "<tr>\n";
     //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>";
+    printf("<td><img src='%s/%s-PredictedCurrent.png' alt='currents'></td>\n", $path, $date2);
+    printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>\n", $path, $date2);
+    echo "</tr>\n";
+    echo "<tr>\n";
+    printf("<td><img src='%s/%s-MoonDist.png' alt='moondist'></td>\n", $path, $date2);
+    printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>\n", $path, $date2);
+    echo "</tr>\n";
+    echo "<tr>\n";
+    printf("<td><img src='%s/%s-RelativeThreshold.png' alt='threshold'></td>\n", $path, $date2);
+    printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>\n", $path, $date2);
+    echo "</tr>\n";
+    echo "</table>\n";
 }
 else
@@ -83,5 +50,5 @@
 
 
-echo "</body>";
-echo "</html>";
+echo "</body>\n";
+echo "</html>\n";
 ?>
