<?php
 include('conexion.php');
?>
<!DOCTYPE html>
<html>
<head>
<title>Lista de que haceres</title>
<link href="style.css" rel="stylesheet">
</head>

<body>
<div>
<h1>Agregar un quehacer</h1>
<fieldset>
 <form action='agregar.php' method='POST'>
 <label>Nombre: <input type="text" size="20" name="nombre"></label><br />
 <label>Hora: <input type="text" size="20" name="hora"></label><br />
 <input type="submit" value="Agregar" name='submitted' >
 </form>
</fieldset>
</div>

<div>
<h1>Lista de quehaceres</h1>
<ol>

<?php
 $result = mysql_query("SELECT * FROM `lista` ORDER BY id ASC") or trigger_error(mysql_error());
 while ($row = mysql_fetch_array($result)){ ?>
 <li><?php echo $row['nombre']; ?> <small><?php echo $row['hora'];?></small><a href="eliminar.php?id=<?php echo $row['id']; ?>">X</a></li>
<?php } ?>
</ol>
</div>

</body>
</html>