<?php
//setting header to json 

    $id = $_POST["id"];  // get internal sensor id from js
    $value = $_POST["v"];  // get value
    require '../php/database.php';
    
    $items = strval($id);
    // $sql = "UPDATE ds18b20 SET `graphVisible`='$value' WHERE `address`='$id'";
    $sql = "UPDATE ds18b20 SET `graphVisible`='$value' WHERE `address`='$id'";

    if ($mysqli->query($sql) === TRUE) {
        // echo "Widget Visible updated successfully";
    } else {
        // echo "Error updating Widget Visible: " . $mysqli->error;
    }
    
    $mysqli->close();