<?php
//setting header to json 
    header('Content-Type: application/json');
    header("Access-Control-Allow-Origin: *");

    $a = $_POST["a"];  // get internal sensor id from js
    $e1 = $_POST["e1"];  // get internal sensor id from js
    $e2 = $_POST["e2"];  // get internal sensor id from js
    $e3 = $_POST["e3"];  // get internal sensor id from js
    require '../php/database.php';

    $password = password_hash($p, PASSWORD_DEFAULT);
    
    // $sql = "UPDATE ds18b20 SET `name`='$name' WHERE `address`='$id'";
    $sql = "UPDATE users SET `adminEmail`='$a', `email1`='$e1', `email2`='$e2', `email3`='$e3' WHERE `userID`='1'";
    
    // $2y$10$prs2O2elGMJHCEIAgOCs.uvMJ9UObZc/HHtw/TJJ0/q59zbZOGy2C

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


    $mysqli->close();
?>