-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.php
More file actions
133 lines (80 loc) · 2.52 KB
/
Copy pathtasks.php
File metadata and controls
133 lines (80 loc) · 2.52 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
<?php
require 'security.php';
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Tasks</title>
<link rel="stylesheet" href="bootstrap-4.2/css/bootstrap.css">
<!--Link from searching data table -examples-bootstrap 4(The javascript in included in the bottom section)(jquery plugin) used to style u the table presentation-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>
<!--Start of navigation bar-->
<?php
require 'navbar.php';
?>
<!--End of navigation bar-->
<!--Start of table div-->
<div class="container">
<table class="table table-secondary" id="items">
<!--Start of table heading-->
<thead>
<tr>
<th>ID</th>
<th>TITLE</th>
<th>STATUS</th>
<th>DATE</th>
</tr>
</thead>
<!--End of table heading-->
<tbody>
<!--<tr>
<td>$id</td>
<td>$title</td>
<td>$status</td>
<td>$Date</td>
</tr>
-->
<?php
/*$conn = mysqli_connect("localhost", "root", "", "tasks");*/
require 'db.php';
$id = $_SESSION['info']['id'];
/*require db replaces the $conn*/
$sql ="select * from items where user_id='$id' ";
$results =mysqli_query($conn,$sql) or die(mysqli_error($conn));
while ($row = mysqli_fetch_assoc($results))
{
extract($row);
echo
"
<tr>
<td> $id </td>
<td> $title</td>
<td> $status</td>
<td> $date</td>
<td><a class='btn btn-secondary btn-sm' href='delete.php?id=$id'>Delete</a> </td>
</tr>
";
/* var_dump($row);
die();*/
}
?>
</tbody>
</table>
</div>
<!--End of table div-->
<script>
$(document).ready(function() {
$('#items').DataTable();
} );
</script>
</body>
</html>