01.
<?php
02.
session_start();
03.
require
(
'dbms.php'
);
04.
05.
if
(!isset(
$_SESSION
[
'login'
])){
06.
header(
'Location: index.php?login=noLOGIN'
);
07.
exit
();
08.
}
09.
10.
?>
11.
12.
13.
<h2>Hello <?php
echo
$_SESSION
[
'username'
]; ?> </h2>
14.
<h2>Add Todolist</h2>
15.
16.
17.
<form action=
"conadd.php"
method=
"post"
>
18.
19.
<label>header: </label> <br>
20.
<input type=
"text"
name=
"header"
> <br>
21.
<label>detail: </label> <br>
22.
23.
<textarea type=
"text"
name=
"detail"
></textarea> <br>
24.
<label>priority:</label><br>
25.
<input type=
"text"
name=
"type"
><br>
26.
27.
<input type=
"date"
name =
"time"
><br>
28.
29.
<button type=
"submit"
name=
"addtask"
> submit</button>
30.
</form>
31.
32.
<hr>
33.
34.
<?php
35.
$sql_incom
=
"SELECT * FROM tb_note WHERE user_id = '"
.
$_SESSION
['id
']."'
";
36.
$result_incom
= mysqli_query(
$conn
,
$sql_incom
);
37.
38.
if
(
$result_incom
->num_rows >0 ){
39.
40.
while
(
$row
= mysqli_fetch_assoc(
$result_incom
)){
41.
42.
echo
"<li>"
;
43.
echo
'<input type="checkbox"><label>'
.
$row
[
"header"
].
'</label><input type="text">'
;
44.
echo
$row
[
"detail"
];
45.
echo
$row
[
"type"
];
46.
echo
$row
[
"timee"
];
47.
?>
48.
<a href=
"editpage.php?note_id=<?php echo $row["
id
"]; ?>"
> Edit</a>
49.
<?php
50.
echo
"</li>"
;
51.
}
52.
}
53.
?>
54.
55.
56.
<a href=
"logout.php"
>Logout </a>