-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
136 lines (120 loc) · 5.4 KB
/
index.php
File metadata and controls
136 lines (120 loc) · 5.4 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
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
<!DOCTYPE html>
<html>
<head>
<title>Admin</title>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="./assets/css/style.css"></link>
</head>
</head>
<body >
<?php
include "./adminHeader.php";
include "./sidebar.php";
include_once "./config/dbconnect.php";
?>
<div id="main-content" class="container allContent-section py-4">
<div class="row">
<div class="col-sm-3">
<div class="card">
<i class="fa fa-users mb-2" style="font-size: 70px;"></i>
<h4 style="color:white;">Total Users</h4>
<h5 style="color:white;">
<?php
$sql="SELECT * from users where isAdmin=0";
$result=$conn-> query($sql);
$count=0;
if ($result-> num_rows > 0){
while ($row=$result-> fetch_assoc()) {
$count=$count+1;
}
}
echo $count;
?></h5>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<i class="fa fa-th-large mb-2" style="font-size: 70px;"></i>
<h4 style="color:white;">Total Categories</h4>
<h5 style="color:white;">
<?php
$sql="SELECT * from category";
$result=$conn-> query($sql);
$count=0;
if ($result-> num_rows > 0){
while ($row=$result-> fetch_assoc()) {
$count=$count+1;
}
}
echo $count;
?>
</h5>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<i class="fa fa-th mb-2" style="font-size: 70px;"></i>
<h4 style="color:white;">Total Products</h4>
<h5 style="color:white;">
<?php
$sql="SELECT * from product";
$result=$conn-> query($sql);
$count=0;
if ($result-> num_rows > 0){
while ($row=$result-> fetch_assoc()) {
$count=$count+1;
}
}
echo $count;
?>
</h5>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<i class="fa fa-list mb-2" style="font-size: 70px;"></i>
<h4 style="color:white;">Total orders</h4>
<h5 style="color:white;">
<?php
$sql="SELECT * from orders";
$result=$conn-> query($sql);
$count=0;
if ($result-> num_rows > 0){
while ($row=$result-> fetch_assoc()) {
$count=$count+1;
}
}
echo $count;
?>
</h5>
</div>
</div>
</div>
</div>
<?php
if (isset($_GET['category']) && $_GET['category'] == "success") {
echo '<script> alert("Category Successfully Added")</script>';
}else if (isset($_GET['category']) && $_GET['category'] == "error") {
echo '<script> alert("Adding Unsuccess")</script>';
}
if (isset($_GET['size']) && $_GET['size'] == "success") {
echo '<script> alert("Size Successfully Added")</script>';
}else if (isset($_GET['size']) && $_GET['size'] == "error") {
echo '<script> alert("Adding Unsuccess")</script>';
}
if (isset($_GET['variation']) && $_GET['variation'] == "success") {
echo '<script> alert("Variation Successfully Added")</script>';
}else if (isset($_GET['variation']) && $_GET['variation'] == "error") {
echo '<script> alert("Adding Unsuccess")</script>';
}
?>
<script type="text/javascript" src="./assets/js/ajaxWork.js"></script>
<script type="text/javascript" src="./assets/js/script.js"></script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js" ></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" ></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js"></script>
</body>
</html>