<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Human readable relative date calculator</title>
</head>
<body>
<h1>Human readable relative date calculator</h2>
<?php
if(isset($_GET['date'])){
$sql_date = $_GET['date'];
require_once('humanRelativeDate.class.php');
$humanRelativeDate = new HumanRelativeDate();
$string = $humanRelativeDate->getTextForSQLDate($sql_date);
echo '<h2>Result: ' . $string . '</h2>';
}
?>
<form method="get" action="index.php">
<h2>Calculate a relative date</h2>
<fieldset>
<label for="date">Enter an SQL formatted date (YYYY-MM-DD hh:mm:ss)</label>
<input type="text" name="date" id="date" value="" />
</fieldset>
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>