-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin_index.php
128 lines (117 loc) · 4.17 KB
/
admin_index.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
session_start();
$host = "localhost";
$username = "root";
$password = "";
$db_name = "vekabestwebsite";
//TODO: Check for admin, let him log in and else redirect away.
if ($_SESSION["admin"] == false) {
header("location: user_login.php");
}
if($_SERVER['REQUEST_METHOD'] == "POST") {
header('Location: admin_index.php');
}
?>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE = edge">
<meta name="viewport" content="width = device-width, initial-scale = 1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Website vader van Steffan</title>
<link href="VekaBest.css" rel="stylesheet" type="text/css">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<!--HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body style="background-color: #f0f0f0;">
<a href="index.php"><button class='inlogknop'>Home</button></a>
<a href=""><button class='inlogknop' onclick='toFalse();'>Uitloggen</button></a>
<div class="banner">
<img src="stockvekafotos/busbanner.jpg" />
</div>
<div class="nav">
<button onclick="showPage('admin_homeEdit');">
Home page
</button>
<button onclick="showPage('admin_contactEdit');">
Contact
</button>
<button onclick="showPage('admin_inventory');">
Inventaris
</button>
<button onclick="showPage('admin_users');">
Gebruikers
</button>
<button onclick="showPage('admin_orders');">
Bestellingen
</button>
</div>
<div class="rowcontainer">
<?php include("admin_inventory.php"); ?>
<?php include("admin_homeEdit.php"); ?>
<?php include("admin_contactEdit.php"); ?>
<?php include("admin_users.php"); ?>
<?php include("admin_orders.php"); ?>
</div>
<script>
var pages = ["admin_homeEdit", "admin_contactEdit", "admin_inventory", "admin_users", "admin_orders"];
function showPage(pagename) {
for (var i = 0; i < pages.length; i++) {
try {
var page = document.getElementById(pages[i]);
page.setAttribute("style", "display: none");
} catch (err) {
}
}
var showpage = document.getElementById(pagename);
showpage.setAttribute("style", "display: block");
}
function toFalse() {
$.ajax({
type : 'GET',
url : 'index.php',
data: {
bool : false,
},
success : function(data){
window.location.href = "index.php";
},
error : function(XMLHttpRequest, textStatus, errorThrown)
{alert ("Error Occured");}
});
}
</script>
<?php
if (isset($_POST['test'])) {
echo '<script type="text/javascript">
showPage("admin_inventory");
</script>';
}
if (isset($_POST['toevoegen'])) {
echo '<script type="text/javascript">
showPage("admin_inventory");
</script>';
}
if (isset($_POST['bewerken'])) {
echo '<script type="text/javascript">
showPage("admin_inventory");
</script>';
}
if (isset($_POST['verwijderen'])) {
echo '<script type="text/javascript">
showPage("admin_inventory");
</script>';
}
?>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src = "https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>