<?php
require_once($_SERVER['DOCUMENT_ROOT'] . '/sys/db.php');

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "selid")
    $lo_id = $paramValue;
}

$dal = new DAL();

$sql = "SELECT LO.id, OS.id as operationspatialunit_id, LO.id AS selectlot_name, " .
       "LO.lottype_id, LO.rationale, LO.lotinterpret_id " .
       "FROM lot LO, spatialunitlot SL, operationspatialunit OS " .
       "WHERE LO.id = $lo_id AND SL.lot_id = LO.id " .
       "AND OS.id = SL.operationspatialunit_id LIMIT 1 " ; 
$result = $dal->query($sql);
 
echo json_encode($result);

?>

