-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
148 lines (127 loc) · 6.75 KB
/
index.php
File metadata and controls
148 lines (127 loc) · 6.75 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
require_once 'inc/header.php';
require_once 'inc/app.php';
?>
<body>
<div class="container my-3 ">
<div class="row d-flex justify-content-center">
<?php $mes->printError();?>
<?php $mes->printSuccess();?>
<?php if($ses->get('error')){
$ses->unset('error');
}
if($ses->get('success')){
$ses->unset('success');
} ?>
<div class="container mb-5 d-flex justify-content-center">
<div class="col-md-4">
<form action="handle/addToDo.php" method="post">
<textarea type="text" class="form-control" rows="3" name="title" id="" placeholder="enter your note here"></textarea>
<input type="date" name="date" class="input input-bordered input-secondary w-full max-w-xs schedule-date" />
<div class="text-center">
<button type="submit" name="add" class="form-control text-white bg-info mt-3 " >Add To Do</button>
</div>
</form>
</div>
</div>
</div>
<div class="row d-flex justify-content-between">
<!-- all -->
<div class="col-md-3 ">
<h4 class="text-white">All Notes</h4>
<!-- select all tasks must be done...if there is no task print ( empty to do) -->
<?php
$tasks=$db->selectAll('list',"status='todo'");
$foundTasks=0;
if(count($tasks)>0)
$foundTasks=1;
?>
<div class="m-2 py-3">
<div class="show-to-do">
<div class="item">
<?php if($foundTasks==0):?>
<div class="alert-info text-center ">
empty to do
</div>
<?php endif;?>
</div>
<?php if($foundTasks==1):foreach ($tasks as $task):?>
<div class="alert alert-info p-2">
<a href="handle/delete.php?id=<?=$task['id']?>" onclick="confirm('are your sure')" class="remove-to-do text-dark d-flex justify-content-end " ><i class="fa fa-close" style="font-size:16px;"></i></a>
<h4 ><?=$task['title']?></h4>
<h5><?=$task['created_at']?></h5>
<div class="d-flex justify-content-between mt-3">
<a href="edit.php?id=<?=$task['id']?>"class="btn btn-info p-1 text-white" >edit</a>
<a href="handle/goto.php?id=<?=$task['id']?>&statue='doing'"class="btn btn-info p-1 text-white" >doing</a>
</div>
</div>
<?php endforeach;endif;?>
</div>
</div>
<!-- -->
</div>
<!-- -->
<!-- doing -->
<div class="col-md-3 ">
<h4 class="text-white">Doing</h4>
<?php
$tasks=$db->selectAll('list',"status='doing'");
$foundTasks=0;
if(count($tasks)>0)
$foundTasks=1;
?>
<div class="m-2 py-3">
<div class="show-to-do">
<div class="item">
<?php if($foundTasks==0):?>
<div class="alert-success text-center ">
empty to do
</div>
<?php endif;?>
</div>
<?php if($foundTasks==1):foreach ($tasks as $task):?>
<div class="alert alert-info p-2">
<a href="handle/delete.php?id=<?=$task['id']?>" onclick="confirm('are your sure')" class="remove-to-do text-dark d-flex justify-content-end " ><i class="fa fa-close" style="font-size:16px;"></i></a>
<h4 ><?=$task['title']?></h4>
<h5><?=$task['created_at']?></h5>
<div class="d-flex justify-content-between mt-3">
<a href="edit.php?id=<?=$task['id']?>"class="btn btn-info p-1 text-white" >edit</a>
<a href="handle/goto.php?id=<?=$task['id']?>&statue='done'"class="btn btn-info p-1 text-white" >done</a>
</div>
</div>
<?php endforeach;endif;?>
</div>
</div>
</div>
<!-- done -->
<div class="col-md-3">
<h4 class="text-white">Done</h4>
<?php
$tasks=$db->selectAll('list',"status='done'");
$foundTasks=0;
if(count($tasks)>0)
$foundTasks=1;
?>
<div class="m-2 py-3">
<div class="show-to-do">
<div class="item">
<?php if($foundTasks==0):?>
<div class="alert-warning text-center ">
empty to do
</div>
<?php endif;?>
</div>
<?php if($foundTasks==1):foreach ($tasks as $task):?>
<div class="alert alert-warning p-2">
<a href="handle/delete.php?id=<?=$task['id']?>" onclick="confirm('are your sure')" class="remove-to-do text-dark d-flex justify-content-end " ><i class="fa fa-close" style="font-size:16px;"></i></a>
<h4 ><?=$task['title']?></h4>
<h5><?=$task['created_at']?></h5>
</div>
<?php endforeach;endif;?>
</div>
</div>
</div>
</div>
</div>
</body>
</html>