-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrafik_suhu.php
287 lines (249 loc) · 8.94 KB
/
grafik_suhu.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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<?php
session_start();
if(!empty($_SESSION["username"])){
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Grafik Monitoring Temperatur Suhu Ruang Server</title>
<!-- Core CSS - Include with every page -->
<link href="css/bootstrap.css" rel="stylesheet">
<link href="font-awesome/css/font-awesome.css" rel="stylesheet">
<!-- Page-Level Plugin CSS - Dashboard -->
<link href="css/plugins/morris/morris-0.4.3.min.css" rel="stylesheet">
<link href="css/plugins/timeline/timeline.css" rel="stylesheet">
<!-- SB Admin CSS - Include with every page -->
<link href="css/sb-admin.css" rel="stylesheet">
<style type="text/css">
#grafik_sensor_1_celcius {
margin-top: auto;
margin-bottom: auto;
}
#grafik_sensor_1_fahrenheit {
margin-top: auto;
margin-bottom: auto;
}
#grafik_sensor_2_celcius {
margin-top: auto;
margin-bottom: auto;
}
#grafik_sensor_2_fahrenheit {
margin-top: auto;
margin-bottom: auto;
}
</style>
</head>
<body>
<div id="wrapper">
<nav class="navbar navbar-default navbar-fixed-top" role="navigation"
style="margin-bottom: 0">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse"
data-target=".sidebar-collapse">
<span class="sr-only">Toggle navigation</span> <span
class="icon-bar"></span> <span class="icon-bar"></span> <span
class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Praktik Kerja Lapang di
Pusat Penelitian Fisika LIPI</a>
</div>
<!-- /.navbar-header -->
<ul class="nav navbar-top-links navbar-right">
<?php echo $_SESSION['username']; ?>
<li class="dropdown"><a class="dropdown-toggle"
data-toggle="dropdown" href="#"> <i class="fa fa-user fa-fw"></i> <i
class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu dropdown-user">
<li><a href="#"><i class="fa fa-user fa-fw"></i> User Profile</a>
</li>
<li><a href="#"><i class="fa fa-gear fa-fw"></i> Settings</a>
</li>
<li class="divider"></li>
<li><a href="logout.php"><i class="fa fa-sign-out fa-fw"></i>
Logout</a>
</li>
</ul> <!-- /.dropdown-user -->
</li>
<!-- /.dropdown -->
</ul>
<!-- /.navbar-top-links -->
</nav>
<!-- /.navbar-static-top -->
<nav class="navbar-default navbar-static-side" role="navigation"
style="padding-top: 50px;">
<div class="sidebar-collapse">
<ul class="nav" id="side-menu">
<li><a href="beranda.php"><i class="fa fa-dashboard fa-fw"></i>
Beranda</a>
</li>
<li><a href="#"><i class="fa fa-wrench fa-fw fa-fw"></i> Sistem<span
class="fa arrow"></span> </a>
<ul class="nav nav-second-level">
<li><a href="monitoring_suhu.php">Monitoring Suhu</a>
</li>
<li><a href="control.php">Kontrol Kipas Pendingin</a>
</li>
<li><a href="automation_control.php">Automation Control</a>
</li>
</ul> <!-- /.nav-second-level -->
</li>
<li class="active"><a href="grafik_suhu.php"><i
class="fa fa-bar-chart-o fa-fw"></i> Grafik Temperatur Suhu</a>
</li>
<li><a href="tables.html"><i class="fa fa-table fa-fw"></i> Cara
Pengaturan</a>
</li>
<li><a href="forms.html"><i class="fa fa-edit fa-fw"></i> Tentang</a>
</li>
</ul>
<!-- /#side-menu -->
</div>
<!-- /.sidebar-collapse -->
</nav>
<!-- /.navbar-static-side -->
<div id="page-wrapper" style="padding-top: 50px;">
<div class="row">
<div class="col-md-12">
<h1 class="page-header">Grafik Temperatur Suhu Ruang Server</h1>
</div>
<!-- /.col-md-12 -->
</div>
<!-- /.row -->
<div class="row">
<div class="col-md-6">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Grafik Temperatur Sensor 1</h3>
</div>
<div class="panel-body" style="text-align: center;">
<div id="chartdiv_1_celcius" align="center"></div>
<div id="chartdiv_1_fahrenheit" align="center"></div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Grafik Temperatur Sensor 2</h3>
</div>
<div class="panel-body" style="text-align: center;">
<div id="chartdiv_2_celcius" align="center"></div>
<div id="chartdiv_2_fahrenheit" align="center"></div>
</div>
</div>
</div>
<!-- /.col-md-6 -->
<div class="col-md-12">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Grafik Temperatur Suhu Ruang Server</h3>
</div>
<div class="panel-body" style="text-align: center;">
<div id="chartdiv_1"></div>
<div id="chartdiv_2"></div>
</div>
</div>
</div>
</div>
<!-- /.row -->
</div>
<!-- /#page-wrapper -->
</div>
<!-- /#wrapper -->
<!-- Core Scripts - Include with every page -->
<script src="js/jquery-1.10.2.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>
<!-- Page-Level Plugin Scripts - Dashboard -->
<script src="js/plugins/morris/raphael-2.1.0.min.js"></script>
<script src="js/plugins/morris/morris.js"></script>
<!-- SB Admin Scripts - Include with every page -->
<script src="js/sb-admin.js"></script>
<!-- Page-Level Demo Scripts - Dashboard - Use for reference -->
<script src="js/demo/dashboard-demo.js"></script>
<script src="js/jquery-latest.js"></script>
<!-- Fusion Chart Untuk Grafik Temperature Suhu -->
<script type="text/javascript" src="chart/fusioncharts.js"></script>
<script type="text/javascript" src="chart/prototype.js"></script>
<script type="text/javascript">
new PeriodicalExecuter(function getLatestData() {
//ngambil data sensor 1 celcius dan fahrenheit dalam 10 data terakhir
new Ajax.Request('chart/data_grafik_sensor_1_celcius.php', {
method: 'get',
onSuccess: function(transport) {
updateChartXML('grafik_sensor_1_celcius', transport.responseText);
}
});
new Ajax.Request('chart/data_grafik_sensor_1_fahrenheit.php', {
method: 'get',
onSuccess: function(transport) {
updateChartXML('grafik_sensor_1_fahrenheit', transport.responseText);
}
});
//ngambil data sensor 2 celcius dan fahrenheit dalam 10 data terakhir
new Ajax.Request('chart/data_grafik_sensor_2_celcius.php', {
method: 'get',
onSuccess: function(transport) {
updateChartXML('grafik_sensor_2_celcius', transport.responseText);
}
});
new Ajax.Request('chart/data_grafik_sensor_2_fahrenheit.php', {
method: 'get',
onSuccess: function(transport) {
updateChartXML('grafik_sensor_2_fahrenheit', transport.responseText);
}
});
//ngambil data sensor 1 dan 2 keseluruhan
new Ajax.Request('chart/data_grafik_sensor_1.php', {
method: 'get',
onSuccess: function(transport) {
updateChartXML('grafik_sensor_1', transport.responseText);
}
});
new Ajax.Request('chart/data_grafik_sensor_2.php', {
method: 'get',
onSuccess: function(transport) {
updateChartXML('grafik_sensor_2', transport.responseText);
}
});
}, 1);
// grafik sensor 1 diambil 10 data terakhir
var grafik_sensor_1_celcius = new FusionCharts("chart/FCF_Line.swf",
"grafik_sensor_1_celcius", "370", "300", "0", "1");
grafik_sensor_1_celcius.setDataURL('chart/data_grafik_sensor_1_celcius.php');
grafik_sensor_1_celcius.render("chartdiv_1_celcius");
var grafik_sensor_1_fahrenheit = new FusionCharts("chart/FCF_Line.swf",
"grafik_sensor_1_fahrenheit", "370", "300", "0", "1");
grafik_sensor_1_fahrenheit.setDataURL('chart/data_grafik_sensor_1_fahrenheit.php');
grafik_sensor_1_fahrenheit.render("chartdiv_1_fahrenheit");
// grafik sensor 2 diambil 10 data terakhir
var grafik_sensor_2_celcius = new FusionCharts("chart/FCF_Line.swf",
"grafik_sensor_2_celcius", "370", "300", "0", "1");
grafik_sensor_2_celcius.setDataURL('chart/data_grafik_sensor_2_celcius.php');
grafik_sensor_2_celcius.render("chartdiv_2_celcius");
var grafik_sensor_2_fahrenheit = new FusionCharts("chart/FCF_Line.swf",
"grafik_sensor_2_fahrenheit", "370", "300", "0", "1");
grafik_sensor_2_fahrenheit.setDataURL('chart/data_grafik_sensor_2_fahrenheit.php');
grafik_sensor_2_fahrenheit.render("chartdiv_2_fahrenheit");
// grafik secara keseluruhan
var grafik_sensor_1 = new FusionCharts("chart/FCF_Line.swf",
"grafik_sensor_1", "800", "300", "0", "1");
grafik_sensor_1.setDataURL('chart/data_grafik_sensor_1.php');
grafik_sensor_1.render("chartdiv_1");
var grafik_sensor_2 = new FusionCharts("chart/FCF_Line.swf",
"grafik_sensor_2", "800", "300", "0", "1");
grafik_sensor_2.setDataURL('chart/data_grafik_sensor_2.php');
grafik_sensor_2.render("chartdiv_2");
</script>
</body>
</html>
<?php }else{
echo "<script>
alert('Harus Login Terlebih dahulu');
location.href='logout.php';
</script>";
} //session tidak ada nip
?>