-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.php
More file actions
67 lines (58 loc) · 2.31 KB
/
admin.php
File metadata and controls
67 lines (58 loc) · 2.31 KB
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
<?php
include_once "Autentication/Auth.php";
include_once "Tools/User.php";
include_once 'Tools/Order.php';
include_once "DataBase.php";
$auth = AuthFabric::GetAuth();
if ($auth->isAuth()) {
$user = $auth->getCurrentUser();
$userInfo = $user->getUserInfo();
if (!$user->isAdmin() && !$user->isModerator())
{
header('Refresh: 3; URL=../index.php');
echo 'Доступ запрещен.';
exit;
}
} else {
header('Refresh: 3; URL=../index.php');
echo 'Пользователь не зарегистрирован.';
exit;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Админ меню</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/Styles.css">
<link rel="stylesheet" type="text/css" href="css/basket_styles.css">
<script type="text/javascript" src="/script/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/script/script.js"></script>
</head>
<body class="body">
<?php include 'Elements/headerMenu.php'; ?>
<div class="headerSearchPanel">
<div class="container">
<div class="Search">
<form>
<input class="SearchInput" type="text" hidden="true" placeholder="Поиск">
<input class="ButtonSubmit" type="submit" hidden="true" value="Найти">
</form>
</div>
<div class="closer"></div>
</div>
</div>
<ul>
<?php
$db = DBWorkerFabric::GetDataBaseWorker();
$orders = $db->getAllOrders($user->getLogin());
foreach ($orders as $order) {
//echo $order->Number;
printf('<li><a href="orderInfo.php?orderNum=%s">Заказ №%s</a><a href="orderInfo.php?orderDelete=%s"> Delete</a></li>',
$order->Number, $order->Number, $order->Number);
}
?>
</ul>
</body>
</html>