-
Notifications
You must be signed in to change notification settings - Fork 0
/
dashboard.php
149 lines (113 loc) · 3.5 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
<?php require_once 'includes/header.php'; ?>
<?php
$sql = "SELECT * FROM product WHERE status = 1";
$query = $connect->query($sql);
$countProduct = $query->num_rows;
$orderSql = "SELECT * FROM orders WHERE order_status = 1";
$orderQuery = $connect->query($orderSql);
$countOrder = $orderQuery->num_rows;
$totalRevenue = "";
while ($orderResult = $orderQuery->fetch_assoc()) {
$totalRevenue = $orderResult['paid'];
}
$lowStockSql = "SELECT * FROM product WHERE quantity <= 3 AND status = 1";
$lowStockQuery = $connect->query($lowStockSql);
$countLowStock = $lowStockQuery->num_rows;
$connect->close();
?>
<style type="text/css">
.ui-datepicker-calendar {
display: none;
}
</style>
<!-- fullCalendar 2.2.5-->
<link rel="stylesheet" href="assests/plugins/fullcalendar/fullcalendar.min.css">
<link rel="stylesheet" href="assests/plugins/fullcalendar/fullcalendar.print.css" media="print">
<div class="row">
<div class="col-md-4">
<div class="panel panel-success">
<div class="panel-heading">
<a href="product.php" style="text-decoration:none;color:black;">
Total Product
<span class="badge pull pull-right"><?php echo $countProduct; ?></span>
</a>
</div> <!--/panel-hdeaing-->
</div> <!--/panel-->
</div> <!--/col-md-4-->
<div class="col-md-4">
<div class="panel panel-info">
<div class="panel-heading">
<a href="orders.php?o=manord" style="text-decoration:none;color:black;">
Total Orders
<span class="badge pull pull-right"><?php echo $countOrder; ?></span>
</a>
</div> <!--/panel-hdeaing-->
</div> <!--/panel-->
</div> <!--/col-md-4-->
<div class="col-md-4">
<div class="panel panel-danger">
<div class="panel-heading">
<a href="product.php" style="text-decoration:none;color:black;">
Low Stock
<span class="badge pull pull-right"><?php echo $countLowStock; ?></span>
</a>
</div> <!--/panel-hdeaing-->
</div> <!--/panel-->
</div> <!--/col-md-4-->
<div class="col-md-4">
<div class="card">
<div class="cardHeader">
<h1><?php echo date('d'); ?></h1>
</div>
<div class="cardContainer">
<p><?php echo date('l') .' '.date('d').', '.date('Y'); ?></p>
</div>
</div>
<br/>
<div class="card">
<div class="cardHeader" style="background-color:#245580;">
<h1><?php if($totalRevenue) {
echo $totalRevenue;
} else {
echo '0';
} ?></h1>
</div>
<div class="cardContainer">
<p> <i class="glyphicon glyphicon-usd"></i> Total Revenue</p>
</div>
</div>
</div>
<div class="col-md-8">
<div class="panel panel-default">
<div class="panel-heading"> <i class="glyphicon glyphicon-calendar"></i> Calendar</div>
<div class="panel-body">
<div id="calendar"></div>
</div>
</div>
</div>
</div> <!--/row-->
<!-- fullCalendar 2.2.5 -->
<script src="assests/plugins/moment/moment.min.js"></script>
<script src="assests/plugins/fullcalendar/fullcalendar.min.js"></script>
<script type="text/javascript">
$(function () {
// top bar active
$('#navDashboard').addClass('active');
//Date for the calendar events (dummy data)
var date = new Date();
var d = date.getDate(),
m = date.getMonth(),
y = date.getFullYear();
$('#calendar').fullCalendar({
header: {
left: '',
center: 'title'
},
buttonText: {
today: 'today',
month: 'month'
}
});
});
</script>
<?php require_once 'includes/footer.php'; ?>