예제 #1
0
파일: index.php 프로젝트: Dionakov/EDTSalle
            } else {
                if (date('H:i', time() + $i) < '20:00') {
                    $i -= 120 * 60;
                } else {
                    if (date('H:i', time() + $i) >= '20:00') {
                        $i -= 150 * 60;
                    }
                }
            }
        }
    }
    return $i;
}
$j = nextTimeSlot(0);
$j = nextTimeSlot($j);
$j = nextTimeSlot($j);
$j = nextTimeSlot($j);
$j = nextTimeSlot($j);
$j = nextTimeSlot($j);
$k = previousTimeSlot($j);
$k = previousTimeSlot($k);
$k = previousTimeSlot($k);
$k = previousTimeSlot($k);
$k = previousTimeSlot($k);
$k = previousTimeSlot($k);
$k = previousTimeSlot($k);
echo "0 => {$j} => {$k}";
?>
    </body>
</html>
예제 #2
0
파일: test.php 프로젝트: Dionakov/EDTSalle
    <title>Edt salles</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Le styles -->
    <link rel="stylesheet" type="text/css" href="dist/css/metro-bootstrap.min.css">
    <link rel="stylesheet" href="styles/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="style.css">
  <?php 
date_default_timezone_set("Europe/Paris");
setlocale(LC_TIME, 'fr_FR.utf8', 'fra');
require_once 'Calendar.php';
require_once 'ListClassRooms.php';
$date = strftime('%d ', time()) . ucfirst(strftime('%B', time()));
$i = 0;
$i = nextTimeSlot($i);
// affichage salles
$list = new ListClassRooms($i);
echo '<table>';
echo '<tr><th colspan=3>' . $date . '</th></tr>';
echo '<tr><th colspan=3>' . $list->getTimeSlot() . '</th></tr>';
foreach ($list->getFreeRooms() as $value) {
    echo '<tr><td>' . $value->getRoom() . '</td><td><img src="green.jpg"></td></tr>';
}
foreach ($list->getUsedRooms() as $value) {
    echo '<tr><td>' . $value->getRoom() . '</td><td><img src="red.jpg"></td></tr>';
}
echo '<table>';
echo '<tr><th colspan=3>' . $date . '</th></tr>';
echo '<tr><th colspan=3>' . $list->getTimeSlot() . '</th></tr>';
foreach ($list->getGroups('t') as $value) {