-
Notifications
You must be signed in to change notification settings - Fork 0
/
50x.php
89 lines (86 loc) · 4.55 KB
/
50x.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
<?php
// Start the session
session_start();
// If the user is logged in, display the user's balance at the top and profile picture on the upper right corner
if($_SESSION['loggedin']){
include('balance.php');
include('getinfo.php');
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Torture My Plant - Error 50x. It's our fault.</title>
<link rel="stylesheet" type="text/css" href="styles/errorpage.css">
<script type="text/javascript" src="javascripts/login.js"></script>
</head>
<body>
<!--Black bar on the top-->
<div id="navbar"></div>
<nav>
<ul>
<!--Homebutton, containing an invisible rectangle around the planticon and the website name -->
<div style="cursor: pointer;" onclick="window.location='index.php'" id="homebutton">
<li><a href="index.php"><img id="homeicon" src="img/planticon2.png"></a></li>
<li><a id="frontpagetext" href="index.php">Torture My Plant</a></li>
</div>
<?php
// Change the navbar, if the user is logged in
if($_SESSION['loggedin'] === TRUE){ ?>
<li><img id="coins" src="img/coins2.png"></li>
<li><p id="cointext"><?php echo number_format($coins, 0, ".", "."); ?></p></li>
<li><a href="profile.php">
<?php // If the user has a profile picture then display it, else display the generic profile picture
if($row['profile_picture'] !== NULL){
?>
<figure>
<?php echo "<img src=\"$path\">"; ?>
</figure>
<?php } else{ ?>
<img id="profilepic" src="img/profilepic.png" >
<?php } ?></a>
</li>
<!--Shopbutton, containing an invisible rectangle around the carticon and "Shop" -->
<div id="shopbutton" style="cursor: pointer;" onclick="window.location='shop.php'"></div>
<li><a href ="shop.php"><img id="cart" src="img/carticon2.png"><p id="shoptext">Shop</p></a></li>
<?php } else{ ?>
<li class="rightelements"><a class="links" href="#" onclick="showlogin();">Login</a></li>
<li class="rightelements"><a class="links" href="signup.php">Create Account</a></li>
<?php } ?>
</ul>
</nav>
<!--Content of the error page-->
<h1 id="errornumber">Error 50x</h1>
<h1 id="errormessage">Something went wrong... We are trying to fix this problem!</h1>
<img class="errorplant" src="img/planticon.png">
<img class="errorplant2" src="img/planticon.png">
<a id="goback" href="index.php"><h1 class="goback">Take me back to the homepage!</h1></a>
<!----Loginscreen---->
<!-- The Modal -->
<div id="loginbackground" class="modal">
<!--Close Button-->
<span onclick="document.getElementById('loginbackground').style.display='none'"
class="close animate">×</span>
<!-- Modal Content -->
<form class="modal-content animate" method="POST" action="">
<p class="logintext">Login</p>
<div class="container">
<!--Shows errors while the user tries to login-->
<div class ="error" id="error"></div>
<!--Input fields of the login form-->
<label for="username"><b>Username</b></label>
<input type="text" placeholder="Username..." name="username" id="username" required>
<label for="password"><b>Password</b></label>
<input type="password" placeholder="Password..." name="password" id="password" required>
<label>
<input type="checkbox" id="remember" checked="checked" name="remember"> Keep me logged in
</label><br><br>
New here? <a href="signup.php">Create an account here</a><br>
<input name="submit" type="button" class="accept loginbutton" id="submitform" value="Login" onclick="validate()" >
</div>
</form>
</div>
</body>
</html>