-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
69 lines (61 loc) · 1.63 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
66
67
68
69
<!DOCTYPE html>
<html lang="en">
<head>
<title>Cloudply Customers</title>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
font-family: sans-serif;
padding: 5px;
}
table tr:nth-child(even) td {
background-color: #95c7ea;
}
</style>
</head>
<body>
<h2>Version 1.20.8</h2><br>
<?php
include("db.php");
// Perform SQL query
$sql = "SELECT * FROM customers";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "<table>\n";
// Output data of each row
while($row = $result->fetch_assoc()) {
echo "\t<tr>\n";
foreach ($row as $col_value) {
print "\t\t<td>$col_value</td>\n";
}
$id=$row['id'];
echo "\t\t<td><a href=\"delete.php?id=$id\" onclick=\"return confirm(\'Are you sure you wish to delete this Record?\');\"> X </a></td>\n";
echo "\t</tr>\n";
}
echo "</table>";
} else {
echo "0 results";
}
// Close connection
$conn->close();
?>
<form action="insert.php" method="post" name="insertform">
<p>
<label for="name" id="preinput"> First Name : </label>
<input type="text" name="first_name" required placeholder="First name" id="inputid"/>
</p>
<p>
<label for="name" id="preinput"> Last Name : </label>
<input type="text" name="last_name" required placeholder="Last name" id="inputid"/>
</p>
<p>
<label for="email" id="preinput"> Email : </label>
<input type="email" name="usermail" required placeholder="Email" id="inputid" />
</p>
<p>
<input type="submit" name="send" value="Submit" id="inputid1" />
</p>
</form>
</body>
</html>