-
Notifications
You must be signed in to change notification settings - Fork 1
/
user_panel.php
377 lines (295 loc) · 12.6 KB
/
user_panel.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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
<?php
// session_start(); // Start the session
session_start();
// Check if the user is logged in
if (!isset($_SESSION['email'])) {
// If not logged in, redirect to login page
header("Location: pages-login.php");
exit();
}
include 'config/db.php';
//get email from session
$email = $_SESSION['email'];
//get user name and email from register table
$getAdminData = "SELECT * FROM register WHERE email = '$email'";
$resultData = mysqli_query($conn, $getAdminData);
if ($resultData->num_rows > 0) {
$row2 = $resultData->fetch_assoc();
$adminName = $row2['name'];
$adminEmail = $row2['email'];
}
//get total no of companies for compani card
$query = "SELECT COUNT(*) AS count FROM compani";
$result = mysqli_query($conn, $query);
$row = mysqli_fetch_assoc($result);
$companyCount = $row['count'];
//get no of branches for branch card
$queryBranches = "SELECT COUNT(*) AS branch_count FROM branch";
$resultBranches = mysqli_query($conn, $queryBranches);
$rowBranches = mysqli_fetch_assoc($resultBranches);
$branchCount = $rowBranches['branch_count'];
//get no of items for item card
$queryItem = "SELECT COUNT(*) AS item_count FROM item";
$resultItem = mysqli_query($conn, $queryItem);
$rowItem = mysqli_fetch_assoc($resultItem);
$itemCount = $rowItem['item_count'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Dashboard </title>
<meta content="" name="description">
<meta content="" name="keywords">
<!-- Favicons -->
<link href="assets/img/favicon.png" rel="icon">
<link href="assets/img/apple-touch-icon.png" rel="apple-touch-icon">
<!-- Google Fonts -->
<link href="https://fonts.gstatic.com" rel="preconnect">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Nunito:300,300i,400,400i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">
<!-- Vendor CSS Files -->
<link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/vendor/bootstrap-icons/bootstrap-icons.css" rel="stylesheet">
<link href="assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
<link href="assets/vendor/quill/quill.snow.css" rel="stylesheet">
<link href="assets/vendor/quill/quill.bubble.css" rel="stylesheet">
<link href="assets/vendor/remixicon/remixicon.css" rel="stylesheet">
<link href="assets/vendor/simple-datatables/style.css" rel="stylesheet">
<!-- Template Main CSS File -->
<link href="assets/css/style.css" rel="stylesheet">
<style>
.profileimage {
margin-right: 24px;
}
.navbar-image {
width: 50px;
height: 50px;
margin-right: 7px;
}
</style>
</head>
<body>
<!-- ======= Header ======= -->
<header id="header" class="header fixed-top d-flex align-items-center">
<div class="d-flex align-items-center justify-content-between">
<img class="navbar-image" src="assets/img/logo3.png" alt="">
<a href="index.php" class="logo d-flex align-items-center">
<span class="d-none d-lg-block">FingerLog</span>
</a>
<i class="bi bi-list toggle-sidebar-btn"></i>
</div><!-- End Logo -->
<nav class="header-nav ms-auto">
<ul class="d-flex align-items-center">
<li class="nav-item d-block d-lg-none">
<a class="nav-link nav-icon search-bar-toggle " href="#">
<i class="bi bi-search"></i>
</a>
</li><!-- End Search Icon-->
<li class="nav-item profileimage dropdown pe-3 mr-4">
<a class="nav-link nav-profile d-flex align-items-center pe-0" href="#" data-bs-toggle="dropdown">
<img src="image/admin-png.png" alt="Profile" class="rounded-circle">
<span class="d-none d-md-block dropdown-toggle ps-2"><?php echo $adminName ?></span>
</a><!-- End Profile Image Icon -->
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow profile">
<li class="dropdown-header">
<h6><?php echo $adminName ?></h6>
<span><?php echo $adminEmail ?></span>
</li>
<li>
<hr class="dropdown-divider">
</li>
</li>
<li>
<a class="dropdown-item d-flex align-items-center" href="logout.php">
<i class="bi bi-box-arrow-right"></i>
<span>Sign Out</span>
</a>
</li>
</ul><!-- End Profile Dropdown Items -->
</li><!-- End Profile Nav -->
</ul>
</nav><!-- End Icons Navigation -->
</header><!-- End Header -->
<!-- ======= Sidebar ======= -->
<aside id="sidebar" class="sidebar">
<ul class="sidebar-nav" id="sidebar-nav">
<li class="nav-item">
<a class="nav-link active" href="index.php">
<i class="ri-home-8-line"></i>
<span>Dashboard</span>
</a>
</li><!-- End Dashboard Nav -->
<!-- <li class="nav-item">
<a class="nav-link collapsed" data-bs-target="#tables-nav" data-bs-toggle="" href="Companies.php">
<i class="ri-building-4-line"></i><span>Companies</span><i class="bi bi-chevron ms-auto"></i>
</a>
</li>End Tables Nav -->
<li class="nav-item">
<a class="nav-link collapsed" data-bs-target="#tables-nav" data-bs-toggle="" href="box.php">
<i class="ri-archive-stack-fill"></i><span>Accounts</span><i class="bi bi-chevron ms-auto"></i>
</a>
</li>
<!-- </li>
<li class="nav-item">
<a class="nav-link collapsed" data-bs-target="#tables-nav" data-bs-toggle="" href="order.php">
<i class="ri-list-ordered"></i><span>Work Orders</span><i class="bi bi-chevron ms-auto"></i>
</a>
</li> -->
<li class="nav-item">
<a class="nav-link collapsed" data-bs-target="#tables-nav" data-bs-toggle="" href="racks.php">
<i class="bi bi-box"></i><span>Racks</span><i class="bi bi-chevron ms-auto"></i>
</a>
</li>
<li class="nav-item">
<a class="nav-link collapsed" data-bs-target="#tables-nav" data-bs-toggle="" href="store.php">
<i class="bi bi-shop"></i><span>Store</span><i class="bi bi-chevron ms-auto"></i>
</a>
</li>
<li class="nav-heading">Pages</li>
<li class="nav-item">
<a class="nav-link collapsed" href="users-profile.php">
<i class="bi bi-person"></i>
<span>Profile</span>
</a>
</li><!-- End Profile Page Nav -->
<!--
<li class="nav-item">
<a class="nav-link collapsed" href="pages-register.php">
<i class="bi bi-card-list"></i>
<span>Register</span>
</a>
</li> -->
<!-- End Register Page Nav -->
<li class="nav-item">
<a class="nav-link collapsed" href="pages-login.php">
<i class="bi bi-box-arrow-right"></i>
<span>Login</span>
</a>
</li><!-- End Login Page Nav -->
<li class="nav-item">
<a class="nav-link collapsed" href="logout.php">
<i class="bi bi-box-arrow-left"></i>
<span>Logout</span>
</a>
</li><!-- End Login Page Nav -->
<li class="nav-item">
<a class="nav-link collapsed" href="pages-contact.php">
<i class="bi bi-envelope"></i>
<span>Contact</span>
</a>
</li><!-- End Contact Page Nav -->
</ul>
</aside><!--------------- End sidebar ------------------>
<main id="main" class="main">
<div class="pagetitle mt-4">
<h1>Dashboard</h1>
<nav>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.php">Home</a></li>
<li class="breadcrumb-item active">Dashboard</li>
</ol>
</nav>
</div><!-- End Page Title -->
<section class="section dashboard">
<div class="row">
<!-- Left side columns -->
<div class="col-lg-12">
<div class="row">
<!-- Sales Card -->
<div class="col-xxl-4 col-md-4">
<div class="card info-card sales-card">
<div class="filter">
<a class="icon" href="#" data-bs-toggle="dropdown"><i class="bi bi-three-dots"></i></a>
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
<li class="dropdown-header text-start">
<h6>Filter</h6>
</li>
<li><a class="dropdown-item" href="#">Today</a></li>
<li><a class="dropdown-item" href="#">This Month</a></li>
<li><a class="dropdown-item" href="#">This Year</a></li>
</ul>
</div>
<div class="card-body">
<h5 class="card-title-indexphp">Companies </h5>
<div class="d-flex align-items-center">
<div class="card-icon rounded-circle d-flex align-items-center justify-content-center">
<i class="ri-building-4-line"></i>
</div>
<div class="ps-3">
<h6><?php echo $companyCount; ?></h6>
</div>
</div>
</div>
</div>
</div><!-- End Sales Card -->
<!-- Revenue Card -->
<div class="col-xxl-4 col-md-4">
<div class="card info-card revenue-card">
<div class="filter">
<a class="icon" href="#" data-bs-toggle="dropdown"><i class="bi bi-three-dots"></i></a>
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
<li class="dropdown-header text-start">
<h6>Filter</h6>
</li>
<li><a class="dropdown-item" href="#">Today</a></li>
<li><a class="dropdown-item" href="#">This Month</a></li>
<li><a class="dropdown-item" href="#">This Year</a></li>
</ul>
</div>
<div class="card-body">
<h5 class="card-title-indexphp">Branches </h5>
<div class="d-flex align-items-center">
<div class="card-icon rounded-circle d-flex align-items-center justify-content-center">
<i class="ri-git-merge-fill"></i>
</div>
<div class="ps-3">
<h6><?php echo $branchCount; ?></h6>
</div>
</div>
</div>
</div>
</div><!-- End Revenue Card -->
<!-- Customers Card -->
<div class="col-xxl-4 col-xl-4">
<div class="card info-card customers-card">
<div class="filter">
<a class="icon" href="#" data-bs-toggle="dropdown"><i class="bi bi-three-dots"></i></a>
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
<li class="dropdown-header text-start">
<h6>Filter</h6>
</li>
<li><a class="dropdown-item" href="#">Today</a></li>
<li><a class="dropdown-item" href="#">This Month</a></li>
<li><a class="dropdown-item" href="#">This Year</a></li>
</ul>
</div>
<div class="card-body">
<h5 class="card-title-indexphp">Items</h5>
<div class="d-flex align-items-center">
<div class="card-icon rounded-circle d-flex align-items-center justify-content-center">
<i class="ri-shopping-cart-line"></i>
</div>
<div class="ps-3">
<h6><?php echo $itemCount; ?></h6>
</div>
</div>
</div>
</div>
</div><!-- End Customers Card -->
</section>
</main><!-- End #main -->
<a href="#" class="back-to-top d-flex align-items-center justify-content-center"><i class="bi bi-arrow-up-short"></i></a>
<!-- Vendor JS Files -->
<script src="assets/vendor/apexcharts/apexcharts.min.js"></script>
<script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="assets/vendor/chart.js/chart.umd.js"></script>
<script src="assets/vendor/echarts/echarts.min.js"></script>
<script src="assets/vendor/quill/quill.js"></script>
<script src="assets/vendor/simple-datatables/simple-datatables.js"></script>
<script src="assets/vendor/tinymce/tinymce.min.js"></script>
<script src="assets/vendor/php-email-form/validate.js"></script>
<!-- Template Main JS File -->
<script src="assets/js/main.js"></script>
</body>
</html>