<?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 control where control='LOADZONA'";
$result = pg_query($conn,$sql);

$sql="insert into control (control,zona,ras) values('LOADZONA','$zona','$ras')";
$result = pg_query($conn,$sql);

pg_close($conn);
echo 'OK';

?>