<?php

//$file = fopen("log.txt", "w");   /// BORRAR LOG
//fwrite($file, "Error $error". PHP_EOL);
//fclose($file);

$ras=$_GET["ras"];
$zona=$_GET["zona"];
$config = require ('config.php');
$conexion=$config['conexion']; 

$conn = pg_connect($conexion);

$sql="delete from zonas where ras='$ras' and zona='$zona'";
$result = pg_query($conn,$sql);

$sql="delete from led where iddisplay = 'RAS$ras"."POS$zona'";
$result = pg_query($conn,$sql);

pg_close($conn);
echo 'OK';

?>