Dashboard Monitoring
query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$suhu_terakhir = $row["suhu"];
$api_terakhir = $row["api_value"];
// Logika Status Api (Sesuaikan threshold nilai analog sensor Anda)
// Biasanya < 1000 berarti ada api dekat (untuk ESP32 range 0-4095)
$status_api = ($api_terakhir < 1000) ? "BAHAYA: API TERDETEKSI" : "Aman";
?>
Riwayat 10 Data Terakhir
| Waktu |
Suhu (°C) |
Nilai Sensor Api |
query($sql_hist);
if ($result_hist->num_rows > 0) {
while($row = $result_hist->fetch_assoc()) {
echo "| " . $row["waktu"] . " | " . $row["suhu"] . " | " . $row["api_value"] . " |
";
}
}
?>