-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
274 lines (256 loc) · 8.77 KB
/
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="./favicon.jpg" type="image/x-icon">
<?php
include('./config.php');
include('./server.php');
include('./authentication.php');
if (isset($_GET['logout'])) {
session_destroy();
}
include('./queries.php');
$getcountitems = mysqli_query($conn, $countitems);
$getcountlocations = mysqli_query($conn, $countlocations);
$getcountcowcodes = mysqli_query($conn, $countcowcodes);
$name = mysqli_query($conn, $sitename);
if (! $name) {
die('Could not load sitename: '.mysqli_error($conn));
}
while($row = mysqli_fetch_assoc($name)) {?>
<title>Admin | <?php $site = htmlspecialchars($row['sitename']); echo $site ;?></title>
<?php }
?>
<!-- Google Font: Source Sans Pro -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
<!-- Font Awesome Icons -->
<link rel="stylesheet" href="./admin/plugins/fontawesome-free/css/all.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="./admin/css/adminlte.min.css">
</head>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
<!-- Navbar -->
<nav class="main-header navbar navbar-expand navbar-white navbar-light">
<!-- Left navbar links -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
</li>
</ul>
<!-- Right navbar links -->
<ul class="navbar-nav ml-auto">
<!-- Navbar Search -->
<li class="nav-item">
<a class="nav-link" href="./account/">
<i class="fas fa-th-large"></i>
</a>
</li>
</ul>
</nav>
<!-- /.navbar -->
<!-- Main Sidebar Container -->
<aside class="main-sidebar sidebar-dark-primary elevation-4">
<!-- Brand Logo -->
<a href="./index.php" class="brand-link">
<img src="./favicon.jpg" alt="Logo" class="brand-image img-circle elevation-3" style="opacity: .8">
<span class="brand-text font-weight-light"><?php echo $site; ?></span>
</a>
<!-- Sidebar -->
<div class="sidebar">
<!-- Sidebar Menu -->
<nav class="mt-2">
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
<!-- Add icons to the links using the .nav-icon class
with font-awesome or any other icon font library -->
<li class="nav-item">
<a href="./" class="nav-link active">
<i class="nav-icon fas fa-tachometer-alt"></i>
<p>
Dashboard
</p>
</a>
</li>
<li class="nav-item">
<a href="./cowcodes.php" class="nav-link">
<i class="nav-icon fas fa-users-cog"></i>
<p>
Cow-Codes
</p>
</a>
</li>
<li class="nav-item menu-closed">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-tree"></i>
<p>
Items
<i class="fas fa-angle-left right"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="./" class="nav-link">Complete List</a>
</li>
<?php
$getroot = mysqli_query($conn, $rootcategories);
if (! $getroot) {
die('Could not fetch data: '.mysqi_error($conn));
}
while ($row2 = mysqli_fetch_assoc($getroot)) {
?>
<li class="nav-item">
<a href="./list.php?id=<?php echo htmlspecialchars($row2['categoryid']);?>" class="nav-link" <?php if(htmlspecialchars($row2['active']) == 'false')
{?>
hidden
<?php };
?>><?php echo htmlspecialchars($row2['name']);?></a>
</li>
<?php };
?>
</ul>
</li>
<?php if (isset($_SESSION['email'])): ?>
<li class="nav-item">
<a href="./index.php?logout='1'" class="nav-link">
<i class="nav-icon fas fa-th"></i>
<p>
Logout
</p>
</a>
</li>
<?php endif ?>
</ul>
</nav>
<!-- /.sidebar-menu -->
</div>
<!-- /.sidebar -->
</aside>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">Dashboard</h1>
</div><!-- /.col -->
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item active">Dashboard</li>
</ol>
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.container-fluid -->
</div>
<!-- /.content-header -->
<!-- Main content -->
<div class="content">
<div class="container-fluid">
<div class="row">
<!-- notification message -->
<?php if (isset($_SESSION['success'])) : ?>
<div class="error success" >
<h3>
<?php
echo $_SESSION['success'];
unset($_SESSION['success']);
?>
</h3>
</div>
<?php endif ?>
<div class="col-lg-3 col-6">
<div class="small-box bg-info">
<div class="inner">
<h3><?php
if (! $getcountcowcodes) {
die('Could not fetch data: '.mysqli_error($conn));
}
while ($row3 = mysqli_fetch_assoc($getcountcowcodes)) {
echo htmlspecialchars($row3['amountsites']);
} ?></h3>
<p>Cow-Codes</p>
</div>
<div class="icon">
<i class="ion ion-bag"></i>
</div>
<a href="./cowcodes.php" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-3 col-6">
<div class="small-box bg-info">
<div class="inner">
<h3><?php
if (! $getcountitems) {
die('Could not fetch data: '.mysqli_error($conn));
}
while ($row4 = mysqli_fetch_assoc($getcountitems)) {
echo htmlspecialchars($row4['amountitems']);
} ?></h3>
<p>Items</p>
</div>
<div class="icon">
<i class="ion ion-bag"></i>
</div>
<a href="./items/" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-3 col-6">
<div class="small-box bg-info">
<div class="inner">
<h3><?php
// if (! $getcountusers) {
// die('Could not fetch data: '.mysqli_error($conn));
// }
// while ($row5 = mysqli_fetch_assoc($getcountusers)) {
// echo htmlspecialchars($row5['amountusers']);
// }?></h3>
<p>Users</p>
</div>
<div class="icon">
<i class="ion ion-bag"></i>
</div>
<a href="./users/" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-3 col-6">
<div class="small-box bg-info">
<div class="inner">
<h3><?php
if (! $getcountlocations) {
die('Could not fetch data: '.mysqli_error($conn));
}
while ($row3 = mysqli_fetch_assoc($getcountlocations)) {
echo htmlspecialchars($row3['amountlocations']);
} ?></h3>
<p>Locations</p>
</div>
<div class="icon">
<i class="ion ion-bag"></i>
</div>
</div>
</div>
</div>
<!-- /.row -->
</div><!-- /.container-fluid -->
</div>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<!-- Main Footer -->
<footer class="main-footer">
<!-- Default to the left -->
<?php include('./admin/footer.php'); ?>
</footer>
</div>
<!-- ./wrapper -->
<!-- REQUIRED SCRIPTS -->
<!-- jQuery -->
<script src="./admin/plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="./admin/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="./admin/js/adminlte.min.js"></script>
</body>
</html>