-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard.php
181 lines (142 loc) · 4.91 KB
/
dashboard.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
<?php
/*******************************************************************************
* Invoice Management System *
* *
* Version: 1.0 *
* Developer: Abhishek Raj *
*******************************************************************************/
include('header.php');
include('functions.php');
include_once("includes/config.php");
?>
<section class="content">
<!-- Small boxes (Stat box) -->
<div class="row">
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-green">
<div class="inner">
<h3><?php
$result = mysqli_query($mysqli, 'SELECT SUM(subtotal) AS value_sum FROM invoices WHERE status = "paid"');
$row = mysqli_fetch_assoc($result);
$sum = $row['value_sum'];
echo $sum;
?></h3>
<p>Sales Amount</p>
</div>
<div class="icon">
<i class="ion ion-social-usd"></i>
</div>
</div>
</div>
<!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-purple">
<div class="inner">
<h3><?php
$sql = "SELECT * FROM invoices";
$query = $mysqli->query($sql);
echo "$query->num_rows";
?></h3>
<p>Total Invoices</p>
</div>
<div class="icon">
<i class="ion ion-printer"></i>
</div>
</div>
</div>
<!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<h3><?php
$sql = "SELECT * FROM invoices WHERE status = 'open'";
$query = $mysqli->query($sql);
echo "$query->num_rows";
?></h3>
<p>Pending Bills</p>
</div>
<div class="icon">
<i class="ion ion-load-a"></i>
</div>
</div>
</div>
<!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner">
<h3><?php
$result = mysqli_query($mysqli, 'SELECT SUM(subtotal) AS value_sum FROM invoices WHERE status = "open"');
$row = mysqli_fetch_assoc($result);
$sum = $row['value_sum'];
echo $sum;
?></h3>
<p>Due Amount</p>
</div>
<div class="icon">
<i class="ion ion-alert-circled"></i>
</div>
</div>
</div>
<!-- ./col -->
</div>
<!-- /.row -->
<!-- 2nd row -->
<div class="row">
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-primary">
<div class="inner">
<h3><?php
$sql = "SELECT * FROM products";
$query = $mysqli->query($sql);
echo "$query->num_rows";
?></h3>
<p>Total Products</p>
</div>
<div class="icon">
<i class="ion ion-social-dropbox"></i>
</div>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-maroon">
<div class="inner">
<h3><?php
$sql = "SELECT * FROM store_customers";
$query = $mysqli->query($sql);
echo "$query->num_rows";
?></h3>
<p>Total Customers</p>
</div>
<div class="icon">
<i class="ion ion-ios-people"></i>
</div>
</div>
</div>
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-olive">
<div class="inner">
<h3><?php
$sql = "SELECT * FROM invoices WHERE status = 'paid'";
$query = $mysqli->query($sql);
echo "$query->num_rows";
?></h3>
<p>Paid Bills</p>
</div>
<div class="icon">
<i class="ion ion-ios-paper"></i>
</div>
</div>
</div>
</div>
</section>
<!-- /.content -->
<?php
include('footer.php');
?>