<?php

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

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

$conexion=$config['conexion'];

$conn = pg_connect($conexion);

$sql="update zonas set seleccion='-'";
$result = pg_query($conn,$sql);

$sql="update zonas set mili_seg_togo=$intentos,senszona=$senszona where zona='$zona' and ras='$ras'";
$result = pg_query($conn,$sql);

pg_query($conn,'commit;');
pg_close($conn);
echo 'OK';

?>