<?php

    include("../../classes/database.class.php");
    include("../../classes/sensorModel.class.php");
    include("../../classes/sensorController.class.php");
    
    $sensor1 = $_GET['sensor1'];
    $sensor2 = $_GET["sensor2"];

    $modelo = new SensorController($sensor1, $sensor2);
	$resposta = $modelo->createSensor();

    if($resposta["onoff"] == 0){
        echo "Desligar";
        if($resposta["prensa"] == 1){
            echo "\nEstampar";
        } else if($resposta["prensa"] == 0){
            echo "\nLivree";
        }
    } else if($resposta["onoff"] == 1){
        echo "Ligar";
        if($resposta["prensa"] == 1){
            echo "\nEstampar";
        } else if($resposta["prensa"] == 0){
            echo "\nLivree";
        }
    }