-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·66 lines (52 loc) · 1.62 KB
/
index.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
<?php
/*
By Nick Sheffield
nick@nicksheffield.com
*/
require_once('classes/sqlite.php');
require_once('classes/security.php');
require_once('classes/template.php');
$database = isset($_GET['db']) ? $_GET['db'] : 'todo';
$db = new sqlite('db/'.$database);
$posts = $db->get('id, content, date, complete');
$db->table('title');
$title = $db->get('name');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php echo $title[0]['name']; ?></title>
<link rel="shortcut icon" href="assets/images/favicon.ico" />
<link href='http://fonts.googleapis.com/css?family=Roboto:400,300,500|Roboto+Slab:400,300,100|Bad+Script|Source+Sans+Pro:200,300,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="assets/css/style.css" />
</head>
<body>
<div id="container">
<header>
<h1 contenteditable="true" spellcheck="false"><?php echo $title[0]['name']; ?></h1>
</header>
<div id="main">
<div id="input">
<input type="text" id="post" placeholder="What do you need to do?" />
<input type="submit" id="submit" value="Save" />
<div id="spinner"></div>
</div>
<?php
foreach($posts as $post){
Template::make_new($post);
}
?>
</div>
</div>
<script>
var db = '<?php echo $database; ?>';
</script>
<script src="assets/js/jquery-1.6.2.min.js"></script>
<script src="assets/js/jquery-placeholders.js"></script>
<script src="assets/js/spin.js"></script>
<script src="assets/js/script.js"></script>
</body>
</html>