-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
65 lines (50 loc) · 1.75 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
<?php
require './action/loop.php';
?>
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PHP To do List App</title>
<!-- Google fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Shadows+Into+Light+Two" rel="stylesheet">
<link rel="stylesheet" href="styles/main.css">
</head>
<body>
<main>
<section id="todo" class="container">
<div class="app">
<h1>to do</h1>
<?php if(!empty($items)) : ?>
<ul id="list">
<?php foreach($items as $item) : ?>
<li>
<span class="item<?php echo $item['done'] ? ' done' : ''?>"><?php echo $item['name']?></span>
<?php if(!$item['done']) : ?>
<a href="./action/mark.php?as=done&item=<?php echo $item['id'] ?>" class="btn">mark as done</a>
<?php else : ?>
<a data-id="<?php echo $item['id'] ?>" href="./action/delete.php?as=delete&item=<?php echo $item['id'] ?>" class="btn">Delete</a>
<?php endif?>
</li>
<?php endforeach; ?>
</ul>
<?php else : ?>
<p>You have No items to show</p>
<?php endif;?>
<form action="./action/add.php" method="post">
<input type="text" name="name" id="items" placeholder="Type Item Here" autocomplete="off" required>
<button type="submit">Add</button>
</form>
</div>
</section>
<footer>
<p>Copyright © Hasan Misbah</p>
</footer>
</main>
<script src="./scripts/jquery.min.js"></script>
<script src="scripts/main.js"></script>
</body>
</html>