forked from EddwaardHaar/Group_8
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforum.php
86 lines (77 loc) · 2.77 KB
/
forum.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
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="assets/style.css">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Sodexo, Menu">
<title>Coffee shop Menu</title>
</head>
<script>
function comment(){
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("comment").innerHTML = this.responseText;
}
};
xmlhttp.open("POST", "./comment.php", true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.send();
}
</script>
<body>
<header>
<?php
if (!isset($_SESSION["credentials"])){
echo "<a href='index.html'><img src='assets/images/2560px-Sodexo_logo.svg.png' width='130' height='44' alt='SodexoLogo' /></a>
<h3> <a href='index.html'>Home</a>     <a href='Menu.html'>Menu</a>     <a href='OpenTime.html'>Open time</a>     <a href='AboutUs.html'>About us</a>    <a href='forum.php'>Forum</a></h3>
";
}else {
echo "<a href='Login_Home.php'><img src='assets/images/2560px-Sodexo_logo.svg.png' width='130' height='44' alt='SodexoLogo' /></a>
<h3><a href='Login_Home.php'>Home</a>   <a href='Login_Menu.php'>Menu</a>   <a href='Login_OpenTime.php'>Open time</a>   <a href='Login_AboutUs.php'>About us</a>  <a href='forum.php'>Forum</a></h3>
";
}
?>
</header>
<kuva><img src="assets/images/coffeeBeans4.jpg" alt="coffeeBeans"></kuva>
<main>
<div id='comment'>
<?php
if (!isset($_SESSION["credentials"])){
echo "<a href='kirjauduajax.html'>Kirjaudu sisään</a>";
}else {
echo "<button onclick='comment()'>comment</button>";
}
?>
</div>
<?php
include('readcomment.php')
?>
</main>
<footer>
<address>
<ul class="list">
<li><b>Sodexo Oy</b></li>
<li>Vankanlähde 9</li>
<li>13100 Hämeenlinna</li>
<li>p. 010 540 7000</li>
<li>[email protected]</li>
<li>[email protected]</li>
<li>
<?php
if (!isset($_SESSION["credentials"])){
echo "<a href='kirjauduajax.html'>Login</a>";
}else {
echo "<a href='kirjauduulos.php'>Logout</a>";
}
?>
</ul>
</address>
</footer>
</body>
</html>