-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_info.php
88 lines (78 loc) · 3.97 KB
/
get_info.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>New Year Resolutions</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-12">
<div class="card mt-5">
<div class="card-header">
<h4>New Year Resolution Details</h4>
</div>
<div class="card-body">
<table class="table table-bordered">
<thead>
<tr>
<th>ID</th>
<th>First Name</th>
<th>Last Name</th>
<th>Gender</th>
<th>Email</th>
<th>Resolution</th>
<th>Description</th>
<th>Target Date</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
$con = mysqli_connect("localhost", "root", "", "resolution_db");
$query = "SELECT * FROM resolutions";
$query_run = mysqli_query($con, $query);
if (mysqli_num_rows($query_run) > 0) {
$i = 1;
foreach ($query_run as $row) {
?>
<tr>
<td><?= $i; ?></td>
<td><?= $row['firstName']; ?></td>
<td><?= $row['lastName']; ?></td>
<td><?= $row['gender']; ?></td>
<td><?= $row['email']; ?></td>
<td><?= $row['resolution']; ?></td>
<td><?= $row['description']; ?></td>
<td><?= $row['target_date']; ?></td>
<td>
<a href="update-process.php?id=<?= $row["id"]; ?>" class="btn btn-warning">Update</a>
<br>
<a href="delete.php?id=<?= $row["id"]; ?>" class="btn btn-danger">Delete</a>
</td>
</tr>
<?php $i++;
}
} else {
?>
<tr>
<td colspan="9">No Record Found</td>
</tr>
<?php
}
?>
</tbody>
</table>
<button onclick="window.location.href = 'index.html';" class="btn btn-primary">Add New Resolution</button>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>