-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.php
89 lines (55 loc) · 2.24 KB
/
demo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
require "connect.php";
require "todo.class.php";
// Select all the todos, ordered by position:
$query = mysql_query("SELECT * FROM `tz_todo` ORDER BY `position` ASC");
$todos = array();
// Filling the $todos array with new ToDo objects:
while($row = mysql_fetch_assoc($query)){
$todos[] = new ToDo($row);
}
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>To Do List</title>
<!-- Including the jQuery UI Human Theme -->
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/themes/humanity/jquery-ui.css" type="text/css" media="all" />
<!-- Our own stylesheet -->
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<h1><b>SIMPLE TODO LISTS</b></h1>
<form class="form-horizontal">
<!-- Form Name -->
<h3>Complete the test task</h3>
<div id="taskField">
<!-- <h4>+</h4> -->
<input name="message" type="text" id="message" class="message" placeholder="Start typing here to create a task">
<a id="addButton" class="green-button" href="#">Add Task</a></p>
</div>
<div id="main">
<ul class="todoList">
<?php
// Looping and outputting the $todos array. The __toString() method
// is used internally to convert the objects to strings:
foreach($todos as $item){
echo $item;
}
?>
</ul>
</div>
<!-- This div is used as the base for the confirmation jQuery UI POPUP. Hidden by CSS. -->
<div id="dialog-confirm" title="Delete TODO Item?">Are you sure you want to delete this TODO item?</div>
<!-- <p class="note">You can add only one in 5 seconds.</p> -->
<!-- Including our scripts -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script>
<script type="text/javascript" src="script.js"></script>
</form>
<!-- <p>
<input name="button" type="submit" value="Add TODO List" id="add">
</p> -->
</body>
</html>