-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadminpage.php
94 lines (83 loc) · 1.87 KB
/
adminpage.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
<?php
require_once('connect.php');
if (!($_SESSION['loggedIn'] == true) OR !($_SESSION['rights'] == 1)){
header('location:index.php');
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="StyleSheet" href="style.css" />
<title>
Best Car Online - Admin
</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('productManagement.php');
}
if($_GET['page'] == 2){
include('categoryManagement.php');
}
if($_GET['page'] == 3){
include('orderManagement.php');
}
if($_GET['page'] == 4){
include('addProduct.php');
}
}
else{
echo "<p>This is adminpage :D</p>";
}
?>
</div>
<?php include("adminmenu.php"); ?>
<div id="footer">© Oskar Gusgård and Joel Vainikka 2015</div>
</div>
</body>
</html>