-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontact.php
131 lines (100 loc) · 3.02 KB
/
contact.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
119
120
121
122
123
124
125
126
127
128
129
<?php
// session_start();
include('server.php');
if (!isAdmin()) {
$_SESSION['msg'] = "You must log in first";
header('location: ../login.php');
}
$query = "SELECT * FROM admin_contact;";
$results = mysqli_query($db, $query);
if(mysqli_num_rows($results) == 1) {
$contact = mysqli_fetch_assoc($results);
$name = $contact['name'];
$message = $contact['message'];
}
?>
<!DOCTYPE html>
<html>
<head>
<!-- Site Properties -->
<title>Something Simple</title>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.3.3/semantic.css">
<link href="https://fonts.googleapis.com/css?family=Pacifico" rel="stylesheet">
<style type="text/css">
.masthead {
min-height: 700px;
padding: 0.5em 0em;
background: #F5EAD1 url('images/web-graphics/leaf-watermark.png');
background-size: 600px;
background-repeat: no-repeat;
background-position: left bottom;
left: -2em;
bottom: -2em;
}
.masthead .container .header span {
font-family: 'Pacifico', cursive;
}
.masthead .container .header i {
padding: 0 0.5em;
}
.masthead .container .right .button {
margin: 0 1em !important;
}
.masthead .container .right h3 {
margin: 0 1em !important;
}
.masthead .container h1 {
font-size: 5em;
margin-top: 2em;
margin-bottom: 0em;
font-family: 'Pacifico', cursive;
}
.masthead .container .eight .button {
margin-top: 1.5em;
margin-right: 1.5em;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.3.3/semantic.js"></script>
</head>
<body>
<div class="pusher">
<!-- MASTER HEAD -->
<section class="masthead">
<!-- NAV BAR -->
<div class="ui container">
<div class="ui large secondary menu">
<div class="header item">
<span>something simple.</span>
<i class="leaf icon"></i>
</div>
<a href="adminHome.php" class="item">Admin</a>
<a href="contact.php" class="active item">Contact</a>
<div class="right item">
<h3>Welcome, <?php echo $_SESSION['username']['username']; ?>!</h3>
<a class="ui negative button" href="index.php">Log Out</a>
</div>
</div>
<div class="ui raised segment container">
<div class="ui grid">
<?php
echo "<table class='ui striped table'>
<thead>
<tr>
<th>Name</th>
<th>Message</th>
</tr>
</thead>";
while($row = mysqli_fetch_array($results)) {
echo "<tr>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['message'] . "</td>";
echo "</tr>";
}
echo "</table>";
?>
</div>
</div>
</section>
</div>
</body>
</html>