-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinspectData.php
155 lines (138 loc) · 4.46 KB
/
inspectData.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
<?php
include_once "header.php";
include_once "controller/gatherDataCtrl.php";
include_once "controller/gatherDataEmergencyCtrl.php";
?>
<div class = "row">
<div class="container">
<h1>Show All data</h1>
<h2>Weather Data</h2>
<?php
$gather = new GatherDataCtrl();
//$res = $gather->getAllGatherData();
$res = $gather->getAllWeatherData();
if($res > 0){
echo "<table id='dtBasicExample' class='table-striped table-bordered table-sm' cellspacing='0' width='100%'><thead><tr>
<th scope='col'>Date Time</th>
<th scope='col'>Location City / Province</th>
<th scope='col'>temp</th>
<th scope='col'>humidity</th>
<th scope='col'>VALUE 3</th>
</tr></thead>";
echo "<tbody>";
//var_dump($res);
//print_r(sizeof($res));
//print_r(gettype($res));
foreach ($res as $key) {
if(is_array($key)){
echo "<tr>";
//echo "<td>".$key['IDX']."</td>";
echo "<th scope='row'>".$key['IDX_DATETIME']."</td>";
echo "<td>".$key['NAME']." -- ".$key['NAME_HGL']."</td>";
echo "<td>".$key['VALUE_1']."</td>";
echo "<td>".$key['VALUE_2']."</td>";
echo "<td>".$key['VALUE_3']."</td>";
echo "</tr>";
}
//print_r("this is dump: ");
//var_dump($value);
//for($i=0; $i<sizeof($res); $i++){
//echo "<tr>";
//echo "<td>".$res[$i]['IDX']."</td>";
// echo "<td>".$key[$i]['IDX_DATETIME']."</td>";
// echo "<td>".$key[$i]['LOCATION']."</td>";
// echo "<td>".$key[$i]['VALUE_1']."</td>";
// echo "<td>".$key[$i]['VALUE_2']."</td>";
// echo "<td>".$key[$i]['VALUE_3']."</td>";
//echo "</tr>";
//print_r($key);
//echo "<tr>";
//echo "<td>".$key['IDX']."</td>";
//echo "<td>".$key['IDX_DATETIME']."</td>";
//echo "<td>".$key['LOCATION']."</td>";
//echo "<td>".$key['VALUE_1']."</td>";
//echo "<td>".$key['VALUE_2']."</td>";
//echo "<td>".$key['VALUE_3']."</td>";
//echo "</tr>";
}
echo "</tbody></table>";
}else{
echo "<h1>There are no data stored</h1>";
}
?>
<h2>Dust Data</h2>
<?php
$gather = new GatherDataCtrl();
//$res = $gather->getAllGatherData();
$res = $gather->getAllWeatherDust();
if($res > 0){
echo "<table id='dtBasicExample1' class='table-striped table-bordered table-sm' cellspacing='0' width='100%'><thead><tr>
<th scope='col'>Date Time</th>
<th scope='col'>Location Province</th>
<th scope='col'>Item Code</th>
<th scope='col'>Value 1</th>
</tr></thead>";
echo "<tbody>";
//var_dump($res);
//print_r(sizeof($res));
//print_r(gettype($res));
foreach ($res as $key) {
if(is_array($key)){
echo "<tr>";
//echo "<td>".$key['IDX']."</td>";
echo "<th scope='row'>".$key['IDX_DATETIME']."</td>";
echo "<td>".$key['NAME_HGL']."</td>";
echo "<td>".$key['ITEMCODE']."</td>";
echo "<td>".$key['VALUE_1']."</td>";
echo "</tr>";
}
}
echo "</tbody></table>";
}else{
echo "<h1>There are no data stored</h1>";
}
?>
<h2>Emergency Data</h2>
<?php
$gather = new GatherDataEmergencyCtrl();
//$res = $gather->getAllGatherData();
$res = $gather->getAllEmergencyData();
if($res > 0){
echo "<table id='dtBasicExample2' class='table-striped table-bordered table-sm' cellspacing='0' width='100%'><thead><tr>
<th scope='col'>Date Time</th>
<th scope='col'>Emergency Code</th>
<th scope='col'>Issued Location</th>
<th scope='col'>Metropolitan City</th>
<th scope='col'>Emergency Text</th>
</tr></thead>";
echo "<tbody>";
//var_dump($res);
//print_r(sizeof($res));
//print_r(gettype($res));
foreach ($res as $key) {
if(is_array($key)){
echo "<tr>";
//echo "<td>".$key['IDX']."</td>";
echo "<th scope='row'>".$key['GEN_YMDHMS']."</td>";
echo "<td>".$key['EMERGENCY_CODE']."</td>";
echo "<td>".$key['SD']."</td>";
echo "<td>".$key['SGG']."</td>";
echo "<td>".$key['EMERGENCY_TEXT']."</td>";
echo "</tr>";
}
}
echo "</tbody></table>";
}else{
echo "<h1>There are no data stored</h1>";
}
?>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
$('#dtBasicExample').DataTable();
$('#dtBasicExample1').DataTable();
$('#dtBasicExample2').DataTable();
$('.dataTables_length').addClass('bs-select');
});
</script>