<?php

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

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "selectid")
    $os_id = $paramValue;
}

$dal = new DAL();

$sql = "SELECT OS.id, 0 AS fkid, " .
       "SU.name,      '' AS name_text " .
       "FROM operationspatialunit OS, spatialunit SU " .
       "WHERE OS.id = $os_id AND SU.id = OS.spatialunit_id LIMIT 1 ";
$result = $dal->query($sql);

echo json_encode($result);

?>
