-
Notifications
You must be signed in to change notification settings - Fork 0
/
display.php
75 lines (62 loc) · 2.23 KB
/
display.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
<?php
include_once "includes/dbh.php";
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link type="text/css" href="css/admin.css" rel="stylesheet">
<title>Admin - GPM Casopis</title>
<!-- favicons
================================================== -->
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
<link rel="icon" href="../favicon.ico" type="image/x-icon">
</head>
<body>
<header>
<nav>
<ul>
<a href="./display.php"><li>Kontaktný formulár</li></a>
<a href="./displayMails.php"><li>Email - odbery</li></a>
</ul>
</nav>
</header>
<div id="formWrap">
<?php
if (isset($_SESSION["username"])) {
$sql = "SELECT * FROM cForm";
$result = mysqli_query($conn, $sql);
$resultCheck = mysqli_num_rows($result);
if ($resultCheck > 0) {
while ($row = mysqli_fetch_assoc($result)) {
echo "<div id=Element>";
echo "<br>";
echo "<p id='prewrite'>Meno: </p>".$row["name"];
echo "<br>";
echo "<p id='prewrite'>E-mail: </p>".$row["email"];
echo "<br>";
echo "<p id='msg'>Správa: </p>".$row["message"];
echo "<br>";
echo "<br>";
echo "<p id='prewrite'>Trieda: </p>".$row["class"];
echo "<br>";
echo "<p id='prewrite'> Rok/Mesiac/Deň a čas: </p>".$row["date"];
echo "<hr>";
echo "</div>";
}
} else {
echo "No results";
}
echo "<hr>";
echo "<form action='includes/logout.php' method='POST'>
<button type='submit' name='submit-logout'>Odhlásiť sa</button>
</form>";
} else {
header("Location: cms-admin.php");
}
?>
</div>
</body>
</html>