-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.php
123 lines (99 loc) · 4.27 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
<?php include('template-parts/header.php'); ?>
<?php include('template-parts/session.php'); ?>
<?php include('template-parts/left-panel.php'); ?>
<!-- Right Panel -->
<div id="right-panel" class="right-panel">
<?php include('template-parts/top-bar.php'); ?>
<?php include('template-parts/breadcrumbs.php'); ?>
<div class="content mt-3">
<div class="col-sm-6 col-lg-3">
<div class="card text-white bg-flat-color-1">
<div class="card-body pb-0">
<div class="dropdown float-right">
</div>
<?php
$sql = "SELECT id FROM users";
$result = $link->query($sql);
?>
<h4 class="mb-0">
<span class="count"><?=$result->num_rows;?></span>
</h4>
<p class="text-light">Users</p>
</div>
</div>
</div>
<!--/.col-->
<div class="col-sm-6 col-lg-3">
<div class="card text-white bg-flat-color-2">
<div class="card-body pb-0">
<div class="dropdown float-right">
</div>
<?php
$sqlCars = "SELECT plate FROM owned_vehicles";
$resultCars = $link->query($sqlCars);
?>
<h4 class="mb-0">
<span class="count"><?=$resultCars->num_rows?></span>
</h4>
<p class="text-light">Cars bought</p>
</div>
</div>
</div>
<!--/.col-->
<div class="col-sm-6 col-lg-3">
<div class="card text-white bg-flat-color-3">
<div class="card-body pb-0">
<div class="dropdown float-right">
</div>
<?php
$sqlMoney = "SELECT money,bank FROM users";
$resultMoney = $link->query($sqlMoney);
$totalMoney = 0;
$totalBank = 0;
while($money = mysqli_fetch_object($resultMoney)){
$totalMoney = $totalMoney + $money->money;
$totalBank = $totalBank + $money->bank;
}
?>
<h4 class="mb-0">
<span class="count"><?=$totalMoney?></span>
</h4>
<p class="text-light">Total money</p>
</div>
</div>
</div>
<!--/.col-->
<div class="col-sm-6 col-lg-3">
<div class="card text-white bg-flat-color-4">
<div class="card-body pb-0">
<div class="dropdown float-right">
</div>
<h4 class="mb-0">
<span class="count"><?=$totalBank?></span>
</h4>
<p class="text-light">Total Bank</p>
</div>
</div>
</div>
<!--/.col-->
<div class="col-sm-6 col-lg-3">
<div class="card text-white bg-flat-color-5">
<div class="card-body pb-0">
<div class="dropdown float-right">
</div>
<?php
$sqlOnline = "SELECT online FROM users where online = 1";
$resultOnline = $link->query($sqlOnline);
?>
<h4 class="mb-0">
<span class="count"><?=$resultOnline->num_rows?></span>
</h4>
<p class="text-light">Online Users</p>
</div>
</div>
</div>
<!--/.col-->
</div> <!-- .content -->
</div><!-- /#right-panel -->
<!-- Right Panel -->
<?php include('template-parts/footer.php'); ?>