-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuserpage.php
98 lines (89 loc) · 2.34 KB
/
userpage.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
<?php
session_start();
if (!($_SESSION['loggedIn'] == true) OR !($_SESSION['rights'] == 0)){
header('location:index.php');
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="StyleSheet" href="style.css" />
<title>
Best Car Online - Userpage
</title>
</head>
<body>
<div id="wrapper">
<div id="logo">
<img src="img/logo.png" alt="logo" />
</div>
<div id="login">
<?php
if(isset($_SESSION['loggedIn'])){
echo "Hello " . $_SESSION['username'];
}
else{
echo "
<form name='input' action='login.php' method='post'>
<article>
Username<br />
<input type='text' name='username' class='field' />
</article>
<article>
Password<br />
<input type='password' name='password' class='field' />
</article>
<footer>
<input type='submit' name='login' value='Login' />
OR
<input type='submit' name='registernow' value='Register now' />
</footer>
</form>
";
}
// Error messages
if(isset($_GET['error'])){
echo "<div id='error'>";
if($_GET['error'] == 1){
echo "Username or password incorrect!";
}
echo "</div>";
}
?>
</div>
<div id="navigation">
<?php include('navigation.php'); ?>
</div>
<div id="content">
<?php
if(isset($_GET['page'])){
if($_GET['page'] == 1){
include('userOrderManagement.php');
}
if($_GET['page'] == 2){
include('userInfoManagement.php');
}
if($_GET['page'] == 3){
include('userPasswordChange.php');
}
}
else{
echo "
<div class='userpage-text'>
<h3>This is your userpage</h3>
<p>In 'Your orders' tab, you can check on your previous orders and your active orders if you have some.
There you can also cancel active orders that haven't been shipped yet. If the order that you are looking for is already in the 'old orders' section
: it is already shipped.</p>
<p>In 'Your information' tab, you can look at your details and chance them how you like. This will come in handy if you need to change your address for the delivery.</p>
<p>The 'Change password' tab is quite obvious right?</p>
</div>
";
}
?>
</div>
<?php include("menu.php"); ?>
<div id="footer">© Oskar Gusgård and Joel Vainikka 2015</div>
</div>
</body>
</html>