-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdashboard.php
executable file
·57 lines (54 loc) · 2.25 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
<?php
include_once("header.php");
$stmt = $conn->prepare("SELECT DISTINCT(`fk_bin_id`), `id`, `is_bin_present`, `bin_level`,`created_time`, bin_sensor_data.latitude as lat, bin_sensor_data.longitude as longi, bin_master.bin_location_name, bin_master.description FROM `bin_sensor_data`, `bin_master` WHERE bin_sensor_data.fk_bin_id = bin_master.bin_id ORDER BY `id` DESC limit 4");
$stmt->execute();
$bin_data = "";
if($stmt->rowCount() > 0)
{
while($row = $stmt->fetch(PDO::FETCH_ASSOC))
{
$bin_level = $row['bin_level'] . "%";
if($row['is_bin_present'] == 0)
$bin_level = "<span class='else-not'>Bin Not Present</span>";
$bin_data .= '<div class="col-xs-12 col-sm-6">
<div class="widget-small">
<div class="indi">
'.$bin_level.'
</div>
<div class="info">
<h6>'.$row['bin_location_name'].'</h6>
<p>Bin Id - <strong>'.$row['fk_bin_id'].'</strong></p>
<p>Availability - <strong>'.$row['is_bin_present'].'</strong></p>
</div>
</div>
</div>';
}
}
?>
<main role="main" class="container">
<section>
<div class="row">
<div class="col-xs-12 col-sm-6">
<div class="card custom-cards">
<iframe src="https://www.google.com/maps/embed?pb=!1m10!1m8!1m3!1d14962.382254186146!2d85.81456041977539!3d20.35831990000001!3m2!1i1024!2i768!4f13.1!5e0!3m2!1sen!2sin!4v1531656800632" width="100%" height="250" frameborder="0" style="border:0" allowfullscreen></iframe>
<div class="card-body">
<div class="row" id="sensor_data1">
<?php echo $bin_data; ?>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6">
<div class="card custom-cards">
<iframe src="https://www.google.com/maps/embed?pb=!1m10!1m8!1m3!1d14962.382254186146!2d85.81456041977539!3d20.35831990000001!3m2!1i1024!2i768!4f13.1!5e0!3m2!1sen!2sin!4v1531656800632" width="100%" height="250" frameborder="0" style="border:0" allowfullscreen></iframe>
<div class="card-body">
<div class="row" id="sensor_data2">
<?php echo $bin_data; ?>
</div>
</div>
</div>
</div>
</div>
</section>
</main><!-- /.container -->
<?php include_once("footer.php"); ?>