-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetails.php
118 lines (91 loc) · 2.71 KB
/
details.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
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
<!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>Details</title>
<style type = "text/css">
h1{
text-align: center;
color: rgb(102, 102, 102);
}
body {
background: #f5efe0;
box-sizing: border-box;
color: #000;
font-size: 1.8rem;
letter-spacing: -0.015em;
text-align: center;
}
table {
margin-left: auto;
margin-right: auto;
width: 80%;
}
th {
font-family: Arial, Helvetica, sans-serif;
font-size: 20px;
background: #666;
<color:rgb(255, 255, 255);
padding: 2px 6px;
border-collapse: separate;
border: 1px solid #000;
}
td {
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
text-align: center;
border: 1px solid #DDD;
}
</style>
</head>
<body>
<h1>DATA ENTRY OF CONTACT INFORMATION</h1>
<?php
// include("insert.php");
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "contact";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT Name, Phone_no, email, message, subject FROM enquiry"; /*select items to display from the sensordata table in the data base*/
echo '<table cellspacing="5" cellpadding="5">
<tr>
<th>Name</th>
<th>Phone_no</th>
<th>email</thh>
<th>message</th>
<th>subject</th>
</tr>';
if ($result = $conn->query($sql)) {
while ($row = $result->fetch_assoc()) {
$row_Name = $row["Name"];
$row_Phone_no = $row["Phone_no"];
$row_email = $row["email"];
$row_message = $row["message"];
$row_subject = $row["subject"];
// Uncomment to set timezone to - 1 hour (you can change 1 to any number)
// $row_reading_time = date("Y-m-d H:i:s", strtotime("$row_reading_time - 1 hours"));
// Uncomment to set timezone to + 4 hours (you can change 4 to any number)
//$row_reading_time = date("Y-m-d H:i:s", strtotime("$row_reading_time + 4 hours"));
echo '<tr>
<td>' . $row_Name . '</td>
<td>' . $row_Phone_no. '</td>
<td>' . $row_email . '</td>
<td>' . $row_message . '</td>
<td>' . $row_subject . '</td>
</tr>';
}
$result->free();
}
$conn->close();
?>
</table>
</body>
</html>