<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Add a Task</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>

<?php

echo '<form action="index.php?act=task&op=add&type=html" method="post">
    <fieldset>
	<legend>Add a Task</legend>
        <p>Task: <input name="task" type="text" size="60" maxlength="100" required></p>
        <p>Parent Task: <select name="parent_id"><option value="0">None</option>';

$tasks = array("1","2","3","4"."5");

foreach($tasks as $task_id) {
    echo "<option value=\"$task_id\">$task</option>\n";
}

echo '</select></p>
<input name="submit" type="submit" value="Add This Task">
</fieldset>
</form>';


echo '<h2>Current To-Do List</h2><ul>';
foreach ($_SESSION['task'] as $task) {
    echo "<li>{$task}</li>\n";
}

?>
</body>
</html>
