connect_error) {
die("Connection failed: " . $conn->connect_error);
}
#$sql = "SELECT * FROM sensors_info ORDER BY sid DESC";
$sql = "SELECT * FROM sensors_info ORDER BY sid ASC";
$result = $conn->query($sql);
$html_name = "";
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
if ($row["sensor_plot"] == "on" && $row["sensor_state"] == "on") {
$html_name = "yes";
}
}
}
if ($html_name) {
$filepath = '/var/www/plots/sensortemp_1h.png';
if (file_exists($filepath)) {
echo '
';
}
else {
echo 'The plot will show up after the first cycle of plot creation which happens every 10 minutes. Please check back after 10 minutes.
';
}
}
else {
echo '
This the main access page to view and manage your Sensiplicity Systems Logger. There are no plots currently enabled and once you have connected some sensors and enable them with plots the system will display an aggregate plot of temperature data for all sensors on this page. Please go to the admin section and enable a plot for a sensor to put it on the list. After you enable the sensor and plots you can find sensor specific plots located under the link called "Temperature Plots". The "Raw Data" link with display the real time data for any enabled sensor regardless if plotting is turned on.
';
}
?>