<?php

if (!isset($_POST['hour']))
{
	$_POST['hour'] = '19';
	$_POST['min'] = '20';
	$_POST['sec'] = '00';
}
?>
<html>
<head>
  <title>Visszaszámláló</title>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<script type="text/javascript" src="countDown24.js.php?hour=<?php
	print $_POST['hour'] ?>&amp;min=<?php print $_POST['min'] ?>&amp;sec=<?php
	print $_POST['sec']
	?>"></script>
</head>
<body>
<form action="" method="post" id="demo">


<select name="hour" onchange="document.getElementById('demo').submit();">
	<?php
		for ($i=1; $i<=24; $i++) {
			$v = $i >= 10 ? $i : '0'.$i;
			print "<option value=\"$v\" ";
			print (isset($_POST['hour']) and $_POST['hour'] == $i) ? " selected=\"selected\" " : "";
			print ">$i</option>";
		}
	?>

</select>

<select name="min" onchange="document.getElementById('demo').submit();">
	<?php
		for ($i=0; $i<=59; $i++) {
			$v = $i >= 10 ? $i : '0'.$i;
			print "<option value=\"$v\" ";
			print (isset($_POST['min']) and $_POST['min'] == $i) ? " selected=\"selected\" " : "";
			print ">$i</option>";
		}
	?>

</select>

<select name="sec" onchange="document.getElementById('demo').submit();">
	<?php
		for ($i=0; $i<=59; $i++) {
			$v = $i >= 10 ? $i : '0'.$i;
			print "<option value=\"$v\" ";
			print (isset($_POST['sec']) and $_POST['sec'] == $i) ? " selected=\"selected\" " : "";
			print ">$i</option>";
		}
	?>

</select>
</form>
A visszaszámlálás vége: <?php print $_POST['hour'] . ':'.$_POST['min'] .':'.$_POST['sec']  ?><br />
<div id="timediv"></div>
<div id="msgdiv"></div>
</body>
</html>
