Changeset 15316


Ignore:
Timestamp:
04/12/13 15:45:44 (11 years ago)
Author:
Daniela Dorner
Message:
added buttons (+1day, -2weeks, etc) and check if files exist
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/dch/scheduling.php

    r15315 r15316  
     1<html>
     2<head>
     3  <meta name="Author" content="Daniela Dorner" />
     4  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
     5  <title>FACT Project</title>
     6  <link rel="StyleSheet" type="text/css" href="../style.css" />
     7</head>
    18<?php
    2 
    3 echo (file_get_contents("header.html"));
    49
    510if (!empty($_GET["date"]))
     
    712    $date=date("Y-m-d", strtotime($_GET["date"]));
    813    $date2=date("Ymd", strtotime($_GET["date"]));
    9     $path="../scheduling/".date("Y/m/d", strtotime($_GET["date"]));
     14    //$path="../scheduling/".date("Y/m/d", strtotime($_GET["date"]));
    1015}
    1116else
     
    1318    $date=date("Y-m-d");
    1419    $date2=date("Ymd");
    15     $path="../scheduling/".date("Y/m/d");
     20    //$path="../scheduling/".date("Y/m/d");
    1621}
     22
     23$path="../scheduling/".date("Y/m/d", strtotime($date));
     24
     25$plusoneday=date("Y-m-d", strtotime($date." +1 day"));
     26$minusoneday=date("Y-m-d", strtotime($date." -1 day"));
     27$plusoneweek=date("Y-m-d", strtotime($date." +1 week"));
     28$minusoneweek=date("Y-m-d", strtotime($date." -1 week"));
     29$plustwoweeks=date("Y-m-d", strtotime($date." +2 week"));
     30$minustwoweeks=date("Y-m-d", strtotime($date." -2 week"));
     31$plusonemonth=date("Y-m-d", strtotime($date." +1 month"));
     32$minusonemonth=date("Y-m-d", strtotime($date." -1 month"));
     33$plusoneyear=date("Y-m-d", strtotime($date." +1 year"));
     34$minusoneyear=date("Y-m-d", strtotime($date." -1 year"));
     35$today=date("Y-m-d",mktime(0,0,0,date("m"), date("d"), date("Y")));
     36
    1737
    1838
    1939echo "<body>";
    2040echo "<form action='scheduling.php' METHOD='GET'>\n";
    21 echo "<input type='submit' value='Show'> scheduling plots for ";
     41echo "scheduling plots for ";
    2242printf("<input name='date' type='text' size='10' maxlength='10' value='%s'>\n", $date);
     43echo "<input type='submit' value='Show'>\n";
     44printf("<input type='button' value='Today' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $today);
     45printf("<input type='button' value='+1Day' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $plusoneday);
     46printf("<input type='button' value='-1Day' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $minusoneday);
     47printf("<input type='button' value='+1Week' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $plusoneweek);
     48printf("<input type='button' value='-1Week' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $minusoneweek);
     49printf("<input type='button' value='+2Weeks' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $plustwoweeks);
     50printf("<input type='button' value='-2Weeks' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $minustwoweeks);
     51printf("<input type='button' value='+1Month' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $plusonemonth);
     52printf("<input type='button' value='-1Month' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $minusonemonth);
     53printf("<input type='button' value='+1Year' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $plusoneyear);
     54printf("<input type='button' value='-1Year' onClick='self.location.href=\"scheduling.php?date=%s\"'>\n", $minusoneyear);
    2355echo "</form>";
    24 printf("<a href='%s'>more files</a>",$path);
    25 echo "<table>";
    26 echo "<tr>";
    27 //printf("<td><img src='%s/visibility%s.png' alt='visibility'></td>", $path, $date);
    28 //printf("<td valign='top'><img src='%s/legend%s.png' alt='legend'></td>", $path, $date);
    29 printf("<td><img src='%s/%s-ZenithDistance.png' alt='visibility'></td>", $path, $date2);
    30 printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>", $path, $date2);
    31 echo "</tr>";
    32 echo "<tr>";
    33 //printf("<td><img src='%s/currents%s.png' alt='currents'></td>", $path, $date);
    34 //printf("<td valign='top'><img src='%s/legend%s.png' alt='legend'></td>", $path, $date);
    35 printf("<td><img src='%s/%s-PredictedCurrent.png' alt='currents'></td>", $path, $date2);
    36 printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>", $path, $date2);
    37 echo "<tr>";
    38 printf("<td><img src='%s/%s-MoonDist.png' alt='moondist'></td>", $path, $date2);
    39 printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>", $path, $date2);
    40 echo "</tr>";
    41 echo "<tr>";
    42 printf("<td><img src='%s/%s-RelativeThreshold.png' alt='threshold'></td>", $path, $date2);
    43 printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>", $path, $date2);
    44 echo "</tr>";
    45 echo "</table>";
     56if (is_dir($path))
     57{
     58    printf("<a href='%s'>more files</a>",$path);
     59    echo "<table>";
     60    echo "<tr>";
     61    //printf("<td><img src='%s/visibility%s.png' alt='visibility'></td>", $path, $date);
     62    //printf("<td valign='top'><img src='%s/legend%s.png' alt='legend'></td>", $path, $date);
     63    printf("<td><img src='%s/%s-ZenithDistance.png' alt='visibility'></td>", $path, $date2);
     64    printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>", $path, $date2);
     65    echo "</tr>";
     66    echo "<tr>";
     67    //printf("<td><img src='%s/currents%s.png' alt='currents'></td>", $path, $date);
     68    //printf("<td valign='top'><img src='%s/legend%s.png' alt='legend'></td>", $path, $date);
     69    printf("<td><img src='%s/%s-PredictedCurrent.png' alt='currents'></td>", $path, $date2);
     70    printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>", $path, $date2);
     71    echo "<tr>";
     72    printf("<td><img src='%s/%s-MoonDist.png' alt='moondist'></td>", $path, $date2);
     73    printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>", $path, $date2);
     74    echo "</tr>";
     75    echo "<tr>";
     76    printf("<td><img src='%s/%s-RelativeThreshold.png' alt='threshold'></td>", $path, $date2);
     77    printf("<td valign='top'><img src='%s/%s-Legend.png' alt='legend'></td>", $path, $date2);
     78    echo "</tr>";
     79    echo "</table>";
     80}
     81else
     82    echo "No files available for ".$date.".\n";
    4683
    4784
Note: See TracChangeset for help on using the changeset viewer.